diff --git a/DependencyInjection/CmfTreeBrowserExtension.php b/DependencyInjection/CmfTreeBrowserExtension.php
index 13eb9ca..b32abba 100644
--- a/DependencyInjection/CmfTreeBrowserExtension.php
+++ b/DependencyInjection/CmfTreeBrowserExtension.php
@@ -11,8 +11,10 @@
namespace Symfony\Cmf\Bundle\TreeBrowserBundle\DependencyInjection;
+use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
+use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
class CmfTreeBrowserExtension extends Extension implements PrependExtensionInterface
@@ -40,5 +42,10 @@ public function prepend(ContainerBuilder $container)
*/
public function load(array $configs, ContainerBuilder $container)
{
+ $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
+ $loader->load('services.xml');
+
+ $config = $this->processConfiguration(new Configuration(), $configs);
+ $container->setParameter('cmf_tree_browser.description.icon_map', $config['icons']);
}
}
diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php
new file mode 100644
index 0000000..ea63a7d
--- /dev/null
+++ b/DependencyInjection/Configuration.php
@@ -0,0 +1,36 @@
+root('cmf_tree_browser');
+
+ $rootNode
+ ->children()
+ ->arrayNode('icons')
+ ->useAttributeAsKey('class')
+ ->prototype('scalar')->end()
+ ->info('A mapping of classes/interfaces and icon classes or icon URLs used by the tree browser.')
+ ->end()
+ ->end()
+ ;
+
+ return $treeBuilder;
+ }
+}
diff --git a/Description/IconEnhancer.php b/Description/IconEnhancer.php
new file mode 100644
index 0000000..49122a8
--- /dev/null
+++ b/Description/IconEnhancer.php
@@ -0,0 +1,67 @@
+
+ */
+class IconEnhancer implements DescriptionEnhancerInterface
+{
+ private $iconMap;
+ private $classMap = [];
+
+ public function __construct(array $iconMap)
+ {
+ $this->iconMap = $iconMap;
+ }
+
+ public function enhance(Description $description)
+ {
+ $class = get_class($description->getResource()->getPayload());
+ if (isset($this->classMap[$class])) {
+ $class = $this->classMap[$class];
+ }
+
+ $description->set('icon', $this->iconMap[$class]);
+ }
+
+ public function supports(PuliResource $resource)
+ {
+ if (!$resource instanceof CmfResource) {
+ return false;
+ }
+
+ $payload = $resource->getPayload();
+ $payloadClass = get_class($payload);
+
+ if (isset($this->iconMap[$payloadClass]) || isset($this->classMap[$payloadClass])) {
+ return true;
+ }
+
+ foreach (array_keys($this->iconMap) as $class) {
+ if (is_a($payload, $class) || is_subclass_of($payload, $class)) {
+ $this->classMap[$payloadClass] = $class;
+
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/Resources/assets/js/adapter/fancytree.js b/Resources/assets/js/adapter/fancytree.js
index 6fe4214..f320b33 100644
--- a/Resources/assets/js/adapter/fancytree.js
+++ b/Resources/assets/js/adapter/fancytree.js
@@ -71,7 +71,6 @@ export class FancytreeAdapter {
this.$tree = $elem;
var actions = this.actions;
- var requestNode = this.requestNode;
var requestNodeToFancytreeNode = (requestNode) => {
if (requestNode.length === 0) {
return;
@@ -92,6 +91,10 @@ export class FancytreeAdapter {
this.pathKeyMap[fancytreeNode.refPath] = key;
+ if (requestNode.descriptors.hasOwnProperty('icon')) {
+ fancytreeNode.icon = requestNode.descriptors.icon;
+ }
+
for (let actionName in actions) {
var action = actions[actionName];
var url = action.url;
diff --git a/Resources/config/services.xml b/Resources/config/services.xml
new file mode 100644
index 0000000..ad25f04
--- /dev/null
+++ b/Resources/config/services.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ %cmf_tree_browser.description.icon_map%
+
+
+
+
+
+
diff --git a/Resources/public/js/cmf_tree_browser.fancytree.js b/Resources/public/js/cmf_tree_browser.fancytree.js
index 9d780b5..e1287f5 100644
--- a/Resources/public/js/cmf_tree_browser.fancytree.js
+++ b/Resources/public/js/cmf_tree_browser.fancytree.js
@@ -1,3 +1,3 @@
!function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var r=n(27),o=i(r),s=n(29);o.default.fn.cmfTree=function(e){e=o.default.extend({adapter:null,request:{load:null},actions:{}},e);var t=(0,o.default)(this),n=function(e){if("string"==typeof e)return(0,o.default)(e);if(e instanceof o.default)return e;throw"Cannot handle selector "+e+". You may want to pass a jQuery object or a jQuery selector."};if(!e.request.load)throw"cmfTree needs an AJAX URL to lazy load the tree, pass it using the `request.load` option.";e.adapter||(e.adapter=new s.FancytreeAdapter(e));var i=e.adapter;if(!i.bindToElement)throw"cmfTree adapters must have a bindToElement() method to specify the output element of the tree.";for(var r in e.actions)if(e.actions.hasOwnProperty(r)){if(!i.addAction)throw"The configured cmfTree adapter does not support actions, implement the addAction() method or use another adapter.";var a=e.actions[r];if(!a.url)throw'actions should have a url defined, "'+r+'" does not.';i.addAction(r,a.url,a.icon)}if(i.bindToElement(t),e.path_output){if(!i.bindToInput)throw"The configured cmfTree adapter does not support binding to an input field, implement the bindToInput() method or use another adapter.";i.bindToInput(n(e.path_output))}return i}},function(e,t,n){var i=n(43)("wks"),r=n(15),o=n(2).Symbol;e.exports=function(e){return i[e]||(i[e]=o&&o[e]||(o||r)("Symbol."+e))}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var i=n(4),r=n(23);e.exports=n(10)?function(e,t,n){return i.setDesc(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){var n=Object;e.exports={create:n.create,getProto:n.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:n.getOwnPropertyDescriptor,setDesc:n.defineProperty,setDescs:n.defineProperties,getKeys:n.keys,getNames:n.getOwnPropertyNames,getSymbols:n.getOwnPropertySymbols,each:[].forEach}},function(e,t){e.exports={}},function(e,t,n){var i=n(2),r=n(3),o=n(15)("src"),s="toString",a=Function[s],l=(""+a).split(s);n(7).inspectSource=function(e){return a.call(e)},(e.exports=function(e,t,n,s){"function"==typeof n&&(n.hasOwnProperty(o)||r(n,o,e[t]?""+e[t]:l.join(String(t))),n.hasOwnProperty("name")||r(n,"name",t)),e===i?e[t]=n:(s||delete e[t],r(e,t,n))})(Function.prototype,s,function(){return"function"==typeof this&&this[o]||a.call(this)})},function(e,t){var n=e.exports={version:"1.2.6"};"number"==typeof __e&&(__e=n)},function(e,t,n){var i=n(32);e.exports=function(e,t,n){if(i(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){e.exports=!n(20)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){"use strict";var i=n(41),r=n(19),o=n(6),s=n(3),a=n(11),l=n(5),c=n(39),d=n(14),u=n(4).getProto,h=n(1)("iterator"),f=!([].keys&&"next"in[].keys()),p="@@iterator",v="keys",y="values",g=function(){return this};e.exports=function(e,t,n,b,m,x,_){c(n,t,b);var k,N,w=function(e){if(!f&&e in E)return E[e];switch(e){case v:return function(){return new n(this,e)};case y:return function(){return new n(this,e)}}return function(){return new n(this,e)}},C=t+" Iterator",S=m==y,T=!1,E=e.prototype,P=E[h]||E[p]||m&&E[m],A=P||w(m);if(P){var F=u(A.call(new e));d(F,C,!0),!i&&a(E,p)&&s(F,h,g),S&&P.name!==y&&(T=!0,A=function(){return P.call(this)})}if(i&&!_||!f&&!T&&E[h]||s(E,h,A),l[t]=A,l[C]=g,m)if(k={values:S?A:w(y),keys:x?A:w(v),entries:S?w("entries"):A},_)for(N in k)N in E||o(E,N,k[N]);else r(r.P+r.F*(f||T),t,k);return k}},function(e,t,n){var i=n(4).setDesc,r=n(11),o=n(1)("toStringTag");e.exports=function(e,t,n){e&&!r(e=n?e:e.prototype,o)&&i(e,o,{configurable:!0,value:t})}},function(e,t){var n=0,i=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+i).toString(36))}},function(e,t,n){var i=n(12);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var i=n(18),r=n(1)("toStringTag"),o="Arguments"==i(function(){return arguments}());e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=(t=Object(e))[r])?n:o?i(t):"Object"==(s=i(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var i=n(2),r=n(7),o=n(3),s=n(6),a=n(8),l="prototype",c=function(e,t,n){var d,u,h,f,p=e&c.F,v=e&c.G,y=e&c.S,g=e&c.P,b=e&c.B,m=v?i:y?i[t]||(i[t]={}):(i[t]||{})[l],x=v?r:r[t]||(r[t]={}),_=x[l]||(x[l]={});v&&(n=t);for(d in n)u=!p&&m&&d in m,h=(u?m:n)[d],f=b&&u?a(h,i):g&&"function"==typeof h?a(Function.call,h):h,m&&!u&&s(m,d,h),x[d]!=h&&o(x,d,f),g&&_[d]!=h&&(_[d]=h)};i.core=r,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,e.exports=c},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var i=n(8),r=n(38),o=n(37),s=n(16),a=n(46),l=n(47);e.exports=function(e,t,n,c){var d,u,h,f=l(e),p=i(n,c,t?2:1),v=0;if("function"!=typeof f)throw TypeError(e+" is not iterable!");if(o(f))for(d=a(e.length);d>v;v++)t?p(s(u=e[v])[0],u[1]):p(e[v]);else for(h=f.call(e);!(u=h.next()).done;)r(h,p,u.value,t)}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var i=n(6);e.exports=function(e,t){for(var n in t)i(e,n,t[n]);return e}},function(e,t){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError(n+": use the 'new' operator!");return e}},function(e,t){var n=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:n)(e)}},function(e,t){e.exports=jQuery},function(e,t){!function(e,t,n,i){"use strict";function r(t,n){t||(n=n?": "+n:"",e.error("Fancytree assertion failed"+n))}function o(e,n){var i,r,o=t.console?t.console[e]:null;if(o)try{o.apply(t.console,n)}catch(e){for(r="",i=0;ia;return!0}function l(e,t,n,i,r){var o=function(){var n=t[e],o=i[e],s=t.ext[r],a=function(){return n.apply(t,arguments)},l=function(e){return n.apply(t,e)};return function(){var e=t._local,n=t._super,i=t._superApply;try{return t._local=s,t._super=a,t._superApply=l,o.apply(t,arguments)}finally{t._local=e,t._super=n,t._superApply=i}}}();return o}function c(t,n,i,r){for(var o in i)"function"==typeof i[o]?"function"==typeof t[o]?t[o]=l(o,t,n,i,r):"_"===o.charAt(0)?t.ext[r][o]=l(o,t,n,i,r):e.error("Could not override tree."+o+". Use prefix '_' to create tree."+r+"._"+o):"options"!==o&&(t.ext[r][o]=i[o])}function d(t,n){return t===i?e.Deferred(function(){this.resolve()}).promise():e.Deferred(function(){this.resolveWith(t,n)}).promise()}function u(t,n){return t===i?e.Deferred(function(){this.reject()}).promise():e.Deferred(function(){this.rejectWith(t,n)}).promise()}function h(e,t){return function(){e.resolveWith(t)}}function f(t){var n=e.extend({},t.data()),i=n.json;return delete n.fancytree,delete n.uiFancytree,i&&(delete n.json,n=e.extend(n,i)),n}function p(e){return(""+e).replace(w,function(e){return T[e]})}function v(e){return(""+e).replace(C,function(e){return T[e]})}function y(e){return e=e.toLowerCase(),function(t){return t.title.toLowerCase().indexOf(e)>=0}}function g(e){var t=new RegExp("^"+e,"i");return function(e){return t.test(e.title)}}function b(t,n){var i,o,s,a;for(this.parent=t,this.tree=t.tree,this.ul=null,this.li=null,this.statusNodeType=null,this._isLoading=!1,this._error=null,this.data={},i=0,o=j.length;iul.fancytree-container").remove();var n,r={tree:this};this.rootNode=new b(r,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,n=e("
",{class:"ui-fancytree fancytree-container fancytree-plain"}).appendTo(this.$div),this.$container=n,this.rootNode.ul=n[0],null==this.options.debugLevel&&(this.options.debugLevel=k.debugLevel),this.$container.attr("tabindex",this.options.tabindex),this.options.rtl&&this.$container.attr("DIR","RTL").addClass("fancytree-rtl"),this.options.aria&&(this.$container.attr("role","tree"),1!==this.options.selectMode&&this.$container.attr("aria-multiselectable",!0))}if(e.ui&&e.ui.fancytree)return void e.ui.fancytree.warn("Fancytree: ignored duplicate include");var x,_,k=null,N=new RegExp(/\.|\//),w=/[&<>"'\/]/g,C=/[<>"'\/]/g,S="$recursive_request",T={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},E={16:!0,17:!0,18:!0},P={8:"backspace",9:"tab",10:"return",13:"return",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},A={0:"",1:"left",2:"middle",3:"right"},F="active expanded focus folder hideCheckbox lazy selected unselectable".split(" "),L={},j="expanded extraClasses folder hideCheckbox icon key lazy refKey selected statusNodeType title tooltip unselectable".split(" "),O={},H={},M={active:!0,children:!0,data:!0,focus:!0};for(x=0;x=0,"insertBefore must be an existing child"),this.children.splice.apply(this.children,[s,0].concat(l))),(!this.parent||this.parent.ul||this.tr)&&this.render(),3===this.tree.options.selectMode&&this.fixSelection3FromEndNodes(),this.triggerModifyChild("add",1===l.length?l[0]:null),a},addClass:function(e){return this.toggleClass(e,!0)},addNode:function(e,t){switch(t!==i&&"over"!==t||(t="child"),t){case"after":return this.getParent().addChildren(e,this.getNextSibling());case"before":return this.getParent().addChildren(e,this);case"firstChild":var n=this.children?this.children[0]:null;return this.addChildren(e,n);case"child":case"over":return this.addChildren(e)}r(!1,"Invalid mode: "+t)},addPagingNode:function(t,n){var i,r;if(n=n||"child",t===!1){for(i=this.children.length-1;i>=0;i--)r=this.children[i],"paging"===r.statusNodeType&&this.removeChild(r);return void(this.partload=!1)}return t=e.extend({title:this.tree.options.strings.moreData,statusNodeType:"paging",icon:!1},t),this.partload=!0,this.addNode(t,n)},appendSibling:function(e){return this.addNode(e,"after")},applyPatch:function(t){if(null===t)return this.remove(),d(this);var n,i,r,o={children:!0,expanded:!0,parent:!0};for(n in t)r=t[n],o[n]||e.isFunction(r)||(O[n]?this[n]=r:this.data[n]=r);return t.hasOwnProperty("children")&&(this.removeChildren(),t.children&&this._setChildren(t.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),i=t.hasOwnProperty("expanded")?this.setExpanded(t.expanded):d(this)},collapseSiblings:function(){return this.tree._callHook("nodeCollapseSiblings",this)},copyTo:function(e,t,n){return e.addNode(this.toDict(!0,n),t)},countChildren:function(e){var t,n,i,r=this.children;if(!r)return 0;if(i=r.length,e!==!1)for(t=0,n=i;t=2&&(Array.prototype.unshift.call(arguments,this.toString()),o("log",arguments))},discard:function(){return this.warn("FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."),this.resetLazy()},discardMarkup:function(e){var t=e?"nodeRemoveMarkup":"nodeRemoveChildMarkup";this.tree._callHook(t,this)},findAll:function(t){t=e.isFunction(t)?t:y(t);var n=[];return this.visit(function(e){t(e)&&n.push(e)}),n},findFirst:function(t){t=e.isFunction(t)?t:y(t);var n=null;return this.visit(function(e){if(t(e))return n=e,!1}),n},_changeSelectStatusAttrs:function(e){var t=!1;switch(e){case!1:t=this.selected||this.partsel,this.selected=!1,this.partsel=!1;break;case!0:t=!this.selected||!this.partsel,this.selected=!0,this.partsel=!0;break;case i:t=this.selected||!this.partsel,this.selected=!1,this.partsel=!0;break;default:r(!1,"invalid state: "+e)}return t&&this.renderStatus(),t},fixSelection3AfterClick:function(){var e=this.isSelected();this.visit(function(t){t._changeSelectStatusAttrs(e)}),this.fixSelection3FromEndNodes()},fixSelection3FromEndNodes:function(){function e(t){var n,r,o,s,a,l,c,d=t.children;if(d&&d.length){for(l=!0,c=!1,n=0,r=d.length;n=1&&(Array.prototype.unshift.call(arguments,this.toString()),o("info",arguments))},isActive:function(){return this.tree.activeNode===this},isChildOf:function(e){return this.parent&&this.parent===e},isDescendantOf:function(e){if(!e||e.tree!==this.tree)return!1;for(var t=this.parent;t;){if(t===e)return!0;t=t.parent}return!1},isExpanded:function(){return!!this.expanded},isFirstSibling:function(){var e=this.parent;return!e||e.children[0]===this},isFolder:function(){return!!this.folder},isLastSibling:function(){var e=this.parent;return!e||e.children[e.children.length-1]===this},isLazy:function(){return!!this.lazy},isLoaded:function(){return!this.lazy||this.hasChildren()!==i},isLoading:function(){return!!this._isLoading},isRoot:function(){return this.isRootNode()},isPartload:function(){return!!this.partload},isRootNode:function(){return this.tree.rootNode===this},isSelected:function(){return!!this.selected},isStatusNode:function(){return!!this.statusNodeType},isPagingNode:function(){return"paging"===this.statusNodeType},isTopLevel:function(){return this.tree.rootNode===this.parent},isUndefined:function(){return this.hasChildren()===i},isVisible:function(){var e,t,n=this.getParentList(!1,!1);for(e=0,t=n.length;e=0;n--)r.push(s[n].setExpanded(!0,t));return e.when.apply(e,r).done(function(){c?i.scrollIntoView(l).done(function(){o.resolve()}):o.resolve()}),o.promise()},moveTo:function(t,n,o){n===i||"over"===n?n="child":"firstChild"===n&&(t.children&&t.children.length?(n="before",t=t.children[0]):n="child");var s,a=this.parent,l="child"===n?t:t.parent;if(this!==t){if(this.parent?l.isDescendantOf(this)&&e.error("Cannot move a node to its own descendant"):e.error("Cannot move system root"),l!==a&&a.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===l)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else s=e.inArray(this,this.parent.children),r(s>=0,"invalid source parent"),this.parent.children.splice(s,1);if(this.parent=l,l.hasChildren())switch(n){case"child":l.children.push(this);break;case"before":s=e.inArray(t,l.children),r(s>=0,"invalid target parent"),l.children.splice(s,0,this);break;case"after":s=e.inArray(t,l.children),r(s>=0,"invalid target parent"),l.children.splice(s+1,0,this);break;default:e.error("Invalid mode "+n)}else l.children=[this];o&&t.visit(o,!0),l===a?l.triggerModifyChild("move",this):l.triggerModifyChild("add",this),this.tree!==t.tree&&(this.warn("Cross-tree moveTo is experimantal!"),this.visit(function(e){e.tree=t.tree},!0)),a.isDescendantOf(l)||a.render(),l.isDescendantOf(a)||l===a||l.render()}},navigate:function(t,n){function i(i){if(i){try{i.makeVisible({scrollIntoView:!1})}catch(e){}return e(i.span).is(":visible")?n===!1?i.setFocus():i.setActive():(i.debug("Navigate: skipping hidden node"),void i.navigate(t,n))}}var r,o,s,a=!0,l=e.ui.keyCode,c=null;switch(t){case l.BACKSPACE:this.parent&&this.parent.parent&&(s=i(this.parent));break;case l.HOME:this.tree.visit(function(t){if(e(t.span).is(":visible"))return s=i(t),!1});break;case l.END:this.tree.visit(function(t){e(t.span).is(":visible")&&(s=t)}),s&&(s=i(s));break;case l.LEFT:this.expanded?(this.setExpanded(!1),s=i(this)):this.parent&&this.parent.parent&&(s=i(this.parent));break;case l.RIGHT:this.expanded||!this.children&&!this.lazy?this.children&&this.children.length&&(s=i(this.children[0])):(this.setExpanded(),s=i(this));break;case l.UP:for(c=this.getPrevSibling();c&&!e(c.span).is(":visible");)c=c.getPrevSibling();for(;c&&c.expanded&&c.children&&c.children.length;)c=c.children[c.children.length-1];!c&&this.parent&&this.parent.parent&&(c=this.parent),s=i(c);break;case l.DOWN:if(this.expanded&&this.children&&this.children.length)c=this.children[0];else for(o=this.getParentList(!1,!0),r=o.length-1;r>=0;r--){for(c=o[r].getNextSibling();c&&!e(c.span).is(":visible");)c=c.getNextSibling();if(c)break}s=i(c);break;default:a=!1}return s||d()},remove:function(){return this.parent.removeChild(this)},removeChild:function(e){return this.tree._callHook("nodeRemoveChild",this,e)},removeChildren:function(){return this.tree._callHook("nodeRemoveChildren",this)},removeClass:function(e){return this.toggleClass(e,!1)},render:function(e,t){return this.tree._callHook("nodeRender",this,e,t)},renderTitle:function(){return this.tree._callHook("nodeRenderTitle",this)},renderStatus:function(){return this.tree._callHook("nodeRenderStatus",this)},replaceWith:function(t){var n,i=this.parent,o=e.inArray(this,i.children),s=this;return r(this.isPagingNode(),"replaceWith() currently requires a paging status node"),n=this.tree._callHook("nodeLoadChildren",this,t),n.done(function(e){var t=s.children;for(x=0;x_+x-m&&(C=c+y-x+m,w&&(r(w.isRootNode()||e(w.span).is(":visible"),"topNode must be visible"),li?1:-1},r.sort(e),t)for(n=0,i=r.length;n=0,n=n===i?!o:!!n)o||(u+=r+" ",c=!0);else for(;u.indexOf(" "+r+" ")>-1;)u=u.replace(" "+r+" "," ");return this.extraClasses=e.trim(u),c},toggleExpanded:function(){return this.tree._callHook("nodeToggleExpanded",this)},toggleSelected:function(){return this.tree._callHook("nodeToggleSelected",this)},toString:function(){return""},triggerModifyChild:function(t,n,i){var r,o=this.tree.options.modifyChild;o&&(n&&n.parent!==this&&e.error("childNode "+n+" is not a child of "+this),r={node:this,tree:this.tree,operation:t,childNode:n||null},i&&e.extend(r,i),o({type:"modifyChild"},r))},triggerModify:function(e,t){this.parent.triggerModifyChild(e,this,t)},visit:function(e,t){var n,i,r=!0,o=this.children;if(t===!0&&(r=e(this),r===!1||"skip"===r))return r;if(o)for(n=0,i=o.length;n=2&&(Array.prototype.unshift.call(arguments,this.toString()),o("log",arguments))},enableUpdate:function(e){return e=e!==!1,!!this._enableUpdate==!!e?e:(this._enableUpdate=e,e?(this.debug("enableUpdate(true): redraw ",this._dirtyRoots),this.render()):this.debug("enableUpdate(false)..."),!e)},findAll:function(e){return this.rootNode.findAll(e)},findFirst:function(e){return this.rootNode.findFirst(e)},findNextNode:function(t,n,i){var r=null,o=n.parent.children,s=null,a=function(e,t,n){var i,r,o=e.children,s=o.length,l=o[t];if(l&&n(l)===!1)return!1;if(l&&l.children&&l.expanded&&a(l,0,n)===!1)return!1;for(i=t+1;i",{type:"checkbox",name:s,value:t.key,checked:!0}))}i=i||{};var o,s="string"==typeof t?t:"ft_"+this._id+"[]",a="string"==typeof n?n:"ft_"+this._id+"_active",l="fancytree_result_"+this._id,c=e("#"+l),d=3===this.options.selectMode&&i.stopOnParents!==!1;c.length?c.empty():c=e("
",{id:l}).hide().insertAfter(this.$container),n!==!1&&this.activeNode&&c.append(e("",{type:"radio",name:a,value:this.activeNode.key,checked:!0})),i.filter?this.visit(function(e){var t=i.filter(e);return"skip"===t?t:void(t!==!1&&r(e))}):t!==!1&&(o=this.getSelectedNodes(d),e.each(o,function(e,t){r(t)}))},getActiveNode:function(){return this.activeNode},getFirstChild:function(){return this.rootNode.getFirstChild()},getFocusNode:function(){return this.focusNode},getNodeByKey:function(e,t){var i,r;return!t&&(i=n.getElementById(this.options.idPrefix+e))?i.ftnode?i.ftnode:null:(t=t||this.rootNode,r=null,t.visit(function(t){if(t.key===e)return r=t,!1},!0),r)},getRootNode:function(){return this.rootNode;
-},getSelectedNodes:function(e){return this.rootNode.getSelectedNodes(e)},hasFocus:function(){return!!this._hasFocus},info:function(e){this.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),o("info",arguments))},loadKeyPath:function(t,n,r){function o(e,t,i){n.call(g,t,"loading"),t.load().done(function(){g.loadKeyPath.call(g,u[e],n,t).always(h(i,g))}).fail(function(r){g.warn("loadKeyPath: error loading: "+e+" (parent: "+p+")"),n.call(g,t,"error"),i.reject()})}var s,a,l,c,d,u,f,p,v,y=this.options.keyPathSeparator,g=this;for(n=n||e.noop,e.isArray(t)||(t=[t]),u={},l=0;l"},_triggerNodeEvent:function(e,t,n,r){var o=this._makeHookContext(t,n,r),s=this.widget._trigger(e,n,o);return s!==!1&&o.result!==i?o.result:s},_triggerTreeEvent:function(e,t,n){var r=this._makeHookContext(this,t,n),o=this.widget._trigger(e,t,r);return o!==!1&&r.result!==i?r.result:o},visit:function(e){return this.rootNode.visit(e,!1)},warn:function(e){Array.prototype.unshift.call(arguments,this.toString()),o("warn",arguments)}},e.extend(m.prototype,{nodeClick:function(e){var t,n,i=e.targetType,r=e.node;if("expander"===i){if(r.isLoading())return void r.debug("Got 2nd click while loading: ignored");this._callHook("nodeToggleExpanded",e)}else if("checkbox"===i)this._callHook("nodeToggleSelected",e),e.options.focusOnSelect&&this._callHook("nodeSetFocus",e,!0);else{if(n=!1,t=!0,r.folder)switch(e.options.clickFolderMode){case 2:n=!0,t=!1;break;case 3:t=!0,n=!0}t&&(this.nodeSetFocus(e),this._callHook("nodeSetActive",e,!0)),n&&this._callHook("nodeToggleExpanded",e)}},nodeCollapseSiblings:function(e,t){var n,i,r,o=e.node;if(o.parent)for(n=o.parent.children,i=0,r=n.length;i500&&(l.lastQuicksearchTerm=""),l.lastQuicksearchTime=i,l.lastQuicksearchTerm+=u,n=l.findNextNode(l.lastQuicksearchTerm,l.getActiveNode()),n&&n.setActive(),void s.preventDefault();switch(k.eventToString(s)){case"+":case"=":l.nodeSetExpanded(t,!0);break;case"-":l.nodeSetExpanded(t,!1);break;case"space":a.isPagingNode()?l._triggerNodeEvent("clickPaging",t,s):c.checkbox?l.nodeToggleSelected(t):l.nodeSetActive(t,!0);break;case"return":l.nodeSetActive(t,!0);break;case"home":case"end":case"backspace":case"left":case"right":case"up":case"down":r=a.navigate(s.which,v,!0);break;default:p=!1}p&&s.preventDefault()},nodeLoadChildren:function(t,n){var i,o,s,a=t.tree,l=t.node,c=(new Date).getTime();return e.isFunction(n)&&(n=n.call(a,{type:"source"},t),r(!e.isFunction(n),"source callback must not return another function")),n.url&&(l._requestId&&l.warn("Recursive load request #"+c+" while #"+l._requestId+" is pending."),i=e.extend({},t.options.ajax,n),l._requestId=c,i.debugDelay?(o=i.debugDelay,e.isArray(o)&&(o=o[0]+Math.random()*(o[1]-o[0])),l.warn("nodeLoadChildren waiting debugDelay "+Math.round(o)+" ms ..."),i.debugDelay=!1,s=e.Deferred(function(t){setTimeout(function(){e.ajax(i).done(function(){t.resolveWith(this,arguments)}).fail(function(){t.rejectWith(this,arguments)})},o)})):s=e.ajax(i),n=new e.Deferred,s.done(function(i,r,o){var s,d;if("json"!==this.dataType&&"jsonp"!==this.dataType||"string"!=typeof i||e.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),l._requestId&&l._requestId>c)return void n.rejectWith(this,[S]);if(t.options.postProcess){try{d=a._triggerNodeEvent("postProcess",t,t.originalEvent,{response:i,error:null,dataType:this.dataType})}catch(e){d={error:e,message:""+e,details:"postProcess failed"}}if(d.error)return s=e.isPlainObject(d.error)?d.error:{message:d.error},s=a._makeHookContext(l,null,s),void n.rejectWith(this,[s]);i=e.isArray(d)?d:i}else i&&i.hasOwnProperty("d")&&t.options.enableAspx&&(i="string"==typeof i.d?e.parseJSON(i.d):i.d);n.resolveWith(this,[i])}).fail(function(e,t,i){var r=a._makeHookContext(l,null,{error:e,args:Array.prototype.slice.call(arguments),message:i,details:e.status+": "+i});n.rejectWith(this,[r])})),e.isFunction(n.then)&&e.isFunction(n.catch)&&(s=n,n=new e.Deferred,s.then(function(e){n.resolve(e)},function(e){n.reject(e)})),e.isFunction(n.promise)&&(a.nodeSetStatus(t,"loading"),n.done(function(e){a.nodeSetStatus(t,"ok"),l._requestId=null}).fail(function(e){var n;return e===S?void l.warn("Ignored response for obsolete load request #"+c+" (expected #"+l._requestId+")"):(e.node&&e.error&&e.message?n=e:(n=a._makeHookContext(l,null,{error:e,args:Array.prototype.slice.call(arguments),message:e?e.message||e.toString():""}),"[object Object]"===n.message&&(n.message="")),l.warn("Load children failed ("+n.message+")",n),void(a._triggerNodeEvent("loadError",n,null)!==!1&&a.nodeSetStatus(t,"error",n.message,n.details)))})),e.when(n).done(function(t){var n;e.isPlainObject(t)&&(r(l.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),r(e.isArray(t.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),n=t,t=t.children,delete n.children,e.extend(a.data,n)),r(e.isArray(t),"expected array of children"),l._setChildren(t),a._triggerNodeEvent("loadChildren",l)})},nodeLoadKeyPath:function(e,t){},nodeRemoveChild:function(t,n){var i,o=t.node,s=e.extend({},t,{node:n}),a=o.children;return 1===a.length?(r(n===a[0],"invalid single child"),this.nodeRemoveChildren(t)):(this.activeNode&&(n===this.activeNode||this.activeNode.isDescendantOf(n))&&this.activeNode.setActive(!1),this.focusNode&&(n===this.focusNode||this.focusNode.isDescendantOf(n))&&(this.focusNode=null),this.nodeRemoveMarkup(s),this.nodeRemoveChildren(s),i=e.inArray(n,a),r(i>=0,"invalid child"),o.triggerModifyChild("remove",n),n.visit(function(e){e.parent=null},!0),this._callHook("treeRegisterNode",this,!1,n),void a.splice(i,1))},nodeRemoveChildMarkup:function(t){var n=t.node;n.ul&&(n.isRootNode()?e(n.ul).empty():(e(n.ul).remove(),n.ul=null),n.visit(function(e){e.li=e.ul=null}))},nodeRemoveChildren:function(t){var n,i=t.tree,r=t.node,o=r.children;o&&(this.activeNode&&this.activeNode.isDescendantOf(r)&&this.activeNode.setActive(!1),this.focusNode&&this.focusNode.isDescendantOf(r)&&(this.focusNode=null),this.nodeRemoveChildMarkup(t),n=e.extend({},t),r.triggerModifyChild("remove",null),r.visit(function(e){e.parent=null,i._callHook("treeRegisterNode",i,!1,e)}),r.lazy?r.children=[]:r.children=null,r.isRootNode()||(r.expanded=!1),this.nodeRenderStatus(t))},nodeRemoveMarkup:function(t){var n=t.node;n.li&&(e(n.li).remove(),n.li=null),this.nodeRemoveChildMarkup(t)},nodeRender:function(t,i,o,s,a){var l,c,d,u,h,f,p,v=t.node,y=t.tree,g=t.options,b=g.aria,m=!1,x=v.parent,_=!x,k=v.children,N=null;if(y._enableUpdate!==!1&&(_||x.ul)){if(r(_||x.ul,"parent UL must exist"),_||(v.li&&(i||v.li.parentNode!==v.parent.ul)&&(v.li.parentNode===v.parent.ul?N=v.li.nextSibling:this.debug("Unlinking "+v+" (must be child of "+v.parent+")"),this.nodeRemoveMarkup(t)),v.li?this.nodeRenderStatus(t):(m=!0,v.li=n.createElement("li"),v.li.ftnode=v,v.key&&g.generateIds&&(v.li.id=g.idPrefix+v.key),v.span=n.createElement("span"),v.span.className="fancytree-node",b&&e(v.li).attr("aria-labelledby","ftal_"+g.idPrefix+v.key),v.li.appendChild(v.span),this.nodeRenderTitle(t),g.createNode&&g.createNode.call(y,{type:"createNode"},t)),g.renderNode&&g.renderNode.call(y,{type:"renderNode"},t)),k){if(_||v.expanded||o===!0){for(v.ul||(v.ul=n.createElement("ul"),(s!==!0||a)&&v.expanded||(v.ul.style.display="none"),b&&e(v.ul).attr("role","group"),v.li?v.li.appendChild(v.ul):v.tree.$div.append(v.ul)),u=0,h=k.length;u1&&(f?g.push(""):g.push(""))):f?g.push(""):g.push(""),h.checkbox&&d.hideCheckbox!==!0&&!d.isStatusNode()&&(f?g.push(""):g.push("")),d.data.iconClass!==i&&(d.icon?e.error("'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead"):(d.warn("'iconClass' node option is deprecated since v2.14.0: use 'icon' instead"),d.icon=d.data.iconClass)),e.isFunction(h.icon)?(o=h.icon.call(u,{type:"icon"},t),null==o&&(o=d.icon)):o=null!=d.icon?d.icon:h.icon,null==o?o=!0:"boolean"!=typeof o&&(o=""+o),o!==!1&&(a=f?" role='img'":"","string"==typeof o?N.test(o)?(o="/"===o.charAt(0)?o:(h.imagePath||"")+o,g.push("")):g.push(""):g.push("")),s="",h.renderTitle&&(s=h.renderTitle.call(u,{type:"renderTitle"},t)||""),s||(d.tooltip?c=d.tooltip:h.tooltip&&(c=h.tooltip===!0?d.title:h.tooltip.call(u,d)),c=c?" title='"+v(c)+"'":"",r=f?" id='ftal_"+h.idPrefix+d.key+"'":"",a=f?" role='treeitem'":"",l=h.titlesTabbable?" tabindex='0'":"",s=""+(h.escapeTitles?p(d.title):d.title)+""),g.push(s),d.span.innerHTML=g.join(""),this.nodeRenderStatus(t),h.enhanceTitle&&(t.$title=e(">span.fancytree-title",d.span),s=h.enhanceTitle.call(u,{type:"enhanceTitle"},t)||""))},nodeRenderStatus:function(t){var n=t.node,i=t.tree,r=t.options,o=n.hasChildren(),s=n.isLastSibling(),a=r.aria,l=e(n.span).find(".fancytree-title"),c=r._classNames,d=[],u=n[i.statusClassPropName];u&&i._enableUpdate!==!1&&(d.push(c.node),i.activeNode===n&&d.push(c.active),i.focusNode===n&&d.push(c.focused),n.expanded?(d.push(c.expanded),a&&l.attr("aria-expanded",!0)):a&&(o?l.attr("aria-expanded",!1):l.removeAttr("aria-expanded")),n.folder&&d.push(c.folder),o!==!1&&d.push(c.hasChildren),s&&d.push(c.lastsib),n.lazy&&null==n.children&&d.push(c.lazy),n.partload&&d.push(c.partload),n.partsel&&d.push(c.partsel),n.unselectable&&d.push(c.unselectable),n._isLoading&&d.push(c.loading),n._error&&d.push(c.error),n.statusNodeType&&d.push(c.statusNodePrefix+n.statusNodeType),n.selected?(d.push(c.selected),a&&l.attr("aria-selected",!0)):a&&l.attr("aria-selected",!1),n.extraClasses&&d.push(n.extraClasses),o===!1?d.push(c.combinedExpanderPrefix+"n"+(s?"l":"")):d.push(c.combinedExpanderPrefix+(n.expanded?"e":"c")+(n.lazy&&null==n.children?"d":"")+(s?"l":"")),d.push(c.combinedIconPrefix+(n.expanded?"e":"c")+(n.folder?"f":"")),u.className=d.join(" "),n.li&&(n.li.className=s?c.lastsib:""))},nodeSetActive:function(t,n,i){i=i||{};var o,s=t.node,a=t.tree,l=t.options,c=i.noEvents===!0,h=i.noFocus===!0,f=s===a.activeNode;return n=n!==!1,f===n?d(s):n&&!c&&this._triggerNodeEvent("beforeActivate",s,t.originalEvent)===!1?u(s,["rejected"]):(n?(a.activeNode&&(r(a.activeNode!==s,"node was active (inconsistency)"),o=e.extend({},t,{node:a.activeNode}),a.nodeSetActive(o,!1),r(null===a.activeNode,"deactivate was out of sync?")),l.activeVisible&&s.makeVisible({scrollIntoView:h&&null==a.focusNode}),a.activeNode=s,a.nodeRenderStatus(t),h||a.nodeSetFocus(t),c||a._triggerNodeEvent("activate",s,t.originalEvent)):(r(a.activeNode===s,"node was not active (inconsistency)"),a.activeNode=null,this.nodeRenderStatus(t),c||t.tree._triggerNodeEvent("deactivate",s,t.originalEvent)),d(s))},nodeSetExpanded:function(t,n,r){r=r||{};var o,s,a,l,c,h,f=t.node,p=t.tree,v=t.options,y=r.noAnimation===!0,g=r.noEvents===!0;if(n=n!==!1,f.expanded&&n||!f.expanded&&!n)return d(f);if(n&&!f.lazy&&!f.hasChildren())return d(f);if(!n&&f.getLevel()ul.fancytree-container").empty(),t.rootNode.children=null},treeCreate:function(e){},treeDestroy:function(e){this.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("ui-helper-hidden")},treeInit:function(e){this.treeLoad(e)},treeLoad:function(t,n){var i,o,s,a,l=t.tree,c=t.widget.element,d=e.extend({},t,{node:this.rootNode});if(l.rootNode.children&&this.treeClear(t),n=n||this.options.source)"string"==typeof n&&e.error("Not implemented");else switch(o=c.data("type")||"html"){case"html":s=c.find(">ul:first"),s.addClass("ui-fancytree-source ui-helper-hidden"),n=e.ui.fancytree.parseHtml(s),this.data=e.extend(this.data,f(s));break;case"json":n=e.parseJSON(c.text()),c.contents().filter(function(){return 3===this.nodeType}).remove(),e.isPlainObject(n)&&(r(e.isArray(n.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),i=n,n=n.children,delete i.children,e.extend(l.data,i));break;default:e.error("Invalid data-type: "+o)}return a=this.nodeLoadChildren(d,n).done(function(){l.render(),3===t.options.selectMode&&l.rootNode.fixSelection3FromEndNodes(),l.activeNode&&l.options.activeVisible&&l.activeNode.makeVisible(),l._triggerTreeEvent("init",null,{status:!0})}).fail(function(){l.render(),l._triggerTreeEvent("init",null,{status:!1})})},treeRegisterNode:function(e,t,n){},treeSetFocus:function(t,n,i){n=n!==!1,n!==this.hasFocus()&&(this._hasFocus=n,!n&&this.focusNode?this.focusNode.setFocus(!1):!n||i&&i.calledByNode||e(this.$container).focus(),this.$container.toggleClass("fancytree-treefocus",n),this._triggerTreeEvent(n?"focusTree":"blurTree"),n&&!this.activeNode&&this.getFirstChild()&&this.getFirstChild().setFocus())},treeSetOption:function(t,n,i){var r=t.tree,o=!0,s=!1;switch(n){case"aria":case"checkbox":case"icon":case"minExpandLevel":case"tabindex":r._callHook("treeCreate",r),s=!0;break;case"escapeTitles":case"tooltip":s=!0;break;case"rtl":i===!1?r.$container.attr("DIR",null).removeClass("fancytree-rtl"):r.$container.attr("DIR","RTL").addClass("fancytree-rtl"),s=!0;break;case"source":o=!1,r._callHook("treeLoad",r,i),s=!0}r.debug("set option "+n+"="+i+" <"+typeof i+">"),o&&(this.widget._super?this.widget._super.call(this.widget,n,i):e.Widget.prototype._setOption.call(this.widget,n,i)),s&&r.render(!0,!1)}}),e.widget("ui.fancytree",{options:{activeVisible:!0,ajax:{type:"GET",cache:!1,dataType:"json"},aria:!1,autoActivate:!0,autoCollapse:!1,autoScroll:!1,checkbox:!1,clickFolderMode:4,debugLevel:null,disabled:!1,enableAspx:!0,escapeTitles:!1,extensions:[],toggleEffect:{effect:"blind",options:{direction:"vertical",scale:"box"},duration:200},generateIds:!1,icon:!0,idPrefix:"ft_",focusOnSelect:!1,keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,quicksearch:!1,rtl:!1,scrollOfs:{top:0,bottom:0},scrollParent:null,selectMode:2,strings:{loading:"Loading…",loadError:"Load error!",moreData:"More…",noData:"No data."},tabindex:"0",titlesTabbable:!1,tooltip:!1,_classNames:{node:"fancytree-node",folder:"fancytree-folder",combinedExpanderPrefix:"fancytree-exp-",combinedIconPrefix:"fancytree-ico-",hasChildren:"fancytree-has-children",active:"fancytree-active",selected:"fancytree-selected",expanded:"fancytree-expanded",lazy:"fancytree-lazy",focused:"fancytree-focused",partload:"fancytree-partload",partsel:"fancytree-partsel",unselectable:"fancytree-unselectable",lastsib:"fancytree-lastsib",loading:"fancytree-loading",error:"fancytree-error",statusNodePrefix:"fancytree-statusnode-"},lazyLoad:null,postProcess:null},_create:function(){this.tree=new m(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul:first");var t,n,o,s=this.options,a=s.extensions,l=this.tree;for(o=0;o=2&&o("log",arguments)},error:function(e){o("error",arguments)},escapeHtml:p,fixPositionOptions:function(t){if((t.offset||(""+t.my+t.at).indexOf("%")>=0)&&e.error("expected new position syntax (but '%' is not supported)"),!e.ui.fancytree.jquerySupports.positionMyOfs){var n=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.my),i=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.at),r=(n[2]?+n[2]:0)+(i[2]?+i[2]:0),o=(n[4]?+n[4]:0)+(i[4]?+i[4]:0);t=e.extend({},t,{my:n[1]+" "+n[3],at:i[1]+" "+i[3]}),(r||o)&&(t.offset=""+r+" "+o)}return t},getEventTargetType:function(e){return this.getEventTarget(e).type},getEventTarget:function(t){var n=t&&t.target?t.target.className:"",r={node:this.getNode(t.target),type:i};return/\bfancytree-title\b/.test(n)?r.type="title":/\bfancytree-expander\b/.test(n)?r.type=r.node.hasChildren()===!1?"prefix":"expander":/\bfancytree-checkbox\b/.test(n)||/\bfancytree-radio\b/.test(n)?r.type="checkbox":/\bfancytree-icon\b/.test(n)?r.type="icon":/\bfancytree-node\b/.test(n)?r.type="title":t&&t.target&&e(t.target).closest(".fancytree-title").length&&(r.type="title"),r},getNode:function(e){if(e instanceof b)return e;for(e.selector!==i?e=e[0]:e.originalEvent!==i&&(e=e.target);e;){if(e.ftnode)return e.ftnode;e=e.parentNode}return null},getTree:function(t){var n;return t instanceof m?t:(t===i&&(t=0),"number"==typeof t?t=e(".fancytree-container").eq(t):"string"==typeof t?t=e(t).eq(0):t.selector!==i?t=t.eq(0):t.originalEvent!==i&&(t=e(t.target)),t=t.closest(":ui-fancytree"),n=t.data("ui-fancytree")||t.data("fancytree"),n?n.tree:null)},eventToString:function(e){var t=e.which,n=e.type,i=[];return e.altKey&&i.push("alt"),e.ctrlKey&&i.push("ctrl"),e.metaKey&&i.push("meta"),e.shiftKey&&i.push("shift"),"click"===n||"dblclick"===n?i.push(A[e.button]+n):E[t]||i.push(P[t]||String.fromCharCode(t).toLowerCase()),i.join("+")},info:function(t){e.ui.fancytree.debugLevel>=1&&o("info",arguments)},keyEventToString:function(e){return this.warn("keyEventToString() is deprecated: use eventToString()"),this.eventToString(e)},overrideMethod:function(t,n,i){var r,o=t[n]||e.noop;t[n]=function(){try{return r=this._super,this._super=o,i.apply(this,arguments)}finally{this._super=r}}},parseHtml:function(t){var n,r,o,s,a,l,c,d,u=t.find(">li"),h=[];return u.each(function(){var u,p,v=e(this),y=v.find(">span:first",this),g=y.length?null:v.find(">a:first"),b={tooltip:null,data:{}};for(y.length?b.title=y.html():g&&g.length?(b.title=g.html(),b.data.href=g.attr("href"),b.data.target=g.attr("target"),b.tooltip=g.attr("title")):(b.title=v.html(),a=b.title.search(/
=0&&(b.title=b.title.substring(0,a))),b.title=e.trim(b.title),s=0,l=F.length;sul:first"),t.length?b.children=e.ui.fancytree.parseHtml(t):b.children=b.lazy?i:null,h.push(b)}),h},registerExtension:function(t){r(null!=t.name,"extensions must have a `name` property."),r(null!=t.version,"extensions must have a `version` property."),e.ui.fancytree._extensions[t.name]=t},unescapeHtml:function(e){var t=n.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue},warn:function(e){o("warn",arguments)}})}(jQuery,window,document)},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){var n="?"===e.substr(0,1),i=n?e.substr(1):e;if(void 0===t[i]){if(n)return;throw'Attribute "'+props[prop]+'" does not exists'}return t[i]}Object.defineProperty(t,"__esModule",{value:!0}),t.FancytreeAdapter=void 0;var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var n=0;n
'},e),n=(0,o.default)("body");(0,o.default)(this).on("contextmenu",e.delegate,function(i){i.preventDefault();var r=(0,o.default)(this);t&&t.remove();var s=e.actions;if("function"==typeof s&&(s=s(r)),!1!==s&&!o.default.isEmptyObject(s)){t=function(){var t=(0,o.default)(e.wrapperTemplate),n=t.is("ul")?t:t.find("ul");for(var i in s){var r=s[i],a=(0,o.default)(function(){var t=e.actionTemplate;for(var n in r)r.hasOwnProperty(n)&&(t=t.replace("{{ "+n+" }}",r[n]));return t}());a.data("cmd",i),n.append(a)}return t}(),t.css({top:i.pageY,left:i.pageX}),n.append(t);var a=e.select;t.on("click","li",function(e){e.stopPropagation(),a(r,e)})}}),(0,o.default)("html").on("click",function(e){t&&t.remove()})}},function(e,t,n){n(50),n(51),n(52),n(49),e.exports=n(7).Map},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var i=n(1)("unscopables"),r=Array.prototype;void 0==r[i]&&n(3)(r,i,{}),e.exports=function(e){r[i][e]=!0}},function(e,t,n){"use strict";var i=n(4),r=n(3),o=n(24),s=n(8),a=n(25),l=n(9),c=n(21),d=n(13),u=n(22),h=n(15)("id"),f=n(11),p=n(12),v=n(42),y=n(10),g=Object.isExtensible||p,b=y?"_s":"size",m=0,x=function(e,t){if(!p(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!f(e,h)){if(!g(e))return"F";if(!t)return"E";r(e,h,++m)}return"O"+e[h]},_=function(e,t){var n,i=x(t);if("F"!==i)return e._i[i];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,r){var d=e(function(e,o){a(e,d,t),e._i=i.create(null),e._f=void 0,e._l=void 0,e[b]=0,void 0!=o&&c(o,n,e[r],e)});return o(d.prototype,{clear:function(){for(var e=this,t=e._i,n=e._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete t[n.i];e._f=e._l=void 0,e[b]=0},delete:function(e){var t=this,n=_(t,e);if(n){var i=n.n,r=n.p;delete t._i[n.i],n.r=!0,r&&(r.n=i),i&&(i.p=r),t._f==n&&(t._f=i),t._l==n&&(t._l=r),t[b]--}return!!n},forEach:function(e){for(var t,n=s(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.n:this._f;)for(n(t.v,t.k,this);t&&t.r;)t=t.p},has:function(e){return!!_(this,e)}}),y&&i.setDesc(d.prototype,"size",{get:function(){return l(this[b])}}),d},def:function(e,t,n){var i,r,o=_(e,t);return o?o.v=n:(e._l=o={i:r=x(t,!0),k:t,v:n,p:i=e._l,n:void 0,r:!1},e._f||(e._f=o),i&&(i.n=o),e[b]++,"F"!==r&&(e._i[r]=o)),e},getEntry:_,setStrong:function(e,t,n){d(e,t,function(e,t){this._t=e,this._k=t,this._l=void 0},function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?"keys"==t?u(0,n.k):"values"==t?u(0,n.v):u(0,[n.k,n.v]):(e._t=void 0,u(1))},n?"entries":"values",!n,!0),v(t)}}},function(e,t,n){"use strict";var i=n(2),r=n(19),o=n(6),s=n(24),a=n(21),l=n(25),c=n(12),d=n(20),u=n(40),h=n(14);e.exports=function(e,t,n,f,p,v){var y=i[e],g=y,b=p?"set":"add",m=g&&g.prototype,x={},_=function(e){var t=m[e];o(m,e,"delete"==e?function(e){return!(v&&!c(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(v&&!c(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return v&&!c(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof g&&(v||m.forEach&&!d(function(){(new g).entries().next()}))){var k,N=new g,w=N[b](v?{}:-0,1)!=N,C=d(function(){N.has(1)}),S=u(function(e){new g(e)});S||(g=t(function(t,n){l(t,g,e);var i=new y;return void 0!=n&&a(n,p,i[b],i),i}),g.prototype=m,m.constructor=g),v||N.forEach(function(e,t){k=1/t===-(1/0)}),(C||k)&&(_("delete"),_("has"),p&&_("get")),(k||w)&&_(b),v&&m.clear&&delete m.clear}else g=f.getConstructor(t,e,p,b),s(g.prototype,n);return h(g,e),x[e]=g,r(r.G+r.W+r.F*(g!=y),x),v||f.setStrong(g,e,p),g}},function(e,t,n){var i=n(18);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==i(e)?e.split(""):Object(e)}},function(e,t,n){var i=n(5),r=n(1)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[r]===e)}},function(e,t,n){var i=n(16);e.exports=function(e,t,n,r){try{return r?t(i(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&i(o.call(e)),t}}},function(e,t,n){"use strict";var i=n(4),r=n(23),o=n(14),s={};n(3)(s,n(1)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=i.create(s,{next:r(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var i=n(1)("iterator"),r=!1;try{var o=[7][i]();o.return=function(){r=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!r)return!1;var n=!1;try{var o=[7],s=o[i]();s.next=function(){return{done:n=!0}},o[i]=function(){return s},e(o)}catch(e){}return n}},function(e,t){e.exports=!1},function(e,t,n){"use strict";var i=n(2),r=n(4),o=n(10),s=n(1)("species");e.exports=function(e){var t=i[e];o&&t&&!t[s]&&r.setDesc(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){var i=n(2),r="__core-js_shared__",o=i[r]||(i[r]={});e.exports=function(e){return o[e]||(o[e]={})}},function(e,t,n){var i=n(26),r=n(9);e.exports=function(e){return function(t,n){var o,s,a=String(r(t)),l=i(n),c=a.length;return l<0||l>=c?e?"":void 0:(o=a.charCodeAt(l),o<55296||o>56319||l+1===c||(s=a.charCodeAt(l+1))<56320||s>57343?e?a.charAt(l):o:e?a.slice(l,l+2):(o-55296<<10)+(s-56320)+65536)}}},function(e,t,n){var i=n(36),r=n(9);e.exports=function(e){return i(r(e))}},function(e,t,n){var i=n(26),r=Math.min;e.exports=function(e){return e>0?r(i(e),9007199254740991):0}},function(e,t,n){var i=n(17),r=n(1)("iterator"),o=n(5);e.exports=n(7).getIteratorMethod=function(e){if(void 0!=e)return e[r]||e["@@iterator"]||o[i(e)]}},function(e,t,n){"use strict";var i=n(33),r=n(22),o=n(5),s=n(45);e.exports=n(13)(Array,"Array",function(e,t){this._t=s(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,r(1)):"keys"==t?r(0,n):"values"==t?r(0,e[n]):r(0,[n,e[n]])},"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(e,t,n){"use strict";var i=n(34);n(35)("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=i.getEntry(this,e);return t&&t.v},set:function(e,t){return i.def(this,0===e?0:e,t)}},i,!0)},function(e,t,n){"use strict";var i=n(17),r={};r[n(1)("toStringTag")]="z",r+""!="[object z]"&&n(6)(Object.prototype,"toString",function(){return"[object "+i(this)+"]"},!0)},function(e,t,n){"use strict";var i=n(44)(!0);n(13)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=i(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){n(48);var i=n(2),r=n(3),o=n(5),s=n(1)("iterator"),a=i.NodeList,l=i.HTMLCollection,c=a&&a.prototype,d=l&&l.prototype,u=o.NodeList=o.HTMLCollection=o.Array;c&&!c[s]&&r(c,s,u),d&&!d[s]&&r(d,s,u)},function(e,t){},function(e,t){}]);
\ No newline at end of file
+},getSelectedNodes:function(e){return this.rootNode.getSelectedNodes(e)},hasFocus:function(){return!!this._hasFocus},info:function(e){this.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),o("info",arguments))},loadKeyPath:function(t,n,r){function o(e,t,i){n.call(g,t,"loading"),t.load().done(function(){g.loadKeyPath.call(g,u[e],n,t).always(h(i,g))}).fail(function(r){g.warn("loadKeyPath: error loading: "+e+" (parent: "+p+")"),n.call(g,t,"error"),i.reject()})}var s,a,l,c,d,u,f,p,v,y=this.options.keyPathSeparator,g=this;for(n=n||e.noop,e.isArray(t)||(t=[t]),u={},l=0;l"},_triggerNodeEvent:function(e,t,n,r){var o=this._makeHookContext(t,n,r),s=this.widget._trigger(e,n,o);return s!==!1&&o.result!==i?o.result:s},_triggerTreeEvent:function(e,t,n){var r=this._makeHookContext(this,t,n),o=this.widget._trigger(e,t,r);return o!==!1&&r.result!==i?r.result:o},visit:function(e){return this.rootNode.visit(e,!1)},warn:function(e){Array.prototype.unshift.call(arguments,this.toString()),o("warn",arguments)}},e.extend(m.prototype,{nodeClick:function(e){var t,n,i=e.targetType,r=e.node;if("expander"===i){if(r.isLoading())return void r.debug("Got 2nd click while loading: ignored");this._callHook("nodeToggleExpanded",e)}else if("checkbox"===i)this._callHook("nodeToggleSelected",e),e.options.focusOnSelect&&this._callHook("nodeSetFocus",e,!0);else{if(n=!1,t=!0,r.folder)switch(e.options.clickFolderMode){case 2:n=!0,t=!1;break;case 3:t=!0,n=!0}t&&(this.nodeSetFocus(e),this._callHook("nodeSetActive",e,!0)),n&&this._callHook("nodeToggleExpanded",e)}},nodeCollapseSiblings:function(e,t){var n,i,r,o=e.node;if(o.parent)for(n=o.parent.children,i=0,r=n.length;i500&&(l.lastQuicksearchTerm=""),l.lastQuicksearchTime=i,l.lastQuicksearchTerm+=u,n=l.findNextNode(l.lastQuicksearchTerm,l.getActiveNode()),n&&n.setActive(),void s.preventDefault();switch(k.eventToString(s)){case"+":case"=":l.nodeSetExpanded(t,!0);break;case"-":l.nodeSetExpanded(t,!1);break;case"space":a.isPagingNode()?l._triggerNodeEvent("clickPaging",t,s):c.checkbox?l.nodeToggleSelected(t):l.nodeSetActive(t,!0);break;case"return":l.nodeSetActive(t,!0);break;case"home":case"end":case"backspace":case"left":case"right":case"up":case"down":r=a.navigate(s.which,v,!0);break;default:p=!1}p&&s.preventDefault()},nodeLoadChildren:function(t,n){var i,o,s,a=t.tree,l=t.node,c=(new Date).getTime();return e.isFunction(n)&&(n=n.call(a,{type:"source"},t),r(!e.isFunction(n),"source callback must not return another function")),n.url&&(l._requestId&&l.warn("Recursive load request #"+c+" while #"+l._requestId+" is pending."),i=e.extend({},t.options.ajax,n),l._requestId=c,i.debugDelay?(o=i.debugDelay,e.isArray(o)&&(o=o[0]+Math.random()*(o[1]-o[0])),l.warn("nodeLoadChildren waiting debugDelay "+Math.round(o)+" ms ..."),i.debugDelay=!1,s=e.Deferred(function(t){setTimeout(function(){e.ajax(i).done(function(){t.resolveWith(this,arguments)}).fail(function(){t.rejectWith(this,arguments)})},o)})):s=e.ajax(i),n=new e.Deferred,s.done(function(i,r,o){var s,d;if("json"!==this.dataType&&"jsonp"!==this.dataType||"string"!=typeof i||e.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),l._requestId&&l._requestId>c)return void n.rejectWith(this,[S]);if(t.options.postProcess){try{d=a._triggerNodeEvent("postProcess",t,t.originalEvent,{response:i,error:null,dataType:this.dataType})}catch(e){d={error:e,message:""+e,details:"postProcess failed"}}if(d.error)return s=e.isPlainObject(d.error)?d.error:{message:d.error},s=a._makeHookContext(l,null,s),void n.rejectWith(this,[s]);i=e.isArray(d)?d:i}else i&&i.hasOwnProperty("d")&&t.options.enableAspx&&(i="string"==typeof i.d?e.parseJSON(i.d):i.d);n.resolveWith(this,[i])}).fail(function(e,t,i){var r=a._makeHookContext(l,null,{error:e,args:Array.prototype.slice.call(arguments),message:i,details:e.status+": "+i});n.rejectWith(this,[r])})),e.isFunction(n.then)&&e.isFunction(n.catch)&&(s=n,n=new e.Deferred,s.then(function(e){n.resolve(e)},function(e){n.reject(e)})),e.isFunction(n.promise)&&(a.nodeSetStatus(t,"loading"),n.done(function(e){a.nodeSetStatus(t,"ok"),l._requestId=null}).fail(function(e){var n;return e===S?void l.warn("Ignored response for obsolete load request #"+c+" (expected #"+l._requestId+")"):(e.node&&e.error&&e.message?n=e:(n=a._makeHookContext(l,null,{error:e,args:Array.prototype.slice.call(arguments),message:e?e.message||e.toString():""}),"[object Object]"===n.message&&(n.message="")),l.warn("Load children failed ("+n.message+")",n),void(a._triggerNodeEvent("loadError",n,null)!==!1&&a.nodeSetStatus(t,"error",n.message,n.details)))})),e.when(n).done(function(t){var n;e.isPlainObject(t)&&(r(l.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),r(e.isArray(t.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),n=t,t=t.children,delete n.children,e.extend(a.data,n)),r(e.isArray(t),"expected array of children"),l._setChildren(t),a._triggerNodeEvent("loadChildren",l)})},nodeLoadKeyPath:function(e,t){},nodeRemoveChild:function(t,n){var i,o=t.node,s=e.extend({},t,{node:n}),a=o.children;return 1===a.length?(r(n===a[0],"invalid single child"),this.nodeRemoveChildren(t)):(this.activeNode&&(n===this.activeNode||this.activeNode.isDescendantOf(n))&&this.activeNode.setActive(!1),this.focusNode&&(n===this.focusNode||this.focusNode.isDescendantOf(n))&&(this.focusNode=null),this.nodeRemoveMarkup(s),this.nodeRemoveChildren(s),i=e.inArray(n,a),r(i>=0,"invalid child"),o.triggerModifyChild("remove",n),n.visit(function(e){e.parent=null},!0),this._callHook("treeRegisterNode",this,!1,n),void a.splice(i,1))},nodeRemoveChildMarkup:function(t){var n=t.node;n.ul&&(n.isRootNode()?e(n.ul).empty():(e(n.ul).remove(),n.ul=null),n.visit(function(e){e.li=e.ul=null}))},nodeRemoveChildren:function(t){var n,i=t.tree,r=t.node,o=r.children;o&&(this.activeNode&&this.activeNode.isDescendantOf(r)&&this.activeNode.setActive(!1),this.focusNode&&this.focusNode.isDescendantOf(r)&&(this.focusNode=null),this.nodeRemoveChildMarkup(t),n=e.extend({},t),r.triggerModifyChild("remove",null),r.visit(function(e){e.parent=null,i._callHook("treeRegisterNode",i,!1,e)}),r.lazy?r.children=[]:r.children=null,r.isRootNode()||(r.expanded=!1),this.nodeRenderStatus(t))},nodeRemoveMarkup:function(t){var n=t.node;n.li&&(e(n.li).remove(),n.li=null),this.nodeRemoveChildMarkup(t)},nodeRender:function(t,i,o,s,a){var l,c,d,u,h,f,p,v=t.node,y=t.tree,g=t.options,b=g.aria,m=!1,x=v.parent,_=!x,k=v.children,N=null;if(y._enableUpdate!==!1&&(_||x.ul)){if(r(_||x.ul,"parent UL must exist"),_||(v.li&&(i||v.li.parentNode!==v.parent.ul)&&(v.li.parentNode===v.parent.ul?N=v.li.nextSibling:this.debug("Unlinking "+v+" (must be child of "+v.parent+")"),this.nodeRemoveMarkup(t)),v.li?this.nodeRenderStatus(t):(m=!0,v.li=n.createElement("li"),v.li.ftnode=v,v.key&&g.generateIds&&(v.li.id=g.idPrefix+v.key),v.span=n.createElement("span"),v.span.className="fancytree-node",b&&e(v.li).attr("aria-labelledby","ftal_"+g.idPrefix+v.key),v.li.appendChild(v.span),this.nodeRenderTitle(t),g.createNode&&g.createNode.call(y,{type:"createNode"},t)),g.renderNode&&g.renderNode.call(y,{type:"renderNode"},t)),k){if(_||v.expanded||o===!0){for(v.ul||(v.ul=n.createElement("ul"),(s!==!0||a)&&v.expanded||(v.ul.style.display="none"),b&&e(v.ul).attr("role","group"),v.li?v.li.appendChild(v.ul):v.tree.$div.append(v.ul)),u=0,h=k.length;u1&&(f?g.push(""):g.push(""))):f?g.push(""):g.push(""),h.checkbox&&d.hideCheckbox!==!0&&!d.isStatusNode()&&(f?g.push(""):g.push("")),d.data.iconClass!==i&&(d.icon?e.error("'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead"):(d.warn("'iconClass' node option is deprecated since v2.14.0: use 'icon' instead"),d.icon=d.data.iconClass)),e.isFunction(h.icon)?(o=h.icon.call(u,{type:"icon"},t),null==o&&(o=d.icon)):o=null!=d.icon?d.icon:h.icon,null==o?o=!0:"boolean"!=typeof o&&(o=""+o),o!==!1&&(a=f?" role='img'":"","string"==typeof o?N.test(o)?(o="/"===o.charAt(0)?o:(h.imagePath||"")+o,g.push("")):g.push(""):g.push("")),s="",h.renderTitle&&(s=h.renderTitle.call(u,{type:"renderTitle"},t)||""),s||(d.tooltip?c=d.tooltip:h.tooltip&&(c=h.tooltip===!0?d.title:h.tooltip.call(u,d)),c=c?" title='"+v(c)+"'":"",r=f?" id='ftal_"+h.idPrefix+d.key+"'":"",a=f?" role='treeitem'":"",l=h.titlesTabbable?" tabindex='0'":"",s=""+(h.escapeTitles?p(d.title):d.title)+""),g.push(s),d.span.innerHTML=g.join(""),this.nodeRenderStatus(t),h.enhanceTitle&&(t.$title=e(">span.fancytree-title",d.span),s=h.enhanceTitle.call(u,{type:"enhanceTitle"},t)||""))},nodeRenderStatus:function(t){var n=t.node,i=t.tree,r=t.options,o=n.hasChildren(),s=n.isLastSibling(),a=r.aria,l=e(n.span).find(".fancytree-title"),c=r._classNames,d=[],u=n[i.statusClassPropName];u&&i._enableUpdate!==!1&&(d.push(c.node),i.activeNode===n&&d.push(c.active),i.focusNode===n&&d.push(c.focused),n.expanded?(d.push(c.expanded),a&&l.attr("aria-expanded",!0)):a&&(o?l.attr("aria-expanded",!1):l.removeAttr("aria-expanded")),n.folder&&d.push(c.folder),o!==!1&&d.push(c.hasChildren),s&&d.push(c.lastsib),n.lazy&&null==n.children&&d.push(c.lazy),n.partload&&d.push(c.partload),n.partsel&&d.push(c.partsel),n.unselectable&&d.push(c.unselectable),n._isLoading&&d.push(c.loading),n._error&&d.push(c.error),n.statusNodeType&&d.push(c.statusNodePrefix+n.statusNodeType),n.selected?(d.push(c.selected),a&&l.attr("aria-selected",!0)):a&&l.attr("aria-selected",!1),n.extraClasses&&d.push(n.extraClasses),o===!1?d.push(c.combinedExpanderPrefix+"n"+(s?"l":"")):d.push(c.combinedExpanderPrefix+(n.expanded?"e":"c")+(n.lazy&&null==n.children?"d":"")+(s?"l":"")),d.push(c.combinedIconPrefix+(n.expanded?"e":"c")+(n.folder?"f":"")),u.className=d.join(" "),n.li&&(n.li.className=s?c.lastsib:""))},nodeSetActive:function(t,n,i){i=i||{};var o,s=t.node,a=t.tree,l=t.options,c=i.noEvents===!0,h=i.noFocus===!0,f=s===a.activeNode;return n=n!==!1,f===n?d(s):n&&!c&&this._triggerNodeEvent("beforeActivate",s,t.originalEvent)===!1?u(s,["rejected"]):(n?(a.activeNode&&(r(a.activeNode!==s,"node was active (inconsistency)"),o=e.extend({},t,{node:a.activeNode}),a.nodeSetActive(o,!1),r(null===a.activeNode,"deactivate was out of sync?")),l.activeVisible&&s.makeVisible({scrollIntoView:h&&null==a.focusNode}),a.activeNode=s,a.nodeRenderStatus(t),h||a.nodeSetFocus(t),c||a._triggerNodeEvent("activate",s,t.originalEvent)):(r(a.activeNode===s,"node was not active (inconsistency)"),a.activeNode=null,this.nodeRenderStatus(t),c||t.tree._triggerNodeEvent("deactivate",s,t.originalEvent)),d(s))},nodeSetExpanded:function(t,n,r){r=r||{};var o,s,a,l,c,h,f=t.node,p=t.tree,v=t.options,y=r.noAnimation===!0,g=r.noEvents===!0;if(n=n!==!1,f.expanded&&n||!f.expanded&&!n)return d(f);if(n&&!f.lazy&&!f.hasChildren())return d(f);if(!n&&f.getLevel()ul.fancytree-container").empty(),t.rootNode.children=null},treeCreate:function(e){},treeDestroy:function(e){this.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("ui-helper-hidden")},treeInit:function(e){this.treeLoad(e)},treeLoad:function(t,n){var i,o,s,a,l=t.tree,c=t.widget.element,d=e.extend({},t,{node:this.rootNode});if(l.rootNode.children&&this.treeClear(t),n=n||this.options.source)"string"==typeof n&&e.error("Not implemented");else switch(o=c.data("type")||"html"){case"html":s=c.find(">ul:first"),s.addClass("ui-fancytree-source ui-helper-hidden"),n=e.ui.fancytree.parseHtml(s),this.data=e.extend(this.data,f(s));break;case"json":n=e.parseJSON(c.text()),c.contents().filter(function(){return 3===this.nodeType}).remove(),e.isPlainObject(n)&&(r(e.isArray(n.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),i=n,n=n.children,delete i.children,e.extend(l.data,i));break;default:e.error("Invalid data-type: "+o)}return a=this.nodeLoadChildren(d,n).done(function(){l.render(),3===t.options.selectMode&&l.rootNode.fixSelection3FromEndNodes(),l.activeNode&&l.options.activeVisible&&l.activeNode.makeVisible(),l._triggerTreeEvent("init",null,{status:!0})}).fail(function(){l.render(),l._triggerTreeEvent("init",null,{status:!1})})},treeRegisterNode:function(e,t,n){},treeSetFocus:function(t,n,i){n=n!==!1,n!==this.hasFocus()&&(this._hasFocus=n,!n&&this.focusNode?this.focusNode.setFocus(!1):!n||i&&i.calledByNode||e(this.$container).focus(),this.$container.toggleClass("fancytree-treefocus",n),this._triggerTreeEvent(n?"focusTree":"blurTree"),n&&!this.activeNode&&this.getFirstChild()&&this.getFirstChild().setFocus())},treeSetOption:function(t,n,i){var r=t.tree,o=!0,s=!1;switch(n){case"aria":case"checkbox":case"icon":case"minExpandLevel":case"tabindex":r._callHook("treeCreate",r),s=!0;break;case"escapeTitles":case"tooltip":s=!0;break;case"rtl":i===!1?r.$container.attr("DIR",null).removeClass("fancytree-rtl"):r.$container.attr("DIR","RTL").addClass("fancytree-rtl"),s=!0;break;case"source":o=!1,r._callHook("treeLoad",r,i),s=!0}r.debug("set option "+n+"="+i+" <"+typeof i+">"),o&&(this.widget._super?this.widget._super.call(this.widget,n,i):e.Widget.prototype._setOption.call(this.widget,n,i)),s&&r.render(!0,!1)}}),e.widget("ui.fancytree",{options:{activeVisible:!0,ajax:{type:"GET",cache:!1,dataType:"json"},aria:!1,autoActivate:!0,autoCollapse:!1,autoScroll:!1,checkbox:!1,clickFolderMode:4,debugLevel:null,disabled:!1,enableAspx:!0,escapeTitles:!1,extensions:[],toggleEffect:{effect:"blind",options:{direction:"vertical",scale:"box"},duration:200},generateIds:!1,icon:!0,idPrefix:"ft_",focusOnSelect:!1,keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,quicksearch:!1,rtl:!1,scrollOfs:{top:0,bottom:0},scrollParent:null,selectMode:2,strings:{loading:"Loading…",loadError:"Load error!",moreData:"More…",noData:"No data."},tabindex:"0",titlesTabbable:!1,tooltip:!1,_classNames:{node:"fancytree-node",folder:"fancytree-folder",combinedExpanderPrefix:"fancytree-exp-",combinedIconPrefix:"fancytree-ico-",hasChildren:"fancytree-has-children",active:"fancytree-active",selected:"fancytree-selected",expanded:"fancytree-expanded",lazy:"fancytree-lazy",focused:"fancytree-focused",partload:"fancytree-partload",partsel:"fancytree-partsel",unselectable:"fancytree-unselectable",lastsib:"fancytree-lastsib",loading:"fancytree-loading",error:"fancytree-error",statusNodePrefix:"fancytree-statusnode-"},lazyLoad:null,postProcess:null},_create:function(){this.tree=new m(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul:first");var t,n,o,s=this.options,a=s.extensions,l=this.tree;for(o=0;o=2&&o("log",arguments)},error:function(e){o("error",arguments)},escapeHtml:p,fixPositionOptions:function(t){if((t.offset||(""+t.my+t.at).indexOf("%")>=0)&&e.error("expected new position syntax (but '%' is not supported)"),!e.ui.fancytree.jquerySupports.positionMyOfs){var n=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.my),i=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.at),r=(n[2]?+n[2]:0)+(i[2]?+i[2]:0),o=(n[4]?+n[4]:0)+(i[4]?+i[4]:0);t=e.extend({},t,{my:n[1]+" "+n[3],at:i[1]+" "+i[3]}),(r||o)&&(t.offset=""+r+" "+o)}return t},getEventTargetType:function(e){return this.getEventTarget(e).type},getEventTarget:function(t){var n=t&&t.target?t.target.className:"",r={node:this.getNode(t.target),type:i};return/\bfancytree-title\b/.test(n)?r.type="title":/\bfancytree-expander\b/.test(n)?r.type=r.node.hasChildren()===!1?"prefix":"expander":/\bfancytree-checkbox\b/.test(n)||/\bfancytree-radio\b/.test(n)?r.type="checkbox":/\bfancytree-icon\b/.test(n)?r.type="icon":/\bfancytree-node\b/.test(n)?r.type="title":t&&t.target&&e(t.target).closest(".fancytree-title").length&&(r.type="title"),r},getNode:function(e){if(e instanceof b)return e;for(e.selector!==i?e=e[0]:e.originalEvent!==i&&(e=e.target);e;){if(e.ftnode)return e.ftnode;e=e.parentNode}return null},getTree:function(t){var n;return t instanceof m?t:(t===i&&(t=0),"number"==typeof t?t=e(".fancytree-container").eq(t):"string"==typeof t?t=e(t).eq(0):t.selector!==i?t=t.eq(0):t.originalEvent!==i&&(t=e(t.target)),t=t.closest(":ui-fancytree"),n=t.data("ui-fancytree")||t.data("fancytree"),n?n.tree:null)},eventToString:function(e){var t=e.which,n=e.type,i=[];return e.altKey&&i.push("alt"),e.ctrlKey&&i.push("ctrl"),e.metaKey&&i.push("meta"),e.shiftKey&&i.push("shift"),"click"===n||"dblclick"===n?i.push(A[e.button]+n):E[t]||i.push(P[t]||String.fromCharCode(t).toLowerCase()),i.join("+")},info:function(t){e.ui.fancytree.debugLevel>=1&&o("info",arguments)},keyEventToString:function(e){return this.warn("keyEventToString() is deprecated: use eventToString()"),this.eventToString(e)},overrideMethod:function(t,n,i){var r,o=t[n]||e.noop;t[n]=function(){try{return r=this._super,this._super=o,i.apply(this,arguments)}finally{this._super=r}}},parseHtml:function(t){var n,r,o,s,a,l,c,d,u=t.find(">li"),h=[];return u.each(function(){var u,p,v=e(this),y=v.find(">span:first",this),g=y.length?null:v.find(">a:first"),b={tooltip:null,data:{}};for(y.length?b.title=y.html():g&&g.length?(b.title=g.html(),b.data.href=g.attr("href"),b.data.target=g.attr("target"),b.tooltip=g.attr("title")):(b.title=v.html(),a=b.title.search(/
=0&&(b.title=b.title.substring(0,a))),b.title=e.trim(b.title),s=0,l=F.length;sul:first"),t.length?b.children=e.ui.fancytree.parseHtml(t):b.children=b.lazy?i:null,h.push(b)}),h},registerExtension:function(t){r(null!=t.name,"extensions must have a `name` property."),r(null!=t.version,"extensions must have a `version` property."),e.ui.fancytree._extensions[t.name]=t},unescapeHtml:function(e){var t=n.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue},warn:function(e){o("warn",arguments)}})}(jQuery,window,document)},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){var n="?"===e.substr(0,1),i=n?e.substr(1):e;if(void 0===t[i]){if(n)return;throw'Attribute "'+props[prop]+'" does not exists'}return t[i]}Object.defineProperty(t,"__esModule",{value:!0}),t.FancytreeAdapter=void 0;var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var n=0;n