function TooltipInit(){jQuery(".tooltip[title], .tooltip-arrow-down[title], .tooltip-arrow-up[title], .tooltip-image[title]").tooltip({track:!0,delay:100,showURL:!1,showBody:" - ",fade:250});jQuery(".show-next-as-tooltip").tooltip({bodyHandler:function(){return jQuery(this).next().html()},showURL:!1});jQuery(".tooltip-from-div").tooltip({bodyHandler:function(){return jQuery("#"+jQuery(this).attr("rel")).html()},showURL:!1})}var __slice;jQuery.cookie=function(n,t,i){var f,r,e,o,u,s;if(typeof t!="undefined"){i=i||{};t===null&&(t="",i.expires=-1);f="";i.expires&&(typeof i.expires=="number"||i.expires.toUTCString)&&(typeof i.expires=="number"?(r=new Date,r.setTime(r.getTime()+i.expires*864e5)):r=i.expires,f="; expires="+r.toUTCString());var h=i.path?"; path="+i.path:"",c=i.domain?"; domain="+i.domain:"",l=i.secure?"; secure":"";document.cookie=[n,"=",encodeURIComponent(t),f,h,c,l].join("")}else{if(e=null,document.cookie&&document.cookie!="")for(o=document.cookie.split(";"),u=0;u<o.length;u++)if(s=jQuery.trim(o[u]),s.substring(0,n.length+1)==n+"="){e=decodeURIComponent(s.substring(n.length+1));break}return e}};jQuery.globalcookie=function(n,t){var i=new jQuery.cookieobject;if(i.get(),typeof t!="undefined")i[n]=t,i.set();else if(typeof n!="undefined")return i[n]};jQuery.cookieobject=function(){return this.cookieID="ProRFx_Global_Cookie",this.set=function(n){var i="",f={cookieID:0,set:1,get:2},t,u,r;n=n||{};for(t in this)t in f||(this[t]===null&&(this[t]=""),i+=t+":"+this[t]+",");i=i.substring(0,i.length-1);u="";n.expires&&(typeof n.expires=="number"||n.expires.toUTCString)&&(typeof n.expires=="number"?(r=new Date,r.setTime(r.getTime()+n.expires*864e5)):r=n.expires,u="; expires="+r.toUTCString());var e=n.path?"; path="+n.path:"",o=n.domain?"; domain="+n.domain:"",s=n.secure?"; secure":"";return document.cookie=[this.cookieID,"=",encodeURIComponent(i),u,e,o,s].join(""),!0},this.get=function(){var cookieValue=null,cookies,cookie,properties,i,property;if(document.cookie&&document.cookie!=""){for(cookies=document.cookie.split(";"),i=0;i<cookies.length;i++)if(cookie=jQuery.trim(cookies[i]),cookie.substring(0,this.cookieID.length+1)==this.cookieID+"="){cookieValue=decodeURIComponent(cookie.substring(this.cookieID.length+1));break}if(cookieValue!=null)for(properties=cookieValue.split(","),i=0;i<properties.length;i++)property=properties[i].split(":"),eval('this["'+property[0]+'"]="'+property[1]+'"')}return!0},this},function(n){function l(i){t.parent||(t.parent=n('<div id="'+i.id+'"><div class="tph"><h3><\/h3><div class="body"><\/div><div class="url"><\/div><\/div><\/div>').appendTo(document.body).hide(),n.fn.bgiframe&&t.parent.bgiframe(),t.title=n("h3",t.parent),t.body=n("div.body",t.parent),t.url=n("div.url",t.parent))}function i(t){return n.data(t,"tooltip")}function a(t){i(this).delay?f=setTimeout(h,i(this).delay):h();s=!!i(this).track;n(document.body).bind("mousemove",u);u(t)}function v(){var u,e,f,s;if(!n.tooltip.blocked&&this!=r&&(this.tooltipText||i(this).bodyHandler)){if(r=this,o=this.tooltipText,i(this).bodyHandler)t.title.hide(),u=i(this).bodyHandler.call(this),u.nodeType||u.jquery?t.body.empty().append(u):t.body.html(u),t.body.show();else if(i(this).showBody){for(e=o.split(i(this).showBody),t.title.html(e.shift()).show(),t.body.empty(),f=0;s=e[f];f++)f>0&&t.body.append("<br/>"),t.body.append(s);t.body.hideWhenEmpty()}else t.title.html(o).show(),t.body.hide();i(this).showURL&&n(this).url()?t.url.html(n(this).url().replace("http://","")).show():t.url.hide();t.parent.addClass(i(this).extraClass);i(this).fixPNG&&t.parent.fixPNG();a.apply(this,arguments)}}function h(){f=null;e&&n.fn.bgiframe||!i(r).fade?t.parent.show():t.parent.is(":animated")?t.parent.stop().show().fadeTo(i(r).fade,r.tOpacity):t.parent.is(":visible")?t.parent.fadeTo(i(r).fade,r.tOpacity):t.parent.fadeIn(i(r).fade);u()}function u(f){var e,o,l,c,h;if(!n.tooltip.blocked&&(!f||f.target.tagName!="OPTION")){if(!s&&t.parent.is(":visible")&&n(document.body).unbind("mousemove",u),r==null){n(document.body).unbind("mousemove",u);return}t.parent.removeClass("viewport-right").removeClass("viewport-bottom");e=t.parent[0].offsetLeft;o=t.parent[0].offsetTop;f&&(e=f.pageX+i(r).left,o=f.pageY+i(r).top,l="auto",i(r).positionLeft&&(l=n(window).width()-e,e="auto"),t.parent.css({left:e,right:l,top:o}));c=y();h=t.parent[0];c.x+c.cx<h.offsetLeft+h.offsetWidth&&(e-=h.offsetWidth+20+i(r).left,t.parent.css({left:e+"px"}).addClass("viewport-right"));c.y+c.cy<h.offsetTop+h.offsetHeight&&(o-=h.offsetHeight+20+i(r).top,o<0&&(o=0+i(r).top),t.parent.css({top:o+"px"}).addClass("viewport-bottom"))}}function y(){return{x:n(window).scrollLeft(),y:n(window).scrollTop(),cx:n(window).width(),cy:n(window).height()}}function c(){function o(){t.parent.removeClass(u.extraClass).hide().css("opacity","")}if(!n.tooltip.blocked){f&&clearTimeout(f);r=null;var u=i(this);e&&n.fn.bgiframe||!u.fade?o():t.parent.is(":animated")?t.parent.stop().fadeTo(u.fade,0,o):t.parent.stop().fadeOut(u.fade,o);i(this).fixPNG&&t.parent.unfixPNG()}}var t={},r,o,f,e=n.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),s=!1;n.tooltip={blocked:!1,defaults:{delay:200,fade:!1,showURL:!0,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){n.tooltip.blocked=!n.tooltip.blocked}};n.fn.extend({tooltip:function(i){return i=n.extend({},n.tooltip.defaults,i),l(i),this.each(function(){n.data(this,"tooltip",i);this.tOpacity=t.parent.css("opacity");this.tooltipText=this.title;n(this).removeAttr("title");this.alt=""}).mouseover(v).mouseout(c).click(c)},fixPNG:e?function(){return this.each(function(){var t=n(this).css("backgroundImage");t.match(/^url\(["']?(.*\.png)["']?\)$/i)&&(t=RegExp.$1,n(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+t+"')"}).each(function(){var t=n(this).css("position");t!="absolute"&&t!="relative"&&n(this).css("position","relative")}))})}:function(){return this},unfixPNG:e?function(){return this.each(function(){n(this).css({filter:"",backgroundImage:""})})}:function(){return this},hideWhenEmpty:function(){return this.each(function(){n(this)[n(this).html()?"show":"hide"]()})},url:function(){return this.attr("href")||this.attr("src")}})}(jQuery);jQuery(function(){TooltipInit()});jQuery.fn.highlight=function(n){function t(n,i){var o=0,e,u,r;if(n.nodeType==3){if(e=n.data.toUpperCase().indexOf(i),e>=0){u=document.createElement("span");u.className="highlight";var f=n.splitText(e),h=f.splitText(i.length),s=f.cloneNode(!0);u.appendChild(s);f.parentNode.replaceChild(u,f);o=1}}else if(n.nodeType==1&&n.childNodes&&!/(script|style)/i.test(n.tagName))for(r=0;r<n.childNodes.length;++r)r+=t(n.childNodes[r],i);return o}return this.each(function(){t(this,n.toUpperCase())})};jQuery.fn.removeHighlight=function(){return this.find("span.highlight").each(function(){this.parentNode.firstChild.nodeName;with(this.parentNode)replaceChild(this.firstChild,this),normalize()}).end()};jQuery.highlight=function(n,t){n.trim()!=""&&jQuery.each(n.split(" "),function(n,i){$(t).highlight(i)})},function(n){n.Guid={};n.Guid.NewGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=Math.random()*16|0,i=n=="x"?t:t&3|8;return i.toString(16)})};n.Guid.Empty="00000000-0000-0000-0000-000000000000"}(jQuery),function(n,t){function c(n){return typeof n=="string"}function o(n){var t=b.call(arguments,1);return function(){return n.apply(this,t.concat(b.call(arguments)))}}function ht(n){return n.replace(/^[^#]*#?(.*)$/,"$1")}function ct(n){return n.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function ft(o,h,l,v,y){var k,p,b,d,g;return v!==i?(b=l.match(o?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/),g=b[3]||"",y===2&&c(v)?p=v.replace(o?rt:it,""):(d=r(b[2]),v=c(v)?r[o?u:f](v):v,p=y===2?v:y===1?n.extend({},v,d):n.extend({},d,v),p=s(p),o&&(p=p.replace(ut,a))),k=b[1]+(o?"#":p||!b[1]?"?":"")+p+g):k=h(l!==i?l:t[w][e]),k}function et(n,t,e){return t===i||typeof t=="boolean"?(e=t,t=s[n?u:f]()):t=c(t)?t.replace(n?rt:it,""):t,r(t,e)}function ot(t,r,u,f){return c(u)||typeof u=="object"||(f=u,u=r,r=i),this.each(function(){var e=n(this),i=r||g()[(this.nodeName||"").toLowerCase()]||"",o=i&&e.attr(i)||"";e.attr(i,s[t](o,u,f))})}var i,b=Array.prototype.slice,a=decodeURIComponent,s=n.param,h,r,v,y=n.bbq=n.bbq||{},k,d,g,nt=n.event.special,tt="hashchange",f="querystring",u="fragment",p="elemUrlAttr",w="location",e="href",l="src",it=/^.*\?|#.*$/g,rt=/^.*\#/,ut,st={};s[f]=o(ft,0,ct);s[u]=h=o(ft,1,ht);h.noEscape=function(t){t=t||"";var i=n.map(t.split(""),encodeURIComponent);ut=new RegExp(i.join("|"),"g")};h.noEscape(",/");n.deparam=r=function(t,r){var u={},f={"true":!0,"false":!1,"null":null};return n.each(t.replace(/\+/g," ").split("&"),function(t,e){var y=e.split("="),h=a(y[0]),o,v=u,l=0,s=h.split("]["),c=s.length-1;if(/\[/.test(s[0])&&/\]$/.test(s[c])?(s[c]=s[c].replace(/\]$/,""),s=s.shift().split("[").concat(s),c=s.length-1):c=0,y.length===2)if(o=a(y[1]),r&&(o=o&&!isNaN(o)?+o:o==="undefined"?i:f[o]!==i?f[o]:o),c)for(;l<=c;l++)h=s[l]===""?v.length:s[l],v=v[h]=l<c?v[h]||(s[l+1]&&isNaN(s[l+1])?{}:[]):o;else n.isArray(u[h])?u[h].push(o):u[h]=u[h]!==i?[u[h],o]:o;else h&&(u[h]=r?i:"")}),u};r[f]=o(et,0);r[u]=v=o(et,1);n[p]||(n[p]=function(t){return n.extend(st,t)})({a:e,base:e,iframe:l,img:l,input:l,form:"action",link:e,script:l});g=n[p];n.fn[f]=o(ot,f);n.fn[u]=o(ot,u);y.pushState=k=function(n,r){c(n)&&/^#/.test(n)&&r===i&&(r=2);var u=n!==i,f=h(t[w][e],u?n:{},u?r:2);t[w][e]=f+(/#/.test(f)?"":"#")};y.getState=d=function(n,t){return n===i||typeof n=="boolean"?v(n):v(t)[n]};y.removeState=function(t){var r={};t!==i&&(r=d(),n.each(n.isArray(t)?t:arguments,function(n,t){delete r[t]}));k(r,2)};nt[tt]=n.extend(nt[tt],{add:function(t){function e(n){var t=n[u]=h();n.getState=function(n,u){return n===i||typeof n=="boolean"?r(t,n):r(t,u)[n]};f.apply(this,arguments)}var f;if(n.isFunction(t))return f=t,e;f=t.handler;t.handler=e}})}(jQuery,this),function(n,t,i){function e(n){return n=n||t[u][f],n.replace(/^[^#]*#?(.*)$/,"$1")}var o,s=n.event.special,u="location",r="hashchange",f="href",a=n.browser,h=document.documentMode,c=a.msie&&(h===i||h<8),l="on"+r in t&&!c;n[r+"Delay"]=100;s[r]=n.extend(s[r],{setup:function(){if(l)return!1;n(o.start)},teardown:function(){if(l)return!1;n(o.stop)}});o=function(){function a(){o=l=function(n){return n};c&&(s=n('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow,l=function(){return e(s.document[u][f])},o=function(n,t){if(n!==t){var i=s.document;i.open().close();i[u].hash="#"+n}},o(e()))}var h={},i,s,o,l;return h.start=function(){if(!i){var s=e();o||a(),function h(){var a=e(),c=l(s);a!==s?(o(s=a,c),n(t).trigger(r)):c!==s&&(t[u][f]=t[u][f].replace(/#.*/,"")+"#"+c);i=setTimeout(h,n[r+"Delay"])}()}},h.stop=function(){s||(i&&clearTimeout(i),i=0)},h}()}(jQuery,this),function(n,t,i){function l(){h=t[f](function(){r.each(function(){var i=n(this),r=i.width(),u=i.height(),t=n.data(this,e);(r!==t.w||u!==t.h)&&i.trigger(s,[t.w=r,t.h=u])});l()},u[c])}var r=n([]),u=n.resize=n.extend(n.resize,{}),h,f="setTimeout",s="resize",e=s+"-special-event",c="delay",o="throttleWindow";u[c]=250;u[o]=!0;n.event.special[s]={setup:function(){if(!u[o]&&this[f])return!1;var t=n(this);r=r.add(t);n.data(this,e,{w:t.width(),h:t.height()});r.length===1&&l()},teardown:function(){if(!u[o]&&this[f])return!1;var t=n(this);r=r.not(t);t.removeData(e);r.length||clearTimeout(h)},add:function(t){function s(t,u,f){var o=n(this),s=n.data(this,e);s.w=u!==i?u:o.width();s.h=f!==i?f:o.height();r.apply(this,arguments)}if(!u[o]&&this[f])return!1;var r;if(n.isFunction(t))return r=t,s;r=t.handler;t.handler=s}}}(jQuery,this),function(n){n.extend(n.fn,{swapClass:function(n,t){var i=this.filter("."+n);return this.filter("."+t).removeClass(t).addClass(n),i.removeClass(n).addClass(t),this},replaceClass:function(n,t){return this.filter("."+n).removeClass(n).addClass(t).end()},hoverClass:function(t){return t=t||"hover",this.hover(function(){n(this).addClass(t)},function(){n(this).removeClass(t)})},heightToggle:function(t,i){t?this.animate({height:"toggle"},t,i):this.each(function(){n(this)[n(this).is(":hidden")?"show":"hide"]();i&&i.apply(this,arguments)})},heightHide:function(n,t){n?this.animate({height:"hide"},n,t):(this.hide(),t&&this.each(t))},prepareBranches:function(n){return n.prerendered||(this.filter(":last-child:not(ul)").addClass(t.last),this.filter((n.collapsed?"":"."+t.closed)+":not(."+t.open+")").find(">ul").hide()),this.filter(":has(>ul)")},applyClasses:function(i,r){this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(){r.apply(n(this).next())}).add(n("a",this)).hoverClass();i.prerendered||(this.filter(":has(>ul:hidden)").addClass(t.expandable).replaceClass(t.last,t.lastExpandable),this.not(":has(>ul:hidden)").addClass(t.collapsable).replaceClass(t.last,t.lastCollapsable),this.prepend('<div class="'+t.hitarea+'"/>').find("div."+t.hitarea).each(function(){var t="";n.each(n(this).parent().attr("class").split(" "),function(){t+=this+"-hitarea "});n(this).addClass(t)}));this.find("div."+t.hitarea).click(r)},treeview:function(i){function s(i,r){function u(r){return function(){return f.apply(n("div."+t.hitarea,i).filter(function(){return r?n(this).parent("."+r).length:!0})),!1}}n("a:eq(0)",r).click(u(t.collapsable));n("a:eq(1)",r).click(u(t.expandable));n("a:eq(2)",r).click(u())}function f(){n(this).parent().find(">.hitarea").swapClass(t.collapsableHitarea,t.expandableHitarea).swapClass(t.lastCollapsableHitarea,t.lastExpandableHitarea).end().swapClass(t.collapsable,t.expandable).swapClass(t.lastCollapsable,t.lastExpandable).find(">ul").heightToggle(i.animated,i.toggle);i.unique&&n(this).parent().siblings().find(">.hitarea").replaceClass(t.collapsableHitarea,t.expandableHitarea).replaceClass(t.lastCollapsableHitarea,t.lastExpandableHitarea).end().replaceClass(t.collapsable,t.expandable).replaceClass(t.lastCollapsable,t.lastExpandable).find(">ul").heightHide(i.animated,i.toggle)}function h(){var t=[];r.each(function(i,r){t[i]=n(r).is(":has(>ul:visible)")?1:0});n.cookie(i.cookieId,t.join(""))}function c(){var t=n.cookie(i.cookieId),u;t&&(u=t.split(""),r.each(function(t,i){n(i).find(">ul")[parseInt(u[t])?"show":"hide"]()}))}var o,r,e,u;if(i=n.extend({cookieId:"treeview"},i),i.add)return this.trigger("add",[i.add]);i.toggle&&(o=i.toggle,i.toggle=function(){return o.apply(n(this).parent()[0],arguments)});this.addClass("treeview");r=this.find("li").prepareBranches(i);switch(i.persist){case"cookie":e=i.toggle;i.toggle=function(){h();e&&e.apply(this,arguments)};c();break;case"location":u=this.find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase()});u.length&&u.addClass("selected").parents("ul, li").add(u.next()).show()}return r.applyClasses(i,f),i.control&&(s(this,i.control),n(i.control).show()),this.bind("add",function(r,u){n(u).prev().removeClass(t.last).removeClass(t.lastCollapsable).removeClass(t.lastExpandable).find(">.hitarea").removeClass(t.lastCollapsableHitarea).removeClass(t.lastExpandableHitarea);n(u).find("li").andSelf().prepareBranches(i).applyClasses(i,f)})}});var t=n.fn.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",last:"last",hitarea:"hitarea"};n.fn.Treeview=n.fn.treeview}(jQuery);!function(n){"use strict";"function"==typeof define&&define.amd?define(["jquery"],n):"undefined"!=typeof module&&module.exports?module.exports=n(require("jquery")):n(jQuery)}(function(n,t){"use strict";var s,o,h,c,e,a;if(!n.jstree){var y=0,u=!1,r=!1,f=!1,v=[],l=n("script:last").attr("src"),i=window.document;if(n.jstree={version:"3.3.4",defaults:{plugins:[]},plugins:{},path:l&&-1!==l.indexOf("/")?l.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g,root:"#"},n.jstree.create=function(t,i){var r=new n.jstree.core(++y),u=i;return i=n.extend(!0,{},n.jstree.defaults,i),u&&u.plugins&&(i.plugins=u.plugins),n.each(i.plugins,function(n,t){"core"!==n&&(r=r.plugin(t,i[t]))}),n(t).data("jstree",r),r.init(t,i),r},n.jstree.destroy=function(){n(".jstree:jstree").jstree("destroy");n(i).off(".jstree")},n.jstree.core=function(n){this._id=n;this._cnt=0;this._wrk=null;this._data={core:{themes:{name:!1,dots:!1,icons:!1,ellipsis:!1},selected:[],last_error:{},working:!1,worker_queue:[],focused:null}}},n.jstree.reference=function(t){var r=null,i=null;if(!t||!t.id||t.tagName&&t.nodeType||(t=t.id),!i||!i.length)try{i=n(t)}catch(u){}if(!i||!i.length)try{i=n("#"+t.replace(n.jstree.idregex,"\\$&"))}catch(u){}return i&&i.length&&(i=i.closest(".jstree")).length&&(i=i.data("jstree"))?r=i:n(".jstree").each(function(){var i=n(this).data("jstree");if(i&&i._model.data[t])return(r=i,!1)}),r},n.fn.jstree=function(i){var u="string"==typeof i,f=Array.prototype.slice.call(arguments,1),r=null;return i!==!0||this.length?(this.each(function(){var e=n.jstree.reference(this),o=u&&e?e[i]:null;return r=u&&o?o.apply(e,f):null,e||u||i!==t&&!n.isPlainObject(i)||n.jstree.create(this,i),(e&&!u||i===!0)&&(r=e||!1),null!==r&&r!==t?!1:void 0}),null!==r&&r!==t?r:this):!1},n.expr.pseudos.jstree=n.expr.createPseudo(function(){return function(i){return n(i).hasClass("jstree")&&n(i).data("jstree")!==t}}),n.jstree.defaults.core={data:!1,strings:!1,check_callback:!1,error:n.noop,animation:200,multiple:!0,themes:{name:!1,url:!1,dir:!1,dots:!0,icons:!0,ellipsis:!1,stripes:!1,variant:!1,responsive:!1},expand_selected_onload:!0,worker:!0,force_text:!1,dblclick_toggle:!0},n.jstree.core.prototype={plugin:function(t,i){var r=n.jstree.plugins[t];return r?(this._data[t]={},r.prototype=this,new r(i,this)):this},init:function(t,i){this._model={data:{},changed:[],force_full_redraw:!1,redraw_timeout:!1,default_state:{loaded:!0,opened:!1,selected:!1,disabled:!1}};this._model.data[n.jstree.root]={id:n.jstree.root,parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}};this.element=n(t).addClass("jstree jstree-"+this._id);this.settings=i;this._data.core.ready=!1;this._data.core.loaded=!1;this._data.core.rtl="rtl"===this.element.css("direction");this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl");this.element.attr("role","tree");this.settings.core.multiple&&this.element.attr("aria-multiselectable",!0);this.element.attr("tabindex")||this.element.attr("tabindex","0");this.bind();this.trigger("init");this._data.core.original_container_html=this.element.find(" > ul > li").clone(!0);this._data.core.original_container_html.find("li").addBack().contents().filter(function(){return 3===this.nodeType&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove();this.element.html("<ul class='jstree-container-ul jstree-children' role='group'><li id='j"+this._id+"_loading' class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='tree-item'><i class='jstree-icon jstree-ocl'><\/i><a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'><\/i>"+this.get_string("Loading ...")+"<\/a><\/li><\/ul>");this.element.attr("aria-activedescendant","j"+this._id+"_loading");this._data.core.li_height=this.get_container_ul().children("li").first().outerHeight()||24;this._data.core.node=this._create_prototype_node();this.trigger("loading");this.load_node(n.jstree.root)},destroy:function(n){if(this.trigger("destroy"),this._wrk)try{window.URL.revokeObjectURL(this._wrk);this._wrk=null}catch(t){}n||this.element.empty();this.teardown()},_create_prototype_node:function(){var r=i.createElement("LI"),n,t;return r.setAttribute("role","treeitem"),n=i.createElement("I"),n.className="jstree-icon jstree-ocl",n.setAttribute("role","presentation"),r.appendChild(n),n=i.createElement("A"),n.className="jstree-anchor",n.setAttribute("href","#"),n.setAttribute("tabindex","-1"),t=i.createElement("I"),t.className="jstree-icon jstree-themeicon",t.setAttribute("role","presentation"),n.appendChild(t),r.appendChild(n),n=t=null,r},teardown:function(){this.unbind();this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/gi,"")});this.element=null},bind:function(){var t="",r=null,u=0;this.element.on("dblclick.jstree",function(n){if(n.target.tagName&&"input"===n.target.tagName.toLowerCase())return!0;if(i.selection&&i.selection.empty)i.selection.empty();else if(window.getSelection){var t=window.getSelection();try{t.removeAllRanges();t.collapse()}catch(r){}}}).on("mousedown.jstree",n.proxy(function(n){n.target===this.element[0]&&(n.preventDefault(),u=+new Date)},this)).on("mousedown.jstree",".jstree-ocl",function(n){n.preventDefault()}).on("click.jstree",".jstree-ocl",n.proxy(function(n){this.toggle_node(n.target)},this)).on("dblclick.jstree",".jstree-anchor",n.proxy(function(n){return n.target.tagName&&"input"===n.target.tagName.toLowerCase()?!0:void(this.settings.core.dblclick_toggle&&this.toggle_node(n.target))},this)).on("click.jstree",".jstree-anchor",n.proxy(function(t){t.preventDefault();t.currentTarget!==i.activeElement&&n(t.currentTarget).focus();this.activate_node(t.currentTarget,t)},this)).on("keydown.jstree",".jstree-anchor",n.proxy(function(t){if(t.target.tagName&&"input"===t.target.tagName.toLowerCase()||32!==t.which&&13!==t.which&&(t.shiftKey||t.ctrlKey||t.altKey||t.metaKey))return!0;var i=null;switch(this._data.core.rtl&&(37===t.which?t.which=39:39===t.which&&(t.which=37)),t.which){case 32:t.ctrlKey&&(t.type="click",n(t.currentTarget).trigger(t));break;case 13:t.type="click";n(t.currentTarget).trigger(t);break;case 37:t.preventDefault();this.is_open(t.currentTarget)?this.close_node(t.currentTarget):(i=this.get_parent(t.currentTarget),i&&i.id!==n.jstree.root&&this.get_node(i,!0).children(".jstree-anchor").focus());break;case 38:t.preventDefault();i=this.get_prev_dom(t.currentTarget);i&&i.length&&i.children(".jstree-anchor").focus();break;case 39:t.preventDefault();this.is_closed(t.currentTarget)?this.open_node(t.currentTarget,function(n){this.get_node(n,!0).children(".jstree-anchor").focus()}):this.is_open(t.currentTarget)&&(i=this.get_node(t.currentTarget,!0).children(".jstree-children")[0],i&&n(this._firstChild(i)).children(".jstree-anchor").focus());break;case 40:t.preventDefault();i=this.get_next_dom(t.currentTarget);i&&i.length&&i.children(".jstree-anchor").focus();break;case 106:this.open_all();break;case 36:t.preventDefault();i=this._firstChild(this.get_container_ul()[0]);i&&n(i).children(".jstree-anchor").filter(":visible").focus();break;case 35:t.preventDefault();this.element.find(".jstree-anchor").filter(":visible").last().focus();break;case 113:t.preventDefault();this.edit(t.currentTarget)}},this)).on("load_node.jstree",n.proxy(function(t,i){i.status&&(i.node.id!==n.jstree.root||this._data.core.loaded||(this._data.core.loaded=!0,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.trigger("loaded")),this._data.core.ready||setTimeout(n.proxy(function(){if(this.element&&!this.get_container_ul().find(".jstree-loading").length){if(this._data.core.ready=!0,this._data.core.selected.length){if(this.settings.core.expand_selected_onload){for(var i=[],t=0,r=this._data.core.selected.length;r>t;t++)i=i.concat(this._model.data[this._data.core.selected[t]].parents);for(i=n.vakata.array_unique(i),t=0,r=i.length;r>t;t++)this.open_node(i[t],!1,0)}this.trigger("changed",{action:"ready",selected:this._data.core.selected})}this.trigger("ready")}},this),0))},this)).on("keypress.jstree",n.proxy(function(u){if(u.target.tagName&&"input"===u.target.tagName.toLowerCase())return!0;r&&clearTimeout(r);r=setTimeout(function(){t=""},500);var o=String.fromCharCode(u.which).toLowerCase(),e=this.element.find(".jstree-anchor").filter(":visible"),s=e.index(i.activeElement)||0,f=!1;if(t+=o,t.length>1){if(e.slice(s).each(n.proxy(function(i,r){if(0===n(r).text().toLowerCase().indexOf(t))return(n(r).focus(),f=!0,!1)},this)),f)return;if(e.slice(0,s).each(n.proxy(function(i,r){if(0===n(r).text().toLowerCase().indexOf(t))return(n(r).focus(),f=!0,!1)},this)),f)return}if(new RegExp("^"+o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+"+$").test(t)){if(e.slice(s+1).each(n.proxy(function(t,i){if(n(i).text().toLowerCase().charAt(0)===o)return(n(i).focus(),f=!0,!1)},this)),f)return;if(e.slice(0,s+1).each(n.proxy(function(t,i){if(n(i).text().toLowerCase().charAt(0)===o)return(n(i).focus(),f=!0,!1)},this)),f)return}},this)).on("init.jstree",n.proxy(function(){var n=this.settings.core.themes;this._data.core.themes.dots=n.dots;this._data.core.themes.stripes=n.stripes;this._data.core.themes.icons=n.icons;this._data.core.themes.ellipsis=n.ellipsis;this.set_theme(n.name||"default",n.url);this.set_theme_variant(n.variant)},this)).on("loading.jstree",n.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"]();this[this._data.core.themes.icons?"show_icons":"hide_icons"]();this[this._data.core.themes.stripes?"show_stripes":"hide_stripes"]();this[this._data.core.themes.ellipsis?"show_ellipsis":"hide_ellipsis"]()},this)).on("blur.jstree",".jstree-anchor",n.proxy(function(t){this._data.core.focused=null;n(t.currentTarget).filter(".jstree-hovered").mouseleave();this.element.attr("tabindex","0")},this)).on("focus.jstree",".jstree-anchor",n.proxy(function(t){var i=this.get_node(t.currentTarget);i&&i.id&&(this._data.core.focused=i.id);this.element.find(".jstree-hovered").not(t.currentTarget).mouseleave();n(t.currentTarget).mouseenter();this.element.attr("tabindex","-1")},this)).on("focus.jstree",n.proxy(function(){if(+new Date-u>500&&!this._data.core.focused){u=0;var n=this.get_node(this.element.attr("aria-activedescendant"),!0);n&&n.find("> .jstree-anchor").focus()}},this)).on("mouseenter.jstree",".jstree-anchor",n.proxy(function(n){this.hover_node(n.currentTarget)},this)).on("mouseleave.jstree",".jstree-anchor",n.proxy(function(n){this.dehover_node(n.currentTarget)},this))},unbind:function(){this.element.off(".jstree");n(i).off(".jstree-"+this._id)},trigger:function(n,t){t||(t={});t.instance=this;this.element.triggerHandler(n.replace(".jstree","")+".jstree",t)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children(".jstree-children").first()},get_string:function(t){var i=this.settings.core.strings;return n.isFunction(i)?i.call(this,t):i&&i[t]?i[t]:t},_firstChild:function(n){for(n=n?n.firstChild:null;null!==n&&1!==n.nodeType;)n=n.nextSibling;return n},_nextSibling:function(n){for(n=n?n.nextSibling:null;null!==n&&1!==n.nodeType;)n=n.nextSibling;return n},_previousSibling:function(n){for(n=n?n.previousSibling:null;null!==n&&1!==n.nodeType;)n=n.previousSibling;return n},get_node:function(t,i){t&&t.id&&(t=t.id);var r;try{if(this._model.data[t])t=this._model.data[t];else if("string"==typeof t&&this._model.data[t.replace(/^#/,"")])t=this._model.data[t.replace(/^#/,"")];else if("string"==typeof t&&(r=n("#"+t.replace(n.jstree.idregex,"\\$&"),this.element)).length&&this._model.data[r.closest(".jstree-node").attr("id")])t=this._model.data[r.closest(".jstree-node").attr("id")];else if((r=n(t,this.element)).length&&this._model.data[r.closest(".jstree-node").attr("id")])t=this._model.data[r.closest(".jstree-node").attr("id")];else{if(!(r=n(t,this.element)).length||!r.hasClass("jstree"))return!1;t=this._model.data[n.jstree.root]}return i&&(t=t.id===n.jstree.root?this.element:n("#"+t.id.replace(n.jstree.idregex,"\\$&"),this.element)),t}catch(u){return!1}},get_path:function(t,i,r){if(t=t.parents?t:this.get_node(t),!t||t.id===n.jstree.root||!t.parents)return!1;var f,e,u=[];for(u.push(r?t.id:t.text),f=0,e=t.parents.length;e>f;f++)u.push(r?t.parents[f]:this.get_text(t.parents[f]));return u=u.reverse().slice(1),i?u.join(i):u},get_next_dom:function(t,i){var r;if(t=this.get_node(t,!0),t[0]===this.element[0]){for(r=this._firstChild(this.get_container_ul()[0]);r&&0===r.offsetHeight;)r=this._nextSibling(r);return r?n(r):!1}if(!t||!t.length)return!1;if(i){r=t[0];do r=this._nextSibling(r);while(r&&0===r.offsetHeight);return r?n(r):!1}if(t.hasClass("jstree-open")){for(r=this._firstChild(t.children(".jstree-children")[0]);r&&0===r.offsetHeight;)r=this._nextSibling(r);if(null!==r)return n(r)}r=t[0];do r=this._nextSibling(r);while(r&&0===r.offsetHeight);return null!==r?n(r):t.parentsUntil(".jstree",".jstree-node").nextAll(".jstree-node:visible").first()},get_prev_dom:function(t,i){var r;if(t=this.get_node(t,!0),t[0]===this.element[0]){for(r=this.get_container_ul()[0].lastChild;r&&0===r.offsetHeight;)r=this._previousSibling(r);return r?n(r):!1}if(!t||!t.length)return!1;if(i){r=t[0];do r=this._previousSibling(r);while(r&&0===r.offsetHeight);return r?n(r):!1}r=t[0];do r=this._previousSibling(r);while(r&&0===r.offsetHeight);if(null!==r){for(t=n(r);t.hasClass("jstree-open");)t=t.children(".jstree-children").first().children(".jstree-node:visible:last");return t}return r=t[0].parentNode.parentNode,r&&r.className&&-1!==r.className.indexOf("jstree-node")?n(r):!1},get_parent:function(t){return t=this.get_node(t),t&&t.id!==n.jstree.root?t.parent:!1},get_children_dom:function(n){return n=this.get_node(n,!0),n[0]===this.element[0]?this.get_container_ul().children(".jstree-node"):n&&n.length?n.children(".jstree-children").children(".jstree-node"):!1},is_parent:function(n){return n=this.get_node(n),n&&(n.state.loaded===!1||n.children.length>0)},is_loaded:function(n){return n=this.get_node(n),n&&n.state.loaded},is_loading:function(n){return n=this.get_node(n),n&&n.state&&n.state.loading},is_open:function(n){return n=this.get_node(n),n&&n.state.opened},is_closed:function(n){return n=this.get_node(n),n&&this.is_parent(n)&&!n.state.opened},is_leaf:function(n){return!this.is_parent(n)},load_node:function(t,i){var r,e,u,o,f;if(n.isArray(t))return this._load_nodes(t.slice(),i),!0;if(t=this.get_node(t),!t)return i&&i.call(this,t,!1),!1;if(t.state.loaded){for(t.state.loaded=!1,u=0,o=t.parents.length;o>u;u++)this._model.data[t.parents[u]].children_d=n.vakata.array_filter(this._model.data[t.parents[u]].children_d,function(i){return-1===n.inArray(i,t.children_d)});for(r=0,e=t.children_d.length;e>r;r++)this._model.data[t.children_d[r]].state.selected&&(f=!0),delete this._model.data[t.children_d[r]];f&&(this._data.core.selected=n.vakata.array_filter(this._data.core.selected,function(i){return-1===n.inArray(i,t.children_d)}));t.children=[];t.children_d=[];f&&this.trigger("changed",{action:"load_node",node:t,selected:this._data.core.selected})}return t.state.failed=!1,t.state.loading=!0,this.get_node(t,!0).addClass("jstree-loading").attr("aria-busy",!0),this._load_node(t,n.proxy(function(n){t=this._model.data[t.id];t.state.loading=!1;t.state.loaded=n;t.state.failed=!t.state.loaded;for(var r=this.get_node(t,!0),u=0,f=0,e=this._model.data,o=!1,u=0,f=t.children.length;f>u;u++)if(e[t.children[u]]&&!e[t.children[u]].state.hidden){o=!0;break}t.state.loaded&&r&&r.length&&(r.removeClass("jstree-closed jstree-open jstree-leaf"),o?"#"!==t.id&&r.addClass(t.state.opened?"jstree-open":"jstree-closed"):r.addClass("jstree-leaf"));r.removeClass("jstree-loading").attr("aria-busy",!1);this.trigger("load_node",{node:t,status:n});i&&i.call(this,t,n)},this)),!0},_load_nodes:function(n,t,i,r){for(var o=!0,h=function(){this._load_nodes(n,t,!0)},f=this._model.data,s=[],u=0,e=n.length;e>u;u++)!f[n[u]]||(f[n[u]].state.loaded||f[n[u]].state.failed)&&(i||!r)||(this.is_loading(n[u])||this.load_node(n[u],h),o=!1);if(o){for(u=0,e=n.length;e>u;u++)f[n[u]]&&f[n[u]].state.loaded&&s.push(n[u]);t&&!t.done&&(t.call(this,s),t.done=!0)}},load_all:function(t,i){if(t||(t=n.jstree.root),t=this.get_node(t),!t)return!1;var f=[],e=this._model.data,u=e[t.id].children_d,r,o;for(t.state&&!t.state.loaded&&f.push(t.id),r=0,o=u.length;o>r;r++)e[u[r]]&&e[u[r]].state&&!e[u[r]].state.loaded&&f.push(u[r]);f.length?this._load_nodes(f,function(){this.load_all(t,i)}):(i&&i.call(this,t),this.trigger("load_all",{node:t}))},_load_node:function(t,i){var r=this.settings.core.data,f,u=function(){return 3!==this.nodeType&&8!==this.nodeType};return r?n.isFunction(r)?r.call(this,t,n.proxy(function(r){r===!1?i.call(this,!1):this["string"==typeof r?"_append_html_data":"_append_json_data"](t,"string"==typeof r?n(n.parseHTML(r)).filter(u):r,function(n){i.call(this,n)})},this)):"object"==typeof r?r.url?(r=n.extend(!0,{},r),n.isFunction(r.url)&&(r.url=r.url.call(this,t)),n.isFunction(r.data)&&(r.data=r.data.call(this,t)),n.ajax(r).done(n.proxy(function(r,f,e){var o=e.getResponseHeader("Content-Type");return o&&-1!==o.indexOf("json")||"object"==typeof r?this._append_json_data(t,r,function(n){i.call(this,n)}):o&&-1!==o.indexOf("html")||"string"==typeof r?this._append_html_data(t,n(n.parseHTML(r)).filter(u),function(n){i.call(this,n)}):(this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:t.id,xhr:e})},this.settings.core.error.call(this,this._data.core.last_error),i.call(this,!1))},this)).fail(n.proxy(function(n){this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:t.id,xhr:n})};i.call(this,!1);this.settings.core.error.call(this,this._data.core.last_error)},this))):(f=n.isArray(r)?n.extend(!0,[],r):n.isPlainObject(r)?n.extend(!0,{},r):r,t.id===n.jstree.root?this._append_json_data(t,f,function(n){i.call(this,n)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_05",reason:"Could not load node",data:JSON.stringify({id:t.id})},this.settings.core.error.call(this,this._data.core.last_error),i.call(this,!1))):"string"==typeof r?t.id===n.jstree.root?this._append_html_data(t,n(n.parseHTML(r)).filter(u),function(n){i.call(this,n)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_06",reason:"Could not load node",data:JSON.stringify({id:t.id})},this.settings.core.error.call(this,this._data.core.last_error),i.call(this,!1)):i.call(this,!1):t.id===n.jstree.root?this._append_html_data(t,this._data.core.original_container_html.clone(!0),function(n){i.call(this,n)}):i.call(this,!1)},_node_changed:function(n){n=this.get_node(n);n&&this._model.changed.push(n.id)},_append_html_data:function(t,i,r){t=this.get_node(t);t.children=[];t.children_d=[];var a=i.is("ul")?i.children():i,o=t.id,c=[],u=[],s=this._model.data,f=s[o],v=this._data.core.selected.length,e,h,l;for(a.each(n.proxy(function(t,i){e=this._parse_model_from_html(n(i),o,f.parents.concat());e&&(c.push(e),u.push(e),s[e].children_d.length&&(u=u.concat(s[e].children_d)))},this)),f.children=c,f.children_d=u,h=0,l=f.parents.length;l>h;h++)s[f.parents[h]].children_d=s[f.parents[h]].children_d.concat(u);this.trigger("model",{nodes:u,parent:o});o!==n.jstree.root?(this._node_changed(o),this.redraw()):(this.get_container_ul().children(".jstree-initial-node").remove(),this.redraw(!0));this._data.core.selected.length!==v&&this.trigger("changed",{action:"model",selected:this._data.core.selected});r.call(this,!0)},_append_json_data:function(t,i,r,u){if(null!==this.element){t=this.get_node(t);t.children=[];t.children_d=[];i.d&&(i=i.d,"string"==typeof i&&(i=JSON.parse(i)));n.isArray(i)||(i=[i]);var f=null,e={df:this._model.default_state,dat:i,par:t.id,m:this._model.data,t_id:this._id,t_cnt:this._cnt,sel:this._data.core.selected},o=function(n,t){n.data&&(n=n.data);var u=n.dat,c=n.par,y=[],o=[],l=[],h=n.df,k=n.t_id,v=n.t_cnt,r=n.m,f=r[c],p=n.sel,s,i,e,a,w=function(n,i,u){u=u?u.concat():[];i&&u.unshift(i);var c=n.id.toString(),e,a,o,s,f={id:c,text:n.text||"",icon:n.icon!==t?n.icon:!0,parent:i,parents:u,children:n.children||[],children_d:n.children_d||[],data:n.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(e in h)h.hasOwnProperty(e)&&(f.state[e]=h[e]);if(n&&n.data&&n.data.jstree&&n.data.jstree.icon&&(f.icon=n.data.jstree.icon),(f.icon===t||null===f.icon||""===f.icon)&&(f.icon=!0),n&&n.data&&(f.data=n.data,n.data.jstree))for(e in n.data.jstree)n.data.jstree.hasOwnProperty(e)&&(f.state[e]=n.data.jstree[e]);if(n&&"object"==typeof n.state)for(e in n.state)n.state.hasOwnProperty(e)&&(f.state[e]=n.state[e]);if(n&&"object"==typeof n.li_attr)for(e in n.li_attr)n.li_attr.hasOwnProperty(e)&&(f.li_attr[e]=n.li_attr[e]);if(f.li_attr.id||(f.li_attr.id=c),n&&"object"==typeof n.a_attr)for(e in n.a_attr)n.a_attr.hasOwnProperty(e)&&(f.a_attr[e]=n.a_attr[e]);for(n&&n.children&&n.children===!0&&(f.state.loaded=!1,f.children=[],f.children_d=[]),r[f.id]=f,e=0,a=f.children.length;a>e;e++)o=w(r[f.children[e]],f.id,u),s=r[o],f.children_d.push(o),s.children_d.length&&(f.children_d=f.children_d.concat(s.children_d));return delete n.data,delete n.children,r[f.id].original=n,f.state.selected&&l.push(f.id),f.id},b=function(n,i,u){u=u?u.concat():[];i&&u.unshift(i);var o=!1,e,a,s,c,f;do o="j"+k+"_"+ ++v;while(r[o]);f={id:!1,text:"string"==typeof n?n:"",icon:"object"==typeof n&&n.icon!==t?n.icon:!0,parent:i,parents:u,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(e in h)h.hasOwnProperty(e)&&(f.state[e]=h[e]);if(n&&n.id&&(f.id=n.id.toString()),n&&n.text&&(f.text=n.text),n&&n.data&&n.data.jstree&&n.data.jstree.icon&&(f.icon=n.data.jstree.icon),(f.icon===t||null===f.icon||""===f.icon)&&(f.icon=!0),n&&n.data&&(f.data=n.data,n.data.jstree))for(e in n.data.jstree)n.data.jstree.hasOwnProperty(e)&&(f.state[e]=n.data.jstree[e]);if(n&&"object"==typeof n.state)for(e in n.state)n.state.hasOwnProperty(e)&&(f.state[e]=n.state[e]);if(n&&"object"==typeof n.li_attr)for(e in n.li_attr)n.li_attr.hasOwnProperty(e)&&(f.li_attr[e]=n.li_attr[e]);if(f.li_attr.id&&!f.id&&(f.id=f.li_attr.id.toString()),f.id||(f.id=o),f.li_attr.id||(f.li_attr.id=f.id),n&&"object"==typeof n.a_attr)for(e in n.a_attr)n.a_attr.hasOwnProperty(e)&&(f.a_attr[e]=n.a_attr[e]);if(n&&n.children&&n.children.length){for(e=0,a=n.children.length;a>e;e++)s=b(n.children[e],f.id,u),c=r[s],f.children.push(s),c.children_d.length&&(f.children_d=f.children_d.concat(c.children_d));f.children_d=f.children_d.concat(f.children)}return n&&n.children&&n.children===!0&&(f.state.loaded=!1,f.children=[],f.children_d=[]),delete n.data,delete n.children,f.original=n,r[f.id]=f,f.state.selected&&l.push(f.id),f.id};if(u.length&&u[0].id!==t&&u[0].parent!==t){for(i=0,e=u.length;e>i;i++)u[i].children||(u[i].children=[]),r[u[i].id.toString()]=u[i];for(i=0,e=u.length;e>i;i++)r[u[i].parent.toString()].children.push(u[i].id.toString()),f.children_d.push(u[i].id.toString());for(i=0,e=f.children.length;e>i;i++)s=w(r[f.children[i]],c,f.parents.concat()),o.push(s),r[s].children_d.length&&(o=o.concat(r[s].children_d));for(i=0,e=f.parents.length;e>i;i++)r[f.parents[i]].children_d=r[f.parents[i]].children_d.concat(o);a={cnt:v,mod:r,sel:p,par:c,dpc:o,add:l}}else{for(i=0,e=u.length;e>i;i++)s=b(u[i],c,f.parents.concat()),s&&(y.push(s),o.push(s),r[s].children_d.length&&(o=o.concat(r[s].children_d)));for(f.children=y,f.children_d=o,i=0,e=f.parents.length;e>i;i++)r[f.parents[i]].children_d=r[f.parents[i]].children_d.concat(o);a={cnt:v,mod:r,sel:p,par:c,dpc:o,add:l}}return"undefined"!=typeof window&&"undefined"!=typeof window.document?a:void postMessage(a)},s=function(t,i){var u,f;if(null!==this.element){this._cnt=t.cnt;f=this._model.data;for(u in f)f.hasOwnProperty(u)&&f[u].state&&f[u].state.loading&&t.mod[u]&&(t.mod[u].state.loading=!0);if(this._model.data=t.mod,i){var s,h=t.add,e=t.sel,o=this._data.core.selected.slice();if(f=this._model.data,e.length!==o.length||n.vakata.array_unique(e.concat(o)).length!==e.length){for(u=0,s=e.length;s>u;u++)-1===n.inArray(e[u],h)&&-1===n.inArray(e[u],o)&&(f[e[u]].state.selected=!1);for(u=0,s=o.length;s>u;u++)-1===n.inArray(o[u],e)&&(f[o[u]].state.selected=!0)}}t.add.length&&(this._data.core.selected=this._data.core.selected.concat(t.add));this.trigger("model",{nodes:t.dpc,parent:t.par});t.par!==n.jstree.root?(this._node_changed(t.par),this.redraw()):this.redraw(!0);t.add.length&&this.trigger("changed",{action:"model",selected:this._data.core.selected});r.call(this,!0)}};if(this.settings.core.worker&&window.Blob&&window.URL&&window.Worker)try{null===this._wrk&&(this._wrk=window.URL.createObjectURL(new window.Blob(["self.onmessage = "+o.toString()],{type:"text/javascript"})));!this._data.core.working||u?(this._data.core.working=!0,f=new window.Worker(this._wrk),f.onmessage=n.proxy(function(n){s.call(this,n.data,!0);try{f.terminate();f=null}catch(t){}this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1},this),e.par?f.postMessage(e):this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1):this._data.core.worker_queue.push([t,i,r,!0])}catch(h){s.call(this,o(e),!1);this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1}else s.call(this,o(e),!1)}},_parse_model_from_html:function(i,r,u){u=u?[].concat(u):[];r&&u.unshift(r);var s,h,l=this._model.data,f={id:!1,text:!1,icon:!0,parent:r,parents:u,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1},o,e,c;for(o in this._model.default_state)this._model.default_state.hasOwnProperty(o)&&(f.state[o]=this._model.default_state[o]);if(e=n.vakata.attributes(i,!0),n.each(e,function(t,i){return i=n.trim(i),i.length?(f.li_attr[t]=i,void("id"===t&&(f.id=i.toString()))):!0}),e=i.children("a").first(),e.length&&(e=n.vakata.attributes(e,!0),n.each(e,function(t,i){i=n.trim(i);i.length&&(f.a_attr[t]=i)})),e=i.children("a").first().length?i.children("a").first().clone():i.clone(),e.children("ins, i, ul").remove(),e=e.html(),e=n("<div />").html(e),f.text=this.settings.core.force_text?e.text():e.html(),e=i.data(),f.data=e?n.extend(!0,{},e):null,f.state.opened=i.hasClass("jstree-open"),f.state.selected=i.children("a").hasClass("jstree-clicked"),f.state.disabled=i.children("a").hasClass("jstree-disabled"),f.data&&f.data.jstree)for(o in f.data.jstree)f.data.jstree.hasOwnProperty(o)&&(f.state[o]=f.data.jstree[o]);e=i.children("a").children(".jstree-themeicon");e.length&&(f.icon=e.hasClass("jstree-themeicon-hidden")?!1:e.attr("rel"));f.state.icon!==t&&(f.icon=f.state.icon);(f.icon===t||null===f.icon||""===f.icon)&&(f.icon=!0);e=i.children("ul").children("li");do c="j"+this._id+"_"+ ++this._cnt;while(l[c]);return f.id=f.li_attr.id?f.li_attr.id.toString():c,e.length?(e.each(n.proxy(function(t,i){s=this._parse_model_from_html(n(i),f.id,u);h=this._model.data[s];f.children.push(s);h.children_d.length&&(f.children_d=f.children_d.concat(h.children_d))},this)),f.children_d=f.children_d.concat(f.children)):i.hasClass("jstree-closed")&&(f.state.loaded=!1),f.li_attr["class"]&&(f.li_attr["class"]=f.li_attr["class"].replace("jstree-closed","").replace("jstree-open","")),f.a_attr["class"]&&(f.a_attr["class"]=f.a_attr["class"].replace("jstree-clicked","").replace("jstree-disabled","")),l[f.id]=f,f.state.selected&&this._data.core.selected.push(f.id),f.id},_parse_model_from_flat_json:function(n,i,r){r=r?r.concat():[];i&&r.unshift(i);var c=n.id.toString(),e=this._model.data,o=this._model.default_state,f,l,s,h,u={id:c,text:n.text||"",icon:n.icon!==t?n.icon:!0,parent:i,parents:r,children:n.children||[],children_d:n.children_d||[],data:n.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in o)o.hasOwnProperty(f)&&(u.state[f]=o[f]);if(n&&n.data&&n.data.jstree&&n.data.jstree.icon&&(u.icon=n.data.jstree.icon),(u.icon===t||null===u.icon||""===u.icon)&&(u.icon=!0),n&&n.data&&(u.data=n.data,n.data.jstree))for(f in n.data.jstree)n.data.jstree.hasOwnProperty(f)&&(u.state[f]=n.data.jstree[f]);if(n&&"object"==typeof n.state)for(f in n.state)n.state.hasOwnProperty(f)&&(u.state[f]=n.state[f]);if(n&&"object"==typeof n.li_attr)for(f in n.li_attr)n.li_attr.hasOwnProperty(f)&&(u.li_attr[f]=n.li_attr[f]);if(u.li_attr.id||(u.li_attr.id=c),n&&"object"==typeof n.a_attr)for(f in n.a_attr)n.a_attr.hasOwnProperty(f)&&(u.a_attr[f]=n.a_attr[f]);for(n&&n.children&&n.children===!0&&(u.state.loaded=!1,u.children=[],u.children_d=[]),e[u.id]=u,f=0,l=u.children.length;l>f;f++)s=this._parse_model_from_flat_json(e[u.children[f]],u.id,r),h=e[s],u.children_d.push(s),h.children_d.length&&(u.children_d=u.children_d.concat(h.children_d));return delete n.data,delete n.children,e[u.id].original=n,u.state.selected&&this._data.core.selected.push(u.id),u.id},_parse_model_from_json:function(n,i,r){r=r?r.concat():[];i&&r.unshift(i);var e=!1,f,l,o,s,h=this._model.data,c=this._model.default_state,u;do e="j"+this._id+"_"+ ++this._cnt;while(h[e]);u={id:!1,text:"string"==typeof n?n:"",icon:"object"==typeof n&&n.icon!==t?n.icon:!0,parent:i,parents:r,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in c)c.hasOwnProperty(f)&&(u.state[f]=c[f]);if(n&&n.id&&(u.id=n.id.toString()),n&&n.text&&(u.text=n.text),n&&n.data&&n.data.jstree&&n.data.jstree.icon&&(u.icon=n.data.jstree.icon),(u.icon===t||null===u.icon||""===u.icon)&&(u.icon=!0),n&&n.data&&(u.data=n.data,n.data.jstree))for(f in n.data.jstree)n.data.jstree.hasOwnProperty(f)&&(u.state[f]=n.data.jstree[f]);if(n&&"object"==typeof n.state)for(f in n.state)n.state.hasOwnProperty(f)&&(u.state[f]=n.state[f]);if(n&&"object"==typeof n.li_attr)for(f in n.li_attr)n.li_attr.hasOwnProperty(f)&&(u.li_attr[f]=n.li_attr[f]);if(u.li_attr.id&&!u.id&&(u.id=u.li_attr.id.toString()),u.id||(u.id=e),u.li_attr.id||(u.li_attr.id=u.id),n&&"object"==typeof n.a_attr)for(f in n.a_attr)n.a_attr.hasOwnProperty(f)&&(u.a_attr[f]=n.a_attr[f]);if(n&&n.children&&n.children.length){for(f=0,l=n.children.length;l>f;f++)o=this._parse_model_from_json(n.children[f],u.id,r),s=h[o],u.children.push(o),s.children_d.length&&(u.children_d=u.children_d.concat(s.children_d));u.children_d=u.children_d.concat(u.children)}return n&&n.children&&n.children===!0&&(u.state.loaded=!1,u.children=[],u.children_d=[]),delete n.data,delete n.children,u.original=n,h[u.id]=u,u.state.selected&&this._data.core.selected.push(u.id),u.id},_redraw:function(){for(var f=this._model.force_full_redraw?this._model.data[n.jstree.root].children.concat([]):this._model.changed.concat([]),r=i.createElement("UL"),t,o=this._data.core.focused,u=0,e=f.length;e>u;u++)t=this.redraw_node(f[u],!0,this._model.force_full_redraw),t&&this._model.force_full_redraw&&r.appendChild(t);this._model.force_full_redraw&&(r.className=this.get_container_ul()[0].className,r.setAttribute("role","group"),this.element.empty().append(r));null!==o&&(t=this.get_node(o,!0),t&&t.length&&t.children(".jstree-anchor")[0]!==i.activeElement?t.children(".jstree-anchor").focus():this._data.core.focused=null);this._model.force_full_redraw=!1;this._model.changed=[];this.trigger("redraw",{nodes:f})},redraw:function(n){n&&(this._model.force_full_redraw=!0);this._redraw()},draw_children:function(t){var r=this.get_node(t),f=!1,e=!1,u=!1,o=i;if(!r)return!1;if(r.id===n.jstree.root)return this.redraw(!0);if(t=this.get_node(t,!0),!t||!t.length)return!1;if(t.children(".jstree-children").remove(),t=t[0],r.children.length&&r.state.loaded){for(u=o.createElement("UL"),u.setAttribute("role","group"),u.className="jstree-children",f=0,e=r.children.length;e>f;f++)u.appendChild(this.redraw_node(r.children[f],!0,!0));t.appendChild(u)}},redraw_node:function(t,r,u,f){var e=this.get_node(t),s=!1,y=!1,w=!1,o=!1,h=!1,v=!1,c="",b=i,l=this._model.data,k=!1,a=null,d=0,g=0,nt=!1,p=!1;if(!e)return!1;if(e.id===n.jstree.root)return this.redraw(!0);if(r=r||0===e.children.length,t=i.querySelector?this.element[0].querySelector("#"+(-1!=="0123456789".indexOf(e.id[0])?"\\3"+e.id[0]+" "+e.id.substr(1).replace(n.jstree.idregex,"\\$&"):e.id.replace(n.jstree.idregex,"\\$&"))):i.getElementById(e.id))t=n(t),u||(s=t.parent().parent()[0],s===this.element[0]&&(s=null),y=t.index()),r||!e.children.length||t.children(".jstree-children").length||(r=!0),r||(w=t.children(".jstree-children")[0]),k=t.children(".jstree-anchor")[0]===i.activeElement,t.remove();else if(r=!0,!u){if(s=e.parent!==n.jstree.root?n("#"+e.parent.replace(n.jstree.idregex,"\\$&"),this.element)[0]:null,!(null===s||s&&l[e.parent].state.opened))return!1;y=n.inArray(e.id,null===s?l[n.jstree.root].children:l[e.parent].children)}t=this._data.core.node.cloneNode(!0);c="jstree-node ";for(o in e.li_attr)if(e.li_attr.hasOwnProperty(o)){if("id"===o)continue;"class"!==o?t.setAttribute(o,e.li_attr[o]):c+=e.li_attr[o]}for(e.a_attr.id||(e.a_attr.id=e.id+"_anchor"),t.setAttribute("aria-selected",!!e.state.selected),t.setAttribute("aria-level",e.parents.length),t.setAttribute("aria-labelledby",e.a_attr.id),e.state.disabled&&t.setAttribute("aria-disabled",!0),o=0,h=e.children.length;h>o;o++)if(!l[e.children[o]].state.hidden){nt=!0;break}if(null!==e.parent&&l[e.parent]&&!e.state.hidden&&(o=n.inArray(e.id,l[e.parent].children),p=e.id,-1!==o))for(o++,h=l[e.parent].children.length;h>o;o++)if(l[l[e.parent].children[o]].state.hidden||(p=l[e.parent].children[o]),p!==e.id)break;e.state.hidden&&(c+=" jstree-hidden");e.state.loaded&&!nt?c+=" jstree-leaf":(c+=e.state.opened&&e.state.loaded?" jstree-open":" jstree-closed",t.setAttribute("aria-expanded",e.state.opened&&e.state.loaded));p===e.id&&(c+=" jstree-last");t.id=e.id;t.className=c;c=(e.state.selected?" jstree-clicked":"")+(e.state.disabled?" jstree-disabled":"");for(h in e.a_attr)if(e.a_attr.hasOwnProperty(h)){if("href"===h&&"#"===e.a_attr[h])continue;"class"!==h?t.childNodes[1].setAttribute(h,e.a_attr[h]):c+=" "+e.a_attr[h]}if(c.length&&(t.childNodes[1].className="jstree-anchor "+c),(e.icon&&e.icon!==!0||e.icon===!1)&&(e.icon===!1?t.childNodes[1].childNodes[0].className+=" jstree-themeicon-hidden":-1===e.icon.indexOf("/")&&-1===e.icon.indexOf(".")?t.childNodes[1].childNodes[0].className+=" "+e.icon+" jstree-themeicon-custom":(t.childNodes[1].childNodes[0].style.backgroundImage='url("'+e.icon+'")',t.childNodes[1].childNodes[0].style.backgroundPosition="center center",t.childNodes[1].childNodes[0].style.backgroundSize="auto",t.childNodes[1].childNodes[0].className+=" jstree-themeicon-custom")),this.settings.core.force_text?t.childNodes[1].appendChild(b.createTextNode(e.text)):t.childNodes[1].innerHTML+=e.text,r&&e.children.length&&(e.state.opened||f)&&e.state.loaded){for(v=b.createElement("UL"),v.setAttribute("role","group"),v.className="jstree-children",o=0,h=e.children.length;h>o;o++)v.appendChild(this.redraw_node(e.children[o],r,!0));t.appendChild(v)}if(w&&t.appendChild(w),!u){for(s||(s=this.element[0]),o=0,h=s.childNodes.length;h>o;o++)if(s.childNodes[o]&&s.childNodes[o].className&&-1!==s.childNodes[o].className.indexOf("jstree-children")){a=s.childNodes[o];break}a||(a=b.createElement("UL"),a.setAttribute("role","group"),a.className="jstree-children",s.appendChild(a));s=a;y<s.childNodes.length?s.insertBefore(t,s.childNodes[y]):s.appendChild(t);k&&(d=this.element[0].scrollTop,g=this.element[0].scrollLeft,t.childNodes[1].focus(),this.element[0].scrollTop=d,this.element[0].scrollLeft=g)}return e.state.opened&&!e.state.loaded&&(e.state.opened=!1,setTimeout(n.proxy(function(){this.open_node(e.id,!1,0)},this),0)),t},open_node:function(i,r,u){var e,s,f,o;if(n.isArray(i)){for(i=i.slice(),e=0,s=i.length;s>e;e++)this.open_node(i[e],r,u);return!0}return i=this.get_node(i),i&&i.id!==n.jstree.root?(u=u===t?this.settings.core.animation:u,this.is_closed(i)?this.is_loaded(i)?(f=this.get_node(i,!0),o=this,f.length&&(u&&f.children(".jstree-children").length&&f.children(".jstree-children").stop(!0,!0),i.children.length&&!this._firstChild(f.children(".jstree-children")[0])&&this.draw_children(i),u?(this.trigger("before_open",{node:i}),f.children(".jstree-children").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").attr("aria-expanded",!0).children(".jstree-children").stop(!0,!0).slideDown(u,function(){this.style.display="";o.element&&o.trigger("after_open",{node:i})})):(this.trigger("before_open",{node:i}),f[0].className=f[0].className.replace("jstree-closed","jstree-open"),f[0].setAttribute("aria-expanded",!0))),i.state.opened=!0,r&&r.call(this,i,!0),f.length||this.trigger("before_open",{node:i}),this.trigger("open_node",{node:i}),u&&f.length||this.trigger("after_open",{node:i}),!0):this.is_loading(i)?setTimeout(n.proxy(function(){this.open_node(i,r,u)},this),500):void this.load_node(i,function(n,t){return t?this.open_node(n,r,u):r?r.call(this,n,!1):!1}):(r&&r.call(this,i,!1),!1)):!1},_open_to:function(t){if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;for(var u=t.parents,i=0,r=u.length;r>i;i+=1)i!==n.jstree.root&&this.open_node(u[i],!1,0);return n("#"+t.id.replace(n.jstree.idregex,"\\$&"),this.element)},close_node:function(i,r){var f,o,e,u;if(n.isArray(i)){for(i=i.slice(),f=0,o=i.length;o>f;f++)this.close_node(i[f],r);return!0}return i=this.get_node(i),i&&i.id!==n.jstree.root?this.is_closed(i)?!1:(r=r===t?this.settings.core.animation:r,e=this,u=this.get_node(i,!0),i.state.opened=!1,this.trigger("close_node",{node:i}),void(u.length?r?u.children(".jstree-children").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").attr("aria-expanded",!1).children(".jstree-children").stop(!0,!0).slideUp(r,function(){this.style.display="";u.children(".jstree-children").remove();e.element&&e.trigger("after_close",{node:i})}):(u[0].className=u[0].className.replace("jstree-open","jstree-closed"),u.attr("aria-expanded",!1).children(".jstree-children").remove(),this.trigger("after_close",{node:i})):this.trigger("after_close",{node:i}))):!1},toggle_node:function(t){var i,r;if(n.isArray(t)){for(t=t.slice(),i=0,r=t.length;r>i;i++)this.toggle_node(t[i]);return!0}return this.is_closed(t)?this.open_node(t):this.is_open(t)?this.close_node(t):void 0},open_all:function(t,i,r){if(t||(t=n.jstree.root),t=this.get_node(t),!t)return!1;var u=t.id===n.jstree.root?this.get_container_ul():this.get_node(t,!0),f,e,o;if(!u.length){for(f=0,e=t.children_d.length;e>f;f++)this.is_closed(this._model.data[t.children_d[f]])&&(this._model.data[t.children_d[f]].state.opened=!0);return this.trigger("open_all",{node:t})}r=r||u;o=this;u=this.is_closed(t)?u.find(".jstree-closed").addBack():u.find(".jstree-closed");u.each(function(){o.open_node(this,function(n,t){t&&this.is_parent(n)&&this.open_all(n,i,r)},i||0)});0===r.find(".jstree-closed").length&&this.trigger("open_all",{node:this.get_node(r)})},close_all:function(t,i){if(t||(t=n.jstree.root),t=this.get_node(t),!t)return!1;var r=t.id===n.jstree.root?this.get_container_ul():this.get_node(t,!0),e=this,u,f;for(r.length&&(r=this.is_open(t)?r.find(".jstree-open").addBack():r.find(".jstree-open"),n(r.get().reverse()).each(function(){e.close_node(this,i||0)})),u=0,f=t.children_d.length;f>u;u++)this._model.data[t.children_d[u]].state.opened=!1;this.trigger("close_all",{node:t})},is_disabled:function(n){return n=this.get_node(n),n&&n.state&&n.state.disabled},enable_node:function(t){var i,r;if(n.isArray(t)){for(t=t.slice(),i=0,r=t.length;r>i;i++)this.enable_node(t[i]);return!0}return t=this.get_node(t),t&&t.id!==n.jstree.root?(t.state.disabled=!1,this.get_node(t,!0).children(".jstree-anchor").removeClass("jstree-disabled").attr("aria-disabled",!1),void this.trigger("enable_node",{node:t})):!1},disable_node:function(t){var i,r;if(n.isArray(t)){for(t=t.slice(),i=0,r=t.length;r>i;i++)this.disable_node(t[i]);return!0}return t=this.get_node(t),t&&t.id!==n.jstree.root?(t.state.disabled=!0,this.get_node(t,!0).children(".jstree-anchor").addClass("jstree-disabled").attr("aria-disabled",!0),void this.trigger("disable_node",{node:t})):!1},is_hidden:function(n){return n=this.get_node(n),n.state.hidden===!0},hide_node:function(t,i){var r,u;if(n.isArray(t)){for(t=t.slice(),r=0,u=t.length;u>r;r++)this.hide_node(t[r],!0);return i||this.redraw(),!0}return t=this.get_node(t),t&&t.id!==n.jstree.root?void(t.state.hidden||(t.state.hidden=!0,this._node_changed(t.parent),i||this.redraw(),this.trigger("hide_node",{node:t}))):!1},show_node:function(t,i){var r,u;if(n.isArray(t)){for(t=t.slice(),r=0,u=t.length;u>r;r++)this.show_node(t[r],!0);return i||this.redraw(),!0}return t=this.get_node(t),t&&t.id!==n.jstree.root?void(t.state.hidden&&(t.state.hidden=!1,this._node_changed(t.parent),i||this.redraw(),this.trigger("show_node",{node:t}))):!1},hide_all:function(t){var i,r=this._model.data,u=[];for(i in r)r.hasOwnProperty(i)&&i!==n.jstree.root&&!r[i].state.hidden&&(r[i].state.hidden=!0,u.push(i));return this._model.force_full_redraw=!0,t||this.redraw(),this.trigger("hide_all",{nodes:u}),u},show_all:function(t){var i,r=this._model.data,u=[];for(i in r)r.hasOwnProperty(i)&&i!==n.jstree.root&&r[i].state.hidden&&(r[i].state.hidden=!1,u.push(i));return this._model.force_full_redraw=!0,t||this.redraw(),this.trigger("show_all",{nodes:u}),u},activate_node:function(n,i){if(this.is_disabled(n))return!1;if(i&&"object"==typeof i||(i={}),this._data.core.last_clicked=this._data.core.last_clicked&&this._data.core.last_clicked.id!==t?this.get_node(this._data.core.last_clicked.id):null,this._data.core.last_clicked&&!this._data.core.last_clicked.state.selected&&(this._data.core.last_clicked=null),!this._data.core.last_clicked&&this._data.core.selected.length&&(this._data.core.last_clicked=this.get_node(this._data.core.selected[this._data.core.selected.length-1])),this.settings.core.multiple&&(i.metaKey||i.ctrlKey||i.shiftKey)&&(!i.shiftKey||this._data.core.last_clicked&&this.get_parent(n)&&this.get_parent(n)===this._data.core.last_clicked.parent))if(i.shiftKey){for(var e=this.get_node(n).id,o=this._data.core.last_clicked.id,u=this.get_node(this._data.core.last_clicked.parent).children,f=!1,r=0,s=u.length;s>r;r+=1)u[r]===e&&(f=!f),u[r]===o&&(f=!f),this.is_disabled(u[r])||!f&&u[r]!==e&&u[r]!==o?this.deselect_node(u[r],!0,i):this.is_hidden(u[r])||this.select_node(u[r],!0,!1,i);this.trigger("changed",{action:"select_node",node:this.get_node(n),selected:this._data.core.selected,event:i})}else this.is_selected(n)?this.deselect_node(n,!1,i):this.select_node(n,!1,!1,i);else!this.settings.core.multiple&&(i.metaKey||i.ctrlKey||i.shiftKey)&&this.is_selected(n)?this.deselect_node(n,!1,i):(this.deselect_all(!0),this.select_node(n,!1,!1,i),this._data.core.last_clicked=this.get_node(n));this.trigger("activate_node",{node:this.get_node(n),event:i})},hover_node:function(n){if(n=this.get_node(n,!0),!n||!n.length||n.children(".jstree-hovered").length)return!1;var t=this.element.find(".jstree-hovered"),i=this.element;t&&t.length&&this.dehover_node(t);n.children(".jstree-anchor").addClass("jstree-hovered");this.trigger("hover_node",{node:this.get_node(n)});setTimeout(function(){i.attr("aria-activedescendant",n[0].id)},0)},dehover_node:function(n){return n=this.get_node(n,!0),n&&n.length&&n.children(".jstree-hovered").length?(n.children(".jstree-anchor").removeClass("jstree-hovered"),void this.trigger("dehover_node",{node:this.get_node(n)})):!1},select_node:function(t,i,r,u){var f,e,o;if(n.isArray(t)){for(t=t.slice(),e=0,o=t.length;o>e;e++)this.select_node(t[e],i,r,u);return!0}return t=this.get_node(t),t&&t.id!==n.jstree.root?(f=this.get_node(t,!0),void(t.state.selected||(t.state.selected=!0,this._data.core.selected.push(t.id),r||(f=this._open_to(t)),f&&f.length&&f.attr("aria-selected",!0).children(".jstree-anchor").addClass("jstree-clicked"),this.trigger("select_node",{node:t,selected:this._data.core.selected,event:u}),i||this.trigger("changed",{action:"select_node",node:t,selected:this._data.core.selected,event:u})))):!1},deselect_node:function(t,i,r){var u,e,f;if(n.isArray(t)){for(t=t.slice(),u=0,e=t.length;e>u;u++)this.deselect_node(t[u],i,r);return!0}return t=this.get_node(t),t&&t.id!==n.jstree.root?(f=this.get_node(t,!0),void(t.state.selected&&(t.state.selected=!1,this._data.core.selected=n.vakata.array_remove_item(this._data.core.selected,t.id),f.length&&f.attr("aria-selected",!1).children(".jstree-anchor").removeClass("jstree-clicked"),this.trigger("deselect_node",{node:t,selected:this._data.core.selected,event:r}),i||this.trigger("changed",{action:"deselect_node",node:t,selected:this._data.core.selected,event:r})))):!1},select_all:function(t){var u=this._data.core.selected.concat([]),i,r;for(this._data.core.selected=this._model.data[n.jstree.root].children_d.concat(),i=0,r=this._data.core.selected.length;r>i;i++)this._model.data[this._data.core.selected[i]]&&(this._model.data[this._data.core.selected[i]].state.selected=!0);this.redraw(!0);this.trigger("select_all",{selected:this._data.core.selected});t||this.trigger("changed",{action:"select_all",selected:this._data.core.selected,old_selection:u})},deselect_all:function(n){for(var i=this._data.core.selected.concat([]),t=0,r=this._data.core.selected.length;r>t;t++)this._model.data[this._data.core.selected[t]]&&(this._model.data[this._data.core.selected[t]].state.selected=!1);this._data.core.selected=[];this.element.find(".jstree-clicked").removeClass("jstree-clicked").parent().attr("aria-selected",!1);this.trigger("deselect_all",{selected:this._data.core.selected,node:i});n||this.trigger("changed",{action:"deselect_all",selected:this._data.core.selected,old_selection:i})},is_selected:function(t){return t=this.get_node(t),t&&t.id!==n.jstree.root?t.state.selected:!1},get_selected:function(t){return t?n.map(this._data.core.selected,n.proxy(function(n){return this.get_node(n)},this)):this._data.core.selected.slice()},get_top_selected:function(t){for(var r=this.get_selected(!0),u={},f,o,i=0,e=r.length;e>i;i++)u[r[i].id]=r[i];for(i=0,e=r.length;e>i;i++)for(f=0,o=r[i].children_d.length;o>f;f++)u[r[i].children_d[f]]&&delete u[r[i].children_d[f]];r=[];for(i in u)u.hasOwnProperty(i)&&r.push(i);return t?n.map(r,n.proxy(function(n){return this.get_node(n)},this)):r},get_bottom_selected:function(t){for(var r=this.get_selected(!0),u=[],i=0,f=r.length;f>i;i++)r[i].children.length||u.push(r[i].id);return t?n.map(u,n.proxy(function(n){return this.get_node(n)},this)):u},get_state:function(){var i={core:{open:[],scroll:{left:this.element.scrollLeft(),top:this.element.scrollTop()},selected:[]}},t;for(t in this._model.data)this._model.data.hasOwnProperty(t)&&t!==n.jstree.root&&(this._model.data[t].state.opened&&i.core.open.push(t),this._model.data[t].state.selected&&i.core.selected.push(t));return i},set_state:function(i,r){if(i){if(i.core&&i.core.selected&&i.core.initial_selection===t&&(i.core.initial_selection=this._data.core.selected.concat([]).sort().join(",")),i.core){var f,u;if(i.core.open)return n.isArray(i.core.open)&&i.core.open.length?this._load_nodes(i.core.open,function(n){this.open_node(n,!1,0);delete i.core.open;this.set_state(i,r)}):(delete i.core.open,this.set_state(i,r)),!1;if(i.core.scroll)return i.core.scroll&&i.core.scroll.left!==t&&this.element.scrollLeft(i.core.scroll.left),i.core.scroll&&i.core.scroll.top!==t&&this.element.scrollTop(i.core.scroll.top),delete i.core.scroll,this.set_state(i,r),!1;if(i.core.selected)return f=this,(i.core.initial_selection===t||i.core.initial_selection===this._data.core.selected.concat([]).sort().join(","))&&(this.deselect_all(),n.each(i.core.selected,function(n,t){f.select_node(t,!1,!0)})),delete i.core.initial_selection,delete i.core.selected,this.set_state(i,r),!1;for(u in i)i.hasOwnProperty(u)&&"core"!==u&&-1===n.inArray(u,this.settings.plugins)&&delete i[u];if(n.isEmptyObject(i.core))return delete i.core,this.set_state(i,r),!1}return n.isEmptyObject(i)?(i=null,r&&r.call(this),this.trigger("set_state"),!1):!0}return!1},refresh:function(t,i){this._data.core.state=i===!0?{}:this.get_state();i&&n.isFunction(i)&&(this._data.core.state=i.call(this,this._data.core.state));this._cnt=0;this._model.data={};this._model.data[n.jstree.root]={id:n.jstree.root,parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}};this._data.core.selected=[];this._data.core.last_clicked=null;this._data.core.focused=null;var r=this.get_container_ul()[0].className;t||(this.element.html("<ul class='"+r+"' role='group'><li class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='treeitem' id='j"+this._id+"_loading'><i class='jstree-icon jstree-ocl'><\/i><a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'><\/i>"+this.get_string("Loading ...")+"<\/a><\/li><\/ul>"),this.element.attr("aria-activedescendant","j"+this._id+"_loading"));this.load_node(n.jstree.root,function(t,i){i&&(this.get_container_ul()[0].className=r,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.set_state(n.extend(!0,{},this._data.core.state),function(){this.trigger("refresh")}));this._data.core.state=null})},refresh_node:function(t){if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;var i=[],r=[],u=this._data.core.selected.concat([]);r.push(t.id);t.state.opened===!0&&i.push(t.id);this.get_node(t,!0).find(".jstree-open").each(function(){r.push(this.id);i.push(this.id)});this._load_nodes(r,n.proxy(function(n){this.open_node(i,!1,0);this.select_node(u);this.trigger("refresh_node",{node:t,nodes:n})},this),!1,!0)},set_id:function(t,i){if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;var r,f,u=this._model.data,e=t.id;for(i=i.toString(),u[t.parent].children[n.inArray(t.id,u[t.parent].children)]=i,r=0,f=t.parents.length;f>r;r++)u[t.parents[r]].children_d[n.inArray(t.id,u[t.parents[r]].children_d)]=i;for(r=0,f=t.children.length;f>r;r++)u[t.children[r]].parent=i;for(r=0,f=t.children_d.length;f>r;r++)u[t.children_d[r]].parents[n.inArray(t.id,u[t.children_d[r]].parents)]=i;return r=n.inArray(t.id,this._data.core.selected),-1!==r&&(this._data.core.selected[r]=i),r=this.get_node(t.id,!0),r&&(r.attr("id",i),this.element.attr("aria-activedescendant")===t.id&&this.element.attr("aria-activedescendant",i)),delete u[t.id],t.id=i,t.li_attr.id=i,u[i]=t,this.trigger("set_id",{node:t,"new":t.id,old:e}),!0},get_text:function(t){return t=this.get_node(t),t&&t.id!==n.jstree.root?t.text:!1},set_text:function(t,i){var r,u;if(n.isArray(t)){for(t=t.slice(),r=0,u=t.length;u>r;r++)this.set_text(t[r],i);return!0}return t=this.get_node(t),t&&t.id!==n.jstree.root?(t.text=i,this.get_node(t,!0).length&&this.redraw_node(t.id),this.trigger("set_text",{obj:t,text:i}),!0):!1},get_json:function(t,i,r){if(t=this.get_node(t||n.jstree.root),!t)return!1;i&&i.flat&&!r&&(r=[]);var u={id:t.id,text:t.text,icon:this.get_icon(t),li_attr:n.extend(!0,{},t.li_attr),a_attr:n.extend(!0,{},t.a_attr),state:{},data:i&&i.no_data?!1:n.extend(!0,n.isArray(t.data)?[]:{},t.data)},f,e;if(i&&i.flat?u.parent=t.parent:u.children=[],i&&i.no_state)delete u.state;else for(f in t.state)t.state.hasOwnProperty(f)&&(u.state[f]=t.state[f]);if(i&&i.no_li_attr&&delete u.li_attr,i&&i.no_a_attr&&delete u.a_attr,i&&i.no_id&&(delete u.id,u.li_attr&&u.li_attr.id&&delete u.li_attr.id,u.a_attr&&u.a_attr.id&&delete u.a_attr.id),i&&i.flat&&t.id!==n.jstree.root&&r.push(u),!i||!i.no_children)for(f=0,e=t.children.length;e>f;f++)i&&i.flat?this.get_json(t.children[f],i,r):u.children.push(this.get_json(t.children[f],i));return i&&i.flat?r:t.id===n.jstree.root?u.children:u},create_node:function(i,r,u,f,e){if(null===i&&(i=n.jstree.root),i=this.get_node(i),!i)return!1;if(u=u===t?"last":u,!u.toString().match(/^(before|after)$/)&&!e&&!this.is_loaded(i))return this.load_node(i,function(){this.create_node(i,r,u,f,!0)});r||(r={text:this.get_string("New node")});r="string"==typeof r?{text:r}:n.extend(!0,{},r);r.text===t&&(r.text=this.get_string("New node"));var o,h,s,c;switch(i.id===n.jstree.root&&("before"===u&&(u="first"),"after"===u&&(u="last")),u){case"before":o=this.get_node(i.parent);u=n.inArray(i.id,o.children);i=o;break;case"after":o=this.get_node(i.parent);u=n.inArray(i.id,o.children)+1;i=o;break;case"inside":case"first":u=0;break;case"last":u=i.children.length;break;default:u||(u=0)}if(u>i.children.length&&(u=i.children.length),r.id||(r.id=!0),!this.check("create_node",r,i,u))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(r.id===!0&&delete r.id,r=this._parse_model_from_json(r,i.id,i.parents.concat()),!r)return!1;for(o=this.get_node(r),h=[],h.push(r),h=h.concat(o.children_d),this.trigger("model",{nodes:h,parent:i.id}),i.children_d=i.children_d.concat(h),s=0,c=i.parents.length;c>s;s++)this._model.data[i.parents[s]].children_d=this._model.data[i.parents[s]].children_d.concat(h);for(r=o,o=[],s=0,c=i.children.length;c>s;s++)o[s>=u?s+1:s]=i.children[s];return o[u]=r.id,i.children=o,this.redraw_node(i,!0),this.trigger("create_node",{node:this.get_node(r),parent:i.id,position:u}),f&&f.call(this,this.get_node(r)),r.id},rename_node:function(t,i){var r,u,f;if(n.isArray(t)){for(t=t.slice(),r=0,u=t.length;u>r;r++)this.rename_node(t[r],i);return!0}return t=this.get_node(t),t&&t.id!==n.jstree.root?(f=t.text,this.check("rename_node",t,this.get_parent(t),i)?(this.set_text(t,i),this.trigger("rename_node",{node:t,text:i,old:f}),!0):(this.settings.core.error.call(this,this._data.core.last_error),!1)):!1},delete_node:function(t){var e,c,i,o,r,f,l,u,s,h,a,v;if(n.isArray(t)){for(t=t.slice(),e=0,c=t.length;c>e;e++)this.delete_node(t[e]);return!0}if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;if(i=this.get_node(t.parent),o=n.inArray(t.id,i.children),h=!1,!this.check("delete_node",t,i,o))return this.settings.core.error.call(this,this._data.core.last_error),!1;for(-1!==o&&(i.children=n.vakata.array_remove(i.children,o)),r=t.children_d.concat([]),r.push(t.id),f=0,l=t.parents.length;l>f;f++)this._model.data[t.parents[f]].children_d=n.vakata.array_filter(this._model.data[t.parents[f]].children_d,function(t){return-1===n.inArray(t,r)});for(u=0,s=r.length;s>u;u++)if(this._model.data[r[u]].state.selected){h=!0;break}for(h&&(this._data.core.selected=n.vakata.array_filter(this._data.core.selected,function(t){return-1===n.inArray(t,r)})),this.trigger("delete_node",{node:t,parent:i.id}),h&&this.trigger("changed",{action:"delete_node",node:t,selected:this._data.core.selected,parent:i.id}),u=0,s=r.length;s>u;u++)delete this._model.data[r[u]];return-1!==n.inArray(this._data.core.focused,r)&&(this._data.core.focused=null,a=this.element[0].scrollTop,v=this.element[0].scrollLeft,i.id===n.jstree.root?this._model.data[n.jstree.root].children[0]&&this.get_node(this._model.data[n.jstree.root].children[0],!0).children(".jstree-anchor").focus():this.get_node(i,!0).children(".jstree-anchor").focus(),this.element[0].scrollTop=a,this.element[0].scrollLeft=v),this.redraw_node(i,!0),!0},check:function(t,i,r,u,f){i=i&&i.id?i:this.get_node(i);r=r&&r.id?r:this.get_node(r);var e=t.match(/^move_node|copy_node|create_node$/i)?r:i,o=this.settings.core.check_callback;return"move_node"!==t&&"copy_node"!==t||f&&f.is_multi||i.id!==r.id&&("move_node"!==t||n.inArray(i.id,r.children)!==u)&&-1===n.inArray(r.id,i.children_d)?(e&&e.data&&(e=e.data),e&&e.functions&&(e.functions[t]===!1||e.functions[t]===!0)?(e.functions[t]===!1&&(this._data.core.last_error={error:"check",plugin:"core",id:"core_02",reason:"Node data prevents function: "+t,data:JSON.stringify({chk:t,pos:u,obj:i&&i.id?i.id:!1,par:r&&r.id?r.id:!1})}),e.functions[t]):o===!1||n.isFunction(o)&&o.call(this,t,i,r,u,f)===!1||o&&o[t]===!1?(this._data.core.last_error={error:"check",plugin:"core",id:"core_03",reason:"User config for core.check_callback prevents function: "+t,data:JSON.stringify({chk:t,pos:u,obj:i&&i.id?i.id:!1,par:r&&r.id?r.id:!1})},!1):!0):(this._data.core.last_error={error:"check",plugin:"core",id:"core_01",reason:"Moving parent inside child",data:JSON.stringify({chk:t,pos:u,obj:i&&i.id?i.id:!1,par:r&&r.id?r.id:!1})},!1)},last_error:function(){return this._data.core.last_error},move_node:function(i,r,u,f,e,o,s){var k,d,y,g,l,c,nt,v,a,h,p,b,tt,w;if(r=this.get_node(r),u=u===t?0:u,!r)return!1;if(!u.toString().match(/^(before|after)$/)&&!e&&!this.is_loaded(r))return this.load_node(r,function(){this.move_node(i,r,u,f,!0,!1,s)});if(n.isArray(i)){if(1!==i.length){for(k=0,d=i.length;d>k;k++)(a=this.move_node(i[k],r,u,f,e,!1,s))&&(r=a,u="after");return this.redraw(),!0}i=i[0]}if(i=i&&i.id?i:this.get_node(i),!i||i.id===n.jstree.root)return!1;if(y=(i.parent||n.jstree.root).toString(),l=u.toString().match(/^(before|after)$/)&&r.id!==n.jstree.root?this.get_node(r.parent):r,c=s?s:this._model.data[i.id]?this:n.jstree.reference(i.id),nt=!c||!c._id||this._id!==c._id,g=c&&c._id&&y&&c._model.data[y]&&c._model.data[y].children?n.inArray(i.id,c._model.data[y].children):-1,c&&c._id&&(i=c._model.data[i.id]),nt)return(a=this.copy_node(i,r,u,f,e,!1,s))?(c&&c.delete_node(i),a):!1;switch(r.id===n.jstree.root&&("before"===u&&(u="first"),"after"===u&&(u="last")),u){case"before":u=n.inArray(r.id,l.children);break;case"after":u=n.inArray(r.id,l.children)+1;break;case"inside":case"first":u=0;break;case"last":u=l.children.length;break;default:u||(u=0)}if(u>l.children.length&&(u=l.children.length),!this.check("move_node",i,l,u,{core:!0,origin:s,is_multi:c&&c._id&&c._id!==this._id,is_foreign:!c||!c._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(i.parent===l.id){for(v=l.children.concat(),a=n.inArray(i.id,v),-1!==a&&(v=n.vakata.array_remove(v,a),u>a&&u--),a=[],h=0,p=v.length;p>h;h++)a[h>=u?h+1:h]=v[h];a[u]=i.id;l.children=a;this._node_changed(l.id);this.redraw(l.id===n.jstree.root)}else{for(a=i.children_d.concat(),a.push(i.id),h=0,p=i.parents.length;p>h;h++){for(v=[],w=c._model.data[i.parents[h]].children_d,b=0,tt=w.length;tt>b;b++)-1===n.inArray(w[b],a)&&v.push(w[b]);c._model.data[i.parents[h]].children_d=v}for(c._model.data[y].children=n.vakata.array_remove_item(c._model.data[y].children,i.id),h=0,p=l.parents.length;p>h;h++)this._model.data[l.parents[h]].children_d=this._model.data[l.parents[h]].children_d.concat(a);for(v=[],h=0,p=l.children.length;p>h;h++)v[h>=u?h+1:h]=l.children[h];for(v[u]=i.id,l.children=v,l.children_d.push(i.id),l.children_d=l.children_d.concat(i.children_d),i.parent=l.id,a=l.parents.concat(),a.unshift(l.id),w=i.parents.length,i.parents=a,a=a.concat(),h=0,p=i.children_d.length;p>h;h++)this._model.data[i.children_d[h]].parents=this._model.data[i.children_d[h]].parents.slice(0,-1*w),Array.prototype.push.apply(this._model.data[i.children_d[h]].parents,a);(y===n.jstree.root||l.id===n.jstree.root)&&(this._model.force_full_redraw=!0);this._model.force_full_redraw||(this._node_changed(y),this._node_changed(l.id));o||this.redraw()}return f&&f.call(this,i,l,u),this.trigger("move_node",{node:i,parent:l.id,position:u,old_parent:y,old_position:g,is_multi:c&&c._id&&c._id!==this._id,is_foreign:!c||!c._id,old_instance:c,new_instance:this}),i.id},copy_node:function(i,r,u,f,e,o,s){var w,k,v,a,l,b,y,p,c,h,d;if(r=this.get_node(r),u=u===t?0:u,!r)return!1;if(!u.toString().match(/^(before|after)$/)&&!e&&!this.is_loaded(r))return this.load_node(r,function(){this.copy_node(i,r,u,f,!0,!1,s)});if(n.isArray(i)){if(1!==i.length){for(w=0,k=i.length;k>w;w++)(a=this.copy_node(i[w],r,u,f,e,!0,s))&&(r=a,u="after");return this.redraw(),!0}i=i[0]}if(i=i&&i.id?i:this.get_node(i),!i||i.id===n.jstree.root)return!1;switch(p=(i.parent||n.jstree.root).toString(),c=u.toString().match(/^(before|after)$/)&&r.id!==n.jstree.root?this.get_node(r.parent):r,h=s?s:this._model.data[i.id]?this:n.jstree.reference(i.id),d=!h||!h._id||this._id!==h._id,h&&h._id&&(i=h._model.data[i.id]),r.id===n.jstree.root&&("before"===u&&(u="first"),"after"===u&&(u="last")),u){case"before":u=n.inArray(r.id,c.children);break;case"after":u=n.inArray(r.id,c.children)+1;break;case"inside":case"first":u=0;break;case"last":u=c.children.length;break;default:u||(u=0)}if(u>c.children.length&&(u=c.children.length),!this.check("copy_node",i,c,u,{core:!0,origin:s,is_multi:h&&h._id&&h._id!==this._id,is_foreign:!h||!h._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if((y=h?h.get_json(i,{no_id:!0,no_data:!0,no_state:!0}):i,!y)||(y.id===!0&&delete y.id,y=this._parse_model_from_json(y,c.id,c.parents.concat()),!y))return!1;for(a=this.get_node(y),i&&i.state&&i.state.loaded===!1&&(a.state.loaded=!1),v=[],v.push(y),v=v.concat(a.children_d),this.trigger("model",{nodes:v,parent:c.id}),l=0,b=c.parents.length;b>l;l++)this._model.data[c.parents[l]].children_d=this._model.data[c.parents[l]].children_d.concat(v);for(v=[],l=0,b=c.children.length;b>l;l++)v[l>=u?l+1:l]=c.children[l];return v[u]=a.id,c.children=v,c.children_d.push(a.id),c.children_d=c.children_d.concat(a.children_d),c.id===n.jstree.root&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||this._node_changed(c.id),o||this.redraw(c.id===n.jstree.root),f&&f.call(this,a,c,u),this.trigger("copy_node",{node:a,original:i,parent:c.id,position:u,old_parent:p,old_position:h&&h._id&&p&&h._model.data[p]&&h._model.data[p].children?n.inArray(i.id,h._model.data[p].children):-1,is_multi:h&&h._id&&h._id!==this._id,is_foreign:!h||!h._id,old_instance:h,new_instance:this}),a.id},cut:function(t){if(t||(t=this._data.core.selected.concat()),n.isArray(t)||(t=[t]),!t.length)return!1;for(var o=[],i,e=0,s=t.length;s>e;e++)i=this.get_node(t[e]),i&&i.id&&i.id!==n.jstree.root&&o.push(i);return o.length?(u=o,f=this,r="move_node",void this.trigger("cut",{node:t})):!1},copy:function(t){if(t||(t=this._data.core.selected.concat()),n.isArray(t)||(t=[t]),!t.length)return!1;for(var o=[],i,e=0,s=t.length;s>e;e++)i=this.get_node(t[e]),i&&i.id&&i.id!==n.jstree.root&&o.push(i);return o.length?(u=o,f=this,r="copy_node",void this.trigger("copy",{node:t})):!1},get_buffer:function(){return{mode:r,node:u,inst:f}},can_paste:function(){return r!==!1&&u!==!1},paste:function(n,t){return n=this.get_node(n),n&&r&&r.match(/^(copy_node|move_node)$/)&&u?(this[r](u,n,t,!1,!1,!1,f)&&this.trigger("paste",{parent:n.id,node:u,mode:r}),u=!1,r=!1,void(f=!1)):!1},clear_buffer:function(){u=!1;r=!1;f=!1;this.trigger("clear_buffer")},edit:function(t,r,u){var v,l,f,h,e,c,o,a,s,y=!1;return(t=this.get_node(t))?this.check("edit",t,this.get_parent(t))?(s=t,r="string"==typeof r?r:t.text,this.set_text(t,""),t=this._open_to(t),s.text=r,v=this._data.core.rtl,l=this.element.width(),this._data.core.focused=s.id,f=t.children(".jstree-anchor").focus(),h=n("<span>"),e=r,c=n("<div />",{css:{position:"absolute",top:"-200px",left:v?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),o=n("<input />",{value:e,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver","box-sizing":"border-box",display:"inline-block",height:this._data.core.li_height+"px",lineHeight:this._data.core.li_height+"px",width:"150px"},blur:n.proxy(function(i){i.stopImmediatePropagation();i.preventDefault();var v=h.children(".jstree-rename-input"),r=v.val(),a=this.settings.core.force_text,l;""===r&&(r=e);c.remove();h.replaceWith(f);h.remove();e=a?e:n("<div><\/div>").append(n.parseHTML(e)).html();this.set_text(t,e);l=!!this.rename_node(t,a?n("<div><\/div>").text(r).text():n("<div><\/div>").append(n.parseHTML(r)).html());l||this.set_text(t,e);this._data.core.focused=s.id;setTimeout(n.proxy(function(){var n=this.get_node(s.id,!0);n.length&&(this._data.core.focused=s.id,n.children(".jstree-anchor").focus())},this),0);u&&u.call(this,s,l,y);o=null},this),keydown:function(n){var t=n.which;27===t&&(y=!0,this.value=e);(27===t||13===t||37===t||38===t||39===t||40===t||32===t)&&n.stopImmediatePropagation();(27===t||13===t)&&(n.preventDefault(),this.blur())},click:function(n){n.stopImmediatePropagation()},mousedown:function(n){n.stopImmediatePropagation()},keyup:function(){o.width(Math.min(c.text("pW"+this.value).width(),l))},keypress:function(n){if(13===n.which)return!1}}),a={fontFamily:f.css("fontFamily")||"",fontSize:f.css("fontSize")||"",fontWeight:f.css("fontWeight")||"",fontStyle:f.css("fontStyle")||"",fontStretch:f.css("fontStretch")||"",fontVariant:f.css("fontVariant")||"",letterSpacing:f.css("letterSpacing")||"",wordSpacing:f.css("wordSpacing")||""},h.attr("class",f.attr("class")).append(f.contents().clone()).append(o),f.replaceWith(h),c.css(a),o.css(a).width(Math.min(c.text("pW"+o[0].value).width(),l))[0].select(),void n(i).one("mousedown.jstree touchstart.jstree dnd_start.vakata",function(t){o&&t.target!==o&&n(o).blur()})):(this.settings.core.error.call(this,this._data.core.last_error),!1):!1},set_theme:function(t,i){if(!t)return!1;if(i===!0){var r=this.settings.core.themes.dir;r||(r=n.jstree.path+"/themes");i=r+"/"+t+"/style.css"}i&&-1===n.inArray(i,v)&&(n("head").append('<link rel="stylesheet" href="'+i+'" type="text/css" />'),v.push(i));this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name);this._data.core.themes.name=t;this.element.addClass("jstree-"+t);this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+t+"-responsive");this.trigger("set_theme",{theme:t})},get_theme:function(){return this._data.core.themes.name},set_theme_variant:function(n){this._data.core.themes.variant&&this.element.removeClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant);this._data.core.themes.variant=n;n&&this.element.addClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)},get_theme_variant:function(){return this._data.core.themes.variant},show_stripes:function(){this._data.core.themes.stripes=!0;this.get_container_ul().addClass("jstree-striped");this.trigger("show_stripes")},hide_stripes:function(){this._data.core.themes.stripes=!1;this.get_container_ul().removeClass("jstree-striped");this.trigger("hide_stripes")},toggle_stripes:function(){this._data.core.themes.stripes?this.hide_stripes():this.show_stripes()},show_dots:function(){this._data.core.themes.dots=!0;this.get_container_ul().removeClass("jstree-no-dots");this.trigger("show_dots")},hide_dots:function(){this._data.core.themes.dots=!1;this.get_container_ul().addClass("jstree-no-dots");this.trigger("hide_dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0;this.get_container_ul().removeClass("jstree-no-icons");this.trigger("show_icons")},hide_icons:function(){this._data.core.themes.icons=!1;this.get_container_ul().addClass("jstree-no-icons");this.trigger("hide_icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},show_ellipsis:function(){this._data.core.themes.ellipsis=!0;this.get_container_ul().addClass("jstree-ellipsis");this.trigger("show_ellipsis")},hide_ellipsis:function(){this._data.core.themes.ellipsis=!1;this.get_container_ul().removeClass("jstree-ellipsis");this.trigger("hide_ellipsis")},toggle_ellipsis:function(){this._data.core.themes.ellipsis?this.hide_ellipsis():this.show_ellipsis()},set_icon:function(i,r){var e,o,f,u;if(n.isArray(i)){for(i=i.slice(),e=0,o=i.length;o>e;e++)this.set_icon(i[e],r);return!0}return i=this.get_node(i),i&&i.id!==n.jstree.root?(u=i.icon,i.icon=r===!0||null===r||r===t||""===r?!0:r,f=this.get_node(i,!0).children(".jstree-anchor").children(".jstree-themeicon"),r===!1?this.hide_icon(i):r===!0||null===r||r===t||""===r?(f.removeClass("jstree-themeicon-custom "+u).css("background","").removeAttr("rel"),u===!1&&this.show_icon(i)):-1===r.indexOf("/")&&-1===r.indexOf(".")?(f.removeClass(u).css("background",""),f.addClass(r+" jstree-themeicon-custom").attr("rel",r),u===!1&&this.show_icon(i)):(f.removeClass(u).css("background",""),f.addClass("jstree-themeicon-custom").css("background","url('"+r+"') center center no-repeat").attr("rel",r),u===!1&&this.show_icon(i)),!0):!1},get_icon:function(t){return t=this.get_node(t),t&&t.id!==n.jstree.root?t.icon:!1},hide_icon:function(t){var i,r;if(n.isArray(t)){for(t=t.slice(),i=0,r=t.length;r>i;i++)this.hide_icon(t[i]);return!0}return t=this.get_node(t),t&&t!==n.jstree.root?(t.icon=!1,this.get_node(t,!0).children(".jstree-anchor").children(".jstree-themeicon").addClass("jstree-themeicon-hidden"),!0):!1},show_icon:function(t){var i,u,r;if(n.isArray(t)){for(t=t.slice(),i=0,u=t.length;u>i;i++)this.show_icon(t[i]);return!0}return t=this.get_node(t),t&&t!==n.jstree.root?(r=this.get_node(t,!0),t.icon=r.length?r.children(".jstree-anchor").children(".jstree-themeicon").attr("rel"):!0,t.icon||(t.icon=!0),r.children(".jstree-anchor").children(".jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0):!1}},n.vakata={},n.vakata.attributes=function(t,i){t=n(t)[0];var r=i?{}:[];return t&&t.attributes&&n.each(t.attributes,function(t,u){-1===n.inArray(u.name.toLowerCase(),["style","contenteditable","hasfocus","tabindex"])&&null!==u.value&&""!==n.trim(u.value)&&(i?r[u.name]=u.value:r.push(u.name))}),r},n.vakata.array_unique=function(n){for(var r=[],f={},i=0,u=n.length;u>i;i++)f[n[i]]===t&&(r.push(n[i]),f[n[i]]=!0);return r},n.vakata.array_remove=function(n,t){return n.splice(t,1),n},n.vakata.array_remove_item=function(t,i){var r=n.inArray(i,t);return-1!==r?n.vakata.array_remove(t,r):t},n.vakata.array_filter=function(n,t,i,r,u){if(n.filter)return n.filter(t,i);r=[];for(u in n)~~u+""==u+""&&u>=0&&t.call(i,n[u],+u,n)&&r.push(n[u]);return r},n.jstree.plugins.changed=function(n,t){var i=[];this.trigger=function(n,r){var u,f,e;if(r||(r={}),"changed"===n.replace(".jstree","")){for(r.changed={selected:[],deselected:[]},e={},u=0,f=i.length;f>u;u++)e[i[u]]=1;for(u=0,f=r.selected.length;f>u;u++)e[r.selected[u]]?e[r.selected[u]]=2:r.changed.selected.push(r.selected[u]);for(u=0,f=i.length;f>u;u++)1===e[i[u]]&&r.changed.deselected.push(i[u]);i=r.selected.slice()}t.trigger.call(this,n,r)};this.refresh=function(){return i=[],t.refresh.apply(this,arguments)}},s=i.createElement("I"),s.className="jstree-icon jstree-checkbox",s.setAttribute("role","presentation"),n.jstree.defaults.checkbox={visible:!0,three_state:!0,whole_node:!0,keep_selected_style:!0,cascade:"",tie_selection:!0,cascade_to_disabled:!0,cascade_to_hidden:!0},n.jstree.plugins.checkbox=function(i,r){this.bind=function(){r.bind.call(this);this._data.checkbox.uto=!1;this._data.checkbox.selected=[];this.settings.checkbox.three_state&&(this.settings.checkbox.cascade="up+down+undetermined");this.element.on("init.jstree",n.proxy(function(){this._data.checkbox.visible=this.settings.checkbox.visible;this.settings.checkbox.keep_selected_style||this.element.addClass("jstree-checkbox-no-clicked");this.settings.checkbox.tie_selection&&this.element.addClass("jstree-checkbox-selection")},this)).on("loading.jstree",n.proxy(function(){this[this._data.checkbox.visible?"show_checkboxes":"hide_checkboxes"]()},this));-1!==this.settings.checkbox.cascade.indexOf("undetermined")&&this.element.on("changed.jstree uncheck_node.jstree check_node.jstree uncheck_all.jstree check_all.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree",n.proxy(function(){this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto);this._data.checkbox.uto=setTimeout(n.proxy(this._undetermined,this),50)},this));this.settings.checkbox.tie_selection||this.element.on("model.jstree",n.proxy(function(n,t){for(var u=this._model.data,e=u[t.parent],r=t.nodes,i=0,f=r.length;f>i;i++)u[r[i]].state.checked=u[r[i]].state.checked||u[r[i]].original&&u[r[i]].original.state&&u[r[i]].original.state.checked,u[r[i]].state.checked&&this._data.checkbox.selected.push(r[i])},this));(-1!==this.settings.checkbox.cascade.indexOf("up")||-1!==this.settings.checkbox.cascade.indexOf("down"))&&this.element.on("model.jstree",n.proxy(function(t,i){var e=this._model.data,u=e[i.parent],s=i.nodes,c=[],v,r,o,h,l,a,y=this.settings.checkbox.cascade,f=this.settings.checkbox.tie_selection;if(-1!==y.indexOf("down"))if(u.state[f?"selected":"checked"]){for(r=0,o=s.length;o>r;r++)e[s[r]].state[f?"selected":"checked"]=!0;this._data[f?"core":"checkbox"].selected=this._data[f?"core":"checkbox"].selected.concat(s)}else for(r=0,o=s.length;o>r;r++)if(e[s[r]].state[f?"selected":"checked"]){for(h=0,l=e[s[r]].children_d.length;l>h;h++)e[e[s[r]].children_d[h]].state[f?"selected":"checked"]=!0;this._data[f?"core":"checkbox"].selected=this._data[f?"core":"checkbox"].selected.concat(e[s[r]].children_d)}if(-1!==y.indexOf("up")){for(r=0,o=u.children_d.length;o>r;r++)e[u.children_d[r]].children.length||c.push(e[u.children_d[r]].parent);for(c=n.vakata.array_unique(c),h=0,l=c.length;l>h;h++)for(u=e[c[h]];u&&u.id!==n.jstree.root;){for(v=0,r=0,o=u.children.length;o>r;r++)v+=e[u.children[r]].state[f?"selected":"checked"];if(v!==o)break;u.state[f?"selected":"checked"]=!0;this._data[f?"core":"checkbox"].selected.push(u.id);a=this.get_node(u,!0);a&&a.length&&a.attr("aria-selected",!0).children(".jstree-anchor").addClass(f?"jstree-clicked":"jstree-checked");u=this.get_node(u.parent)}}this._data[f?"core":"checkbox"].selected=n.vakata.array_unique(this._data[f?"core":"checkbox"].selected)},this)).on(this.settings.checkbox.tie_selection?"select_node.jstree":"check_node.jstree",n.proxy(function(t,i){for(var p=this,h=i.node,y=this._model.data,u=this.get_node(h.parent),l,c,a=this.settings.checkbox.cascade,o=this.settings.checkbox.tie_selection,f={},s=this._data[o?"core":"checkbox"].selected,v,r=0,e=s.length;e>r;r++)f[s[r]]=!0;if(-1!==a.indexOf("down")&&(v=this._cascade_new_checked_state(h.id,!0),h.children_d.concat(h.id).forEach(function(n){v.indexOf(n)>-1?f[n]=!0:delete f[n]})),-1!==a.indexOf("up"))while(u&&u.id!==n.jstree.root){for(l=0,r=0,e=u.children.length;e>r;r++)l+=y[u.children[r]].state[o?"selected":"checked"];if(l!==e)break;u.state[o?"selected":"checked"]=!0;f[u.id]=!0;c=this.get_node(u,!0);c&&c.length&&c.attr("aria-selected",!0).children(".jstree-anchor").addClass(o?"jstree-clicked":"jstree-checked");u=this.get_node(u.parent)}s=[];for(r in f)f.hasOwnProperty(r)&&s.push(r);this._data[o?"core":"checkbox"].selected=s},this)).on(this.settings.checkbox.tie_selection?"deselect_all.jstree":"uncheck_all.jstree",n.proxy(function(){for(var r=this.get_node(n.jstree.root),f=this._model.data,t,i=0,u=r.children_d.length;u>i;i++)t=f[r.children_d[i]],t&&t.original&&t.original.state&&t.original.state.undetermined&&(t.original.state.undetermined=!1)},this)).on(this.settings.checkbox.tie_selection?"deselect_node.jstree":"uncheck_node.jstree",n.proxy(function(n,t){var l=this,r=t.node,a=this.get_node(r,!0),f,o,i,s=this.settings.checkbox.cascade,e=this.settings.checkbox.tie_selection,u=this._data[e?"core":"checkbox"].selected,c=r.children_d.concat(r.id),h;if(-1!==s.indexOf("down")&&(h=this._cascade_new_checked_state(r.id,!1),u=u.filter(function(n){return-1===c.indexOf(n)||h.indexOf(n)>-1})),-1!==s.indexOf("up")&&-1===u.indexOf(r.id)){for(f=0,o=r.parents.length;o>f;f++)i=this._model.data[r.parents[f]],i.state[e?"selected":"checked"]=!1,i&&i.original&&i.original.state&&i.original.state.undetermined&&(i.original.state.undetermined=!1),i=this.get_node(r.parents[f],!0),i&&i.length&&i.attr("aria-selected",!1).children(".jstree-anchor").removeClass(e?"jstree-clicked":"jstree-checked");u=u.filter(function(n){return-1===r.parents.indexOf(n)})}this._data[e?"core":"checkbox"].selected=u},this));-1!==this.settings.checkbox.cascade.indexOf("up")&&this.element.on("delete_node.jstree",n.proxy(function(t,i){for(var r=this.get_node(i.parent),h=this._model.data,f,e,s,o,u=this.settings.checkbox.tie_selection;r&&r.id!==n.jstree.root&&!r.state[u?"selected":"checked"];){for(s=0,f=0,e=r.children.length;e>f;f++)s+=h[r.children[f]].state[u?"selected":"checked"];if(!(e>0&&s===e))break;r.state[u?"selected":"checked"]=!0;this._data[u?"core":"checkbox"].selected.push(r.id);o=this.get_node(r,!0);o&&o.length&&o.attr("aria-selected",!0).children(".jstree-anchor").addClass(u?"jstree-clicked":"jstree-checked");r=this.get_node(r.parent)}},this)).on("move_node.jstree",n.proxy(function(t,i){var c=i.is_multi,l=i.old_parent,a=this.get_node(i.parent),h=this._model.data,r,s,e,o,f,u=this.settings.checkbox.tie_selection;if(!c)for(r=this.get_node(l);r&&r.id!==n.jstree.root&&!r.state[u?"selected":"checked"];){for(s=0,e=0,o=r.children.length;o>e;e++)s+=h[r.children[e]].state[u?"selected":"checked"];if(!(o>0&&s===o))break;r.state[u?"selected":"checked"]=!0;this._data[u?"core":"checkbox"].selected.push(r.id);f=this.get_node(r,!0);f&&f.length&&f.attr("aria-selected",!0).children(".jstree-anchor").addClass(u?"jstree-clicked":"jstree-checked");r=this.get_node(r.parent)}for(r=a;r&&r.id!==n.jstree.root;){for(s=0,e=0,o=r.children.length;o>e;e++)s+=h[r.children[e]].state[u?"selected":"checked"];if(s===o)r.state[u?"selected":"checked"]||(r.state[u?"selected":"checked"]=!0,this._data[u?"core":"checkbox"].selected.push(r.id),f=this.get_node(r,!0),f&&f.length&&f.attr("aria-selected",!0).children(".jstree-anchor").addClass(u?"jstree-clicked":"jstree-checked"));else{if(!r.state[u?"selected":"checked"])break;r.state[u?"selected":"checked"]=!1;this._data[u?"core":"checkbox"].selected=n.vakata.array_remove_item(this._data[u?"core":"checkbox"].selected,r.id);f=this.get_node(r,!0);f&&f.length&&f.attr("aria-selected",!1).children(".jstree-anchor").removeClass(u?"jstree-clicked":"jstree-checked")}r=this.get_node(r.parent)}},this))};this._undetermined=function(){if(null!==this.element){for(var i,h,f={},e=this._model.data,c=this.settings.checkbox.tie_selection,u=this._data[c?"core":"checkbox"].selected,o=[],l=this,r=0,s=u.length;s>r;r++)if(e[u[r]]&&e[u[r]].parents)for(i=0,h=e[u[r]].parents.length;h>i;i++){if(f[e[u[r]].parents[i]]!==t)break;e[u[r]].parents[i]!==n.jstree.root&&(f[e[u[r]].parents[i]]=!0,o.push(e[u[r]].parents[i]))}for(this.element.find(".jstree-closed").not(":has(.jstree-children)").each(function(){var u=l.get_node(this),c;if(u)if(u.state.loaded){for(r=0,s=u.children_d.length;s>r;r++)if(c=e[u.children_d[r]],!c.state.loaded&&c.original&&c.original.state&&c.original.state.undetermined&&c.original.state.undetermined===!0)for(f[c.id]===t&&c.id!==n.jstree.root&&(f[c.id]=!0,o.push(c.id)),i=0,h=c.parents.length;h>i;i++)f[c.parents[i]]===t&&c.parents[i]!==n.jstree.root&&(f[c.parents[i]]=!0,o.push(c.parents[i]))}else if(u.original&&u.original.state&&u.original.state.undetermined&&u.original.state.undetermined===!0)for(f[u.id]===t&&u.id!==n.jstree.root&&(f[u.id]=!0,o.push(u.id)),i=0,h=u.parents.length;h>i;i++)f[u.parents[i]]===t&&u.parents[i]!==n.jstree.root&&(f[u.parents[i]]=!0,o.push(u.parents[i]))}),this.element.find(".jstree-undetermined").removeClass("jstree-undetermined"),r=0,s=o.length;s>r;r++)e[o[r]].state[c?"selected":"checked"]||(u=this.get_node(o[r],!0),u&&u.length&&u.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-undetermined"))}};this.redraw_node=function(t,i,u){if(t=r.redraw_node.apply(this,arguments)){for(var e=null,o=null,f=0,h=t.childNodes.length;h>f;f++)if(t.childNodes[f]&&t.childNodes[f].className&&-1!==t.childNodes[f].className.indexOf("jstree-anchor")){e=t.childNodes[f];break}e&&(!this.settings.checkbox.tie_selection&&this._model.data[t.id].state.checked&&(e.className+=" jstree-checked"),o=s.cloneNode(!1),this._model.data[t.id].state.checkbox_disabled&&(o.className+=" jstree-checkbox-disabled"),e.insertBefore(o,e.childNodes[0]))}return u||-1===this.settings.checkbox.cascade.indexOf("undetermined")||(this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(n.proxy(this._undetermined,this),50)),t};this.show_checkboxes=function(){this._data.core.themes.checkboxes=!0;this.get_container_ul().removeClass("jstree-no-checkboxes")};this.hide_checkboxes=function(){this._data.core.themes.checkboxes=!1;this.get_container_ul().addClass("jstree-no-checkboxes")};this.toggle_checkboxes=function(){this._data.core.themes.checkboxes?this.hide_checkboxes():this.show_checkboxes()};this.is_undetermined=function(t){t=this.get_node(t);var r=this.settings.checkbox.cascade,i,u,f=this.settings.checkbox.tie_selection,o=this._data[f?"core":"checkbox"].selected,e=this._model.data;if(!t||t.state[f?"selected":"checked"]===!0||-1===r.indexOf("undetermined")||-1===r.indexOf("down")&&-1===r.indexOf("up"))return!1;if(!t.state.loaded&&t.original.state.undetermined===!0)return!0;for(i=0,u=t.children_d.length;u>i;i++)if(-1!==n.inArray(t.children_d[i],o)||!e[t.children_d[i]].state.loaded&&e[t.children_d[i]].original.state.undetermined)return!0;return!1};this.disable_checkbox=function(t){var i,u,r;if(n.isArray(t)){for(t=t.slice(),i=0,u=t.length;u>i;i++)this.disable_checkbox(t[i]);return!0}return t=this.get_node(t),t&&t.id!==n.jstree.root?(r=this.get_node(t,!0),void(t.state.checkbox_disabled||(t.state.checkbox_disabled=!0,r&&r.length&&r.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-checkbox-disabled"),this.trigger("disable_checkbox",{node:t})))):!1};this.enable_checkbox=function(t){var i,u,r;if(n.isArray(t)){for(t=t.slice(),i=0,u=t.length;u>i;i++)this.enable_checkbox(t[i]);return!0}return t=this.get_node(t),t&&t.id!==n.jstree.root?(r=this.get_node(t,!0),void(t.state.checkbox_disabled&&(t.state.checkbox_disabled=!1,r&&r.length&&r.children(".jstree-anchor").children(".jstree-checkbox").removeClass("jstree-checkbox-disabled"),this.trigger("enable_checkbox",{node:t})))):!1};this.activate_node=function(t,i){return n(i.target).hasClass("jstree-checkbox-disabled")?!1:(this.settings.checkbox.tie_selection&&(this.settings.checkbox.whole_node||n(i.target).hasClass("jstree-checkbox"))&&(i.ctrlKey=!0),this.settings.checkbox.tie_selection||!this.settings.checkbox.whole_node&&!n(i.target).hasClass("jstree-checkbox")?r.activate_node.call(this,t,i):this.is_disabled(t)?!1:(this.is_checked(t)?this.uncheck_node(t,i):this.check_node(t,i),void this.trigger("activate_node",{node:this.get_node(t)})))};this._cascade_new_checked_state=function(n,t){var h=this,r=this.settings.checkbox.tie_selection,i=this._model.data[n],u=[],f=[],o,e,s;return!this.settings.checkbox.cascade_to_disabled&&i.state.disabled||!this.settings.checkbox.cascade_to_hidden&&i.state.hidden?(o=this.get_checked_descendants(n),i.state[r?"selected":"checked"]&&o.push(i.id),u=u.concat(o)):(i.children&&i.children.forEach(function(n){var i=h._cascade_new_checked_state(n,t);u=u.concat(i);i.indexOf(n)>-1&&f.push(n)}),e=h.get_node(i,!0),s=f.length>0&&f.length<i.children.length,i.original&&i.original.state&&i.original.state.undetermined&&(i.original.state.undetermined=s),s?(i.state[r?"selected":"checked"]=!1,e.attr("aria-selected",!1).children(".jstree-anchor").removeClass(r?"jstree-clicked":"jstree-checked")):t&&f.length===i.children.length?(i.state[r?"selected":"checked"]=t,u.push(i.id),e.attr("aria-selected",!0).children(".jstree-anchor").addClass(r?"jstree-clicked":"jstree-checked")):(i.state[r?"selected":"checked"]=!1,e.attr("aria-selected",!1).children(".jstree-anchor").removeClass(r?"jstree-clicked":"jstree-checked"))),u};this.get_checked_descendants=function(n){var t=this,i=t.settings.checkbox.tie_selection,r=t._model.data[n];return r.children_d.filter(function(n){return t._model.data[n].state[i?"selected":"checked"]})};this.check_node=function(t,i){if(this.settings.checkbox.tie_selection)return this.select_node(t,!1,!0,i);var r,u,f;if(n.isArray(t)){for(t=t.slice(),u=0,f=t.length;f>u;u++)this.check_node(t[u],i);return!0}return t=this.get_node(t),t&&t.id!==n.jstree.root?(r=this.get_node(t,!0),void(t.state.checked||(t.state.checked=!0,this._data.checkbox.selected.push(t.id),r&&r.length&&r.children(".jstree-anchor").addClass("jstree-checked"),this.trigger("check_node",{node:t,selected:this._data.checkbox.selected,event:i})))):!1};this.uncheck_node=function(t,i){if(this.settings.checkbox.tie_selection)return this.deselect_node(t,!1,i);var r,f,u;if(n.isArray(t)){for(t=t.slice(),r=0,f=t.length;f>r;r++)this.uncheck_node(t[r],i);return!0}return t=this.get_node(t),t&&t.id!==n.jstree.root?(u=this.get_node(t,!0),void(t.state.checked&&(t.state.checked=!1,this._data.checkbox.selected=n.vakata.array_remove_item(this._data.checkbox.selected,t.id),u.length&&u.children(".jstree-anchor").removeClass("jstree-checked"),this.trigger("uncheck_node",{node:t,selected:this._data.checkbox.selected,event:i})))):!1};this.check_all=function(){if(this.settings.checkbox.tie_selection)return this.select_all();var r=this._data.checkbox.selected.concat([]),t,i;for(this._data.checkbox.selected=this._model.data[n.jstree.root].children_d.concat(),t=0,i=this._data.checkbox.selected.length;i>t;t++)this._model.data[this._data.checkbox.selected[t]]&&(this._model.data[this._data.checkbox.selected[t]].state.checked=!0);this.redraw(!0);this.trigger("check_all",{selected:this._data.checkbox.selected})};this.uncheck_all=function(){if(this.settings.checkbox.tie_selection)return this.deselect_all();for(var i=this._data.checkbox.selected.concat([]),n=0,t=this._data.checkbox.selected.length;t>n;n++)this._model.data[this._data.checkbox.selected[n]]&&(this._model.data[this._data.checkbox.selected[n]].state.checked=!1);this._data.checkbox.selected=[];this.element.find(".jstree-checked").removeClass("jstree-checked");this.trigger("uncheck_all",{selected:this._data.checkbox.selected,node:i})};this.is_checked=function(t){return this.settings.checkbox.tie_selection?this.is_selected(t):(t=this.get_node(t),t&&t.id!==n.jstree.root?t.state.checked:!1)};this.get_checked=function(t){return this.settings.checkbox.tie_selection?this.get_selected(t):t?n.map(this._data.checkbox.selected,n.proxy(function(n){return this.get_node(n)},this)):this._data.checkbox.selected};this.get_top_checked=function(t){if(this.settings.checkbox.tie_selection)return this.get_top_selected(t);for(var r=this.get_checked(!0),u={},f,o,i=0,e=r.length;e>i;i++)u[r[i].id]=r[i];for(i=0,e=r.length;e>i;i++)for(f=0,o=r[i].children_d.length;o>f;f++)u[r[i].children_d[f]]&&delete u[r[i].children_d[f]];r=[];for(i in u)u.hasOwnProperty(i)&&r.push(i);return t?n.map(r,n.proxy(function(n){return this.get_node(n)},this)):r};this.get_bottom_checked=function(t){if(this.settings.checkbox.tie_selection)return this.get_bottom_selected(t);for(var r=this.get_checked(!0),u=[],i=0,f=r.length;f>i;i++)r[i].children.length||u.push(r[i].id);return t?n.map(u,n.proxy(function(n){return this.get_node(n)},this)):u};this.load_node=function(t){var u,f,e,i;if(!n.isArray(t)&&!this.settings.checkbox.tie_selection&&(i=this.get_node(t),i&&i.state.loaded))for(u=0,f=i.children_d.length;f>u;u++)this._model.data[i.children_d[u]].state.checked&&(e=!0,this._data.checkbox.selected=n.vakata.array_remove_item(this._data.checkbox.selected,i.children_d[u]));return r.load_node.apply(this,arguments)};this.get_state=function(){var n=r.get_state.apply(this,arguments);return this.settings.checkbox.tie_selection?n:(n.checkbox=this._data.checkbox.selected.slice(),n)};this.set_state=function(t,i){var u=r.set_state.apply(this,arguments),f;return u&&t.checkbox?(this.settings.checkbox.tie_selection||(this.uncheck_all(),f=this,n.each(t.checkbox,function(n,t){f.check_node(t)})),delete t.checkbox,this.set_state(t,i),!1):u};this.refresh=function(){return this.settings.checkbox.tie_selection||(this._data.checkbox.selected=[]),r.refresh.apply(this,arguments)}},n.jstree.defaults.conditionalselect=function(){return!0},n.jstree.plugins.conditionalselect=function(n,t){this.activate_node=function(n,i){this.settings.conditionalselect.call(this,this.get_node(n),i)&&t.activate_node.call(this,n,i)}},n.jstree.defaults.contextmenu={select_node:!0,show_at_node:!0,items:function(){return{create:{separator_before:!1,separator_after:!0,_disabled:!1,label:"Create",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.create_node(r,{},"last",function(n){try{i.edit(n)}catch(t){setTimeout(function(){i.edit(n)},0)}})}},rename:{separator_before:!1,separator_after:!1,_disabled:!1,label:"Rename",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.edit(r)}},remove:{separator_before:!1,icon:!1,separator_after:!1,_disabled:!1,label:"Delete",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.is_selected(r)?i.delete_node(i.get_selected()):i.delete_node(r)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.is_selected(r)?i.cut(i.get_top_selected()):i.cut(r)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.is_selected(r)?i.copy(i.get_top_selected()):i.copy(r)}},paste:{separator_before:!1,icon:!1,_disabled:function(t){return!n.jstree.reference(t.reference).can_paste()},separator_after:!1,label:"Paste",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.paste(r)}}}}}}},n.jstree.plugins.contextmenu=function(r,u){this.bind=function(){u.bind.call(this);var r=0,t=null,f,e;this.element.on("init.jstree loading.jstree ready.jstree",n.proxy(function(){this.get_container_ul().addClass("jstree-contextmenu")},this)).on("contextmenu.jstree",".jstree-anchor",n.proxy(function(n,i){"input"!==n.target.tagName.toLowerCase()&&(n.preventDefault(),r=n.ctrlKey?+new Date:0,(i||t)&&(r=+new Date+1e4),t&&clearTimeout(t),this.is_loading(n.currentTarget)||this.show_contextmenu(n.currentTarget,n.pageX,n.pageY,n))},this)).on("click.jstree",".jstree-anchor",n.proxy(function(){this._data.contextmenu.visible&&(!r||+new Date-r>250)&&n.vakata.context.hide();r=0},this)).on("touchstart.jstree",".jstree-anchor",function(i){i.originalEvent&&i.originalEvent.changedTouches&&i.originalEvent.changedTouches[0]&&(f=i.originalEvent.changedTouches[0].clientX,e=i.originalEvent.changedTouches[0].clientY,t=setTimeout(function(){n(i.currentTarget).trigger("contextmenu",!0)},750))}).on("touchmove.vakata.jstree",function(n){t&&n.originalEvent&&n.originalEvent.changedTouches&&n.originalEvent.changedTouches[0]&&(Math.abs(f-n.originalEvent.changedTouches[0].clientX)>50||Math.abs(e-n.originalEvent.changedTouches[0].clientY)>50)&&clearTimeout(t)}).on("touchend.vakata.jstree",function(){t&&clearTimeout(t)});n(i).on("context_hide.vakata.jstree",n.proxy(function(t,i){this._data.contextmenu.visible=!1;n(i.reference).removeClass("jstree-context")},this))};this.teardown=function(){this._data.contextmenu.visible&&n.vakata.context.hide();u.teardown.call(this)};this.show_contextmenu=function(i,r,u,f){if(i=this.get_node(i),!i||i.id===n.jstree.root)return!1;var s=this.settings.contextmenu,h=this.get_node(i,!0),c=h.children(".jstree-anchor"),o=!1,e=!1;(s.show_at_node||r===t||u===t)&&(o=c.offset(),r=o.left,u=o.top+this._data.core.li_height);this.settings.contextmenu.select_node&&!this.is_selected(i)&&this.activate_node(i,f);e=s.items;n.isFunction(e)&&(e=e.call(this,i,n.proxy(function(n){this._show_contextmenu(i,r,u,n)},this)));n.isPlainObject(e)&&this._show_contextmenu(i,r,u,e)};this._show_contextmenu=function(t,r,u,f){var o=this.get_node(t,!0),e=o.children(".jstree-anchor");n(i).one("context_show.vakata.jstree",n.proxy(function(t,i){var r="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";n(i.element).addClass(r);e.addClass("jstree-context")},this));this._data.contextmenu.visible=!0;n.vakata.context.show(e,{x:r,y:u},f);this.trigger("show_contextmenu",{node:t,x:r,y:u})}},function(n){var r=!1,t={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};n.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(r){n(i).triggerHandler("context_"+r+".vakata",{reference:t.reference,element:t.element,position:{x:t.position_x,y:t.position_y}})},_execute:function(i){return i=t.items[i],i&&(!i._disabled||n.isFunction(i._disabled)&&!i._disabled({item:i,reference:t.reference,element:t.element}))&&i.action?i.action.call(null,{item:i,reference:t.reference,element:t.element,position:{x:t.position_x,y:t.position_y}}):!1},_parse:function(i,r){if(!i)return!1;r||(t.html="",t.items=[]);var u="",f=!1,e;return r&&(u+="<ul>"),n.each(i,function(i,r){return r?(t.items.push(r),!f&&r.separator_before&&(u+="<li class='vakata-context-separator'><a href='#' "+(n.vakata.context.settings.icons?"":'style="margin-left:0px;"')+">&#160;<\/a><\/li>"),f=!1,u+="<li class='"+(r._class||"")+(r._disabled===!0||n.isFunction(r._disabled)&&r._disabled({item:r,reference:t.reference,element:t.element})?" vakata-contextmenu-disabled ":"")+"' "+(r.shortcut?" data-shortcut='"+r.shortcut+"' ":"")+">",u+="<a href='#' rel='"+(t.items.length-1)+"' "+(r.title?"title='"+r.title+"'":"")+">",n.vakata.context.settings.icons&&(u+="<i ",r.icon&&(u+=-1!==r.icon.indexOf("/")||-1!==r.icon.indexOf(".")?" style='background:url(\""+r.icon+"\") center center no-repeat' ":" class='"+r.icon+"' "),u+="><\/i><span class='vakata-contextmenu-sep'>&#160;<\/span>"),u+=(n.isFunction(r.label)?r.label({item:i,reference:t.reference,element:t.element}):r.label)+(r.shortcut?' <span class="vakata-contextmenu-shortcut vakata-contextmenu-shortcut-'+r.shortcut+'">'+(r.shortcut_label||"")+"<\/span>":"")+"<\/a>",r.submenu&&(e=n.vakata.context._parse(r.submenu,!0),e&&(u+=e)),u+="<\/li>",void(r.separator_after&&(u+="<li class='vakata-context-separator'><a href='#' "+(n.vakata.context.settings.icons?"":'style="margin-left:0px;"')+">&#160;<\/a><\/li>",f=!0))):!0}),u=u.replace(/<li class\='vakata-context-separator'\><\/li\>$/,""),r&&(u+="<\/ul>"),r||(t.html=u,n.vakata.context._trigger("parse")),u.length>10?u:!1},_show_submenu:function(t){if(t=n(t),t.length&&t.children("ul").length){var i=t.children("ul"),e=t.offset().left,f=e+t.outerWidth(),s=t.offset().top,u=i.width(),h=i.height(),o=n(window).width()+n(window).scrollLeft(),c=n(window).height()+n(window).scrollTop();r?t[f-(u+10+t.outerWidth())<0?"addClass":"removeClass"]("vakata-context-left"):t[f+u>o&&e>o-f?"addClass":"removeClass"]("vakata-context-right");s+h+10>c&&i.css("bottom","-1px");t.hasClass("vakata-context-right")?u>e&&i.css("margin-right",e-u):u>o-f&&i.css("margin-left",o-f-u);i.show()}},show:function(i,u,f){var h,o,e,s,c,l,a,v;switch(t.element&&t.element.length&&t.element.width(""),!0){case!u&&!i:return!1;case!!u&&!!i:t.reference=i;t.position_x=u.x;t.position_y=u.y;break;case!u&&!!i:t.reference=i;h=i.offset();t.position_x=h.left+i.outerHeight();t.position_y=h.top;break;case!!u&&!i:t.position_x=u.x;t.position_y=u.y}i&&!f&&n(i).data("vakata_contextmenu")&&(f=n(i).data("vakata_contextmenu"));n.vakata.context._parse(f)&&t.element.html(t.html);t.items.length&&(t.element.appendTo("body"),o=t.element,e=t.position_x,s=t.position_y,c=o.width(),l=o.height(),a=n(window).width()+n(window).scrollLeft(),v=n(window).height()+n(window).scrollTop(),r&&(e-=o.outerWidth()-n(i).outerWidth(),e<n(window).scrollLeft()+20&&(e=n(window).scrollLeft()+20)),e+c+20>a&&(e=a-(c+20)),s+l+20>v&&(s=v-(l+20)),t.element.css({left:e,top:s}).show().find("a").first().focus().parent().addClass("vakata-context-hover"),t.is_visible=!0,n.vakata.context._trigger("show"))},hide:function(){t.is_visible&&(t.element.hide().find("ul").hide().end().find(":focus").blur().end().detach(),t.is_visible=!1,n.vakata.context._trigger("hide"))}};n(function(){r="rtl"===n("body").css("direction");var u=!1;t.element=n("<ul class='vakata-context'><\/ul>");t.element.on("mouseenter","li",function(i){i.stopImmediatePropagation();n.contains(this,i.relatedTarget)||(u&&clearTimeout(u),t.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),n(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),n.vakata.context._show_submenu(this))}).on("mouseleave","li",function(t){n.contains(this,t.relatedTarget)||n(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(){n(this).find(".vakata-context-hover").removeClass("vakata-context-hover");n.vakata.context.settings.hide_onmouseleave&&(u=setTimeout(function(){return function(){n.vakata.context.hide()}}(this),n.vakata.context.settings.hide_onmouseleave))}).on("click","a",function(t){t.preventDefault();n(this).blur().parent().hasClass("vakata-context-disabled")||n.vakata.context._execute(n(this).attr("rel"))===!1||n.vakata.context.hide()}).on("keydown","a",function(i){var r=null;switch(i.which){case 13:case 32:i.type="click";i.preventDefault();n(i.currentTarget).trigger(i);break;case 37:t.is_visible&&(t.element.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").focus(),i.stopImmediatePropagation(),i.preventDefault());break;case 38:t.is_visible&&(r=t.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first(),r.length||(r=t.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()),r.addClass("vakata-context-hover").children("a").focus(),i.stopImmediatePropagation(),i.preventDefault());break;case 39:t.is_visible&&(t.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").focus(),i.stopImmediatePropagation(),i.preventDefault());break;case 40:t.is_visible&&(r=t.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first(),r.length||(r=t.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()),r.addClass("vakata-context-hover").children("a").focus(),i.stopImmediatePropagation(),i.preventDefault());break;case 27:n.vakata.context.hide();i.preventDefault()}}).on("keydown",function(n){n.preventDefault();var i=t.element.find(".vakata-contextmenu-shortcut-"+n.which).parent();i.parent().not(".vakata-context-disabled")&&i.click()});n(i).on("mousedown.vakata.jstree",function(i){t.is_visible&&t.element[0]!==i.target&&!n.contains(t.element[0],i.target)&&n.vakata.context.hide()}).on("context_show.vakata.jstree",function(){t.element.find("li:has(ul)").children("a").addClass("vakata-context-parent");r&&t.element.addClass("vakata-context-rtl").css("direction","rtl");t.element.find("ul").hide().end()})})}(n),n.jstree.defaults.dnd={copy:!0,open_timeout:500,is_draggable:!0,check_while_dragging:!0,always_copy:!1,inside_pos:0,drag_selection:!0,touch:!0,large_drop_target:!1,large_drag_target:!1,use_html5:!1},n.jstree.plugins.dnd=function(t,r){this.init=function(n,t){r.init.call(this,n,t);this.settings.dnd.use_html5=this.settings.dnd.use_html5&&"draggable"in i.createElement("span")};this.bind=function(){r.bind.call(this);this.element.on(this.settings.dnd.use_html5?"dragstart.jstree":"mousedown.jstree touchstart.jstree",this.settings.dnd.large_drag_target?".jstree-node":".jstree-anchor",n.proxy(function(t){if(this.settings.dnd.large_drag_target&&n(t.target).closest(".jstree-node")[0]!==t.currentTarget||"touchstart"===t.type&&(!this.settings.dnd.touch||"selected"===this.settings.dnd.touch&&!n(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").hasClass("jstree-clicked")))return!0;var i=this.get_node(t.target),r=this.is_selected(i)&&this.settings.dnd.drag_selection?this.get_top_selected().length:1,u=r>1?r+" "+this.get_string("nodes"):this.get_text(t.currentTarget);if(this.settings.core.force_text&&(u=n.vakata.html.escape(u)),i&&i.id&&i.id!==n.jstree.root&&(1===t.which||"touchstart"===t.type||"dragstart"===t.type)&&(this.settings.dnd.is_draggable===!0||n.isFunction(this.settings.dnd.is_draggable)&&this.settings.dnd.is_draggable.call(this,r>1?this.get_top_selected(!0):[i],t))){if(o={jstree:!0,origin:this,obj:this.get_node(i,!0),nodes:r>1?this.get_top_selected():[i.id]},h=t.currentTarget,!this.settings.dnd.use_html5)return this.element.trigger("mousedown.jstree"),n.vakata.dnd.start(t,o,'<div id="jstree-dnd" class="jstree-'+this.get_theme()+" jstree-"+this.get_theme()+"-"+this.get_theme_variant()+" "+(this.settings.core.themes.responsive?" jstree-dnd-responsive":"")+'"><i class="jstree-icon jstree-er"><\/i>'+u+'<ins class="jstree-copy" style="display:none;">+<\/ins><\/div>');n.vakata.dnd._trigger("start",t,{helper:n(),element:h,data:o})}},this));this.settings.dnd.use_html5&&this.element.on("dragover.jstree",function(t){return t.preventDefault(),n.vakata.dnd._trigger("move",t,{helper:n(),element:h,data:o}),!1}).on("drop.jstree",n.proxy(function(t){return t.preventDefault(),n.vakata.dnd._trigger("stop",t,{helper:n(),element:h,data:o}),!1},this))};this.redraw_node=function(n){if(n=r.redraw_node.apply(this,arguments),n&&this.settings.dnd.use_html5)if(this.settings.dnd.large_drag_target)n.setAttribute("draggable",!0);else{for(var i=null,t=0,u=n.childNodes.length;u>t;t++)if(n.childNodes[t]&&n.childNodes[t].className&&-1!==n.childNodes[t].className.indexOf("jstree-anchor")){i=n.childNodes[t];break}i&&i.setAttribute("draggable",!0)}return n}},n(function(){var r=!1,o=!1,u=!1,f=!1,e=n('<div id="jstree-marker">&#160;<\/div>').hide();n(i).on("dnd_start.vakata.jstree",function(n,t){r=!1;u=!1;t&&t.data&&t.data.jstree&&e.appendTo("body")}).on("dnd_move.vakata.jstree",function(i,s){var ot=s.event.target!==u.target;if(f&&(!s.event||"dragover"!==s.event.type||ot)&&clearTimeout(f),s&&s.data&&s.data.jstree&&(!s.event.target.id||"jstree-marker"!==s.event.target.id)){u=s.event;var h=n.jstree.reference(s.event.target),c=!1,v=!1,d=!1,g,nt,p,y,w,tt,a,l,it,ft,rt,st,b,k,ut,et;if(h&&h._data&&h._data.dnd)if(e.attr("class","jstree-"+h.get_theme()+(h.settings.core.themes.responsive?" jstree-dnd-responsive":"")),ut=s.data.origin&&(s.data.origin.settings.dnd.always_copy||s.data.origin.settings.dnd.copy&&(s.event.metaKey||s.event.ctrlKey)),s.helper.children().attr("class","jstree-"+h.get_theme()+" jstree-"+h.get_theme()+"-"+h.get_theme_variant()+" "+(h.settings.core.themes.responsive?" jstree-dnd-responsive":"")).find(".jstree-copy").first()[ut?"show":"hide"](),s.event.target!==h.element[0]&&s.event.target!==h.get_container_ul()[0]||0!==h.get_container_ul().children().length){if(c=h.settings.dnd.large_drop_target?n(s.event.target).closest(".jstree-node").children(".jstree-anchor"):n(s.event.target).closest(".jstree-anchor"),c&&c.length&&c.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(v=c.offset(),d=(s.event.pageY!==t?s.event.pageY:s.event.originalEvent.pageY)-v.top,p=c.outerHeight(),tt=p/3>d?["b","i","a"]:d>p-p/3?["a","i","b"]:d>p/2?["i","a","b"]:["i","b","a"],n.each(tt,function(t,i){switch(i){case"b":g=v.left-6;nt=v.top;y=h.get_parent(c);w=c.parent().index();break;case"i":b=h.settings.dnd.inside_pos;k=h.get_node(c.parent());g=v.left-2;nt=v.top+p/2+1;y=k.id;w="first"===b?0:"last"===b?k.children.length:Math.min(b,k.children.length);break;case"a":g=v.left-6;nt=v.top+p;y=h.get_parent(c);w=c.parent().index()+1}for(a=!0,l=0,it=s.data.nodes.length;it>l;l++)if(ft=s.data.origin&&(s.data.origin.settings.dnd.always_copy||s.data.origin.settings.dnd.copy&&(s.event.metaKey||s.event.ctrlKey))?"copy_node":"move_node",rt=w,"move_node"===ft&&"a"===i&&s.data.origin&&s.data.origin===h&&y===h.get_parent(s.data.nodes[l])&&(st=h.get_node(y),rt>n.inArray(s.data.nodes[l],st.children)&&(rt-=1)),a=a&&(h&&h.settings&&h.settings.dnd&&h.settings.dnd.check_while_dragging===!1||h.check(ft,s.data.origin&&s.data.origin!==h?s.data.origin.get_node(s.data.nodes[l]):s.data.nodes[l],y,rt,{dnd:!0,ref:h.get_node(c.parent()),pos:i,origin:s.data.origin,is_multi:s.data.origin&&s.data.origin!==h,is_foreign:!s.data.origin})),!a){h&&h.last_error&&(o=h.last_error());break}return"i"===i&&c.parent().is(".jstree-closed")&&h.settings.dnd.open_timeout&&(!s.event||"dragover"!==s.event.type||ot)&&(f&&clearTimeout(f),f=setTimeout(function(n,t){return function(){n.open_node(t)}}(h,c),h.settings.dnd.open_timeout)),a?(et=h.get_node(y,!0),et.hasClass(".jstree-dnd-parent")||(n(".jstree-dnd-parent").removeClass("jstree-dnd-parent"),et.addClass("jstree-dnd-parent")),r={ins:h,par:y,pos:"i"!==i||"last"!==b||0!==w||h.is_loaded(k)?w:"last"},e.css({left:g+"px",top:nt+"px"}).show(),s.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),s.event.originalEvent&&s.event.originalEvent.dataTransfer&&(s.event.originalEvent.dataTransfer.dropEffect=ut?"copy":"move"),o={},tt=!0,!1):void 0}),tt===!0))return}else{for(a=!0,l=0,it=s.data.nodes.length;it>l;l++)if(a=a&&h.check(s.data.origin&&(s.data.origin.settings.dnd.always_copy||s.data.origin.settings.dnd.copy&&(s.event.metaKey||s.event.ctrlKey))?"copy_node":"move_node",s.data.origin&&s.data.origin!==h?s.data.origin.get_node(s.data.nodes[l]):s.data.nodes[l],n.jstree.root,"last",{dnd:!0,ref:h.get_node(n.jstree.root),pos:"i",origin:s.data.origin,is_multi:s.data.origin&&s.data.origin!==h,is_foreign:!s.data.origin}),!a)break;if(a)return r={ins:h,par:n.jstree.root,pos:"last"},e.hide(),s.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),void(s.event.originalEvent&&s.event.originalEvent.dataTransfer&&(s.event.originalEvent.dataTransfer.dropEffect=ut?"copy":"move"))}n(".jstree-dnd-parent").removeClass("jstree-dnd-parent");r=!1;s.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er");s.event.originalEvent&&s.event.originalEvent.dataTransfer&&(s.event.originalEvent.dataTransfer.dropEffect="none");e.hide()}}).on("dnd_scroll.vakata.jstree",function(n,t){t&&t.data&&t.data.jstree&&(e.hide(),r=!1,u=!1,t.helper.find(".jstree-icon").first().removeClass("jstree-ok").addClass("jstree-er"))}).on("dnd_stop.vakata.jstree",function(t,i){if(n(".jstree-dnd-parent").removeClass("jstree-dnd-parent"),f&&clearTimeout(f),i&&i.data&&i.data.jstree){e.hide().detach();var s,h,c=[];if(r){for(s=0,h=i.data.nodes.length;h>s;s++)c[s]=i.data.origin?i.data.origin.get_node(i.data.nodes[s]):i.data.nodes[s];r.ins[i.data.origin&&(i.data.origin.settings.dnd.always_copy||i.data.origin.settings.dnd.copy&&(i.event.metaKey||i.event.ctrlKey))?"copy_node":"move_node"](c,r.par,r.pos,!1,!1,!1,i.data.origin)}else s=n(i.event.target).closest(".jstree"),s.length&&o&&o.error&&"check"===o.error&&(s=s.jstree(!0),s&&s.settings.core.error.call(this,o));u=!1;r=!1}}).on("keyup.jstree keydown.jstree",function(t,i){i=n.vakata.dnd._get();i&&i.data&&i.data.jstree&&("keyup"===t.type&&27===t.which?(f&&clearTimeout(f),r=!1,o=!1,u=!1,f=!1,e.hide().detach(),n.vakata.dnd._clean()):(i.helper.find(".jstree-copy").first()[i.data.origin&&(i.data.origin.settings.dnd.always_copy||i.data.origin.settings.dnd.copy&&(t.metaKey||t.ctrlKey))?"show":"hide"](),u&&(u.metaKey=t.metaKey,u.ctrlKey=t.ctrlKey,n.vakata.dnd._trigger("move",u))))})}),function(n){n.vakata.html={div:n("<div />"),escape:function(t){return n.vakata.html.div.text(t).html()},strip:function(t){return n.vakata.html.div.empty().append(n.parseHTML(t)).text()}};var r={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1};n.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5,threshold_touch:50},_trigger:function(r,u,f){f===t&&(f=n.vakata.dnd._get());f.event=u;n(i).triggerHandler("dnd_"+r+".vakata",f)},_get:function(){return{data:r.data,element:r.element,helper:r.helper}},_clean:function(){r.helper&&r.helper.remove();r.scroll_i&&(clearInterval(r.scroll_i),r.scroll_i=!1);r={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1};n(i).off("mousemove.vakata.jstree touchmove.vakata.jstree",n.vakata.dnd.drag);n(i).off("mouseup.vakata.jstree touchend.vakata.jstree",n.vakata.dnd.stop)},_scroll:function(t){if(!r.scroll_e||!r.scroll_l&&!r.scroll_t)return r.scroll_i&&(clearInterval(r.scroll_i),r.scroll_i=!1),!1;if(!r.scroll_i)return r.scroll_i=setInterval(n.vakata.dnd._scroll,100),!1;if(t===!0)return!1;var i=r.scroll_e.scrollTop(),u=r.scroll_e.scrollLeft();r.scroll_e.scrollTop(i+r.scroll_t*n.vakata.dnd.settings.scroll_speed);r.scroll_e.scrollLeft(u+r.scroll_l*n.vakata.dnd.settings.scroll_speed);(i!==r.scroll_e.scrollTop()||u!==r.scroll_e.scrollLeft())&&n.vakata.dnd._trigger("scroll",r.scroll_e)},start:function(t,u,f){"touchstart"===t.type&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=i.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset));r.is_drag&&n.vakata.dnd.stop({});try{t.currentTarget.unselectable="on";t.currentTarget.onselectstart=function(){return!1};t.currentTarget.style&&(t.currentTarget.style.touchAction="none",t.currentTarget.style.msTouchAction="none",t.currentTarget.style.MozUserSelect="none")}catch(e){}return r.init_x=t.pageX,r.init_y=t.pageY,r.data=u,r.is_down=!0,r.element=t.currentTarget,r.target=t.target,r.is_touch="touchstart"===t.type,f!==!1&&(r.helper=n("<div id='vakata-dnd'><\/div>").html(f).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),n(i).on("mousemove.vakata.jstree touchmove.vakata.jstree",n.vakata.dnd.drag),n(i).on("mouseup.vakata.jstree touchend.vakata.jstree",n.vakata.dnd.stop),!1},drag:function(t){if("touchmove"===t.type&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=i.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset)),r.is_down){if(!r.is_drag){if(!(Math.abs(t.pageX-r.init_x)>(r.is_touch?n.vakata.dnd.settings.threshold_touch:n.vakata.dnd.settings.threshold)||Math.abs(t.pageY-r.init_y)>(r.is_touch?n.vakata.dnd.settings.threshold_touch:n.vakata.dnd.settings.threshold)))return;r.helper&&(r.helper.appendTo("body"),r.helper_w=r.helper.outerWidth());r.is_drag=!0;n(r.target).one("click.vakata",!1);n.vakata.dnd._trigger("start",t)}var u=!1,l=!1,f=!1,o=!1,e=!1,s=!1,a=!1,v=!1,h=!1,c=!1;return r.scroll_t=0,r.scroll_l=0,r.scroll_e=!1,n(n(t.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test(n(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var u=n(this),i=u.offset();return this.scrollHeight>this.offsetHeight&&(i.top+u.height()-t.pageY<n.vakata.dnd.settings.scroll_proximity&&(r.scroll_t=1),t.pageY-i.top<n.vakata.dnd.settings.scroll_proximity&&(r.scroll_t=-1)),this.scrollWidth>this.offsetWidth&&(i.left+u.width()-t.pageX<n.vakata.dnd.settings.scroll_proximity&&(r.scroll_l=1),t.pageX-i.left<n.vakata.dnd.settings.scroll_proximity&&(r.scroll_l=-1)),r.scroll_t||r.scroll_l?(r.scroll_e=n(this),!1):void 0}),r.scroll_e||(u=n(i),l=n(window),f=u.height(),o=l.height(),e=u.width(),s=l.width(),a=u.scrollTop(),v=u.scrollLeft(),f>o&&t.pageY-a<n.vakata.dnd.settings.scroll_proximity&&(r.scroll_t=-1),f>o&&o-(t.pageY-a)<n.vakata.dnd.settings.scroll_proximity&&(r.scroll_t=1),e>s&&t.pageX-v<n.vakata.dnd.settings.scroll_proximity&&(r.scroll_l=-1),e>s&&s-(t.pageX-v)<n.vakata.dnd.settings.scroll_proximity&&(r.scroll_l=1),(r.scroll_t||r.scroll_l)&&(r.scroll_e=u)),r.scroll_e&&n.vakata.dnd._scroll(!0),r.helper&&(h=parseInt(t.pageY+n.vakata.dnd.settings.helper_top,10),c=parseInt(t.pageX+n.vakata.dnd.settings.helper_left,10),f&&h+25>f&&(h=f-50),e&&c+r.helper_w>e&&(c=e-(r.helper_w+2)),r.helper.css({left:c+"px",top:h+"px"})),n.vakata.dnd._trigger("move",t),!1}},stop:function(t){if("touchend"===t.type&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=i.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset)),r.is_drag)t.target!==r.target&&n(r.target).off("click.vakata"),n.vakata.dnd._trigger("stop",t);else if("touchend"===t.type&&t.target===r.target){var u=setTimeout(function(){n(t.target).click()},100);n(t.target).one("click",function(){u&&clearTimeout(u)})}return n.vakata.dnd._clean(),!1}}}(n),n.jstree.defaults.massload=null,n.jstree.plugins.massload=function(t,i){this.init=function(n,t){this._data.massload={};i.init.call(this,n,t)};this._load_nodes=function(t,r,u,f){var e=this.settings.massload,a=JSON.stringify(t),h=[],c=this._model.data,s,l,o;if(!u){for(s=0,l=t.length;l>s;s++)c[t[s]]&&(c[t[s]].state.loaded||c[t[s]].state.failed)&&!f||(h.push(t[s]),o=this.get_node(t[s],!0),o&&o.length&&o.addClass("jstree-loading").attr("aria-busy",!0));if(this._data.massload={},h.length){if(n.isFunction(e))return e.call(this,h,n.proxy(function(n){var e,s;if(n)for(e in n)n.hasOwnProperty(e)&&(this._data.massload[e]=n[e]);for(e=0,s=t.length;s>e;e++)o=this.get_node(t[e],!0),o&&o.length&&o.removeClass("jstree-loading").attr("aria-busy",!1);i._load_nodes.call(this,t,r,u,f)},this));if("object"==typeof e&&e&&e.url)return e=n.extend(!0,{},e),n.isFunction(e.url)&&(e.url=e.url.call(this,h)),n.isFunction(e.data)&&(e.data=e.data.call(this,h)),n.ajax(e).done(n.proxy(function(n){var e,s;if(n)for(e in n)n.hasOwnProperty(e)&&(this._data.massload[e]=n[e]);for(e=0,s=t.length;s>e;e++)o=this.get_node(t[e],!0),o&&o.length&&o.removeClass("jstree-loading").attr("aria-busy",!1);i._load_nodes.call(this,t,r,u,f)},this)).fail(n.proxy(function(){i._load_nodes.call(this,t,r,u,f)},this))}}return i._load_nodes.call(this,t,r,u,f)};this._load_node=function(t,r){var u=this._data.massload[t.id],e=null,f;return u?(e=this["string"==typeof u?"_append_html_data":"_append_json_data"](t,"string"==typeof u?n(n.parseHTML(u)).filter(function(){return 3!==this.nodeType}):u,function(n){r.call(this,n)}),f=this.get_node(t.id,!0),f&&f.length&&f.removeClass("jstree-loading").attr("aria-busy",!1),delete this._data.massload[t.id],e):i._load_node.call(this,t,r)}},n.jstree.defaults.search={ajax:!1,fuzzy:!1,case_sensitive:!1,show_only_matches:!1,show_only_matches_children:!1,close_opened_onclear:!0,search_leaves_only:!1,search_callback:!1},n.jstree.plugins.search=function(i,r){this.bind=function(){r.bind.call(this);this._data.search.str="";this._data.search.dom=n();this._data.search.res=[];this._data.search.opn=[];this._data.search.som=!1;this._data.search.smc=!1;this._data.search.hdn=[];this.element.on("search.jstree",n.proxy(function(t,i){if(this._data.search.som&&i.res.length){for(var u=this._model.data,f=[],e,s,r=0,o=i.res.length;o>r;r++)if(u[i.res[r]]&&!u[i.res[r]].state.hidden&&(f.push(i.res[r]),f=f.concat(u[i.res[r]].parents),this._data.search.smc))for(e=0,s=u[i.res[r]].children_d.length;s>e;e++)u[u[i.res[r]].children_d[e]]&&!u[u[i.res[r]].children_d[e]].state.hidden&&f.push(u[i.res[r]].children_d[e]);f=n.vakata.array_remove_item(n.vakata.array_unique(f),n.jstree.root);this._data.search.hdn=this.hide_all(!0);this.show_node(f,!0);this.redraw(!0)}},this)).on("clear_search.jstree",n.proxy(function(n,t){this._data.search.som&&t.res.length&&(this.show_node(this._data.search.hdn,!0),this.redraw(!0))},this))};this.search=function(i,r,u,f,e,o){if(i===!1||""===n.trim(i.toString()))return this.clear_search();f=this.get_node(f);f=f&&f.id?f.id:null;i=i.toString();var h=this.settings.search,s=h.ajax?h.ajax:!1,v=this._model.data,y=null,a=[],c=[],l,p;if(this._data.search.res.length&&!e&&this.clear_search(),u===t&&(u=h.show_only_matches),o===t&&(o=h.show_only_matches_children),!r&&s!==!1)return n.isFunction(s)?s.call(this,i,n.proxy(function(t){t&&t.d&&(t=t.d);this._load_nodes(n.isArray(t)?n.vakata.array_unique(t):[],function(){this.search(i,!0,u,f,e,o)})},this),f):(s=n.extend({},s),s.data||(s.data={}),s.data.str=i,f&&(s.data.inside=f),this._data.search.lastRequest&&this._data.search.lastRequest.abort(),this._data.search.lastRequest=n.ajax(s).fail(n.proxy(function(){this._data.core.last_error={error:"ajax",plugin:"search",id:"search_01",reason:"Could not load search parents",data:JSON.stringify(s)};this.settings.core.error.call(this,this._data.core.last_error)},this)).done(n.proxy(function(t){t&&t.d&&(t=t.d);this._load_nodes(n.isArray(t)?n.vakata.array_unique(t):[],function(){this.search(i,!0,u,f,e,o)})},this)),this._data.search.lastRequest);if(e||(this._data.search.str=i,this._data.search.dom=n(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=u,this._data.search.smc=o),y=new n.vakata.search(i,!0,{caseSensitive:h.case_sensitive,fuzzy:h.fuzzy}),n.each(v[f?f:n.jstree.root].children_d,function(n,t){var r=v[t];r.text&&!r.state.hidden&&(!h.search_leaves_only||r.state.loaded&&0===r.children.length)&&(h.search_callback&&h.search_callback.call(this,i,r)||!h.search_callback&&y.search(r.text).isMatch)&&(a.push(t),c=c.concat(r.parents))}),a.length){for(c=n.vakata.array_unique(c),l=0,p=c.length;p>l;l++)c[l]!==n.jstree.root&&v[c[l]]&&this.open_node(c[l],null,0)===!0&&this._data.search.opn.push(c[l]);e?(this._data.search.dom=this._data.search.dom.add(n(this.element[0].querySelectorAll("#"+n.map(a,function(t){return-1!=="0123456789".indexOf(t[0])?"\\3"+t[0]+" "+t.substr(1).replace(n.jstree.idregex,"\\$&"):t.replace(n.jstree.idregex,"\\$&")}).join(", #")))),this._data.search.res=n.vakata.array_unique(this._data.search.res.concat(a))):(this._data.search.dom=n(this.element[0].querySelectorAll("#"+n.map(a,function(t){return-1!=="0123456789".indexOf(t[0])?"\\3"+t[0]+" "+t.substr(1).replace(n.jstree.idregex,"\\$&"):t.replace(n.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.res=a);this._data.search.dom.children(".jstree-anchor").addClass("jstree-search")}this.trigger("search",{nodes:this._data.search.dom,str:i,res:this._data.search.res,show_only_matches:u})};this.clear_search=function(){this.settings.search.close_opened_onclear&&this.close_node(this._data.search.opn,0);this.trigger("clear_search",{nodes:this._data.search.dom,str:this._data.search.str,res:this._data.search.res});this._data.search.res.length&&(this._data.search.dom=n(this.element[0].querySelectorAll("#"+n.map(this._data.search.res,function(t){return-1!=="0123456789".indexOf(t[0])?"\\3"+t[0]+" "+t.substr(1).replace(n.jstree.idregex,"\\$&"):t.replace(n.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search"));this._data.search.str="";this._data.search.res=[];this._data.search.opn=[];this._data.search.dom=n()};this.redraw_node=function(t){if(t=r.redraw_node.apply(this,arguments),t&&-1!==n.inArray(t.id,this._data.search.res)){for(var u=null,i=0,f=t.childNodes.length;f>i;i++)if(t.childNodes[i]&&t.childNodes[i].className&&-1!==t.childNodes[i].className.indexOf("jstree-anchor")){u=t.childNodes[i];break}u&&(u.className+=" jstree-search")}return t}},function(n){n.vakata.search=function(t,i,r){r=r||{};r=n.extend({},n.vakata.search.defaults,r);r.fuzzy!==!1&&(r.fuzzy=!0);t=r.caseSensitive?t:t.toLowerCase();var f=r.location,s=r.distance,l=r.threshold,u=t.length,h,c,e,o;return u>32&&(r.fuzzy=!1),r.fuzzy&&(h=1<<u-1,c=function(){for(var i={},n=0,n=0;u>n;n++)i[t.charAt(n)]=0;for(n=0;u>n;n++)i[t.charAt(n)]|=1<<u-n-1;return i}(),e=function(n,t){var i=n/u,r=Math.abs(f-t);return s?i+r/s:r?1:i}),o=function(n){if(n=r.caseSensitive?n:n.toLowerCase(),t===n||-1!==n.indexOf(t))return{isMatch:!0,score:0};if(!r.fuzzy)return{isMatch:!1,score:1};var a,i,tt=n.length,v=l,o=n.indexOf(t,f),p,s,w=u+tt,b,g,k,y,nt,d=1,it=[];for(-1!==o&&(v=Math.min(e(0,o),v),o=n.lastIndexOf(t,f+u),-1!==o&&(v=Math.min(e(0,o),v))),o=-1,a=0;u>a;a++){for(p=0,s=w;s>p;)e(a,f+s)<=v?p=s:w=s,s=Math.floor((w-p)/2+p);for(w=s,g=Math.max(1,f-s+1),k=Math.min(f+s,tt)+u,y=new Array(k+2),y[k+1]=(1<<a)-1,i=k;i>=g;i--)if(nt=c[n.charAt(i-1)],y[i]=0===a?(y[i+1]<<1|1)&nt:(y[i+1]<<1|1)&nt|(b[i+1]|b[i])<<1|1|b[i+1],y[i]&h&&(d=e(a,i-1),v>=d)){if(v=d,o=i-1,it.push(o),!(o>f))break;g=Math.max(1,2*f-o)}if(e(a+1,f)>v)break;b=y}return{isMatch:o>=0,score:d}},i===!0?{search:o}:o(i)};n.vakata.search.defaults={location:0,distance:100,threshold:.6,fuzzy:!1,caseSensitive:!1}}(n),n.jstree.defaults.sort=function(n,t){return this.get_text(n)>this.get_text(t)?1:-1},n.jstree.plugins.sort=function(t,i){this.bind=function(){i.bind.call(this);this.element.on("model.jstree",n.proxy(function(n,t){this.sort(t.parent,!0)},this)).on("rename_node.jstree create_node.jstree",n.proxy(function(n,t){this.sort(t.parent||t.node.parent,!1);this.redraw_node(t.parent||t.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",n.proxy(function(n,t){this.sort(t.parent,!1);this.redraw_node(t.parent,!0)},this))};this.sort=function(t,i){var r,u;if(t=this.get_node(t),t&&t.children&&t.children.length&&(t.children.sort(n.proxy(this.settings.sort,this)),i))for(r=0,u=t.children_d.length;u>r;r++)this.sort(t.children_d[r],!1)}},c=!1,n.jstree.defaults.state={key:"jstree",events:"changed.jstree open_node.jstree close_node.jstree check_node.jstree uncheck_node.jstree",ttl:!1,filter:!1},n.jstree.plugins.state=function(t,i){this.bind=function(){i.bind.call(this);var t=n.proxy(function(){this.element.on(this.settings.state.events,n.proxy(function(){c&&clearTimeout(c);c=setTimeout(n.proxy(function(){this.save_state()},this),100)},this));this.trigger("state_ready")},this);this.element.on("ready.jstree",n.proxy(function(){this.element.one("restore_state.jstree",t);this.restore_state()||t()},this))};this.save_state=function(){var t={state:this.get_state(),ttl:this.settings.state.ttl,sec:+new Date};n.vakata.storage.set(this.settings.state.key,JSON.stringify(t))};this.restore_state=function(){var t=n.vakata.storage.get(this.settings.state.key);if(t)try{t=JSON.parse(t)}catch(i){return!1}return t&&t.ttl&&t.sec&&+new Date-t.sec>t.ttl?!1:(t&&t.state&&(t=t.state),t&&n.isFunction(this.settings.state.filter)&&(t=this.settings.state.filter.call(this,t)),t?(this.element.one("set_state.jstree",function(i,r){r.instance.trigger("restore_state",{state:n.extend(!0,{},t)})}),this.set_state(t),!0):!1)};this.clear_state=function(){return n.vakata.storage.del(this.settings.state.key)}},function(n){n.vakata.storage={set:function(n,t){return window.localStorage.setItem(n,t)},get:function(n){return window.localStorage.getItem(n)},del:function(n){return window.localStorage.removeItem(n)}}}(n),n.jstree.defaults.types={"default":{}},n.jstree.defaults.types[n.jstree.root]={},n.jstree.plugins.types=function(i,r){this.init=function(i,u){var f,e;if(u&&u.types&&u.types["default"])for(f in u.types)if("default"!==f&&f!==n.jstree.root&&u.types.hasOwnProperty(f))for(e in u.types["default"])u.types["default"].hasOwnProperty(e)&&u.types[f][e]===t&&(u.types[f][e]=u.types["default"][e]);r.init.call(this,i,u);this._model.data[n.jstree.root].type=n.jstree.root};this.refresh=function(t,i){r.refresh.call(this,t,i);this._model.data[n.jstree.root].type=n.jstree.root};this.bind=function(){this.element.on("model.jstree",n.proxy(function(i,r){for(var f=this._model.data,e=r.nodes,s=this.settings.types,o="default",h,u=0,c=e.length;c>u;u++){if(o="default",f[e[u]].original&&f[e[u]].original.type&&s[f[e[u]].original.type]&&(o=f[e[u]].original.type),f[e[u]].data&&f[e[u]].data.jstree&&f[e[u]].data.jstree.type&&s[f[e[u]].data.jstree.type]&&(o=f[e[u]].data.jstree.type),f[e[u]].type=o,f[e[u]].icon===!0&&s[o].icon!==t&&(f[e[u]].icon=s[o].icon),s[o].li_attr!==t&&"object"==typeof s[o].li_attr)for(h in s[o].li_attr)if(s[o].li_attr.hasOwnProperty(h)){if("id"===h)continue;f[e[u]].li_attr[h]===t?f[e[u]].li_attr[h]=s[o].li_attr[h]:"class"===h&&(f[e[u]].li_attr["class"]=s[o].li_attr["class"]+" "+f[e[u]].li_attr["class"])}if(s[o].a_attr!==t&&"object"==typeof s[o].a_attr)for(h in s[o].a_attr)if(s[o].a_attr.hasOwnProperty(h)){if("id"===h)continue;f[e[u]].a_attr[h]===t?f[e[u]].a_attr[h]=s[o].a_attr[h]:"href"===h&&"#"===f[e[u]].a_attr[h]?f[e[u]].a_attr.href=s[o].a_attr.href:"class"===h&&(f[e[u]].a_attr["class"]=s[o].a_attr["class"]+" "+f[e[u]].a_attr["class"])}}f[n.jstree.root].type=n.jstree.root},this));r.bind.call(this)};this.get_json=function(t,i,u){var e,s,o=this._model.data,h=i?n.extend(!0,{},i,{no_id:!1}):{},f=r.get_json.call(this,t,h,u);if(f===!1)return!1;if(n.isArray(f))for(e=0,s=f.length;s>e;e++)f[e].type=f[e].id&&o[f[e].id]&&o[f[e].id].type?o[f[e].id].type:"default",i&&i.no_id&&(delete f[e].id,f[e].li_attr&&f[e].li_attr.id&&delete f[e].li_attr.id,f[e].a_attr&&f[e].a_attr.id&&delete f[e].a_attr.id);else f.type=f.id&&o[f.id]&&o[f.id].type?o[f.id].type:"default",i&&i.no_id&&(f=this._delete_ids(f));return f};this._delete_ids=function(t){if(n.isArray(t)){for(var i=0,r=t.length;r>i;i++)t[i]=this._delete_ids(t[i]);return t}return delete t.id,t.li_attr&&t.li_attr.id&&delete t.li_attr.id,t.a_attr&&t.a_attr.id&&delete t.a_attr.id,t.children&&n.isArray(t.children)&&(t.children=this._delete_ids(t.children)),t};this.check=function(i,u,f,e,o){if(r.check.call(this,i,u,f,e,o)===!1)return!1;u=u&&u.id?u:this.get_node(u);f=f&&f.id?f:this.get_node(f);var c=u&&u.id?o&&o.origin?o.origin:n.jstree.reference(u.id):null,s,h,l,a;switch(c=c&&c._model&&c._model.data?c._model.data:null,i){case"create_node":case"move_node":case"copy_node":if("move_node"!==i||-1===n.inArray(u.id,f.children)){if(s=this.get_rules(f),s.max_children!==t&&-1!==s.max_children&&s.max_children===f.children.length)return this._data.core.last_error={error:"check",plugin:"types",id:"types_01",reason:"max_children prevents function: "+i,data:JSON.stringify({chk:i,pos:e,obj:u&&u.id?u.id:!1,par:f&&f.id?f.id:!1})},!1;if(s.valid_children!==t&&-1!==s.valid_children&&-1===n.inArray(u.type||"default",s.valid_children))return this._data.core.last_error={error:"check",plugin:"types",id:"types_02",reason:"valid_children prevents function: "+i,data:JSON.stringify({chk:i,pos:e,obj:u&&u.id?u.id:!1,par:f&&f.id?f.id:!1})},!1;if(c&&u.children_d&&u.parents){for(h=0,l=0,a=u.children_d.length;a>l;l++)h=Math.max(h,c[u.children_d[l]].parents.length);h=h-u.parents.length+1}(0>=h||h===t)&&(h=1);do{if(s.max_depth!==t&&-1!==s.max_depth&&s.max_depth<h)return this._data.core.last_error={error:"check",plugin:"types",id:"types_03",reason:"max_depth prevents function: "+i,data:JSON.stringify({chk:i,pos:e,obj:u&&u.id?u.id:!1,par:f&&f.id?f.id:!1})},!1;f=this.get_node(f.parent);s=this.get_rules(f);h++}while(f)}}return!0};this.get_rules=function(n){if(n=this.get_node(n),!n)return!1;var i=this.get_type(n,!0);return i.max_depth===t&&(i.max_depth=-1),i.max_children===t&&(i.max_children=-1),i.valid_children===t&&(i.valid_children=-1),i};this.get_type=function(t,i){return t=this.get_node(t),t?i?n.extend({type:t.type},this.settings.types[t.type]):t.type:!1};this.set_type=function(i,r){var o=this._model.data,f,c,a,e,l,u,h,s;if(n.isArray(i)){for(i=i.slice(),c=0,a=i.length;a>c;c++)this.set_type(i[c],r);return!0}if(f=this.settings.types,i=this.get_node(i),!f[r]||!i)return!1;if(h=this.get_node(i,!0),h&&h.length&&(s=h.children(".jstree-anchor")),e=i.type,l=this.get_icon(i),i.type=r,(l===!0||!f[e]||f[e].icon!==t&&l===f[e].icon)&&this.set_icon(i,f[r].icon!==t?f[r].icon:!0),f[e]&&f[e].li_attr!==t&&"object"==typeof f[e].li_attr)for(u in f[e].li_attr)if(f[e].li_attr.hasOwnProperty(u)){if("id"===u)continue;"class"===u?(o[i.id].li_attr["class"]=(o[i.id].li_attr["class"]||"").replace(f[e].li_attr[u],""),h&&h.removeClass(f[e].li_attr[u])):o[i.id].li_attr[u]===f[e].li_attr[u]&&(o[i.id].li_attr[u]=null,h&&h.removeAttr(u))}if(f[e]&&f[e].a_attr!==t&&"object"==typeof f[e].a_attr)for(u in f[e].a_attr)if(f[e].a_attr.hasOwnProperty(u)){if("id"===u)continue;"class"===u?(o[i.id].a_attr["class"]=(o[i.id].a_attr["class"]||"").replace(f[e].a_attr[u],""),s&&s.removeClass(f[e].a_attr[u])):o[i.id].a_attr[u]===f[e].a_attr[u]&&("href"===u?(o[i.id].a_attr[u]="#",s&&s.attr("href","#")):(delete o[i.id].a_attr[u],s&&s.removeAttr(u)))}if(f[r].li_attr!==t&&"object"==typeof f[r].li_attr)for(u in f[r].li_attr)if(f[r].li_attr.hasOwnProperty(u)){if("id"===u)continue;o[i.id].li_attr[u]===t?(o[i.id].li_attr[u]=f[r].li_attr[u],h&&("class"===u?h.addClass(f[r].li_attr[u]):h.attr(u,f[r].li_attr[u]))):"class"===u&&(o[i.id].li_attr["class"]=f[r].li_attr[u]+" "+o[i.id].li_attr["class"],h&&h.addClass(f[r].li_attr[u]))}if(f[r].a_attr!==t&&"object"==typeof f[r].a_attr)for(u in f[r].a_attr)if(f[r].a_attr.hasOwnProperty(u)){if("id"===u)continue;o[i.id].a_attr[u]===t?(o[i.id].a_attr[u]=f[r].a_attr[u],s&&("class"===u?s.addClass(f[r].a_attr[u]):s.attr(u,f[r].a_attr[u]))):"href"===u&&"#"===o[i.id].a_attr[u]?(o[i.id].a_attr.href=f[r].a_attr.href,s&&s.attr("href",f[r].a_attr.href)):"class"===u&&(o[i.id].a_attr["class"]=f[r].a_attr["class"]+" "+o[i.id].a_attr["class"],s&&s.addClass(f[r].a_attr[u]))}return!0}},n.jstree.defaults.unique={case_sensitive:!1,duplicate:function(n,t){return n+" ("+t+")"}},n.jstree.plugins.unique=function(i,r){this.check=function(t,i,u,f,e){if(r.check.call(this,t,i,u,f,e)===!1)return!1;if(i=i&&i.id?i:this.get_node(i),u=u&&u.id?u:this.get_node(u),!u||!u.children)return!0;for(var s="rename_node"===t?f:i.text,h=[],c=this.settings.unique.case_sensitive,l=this._model.data,o=0,a=u.children.length;a>o;o++)h.push(c?l[u.children[o]].text:l[u.children[o]].text.toLowerCase());switch(c||(s=s.toLowerCase()),t){case"delete_node":return!0;case"rename_node":return o=-1===n.inArray(s,h)||i.text&&i.text[c?"toString":"toLowerCase"]()===s,o||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_01",reason:"Child with name "+s+" already exists. Preventing: "+t,data:JSON.stringify({chk:t,pos:f,obj:i&&i.id?i.id:!1,par:u&&u.id?u.id:!1})}),o;case"create_node":return o=-1===n.inArray(s,h),o||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_04",reason:"Child with name "+s+" already exists. Preventing: "+t,data:JSON.stringify({chk:t,pos:f,obj:i&&i.id?i.id:!1,par:u&&u.id?u.id:!1})}),o;case"copy_node":return o=-1===n.inArray(s,h),o||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_02",reason:"Child with name "+s+" already exists. Preventing: "+t,data:JSON.stringify({chk:t,pos:f,obj:i&&i.id?i.id:!1,par:u&&u.id?u.id:!1})}),o;case"move_node":return o=i.parent===u.id&&(!e||!e.is_multi)||-1===n.inArray(s,h),o||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_03",reason:"Child with name "+s+" already exists. Preventing: "+t,data:JSON.stringify({chk:t,pos:f,obj:i&&i.id?i.id:!1,par:u&&u.id?u.id:!1})}),o}return!0};this.create_node=function(i,u,f,e,o){if(!u||u.text===t){if((null===i&&(i=n.jstree.root),i=this.get_node(i),!i)||(f=f===t?"last":f,!f.toString().match(/^(before|after)$/)&&!o&&!this.is_loaded(i)))return r.create_node.call(this,i,u,f,e,o);u||(u={});var l,h,c,s,a,v=this._model.data,y=this.settings.unique.case_sensitive,p=this.settings.unique.duplicate;for(h=l=this.get_string("New node"),c=[],s=0,a=i.children.length;a>s;s++)c.push(y?v[i.children[s]].text:v[i.children[s]].text.toLowerCase());for(s=1;-1!==n.inArray(y?h:h.toLowerCase(),c);)h=p.call(this,l,++s).toString();u.text=h}return r.create_node.call(this,i,u,f,e,o)}},e=i.createElement("DIV"),e.setAttribute("unselectable","on"),e.setAttribute("role","presentation"),e.className="jstree-wholerow",e.innerHTML="&#160;",n.jstree.plugins.wholerow=function(t,i){this.bind=function(){i.bind.call(this);this.element.on("ready.jstree set_state.jstree",n.proxy(function(){this.hide_dots()},this)).on("init.jstree loading.jstree ready.jstree",n.proxy(function(){this.get_container_ul().addClass("jstree-wholerow-ul")},this)).on("deselect_all.jstree",n.proxy(function(){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked")},this)).on("changed.jstree",n.proxy(function(n,t){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked");for(var i=!1,r=0,u=t.selected.length;u>r;r++)i=this.get_node(t.selected[r],!0),i&&i.length&&i.children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("open_node.jstree",n.proxy(function(n,t){this.get_node(t.node,!0).find(".jstree-clicked").parent().children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("hover_node.jstree dehover_node.jstree",n.proxy(function(n,t){"hover_node"===n.type&&this.is_disabled(t.node)||this.get_node(t.node,!0).children(".jstree-wholerow")["hover_node"===n.type?"addClass":"removeClass"]("jstree-wholerow-hovered")},this)).on("contextmenu.jstree",".jstree-wholerow",n.proxy(function(t){if(this._data.contextmenu){t.preventDefault();var i=n.Event("contextmenu",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,pageX:t.pageX,pageY:t.pageY});n(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(i)}},this)).on("click.jstree",".jstree-wholerow",function(t){t.stopImmediatePropagation();var i=n.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});n(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(i).focus()}).on("dblclick.jstree",".jstree-wholerow",function(t){t.stopImmediatePropagation();var i=n.Event("dblclick",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});n(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(i).focus()}).on("click.jstree",".jstree-leaf > .jstree-ocl",n.proxy(function(t){t.stopImmediatePropagation();var i=n.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});n(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(i).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",n.proxy(function(n){return n.stopImmediatePropagation(),this.is_disabled(n.currentTarget)||this.hover_node(n.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",n.proxy(function(n){this.dehover_node(n.currentTarget)},this))};this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove();i.teardown.call(this)};this.redraw_node=function(t){if(t=i.redraw_node.apply(this,arguments)){var r=e.cloneNode(!0);-1!==n.inArray(t.id,this._data.core.selected)&&(r.className+=" jstree-wholerow-clicked");this._data.core.focused&&this._data.core.focused===t.id&&(r.className+=" jstree-wholerow-hovered");t.insertBefore(r,t.childNodes[0])}return t}},i.registerElement&&Object&&Object.create){a=Object.create(HTMLElement.prototype);a.createdCallback=function(){var i={core:{},plugins:[]},t;for(t in n.jstree.plugins)n.jstree.plugins.hasOwnProperty(t)&&this.attributes[t]&&(i.plugins.push(t),this.getAttribute(t)&&JSON.parse(this.getAttribute(t))&&(i[t]=JSON.parse(this.getAttribute(t))));for(t in n.jstree.defaults.core)n.jstree.defaults.core.hasOwnProperty(t)&&this.attributes[t]&&(i.core[t]=JSON.parse(this.getAttribute(t))||this.getAttribute(t));n(this).jstree(i)};try{i.registerElement("vakata-jstree",{prototype:a})}catch(p){}}}});var Opentip,firstAdapter,i,mouseMoved,mousePosition,mousePositionObservers,position,vendors,_i,_len,_ref,__slice=[].slice,__indexOf=[].indexOf||function(n){for(var t=0,i=this.length;i>t;t++)if(t in this&&this[t]===n)return t;return-1},__hasProp={}.hasOwnProperty;for(Opentip=function(){function n(t,i,r,u){var l,w,a,v,e,s,h,c,b,k,d,y,p,f,o=this;if(this.id=++n.lastId,this.debug("Creating Opentip."),n.tips.push(this),this.adapter=n.adapter,l=this.adapter.data(t,"opentips")||[],l.push(this),this.adapter.data(t,"opentips",l),this.triggerElement=this.adapter.wrap(t),this.triggerElement.length>1)throw Error("You can't call Opentip on multiple elements.");if(1>this.triggerElement.length)throw Error("Invalid element.");for(this.loaded=!1,this.loading=!1,this.visible=!1,this.waitingToShow=!1,this.waitingToHide=!1,this.currentPosition={left:0,top:0},this.dimensions={width:100,height:50},this.content="",this.redraw=!0,this.currentObservers={showing:!1,visible:!1,hiding:!1,hidden:!1},u=this.adapter.clone(u),typeof i=="object"?(u=i,i=r=void 0):typeof r=="object"&&(u=r,r=void 0),r!=null&&(u.title=r),i!=null&&this.setContent(i),u["extends"]==null&&(u["extends"]=u.style!=null?u.style:n.defaultStyle),v=[u],f=u;f["extends"];){if(s=f["extends"],f=n.styles[s],f==null)throw Error("Invalid style: "+s);v.unshift(f);f["extends"]==null&&s!=="standard"&&(f["extends"]="standard")}for(u=(d=this.adapter).extend.apply(d,[{}].concat(__slice.call(v))),u.hideTriggers=function(){var n,r,t,i;for(t=u.hideTriggers,i=[],n=0,r=t.length;r>n;n++)w=t[n],i.push(w);return i}(),u.hideTrigger&&u.hideTriggers.length===0&&u.hideTriggers.push(u.hideTrigger),y=["tipJoint","targetJoint","stem"],h=0,b=y.length;b>h;h++)e=y[h],u[e]&&typeof u[e]=="string"&&(u[e]=new n.Joint(u[e]));for(!u.ajax||u.ajax!==!0&&u.ajax||(u.ajax=this.adapter.tagName(this.triggerElement)==="A"?this.adapter.attr(this.triggerElement,"href"):!1),u.showOn==="click"&&this.adapter.tagName(this.triggerElement)==="A"&&this.adapter.observe(this.triggerElement,"click",function(n){return n.preventDefault(),n.stopPropagation(),n.stopped=!0}),u.target&&(u.fixed=!0),u.stem===!0&&(u.stem=new n.Joint(u.tipJoint)),u.target===!0?u.target=this.triggerElement:u.target&&(u.target=this.adapter.wrap(u.target)),this.currentStem=u.stem,u.delay==null&&(u.delay=u.showOn==="mouseover"?.2:0),u.targetJoint==null&&(u.targetJoint=new n.Joint(u.tipJoint).flip()),this.showTriggers=[],this.showTriggersWhenVisible=[],this.hideTriggers=[],u.showOn&&u.showOn!=="creation"&&this.showTriggers.push({element:this.triggerElement,event:u.showOn}),u.ajaxCache!=null&&(u.cache=u.ajaxCache,delete u.ajaxCache),this.options=u,this.bound={},p=["prepareToShow","prepareToHide","show","hide","reposition"],c=0,k=p.length;k>c;c++)a=p[c],this.bound[a]=function(n){return function(){return o[n].apply(o,arguments)}}(a);this.adapter.domReady(function(){return o.activate(),o.options.showOn==="creation"?o.prepareToShow():void 0})}return n.prototype.STICKS_OUT_TOP=1,n.prototype.STICKS_OUT_BOTTOM=2,n.prototype.STICKS_OUT_LEFT=1,n.prototype.STICKS_OUT_RIGHT=2,n.prototype["class"]={container:"opentip-container",opentip:"opentip",header:"ot-header",content:"ot-content",loadingIndicator:"ot-loading-indicator",close:"ot-close",goingToHide:"ot-going-to-hide",hidden:"ot-hidden",hiding:"ot-hiding",goingToShow:"ot-going-to-show",showing:"ot-showing",visible:"ot-visible",loading:"ot-loading",ajaxError:"ot-ajax-error",fixed:"ot-fixed",showEffectPrefix:"ot-show-effect-",hideEffectPrefix:"ot-hide-effect-",stylePrefix:"style-"},n.prototype._setup=function(){var n,t,i,r,f,u,h,c,e,o,s;for(this.debug("Setting up the tooltip."),this._buildContainer(),this.hideTriggers=[],e=this.options.hideTriggers,r=f=0,h=e.length;h>f;r=++f){if(t=e[r],i=null,n=this.options.hideOn instanceof Array?this.options.hideOn[r]:this.options.hideOn,typeof t=="string")switch(t){case"trigger":n=n||"mouseout";i=this.triggerElement;break;case"tip":n=n||"mouseover";i=this.container;break;case"target":n=n||"mouseover";i=this.options.target;break;case"closeButton":break;default:throw Error("Unknown hide trigger: "+t+".");}else n=n||"mouseover",i=this.adapter.wrap(t);i&&this.hideTriggers.push({element:i,event:n,original:t})}for(o=this.hideTriggers,s=[],u=0,c=o.length;c>u;u++)t=o[u],s.push(this.showTriggersWhenVisible.push({element:t.element,event:"mouseover"}));return s},n.prototype._buildContainer=function(){return this.container=this.adapter.create('<div id="opentip-'+this.id+'" class="'+this["class"].container+" "+this["class"].hidden+" "+this["class"].stylePrefix+this.options.className+'"><\/div>'),this.adapter.css(this.container,{position:"absolute"}),this.options.ajax&&this.adapter.addClass(this.container,this["class"].loading),this.options.fixed&&this.adapter.addClass(this.container,this["class"].fixed),this.options.showEffect&&this.adapter.addClass(this.container,""+this["class"].showEffectPrefix+this.options.showEffect),this.options.hideEffect?this.adapter.addClass(this.container,""+this["class"].hideEffectPrefix+this.options.hideEffect):void 0},n.prototype._buildElements=function(){var n,t;return this.tooltipElement=this.adapter.create('<div class="'+this["class"].opentip+'"><div class="'+this["class"].header+'"><\/div><div class="'+this["class"].content+'"><\/div><\/div>'),this.backgroundCanvas=this.adapter.wrap(document.createElement("canvas")),this.adapter.css(this.backgroundCanvas,{position:"absolute"}),typeof G_vmlCanvasManager!="undefined"&&G_vmlCanvasManager!==null&&G_vmlCanvasManager.initElement(this.adapter.unwrap(this.backgroundCanvas)),n=this.adapter.find(this.tooltipElement,"."+this["class"].header),this.options.title&&(t=this.adapter.create("<h1><\/h1>"),this.adapter.update(t,this.options.title,this.options.escapeTitle),this.adapter.append(n,t)),this.options.ajax&&!this.loaded&&this.adapter.append(this.tooltipElement,this.adapter.create('<div class="'+this["class"].loadingIndicator+'"><span>↻<\/span><\/div>')),__indexOf.call(this.options.hideTriggers,"closeButton")>=0&&(this.closeButtonElement=this.adapter.create('<a href="javascript:undefined;" class="'+this["class"].close+'"><span>Close<\/span><\/a>'),this.adapter.append(n,this.closeButtonElement)),this.adapter.append(this.container,this.backgroundCanvas),this.adapter.append(this.container,this.tooltipElement),this.adapter.append(document.body,this.container),this._newContent=!0,this.redraw=!0},n.prototype.setContent=function(n){return this.content=n,this._newContent=!0,typeof this.content=="function"?(this._contentFunction=this.content,this.content=""):this._contentFunction=null,this.visible?this._updateElementContent():void 0},n.prototype._updateElementContent=function(){var n;return(this._newContent||!this.options.cache&&this._contentFunction)&&(n=this.adapter.find(this.container,"."+this["class"].content),n!=null&&(this._contentFunction&&(this.debug("Executing content function."),this.content=this._contentFunction(this)),this.adapter.update(n,this.content,this.options.escapeContent)),this._newContent=!1),this._storeAndLockDimensions(),this.reposition()},n.prototype._storeAndLockDimensions=function(){var n;if(this.container)return n=this.dimensions,this.adapter.css(this.container,{width:"auto",left:"0px",top:"0px"}),this.dimensions=this.adapter.dimensions(this.container),this.dimensions.width+=1,this.adapter.css(this.container,{width:""+this.dimensions.width+"px",top:""+this.currentPosition.top+"px",left:""+this.currentPosition.left+"px"}),this._dimensionsEqual(this.dimensions,n)?void 0:(this.redraw=!0,this._draw())},n.prototype.activate=function(){return this._setupObservers("hidden","hiding")},n.prototype.deactivate=function(){return this.debug("Deactivating tooltip."),this.hide(),this._setupObservers("-showing","-visible","-hidden","-hiding")},n.prototype._setupObservers=function(){var i,r,t,s,n,u,f,e,o,a,v,y,p,h,c,l,w=this;for(s=arguments.length>=1?__slice.call(arguments,0):[],u=0,a=s.length;a>u;u++)if(t=s[u],r=!1,t.charAt(0)==="-"&&(r=!0,t=t.substr(1)),this.currentObservers[t]!==!r)switch(this.currentObservers[t]=!r,i=function(){var n,t,i;return n=arguments.length>=1?__slice.call(arguments,0):[],r?(t=w.adapter).stopObserving.apply(t,n):(i=w.adapter).observe.apply(i,n)},t){case"showing":for(h=this.hideTriggers,f=0,v=h.length;v>f;f++)n=h[f],i(n.element,n.event,this.bound.prepareToHide);i(document.onresize!=null?document:window,"resize",this.bound.reposition);i(window,"scroll",this.bound.reposition);break;case"visible":for(c=this.showTriggersWhenVisible,e=0,y=c.length;y>e;e++)n=c[e],i(n.element,n.event,this.bound.prepareToShow);break;case"hiding":for(l=this.showTriggers,o=0,p=l.length;p>o;o++)n=l[o],i(n.element,n.event,this.bound.prepareToShow);break;case"hidden":break;default:throw Error("Unknown state: "+t);}return null},n.prototype.prepareToShow=function(){return this._abortHiding(),this._abortShowing(),this.visible?void 0:(this.debug("Showing in "+this.options.delay+"s."),this.container==null&&this._setup(),this.options.group&&n._abortShowingGroup(this.options.group,this),this.preparingToShow=!0,this._setupObservers("-hidden","-hiding","showing"),this._followMousePosition(),this.options.fixed&&!this.options.target&&(this.initialMousePosition=mousePosition),this.reposition(),this._showTimeoutId=this.setTimeout(this.bound.show,this.options.delay||0))},n.prototype.show=function(){var t=this;return this._abortHiding(),this.visible?void 0:(this._clearTimeouts(),this._triggerElementExists()?(this.debug("Showing now."),this.container==null&&this._setup(),this.options.group&&n._hideGroup(this.options.group,this),this.visible=!0,this.preparingToShow=!1,this.tooltipElement==null&&this._buildElements(),this._updateElementContent(),!this.options.ajax||this.loaded&&this.options.cache||this._loadAjax(),this._searchAndActivateCloseButtons(),this._startEnsureTriggerElement(),this.adapter.css(this.container,{zIndex:n.lastZIndex++}),this._setupObservers("-hidden","-hiding","-showing","-visible","showing","visible"),this.options.fixed&&!this.options.target&&(this.initialMousePosition=mousePosition),this.reposition(),this.adapter.removeClass(this.container,this["class"].hiding),this.adapter.removeClass(this.container,this["class"].hidden),this.adapter.addClass(this.container,this["class"].goingToShow),this.setCss3Style(this.container,{transitionDuration:"0s"}),this.defer(function(){var n;if(t.visible&&!t.preparingToHide)return t.adapter.removeClass(t.container,t["class"].goingToShow),t.adapter.addClass(t.container,t["class"].showing),n=0,t.options.showEffect&&t.options.showEffectDuration&&(n=t.options.showEffectDuration),t.setCss3Style(t.container,{transitionDuration:""+n+"s"}),t._visibilityStateTimeoutId=t.setTimeout(function(){return t.adapter.removeClass(t.container,t["class"].showing),t.adapter.addClass(t.container,t["class"].visible)},n),t._activateFirstInput()}),this._draw()):this.deactivate())},n.prototype._abortShowing=function(){if(this.preparingToShow)return(this.debug("Aborting showing."),this._clearTimeouts(),this._stopFollowingMousePosition(),this.preparingToShow=!1,this._setupObservers("-showing","-visible","hiding","hidden"))},n.prototype.prepareToHide=function(){return this._abortShowing(),this._abortHiding(),this.visible?(this.debug("Hiding in "+this.options.hideDelay+"s"),this.preparingToHide=!0,this._setupObservers("-showing","visible","-hidden","hiding"),this._hideTimeoutId=this.setTimeout(this.bound.hide,this.options.hideDelay)):void 0},n.prototype.hide=function(){var n=this;return this._abortShowing(),this.visible&&(this._clearTimeouts(),this.debug("Hiding!"),this.visible=!1,this.preparingToHide=!1,this._stopEnsureTriggerElement(),this._setupObservers("-showing","-visible","-hiding","-hidden","hiding","hidden"),this.options.fixed||this._stopFollowingMousePosition(),this.container)?(this.adapter.removeClass(this.container,this["class"].visible),this.adapter.removeClass(this.container,this["class"].showing),this.adapter.addClass(this.container,this["class"].goingToHide),this.setCss3Style(this.container,{transitionDuration:"0s"}),this.defer(function(){var t;return n.adapter.removeClass(n.container,n["class"].goingToHide),n.adapter.addClass(n.container,n["class"].hiding),t=0,n.options.hideEffect&&n.options.hideEffectDuration&&(t=n.options.hideEffectDuration),n.setCss3Style(n.container,{transitionDuration:""+t+"s"}),n._visibilityStateTimeoutId=n.setTimeout(function(){return n.adapter.removeClass(n.container,n["class"].hiding),n.adapter.addClass(n.container,n["class"].hidden),n.setCss3Style(n.container,{transitionDuration:"0s"}),n.options.removeElementsOnHide?(n.debug("Removing HTML elements."),n.adapter.remove(n.container),delete n.container,delete n.tooltipElement):void 0},t)})):void 0},n.prototype._abortHiding=function(){if(this.preparingToHide)return(this.debug("Aborting hiding."),this._clearTimeouts(),this.preparingToHide=!1,this._setupObservers("-hiding","showing","visible"))},n.prototype.reposition=function(){var n,t,i,r=this;return n=this.getPosition(),n==null||(t=this.options.stem,this.options.containInViewport&&(i=this._ensureViewportContainment(n),n=i.position,t=i.stem),this._positionsEqual(n,this.currentPosition))?void 0:(this.options.stem&&!t.eql(this.currentStem)&&(this.redraw=!0),this.currentPosition=n,this.currentStem=t,this._draw(),this.adapter.css(this.container,{left:""+n.left+"px",top:""+n.top+"px"}),this.defer(function(){var n,t;return n=r.adapter.unwrap(r.container),n.style.visibility="hidden",t=n.offsetHeight,n.style.visibility="visible"}))},n.prototype.getPosition=function(n,t,i){var o,s,f,r,u,e,c,h,l;if(this.container)return n==null&&(n=this.options.tipJoint),t==null&&(t=this.options.targetJoint),r={},this.options.target?(c=this.adapter.offset(this.options.target),e=this.adapter.dimensions(this.options.target),r=c,t.right?(h=this.adapter.unwrap(this.options.target),h.getBoundingClientRect!=null?r.left=h.getBoundingClientRect().right+((l=window.pageXOffset)!=null?l:document.body.scrollLeft):r.left+=e.width):t.center&&(r.left+=Math.round(e.width/2)),t.bottom?r.top+=e.height:t.middle&&(r.top+=Math.round(e.height/2)),this.options.borderWidth&&(this.options.tipJoint.left&&(r.left+=this.options.borderWidth),this.options.tipJoint.right&&(r.left-=this.options.borderWidth),this.options.tipJoint.top?r.top+=this.options.borderWidth:this.options.tipJoint.bottom&&(r.top-=this.options.borderWidth))):r=this.initialMousePosition?{top:this.initialMousePosition.y,left:this.initialMousePosition.x}:{top:mousePosition.y,left:mousePosition.x},this.options.autoOffset&&(u=this.options.stem?this.options.stemLength:0,f=u&&this.options.fixed?2:10,o=n.middle&&!this.options.fixed?15:0,s=n.center&&!this.options.fixed?15:0,n.right?r.left-=f+o:n.left&&(r.left+=f+o),n.bottom?r.top-=f+s:n.top&&(r.top+=f+s),u&&(i==null&&(i=this.options.stem),i.right?r.left-=u:i.left&&(r.left+=u),i.bottom?r.top-=u:i.top&&(r.top+=u))),r.left+=this.options.offset[0],r.top+=this.options.offset[1],n.right?r.left-=this.dimensions.width:n.center&&(r.left-=Math.round(this.dimensions.width/2)),n.bottom?r.top-=this.dimensions.height:n.middle&&(r.top-=Math.round(this.dimensions.height/2)),r},n.prototype._ensureViewportContainment=function(t){var o,e,s,h,c,l,f,r,u,i,a,v;if((f=this.options.stem,s={position:t,stem:f},!this.visible||!t)||(r=this._sticksOut(t),!r[0]&&!r[1]))return s;if(i=new n.Joint(this.options.tipJoint),this.options.targetJoint&&(u=new n.Joint(this.options.targetJoint)),l=this.adapter.scrollOffset(),a=this.adapter.viewportDimensions(),v=[t.left-l[0],t.top-l[1]],o=!1,a.width>=this.dimensions.width&&r[0])switch(o=!0,r[0]){case this.STICKS_OUT_LEFT:i.setHorizontal("left");this.options.targetJoint&&u.setHorizontal("right");break;case this.STICKS_OUT_RIGHT:i.setHorizontal("right");this.options.targetJoint&&u.setHorizontal("left")}if(a.height>=this.dimensions.height&&r[1])switch(o=!0,r[1]){case this.STICKS_OUT_TOP:i.setVertical("top");this.options.targetJoint&&u.setVertical("bottom");break;case this.STICKS_OUT_BOTTOM:i.setVertical("bottom");this.options.targetJoint&&u.setVertical("top")}return o?(this.options.stem&&(f=i),t=this.getPosition(i,u,f),e=this._sticksOut(t),h=!1,c=!1,e[0]&&e[0]!==r[0]&&(h=!0,i.setHorizontal(this.options.tipJoint.horizontal),this.options.targetJoint&&u.setHorizontal(this.options.targetJoint.horizontal)),e[1]&&e[1]!==r[1]&&(c=!0,i.setVertical(this.options.tipJoint.vertical),this.options.targetJoint&&u.setVertical(this.options.targetJoint.vertical)),h&&c?s:((h||c)&&(this.options.stem&&(f=i),t=this.getPosition(i,u,f)),{position:t,stem:f})):s},n.prototype._sticksOut=function(n){var i,r,t,u;return r=this.adapter.scrollOffset(),u=this.adapter.viewportDimensions(),i=[n.left-r[0],n.top-r[1]],t=[!1,!1],0>i[0]?t[0]=this.STICKS_OUT_LEFT:i[0]+this.dimensions.width>u.width&&(t[0]=this.STICKS_OUT_RIGHT),0>i[1]?t[1]=this.STICKS_OUT_TOP:i[1]+this.dimensions.height>u.height&&(t[1]=this.STICKS_OUT_BOTTOM),t},n.prototype._draw=function(){var h,u,f,e,o,l,c,t,w,b,r,k,s,a,v,d,y,g,p,i=this;if(this.backgroundCanvas&&this.redraw){if(this.debug("Drawing background."),this.redraw=!1,this.currentStem){for(y=["top","right","bottom","left"],v=0,d=y.length;d>v;v++)k=y[v],this.adapter.removeClass(this.container,"stem-"+k);this.adapter.addClass(this.container,"stem-"+this.currentStem.horizontal);this.adapter.addClass(this.container,"stem-"+this.currentStem.vertical)}return l=[0,0],c=[0,0],__indexOf.call(this.options.hideTriggers,"closeButton")>=0&&(o=new n.Joint(((g=this.currentStem)!=null?g+"":void 0)==="top right"?"top left":"top right"),l=[this.options.closeButtonRadius+this.options.closeButtonOffset[0],this.options.closeButtonRadius+this.options.closeButtonOffset[1]],c=[this.options.closeButtonRadius-this.options.closeButtonOffset[0],this.options.closeButtonRadius-this.options.closeButtonOffset[1]]),f=this.adapter.clone(this.dimensions),e=[0,0],this.options.borderWidth&&(f.width+=this.options.borderWidth*2,f.height+=this.options.borderWidth*2,e[0]-=this.options.borderWidth,e[1]-=this.options.borderWidth),this.options.shadow&&(f.width+=this.options.shadowBlur*2,f.width+=Math.max(0,this.options.shadowOffset[0]-this.options.shadowBlur*2),f.height+=this.options.shadowBlur*2,f.height+=Math.max(0,this.options.shadowOffset[1]-this.options.shadowBlur*2),e[0]-=Math.max(0,this.options.shadowBlur-this.options.shadowOffset[0]),e[1]-=Math.max(0,this.options.shadowBlur-this.options.shadowOffset[1])),u={left:0,right:0,top:0,bottom:0},this.currentStem&&(this.currentStem.left?u.left=this.options.stemLength:this.currentStem.right&&(u.right=this.options.stemLength),this.currentStem.top?u.top=this.options.stemLength:this.currentStem.bottom&&(u.bottom=this.options.stemLength)),o&&(o.left?u.left=Math.max(u.left,c[0]):o.right&&(u.right=Math.max(u.right,c[0])),o.top?u.top=Math.max(u.top,c[1]):o.bottom&&(u.bottom=Math.max(u.bottom,c[1]))),f.width+=u.left+u.right,f.height+=u.top+u.bottom,e[0]-=u.left,e[1]-=u.top,this.currentStem&&this.options.borderWidth&&(p=this._getPathStemMeasures(this.options.stemBase,this.options.stemLength,this.options.borderWidth),a=p.stemLength,s=p.stemBase),h=this.adapter.unwrap(this.backgroundCanvas),h.width=f.width,h.height=f.height,this.adapter.css(this.backgroundCanvas,{width:""+h.width+"px",height:""+h.height+"px",left:""+e[0]+"px",top:""+e[1]+"px"}),t=h.getContext("2d"),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,h.width,h.height),t.beginPath(),t.fillStyle=this._getColor(t,this.dimensions,this.options.background,this.options.backgroundGradientHorizontal),t.lineJoin="miter",t.miterLimit=500,r=this.options.borderWidth/2,this.options.borderWidth?(t.strokeStyle=this.options.borderColor,t.lineWidth=this.options.borderWidth):(a=this.options.stemLength,s=this.options.stemBase),s==null&&(s=0),b=function(n,u,f){return f&&t.moveTo(Math.max(s,i.options.borderRadius,l[0])+1-r,-r),u?(t.lineTo(n/2-s/2,-r),t.lineTo(n/2,-a-r),t.lineTo(n/2+s/2,-r)):void 0},w=function(n,u,f){var h,c,o,e;return n?(t.lineTo(-s+r,0-r),t.lineTo(a+r,-a-r),t.lineTo(r,s-r)):u?(e=i.options.closeButtonOffset,o=l[0],f%2!=0&&(e=[e[1],e[0]],o=l[1]),h=Math.acos(e[1]/i.options.closeButtonRadius),c=Math.acos(e[0]/i.options.closeButtonRadius),t.lineTo(-o+r,-r),t.arc(r-e[0],-r+e[1],i.options.closeButtonRadius,-(Math.PI/2+h),c,!1)):(t.lineTo(-i.options.borderRadius+r,-r),t.quadraticCurveTo(r,-r,r,i.options.borderRadius-r))},t.translate(-e[0],-e[1]),t.save(),function(){var e,r,s,l,h,a,v,y,u,f,c;for(c=[],r=u=0,f=n.positions.length/2;f>=0?f>u:u>f;r=f>=0?++u:--u)h=r*2,a=r===0||r===3?0:i.dimensions.width,v=2>r?0:i.dimensions.height,y=Math.PI/2*r,s=r%2==0?i.dimensions.width:i.dimensions.height,l=new n.Joint(n.positions[h]),e=new n.Joint(n.positions[h+1]),t.save(),t.translate(a,v),t.rotate(y),b(s,l.eql(i.currentStem),r===0),t.translate(s,0),w(e.eql(i.currentStem),e.eql(o),r),c.push(t.restore());return c}(),t.closePath(),t.save(),this.options.shadow&&(t.shadowColor=this.options.shadowColor,t.shadowBlur=this.options.shadowBlur,t.shadowOffsetX=this.options.shadowOffset[0],t.shadowOffsetY=this.options.shadowOffset[1]),t.fill(),t.restore(),this.options.borderWidth&&t.stroke(),t.restore(),o?function(){var f,e,s,n,u;return s=e=i.options.closeButtonRadius*2,o+""=="top right"?(u=[i.dimensions.width-i.options.closeButtonOffset[0],i.options.closeButtonOffset[1]],f=[u[0]+r,u[1]-r]):(u=[i.options.closeButtonOffset[0],i.options.closeButtonOffset[1]],f=[u[0]-r,u[1]-r]),t.translate(f[0],f[1]),n=i.options.closeButtonCrossSize/2,t.save(),t.beginPath(),t.strokeStyle=i.options.closeButtonCrossColor,t.lineWidth=i.options.closeButtonCrossLineWidth,t.lineCap="round",t.moveTo(-n,-n),t.lineTo(n,n),t.stroke(),t.beginPath(),t.moveTo(n,-n),t.lineTo(-n,n),t.stroke(),t.restore(),i.adapter.css(i.closeButtonElement,{left:""+(u[0]-n-i.options.closeButtonLinkOverscan)+"px",top:""+(u[1]-n-i.options.closeButtonLinkOverscan)+"px",width:""+(i.options.closeButtonCrossSize+i.options.closeButtonLinkOverscan*2)+"px",height:""+(i.options.closeButtonCrossSize+i.options.closeButtonLinkOverscan*2)+"px"})}():void 0}},n.prototype._getPathStemMeasures=function(n,t,i){var e,o,r,f,s,h,u;if(f=i/2,r=Math.atan(n/2/t),e=r*2,s=f/Math.sin(e),o=2*s*Math.cos(r),u=f+t-o,0>u)throw Error("Sorry but your stemLength / stemBase ratio is strange.");return h=Math.tan(r)*u*2,{stemLength:u,stemBase:h}},n.prototype._getColor=function(n,t,i,r){var u,f,e,o,s;if(r==null&&(r=!1),typeof i=="string")return i;for(f=r?n.createLinearGradient(0,0,t.width,0):n.createLinearGradient(0,0,0,t.height),e=o=0,s=i.length;s>o;e=++o)u=i[e],f.addColorStop(u[0],u[1]);return f},n.prototype._searchAndActivateCloseButtons=function(){var i,n,r,t;for(t=this.adapter.findAll(this.container,"."+this["class"].close),n=0,r=t.length;r>n;n++)i=t[n],this.hideTriggers.push({element:this.adapter.wrap(i),event:"click"});return this.currentObservers.showing&&this._setupObservers("-showing","showing"),this.currentObservers.visible?this._setupObservers("-visible","visible"):void 0},n.prototype._activateFirstInput=function(){var n;return n=this.adapter.unwrap(this.adapter.find(this.container,"input, textarea")),n!=null?typeof n.focus=="function"?n.focus():void 0:void 0},n.prototype._followMousePosition=function(){if(!this.options.fixed)return n._observeMousePosition(this.bound.reposition)},n.prototype._stopFollowingMousePosition=function(){if(!this.options.fixed)return n._stopObservingMousePosition(this.bound.reposition)},n.prototype._clearShowTimeout=function(){return clearTimeout(this._showTimeoutId)},n.prototype._clearHideTimeout=function(){return clearTimeout(this._hideTimeoutId)},n.prototype._clearTimeouts=function(){return clearTimeout(this._visibilityStateTimeoutId),this._clearShowTimeout(),this._clearHideTimeout()},n.prototype._triggerElementExists=function(){for(var n=this.adapter.unwrap(this.triggerElement);n.parentNode;){if(n.parentNode.tagName==="BODY")return!0;n=n.parentNode}return!1},n.prototype._loadAjax=function(){var n=this;if(!this.loading)return this.loaded=!1,this.loading=!0,this.adapter.addClass(this.container,this["class"].loading),this.setContent(""),this.debug("Loading content from "+this.options.ajax),this.adapter.ajax({url:this.options.ajax,method:this.options.ajaxMethod,onSuccess:function(t){return n.debug("Loading successful."),n.adapter.removeClass(n.container,n["class"].loading),n.setContent(t)},onError:function(t){var i;return i=n.options.ajaxErrorMessage,n.debug(i,t),n.setContent(i),n.adapter.addClass(n.container,n["class"].ajaxError)},onComplete:function(){return n.adapter.removeClass(n.container,n["class"].loading),n.loading=!1,n.loaded=!0,n._searchAndActivateCloseButtons(),n._activateFirstInput(),n.reposition()}})},n.prototype._ensureTriggerElement=function(){if(!this._triggerElementExists())return(this.deactivate(),this._stopEnsureTriggerElement())},n.prototype._ensureTriggerElementInterval=1e3,n.prototype._startEnsureTriggerElement=function(){var n=this;return this._ensureTriggerElementTimeoutId=setInterval(function(){return n._ensureTriggerElement()},this._ensureTriggerElementInterval)},n.prototype._stopEnsureTriggerElement=function(){return clearInterval(this._ensureTriggerElementTimeoutId)},n}(),vendors=["khtml","ms","o","moz","webkit"],Opentip.prototype.setCss3Style=function(n,t){var i,u,e,f,r;n=this.adapter.unwrap(n);r=[];for(i in t)__hasProp.call(t,i)&&(u=t[i],n.style[i]!=null?r.push(n.style[i]=u):r.push(function(){var t,o,r;for(r=[],t=0,o=vendors.length;o>t;t++)e=vendors[t],f=""+this.ucfirst(e)+this.ucfirst(i),n.style[f]!=null?r.push(n.style[f]=u):r.push(void 0);return r}.call(this)));return r},Opentip.prototype.defer=function(n){return setTimeout(n,0)},Opentip.prototype.setTimeout=function(n,t){return setTimeout(n,t?t*1e3:0)},Opentip.prototype.ucfirst=function(n){return n==null?"":n.charAt(0).toUpperCase()+n.slice(1)},Opentip.prototype.dasherize=function(n){return n.replace(/([A-Z])/g,function(n,t){return"-"+t.toLowerCase()})},mousePositionObservers=[],mousePosition={x:0,y:0},mouseMoved=function(n){var r,t,u,i;for(mousePosition=Opentip.adapter.mousePosition(n),i=[],t=0,u=mousePositionObservers.length;u>t;t++)r=mousePositionObservers[t],i.push(r());return i},Opentip.followMousePosition=function(){return Opentip.adapter.observe(document.body,"mousemove",mouseMoved)},Opentip._observeMousePosition=function(n){return mousePositionObservers.push(n)},Opentip._stopObservingMousePosition=function(n){var t;return mousePositionObservers=function(){var i,u,r;for(r=[],i=0,u=mousePositionObservers.length;u>i;i++)t=mousePositionObservers[i],t!==n&&r.push(t);return r}()},Opentip.Joint=function(){function n(n){n!=null&&(n instanceof Opentip.Joint&&(n+=""),this.set(n))}return n.prototype.set=function(n){return n=n.toLowerCase(),this.setHorizontal(n),this.setVertical(n),this},n.prototype.setHorizontal=function(n){var t,i,r,u,e,o,f;for(i=["left","center","right"],r=0,e=i.length;e>r;r++)t=i[r],~n.indexOf(t)&&(this.horizontal=t.toLowerCase());for(this.horizontal==null&&(this.horizontal="center"),f=[],u=0,o=i.length;o>u;u++)t=i[u],f.push(this[t]=this.horizontal===t?t:void 0);return f},n.prototype.setVertical=function(n){var t,i,r,u,e,o,f;for(i=["top","middle","bottom"],r=0,e=i.length;e>r;r++)t=i[r],~n.indexOf(t)&&(this.vertical=t.toLowerCase());for(this.vertical==null&&(this.vertical="middle"),f=[],u=0,o=i.length;o>u;u++)t=i[u],f.push(this[t]=this.vertical===t?t:void 0);return f},n.prototype.eql=function(n){return n!=null&&this.horizontal===n.horizontal&&this.vertical===n.vertical},n.prototype.flip=function(){var n,t;return t=Opentip.position[this.toString(!0)],n=(t+4)%8,this.set(Opentip.positions[n]),this},n.prototype.toString=function(n){var t,i;return n==null&&(n=!1),i=this.vertical==="middle"?"":this.vertical,t=this.horizontal==="center"?"":this.horizontal,i&&t&&(t=n?Opentip.prototype.ucfirst(t):" "+t),""+i+t},n}(),Opentip.prototype._positionsEqual=function(n,t){return n!=null&&t!=null&&n.left===t.left&&n.top===t.top},Opentip.prototype._dimensionsEqual=function(n,t){return n!=null&&t!=null&&n.width===t.width&&n.height===t.height},Opentip.prototype.debug=function(){var n;return n=arguments.length>=1?__slice.call(arguments,0):[],Opentip.debug&&(typeof console!="undefined"&&console!==null?console.debug:void 0)!=null?(n.unshift("#"+this.id+" |"),console.debug.apply(console,n)):void 0},Opentip.findElements=function(){var i,t,r,f,n,e,u,h,o,s;for(i=Opentip.adapter,o=i.findAll(document.body,"[data-ot]"),s=[],u=0,h=o.length;h>u;u++){r=o[u];e={};t=i.data(r,"ot");(t===""||t==="true"||t==="yes")&&(t=i.attr(r,"title"),i.attr(r,"title",""));t=t||"";for(f in Opentip.styles.standard)n=i.data(r,"ot"+Opentip.prototype.ucfirst(f)),n!=null&&(n==="yes"||n==="true"||n==="on"?n=!0:(n==="no"||n==="false"||n==="off")&&(n=!1),e[f]=n);s.push(new Opentip(r,t,e))}return s},Opentip.version="2.4.6",Opentip.debug=!1,Opentip.lastId=0,Opentip.lastZIndex=100,Opentip.tips=[],Opentip._abortShowingGroup=function(n,t){var i,r,e,f,u;for(f=Opentip.tips,u=[],r=0,e=f.length;e>r;r++)i=f[r],i!==t&&i.options.group===n?u.push(i._abortShowing()):u.push(void 0);return u},Opentip._hideGroup=function(n,t){var i,r,e,f,u;for(f=Opentip.tips,u=[],r=0,e=f.length;e>r;r++)i=f[r],i!==t&&i.options.group===n?u.push(i.hide()):u.push(void 0);return u},Opentip.adapters={},Opentip.adapter=null,firstAdapter=!0,Opentip.addAdapter=function(n){return Opentip.adapters[n.name]=n,firstAdapter?(Opentip.adapter=n,n.domReady(Opentip.findElements),n.domReady(Opentip.followMousePosition),firstAdapter=!1):void 0},Opentip.positions=["top","topRight","right","bottomRight","bottom","bottomLeft","left","topLeft"],Opentip.position={},_ref=Opentip.positions,i=_i=0,_len=_ref.length;_len>_i;i=++_i)position=_ref[i],Opentip.position[position]=i;Opentip.styles={standard:{"extends":null,title:void 0,escapeTitle:!0,escapeContent:!1,className:"standard",stem:!0,delay:null,hideDelay:.1,fixed:!1,showOn:"mouseover",hideTrigger:"trigger",hideTriggers:[],hideOn:null,removeElementsOnHide:!1,offset:[0,0],containInViewport:!0,autoOffset:!0,showEffect:"appear",hideEffect:"fade",showEffectDuration:.3,hideEffectDuration:.2,stemLength:5,stemBase:8,tipJoint:"top left",target:null,targetJoint:null,cache:!0,ajax:!1,ajaxMethod:"GET",ajaxErrorMessage:"There was a problem downloading the content.",group:null,style:null,background:"#fff18f",backgroundGradientHorizontal:!1,closeButtonOffset:[5,5],closeButtonRadius:7,closeButtonCrossSize:4,closeButtonCrossColor:"#d2c35b",closeButtonCrossLineWidth:1.5,closeButtonLinkOverscan:6,borderRadius:5,borderWidth:1,borderColor:"#f2e37b",shadow:!0,shadowBlur:10,shadowOffset:[3,3],shadowColor:"rgba(0, 0, 0, 0.1)"},glass:{"extends":"standard",className:"glass",background:[[0,"rgba(252, 252, 252, 0.8)"],[.5,"rgba(255, 255, 255, 0.8)"],[.5,"rgba(250, 250, 250, 0.9)"],[1,"rgba(245, 245, 245, 0.9)"]],borderColor:"#eee",closeButtonCrossColor:"rgba(0, 0, 0, 0.2)",borderRadius:15,closeButtonRadius:10,closeButtonOffset:[8,8]},dark:{"extends":"standard",className:"dark",borderRadius:13,borderColor:"#444",closeButtonCrossColor:"rgba(240, 240, 240, 1)",shadowColor:"rgba(0, 0, 0, 0.3)",shadowOffset:[2,2],background:[[0,"rgba(30, 30, 30, 0.7)"],[.5,"rgba(30, 30, 30, 0.8)"],[.5,"rgba(10, 10, 10, 0.8)"],[1,"rgba(10, 10, 10, 0.9)"]]},alert:{"extends":"standard",className:"alert",borderRadius:1,borderColor:"#AE0D11",closeButtonCrossColor:"rgba(255, 255, 255, 1)",shadowColor:"rgba(0, 0, 0, 0.3)",shadowOffset:[2,2],background:[[0,"rgba(203, 15, 19, 0.7)"],[.5,"rgba(203, 15, 19, 0.8)"],[.5,"rgba(189, 14, 18, 0.8)"],[1,"rgba(179, 14, 17, 0.9)"]]}};Opentip.defaultStyle="standard";typeof module!="undefined"&&module!==null?module.exports=Opentip:window.Opentip=Opentip;__slice=[].slice,function(n){var t;return n.fn.opentip=function(n,t,i){return new Opentip(this,n,t,i)},t=function(){function t(){}return t.prototype.name="jquery",t.prototype.domReady=function(t){return n(t)},t.prototype.create=function(t){return n(t)},t.prototype.wrap=function(t){if(t=n(t),t.length>1)throw Error("Multiple elements provided.");return t},t.prototype.unwrap=function(t){return n(t)[0]},t.prototype.tagName=function(n){return this.unwrap(n).tagName},t.prototype.attr=function(){var t,i,r;return i=arguments[0],t=arguments.length>=2?__slice.call(arguments,1):[],(r=n(i)).attr.apply(r,t)},t.prototype.data=function(){var t,i,r;return i=arguments[0],t=arguments.length>=2?__slice.call(arguments,1):[],(r=n(i)).data.apply(r,t)},t.prototype.find=function(t,i){return n(t).find(i).get(0)},t.prototype.findAll=function(t,i){return n(t).find(i)},t.prototype.update=function(t,i,r){return t=n(t),r?t.text(i):t.html(i)},t.prototype.append=function(t,i){return n(t).append(i)},t.prototype.remove=function(t){return n(t).remove()},t.prototype.addClass=function(t,i){return n(t).addClass(i)},t.prototype.removeClass=function(t,i){return n(t).removeClass(i)},t.prototype.css=function(t,i){return n(t).css(i)},t.prototype.dimensions=function(t){return{width:n(t).outerWidth(),height:n(t).outerHeight()}},t.prototype.scrollOffset=function(){return[window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop]},t.prototype.viewportDimensions=function(){return{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}},t.prototype.mousePosition=function(n){return n==null?null:{x:n.pageX,y:n.pageY}},t.prototype.offset=function(t){var i;return i=n(t).offset(),{left:i.left,top:i.top}},t.prototype.observe=function(t,i,r){return n(t).bind(i,r)},t.prototype.stopObserving=function(t,i,r){return n(t).unbind(i,r)},t.prototype.ajax=function(t){var i,r;if(t.url==null)throw Error("No url provided");return n.ajax({url:t.url,type:(i=(r=t.method)!=null?r.toUpperCase():void 0)!=null?i:"GET"}).done(function(n){if(typeof t.onSuccess=="function")return t.onSuccess(n)}).fail(function(n){if(typeof t.onError=="function")return t.onError("Server responded with status "+n.status)}).always(function(){if(typeof t.onComplete=="function")return t.onComplete()})},t.prototype.clone=function(t){return n.extend({},t)},t.prototype.extend=function(){var t,i;return i=arguments[0],t=arguments.length>=2?__slice.call(arguments,1):[],n.extend.apply(n,[i].concat(__slice.call(t)))},t}(),Opentip.addAdapter(new t)}(jQuery),function(n){var s,p,w,r,tt,e,it,h,d,g,a=0,i={},c=[],l=0,t={},o=[],ut=null,b=new Image,et=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,bt=/[^\.]\.(swf)\s*$/i,ot,st=1,k=0,y="",v,f,u=!1,nt=n.extend(n("<div/>")[0],{prop:0}),ht=n.browser.msie&&n.browser.version<7&&!window.XMLHttpRequest,ct=function(){p.hide();b.onerror=b.onload=null;ut&&ut.abort();s.empty()},lt=function(){!1===i.onError(c,a,i)?(p.hide(),u=!1):(i.titleShow=!1,i.width="auto",i.height="auto",s.html('<p id="fancybox-error">Image is not available.<\/p>'),rt())},ft=function(){var t=c[a],r,o,h,l,v,f;if(ct(),i=n.extend({},n.fn.fancybox.defaults,typeof n(t).data("fancybox")=="undefined"?i:n(t).data("fancybox")),f=i.onStart(c,a,i),f===!1)u=!1;else if(typeof f=="object"&&(i=n.extend(i,f)),h=i.title||(t.nodeName?n(t).attr("title"):t.title)||"",t.nodeName&&!i.orig&&(i.orig=n(t).children("img:first").length?n(t).children("img:first"):n(t)),h===""&&i.orig&&i.titleFromAlt&&(h=i.orig.attr("alt")),r=i.href||(t.nodeName?n(t).attr("href"):t.href)||null,(/^(?:javascript)/i.test(r)||r=="#")&&(r=null),i.type?(o=i.type,r||(r=i.content)):i.content?o="html":r&&(o=r.match(et)?"image":r.match(bt)?"swf":n(t).hasClass("iframe")?"iframe":r.indexOf("#")===0?"inline":"ajax"),o){o=="inline"&&(t=r.substr(r.indexOf("#")),o=n(t).length>0?"inline":"ajax");i.type=o;i.href=r;i.title=h;i.autoDimensions&&(i.type=="html"||i.type=="inline"||i.type=="ajax"?(i.width="auto",i.height="auto"):i.autoDimensions=!1);i.modal&&(i.overlayShow=!0,i.hideOnOverlayClick=!1,i.hideOnContentClick=!1,i.enableEscapeButton=!1,i.showCloseButton=!1);i.padding=parseInt(i.padding,10);i.margin=parseInt(i.margin,10);s.css("padding",i.padding+i.margin);n(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){n(this).replaceWith(e.children())});switch(o){case"html":s.html(i.content);rt();break;case"inline":if(n(t).parent().is("#fancybox-content")===!0){u=!1;break}n('<div class="fancybox-inline-tmp" />').hide().insertBefore(n(t)).bind("fancybox-cleanup",function(){n(this).replaceWith(e.children())}).bind("fancybox-cancel",function(){n(this).replaceWith(s.children())});n(t).appendTo(s);rt();break;case"image":u=!1;n.fancybox.showActivity();b=new Image;b.onerror=function(){lt()};b.onload=function(){u=!0;b.onerror=b.onload=null;i.width=b.width;i.height=b.height;n("<img />").attr({id:"fancybox-img",src:b.src,alt:i.title}).appendTo(s);at()};b.src=r;break;case"swf":i.scrolling="no";l='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+i.width+'" height="'+i.height+'"><param name="movie" value="'+r+'"><\/param>';v="";n.each(i.swf,function(n,t){l+='<param name="'+n+'" value="'+t+'"><\/param>';v+=" "+n+'="'+t+'"'});l+='<embed src="'+r+'" type="application/x-shockwave-flash" width="'+i.width+'" height="'+i.height+'"'+v+"><\/embed><\/object>";s.html(l);rt();break;case"ajax":u=!1;n.fancybox.showActivity();i.ajax.win=i.ajax.success;ut=n.ajax(n.extend({},i.ajax,{url:r,data:i.ajax.data||{},error:function(n){n.status>0&&lt()},success:function(n,t,u){if((typeof u=="object"?u:ut).status==200){if(typeof i.ajax.win=="function"){if(f=i.ajax.win(r,n,t,u),f===!1){p.hide();return}(typeof f=="string"||typeof f=="object")&&(n=f)}s.html(n);rt()}}}));break;case"iframe":at()}}else lt()},rt=function(){var t=i.width,r=i.height;t=t.toString().indexOf("%")>-1?parseInt((n(window).width()-i.margin*2)*parseFloat(t)/100,10)+"px":t=="auto"?"auto":t+"px";r=r.toString().indexOf("%")>-1?parseInt((n(window).height()-i.margin*2)*parseFloat(r)/100,10)+"px":r=="auto"?"auto":r+"px";s.wrapInner('<div style="width:'+t+";height:"+r+";overflow: "+(i.scrolling=="auto"?"auto":i.scrolling=="yes"?"scroll":"hidden")+';position:relative;"><\/div>');i.width=s.width();i.height=s.height();at()},at=function(){var b,rt;if(p.hide(),r.is(":visible")&&!1===t.onCleanup(o,l,t))n.event.trigger("fancybox-cancel"),u=!1;else{if(u=!0,n(e.add(w)).unbind(),n(window).unbind("resize.fb scroll.fb"),n(document).unbind("keydown.fb"),r.is(":visible")&&t.titlePosition!=="outside"&&r.css("height",r.height()),o=c,l=a,t=i,t.overlayShow?(w.css({"background-color":t.overlayColor,opacity:t.overlayOpacity,cursor:t.hideOnOverlayClick?"pointer":"auto",height:n(document).height()}),w.is(":visible")||(ht&&n("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"}),w.show())):w.hide(),f=dt(),y=t.title||"",k=0,h.empty().removeAttr("style").removeClass(),t.titleShow!==!1&&(b=n.isFunction(t.titleFormat)?t.titleFormat(y,o,l,t):y&&y.length?t.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"><\/td><td id="fancybox-title-float-main">'+y+'<\/td><td id="fancybox-title-float-right"><\/td><\/tr><\/table>':'<div id="fancybox-title-'+t.titlePosition+'">'+y+"<\/div>":!1,y=b,!(!y||y===""))){h.addClass("fancybox-title-"+t.titlePosition).html(y).appendTo("body").show();switch(t.titlePosition){case"inside":h.css({width:f.width-t.padding*2,marginLeft:t.padding,marginRight:t.padding});k=h.outerHeight(!0);h.appendTo(tt);f.height+=k;break;case"over":h.css({marginLeft:t.padding,width:f.width-t.padding*2,bottom:t.padding}).appendTo(tt);break;case"float":h.css("left",parseInt((h.width()-f.width-40)/2,10)*-1).appendTo(r);break;default:h.css({width:f.width-t.padding*2,paddingLeft:t.padding,paddingRight:t.padding}).appendTo(r)}}h.hide();r.is(":visible")?(n(it.add(d).add(g)).hide(),b=r.position(),v={top:b.top,left:b.left,width:r.width(),height:r.height()},rt=v.width==f.width&&v.height==f.height,e.fadeTo(t.changeFade,.3,function(){var r=function(){e.html(s.contents()).fadeTo(t.changeFade,1,vt)};n.event.trigger("fancybox-change");e.empty().removeAttr("filter").css({"border-width":t.padding,width:f.width-t.padding*2,height:i.autoDimensions?"auto":f.height-k-t.padding*2});rt?r():(nt.prop=0,n(nt).animate({prop:1},{duration:t.changeSpeed,easing:t.easingChange,step:yt,complete:r}))})):(r.removeAttr("style"),e.css("border-width",t.padding),t.transitionIn=="elastic"?(v=wt(),e.html(s.contents()),r.show(),t.opacity&&(f.opacity=0),nt.prop=0,n(nt).animate({prop:1},{duration:t.speedIn,easing:t.easingIn,step:yt,complete:vt})):(t.titlePosition=="inside"&&k>0&&h.show(),e.css({width:f.width-t.padding*2,height:i.autoDimensions?"auto":f.height-k-t.padding*2}).html(s.contents()),r.css(f).fadeIn(t.transitionIn=="none"?0:t.speedIn,vt)))}},kt=function(){(t.enableEscapeButton||t.enableKeyboardNav)&&n(document).bind("keydown.fb",function(i){i.keyCode==27&&t.enableEscapeButton?(i.preventDefault(),n.fancybox.close()):(i.keyCode==37||i.keyCode==39)&&t.enableKeyboardNav&&i.target.tagName!=="INPUT"&&i.target.tagName!=="TEXTAREA"&&i.target.tagName!=="SELECT"&&(i.preventDefault(),n.fancybox[i.keyCode==37?"prev":"next"]())});t.showNavArrows?((t.cyclic&&o.length>1||l!==0)&&d.show(),(t.cyclic&&o.length>1||l!=o.length-1)&&g.show()):(d.hide(),g.hide())},vt=function(){n.support.opacity||(e.get(0).style.removeAttribute("filter"),r.get(0).style.removeAttribute("filter"));i.autoDimensions&&e.css("height","auto");r.css("height","auto");y&&y.length&&h.show();t.showCloseButton&&it.show();kt();t.hideOnContentClick&&e.bind("click",n.fancybox.close);t.hideOnOverlayClick&&w.bind("click",n.fancybox.close);n(window).bind("resize.fb",n.fancybox.resize);t.centerOnScroll&&n(window).bind("scroll.fb",n.fancybox.center);t.type=="iframe"&&n('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(n.browser.msie?'allowtransparency="true""':"")+' scrolling="'+i.scrolling+'" src="'+t.href+'"><\/iframe>').appendTo(e);r.show();u=!1;n.fancybox.center();t.onComplete(o,l,t);var f,s;o.length-1>l&&(f=o[l+1].href,typeof f!="undefined"&&f.match(et)&&(s=new Image,s.src=f));l>0&&(f=o[l-1].href,typeof f!="undefined"&&f.match(et)&&(s=new Image,s.src=f))},yt=function(n){var i={width:parseInt(v.width+(f.width-v.width)*n,10),height:parseInt(v.height+(f.height-v.height)*n,10),top:parseInt(v.top+(f.top-v.top)*n,10),left:parseInt(v.left+(f.left-v.left)*n,10)};typeof f.opacity!="undefined"&&(i.opacity=n<.5?.5:n);r.css(i);e.css({width:i.width-t.padding*2,height:i.height-k*n-t.padding*2})},pt=function(){return[n(window).width()-t.margin*2,n(window).height()-t.margin*2,n(document).scrollLeft()+t.margin,n(document).scrollTop()+t.margin]},dt=function(){var r=pt(),n={},f=t.autoScale,u=t.padding*2;return n.width=t.width.toString().indexOf("%")>-1?parseInt(r[0]*parseFloat(t.width)/100,10):t.width+u,n.height=t.height.toString().indexOf("%")>-1?parseInt(r[1]*parseFloat(t.height)/100,10):t.height+u,f&&(n.width>r[0]||n.height>r[1])&&(i.type=="image"||i.type=="swf"?(f=t.width/t.height,n.width>r[0]&&(n.width=r[0],n.height=parseInt((n.width-u)/f+u,10)),n.height>r[1]&&(n.height=r[1],n.width=parseInt((n.height-u)*f+u,10))):(n.width=Math.min(n.width,r[0]),n.height=Math.min(n.height,r[1]))),n.top=parseInt(Math.max(r[3]-20,r[3]+(r[1]-n.height-40)*.5),10),n.left=parseInt(Math.max(r[2]-20,r[2]+(r[0]-n.width-40)*.5),10),n},wt=function(){var r=i.orig?n(i.orig):!1,u={};return r&&r.length?(u=r.offset(),u.top+=parseInt(r.css("paddingTop"),10)||0,u.left+=parseInt(r.css("paddingLeft"),10)||0,u.top+=parseInt(r.css("border-top-width"),10)||0,u.left+=parseInt(r.css("border-left-width"),10)||0,u.width=r.width(),u.height=r.height(),u={width:u.width+t.padding*2,height:u.height+t.padding*2,top:u.top-t.padding-20,left:u.left-t.padding-20}):(r=pt(),u={width:t.padding*2,height:t.padding*2,top:parseInt(r[3]+r[1]*.5,10),left:parseInt(r[2]+r[0]*.5,10)}),u},gt=function(){p.is(":visible")?(n("div",p).css("top",st*-40+"px"),st=(st+1)%12):clearInterval(ot)};n.fn.fancybox=function(t){return n(this).length?(n(this).data("fancybox",n.extend({},t,n.metadata?n(this).metadata():{})).unbind("click.fb").bind("click.fb",function(t){t.preventDefault();u||(u=!0,n(this).blur(),c=[],a=0,t=n(this).attr("rel")||"",t&&t!=""&&t!=="nofollow"?(c=n("a[rel="+t+"], area[rel="+t+"]"),a=c.index(this)):c.push(this),ft())}),this):this};n.fancybox=function(t,i){var f,r,e;if(!u){if(u=!0,f=typeof i!="undefined"?i:{},c=[],a=parseInt(f.index,10)||0,n.isArray(t)){for(r=0,e=t.length;r<e;r++)typeof t[r]=="object"?n(t[r]).data("fancybox",n.extend({},f,t[r])):t[r]=n({}).data("fancybox",n.extend({content:t[r]},f));c=jQuery.merge(c,t)}else typeof t=="object"?n(t).data("fancybox",n.extend({},f,t)):t=n({}).data("fancybox",n.extend({content:t},f)),c.push(t);(a>c.length||a<0)&&(a=0);ft()}};n.fancybox.showActivity=function(){clearInterval(ot);p.show();ot=setInterval(gt,66)};n.fancybox.hideActivity=function(){p.hide()};n.fancybox.next=function(){return n.fancybox.pos(l+1)};n.fancybox.prev=function(){return n.fancybox.pos(l-1)};n.fancybox.pos=function(n){u||(n=parseInt(n),c=o,n>-1&&n<o.length?(a=n,ft()):t.cyclic&&o.length>1&&(a=n>=o.length?0:o.length-1,ft()))};n.fancybox.cancel=function(){if(!u){u=!0;n.event.trigger("fancybox-cancel");ct();i.onCancel(c,a,i);u=!1}};n.fancybox.close=function(){function s(){w.fadeOut("fast");h.empty().hide();r.hide();n.event.trigger("fancybox-cleanup");e.empty();t.onClosed(o,l,t);o=i=[];l=a=0;t=i={};u=!1}if(!(u||r.is(":hidden")))if(u=!0,t&&!1===t.onCleanup(o,l,t))u=!1;else if(ct(),n(it.add(d).add(g)).hide(),n(e.add(w)).unbind(),n(window).unbind("resize.fb scroll.fb"),n(document).unbind("keydown.fb"),e.find("iframe").attr("src",ht&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank"),t.titlePosition!=="inside"&&h.empty(),r.stop(),t.transitionOut=="elastic"){v=wt();var c=r.position();f={top:c.top,left:c.left,width:r.width(),height:r.height()};t.opacity&&(f.opacity=1);h.empty().hide();nt.prop=1;n(nt).animate({prop:0},{duration:t.speedOut,easing:t.easingOut,step:yt,complete:s})}else r.fadeOut(t.transitionOut=="none"?0:t.speedOut,s)};n.fancybox.resize=function(){w.is(":visible")&&w.css("height",n(document).height());n.fancybox.center(!0)};n.fancybox.center=function(n){var i,f;u||(f=n===!0?1:0,i=pt(),!f&&(r.width()>i[0]||r.height()>i[1])||r.stop().animate({top:parseInt(Math.max(i[3]-20,i[3]+(i[1]-e.height()-40)*.5-t.padding)),left:parseInt(Math.max(i[2]-20,i[2]+(i[0]-e.width()-40)*.5-t.padding))},typeof n=="number"?n:200))};n.fancybox.init=function(){n("#fancybox-wrap").length||(n("body").append(s=n('<div id="fancybox-tmp"><\/div>'),p=n('<div id="fancybox-loading"><div><\/div><\/div>'),w=n('<div id="fancybox-overlay"><\/div>'),r=n('<div id="fancybox-wrap"><\/div>')),tt=n('<div id="fancybox-outer"><\/div>').append('<div class="fancybox-bg" id="fancybox-bg-n"><\/div><div class="fancybox-bg" id="fancybox-bg-ne"><\/div><div class="fancybox-bg" id="fancybox-bg-e"><\/div><div class="fancybox-bg" id="fancybox-bg-se"><\/div><div class="fancybox-bg" id="fancybox-bg-s"><\/div><div class="fancybox-bg" id="fancybox-bg-sw"><\/div><div class="fancybox-bg" id="fancybox-bg-w"><\/div><div class="fancybox-bg" id="fancybox-bg-nw"><\/div>').appendTo(r),tt.append(e=n('<div id="fancybox-content"><\/div>'),it=n('<a id="fancybox-close"><\/a>'),h=n('<div id="fancybox-title"><\/div>'),d=n('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"><\/span><\/a>'),g=n('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"><\/span><\/a>')),it.click(n.fancybox.close),p.click(n.fancybox.cancel),d.click(function(t){t.preventDefault();n.fancybox.prev()}),g.click(function(t){t.preventDefault();n.fancybox.next()}),n.fn.mousewheel&&r.bind("mousewheel.fb",function(t,i){u?t.preventDefault():(n(t.target).get(0).clientHeight==0||n(t.target).get(0).scrollHeight===n(t.target).get(0).clientHeight)&&(t.preventDefault(),n.fancybox[i>0?"prev":"next"]())}),n.support.opacity||r.addClass("fancybox-ie"),ht&&(p.addClass("fancybox-ie6"),r.addClass("fancybox-ie6"),n('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"><\/iframe>').prependTo(tt)))};n.fn.fancybox.defaults={padding:10,margin:40,opacity:!1,modal:!1,cyclic:!1,scrolling:"auto",width:560,height:340,autoScale:!0,autoDimensions:!0,centerOnScroll:!1,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:!0,hideOnContentClick:!1,overlayShow:!0,overlayOpacity:.7,overlayColor:"#777",titleShow:!0,titlePosition:"float",titleFormat:null,titleFromAlt:!1,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:!0,showNavArrows:!0,enableEscapeButton:!0,enableKeyboardNav:!0,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};n(document).ready(function(){n.fancybox.init()})}(jQuery)