123 |
- !function(e,t){if("function"==typeof define&&define.amd)define(["jquery","jquery-ui"],t);else if("undefined"!=typeof exports){var n,i;try{n=require("jquery"),i=require("jquery-ui")}catch(e){}module.exports=t(n)}else t(e.jQuery,e.jQuery.ui,!0)}(this,function(st,e,t){var n,i,a,o,r,s,l,c,d,p,u,h,f,m,g,v,b,y,w,x,k,Me=function(e,t,n){function P(e){var i,t,n,a,o,r,s,l={},c={};2.1<=D.api?(D.commandMap=e.options.uiCmdMap&&Object.keys(e.options.uiCmdMap).length?e.options.uiCmdMap:{},ve!==JSON.stringify(D.commandMap)&&(ve=JSON.stringify(D.commandMap))):D.options.sync=0,e.init?(Q={},ee={}):(o=J,i="elfinder-subtree-loaded "+D.res("class","navexpand"),D.res("class","navcollapse"),t=Object.keys(Q),n=function(e){if(!Q[e])return!0;var t="directory"===Q[e].mime,n=Q[e].phash;!(!t||l[n]||!c[n]&&D.navHash2Elm(Q[e].hash).is(":hidden")&&100<D.navHash2Elm(n).next(".elfinder-navbar-subtree").children().length)||!t&&n===J||oe[e]?t&&(c[n]=!0):(t&&!l[n]&&(l[n]=!0,D.navHash2Elm(n).removeClass(i).next(".elfinder-navbar-subtree").empty()),xe(Q[e]))},a=function(){t.length&&(be&&be._abort(),be=D.asyncJob(n,t,{interval:20,numPerOnce:100}).done(function(){var t=D.storage("hide")||{items:{}};Object.keys(Z).length&&st.each(Z,function(e){t.items[e]||delete Z[e]})}))},D.trigger("filesgc").one("filesgc",function(){t=[]}),D.one("opendone",function(){o!==J&&(R.data("lazycnt")?D.one("lazydone",a):a())})),D.sorters={},J=e.cwd.hash,ye(e.files),Q[J]?(s=D.diff([e.cwd],!0)).changed.length&&(ye(s.changed,"change"),D.change({changed:s.changed})):ye([e.cwd]),e.changed&&e.changed.length&&ye(e.changed,"change"),r=JSON.stringify(D.sorters),he!==r&&(D.trigger("sorterupdate"),he=r),D.lastDir(J),D.autoSync()}function i(n){var e,i=n.keyCode,a=!(!n.ctrlKey&&!n.metaKey),t="mousedown"===n.type;t||(D.keyState.keyCode=i),D.keyState.ctrlKey=a,D.keyState.shiftKey=n.shiftKey,D.keyState.metaKey=n.metaKey,D.keyState.altKey=n.altKey,t||("keyup"!==n.type?K&&(st.each(ie,function(e,t){t.type==n.type&&t.keyCode==i&&t.shiftKey==n.shiftKey&&t.ctrlKey==a&&t.altKey==n.altKey&&(n.preventDefault(),n.stopPropagation(),t.callback(n,D),D.debug("shortcut-exec",e+" : "+t.description))}),i!=st.ui.keyCode.TAB||st(n.target).is(":input")||n.preventDefault(),"keydown"===n.type&&i==st.ui.keyCode.ESCAPE&&(R.find(".ui-widget:visible").length||D.clipboard().length&&D.clipboard([]),st.ui.ddmanager&&(e=st.ui.ddmanager.current)&&e.helper&&e.cancel(),D.toHide(R.find(".ui-widget.elfinder-button-menu.elfinder-frontmost:visible")),D.trigger("keydownEsc",n))):D.keyState.keyCode=null)}var o,s,q,a,F,r,l,c,d,p,u,h,f,m,g,v,b,y,w,x,k,C,z,T,A,j,O,S,I,M,D=this,E=[],U=["button","tooltip"],R=st(e),H=st.extend(!0,{},st._data(R.get(0),"events")),_=st("<div></div>").append(R.contents()).attr("class",R.attr("class")||"").attr("style",R.attr("style")||""),N=R.attr("id")||R.attr("id","elfauto"+st(".elfinder").length).attr("id"),L="elfinder-"+N,W="mousedown."+L,B="keydown."+L,$="keypress."+L,V="keyup."+L,K=!1,X=!1,J="",G={path:"",url:"",tmbUrl:"",disabled:[],separator:"/",archives:[],extract:[],copyOverwrite:!0,uploadOverwrite:!0,uploadMaxSize:0,jpgQuality:100,tmbCrop:!1,tmbReqCustomData:!1,tmb:!1},Y={},Q={},Z={},ee={},te=[],ne={},ie={},ae=[],oe={},re=[],se=[],le=new D.command(D),ce="auto",de=400,pe=null,ue="sounds/",he="",fe=!1,me=st(document.createElement("audio")).hide().appendTo("body")[0],ge=0,ve="",be=null,ye=function(e,t){function n(e){var t=e||{},n=[];st.each(D.sortRules,function(e){(l[e]||void 0!==t[e]||"mode"===e&&void 0!==t.perm)&&n.push(e)}),D.sorters=D.arrayFlip(n,!0),D.sorters._checked=!0}for(var i,a,o,r,t=t||"files",s=["sizeInfo","encoding"],l={name:!0,perm:!0,date:!0,size:!0,kind:!0},c=!D.sorters._checked&&"files"===t,d=e.length,p={},u=D.storage("hide")||{},h=u.items||{},f=0;f<d;f++)if(i=Object.assign({},e[f]),r=!(u.show||!h[i.hash]),i.name&&i.hash&&i.mime){if(r||(c&&i.phash===J&&(n(i),c=!1),!i.phash||"add"!==t&&("change"!==t||Q[i.hash]&&i.size===Q[i.hash])||(o=D.parents(i.phash))&&st.each(o,function(){p[this]=!0})),Q[i.hash]){for(a=0;a<s.length;a++)Q[i.hash][s[a]]&&!i[s[a]]&&(i[s[a]]=Q[i.hash][s[a]]);i.sizeInfo&&!i.size&&(i.size=i.sizeInfo.size),xe(Q[i.hash],!0)}h[i.hash]&&(Z[i.hash]=i),r?(d--,e.splice(f--,1)):("directory"!==(Q[i.hash]=i).mime||ee[i.hash]||(ee[i.hash]={}),i.phash&&(ee[i.phash]||(ee[i.phash]={}),ee[i.phash][i.hash]=!0))}st.each(Object.keys(p),function(){var e=Q[this];e&&e.sizeInfo&&delete e.sizeInfo}),c&&n()},we=function(e){var t,n=e.length,i={},o=function(a){var e=Q[a];e&&("directory"===e.mime&&(i[a]&&delete D.roots[i[a]],st.each(D.leafRoots,function(e,t){var n,i;-1!==(n=st.inArray(a,t))&&(1===t.length?((i=Object.assign({},Q[e]))&&i._realStats&&(st.each(i._realStats,function(e,t){i[e]=t}),we(Q[e]._realStats),D.change({changed:[i]})),delete D.leafRoots[e]):D.leafRoots[e].splice(n,1))}),D.searchStatus.state<2&&st.each(Q,function(e,t){t.phash==a&&o(e)})),e.phash&&(t=D.parents(e.phash))&&st.each(t,function(){r[this]=!0}),xe(Q[a]))},r={};for(st.each(D.roots,function(e,t){i[t]=e});n--;)o(e[n]);st.each(Object.keys(r),function(){var e=Q[this];e&&e.sizeInfo&&delete e.sizeInfo})},xe=function(e,t){var n=e.hash,i=e.phash;i&&ee[i]&&delete ee[i][n],t||(ee[n]&&delete ee[n],D.optionsByHashes[n]&&delete D.optionsByHashes[n]),delete Q[n]},ke=0,Ce=[],ze=null,Te=new Date,Ae=window.parent!==window,je=function(){var n,e;if(Ae)try{(e=st("iframe",window.parent.document)).length&&st.each(e,function(e,t){if(t.contentWindow===window)return n=st(t),!1})}catch(e){}return n}();function Oe(){R.data("cssautoloadHide")&&(R.data("cssautoloadHide").remove(),R.removeData("cssautoloadHide"))}function Se(){D.cssloaded||(Oe(),D.cssloaded=!0,D.trigger("cssloaded"))}function Ie(e){var t;e.target===window&&e.data&&e.data.elm&&(t=e.data.elm,T&&cancelAnimationFrame(T),T=requestAnimationFrame(function(){t.trigger("resize",{maximize:"on"})}))}t=t||{},D.UA.Mobile&&st(window).on("orientationchange."+L,function(){var e=(screen&&screen.orientation&&screen.orientation.angle||window.orientation||0)+0;-90===e&&(e=270),D.UA.Angle=e,D.UA.Rotated=e%180!=0}).trigger("orientationchange."+L),t.bootCallback&&"function"==typeof t.bootCallback&&(c=n,d=t.bootCallback,n=function(e,t){c&&"function"==typeof c&&c.call(this,e,t),d.call(this,e,t)}),delete t.bootCallback,this.api=null,this.newAPI=!1,this.oldAPI=!1,this.netDrivers=[],this.baseUrl="",this.i18nBaseUrl="",this.cssloaded=!1,this.theme=null,this.mimesCanMakeEmpty={},this.bootCallback,this.reloadCallback,this.id=N,this.storage=function(){try{return"localStorage"in window&&null!==window.localStorage?(D.UA.Safari&&(window.localStorage.setItem("elfstoragecheck",1),window.localStorage.removeItem("elfstoragecheck")),D.localStorage):D.cookie}catch(e){return D.cookie}}(),this.pauseUnloadCheck=function(e,t){if(void 0===e)return fe;fe=!!e,e&&!t&&requestAnimationFrame(function(){fe=!1})},this.options=Object.assign({},this._options),t.uiOptions&&t.uiOptions.toolbar&&Array.isArray(t.uiOptions.toolbar)&&st.isPlainObject(t.uiOptions.toolbar[t.uiOptions.toolbar.length-1])&&(D.options.uiOptions.toolbarExtra=Object.assign(D.options.uiOptions.toolbarExtra||{},t.uiOptions.toolbar.pop())),(p=function(e,n){st.isPlainObject(e)&&st.each(e,function(e,t){st.isPlainObject(t)?(n[e]||(n[e]={}),p(t,n[e])):n[e]=t})})(t,D.options),this.options.uiOptions.toolbar.push(this.options.uiOptions.toolbarExtra),delete this.options.uiOptions.toolbarExtra,this.toUnbindEvents={},this.bind=function(e,t,n){var i,a;if(t&&("function"==typeof t||"function"==typeof t.done))for(a=(e=(""+e).toLowerCase().replace(/^\s+|\s+$/g,"").split(/\s+/)).length,i=0;i<a;i++)void 0===ne[e[i]]&&(ne[e[i]]=[]),ne[e[i]][n?"unshift":"push"](t);return this},this.unbind=function(e,t){for(var n,i,a=(e=(""+e).toLowerCase().split(/\s+/)).length,o=0;o<a;o++)(n=ne[e[o]])&&-1<(i=st.inArray(t,n))&&n.splice(i,1);return t=null,this},this.trigger=function(e,t,n){var i,a,o,r,s=e.toLowerCase(),l="object"==typeof t,c=ne[s]||[],d=[];if(this.debug("event-"+s,t),l&&void 0!==n||(n=!0),a=c.length){for(r=st.Event(s),t&&(t._getEvent=function(){return r}),n&&(r.data=t),i=0;i<a;i++)if(c[i])if(c[i].done)d.push(c[i].done);else{if(c[i].length&&!n){if(void 0===o)try{o=JSON.stringify(t)}catch(e){o=!1}r.data=o?JSON.parse(o):t}try{if(!1===c[i].call(r,r,this)||r.isDefaultPrevented()){this.debug("event-stoped",r.type);break}}catch(e){window.console&&window.console.log&&window.console.log(e)}}if(a=d.length)for(i=0;i<a;i++)try{if(!1===d[i].call(r,r,this)||r.isDefaultPrevented()){this.debug("event-stoped",r.type+"(done)");break}}catch(e){window.console&&window.console.log&&window.console.log(e)}this.toUnbindEvents[s]&&this.toUnbindEvents[s].length&&(st.each(this.toUnbindEvents[s],function(e,t){D.unbind(t.type,t.callback)}),delete this.toUnbindEvents[s])}return this},this.getListeners=function(e){return e?ne[e.toLowerCase()]:ne},this.baseUrl=D.options.baseUrl?D.options.baseUrl:(f="",u=null,st("head > script").each(function(){if(this.src&&this.src.match(/js\/elfinder(?:-[a-z0-9_-]+)?\.(?:min|full)\.js$/i))return u=st(this),!1}),u&&((f=u.attr("src").replace(/js\/[^\/]+$/,"")).match(/^(https?\/\/|\/)/)||(h=st("head > base[href]").attr("href"))&&(f=h.replace(/\/$/,"")+"/"+f)),""!==f?D.options.baseUrl=f:(D.options.baseUrl||(D.options.baseUrl="./"),f=D.options.baseUrl),f),this.i18nBaseUrl=(this.options.i18nBaseUrl||this.baseUrl+"js/i18n").replace(/\/$/,"")+"/",this.options.maxErrorDialogs=Math.max(1,parseInt(this.options.maxErrorDialogs||5)),G.dispInlineRegex=this.options.dispInlineRegex,this.options.cssAutoLoad&&(m=D.baseUrl,st('head > link[href$="css/elfinder.min.css"],link[href$="css/elfinder.full.css"]:first').length||(D.cssloaded=null),Array.isArray(D.options.cssAutoLoad)&&(D.options.themes.default?!0===D.cssloaded?D.loadCss(D.options.cssAutoLoad):D.bind("cssloaded",function(){D.loadCss(D.options.cssAutoLoad)}):(D.options.themes=Object.assign({default:{name:"default",cssurls:D.options.cssAutoLoad}},D.options.themes),D.options.theme||(D.options.theme="default"))),null===D.cssloaded&&(R.addClass("elfinder").data("cssautoloadHide",st("<style>.elfinder{visibility:hidden;overflow:hidden}</style>")),st("head").append(R.data("cssautoloadHide")),D.options.themes.default||(D.options.themes=Object.assign({default:{name:"default",cssurls:"../../static/admin/src/elfinder/css/theme.css",author:"elFinder Project",license:"3-clauses BSD"}},D.options.themes),D.options.theme||(D.options.theme="default")),requestAnimationFrame(function(){"hidden"===R.css("visibility")?D.loadCss([m+"css/elfinder.min.css"],{dfd:st.Deferred().done(function(){Se()}).fail(function(){Oe(),D.cssloaded||(D.cssloaded=!1,D.bind("init",function(){D.cssloaded||D.error(["errRead","CSS (elfinder.min)"])}))})}):Se()}))),v=D.options.themes,(b=Object.keys(v||{})).length&&(v[g=D.storage("theme")||D.options.theme]||(g=b[0]),D.cssloaded?D.changeTheme(g):D.bind("cssloaded",function(){D.changeTheme(g)})),this.optionProperties={icon:void 0,csscls:void 0,tmbUrl:void 0,uiCmdMap:{},netkey:void 0,disabled:[]},Ae||this.options.enableAlways||2!==st("body").children().length||(this.options.enableAlways=!0),!0===this.options.debug?this.options.debug="all":Array.isArray(this.options.debug)?(y={},st.each(D.options.debug,function(){y[this]=!0}),D.options.debug=y):this.options.debug=!1,this.noConflicts={},this.noConflict=function(){st.each(U,function(e,t){st.fn[t]&&"function"==typeof st.fn[t].noConflict&&(D.noConflicts[t]=st.fn[t].noConflict())})},this.noConflict(),this.isCORS=!1,void 0!==D.options.cors&&null!==D.options.cors?D.isCORS=!!D.options.cors:(w=document.createElement("a"),k=window.location.protocol,C=function(e){return"https:"===(e=e&&":"!==e?e:k)?/\:443$/:/\:80$/},z=window.location.host.replace(C(k),""),w.href=t.url,t.urlUpload&&t.urlUpload!==t.url&&((x=document.createElement("a")).href=t.urlUpload),(z!==w.host.replace(C(w.protocol),"")||":"!==w.protocol&&""!==w.protocol&&k!==w.protocol||x&&(z!==x.host.replace(C(x.protocol),"")||":"!==x.protocol&&""!==x.protocol&&k!==x.protocol))&&(D.isCORS=!0)),D.isCORS&&(st.isPlainObject(D.options.customHeaders)||(D.options.customHeaders={}),st.isPlainObject(D.options.xhrFields)||(D.options.xhrFields={}),D.options.requestType="post",D.options.customHeaders["X-Requested-With"]="XMLHttpRequest",D.options.xhrFields.withCredentials=!0),this.requestType=/^(get|post)$/i.test(this.options.requestType)?this.options.requestType.toLowerCase():"get",q=Math.max(parseInt(this.options.requestMaxConn),1),this.optsCustomData=st.isPlainObject(this.options.customData)?this.options.customData:{},this.customData=Object.assign({},this.optsCustomData),this.prevCustomData=null,this.customHeaders=st.isPlainObject(this.options.customHeaders)?this.options.customHeaders:{},this.xhrFields=st.isPlainObject(this.options.xhrFields)?this.options.xhrFields:{},this.replaceXhrSend=function(){l=l||XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.send=function(){var t=this;return D.customHeaders&&st.each(D.customHeaders,function(e){t.setRequestHeader(e,this)}),D.xhrFields&&st.each(D.xhrFields,function(e){e in t&&(t[e]=this)}),l.apply(this,arguments)}},this.restoreXhrSend=function(){l&&(XMLHttpRequest.prototype.send=l)},this.abortCmdsOnOpen=this.options.abortCmdsOnOpen||["tmb","parents"],this.navPrefix="nav"+(Me.prototype.uniqueid?Me.prototype.uniqueid:"")+"-",this.cwdPrefix=Me.prototype.uniqueid?"cwd"+Me.prototype.uniqueid+"-":"",++Me.prototype.uniqueid,this.uploadURL=t.urlUpload||t.url,this.namespace=L,this.today=new Date(Te.getFullYear(),Te.getMonth(),Te.getDate()).getTime()/1e3,this.yesterday=this.today-86400,a=this.options.UTCDate?"UTC":"",this.getHours="get"+a+"Hours",this.getMinutes="get"+a+"Minutes",this.getSeconds="get"+a+"Seconds",this.getDate="get"+a+"Date",this.getDay="get"+a+"Day",this.getMonth="get"+a+"Month",this.getFullYear="get"+a+"FullYear",this.zIndex,this.searchStatus={state:0,query:"",target:"",mime:"",mixed:!1,ininc:!1},this.lang=this.storage("lang")||this.options.lang,"jp"===this.lang&&(this.lang=this.options.lang="ja"),this.viewType=this.storage("view")||this.options.defaultView||"icons",this.sortType=this.storage("sortType")||this.options.sortType||"name",this.sortOrder=this.storage("sortOrder")||this.options.sortOrder||"asc",this.sortStickFolders=this.storage("sortStickFolders"),null===this.sortStickFolders?this.sortStickFolders=!!this.options.sortStickFolders:this.sortStickFolders=!!this.sortStickFolders,this.sortAlsoTreeview=this.storage("sortAlsoTreeview"),null===this.sortAlsoTreeview||null===this.options.sortAlsoTreeview?this.sortAlsoTreeview=!!this.options.sortAlsoTreeview:this.sortAlsoTreeview=!!this.sortAlsoTreeview,this.sortRules=st.extend(!0,{},this._sortRules,this.options.sortRules),st.each(this.sortRules,function(e,t){"function"!=typeof t&&delete D.sortRules[e]}),this.compare=st.proxy(this.compare,this),this.notifyDelay=0<this.options.notifyDelay?parseInt(this.options.notifyDelay):500,this.draggingUiHelper=null,this.droppable={greedy:!0,tolerance:"pointer",accept:".elfinder-cwd-file-wrapper,.elfinder-navbar-dir,.elfinder-cwd-file,.elfinder-cwd-filename",hoverClass:this.res("class","adroppable"),classes:{"ui-droppable-hover":this.res("class","adroppable")},autoDisable:!0,drop:function(e,t){var n,i,a,o=st(this),r=st.grep(t.helper.data("files")||[],function(e){return!!e}),s=[],l=[],c=[],d=t.helper.hasClass("elfinder-drag-helper-plus");if(void 0===e.button||t.helper.data("namespace")!==L||!D.insideWorkzone(e.pageX,e.pageY))return!1;for(i=o.hasClass(D.res("class","cwdfile"))?D.cwdId2Hash(o.attr("id")):o.hasClass(D.res("class","navdir"))?D.navId2Hash(o.attr("id")):J,n=r.length;n--;)(a=r[n])!=i&&Q[a].phash!=i?s.push(a):(d&&a!==i&&Q[i].write?l:c).push(a);if(c.length)return!1;t.helper.data("droped",!0),l.length&&(t.helper.hide(),D.exec("duplicate",l,{_userAction:!0})),s.length&&(t.helper.hide(),D.clipboard(s,!d),D.exec("paste",i,{_userAction:!0},i).always(function(){D.clipboard([]),D.trigger("unlockfiles",{files:r})}),D.trigger("drop",{files:r}))}},this.enabled=function(){return K&&this.visible()},this.visible=function(){return R[0].elfinder&&R.is(":visible")},this.isRoot=function(e){return!(!e.isroot&&e.phash)},this.root=function(n,e){var i,t;if(n=n||J,!e&&(st.each(D.roots,function(e,t){if(0===n.indexOf(e))return i=t,!1}),i))return i;for(i=Q[n];i&&i.phash&&(e||!i.isroot);)i=Q[i.phash];if(i)return i.hash;for(;t in Q&&Q.hasOwnProperty(t);)if("directory"===(i=Q[t]).mime&&!i.phash&&i.read)return i.hash;return""},this.cwd=function(){return Q[J]||{}},this.option=function(n,i){var a,e;return i=i||J,D.optionsByHashes[i]&&void 0!==D.optionsByHashes[i][n]?D.optionsByHashes[i][n]:!D.hasVolOptions||J===i||(e=D.file(i))&&e.phash===J?Y[n]||"":(a="",st.each(D.volOptions,function(e,t){if(0===i.indexOf(e))return a=t[n]||"",!1}),a)},this.getDisabledCmds=function(e,t){var i={hidden:!0};return Array.isArray(e)||(e=[e]),st.each(e,function(e,t){var n=D.option("disabledFlip",t);n&&Object.assign(i,n)}),t?i:Object.keys(i)},this.file=function(e,t){return e?Q[e]||(t?Z[e]:void 0):void 0},this.files=function(t){var n={};return t?ee[t]?(st.each(ee[t],function(e){Q[e]?n[e]=Q[e]:delete ee[t][e]}),Object.assign({},n)):{}:Object.assign({},Q)},this.parents=function(e){for(var t,n=[];e&&(t=this.file(e));)n.unshift(t.hash),e=t.phash;return n},this.path2array=function(e,t){for(var n,i=[];e;){if(!(n=Q[e])||!n.hash){i=[];break}i.unshift(t&&n.i18?n.i18:n.name),e=n.isroot?null:n.phash}return i},this.path=function(e,t,n){var i=Q[e]&&Q[e].path?Q[e].path:this.path2array(e,t).join(Y.separator);if(n&&Q[e]){n=Object.assign({notify:{type:"parents",cnt:1,hideCnt:!0}},n);function a(){D.request({data:{cmd:"parents",target:Q[e].phash},notify:s,preventFail:!0}).done(c).fail(function(){r.reject()})}var o,r=st.Deferred(),s=n.notify,l=!1,c=function(){D.one("parentsdone",function(){""===(i=D.path(e,t))&&l?(l=!1,a()):(s&&(clearTimeout(o),s.cnt=-parseInt(s.cnt||0),D.notify(s)),r.resolve(i))})};return i?r.resolve(i):(D.ui.tree?(s&&(o=setTimeout(function(){D.notify(s)},D.notifyDelay)),c(l=!0)):a(),r)}return i},this.url=function(n,e){function i(e){return e&&d&&(e=D.convAbsUrl(e)),e}function t(e){if(e)return i(e);if(o.url)return i(o.url);if(void 0===a&&(a=u()),a)return i(a+st.map(D.path2array(n),function(e){return encodeURIComponent(e)}).slice(1).join("/"));var t=Object.assign({},D.customData,{cmd:"file",target:o.hash});return D.oldAPI&&(t.cmd="open",t.current=o.phash),i(D.options.url+(-1===D.options.url.indexOf("?")?"?":"&")+st.param(t,!0))}var a,o=Q[n],r=e||{},s=r.async||!1,l=r.temporary||!1,c=r.onetime&&D.option("onetimeUrl",n)||!1,d=r.absurl||!1,p=s||c?st.Deferred():null,u=function(){return D.option("url",!D.isRoot(o)&&o.phash||o.hash)};if(!o||!o.read)return s?p.resolve(""):"";if(!c||o.url&&"1"!=o.url||(a=u()))if("1"==o.url||l&&!o.url&&!(a=u()))this.request({data:{cmd:"url",target:n,options:{temporary:l?1:0}},preventDefault:!0,options:{async:s},notify:s?{type:l?"file":"url",cnt:1,hideCnt:!0}:{},progressBar:r.progressBar}).done(function(e){o.url=e.url||""}).fail(function(){o.url=""}).always(function(){var e;return o.url&&l&&(e=o.url,o.url="1"),s?void p.resolve(t(e)):t(e)});else{if(!s)return t();p.resolve(t())}else s=!0,this.request({data:{cmd:"url",target:n,options:{onetime:1}},preventDefault:!0,options:{async:s},notify:{type:"file",cnt:1,hideCnt:!0},progressBar:r.progressBar}).done(function(e){p.resolve(i(e.url||""))}).fail(function(){p.resolve("")});return s?p:void 0},this.forExternalUrl=function(e,t){var n={async:!0,absurl:!0};return n[D.option("onetimeUrl",e)?"onetime":"temporary"]=!0,D.url(e,Object.assign({},t,n))},this.openUrl=function(e,t,n,i){var a=Q[e],o="",r=(i||{}).onetimeSize||5242880;return a&&a.read?t&&"sameorigin"!==t||(a.url?1!=a.url&&(o=a.url):Y.url&&0===a.hash.indexOf(D.cwd().volumeid)&&(o=Y.url+st.map(this.path2array(e),function(e){return encodeURIComponent(e)}).slice(1).join("/")),t&&!this.isSameOrigin(o)||!o)?n&&this.hasParrotHeaders()?(i?delete i.onetimeSize:i={},!i.onetime&&!i.temporary&&a.size>r&&(a.mime.match(/^video|audio/)?i.temporary=!0:i.onetime=!0),i.onetime||i.temporary?this.url(a.hash,Object.assign({async:!0},i)).done(function(e){n(e)}).fail(function(){n("")}):this.getContents(e,"blob",i).done(function(e){o=(window.URL||window.webkitURL).createObjectURL(e),n(o)}).fail(function(){n("")})):(o=(o=this.options.url)+(-1===o.indexOf("?")?"?":"&")+(this.oldAPI?"cmd=open¤t="+a.phash:"cmd=file")+"&target="+a.hash+"&_t="+(a.ts||parseInt(new Date/1e3)),!0===t&&(o+="&download=1"),st.each(this.customData,function(e,t){o+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t)}),n?void n(o):o):(o+=(o.match(/\?/)?"&":"?")+"_".repeat((o.match(/[\?&](_+)t=/g)||["&t="]).sort().shift().match(/[\?&](_*)t=/)[1].length+1)+"t="+(a.ts||parseInt(new Date/1e3)),n?void n(o):o):""},this.tmb=function(e){var t,n="elfinder-cwd-bgurl",i="",a={},o=0;return!(!st.isPlainObject(e)||((D.searchStatus.state&&0!==e.hash.indexOf(D.cwd().volumeid)?(t=D.option("tmbUrl",e.hash),D.option("tmbCrop",e.hash)):(t=Y.tmbUrl,Y.tmbCrop))&&(n+=" elfinder-cwd-bgurl-crop"),"self"===t&&0===e.mime.indexOf("image/")?(i=D.openUrl(e.hash),n+=" elfinder-cwd-bgself"):(D.oldAPI||t)&&e&&e.tmb&&1!=e.tmb?i=t+e.tmb:D.newAPI&&e&&e.tmb&&1!=e.tmb&&(i=e.tmb),!i))&&("self"!==t&&(e.ts&&(a._t=e.ts),Y.tmbReqCustomData&&Object.keys(this.customData).length&&(a=Object.assign(a,this.customData)),Object.keys(a).length&&(i+=i.match(/\?/)?"&":"?",st.each(a,function(e,t){i+=(0==o++?"":"&")+encodeURIComponent(e)+"="+encodeURIComponent(t)}))),{url:i,className:n})},this.selected=function(){return te.slice(0)},this.selectedFiles=function(){return st.map(te,function(e){return Q[e]?Object.assign({},Q[e]):null})},this.fileByName=function(e,t){for(var n in Q)if(Q.hasOwnProperty(n)&&Q[n].phash==t&&Q[n].name==e)return Q[n]},this.validResponse=function(e,t){return t.error||this.rules[this.rules[e]?e:"defaults"](t)},this.returnBytes=function(e){var t;return isNaN(e)?(t=(e=(e=e||"").replace(/b$/i,"")).charAt(e.length-1).toLowerCase(),e=e.replace(/[tgmk]$/i,""),"t"==t?e=1024*e*1024*1024*1024:"g"==t?e=1024*e*1024*1024:"m"==t?e=1024*e*1024:"k"==t&&(e*=1024),e=isNaN(e)?0:parseInt(e)):(e=parseInt(e))<1&&(e=0),e},this.request=function(n){function i(e){e.warning&&p.error(e.warning),b?P(e):p.updateCache(e),p.lazy(function(){e.removed&&e.removed.length&&p.remove(e),e.added&&e.added.length&&p.add(e),e.changed&&e.changed.length&&p.change(e)}).then(function(){return p.lazy(function(){p.trigger(g,e,!1)})}).then(function(){return p.lazy(function(){p.trigger(g+"done")})}).then(function(){e.toasts&&Array.isArray(e.toasts)&&st.each(e.toasts,function(){this.msg&&p.toast(this)}),e.sync&&p.sync()})}function a(e,t){var n,i,a=p.options.debug;switch(t){case"abort":n=e.quiet?"":["errConnect","errAbort"];break;case"timeout":n=["errConnect","errTimeout"];break;case"parsererror":n=["errResponse","errDataNotJSON"],e.responseText&&(J&&(!a||"all"!==a&&!a["backend-error"])||n.push(e.responseText));break;default:if(e.responseText)try{(i=JSON.parse(e.responseText))&&i.error&&(n=i.error)}catch(e){}if(!n)if(403==e.status)n=["errConnect","errAccess","HTTP error "+e.status];else if(404==e.status)n=["errConnect","errNotFound","HTTP error "+e.status];else if(500<=e.status)n=["errResponse","errServerError","HTTP error "+e.status];else{if(414==e.status&&"get"===E.type)return E.type="post",p.abortXHR(e),void(h.xhr=e=p.transport.send(E).fail(n).done(F));n=e.quiet?"":["errConnect","HTTP error "+e.status]}}p.trigger(g+"done"),h.reject({error:n},e,t)}function o(e){l&&"pending"===l.state()&&(p.abortXHR(l,{quiet:!0,abort:!0}),e&&("unload"===e.type||"destroy"===e.type)||p.autoSync())}function r(e){if(p.trigger(g+"done"),"autosync"==e.type){if("stop"!=e.data.action)return}else if(!("unload"==e.type||"destroy"==e.type||"openxhrabort"==e.type||e.data.added&&e.data.added.length))return;o(e)}function e(e){function t(){j=!1,h.reject()}if(e&&"cmd"===e)return g;if(b){if(ze&&"pending"===ze.state()){if(ze._target===m.target)return h.reject("openabort");ze.xhr?ze.xhr.queueAbort():ze.reject("openabort")}(ze=h)._target=m.target}if(h.always(function(){delete E.headers["X-elFinderReqid"],b&&(ze=null)}).fail(function(e,t,n){var i,a;b&&"openabort"===e&&(e="",j=!1),i={cmd:g,err:e,xhr:t,rc:n},0===e&&Ce.length&&(Ce=st.grep(Ce,function(e){return e("cmd")!==g})),p.trigger("requestError",i),i._getEvent&&i._getEvent().isDefaultPrevented()&&(j=y=!1,e&&(e.error="")),o(),b&&(d=p.file(m.target))&&d.volumeid&&p.isRoot(d)&&delete p.volumeExpires[d.volumeid],p.trigger(g+"fail",n),(a="object"==typeof e?e.error:e)&&(y?p.error(a):p.debug("error",p.i18n(a))),j&&p.sync()}),!g)return j=!1,h.reject({error:"errCmdReq"});if(p.maxTargets&&m.targets&&m.targets.length>p.maxTargets)return j=!1,h.reject({error:["errMaxTargets",p.maxTargets]});if(w&&h.done(i),b){for(;c=re.pop();)c.queueAbort();if(J!==m.target)for(;c=se.pop();)c.queueAbort()}return-1!==st.inArray(g,(p.cmdsToAdd+" autosync").split(" "))&&("autosync"!==g&&(p.autoSync("stop"),h.always(function(){p.autoSync()})),p.trigger("openxhrabort")),delete E.preventFail,2.1029<=p.api&&(M?E.headers["X-elFinderReqid"]=f:Object.assign(E.data,{reqid:f})),h.syncOnFail=function(e){j=!!e},ke++,h.xhr=l=p.transport.send(E).always(function(){E._xhr&&void 0!==E._xhr.responseURL&&(l.responseURL=E._xhr.responseURL||""),--ke,Ce.length&&Ce.shift()()}).fail(a).done(F),2.1029<=p.api&&(l._requestId=f),b||m.compare&&"info"===g?(l.queueAbort=t,re.unshift(l),m.compare&&p.bind(p.cmdsToAdd+" autosync openxhrabort",r),h.always(function(){var e=st.inArray(l,re);m.compare&&p.unbind(p.cmdsToAdd+" autosync openxhrabort",r),-1!==e&&re.splice(e,1)})):-1!==st.inArray(g,p.abortCmdsOnOpen)&&(l.queueAbort=t,se.unshift(l),h.always(function(){var e=st.inArray(l,se);-1!==e&&se.splice(e,1)})),p.bind("unload destroy",r),h.always(function(){p.unbind("unload destroy",r)}),h}function t(){return z.type&&z.cnt&&(T&&(z.cancel=h,n.eachCancel&&(z.id=+new Date)),s=setTimeout(function(){k=setTimeout(D,1e3),p.notify(z),C=!0,h.always(function(){z.cnt=-(parseInt(z.cnt)||0),p.notify(z),C=!1})},p.notifyDelay),h.always(function(){clearTimeout(s)})),ke<q?e():(b?Ce.unshift(e):Ce.push(e),h)}var s,l,c,d,p=this,u=this.options,h=st.Deferred(),f=(+new Date).toString(16)+Math.floor(1e3*Math.random()).toString(16),m=Object.assign({},p.customData,{mimes:u.onlyMimes},n.data||n),g=m.cmd,v="binary"===(n.options||{}).dataType,b=!n.asNotOpen&&"open"===g,y=!(v||n.preventDefault||n.preventFail),w=!(v||n.preventDefault||n.preventDone),x=n.progressVal||20,k=null,C=!1,z=!n.progressBar&&n.notify?Object.assign({progress:x*n.notify.cnt},n.notify):{},T=!!n.cancel,A=v||!!n.raw,j=n.syncOnFail,O=!!n.lazy,S=n.prepare,I=n.navigate,M=(n.options||{}).cache,E=Object.assign({url:u.url,async:!0,type:this.requestType,dataType:"json",cache:2.1029<=p.api,data:m,headers:this.customHeaders,xhrFields:this.xhrFields,progress:function(e){var t=e.loaded/e.total*100;if(k&&clearTimeout(k),n.progressBar)try{n.progressBar.width(t+"%")}catch(e){}else C&&z.type&&(t*=z.cnt,x<t&&(p.notify({type:z.type,progress:t-x,cnt:0,hideCnt:z.hideCnt}),x=t));if(n.progress)try{n.progress(e)}catch(e){}}},n.options||{}),F=function(a){if(p.currentReqCmd=g,a.debug&&p.responseDebug(a),p.setCustomHeaderByXhr(l),A)return p.abortXHR(l),a&&a.debug&&p.debug("backend-debug",a),h.resolve(a);if(!a)return h.reject({error:["errResponse","errDataEmpty"]},l,a);if(!st.isPlainObject(a))return h.reject({error:["errResponse","errDataNotJSON"]},l,a);if(a.error)return b&&st.each(p.leafRoots,function(e,t){p.leafRoots[e]=st.grep(t,function(e){return e!==m.target})}),h.reject({error:a.error},l,a);function e(){function e(i){p.leafRoots[m.target]&&a[i]&&st.each(p.leafRoots[m.target],function(e,t){var n;(n=p.file(t))&&a[i].push(n)})}function t(){p.textMimes={},st.each(p.res("mimes","text"),function(){p.textMimes[this.toLowerCase()]=!0})}var i;if(b?e("files"):"tree"===g&&e("tree"),a=p.normalize(a),!p.validResponse(g,a))return h.reject({error:a.norError||"errResponse"},l,a);b&&(p.api||(p.api=a.api||1,"2.0"==p.api&&void 0!==a.options.uploadMaxSize&&(p.api="2.1"),p.newAPI=2<=p.api,p.oldAPI=!p.newAPI),a.textMimes&&Array.isArray(a.textMimes)&&(p.resources.mimes.text=a.textMimes,t()),p.textMimes||t(),a.options&&(Y=Object.assign({},G,a.options)),a.netDrivers&&(p.netDrivers=a.netDrivers),a.maxTargets&&(p.maxTargets=a.maxTargets),m.init&&(p.uplMaxSize=p.returnBytes(a.uplMaxSize),p.uplMaxFile=a.uplMaxFile?Math.min(parseInt(a.uplMaxFile),50):20)),"function"==typeof S&&S(a),I&&(i=I.target||"added",a[i]&&a[i].length&&p.one(g+"done",function(){function r(){var t=p.cwd().hash;return st.map(n,function(e){return e.phash&&t===e.phash?e.hash:null})}function e(e){var t,n,i,a=void 0,o=e.action?e.action.data:void 0;return(o||s.length)&&e.action&&(n=e.action.msg)&&(t=e.action.cmd)&&(!e.action.cwdNot||e.action.cwdNot!==p.cwd().hash)&&(i=e.action.done,o=e.action.data,a=st("<div></div>").append(st('<button type="button" class="ui-button ui-widget ui-state-default ui-corner-all elfinder-tabstop"><span class="ui-button-text">'+p.i18n(n)+"</span></button>").on("mouseenter mouseleave",function(e){st(this).toggleClass("ui-state-hover","mouseenter"==e.type)}).on("click",function(){p.exec(t,o||s,{_userAction:!0,_currentType:"toast",_currentNode:st(this)}),i&&p.one(t+"done",function(){"function"==typeof i?i():"select"===i&&p.trigger("selectfiles",{files:r()})})}))),delete e.action,e.extNode=a,e}var n=a[i],t=p.findCwdNodes(n),s=r();I.toast||(I.toast={}),I.noselect||p.trigger("selectfiles",{files:1<p.searchStatus.state?st.map(n,function(e){return e.hash}):s}),t.length?(I.noscroll||(t.first().trigger("scrolltoview",{blink:!1}),p.resources.blink(t,"lookme")),st.isPlainObject(I.toast.incwd)&&p.toast(e(I.toast.incwd))):st.isPlainObject(I.toast.inbuffer)&&p.toast(e(I.toast.inbuffer))})),h.resolve(a),a.debug&&p.debug("backend-debug",a)}p.abortXHR(l),O?p.lazy(e):e()},D=function(){var e;C&&k&&(e=+z.cnt,k=null,p.notify({type:z.type,progress:e,cnt:0,hideCnt:z.hideCnt}),(x+=e)/z.cnt<80&&(k=setTimeout(D,500)))},U={opts:n,result:!0};return p.api||m.init?(p.trigger("request."+g,U,!0),U.result?"object"==typeof U.result&&U.result.promise?(U.result.done(t).fail(function(){p.trigger(g+"done"),h.reject()}),h):t():(p.trigger(g+"done"),h.reject())):(j=!1,h.reject())},this.cache=function(e,t){Array.isArray(e)||(e=[e]),ye(e,t)},this.updateCache=function(e){st.isPlainObject(e)&&(e.files&&e.files.length&&ye(e.files,"files"),e.tree&&e.tree.length&&ye(e.tree,"tree"),e.removed&&e.removed.length&&we(e.removed),e.added&&e.added.length&&ye(e.added,"add"),e.changed&&e.changed.length&&ye(e.changed,"change"))},this.diff=function(e,n,t){var a={},o=[],r=[],s=[],l=null;return st.each(e,function(e,t){a[t.hash]=t}),t&&t.length&&(l={},st.each(t,function(){l[this]=!0})),st.each(Q,function(e,t){a[e]||n&&t.phash!==n||r.push(e)}),st.each(a,function(e,t){var n,i=Q[e],a={};i?(st.each(Object.keys(i),function(){a[this]=!0}),st.each(t,function(e){if(delete a[e],!(l&&l[e]||t[e]===i[e]))return s.push(t),!(a={})}),0!==(n=Object.keys(a).length)&&(l&&st.each(a,function(e){l[e]&&--n}),0!==n&&s.push(t))):o.push(t)}),st.each(r,function(e,t){var n=Q[t],i=n.phash;i&&"directory"==n.mime&&-1===st.inArray(i,r)&&a[i]&&!function(e){for(var t=s.length;t--;)if(s[t].hash==e)return!0}(i)&&s.push(a[i])}),{added:o,removed:r,changed:s}},this.sync=function(o,n){this.autoSync("stop");var i,a,r,s,l=this,c=(a="",s=r=0,o&&n&&st.each(Q,function(e,t){t.phash&&t.phash===o&&(++r,s=Math.max(s,t.ts)),a=r+":"+s}),a),d=st.Deferred().always(function(){i||l.trigger("sync")}),p=[this.request({data:{cmd:"open",reload:1,target:J,tree:!o&&this.ui.tree?1:0,compare:c},preventDefault:!0})];return!o&&2<=l.api&&(J!==this.root()&&p.push(this.request({data:{cmd:"parents",target:J},preventDefault:!0})),st.each(function(){for(var e,t=[],n=l.file(l.root(J)),i=n?n.volumeid:null,a=l.cwd().phash;a;)a=(e=l.file(a))?(0!==a.indexOf(i)&&(t.push({target:a,cmd:"tree"}),l.isRoot(e)||t.push({target:a,cmd:"parents"}),i=(n=l.file(l.root(a)))?n.volumeid:null),e.phash):null;return t}(),function(e,t){p.push(l.request({data:{cmd:t.cmd,target:t.target},preventDefault:!0}))})),st.when.apply(st,p).fail(function(e,t){i=t&&200!=t.status,n&&-1===st.inArray("errOpen",e)?d.reject(e&&0!=t.status?e:void 0):(d.reject(e),l.parseError(e)&&l.request({data:{cmd:"open",target:l.lastDir("")||l.root(),tree:1,init:1},notify:{type:"open",cnt:1,hideCnt:!0}}))}).done(function(e){var t,n,i;if(e.cwd.compare&&c===e.cwd.compare)return d.reject();if(t={tree:[]},1<(n=arguments.length))for(i=1;i<n;i++)arguments[i].tree&&arguments[i].tree.length&&t.tree.push.apply(t.tree,arguments[i].tree);if(l.api<2.1&&(t.tree||(t.tree=[]),t.tree.push(e.cwd)),e=l.normalize(e),!l.validResponse("open",e))return d.reject(e.norError||"errResponse");if(t=l.normalize(t),!l.validResponse("tree",t))return d.reject(t.norError||"errResponse");var a=l.diff(e.files.concat(t&&t.tree?t.tree:[]),o);return a.added.push(e.cwd),l.updateCache(a),a.removed.length&&l.remove(a),a.added.length&&l.add(a),a.changed.length&&l.change(a),d.resolve(a)}).always(function(){l.autoSync()}),d},this.upload=function(e){return this.transport.upload(e,this)},this.shortcut=function(e){var t,n,i,a,o;if(this.options.allowShortcuts&&e.pattern&&st.isFunction(e.callback))for(t=e.pattern.toUpperCase().split(/\s+/),a=0;a<t.length;a++)(i=1==(i=(o=(n=t[a]).split("+")).pop()).length?0<i?i:i.charCodeAt(0):0<i?i:st.ui.keyCode[i])&&!ie[n]&&(ie[n]={keyCode:i,altKey:-1!=st.inArray("ALT",o),ctrlKey:-1!=st.inArray("CTRL",o),shiftKey:-1!=st.inArray("SHIFT",o),type:e.type||"keydown",callback:e.callback,description:e.description,pattern:n});return this},this.shortcuts=function(){var n=[];return st.each(ie,function(e,t){n.push([t.pattern,D.i18n(t.description)])}),n},this.clipboard=function(e,n){function t(){return st.map(ae,function(e){return e.hash})}return void 0!==e&&(ae.length&&this.trigger("unlockfiles",{files:t()}),oe={},ae=st.map(e||[],function(e){var t=Q[e];return t?(oe[e]=!0,{hash:e,phash:t.phash,name:t.name,mime:t.mime,read:t.read,locked:t.locked,cut:!!n}):null}),this.trigger("changeclipboard",{clipboard:ae.slice(0,ae.length)}),n&&this.trigger("lockfiles",{files:t()})),ae.slice(0,ae.length)},this.isCommandEnabled=function(e,t){var n,i,a=D.cwd().volumeid||"";return!t&&1<D.searchStatus.state&&D.selected().length&&(t=D.selected()[0]),n=!t||a&&0===t.indexOf(a)?Y.disabledFlip:D.option("disabledFlip",t),!!(i=this._commands[e])&&(i.alwaysEnabled||!n[e])},this.exec=function(e,t,n,i){var a,o;return!i&&this.commandMap[e]&&"hidden"!==this.commandMap[e]&&(e=this.commandMap[e]),"open"===e&&((this.searchStatus.state||this.searchStatus.ininc)&&this.trigger("searchend",{noupdate:!0}),this.autoSync("stop")),!i&&t&&(st.isArray(t)?t.length&&(i=t[0]):i=t),"object"==(o=typeof(a=this._commands[e]&&this.isCommandEnabled(e,i)?this._commands[e].exec(t,n):st.Deferred().reject("errUnknownCmd")))&&a.promise||(D.debug("warning",'"cmd.exec()" should be returned "$.Deferred" but cmd "'+e+'" returned "'+o+'"'),a=st.Deferred().resolve()),this.trigger("exec",{dfrd:a,cmd:e,files:t,opts:n,dstHash:i}),a},this.dialog=function(e,t){function n(){!i.data("draged")&&i.is(":visible")&&i.elfinderdialog("posInit")}var i=st("<div></div>").append(e).appendTo(R).elfinderdialog(t,D),a=i.closest(".ui-dialog");return a.length&&(D.bind("resize",n),a.on("remove",function(){D.unbind("resize",n)})),i},this.toast=function(e){return st('<div class="ui-front"></div>').appendTo(this.ui.toast).elfindertoast(e||{},this)},this.getUI=function(e){return e?this.ui[e]||st():R},this.getCommand=function(e){return void 0===e?this._commands:this._commands[e]},this.resize=function(e,t){var n,i=!R.hasClass("ui-resizable"),a=R.data("resizeSize")||{w:0,h:0},o={};pe&&pe.data("resizeTm")&&clearTimeout(pe.data("resizeTm")),"string"==typeof t&&(n=t.match(/^([0-9.]+)%$/))&&(pe&&pe.length||(pe=st(window)),pe.data("marginToMyNode")||pe.data("marginToMyNode",function(){for(var e=R.outerHeight(!0)-R.innerHeight(),t=R;t.get(0)!==pe.get(0)&&(e+=(t=t.parent()).outerHeight(!0)-t.innerHeight(),t.parent().length););return e}()),pe.data("fitToBaseFunc")||pe.data("fitToBaseFunc",function(e){var t=pe.data("resizeTm");e.preventDefault(),e.stopPropagation(),t&&cancelAnimationFrame(t),R.hasClass("elfinder-fullscreen")||D.UA.Mobile&&pe.data("rotated")===D.UA.Rotated||(pe.data("rotated",D.UA.Rotated),pe.data("resizeTm",requestAnimationFrame(function(){D.restoreSize()})))}),void 0===pe.data("rotated")&&pe.data("rotated",D.UA.Rotated),t=pe.height()*(n[1]/100)-pe.data("marginToMyNode"),pe.off("resize."+D.namespace,pe.data("fitToBaseFunc")),i&&pe.on("resize."+D.namespace,pe.data("fitToBaseFunc"))),R.css({width:e,height:parseInt(t)}),o.w=Math.round(R.width()),o.h=Math.round(R.height()),R.data("resizeSize",o),o.w===a.w&&o.h===a.h||(R.trigger("resize"),this.trigger("resize",{width:o.w,height:o.h}))},this.restoreSize=function(){this.resize(ce,de)},this.show=function(){R.show(),this.enable().trigger("show")},this.hide=function(){this.options.enableAlways&&(X=K,K=!1),this.disable(),this.trigger("hide"),R.hide()},this.lazy=function(e,t,i){function n(e){var t,n=R.data("lazycnt");e?(t=!R.data("lazyrepaint")&&i.repaint,n?R.data("lazycnt",++n):R.data("lazycnt",1).addClass("elfinder-processing"),t&&R.data("lazyrepaint",!0).css("display")):n&&1<n?R.data("lazycnt",--n):(t=R.data("lazyrepaint"),R.data("lazycnt",0).removeData("lazyrepaint").removeClass("elfinder-processing"),t&&R.css("display"),D.trigger("lazydone"))}function a(){o.resolve(e.call(o)),n(!1)}var o=st.Deferred();return t=t||0,i=i||{},n(!0),t?setTimeout(a,t):requestAnimationFrame(a),o},this.destroy=function(){R&&R[0].elfinder&&(R.hasClass("elfinder-fullscreen")&&D.toggleFullscreen(R),this.options.syncStart=!1,this.autoSync("forcestop"),this.trigger("destroy").disable(),ae=[],te=[],ne={},ie={},st(window).off("."+L),st(document).off("."+L),D.trigger=function(){},st(me).remove(),R.off().removeData().empty().append(_.contents()).attr("class",_.attr("class")).attr("style",_.attr("style")),delete R[0].elfinder,st.each(H,function(e,t){st.each(t,function(e,t){R.on(t.type+(t.namespace?"."+t.namespace:""),t.selector,t.handler)})}))},this.autoSync=function(e){var r;if(1e3<=D.options.sync){if(s&&(clearTimeout(s),s=null,D.trigger("autosync",{action:"stop"})),"stop"===e?++ge:ge=Math.max(0,--ge),ge||"forcestop"===e||!D.options.syncStart)return;(r=function(e){var o;Y.syncMinMs&&(e||s)&&(e&&D.trigger("autosync",{action:"start"}),o=Math.max(D.options.sync,Y.syncMinMs),s&&clearTimeout(s),s=setTimeout(function(){var n,i=!0,a=J;Y.syncChkAsTs&&Q[a]&&(n=Q[a].ts)?D.request({data:{cmd:"info",targets:[a],compare:n,reload:1},preventDefault:!0}).done(function(e){var t;i=!0,e.compare&&(t=e.compare)==n&&(i=!1),i?D.sync(a).always(function(){t&&(Q[a].ts=t),r()}):r()}).fail(function(e,t){var n=D.parseError(e);n&&0!=t.status?(D.error(n),Array.isArray(n)&&-1!==st.inArray("errOpen",n)&&D.request({data:{cmd:"open",target:D.lastDir("")||D.root(),tree:1,init:1},notify:{type:"open",cnt:1,hideCnt:!0}})):s=setTimeout(function(){r()},o)}):D.sync(J,!0).always(function(){r()})},o))})(!0)}},this.insideWorkzone=function(e,t,n){var i=this.getUI("workzone").data("rectangle");return n=n||1,!(e<i.left+n||e>i.left+i.width+n||t<i.top+n||t>i.top+i.height+n)},this.toFront=function(e){var t=R.children(".ui-front").removeClass("elfinder-frontmost"),n=t.last();t.css("z-index",""),st(e).addClass("ui-front elfinder-frontmost").css("z-index",n.css("z-index")+1)},this.toHide=function(e,t){var n,i=st(e);t||i.hide(),i.hasClass("elfinder-frontmost")&&(i.removeClass("elfinder-frontmost"),(n=R.children(".ui-front:visible:not(.elfinder-frontmost)").last()).length&&requestAnimationFrame(function(){R.children(".elfinder-frontmost:visible").length||(D.toFront(n),n.trigger("frontmost"))}))},this.getMaximizeCss=function(){return{width:"100%",height:"100%",margin:0,top:0,left:0,display:"block",position:"fixed",zIndex:Math.max(D.zIndex?D.zIndex+1:0,1e3),maxWidth:"",maxHeight:""}},function(){Ae&&D.UA.Fullscreen&&(D.UA.Fullscreen=!1,je&&void 0!==je.attr("allowfullscreen")&&(D.UA.Fullscreen=!0));function i(){var a=0,o=0;st.each(R.children(".ui-dialog,.ui-draggable"),function(e,t){var n=st(t),i=n.position();i.top<0&&(n.css("top",a),a+=20),i.left<0&&(n.css("left",o),o+=20)})}function a(){var e=D.storage("useFullscreen");s=D.UA.Fullscreen&&(e?0<e:"screen"===D.options.commandsOptions.fullscreen.mode)?{fullElm:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||null},exitFull:function(){return document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():void 0},toFull:function(e){return e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():!!e.msRequestFullscreen&&e.msRequestFullscreen()}}:{fullElm:function(){var e;return R.hasClass(l)?R.get(0):(e=R.find("."+l)).length?e.get(0):null},exitFull:function(){var e;st(window).off("resize."+L,p),void 0!==t&&st("body").css("overflow",t),t=void 0,o&&(e=o.elm,d(e),st(e).trigger("resize",{fullscreen:"off"})),st(window).trigger("resize")},toFull:function(e){return t=st("body").css("overflow")||"",st("body").css("overflow","hidden"),st(e).css(D.getMaximizeCss()).addClass(l).trigger("resize",{fullscreen:"on"}),i(),st(window).on("resize."+L,p).trigger("resize"),!0}}}var o,t,r,s,l="elfinder-fullscreen",c="elfinder-fullscreen-native",d=function(e){o&&o.elm==e&&(st(e).removeClass(l+" "+c).attr("style",o.style),o=null)},p=function(e){var t;e.target===window&&(r&&cancelAnimationFrame(r),r=requestAnimationFrame(function(){(t=s.fullElm())&&st(t).trigger("resize",{fullscreen:"on"})}))};a(),st(document).on("fullscreenchange."+L+" webkitfullscreenchange."+L+" mozfullscreenchange."+L+" MSFullscreenChange."+L,function(e){var t,n;D.UA.Fullscreen&&(t=s.fullElm(),n=st(window),r&&cancelAnimationFrame(r),null===t?(n.off("resize."+L,p),o&&(t=o.elm,d(t),st(t).trigger("resize",{fullscreen:"off"}))):(st(t).addClass(l+" "+c).attr("style","width:100%; height:100%; margin:0; padding:0;").trigger("resize",{fullscreen:"on"}),n.on("resize."+L,p),i()),n.trigger("resize"))}),D.toggleFullscreen=function(e,t){var n=st(e).get(0),i=null;if(i=s.fullElm()){if(i==n){if(!0===t)return i}else if(!1===t)return i;return s.exitFull(),null}return!1===t?null:(a(),!(o={elm:n,style:st(n).attr("style")})!==s.toFull(n)?n:o=null)}}(),A="elfinder-maximized",D.toggleMaximize=function(e,t){var n,i,a=st(e);if(a.hasClass(A)){if(!0===t)return;i=a,st(window).off("resize."+L,Ie),st("body").css("overflow",i.data("bodyOvf")),i.removeClass(A).attr("style",i.data("orgStyle")).removeData("bodyOvf").removeData("orgStyle"),i.trigger("resize",{maximize:"off"})}else{if(!1===t)return;(n=a).data("bodyOvf",st("body").css("overflow")||"").data("orgStyle",n.attr("style")).addClass(A).css(D.getMaximizeCss()),st("body").css("overflow","hidden"),st(window).on("resize."+L,{elm:n},Ie),n.trigger("resize",{maximize:"on"})}},Object.assign(st.ui.keyCode,{F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,DIG0:48,DIG1:49,DIG2:50,DIG3:51,DIG4:52,DIG5:53,DIG6:54,DIG7:55,DIG8:56,DIG9:57,NUM0:96,NUM1:97,NUM2:98,NUM3:99,NUM4:100,NUM5:101,NUM6:102,NUM7:103,NUM8:104,NUM9:105,CONTEXTMENU:93,DOT:190}),this.dragUpload=!1,this.xhrUpload=("undefined"!=typeof XMLHttpRequestUpload||"undefined"!=typeof XMLHttpRequestEventTarget)&&"undefined"!=typeof File&&"undefined"!=typeof FormData,this.transport={},"object"==typeof this.options.transport&&(this.transport=this.options.transport,"function"==typeof this.transport.init&&this.transport.init(this)),"function"!=typeof this.transport.send&&(this.transport.send=function(e){return D.UA.IE||(e._xhr=new XMLHttpRequest,e.xhr=function(){return e.progress&&e._xhr.addEventListener("progress",e.progress),e._xhr}),st.ajax(e)}),"iframe"==this.transport.upload?this.transport.upload=st.proxy(this.uploads.iframe,this):"function"==typeof this.transport.upload?this.dragUpload=!!this.options.dragUploadAllow:this.xhrUpload&&this.options.dragUploadAllow?(this.transport.upload=st.proxy(this.uploads.xhr,this),this.dragUpload=!0):this.transport.upload=st.proxy(this.uploads.iframe,this),this.decodeRawString=function(e){return function(e){for(var t,n=String.fromCharCode,i=0,a=e.length,o="";t=e[i],i<a;i++)o+=t<=127?n(t):t<=223&&194<=t?n((31&t)<<6|63&e[++i]):t<=239&&224<=t?n((15&t)<<12|(63&e[++i])<<6|63&e[++i]):t<=247&&240<=t?n(55296|((7&t)<<8|(63&e[++i])<<2|e[++i]>>>4&3)-64,56320|(15&e[i++])<<6|63&e[i]):n(65533);return o}(function(e){var t,n,i,a=[];for("string"==typeof e&&(e=function(e){for(var t=0,n=e.length,i=[];t<n;t++)i.push(e.charCodeAt(t));return i}(e)),t=0,n=e.length;i=e[t],t<n;t++)55296<=i&&i<=56319?a.push(64+(1023&i)<<10|1023&e[++t]):a.push(i);return a}(e))},this.getContents=function(e,t,n){var i,a,o=st.Deferred(),r=t||"arraybuffer";return o.fail(function(){a&&"pending"===a.state()&&a.reject()}),i=this.openUrl(e),this.isSameOrigin(i)||(i=this.openUrl(e,!0)),a=this.request(Object.assign({data:{cmd:"get"},options:{url:i,type:"get",cache:!0,dataType:"binary",responseType:r,processData:!1},notify:{type:"file",cnt:1,hideCnt:!0},cancel:!0},n||{})).fail(function(){o.reject()}).done(function(e){o.resolve(e)}),o},this.getBinaryByUrl=function(e,t,n){var i,a=st.Deferred();return a.fail(function(){i&&"pending"===i.state()&&i.reject()}),i=this.request(Object.assign({data:{cmd:"get"},options:Object.assign({type:"get",cache:!0,dataType:"binary",responseType:"blob",processData:!1},e)},n||{})).fail(function(){a.reject()}).done(function(e){t&&t(e),a.resolve(e)}),a},this.getMimetype=function(e,t){var n,i=t,a=(e+"").match(/\.([^.]+)$/);return a&&(n=a[1])&&((i=(o=o||D.arrayFlip(D.mimeTypes))[n.toLowerCase()])||(i=t)),i},D.hashCheckers=[],j=this,O={},window.Worker&&window.ArrayBuffer&&(j.options.cdns.sparkmd5&&(O.SparkMD5=!0,j.hashCheckers.push("md5")),j.options.cdns.jssha&&(O.jsSHA=!0,j.hashCheckers=j.hashCheckers.concat(["sha1","sha224","sha256","sha384","sha512","sha3-224","sha3-256","sha3-384","sha3-512","shake128","shake256"]))),j.getContentsHashes=function(o,e,t,n){var i,r=st.Deferred(),s=j.arrayFlip(e||["md5"],!0),l=[],c={},d=t||{shake128len:256,shake256len:512};return r.fail(function(){i&&i.reject()}),Object.keys(O).length?i=j.getContents(o,"arraybuffer",n).done(function(t){s.md5&&O.SparkMD5&&l.push(function(){var n=st.Deferred();try{var i=j.getWorker();n.fail(function(){i&&i.terminate()}),i.onmessage=function(e){var t;i&&i.terminate(),e.data.hash?(c.md5=e.data.hash,(t=j.file(o))&&(t.md5=c.md5)):e.data.error&&(c.md5=e.data.error),r.notify(c),n.resolve()},i.onerror=function(e){n.reject()},i.postMessage({scripts:[j.options.cdns.sparkmd5,j.getWorkerUrl("calcfilehash.js")],data:{type:"md5",bin:t}}),r.fail(function(){n.reject()})}catch(e){n.reject(),delete O.SparkMD5}return n}()),O.jsSHA&&st.each(["1","224","256","384","512","3-224","3-256","3-384","3-512","ke128","ke256"],function(e,a){s["sha"+a]&&l.push(function(){var n=st.Deferred();try{var i=j.getWorker();n.fail(function(){i&&i.terminate()}),i.onmessage=function(e){var t;i&&i.terminate(),e.data.hash?(c["sha"+a]=e.data.hash,(t=j.file(o))&&(t["sha"+a]=c["sha"+a])):e.data.error&&(c["sha"+a]=e.data.error),r.notify(c),n.resolve()},i.onerror=function(e){n.reject()},i.postMessage({scripts:[j.options.cdns.jssha,j.getWorkerUrl("calcfilehash.js")],data:{type:a,bin:t,hashOpts:d}}),r.fail(function(){n.reject()})}catch(e){n.reject(),delete O.jsSHA}return n}())}),l.length?st.when.apply(null,l).always(function(){r.resolve(c)}):r.reject()}).fail(function(){r.reject()}):r.reject(),r},this.parseError=function(e){var t=e;return st.isPlainObject(t)&&(t=t.error),t},this.error=function(){var e,t=arguments[0],n=arguments[1]||null;return 1==arguments.length&&"function"==typeof t?D.bind("error",t):!0!==(e=this.parseError(t))&&e?D.trigger("error",{error:e,opts:n}):this},st.each(["enable","disable","load","open","reload","select","add","remove","change","dblclick","getfile","lockfiles","unlockfiles","selectfiles","unselectfiles","dragstart","dragstop","search","searchend","viewchange"],function(e,t){D[t]=function(){var e=arguments[0];return 1==arguments.length&&"function"==typeof e?D.bind(t,e):D.trigger(t,st.isPlainObject(e)?e:{})}}),this.enable(function(){!K&&D.api&&D.visible()&&D.ui.overlay.is(":hidden")&&!R.children(".elfinder-dialog."+D.res("class","editing")+":visible").length&&(K=!0,document.activeElement&&document.activeElement.blur(),R.removeClass("elfinder-disabled"))}).disable(function(){X=K,K=!1,R.addClass("elfinder-disabled")}).open(function(){te=[]}).select(function(e){var t=0,n=[];te=st.grep(e.data.selected||e.data.value||[],function(e){return n.length||D.maxTargets&&++t>D.maxTargets?(n.push(e),!1):!!Q[e]}),n.length&&(D.trigger("unselectfiles",{files:n,inselect:!0}),D.toast({mode:"warning",msg:D.i18n(["errMaxTargets",D.maxTargets])}))}).error(function(e){var t,n,i={cssClass:"elfinder-dialog-error",title:D.i18n("error"),resizable:!1,destroyOnClose:!0,buttons:{}},a=D.getUI();a.children(".elfinder-dialog-error").length<D.options.maxErrorDialogs?(i.buttons[D.i18n(D.i18n("btnClose"))]=function(){st(this).elfinderdialog("close")},e.data.opts&&st.isPlainObject(e.data.opts)&&Object.assign(i,e.data.opts),D.dialog('<span class="elfinder-dialog-icon elfinder-dialog-icon-error"></span>'+D.i18n(e.data.error),i)):(n=(t=a.children(".elfinder-dialog-error:last").children(".ui-dialog-content:first")).children(".elfinder-error-counter")).length?n.data("cnt",parseInt(n.data("cnt"))+1).html(D.i18n(["moreErrors",n.data("cnt")])):(n=st('<span class="elfinder-error-counter">'+D.i18n(["moreErrors",1])+"</span>").data("cnt",1),t.append("<br/>",n))}).bind("tmb",function(e){st.each(e.data.images||[],function(e,t){Q[e]&&(Q[e].tmb=t)})}).bind("searchstart",function(e){Object.assign(D.searchStatus,e.data),D.searchStatus.state=1}).bind("search",function(e){D.searchStatus.state=2}).bind("searchend",function(){D.searchStatus.state=0,D.searchStatus.ininc=!1,D.searchStatus.mixed=!1}).bind("canMakeEmptyFile",function(e){var t=e.data,n={};t&&Array.isArray(t.mimes)&&(t.unshift||(n=D.mimesCanMakeEmpty),st.each(t.mimes,function(){n[this]||(n[this]=D.mimeTypes[this])}),t.unshift&&(D.mimesCanMakeEmpty=Object.assign(n,D.mimesCanMakeEmpty)))}).bind("themechange",function(){requestAnimationFrame(function(){D.trigger("uiresize")})}),!0===this.options.sound&&this.bind("playsound",function(e){var t=me.canPlayType&&me.canPlayType('audio/wav; codecs="1"'),n=e.data&&e.data.soundFile;t&&n&&""!=t&&"no"!=t&&st(me).html('<source src="'+ue+n+'" type="audio/wav">')[0].play()}),st.each(this.options.handlers,function(e,t){D.bind(e,t)}),this.history=new this.history(this),this.roots={},this.leafRoots={},this.volumeExpires={},this._commands={},Array.isArray(this.options.commands)||(this.options.commands=[]),-1!==st.inArray("*",this.options.commands)&&(this.options.commands=Object.keys(this.commands)),this.commandMap={},this.volOptions={},this.hasVolOptions=!1,this.trashes={},this.optionsByHashes={},this.uiAutoHide=[],this.one("open",function(){D.uiAutoHide.length&&setTimeout(function(){D.trigger("uiautohide")},500)}),this.bind("uiautohide",function(){D.uiAutoHide.length&&D.uiAutoHide.shift()()}),this.options.width&&(ce=this.options.width),this.options.height&&(de=this.options.height),this.options.heightBase&&(pe=st(this.options.heightBase)),ue=this.options.soundPath?this.options.soundPath.replace(/\/+$/,"")+"/":this.baseUrl+ue,this.options.parrotHeaders&&Array.isArray(this.options.parrotHeaders)&&this.options.parrotHeaders.length?(this.parrotHeaders=this.options.parrotHeaders,st.each(this.parrotHeaders,function(e,t){var n=D.sessionStorage("core-ph:"+t);n&&(D.customHeaders[t]=n)})):this.parrotHeaders=[],D.one("opendone",function(){var t;st(document).on("click."+L,function(e){!K||D.options.enableAlways||st(e.target).closest(R).length||D.disable()}).on(B+" "+$+" "+V+" "+W,i),D.options.useBrowserHistory&&st(window).on("popstate."+L,function(e){var t,n,i=e.originalEvent.state||{},a=!!i.thash,o=R.find(".elfinder-frontmost:visible"),r=R.find(".elfinder-navbar-dir,.elfinder-cwd-filename").find("input,textarea");a||(i={thash:D.cwd().hash},st("html,body").animate({scrollTop:R.offset().top})),o.length||r.length?(history.pushState(i,null,location.pathname+location.search+"#elf_"+i.thash),o.length?o.hasClass(D.res("class","preventback"))||(o.hasClass("elfinder-contextmenu")?st(document).trigger(st.Event("keydown",{keyCode:st.ui.keyCode.ESCAPE,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1})):o.hasClass("elfinder-dialog")?o.elfinderdialog("close"):o.trigger("close")):r.trigger(st.Event("keydown",{keyCode:st.ui.keyCode.ESCAPE,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1}))):a?st.isEmptyObject(D.files())||D.request({data:{cmd:"open",target:i.thash,onhistory:1},notify:{type:"open",cnt:1,hideCnt:!0},syncOnFail:!0}):(t=function(){n.trigger("click")},D.one("open",t,!0),n=D.toast({msg:D.i18n("pressAgainToExit"),onHidden:function(){D.unbind("open",t),history.pushState(i,null,location.pathname+location.search+"#elf_"+i.thash)}}))}),st(window).on("resize."+L,function(e){e.target===this&&(t&&cancelAnimationFrame(t),t=requestAnimationFrame(function(){var e=R.data("resizeSize")||{w:0,h:0},t={w:Math.round(R.width()),h:Math.round(R.height())};R.data("resizeSize",t),t.w===e.w&&t.h===e.h||(R.trigger("resize"),D.trigger("resize",{width:t.w,height:t.h}))}))}).on("beforeunload."+L,function(e){var t,n;if(!D.pauseUnloadCheck()){if(R.is(":visible")&&(D.ui.notify.children().length&&-1!==st.inArray("hasNotifyDialog",D.options.windowCloseConfirm)?t=D.i18n("ntfsmth"):R.find("."+D.res("class","editing")).length&&-1!==st.inArray("editingFile",D.options.windowCloseConfirm)?t=D.i18n("editingFile"):(n=Object.keys(D.selected()).length)&&-1!==st.inArray("hasSelectedItem",D.options.windowCloseConfirm)?t=D.i18n("hasSelected",""+n):(n=Object.keys(D.clipboard()).length)&&-1!==st.inArray("hasClipboardData",D.options.windowCloseConfirm)&&(t=D.i18n("hasClipboard",""+n)),t))return e.returnValue=t;D.trigger("unload")}}),st(window).on("message."+L,function(e){var t,n,i=e.originalEvent||null;if(i&&(0===D.convAbsUrl(D.options.url).indexOf(i.origin)||0===D.convAbsUrl(D.uploadURL).indexOf(i.origin)))try{(n=(t=JSON.parse(i.data)).data||null)&&(n.error?(t.bind&&D.trigger(t.bind+"fail",n),D.error(n.error)):(n.warning&&D.error(n.warning),D.updateCache(n),n.removed&&n.removed.length&&D.remove(n),n.added&&n.added.length&&D.add(n),n.changed&&n.changed.length&&D.change(n),t.bind&&(D.trigger(t.bind,n),D.trigger(t.bind+"done")),n.sync&&D.sync()))}catch(e){D.sync()}}),D.options.enableAlways?(st(window).on("focus."+L,function(e){e.target===this&&D.enable()}),Ae&&st(window.top).on("focus."+L,function(){!D.enable()||je&&!je.is(":visible")||requestAnimationFrame(function(){st(window).trigger("focus")})})):Ae&&st(window).on("blur."+L,function(e){K&&e.target===this&&D.disable()}),Ae&&R.on("click",function(e){st(window).trigger("focus")}),D.options.enableByMouseOver&&R.on("mouseenter touchstart",function(e){Ae&&st(window).trigger("focus"),D.enabled()||D.enable()}),st(window).on("visibilitychange."+L,function(e){var t=document.hidden||document.webkitHidden||document.msHidden;D.options.syncStart&&D.autoSync(t?"stop":void 0)})}),R[0].elfinder=this,E.push((S=D.lang,I=D.i18nBaseUrl+"elfinder."+S+".js",M=st.Deferred().done(function(){D.i18[S]&&(D.lang=S),D.trigger("i18load"),F="en"===D.lang?D.i18.en:st.extend(!0,{},D.i18.en,D.i18[D.lang])}),D.i18[S]?M.resolve():(D.lang="en",D.hasRequire?require([I],function(){M.resolve()},function(){M.resolve()}):D.loadScript([I],function(){M.resolve()},{loadType:"tag",error:function(){M.resolve()}})),M)),r=function(){var t,s,l,c,d,p,u,n,i,h,f,m,g,v,b,y,w,x,k,C,o,r,a,z,e,T,A,j,O;if(D.messages=F.messages,!(st.fn.selectable&&st.fn.draggable&&st.fn.droppable&&st.fn.resizable&&st.fn.button&&st.fn.slider))return alert(D.i18n("errJqui"));if(!R.length)return alert(D.i18n("errNode"));if(!D.options.url)return alert(D.i18n("errURL"));function S(e){var t=(e.originalEvent.touches||[{}])[0].pageY||null;(!f||t<f)&&(e.preventDefault(),y&&clearTimeout(y))}function I(e){e.preventDefault(),y&&clearTimeout(y)}function M(e){return"TEXTAREA"!==e.target.nodeName&&"INPUT"!==e.target.nodeName&&0===st(e.target).closest("div.ui-dialog-content").length}function E(){r&&cancelAnimationFrame(r),r=null}t=Object.assign({name:D.i18n("name"),perm:D.i18n("perms"),date:D.i18n("modify"),size:D.i18n("size"),kind:D.i18n("kind"),modestr:D.i18n("mode"),modeoct:D.i18n("mode"),modeboth:D.i18n("mode")},D.options.uiOptions.cwd.listView.columnsCustomName),D.getColumnName=function(e){return t[e]||D.i18n(e)},D.direction=F.direction,D.dateFormat=D.options.dateFormat||F.dateFormat,D.fancyFormat=D.options.fancyDateFormat||F.fancyDateFormat,D.nonameDateFormat=(D.options.nonameDateFormat||F.nonameDateFormat).replace(/[\/\\]/g,"_"),D.cssClass="ui-helper-reset ui-helper-clearfix ui-widget ui-widget-content ui-corner-all elfinder elfinder-"+("rtl"==D.direction?"rtl":"ltr")+(D.UA.Touch?" elfinder-touch"+(D.options.resizable?" touch-punch":""):"")+(D.UA.Mobile?" elfinder-mobile":"")+(D.UA.iOS?" elfinder-ios":"")+" "+D.options.cssClass,R.addClass(D.cssClass).on(W,function(){K||D.enable()}),u=B+"draggable keyup."+L+"draggable",D.draggable={appendTo:R,addClasses:!1,distance:4,revert:!0,refreshPositions:!1,cursor:"crosshair",cursorAt:{left:50,top:47},scroll:!1,start:function(e,t){var n,i,a=t.helper,o=st.grep(a.data("files")||[],function(e){return!!e&&(oe[e]=!0)}),r=!1;for(p=R.attr("style"),R.width(R.width()).height(R.height()),s="ltr"===D.direction,l=D.getUI("workzone").data("rectangle"),c=l.top+l.height,d=c-D.getUI("navdock").outerHeight(!0),D.draggingUiHelper=a,n=o.length;n--;)if(i=o[n],Q[i].locked){r=!0,a.data("locked",!0);break}r||D.trigger("lockfiles",{files:o}),a.data("autoScrTm",setInterval(function(){a.data("autoScr")&&D.autoScroll[a.data("autoScr")](a.data("autoScrVal"))},50))},drag:function(e,t){var n,i,a,o=t.helper;((i=l.top>e.pageY)||d<e.pageY)&&(n=l.cwdEdge>e.pageX?(s?"navbar":"cwd")+(i?"Up":"Down"):(s?"cwd":"navbar")+(i?"Up":"Down"),i||("cwd"===n.substr(0,3)?c<e.pageY?a=c:n=null:a=d),n&&(o.data("autoScr",n),o.data("autoScrVal",Math.pow(i?l.top-e.pageY:e.pageY-a,1.3)))),n||o.data("autoScr")&&o.data("refreshPositions",1).data("autoScr",null),o.data("refreshPositions")&&st(this).elfUiWidgetInstance("draggable")&&(0<o.data("refreshPositions")?(st(this).draggable("option",{refreshPositions:!0,elfRefresh:!0}),o.data("refreshPositions",-1)):(st(this).draggable("option",{refreshPositions:!1,elfRefresh:!1}),o.data("refreshPositions",null)))},stop:function(e,t){var n,i=t.helper;st(document).off(u),st(this).elfUiWidgetInstance("draggable")&&st(this).draggable("option",{refreshPositions:!1}),D.draggingUiHelper=null,D.trigger("focus").trigger("dragstop"),i.data("droped")||(n=st.grep(i.data("files")||[],function(e){return!!e}),D.trigger("unlockfiles",{files:n}),D.trigger("selectfiles",{files:D.selected()})),D.enable(),R.attr("style",p),i.data("autoScrTm")&&clearInterval(i.data("autoScrTm"))},helper:function(e,t){function n(e){var t=e.mime,n=D.tmb(e),i='<div class="elfinder-cwd-icon elfinder-cwd-icon-drag '+D.mime2class(t)+' ui-corner-all"></div>';return n?i=st(i).addClass(n.className).css("background-image","url('"+n.url+"')").get(0).outerHTML:e.icon&&(i=st(i).css(D.getIconStyle(e,!0)).get(0).outerHTML),e.csscls&&(i='<div class="'+e.csscls+'">'+i+"</div>"),i}var i,a,o,r=this.id?st(this):st(this).parents("[id]:first"),s=st('<div class="elfinder-drag-helper"><span class="elfinder-drag-helper-icon-status"></span></div>');return D.draggingUiHelper&&D.draggingUiHelper.stop(!0,!0),D.trigger("dragstart",{target:r[0],originalEvent:e},!0),i=r.hasClass(D.res("class","cwdfile"))?D.selected():[D.navId2Hash(r.attr("id"))],s.append(n(Q[i[0]])).data("files",i).data("locked",!1).data("droped",!1).data("namespace",L).data("dropover",0),1<(a=i.length)&&s.append(n(Q[i[a-1]])+'<span class="elfinder-drag-num">'+a+"</span>"),st(document).on(u,function(e){var t=e.shiftKey||e.ctrlKey||e.metaKey;o!==t&&(o=t,s.is(":visible")&&s.data("dropover")&&!s.data("droped")&&(s.toggleClass("elfinder-drag-helper-plus",!!s.data("locked")||o),D.trigger(o?"unlockfiles":"lockfiles",{files:i,helper:s})))}),s}},D.commands.getfile&&("function"==typeof D.options.getFileCallback?(D.bind("dblclick",function(e){e.preventDefault(),D.exec("getfile").fail(function(){D.exec("open",e.data&&e.data.file?[e.data.file]:void 0)})}),D.shortcut({pattern:"enter",description:D.i18n("cmdgetfile"),callback:function(){D.exec("getfile").fail(function(){D.exec("mac"==D.OS?"rename":"open")})}}).shortcut({pattern:"ctrl+enter",description:D.i18n("mac"==D.OS?"cmdrename":"cmdopen"),callback:function(){D.exec("mac"==D.OS?"rename":"open")}})):D.options.getFileCallback=null),st.each(D.commands,function(e,t){var n,i,a=Object.assign({},t.prototype);if(st.isFunction(t)&&!D._commands[e]&&(t.prototype.forceLoad||-1!==st.inArray(e,D.options.commands))){if(n=t.prototype.extendsCmd||""){if(!st.isFunction(D.commands[n]))return!0;t.prototype=Object.assign({},le,new D.commands[n],t.prototype)}else t.prototype=Object.assign({},le,t.prototype);D._commands[e]=new t,t.prototype=a,i=D.options.commandsOptions[e]||{},n&&D.options.commandsOptions[n]&&(i=st.extend(!0,{},D.options.commandsOptions[n],i)),D._commands[e].setup(e,i),D._commands[e].linkedCmds.length&&st.each(D._commands[e].linkedCmds,function(e,t){var n=D.commands[t];st.isFunction(n)&&!D._commands[t]&&(n.prototype=le,D._commands[t]=new n,D._commands[t].setup(t,D.options.commandsOptions[t]||{}))})}}),D.ui={workzone:st("<div></div>").appendTo(R).elfinderworkzone(D),navbar:st("<div></div>").appendTo(R).elfindernavbar(D,D.options.uiOptions.navbar||{}),navdock:st("<div></div>").appendTo(R).elfindernavdock(D,D.options.uiOptions.navdock||{}),contextmenu:st("<div></div>").appendTo(R).elfindercontextmenu(D),overlay:st("<div></div>").appendTo(R).elfinderoverlay({show:function(){D.disable()},hide:function(){X&&D.enable()}}),cwd:st("<div></div>").appendTo(R).elfindercwd(D,D.options.uiOptions.cwd||{}),notify:D.dialog("",{cssClass:"elfinder-dialog-notify"+(D.options.notifyDialog.canClose?"":" elfinder-titlebar-button-hide"),position:D.options.notifyDialog.position,absolute:!0,resizable:!1,autoOpen:!1,allowMinimize:!0,closeOnEscape:!!D.options.notifyDialog.canClose,title:" ",width:D.options.notifyDialog.width?parseInt(D.options.notifyDialog.width):null,minHeight:null,minimize:function(){D.ui.notify.trigger("minimize")}}),statusbar:st('<div class="ui-widget-header ui-helper-clearfix ui-corner-bottom elfinder-statusbar"></div>').hide().appendTo(R),toast:st('<div class="elfinder-toast"></div>').appendTo(R),bottomtray:st('<div class="elfinder-bottomtray">').appendTo(R),progressbar:st('<div class="elfinder-ui-progressbar">').appendTo(R)},D.trigger("uiready"),st.each(D.options.ui||[],function(e,t){var n="elfinder"+t,i=D.options.uiOptions[t]||{};!D.ui[t]&&st.fn[n]&&(D.ui[t]=st("<"+(i.tag||"div")+"/>").appendTo(R),D.ui[t][n](D,i))}),D.ui.progressbar.appendTo(D.ui.workzone),D.ui.notify.prev(".ui-dialog-titlebar").append('<div class="elfinder-ui-progressbar"></div>'),D.resize(ce,de),D.options.resizable&&(R.resizable({resize:function(e,t){D.resize(t.size.width,t.size.height)},handles:"se",minWidth:300,minHeight:200}),D.UA.Touch&&R.addClass("touch-punch")),n=D.getUI("navbar"),i=D.getUI("cwd").parent(),D.autoScroll={navbarUp:function(e){n.scrollTop(Math.max(0,n.scrollTop()-e))},navbarDown:function(e){n.scrollTop(n.scrollTop()+e)},cwdUp:function(e){i.scrollTop(Math.max(0,i.scrollTop()-e))},cwdDown:function(e){i.scrollTop(i.scrollTop()+e)}},D.UA.Touch&&(x=D.getUI("navbar"),k=D.getUI("toolbar"),C="touchmove.stopscroll",x=x.children().length?x:null,k=k.length?k:null,R.on("touchstart touchmove touchend",function(e){if("touchend"===e.type)return f=h=!1,void(y=setTimeout(function(){R.off(C)},100));var t,n,i,a,o,r=e.originalEvent.touches||[{}],s=r[0].pageX||null,l=r[0].pageY||null,c="ltr"===D.direction;null===s||null===l||"touchstart"===e.type&&1<r.length||("touchstart"===e.type?(m=R.offset(),g=R.width(),x&&(h=!1,x.is(":hidden")?(w=w||Math.max(50,g/10),(c?s-m.left:g+m.left-s)<w&&(h=s)):e.originalEvent._preventSwipeX||(v=x.width(),n=c?s<m.left+v:s>m.left+g-v,h=!!n&&(w=Math.max(50,g/10),s))),k&&(f=!1,e.originalEvent._preventSwipeY||(b=k.height(),l-m.top<(k.is(":hidden")?50:b+30)&&(f=l,R.on(C,k.is(":hidden")?I:S))))):(x&&!1!==h&&(t=(c?s<h:h<s)?"navhide":"navshow",i=Math.abs(h-s),("navhide"==t&&.6*v<i||("navhide"==t?v/3:45)<i&&("navshow"==t||(c?s<m.left+20:s>m.left+g-20)))&&(D.getUI("navbar").trigger(t,{handleW:w}),h=!1)),k&&!1!==f&&(a=k.offset().top,Math.abs(f-l)>Math.min(45,b/3)&&("slideDown"==(o=l<f?"slideUp":"slideDown")||l<a+20)&&(k.is("slideDown"==o?":hidden":":visible")&&k.stop(!0,!0).trigger("toggle",{duration:100,handleH:50}),f=!1))))})),D.dragUpload&&(a="native-drag-enter",z="native-drag-disable",e="class",T=D.res(e,"navdir"),D.res(e,"droppable"),D.res(e,"adroppable"),D.res(e,"navarrow"),A=D.res(e,"adroppable"),j=D.getUI("workzone"),O="ltr"===D.direction,R.on("dragenter",function(e){E(),M(e)&&(e.preventDefault(),e.stopPropagation(),o=j.data("rectangle"))}).on("dragleave",function(e){E(),M(e)&&(e.preventDefault(),e.stopPropagation())}).on("dragover",function(i){var a;M(i)?(i.preventDefault(),i.stopPropagation(),i.originalEvent.dataTransfer.dropEffect="none",r=r||requestAnimationFrame(function(){var e,t=o.top+o.height,n=t-D.getUI("navdock").outerHeight(!0);((a=i.pageY<o.top)||i.pageY>n)&&(e=o.cwdEdge>i.pageX?(O?"navbar":"cwd")+(a?"Up":"Down"):(O?"cwd":"navbar")+(a?"Up":"Down"),a||"cwd"===e.substr(0,3)&&(t<i.pageY?n=t:e=""),e&&D.autoScroll[e](Math.pow(a?o.top-i.pageY:i.pageY-n,1.3))),r=null})):E()}).on("drop",function(e){E(),M(e)&&(e.stopPropagation(),e.preventDefault())}),R.on("dragenter",".native-droppable",function(e){if(e.originalEvent.dataTransfer){var n,t=st(e.currentTarget),i=null;if(!(e.currentTarget.id||null)){i=D.cwd(),t.data(z,!1);try{st.each(e.originalEvent.dataTransfer.types,function(e,t){"elfinderfrom:"===t.substr(0,13)&&(n=t.substr(13).toLowerCase())})}catch(e){}}i&&(!i.write||n&&n===(window.location.href+i.hash).toLowerCase())?t.data(z,!0):(e.preventDefault(),e.stopPropagation(),t.data(a,!0),t.addClass(A))}}).on("dragleave",".native-droppable",function(e){var t;e.originalEvent.dataTransfer&&(t=st(e.currentTarget),e.preventDefault(),e.stopPropagation(),t.data(a)?t.data(a,!1):t.removeClass(A))}).on("dragover",".native-droppable",function(e){var t;e.originalEvent.dataTransfer&&(t=st(e.currentTarget),e.preventDefault(),e.stopPropagation(),e.originalEvent.dataTransfer.dropEffect=t.data(z)?"none":"copy",t.data(a,!1))}).on("drop",".native-droppable",function(e){var t,n;e.originalEvent&&e.originalEvent.dataTransfer&&(t=st(e.currentTarget),e.preventDefault(),e.stopPropagation(),t.removeClass(A),n=e.currentTarget.id?t.hasClass(T)?D.navId2Hash(e.currentTarget.id):D.cwdId2Hash(e.currentTarget.id):D.cwd().hash,e.originalEvent._target=n,D.exec("upload",{dropEvt:e.originalEvent,target:n},void 0,n))})),!1===D.cssloaded&&(D.cssloaded=!0,D.trigger("cssloaded")),D.zIndexCalc(),D.trigger("init").request({data:{cmd:"open",target:D.startDir(),init:1,tree:1},preventDone:!0,notify:{type:"open",cnt:1,hideCnt:!0},freeze:!0}).fail(function(){D.trigger("fail").disable().lastDir(""),ne={},ie={},st(document).add(R).off("."+L),D.trigger=function(){}}).done(function(e){function n(e){var t=D.file(D.trashes[e]);D.options.debug,t&&t.volumeid&&delete D.volOptions[t.volumeid].trashHash,D.trashes[e]=!1,D.debug("backend-error",'Trash hash "'+e+'" was not found or not writable.')}var i={};D.options.rawStringDecoder&&D.registRawStringDecoder(D.options.rawStringDecoder),D.zIndexCalc(),D.load().debug("api",D.api),R.trigger("resize"),P(e),D.trigger("open",e,!1),D.trigger("opendone"),Ae&&D.options.enableAlways&&st(window).trigger("focus"),st.each(D.trashes,function(e){var t=D.file(e);t?"directory"===t.mime&&t.write||n(e):i[e]=!0}),Object.keys(i).length&&D.request({data:{cmd:"info",targets:Object.keys(i)},preventDefault:!0}).done(function(e){e&&e.files&&st.each(e.files,function(e,t){"directory"===t.mime&&t.write&&delete i[t.hash]})}).always(function(){st.each(i,n)}),D[D.options.enableAlways?"enable":"disable"]()})},n&&"function"==typeof n&&(D.bootCallback=n).call(R.get(0),D,{dfrdsBeforeBootup:E}),st.when.apply(null,E).done(function(){r()}).fail(function(e){D.error(e)})};function C(e,t){var n,i;1<e.originalEvent.touches.length||(h(e.currentTarget).hasClass("touch-punch-keep-default")||e.preventDefault(),n=e.originalEvent.changedTouches[0],(i=document.createEvent("MouseEvents")).initMouseEvent(t,!0,!0,window,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i))}function z(e,t){var n=0;for(n in t)if(void 0!==e[t[n]])return t[n];return e[t[n]]="",t[n]}return void 0!==(t=t||!1)&&!t||(window.elFinder=Me),Me.prototype={uniqueid:0,res:function(e,t){return this.resources[e]&&this.resources[e][t]},OS:-1!==navigator.userAgent.indexOf("Mac")?"mac":-1!==navigator.userAgent.indexOf("Win")?"win":"other",UA:(r=!document.unqueID&&!window.opera&&!window.sidebar&&"localStorage"in window&&"WebkitAppearance"in document.documentElement.style,s=r&&window.chrome,{ltIE6:void 0===window.addEventListener&&void 0===document.documentElement.style.maxHeight,ltIE7:void 0===window.addEventListener&&void 0===document.querySelectorAll,ltIE8:void 0===window.addEventListener&&void 0===document.getElementsByClassName,ltIE9:document.uniqueID&&document.documentMode<=9,ltIE10:document.uniqueID&&document.documentMode<=10,gtIE11:document.uniqueID&&11<=document.documentMode,IE:document.uniqueID,Firefox:window.sidebar,Opera:window.opera,Webkit:r,Chrome:s,Edge:!(!s||!window.msCredentials),Safari:r&&!window.chrome,Mobile:void 0!==window.orientation,Touch:void 0!==window.ontouchstart,iOS:navigator.platform.match(/^iP(?:[ao]d|hone)/),Mac:navigator.platform.match(/^Mac/),Fullscreen:void 0!==(document.exitFullscreen||document.webkitExitFullscreen||document.mozCancelFullScreen||document.msExitFullscreen),Angle:0,Rotated:!1,CSS:(a=document.createElement("a").style,o=document.createElement("p").style,a.cssText="position:sticky;position:-webkit-sticky;width:-webkit-max-content;width:-moz-max-content;width:-ms-max-content;width:max-content;",{positionSticky:-1!==a.position.indexOf("sticky"),widthMaxContent:-1!==a.width.indexOf("max-content"),flex:void 0!==o.flex})}),cookieEnabled:(i="elftest=",document.cookie=i+"1",n=2===document.cookie.split(i).length,document.cookie=i+";max-age=0",n),hasRequire:"function"==typeof define&&define.amd,currentReqCmd:"",keyState:{},i18:{en:{translator:"",language:"English",direction:"ltr",dateFormat:"d.m.Y H:i",fancyDateFormat:"$1 H:i",nonameDateFormat:"ymd-His",messages:{}},months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["msJan","msFeb","msMar","msApr","msMay","msJun","msJul","msAug","msSep","msOct","msNov","msDec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},kinds:{unknown:"Unknown",directory:"Folder",group:"Selects",symlink:"Alias","symlink-broken":"AliasBroken","application/x-empty":"TextPlain","application/postscript":"Postscript","application/vnd.ms-office":"MsOffice","application/msword":"MsWord","application/vnd.ms-word":"MsWord","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"MsWord","application/vnd.ms-word.document.macroEnabled.12":"MsWord","application/vnd.openxmlformats-officedocument.wordprocessingml.template":"MsWord","application/vnd.ms-word.template.macroEnabled.12":"MsWord","application/vnd.ms-excel":"MsExcel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"MsExcel","application/vnd.ms-excel.sheet.macroEnabled.12":"MsExcel","application/vnd.openxmlformats-officedocument.spreadsheetml.template":"MsExcel","application/vnd.ms-excel.template.macroEnabled.12":"MsExcel","application/vnd.ms-excel.sheet.binary.macroEnabled.12":"MsExcel","application/vnd.ms-excel.addin.macroEnabled.12":"MsExcel","application/vnd.ms-powerpoint":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.presentation":"MsPP","application/vnd.ms-powerpoint.presentation.macroEnabled.12":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.slideshow":"MsPP","application/vnd.ms-powerpoint.slideshow.macroEnabled.12":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.template":"MsPP","application/vnd.ms-powerpoint.template.macroEnabled.12":"MsPP","application/vnd.ms-powerpoint.addin.macroEnabled.12":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.slide":"MsPP","application/vnd.ms-powerpoint.slide.macroEnabled.12":"MsPP","application/pdf":"PDF","application/xml":"XML","application/vnd.oasis.opendocument.text":"OO","application/vnd.oasis.opendocument.text-template":"OO","application/vnd.oasis.opendocument.text-web":"OO","application/vnd.oasis.opendocument.text-master":"OO","application/vnd.oasis.opendocument.graphics":"OO","application/vnd.oasis.opendocument.graphics-template":"OO","application/vnd.oasis.opendocument.presentation":"OO","application/vnd.oasis.opendocument.presentation-template":"OO","application/vnd.oasis.opendocument.spreadsheet":"OO","application/vnd.oasis.opendocument.spreadsheet-template":"OO","application/vnd.oasis.opendocument.chart":"OO","application/vnd.oasis.opendocument.formula":"OO","application/vnd.oasis.opendocument.database":"OO","application/vnd.oasis.opendocument.image":"OO","application/vnd.openofficeorg.extension":"OO","application/x-shockwave-flash":"AppFlash","application/flash-video":"Flash video","application/x-bittorrent":"Torrent","application/javascript":"JS","application/rtf":"RTF","application/rtfd":"RTF","application/x-font-ttf":"TTF","application/x-font-otf":"OTF","application/x-rpm":"RPM","application/x-web-config":"TextPlain","application/xhtml+xml":"HTML","application/docbook+xml":"DOCBOOK","application/x-awk":"AWK","application/x-gzip":"GZIP","application/x-bzip2":"BZIP","application/x-xz":"XZ","application/zip":"ZIP","application/x-zip":"ZIP","application/x-rar":"RAR","application/x-tar":"TAR","application/x-7z-compressed":"7z","application/x-jar":"JAR","text/plain":"TextPlain","text/x-php":"PHP","text/html":"HTML","text/javascript":"JS","text/css":"CSS","text/rtf":"RTF","text/rtfd":"RTF","text/x-c":"C","text/x-csrc":"C","text/x-chdr":"CHeader","text/x-c++":"CPP","text/x-c++src":"CPP","text/x-c++hdr":"CPPHeader","text/x-shellscript":"Shell","application/x-csh":"Shell","text/x-python":"Python","text/x-java":"Java","text/x-java-source":"Java","text/x-ruby":"Ruby","text/x-perl":"Perl","text/x-sql":"SQL","text/xml":"XML","text/x-comma-separated-values":"CSV","text/x-markdown":"Markdown","image/x-ms-bmp":"BMP","image/jpeg":"JPEG","image/gif":"GIF","image/png":"PNG","image/tiff":"TIFF","image/x-targa":"TGA","image/vnd.adobe.photoshop":"PSD","image/xbm":"XBITMAP","image/pxm":"PXM","audio/mpeg":"AudioMPEG","audio/midi":"AudioMIDI","audio/ogg":"AudioOGG","audio/mp4":"AudioMPEG4","audio/x-m4a":"AudioMPEG4","audio/wav":"AudioWAV","audio/x-mp3-playlist":"AudioPlaylist","video/x-dv":"VideoDV","video/mp4":"VideoMPEG4","video/mpeg":"VideoMPEG","video/x-msvideo":"VideoAVI","video/quicktime":"VideoMOV","video/x-ms-wmv":"VideoWM","video/x-flv":"VideoFlash","video/x-matroska":"VideoMKV","video/ogg":"VideoOGG"},mimeTypes:{},rules:{defaults:function(e){return!(!e||e.added&&!Array.isArray(e.added)||e.removed&&!Array.isArray(e.removed)||e.changed&&!Array.isArray(e.changed))},open:function(e){return e&&e.cwd&&e.files&&st.isPlainObject(e.cwd)&&Array.isArray(e.files)},tree:function(e){return e&&e.tree&&Array.isArray(e.tree)},parents:function(e){return e&&e.tree&&Array.isArray(e.tree)},tmb:function(e){return e&&e.images&&(st.isPlainObject(e.images)||Array.isArray(e.images))},upload:function(e){return e&&(st.isPlainObject(e.added)||Array.isArray(e.added))},search:function(e){return e&&e.files&&Array.isArray(e.files)}},commands:{},cmdsToAdd:"archive duplicate extract mkdir mkfile paste rm upload",parseUploadData:function(e){var t,n=this;if(!st.trim(e))return{error:["errResponse","errDataEmpty"]};try{t=JSON.parse(e)}catch(e){return{error:["errResponse","errDataNotJSON"]}}return t=n.normalize(t),n.validResponse("upload",t)?(t.removed=st.merge(t.removed||[],st.map(t.added||[],function(e){return n.file(e.hash)?e.hash:null})),t):{error:t.norError||["errResponse"]}},iframeCnt:0,uploads:{xhrUploading:!1,failSyncTm:null,chunkfailReq:{},checkExists:function(a,i,o,t){function r(){for(var e=a.length;-1<--e;)a[e]._remove=!0}function s(){e.resolve(h,f)}var l,c,d,p,u,e=st.Deferred(),h=[],f={};return 2.1<=o.api&&"object"==typeof a[0]?(c=[],d=[],p=i!==o.cwd().hash?o.path(i,!0)+o.option("separator",i):"",u=function(n){var i=n==d.length-1,e={cssClass:"elfinder-confirm-upload",title:o.i18n("cmdupload"),text:["errExists",p+d[n].name,"confirmRepl"],all:!i,accept:{label:"btnYes",callback:function(e){i||e?s():u(++n)}},reject:{label:"btnNo",callback:function(e){var t;if(e)for(t=d.length;n<t--;)a[d[t].i]._remove=!0;else a[d[n].i]._remove=!0;i||e?s():u(++n)}},cancel:{label:"btnCancel",callback:function(){r(),s()}},buttons:[{label:"btnBackup",cssClass:"elfinder-confirm-btn-backup",callback:function(e){var t;if(e)for(t=d.length;n<t--;)h.push(d[t].name);else h.push(d[n].name);i||e?s():u(++n)}}]};t||e.buttons.push({label:"btnRename"+(i?"":"All"),cssClass:"elfinder-confirm-btn-rename",callback:function(){h=null,s()}}),0<o.iframeCnt&&delete e.reject,o.confirm(e)},o.file(i).read?(l=st.map(a,function(e,t){return!e.name||o.UA.iOS&&"image.jpg"===e.name?null:{i:t,name:e.name}}),o.request({data:{cmd:"ls",target:i,intersect:st.map(l,function(e){return e.name})},notify:{type:"preupload",cnt:1,hideCnt:!0},preventDefault:!0}).done(function(e){var t,n;e&&(e.error?r():o.options.overwriteUploadConfirm&&o.option("uploadOverwrite",i)&&e.list&&(Array.isArray(e.list)?c=e.list||[]:(t=[],c=st.map(e.list,function(e){return"string"==typeof e?e:(t=t.concat(e),!1)}),t.length&&(c=c.concat(t)),f=e.list),(d=st.grep(l,function(e){return-1!==st.inArray(e.name,c)})).length&&c.length&&i==o.cwd().hash&&(n=st.map(o.files(i),function(e){return e.name}),st.grep(c,function(e){return-1===st.inArray(e,n)}).length&&o.sync()))),0<d.length?u(0):s()}).fail(function(e){r(),s(),e&&o.error(e)})):s()):s(),e},checkFile:function(a,l,c){if(a.checked||"files"==a.type)return a.files;if("data"==a.type){var n,i=st.Deferred(),d=st.Deferred(),p=[],u=[],h=0,f=[],m=!1,g=function(e){function o(){--h<1&&"pending"===d.state()&&d.resolve()}function t(e){a&&e.name.match(a)||(u.push(i.fullPath||""),p.push(e)),o()}function n(e){var i=[],a=function(){e.readEntries(function(e){if(m||!e.length){for(var t=0;t<i.length;t++){if(m){d.reject();break}g([i[t]])}o()}else i=i.concat((n=e,Array.prototype.slice.call(n||[],0))),a();var n},o)};a()}var i,a=l.options.folderUploadExclude[l.OS]||null,r=e.length;h++;for(var s=0;s<r;s++){if(m){d.reject();break}(i=e[s])&&(i.isFile?(h++,i.file(t,o)):i.isDirectory&&2.1<=l.api&&(h++,f.push(i.fullPath),n(i.createReader())))}return o(),d},v=st.map(a.files.items,function(e){return e.getAsEntry?e.getAsEntry():e.webkitGetAsEntry()});return st.each(v,function(e,t){if(t.isDirectory)return!(n=!0)}),0<v.length?(l.uploads.checkExists(v,c,l,n).done(function(o,r){var s=[];l.options.overwriteUploadConfirm&&l.option("uploadOverwrite",c)&&(null===o&&(a.overwrite=0,o=[]),v=st.grep(v,function(n){var e,t,i,a;return n.isDirectory&&o.length&&-1!==(e=st.inArray(n.name,o))&&(o.splice(e,1),t=l.uniqueName(n.name+l.options.backupSuffix,null,""),st.each(r,function(e,t){if(n.name==t)return i=e,!1}),i=i||l.fileByName(n.name,c).hash,l.lockfiles({files:[i]}),a=l.request({data:{cmd:"rename",target:i,name:t},notify:{type:"rename",cnt:1}}).fail(function(){n._remove=!0,l.sync()}).always(function(){l.unlockfiles({files:[i]})}),s.push(a)),!n._remove})),st.when.apply(st,s).done(function(){var e,t,n=+new Date;0<v.length?(t=l.escape(v[0].name),1<v.length&&(t+=" ... "+v.length+l.i18n("items")),e=setTimeout(function(){l.notify({type:"readdir",id:n,cnt:1,hideCnt:!0,msg:l.i18n("ntfreaddir")+" ("+t+")",cancel:function(){m=!0}})},l.options.notifyDelay),g(v).done(function(){e&&clearTimeout(e),l.notify({type:"readdir",id:n,cnt:-1}),m?i.reject():i.resolve([p,u,o,r,f])}).fail(function(){i.reject()})):i.reject()})}),i.promise()):i.reject()}var o=[],r=[],e=a.files[0];if("html"==a.type){var s,t=st("<html></html>").append(st.parseHTML(e.replace(/ src=/gi," _elfsrc=")));st("img[_elfsrc]",t).each(function(){var e,t,n=st(this),i=n.closest("a");i&&i.attr("href")&&i.attr("href").match(/\.(?:jpe?g|gif|bmp|png)/i)&&(t=i.attr("href")),(e=n.attr("_elfsrc"))&&(t?(-1==st.inArray(t,o)&&o.push(t),-1==st.inArray(e,r)&&r.push(e)):-1==st.inArray(e,o)&&o.push(e)),1===o.length&&o[0].match(/^data:image\/png/)&&(a.clipdata=!0)}),(s=st("a[href]",t)).each(function(){var e,t,n,i;(e=st(this).text())&&(n=st(this).attr("href"),(i=document.createElement("a")).href=n,(t=i).href&&t.href.match(/^(?:ht|f)tp/i)&&(1===s.length||!t.pathname.match(/(?:\.html?|\/[^\/.]*)$/i)||st.trim(e).match(/\.[a-z0-9-]{1,10}$/i))&&-1==st.inArray(t.href,o)&&-1==st.inArray(t.href,r)&&o.push(t.href))})}else for(var b,y,w=/((?:ht|f)tps?:\/\/[-_.!~*\'()a-z0-9;/?:\@&=+\$,%#\*\[\]]+)/gi;b=w.exec(e);)y=b[1].replace(/&/g,"&"),-1==st.inArray(y,o)&&o.push(y);return o},xhr:function(S,I){function s(e){var t=st.Deferred();return e.promise?e.always(function(e){t.resolve(Array.isArray(e)&&e.length?q?e[0][0]:e[0]:{})}):t.resolve(e.length?q?e[0][0]:e[0]:{}),t}function M(e,t){v.children(".elfinder-notify-cancel")[e?"show":"hide"](),K=e}function E(e){return e=e||f,setTimeout(function(){i=!0,F.notify({type:"upload",cnt:$,progress:u-h,size:e,cancel:function(){c.trigger("uploadabort","userabort")}}),v=a.children(".elfinder-notify-upload"),h=u,S.multiupload?K&&M(!0):M(K&&u<e)},F.options.notifyDelay)}function l(){i&&W.notifyWith(v,[{cnt:v.data("cnt"),progress:v.data("progress"),total:v.data("total")}])}var F=I||this,c=F.getUI(),D=new XMLHttpRequest,U=null,n=null,d=null,P=S.checked,q=S.isDataType||"data"==S.type,R=S.target||F.cwd().hash,H=S.dropEvt||null,_=S.extraData||null,N=-1!=F.option("uploadMaxConn",R),L=Math.min(5,Math.max(1,F.option("uploadMaxConn",R))),t=0,W=st.Deferred().fail(function(e){var t,n=F.parseError(e);"userabort"===n&&(t=!0,n=void 0),p&&(F.uploads.xhrUploading||t)?s(p).done(function(e){t||G(n,e),e._cid?F.uploads.chunkfailReq[e._cid]||(F.uploads.chunkfailReq[e._cid]=!0,setTimeout(function(){I.request({data:{cmd:"upload",target:R,chunk:e._chunk,cid:e._cid,upload:["chunkfail"],mimes:"chunkfail"},options:{type:"post",url:F.uploadURL},preventDefault:!0}).always(function(){delete F.uploads.chunkfailReq[e._chunk]})},1e3)):(F.uploads.failSyncTm&&clearTimeout(F.uploads.failSyncTm),F.uploads.failSyncTm=setTimeout(function(){F.sync(R)},1e3))}):G(n),t||F.sync(),F.uploads.xhrUploading=!1,p=null}).done(function(e){F.uploads.xhrUploading=!1,p=null,e&&(F.currentReqCmd="upload",e.warning&&G(e.warning),F.updateCache(e),e.removed&&e.removed.length&&F.remove(e),e.added&&e.added.length&&F.add(e),e.changed&&e.changed.length&&F.change(e),F.trigger("upload",e,!1),F.trigger("uploaddone"),e.toasts&&Array.isArray(e.toasts)&&st.each(e.toasts,function(){this.msg&&F.toast(this)}),e.sync&&F.sync(),e.debug&&(F.responseDebug(e),I.debug("backend-debug",e)))}).always(function(){F.abortXHR(D),c.off("uploadabort",m),st(window).off("unload",m),U&&clearTimeout(U),n&&clearTimeout(n),d&&clearTimeout(d),P&&!S.multiupload&&J()&&F.notify({type:"upload",cnt:-$,progress:0,size:0}),n&&o&&F.notify({type:"chunkmerge",cnt:-$}),g&&a.children(".elfinder-notify-chunkmerge").length&&F.notify({type:"chunkmerge",cnt:-1})}),B=new FormData,p=S.input?S.input.files:F.uploads.checkFile(S,F,R),$=S.checked&&q?p[0].length:p.length,V=!1,u=0,h=0,f=0,i=!1,a=F.ui.notify,K=!0,o=!1,X=!1,J=function(){return!i&&(v=a.children(".elfinder-notify-upload")).length&&(i=!0),i},m=function(e,t){X=!0,F.abortXHR(D,{quiet:!0,abort:!0}),W.reject(t),J()&&F.notify({type:"upload",cnt:-1*v.data("cnt"),progress:0,size:0})},G=function(e,t,n){e&&F.trigger("xhruploadfail",{error:e,file:t}),n?e&&(r<F.options.maxErrorDialogs&&(Array.isArray(e)?Y=Y.concat(e):Y.push(e)),r++):e?F.error(e):(Y.length&&(r>=F.options.maxErrorDialogs&&(Y=Y.concat("moreErrors",r-F.options.maxErrorDialogs)),F.error(Y)),Y=[],r=0)},Y=[],r=0,Q=S.renames||null,Z=S.hashes||null,g=!1,v=st();if(c.one("uploadabort",m),st(window).one("unload."+I.namespace,m),g||(h=u),!q&&!$)return W.reject(["errUploadNoFiles"]);D.addEventListener("error",function(){0==D.status?X?W.reject():!q&&S.files&&st.grep(S.files,function(e){return!e.type&&e.size===(F.UA.Safari?1802:0)}).length?W.reject(["errAbort","errFolderUpload"]):S.input&&st.grep(S.input.files,function(e){return!e.type&&e.size===(F.UA.Safari?1802:0)}).length?W.reject(["errUploadNoFiles"]):t++<=30?(J()&&h&&F.notify({type:"upload",cnt:0,progress:0,size:h}),F.abortXHR(D,{quiet:!0}),h=u=0,setTimeout(function(){var e;X||(D.open("POST",F.uploadURL,!0),2.1029<=F.api&&(e=(+new Date).toString(16)+Math.floor(1e3*Math.random()).toString(16),"function"==typeof B.delete&&B.delete("reqid"),B.append("reqid",e),D._requestId=e),D.send(B))},1e4)):c.trigger("uploadabort",["errAbort","errTimeout"]):c.trigger("uploadabort","errConnect")},!1),D.addEventListener("load",function(e){var t,n,i=D.status,a=0,o="";if(F.setCustomHeaderByXhr(D),400<=i?o=500<i?"errResponse":["errResponse","errServerError"]:D.responseText||(o=["errResponse","errDataEmpty"]),o&&(c.trigger("uploadabort"),s(p||{}).done(function(e){return W.reject(e._cid?null:o)})),u=f,J()&&(a=u-h)&&(F.notify({type:"upload",cnt:0,progress:a,size:0}),l()),(t=F.parseUploadData(D.responseText))._chunkmerged){B=new FormData;var r=[{_chunkmerged:t._chunkmerged,_name:t._name,_mtime:t._mtime}];return g=!0,c.off("uploadabort",m),d=setTimeout(function(){F.notify({type:"chunkmerge",cnt:1})},F.options.notifyDelay),void(q?k(r,p[1]):k(r))}t._multiupload=!!S.multiupload,t.error?(n={cmd:"upload",err:t,xhr:D,rc:D.status},F.trigger("uploadfail",t),F.trigger("requestError",n),n._getEvent&&n._getEvent().isDefaultPrevented()&&(t.error=""),t._chunkfailure||t._multiupload?(X=!0,F.uploads.xhrUploading=!1,U&&clearTimeout(U),v.length?(F.notify({type:"upload",cnt:-$,progress:0,size:0}),W.reject(t)):W.reject()):W.reject(t)):W.resolve(t)},!1),D.upload.addEventListener("loadstart",function(e){!g&&e.lengthComputable&&(u=e.loaded,t&&(u=0),f=e.total,u=u||parseInt(.05*f),J()&&(F.notify({type:"upload",cnt:0,progress:u-h,size:S.multiupload?0:f}),h=u,l()))},!1),D.upload.addEventListener("progress",function(e){var t;e.lengthComputable&&!g&&D.readyState<2&&(u=e.loaded,!S.checked&&0<u&&!U&&(U=E(D._totalSize-u)),f||(f=e.total,u=u||parseInt(.05*f)),t=u-h,J()&&.05<=t/e.total&&(F.notify({type:"upload",cnt:0,progress:t,size:0}),h=u,l()),!o&&f<=u&&!V&&(o=!0,n=setTimeout(function(){F.notify({type:"chunkmerge",cnt:$})},F.options.notifyDelay)),K&&!S.multiupload&&f<=u&&J()&&M(!1))},!1);var b,y,w,e,x,k=function(e,t){var n,i,a,o,r,s,l,c,d,p,u,h,f,m,g,v=0,b=1,y=[],w=0,x=$,k=0,C=[],z=(new Date).getTime().toString().substr(-9),T=Math.min((I.uplMaxSize?I.uplMaxSize:2097152)-8190,I.options.uploadMaxChunkSize),A=!N&&"",j=function(t,e){var n,i,a,o=[];if(!X){for(;t.length&&o.length<e;)o.push(t.shift());if(i=o.length){a=i;for(var r=0;r<i&&!X;r++)n=q?o[r][0][0]._cid||null:o[r][0]._cid||null,m[n]?f--:I.exec("upload",{type:S.type,isDataType:q,files:o[r],checked:!0,target:R,dropEvt:H,renames:Q,hashes:Z,multiupload:!0,overwrite:0===S.overwrite?0:void 0,clipdata:S.clipdata},void 0,R).fail(function(e){e&&"No such command"===e&&(X=!0,I.error(["errUpload","errPerm"])),n&&(m[n]=!0)}).always(function(e){e&&e.added&&(u=st.merge(u,e.added)),f<=++h&&(I.trigger("multiupload",{added:u}),U&&clearTimeout(U),J()&&F.notify({type:"upload",cnt:-$,progress:0,size:0})),t.length?j(t,1):(--a<=1&&K&&M(!1),W.resolve())})}}(o.length<1||X)&&(X?(U&&clearTimeout(U),n&&(m[n]=!0),W.reject()):(W.resolve(),F.uploads.xhrUploading=!1))},O=function(){F.uploads.xhrUploading?setTimeout(O,100):(F.uploads.xhrUploading=!0,j(y,L))};if(!P&&(q||"files"==S.type)){for((n=I.option("uploadMaxSize",R))||(n=0),r=0;r<e.length;r++){try{i=(d=e[r]).size,!1===A&&(A="",2.1<=F.api&&("slice"in d?A="slice":"mozSlice"in d?A="mozSlice":"webkitSlice"in d&&(A="webkitSlice")))}catch(e){$--,x--;continue}if(n&&n<i||!A&&I.uplMaxSize&&i>I.uplMaxSize)G(["errUploadFile",d.name,"errUploadFileSize"],d,!0),$--,x--;else if(!d.type||F.uploadMimeCheck(d.type,R))if(A&&T<i){for(s=0,l=T,c=-1,x=Math.floor((i-1)/T),a=d.lastModified?Math.round(d.lastModified/1e3):0,o=S.clipdata?I.date(I.nonameDateFormat)+".png":d.name,k+=i,C[z]=0;s<i;)(p=d[A](s,l))._chunk=o+"."+ ++c+"_"+x+".part",p._cid=z,p._range=s+","+p.size+","+i,p._mtime=a,C[z]++,v&&w++,void 0===y[w]&&(y[w]=[],q&&(y[w][0]=[],y[w][1]=[])),v=T,b=1,q?(y[w][0].push(p),y[w][1].push(t[r])):y[w].push(p),l=(s=l)+T;null==p?(G(["errUploadFile",d.name,"errUploadFileSize"],d,!0),$--,x--):(x+=c,v=0,b=1,w++)}else(I.uplMaxSize&&v+i>I.uplMaxSize||b>I.uplMaxFile)&&(v=0,b=1,w++),void 0===y[w]&&(y[w]=[],q&&(y[w][0]=[],y[w][1]=[])),q?(y[w][0].push(d),y[w][1].push(t[r])):y[w].push(d),v+=i,k+=i,b++;else G(["errUploadFile",d.name,"errUploadMime","("+d.type+")"],d,!0),$--,x--}if(Y.length&&G(),0==y.length)return!(S.checked=!0);if(1<y.length)return U=E(k),u=[],h=0,f=y.length,m=[],O(),!0;q?(e=y[0][0],t=y[0][1]):e=y[0]}return P||(I.UA.Safari&&S.files?D._totalSize=k:U=E(k)),P=!0,e.length||W.reject(["errUploadNoFiles"]),D.open("POST",F.uploadURL,!0),I.customHeaders&&st.each(I.customHeaders,function(e){D.setRequestHeader(e,this)}),I.xhrFields&&st.each(I.xhrFields,function(e){e in D&&(D[e]=this)}),2.1029<=F.api&&(g=(+new Date).toString(16)+Math.floor(1e3*Math.random()).toString(16),B.append("reqid",g),D._requestId=g),B.append("cmd","upload"),B.append(F.newAPI?"target":"current",R),Q&&Q.length&&(st.each(Q,function(e,t){B.append("renames[]",t)}),B.append("suffix",I.options.backupSuffix)),Z&&st.each(Z,function(e,t){B.append("hashes["+e+"]",t)}),st.each(F.customData,function(e,t){B.append(e,t)}),st.each(F.options.onlyMimes,function(e,t){B.append("mimes[]",t)}),st.each(e,function(e,t){var n;t._chunkmerged?(B.append("chunk",t._chunkmerged),B.append("upload[]",t._name),B.append("mtime[]",t._mtime),S.clipdata&&B.append("overwrite",0),V=!0):(t._chunkfail?(B.append("upload[]","chunkfail"),B.append("mimes","chunkfail")):(S.clipdata?t._chunk||(S.overwrite=0,n=I.date(I.nonameDateFormat)+".png"):t.name&&(n=t.name,I.UA.iOS&&(n.match(/^image\.jpe?g$/i)?(S.overwrite=0,n=I.date(I.nonameDateFormat)+".jpg"):n.match(/^capturedvideo\.mov$/i)&&(S.overwrite=0,n=I.date(I.nonameDateFormat)+".mov")),n=(t.webkitRelativePath||t.relativePath||t._relativePath||"").replace(/[^\/]+$/,"")+n),n?B.append("upload[]",t,n):B.append("upload[]",t)),t._chunk?(B.append("chunk",t._chunk),B.append("cid",t._cid),B.append("range",t._range),B.append("mtime[]",t._mtime),V=!0):B.append("mtime[]",t.lastModified?Math.round(t.lastModified/1e3):0))}),q&&st.each(t,function(e,t){B.append("upload_path[]",t)}),0===S.overwrite&&B.append("overwrite",0),H&&B.append("dropWith",parseInt((H.altKey?"1":"0")+(H.ctrlKey?"1":"0")+(H.metaKey?"1":"0")+(H.shiftKey?"1":"0"),2)),_&&st.each(_,function(e,t){B.append(e,t)}),D.send(B),!0};return q?P?k(p[0],p[1]):p.done(function(a){if(Q=[],$=a[0].length){if(a[4]&&a[4].length)return void I.request({data:{cmd:"mkdir",target:R,dirs:a[4]},notify:{type:"mkdir",cnt:a[4].length},preventFail:!0}).fail(function(e){"errCmdParams"===(e=e||["errUnknown"])[0]?L=1:(L=0,W.reject(e))}).done(function(n){var i=!1;n.hashes||(n.hashes={}),a[1]=st.map(a[1],function(e,t){return a[0][t]._relativePath=e.replace(/^\//,""),""===(e=e.replace(/\/[^\/]*$/,""))?R:n.hashes[e]?n.hashes[e]:(i=!0,a[0][t]._remove=!0,null)}),i&&(a[0]=st.grep(a[0],function(e){return!e._remove}))}).always(function(e){L&&(Q=a[2],Z=a[3],k(a[0],a[1]))});a[1]=st.map(a[1],function(){return R}),Q=a[2],Z=a[3],k(a[0],a[1])}else W.reject(["errUploadNoFiles"])}).fail(function(){W.reject()}):0<p.length?S.clipdata||null!=Q?k(p)||W.reject():(b=[],y=[],w=I.options.folderUploadExclude[I.OS]||null,st.each(p,function(e,t){var n,i,a=t.webkitRelativePath||t.relativePath||"";if(!a)return!1;w&&t.name.match(w)?(t._remove=!0,a=void 0):(a="/"+a.replace(/\/[^\/]*$/,"").replace(/^\//,""))&&-1===st.inArray(a,b)&&(b.push(a),-1!==(n=a.substr(1).indexOf("/"))&&(i=a.substr(0,n+1))&&-1===st.inArray(i,b)&&b.unshift(i)),y.push(a)}),Q=[],Z={},b.length?(e=st.map(b,function(e){return-1===e.substr(1).indexOf("/")?{name:e.substr(1)}:null}),x=[],I.uploads.checkExists(e,R,I,!0).done(function(n,i){var a,o,r=[];I.options.overwriteUploadConfirm&&I.option("uploadOverwrite",R)&&(x=st.map(e,function(e){return e._remove?e.name:null}),e=st.grep(e,function(e){return!e._remove})),x.length&&st.each(y.concat(),function(e,t){0===st.inArray(t,x)&&(p[e]._remove=!0,y[e]=void 0)}),p=st.grep(p,function(e){return!e._remove}),y=st.grep(y,function(e){return void 0!==e}),e.length?(st.Deferred(),n.length?st.each(n,function(e,t){a=I.uniqueName(t+I.options.backupSuffix,null,""),st.each(i,function(e,t){if(n[0]==t)return o=e,!1}),o=o||I.fileByName(n[0],R).hash,I.lockfiles({files:[o]}),r.push(I.request({data:{cmd:"rename",target:o,name:a},notify:{type:"rename",cnt:1}}).fail(function(e){W.reject(e),I.sync()}).always(function(){I.unlockfiles({files:[o]})}))}):r.push(null),st.when.apply(st,r).done(function(){I.request({data:{cmd:"mkdir",target:R,dirs:b},notify:{type:"mkdir",cnt:b.length},preventFail:!0}).fail(function(e){"errCmdParams"===(e=e||["errUnknown"])[0]?L=1:(L=0,W.reject(e))}).done(function(n){var i=!1;n.hashes||(n.hashes={}),y=st.map(y.concat(),function(e,t){return"/"===e?R:n.hashes[e]?n.hashes[e]:(i=!0,p[t]._remove=!0,null)}),i&&(p=st.grep(p,function(e){return!e._remove}))}).always(function(e){L&&(q=!0,k(p,y)||W.reject())})})):W.reject()})):I.uploads.checkExists(p,R,I).done(function(e,t){I.options.overwriteUploadConfirm&&I.option("uploadOverwrite",R)&&(Z=t,null===e?S.overwrite=0:Q=e,p=st.grep(p,function(e){return!e._remove})),0<($=p.length)&&k(p)||W.reject()})):W.reject(),W},iframe:function(n,e){function t(){s&&clearTimeout(s),r&&clearTimeout(r),o&&l.notify({type:"upload",cnt:-a}),setTimeout(function(){f&&st('<iframe src="javascript:false;"></iframe>').appendTo(h),h.remove(),m.remove()},100)}var i,a,o,r,s,l=e||this,c=!!n.input&&n.input,d=!c&&l.uploads.checkFile(n,l),p=st.Deferred().fail(function(e){e&&l.error(e)}),u="iframe-"+e.namespace+ ++l.iframeCnt,h=st('<form action="'+l.uploadURL+'" method="post" enctype="multipart/form-data" encoding="multipart/form-data" target="'+u+'" style="display:none"><input type="hidden" name="cmd" value="upload" /></form>'),f=this.UA.IE,m=st('<iframe src="'+(f?"javascript:false;":"about:blank")+'" name="'+u+'" style="position:absolute;left:-1000px;top:-1000px" ></iframe>').on("load",function(){m.off("load").on("load",function(){t(),p.resolve()}),r=setTimeout(function(){o=!0,l.notify({type:"upload",cnt:a})},l.options.notifyDelay),0<l.options.iframeTimeout&&(s=setTimeout(function(){t(),p.reject(["errConnect","errTimeout"])},l.options.iframeTimeout)),h.submit()}),g=n.target||l.cwd().hash,v=[],b=[],y={};if(d&&d.length)st.each(d,function(e,t){h.append('<input type="hidden" name="upload[]" value="'+t+'"/>')}),a=1;else{if(!(c&&st(c).is(":file")&&st(c).val()))return p.reject();e.options.overwriteUploadConfirm&&e.option("uploadOverwrite",g)&&(i=c.files?c.files:[{name:st(c).val().replace(/^(?:.+[\\\/])?([^\\\/]+)$/,"$1")}],v.push(l.uploads.checkExists(i,g,l).done(function(e,t){y=t,null===e?n.overwrite=0:(b=e,(a=st.grep(i,function(e){return!e._remove}).length)!=i.length&&(a=0))}))),a=c.files?c.files.length:1,h.append(c)}return st.when.apply(st,v).done(function(){return a<1?p.reject():(h.append('<input type="hidden" name="'+(l.newAPI?"target":"current")+'" value="'+g+'"/>').append('<input type="hidden" name="html" value="1"/>').append('<input type="hidden" name="node" value="'+l.id+'"/>').append(st(c).attr("name","upload[]")),0<b.length&&(st.each(b,function(e,t){h.append('<input type="hidden" name="renames[]" value="'+l.escape(t)+'"/>')}),h.append('<input type="hidden" name="suffix" value="'+e.options.backupSuffix+'"/>')),y&&st.each(b,function(e,t){h.append('<input type="hidden" name="['+e+']" value="'+l.escape(t)+'"/>')}),0===n.overwrite&&h.append('<input type="hidden" name="overwrite" value="0"/>'),st.each(l.options.onlyMimes||[],function(e,t){h.append('<input type="hidden" name="mimes[]" value="'+l.escape(t)+'"/>')}),st.each(l.customData,function(e,t){h.append('<input type="hidden" name="'+e+'" value="'+l.escape(t)+'"/>')}),h.appendTo("body"),void m.appendTo("body"))}),p}},one:function(e,n,t){var i=this,a=e.toLowerCase(),o=function(e,t){return i.toUnbindEvents[a]||(i.toUnbindEvents[a]=[]),i.toUnbindEvents[a].push({type:a,callback:o}),(n.done?n.done:n).apply(this,arguments)};return n.done&&(o={done:o}),this.bind(a,o,t)},localStorage:function(t,n){var e,i,a,o,r,s=window.localStorage,l="elfinder-"+(t||"")+this.id,c=window.location.pathname+"-elfinder-",d=this.id,p=[];if(void 0===t)return o=c.length,r=-1*d.length,st.each(s,function(e){e.substr(0,o)===c&&e.substr(r)===d&&p.push(e)}),st.each(p,function(e,t){s.removeItem(t)}),!0;if(t=c+t+d,null===n)return s.removeItem(t);if(void 0===n&&!(e=s.getItem(t))&&(i=s.getItem(l))&&(n=i,s.removeItem(l)),void 0!==n){"string"!=(a=typeof n)&&"number"!=a&&(n=JSON.stringify(n));try{s.setItem(t,n)}catch(e){try{s.clear(),s.setItem(t,n)}catch(e){this.debug("error",e.toString())}}e=s.getItem(t)}if(e&&("{"===e.substr(0,1)||"["===e.substr(0,1)))try{return JSON.parse(e)}catch(e){}return e},sessionStorage:function(t,n){var i,e,a;try{i=window.sessionStorage}catch(e){}if(i){if(null===n)return i.removeItem(t);if(void 0!==n){"string"!=(a=typeof n)&&"number"!=a&&(n=JSON.stringify(n));try{i.setItem(t,n)}catch(e){try{i.clear(),i.setItem(t,n)}catch(e){this.debug("error",e.toString())}}}if((e=i.getItem(t))&&("{"===e.substr(0,1)||"["===e.substr(0,1)))try{return JSON.parse(e)}catch(e){}return e}},cookie:function(e,t){var n,i,a,o,r,s;if(e="elfinder-"+e+this.id,void 0===t){if(this.cookieEnabled&&document.cookie&&""!=document.cookie)for(a=document.cookie.split(";"),e+="=",o=0;o<a.length;o++)if(a[o]=st.trim(a[o]),a[o].substring(0,e.length)==e){if("{"===(r=decodeURIComponent(a[o].substring(e.length))).substr(0,1)||"["===r.substr(0,1))try{return JSON.parse(r)}catch(e){}return r}return null}if(!this.cookieEnabled)return"";if(i=Object.assign({},this.options.cookie),null===t?(t="",i.expires=-1):"string"!=(s=typeof t)&&"number"!=s&&(t=JSON.stringify(t)),"number"==typeof i.expires&&((n=new Date).setTime(n.getTime()+864e5*i.expires),i.expires=n),document.cookie=e+"="+encodeURIComponent(t)+"; expires="+i.expires.toUTCString()+(i.path?"; path="+i.path:"")+(i.domain?"; domain="+i.domain:"")+(i.secure?"; secure":""),t&&("{"===t.substr(0,1)||"["===t.substr(0,1)))try{return JSON.parse(t)}catch(e){}return t},startDir:function(){var e=window.location.hash;return e&&e.match(/^#elf_/)?e.replace(/^#elf_/,""):this.options.startPathHash?this.options.startPathHash:this.lastDir()},lastDir:function(e){return this.options.rememberLastDir?this.storage("lastdir",e):""},_node:st("<span></c.length;>"),escape:function(e){return this._node.text(e).html().replace(/"/g,""").replace(/'/g,"'")},normalize:function(o){function p(a){function n(e){var t=typeof e;return"object"===t&&Array.isArray(e)&&(t="array"),t}return st.each(g.optionProperties,function(e,t){void 0!==t&&a[e]&&n(a[e])!==n(t)&&(a[e]=t)}),a.disabled?(a.disabledFlip=g.arrayFlip(a.disabled,!0),st.each(g.options.disabledCmdsRels,function(e,t){var n,i;(a.disabledFlip[e]||(n=e.match(/^([^&]+)&([^=]+)=(.*)$/))&&a.disabledFlip[n[1]]&&a[n[2]]==n[3])&&(i=!0),i&&st.each(t,function(e,t){a.disabledFlip[t]||(a.disabledFlip[t]=!0,a.disabled.push(t))})})):a.disabledFlip={},a}function e(t,e,n){var i,a,o,r,s,l,c=!e||t,d=!!e&&null;if(t&&t.hash&&t.name&&t.mime){if("application/x-empty"===t.mime&&(t.mime="text/plain"),(o=g.isRoot(t))&&!t.volumeid&&g.debug("warning","The volume root statuses requires `volumeid` property."),o||"directory"===t.mime){if(t.phash){if(t.phash===t.hash)return b=b.concat(['Parent folder of "$1" is itself.',t.name]),d;if(o&&t.volumeid&&0===t.phash.indexOf(t.volumeid))return b=b.concat(['Parent folder of "$1" is inner itself.',t.name]),d}t.volumeid&&(i=t.volumeid,o&&(t.phash&&(g.leafRoots[t.phash]?-1===st.inArray(t.hash,g.leafRoots[t.phash])&&g.leafRoots[t.phash].push(t.hash):g.leafRoots[t.phash]=[t.hash]),g.hasVolOptions=!0,g.volOptions[i]||(g.volOptions[i]={dispInlineRegex:g.options.dispInlineRegex}),a=g.volOptions[i],t.options&&Object.assign(a,t.options),t.disabled&&(a.disabled=t.disabled,a.disabledFlip=g.arrayFlip(t.disabled,!0)),t.tmbUrl&&(a.tmbUrl=t.tmbUrl),a.url&&"/"!==a.url.substr(-1)&&(a.url+="/"),(s=a).uiCmdMap&&(st.isPlainObject(s.uiCmdMap)&&Object.keys(s.uiCmdMap).length?(s.disabledFlip||(s.disabledFlip={}),l=s.disabledFlip,st.each(s.uiCmdMap,function(e,t){"hidden"!==t||l[e]||(s.disabled.push(e),s.disabledFlip[e]=!0)})):delete s.uiCmdMap),a.trashHash&&(!1===g.trashes[a.trashHash]?delete a.trashHash:g.trashes[a.trashHash]=t.hash),st.each(g.optionProperties,function(e){a[e]&&(t[e]=a[e])}),"cwd"!==n&&(g.roots[i]=t.hash),t.expires&&(g.volumeExpires[i]=t.expires)),m!==i&&(m=i,f=g.option("i18nFolderName",i))),o&&!t.i18&&(u="volume_"+t.name,h=g.i18n(!1,u),u!==h&&(t.i18=h)),f&&!t.i18&&(u="folder_"+t.name,h=g.i18n(!1,u),u!==h&&(t.i18=h)),o&&(r=g.storage("rootNames"))&&(r[t.hash]&&(t._name=t.name,t._i18=t.i18,t.name=r[t.hash]=r[t.hash],delete t.i18),g.storage("rootNames",r)),g.trashes[t.hash]&&(t.locked=!0)}else{if(v)try{if(!v(t))return d}catch(e){g.debug(e)}0==t.size&&(t.mime=g.getMimetype(t.name,t.mime))}return t.options&&(g.optionsByHashes[t.hash]=p(t.options)),delete t.options,c}return d}function t(e,a){st.each(e,function(e,t){var n,i;g.leafRoots[t.hash]&&g.applyLeafRootStats(t),"change"!==a&&t.phash&&g.isRoot(t)&&(n=g.file(t.phash))&&(g.applyLeafRootStats(n),o.changed?(st.each(o.changed,function(e,t){if(t.hash===n.hash)return o.changed[e]=n,!(i=!0)}),i||o.changed.push(n)):o.changed=[n])})}var u,h,f,m,n,i,a,r,s,g=this,v=((a=g.options.fileFilter)&&("function"==typeof a?i=function(e){return a.call(g,e)}:a instanceof RegExp&&(i=function(e){return a.test(e.name)})),i||null),b=[];if(o.customData&&(!g.prevCustomData||JSON.stringify(o.customData)!==JSON.stringify(g.prevCustomData))){g.prevCustomData=o.customData;try{n=JSON.parse(o.customData),st.isPlainObject(n)&&(g.prevCustomData=n,st.each(Object.keys(n),function(e,t){null===n[t]&&(delete n[t],delete g.optsCustomData[t])}),g.customData=Object.assign({},g.optsCustomData,n))}catch(e){}}return o.options&&p(o.options),o.cwd&&(o.cwd.volumeid&&o.options&&Object.keys(o.options).length&&g.isRoot(o.cwd)&&(g.hasVolOptions=!0,g.volOptions[o.cwd.volumeid]=o.options),o.cwd=e(o.cwd,!0,"cwd")),o.files&&(o.files=st.grep(o.files,e)),o.tree&&(o.tree=st.grep(o.tree,e)),o.added&&(o.added=st.grep(o.added,e)),o.changed&&(o.changed=st.grep(o.changed,e)),o.removed&&o.removed.length&&2===g.searchStatus.state&&(o.removed=o.removed.concat((r=o.removed,s=[],st.each(g.files(),function(n,e){st.each(g.parents(n),function(e,t){if(-1!==st.inArray(t,r)&&-1===st.inArray(n,r))return s.push(n),!1})}),s))),o.api&&(o.init=!0),Object.keys(g.leafRoots).length&&(o.files&&t(o.files),o.tree&&t(o.tree),o.added&&t(o.added),o.changed&&t(o.changed,"change")),o.cwd&&o.cwd.options&&o.options&&Object.assign(o.options,p(o.cwd.options)),o.options&&o.options.url&&"/"!==o.options.url.substr(-1)&&(o.options.url+="/"),b.length&&(o.norError=["errResponse"].concat(b)),o},setSort:function(e,t,n,i){this.storage("sortType",this.sortType=this.sortRules[e]?e:"name"),this.storage("sortOrder",this.sortOrder=/asc|desc/.test(t)?t:"asc"),this.storage("sortStickFolders",(this.sortStickFolders=!!n)?1:""),this.storage("sortAlsoTreeview",(this.sortAlsoTreeview=!!i)?1:""),this.trigger("sortchange")},_sortRules:{name:function(e,t){return Me.prototype.naturalCompare(e.i18||e.name,t.i18||t.name)},size:function(e,t){var n=parseInt(e.size)||0,i=parseInt(t.size)||0;return n===i?0:i<n?1:-1},kind:function(e,t){return Me.prototype.naturalCompare(e.mime,t.mime)},date:function(e,t){var n=e.ts||e.date||0,i=t.ts||t.date||0;return n===i?0:i<n?1:-1},perm:function(e,t){function n(e){return(e.write?2:0)+(e.read?1:0)}var i=n(e),a=n(t);return i===a?0:a<i?1:-1},mode:function(e,t){var n=e.mode||e.perm||"",i=t.mode||t.perm||"";return Me.prototype.naturalCompare(n,i)},owner:function(e,t){var n=e.owner||"",i=t.owner||"";return Me.prototype.naturalCompare(n,i)},group:function(e,t){var n=e.group||"",i=t.group||"";return Me.prototype.naturalCompare(n,i)}},sorters:{},naturalCompare:function(e,t){var w=Me.prototype.naturalCompare;return void 0===w.loc&&(w.loc=navigator.userLanguage||navigator.browserLanguage||navigator.language||"en-US"),void 0===w.sort&&(0<"11".localeCompare("2",w.loc,{numeric:!0})?window.Intl&&window.Intl.Collator?w.sort=new Intl.Collator(w.loc,{numeric:!0}).compare:w.sort=function(e,t){return e.localeCompare(t,w.loc,{numeric:!0})}:(w.sort=function(e,t){function n(e){return w.sort.insensitive&&(""+e).toLowerCase()||""+e}var i,a,o,r=/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,s=/(^[ ]*|[ ]*$)/g,l=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=/^0x[0-9a-f]+$/i,d=/^0/,p=/^[\x01\x21-\x2f\x3a-\x40\x5b-\x60\x7b-\x7e]/,u=n(e).replace(s,"").replace(/^_/,"")||"",h=n(t).replace(s,"").replace(/^_/,"")||"",f=u.replace(r,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=h.replace(r,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),g=parseInt(u.match(c))||1!=f.length&&u.match(l)&&Date.parse(u),v=parseInt(h.match(c))||g&&h.match(l)&&Date.parse(h)||null;if(v){if(g<v)return-1;if(v<g)return 1}for(var b=0,y=Math.max(f.length,m.length);b<y;b++){if(i=!(f[b]||"").match(d)&&parseFloat(f[b])||f[b]||0,a=!(m[b]||"").match(d)&&parseFloat(m[b])||m[b]||0,isNaN(i)!==isNaN(a)){if(isNaN(i)&&("string"!=typeof i||!i.match(p)))return 1;if("string"!=typeof a||!a.match(p))return-1}if(0===parseInt(i,10)&&(i=0),0===parseInt(a,10)&&(a=0),typeof i!=typeof a&&(i+="",a+=""),w.sort.insensitive&&"string"==typeof i&&"string"==typeof a&&0!==(o=i.localeCompare(a,w.loc)))return o;if(i<a)return-1;if(a<i)return 1}return 0},w.sort.insensitive=!0)),w.sort(e,t)},compare:function(e,t){var n,i=this.sortType,a="asc"==this.sortOrder,o=this.sortStickFolders,r=this.sortRules,s=r[i],l="directory"==e.mime,c="directory"==t.mime;if(o){if(l&&!c)return-1;if(!l&&c)return 1}return n=a?s(e,t):s(t,e),"name"!==i&&0===n?n=a?r.name(e,t):r.name(t,e):n},sortFiles:function(e){return e.sort(this.compare)},notify:function(e){function t(){function e(){u.remove(),d.children(p.data("minimized")?void 0:":visible").length||(p.data("minimized")?p.data("minimized").hide():d.elfinderdialog("close")),x()}var t=u.find(".elfinder-notify-progress");u._esc&&st(document).off("keydown",u._esc),u.data("cur")<100?t.animate({width:"100%"},50,function(){requestAnimationFrame(function(){e()})}):e()}var n,i,a,o=this,r=e.type,s=e.id?"elfinder-notify-"+e.id:"",l=this.i18n(void 0!==e.msg?e.msg:this.messages["ntf"+r]?"ntf"+r:"ntfsmth"),c=this.arrayFlip(this.options.notifyDialog.hiddens||[]),d=this.ui.notify,p=d.closest(".ui-dialog"),u=d.children(".elfinder-notify-"+r+(s?"."+s:"")),h=u.children("div.elfinder-notify-cancel").children("button"),f='<div class="elfinder-notify elfinder-notify-{type}'+(s?" "+s:"")+'"><span class="elfinder-dialog-icon elfinder-dialog-icon-{type}"></span><span class="elfinder-notify-msg">{msg}</span> <span class="elfinder-notify-cnt"></span><div class="elfinder-notify-progressbar"><div class="elfinder-notify-progress"></div></div><div class="elfinder-notify-cancel"></div></div>',m=e.cnt+0,g=void 0!==e.size?parseInt(e.size):null,v=void 0!==e.progress&&0<=e.progress?e.progress:null,b=e.fakeinterval||200,y=e.cancel,w=function(e){var t;u.length&&(t=u.data("cur")+1)<=98&&(u.find(".elfinder-notify-progress").width(t+"%"),u.data("cur",t),x(),setTimeout(function(){w(e*=1.05)},e))},x=function(){var e,t=0,n=0,i=d.children(".elfinder-notify");i.length?(i.each(function(){t++,n+=Math.min(st(this).data("cur"),100)}),e=t?Math.floor(n/(100*t)*100)+"%":0,o.ui.progressbar.width(e),p.data("minimized")&&(p.data("minimized").title(e),p.data("minimized").dialog().children(".ui-dialog-titlebar").children(".elfinder-ui-progressbar").width(e))):(o.ui.progressbar.width(0),p.data("minimized")&&p.data("minimized").hide())};return r&&(u.length?void 0!==e.msg&&u.children("span.elfinder-notify-msg").html(l):(u=st(f.replace(/\{type\}/g,r).replace(/\{msg\}/g,l)),c[r]?u.hide():d.on("minimize",function(e){p.data("minimized")&&x()}),u.appendTo(d).data("cnt",0),null!=v?u.data({progress:0,total:0,cur:0}):(u.data({cur:0}),w(b)),y&&(h=st('<span class="elfinder-notify-button ui-icon ui-icon-close" title="'+this.i18n("btnCancel")+'"></span>').on("mouseenter mouseleave",function(e){st(this).toggleClass("ui-state-hover","mouseenter"===e.type)}),u.children("div.elfinder-notify-cancel").append(h)),d.trigger("resize")),0<(n=m+parseInt(u.data("cnt")))?(y&&h.length&&(st.isFunction(y)||"object"==typeof y&&y.promise)&&(u._esc=function(e){"keydown"==e.type&&e.keyCode!=st.ui.keyCode.ESCAPE||(e.preventDefault(),e.stopPropagation(),t(),y.promise?y.reject(0):y(e))},h.on("click",function(e){u._esc(e)}),st(document).on("keydown."+this.namespace,u._esc)),e.hideCnt||u.children(".elfinder-notify-cnt").text("("+n+")"),0<m&&d.is(":hidden")&&!c[r]&&(p.data("minimized")?p.data("minimized").show():d.elfinderdialog("open",this).height("auto")),u.data("cnt",n),null!=v&&0<=(i=u.data("total"))&&0<=(a=u.data("progress"))&&(i+=null!=g?g:m,a+=v,null==g&&m<0&&(a+=100*m),u.data({progress:a,total:i}),null!=g&&(a*=100,i=Math.max(1,i)),v=Math.min(parseInt(a/i),100),u.find(".elfinder-notify-progress").animate({width:(v<100?v:100)+"%"},20,function(){u.data("cur",v),x()}))):t()),this},confirm:function(e){var n,i,a=this,o=!1,r={cssClass:"elfinder-dialog-confirm",modal:!0,resizable:!1,title:this.i18n(e.title||"confirmReq"),buttons:{},close:function(){o||e.cancel.callback(),st(this).elfinderdialog("destroy")}},t=this.i18n("apllyAll");return e.cssClass&&(r.cssClass+=" "+e.cssClass),r.buttons[this.i18n(e.accept.label)]=function(){e.accept.callback(!(!n||!n.prop("checked"))),o=!0,st(this).elfinderdialog("close")},r.buttons[this.i18n(e.accept.label)]._cssClass="elfinder-confirm-accept",e.reject&&(r.buttons[this.i18n(e.reject.label)]=function(){e.reject.callback(!(!n||!n.prop("checked"))),o=!0,st(this).elfinderdialog("close")},r.buttons[this.i18n(e.reject.label)]._cssClass="elfinder-confirm-reject"),e.buttons&&0<e.buttons.length&&(i=1,st.each(e.buttons,function(e,t){r.buttons[a.i18n(t.label)]=function(){t.callback(!(!n||!n.prop("checked"))),o=!0,st(this).elfinderdialog("close")},r.buttons[a.i18n(t.label)]._cssClass="elfinder-confirm-extbtn"+i++,t.cssClass&&(r.buttons[a.i18n(t.label)]._cssClass+=" "+t.cssClass)})),r.buttons[this.i18n(e.cancel.label)]=function(){st(this).elfinderdialog("close")},r.buttons[this.i18n(e.cancel.label)]._cssClass="elfinder-confirm-cancel",e.all&&(r.create=function(){var e=st('<div class="elfinder-dialog-confirm-applyall"></div>');n=st('<input type="checkbox" />'),st(this).next().find(".ui-dialog-buttonset").prepend(e.append(st("<label>"+t+"</label>").prepend(n)))}),e.optionsCallback&&st.isFunction(e.optionsCallback)&&e.optionsCallback(r),this.dialog('<span class="elfinder-dialog-icon elfinder-dialog-icon-confirm"></span>'+this.i18n(e.text),r)},uniqueName:function(e,t,n){var i,a,o=0,r="";if(e=this.i18n(!1,e),t=t||this.cwd().hash,n=void 0===n?" ":n,(i=e.match(/^(.+)(\.[^.]+)$/))&&(r=i[2],e=i[1]),a=e+r,!this.fileByName(a,t))return a;for(;o<1e4;)if(a=e+n+ ++o+r,!this.fileByName(a,t))return a;return e+Math.random()+r},i18n:function(){function e(e){var t;return 0===e.indexOf("#")&&(t=r.file(e.substr(1)))?t.name:e}var i,t,n,a,o,r=this,s=this.messages,l=[],c=[],d=0;for(arguments.length&&!1===arguments[0]&&(a=function(e){return e},d=1),i=d;i<arguments.length;i++)if(n=arguments[i],Array.isArray(n))for(t=0;t<n.length;t++)n[t]instanceof jQuery?l.push(n[t]):void 0!==n[t]&&l.push(e(""+n[t]));else n instanceof jQuery?l.push(n[t]):void 0!==n&&l.push(e(""+n));for(i=0;i<l.length;i++)-1===st.inArray(i,c)&&(n="string"==typeof(n=l[i])?(o=!(!s[n]||!n.match(/^err/)),(n=s[n]||(a?a(n):r.escape(n))).replace(/\$(\d+)/g,function(e,t){var n;return 0<(t=i+parseInt(t))&&l[t]&&c.push(t),n=a?a(l[t]):r.escape(l[t]),o&&(n='<span class="elfinder-err-var elfinder-err-var'+t+'">'+n+"</span>"),n})):n.get(0).outerHTML,l[i]=n);return st.grep(l,function(e,t){return-1===st.inArray(t,c)}).join("<br>")},getIconStyle:function(n,i){var a=this,o="",r={},s=0;return n.icon&&(o='style="',st.each({background:"url('{url}') 0 0 no-repeat","background-size":"contain"},function(e,t){0==s++&&(t=t.replace("{url}",a.escape(n.icon))),i?r[e]=t:o+=e+":"+t+";"}),o+='"'),i?r:o},mime2class:function(e){var t="elfinder-cwd-icon-",n=e.toLowerCase(),i=this.textMimes[n],n=n.split("/");return i?n[0]+=" "+t+"text":n[1]&&n[1].match(/\+xml$/)&&(n[0]+=" "+t+"xml"),t+n[0]+(n[1]?" "+t+n[1].replace(/(\.|\+)/g,"-"):"")},mime2kind:function(e){var t,n="object"==typeof e,i=n?e.mime:e;return n&&e.alias&&"symlink-broken"!=i?t="Alias":this.kinds[i]&&(t=!n||"directory"!==i||e.phash&&!e.isroot?this.kinds[i]:"Root"),t=t||(0===i.indexOf("text")?"Text":0===i.indexOf("image")?"Image":0===i.indexOf("audio")?"Audio":0===i.indexOf("video")?"Video":0===i.indexOf("application")?"App":i),this.messages["kind"+t]?this.i18n("kind"+t):i},mimeIsText:function(e){return!!(this.textMimes[e.toLowerCase()]||0===e.indexOf("text/")&&"rtf"!==e.substr(5,3)||e.match(/^application\/.+\+xml$/))},date:function(e,t){var n,i,a,o,r,s,l,c,d=this;return t=t||new Date,r=t[d.getHours](),s=12<r?r-12:r,l=t[d.getMinutes](),c=t[d.getSeconds](),n=t[d.getDate](),i=t[d.getDay](),a=t[d.getMonth]()+1,o=t[d.getFullYear](),e.replace(/[a-z]/gi,function(e){switch(e){case"d":return 9<n?n:"0"+n;case"j":return n;case"D":return d.i18n(d.i18.daysShort[i]);case"l":return d.i18n(d.i18.days[i]);case"m":return 9<a?a:"0"+a;case"n":return a;case"M":return d.i18n(d.i18.monthsShort[a-1]);case"F":return d.i18n(d.i18.months[a-1]);case"Y":return o;case"y":return(""+o).substr(2);case"H":return 9<r?r:"0"+r;case"G":return r;case"g":return s;case"h":return 9<s?s:"0"+s;case"a":return 12<=r?"pm":"am";case"A":return 12<=r?"PM":"AM";case"i":return 9<l?l:"0"+l;case"s":return 9<c?c:"0"+c}return e})},formatDate:function(e,t){var n,i,a,o=this,r=t||e.ts;o.i18;return o.options.clientFormatDate&&0<r?(n=new Date(1e3*r),i=r>=this.yesterday?this.fancyFormat:this.dateFormat,a=o.date(i,n),r>=this.yesterday?a.replace("$1",this.i18n(r>=this.today?"Today":"Yesterday")):a):e.date?e.date.replace(/([a-z]+)\s/i,function(e,t){return o.i18n(t)+" "}):o.i18n("dateUnknown")},toLocaleString:function(e){var t=new Number(e);return t?t.toLocaleString?t.toLocaleString():String(e).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"):e},perms2class:function(e){var t="";return e.read||e.write?e.read?e.write||(t="elfinder-ro"):t="elfinder-wo":t="elfinder-na",e.type&&(t+=" elfinder-"+this.escape(e.type)),t},formatPermissions:function(e){var t=[];return e.read&&t.push(this.i18n("read")),e.write&&t.push(this.i18n("write")),t.length?t.join(" "+this.i18n("and")+" "):this.i18n("noaccess")},formatSize:function(e){var t=1,n="b";return"unknown"==e?this.i18n("unknown"):(1073741824<e?(t=1073741824,n="GB"):1048576<e?(t=1048576,n="MB"):1024<e&&(t=1024,n="KB"),(0<(e/=t)?1048576<=t?e.toFixed(2):Math.round(e):0)+" "+n)},formatFileMode:function(e,t){var n,i,a,o,r,s,l,c;if(t=t||this.options.fileModeStyle.toLowerCase(),(e=st.trim(e)).match(/[rwxs-]{9}$/i)){if(l=e=e.substr(-9),"string"==t)return l;for(c="",n=a=0;n<7;n+=3)o=0,(i=e.substr(n,3)).match(/[r]/i)&&(o+=4),i.match(/[w]/i)&&(o+=2),i.match(/[xs]/i)&&(i.match(/[xs]/)&&(o+=1),i.match(/[s]/i)&&(0==n?a+=4:3==n&&(a+=2))),c+=o.toString(8);a&&(c=a.toString(8)+c)}else{if(c=(e=parseInt(e,8))?e.toString(8):"",!e||"octal"==t)return c;for(a=0,3<(i=e.toString(8)).length&&(i=i.substr(-4),a=parseInt(i.substr(0,1),8),i=i.substr(1)),s=2==(2&a),r=4==(4&a),l="",n=0;n<3;n++)4==(4&parseInt(i.substr(n,1),8))?l+="r":l+="-",2==(2&parseInt(i.substr(n,1),8))?l+="w":l+="-",1==(1&parseInt(i.substr(n,1),8))?l+=0==n&&r||1==n&&s?"s":"x":l+="-"}return"both"==t?l+" ("+c+")":"string"==t?l:c},registRawStringDecoder:function(e){st.isFunction(e)&&(this.decodeRawString=this.options.rawStringDecoder=e)},uploadMimeCheck:function(i,e){e=e||this.cwd().hash;function t(e){var n=!1;return"string"==typeof e&&"all"===e.toLowerCase()?n=!0:Array.isArray(e)&&e.length&&st.each(e,function(e,t){if("all"===(t=t.toLowerCase())||0===i.indexOf(t))return!(n=!0)}),n}var n,a,o=!0,r=this.option("uploadMime",e);return i&&st.isPlainObject(r)&&(i=i.toLowerCase(),n=t(r.allow),a=t(r.deny),"allow"===r.firstOrder?o=!a&&!0===n:(o=!0)!==a||n||(o=!1)),o},sequence:function(n){var e=n.length,i=function(e,t){return n[++t]?i(e.then(n[t]),t):e};return 1<e?i(n[0](),0):n[0]()},reloadContents:function(n){var t,i=st.Deferred();try{t=st('<iframe width="1" height="1" scrolling="no" frameborder="no" style="position:absolute; top:-1px; left:-1px" crossorigin="use-credentials">').attr("src",n).one("load",function(){var t=st(this);try{this.contentDocument.location.reload(!0),t.one("load",function(){t.remove(),i.resolve()})}catch(e){t.attr("src","").attr("src",n).one("load",function(){t.remove(),i.resolve()})}}).appendTo("body")}catch(e){t&&t.remove(),i.reject()}return i},makeNetmountOptionOauth:function(d,e,p,t){var r,n="boolean"==typeof t?t:null,u=Object.assign({noOffline:!1,root:"root",pathI18n:"folderId",folders:!0},null===n?t||{}:{noOffline:n}),h=function(a,e,t){var n,o=this,i=Object.keys(st.isPlainObject(t)?t:{}).length;e.next().remove(),i&&(n=st('<select class="ui-corner-all elfinder-tabstop" style="max-width:200px;">').append(st(st.map(t,function(e,t){return'<option value="'+a.escape((t+"").trim())+'">'+a.escape(e)+"</option>"}).join(""))).on("change click",function(e){var t,n=st(this),i=n.val();o.inputs.path.val(i),!u.folders||"change"!==e.type&&n.data("current")===i||(n.next().remove(),n.data("current",i),i!=u.root&&(t=s(),r&&"pending"===r.state()&&a.abortXHR(r,{quiet:!0,abort:!0}),n.after(t),r=a.request({data:{cmd:"netmount",protocol:d,host:p,user:"init",path:i,pass:"folders"},preventDefault:!0}).done(function(e){h.call(o,a,n,e.folders)}).always(function(){a.abortXHR(r,{quiet:!0}),t.remove()}).xhr))}),e.after(st("<div></div>").append(n)).closest(".ui-dialog").trigger("tabstopsInit"),n.trigger("focus"))},s=function(){return st('<div class="elfinder-netmount-spinner"></div>').append('<span class="elfinder-spinner"></span>')};return{vars:{},name:e,inputs:{offline:st('<input type="checkbox"/>').on("change",function(){st(this).parents("table.elfinder-netmount-tb").find("select:first").trigger("change","reset")}),host:st('<span><span class="elfinder-spinner"></span></span><input type="hidden"/>'),path:st('<input type="text" value="'+u.root+'"/>'),user:st('<input type="hidden"/>'),pass:st('<input type="hidden"/>'),mnt2res:st('<input type="hidden"/>')},select:function(n,e,t){var i=this.inputs,a=i.offline,o=st(i.host[0]),r=t||null;this.vars.mbtn=i.host.closest(".ui-dialog").children(".ui-dialog-buttonpane:first").find("button.elfinder-btncnt-0"),o.data("inrequest")||!o.find("span.elfinder-spinner").length&&"reset"!==r&&("winfocus"!==r||o.siblings("span.elfinder-button-icon-reload").length)?(a.closest("tr")[u.noOffline||i.user.val()?"hide":"show"](),o.data("funcexpup")&&o.data("funcexpup")()):(1===a.parent().children().length&&(i.path.parent().prev().html(n.i18n(u.pathI18n)),a.attr("title",n.i18n("offlineAccess")),a.uniqueId().after(st("<label></label>").attr("for",a.attr("id")).html(" "+n.i18n("offlineAccess")))),o.data("inrequest",!0).empty().addClass("elfinder-spinner").parent().find("span.elfinder-button-icon").remove(),n.request({data:{cmd:"netmount",protocol:d,host:p,user:"init",options:{id:n.id,offline:a.prop("checked")?1:0,pass:i.host[1].value}},preventDefault:!0}).done(function(e){o.removeClass("elfinder-spinner").html(e.body.replace(/\{msg:([^}]+)\}/g,function(e,t){return n.i18n(t,p)}))}),u.noOffline&&a.closest("tr").hide()),this.vars.mbtn[st(i.host[1]).val()?"show":"hide"]()},done:function(t,e){var n,i=this.inputs,a=this.protocol,o=st(i.host[0]),r=st(i.host[1]),s=" ",l=this.vars,c=function(){l.oauthW&&!document.hasFocus()&&--l.chkCnt&&(a.trigger("change","winfocus"),l.tm=setTimeout(c,3e3))};if(u.noOffline&&i.offline.closest("tr").hide(),"makebtn"==e.mode)o.removeClass("elfinder-spinner").removeData("expires").removeData("funcexpup"),n=i.host.find("input").on("mouseenter mouseleave",function(){st(this).toggleClass("ui-state-hover")}),e.url&&n.on("click",function(){l.tm&&clearTimeout(l.tm),l.oauthW=window.open(e.url),(t.UA.iOS||t.UA.Mac)&&t.isCORS&&!l.chkdone&&(l.chkCnt=60,l.tm=setTimeout(c,5e3))}),r.val(""),i.path.val(u.root).next().remove(),i.user.val(""),i.pass.val(""),u.noOffline||i.offline.closest("tr").show(),l.mbtn.hide();else if("folders"==e.mode)e.folders&&h.call(this,t,i.path.nextAll(":last"),e.folders);else{if(l.oauthW&&(l.tm&&clearTimeout(l.tm),l.oauthW.close(),delete l.oauthW,l.chkdone=!0),e.expires&&(s="()",o.data("expires",e.expires)),o.html(p+s).removeClass("elfinder-spinner"),e.expires&&(o.data("funcexpup",function(){var e=Math.floor((o.data("expires")-new Date/1e3)/60);e<3?o.parent().children(".elfinder-button-icon-reload").click():(o.text(o.text().replace(/\(.*\)/,"("+t.i18n(["minsLeft",e])+")")),setTimeout(function(){o.is(":visible")&&o.data("funcexpup")()},6e4))}),o.data("funcexpup")()),e.reset)return void a.trigger("change","reset");o.parent().append(st('<span class="elfinder-button-icon elfinder-button-icon-reload" title="'+t.i18n("reAuth")+'">').on("click",function(){r.val("reauth"),a.trigger("change","reset")})),r.val(d),l.mbtn.show(),e.folders&&h.call(this,t,i.path,e.folders),e.mnt2res&&i.mnt2res.val("1"),i.user.val("done"),i.pass.val("done"),i.offline.closest("tr").hide()}o.removeData("inrequest")},fail:function(e,t){st(this.inputs.host[0]).removeData("inrequest"),this.protocol.trigger("change","reset")},integrateInfo:u.integrate}},findCwdNodes:function(e,n){var i=this,a=(this.getUI("cwd"),this.cwd().hash),o=st();return n=n||{},st.each(e,function(e,t){if((t.phash===a||1<i.searchStatus.state)&&(o=o.add(i.cwdHash2Elm(t.hash)),n.firstOnly))return!1}),o},convAbsUrl:function(e){if(e.match(/^http/i))return e;if("//"===e.substr(0,2))return window.location.protocol+e;var t=window.location.protocol+"//"+window.location.host,n=/[^\/]+\/\.\.\//,i="/"===e.substr(0,1)?t+e:t+window.location.pathname.replace(/\/[^\/]+$/,"/")+e;for(i=i.replace("/./","/");n.test(i);)i=i.replace(n,"");return i},isSameOrigin:function(e){var t;if(e=this.convAbsUrl(e),location.origin&&window.URL)try{return t=new URL(e),location.origin===t.origin}catch(e){}return(t=document.createElement("a")).href=e,location.protocol===t.protocol&&location.host===t.host&&location.port&&t.port},navHash2Id:function(e){return this.navPrefix+e},navId2Hash:function(e){return"string"==typeof e&&e.substr(this.navPrefix.length)},cwdHash2Id:function(e){return this.cwdPrefix+e},cwdId2Hash:function(e){return"string"==typeof e&&e.substr(this.cwdPrefix.length)},navHash2Elm:function(e){return st(document.getElementById(this.navHash2Id(e)))},cwdHash2Elm:function(e){return st(document.getElementById(this.cwdHash2Id(e)))},isInWindow:function(e,t){var n,i;return!!(n=e.get(0))&&(!(!t&&null===n.offsetParent)&&(i=n.getBoundingClientRect(),!!document.elementFromPoint(i.left,i.top)))},zIndexCalc:function(){var i=this,e=this.getUI(),t=e.css("z-index");t&&"auto"!==t&&"inherit"!==t?i.zIndex=t:e.parents().each(function(e,t){var n=st(t).css("z-index");if("auto"!==n&&"inherit"!==n&&(n=parseInt(n)))return i.zIndex=n,!1})},loadScript:function(i,a,o,r){var s,l,e={dataType:"script",cache:!0},c={},d={};return(o=o||{}).tryRequire&&this.hasRequire?require(i,a,o.error):(s=function(){var e,t,n;st.each(d,function(e,t){if("success"!==t&&"notmodified"!==t)return!(n=!0)}),n?o.error&&st.isFunction(o.error)&&o.error({loadResults:d}):st.isFunction(a)&&(r&&void 0===r.obj[r.name]?(e=r.timeout?r.timeout/10:1,t=setInterval(function(){(--e<0||void 0!==r.obj[r.name])&&(clearInterval(t),a())},10)):a())},"tag"===o.loadType?(st("head > script").each(function(){c[this.src]=this}),l=i.length,st.each(i,function(t,e){var n,i=!1;c[e]?(d[t]=c[e]._error||"success",--l<1&&s()):((n=document.createElement("script")).charset=o.charset||"UTF-8",st("head").append(n),n.onload=n.onreadystatechange=function(){i||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(i=!0,d[t]="success",--l<1&&s())},n.onerror=function(e){d[t]=n._error=e&&e.type?e.type:"error",--l<1&&s()},n.src=e)})):(o=st.isPlainObject(o)?Object.assign(e,o):e,l=0,function e(t,n){void 0!==t&&(d[l++]=n),i.length?st.ajax(Object.assign({},o,{url:i.shift(),success:e,error:e})):s()}())),this},loadCss:function(e,t){var i,a,o=this;return"string"==typeof e&&(e=[e]),t&&(t.className&&(i=t.className),t.dfd&&t.dfd.promise&&(a=[])),st.each(e,function(e,t){var n;t=o.convAbsUrl(t).replace(/^https?:/i,""),a&&(a[e]=st.Deferred()),st('head > link[href="'+o.escape(t)+'"]').length?a&&a[e].resolve():((n=document.createElement("link")).type="text/css",n.rel="stylesheet",n.href=t,i&&(n.className=i),a&&(n.onload=function(){a[e].resolve()},n.onerror=function(){a[e].reject()}),st("head").append(n))}),a&&st.when.apply(null,a).done(function(){t.dfd.resolve()}).fail(function(){t.dfd.reject()}),this},asyncJob:function(i,e,t){var a,o,r,s=st.Deferred(),l=!1,c=Object.assign({interval:0,numPerOnce:1},t||{}),d=[],p=[];return s._abort=function(e){r&&clearTimeout(r),p=[],l=!0,"pending"===s.state()&&s[e?"resolve":"reject"](d)},s.fail(function(){s._abort()}).always(function(){s._abort=function(){}}),"function"==typeof i&&Array.isArray(e)?(p=e.concat(),o=function(){var e,t,n;if(!l){for(t=(a=p.splice(0,c.numPerOnce)).length,e=0;e<t&&!l;e++)null!==(n=i(a[e]))&&d.push(n);l||(p.length?r=setTimeout(o,c.interval):s.resolve(d))}},p.length?r=setTimeout(o,0):s.resolve(d)):s.reject(),s},getSize:function(a){var o,r,p=this,s=[],u=a.length,h=st.Deferred().fail(function(){st.each(s,function(e,t){t&&(t.syncOnFail&&t.syncOnFail(!1),t.reject())})});return p.autoSync("stop"),o=st.Deferred(),0<(r=Object.keys(p.leafRoots).length)?st.each(p.leafRoots,function(e){var t,n,i,a;t=e,n=st.Deferred(),i=p.file(t),(a=i?i.phash:t)&&!p.file(a)?p.request({data:{cmd:"parents",target:a},preventFail:!0}).done(function(){p.one("parentsdone",function(){n.resolve()})}).fail(function(){n.resolve()}):n.resolve(),n.done(function(){--r<1&&o.resolve()})}):o.resolve(),o.done(function(){var e=[],n={},t=[],i=[],d={};st.each(a,function(){var i,a;e.push.apply(e,(i=p.file(this),a=[],"directory"===i.mime&&st.each(p.leafRoots,function(e,t){var n;if(e===i.hash)a.push.apply(a,t);else for(n=(p.file(e)||{}).phash;n;)n===i.hash&&a.push.apply(a,t),n=(p.file(n)||{}).phash}),a))}),a.push.apply(a,e),st.each(a,function(){var e=p.root(this),t=p.file(this);t&&(t.sizeInfo||"directory"!==t.mime)?i.push(st.Deferred().resolve(t.sizeInfo?t.sizeInfo:{size:t.size,dirCnt:0,fileCnt:1})):n[e]?n[e].push(this.toString()):n[e]=[this.toString()]}),st.each(n,function(){var e=t.length;1===this.length&&(d[e]=this[0]),t.push(p.request({data:{cmd:"size",targets:this},preventDefault:!0}))}),s.push.apply(s,t),t.push.apply(t,i),st.when.apply(st,t).fail(function(){h.reject()}).done(function(){function n(e,t){var n;(n=p.file(e))&&(n.sizeInfo={isCache:!0},st.each(["size","dirCnt","fileCnt"],function(){n.sizeInfo[this]=t[this]||0}),n.size=parseInt(n.sizeInfo.size),l.push(n))}for(var e,t=0,i=0,a=0,o=arguments.length,r=[],s="",l=[],c=0;c<o;c++)(e=arguments[c]).isCache||(d[c]&&p.file(d[c])?n(d[c],e):e.sizes&&st.isPlainObject(e.sizes)&&st.each(e.sizes,function(e,t){n(e,t)})),t+=parseInt(e.size),!1!==i&&(void 0===e.fileCnt?i=!1:i+=parseInt(e.fileCnt||0)),!1!==a&&(void 0===e.dirCnt?a=!1:a+=parseInt(e.dirCnt||0));l.length&&p.change({changed:l}),!1!==a&&r.push(p.i18n("folders")+": "+(a-(1<u?0:1))),!1!==i&&r.push(p.i18n("files")+": "+i),r.length&&(s="<br>"+r.join(", ")),h.resolve({size:t,fileCnt:i,dirCnt:a,formated:(0<=t?p.formatSize(t):p.i18n("unknown"))+s})}),p.autoSync()}),h},wkObjUrl:null,getWorker:function(e){var t;try{this.wkObjUrl||(this.wkObjUrl=(window.URL||window.webkitURL).createObjectURL(new Blob([function(){self.onmessage=function(e){var t=e.data;try{if(self.data=t.data,t.scripts)for(var n=0;n<t.scripts.length;n++)importScripts(t.scripts[n]);self.postMessage(self.res)}catch(e){self.postMessage({error:e.toString()})}}}.toString().replace(/\s+/g," ").replace(/ *([^\w]) */g,"$1").replace(/^function\b.+?\{|\}$/g,"")],{type:"text/javascript"}))),t=new Worker(this.wkObjUrl,e)}catch(e){this.debug("error",e.toString())}return t},getWorkerUrl:function(e){return this.convAbsUrl(this.baseUrl+"js/worker/"+e)},getTheme:function(t){var n,i,a=this,o=st.Deferred(),r=function(e,t){return t=t||a.convAbsUrl(a.baseUrl),Array.isArray(e)?st.map(e,function(e){return r(e,t)}):e.match(/^(?:http|\/\/)/i)?e:t+e.replace(/^(?:\.\/|\/)/,"")};return t&&(n=a.options.themes[t])?"string"==typeof n?(url=r(n),(i=url.match(/^(.+\/)[^/]+\.json$/i))?st.getJSON(url).done(function(e){(n=e).id=t,n.cssurls&&(n.cssurls=r(n.cssurls,i[1])),o.resolve(n)}).fail(function(){o.reject()}):o.resolve({id:t,name:t,cssurls:[url]})):st.isPlainObject(n)&&n.cssurls?(n.id=t,n.cssurls=r(n.cssurls),Array.isArray(n.cssurls)||(n.cssurls=[n.cssurls]),n.name||(n.name=t),o.resolve(n)):o.reject():o.reject(),o},changeTheme:function(e){var t=this;return e&&(!t.options.themes[e]||t.theme&&t.theme.id===e?"default"===e&&t.theme&&"default"!==t.theme.id&&(st("head>link.elfinder-theme-ext").remove(),t.theme=null,t.trigger&&t.trigger("themechange")):t.getTheme(e).done(function(e){e.cssurls&&(st("head>link.elfinder-theme-ext").remove(),t.loadCss(e.cssurls,{className:"elfinder-theme-ext",dfd:st.Deferred().done(function(){t.theme=e,t.trigger&&t.trigger("themechange")})}))})),this},applyLeafRootStats:function(t,e){var n=this,i=!e&&n.file(t.hash)||t,a=i.ts,o=!1;return!e&&t._realStats||(t._realStats={locked:t.locked||0,dirs:t.dirs||0,ts:t.ts}),t.locked=1,i.locked||(o=!0),t.dirs=1,i.dirs||(o=!0),st.each(n.leafRoots[t.hash],function(){var e=n.file(this);e&&e.ts&&(t.ts||0)<e.ts&&(t.ts=e.ts)}),a!==t.ts&&(o=!0),o},abortXHR:function(e,t){var n=t||{};e&&(n.quiet&&(e.quiet=!0),n.abort&&e._requestId&&this.request({data:{cmd:"abort",id:e._requestId},preventDefault:!0}),e.abort(),e=void 0)},setCustomHeaderByXhr:function(i){var a=this;i.getResponseHeader&&a.parrotHeaders&&a.parrotHeaders.length&&st.each(a.parrotHeaders,function(e,t){var n=i.getResponseHeader(t);n?(a.customHeaders[t]=n,a.sessionStorage("core-ph:"+t,n)):"string"==typeof n&&(delete a.customHeaders[t],a.sessionStorage("core-ph:"+t,null))})},hasParrotHeaders:function(){var e=!1,t=this.parrotHeaders;if(Object.keys(this.customHeaders).length)for(var n=0;n<t.length;n++)if(this.customHeaders[t[n]]){e=!0;break}return e},getRequestId:function(){return(+new Date).toString(16)+Math.floor(1e3*Math.random()).toString(16)},arrayFlip:function(e,t){var n,i={},a=st.isArray(e);for(n in e)(a||e.hasOwnProperty(n))&&(i[e[n]]=t||n);return i},splitFileExtention:function(e){var t;return(t=e.match(/^(.+?)?\.((?:tar\.(?:gz|bz|bz2|z|lzo))|cpio\.gz|ps\.gz|xcf\.(?:gz|bz2)|[a-z0-9]{1,10})$/i))?(void 0===t[1]&&(t[1]=""),[t[1],t[2]]):[e,""]},sliceArrayBuffer:function(e,t){for(var n=[],i=0;i*t<e.byteLength;)n.push(e.slice(i*t,(i+1)*t)),i++;return n},arrayBufferToBase64:function(e){if(!window.btoa)return"";var t=new Uint8Array(e),n=Array.prototype.slice.call(t).map(function(e){return String.fromCharCode(e)});return window.btoa(n.join(""))},log:function(e){return window.console&&window.console.log&&window.console.log(e),this},debug:function(e,t){var n,i,a=this,o=this.options.debug,r=this.options.toastBackendWarn;return"backend-error"===e?this.cwd().hash&&(!o||"all"!==o&&!o["backend-error"])||(t=Array.isArray(t)?t:[t],this.error(t)):"backend-warning"===e?(i=!0,r&&(n=st.isPlainObject(r)?r:{},st.each(Array.isArray(t)?t:[t],function(e,t){a.toast(Object.assign({mode:"warning",msg:t},n))}))):"backend-debug"===e&&this.trigger("backenddebug",t),(i||o&&("all"===o||o[e]))&&window.console&&window.console.log&&window.console.log("elfinder debug: ["+e+"] ["+this.id+"]",t),this},responseDebug:function(e){var t,n=e.debug;n&&((t=this.options.debug)&&"all"===t||((t=t||(this.options.debug={}))["backend-error"]=!0,t.warning=!0),n.mountErrors&&("string"==typeof n.mountErrors||Array.isArray(n.mountErrors)&&n.mountErrors.length)&&this.debug("backend-error",n.mountErrors),n.backendErrors&&("string"==typeof n.backendErrors||Array.isArray(n.backendErrors)&&n.backendErrors.length)&&this.debug("backend-warning",n.backendErrors))},time:function(e){window.console&&window.console.time&&window.console.time(e)},timeEnd:function(e){window.console&&window.console.timeEnd&&window.console.timeEnd(e)}},Object.keys||(Object.keys=(l=Object.prototype.hasOwnProperty,c=!{toString:null}.propertyIsEnumerable("toString"),p=(d=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length,function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on non-object");var t,n=[];for(t in e)l.call(e,t)&&n.push(t);if(c)for(var i=0;i<p;i++)l.call(e,d[i])&&n.push(d[i]);return n})),Array.isArray||(Array.isArray=function(e){return jQuery.isArray(e)}),Object.assign||(Object.assign=function(){return jQuery.extend.apply(null,arguments)}),String.prototype.repeat||(String.prototype.repeat=function(e){"use strict";if(null==this)throw new TypeError("can't convert "+this+" to object");var t=""+this;if((e=+e)!=e&&(e=0),e<0)throw new RangeError("repeat count must be non-negative");if(e==1/0)throw new RangeError("repeat count must be less than infinity");if(e=Math.floor(e),0==t.length||0==e)return"";if(1<<28<=t.length*e)throw new RangeError("repeat count must not overflow maximum string size");for(var n="",i=0;i<e;i++)n+=t;return n}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),function(){try{return Array.apply(null,{})}catch(e){}var n=Object.prototype.toString,i=Function.prototype.apply,a=Array.prototype.slice;Function.prototype.apply=function(e,t){return i.call(this,e,"[object Array]"===n.call(t)?t:a.call(t))}}(),Array.from||(Array.from=function(e){return 1===e.length?[e[0]]:Array.apply(null,e)}),window.cancelAnimationFrame||function(){for(var o=0,e=["ms","moz","webkit","o"],t=0;t<e.length&&!window.requestAnimationFrame;++t)window.requestAnimationFrame=window[e[t]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[t]+"CancelAnimationFrame"]||window[e[t]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e,t){var n=(new Date).getTime(),i=Math.max(0,16-(n-o)),a=window.setTimeout(function(){e(n+i)},i);return o=n+i,a}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){clearTimeout(e)})}(),Me.prototype.version="2.1.57",st.ui&&st.ui.ddmanager&&(u=st.ui.ddmanager.prepareOffsets,st.ui.ddmanager.prepareOffsets=function(e,t){if("mousedown"===t.type||e.options.elfRefresh)for(var n,i=st.ui.ddmanager.droppables[e.options.scope]||[],a=i.length,o=0;o<a;o++)(n=i[o]).options.autoDisable&&(!n.options.disabled||1<n.options.autoDisable)&&(n.options.disabled=function(e){if(e.is(":hidden"))return!0;var t=e[0].getBoundingClientRect();return!document.elementFromPoint(t.left,t.top)&&!document.elementFromPoint(t.left+t.width,t.top+t.height)}(n.element),n.options.autoDisable=n.options.disabled?2:1);return u(e,t)}),window.jQuery.ajaxTransport("+binary",function(o,e,t){var r;if(window.FormData&&(o.dataType&&"binary"==o.dataType||o.data&&(window.ArrayBuffer&&o.data instanceof ArrayBuffer||window.Blob&&o.data instanceof Blob)))return{send:function(e,n){var t,i=o.responseType||"blob",a=o.xhr();if(a.open(o.type,o.url,o.async,o.username,o.password),o.xhrFields)for(t in o.xhrFields)a[t]=o.xhrFields[t];for(t in o.mimeType&&a.overrideMimeType&&a.overrideMimeType(o.mimeType),o.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)a.setRequestHeader(t,e[t]);r=function(t){return function(){var e;r&&(r=a.onload=a.onerror=a.onabort=a.ontimeout=null,"abort"===t?a.abort():"error"===t?n(a.status,a.statusText):((e={})[o.dataType]=a.response,n(a.status,a.statusText,e,a.getAllResponseHeaders())))}},a.onload=r(),a.onabort=a.onerror=a.ontimeout=r("error"),r=r("abort");try{a.responseType=i,a.send(o.data||null)}catch(e){if(r)throw e}},abort:function(){r&&r()}}}),(h=jQuery).support.touch="ontouchend"in document,h.support.touch&&(f=h.ui.mouse.prototype,m=f._mouseInit,g=f._mouseDestroy,f._touchStart=function(e){!v&&this._mouseCapture(e.originalEvent.changedTouches[0])&&(b=e.originalEvent.changedTouches[0].screenX.toFixed(0),y=e.originalEvent.changedTouches[0].screenY.toFixed(0),v=!0,this._touchMoved=!1,C(e,"mouseover"),C(e,"mousemove"),C(e,"mousedown"))},f._touchMove=function(e){var t,n;v&&(t=e.originalEvent.changedTouches[0].screenX.toFixed(0),n=e.originalEvent.changedTouches[0].screenY.toFixed(0),Math.abs(b-t)<=4&&Math.abs(y-n)<=4||(this._touchMoved=!0,C(e,"mousemove")))},f._touchEnd=function(e){v&&(C(e,"mouseup"),C(e,"mouseout"),this._touchMoved||C(e,"click"),v=!1,this._touchMoved=!1)},f._mouseInit=function(){var e=this;e.element.hasClass("touch-punch")&&e.element.on({touchstart:h.proxy(e,"_touchStart"),touchmove:h.proxy(e,"_touchMove"),touchend:h.proxy(e,"_touchEnd")}),m.call(e)},f._mouseDestroy=function(){var e=this;e.element.hasClass("touch-punch")&&e.element.off({touchstart:h.proxy(e,"_touchStart"),touchmove:h.proxy(e,"_touchMove"),touchend:h.proxy(e,"_touchEnd")}),g.call(e)}),st.fn.elfinder=function(a,o){return"instance"===a?this.getElFinder():this.each(function(){var e,t="string"==typeof a?a:"",n="function"==typeof o?o:void 0,i=this.elfinder;if(i)switch(t){case"close":case"hide":i.hide();break;case"open":case"show":i.show();break;case"destroy":i.destroy();break;case"reload":case"restart":i&&(e=st.extend(!0,i.options,st.isPlainObject(o)?o:{}),n=i.bootCallback,i.reloadCallback&&st.isFunction(i.reloadCallback)?i.reloadCallback(e,n):(i.destroy(),new Me(this,e,n)))}else st.isPlainObject(a)&&new Me(this,a,n)})},st.fn.getElFinder=function(){var e;return this.each(function(){if(this.elfinder)return e=this.elfinder,!1}),e},st.fn.elfUiWidgetInstance=function(t){try{return this[t]("instance")}catch(e){var n=this.data("ui-"+t);return n&&"object"==typeof n&&n.widgetFullName==="ui-"+t?n:null}},st.fn.scrollRight||st.fn.extend({scrollRight:function(e){var t=this.get(0);return void 0===e?Math.max(0,t.scrollWidth-(t.scrollLeft+t.clientWidth)):this.scrollLeft(t.scrollWidth-t.clientWidth-e)}}),st.fn.scrollBottom||st.fn.extend({scrollBottom:function(e){var t=this.get(0);return void 0===e?Math.max(0,t.scrollHeight-(t.scrollTop+t.clientHeight)):this.scrollTop(t.scrollHeight-t.clientHeight-e)}}),Me.prototype.mimeTypes={"application/x-executable":"exe","application/x-jar":"jar","application/x-gzip":"gz","application/x-bzip2":"tbz","application/x-rar":"rar","text/x-php":"php","text/javascript":"js","application/rtfd":"rtfd","text/x-python":"py","text/x-ruby":"rb","text/x-shellscript":"sh","text/x-perl":"pl","text/xml":"xml","text/x-csrc":"c","text/x-chdr":"h","text/x-c++src":"cpp","text/x-c++hdr":"hh","text/x-markdown":"md","text/x-yaml":"yml","image/x-ms-bmp":"bmp","image/x-targa":"tga","image/xbm":"xbm","image/pxm":"pxm","audio/wav":"wav","video/x-dv":"dv","video/x-ms-wmv":"wm","video/ogg":"ogm","video/MP2T":"m2ts","application/x-mpegURL":"m3u8","application/dash+xml":"mpd","application/andrew-inset":"ez","application/applixware":"aw","application/atom+xml":"atom","application/atomcat+xml":"atomcat","application/atomsvc+xml":"atomsvc","application/ccxml+xml":"ccxml","application/cdmi-capability":"cdmia","application/cdmi-container":"cdmic","application/cdmi-domain":"cdmid","application/cdmi-object":"cdmio","application/cdmi-queue":"cdmiq","application/cu-seeme":"cu","application/davmount+xml":"davmount","application/docbook+xml":"dbk","application/dssc+der":"dssc","application/dssc+xml":"xdssc","application/ecmascript":"ecma","application/emma+xml":"emma","application/epub+zip":"epub","application/exi":"exi","application/font-tdpfr":"pfr","application/gml+xml":"gml","application/gpx+xml":"gpx","application/gxf":"gxf","application/hyperstudio":"stk","application/inkml+xml":"ink","application/ipfix":"ipfix","application/java-serialized-object":"ser","application/java-vm":"class","application/json":"json","application/jsonml+json":"jsonml","application/lost+xml":"lostxml","application/mac-binhex40":"hqx","application/mac-compactpro":"cpt","application/mads+xml":"mads","application/marc":"mrc","application/marcxml+xml":"mrcx","application/mathematica":"ma","application/mathml+xml":"mathml","application/mbox":"mbox","application/mediaservercontrol+xml":"mscml","application/metalink+xml":"metalink","application/metalink4+xml":"meta4","application/mets+xml":"mets","application/mods+xml":"mods","application/mp21":"m21","application/mp4":"mp4s","application/msword":"doc","application/mxf":"mxf","application/octet-stream":"bin","application/oda":"oda","application/oebps-package+xml":"opf","application/ogg":"ogx","application/omdoc+xml":"omdoc","application/onenote":"onetoc","application/oxps":"oxps","application/patch-ops-error+xml":"xer","application/pdf":"pdf","application/pgp-encrypted":"pgp","application/pgp-signature":"asc","application/pics-rules":"prf","application/pkcs10":"p10","application/pkcs7-mime":"p7m","application/pkcs7-signature":"p7s","application/pkcs8":"p8","application/pkix-attr-cert":"ac","application/pkix-cert":"cer","application/pkix-crl":"crl","application/pkix-pkipath":"pkipath","application/pkixcmp":"pki","application/pls+xml":"pls","application/postscript":"ai","application/prs.cww":"cww","application/pskc+xml":"pskcxml","application/rdf+xml":"rdf","application/reginfo+xml":"rif","application/relax-ng-compact-syntax":"rnc","application/resource-lists+xml":"rl","application/resource-lists-diff+xml":"rld","application/rls-services+xml":"rs","application/rpki-ghostbusters":"gbr","application/rpki-manifest":"mft","application/rpki-roa":"roa","application/rsd+xml":"rsd","application/rss+xml":"rss","application/rtf":"rtf","application/sbml+xml":"sbml","application/scvp-cv-request":"scq","application/scvp-cv-response":"scs","application/scvp-vp-request":"spq","application/scvp-vp-response":"spp","application/sdp":"sdp","application/set-payment-initiation":"setpay","application/set-registration-initiation":"setreg","application/shf+xml":"shf","application/smil+xml":"smi","application/sparql-query":"rq","application/sparql-results+xml":"srx","application/srgs":"gram","application/srgs+xml":"grxml","application/sru+xml":"sru","application/ssdl+xml":"ssdl","application/ssml+xml":"ssml","application/tei+xml":"tei","application/thraud+xml":"tfi","application/timestamped-data":"tsd","application/vnd.3gpp.pic-bw-large":"plb","application/vnd.3gpp.pic-bw-small":"psb","application/vnd.3gpp.pic-bw-var":"pvb","application/vnd.3gpp2.tcap":"tcap","application/vnd.3m.post-it-notes":"pwn","application/vnd.accpac.simply.aso":"aso","application/vnd.accpac.simply.imp":"imp","application/vnd.acucobol":"acu","application/vnd.acucorp":"atc","application/vnd.adobe.air-application-installer-package+zip":"air","application/vnd.adobe.formscentral.fcdt":"fcdt","application/vnd.adobe.fxp":"fxp","application/vnd.adobe.xdp+xml":"xdp","application/vnd.adobe.xfdf":"xfdf","application/vnd.ahead.space":"ahead","application/vnd.airzip.filesecure.azf":"azf","application/vnd.airzip.filesecure.azs":"azs","application/vnd.amazon.ebook":"azw","application/vnd.americandynamics.acc":"acc","application/vnd.amiga.ami":"ami","application/vnd.android.package-archive":"apk","application/vnd.anser-web-certificate-issue-initiation":"cii","application/vnd.anser-web-funds-transfer-initiation":"fti","application/vnd.antix.game-component":"atx","application/vnd.apple.installer+xml":"mpkg","application/vnd.aristanetworks.swi":"swi","application/vnd.astraea-software.iota":"iota","application/vnd.audiograph":"aep","application/vnd.blueice.multipass":"mpm","application/vnd.bmi":"bmi","application/vnd.businessobjects":"rep","application/vnd.chemdraw+xml":"cdxml","application/vnd.chipnuts.karaoke-mmd":"mmd","application/vnd.cinderella":"cdy","application/vnd.claymore":"cla","application/vnd.cloanto.rp9":"rp9","application/vnd.clonk.c4group":"c4g","application/vnd.cluetrust.cartomobile-config":"c11amc","application/vnd.cluetrust.cartomobile-config-pkg":"c11amz","application/vnd.commonspace":"csp","application/vnd.contact.cmsg":"cdbcmsg","application/vnd.cosmocaller":"cmc","application/vnd.crick.clicker":"clkx","application/vnd.crick.clicker.keyboard":"clkk","application/vnd.crick.clicker.palette":"clkp","application/vnd.crick.clicker.template":"clkt","application/vnd.crick.clicker.wordbank":"clkw","application/vnd.criticaltools.wbs+xml":"wbs","application/vnd.ctc-posml":"pml","application/vnd.cups-ppd":"ppd","application/vnd.curl.car":"car","application/vnd.curl.pcurl":"pcurl","application/vnd.dart":"dart","application/vnd.data-vision.rdz":"rdz","application/vnd.dece.data":"uvf","application/vnd.dece.ttml+xml":"uvt","application/vnd.dece.unspecified":"uvx","application/vnd.dece.zip":"uvz","application/vnd.denovo.fcselayout-link":"fe_launch","application/vnd.dna":"dna","application/vnd.dolby.mlp":"mlp","application/vnd.dpgraph":"dpg","application/vnd.dreamfactory":"dfac","application/vnd.ds-keypoint":"kpxx","application/vnd.dvb.ait":"ait","application/vnd.dvb.service":"svc","application/vnd.dynageo":"geo","application/vnd.ecowin.chart":"mag","application/vnd.enliven":"nml","application/vnd.epson.esf":"esf","application/vnd.epson.msf":"msf","application/vnd.epson.quickanime":"qam","application/vnd.epson.salt":"slt","application/vnd.epson.ssf":"ssf","application/vnd.eszigno3+xml":"es3","application/vnd.ezpix-album":"ez2","application/vnd.ezpix-package":"ez3","application/vnd.fdf":"fdf","application/vnd.fdsn.mseed":"mseed","application/vnd.fdsn.seed":"seed","application/vnd.flographit":"gph","application/vnd.fluxtime.clip":"ftc","application/vnd.framemaker":"fm","application/vnd.frogans.fnc":"fnc","application/vnd.frogans.ltf":"ltf","application/vnd.fsc.weblaunch":"fsc","application/vnd.fujitsu.oasys":"oas","application/vnd.fujitsu.oasys2":"oa2","application/vnd.fujitsu.oasys3":"oa3","application/vnd.fujitsu.oasysgp":"fg5","application/vnd.fujitsu.oasysprs":"bh2","application/vnd.fujixerox.ddd":"ddd","application/vnd.fujixerox.docuworks":"xdw","application/vnd.fujixerox.docuworks.binder":"xbd","application/vnd.fuzzysheet":"fzs","application/vnd.genomatix.tuxedo":"txd","application/vnd.geogebra.file":"ggb","application/vnd.geogebra.tool":"ggt","application/vnd.geometry-explorer":"gex","application/vnd.geonext":"gxt","application/vnd.geoplan":"g2w","application/vnd.geospace":"g3w","application/vnd.gmx":"gmx","application/vnd.google-earth.kml+xml":"kml","application/vnd.google-earth.kmz":"kmz","application/vnd.grafeq":"gqf","application/vnd.groove-account":"gac","application/vnd.groove-help":"ghf","application/vnd.groove-identity-message":"gim","application/vnd.groove-injector":"grv","application/vnd.groove-tool-message":"gtm","application/vnd.groove-tool-template":"tpl","application/vnd.groove-vcard":"vcg","application/vnd.hal+xml":"hal","application/vnd.handheld-entertainment+xml":"zmm","application/vnd.hbci":"hbci","application/vnd.hhe.lesson-player":"les","application/vnd.hp-hpgl":"hpgl","application/vnd.hp-hpid":"hpid","application/vnd.hp-hps":"hps","application/vnd.hp-jlyt":"jlt","application/vnd.hp-pcl":"pcl","application/vnd.hp-pclxl":"pclxl","application/vnd.hydrostatix.sof-data":"sfd-hdstx","application/vnd.ibm.minipay":"mpy","application/vnd.ibm.modcap":"afp","application/vnd.ibm.rights-management":"irm","application/vnd.ibm.secure-container":"sc","application/vnd.iccprofile":"icc","application/vnd.igloader":"igl","application/vnd.immervision-ivp":"ivp","application/vnd.immervision-ivu":"ivu","application/vnd.insors.igm":"igm","application/vnd.intercon.formnet":"xpw","application/vnd.intergeo":"i2g","application/vnd.intu.qbo":"qbo","application/vnd.intu.qfx":"qfx","application/vnd.ipunplugged.rcprofile":"rcprofile","application/vnd.irepository.package+xml":"irp","application/vnd.is-xpr":"xpr","application/vnd.isac.fcs":"fcs","application/vnd.jam":"jam","application/vnd.jcp.javame.midlet-rms":"rms","application/vnd.jisp":"jisp","application/vnd.joost.joda-archive":"joda","application/vnd.kahootz":"ktz","application/vnd.kde.karbon":"karbon","application/vnd.kde.kchart":"chrt","application/vnd.kde.kformula":"kfo","application/vnd.kde.kivio":"flw","application/vnd.kde.kontour":"kon","application/vnd.kde.kpresenter":"kpr","application/vnd.kde.kspread":"ksp","application/vnd.kde.kword":"kwd","application/vnd.kenameaapp":"htke","application/vnd.kidspiration":"kia","application/vnd.kinar":"kne","application/vnd.koan":"skp","application/vnd.kodak-descriptor":"sse","application/vnd.las.las+xml":"lasxml","application/vnd.llamagraphics.life-balance.desktop":"lbd","application/vnd.llamagraphics.life-balance.exchange+xml":"lbe","application/vnd.lotus-1-2-3":123,"application/vnd.lotus-approach":"apr","application/vnd.lotus-freelance":"pre","application/vnd.lotus-notes":"nsf","application/vnd.lotus-organizer":"org","application/vnd.lotus-screencam":"scm","application/vnd.lotus-wordpro":"lwp","application/vnd.macports.portpkg":"portpkg","application/vnd.mcd":"mcd","application/vnd.medcalcdata":"mc1","application/vnd.mediastation.cdkey":"cdkey","application/vnd.mfer":"mwf","application/vnd.mfmp":"mfm","application/vnd.micrografx.flo":"flo","application/vnd.micrografx.igx":"igx","application/vnd.mif":"mif","application/vnd.mobius.daf":"daf","application/vnd.mobius.dis":"dis","application/vnd.mobius.mbk":"mbk","application/vnd.mobius.mqy":"mqy","application/vnd.mobius.msl":"msl","application/vnd.mobius.plc":"plc","application/vnd.mobius.txf":"txf","application/vnd.mophun.application":"mpn","application/vnd.mophun.certificate":"mpc","application/vnd.mozilla.xul+xml":"xul","application/vnd.ms-artgalry":"cil","application/vnd.ms-cab-compressed":"cab","application/vnd.ms-excel":"xls","application/vnd.ms-excel.addin.macroenabled.12":"xlam","application/vnd.ms-excel.sheet.binary.macroenabled.12":"xlsb","application/vnd.ms-excel.sheet.macroenabled.12":"xlsm","application/vnd.ms-excel.template.macroenabled.12":"xltm","application/vnd.ms-fontobject":"eot","application/vnd.ms-htmlhelp":"chm","application/vnd.ms-ims":"ims","application/vnd.ms-lrm":"lrm","application/vnd.ms-officetheme":"thmx","application/vnd.ms-pki.seccat":"cat","application/vnd.ms-pki.stl":"stl","application/vnd.ms-powerpoint":"ppt","application/vnd.ms-powerpoint.addin.macroenabled.12":"ppam","application/vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","application/vnd.ms-powerpoint.slide.macroenabled.12":"sldm","application/vnd.ms-powerpoint.slideshow.macroenabled.12":"ppsm","application/vnd.ms-powerpoint.template.macroenabled.12":"potm","application/vnd.ms-project":"mpp","application/vnd.ms-word.document.macroenabled.12":"docm","application/vnd.ms-word.template.macroenabled.12":"dotm","application/vnd.ms-works":"wps","application/vnd.ms-wpl":"wpl","application/vnd.ms-xpsdocument":"xps","application/vnd.mseq":"mseq","application/vnd.musician":"mus","application/vnd.muvee.style":"msty","application/vnd.mynfc":"taglet","application/vnd.neurolanguage.nlu":"nlu","application/vnd.nitf":"ntf","application/vnd.noblenet-directory":"nnd","application/vnd.noblenet-sealer":"nns","application/vnd.noblenet-web":"nnw","application/vnd.nokia.n-gage.data":"ngdat","application/vnd.nokia.n-gage.symbian.install":"n-gage","application/vnd.nokia.radio-preset":"rpst","application/vnd.nokia.radio-presets":"rpss","application/vnd.novadigm.edm":"edm","application/vnd.novadigm.edx":"edx","application/vnd.novadigm.ext":"ext","application/vnd.oasis.opendocument.chart":"odc","application/vnd.oasis.opendocument.chart-template":"otc","application/vnd.oasis.opendocument.database":"odb","application/vnd.oasis.opendocument.formula":"odf","application/vnd.oasis.opendocument.formula-template":"odft","application/vnd.oasis.opendocument.graphics":"odg","application/vnd.oasis.opendocument.graphics-template":"otg","application/vnd.oasis.opendocument.image":"odi","application/vnd.oasis.opendocument.image-template":"oti","application/vnd.oasis.opendocument.presentation":"odp","application/vnd.oasis.opendocument.presentation-template":"otp","application/vnd.oasis.opendocument.spreadsheet":"ods","application/vnd.oasis.opendocument.spreadsheet-template":"ots","application/vnd.oasis.opendocument.text":"odt","application/vnd.oasis.opendocument.text-master":"odm","application/vnd.oasis.opendocument.text-template":"ott","application/vnd.oasis.opendocument.text-web":"oth","application/vnd.olpc-sugar":"xo","application/vnd.oma.dd2+xml":"dd2","application/vnd.openofficeorg.extension":"oxt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/vnd.openxmlformats-officedocument.presentationml.slide":"sldx","application/vnd.openxmlformats-officedocument.presentationml.slideshow":"ppsx","application/vnd.openxmlformats-officedocument.presentationml.template":"potx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","application/vnd.osgeo.mapguide.package":"mgp","application/vnd.osgi.dp":"dp","application/vnd.osgi.subsystem":"esa","application/vnd.palm":"pdb","application/vnd.pawaafile":"paw","application/vnd.pg.format":"str","application/vnd.pg.osasli":"ei6","application/vnd.picsel":"efif","application/vnd.pmi.widget":"wg","application/vnd.pocketlearn":"plf","application/vnd.powerbuilder6":"pbd","application/vnd.previewsystems.box":"box","application/vnd.proteus.magazine":"mgz","application/vnd.publishare-delta-tree":"qps","application/vnd.pvi.ptid1":"ptid","application/vnd.quark.quarkxpress":"qxd","application/vnd.realvnc.bed":"bed","application/vnd.recordare.musicxml":"mxl","application/vnd.recordare.musicxml+xml":"musicxml","application/vnd.rig.cryptonote":"cryptonote","application/vnd.rim.cod":"cod","application/vnd.rn-realmedia":"rm","application/vnd.rn-realmedia-vbr":"rmvb","application/vnd.route66.link66+xml":"link66","application/vnd.sailingtracker.track":"st","application/vnd.seemail":"see","application/vnd.sema":"sema","application/vnd.semd":"semd","application/vnd.semf":"semf","application/vnd.shana.informed.formdata":"ifm","application/vnd.shana.informed.formtemplate":"itp","application/vnd.shana.informed.interchange":"iif","application/vnd.shana.informed.package":"ipk","application/vnd.simtech-mindmapper":"twd","application/vnd.smaf":"mmf","application/vnd.smart.teacher":"teacher","application/vnd.solent.sdkm+xml":"sdkm","application/vnd.spotfire.dxp":"dxp","application/vnd.spotfire.sfs":"sfs","application/vnd.stardivision.calc":"sdc","application/vnd.stardivision.draw":"sda","application/vnd.stardivision.impress":"sdd","application/vnd.stardivision.math":"smf","application/vnd.stardivision.writer":"sdw","application/vnd.stardivision.writer-global":"sgl","application/vnd.stepmania.package":"smzip","application/vnd.stepmania.stepchart":"sm","application/vnd.sun.xml.calc":"sxc","application/vnd.sun.xml.calc.template":"stc","application/vnd.sun.xml.draw":"sxd","application/vnd.sun.xml.draw.template":"std","application/vnd.sun.xml.impress":"sxi","application/vnd.sun.xml.impress.template":"sti","application/vnd.sun.xml.math":"sxm","application/vnd.sun.xml.writer":"sxw","application/vnd.sun.xml.writer.global":"sxg","application/vnd.sun.xml.writer.template":"stw","application/vnd.sus-calendar":"sus","application/vnd.svd":"svd","application/vnd.symbian.install":"sis","application/vnd.syncml+xml":"xsm","application/vnd.syncml.dm+wbxml":"bdm","application/vnd.syncml.dm+xml":"xdm","application/vnd.tao.intent-module-archive":"tao","application/vnd.tcpdump.pcap":"pcap","application/vnd.tmobile-livetv":"tmo","application/vnd.trid.tpt":"tpt","application/vnd.triscape.mxs":"mxs","application/vnd.trueapp":"tra","application/vnd.ufdl":"ufd","application/vnd.uiq.theme":"utz","application/vnd.umajin":"umj","application/vnd.unity":"unityweb","application/vnd.uoml+xml":"uoml","application/vnd.vcx":"vcx","application/vnd.visio":"vsd","application/vnd.visionary":"vis","application/vnd.vsf":"vsf","application/vnd.wap.wbxml":"wbxml","application/vnd.wap.wmlc":"wmlc","application/vnd.wap.wmlscriptc":"wmlsc","application/vnd.webturbo":"wtb","application/vnd.wolfram.player":"nbp","application/vnd.wordperfect":"wpd","application/vnd.wqd":"wqd","application/vnd.wt.stf":"stf","application/vnd.xara":"xar","application/vnd.xfdl":"xfdl","application/vnd.yamaha.hv-dic":"hvd","application/vnd.yamaha.hv-script":"hvs","application/vnd.yamaha.hv-voice":"hvp","application/vnd.yamaha.openscoreformat":"osf","application/vnd.yamaha.openscoreformat.osfpvg+xml":"osfpvg","application/vnd.yamaha.smaf-audio":"saf","application/vnd.yamaha.smaf-phrase":"spf","application/vnd.yellowriver-custom-menu":"cmp","application/vnd.zul":"zir","application/vnd.zzazz.deck+xml":"zaz","application/voicexml+xml":"vxml","application/widget":"wgt","application/winhlp":"hlp","application/wsdl+xml":"wsdl","application/wspolicy+xml":"wspolicy","application/x-7z-compressed":"7z","application/x-abiword":"abw","application/x-ace-compressed":"ace","application/x-apple-diskimage":"dmg","application/x-authorware-bin":"aab","application/x-authorware-map":"aam","application/x-authorware-seg":"aas","application/x-bcpio":"bcpio","application/x-bittorrent":"torrent","application/x-blorb":"blb","application/x-bzip":"bz","application/x-cbr":"cbr","application/x-cdlink":"vcd","application/x-cfs-compressed":"cfs","application/x-chat":"chat","application/x-chess-pgn":"pgn","application/x-conference":"nsc","application/x-cpio":"cpio","application/x-csh":"csh","application/x-debian-package":"deb","application/x-dgc-compressed":"dgc","application/x-director":"dir","application/x-doom":"wad","application/x-dtbncx+xml":"ncx","application/x-dtbook+xml":"dtb","application/x-dtbresource+xml":"res","application/x-dvi":"dvi","application/x-envoy":"evy","application/x-eva":"eva","application/x-font-bdf":"bdf","application/x-font-ghostscript":"gsf","application/x-font-linux-psf":"psf","application/x-font-pcf":"pcf","application/x-font-snf":"snf","application/x-font-type1":"pfa","application/x-freearc":"arc","application/x-futuresplash":"spl","application/x-gca-compressed":"gca","application/x-glulx":"ulx","application/x-gnumeric":"gnumeric","application/x-gramps-xml":"gramps","application/x-gtar":"gtar","application/x-hdf":"hdf","application/x-install-instructions":"install","application/x-iso9660-image":"iso","application/x-java-jnlp-file":"jnlp","application/x-latex":"latex","application/x-lzh-compressed":"lzh","application/x-mie":"mie","application/x-mobipocket-ebook":"prc","application/x-ms-application":"application","application/x-ms-shortcut":"lnk","application/x-ms-wmd":"wmd","application/x-ms-wmz":"wmz","application/x-ms-xbap":"xbap","application/x-msaccess":"mdb","application/x-msbinder":"obd","application/x-mscardfile":"crd","application/x-msclip":"clp","application/x-msdownload":"dll","application/x-msmediaview":"mvb","application/x-msmetafile":"wmf","application/x-msmoney":"mny","application/x-mspublisher":"pub","application/x-msschedule":"scd","application/x-msterminal":"trm","application/x-mswrite":"wri","application/x-netcdf":"nc","application/x-nzb":"nzb","application/x-pkcs12":"p12","application/x-pkcs7-certificates":"p7b","application/x-pkcs7-certreqresp":"p7r","application/x-research-info-systems":"ris","application/x-shar":"shar","application/x-shockwave-flash":"swf","application/x-silverlight-app":"xap","application/x-sql":"sql","application/x-stuffit":"sit","application/x-stuffitx":"sitx","application/x-subrip":"srt","application/x-sv4cpio":"sv4cpio","application/x-sv4crc":"sv4crc","application/x-t3vm-image":"t3","application/x-tads":"gam","application/x-tar":"tar","application/x-tcl":"tcl","application/x-tex":"tex","application/x-tex-tfm":"tfm","application/x-texinfo":"texinfo","application/x-tgif":"obj","application/x-ustar":"ustar","application/x-wais-source":"src","application/x-x509-ca-cert":"der","application/x-xfig":"fig","application/x-xliff+xml":"xlf","application/x-xpinstall":"xpi","application/x-xz":"xz","application/x-zmachine":"z1","application/xaml+xml":"xaml","application/xcap-diff+xml":"xdf","application/xenc+xml":"xenc","application/xhtml+xml":"xhtml","application/xml":"xsl","application/xml-dtd":"dtd","application/xop+xml":"xop","application/xproc+xml":"xpl","application/xslt+xml":"xslt","application/xspf+xml":"xspf","application/xv+xml":"mxml","application/yang":"yang","application/yin+xml":"yin","application/zip":"zip","audio/adpcm":"adp","audio/basic":"au","audio/midi":"mid","audio/mp4":"m4a","audio/mpeg":"mpga","audio/ogg":"oga","audio/s3m":"s3m","audio/silk":"sil","audio/vnd.dece.audio":"uva","audio/vnd.digital-winds":"eol","audio/vnd.dra":"dra","audio/vnd.dts":"dts","audio/vnd.dts.hd":"dtshd","audio/vnd.lucent.voice":"lvp","audio/vnd.ms-playready.media.pya":"pya","audio/vnd.nuera.ecelp4800":"ecelp4800","audio/vnd.nuera.ecelp7470":"ecelp7470","audio/vnd.nuera.ecelp9600":"ecelp9600","audio/vnd.rip":"rip","audio/webm":"weba","audio/x-aac":"aac","audio/x-aiff":"aif","audio/x-caf":"caf","audio/x-flac":"flac","audio/x-matroska":"mka","audio/x-mpegurl":"m3u","audio/x-ms-wax":"wax","audio/x-ms-wma":"wma","audio/x-pn-realaudio":"ram","audio/x-pn-realaudio-plugin":"rmp","audio/xm":"xm","chemical/x-cdx":"cdx","chemical/x-cif":"cif","chemical/x-cmdf":"cmdf","chemical/x-cml":"cml","chemical/x-csml":"csml","chemical/x-xyz":"xyz","font/collection":"ttc","font/otf":"otf","font/ttf":"ttf","font/woff":"woff","font/woff2":"woff2","image/cgm":"cgm","image/g3fax":"g3","image/gif":"gif","image/ief":"ief","image/jpeg":"jpeg","image/ktx":"ktx","image/png":"png","image/prs.btif":"btif","image/sgi":"sgi","image/svg+xml":"svg","image/tiff":"tiff","image/vnd.adobe.photoshop":"psd","image/vnd.dece.graphic":"uvi","image/vnd.djvu":"djvu","image/vnd.dvb.subtitle":"sub","image/vnd.dwg":"dwg","image/vnd.dxf":"dxf","image/vnd.fastbidsheet":"fbs","image/vnd.fpx":"fpx","image/vnd.fst":"fst","image/vnd.fujixerox.edmics-mmr":"mmr","image/vnd.fujixerox.edmics-rlc":"rlc","image/vnd.ms-modi":"mdi","image/vnd.ms-photo":"wdp","image/vnd.net-fpx":"npx","image/vnd.wap.wbmp":"wbmp","image/vnd.xiff":"xif","image/webp":"webp","image/x-3ds":"3ds","image/x-cmu-raster":"ras","image/x-cmx":"cmx","image/x-freehand":"fh","image/x-icon":"ico","image/x-mrsid-image":"sid","image/x-pcx":"pcx","image/x-pict":"pic","image/x-portable-anymap":"pnm","image/x-portable-bitmap":"pbm","image/x-portable-graymap":"pgm","image/x-portable-pixmap":"ppm","image/x-rgb":"rgb","image/x-xpixmap":"xpm","image/x-xwindowdump":"xwd","message/rfc822":"eml","model/iges":"igs","model/mesh":"msh","model/vnd.collada+xml":"dae","model/vnd.dwf":"dwf","model/vnd.gdl":"gdl","model/vnd.gtw":"gtw","model/vnd.vtu":"vtu","model/vrml":"wrl","model/x3d+binary":"x3db","model/x3d+vrml":"x3dv","model/x3d+xml":"x3d","text/cache-manifest":"appcache","text/calendar":"ics","text/css":"css","text/csv":"csv","text/html":"html","text/n3":"n3","text/plain":"txt","text/prs.lines.tag":"dsc","text/richtext":"rtx","text/sgml":"sgml","text/tab-separated-values":"tsv","text/troff":"t","text/turtle":"ttl","text/uri-list":"uri","text/vcard":"vcard","text/vnd.curl":"curl","text/vnd.curl.dcurl":"dcurl","text/vnd.curl.mcurl":"mcurl","text/vnd.curl.scurl":"scurl","text/vnd.fly":"fly","text/vnd.fmi.flexstor":"flx","text/vnd.graphviz":"gv","text/vnd.in3d.3dml":"3dml","text/vnd.in3d.spot":"spot","text/vnd.sun.j2me.app-descriptor":"jad","text/vnd.wap.wml":"wml","text/vnd.wap.wmlscript":"wmls","text/x-asm":"s","text/x-c":"cc","text/x-fortran":"f","text/x-java-source":"java","text/x-nfo":"nfo","text/x-opml":"opml","text/x-pascal":"p","text/x-setext":"etx","text/x-sfv":"sfv","text/x-uuencode":"uu","text/x-vcalendar":"vcs","text/x-vcard":"vcf","video/3gpp":"3gp","video/3gpp2":"3g2","video/h261":"h261","video/h263":"h263","video/h264":"h264","video/jpeg":"jpgv","video/jpm":"jpm","video/mj2":"mj2","video/mp4":"mp4","video/mpeg":"mpeg","video/quicktime":"qt","video/vnd.dece.hd":"uvh","video/vnd.dece.mobile":"uvm","video/vnd.dece.pd":"uvp","video/vnd.dece.sd":"uvs","video/vnd.dece.video":"uvv","video/vnd.dvb.file":"dvb","video/vnd.fvt":"fvt","video/vnd.mpegurl":"mxu","video/vnd.ms-playready.media.pyv":"pyv","video/vnd.uvvu.mp4":"uvu","video/vnd.vivo":"viv","video/webm":"webm","video/x-f4v":"f4v","video/x-fli":"fli","video/x-flv":"flv","video/x-m4v":"m4v","video/x-matroska":"mkv","video/x-mng":"mng","video/x-ms-asf":"asf","video/x-ms-vob":"vob","video/x-ms-wmx":"wmx","video/x-ms-wvx":"wvx","video/x-msvideo":"avi","video/x-sgi-movie":"movie","video/x-smv":"smv","x-conference/x-cooltalk":"ice","text/x-sql":"sql","image/x-pixlr-data":"pxd","image/x-adobe-dng":"dng","image/x-sketch":"sketch","image/x-xcf":"xcf","audio/amr":"amr","image/vnd-ms.dds":"dds","application/plt":"plt","application/sat":"sat","application/step":"step","text/x-httpd-cgi":"cgi","text/x-asap":"asp","text/x-jsp":"jsp"},Me.prototype._options={cdns:{ace:"https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.8",codemirror:"https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.52.2",ckeditor:"https://cdnjs.cloudflare.com/ajax/libs/ckeditor/4.12.1",ckeditor5:"https://cdn.ckeditor.com/ckeditor5/17.0.0",tinymce:"https://cdnjs.cloudflare.com/ajax/libs/tinymce/5.2.0",simplemde:"https://cdnjs.cloudflare.com/ajax/libs/simplemde/1.11.2",fabric:"https://cdnjs.cloudflare.com/ajax/libs/fabric.js/3.6.2",fabric16:"https://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.6.7",tui:"https://uicdn.toast.com",hls:"https://cdnjs.cloudflare.com/ajax/libs/hls.js/0.13.2/hls.min.js",dash:"https://cdnjs.cloudflare.com/ajax/libs/dashjs/3.0.3/dash.all.min.js",flv:"https://cdnjs.cloudflare.com/ajax/libs/flv.js/1.5.0/flv.min.js",videojs:"https://cdnjs.cloudflare.com/ajax/libs/video.js/7.7.5",prettify:"https://cdn.jsdelivr.net/gh/google/code-prettify@f1c3473acd1e8ea8c8c1a60c56e89f5cdd06f915/loader/run_prettify.js",psd:"https://cdnjs.cloudflare.com/ajax/libs/psd.js/3.2.0/psd.min.js",rar:"https://cdn.jsdelivr.net/gh/nao-pon/rar.js@6cef13ec66dd67992fc7f3ea22f132d770ebaf8b/rar.min.js",zlibUnzip:"https://cdn.jsdelivr.net/gh/imaya/zlib.js@0.3.1/bin/unzip.min.js",zlibGunzip:"https://cdn.jsdelivr.net/gh/imaya/zlib.js@0.3.1/bin/gunzip.min.js",bzip2:"https://cdn.jsdelivr.net/gh/nao-pon/bzip2.js@0.8.0/bzip2.js",marked:"https://cdnjs.cloudflare.com/ajax/libs/marked/0.7.0/marked.min.js",sparkmd5:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.0/spark-md5.min.js",jssha:"https://cdnjs.cloudflare.com/ajax/libs/jsSHA/2.3.1/sha.js",amr:"https://cdn.jsdelivr.net/gh/yxl/opencore-amr-js@dcf3d2b5f384a1d9ded2a54e4c137a81747b222b/js/amrnb.js",tiff:"https://cdn.jsdelivr.net/gh/seikichi/tiff.js@545ede3ee46b5a5bc5f06d65954e775aa2a64017/tiff.min.js"},url:"",requestType:"get",cors:null,parrotHeaders:[],requestMaxConn:3,transport:{},urlUpload:"",dragUploadAllow:"auto",overwriteUploadConfirm:!0,uploadMaxChunkSize:10485760,folderUploadExclude:{win:/^(?:desktop\.ini|thumbs\.db)$/i,mac:/^\.ds_store$/i},iframeTimeout:0,customData:{},handlers:{},customHeaders:{},xhrFields:{},lang:"en",baseUrl:"",i18nBaseUrl:"",cssAutoLoad:!0,themes:{},theme:null,maxErrorDialogs:5,cssClass:"",commands:["*"],commandsOptions:{getfile:{onlyURL:!1,multiple:!1,folders:!1,oncomplete:"",onerror:"",getPath:!0,getImgSize:!1},open:{method:"post",into:"window",selectAction:"open"},opennew:{url:"",useOriginQuery:!0},upload:{ui:"button"},download:{maxRequests:10,minFilesZipdl:2},quicklook:{autoplay:!0,width:450,height:300,mediaControlsList:"",pdfToolbar:!0,textInitialLines:100,prettifyMaxLines:300,contain:!1,docked:0,dockHeight:"auto",dockAutoplay:!1,googleMapsApiKey:"",googleMapsOpts:{maps:{},kml:{suppressInfoWindows:!1,preserveViewport:!1}},viewerjs:{url:"",mimes:["application/pdf","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation"],pdfNative:!0},sharecadMimes:[],googleDocsMimes:[],officeOnlineMimes:[],getDimThreshold:"200K",unzipMaxSize:"50M",mimeRegexNotEmptyCheck:/^application\/vnd\.google-apps\./},edit:{dialogWidth:void 0,dialogHeight:void 0,mimes:[],mkfileHideMimes:[],makeTextMimes:["text/plain","text/css","text/html"],useStoredEditor:!1,editorMaximized:!1,editors:[],encodings:["Big5","Big5-HKSCS","Cp437","Cp737","Cp775","Cp850","Cp852","Cp855","Cp857","Cp858","Cp862","Cp866","Cp874","EUC-CN","EUC-JP","EUC-KR","GB18030","ISO-2022-CN","ISO-2022-JP","ISO-2022-KR","ISO-8859-1","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-13","ISO-8859-15","KOI8-R","KOI8-U","Shift-JIS","Windows-1250","Windows-1251","Windows-1252","Windows-1253","Windows-1254","Windows-1257"],extraOptions:{uploadOpts:{},tuiImgEditOpts:{iconsPath:void 0,theme:{}},pixo:{apikey:""},managerUrl:null,ckeditor:{},ckeditor5:{mode:"decoupled-document"},tinymce:{},onlineConvert:{maxSize:100,showLink:!0}}},fullscreen:{mode:"screen"},search:{incsearch:{enable:!0,minlen:1,wait:500},searchTypes:{SearchMime:{name:"btnMime",title:"searchMime",incsearch:"mime"}}},info:{nullUrlDirLinkSelf:!0,hideItems:[],showHashMaxsize:104857600,showHashAlgorisms:["md5","sha256"],showHashOpts:{shake128len:256,shake256len:512},custom:{}},mkdir:{intoNewFolderToolbtn:!1},resize:{grid8px:"disable",presetSize:[[320,240],[400,400],[640,480],[800,600]],getDimThreshold:204800,dimSubImgSize:307200},rm:{quickTrash:!0,infoCheckWait:10,toTrashMaxItems:1e3},paste:{moveConfirm:!1},help:{view:["about","shortcuts","help","integrations","debug"],helpSource:""},preference:{width:600,height:400,categories:null,prefs:null,langs:null,selectActions:["open","edit/download","resize/edit/download","download","quicklook"]}},disabledCmdsRels:{get:["edit"],rm:["cut","empty"],"file&url=":["download","zipdl"]},bootCallback:null,getFileCallback:null,defaultView:"icons",startPathHash:"",sound:!0,ui:["toolbar","places","tree","path","stat"],uiOptions:{toolbar:[["home","back","forward","up","reload"],["netmount"],["mkdir","mkfile","upload"],["open","download","getfile"],["undo","redo"],["copy","cut","paste","rm","empty","hide"],["duplicate","rename","edit","resize","chmod"],["selectall","selectnone","selectinvert"],["quicklook","info"],["extract","archive"],["search"],["view","sort"],["preference","help"],["fullscreen"]],toolbarExtra:{displayTextLabel:!1,labelExcludeUA:["Mobile"],autoHideUA:["Mobile"],defaultHides:["home","reload"],showPreferenceButton:"none",preferenceInContextmenu:!0},tree:{attrTitle:!0,openRootOnLoad:!0,openCwdOnOpen:!0,syncTree:!0,subTreeMax:100,subdirsMaxConn:2,subdirsAtOnce:5,durations:{slideUpDown:"fast",autoScroll:"fast"}},navbar:{minWidth:150,maxWidth:500,autoHideUA:[]},navdock:{disabled:!1,initMaxHeight:"50%",maxHeight:"90%"},cwd:{oldSchool:!1,showSelectCheckboxUA:["Touch"],metakeyDragout:!0,listView:{columns:["perm","date","size","kind"],columnsCustomName:{},fixedHeader:!0},iconsView:{size:0,sizeMax:3,sizeNames:{0:"viewSmall",1:"viewMedium",2:"viewLarge",3:"viewExtraLarge"}}},path:{toWorkzoneWithoutNavbar:!0},dialog:{focusOnMouseOver:!0},toast:{animate:{showMethod:"fadeIn",showDuration:300,showEasing:"swing",timeOut:3e3,hideMethod:"fadeOut",hideDuration:1500,hideEasing:"swing"}}},dispInlineRegex:"^(?:(?:image|video|audio)|application/(?:x-mpegURL|dash+xml)|(?:text/plain|application/pdf)$)",onlyMimes:[],sortRules:{},sortType:"name",sortOrder:"asc",sortStickFolders:!0,sortAlsoTreeview:!1,clientFormatDate:!0,UTCDate:!1,dateFormat:"",fancyDateFormat:"",fileModeStyle:"both",width:"auto",height:400,heightBase:null,resizable:!0,notifyDelay:500,notifyDialog:{position:{},width:null,canClose:!1,hiddens:["open"]},dialogContained:!1,allowShortcuts:!0,rememberLastDir:!0,reloadClearHistory:!1,useBrowserHistory:!0,showFiles:50,showThreshold:50,validName:!1,fileFilter:!1,backupSuffix:"~",sync:0,syncStart:!0,loadTmbs:5,cookie:{expires:30,domain:"",path:"/",secure:!1},contextmenu:{navbar:["open","opennew","download","|","upload","mkdir","|","copy","cut","paste","duplicate","|","rm","empty","hide","|","rename","|","archive","|","places","info","chmod","netunmount"],cwd:["undo","redo","|","back","up","reload","|","upload","mkdir","mkfile","paste","|","empty","hide","|","view","sort","selectall","colwidth","|","places","info","chmod","netunmount","|","fullscreen","|","preference"],files:["getfile","|","open","opennew","download","opendir","quicklook","|","upload","mkdir","|","copy","cut","paste","duplicate","|","rm","empty","hide","|","rename","edit","resize","|","archive","extract","|","selectall","selectinvert","|","places","info","chmod","netunmount"]},enableAlways:!1,enableByMouseOver:!0,windowCloseConfirm:["hasNotifyDialog","editingFile"],rawStringDecoder:"object"==typeof Encoding&&st.isFunction(Encoding.convert)?function(e){return Encoding.convert(e,{to:"UNICODE",type:"string"})}:null,debug:["error","warning","event-destroy"],toastBackendWarn:!0},Me.prototype._options.commandsOptions.netmount={ftp:{name:"FTP",inputs:{host:st('<input type="text"/>'),port:st('<input type="number" placeholder="21" class="elfinder-input-optional"/>'),path:st('<input type="text" value="/"/>'),user:st('<input type="text"/>'),pass:st('<input type="password" autocomplete="new-password"/>'),FTPS:st('<input type="checkbox" value="1" title="File Transfer Protocol over SSL/TLS"/>'),encoding:st('<input type="text" placeholder="Optional" class="elfinder-input-optional"/>'),locale:st('<input type="text" placeholder="Optional" class="elfinder-input-optional"/>')}},dropbox2:Me.prototype.makeNetmountOptionOauth("dropbox2","Dropbox","Dropbox",{noOffline:!0,root:"/",pathI18n:"path",integrate:{title:"Dropbox.com",link:"https://www.dropbox.com"}}),googledrive:Me.prototype.makeNetmountOptionOauth("googledrive","Google Drive","Google",{integrate:{title:"Google Drive",link:"https://www.google.com/drive/"}}),onedrive:Me.prototype.makeNetmountOptionOauth("onedrive","One Drive","OneDrive",{integrate:{title:"Microsoft OneDrive",link:"https://onedrive.live.com"}}),box:Me.prototype.makeNetmountOptionOauth("box","Box","Box",{noOffline:!0,integrate:{title:"Box.com",link:"https://www.box.com"}})},Me.prototype.history=function(n){function t(){s=[n.cwd().hash],r=!(a=0)}function e(e){return e&&o.canForward()||!e&&o.canBack()?(r=!1,n.exec("open",s[e?++a:--a]).fail(t)):st.Deferred().reject()}function i(e){!l||l.state&&l.state.thash===e||l.pushState({thash:e},null,location.pathname+location.search+(e?"#elf_"+e:""))}var a,o=this,r=!0,s=[],l=n.options.useBrowserHistory&&window.history&&window.history.pushState?window.history:null;this.canBack=function(){return 0<a},this.canForward=function(){return a<s.length-1},this.back=e,this.forward=function(){return e(!0)},n.bind("init",function(){l&&!l.state&&i(n.startDir())}).open(function(){var e=s.length,t=n.cwd().hash;r&&(0<=a&&a+1<e&&s.splice(a+1),s[s.length-1]!=t&&s.push(t),a=s.length-1),r=!0,i(t)}).reload(n.options.reloadClearHistory&&t)},Me.prototype.command=function(t){this.fm=t,this.name="",this.dialogClass="",this.className="",this.title="",this.linkedCmds=[],this.state=-1,this.alwaysEnabled=!1,this.noChangeDirOnRemovedCwd=!1,this._disabled=!1,this.disableOnSearch=!1,this.updateOnSelect=!0,this.syncTitleOnChange=!1,this.keepContextmenu=!1,this._handlers={enable:function(){this.update(void 0,this.value)},disable:function(){this.update(-1,this.value)},"open reload load sync":function(){this._disabled=!(this.alwaysEnabled||this.fm.isCommandEnabled(this.name)),this.update(void 0,this.value),this.change()}},this.handlers={},this.shortcuts=[],this.options={ui:"button"},this.listeners=[],this.setup=function(e,t){var n,i,a,o=this,r=this.fm;for(this.name=e,this.title=r.messages["cmd"+e]?r.i18n("cmd"+e):this.extendsCmd&&r.messages["cmd"+this.extendsCmd]?r.i18n("cmd"+this.extendsCmd):e,this.options=Object.assign({},this.options,t),this.listeners=[],this.dialogClass="elfinder-dialog-"+e,t.shortcuts&&("function"==typeof t.shortcuts?a=t.shortcuts(this.fm,this.shortcuts):Array.isArray(t.shortcuts)&&(a=t.shortcuts),this.shortcuts=a||[]),this.updateOnSelect&&(this._handlers.select=function(){this.update(void 0,this.value)}),st.each(Object.assign({},o._handlers,o.handlers),function(e,t){r.bind(e,st.proxy(t,o))}),n=0;n<this.shortcuts.length;n++)(function(e){var i=e.callback||function(e){r.exec(o.name,void 0,{_userAction:!0,_currentType:"shortcut"})};e.callback=function(e){var t,n={};o.enabled()&&(r.searchStatus.state<2?t=r.isCommandEnabled(o.name):(st.each(r.selected(),function(e,t){r.optionsByHashes[t]?n[t]=!0:st.each(r.volOptions,function(e){if(!n[e]&&0===t.indexOf(e))return!(n[e]=!0)})}),st.each(n,function(e){if(!(t=r.isCommandEnabled(o.name,e)))return!1})),t&&(o.event=e,i.call(o),delete o.event))}})(i=this.shortcuts[n]),i.description||(i.description=this.title),r.shortcut(i);this.disableOnSearch&&r.bind("search searchend",function(){o._disabled="search"===this.type||!(this.alwaysEnabled||r.isCommandEnabled(e)),o.update(void 0,o.value)}),this.init()},this.init=function(){},this.exec=function(e,t){return st.Deferred().reject()},this.getUndo=function(e,t){return!1},this.disabled=function(){return this.state<0},this.enabled=function(){return-1<this.state},this.active=function(){return 0<this.state},this.getstate=function(){return-1},this.update=function(e,t){var n=this.state,i=this.value;this._disabled&&0===this.fm.searchStatus?this.state=-1:this.state=void 0!==e?e:this.getstate(),this.value=t,n==this.state&&i==this.value||this.change()},this.change=function(e){var t,n;if("function"==typeof e)this.listeners.push(e);else for(n=0;n<this.listeners.length;n++){t=this.listeners[n];try{t(this.state,this.value)}catch(e){this.fm.debug("error",e)}}return this},this.hashes=function(e){return e?st.grep(Array.isArray(e)?e:[e],function(e){return!!t.file(e)}):t.selected()},this.files=function(e){var t=this.fm;return e?st.map(Array.isArray(e)?e:[e],function(e){return t.file(e)||null}):t.selectedFiles()},this.fmDialog=function(e,t){return t.cssClass?t.cssClass+=" "+this.dialogClass:t.cssClass=this.dialogClass,this.fm.dialog(e,t)}},Me.prototype.resources={class:{hover:"ui-state-hover",active:"ui-state-active",disabled:"ui-state-disabled",draggable:"ui-draggable",droppable:"ui-droppable",adroppable:"elfinder-droppable-active",cwdfile:"elfinder-cwd-file",cwd:"elfinder-cwd",tree:"elfinder-tree",treeroot:"elfinder-navbar-root",navdir:"elfinder-navbar-dir",navdirwrap:"elfinder-navbar-dir-wrapper",navarrow:"elfinder-navbar-arrow",navsubtree:"elfinder-navbar-subtree",navcollapse:"elfinder-navbar-collapsed",navexpand:"elfinder-navbar-expanded",treedir:"elfinder-tree-dir",placedir:"elfinder-place-dir",searchbtn:"elfinder-button-search",editing:"elfinder-to-editing",preventback:"elfinder-prevent-back",tabstab:"ui-state-default ui-tabs-tab ui-corner-top ui-tab",tabsactive:"ui-tabs-active ui-state-active"},tpl:{perms:'<span class="elfinder-perms"></span>',lock:'<span class="elfinder-lock"></span>',symlink:'<span class="elfinder-symlink"></span>',navicon:'<span class="elfinder-nav-icon"></span>',navspinner:'<span class="elfinder-spinner elfinder-navbar-spinner"></span>',navdir:'<div class="elfinder-navbar-wrapper{root}"><span id="{id}" class="ui-corner-all elfinder-navbar-dir {cssclass}"{title}><span class="elfinder-navbar-arrow"></span><span class="elfinder-navbar-icon" {style}></span>{symlink}{permissions}{name}</span><div class="elfinder-navbar-subtree" style="display:none"></div></div>',placedir:'<div class="elfinder-navbar-wrapper"><span id="{id}" class="ui-corner-all elfinder-navbar-dir {cssclass}"{title}><span class="elfinder-navbar-arrow"></span><span class="elfinder-navbar-icon" {style}></span>{symlink}{permissions}{name}</span><div class="elfinder-navbar-subtree" style="display:none"></div></div>'},mimes:{text:["application/dash+xml","application/docbook+xml","application/javascript","application/json","application/plt","application/sat","application/sql","application/step","application/vnd.hp-hpgl","application/x-awk","application/x-config","application/x-csh","application/x-empty","application/x-mpegurl","application/x-perl","application/x-php","application/x-web-config","application/xhtml+xml","application/xml","audio/x-mp3-playlist","image/cgm","image/svg+xml","image/vnd.dxf","model/iges"]},mixin:{make:function(){function e(){requestAnimationFrame(function(){D&&D.trigger("blur")})}function a(){M.is(":hidden")||M.elfinderoverlay("hide").off("click close",F),n&&(o.removeClass("ui-front").css("position","").off("unselect."+h.namespace,e),w?n&&n.css("max-height",""):b||o.css("width","").parent("td").css("overflow",""))}var t,n,o,s,i,r,l,c,d,p,u=this,h=this.fm,f=this.name,m=this.requestCmd||f,g=h.getUI("workzone"),v=this.origin&&"navbar"===this.origin?"tree":"cwd",b="tree"==v,y=b?"navHash2Elm":"cwdHash2Elm",w=!b&&"list"!=h.storage("view"),x=h.selected(),k=this.move||!1,C=g.hasClass("elfinder-cwd-wrapper-empty"),z=st.Deferred().fail(function(e){r&&i.attr("class",r),C&&g.addClass("elfinder-cwd-wrapper-empty"),x&&(k&&h.trigger("unlockfiles",{files:x}),h.clipboard([]),h.trigger("selectfiles",{files:x})),e&&h.error(e)}).always(function(){a(),E(),h.enable().unbind("open",q).trigger("resMixinMake")}),T="tmp_"+parseInt(1e5*Math.random()),A=this.data&&this.data.target?this.data.target:b?h.file(x[0]).hash:h.cwd().hash,j=new Date,O={hash:T,phash:A,name:h.uniqueName(this.prefix,A),mime:this.mime,read:!0,write:!0,date:"Today "+j.getHours()+":"+j.getMinutes(),move:k},S=(h.getUI(v).trigger("create."+h.namespace,O),this.data||{}),I=h[y](T),M=h.getUI("overlay"),E=function(){I&&I.length&&(D.off(),I.hide(),h.unselectfiles({files:[T]}).unbind("resize",P),requestAnimationFrame(function(){b?I.closest(".elfinder-navbar-wrapper").remove():I.remove()}))},F=function(e){M.is(":hidden")||o.css("z-index",""),R||(E(),z.reject(),e&&(e.stopPropagation(),e.preventDefault()))},D=st(w?"<textarea></textarea>":'<input type="text"/>').on("keyup text",function(){w?(this.style.height="1px",this.style.height=this.scrollHeight+"px"):t&&(this.style.width=t+"px",this.scrollWidth>t&&(this.style.width=this.scrollWidth+10+"px"))}).on("keydown",function(e){e.stopImmediatePropagation(),e.keyCode==st.ui.keyCode.ESCAPE?z.reject():e.keyCode==st.ui.keyCode.ENTER&&(e.preventDefault(),D.trigger("blur"))}).on("mousedown click dblclick",function(e){e.stopPropagation(),"dblclick"===e.type&&e.preventDefault()}).on("blur",function(){var e,t=st.trim(D.val()),n=D.parent(),i=!0;if(M.is(":hidden")||o.css("z-index",""),""===t)return F();if(!R&&n.length){if(h.options.validName&&h.options.validName.test)try{i=h.options.validName.test(t)}catch(e){i=!1}if(!t||"."===t||".."===t||!i)return R=!0,h.error("directory"===O.mime?"errInvDirname":"errInvName",{modal:!0,close:function(){setTimeout(U,120)}}),!1;if(h.fileByName(t,A))return R=!0,h.error(["errExists",t],{modal:!0,close:function(){setTimeout(U,120)}}),!1;e=x&&k?h.exec("cut",x):null,st.when(e).done(function(){var o={},r={};a(),D.hide().before(st("<span>").text(t)),h.lockfiles({files:[T]}),h.request({data:Object.assign({cmd:m,name:t,target:A},S||{}),notify:{type:m,cnt:1},preventFail:!0,syncOnFail:!0,navigate:{toast:o}}).fail(function(e){h.unlockfiles({files:[T]}),R=!0,D.show().prev().remove(),h.error(e,{modal:!0,close:function(){Array.isArray(e)&&-1!==st.inArray("errUploadMime",e)?z.notify("errUploadMime").reject():setTimeout(U,120)}})}).done(function(e){var t,n,i,a;e&&e.added&&e.added[0]&&(t=e.added[0],n=t.hash,h[y](n),i={directory:{cmd:"open",msg:"cmdopendir"},text:{cmd:"edit",msg:"cmdedit"},default:{cmd:"open",msg:"cmdopen"}},x&&k&&h.one(m+"done",function(){h.exec("paste",n)}),k||(h.mimeIsText(t.mime)&&!h.mimesCanMakeEmpty[t.mime]&&h.mimeTypes[t.mime]&&(h.trigger("canMakeEmptyFile",{mimes:[t.mime],unshift:!0}),(a={})[t.mime]=h.mimeTypes[t.mime],h.storage("mkfileTextMimes",Object.assign(a,h.storage("mkfileTextMimes")||{}))),Object.assign(r,s||i[t.mime]||i[t.mime.split("/")[0]]||i[h.mimesCanMakeEmpty[t.mime]||-1!==st.inArray(t.mime,h.resources.mimes.text)?"text":"none"]||i.default),Object.assign(o,r.cmd?{incwd:{msg:h.i18n(["complete",h.i18n("cmd"+f)]),action:r},inbuffer:{msg:h.i18n(["complete",h.i18n("cmd"+f)]),action:r}}:{inbuffer:{msg:h.i18n(["complete",h.i18n("cmd"+f)])}}))),z.resolve(e)})}).fail(function(){z.reject()})}}).on("dragenter dragleave dragover drop",function(e){e.stopPropagation()}),U=function(){var e=h.splitFileExtention(D.val())[0];R||!h.UA.Mobile||h.UA.iOS||(M.on("click close",F).elfinderoverlay("show"),o.css("z-index",M.css("z-index")+1)),R=!1,h.enabled()||h.enable(),D.trigger("focus").trigger("select"),D[0].setSelectionRange&&D[0].setSelectionRange(0,e.length)},P=function(){I.trigger("scrolltoview",{blink:!1})},q=function(){z&&"pending"===z.state()&&z.reject()},R=!1;return h.isCommandEnabled(m,A)&&I.length?(st.isPlainObject(u.nextAction)&&(s=Object.assign({},u.nextAction)),b?(i=h[y](A),l=h.res("class","navcollapse"),c=h.res("class","navexpand"),d=h.res("class","navarrow"),p=h.res("class","navsubtree"),I.closest("."+p).show(),i.hasClass(l)||(r=i.attr("class"),i.addClass(l+" "+c+" elfinder-subtree-loaded")),i.is("."+l+":not(."+c+")")&&i.children("."+d).trigger("click").data("dfrd").done(function(){D.val()===O.name&&D.val(h.uniqueName(u.prefix,A)).trigger("select").trigger("focus")}),n=I.contents().filter(function(){return 3==this.nodeType&&st(this).parent().attr("id")===h.navHash2Id(O.hash)}),o=n.parent(),n.replaceWith(D.val(O.name))):(C&&g.removeClass("elfinder-cwd-wrapper-empty"),n=I.find(".elfinder-cwd-filename"),o=n.parent(),w?n.css("max-height","none"):(t=o.width(),o.width(t-15).parent("td").css("overflow","visible")),n.empty().append(D.val(O.name))),o.addClass("ui-front").css("position","relative").on("unselect."+h.namespace,e),h.bind("resize",P).one("open",q),D.trigger("keyup"),U(),z):z.reject()}},blink:function(e,t){var n={slowonce:function(){e.hide().delay(250).fadeIn(750).delay(500).fadeOut(3500)},lookme:function(){e.show().fadeOut(500).fadeIn(750)}},i=n[t=t||"slowonce"]||n.lookme;e.stop(!0,!0),i()}},st.fn.dialogelfinder=function(e,t){var n,i,r="elfinderPosition",s="elfinderDestroyOnClose";if(st.isPlainObject(e))this.not(".elfinder").each(function(){e.handlers=e.handlers||{};var n,i=st(this),a=(st(document),st('<div class="ui-widget-header dialogelfinder-drag ui-corner-top">'+(e.title||"Files")+"</div>")),o=(st('<a href="#" class="dialogelfinder-drag-close ui-corner-all"><span class="ui-icon ui-icon-closethick"> </span></a>').appendTo(a).on("click",function(e){e.preventDefault(),i.dialogelfinder("close")}),e.handlers.init);e.handlers.init=function(e,t){i.prepend(a),o&&o(e,t)},(n=i.addClass("elfinder dialogelfinder touch-punch").css("position","absolute").hide().appendTo("body").draggable({handle:".dialogelfinder-drag",containment:"window",stop:function(){i.trigger("resize"),n.trigger("resize")}}).elfinder(e,t).elfinder("instance")).reloadCallback=function(e,t){n.destroy(),e.handlers.init=o,i.dialogelfinder(e,t).dialogelfinder("open")},i.width(parseInt(i.width())||840).data(s,!!e.destroyOnClose).find(".elfinder-toolbar").removeClass("ui-corner-top"),e.position&&i.data(r,e.position),!1!==e.autoOpen&&st(this).dialogelfinder("open")});else if("open"===e)i=(n=st(this)).data(r)||{top:parseInt(st(document).scrollTop()+(st(window).height()<n.height()?2:(st(window).height()-n.height())/2)),left:parseInt(st(document).scrollLeft()+(st(window).width()<n.width()?2:(st(window).width()-n.width())/2))},n.is(":hidden")&&(n.addClass("ui-front").css(i).show().trigger("resize"),setTimeout(function(){n.trigger("resize").trigger("mousedown")},200));else if("close"===e)(n=st(this).removeClass("ui-front")).is(":visible")&&(n.data(s)?n.elfinder("destroy").remove():n.elfinder("close"));else if("instance"===e)return st(this).getElFinder();return this},"function"==typeof Me&&Me.prototype.i18&&(Me.prototype.i18.en={translator:"Troex Nevelin <troex@fury.scancode.ru>, Naoki Sawada <hypweb+elfinder@gmail.com>",language:"English",direction:"ltr",dateFormat:"M d, Y h:i A",fancyDateFormat:"$1 h:i A",nonameDateFormat:"ymd-His",messages:{error:"Error",errUnknown:"Unknown error.",errUnknownCmd:"Unknown command.",errJqui:"Invalid jQuery UI configuration. Selectable, draggable and droppable components must be included.",errNode:"elFinder requires DOM Element to be created.",errURL:"Invalid elFinder configuration! URL option is not set.",errAccess:"Access denied.",errConnect:"Unable to connect to backend.",errAbort:"Connection aborted.",errTimeout:"Connection timeout.",errNotFound:"Backend not found.",errResponse:"Invalid backend response.",errConf:"Invalid backend configuration.",errJSON:"PHP JSON module not installed.",errNoVolumes:"Readable volumes not available.",errCmdParams:'Invalid parameters for command "$1".',errDataNotJSON:"Data is not JSON.",errDataEmpty:"Data is empty.",errCmdReq:"Backend request requires command name.",errOpen:'Unable to open "$1".',errNotFolder:"Object is not a folder.",errNotFile:"Object is not a file.",errRead:'Unable to read "$1".',errWrite:'Unable to write into "$1".',errPerm:"Permission denied.",errLocked:'"$1" is locked and can not be renamed, moved or removed.',errExists:'Item named "$1" already exists.',errInvName:"Invalid file name.",errInvDirname:"Invalid folder name.",errFolderNotFound:"Folder not found.",errFileNotFound:"File not found.",errTrgFolderNotFound:'Target folder "$1" not found.',errPopup:"Browser prevented opening popup window. To open file enable it in browser options.",errMkdir:'Unable to create folder "$1".',errMkfile:'Unable to create file "$1".',errRename:'Unable to rename "$1".',errCopyFrom:'Copying files from volume "$1" not allowed.',errCopyTo:'Copying files to volume "$1" not allowed.',errMkOutLink:"Unable to create a link to outside the volume root.",errUpload:"Upload error.",errUploadFile:'Unable to upload "$1".',errUploadNoFiles:"No files found for upload.",errUploadTotalSize:"Data exceeds the maximum allowed size.",errUploadFileSize:"File exceeds maximum allowed size.",errUploadMime:"File type not allowed.",errUploadTransfer:'"$1" transfer error.',errUploadTemp:"Unable to make temporary file for upload.",errNotReplace:'Object "$1" already exists at this location and can not be replaced by object with another type.',errReplace:'Unable to replace "$1".',errSave:'Unable to save "$1".',errCopy:'Unable to copy "$1".',errMove:'Unable to move "$1".',errCopyInItself:'Unable to copy "$1" into itself.',errRm:'Unable to remove "$1".',errTrash:"Unable into trash.",errRmSrc:"Unable remove source file(s).",errExtract:'Unable to extract files from "$1".',errArchive:"Unable to create archive.",errArcType:"Unsupported archive type.",errNoArchive:"File is not archive or has unsupported archive type.",errCmdNoSupport:"Backend does not support this command.",errReplByChild:'The folder "$1" can\'t be replaced by an item it contains.',errArcSymlinks:"For security reason denied to unpack archives contains symlinks or files with not allowed names.",errArcMaxSize:"Archive files exceeds maximum allowed size.",errResize:'Unable to resize "$1".',errResizeDegree:"Invalid rotate degree.",errResizeRotate:"Unable to rotate image.",errResizeSize:"Invalid image size.",errResizeNoChange:"Image size not changed.",errUsupportType:"Unsupported file type.",errNotUTF8Content:'File "$1" is not in UTF-8 and cannot be edited.',errNetMount:'Unable to mount "$1".',errNetMountNoDriver:"Unsupported protocol.",errNetMountFailed:"Mount failed.",errNetMountHostReq:"Host required.",errSessionExpires:"Your session has expired due to inactivity.",errCreatingTempDir:'Unable to create temporary directory: "$1"',errFtpDownloadFile:'Unable to download file from FTP: "$1"',errFtpUploadFile:'Unable to upload file to FTP: "$1"',errFtpMkdir:'Unable to create remote directory on FTP: "$1"',errArchiveExec:'Error while archiving files: "$1"',errExtractExec:'Error while extracting files: "$1"',errNetUnMount:"Unable to unmount.",errConvUTF8:"Not convertible to UTF-8",errFolderUpload:"Try the modern browser, If you'd like to upload the folder.",errSearchTimeout:'Timed out while searching "$1". Search result is partial.',errReauthRequire:"Re-authorization is required.",errMaxTargets:"Max number of selectable items is $1.",errRestore:"Unable to restore from the trash. Can't identify the restore destination.",errEditorNotFound:"Editor not found to this file type.",errServerError:"Error occurred on the server side.",errEmpty:'Unable to empty folder "$1".',moreErrors:"There are $1 more errors.",cmdarchive:"Create archive",cmdback:"Back",cmdcopy:"Copy",cmdcut:"Cut",cmddownload:"Download",cmdduplicate:"Duplicate",cmdedit:"Edit file",cmdextract:"Extract files from archive",cmdforward:"Forward",cmdgetfile:"Select files",cmdhelp:"About this software",cmdhome:"Root",cmdinfo:"Get info",cmdmkdir:"New folder",cmdmkdirin:"Into New Folder",cmdmkfile:"New file",cmdopen:"Open",cmdpaste:"Paste",cmdquicklook:"Preview",cmdreload:"Reload",cmdrename:"Rename",cmdrm:"Delete",cmdtrash:"Into trash",cmdrestore:"Restore",cmdsearch:"Find files",cmdup:"Go to parent folder",cmdupload:"Upload files",cmdview:"View",cmdresize:"Resize & Rotate",cmdsort:"Sort",cmdnetmount:"Mount network volume",cmdnetunmount:"Unmount",cmdplaces:"To Places",cmdchmod:"Change mode",cmdopendir:"Open a folder",cmdcolwidth:"Reset column width",cmdfullscreen:"Full Screen",cmdmove:"Move",cmdempty:"Empty the folder",cmdundo:"Undo",cmdredo:"Redo",cmdpreference:"Preferences",cmdselectall:"Select all",cmdselectnone:"Select none",cmdselectinvert:"Invert selection",cmdopennew:"Open in new window",cmdhide:"Hide (Preference)",btnClose:"Close",btnSave:"Save",btnRm:"Remove",btnApply:"Apply",btnCancel:"Cancel",btnNo:"No",btnYes:"Yes",btnMount:"Mount",btnApprove:"Goto $1 & approve",btnUnmount:"Unmount",btnConv:"Convert",btnCwd:"Here",btnVolume:"Volume",btnAll:"All",btnMime:"MIME Type",btnFileName:"Filename",btnSaveClose:"Save & Close",btnBackup:"Backup",btnRename:"Rename",btnRenameAll:"Rename(All)",btnPrevious:"Prev ($1/$2)",btnNext:"Next ($1/$2)",btnSaveAs:"Save As",ntfopen:"Open folder",ntffile:"Open file",ntfreload:"Reload folder content",ntfmkdir:"Creating folder",ntfmkfile:"Creating files",ntfrm:"Delete items",ntfcopy:"Copy items",ntfmove:"Move items",ntfprepare:"Checking existing items",ntfrename:"Rename files",ntfupload:"Uploading files",ntfdownload:"Downloading files",ntfsave:"Save files",ntfarchive:"Creating archive",ntfextract:"Extracting files from archive",ntfsearch:"Searching files",ntfresize:"Resizing images",ntfsmth:"Doing something",ntfloadimg:"Loading image",ntfnetmount:"Mounting network volume",ntfnetunmount:"Unmounting network volume",ntfdim:"Acquiring image dimension",ntfreaddir:"Reading folder infomation",ntfurl:"Getting URL of link",ntfchmod:"Changing file mode",ntfpreupload:"Verifying upload file name",ntfzipdl:"Creating a file for download",ntfparents:"Getting path infomation",ntfchunkmerge:"Processing the uploaded file",ntftrash:"Doing throw in the trash",ntfrestore:"Doing restore from the trash",ntfchkdir:"Checking destination folder",ntfundo:"Undoing previous operation",ntfredo:"Redoing previous undone",ntfchkcontent:"Checking contents",volume_Trash:"Trash",dateUnknown:"unknown",Today:"Today",Yesterday:"Yesterday",msJan:"Jan",msFeb:"Feb",msMar:"Mar",msApr:"Apr",msMay:"May",msJun:"Jun",msJul:"Jul",msAug:"Aug",msSep:"Sep",msOct:"Oct",msNov:"Nov",msDec:"Dec",January:"January",February:"February",March:"March",April:"April",May:"May",June:"June",July:"July",August:"August",September:"September",October:"October",November:"November",December:"December",Sunday:"Sunday",Monday:"Monday",Tuesday:"Tuesday",Wednesday:"Wednesday",Thursday:"Thursday",Friday:"Friday",Saturday:"Saturday",Sun:"Sun",Mon:"Mon",Tue:"Tue",Wed:"Wed",Thu:"Thu",Fri:"Fri",Sat:"Sat",sortname:"by name",sortkind:"by kind",sortsize:"by size",sortdate:"by date",sortFoldersFirst:"Folders first",sortperm:"by permission",sortmode:"by mode",sortowner:"by owner",sortgroup:"by group",sortAlsoTreeview:"Also Treeview","untitled file.txt":"NewFile.txt","untitled folder":"NewFolder",Archive:"NewArchive","untitled file":"NewFile.$1",extentionfile:"$1: File",extentiontype:"$1: $2",confirmReq:"Confirmation required",confirmRm:"Are you sure you want to permanently remove items?<br/>This cannot be undone!",confirmRepl:"Replace old file with new one? (If it contains folders, it will be merged. To backup and replace, select Backup.)",confirmRest:"Replace existing item with the item in trash?",confirmConvUTF8:"Not in UTF-8<br/>Convert to UTF-8?<br/>Contents become UTF-8 by saving after conversion.",confirmNonUTF8:"Character encoding of this file couldn't be detected. It need to temporarily convert to UTF-8 for editting.<br/>Please select character encoding of this file.",confirmNotSave:"It has been modified.<br/>Losing work if you do not save changes.",confirmTrash:"Are you sure you want to move items to trash bin?",confirmMove:'Are you sure you want to move items to "$1"?',apllyAll:"Apply to all",name:"Name",size:"Size",perms:"Permissions",modify:"Modified",kind:"Kind",read:"read",write:"write",noaccess:"no access",and:"and",unknown:"unknown",selectall:"Select all items",selectfiles:"Select item(s)",selectffile:"Select first item",selectlfile:"Select last item",viewlist:"List view",viewicons:"Icons view",viewSmall:"Small icons",viewMedium:"Medium icons",viewLarge:"Large icons",viewExtraLarge:"Extra large icons",places:"Places",calc:"Calculate",path:"Path",aliasfor:"Alias for",locked:"Locked",dim:"Dimensions",files:"Files",folders:"Folders",items:"Items",yes:"yes",no:"no",link:"Link",searcresult:"Search results",selected:"selected items",about:"About",shortcuts:"Shortcuts",help:"Help",webfm:"Web file manager",ver:"Version",protocolver:"protocol version",homepage:"Project home",docs:"Documentation",github:"Fork us on GitHub",twitter:"Follow us on Twitter",facebook:"Join us on Facebook",team:"Team",chiefdev:"chief developer",developer:"developer",contributor:"contributor",maintainer:"maintainer",translator:"translator",icons:"Icons",dontforget:"and don't forget to take your towel",shortcutsof:"Shortcuts disabled",dropFiles:"Drop files here",or:"or",selectForUpload:"Select files",moveFiles:"Move items",copyFiles:"Copy items",restoreFiles:"Restore items",rmFromPlaces:"Remove from places",aspectRatio:"Aspect ratio",scale:"Scale",width:"Width",height:"Height",resize:"Resize",crop:"Crop",rotate:"Rotate","rotate-cw":"Rotate 90 degrees CW","rotate-ccw":"Rotate 90 degrees CCW",degree:"°",netMountDialogTitle:"Mount network volume",protocol:"Protocol",host:"Host",port:"Port",user:"User",pass:"Password",confirmUnmount:"Are you sure to unmount $1?",dropFilesBrowser:"Drop or Paste files from browser",dropPasteFiles:"Drop files, Paste URLs or images(clipboard) here",encoding:"Encoding",locale:"Locale",searchTarget:"Target: $1",searchMime:"Search by input MIME Type",owner:"Owner",group:"Group",other:"Other",execute:"Execute",perm:"Permission",mode:"Mode",emptyFolder:"Folder is empty",emptyFolderDrop:"Folder is empty\\A Drop to add items",emptyFolderLTap:"Folder is empty\\A Long tap to add items",quality:"Quality",autoSync:"Auto sync",moveUp:"Move up",getLink:"Get URL link",selectedItems:"Selected items ($1)",folderId:"Folder ID",offlineAccess:"Allow offline access",reAuth:"To re-authenticate",nowLoading:"Now loading...",openMulti:"Open multiple files",openMultiConfirm:"You are trying to open the $1 files. Are you sure you want to open in browser?",emptySearch:"Search results is empty in search target.",editingFile:"It is editing a file.",hasSelected:"You have selected $1 items.",hasClipboard:"You have $1 items in the clipboard.",incSearchOnly:"Incremental search is only from the current view.",reinstate:"Reinstate",complete:"$1 complete",contextmenu:"Context menu",pageTurning:"Page turning",volumeRoots:"Volume roots",reset:"Reset",bgcolor:"Background color",colorPicker:"Color picker","8pxgrid":"8px Grid",enabled:"Enabled",disabled:"Disabled",emptyIncSearch:"Search results is empty in current view.\\A Press [Enter] to expand search target.",emptyLetSearch:"First letter search results is empty in current view.",textLabel:"Text label",minsLeft:"$1 mins left",openAsEncoding:"Reopen with selected encoding",saveAsEncoding:"Save with the selected encoding",selectFolder:"Select folder",firstLetterSearch:"First letter search",presets:"Presets",tooManyToTrash:"It's too many items so it can't into trash.",TextArea:"TextArea",folderToEmpty:'Empty the folder "$1".',filderIsEmpty:'There are no items in a folder "$1".',preference:"Preference",language:"Language",clearBrowserData:"Initialize the settings saved in this browser",toolbarPref:"Toolbar settings",charsLeft:"... $1 chars left.",linesLeft:"... $1 lines left.",sum:"Sum",roughFileSize:"Rough file size",autoFocusDialog:"Focus on the element of dialog with mouseover",select:"Select",selectAction:"Action when select file",useStoredEditor:"Open with the editor used last time",selectinvert:"Invert selection",renameMultiple:"Are you sure you want to rename $1 selected items like $2?<br/>This cannot be undone!",batchRename:"Batch rename",plusNumber:"+ Number",asPrefix:"Add prefix",asSuffix:"Add suffix",changeExtention:"Change extention",columnPref:"Columns settings (List view)",reflectOnImmediate:"All changes will reflect immediately to the archive.",reflectOnUnmount:"Any changes will not reflect until un-mount this volume.",unmountChildren:"The following volume(s) mounted on this volume also unmounted. Are you sure to unmount it?",selectionInfo:"Selection Info",hashChecker:"Algorithms to show the file hash",infoItems:"Info Items (Selection Info Panel)",pressAgainToExit:"Press again to exit.",toolbar:"Toolbar",workspace:"Work Space",dialog:"Dialog",all:"All",iconSize:"Icon Size (Icons view)",editorMaximized:"Open the maximized editor window",editorConvNoApi:"Because conversion by API is not currently available, please convert on the website.",editorConvNeedUpload:"After conversion, you must be upload with the item URL or a downloaded file to save the converted file.",convertOn:"Convert on the site of $1",integrations:"Integrations",integrationWith:"This elFinder has the following external services integrated. Please check the terms of use, privacy policy, etc. before using it.",showHidden:"Show hidden items",hideHidden:"Hide hidden items",toggleHidden:"Show/Hide hidden items",makefileTypes:'File types to enable with "New file"',typeOfTextfile:"Type of the Text file",add:"Add",theme:"Theme",default:"Default",description:"Description",website:"Website",author:"Author",email:"Email",license:"License",exportToSave:"This item can't be saved. To avoid losing the edits you need to export to your PC.",dblclickToSelect:"Double click on the file to select it.",useFullscreen:"Use fullscreen mode",kindUnknown:"Unknown",kindRoot:"Volume Root",kindFolder:"Folder",kindSelects:"Selections",kindAlias:"Alias",kindAliasBroken:"Broken alias",kindApp:"Application",kindPostscript:"Postscript document",kindMsOffice:"Microsoft Office document",kindMsWord:"Microsoft Word document",kindMsExcel:"Microsoft Excel document",kindMsPP:"Microsoft Powerpoint presentation",kindOO:"Open Office document",kindAppFlash:"Flash application",kindPDF:"Portable Document Format (PDF)",kindTorrent:"Bittorrent file",kind7z:"7z archive",kindTAR:"TAR archive",kindGZIP:"GZIP archive",kindBZIP:"BZIP archive",kindXZ:"XZ archive",kindZIP:"ZIP archive",kindRAR:"RAR archive",kindJAR:"Java JAR file",kindTTF:"True Type font",kindOTF:"Open Type font",kindRPM:"RPM package",kindText:"Text document",kindTextPlain:"Plain text",kindPHP:"PHP source",kindCSS:"Cascading style sheet",kindHTML:"HTML document",kindJS:"Javascript source",kindRTF:"Rich Text Format",kindC:"C source",kindCHeader:"C header source",kindCPP:"C++ source",kindCPPHeader:"C++ header source",kindShell:"Unix shell script",kindPython:"Python source",kindJava:"Java source",kindRuby:"Ruby source",kindPerl:"Perl script",kindSQL:"SQL source",kindXML:"XML document",kindAWK:"AWK source",kindCSV:"Comma separated values",kindDOCBOOK:"Docbook XML document",kindMarkdown:"Markdown text",kindImage:"Image",kindBMP:"BMP image",kindJPEG:"JPEG image",kindGIF:"GIF Image",kindPNG:"PNG Image",kindTIFF:"TIFF image",kindTGA:"TGA image",kindPSD:"Adobe Photoshop image",kindXBITMAP:"X bitmap image",kindPXM:"Pixelmator image",kindAudio:"Audio media",kindAudioMPEG:"MPEG audio",kindAudioMPEG4:"MPEG-4 audio",kindAudioMIDI:"MIDI audio",kindAudioOGG:"Ogg Vorbis audio",kindAudioWAV:"WAV audio",AudioPlaylist:"MP3 playlist",kindVideo:"Video media",kindVideoDV:"DV movie",kindVideoMPEG:"MPEG movie",kindVideoMPEG4:"MPEG-4 movie",kindVideoAVI:"AVI movie",kindVideoMOV:"Quick Time movie",kindVideoWM:"Windows Media movie",kindVideoFlash:"Flash movie",kindVideoMKV:"Matroska movie",kindVideoOGG:"Ogg movie"}}),st.fn.elfinderbutton=function(f){return this.each(function(){function e(){a.toHide(n)}var n,t,i="class",a=f.fm,o=a.res(i,"disabled"),r=a.res(i,"active"),s=a.res(i,"hover"),l="elfinder-button-menu-item",c=st('<span class="elfinder-button-text">'+f.title+"</span>"),d=f.className?f.className:f.name,p=st(this).addClass("ui-state-default elfinder-button").attr("title",f.title).append('<span class="elfinder-button-icon elfinder-button-icon-'+d+'"></span>',c).on("mouseenter mouseleave",function(e){p.hasClass(o)||p["mouseleave"==e.type?"removeClass":"addClass"](s)}).on("click",function(e){p.hasClass(o)||(n&&1<=f.variants.length?(n.is(":hidden")&&a.getUI().click(),e.stopPropagation(),n.css(u()).slideToggle({duration:100,done:function(e){a[n.is(":visible")?"toFront":"toHide"](n)}})):a.exec(f.name,h(),{_userAction:!0,_currentType:"toolbar",_currentNode:p}))}),u=function(){var e=a.getUI(),t=e.offset(),n=p.offset();return{top:n.top-t.top,left:n.left-t.left,maxHeight:e.height()-40}},h=function(){var e=a.selected();return e.length||(e=a.cwd()?[a.cwd().hash]:void 0),e};c.hide(),f.button=p,Array.isArray(f.variants)&&(p.addClass("elfinder-menubutton"),n=st('<div class="ui-front ui-widget ui-widget-content elfinder-button-menu elfinder-button-'+d+'-menu ui-corner-all"></div>').hide().appendTo(a.getUI()).on("mouseenter mouseleave","."+l,function(){st(this).toggleClass(s)}).on("click","."+l,function(e){var t=st(this).data("value");e.preventDefault(),e.stopPropagation(),p.removeClass(s),a.toHide(n),void 0===t&&(t={}),"object"==typeof t&&(t._userAction=!0),a.exec(f.name,h(),t)}).on("close",e),a.bind("disable select",e).getUI().on("click",e),f.change(function(){n.html(""),st.each(f.variants,function(e,t){n.append(st('<div class="'+l+'">'+t[1]+"</div>").data("value",t[0]).addClass(t[0]==f.value?"elfinder-button-menu-item-selected":""))})})),f.change(function(){var e;t&&cancelAnimationFrame(t),t=requestAnimationFrame(function(){f.disabled()?p.removeClass(r+" "+s).addClass(o):(p.removeClass(o),p[f.active()?"addClass":"removeClass"](r)),f.syncTitleOnChange&&(e=f.className?f.className:f.name,d!==e&&(p.children(".elfinder-button-icon").removeClass("elfinder-button-icon-"+d).addClass("elfinder-button-icon-"+e),n&&n.removeClass("elfinder-button-"+d+"-menu").addClass("elfinder-button-"+e+"-menu"),d=e),c.html(f.title),p.attr("title",f.title))})}).change()})},st.fn.elfindercontextmenu=function(E){return this.each(function(){st(this);function h(e,t,n,i){var a,o,r="",s="",l="";return i&&(i.className&&(r=" "+i.className),i.iconClass&&(l=i.iconClass,t=""),i.iconImg&&(o=(a=i.iconImg.split(/ +/))[1]&&a[2]?E.escape(a[1]+"px "+a[2]+"px"):"",s=" style=\"background:url('"+E.escape(a[0])+"') "+(o||"0 0")+" no-repeat;"+(o?"":"posbackground-size:contain;")+'"')),st(c.replace("{icon}",t?"elfinder-button-icon-"+t:l||"").replace("{label}",e).replace("{style}",s).replace("{className}",r)).on("click",function(e){e.stopPropagation(),e.preventDefault(),n()})}function f(e){var t=e.keyCode,n=st.ui.keyCode.ESCAPE,i=st.ui.keyCode.ENTER,a=st.ui.keyCode.LEFT,o=st.ui.keyCode.RIGHT,r=st.ui.keyCode.UP,s=st.ui.keyCode.DOWN,l="ltr"===E.direction?o:a,c=l===o?a:o;-1!==st.inArray(t,[n,i,a,o,r,s])&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),t==n||t===c?g&&y&&w?(w.trigger("mouseleave").trigger("submenuclose"),g.addClass(T),w=y=null):t==n&&I():t==r||t==s?y?(w&&w.trigger("mouseleave"),t==s&&(!w||y.length<=++y._cur)?y._cur=0:t==r&&(!w||--y._cur<0)&&(y._cur=y.length-1),w=y.eq(y._cur).trigger("mouseenter")):(y=null,g&&g.trigger("mouseleave"),t==s&&(!g||b.length<=++b._cur)?b._cur=0:t==r&&(!g||--b._cur<0)&&(b._cur=b.length-1),g=b.eq(b._cur).addClass(T)):!g||t!=i&&t!==l||(g.hasClass("elfinder-contextmenu-group")?w?t==i&&w.click():(g.trigger("mouseenter"),(y=g.find("div."+C))._cur=0,w=y.first().addClass(T)):t==i&&g.click()))}function o(r,s){var e,l,c=!1,d=!1,p=[],u="cwd"===r;M=r,i=s,(l=E.option("uiCmdMap",u?void 0:s[0]))||(l={}),u||(p=E.getDisabledCmds(s)),1<(e=E.selected().length)&&A.append('<div class="ui-corner-top ui-widget-header elfinder-contextmenu-header"><span>'+E.i18n("selectedItems",""+e)+"</span></div>"),b=st(),st.each(n[r]||[],function(e,t){var i,n,a,m,g,o;if("|"!==t){if(l[t]?(n=l[t],a=!0):n=t,!(i=E.getCommand(n))||u||E.searchStatus.state&&i.disableOnSearch||(i.__disabled=i._disabled,i._disabled=!(i.alwaysEnabled||E._commands[n]&&!(-1!==st.inArray(t,p)||a&&p[n])),st.each(i.linkedCmds,function(e,t){var n;(n=E.getCommand(t))&&(n.__disabled=n._disabled,n._disabled=!(n.alwaysEnabled||E._commands[t]&&!p[t]))})),i&&!i._disabled&&-1!=i.getstate(s)){if(i.variants){if(!i.variants.length)return;m=h(i.title,i.className?i.className:i.name,function(){},i.contextmenuOpts),g=st('<div class="ui-front ui-corner-all elfinder-contextmenu-sub"></div>').hide().css("max-height",E.getUI().height()-30).appendTo(m.append('<span class="elfinder-contextmenu-arrow"></span>')),o=function(e){var t,n,i,a,o,r,s,l,c,d,p,u,h,f;e?(t=v.attr("style"),v.width(v.width()),g.css({top:"-1000px",left:"auto",right:"auto"}),i=(n=m.offset()).left,a=n.top,o=m.outerWidth(),r=g.outerWidth(!0),s=g.outerHeight(!0),c=(l=v.offset()).left+v.width(),d=l.top+v.height(),u=o,(p=j)?10<(f=i+o+r-c)&&(r-5<i?(u-=5,p=!1):E.UA.Mobile||(u=o-f)):0<(f=r-i)&&(i+o+r-15<c?(u-=5,p=!0):E.UA.Mobile||(u=o-f)),h=0<(f=a+5+s-d)&&a<d?5-f:0<f?30-s:5,A.find(".elfinder-contextmenu-sub:visible").hide(),g.css({top:h,left:p?u:"auto",right:p?"auto":u,overflowY:"auto"}).show(),v.attr("style",t)):g.hide()},m.addClass("elfinder-contextmenu-group").on("mouseleave",".elfinder-contextmenu-sub",function(e){A.data("draged")||A.removeData("submenuKeep")}).on("submenuclose",".elfinder-contextmenu-sub",function(e){o(!1)}).on("click","."+C,function(e){var t,n;e.stopPropagation(),A.data("draged")||(n=st(this),i.keepContextmenu?(n.removeClass(T),m.addClass(T)):A.hide(),void 0===(t=n.data("exec"))&&(t={}),"object"==typeof t&&(t._userAction=!0,t._currentType=r,t._currentNode=n),i.keepContextmenu||I(),E.exec(i.name,s,t))}).on("touchend",function(e){A.data("drag")||(o(!0),A.data("submenuKeep",!0))}).on("mouseenter mouseleave",function(e){A.data("touching")||(m.data("timer")&&(clearTimeout(m.data("timer")),m.removeData("timer")),st(e.target).closest(".elfinder-contextmenu-sub",A).length||("mouseleave"===e.type?A.data("submenuKeep")||m.data("timer",setTimeout(function(){m.removeData("timer"),o(!1)},250)):m.data("timer",setTimeout(function(){m.removeData("timer"),o(!0)},b.find("div.elfinder-contextmenu-sub:visible").length?250:0))))}),st.each(i.variants,function(e,t){var n,i,a,o,r="|"===t?'<div class="elfinder-contextmenu-separator"></div>':st('<div class="'+k+" "+C+'"><span>'+t[1]+"</span></div>").data("exec",t[0]);void 0!==t[2]&&(n=st("<span></span>").addClass("elfinder-button-icon elfinder-contextmenu-icon"),/\//.test(t[2])?n.css((i=t[2],a=i.split(/ +/),o=a[1]&&a[2]?a[1]+"px "+a[2]+"px":"",{backgroundImage:'url("'+a[0]+'")',backgroundRepeat:"no-repeat",backgroundPosition:o||"",backgroundSize:o?"":"contain"})):n.addClass("elfinder-button-icon-"+t[2]),r.prepend(n).addClass(C+"-icon")),g.append(r)})}else m=h(i.title,i.className?i.className:i.name,function(){A.data("draged")||(i.keepContextmenu||I(),E.exec(i.name,s,{_userAction:!0,_currentType:r,_currentNode:m}))},i.contextmenuOpts),i.extra&&i.extra.node?(st('<span class="elfinder-button-icon elfinder-button-icon-'+(i.extra.icon||"")+" "+z+'"></span>').append(i.extra.node).appendTo(m),st(i.extra.node).trigger("ready",{targets:s})):m.remove("."+z);i.extendsCmd&&m.children("span.elfinder-button-icon").addClass("elfinder-button-icon-"+i.extendsCmd),d&&A.append('<div class="elfinder-contextmenu-separator"></div>'),A.append(m),d=!(c=!0)}i&&void 0!==i.__disabled&&(i._disabled=i.__disabled,delete i.__disabled,st.each(i.linkedCmds,function(e,t){var n;(n=E.getCommand(t))&&(n._disabled=n.__disabled,delete n.__disabled)}))}else c&&(d=!0)}),b=A.children("div."+k)}var v,m,b,g,y,w,x,k="elfinder-contextmenu-item",C="elfinder-contextsubmenu-item",z="elfinder-contextmenu-extra-icon",T=E.res("class","hover"),t={distance:8,start:function(){A.data("drag",!0).data("touching")&&A.find("."+T).removeClass(T)},stop:function(){A.data("draged",!0).removeData("drag")}},A=st(this).addClass("touch-punch ui-helper-reset ui-front ui-widget ui-state-default ui-corner-all elfinder-contextmenu elfinder-contextmenu-"+E.direction).hide().on("touchstart",function(e){A.data("touching",!0).children().removeClass(T)}).on("touchend",function(e){A.removeData("touching")}).on("mouseenter mouseleave","."+k,function(e){st(this).toggleClass(T,!("mouseenter"!==e.type&&(A.data("draged")||!A.data("submenuKeep")))),A.data("draged")&&A.data("submenuKeep")&&A.find(".elfinder-contextmenu-sub:visible").parent().addClass(T)}).on("mouseenter mouseleave","."+z,function(e){st(this).parent().toggleClass(T,"mouseleave"===e.type)}).on("mouseenter mouseleave","."+k+",."+C,function(e){function t(n,i){st.each(i?y:b,function(e,t){if(n[0]===t)return(i?y:b)._cur=e,i?w=n:g=n,!1})}var n,i,a;e.originalEvent&&(n=st(this),i=function(){g&&!g.children("div.elfinder-contextmenu-sub:visible").length&&g.removeClass(T)},"mouseenter"===e.type?n.hasClass(C)?(w&&w.removeClass(T),g&&(y=g.find("div."+C)),t(n,!0)):(i(),t(n)):n.hasClass(C)?y=w=null:(i(),a=g,setTimeout(function(){a===g&&(g=null)},250)))}).on("contextmenu",function(){return!1}).on("mouseup",function(){setTimeout(function(){A.removeData("draged")},100)}).draggable(t),j="ltr"===E.direction,O=j?"left":"right",n=Object.assign({},E.options.contextmenu),c='<div class="'+k+'{className}"><span class="elfinder-button-icon {icon} elfinder-contextmenu-icon"{style}></span><span>{label}</span></div>',S=function(e,t,n){var i,a,o=A.outerWidth(),r=A.outerHeight(),s=v.attr("style"),l=v.offset(),c=v.width(),d=v.height(),p=E.UA.Mobile?40:2,u=E.UA.Mobile?20:2,e=e-(l?l.left:0),t=t-(l?l.top:0),n=Object.assign(n||{},{top:Math.max(0,t+u+r<d?t+u:t-(t+r-d)),left:Math.max(0,e<o+p||e+p+o<c?e+p:e-p-o),opacity:"1"});x=!0,E.autoSync("stop"),v.width(c),A.stop().removeAttr("style").css(n),E.toFront(A),A.show(),v.attr("style",s),n[O]=parseInt(A.width()),A.find(".elfinder-contextmenu-sub").css(n),E.UA.iOS&&st("div.elfinder div.overflow-scrolling-touch").css("-webkit-overflow-scrolling","auto"),w=y=g=null,st(document).on("keydown."+E.namespace,f),(i=st._data(document).events)&&i.keydown&&i.keydown.unshift(i.keydown.pop()),E.UA.Mobile&&(a="touchstart.contextmenuAutoToggle",A.data("hideTm")&&clearTimeout(A.data("hideTm")),A.is(":visible")&&A.on("touchstart",function(e){1<e.originalEvent.touches.length||(A.stop(),E.toFront(A),A.data("hideTm")&&clearTimeout(A.data("hideTm")))}).data("hideTm",setTimeout(function(){A.is(":visible")&&(m.find(".elfinder-cwd-file").off(a),m.find(".elfinder-cwd-file.ui-selected").one(a,function(e){if(!(1<e.originalEvent.touches.length)){var t=st(e.target);if(A.first().length&&!t.is("input:checkbox")&&!t.hasClass("elfinder-cwd-select"))return e.stopPropagation(),S(e.originalEvent.touches[0].pageX,e.originalEvent.touches[0].pageY),m.data("longtap",!0),void t.one("touchend",function(){setTimeout(function(){m.removeData("longtap")},80)});m.find(".elfinder-cwd-file").off(a)}}).one("unselect."+E.namespace,function(){m.find(".elfinder-cwd-file").off(a)}),A.fadeOut({duration:300,fail:function(){A.css("opacity","1").show()},done:function(){E.toHide(A)}}))},4500))),requestAnimationFrame(function(){E.getUI().one("click."+E.namespace,I)})},I=function(){if(E.getUI().off("click."+E.namespace,I),st(document).off("keydown."+E.namespace,f),M=i=null,A.is(":visible")||A.children().length){E.toHide(A.removeAttr("style").empty().removeData("submenuKeep"));try{A.draggable("instance")||A.draggable(t)}catch(e){A.hasClass("ui-draggable")||A.draggable(t)}A.data("prevNode")&&(A.data("prevNode").after(A),A.removeData("prevNode")),E.trigger("closecontextmenu"),E.UA.iOS&&st("div.elfinder div.overflow-scrolling-touch").css("-webkit-overflow-scrolling","touch")}x&&E.searchStatus.state<1&&!E.searchStatus.ininc&&E.autoSync(),x=!1},M=null,i=null;E.one("load",function(){v=E.getUI(),m=E.getUI("cwd"),E.bind("contextmenu",function(e){var t,n,i=e.data,a={};i.type&&"files"!==i.type&&m.trigger("unselectall"),I(),i.type&&i.targets?(E.trigger("contextmenucreate",i),o(i.type,i.targets),E.trigger("contextmenucreatedone",i)):i.raw&&(n=i.raw,M="raw",st.each(n,function(e,t){var n;"|"===t?A.append('<div class="elfinder-contextmenu-separator"></div>'):t.label&&"function"==typeof t.callback&&(n=h(t.label,t.icon,function(){A.data("draged")||(t.remain||I(),t.callback())},t.options||null),A.append(n))}),b=A.children("div."+k)),A.children().length&&((t=i.prevNode||null)&&(A.data("prevNode",A.prev()),t.after(A)),i.fitHeight&&(a={maxHeight:Math.min(E.getUI().height(),st(window).height()),overflowY:"auto"},A.draggable("destroy").removeClass("ui-draggable")),S(i.x,i.y,a),i.opened&&"function"==typeof i.opened&&i.opened.call(A))}).one("destroy",function(){A.remove()}).bind("disable",I).bind("select",function(e){"files"!==M||e.data&&e.data.selected.toString()===i.toString()||I()})}).shortcut({pattern:"mac"===E.OS?"ctrl+m":"contextmenu shift+f10",description:"contextmenu",callback:function(e){e.stopPropagation(),e.preventDefault(),st(document).one("contextmenu."+E.namespace,function(e){e.preventDefault(),e.stopPropagation()});var t,n,i,a,o=E.selected();o.length?(t="files",n=o,a=E.cwdHash2Elm(o[0])):(t="cwd",n=[E.cwd().hash],i=E.getUI("workzone").offset()),a&&a.length||(a=E.getUI("workzone")),(i=a.offset()).top+=a.height()/2,i.left+=a.width()/2,E.trigger("contextmenu",{type:t,targets:n,x:i.left,y:i.top})}})})},st.fn.elfindercwd=function(Re,He){return this.not(".elfinder-cwd").each(function(){function o(){return'<tr id="{id}" class="'+C+' {permsclass} {dirclass}" title="{tooltip}"{css}><td class="elfinder-col-name"><div class="elfinder-cwd-file-wrapper"><span class="elfinder-cwd-icon {mime}"{style}></span>{marker}<span class="elfinder-cwd-filename">{name}</span></div>'+_+"</td>"+function(){for(var e="",t=0;t<R.length;t++)e+='<td class="elfinder-col-'+R[t]+'">{'+R[t]+"}</td>";return e}()+"</tr>"}function h(n){return n.mime&&"directory"!==n.mime&&!X[n.mime]&&function(e,t){var n,i,a;if(e&&!X[e]&&(void 0===s&&(st("#elfinderAddBadgeStyle"+Re.namespace).length&&st("#elfinderAddBadgeStyle"+Re.namespace).remove(),s=st('<style id="addBadgeStyle'+Re.namespace+'"></style>').insertBefore(st("head").children(":first")).get(0).sheet||null),s)){if(a=(e=e.toLowerCase()).split("/"),i=Re.escape(Re.mimeTypes[e]||(t.replace(/.bac?k$/i,"").match(/\.([^.]+)$/)||["",""])[1])){n=".elfinder-cwd-icon-"+a[0].replace(/(\.|\+)/g,"-"),void 0!==a[1]&&(n+=".elfinder-cwd-icon-"+a[1].replace(/(\.|\+)/g,"-"));try{s.insertRule(n+':before{content:"'+i.toLowerCase()+'"}',0)}catch(e){}}X[e]=!0}}(n.mime,n.name),W[k?"row":"icon"].replace(/\{([a-z0-9_]+)\}/g,function(e,t){return K[t]?K[t](n,Re):n[t]?n[t]:""})}function a(e){Re.cwdHash2Elm(e).trigger(m)}function t(){Re.cwd().hash,_&&Ie.find("input").prop("checked",!0),Re.lazy(function(){var e;Re.maxTargets&&(q||P).length>Re.maxTargets?(Z({notrigger:!0}),e=(e=st.map(q||P,function(e){return Re.file(e)||null})).slice(0,Re.maxTargets),Y={},st.each(e,function(e,t){Y[t.hash]=!0,Re.cwdHash2Elm(t.hash).trigger(m)}),Re.toast({mode:"warning",msg:Re.i18n(["errMaxTargets",Re.maxTargets])})):(je.find("[id]:not(."+w+"):not(.elfinder-cwd-parent)").trigger(m),Y=Re.arrayFlip(q||P,!0)),te(),_&&Ie.data("pending",!1)},0,{repaint:!0})}function i(e){function t(e){e&&(de=st(h(st.extend(!0,{},e,{name:"..",i18:"..",mime:"directory"}))).addClass("elfinder-cwd-parent").on("dblclick",function(){Re.trigger("select",{selected:[n]}).exec("open",n)}),(k?de.children("td:first"):de).children(".elfinder-cwd-select").remove(),Re.cwdHash2Elm(n).length?Re.cwdHash2Elm(n).replaceWith(de):(k?je.find("tbody"):je).prepend(de),Re.draggingUiHelper&&Re.draggingUiHelper.data("refreshPositions",1))}var n=Re.cwd().phash,i=Re.file(n)||null;i?t(i):(t({hash:n,read:!0,write:!0}),Re.getUI("tree").length?Re.one("parents",function(){t(Re.file(n)||null),Oe.trigger(oe)}):Re.request({data:{cmd:"parents",target:Re.cwd().hash},preventFail:!0}).done(function(e){t(Re.file(n)||null),Oe.trigger(oe)}))}function c(e,t){var n,i,a,o,r,s,l=k?je.find("tbody"):je,c=e.length,d={},p=!!st.htmlPrefilter,u=st(p?document.createDocumentFragment():"<div></div>");if(pe<c)Ae(),Y=Re.arrayFlip(st.map(e,function(e){return e.hash}),!0),te();else{for(c&&Fe.removeClass("elfinder-cwd-wrapper-empty"),s="self"===Re.option("tmbUrl");c--;)i=(n=e[c]).hash,Re.cwdHash2Elm(i).length||((a=function(e){for(var t,n=je.find("[id]:first");n.length;){if(t=Re.file(Re.cwdId2Hash(n.attr("id"))),!n.hasClass("elfinder-cwd-parent")&&t&&Re.compare(e,t)<0)return n;n=n.next("[id]")}}(n))&&!a.length&&(a=null),!a&&0<=(r=function(e){for(var t=ie.length,n=0;n<t;n++)if(Re.compare(e,ie[n])<0)return n;return t||-1}(n))?ie.splice(r,0,n):(u.empty().append(h(n)),"directory"!==n.mime||f||be(u),o=p?u:u.children(),a?a.before(o):l.append(o),++ae.renderd),Re.cwdHash2Elm(i).length&&(n.tmb&&(1!=n.tmb||0<n.size)||s&&0===n.mime.indexOf("image/"))&&(d[i]=n.tmb||"self"));k&&(ge(),me({fitWidth:!L})),xe(l),Object.keys(d).length&&(Object.assign(ae.attachTmbs,d),ie.length<1&&we())}}function r(e){var t,n,i,a,o=e.length,r=1<Re.searchStatus.state,s=Re.getCommand(Re.currentReqCmd)||{};if(!Re.cwd().hash&&!s.noChangeDirOnRemovedCwd)return st.each(U.reverse(),function(e,t){if(Re.file(t))return a=!0,Re.one(Re.currentReqCmd+"done",function(){Re.cwd().hash||Re.exec("open",t)}),!1}),a||Re.cwd().hash||Re.exec("open",Re.roots[Object.keys(Re.roots)[0]]),0;for(;o--;){if(t=e[o],(n=Re.cwdHash2Elm(t)).length)try{n.remove(),--ae.renderd}catch(e){Re.debug("error",e)}else-1!==(i=function(e){for(var t=ie.length;t--;)if(ie[t].hash==e)return t;return-1}(t))&&ie.splice(i,1);Y[t]&&delete Y[t],r&&-1!==(i=st.inArray(t,P))&&P.splice(i,1)}r&&Re.trigger("cwdhasheschange",P),k&&(ge(),me({fitWidth:!L}))}var x,s,l,d,p,u,e,f=Re.UA.Mobile,k="list"==Re.viewType,m="select."+Re.namespace,g="unselect."+Re.namespace,v="disable."+Re.namespace,b="enable."+Re.namespace,y="class",C=Re.res(y,"cwdfile"),z="."+C,w="ui-selected",T=Re.res(y,"disabled"),A=Re.res(y,"draggable"),j=Re.res(y,"droppable"),O=Re.res(y,"hover"),n=Re.res(y,"active"),S=Re.res(y,"adroppable"),I=C+"-tmp",M="elfinder-cwd-selectchk",E=0<Re.options.loadTmbs?Re.options.loadTmbs:5,F="",D={},U=[],P=[],q=void 0,R=[],H="",_=st.map(He.showSelectCheckboxUA,function(e){return!(!Re.UA[e]&&!e.match(/^all$/i))||null}).length?'<div class="elfinder-cwd-select"><input type="checkbox" class="'+M+'"></div>':"",N=!1,L=null,W={icon:'<div id="{id}" class="'+C+' {permsclass} {dirclass} ui-corner-all" title="{tooltip}"><div class="elfinder-cwd-file-wrapper ui-corner-all"><div class="elfinder-cwd-icon {mime} ui-corner-all" unselectable="on"{style}></div>{marker}</div><div class="elfinder-cwd-filename" title="{nametitle}">{name}</div>'+_+"</div>",row:""},B=Re.res("tpl","perms"),$=Re.res("tpl","lock"),V=Re.res("tpl","symlink"),K={id:function(e){return Re.cwdHash2Id(e.hash)},name:function(e){var t=Re.escape(e.i18||e.name);return k||(t=t.replace(/([_.])/g,"​$1")),t},nametitle:function(e){return Re.escape(e.i18||e.name)},permsclass:function(e){return Re.perms2class(e)},perm:function(e){return Re.formatPermissions(e)},dirclass:function(e){var t="directory"==e.mime?"directory":"";return e.isroot&&(t+=" isroot"),e.csscls&&(t+=" "+Re.escape(e.csscls)),He.getClass&&(t+=" "+He.getClass(e)),t},style:function(e){return e.icon?Re.getIconStyle(e):""},mime:function(e){var t=Re.mime2class(e.mime);return e.icon&&(t+=" elfinder-cwd-bgurl"),t},size:function(e){return"directory"!==e.mime||e.size?Re.formatSize(e.size):"-"},date:function(e){return Re.formatDate(e)},kind:function(e){return Re.mime2kind(e)},mode:function(e){return e.perm?Re.formatFileMode(e.perm):""},modestr:function(e){return e.perm?Re.formatFileMode(e.perm,"string"):""},modeoct:function(e){return e.perm?Re.formatFileMode(e.perm,"octal"):""},modeboth:function(e){return e.perm?Re.formatFileMode(e.perm,"both"):""},marker:function(e){return(e.alias||"symlink-broken"==e.mime?V:"")+(e.read&&e.write?"":B)+(e.locked?$:"")},tooltip:function(e){var t=Re.formatDate(e)+(0<e.size?" ("+Re.formatSize(e.size)+")":""),n="",n=F&&e.path?Re.escape(e.path.replace(/\/[^\/]*$/,"")):e.tooltip?Re.escape(e.tooltip).replace(/\r/g," "):"";return k&&(n+=(n?" ":"")+Re.escape(e.i18||e.name)),n?n+" "+t:t}},X={},J=st(),G=!1,Y={},Q=!1,Z=function(e){var t=e||{};_&&Ie.find("input").prop("checked",!1),Object.keys(Y).length&&(G=!1,Y={},je.find("[id]."+w).trigger(g),_&&je.find("input:checkbox."+M).prop("checked",!1)),t.notrigger||te(),_&&Ie.data("pending",!1),je.removeClass("elfinder-cwd-allselected")},ee=void 0,te=function(){var e=Object.keys(Y),t={selected:e,origin:"cwd"};de&&(1<e.length||e[0]!==Re.cwdId2Hash(de.attr("id")))&&de.hasClass(w)&&de.trigger(g),Q=e.length&&e.length===(q||P).length&&(!Re.maxTargets||e.length<=Re.maxTargets),_&&(Ie.find("input").prop("checked",Q),je[Q?"addClass":"removeClass"]("elfinder-cwd-allselected")),Q?t.selectall=!0:e.length||(t.unselectall=!0),Re.trigger("select",t)},ne=function(e,t){var n,i,a,o,r;e.length&&(n=e.position().top,i=e.outerHeight(!0),(a=Oe.scrollTop())+(o=Oe.get(0).clientHeight)<n+(r=he?he.outerHeight(!0):0)+i?Oe.scrollTop(parseInt(n+r+i-o)):n<a&&Oe.scrollTop(n),k&&Oe.scrollLeft(0),t&&Re.resources.blink(e,"lookme"))},ie=[],ae={},oe="elfscrstop",re=!1,se={disabled:!0,filter:"[id]:first",stop:te,delay:250,appendTo:"body",autoRefresh:!1,selected:function(e,t){st(t.selected).trigger(m)},unselected:function(e,t){st(t.unselected).trigger(g)}},le={},ce=function(e,t){if(ae.renderd){var n=(k?je.find("tbody:first"):je).children("[id]"+(He.oldSchool?":not(.elfinder-cwd-parent)":"")+":first");if(n.length){function i(){for(var e,t,n=0;n<5&&((e=g.attr("id"))&&(ae.getTmbs=[],t=Re.cwdId2Hash(e),le[t]=e,ae.attachTmbs[t]&&(b[t]=ae.attachTmbs[t]),f&&(v[e]=!0)),(g=g.next()).length);n++);}function a(){var e;je.data("selectable")&&(Object.assign(v,Y),(e=Object.keys(v)).length&&(se.filter="#"+e.join(", #"),je.selectable("enable").selectable("option",{filter:se.filter}).selectable("refresh"))),Object.keys(b).length&&(ae.getTmbs=[],ye(b))}function o(){g.hasClass(C)||(g=g.closest(z))}var r,s,l,c,d,p,u,h,f=je.data("selectable"),m=(l=Oe.offset(),c=Oe.width(),d=st(window),p=n.width()/2,u=Math.min(l.left-d.scrollLeft()+("ltr"===Re.direction?p:c-p),l.left+c-10),h=l.top-d.scrollTop()+10+(k?x:0),{left:Math.max(0,Math.round(u)),top:Math.max(0,Math.round(h))}),g=e?n:st(document.elementFromPoint(m.left,m.top)),v={},b={},y=Math.ceil((ae.hpi?Math.ceil(Fe.data("rectangle").height/ae.hpi*1.5):pe)/5);if(le={},f&&je.selectable("option","disabled"),g.length&&(g.hasClass(C)||g.closest(z).length||((s=Re.getUI().find(".ui-dialog:visible,.ui-widget:visible")).length?(s.hide(),g=st(document.elementFromPoint(m.left,m.top)),s.show()):s=null),o(),g.length||(s&&s.hide(),g=st(document.elementFromPoint(m.left,m.top+5)),s&&s.show(),o())),g.length){if(g.attr("id"))if(e){for(var w=0;w<y&&(i(),g.length);w++);a()}else ae.repaintJob&&"pending"===ae.repaintJob.state()&&ae.repaintJob.reject(),r=new Array(y),ae.repaintJob=Re.asyncJob(function(){i(),g.length||(a(),ae.repaintJob&&"pending"===ae.repaintJob.state()&&ae.repaintJob.reject())},r).done(a)}else e&&ae.renderd&&(t=t||0)<10&&requestAnimationFrame(function(){ce(e,++t)})}}},de=null,pe=Re.options.showFiles,ue=function(){var d,e,t,p,u,n;ae.rendering||ae.renderd&&!ie.length||(d=k?je.children("table").children("tbody"):je,p=!!st.htmlPrefilter,u=st(p?document.createDocumentFragment():"<div></div>"),n=function(e){var t,n,i=e||null,a=[],o=!1,r={},s="self"===Re.option("tmbUrl"),l=!ae.renderd,c=ie.splice(0,pe+(i||0)/(ae.hpi||1));ae.renderd+=c.length,ie.length||(Se.hide(),Oe.off(oe,ue)),t=[],a=st.map(c,function(e){return e.hash&&e.name?("directory"==e.mime&&(o=!0),(e.tmb&&(1!=e.tmb||0<e.size)||s&&0===e.mime.indexOf("image/"))&&(r[e.hash]=e.tmb||"self"),D[e.hash]&&t.push(e.hash),h(e)):null}),u.empty().append(a.join("")),o&&!f&&be(u),n=[],Object.keys(Y).length&&u.find("[id]:not(."+w+"):not(.elfinder-cwd-parent)").each(function(){Y[Re.cwdId2Hash(this.id)]&&n.push(st(this))}),d.append(p?u:u.children()),n.length&&(st.each(n,function(e,t){t.trigger(m)}),te()),t.length&&Re.trigger("lockfiles",{files:t}),ae.hpi||xe(d,c.length),k&&(je.find("thead").show(),me({fitWidth:!L})),Object.keys(r).length&&Object.assign(ae.attachTmbs,r),l&&(f||je.data("selectable")||je.selectable(se).data("selectable",!0)),re||Oe.trigger(oe)},ae.renderd||(ae.rendering=!0,Oe.scrollTop(0),e=Re.cwd().phash,n(),He.oldSchool&&(e&&!F?i():de=st()),k&&(L&&ge(),me({fitWidth:!0})),ae.itemH=(k?d.find("tr:first"):d.find("[id]:first")).outerHeight(!0),Re.trigger("cwdrender"),ae.rendering=!1,ce(!0)),!ae.rendering&&ie.length?0<(t=Oe.height()+Oe.scrollTop()+Re.options.showThreshold+ae.row-ae.renderd*ae.hpi)?(ae.rendering=!0,Re.lazy(function(){n(t),ae.rendering=!1})):Re.enabled()||Ee():Ee())},he=null,fe=Re.UA.CSS.positionSticky&&Re.UA.CSS.widthMaxContent,me=function(e){if(x=0,He.listView.fixedHeader){function t(){var e="ltr"===Re.direction?"left":"right",t=-1*("ltr"===Re.direction?Oe.scrollLeft():a.outerWidth(!0)-Oe.width()-Oe.scrollLeft());i.css(e)!==t&&i.css(e,t)}var n,i,a,o,r,s,l,c,d,p,u,h=e||{},f=je.find("tbody"),m=f.children("tr:first");if(m.length&&m.is(":visible")){if(a=f.parent(),he?s=(o=st("#"+Re.namespace+"-cwd-thead")).children("tr:first"):(u=!0,f.addClass("elfinder-cwd-fixheader"),r=(s=(o=je.find("thead").attr("id",Re.namespace+"-cwd-thead")).children("tr:first")).outerHeight(!0),je.css("margin-top",r-parseInt(a.css("padding-top"))),fe?(he=st('<div class="elfinder-table-header-sticky"></div>').addClass(je.attr("class")).append(st("<table></table>").append(o)),je.after(he),Oe.on("resize.fixheader",function(e){e.stopPropagation(),me({fitWidth:!0})})):(i=st("<div></div>").addClass(je.attr("class")).append(st("<table></table>").append(o)),he=st("<div></div>").addClass(Oe.attr("class")+" elfinder-cwd-fixheader").removeClass("ui-droppable native-droppable").css(Oe.position()).css({height:r,width:je.outerWidth()}).append(i),"rtl"===Re.direction&&he.css("left",Oe.data("width")-Oe.width()+"px"),t(),Oe.after(he).on("scroll.fixheader resize.fixheader",function(e){t(),"resize"===e.type&&(e.stopPropagation(),he.css(Oe.position()),Oe.data("width",Oe.css("overflow","hidden").width()),Oe.css("overflow","auto"),me())}))),u||h.fitWidth||2<Math.abs(m.outerWidth()-s.outerWidth())){n=R.length+1;for(var g=0;g<n&&(l=s.children("td:eq("+g+")"),c=m.children("td:eq("+g+")"),d=l.width(),p=c.width(),void 0===l.data("delta")&&l.data("delta",l.outerWidth()-d-(c.outerWidth()-p)),p-=l.data("delta"),u||h.fitWidth||d!==p);g++)l.css("width",p+"px")}fe||(he.data("widthTimer")&&cancelAnimationFrame(he.data("widthTimer")),he.data("widthTimer",requestAnimationFrame(function(){he&&(he.css("width",De.width()+"px"),"rtl"===Re.direction&&he.css("left",Oe.data("width")-Oe.width()+"px"))}))),x=o.height()}}},ge=function(){var e,i;k&&L&&(e="elfinder-cwd-colwidth",(i=je.find("tr[id]:first")).hasClass(e)||(je.find("tr."+e).removeClass(e).find("td").css("width",""),i.addClass(e),je.find("table:first").css("table-layout","fixed"),st.each(st.merge(["name"],R),function(e,t){var n=L[t]||i.find("td.elfinder-col-"+t).width();i.find("td.elfinder-col-"+t).width(n)})))},ve=Object.assign({},Re.droppable,{over:function(e,t){var n,i,a,o=st(this),r=t.helper,s=e.shiftKey||e.ctrlKey||e.metaKey;e.stopPropagation(),r.data("dropover",r.data("dropover")+1),o.data("dropover",!0),r.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus"),r.data("namespace")===Re.namespace&&Re.insideWorkzone(e.pageX,e.pageY)?(o.hasClass(Re.res(y,"cwdfile"))?(n=Re.cwdId2Hash(o.attr("id")),o.data("dropover",n)):(n=Re.cwd().hash,Re.cwd().write&&o.data("dropover",n)),a=Re.file(r.data("files")[0]).phash===n,o.data("dropover")===n?st.each(r.data("files"),function(e,t){if(t===n||a&&!s&&!r.hasClass("elfinder-drag-helper-plus"))return o.removeClass(S),!1}):o.removeClass(S),r.data("locked")||a?i="elfinder-drag-helper-plus":(i="elfinder-drag-helper-move",s&&(i+=" elfinder-drag-helper-plus")),o.hasClass(S)&&r.addClass(i),requestAnimationFrame(function(){o.hasClass(S)&&r.addClass(i)})):o.removeClass(S)},out:function(e,t){var n=t.helper;e.stopPropagation(),n.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus").data("dropover",Math.max(n.data("dropover")-1,0)),st(this).removeData("dropover").removeClass(S)},deactivate:function(){st(this).removeData("dropover").removeClass(S)},drop:function(e,t){Z({notrigger:!0}),Re.droppable.drop.call(this,e,t)}}),be=function(e){var t=(e=e||(k?je.find("tbody"):je)).children(".directory:not(."+j+",.elfinder-na,.elfinder-ro)");Re.isCommandEnabled("paste")&&t.droppable(ve),Re.isCommandEnabled("upload")&&t.addClass("native-droppable"),e.children(".isroot").each(function(e,t){var n=st(t),i=Re.cwdId2Hash(t.id);Re.isCommandEnabled("paste",i)?n.hasClass(j+",elfinder-na,elfinder-ro")||n.droppable(ve):n.hasClass(j)&&n.droppable("destroy"),Re.isCommandEnabled("upload",i)?n.hasClass("native-droppable,elfinder-na,elfinder-ro")||n.addClass("native-droppable"):n.hasClass("native-droppable")&&n.removeClass("native-droppable")})},ye=function(e,s){st.isPlainObject(e)&&Object.keys(e).length&&(Object.assign(ae.attachTmbs,e),st.each(e,function(e,t){var n,i,a,o,r=Re.cwdHash2Elm(e);r.length&&("1"!=t?((n=Re.file(e)).tmb!==t&&(n.tmb=t),i=Re.tmb(n),s?r.find(".elfinder-cwd-icon").addClass(i.className).css("background-image","url('"+i.url+"')"):(a=r,o=i,st("<img/>").on("load",function(){a.find(".elfinder-cwd-icon").addClass(o.className).css("background-image","url('"+o.url+"')")}).attr("src",o.url)),delete ae.attachTmbs[e]):s?we([e]):ae.tmbLoading[e]||ae.getTmbs.push(e))}),s||!ae.getTmbs.length||Object.keys(ae.tmbLoading).length||we())},we=function(t){var a=[],o=!1;Re.oldAPI?Re.request({data:{cmd:"tmb",current:Re.cwd().hash},preventFail:!0}).done(function(e){e.images&&Object.keys(e.images).length&&ye(e.images),e.tmb&&we()}):(a=t?(o=!0,t.splice(0,E)):ae.getTmbs.splice(0,E)).length&&(o||le[a[0]]||le[a[a.length-1]])&&(st.each(a,function(e,t){ae.tmbLoading[t]=!0}),Re.request({data:{cmd:"tmb",targets:a},preventFail:!0}).done(function(n){var e,i=[];n.images&&((e=Object.keys(n.images).length)?(e<a.length&&st.each(a,function(e,t){n.images[t]||i.push(t)}),ye(n.images,o)):i=a,i.length&&st.each(i,function(e,t){delete ae.attachTmbs[t]})),o&&t.length&&we(t)}).always(function(){ae.tmbLoading={},!o&&ae.getTmbs.length&&we()}))},xe=function(e,t){var n,i,a,o=e||(k?je.find("tbody"):je),r=qe[Re.viewType],s=1;0<ie.length&&(ae.hpi?k||(s=Math.floor(o.width()/r.width)):((i=r).height||(a=(k?je.find("tbody"):je).find(k?"tr:first":"[id]:first"),i.height=a.outerHeight(!0),k||(i.width=a.outerWidth(!0))),k?ae.row=ae.hpi=r.height:(s=Math.floor(o.width()/r.width),ae.row=r.height,ae.hpi=ae.row/s)),n=Math.ceil((ie.length+(t||0))/s),k&&he&&++n,Se.css({top:ae.row*n+"px"}).show())},ke=function(e){e.preventDefault(),void 0===je.data("longtap")?Re.trigger("contextmenu",{type:"cwd",targets:[Re.cwd().hash],x:e.pageX,y:e.pageY}):e.stopPropagation()},Ce=function(e){1<e.originalEvent.touches.length||(!1!==je.data("longtap")&&(Oe.data("touching",{x:e.originalEvent.touches[0].pageX,y:e.originalEvent.touches[0].pageY}),je.data("tmlongtap",setTimeout(function(){je.data("longtap",!0),Re.trigger("contextmenu",{type:"cwd",targets:[Re.cwd().hash],x:Oe.data("touching").x,y:Oe.data("touching").y})},500))),je.data("longtap",null))},ze=function(e){"touchmove"===e.type?(!Oe.data("touching")||4<Math.abs(Oe.data("touching").x-e.originalEvent.touches[0].pageX)+Math.abs(Oe.data("touching").y-e.originalEvent.touches[0].pageY))&&Oe.data("touching",null):setTimeout(function(){je.removeData("longtap")},80),clearTimeout(je.data("tmlongtap"))},Te=function(e){je.data("longtap")&&(e.preventDefault(),e.stopPropagation())},Ae=function(){Re.lazy(function(){var e;Fe.append(Ie).removeClass("elfinder-cwd-wrapper-empty elfinder-search-result elfinder-incsearch-result elfinder-letsearch-result"),(1<Re.searchStatus.state||Re.searchStatus.ininc)&&Fe.addClass("elfinder-search-result"+(Re.searchStatus.ininc?" elfinder-"+("/"===F.substr(0,1)?"let":"inc")+"search-result":"")),ae.attachThumbJob&&ae.attachThumbJob._abort(),je.data("selectable")&&je.selectable("disable").selectable("destroy").removeData("selectable"),Re.trigger("cwdinit"),J=st();try{je.empty()}catch(e){je.html("")}he&&(Oe.off("scroll.fixheader resize.fixheader"),he.remove(),he=null),je.removeClass("elfinder-cwd-view-icons elfinder-cwd-view-list").addClass("elfinder-cwd-view-"+(k?"list":"icons")).attr("style","").css("height","auto"),Se.hide(),Oe[k?"addClass":"removeClass"]("elfinder-cwd-wrapper-list")._padding=parseInt(Oe.css("padding-top"))+parseInt(Oe.css("padding-bottom")),Re.UA.iOS&&Oe.removeClass("overflow-scrolling-touch").addClass("overflow-scrolling-touch"),k&&(je.html("<table><thead></thead><tbody></tbody></table>"),e=st('<tr class="ui-state-default"><td class="elfinder-cwd-view-th-name">'+Re.getColumnName("name")+"</td>"+function(){for(var e,t="",n=0;n<R.length;n++)e=Re.getColumnName(R[n]),t+='<td class="elfinder-cwd-view-th-'+R[n]+' sortable-item">'+e+"</td>";return t}()+"</tr>"),je.find("thead").hide().append(e).find("td:first").append(Ie),st.fn.sortable&&e.addClass("touch-punch touch-punch-keep-default").sortable({axis:"x",distance:8,items:"> .sortable-item",start:function(e,t){st(t.item[0]).data("dragging",!0),t.placeholder.width(t.helper.removeClass("ui-state-hover").width()).removeClass("ui-state-active").addClass("ui-state-hover").css("visibility","visible")},update:function(e,t){var n,i,a=st(t.item[0]).attr("class").split(" ")[0].replace("elfinder-cwd-view-th-","");R=st.map(st(this).children(),function(e){var t=st(e).attr("class").split(" ")[0].replace("elfinder-cwd-view-th-","");return i||(a===t?i=!0:n=t),"name"===t?null:t}),W.row=o(),Re.storage("cwdCols",R),n=".elfinder-col-"+n+":first",a=".elfinder-col-"+a+":first",Re.lazy(function(){je.find("tbody tr").each(function(){var e=st(this);e.children(n).after(e.children(a))})})},stop:function(e,t){setTimeout(function(){st(t.item[0]).removeData("dragging")},100)}}),e.find("td").addClass("touch-punch").resizable({handles:"ltr"===Re.direction?"e":"w",start:function(e,t){var n=je.find("td.elfinder-col-"+t.element.attr("class").split(" ")[0].replace("elfinder-cwd-view-th-","")+":first");t.element.data("dragging",!0).data("resizeTarget",n).data("targetWidth",n.width()),N=!0,"fixed"!==je.find("table").css("table-layout")&&(je.find("tbody tr:first td").each(function(){st(this).width(st(this).width())}),je.find("table").css("table-layout","fixed"))},resize:function(e,t){t.element.data("resizeTarget").width(t.element.data("targetWidth")-(t.originalSize.width-t.size.width))},stop:function(e,t){me({fitWidth:!(N=!1)}),L={},je.find("tbody tr:first td").each(function(){var e=st(this).attr("class").split(" ")[0].replace("elfinder-col-","");L[e]=st(this).width()}),Re.storage("cwdColWidth",L),setTimeout(function(){t.element.removeData("dragging")},100)}}).find(".ui-resizable-handle").addClass("ui-icon ui-icon-grip-dotted-vertical")),ie=st.map(q||P,function(e){return Re.file(e)||null}),ie=Re.sortFiles(ie),q?q=st.map(ie,function(e){return e.hash}):P=st.map(ie,function(e){return e.hash}),ae={renderd:0,attachTmbs:{},getTmbs:[],tmbLoading:{},lazyOpts:{tm:0}},Fe[ie.length<1?"addClass":"removeClass"]("elfinder-cwd-wrapper-empty"),Oe.off(oe,ue).on(oe,ue).trigger(oe),Re.cwd().write?(Oe[Re.isCommandEnabled("upload")?"addClass":"removeClass"]("native-droppable"),Oe.droppable(Re.isCommandEnabled("paste")?"enable":"disable")):Oe.removeClass("native-droppable").droppable("disable").removeClass("ui-state-disabled")})},je=st(this).addClass("ui-helper-clearfix elfinder-cwd").attr("unselectable","on").on("click."+Re.namespace,z,function(e){var t,n,i,a,o,r=this.id?st(this):st(this).parents("[id]:first"),s=st(e.target);if(_&&(s.is("input:checkbox."+M)||s.hasClass("elfinder-cwd-select")))return e.stopPropagation(),e.preventDefault(),r.trigger(r.hasClass(w)?g:m),te(),void requestAnimationFrame(function(){s.prop("checked",r.hasClass(w))});if(je.data("longtap")||s.hasClass("elfinder-cwd-nonselect"))e.stopPropagation();else{if(H||(H=r.attr("id"),setTimeout(function(){H=""},500)),e.shiftKey&&(t=r.prevAll(ee||"."+w+":first"),n=r.nextAll(ee||"."+w+":first"),i=t.length,a=n.length),e.shiftKey&&(i||a))o=(o=i?r.prevUntil("#"+t.attr("id")):r.nextUntil("#"+n.attr("id"))).add(r),i||(o=st(o.get().reverse())),o.trigger(m);else if(e.ctrlKey||e.metaKey)r.trigger(r.hasClass(w)?g:m);else{if(Oe.data("touching")&&r.hasClass(w))return Oe.data("touching",null),void Re.dblclick({file:Re.cwdId2Hash(this.id)});Z({notrigger:!0}),r.trigger(m)}te()}}).on("dblclick."+Re.namespace,z,function(e){var t;H&&(t=Re.cwdId2Hash(H),e.stopPropagation(),this.id!==H&&(st(this).trigger(g),st("#"+H).trigger(m),te()),Re.dblclick({file:t}))}).on("touchstart."+Re.namespace,z,function(e){if(!(1<e.originalEvent.touches.length)){var t=this.id?st(this):st(this).parents("[id]:first"),n=st(e.target),i=e.target.nodeName;if("INPUT"===i&&"text"===e.target.type||"TEXTAREA"===i||n.hasClass("elfinder-cwd-nonselect"))e.stopPropagation();else{if(t.find("input:text,textarea").length)return e.stopPropagation(),void e.preventDefault();Oe.data("touching",{x:e.originalEvent.touches[0].pageX,y:e.originalEvent.touches[0].pageY}),_&&(n.is("input:checkbox."+M)||n.hasClass("elfinder-cwd-select"))||(t.prevAll("."+w+":first").length,t.nextAll("."+w+":first").length,je.data("longtap",null),(Object.keys(Y).length||k&&"TD"!==e.target.nodeName||!k&&this!==e.target)&&(je.data("longtap",!1),t.addClass(O),t.data("tmlongtap",setTimeout(function(){je.data("longtap",!0),t.trigger(m),te(),Re.trigger("contextmenu",{type:"files",targets:Re.selected(),x:e.originalEvent.touches[0].pageX,y:e.originalEvent.touches[0].pageY})},500))))}}}).on("touchmove."+Re.namespace+" touchend."+Re.namespace,z,function(e){var t,n=st(e.target);_&&(n.is("input:checkbox."+M)||n.hasClass("elfinder-cwd-select"))||("INPUT"!=e.target.nodeName&&"TEXTAREA"!=e.target.nodeName?(t=this.id?st(this):st(this).parents("[id]:first"),clearTimeout(t.data("tmlongtap")),"touchmove"===e.type?(Oe.data("touching",null),t.removeClass(O)):(Oe.data("touching")&&!je.data("longtap")&&t.hasClass(w)&&(e.preventDefault(),Oe.data("touching",null),Re.dblclick({file:Re.cwdId2Hash(this.id)})),setTimeout(function(){je.removeData("longtap")},80))):e.stopPropagation())}).on("mouseenter."+Re.namespace,z,function(e){if(!re){var i=st(this),p=null;if(!(f||i.data("dragRegisted")||i.hasClass(I)||i.hasClass(A)||i.hasClass(T))){if(i.data("dragRegisted",!0),!Re.isCommandEnabled("copy",1<Re.searchStatus.state||i.hasClass("isroot")?Re.cwdId2Hash(i.attr("id")):void 0))return;i.on("mousedown",function(e){var t=He.metakeyDragout&&!Re.UA.IE&&(e.shiftKey||e.altKey),n=!1;t&&je.data("selectable")&&(je.selectable("disable").selectable("destroy").removeData("selectable"),requestAnimationFrame(function(){je.selectable(se).selectable("option",{disabled:!1}).selectable("refresh").data("selectable",!0)})),i.removeClass("ui-state-disabled"),t?i.draggable("option","disabled",!0).attr("draggable","true"):(i.hasClass(w)||(n=k?st(e.target).closest("span,tr").is("tr"):st(e.target).hasClass("elfinder-cwd-file")),n?i.draggable("option","disabled",!0).removeClass("ui-state-disabled"):i.draggable("option","disabled",!1).removeAttr("draggable").draggable("option","cursorAt",{left:50-parseInt(st(e.currentTarget).css("margin-left")),top:47}))}).on("dragstart",function(e){var t=e.dataTransfer||e.originalEvent.dataTransfer||null;if(p=null,t&&!Re.UA.IE){function n(e){var t=e.mime,n=Re.tmb(e),i='<div class="elfinder-cwd-icon elfinder-cwd-icon-drag '+Re.mime2class(t)+' ui-corner-all"></div>';return n&&(i=st(i).addClass(n.className).css("background-image","url('"+n.url+"')").get(0).outerHTML),i}var i,a=this.id?st(this):st(this).parents("[id]:first"),o=st("<span>"),r="",s=null,l=null,c=[],d=[];if(a.trigger(m),te(),st.each(Y,function(e){var t=Re.file(e),n=t.url;if(t&&"directory"!==t.mime){if(n){if("1"==n)return d.push(e),!0}else n=Re.url(t.hash);n&&(n=Re.convAbsUrl(n),c.push(e),st("<a>").attr("href",n).text(n).appendTo(o),r+=n+"\n",s=s||t.mime+":"+t.name+":"+n,l=l||n+"\n"+t.name)}}),d.length)return st.each(d,function(e,t){var n=Re.file(t);n.url="",Re.request({data:{cmd:"url",target:t},notify:{type:"url",cnt:1},preventDefault:!0}).always(function(e){n.url=e.url?e.url:"1"})}),!1;if(!r)return!1;t.setDragImage&&(p=st('<div class="elfinder-drag-helper html5-native"></div>').append(n(Re.file(c[0]))).appendTo(st(document.body)),1<(i=c.length)&&p.append(n(Re.file(c[i-1]))+'<span class="elfinder-drag-num">'+i+"</span>"),t.setDragImage(p.get(0),50,47)),t.effectAllowed="copyLink",t.setData("DownloadURL",s),t.setData("text/x-moz-url",l),t.setData("text/uri-list",r),t.setData("text/plain",r),t.setData("text/html",o.html()),t.setData("elfinderfrom",window.location.href+Re.cwd().hash),t.setData("elfinderfrom:"+t.getData("elfinderfrom"),"")}}).on("dragend",function(e){Z({notrigger:!0}),p&&p.remove()}).draggable(Re.draggable)}}}).on(m,z,function(e){var t=st(this),n=Re.cwdId2Hash(t.attr("id"));G||t.hasClass(T)||(ee="#"+this.id,t.addClass(w).children().addClass(O).find("input:checkbox."+M).prop("checked",!0),Y[n]||(Y[n]=!0),J=je.find("[id]."+w+":last").next())}).on(g,z,function(e){var t=st(this),n=Re.cwdId2Hash(t.attr("id"));G||(t.removeClass(w).children().removeClass(O).find("input:checkbox."+M).prop("checked",!1),je.hasClass("elfinder-cwd-allselected")&&(_&&Ie.children("input").prop("checked",!1),je.removeClass("elfinder-cwd-allselected")),Y[n]&&delete Y[n])}).on(v,z,function(){var e=st(this).removeClass(O+" "+w).addClass(T),t=e.children(),n=k?e:t.find("div.elfinder-cwd-file-wrapper,div.elfinder-cwd-filename");t.removeClass(O+" "+w),e.hasClass(j)&&e.droppable("disable"),n.hasClass(A)&&n.draggable("disable")}).on(b,z,function(){var e=st(this).removeClass(T),t=k?e:e.children("div.elfinder-cwd-file-wrapper,div.elfinder-cwd-filename");e.hasClass(j)&&e.droppable("enable"),t.hasClass(A)&&t.draggable("enable")}).on("scrolltoview",z,function(e,t){ne(st(this),!t||void 0===t.blink||t.blink)}).on("mouseenter."+Re.namespace+" mouseleave."+Re.namespace,z,function(e){"mouseenter"===e.type&&(re||Re.UA.Mobile)||(Re.trigger("hover",{hash:Re.cwdId2Hash(st(this).attr("id")),type:e.type}),st(this).toggleClass(O,"mouseenter"==e.type))}).on("mouseenter."+Re.namespace+" mouseleave."+Re.namespace,".elfinder-cwd-file-wrapper,.elfinder-cwd-filename",function(e){"mouseenter"===e.type&&re||st(this).closest(z).children(".elfinder-cwd-file-wrapper,.elfinder-cwd-filename").toggleClass(n,"mouseenter"==e.type)}).on("contextmenu."+Re.namespace,function(e){var t=st(e.target).closest(z);t.get(0)===e.target&&!Y[Re.cwdId2Hash(t.get(0).id)]||(t.find("input:text,textarea").length?e.stopPropagation():t.length&&("TD"!=e.target.nodeName||Y[Re.cwdId2Hash(t.get(0).id)])&&(e.stopPropagation(),e.preventDefault(),t.hasClass(T)||Oe.data("touching")||(t.hasClass(w)||(Z({notrigger:!0}),t.trigger(m),te()),Re.trigger("contextmenu",{type:"files",targets:Re.selected(),x:e.pageX,y:e.pageY}))))}).on("click."+Re.namespace,function(e){e.target!==this||je.data("longtap")||e.shiftKey||e.ctrlKey||e.metaKey||Z()}).on("create."+Re.namespace,function(e,t){var n=k?je.find("tbody"):je,i=n.find(".elfinder-cwd-parent"),a=t.move||!1,o=st(h(t)).addClass(I),r=Re.selected();r.length?a&&Re.trigger("lockfiles",{files:r}):Z(),i.length?i.after(o):n.prepend(o),ge(),Oe.scrollTop(0).scrollLeft(0)}).on("unselectall",Z).on("selectfile",function(e,t){Re.cwdHash2Elm(t).trigger(m),te()}).on("colwidth",function(){k&&(je.find("table").css("table-layout","").find("td").css("width",""),me({fitWidth:!0}),Re.storage("cwdColWidth",L=null))}).on("iconpref",function(e,t){je.removeClass(function(e,t){return(t.match(/\belfinder-cwd-size\S+/g)||[]).join(" ")}),p=t&&parseInt(t.size)||0,k||(0<p&&je.addClass("elfinder-cwd-size"+p),ae.renderd&&requestAnimationFrame(function(){qe.icons={},ae.hpi=null,xe(je,ae.renderd),ce()}))}).on("onwheel"in document?"wheel":"mousewheel",function(e){var t,n;!k&&(e.ctrlKey&&!e.metaKey||!e.ctrlKey&&e.metaKey)&&(e.stopPropagation(),e.preventDefault(),void 0!==(t=je.data("wheelTm"))?(clearTimeout(t),je.data("wheelTm",setTimeout(function(){je.removeData("wheelTm")},200))):(je.data("wheelTm",!1),n=p||0,0<(e.originalEvent.deltaY?e.originalEvent.deltaY:-e.originalEvent.wheelDelta)?0<p&&(n=p-1):p<He.iconsView.sizeMax&&(n=p+1),n!==p&&(Re.storage("iconsize",n),je.trigger("iconpref",{size:n}))))}),Oe=st('<div class="elfinder-cwd-wrapper"></div>').droppable(Object.assign({},ve,{autoDisable:!1})).on("contextmenu."+Re.namespace,ke).on("touchstart."+Re.namespace,Ce).on("touchmove."+Re.namespace+" touchend."+Re.namespace,ze).on("click."+Re.namespace,Te).on("scroll."+Re.namespace,function(){re||(je.data("selectable")&&je.selectable("disable"),Oe.trigger("elfscrstart")),re=!0,ae.scrtm&&cancelAnimationFrame(ae.scrtm),ae.scrtm&&Math.abs((ae.scrolltop||0)-(ae.scrolltop=this.scrollTop||st(this).scrollTop()))<5&&(ae.scrtm=0,Oe.trigger(oe)),ae.scrtm=requestAnimationFrame(function(){ae.scrtm=0,Oe.trigger(oe)})}).on(oe,function(){re=!1,ce()}),Se=st("<div> </div>").css({position:"absolute",width:"1px",height:"1px"}).hide(),Ie=_?st('<div class="elfinder-cwd-selectall"><input type="checkbox"/></div>').attr("title",Re.i18n("selectall")).on("click",function(e){return e.stopPropagation(),e.preventDefault(),!st(this).data("pending")&&(Ie.data("pending",!0),void(je.hasClass("elfinder-cwd-allselected")?(Ie.find("input").prop("checked",!1),requestAnimationFrame(function(){Z()})):t()))}):st(),Me=null,Ee=function(t){function n(){var e;void 0!==ae.renderd&&(e=0,Oe.siblings("div.elfinder-panel:visible").each(function(){e+=st(this).outerHeight(!0)}),Oe.height(Fe.height()-e-Oe._padding))}t&&n(),Me&&cancelAnimationFrame(Me),Me=requestAnimationFrame(function(){var e;t||n(),je.css("height","auto"),e=Oe[0].clientHeight-parseInt(Oe.css("padding-top"))-parseInt(Oe.css("padding-bottom"))-parseInt(je.css("margin-top")),je.outerHeight(!0)<e&&je.height(e)}),k&&!N&&(t?Oe.trigger("resize.fixheader"):me()),ce()},Fe=st(this).parent().on("resize",Ee).children(".elfinder-workzone").append(Oe.append(this).append(Se)),De=st('<div class="elfinder-cwd-message-board"></div>').insertAfter(je),Ue=st('<div class="elfinder-cwd-expires" ></div>'),Pe=function(){var e,t,n;l&&clearTimeout(l),u&&Re.volumeExpires[u]&&(n=(t=Re.volumeExpires[u]-new Date/1e3)%60+.1,e=Math.floor(t/60),Ue.html(Re.i18n(["minsLeft",e])).show(),e&&(l=setTimeout(Pe,1e3*n)))},qe={icons:{},list:{}};Re.UA.ltIE10||De.append(st('<div class="elfinder-cwd-trash" ></div>').html(Re.i18n("volume_Trash"))).append(Ue),K=Object.assign(K,He.replacement||{});try{L=Re.storage("cwdColWidth")?Re.storage("cwdColWidth"):null}catch(e){L=null}Re.bind("columnpref",function(e){var t=e.data||{};(R=Re.storage("cwdCols"))?(R=st.grep(R,function(e){return-1!==He.listView.columns.indexOf(e)}),He.listView.columns.length>R.length&&st.each(He.listView.columns,function(e,t){-1===R.indexOf(t)&&R.push(t)})):R=He.listView.columns;var n=Re.storage("columnhides")||null;n&&Object.keys(n).length&&(R=st.grep(R,function(e){return!n[e]})),W.row=o(),k&&t.repaint&&Ae()}).trigger("columnpref"),f&&st("body").on("touchstart touchmove touchend",function(e){}),_&&je.addClass("elfinder-has-checkbox"),st(window).on("scroll."+Re.namespace,function(){e&&cancelAnimationFrame(e),e=requestAnimationFrame(function(){Oe.trigger(oe)})}),st(document).on("keydown."+Re.namespace,function(e){e.keyCode==st.ui.keyCode.ESCAPE&&(Re.getUI().find(".ui-widget:visible").length||Z())}),Re.one("init",function(){var e,i,a,t,n=document.createElement("style"),o=0;document.head&&(document.head.appendChild(n),(e=n.sheet).insertRule('.elfinder-cwd-wrapper-empty .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+Re.i18n("emptyFolder")+'" }',o++),e.insertRule('.elfinder-cwd-wrapper-empty .native-droppable .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+Re.i18n("emptyFolder"+(f?"LTap":"Drop"))+'" }',o++),e.insertRule('.elfinder-cwd-wrapper-empty .ui-droppable-disabled .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+Re.i18n("emptyFolder")+'" }',o++),e.insertRule('.elfinder-cwd-wrapper-empty.elfinder-search-result .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+Re.i18n("emptySearch")+'" }',o++),e.insertRule('.elfinder-cwd-wrapper-empty.elfinder-search-result.elfinder-incsearch-result .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+Re.i18n("emptyIncSearch")+'" }',o++),e.insertRule('.elfinder-cwd-wrapper-empty.elfinder-search-result.elfinder-letsearch-result .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+Re.i18n("emptyLetSearch")+'" }',o++)),(t=Re.storage("iconsize")||He.iconsView.size||0)&&(t=Math.min(t,He.iconsView.sizeMax),je.trigger("iconpref",{size:t})),f||(Re.one("open",function(){e&&Re.zIndex&&e.insertRule(".ui-selectable-helper{z-index:"+Re.zIndex+";}",o++)}),a=st('<div style="position:absolute"></div>'),(i=Re.getUI()).on("resize",function(e,t){var n;e.preventDefault(),e.stopPropagation(),t&&t.fullscreen&&(n=i.offset(),"on"===t.fullscreen?(a.css({top:-1*n.top,left:-1*n.left}).appendTo(i),se.appendTo=a):(a.detach(),se.appendTo="body"),je.data("selectable")&&je.selectable("option",{appendTo:se.appendTo}))})),d=Re.getUI("tree").length}).bind("enable",function(){Ee()}).bind("request.open",function(){ae.getTmbs=[]}).one("open",function(){Re.maxTargets&&(E=Math.min(Re.maxTargets,E))}).bind("open add remove searchend",function(){var e,t,n,i=Re.cwd().hash,a=this.type;("open"===a||"searchend"===a||Re.searchStatus.state<2)&&(P=st.map(Re.files(i),function(e){return e.hash}),Re.trigger("cwdhasheschange",P)),"open"===a&&(e=i&&(!Re.file(i)||d)?d?(n=st.Deferred(),Re.one("treesync",function(e){e.data.always(function(){n.resolve()})}),n):Re.request({data:{cmd:"parents",target:Re.cwd().hash},preventFail:!0}):null,(t=Re.cwd()).volumeid!==u&&(Ue.empty().hide(),u&&Oe.removeClass("elfinder-cwd-wrapper-"+u),u=t.volumeid,Pe(),Oe.addClass("elfinder-cwd-wrapper-"+u)),st.when(e).done(function(){var n;U=Re.parents(t.hash),Oe[n=!1,st.each(U,function(e,t){if(Re.trashes[t])return!(n=!0)}),n?"addClass":"removeClass"]("elfinder-cwd-wrapper-trash")}),Z({notrigger:!(q=void 0)}),Ae())}).bind("search",function(e){P=st.map(e.data.files,function(e){return e.hash}),Re.trigger("cwdhasheschange",P),q=void 0,Re.searchStatus.ininc=!1,Ae(),Re.autoSync("stop")}).bind("searchend",function(e){(F||q)&&(F="",q?Re.trigger("incsearchend",e.data):e.data&&e.data.noupdate||Ae()),Re.autoSync()}).bind("searchstart",function(e){Z(),F=e.data.query}).bind("incsearchstart",function(e){var t=e.data.query||"",a=e.data.type||"SearchName",o=Re.options.commandsOptions.search.searchTypes||{};(o[a]&&o[a].incsearch||"SearchName"===a)&&(Y={},Re.lazy(function(){var n,i,e="";if(F=t){if("/"===t.substr(0,1)&&(t=t.substr(1),e="^"),n=new RegExp(e+t.replace(/([\\*\;\.\?\[\]\{\}\(\)\^\$\-\|])/g,"\\$1"),"i"),"SearchName"===a)q=st.grep(P,function(e){var t=Re.file(e);return!(!t||!(t.name.match(n)||t.i18&&t.i18.match(n)))});else if("string"==typeof(i=o[a].incsearch))q=st.grep(P,function(e){var t=Re.file(e);return!!(t&&t[i]&&(t[i]+"").match(n))});else if("function"==typeof i)try{q=st.grep(i({val:t,regex:n},P,Re),function(e){return!!Re.file(e)})}catch(e){q=[]}Re.trigger("incsearch",{hashes:q,query:t}).searchStatus.ininc=!0,Ae(),Re.autoSync("stop")}else Re.trigger("incsearchend")}))}).bind("incsearchend",function(e){F="",Re.searchStatus.ininc=!1,q=void 0,e.data&&e.data.noupdate||Ae(),Re.autoSync()}).bind("sortchange",function(){var e=Oe.scrollLeft(),t=je.hasClass("elfinder-cwd-allselected");Ae(),Re.one("cwdrender",function(){Oe.scrollLeft(e),t&&(Y=Re.arrayFlip(q||P,!0)),(t||Object.keys(Y).length)&&te()})}).bind("viewchange",function(){var e="list"!=Re.viewType,t=je.hasClass("elfinder-cwd-allselected");e!=k&&(k=e,Re.viewType=k?"list":"icons",p&&Re.one("cwdinit",function(){je.trigger("iconpref",{size:p})}),Ae(),Ee(),t&&(je.addClass("elfinder-cwd-allselected"),Ie.find("input").prop("checked",!0)),Object.keys(Y).length&&te())}).bind("wzresize",function(){var e,t=k?je.find("tbody"):je;Ee(!0),ae.hpi&&xe(t,t.find("[id]").length),e=je.offset(),Fe.data("rectangle",Object.assign({width:Fe.width(),height:Fe.height(),cwdEdge:"ltr"===Re.direction?e.left:e.left+je.width()},Fe.offset())),ae.itemH=(k?t.find("tr:first"):t.find("[id]:first")).outerHeight(!0)}).bind("changeclipboard",function(e){D={},e.data&&e.data.clipboard&&e.data.clipboard.length&&st.each(e.data.clipboard,function(e,t){t.cut&&(D[t.hash]=!0)})}).bind("resMixinMake",function(){ge()}).bind("tmbreload",function(e){var n={},t=e.data&&e.data.files?e.data.files:null;st.each(t,function(e,t){t.tmb&&"1"!=t.tmb&&(n[t.hash]=t.tmb)}),Object.keys(n).length&&ye(n,!0)}).add(function(e){var a=F?new RegExp(F.replace(/([\\*\;\.\?\[\]\{\}\(\)\^\$\-\|])/g,"\\$1"),"i"):null,o=Re.searchStatus.mime,r=1<Re.searchStatus.state,s=r&&Re.searchStatus.target?Re.searchStatus.target:Re.cwd().hash,l=Re.path(s),t=st.grep(e.data.added||[],function(e){return!(i=(t=e).phash===s)&&r&&(n=t.path||Re.path(t.hash),!(i=l&&0===n.indexOf(l))&&Re.searchStatus.mixed&&(i=!!st.grep(Re.searchStatus.mixed,function(e){return 0===t.hash.indexOf(e)}).length)),i&&r&&(i=o?0===t.mime.indexOf(o):!!(t.name.match(a)||t.i18&&t.i18.match(a))),!!i;var t,n,i});c(t),2===Re.searchStatus.state&&(st.each(t,function(e,t){-1===st.inArray(t.hash,P)&&P.push(t.hash)}),Re.trigger("cwdhasheschange",P)),k&&Ee(),Oe.trigger(oe)}).change(function(e){var n,t=Re.cwd().hash,i=Re.selected();F?st.each(e.data.changed||[],function(e,t){Re.cwdHash2Elm(t.hash).length&&(r([t.hash]),c([t]),-1!==st.inArray(t.hash,i)&&a(t.hash),n=!0)}):st.each(st.grep(e.data.changed||[],function(e){return e.phash==t}),function(e,t){Re.cwdHash2Elm(t.hash).length&&(r([t.hash]),c([t]),-1!==st.inArray(t.hash,i)&&a(t.hash),n=!0)}),n&&(Re.trigger("cwdhasheschange",P),k&&Ee(),Oe.trigger(oe)),te()}).remove(function(e){var t=k?je.find("tbody"):je;r(e.data.removed||[]),te(),ie.length<1&&t.children(z+(He.oldSchool?":not(.elfinder-cwd-parent)":"")).length<1?(Fe.addClass("elfinder-cwd-wrapper-empty"),_&&Ie.find("input").prop("checked",!1),Se.hide(),Oe.off(oe,ue),Ee()):(xe(t),Oe.trigger(oe))}).dragstart(function(e){var t=st(e.data.target),n=e.data.originalEvent;t.hasClass(C)&&(t.hasClass(w)||(n.ctrlKey||n.metaKey||n.shiftKey||Z({notrigger:!0}),t.trigger(m),te())),je.removeClass(T).data("selectable")&&je.selectable("disable"),G=!0}).dragstop(function(){je.data("selectable")&&je.selectable("enable"),G=!1}).bind("lockfiles unlockfiles selectfiles unselectfiles",function(e){var t,n,i,a={lockfiles:v,unlockfiles:b,selectfiles:m,unselectfiles:g}[e.type],o=e.data.files||[],r=o.length,s=e.data.helper||st();if(0<r&&(t=Re.parents(o[0])),a!==m&&a!==g||(i=a===m,st.each(o,function(e,t){var n=je.hasClass("elfinder-cwd-allselected");Y[t]?(n&&(_&&Ie.children("input").prop("checked",!1),je.removeClass("elfinder-cwd-allselected"),n=!1),i||delete Y[t]):i&&(Y[t]=!0)})),!s.data("locked")){for(;r--;)try{Re.cwdHash2Elm(o[r]).trigger(a)}catch(e){}e.data.inselect||te()}Oe.data("dropover")&&-1!==t.indexOf(Oe.data("dropover"))&&(n="lockfiles"!==e.type,s.toggleClass("elfinder-drag-helper-plus",n),Oe.toggleClass(S,n))}).bind("mkdir mkfile duplicate upload rename archive extract paste multiupload",function(e){var n;"upload"==e.type&&e.data._multiupload||(n=Re.cwd().hash,Z({notrigger:!0}),st.each((e.data.added||[]).concat(e.data.changed||[]),function(e,t){t&&t.phash==n&&a(t.hash)}),te())}).shortcut({pattern:"ctrl+a",description:"selectall",callback:t}).shortcut({pattern:"ctrl+shift+i",description:"selectinvert",callback:function(){var i={};Q?Z():Object.keys(Y).length?(st.each(q||P,function(e,t){var n=Re.cwdHash2Elm(t);Y[t]?n.length&&n.trigger(g):(i[t]=!0,n.length&&n.trigger(m))}),Y=i,te()):t()}}).shortcut({pattern:"left right up down shift+left shift+right shift+up shift+down",description:"selectfiles",type:"keydown",callback:function(e){!function(e,t){var n,i,a,o,r,s=st.ui.keyCode,l=e==s.LEFT||e==s.UP,c=je.find("[id]."+w);function d(e,t){return e[t+"All"]("[id]:not(."+T+"):not(.elfinder-cwd-parent):first")}if(c.length)if((a=d(n=c.filter(l?":first":":last"),l?"prev":"next")).length)if(k||e==s.LEFT||e==s.RIGHT)i=a;else if(o=n.position().top,r=n.position().left,i=n,l){for(;(i=i.prev("[id]")).length&&!(i.position().top<o&&i.position().left<=r););i.hasClass(T)&&(i=d(i,"next"))}else{for(;(i=i.next("[id]")).length&&!(i.position().top>o&&i.position().left>=r););i.hasClass(T)&&(i=d(i,"prev")),i.length||(a=je.find("[id]:not(."+T+"):last")).position().top>o&&(i=a)}else i=n;else i=J.length?l?J.prev():J:je.find("[id]:not(."+T+"):not(.elfinder-cwd-parent):"+(l?"last":"first"));i&&i.length&&!i.hasClass("elfinder-cwd-parent")&&(n&&t?i=n.add(n[l?"prevUntil":"nextUntil"]("#"+i.attr("id"))).add(i):c.trigger(g),i.trigger(m),ne(i.filter(l?":first":":last")),te())}(e.keyCode,e.shiftKey)}}).shortcut({pattern:"home",description:"selectffile",callback:function(e){Z({notrigger:!0}),ne(je.find("[id]:first").trigger(m)),te()}}).shortcut({pattern:"end",description:"selectlfile",callback:function(e){Z({notrigger:!0}),ne(je.find("[id]:last").trigger(m)),te()}}).shortcut({pattern:"page_up",description:"pageTurning",callback:function(e){ae.itemH&&Oe.scrollTop(Math.round(Oe.scrollTop()-Math.floor((Oe.height()+(k?-1*ae.itemH:16))/ae.itemH)*ae.itemH))}}).shortcut({pattern:"page_down",description:"pageTurning",callback:function(e){ae.itemH&&Oe.scrollTop(Math.round(Oe.scrollTop()+Math.floor((Oe.height()+(k?-1*ae.itemH:16))/ae.itemH)*ae.itemH))}})}),this},st.fn.elfinderdialog=function(C,z){function T(e){var t,n;F.enabled&&(n=z.options.dialogContained?S:st(window),t={maxWidth:F.width?n.width()-E.width:null,maxHeight:F.height?n.height()-E.height:null},Object.assign(I,t),e.css(t).trigger("resize"),e.data("hasResizable")&&(e.resizable("option","maxWidth")<t.maxWidth||e.resizable("option","maxHeight")<t.maxHeight)&&e.resizable("option",t))}function A(e){var t=e.data;n&&cancelAnimationFrame(n),n=requestAnimationFrame(function(){F.enabled&&T(t)})}function j(){var e=S.children(".elfinder-dialog."+z.res("class","editing")+":visible");z[e.length?"disable":"enable"]()}var O,n,e,S,I,M=-1!=window.navigator.platform.indexOf("Win"),E={},F={enabled:!1,width:!1,height:!1,defaultSize:null};return z&&z.ui?S=z.getUI():(S=this.closest(".elfinder"),z=z||S.elfinder("instance")),"string"==typeof C?(e=this.closest(".ui-dialog")).length&&("open"===C?"none"===e.css("display")&&(e.trigger("posinit").show().trigger("open").hide(),e.fadeIn(120,function(){z.trigger("dialogopened",{dialog:e})})):"close"===C||"destroy"===C?(e.stop(!0),(e.is(":visible")||S.is(":hidden"))&&(e.trigger("close"),z.trigger("dialogclosed",{dialog:e})),"destroy"===C?(e.remove(),z.trigger("dialogremoved",{dialog:e})):e.data("minimized")&&e.data("minimized").close()):"toTop"===C?(e.trigger("totop"),z.trigger("dialogtotoped",{dialog:e})):"posInit"===C?(e.trigger("posinit"),z.trigger("dialogposinited",{dialog:e})):"tabstopsInit"===C?(e.trigger("tabstopsInit"),z.trigger("dialogtabstopsinited",{dialog:e})):"checkEditing"===C&&j()):((C=Object.assign({},st.fn.elfinderdialog.defaults,C)).allowMinimize&&"auto"===C.allowMinimize&&(C.allowMinimize=!!this.find("textarea,input").length),C.openMaximized=C.allowMinimize&&C.openMaximized,C.headerBtnPos&&"auto"===C.headerBtnPos&&(C.headerBtnPos=M?"right":"left"),C.headerBtnOrder&&"auto"===C.headerBtnOrder&&(C.headerBtnOrder=M?"close:maximize:minimize":"close:minimize:maximize"),C.modal&&C.allowMinimize&&(C.allowMinimize=!1),z.options.dialogContained?F.width=F.height=F.enabled=!0:(F.width="window"===C.maxWidth,F.height="window"===C.maxHeight,(F.width||F.height)&&(F.enabled=!0)),O=z.arrayFlip(C.propagationEvents,!0),this.filter(":not(.ui-dialog-content)").each(function(){function e(){(b=x.find("."+l)).length&&(b.attr("tabindex","-1"),b.filter("."+d).length||f.children("."+l+":"+(M?"first":"last")).addClass(d))}function a(n){var i=b.filter(":visible:enabled"),a=n?null:i.filter("."+d+":first");return a&&a.length||(a=i.first()),n&&st.each(i,function(e,t){if(t===n&&i[e+1])return a=i.eq(e+1),!1}),a}var t,n,c=st(this).addClass("ui-dialog-content ui-widget-content"),i="elfinder-dialog-active",o="elfinder-dialog",r="elfinder-dialog-notify",s="ui-state-hover",l="elfinder-tabstop",d="elfinder-focus",p="elfinder-dialog-modal",u=parseInt(1e6*Math.random()),h=st('<div class="ui-dialog-titlebar ui-widget-header ui-corner-top ui-helper-clearfix"><span class="elfinder-dialog-title">'+C.title+"</span></div>"),f=st('<div class="ui-dialog-buttonset"></div>'),m=st('<div class=" ui-helper-clearfix ui-dialog-buttonpane ui-widget-content"></div>').append(f),g=0,v=0,b=st(),y=st('<div style="width:100%;height:100%;position:absolute;top:0px;left:0px;"></div>').hide(),w={close:function(){h.prepend(st('<span class="ui-widget-header ui-dialog-titlebar-close ui-corner-all elfinder-titlebar-button"><span class="ui-icon ui-icon-closethick"></span></span>').on("mousedown touchstart",function(e){e.preventDefault(),e.stopPropagation(),c.elfinderdialog("close")}))},maximize:function(){C.allowMaximize&&(x.on("resize",function(e,t){var n,i;if(e.preventDefault(),e.stopPropagation(),t&&t.maximize){if(i=h.find(".elfinder-titlebar-full"),n="on"===t.maximize,i.children("span.ui-icon").toggleClass("ui-icon-plusthick",!n).toggleClass("ui-icon-arrowreturnthick-1-s",n),n){try{x.hasClass("ui-draggable")&&x.draggable("disable"),x.hasClass("ui-resizable")&&x.resizable("disable")}catch(e){}c.css("width","100%").css("height",x.height()-x.children(".ui-dialog-titlebar").outerHeight(!0)-m.outerHeight(!0))}else{c.attr("style",i.data("style")),i.removeData("style"),k();try{x.hasClass("ui-draggable")&&x.draggable("enable"),x.hasClass("ui-resizable")&&x.resizable("enable")}catch(e){}}x.trigger("resize",{init:!0})}}),h.prepend(st('<span class="ui-widget-header ui-corner-all elfinder-titlebar-button elfinder-titlebar-full"><span class="ui-icon ui-icon-plusthick"></span></span>').on("mousedown touchstart",function(e){var t=st(this);e.preventDefault(),e.stopPropagation(),x.hasClass("elfinder-maximized")||void 0!==t.data("style")||(c.height(c.height()),t.data("style",c.attr("style")||"")),z.toggleMaximize(x),"function"==typeof C.maximize&&C.maximize.call(c[0])})))},minimize:function(){var e,s,l;C.allowMinimize&&(e=st('<span class="ui-widget-header ui-corner-all elfinder-titlebar-button elfinder-titlebar-minimize"><span class="ui-icon ui-icon-minusthick"></span></span>').on("mousedown touchstart",function(e){function t(){s.remove(),x.removeData("minimized").show(),c.elfinderdialog("close")}var n=st(this),i=z.getUI("bottomtray"),a={width:70,height:24},o=st("<div></div>").css(a).addClass(x.get(0).className+" elfinder-dialog-minimized"),r={};e.preventDefault(),e.stopPropagation(),x.data("minimized")?(x.removeData("minimized").before(s.css(Object.assign({position:"absolute"},s.offset()))),z.toFront(s),s.animate(Object.assign({width:x.width(),height:x.height()},l),function(){x.show(),z.toFront(x),s.remove(),k(),j(),x.trigger("resize",{init:!0}),"function"==typeof C.minimize&&C.minimize.call(c[0])})):(l=x.data("minimized",{dialog:function(){return s},show:function(){s.show()},hide:function(){s.hide()},close:t,title:function(e){s.children(".ui-dialog-titlebar").children(".elfinder-dialog-title").text(e)}}).position(),s=x.clone().on("mousedown",function(){n.trigger("mousedown")}).removeClass("ui-draggable ui-resizable elfinder-frontmost"),i.append(o),Object.assign(r,o.offset(),a),o.remove(),s.height(x.height()).children(".ui-dialog-content:first").empty(),z.toHide(x.before(s)),s.children(".ui-dialog-content:first,.ui-dialog-buttonpane,.ui-resizable-handle").remove(),s.find(".elfinder-titlebar-minimize,.elfinder-titlebar-full").remove(),s.find(".ui-dialog-titlebar-close").on("mousedown",function(e){e.stopPropagation(),e.preventDefault(),t()}),s.animate(r,function(){s.attr("style","").css({maxWidth:x.width()}).addClass("elfinder-dialog-minimized").appendTo(i),j(),"function"==typeof C.minimize&&C.minimize.call(c[0])}))}),h.on("dblclick",function(e){st(this).children(".elfinder-titlebar-minimize").trigger("mousedown")}).prepend(e),x.on("togleminimize",function(){e.trigger("mousedown")}))}},x=st('<div class="ui-front ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable std42-dialog touch-punch '+o+" "+C.cssClass+'"></div>').hide().append(c).appendTo(S).draggable({containment:z.options.dialogContained?S:null,handle:".ui-dialog-titlebar",start:function(){y.show()},drag:function(e,t){var n=t.offset.top,i=t.offset.left;n<0&&(t.position.top=t.position.top-n),i<0&&(t.position.left=t.position.left-i),z.options.dialogContained&&(t.position.top<0&&(t.position.top=0),t.position.left<0&&(t.position.left=0))},stop:function(e,t){y.hide(),x.css({height:C.height}),c.data("draged",!0)}}).css({width:C.width,height:C.height,minWidth:C.minWidth,minHeight:C.minHeight,maxWidth:C.maxWidth,maxHeight:C.maxHeight}).on("touchstart touchmove touchend click dblclick mouseup mouseenter mouseleave mouseout mouseover mousemove",function(e){O[e.type]||e.stopPropagation()}).on("mousedown",function(e){O[e.type]||e.stopPropagation(),requestAnimationFrame(function(){x.is(":visible")&&!x.hasClass("elfinder-frontmost")&&((n=st(":focus")).length||(n=void 0),x.trigger("totop"))})}).on("open",function(){x.data("margin-y",c.outerHeight(!0)-c.height()),F.enabled&&(C.height&&"auto"!==C.height&&x.trigger("resize",{init:!0}),F.defaultSize||(F.defaultSize={width:c.width(),height:c.height()}),T(x),x.trigger("resize").trigger("posinit"),S.on("resize."+z.namespace,x,A)),x.hasClass(r)||S.children("."+o+":visible:not(."+r+")").each(function(){var e=st(this),t=parseInt(e.css("top")),n=parseInt(e.css("left")),i=parseInt(x.css("top")),a=parseInt(x.css("left")),o=Math.abs(t-i)<10,r=Math.abs(n-a)<10;e[0]!=x[0]&&(o||r)&&x.css({top:o?t+10:i,left:r?n+10:a})}),x.data("modal")&&(x.addClass(p),z.getUI("overlay").elfinderoverlay("show")),x.trigger("totop"),C.openMaximized&&z.toggleMaximize(x),z.trigger("dialogopen",{dialog:x}),"function"==typeof C.open&&st.proxy(C.open,c[0])(),C.closeOnEscape&&st(document).on("keydown."+u,function(e){e.keyCode==st.ui.keyCode.ESCAPE&&x.hasClass("elfinder-frontmost")&&c.elfinderdialog("close")}),x.hasClass(z.res("class","editing"))&&j()}).on("close",function(e){var t;C.beforeclose&&"function"==typeof C.beforeclose?(t=C.beforeclose())&&t.promise||(t=t?st.Deferred().resolve():st.Deferred().reject()):t=st.Deferred().resolve(),t.done(function(){F.enabled&&S.off("resize."+z.namespace,A),C.closeOnEscape&&st(document).off("keyup."+u),C.allowMaximize&&z.toggleMaximize(x,!1),z.toHide(x),x.data("modal")&&z.getUI("overlay").elfinderoverlay("hide"),"function"==typeof C.close&&st.proxy(C.close,c[0])(),C.destroyOnClose&&x.parent().length&&x.hide().remove(),S.children("."+o+":visible"),x.hasClass(z.res("class","editing"))&&j()})}).on("totop frontmost",function(){var e=z.storage("autoFocusDialog");x.data("focusOnMouseOver",e?0<e:z.options.uiOptions.dialog.focusOnMouseOver),x.data("minimized")&&h.children(".elfinder-titlebar-minimize").trigger("mousedown"),!x.data("modal")&&z.getUI("overlay").is(":visible")?z.getUI("overlay").before(x):z.toFront(x),S.children("."+o+":not(."+p+")").removeClass(i),x.addClass(i),z.UA.Mobile||(n||a()).trigger("focus"),n=void 0}).on("posinit",function(){var e,t,n,i,a,o,r,s=C.position;if(!x.hasClass("elfinder-maximized")){if(!s&&!x.data("resizing")){if(r=S.hasClass("elfinder-fullscreen")||z.options.enableAlways,x.css(r?{maxWidth:"100%",maxHeight:"100%",overflow:"auto"}:I),z.UA.Mobile&&!r&&x.data("rotated")===z.UA.Rotated)return;x.data("rotated",z.UA.Rotated),a=st(window),e=S.offset(),(i={width:x.outerWidth(!0),height:x.outerHeight(!0)}).right=e.left+i.width,i.bottom=e.top+i.height,(o={scrLeft:a.scrollLeft(),scrTop:a.scrollTop(),width:a.width(),height:a.height()}).right=o.scrLeft+o.width,o.bottom=o.scrTop+o.height,n=z.options.dialogContained||r?t=0:(t=-1*e.top+o.scrTop,-1*e.left+o.scrLeft),s={top:i.height>=o.height?t:Math.max(t,parseInt((S.height()-i.height)/2-42)),left:i.width>=o.width?n:Math.max(n,parseInt((S.width()-i.width)/2))},i.right+s.left>o.right&&(s.left=Math.max(n,o.right-i.right)),i.bottom+s.top>o.bottom&&(s.top=Math.max(t,o.bottom-i.bottom))}C.absolute&&(s.position="absolute"),s&&x.css(s)}}).on("resize",function(e,t){var n,i,a,o,r=0,s=t&&t.init;t&&(t.minimize||t.maxmize)||x.data("minimized")||(e.stopPropagation(),e.preventDefault(),x.children(".ui-widget-header,.ui-dialog-buttonpane").each(function(){r+=st(this).outerHeight(!0)}),(o="auto"===C.height)&&c.css({"max-height":"",height:"auto"}),n=s||!F.enabled||e.originalEvent||x.hasClass("elfinder-maximized")?x.height()-r-x.data("margin-y"):(n=x.height(),i=x.css("min-height")||n,a=x.css("max-height")||n,i=i.match(/%/)?Math.floor(parseInt(i)/100*x.parent().height()):parseInt(i),a=a.match(/%/)?Math.floor(parseInt(a)/100*x.parent().height()):parseInt(a),Math.min(o?x.height():F.defaultSize.height,Math.max(a,i)-r-x.data("margin-y"))),c.css(o?"max-height":"height",n),s||(k(),i=n<(i=c.height())?i+r+x.data("margin-y"):C.minHeight,x.css("min-height",i),x.data("hasResizable")&&x.resizable("option",{minHeight:i}),"function"==typeof C.resize&&st.proxy(C.resize,c[0])(e,t)))}).on("tabstopsInit",e).on("focus","."+l,function(){st(this).addClass(s).parent("label").addClass(s),this.id&&st(this).parent().find("label[for="+this.id+"]").addClass(s)}).on("click","select."+l,function(){var e=st(this);e.data("keepFocus")?e.removeData("keepFocus"):e.data("keepFocus",!0)}).on("blur","."+l,function(){st(this).removeClass(s).removeData("keepFocus").parent("label").removeClass(s),this.id&&st(this).parent().find("label[for="+this.id+"]").removeClass(s)}).on("mouseenter mouseleave","."+l+",label",function(e){var t,n=st(this);("LABEL"!==this.nodeName||n.children("."+l).length||(t=n.attr("for"))&&st("#"+t).hasClass(l))&&(C.btnHoverFocus&&x.data("focusOnMouseOver")?"mouseenter"!==e.type||st(":focus").data("keepFocus")||n.trigger("focus"):n.toggleClass(s,"mouseenter"==e.type))}).on("keydown","."+l,function(e){var t,n,i=st(this);if(i.is(":focus")){if(t=e.keyCode===st.ui.keyCode.ESCAPE,e.keyCode===st.ui.keyCode.ENTER?(e.preventDefault(),i.trigger("click")):e.keyCode===st.ui.keyCode.TAB&&e.shiftKey||e.keyCode===st.ui.keyCode.LEFT||e.keyCode==st.ui.keyCode.UP?n="prev":e.keyCode!==st.ui.keyCode.TAB&&e.keyCode!=st.ui.keyCode.RIGHT&&e.keyCode!=st.ui.keyCode.DOWN||(n="next"),n&&(i.is("textarea")&&!e.ctrlKey&&!e.metaKey||i.is("select,span.ui-slider-handle")&&e.keyCode!==st.ui.keyCode.TAB||i.is("input:not(:checkbox,:radio)")&&!e.ctrlKey&&!e.metaKey&&e.keyCode===st.ui.keyCode["prev"===n?"LEFT":"RIGHT"]))return void e.stopPropagation();t?i.is("input:not(:checkbox,:radio),textarea")&&""!==i.val()&&(i.val(""),e.stopPropagation()):e.stopPropagation(),n&&(e.preventDefault(),("prev"===n?function(n){var i=b.filter(":visible:enabled"),a=i.last();return st.each(i,function(e,t){if(t===n&&i[e-1])return a=i.eq(e-1),!1}),a}:a)(this).trigger("focus"))}}).data({modal:C.modal}),k=function(){var e,t=z.getUI();t.hasClass("elfinder-fullscreen")&&(e=x.position(),x.css("top",Math.max(Math.min(Math.max(e.top,0),t.height()-100),0)),x.css("left",Math.max(Math.min(Math.max(e.left,0),t.width()-200),0)))};x.prepend(h),st.each(C.headerBtnOrder.split(":").reverse(),function(e,t){w[t]&&w[t]()}),M&&h.children(".elfinder-titlebar-button").addClass("elfinder-titlebar-button-right"),st.each(C.buttons,function(e,t){var n=st('<button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only elfinder-btncnt-'+v+++" "+l+'"><span class="ui-button-text">'+e+"</span></button>").on("click",st.proxy(t,c[0]));t._cssClass&&n.addClass(t._cssClass),M?f.append(n):f.prepend(n)}),f.children().length&&(x.append(m),x.show(),m.find("button").each(function(e,t){g+=st(t).outerWidth(!0)}),x.hide(),g+=20,x.width()<g&&x.width(g)),x.append(y),F.enabled&&(E.width=x.outerWidth(!0)-x.width()+(x.outerWidth()-x.width())/2,E.height=x.outerHeight(!0)-x.height()+(x.outerHeight()-x.height())/2),z.options.dialogContained&&(t={maxWidth:S.width()-E.width,maxHeight:S.height()-E.height},C.maxWidth=C.maxWidth?Math.min(t.maxWidth,C.maxWidth):t.maxWidth,C.maxHeight=C.maxHeight?Math.min(t.maxHeight,C.maxHeight):t.maxHeight,x.css(t)),I={maxWidth:x.css("max-width"),maxHeight:x.css("max-height"),overflow:x.css("overflow")},C.resizable&&x.resizable({minWidth:C.minWidth,minHeight:C.minHeight,maxWidth:C.maxWidth,maxHeight:C.maxHeight,start:function(){y.show(),!0!==x.data("resizing")&&x.data("resizing")&&clearTimeout(x.data("resizing")),x.data("resizing",!0)},stop:function(e,t){y.hide(),x.data("resizing",setTimeout(function(){x.data("resizing",!1)},200)),F.enabled&&(F.defaultSize={width:c.width(),height:c.height()})}}).data("hasResizable",!0),C.optimizeNumber&&x.find("input[type=number]").each(function(){st(this).attr("inputmode","numeric"),st(this).attr("pattern","[0-9]*")}),e(),"function"==typeof C.create&&st.proxy(C.create,this)(),C.autoOpen&&(C.open?requestAnimationFrame(function(){c.elfinderdialog("open")}):c.elfinderdialog("open")),C.resize&&z.bind("themechange",function(){setTimeout(function(){x.data("margin-y",c.outerHeight(!0)-c.height()),x.trigger("resize",{init:!0})},300)})})),this},st.fn.elfinderdialog.defaults={cssClass:"",title:"",modal:!1,resizable:!0,autoOpen:!0,closeOnEscape:!0,destroyOnClose:!1,buttons:{},btnHoverFocus:!0,position:null,absolute:!1,width:320,height:"auto",minWidth:200,minHeight:70,maxWidth:null,maxHeight:null,allowMinimize:"auto",allowMaximize:!1,openMaximized:!1,headerBtnPos:"auto",headerBtnOrder:"auto",optimizeNumber:!0,propagationEvents:["mousemove","mouseup"]},st.fn.elfinderfullscreenbutton=function(n){return this.each(function(){var e,t=st(this).elfinderbutton(n).children(".elfinder-button-icon");n.change(function(){e&&cancelAnimationFrame(e),e=requestAnimationFrame(function(){var e=n.value;t.addClass("elfinder-button-icon-fullscreen").toggleClass("elfinder-button-icon-unfullscreen",e),n.className=e?"unfullscreen":""})})})},st.fn.elfindernavbar=function(h,e){return this.not(".elfinder-navbar").each(function(){function o(){var e=h.getUI("cwd"),t=h.getUI("workzone"),n=t.data("rectangle"),i=e.offset();t.data("rectangle",Object.assign(n,{cwdEdge:"ltr"===h.direction?i.left:i.left+e.width()}))}function t(){d.css("overflow","hidden"),n=Math.round(d.outerHeight()-d.height()),i=Math.round(c.outerWidth()-c.innerWidth()),d.css("overflow","auto")}var n,i,a,r,s,l,c,d=st(this).hide().addClass("ui-state-default elfinder-navbar"),p=d.css("overflow","hidden").parent().children(".elfinder-workzone").append(d),u="ltr"==h.direction;h.one("init",function(){c=h.getUI("navdock");function e(){t(),h.bind("wzresize",function(){var e=0;c.width(d.outerWidth()-i),1<c.children().length&&(e=c.outerHeight(!0)),d.height(p.height()-e-n)}).trigger("wzresize")}h.cssloaded?e():h.one("cssloaded",e)}).one("opendone",function(){a&&a.trigger("resize"),d.css("overflow","auto")}).bind("themechange",t),h.UA.Touch&&(void 0===(s=h.storage("autoHide")||{}).navbar&&(s.navbar=e.autoHideUA&&0<e.autoHideUA.length&&st.grep(e.autoHideUA,function(e){return!!h.UA[e]}).length,h.storage("autoHide",s)),s.navbar&&h.one("init",function(){d.children().length&&h.uiAutoHide.push(function(){d.stop(!0,!0).trigger("navhide",{duration:"slow",init:!0})})}),h.bind("load",function(){d.children().length&&"none"!==(r=st('<div class="elfinder-navbar-swipe-handle"></div>').hide().appendTo(p)).css("pointer-events")&&(r.remove(),r=null)}),d.on("navshow navhide",function(e,t){var n="navshow"===e.type?"show":"hide",i=t&&t.duration?t.duration:"fast",a=t&&t.handleW?t.handleW:Math.max(50,h.getUI().width()/10);d.stop(!0,!0)[n]({duration:i,step:function(){h.trigger("wzresize")},complete:function(){r&&("show"==n?r.stop(!0,!0).hide():(r.width(a||""),h.resources.blink(r,"slowonce"))),h.trigger("navbar"+n),t.init&&h.trigger("uiautohide"),o()}}),s.navbar="show"!=n,h.storage("autoHide",Object.assign(h.storage("autoHide"),{navbar:s.navbar}))}).on("touchstart",function(e){5<st(this)["scroll"+("ltr"===h.direction?"Right":"Left")]()&&(e.originalEvent._preventSwipeX=!0)})),h.UA.Mobile||(a=d.resizable({handles:u?"e":"w",minWidth:e.minWidth||150,maxWidth:e.maxWidth||500,resize:function(){h.trigger("wzresize")},stop:function(e,t){h.storage("navbarWidth",t.size.width),o()}}).on("resize scroll",function(t){var e=st(this),n=e.data("posinit");t.preventDefault(),t.stopPropagation(),u||"resize"!==t.type||d.css("left",0),n&&cancelAnimationFrame(n),e.data("posinit",requestAnimationFrame(function(){var e=h.UA.Opera&&d.scrollLeft()?20:2;a.css("top",0).css({top:parseInt(d.scrollTop())+"px",left:u?"auto":-1*parseInt(d.scrollRight()-e),right:u?-1*parseInt(d.scrollLeft()-e):"auto"}),"resize"===t.type&&h.getUI("cwd").trigger("resize")}))}).children(".ui-resizable-handle").addClass("ui-front")),(l=h.storage("navbarWidth"))?d.width(l):h.UA.Mobile&&h.one(h.cssloaded?"init":"cssloaded",function(){function e(){l=d.parent().width()/2,d.data("defWidth")>l?d.width(l):d.width(d.data("defWidth")),d.data("width",d.width()),h.trigger("wzresize")}d.data("defWidth",d.width()),st(window).on("resize."+h.namespace,e),e()})}),this},st.fn.elfindernavdock=function(f,e){return this.not(".elfinder-navdock").each(function(){function r(e,t){var n,i=e-(t||c.height()),a=Object.keys(p).length,o=a?i/a:0;i&&(n=c.css("overflow"),c.css("overflow","hidden"),c.height(e),st.each(p,function(e,t){t.height(t.height()+o).trigger("resize."+f.namespace)}),f.trigger("wzresize"),c.css("overflow",n))}var s,l,c=st(this).hide().addClass("ui-state-default elfinder-navdock touch-punch"),d=(c.parent().children(".elfinder-workzone").append(c),st('<div class="ui-front ui-resizable-handle ui-resizable-n"></div>').appendTo(c)),p={},u=(parseInt(e.initMaxHeight)||50)/100,h=(parseInt(e.maxHeight)||90)/100;c.data("addNode",function(e,t){var n,i,a=f.getUI("workzone").height(),o=a*u;return t=Object.assign({first:!1,sizeSync:!0,init:!1},t),e.attr("id")||e.attr("id",f.namespace+"-navdock-"+ +new Date),t.sizeSync&&(p[e.attr("id")]=e),n=c.height()+e.outerHeight(!0),t.first?d.after(e):c.append(e),l=!0,c.resizable("enable").height(n).show(),f.trigger("wzresize"),t.init&&(i=f.storage("navdockHeight"),s=n=i||(o<n?o:n)),r(Math.min(n,a*h)),c}).data("removeNode",function(e,t){var n=st("#"+e);return delete p[e],c.height(c.height()-st("#"+e).outerHeight(!0)),t?"detach"===t?n=n.detach():t.append(n):n.remove(),c.children().length<=1&&(l=!1,c.resizable("disable").height(0).hide()),f.trigger("wzresize"),n}),e.disabled||f.one("init",function(){var n;f.getUI("navbar").children().not(".ui-resizable-handle").length&&(c.data("dockEnabled",!0),c.resizable({maxHeight:f.getUI("workzone").height()*h,handles:{n:d},start:function(e,t){n=c.css("overflow"),c.css("overflow","hidden"),f.trigger("navdockresizestart",{event:e,ui:t},!0)},resize:function(e,t){c.css("top",""),f.trigger("wzresize",{inNavdockResize:!0})},stop:function(e,t){f.trigger("navdockresizestop",{event:e,ui:t},!0),c.css("top",""),s=t.size.height,f.storage("navdockHeight",s),r(s,t.originalSize.height),c.css("overflow",n)}}),f.bind("wzresize",function(e){var t,n;c.is(":visible")&&(t=f.getUI("workzone").height()*h,e.data&&e.data.inNavdockResize||(n=c.height(),t<s?1<Math.abs(n-t)&&r(t):1<Math.abs(n-s)&&r(s)),c.resizable("option","maxHeight",t))}).bind("themechange",function(){var n=Math.round(c.height());requestAnimationFrame(function(){var e=Math.round(c.height()),t=n-e;0!=t&&r(c.height(),e-t)})})),f.bind("navbarshow navbarhide",function(e){c[l&&"navbarshow"===e.type?"show":"hide"]()})})}),this},st.fn.elfinderoverlay=function(e){var t,n,i,a,o=this.parent().elfinder("instance");return this.filter(":not(.elfinder-overlay)").each(function(){e=Object.assign({},e),st(this).addClass("ui-front ui-widget-overlay elfinder-overlay").hide().on("mousedown",function(e){e.preventDefault(),e.stopPropagation()}).data({cnt:0,show:"function"==typeof e.show?e.show:function(){},hide:"function"==typeof e.hide?e.hide:function(){}})}),"show"==e&&(n=(t=this.eq(0)).data("cnt")+1,i=t.data("show"),o.toFront(t),t.data("cnt",n),t.is(":hidden")&&(t.show(),i())),"hide"==e&&(n=(t=this.eq(0)).data("cnt")-1,a=t.data("hide"),t.data("cnt",n),n<=0&&(t.hide(),a())),this},st.fn.elfinderpanel=function(a){return this.each(function(){var n=st(this).addClass("elfinder-panel ui-state-default ui-corner-all"),i="margin-"+("ltr"==a.direction?"left":"right");a.one("load",function(e){var t=a.getUI("navbar");n.css(i,parseInt(t.outerWidth(!0))),t.on("resize",function(e){e.preventDefault(),e.stopPropagation(),n.is(":visible")&&n.css(i,parseInt(t.outerWidth(!0)))})})})},st.fn.elfinderpath=function(f,m){return this.each(function(){function n(o){var r=[],s=[];return st.each(f.parents(o),function(e,t){var n=o===t?"elfinder-path-dir elfinder-path-cwd":"elfinder-path-dir",i=f.file(t),a=f.escape(i.i18||i.name);s.push(a),r.push('<span id="'+d+t+'" class="'+n+'" title="'+s.join(f.option("separator"))+'">'+a+"</span>")}),r.join('<span class="elfinder-path-other">'+f.option("separator")+"</span>")}function t(){var e;u.children("span.elfinder-path-dir").attr("style",""),e="ltr"===f.direction?st("#"+d+f.cwd().hash).prevAll("span.elfinder-path-dir:first"):st(),u.scrollLeft(e.length?e.position().left:0)}function i(){var i,e,a,n;f.UA.CSS.flex||(e=(i=u.children("span.elfinder-path-dir")).length,"workzone"===l||e<2?i.attr("style",""):(u.width(u.css("max-width")),i.css({maxWidth:100/e+"%",display:"inline-block"}),a=u.width()-9,u.children("span.elfinder-path-other").each(function(){a-=st(this).width()}),n=[],i.each(function(e){var t=st(this).width();a-=t,t<this.scrollWidth&&n.push(e)}),u.width(""),n.length?(0<a&&(a/=n.length,st.each(n,function(e,t){var n=st(i[t]);n.css("max-width",n.width()+a)})),i.last().attr("style","")):i.attr("style","")))}var e,a,o="",r="",s=[],l="statusbar",c=f.res("class","hover"),d="path"+(Me.prototype.uniqueid?Me.prototype.uniqueid:"")+"-",p=st('<div class="ui-widget-header ui-helper-clearfix elfinder-workzone-path"></div>'),u=st(this).addClass("elfinder-path").html(" ").on("mousedown","span.elfinder-path-dir",function(e){var t=st(this).attr("id").substr(d.length);e.preventDefault(),t!=f.cwd().hash&&(st(this).addClass(c),o?f.exec("search",o,{target:t,mime:s.join(" ")}):f.trigger("select",{selected:[t]}).exec("open",t))}).prependTo(f.getUI("statusbar").show()),h=st('<div class="elfinder-path-roots"></div>').on("click",function(e){e.stopPropagation(),e.preventDefault();var t=st.map(f.roots,function(e){return f.file(e)}),n=[];st.each(t,function(e,t){t.phash||f.root(f.cwd().hash,!0)===t.hash||n.push({label:f.escape(t.i18||t.name),icon:"home",callback:function(){f.exec("open",t.hash)},options:{iconClass:t.csscls||"",iconImg:t.icon||""}})}),f.trigger("contextmenu",{raw:n,x:e.pageX,y:e.pageY})}).append('<span class="elfinder-button-icon elfinder-button-icon-menu" ></span>').appendTo(p);f.one("init",function(){e=f.getUI("tree").length,a=f.getUI("stat").length,!e&&m.toWorkzoneWithoutNavbar&&(p.append(u).insertBefore(f.getUI("workzone")),l="workzone",f.bind("open",t).one("opendone",function(){f.getUI().trigger("resize")}))}).bind("open searchend parents",function(){r=o="",s=[],u.html(n(f.cwd().hash)),1<Object.keys(f.roots).length?(u.css("margin",""),h.show()):(u.css("margin",0),h.hide()),a||i()}).bind("searchstart",function(e){e.data&&(o=e.data.query||"",r=e.data.target||"",s=e.data.mimes||[])}).bind("search",function(e){var t="",t=r?n(r):f.i18n("btnAll");u.html('<span class="elfinder-path-other">'+f.i18n("searcresult")+": </span>"+t),i()}).bind("navbarshow navbarhide",function(){var e=f.getUI("workzone");"navbarshow"===this.type?(f.unbind("open",t),u.prependTo(f.getUI("statusbar")),p.detach(),l="statusbar"):(p.append(u).insertBefore(e),l="workzone",t(),f.bind("open",t)),f.trigger("uiresize")}).bind("resize uistatchange",i)})},st.fn.elfinderplaces=function(O,S){return this.each(function(){function c(e){return e.substr(6)}function n(e){return"place-"+e}function s(e){return st(document.getElementById(n(e)))}function d(){var e=[],n={};(e=st.map(A.children().find("[id]"),function(e){return c(e.id)})).length?st.each(e.reverse(),function(e,t){n[t]=l[t]}):n=null,O.storage(w,n)}function i(){var e,t;w="places"+(S.suffix?S.suffix:""),l={},"string"==typeof(e=O.storage(w))?(e=st.grep(e.split(","),function(e){return!!e}),st.each(e,function(e,t){var n=t.split("#");l[n[0]]=n[1]?n[1]:n[0]})):st.isPlainObject(e)&&(l=e),O.trigger("placesload",{dirs:l,storageKey:w},!0),(t=Object.keys(l)).length&&(T.prepend(b),O.request({data:{cmd:"info",targets:t},preventDefault:!0}).done(function(e){var i={};e.files&&e.files.length&&O.cache(e.files),st.each(e.files,function(e,t){var n=t.hash;i[n]=t}),st.each(l,function(e,t){k(i[e]||Object.assign({notfound:!0},t))}),0<O.storage("placesState")&&T.trigger("click")}).always(function(){b.remove()}))}function o(e,t){return st(g.replace(/\{id\}/,n(e?e.hash:t)).replace(/\{name\}/,O.escape(e?e.i18||e.name:t)).replace(/\{cssclass\}/,e?O.perms2class(e)+(e.notfound?" elfinder-na":"")+(e.csscls?" "+e.csscls:""):"").replace(/\{permissions\}/,!e||e.read&&e.write&&!e.notfound?"":v).replace(/\{title\}/,e?' title="'+O.escape(O.path(e.hash,!0)||e.i18||e.name)+'"':"").replace(/\{symlink\}/,"").replace(/\{style\}/,e&&e.icon?O.getIconStyle(e):""))}function p(e){var t,n,i=null;return l[e]&&(delete l[e],(t=s(e)).length&&(i=t.text(),t.parent().remove(),n=A.children().length,C.toggle(1<n),n||(T.removeClass(a),j.removeClass(h),A.slideToggle(!1)))),i}function r(e,t){var n=e.hash,i=s(t||n),a=o(e,n);return 0<i.length&&(i.parent().replaceWith(a),l[n]=e,!0)}var l={},e="class",u=O.res(e,"navdir"),a=O.res(e,"navcollapse"),h=O.res(e,"navexpand"),f=O.res(e,"hover"),t=O.res(e,"treeroot"),m=O.res(e,"adroppable"),g=O.res("tpl","placedir"),v=O.res("tpl","perms"),b=st(O.res("tpl","navspinner")),y=S.suffix?S.suffix:"",w="places"+y,x=null,k=function(e){var t,n;return"directory"===e.mime&&(n=e.hash,O.files().hasOwnProperty(n)||O.trigger("tree",{tree:[e]}),t=o(e,n),l[n]=e,A.prepend(t),T.addClass(a),C.toggle(1<A.children().length),!0)},C=st('<span class="elfinder-button-icon elfinder-button-icon-sort elfinder-places-root-icon" title="'+O.i18n("cmdsort")+'"></span>').hide().on("click",function(e){e.stopPropagation(),A.empty(),st.each(l,function(e,t){var n=O.file(e)||t,i=o(n,e),a=null;if(n||i.hide(),A.children().length&&(st.each(A.children(),function(){var e=st(this);if((n.i18||n.name).localeCompare(e.children("."+u).text())<0)return a=!i.insertBefore(e)}),null!==a))return!0;s(e).length||A.append(i)}),d()}),z=o({hash:"root-"+O.namespace,name:O.i18n(S.name,"places"),read:!0,write:!0}),T=z.children("."+u).addClass(t).on("click",function(e){e.stopPropagation(),T.hasClass(a)&&(j.toggleClass(h),A.slideToggle(),O.storage("placesState",j.hasClass(h)?1:0))}).append(C),A=z.children("."+O.res(e,"navsubtree")),j=st(this).addClass(O.res(e,"tree")+" elfinder-places ui-corner-all").hide().append(z).appendTo(O.getUI("navbar")).on("mouseenter mouseleave","."+u,function(e){st(this).toggleClass("ui-state-hover","mouseenter"==e.type)}).on("click","."+u,function(e){var t=st(this);t.data("longtap")?e.stopPropagation():t.hasClass("elfinder-na")||O.exec("open",t.attr("id").substr(6))}).on("contextmenu","."+u+":not(."+t+")",function(e){var t=st(this),r=t.attr("id").substr(6);e.preventDefault(),O.trigger("contextmenu",{raw:[{label:O.i18n("moveUp"),icon:"up",remain:!0,callback:function(){var e,t,n,i,a,o;t=s(e=r),n=t.parent(),i=n.prev("div"),a="ui-state-hover",o=O.getUI("contextmenu"),x&&clearTimeout(x),i.length&&(o.find(":first").data("placesHash",e),t.addClass(a),n.insertBefore(i),i=n.prev("div"),x=setTimeout(function(){t.removeClass(a),o.find(":first").data("placesHash")===e&&o.hide().empty()},1500)),i.length||(t.removeClass(a),o.hide().empty()),d()}},"|",{label:O.i18n("rmFromPlaces"),icon:"rm",callback:function(){p(r),d()}}],x:e.pageX,y:e.pageY}),t.addClass("ui-state-hover"),O.getUI("contextmenu").children().on("mouseenter",function(){t.addClass("ui-state-hover")}),O.bind("closecontextmenu",function(){t.removeClass("ui-state-hover")})}).droppable({tolerance:"pointer",accept:".elfinder-cwd-file-wrapper,.elfinder-tree-dir,.elfinder-cwd-file",hoverClass:O.res("class","adroppable"),classes:{"ui-droppable-hover":O.res("class","adroppable")},over:function(e,t){var n=t.helper,i=st.grep(n.data("files"),function(e){return"directory"===O.file(e).mime&&!l[e]});e.stopPropagation(),n.data("dropover",n.data("dropover")+1),O.insideWorkzone(e.pageX,e.pageY)&&(0<i.length?(n.addClass("elfinder-drag-helper-plus"),O.trigger("unlockfiles",{files:n.data("files"),helper:n})):st(this).removeClass(m))},out:function(e,t){var n=t.helper;e.stopPropagation(),n.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus").data("dropover",Math.max(n.data("dropover")-1,0)),st(this).removeData("dropover").removeClass(m)},drop:function(e,t){var n=t.helper,i=!0;st.each(n.data("files"),function(e,t){var n=O.file(t);n&&"directory"==n.mime&&!l[n.hash]?k(n):i=!1}),d(),i&&n.hide()}}).on("touchstart","."+u+":not(."+t+")",function(e){var t,n;1<e.originalEvent.touches.length||(t=st(this).attr("id").substr(6),n=st(this).addClass(f).data("longtap",null).data("tmlongtap",setTimeout(function(){n.data("longtap",!0),O.trigger("contextmenu",{raw:[{label:O.i18n("rmFromPlaces"),icon:"rm",callback:function(){p(t),d()}}],x:e.originalEvent.touches[0].pageX,y:e.originalEvent.touches[0].pageY})},500)))}).on("touchmove touchend","."+u+":not(."+t+")",function(e){clearTimeout(st(this).data("tmlongtap")),"touchmove"==e.type&&st(this).removeClass(f)});st.fn.sortable&&A.addClass("touch-punch").sortable({appendTo:O.getUI(),revert:!1,helper:function(e){var t=st(e.target).parent();return t.children().removeClass("ui-state-hover"),st('<div class="ui-widget elfinder-place-drag elfinder-'+O.direction+'"></div>').append(st('<div class="elfinder-navbar"></div>').show().append(t.clone()))},stop:function(e,t){var n=st(t.item[0]),i=j.offset().top,a=j.offset().left,o=j.width(),r=j.height(),s=e.pageX,l=e.pageY;a<s&&s<a+o&&i<l&&l<l+r||(p(c(n.children(":first").attr("id"))),d())},update:function(e,t){d()}}),st(this).on("regist",function(e,t){var n=!1;st.each(t,function(e,t){t&&"directory"==t.mime&&!l[t.hash]&&k(t)&&(n=!0)}),n&&d()}),O.one("load",function(){O.oldAPI||(j.show().parent().show(),i(),O.change(function(e){var n=!1;st.each(e.data.changed,function(e,t){l[t.hash]&&("directory"!==t.mime?p(t.hash)&&(n=!0):r(t)&&(n=!0))}),n&&d()}).bind("rename",function(n){var i=!1;n.data.removed&&st.each(n.data.removed,function(e,t){n.data.added[e]&&r(n.data.added[e],t)&&(i=!0)}),i&&d()}).bind("rm paste",function(e){var i=[],t=!1;e.data.removed&&st.each(e.data.removed,function(e,t){var n=p(t);n&&i.push(n)}),i.length&&(t=!0),e.data.added&&i.length&&st.each(e.data.added,function(e,t){1!==st.inArray(t.name,i)&&"directory"==t.mime&&k(t)}),t&&d()}).bind("sync netmount",function(){var e,o=this,t=S.suffix?S.suffix:"";if("sync"===o.type&&y!==t)return y=t,A.empty(),T.removeClass(a),j.removeClass(h),A.slideToggle(!1),void i();(e=Object.keys(l)).length&&(T.prepend(b),O.request({data:{cmd:"info",targets:e},preventDefault:!0}).done(function(e){var i={},n=!1,a=O.cwd().hash;st.each(e.files||[],function(e,t){var n=t.hash;i[n]=t,O.files().hasOwnProperty(t.hash)||O.updateCache({tree:[t]})}),st.each(l,function(e,t){Boolean(t.notfound)===Boolean(i[e])?t.phash===a&&"netmount"!==o.type||i[e]&&"directory"!==i[e].mime?p(e)&&(n=!0):r(i[e]||Object.assign({notfound:!0},t))&&(n=!0):i[e]&&i[e].phash!=a&&r(i[e])}),n&&d()}).always(function(){b.remove()}))}))})})},st.fn.elfindersearchbutton=function(g){return this.each(function(){function a(e){return l.namespace+l.escape(e)}function t(){m.data("inctm")&&clearTimeout(m.data("inctm"));var e=st.trim(m.val()),t=!st("#"+a("SearchFromAll")).prop("checked"),n=st("#"+a("SearchMime")).prop("checked"),i="",t=t&&(st("#"+a("SearchFromVol")).prop("checked")?l.root(l.cwd().hash):l.cwd().hash);n&&(n=e,e="."),o&&(i=o.children("input:checked").val()),e?(m.trigger("focus"),g.exec(e,t,n,i).done(function(){s=!0}).fail(function(){h()})):l.trigger("searchend")}var n,o,r,i,s=!1,l=g.fm,c=(l.res("class","disabled"),g.options.incsearch||{enable:!1}),e=g.options.searchTypes,d=l.getUI("toolbar"),p=l.res("class","searchbtn"),u=st(this).hide().addClass("ui-widget-content elfinder-button "+p).on("click",function(e){e.stopPropagation()}),h=function(){m.data("inctm")&&clearTimeout(m.data("inctm")),m.val("").trigger("blur"),(s||f)&&(s=!1,f="",l.lazy(function(){l.trigger("searchend")}))},f="",m=st('<input type="text" size="42"/>').on("focus",function(){var e,t;u.hasClass("ui-state-active")||l.getUI().click(),i=!0,f="",u.addClass("ui-state-active"),l.trigger("uiresize"),n&&n.css((e=l.getUI(),t=e.offset(),{top:u.offset().top-t.top,maxHeight:e.height()-40})).slideDown(function(){u.addClass("ui-state-active"),l.toFront(n)})}).on("blur",function(){i=!1,n?n.data("infocus")?n.data("infocus",!1):n.slideUp(function(){u.removeClass("ui-state-active"),l.trigger("uiresize"),l.toHide(n)}):u.removeClass("ui-state-active")}).appendTo(u).on("keypress",function(e){e.stopPropagation()}).on("keydown",function(e){e.stopPropagation(),e.keyCode===st.ui.keyCode.ENTER?t():e.keyCode===st.ui.keyCode.ESCAPE&&(e.preventDefault(),h())});c.enable&&(c.minlen=c.minlen||2,c.wait=c.wait||500,m.attr("title",l.i18n("incSearchOnly")).on("compositionstart",function(){m.data("composing",!0)}).on("compositionend",function(){m.removeData("composing"),m.trigger("input")}).on("input",function(){m.data("composing")||(m.data("inctm")&&clearTimeout(m.data("inctm")),m.data("inctm",setTimeout(function(){var e=m.val();(0===e.length||e.length>=c.minlen)&&(f!==e&&l.trigger("incsearchstart",{query:e,type:o?o.children("input:checked").val():"searchName"}),""===(f=e)&&1<l.searchStatus.state&&l.searchStatus.query&&m.val(l.searchStatus.query).trigger("select"))},c.wait)))}),l.UA.ltIE8&&m.on("keydown",function(e){229===e.keyCode&&(m.data("imetm")&&clearTimeout(m.data("imetm")),m.data("composing",!0),m.data("imetm",setTimeout(function(){m.removeData("composing")},100)))}).on("keyup",function(e){m.data("imetm")&&clearTimeout(m.data("imetm")),m.data("composing")?e.keyCode===st.ui.keyCode.ENTER&&m.trigger("compositionend"):m.trigger("input")})),st('<span class="ui-icon ui-icon-search" title="'+g.title+'"></span>').appendTo(u).on("mousedown",function(e){e.stopPropagation(),e.preventDefault(),u.hasClass("ui-state-active")?t():m.trigger("focus")}),st('<span class="ui-icon ui-icon-close"></span>').appendTo(u).on("mousedown",function(e){e.stopPropagation(),e.preventDefault(),""!==m.val()||u.hasClass("ui-state-active")?h():m.trigger("focus")}),l.bind("toolbarload",function(){var e,t=u.parent();t.length&&(d.prepend(u.show()),t.remove(),l.UA.ltIE7&&(e=u.children("ltr"==l.direction?".ui-icon-close":".ui-icon-search")).css({right:"",left:parseInt(u.width())-e.outerWidth(!0)}))}),l.one("init",function(){l.getUI("cwd").on("touchstart click",function(){i&&m.trigger("blur")})}).one("open",function(){(n=l.api<2.1?null:st('<div class="ui-front ui-widget ui-widget-content elfinder-button-menu elfinder-button-search-menu ui-corner-all"></div>').append(st('<div class="buttonset"></div>').append(st('<input id="'+a("SearchFromCwd")+'" name="serchfrom" type="radio" checked="checked"/><label for="'+a("SearchFromCwd")+'">'+l.i18n("btnCwd")+"</label>"),st('<input id="'+a("SearchFromVol")+'" name="serchfrom" type="radio"/><label for="'+a("SearchFromVol")+'">'+l.i18n("btnVolume")+"</label>"),st('<input id="'+a("SearchFromAll")+'" name="serchfrom" type="radio"/><label for="'+a("SearchFromAll")+'">'+l.i18n("btnAll")+"</label>")),st('<div class="buttonset elfinder-search-type"></div>').append(st('<input id="'+a("SearchName")+'" name="serchcol" type="radio" checked="checked" value="SearchName"/><label for="'+a("SearchName")+'">'+l.i18n("btnFileName")+"</label>"))).hide().appendTo(l.getUI()))&&(e&&(o=n.find(".elfinder-search-type"),st.each(g.options.searchTypes,function(e,t){o.append(st('<input id="'+a(e)+'" name="serchcol" type="radio" value="'+l.escape(e)+'"/><label for="'+a(e)+'">'+l.i18n(t.name)+"</label>"))})),n.find("div.buttonset").buttonset(),st("#"+a("SearchFromAll")).next("label").attr("title",l.i18n("searchTarget",l.i18n("btnAll"))),e&&st.each(e,function(e,t){t.title&&st("#"+a(e)).next("label").attr("title",l.i18n(t.title))}),n.on("mousedown","div.buttonset",function(e){e.stopPropagation(),n.data("infocus",!0)}).on("click","input",function(e){e.stopPropagation(),st.trim(m.val())?t():m.trigger("focus")}).on("close",function(){m.trigger("blur")}))}).bind("searchend",function(){m.val("")}).bind("open parents",function(){var n=[],e=l.file(l.root(l.cwd().hash));e&&(st.each(l.parents(l.cwd().hash),function(e,t){n.push(l.file(t).name)}),st("#"+a("SearchFromCwd")).next("label").attr("title",l.i18n("searchTarget",n.join(l.option("separator")))),st("#"+a("SearchFromVol")).next("label").attr("title",l.i18n("searchTarget",e.name)))}).bind("open",function(){f&&h()}).bind("cwdinit",function(){r=!1}).bind("cwdrender",function(){r=!0}).bind("keydownEsc",function(){f&&"/"===f.substr(0,1)&&(f="",m.val(""),l.trigger("searchend"))}).shortcut({pattern:"ctrl+f f3",description:g.title,callback:function(){m.trigger("select").trigger("focus")}}).shortcut({pattern:"a b c d e f g h i j k l m n o p q r s t u v w x y z dig0 dig1 dig2 dig3 dig4 dig5 dig6 dig7 dig8 dig9 num0 num1 num2 num3 num4 num5 num6 num7 num8 num9",description:l.i18n("firstLetterSearch"),callback:function(e){var t,n,i;r&&(n=function(){var e=l.selected(),t=st.ui.keyCode[!e.length||l.cwdHash2Elm(e[0]).next("[id]").length?"RIGHT":"HOME"];st(document).trigger(st.Event("keydown",{keyCode:t,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1}))},96<=(t=e.originalEvent.keyCode)&&t<=105&&(t-=48),i="/"+String.fromCharCode(t),f!==i?(m.val(i),f=i,l.trigger("incsearchstart",{query:i}).one("cwdrender",n)):n())}})})},st.fn.elfindersortbutton=function(m){return this.each(function(){function e(){i.toHide(h)}function t(){h.children("[rel]").removeClass(l+" "+c+" "+d).filter('[rel="'+i.sortType+'"]').addClass(l+" "+("asc"==i.sortOrder?c:d)),h.children(".elfinder-sort-stick").toggleClass(l,i.sortStickFolders),h.children(".elfinder-sort-tree").toggleClass(l,i.sortAlsoTreeview)}var n,i=m.fm,a=m.name,o=i.res("class","disabled"),r=i.res("class","hover"),s="elfinder-button-menu-item",l=s+"-selected",c=l+"-asc",d=l+"-desc",p=st('<span class="elfinder-button-text">'+m.title+"</span>"),u=st(this).addClass("ui-state-default elfinder-button elfinder-menubutton elfiner-button-"+a).attr("title",m.title).append('<span class="elfinder-button-icon elfinder-button-icon-'+a+'"></span>',p).on("mouseenter mouseleave",function(e){u.hasClass(o)||u.toggleClass(r,"mouseenter"===e.type)}).on("click",function(e){u.hasClass(o)||(e.stopPropagation(),h.is(":hidden")&&i.getUI().click(),h.css(f()).slideToggle({duration:100,done:function(e){i[h.is(":visible")?"toFront":"toHide"](h)}}))}),h=st('<div class="ui-front ui-widget ui-widget-content elfinder-button-menu elfinder-button-sort-menu ui-corner-all"></div>').hide().appendTo(i.getUI()).on("mouseenter mouseleave","."+s,function(e){st(this).toggleClass(r,"mouseenter"===e.type)}).on("click",function(e){e.preventDefault(),e.stopPropagation()}).on("close",e),f=function(){var e=i.getUI().offset(),t=u.offset();return{top:t.top-e.top,left:t.left-e.left}};p.hide(),st.each(i.sortRules,function(e,t){h.append(st('<div class="'+s+'" rel="'+e+'"><span class="ui-icon ui-icon-arrowthick-1-n"></span><span class="ui-icon ui-icon-arrowthick-1-s"></span>'+i.i18n("sort"+e)+"</div>").data("type",e))}),h.children().on("click",function(e){m.exec([],st(this).removeClass(r).attr("rel"))}),st('<div class="'+s+" "+s+'-separated elfinder-sort-ext elfinder-sort-stick"><span class="ui-icon ui-icon-check"></span>'+i.i18n("sortFoldersFirst")+"</div>").appendTo(h).on("click",function(){m.exec([],"stick")}),i.one("init",function(){i.ui.tree&&null!==i.options.sortAlsoTreeview&&st('<div class="'+s+" "+s+'-separated elfinder-sort-ext elfinder-sort-tree"><span class="ui-icon ui-icon-check"></span>'+i.i18n("sortAlsoTreeview")+"</div>").appendTo(h).on("click",function(){m.exec([],"tree")})}).bind("disable select",e).bind("sortchange",t).getUI().on("click",e),1<h.children().length?m.change(function(){n&&cancelAnimationFrame(n),n=requestAnimationFrame(function(){u.toggleClass(o,m.disabled()),t()})}).change():u.addClass(o)})},st.fn.elfinderstat=function(p){return this.each(function(){function t(e){s.find("span.elfinder-stat-incsearch").html(e?e.hashes.length+" / ":""),s.attr("title",s.text()),p.trigger("uistatchange")}function e(e){var t,n,i=0,a=0,o=[];1===e.length?(n=e[0],i=n.size,2===p.searchStatus.state&&(t=p.escape(n.path?n.path.replace(/\/[^\/]*$/,""):".."),o.push('<a href="#elf_'+n.phash+'" data-hash="'+n.hash+'" title="'+t+'">'+t+"</a>")),o.push(p.escape(n.i18||n.name)),r.html(o.join("/")+(0<i?", "+p.formatSize(i):""))):e.length?(st.each(e,function(e,t){a++,i+=parseInt(t.size)||0}),r.html(a?c+": "+a+", "+d+": "+p.formatSize(i):" ")):r.html(""),r.attr("title",r.text()),p.trigger("uistatchange")}var s=st(this).addClass("elfinder-stat-size"),r=st('<div class="elfinder-stat-selected"></div>').on("click","a",function(e){var t=st(this).data("hash");e.preventDefault(),p.exec("opendir",[t])}),l=p.i18n("items"),c=p.i18n("selected"),d=p.i18n("size");p.getUI("statusbar").prepend(s).append(r).show(),p.UA.Mobile&&st.fn.tooltip&&p.getUI("statusbar").tooltip({classes:{"ui-tooltip":"elfinder-ui-tooltip ui-widget-shadow"},tooltipClass:"elfinder-ui-tooltip ui-widget-shadow",track:!0}),p.bind("cwdhasheschange",function(e){var t,n,i,a,o,r;t=st.map(e.data,function(e){return p.file(e)}),i=n=0,a=p.cwd(),r=o=!0,(a.sizeInfo||a.size)&&(i=a.size,o=!1),st.each(t,function(e,t){n++,o&&(i+=parseInt(t.size)||0,!0!==r||"directory"!==t.mime||t.sizeInfo||(r=!1))}),s.html(l+': <span class="elfinder-stat-incsearch"></span>'+n+', <span class="elfinder-stat-size'+(r?" elfinder-stat-size-recursive":"")+'">'+p.i18n(r?"sum":"size")+": "+p.formatSize(i)+"</span>").attr("title",s.text()),p.trigger("uistatchange")}).change(function(e){var t=e.data.changed||[],n=p.cwd().hash;st.each(t,function(){if(this.hash===n)return this.size&&(s.children(".elfinder-stat-size").addClass("elfinder-stat-size-recursive").html(p.i18n("sum")+": "+p.formatSize(this.size)),s.attr("title",s.text())),!1})}).select(function(){e(p.selectedFiles())}).bind("open",function(){e([])}).bind("incsearch",function(e){t(e.data)}).bind("incsearchend",function(){t()})})},st.fn.elfindertoast=function(o,r){var e=Object.assign({mode:"success",msg:"",showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1500,hideEasing:"swing",onHidden:void 0,timeOut:3e3,extNode:void 0,button:void 0,width:void 0},st.isPlainObject(r.options.uiOptions.toast.defaults)?r.options.uiOptions.toast.defaults:{});return this.each(function(){o=Object.assign({},e,o||{});function t(e){i.stop(),r.toFront(i),i[o.showMethod]({duration:o.showDuration,easing:o.showEasing,complete:function(){o.onShown&&o.onShown(),!e&&o.timeOut&&(n=setTimeout(a,o.timeOut))}})}var n,i=st(this),a=function(){i[o.hideMethod]({duration:o.hideDuration,easing:o.hideEasing,complete:function(){o.onHidden&&o.onHidden(),i.remove()}})};i.on("click",function(e){e.stopPropagation(),e.preventDefault(),n&&clearTimeout(n),o.onHidden&&o.onHidden(),i.stop().remove()}).on("mouseenter mouseleave",function(e){o.timeOut&&(n&&clearTimeout(n),n=null,"mouseenter"===e.type?t(!0):n=setTimeout(a,o.timeOut))}).hide().addClass("toast-"+o.mode).append(st('<div class="elfinder-toast-msg"></div>').html(o.msg.replace(/%([a-zA-Z0-9]+)%/g,function(e,t){return r.i18n(t)}))),o.extNode&&i.append(o.extNode),o.button&&i.append(st('<button class="ui-button ui-widget ui-state-default ui-corner-all elfinder-tabstop"></button>').append(st('<span class="ui-button-text"></span>').text(r.i18n(o.button.text))).on("mouseenter mouseleave",function(e){st(this).toggleClass("ui-state-hover","mouseenter"==e.type)}).on("click",o.button.click||function(){})),o.width&&i.css("max-width",o.width),t()})},st.fn.elfindertoolbar=function(w,x){return this.not(".elfinder-toolbar").each(function(){function o(e){var t,n;for(st.each(m,function(e,t){t.detach()}),h.empty(),i=g.length;i--;)if(g[i]){for(s=st('<div class="ui-widget-content ui-corner-all elfinder-buttonset"></div>'),a=g[i].length;a--;)t=g[i][a],e&&e[t]||!(r=u[t])||(l="elfinder"+r.options.ui,!m[t]&&st.fn[l]&&(m[t]=st("<div></div>")[l](r)),m[t]&&(m[t].children(".elfinder-button-text")[p?"show":"hide"](),s.prepend(m[t])));s.children().length&&h.prepend(s),s.children(":gt(0)").before('<span class="ui-widget-content elfinder-toolbar-button-separator"></span>')}(n=u.preference)&&("always"!==f.showPreferenceButton&&(h.children().length||"auto"!==f.showPreferenceButton)||(s=st('<div class="ui-widget-content ui-corner-all elfinder-buttonset"></div>'),t="preference",l="elfinder"+r.options.ui,m[t]=st("<div></div>")[l](n),m[t].children(".elfinder-button-text")[p?"show":"hide"](),s.prepend(m[t]),h.append(s))),!h.data("swipeClose")&&h.children().length?h.show():h.hide(),y=h[0].clientHeight,w.trigger("toolbarload").trigger("uiresize")}var i,a,r,s,l,c,d,p,t,e,u=w._commands,h=st(this).addClass("ui-helper-clearfix ui-widget-header elfinder-toolbar"),f={displayTextLabel:!1,labelExcludeUA:["Mobile"],autoHideUA:["Mobile"],showPreferenceButton:"none"},m={},g=(e=x||[],st.grep(e,function(e){return!st.isPlainObject(e)||(f=Object.assign(f,e),!1)})),v=null,b="",y=0,n=[];f.showPreferenceButton=f.showPreferenceButton.toLowerCase(),"none"!==f.displayTextLabel&&(p=null===(p=w.storage("toolbarTextLabel"))?f.displayTextLabel&&(!f.labelExcludeUA||!f.labelExcludeUA.length||!st.grep(f.labelExcludeUA,function(e){return!!w.UA[e]}).length):1==p,n.push({label:w.i18n("textLabel"),icon:"text",callback:function(){p=!p,h.css("height","").find(".elfinder-button-text")[p?"show":"hide"](),w.trigger("uiresize").storage("toolbarTextLabel",p?"1":"0")}})),f.preferenceInContextmenu&&u.preference&&n.push({label:w.i18n("toolbarPref"),icon:"preference",callback:function(){w.exec("preference",void 0,{tab:"toolbar"})}}),n.length&&h.on("contextmenu",function(e){e.stopPropagation(),e.preventDefault(),w.trigger("contextmenu",{raw:n,x:e.pageX,y:e.pageY})}).on("touchstart",function(e){1<e.originalEvent.touches.length||(h.data("tmlongtap")&&clearTimeout(h.data("tmlongtap")),h.removeData("longtap").data("longtap",{x:e.originalEvent.touches[0].pageX,y:e.originalEvent.touches[0].pageY}).data("tmlongtap",setTimeout(function(){h.removeData("longtapTm").trigger({type:"contextmenu",pageX:h.data("longtap").x,pageY:h.data("longtap").y}).data("longtap",{longtap:!0})},500)))}).on("touchmove touchend",function(e){h.data("tmlongtap")&&(("touchend"===e.type||4<Math.abs(h.data("longtap").x-e.originalEvent.touches[0].pageX)+Math.abs(h.data("longtap").y-e.originalEvent.touches[0].pageY))&&clearTimeout(h.data("tmlongtap")),h.removeData("longtapTm"))}).on("click",function(e){h.data("longtap")&&h.data("longtap").longtap&&(e.stopImmediatePropagation(),e.preventDefault())}).on("touchend click",".elfinder-button",function(e){h.data("longtap")&&h.data("longtap").longtap&&(e.stopImmediatePropagation(),e.preventDefault())}),h.prev().length&&h.parent().prepend(this),o(),w.bind("open sync select toolbarpref",function(){var e,t,n,i=Object.assign({},w.option("disabledFlip")),a=w.storage("toolbarhides");if(!a&&Array.isArray(f.defaultHides)&&(a={},st.each(f.defaultHides,function(){a[this]=!0}),w.storage("toolbarhides",a)),"select"===this.type){if(w.searchStatus.state<2)return;(t=w.selected()).length&&(i=w.getDisabledCmds(t,!0))}st.each(a,function(e){i[e]||(i[e]=!0)}),Object.keys(w.commandMap).length&&st.each(w.commandMap,function(e,t){"hidden"===t&&(i[e]=!0)}),n=Object.keys(i),v&&v.toString()===n.sort().toString()||(o(n.length?i:null),e=!0),v=n.sort(),!e&&b===JSON.stringify(w.commandMap)||(b=JSON.stringify(w.commandMap),e||st.each(st("div.elfinder-button"),function(){var e=st(this).data("origin");e&&st(this).after(e).detach()}),Object.keys(w.commandMap).length&&st.each(w.commandMap,function(e,t){var n,i=w._commands[t],a=i?"elfinder"+i.options.ui:null;a&&st.fn[a]&&(n=m[e])&&(!m[t]&&st.fn[a]&&(m[t]=st("<div></div>")[a](i),m[t]&&(m[t].children(".elfinder-button-text")[p?"show":"hide"](),i.extendsCmd&&m[t].children("span.elfinder-button-icon").addClass("elfinder-button-icon-"+i.extendsCmd))),m[t]&&(n.after(m[t]),m[t].data("origin",n.detach())))}))}).bind("resize",function(e){t&&cancelAnimationFrame(t),t=requestAnimationFrame(function(){var e=h[0].clientHeight;y!==e&&(y=e,w.trigger("uiresize"))})}),w.UA.Touch&&(void 0===(d=w.storage("autoHide")||{}).toolbar&&(d.toolbar=f.autoHideUA&&0<f.autoHideUA.length&&st.grep(f.autoHideUA,function(e){return!!w.UA[e]}).length,w.storage("autoHide",d)),d.toolbar&&w.one("init",function(){w.uiAutoHide.push(function(){h.stop(!0,!0).trigger("toggle",{duration:500,init:!0})})}),w.bind("load",function(){"none"!==(c=st('<div class="elfinder-toolbar-swipe-handle"></div>').hide().appendTo(w.getUI())).css("pointer-events")&&(c.remove(),c=null)}),h.on("toggle",function(e,t){var n=w.getUI("workzone"),i=h.is(":hidden"),a=n.height(),o=h.height(),r=h.outerHeight(!0)-o,s=Object.assign({step:function(e){n.height(a+(i?-1*(e+r):o-e)),w.trigger("resize")},always:function(){requestAnimationFrame(function(){h.css("height",""),w.trigger("uiresize"),c&&(i?c.stop(!0,!0).hide():(c.height(t.handleH?t.handleH:""),w.resources.blink(c,"slowonce"))),i&&h.scrollTop("0px"),t.init&&w.trigger("uiautohide")})}},t);h.data("swipeClose",!i).stop(!0,!0).animate({height:"toggle"},s),d.toolbar=!i,w.storage("autoHide",Object.assign(w.storage("autoHide"),{toolbar:d.toolbar}))}).on("touchstart",function(e){5<h.scrollBottom()&&(e.originalEvent._preventSwipeY=!0)}))}),this},st.fn.elfindertree=function(ae,oe){var re=ae.res("class","tree");return this.not("."+re).each(function(){function s(e){var t=ne.offset().left;return t<=e&&e<=t+ne.width()}function g(){var e=Object.keys(P);e.length&&(R&&R._abort(),i&&clearTimeout(i),q=[],R=ae.asyncJob(function(e){return ae.isInWindow(st("#"+e))?e:null},e,{numPerOnce:200}).done(function(e){e.length&&(q=e,_())}))}function k(i){return B.replace(/(?:\{([a-z]+)\})/gi,function(e,t){var n=X[t]?X[t](i):i[t]||"";return"id"===t&&-1==i.dirs&&(P[n]=n),n})}function v(e,t){return st.map(e||[],function(e){return"directory"!==e.mime||t&&!ae.navHash2Elm(e.hash).length?null:e})}function b(e){return e?ae.navHash2Elm(e).next("."+O):ee}function y(e,t){for(var n,i=e.children(":first");i.length;){if(ae.file(ae.navId2Hash(i.children("[id]").attr("id"))),(n=ae.file(ae.navId2Hash(i.children("[id]").attr("id"))))&&G(t,n)<0)return i;i=i.next()}return e.children("button.elfinder-navbar-pager-next")}function w(e){for(var t,n=e||ae.cwd(),i=n.hash?[n.hash]:[],a=ae.root(n.hash),o=ae.file(a);o&&(t=o.phash)&&(i.unshift(t),a=ae.root(t),o=ae.file(a),!ae.navHash2Elm(o.hash).hasClass(F)););return i}function x(e){var t=e||ae.cwd(),n=t.hash,i=ae.navHash2Elm(n);if(!i.length){for(;t&&t.phash;)K[t.phash]&&!ae.navHash2Elm(t.hash).length&&K[t.phash].trigger("update."+ae.namespace,{select:t.hash}),t=ae.file(t.phash);i=ae.navHash2Elm(n)}return i}function C(a,e){function t(e,t){function n(){A&&o&&(b(o.hash).show().prev(I).addClass(E),A=!1),f?Y().done(g):g()}var i;e&&st.each(e,function(e,t){t&&J(t),x(ae.file(e)),t&&Z(t,F)}),a&&(ae.api<2.1&&a.push(u),J(a)),(i=x()).hasClass(U)||(ee.find(I+"."+U).removeClass(U),i.addClass(U)),i.parents(".elfinder-navbar-wrapper").children("."+S).addClass(F),e?ae.lazy(n).done(function(){t.resolve()}):(n(),t.resolve())}function n(e){o&&(i.remove(),o.addClass(M+(e?"":" "+F)))}var o,i,r,d,s,l,c,p,u=ae.cwd(),h=u.hash,f=void 0===e?j:e,m=st.Deferred();return ae.navHash2Elm(h).length?t(void 0,m):(z=!0,l=st.Deferred(),c=[],p=w(r),((c=st.map(p,function(t){var n,e,i,a,o=ae.file(t),r=!!o&&ae.isRoot(o),s=ae.navHash2Elm(t),l=function(e,t){var n,i=t||1,a=!!(n=ae.file(e))&&n.phash;return a&&1<i?l(a,--i):a},c=function(){var e=l(t);for(n=e;e&&!ae.navHash2Elm(e).hasClass(F);)e=l(n=e);return e||(n=void 0,e=ae.root(t)),e}();return s.hasClass(F)||!r&&o&&ae.navHash2Elm(o.phash).hasClass(F)?null:(r||c===l(t)||c===l(t,2)?(n=void 0,e="tree",r||(t=l(t))):e="parents",d=d||("tree"===e?t:c),a={cmd:e,target:t},(i=n)&&(a.until=i),ae.request({data:a,preventFail:!0}))})).length?(x(ae.file(d)),s=ae.navHash2Id(d),f&&Y(s),o=st("#"+s),i=st(ae.res("tpl","navspinner")).insertBefore(o.children("."+D)),o.removeClass(M),st.when.apply(st,c).done(function(){var e,t,n={},i=arguments.length;if(0<i)for(t=0;t<i;t++)e=arguments[t].tree||[],n[p[t]]=Object.assign([],v(e));l.resolve(n)}).fail(function(){l.reject()}),l):l.resolve()).done(function(e){t(e,m),n()}).fail(function(){n(!0),m.reject()}).always(function(){z=!1})),ae.trigger("treesync",m),m}var i,l,z,e,t="class",T=ae.UA.Mobile,o=ae.res(t,"treeroot"),A=oe.openRootOnLoad,c=oe.openCwdOnOpen,j=c||oe.syncTree,O=ae.res(t,"navsubtree"),S=ae.res(t,"treedir"),I="span."+S,M=ae.res(t,"navcollapse"),E=ae.res(t,"navexpand"),F="elfinder-subtree-loaded",a="elfinder-subtree-chksubdir",D=ae.res(t,"navarrow"),U=ae.res(t,"active"),d=ae.res(t,"adroppable"),p=ae.res(t,"hover"),r=ae.res(t,"disabled"),u=ae.res(t,"draggable"),h=ae.res(t,"droppable"),n="elfinder-navbar-wrapper-root",f="elfinder-navbar-wrapper-pastable",m="elfinder-navbar-wrapper-uploadable",P={},q=[],R=null,H=0,_=function(){var e,t=oe.subdirsMaxConn-H,n=ae.maxTargets?Math.min(ae.maxTargets,oe.subdirsAtOnce):oe.subdirsAtOnce;if(i&&cancelAnimationFrame(i),q.length)if(0<t)for(e=0;e<t;e++)q.length&&(H++,function(e){var n=[];if(st.each(e,function(e,t){P[t]&&n.push(ae.navId2Hash(t)),delete P[t]}),n.length)return ae.request({data:{cmd:"subdirs",targets:n,preventDefault:!0}}).done(function(e){e&&e.subdirs&&st.each(e.subdirs,function(e,t){var n=ae.navHash2Elm(e);n.removeClass(a),n[t?"addClass":"removeClass"](M)})})}(q.splice(0,n)).always(function(){H--,_()}));else i=requestAnimationFrame(function(){q.length&&_()})},N=ae.droppable.drop,L=st.extend(!0,{},ae.droppable,{over:function(e,n){var i,t,a=st(this),o=n.helper,r=p+" "+d;if(e.stopPropagation(),o.data("dropover",o.data("dropover")+1),a.data("dropover",!0),n.helper.data("namespace")!==ae.namespace||!ae.insideWorkzone(e.pageX,e.pageY))return a.removeClass(r),void o.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus");s(e.clientX)?(o.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus"),a.addClass(p),a.is("."+M+":not(."+E+")")&&a.data("expandTimer",setTimeout(function(){a.is("."+M+"."+p)&&a.children("."+D).trigger("click")},500)),a.is(".elfinder-ro,.elfinder-na")?a.removeClass(d):(i=ae.navId2Hash(a.attr("id")),a.data("dropover",i),st.each(n.helper.data("files"),function(e,t){if(t===i||ae.file(t).phash===i&&!n.helper.hasClass("elfinder-drag-helper-plus"))return a.removeClass(r),!1}),o.data("locked")?t="elfinder-drag-helper-plus":(t="elfinder-drag-helper-move",(e.shiftKey||e.ctrlKey||e.metaKey)&&(t+=" elfinder-drag-helper-plus")),a.hasClass(d)&&o.addClass(t),requestAnimationFrame(function(){a.hasClass(d)&&o.addClass(t)}))):a.removeClass(r)},out:function(e,t){var n=st(this),i=t.helper;e.stopPropagation(),s(e.clientX)&&i.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus"),i.data("dropover",Math.max(i.data("dropover")-1,0)),n.data("expandTimer")&&clearTimeout(n.data("expandTimer")),n.removeData("dropover").removeClass(p+" "+d)},deactivate:function(){st(this).removeData("dropover").removeClass(p+" "+d)},drop:function(e,t){s(e.clientX)&&N.call(this,e,t)}}),W=st(ae.res("tpl","navspinner")),B=ae.res("tpl","navdir"),$=ae.res("tpl","perms"),V=(ae.res("tpl","lock"),ae.res("tpl","symlink")),K={},X={id:function(e){return ae.navHash2Id(e.hash)},name:function(e){return ae.escape(e.i18||e.name)},cssclass:function(e){var t=(e.phash&&!e.isroot?"":o)+" "+S+" "+ae.perms2class(e);return e.dirs&&!e.link&&(t+=" "+M)&&-1==e.dirs&&(t+=" "+a),oe.getClass&&(t+=" "+oe.getClass(e)),e.csscls&&(t+=" "+ae.escape(e.csscls)),t},title:function(e){return oe.attrTitle?' title="'+ae.escape(ae.path(e.hash,!0)||e.i18||e.name)+'"':""},root:function(e){var t="";return!e.phash||e.isroot?(t+=" "+n,!e.disabled||e.disabled.length<1?t+=" "+f+" "+m:(-1===st.inArray("paste",e.disabled)&&(t+=" "+f),-1===st.inArray("upload",e.disabled)&&(t+=" "+m)),t):""},permissions:function(e){return e.read&&e.write?"":$},symlink:function(e){return e.alias?V:""},style:function(e){return e.icon?ae.getIconStyle(e):""}},J=function(e){function i(p,u,e,t){function h(){r={},st.each(u,function(e,t){r[t.hash]=e})}function f(e,t){var n,i;e.stopPropagation(),t.select?y(v(t.select)):t.change?"prepare"===(i=t.change)?st.each(u,function(e,t){t.node&&p.append(t.node.hide())}):"done"===i&&st.each(u,function(e,t){t.node&&t.node.detach().show()}):(t.removed&&t.removed.length&&(u=st.grep(u,function(e){return-1===t.removed.indexOf(e.hash)||(n=n||!0,!1)})),t.added&&t.added.length&&(u=u.concat(st.grep(t.added,function(e){return void 0===r[e.hash]&&(n=n||!0,!0)}))),n&&(u.sort(G),h(),y(m)))}var r={},m=0,g=ae.newAPI?Math.min(1e4,Math.max(10,oe.subTreeMax)):1e4,v=function(e){if(void 0!==r[e])return Math.floor(r[e]/g)*g},b=ae.navId2Hash(p.prev("[id]").attr("id")),y=function(e,t){var n,i,a,o,r,s,l,c=[],d={};delete K[b],m=e,p.off("update."+ae.namespace,f),u.length>g&&(p.on("update."+ae.namespace,f),void 0===e&&(h(),void 0===(e=v(x.hash))&&(e=0)),a=u.slice(e,e+g),K[b]=p,o=e?Math.max(-1,e-g):-1,r=e+g>=u.length?0:e+g,n=Math.ceil(u.length/g),i=Math.ceil(e/g)),st.each(a||u,function(e,t){c.push(k(t)),t.node&&(d[t.hash]=t.node)}),s=-1<o?st('<button class="elfinder-navbar-pager elfinder-navbar-pager-prev"></button>').text(ae.i18n("btnPrevious",i,n)).button({icons:{primary:"ui-icon-caret-1-n"}}).on("click",function(e){e.preventDefault(),e.stopPropagation(),y(o,"up")}):st(),l=r?st('<button class="elfinder-navbar-pager elfinder-navbar-pager-next"></button>').text(ae.i18n("btnNext",i+2,n)).button({icons:{primary:"ui-icon-caret-1-s"}}).on("click",function(e){e.preventDefault(),e.stopPropagation(),y(r,"down")}):st(),w(),p.empty()[a?"addClass":"removeClass"]("elfinder-navbar-hasmore").append(s,c.join(""),l),st.each(d,function(e,t){ae.navHash2Elm(e).parent().replaceWith(t)}),t&&Y(ae.navHash2Id(a["up"===t?a.length-1:0].hash)),T||ae.lazy(function(){Q(null,p)})},w=function(){st.each(p.children(".elfinder-navbar-wrapper"),function(e,t){var n,i,a=st(t),o=a.children("[id]:first");o.hasClass(F)&&(n=ae.navId2Hash(o.attr("id")))&&void 0!==(i=r[n])&&(u[i].node=a.detach())})};y()}for(var t,n,a,o,r,s,l,c=e.length,d=[],p=c,u=st(),h={},x=ae.cwd(),f={},m=[],g={};p--;)h[(t=e[p]).hash]||ae.navHash2Elm(t.hash).length||(h[t.hash]=!0,(n=b(t.phash)).length?(void 0===g[l=t.phash||"treeroot"]&&(g[l]=n.children(":last")),o=!g[l].length,t.phash&&(o||n.hasClass("elfinder-navbar-hasmore")||(a=y(n,t)).length)?o?(f[t.phash]||(f[t.phash]=[]),f[t.phash].push(t)):a?(s=k(t),a.before(s),T||(u=u.add(s))):m.push(t):(s=k(t),o?n.prepend(s):g[l].after(s),t.phash&&!t.isroot||(r=ae.navHash2Elm(t.hash).parent()),T||Q(null,r))):d.push(t));Object.keys(f).length&&st.each(f,function(e,t){var n=b(e);t.sort(G),i(n,t)}),m.length&&n.trigger("update."+ae.namespace,{added:m}),d.length&&d.length<c?J(d):!T&&u.length&&ae.lazy(function(){Q(u)})},G=function(e,t){if(ae.sortAlsoTreeview){var n="asc"==ae.sortOrder,i=ae.sortType,a=ae.sortRules,o=n?a[ae.sortType](e,t):a[ae.sortType](t,e);return"name"!==i&&0===o?o=n?a.name(e,t):a.name(t,e):o}return ae.sortRules.name(e,t)},Y=function(e){var t,n,i,a,o,r,s=st.Deferred();return l&&clearTimeout(l),l=setTimeout(function(){(t=st(document.getElementById(e||ae.navHash2Id(ae.cwd().hash)))).length?((c?t:t.parent()).parents(".elfinder-navbar-wrapper").children("."+F).addClass(E).next("."+O).show(),n=ee.parent().stop(!1,!0),i=n.offset().top,a=n.height(),o=i+a-t.outerHeight(),(r=t.offset().top)<i||o<r?n.animate({scrollTop:n.scrollTop()+r-i-a/3},{duration:oe.durations.autoScroll,complete:function(){s.resolve()}}):s.resolve()):s.reject()},100),s},Q=function(e,t){e||(t&&!t.closest("div."+n).hasClass(m)||(t||ee.find("div."+m)).find(I+":not(.elfinder-ro,.elfinder-na)").addClass("native-droppable"),e=!t||t.closest("div."+n).hasClass(f)?(t||ee.find("div."+f)).find(I+":not(."+h+")"):st(),t&&t.children("div."+n).each(function(){Q(null,st(this))})),e.length&&ae.asyncJob(function(e){st(e).droppable(L)},st.makeArray(e),{interval:20,numPerOnce:100})},Z=function(e,n){var i=n==F?"."+M+":not(."+F+")":":not(."+M+")";st.each(e,function(e,t){ae.navHash2Elm(t.phash).filter(i).filter(function(){return 0<st.grep(st(this).next("."+O).children(),function(e){return!st(e).children().hasClass(o)}).length}).addClass(n)})},ee=st(this).addClass(re).on("mouseenter mouseleave",I,function(e){var t,n,i,a="mouseenter"===e.type;a&&te||((t=st(this)).hasClass(d+" "+r)||(T||!a||t.data("dragRegisted")||t.hasClass(o+" "+u+" elfinder-na elfinder-wo")||(t.data("dragRegisted",!0),ae.isCommandEnabled("copy",n=ae.navId2Hash(t.attr("id")))&&t.draggable(ae.draggable)),t.toggleClass(p,a)),a&&oe.attrTitle&&((i=ae.file(n||ae.navId2Hash(t.attr("id")))).isroot||t.attr("title")!==(i.i18||i.name)||t.attr("title",ae.path(n,!0))))}).on("dragenter",I,function(e){var t;e.originalEvent.dataTransfer&&((t=st(this)).addClass(p),t.is("."+M+":not(."+E+")")&&t.data("expandTimer",setTimeout(function(){t.is("."+M+"."+p)&&t.children("."+D).trigger("click")},500)))}).on("dragleave",I,function(e){var t;e.originalEvent.dataTransfer&&((t=st(this)).data("expandTimer")&&clearTimeout(t.data("expandTimer")),t.removeClass(p))}).on("click",I,function(e){var t=st(this),n=ae.navId2Hash(t.attr("id"));ae.file(n);if(t.data("longtap"))return t.removeData("longtap"),void e.stopPropagation();t.hasClass(U)||(ee.find(I+"."+U).removeClass(U),t.addClass(U)),n==ae.cwd().hash||t.hasClass(r)?(t.hasClass(M)&&t.children("."+D).trigger("click"),ae.select({selected:[n],origin:"navbar"})):ae.exec("open",n).done(function(){ae.one("opendone",function(){ae.select({selected:[n],origin:"navbar"})})})}).on("touchstart",I,function(e){var t,n;1<e.originalEvent.touches.length||(t=e.originalEvent,"INPUT"!==e.target.nodeName?n=st(this).addClass(p).removeData("longtap").data("tmlongtap",setTimeout(function(e){n.data("longtap",!0),ae.trigger("contextmenu",{type:"navbar",targets:[ae.navId2Hash(n.attr("id"))],x:t.touches[0].pageX,y:t.touches[0].pageY})},500)):e.stopPropagation())}).on("touchmove touchend",I,function(e){"INPUT"!==e.target.nodeName?(clearTimeout(st(this).data("tmlongtap")),st(this).removeData("tmlongtap"),"touchmove"==e.type&&st(this).removeClass(p)):e.stopPropagation()}).on("click",I+"."+M+" ."+D,function(e){var t=st(this),n=t.parent(I),i=n.next("."+O),a=st.Deferred();e.stopPropagation(),n.hasClass(F)?(n.toggleClass(E),ae.lazy(function(){30<(n.hasClass(E)?i.children().length+i.find("div.elfinder-navbar-subtree[style*=block]").children().length:i.find("div:visible").length)?(i.toggle(),ae.draggingUiHelper&&ae.draggingUiHelper.data("refreshPositions",1),g()):i.stop(!0,!0)[n.hasClass(E)?"slideDown":"slideUp"](oe.durations.slideUpDown,function(){ae.draggingUiHelper&&ae.draggingUiHelper.data("refreshPositions",1),g()})}).always(function(){a.resolve()})):(W.insertBefore(t),n.removeClass(M),ae.request({cmd:"tree",target:ae.navId2Hash(n.attr("id"))}).done(function(e){J(Object.assign([],v(e.tree))),i.children().length&&(n.addClass(M+" "+E),30<i.children().length?(i.show(),ae.draggingUiHelper&&ae.draggingUiHelper.data("refreshPositions",1),g()):i.stop(!0,!0).slideDown(oe.durations.slideUpDown,function(){ae.draggingUiHelper&&ae.draggingUiHelper.data("refreshPositions",1),g()}))}).always(function(e){W.remove(),n.addClass(F),ae.one("treedone",function(){a.resolve()})})),t.data("dfrd",a)}).on("contextmenu",I,function(e){var t=st(this);t.find("input:text").length?e.stopPropagation():(e.preventDefault(),t.data("tmlongtap")||ae.trigger("contextmenu",{type:"navbar",targets:[ae.navId2Hash(st(this).attr("id"))],x:e.pageX,y:e.pageY}),t.addClass("ui-state-hover"),ae.getUI("contextmenu").children().on("mouseenter",function(){t.addClass("ui-state-hover")}),ae.bind("closecontextmenu",function(){t.removeClass("ui-state-hover")}))}).on("scrolltoview",I,function(e,t){var n=st(this);Y(n.attr("id")).done(function(){t&&"undefined"!==t.blink&&!t.blink||ae.resources.blink(n,"lookme")})}).on("create."+ae.namespace,function(e,t){var n=b(t.phash),i=t.move||!1,a=st(k(t)).addClass("elfinder-navbar-wrapper-tmp"),o=ae.selected();i&&o.length&&ae.trigger("lockfiles",{files:o}),n.prepend(a)}),te=!1,ne=ae.getUI("navbar").append(ee).show().on("scroll",function(){te=!0,e&&cancelAnimationFrame(e),e=requestAnimationFrame(function(){te=!1,g()})}),ie=ae.sortAlsoTreeview;ae.open(function(e){var t=e.data,n=v(t.files),i=ae.getUI("contextmenu");t.init&&ee.empty(),ae.UA.iOS&&ne.removeClass("overflow-scrolling-touch").addClass("overflow-scrolling-touch"),n.length?ae.lazy(function(){i.data("cmdMaps")||i.data("cmdMaps",{}),J(n),Z(n,F),C(n)}):C()}).add(function(e){var t=v(e.data.added);t.length&&(J(t),Z(t,M))}).change(function(e){if(!z){var t,n,i,a,o,r,s,l,c,d,p,u,h=v(e.data.changed,!0),f=h.length,m=f;st();for(st.each(K,function(e,t){t.trigger("update."+ae.namespace,{change:"prepare"})});m--;)if(n=(t=h[m]).phash,(i=ae.navHash2Elm(t.hash)).length){if(p=i.parent(),n){if(o=i.closest("."+O),r=b(n),s=i.parent().next(),l=y(r,t),!r.length)continue;r[0]===o[0]&&s.get(0)===l.get(0)||(l.length?l.before(p):r.append(p))}c=i.hasClass(E),d=i.hasClass(F),a=st(k(t)),i.replaceWith(a.children(I)),T||Q(null,p),t.dirs&&(c||d)&&(i=ae.navHash2Elm(t.hash))&&i.next("."+O).children().length&&(c&&i.addClass(E),d&&i.addClass(F)),u|=-1==t.dirs}u&&g(),st.each(K,function(e,t){t.trigger("update."+ae.namespace,{change:"done"})}),f&&C(void 0,!1)}}).remove(function(e){var t,n,i,a=e.data.removed,o=a.length;for(st.each(K,function(e,t){t.trigger("update."+ae.namespace,{removed:a}),t.trigger("update."+ae.namespace,{change:"prepare"})});o--;)(t=ae.navHash2Elm(a[o])).length&&(i=!0,n=t.closest("."+O),t.parent().detach(),n.children().length||n.hide().prev(I).removeClass(M+" "+E+" "+F));i&&ae.getUI("navbar").children(".ui-resizable-handle").trigger("resize"),st.each(K,function(e,t){t.trigger("update."+ae.namespace,{change:"done"})})}).bind("lockfiles unlockfiles",function(e){var i="lockfiles"==e.type,a=!!e.data.helper&&e.data.helper.data("locked"),o=i&&!a?"disable":"enable",t=st.grep(e.data.files||[],function(e){var t=ae.file(e);return!(!t||"directory"!=t.mime)});st.each(t,function(e,t){var n=ae.navHash2Elm(t);n.length&&!a&&(n.hasClass(u)&&n.draggable(o),n.hasClass(h)&&n.droppable(o),n[i?"addClass":"removeClass"](r))})}).bind("sortchange",function(){var n,e,i,a,o,r;!ae.sortAlsoTreeview&&ie===ae.sortAlsoTreeview||(e=[],i={},o="",r=!(a={}),ae.lazy(function(){n=v(ae.files()),ie=ae.sortAlsoTreeview,ee.empty(),J(st.map(ae.roots,function(e){var t=ae.file(e);return t&&!t.phash?t:null})),Object.keys(K).length?(1<(e=w()).length?(st.each(e,function(e,t){var n=ae.file(ae.root(t)).volumeid;0===e&&(o=n),a[n]=t,i[t]=[]}),st.each(n,function(e,t){return t.volumeid?void i[a[t.volumeid]||a[o]].push(t):!(r=!0)})):r=!0,r?st.each(e,function(e,t){J(n),x(ae.file(t)),Z(n,F)}):st.each(i,function(e,t){J(t),x(ae.file(e)),Z(t,F)})):(J(n),x(),Z(n,F)),C()},100))})}),this},st.fn.elfinderuploadbutton=function(o){return this.each(function(){var e,t=o.fm,n=st(this).elfinderbutton(o).off("click"),i=st("<form></form>").appendTo(n),a=st('<input type="file" multiple="true" title="'+o.fm.i18n("selectForUpload")+'"/>').on("change",function(){var e=st(this);e.val()&&(t.exec("upload",{input:e.remove()[0]},void 0,t.cwd().hash),a.clone(!0).appendTo(i))}).on("dragover",function(e){e.originalEvent.dataTransfer.dropEffect="copy"});i.append(a.clone(!0)),o.change(function(){e&&cancelAnimationFrame(e),e=requestAnimationFrame(function(){var e=o.disabled();i.is("visible")?e||i.hide():e&&i.show()})}).change()})},st.fn.elfinderviewbutton=function(a){return this.each(function(){var e,t=st(this).elfinderbutton(a),n=t.children(".elfinder-button-icon"),i=t.children(".elfinder-button-text");a.change(function(){e&&cancelAnimationFrame(e),e=requestAnimationFrame(function(){var e="icons"==a.value;n.toggleClass("elfinder-button-icon-view-list",e),a.className=e?"view-list":"",a.title=a.fm.i18n(e?"viewlist":"viewicons"),t.attr("title",a.title),i.html(a.title)})})})},st.fn.elfinderworkzone=function(l){var c="elfinder-workzone";return this.not("."+c).each(function(){function e(){a=o.outerHeight(!0)-o.height()}function t(e){var t=s.height()-a,n=s.attr("style"),i=Math.round(o.height());e&&(e.preventDefault(),e.stopPropagation()),s.css("overflow","hidden").children(":visible:not(."+c+")").each(function(){var e=st(this);"absolute"!=e.css("position")&&"fixed"!=e.css("position")&&(t-=e.outerHeight(!0))}),s.attr("style",n||""),t=Math.max(0,Math.round(t)),r===t&&i===t||(r=Math.round(o.height()),o.height(t),l.trigger("wzresize"))}var a,o=st(this).addClass(c),r=Math.round(o.height()),s=o.parent();e(),s.on("resize."+l.namespace,t),l.one("cssloaded",function(){a=o.outerHeight(!0)-o.height(),t()}).bind("uiresize",t).bind("themechange",e)}),this},Me.prototype.commands.archive=function(){var l,c=this,d=c.fm,p=[];this.variants=[],this.disableOnSearch=!1,this.nextAction={},d.bind("open reload",function(){c.variants=[],st.each(p=d.option("archivers").create||[],function(e,t){c.variants.push([t,d.mime2kind(t)])}),c.change()}),this.getstate=function(e){var t,n=this.files(e),i=n.length,a=i&&!d.isRoot(n[0])&&(d.file(n[0].phash)||{}).write&&!st.grep(n,function(e){return!e.read}).length;return a&&1<d.searchStatus.state&&(t=d.cwd().volumeid,a=i===st.grep(n,function(e){return!(!e.read||0!==e.hash.indexOf(t))}).length),a&&!this._disabled&&p.length&&(i||l&&"pending"==l.state())?0:-1},this.exec=function(e,t){var n,i=this.files(e),a=i.length,o=t||p[0],r=d.file(i[0].phash)||null,s=["errArchive","errPerm","errCreatingTempDir","errFtpDownloadFile","errFtpUploadFile","errFtpMkdir","errArchiveExec","errExtractExec","errRm"];if(l=st.Deferred().fail(function(e){e&&d.error(e)}),!a||!p.length||-1===st.inArray(o,p))return l.reject();if(!r.write)return l.reject(s);for(n=0;n<a;n++)if(!i[n].read)return l.reject(s);return c.mime=o,c.prefix=(1<a?"Archive":i[0].name)+(d.option("archivers").createext?"."+d.option("archivers").createext[o]:""),c.data={targets:c.hashes(e),type:o},d.cwd().hash!==r.hash?d.exec("open",r.hash).done(function(){d.one("cwdrender",function(){d.selectfiles({files:e}),l=st.proxy(d.res("mixin","make"),c)()})}):(d.selectfiles({files:e}),l=st.proxy(d.res("mixin","make"),c)()),l}},(Me.prototype.commands.back=function(){this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+left backspace"}],this.getstate=function(){return this.fm.history.canBack()?0:-1},this.exec=function(){return this.fm.history.back()}}).prototype={forceLoad:!0},Me.prototype.commands.chmod=function(){this.updateOnSelect=!1;function x(e){return!isNaN(parseInt(e,8)&&parseInt(e,8)<=511)||e.match(/^([r-][w-][x-]){3}$/i)}var e=this.fm,k={0:"owner",1:"group",2:"other"},C={read:e.i18n("read"),write:e.i18n("write"),execute:e.i18n("execute"),perm:e.i18n("perm"),kind:e.i18n("kind"),files:e.i18n("files")};this.tpl={main:'<div class="ui-helper-clearfix elfinder-info-title"><span class="elfinder-cwd-icon {class} ui-corner-all"></span>{title}</div>{dataTable}',itemTitle:'<strong>{name}</strong><span id="elfinder-info-kind">{kind}</span>',groupTitle:"<strong>{items}: {num}</strong>",dataTable:'<table id="{id}-table-perm"><tr><td>{0}</td><td>{1}</td><td>{2}</td></tr></table><div class="">'+C.perm+': <input class="elfinder-tabstop elfinder-focus" id="{id}-perm" type="text" size="4" maxlength="3" value="{value}"></div>',fieldset:'<fieldset id="{id}-fieldset-{level}"><legend>{f_title}{name}</legend><input type="checkbox" value="4" class="elfinder-tabstop" id="{id}-read-{level}-perm"{checked-r}> <label for="{id}-read-{level}-perm">'+C.read+'</label><br><input type="checkbox" value="6" class="elfinder-tabstop" id="{id}-write-{level}-perm"{checked-w}> <label for="{id}-write-{level}-perm">'+C.write+'</label><br><input type="checkbox" value="5" class="elfinder-tabstop" id="{id}-execute-{level}-perm"{checked-x}> <label for="{id}-execute-{level}-perm">'+C.execute+"</label><br>"},this.shortcuts=[{}],this.getstate=function(e){var t=this.fm;return 0==(e=e||t.selected()).length&&(e=[t.cwd().hash]),this.checkstate(this.files(e))?0:-1},this.checkstate=function(e){var t=e.length;if(!t)return!1;var n=st.grep(e,function(e){return!(!(e.isowner&&e.perm&&x(e.perm))||1!=t&&"directory"==e.mime)}).length;return t==n},this.exec=function(e){var n=this.hashes(e),t=this.files(n);t.length||(n=[this.fm.cwd().hash],t=this.files(n));function i(){for(var e,t="",n=0;n<3;n++)e=0,st("#"+u+"-read-"+k[n]+"-perm").is(":checked")&&(e|=4),st("#"+u+"-write-"+k[n]+"-perm").is(":checked")&&(e|=2),st("#"+u+"-execute-"+k[n]+"-perm").is(":checked")&&(e|=1),t+=e.toString(8);st("#"+u+"-perm").val(t)}var a,o,r,l=this.fm,s=st.Deferred().always(function(){l.enable()}),c=this.tpl,d=t.length,p=t[0],u=l.namespace+"-perm-"+p.hash,h=c.main,f=' checked="checked"',m=function(){var t,e=st.trim(st("#"+u+"-perm").val());if(!x(e))return!1;b.elfinderdialog("close"),t={cmd:"chmod",targets:n,mode:e},l.request({data:t,notify:{type:"chmod",cnt:d}}).fail(function(e){s.reject(e)}).done(function(e){e.changed&&e.changed.length&&(e.undo={cmd:"chmod",callback:function(){var n=[];return st.each(y,function(e,t){n.push(l.request({data:{cmd:"chmod",targets:t,mode:e},notify:{type:"undo",cnt:t.length}}))}),st.when.apply(null,n)}},e.redo={cmd:"chmod",callback:function(){return l.request({data:t,notify:{type:"redo",cnt:n.length}})}}),s.resolve(e)})},g=function(e){if(isNaN(parseInt(e,8))){for(var t=e.split(""),n=[],i=0,a=t.length;i<a;i++)0===i||3===i||6===i?t[i].match(/[r]/i)?n.push(1):t[i].match(/[-]/)&&n.push(0):1===i||4===i||7===i?t[i].match(/[w]/i)?n.push(1):t[i].match(/[-]/)&&n.push(0):t[i].match(/[x]/i)?n.push(1):t[i].match(/[-]/)&&n.push(0);n.splice(3,0,","),n.splice(7,0,",");for(var o=n.join("").split(","),r=[],s=0,l=o.length;s<l;s++){var c=parseInt(o[s],2).toString(8);r.push(c)}e=r.join("")}else e=parseInt(e,8).toString(8);return e},v={title:this.title,width:"auto",buttons:((r={})[l.i18n("btnApply")]=m,r[l.i18n("btnCancel")]=function(){b.elfinderdialog("close")},r),close:function(){st(this).elfinderdialog("destroy")}},b=l.getUI().find("#"+u),y={},w="";return b.length?(b.elfinderdialog("toTop"),st.Deferred().resolve()):(h=h.replace("{class}",1<d?"elfinder-cwd-icon-group":l.mime2class(p.mime)),1<d?a=c.groupTitle.replace("{items}",l.i18n("items")).replace("{num}",d):(a=c.itemTitle.replace("{name}",p.name).replace("{kind}",l.mime2kind(p)),w=l.tmb(p)),o=function(e,t){for(var n,i,a,o="",r=c.dataTable,s=0;s<3;s++)o+=(n=parseInt(e.slice(s,s+1),8)).toString(8),i=c.fieldset.replace("{f_title}",l.i18n(k[s])).replace("{name}",(a=t[k[s]])?":"+a:"").replace(/\{level\}/g,k[s]),r=r.replace("{"+s+"}",i).replace("{checked-r}",4==(4&n)?f:"").replace("{checked-w}",2==(2&n)?f:"").replace("{checked-x}",1==(1&n)?f:"");return r=r.replace("{value}",o).replace("{valueCaption}",C.perm)}(function(e){for(var t,n,i,a="777",o="",r=e.length,s=0;s<r;s++){t=g(e[s].perm),y[t]||(y[t]=[]),y[t].push(e[s].hash),o="";for(var l=0;l<3;l++)n=parseInt(t.slice(l,l+1),8),i=parseInt(a.slice(l,l+1),8),4!=(4&n)&&4==(4&i)&&(i-=4),2!=(2&n)&&2==(2&i)&&(i-=2),1!=(1&n)&&1==(1&i)&&--i,o+=i.toString(8);a=o}return a}(t),1==t.length?t[0]:{}),h=h.replace("{title}",a).replace("{dataTable}",o).replace(/{id}/g,u),(b=this.fmDialog(h,v)).attr("id",u),w&&st("<img/>").on("load",function(){b.find(".elfinder-cwd-icon").addClass(w.className).css("background-image","url('"+w.url+"')")}).attr("src",w.url),st("#"+u+"-table-perm :checkbox").on("click",function(){i()}),st("#"+u+"-perm").on("keydown",function(e){if(e.keyCode==st.ui.keyCode.ENTER)return e.stopPropagation(),void m()}).on("focus",function(e){st(this).trigger("select")}).on("keyup",function(e){3==st(this).val().length&&(st(this).trigger("select"),function(e){for(var t,n=0;n<3;n++)t=parseInt(e.slice(n,n+1),8),st("#"+u+"-read-"+k[n]+"-perm").prop("checked",!1),st("#"+u+"-write-"+k[n]+"-perm").prop("checked",!1),st("#"+u+"-execute-"+k[n]+"-perm").prop("checked",!1),4==(4&t)&&st("#"+u+"-read-"+k[n]+"-perm").prop("checked",!0),2==(2&t)&&st("#"+u+"-write-"+k[n]+"-perm").prop("checked",!0),1==(1&t)&&st("#"+u+"-execute-"+k[n]+"-perm").prop("checked",!0);i()}(st(this).val()))}),s)}},Me.prototype.commands.colwidth=function(){this.alwaysEnabled=!0,this.updateOnSelect=!1,this.getstate=function(){return"fixed"===this.fm.getUI("cwd").find("table").css("table-layout")?0:-1},this.exec=function(){return this.fm.getUI("cwd").trigger("colwidth"),st.Deferred().resolve()}},Me.prototype.commands.copy=function(){this.shortcuts=[{pattern:"ctrl+c ctrl+insert"}],this.getstate=function(e){var t=this.files(e),n=t.length;return n&&st.grep(t,function(e){return!!e.read}).length==n?0:-1},this.exec=function(e){var t=this.fm,n=st.Deferred().fail(function(e){t.error(e)});return st.each(this.files(e),function(e,t){if(!t.read)return!n.reject(["errCopy",t.name,"errPerm"])}),"rejected"==n.state()?n:n.resolve(t.clipboard(this.hashes(e)))}},Me.prototype.commands.cut=function(){var i=this.fm;this.shortcuts=[{pattern:"ctrl+x shift+insert"}],this.getstate=function(e){var t=this.files(e),n=t.length;return n&&st.grep(t,function(e){return!(!e.read||e.locked||i.isRoot(e))}).length==n?0:-1},this.exec=function(e){var n=st.Deferred().fail(function(e){i.error(e)});return st.each(this.files(e),function(e,t){return!t.read||t.locked||i.isRoot(t)?!n.reject(["errCopy",t.name,"errPerm"]):t.locked?!n.reject(["errLocked",t.name]):void 0}),"rejected"==n.state()?n:n.resolve(i.clipboard(this.hashes(e),!0))}},Me.prototype.commands.zipdl=function(){},Me.prototype.commands.download=function(){function k(e,i){var n,a;if(null!==r&&(1<o.searchStatus.state?T=o.searchStatus.mixed:o.leafRoots[o.cwd().hash]&&(n=o.cwd().volumeid,st.each(e,function(e,t){if(0!==t.indexOf(n))return!(T=!0)})),z=o.isCommandEnabled("zipdl",e[0])),T){if(a=r?"zipdl":"download",!(e=st.grep(e,function(e){var t=o.file(e),n=!(!t||!r&&"directory"===t.mime||!o.isCommandEnabled(a,e));return t&&i&&!n&&o.cwdHash2Elm(t.hash).trigger("unselect"),n})).length)return[]}else if(!o.isCommandEnabled("download",e[0]))return[];return st.grep(C.files(e),function(e){var t=!(!e.read||!z&&"directory"==e.mime);return i&&!t&&o.cwdHash2Elm(e.hash).trigger("unselect"),t})}var C=this,o=this.fm,r=null,z=!1,T=!1,A=!1,j=window.location.pathname||"/";this.linkedCmds=["zipdl"],this.shortcuts=[{pattern:"shift+enter"}],this.getstate=function(e){var t=this.hashes(e),n=t.length,i=this.options.maxRequests||10;return!(n<1)&&(n=k(t).length)&&(z||n<=i&&(!o.UA.IE&&!o.UA.Mobile||1==n))?0:-1},o.bind("contextmenu",function(e){function n(r){var e=r.url||s.url(r.hash);return{icon:"link",node:st("<a></a>").attr({href:e,target:"_blank",title:s.i18n("link")}).text(r.name).on("mousedown click touchstart touchmove touchend contextmenu",function(e){e.stopPropagation()}).on("dragstart",function(e){var t,n,i,a,o=e.dataTransfer||e.originalEvent.dataTransfer||null;l=null,o&&(o.effectAllowed="copyLink",o.setDragImage&&(l=st('<div class="elfinder-drag-helper html5-native">').append((n=(t=r).mime,i=s.tmb(t),a='<div class="elfinder-cwd-icon '+s.mime2class(n)+' ui-corner-all"></div>',i&&(a=st(a).addClass(i.className).css("background-image","url('"+i.url+"')").get(0).outerHTML),a)).appendTo(st(document.body)),o.setDragImage(l.get(0),50,47)),s.UA.IE||(o.setData("elfinderfrom",window.location.href+r.phash),o.setData("elfinderfrom:"+o.getData("elfinderfrom"),"")))}).on("dragend",function(e){l&&l.remove()})}}var i,a,t,s=C.fm,l=null;C.extra=null,e.data&&1===(t=e.data.targets||[]).length&&(i=s.file(t[0]))&&"directory"!==i.mime&&("1"!=i.url?C.extra=n(i):(C.extra={icon:"link",node:st("<a></a>").attr({href:"#",title:s.i18n("getLink"),draggable:"false"}).text(i.name).on("click touchstart",function(e){var t;"touchstart"===e.type&&1<e.originalEvent.touches.length||(t=a.parent(),e.stopPropagation(),e.preventDefault(),t.removeClass("ui-state-disabled").addClass("elfinder-button-icon-spinner"),s.request({data:{cmd:"url",target:i.hash},preventDefault:!0}).always(function(e){t.removeClass("elfinder-button-icon-spinner"),e.url?(s.file(i.hash).url=e.url,a.replaceWith(n(i).node)):t.addClass("ui-state-disabled")}))})},(a=C.extra.node).ready(function(){requestAnimationFrame(function(){a.parent().addClass("ui-state-disabled").css("pointer-events","auto")})})))}).one("open",function(){2.1012<=o.api&&(r=o.getCommand("zipdl")),A=o.cookieEnabled&&2.1038<o.api&&!o.isCORS}),this.exec=function(e){function t(u){return function(){var e,d,t,p=st.Deferred(),n=m.file(m.root(u[0])),i=1===u.length,a=n?n.i18||n.name:null;return i?(e=m.file(u[0]))&&(d=e.i18||e.name):(st.each(u,function(){var e=m.file(this);if(!e||t&&t!==e.phash)return t=null,!1;t=e.phash}),t&&(e=m.file(t))&&(d=(e.i18||e.name)+"-"+u.length)),d&&(a=d),a=a&&" ("+a+")",m.request({data:{cmd:"zipdl",targets:u},notify:{type:"zipdl",cnt:1,hideCnt:!0,msg:m.i18n("ntfzipdl")+a},cancel:!0,eachCancel:!0,preventDefault:!0}).done(function(e){function t(e){a=st("<a></a>").attr("href",e).attr("download",m.escape(d)).on("click",function(){p.resolve(),i&&i.elfinderdialog("destroy")}),v?(a.attr("target","_blank").append('<span class="elfinder-button-icon elfinder-button-icon-download"></span>'+m.escape(d)),l[m.i18n("btnCancel")]=function(){i.elfinderdialog("destroy")},i=C.fmDialog(a,{title:m.i18n("link"),buttons:l,width:"200px",destroyOnClose:!0,close:function(){"resolved"!==p.state()&&p.resolve()}})):(b(a.hide().appendTo("body").get(0)),a.remove())}var n,i,a,o,r,s,l={},c="dlw"+ +new Date;e.error?(m.error(e.error),p.resolve()):e.zipdl&&(n=e.zipdl,d?(s=m.splitFileExtention(n.name||""),d+=s[1]?"."+s[1]:".zip"):d=n.name,f||v?(h=m.options.url+(-1===m.options.url.indexOf("?")?"?":"&")+"cmd=zipdl&download=1",st.each([u[0],n.file,d,n.mime],function(e,t){h+="&targets%5B%5D="+encodeURIComponent(t)}),st.each(m.customData,function(e,t){h+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t)}),h+="&"+encodeURIComponent(d),m.hasParrotHeaders()?m.getBinaryByUrl({url:h},function(e){e instanceof Blob?(h=(window.URL||window.webkitURL).createObjectURL(e),t(h)):m.error(["errUploadTransfer",m.i18n("kindZIP")])}):t(h)):(o=st('<form action="'+m.options.url+'" method="post" target="'+c+'" style="display:none"></form>').append('<input type="hidden" name="cmd" value="zipdl"/>').append('<input type="hidden" name="download" value="1"/>'),st.each([u[0],n.file,d,n.mime],function(e,t){o.append('<input type="hidden" name="targets[]" value="'+m.escape(t)+'"/>')}),st.each(m.customData,function(e,t){o.append('<input type="hidden" name="'+e+'" value="'+m.escape(t)+'"/>')}),o.attr("target",c).appendTo("body"),r=st('<iframe style="display:none" name="'+c+'">').appendTo("body").ready(function(){o.submit().remove(),p.resolve(),setTimeout(function(){r.remove()},2e4)})))}).fail(function(e){e&&m.error(e),p.resolve()}),p.promise()}}var n,h,i,f,a,o,r,s,l,c=this.hashes(e),m=this.fm,d=(m.options.url,k(c,!0)),p=st.Deferred(),u="",g={},v=!1,b=function(e){var t;"function"==typeof MouseEvent?t=new MouseEvent("click"):(t=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),m.pauseUnloadCheck(!0),e.dispatchEvent(t)},y=function(e){var t="elfdl"+e;2===document.cookie.split(t+"=").length?(o&&clearTimeout(o),document.cookie=t+"=; path="+j+"; max-age=0",w()):setTimeout(function(){y(e)},200)},w=function(){m.ui.notify.children(".elfinder-notify-download").length&&m.notify({type:"download",cnt:-1})},x=[];if(!d.length)return p.reject();if(a=st.grep(d,function(e){return"directory"!==e.mime}).length,i=st("<a>").hide().appendTo("body"),f="string"==typeof i.get(0).download,z&&(a!==d.length||a>=(this.options.minFilesZipdl||1)))return i.remove(),v=!f&&m.UA.Mobile,T?(g={},st.each(d,function(e,t){var n=t.hash.split("_",2);g[n[0]]?g[n[0]].push(t.hash):g[n[0]]=[t.hash]}),!v&&m.UA.Mobile&&1<Object.keys(g).length&&(v=!0)):g=[st.map(d,function(e){return e.hash})],p=m.sequence(st.map(g,t)).always(function(){m.trigger("download",{files:d})});for(x=[],s=st.Deferred().done(function(e){for(n=0;n<e.length;n++)h=e[n],A&&h.substr(0,m.options.url.length)===m.options.url&&(r=m.getRequestId(),x.push(r),h+="&cpath="+j+"&reqid="+r,o=setTimeout(function(){m.notify({type:"download",cnt:1,cancel:m.UA.IE||m.UA.Edge?void 0:function(){x.length&&st.each(x,function(){m.request({data:{cmd:"abort",id:this},preventDefault:!0})}),x=[]}})},m.notifyDelay),y(r)),f?b(i.attr("href",h).attr("download",m.escape(d[n].name)).get(0)):m.UA.Mobile?setTimeout(function(){window.open(h)||(m.error("errPopup"),o&&cleaerTimeout(o),w())},100):u+='<iframe class="downloader" id="downloader-'+d[n].hash+'" style="display:none" src="'+h+'"></iframe>';i.remove(),st(u).appendTo("body").ready(function(){setTimeout(function(){st(u).each(function(){st("#"+st(this).attr("id")).remove()})},2e4+1e4*n)}),m.trigger("download",{files:d}),p.resolve()}),a=d.length,l=[],n=0;n<d.length;n++)m.openUrl(d[n].hash,!0,function(e){e&&l.push(e),--a<1&&s.resolve(l)});return p}},Me.prototype.commands.duplicate=function(){var i=this.fm;this.getstate=function(e){var t=this.files(e),n=t.length;return n&&i.cwd().write&&st.grep(t,function(e){return!(!e.read||e.phash!==i.cwd().hash||i.isRoot(e))}).length==n?0:-1},this.exec=function(e){var n=this.fm,t=this.files(e),i=t.length,a=st.Deferred().fail(function(e){e&&n.error(e)});return i?(st.each(t,function(e,t){if(!t.read||!n.file(t.phash).write)return!a.reject(["errCopy",t.name,"errPerm"])}),"rejected"==a.state()?a:n.request({data:{cmd:"duplicate",targets:this.hashes(e)},notify:{type:"copy",cnt:i},navigate:{toast:{inbuffer:{msg:n.i18n(["complete",n.i18n("cmdduplicate")])}}}})):a.reject()}},Me.prototype.commands.edit=function(){function M(e){var n,i=st('<select class="ui-corner-all"></select>');return e&&st.each(e,function(e,t){n=D.escape(t.value),i.append('<option value="'+n+'">'+(t.caption?D.escape(t.caption):n)+"</option>")}),st.each(F.options.encodings,function(e,t){i.append('<option value="'+t+'">'+t+"</option>")}),i}function p(e){var n,i,a,o=e.length;return 1<o&&(n=e[0].mime,i=e[0].name.replace(/^.*(\.[^.]+)$/,"$1")),st.grep(e,function(e){var t;return!a&&"directory"!==e.mime&&((t=e.read&&(l||D.mimeIsText(e.mime)||-1!==st.inArray(e.mime,1===o?r:s))&&(!F.onlyMimes.length||-1!==st.inArray(e.mime,F.onlyMimes))&&(1===o||e.mime===n&&e.name.substr(-1*i.length)===i)&&!!D.uploadMimeCheck(e.mime,e.phash)&&b(e,o)&&Object.keys(v).length)||(a=!0),t)})}function E(e){var n,i=D.file(e);D.request({cmd:"info",targets:[e],preventDefault:!0}).done(function(e){var t;e&&e.files&&e.files.length&&(n=e.files[0],i.ts==n.ts&&i.size==n.size||(t={changed:[n]},D.updateCache(t),D.change(t)))})}function u(i,s,a,o,r,e){function l(){return!!T||(D.toast({mode:"warning",msg:D.i18n("nowLoading")}),!1)}function c(){e&&Array.isArray(e)&&st.each(e,function(){this.msg&&D.toast(this)})}function d(){var e,t,n,i=y?y.val():void 0,a=st.Deferred().fail(function(e){b.show().find("button.elfinder-btncnt-0,button.elfinder-btncnt-1").hide()});return l()?(g.editor&&(g.editor.save(g[0],g.editor.instance),(e=g.editor.confObj).info&&(e.info.schemeContent||e.info.arrayBufferContent)&&(i="scheme")),t=j(),O(t),t.promise?(n=setTimeout(function(){D.notify({type:"chkcontent",cnt:1,hideCnt:!0,cancel:function(){t.reject()}})},100),t.always(function(){n&&clearTimeout(n),D.notify({type:"chkcontent",cnt:-1})}).done(function(e){z.notifyWith(g,[i,g.data("hash"),v,a])}).fail(function(e){a.reject(e)})):z.notifyWith(g,[i,g.data("hash"),v,a]),a):a.resolve()}function p(){l()&&d().fail(function(e){e&&D.error(e)})}function u(){g.elfinderdialog("close")}function t(){l()&&(b.hide(),d().done(function(){T=!1,b.show(),u()}).fail(function(e){b.show(),e&&D.error(e)}))}function h(){var t,e,n,i,a,o,r;l()&&(t=v,e=s.phash,n=function(e){r.addClass(U).fadeIn(function(){e&&D.error(e)}),v=t,D.disable()},i=function(){F.mime=I.mime||s.mime,F.prefix=(I.name||s.name).replace(/ \d+(\.[^.]+)?$/,"$1"),F.requestCmd="mkfile",F.nextAction={},F.data={target:e},st.proxy(D.res("mixin","make"),F)().done(function(e){var t;e.added&&e.added.length?(t=g.data("hash"),g.data("hash",e.added[0].hash),d().done(function(){T=!1,b.show(),u(),r.fadeIn()}).fail(function(){D.exec("rm",[e.added[0].hash],{forceRm:!0,quiet:!0}),g.data("hash",t),b.find("button.elfinder-btncnt-2").hide(),n()})):n()}).progress(function(e){e&&"errUploadMime"===e&&g.trigger("saveAsFail")}).fail(n).always(function(){delete F.mime,delete F.prefix,delete F.nextAction,delete F.data}),D.trigger("unselectfiles",{files:[s.hash]})},o=a=null,r=D.getUI().children("."+F.dialogClass+":visible"),b.is(":hidden")&&(r=r.add(b)),r.removeClass(U).fadeOut(),D.enable(),D.searchStatus.state<2&&e!==D.cwd().hash?a=D.exec("open",[e],{thash:e}):D.file(e)||(o=D.request({cmd:"info",targets:[e]})),st.when([a,o]).done(function(){o?D.one("infodone",function(){D.file(e)?i():n("errFolderNotFound")}):a?D.one("cwdrender",i):i()}).fail(n))}function f(){var e,t,n=st.Deferred();return T?(g.editor&&g.editor.save(g[0],g.editor.instance),(e=j())&&e.promise?(t=setTimeout(function(){D.notify({type:"chkcontent",cnt:1,hideCnt:!0,cancel:function(){e.reject()}})},100),e.always(function(){t&&clearTimeout(t),D.notify({type:"chkcontent",cnt:-1})}).done(function(e){n.resolve(v!==e)}).fail(function(e){n.resolve(e||void 0!==v)})):n.resolve(v!==e),n):n.resolve(!1)}function m(){y&&f().done(function(e){e?y.attr("title",D.i18n("saveAsEncoding")).addClass("elfinder-edit-changed"):y.attr("title",D.i18n("openAsEncoding")).removeClass("elfinder-edit-changed")})}var g,v,b,y,n,w,x,k,C,z=st.Deferred(),T=!1,A={title:D.escape(s.name),width:(k=D.options.dialogContained?D.getUI():st(window),C="string"==typeof F.options.dialogWidth&&(x=F.options.dialogWidth.match(/(\d+)%/))?parseInt(k.width()*(x[1]/100)):parseInt(F.options.dialogWidth||650),Math.min(C,k.width())),height:function(){if(F.options.dialogHeight){var e,t=D.options.dialogContained?D.getUI():st(window),n="string"==typeof F.options.dialogHeight&&(e=F.options.dialogHeight.match(/(\d+)%/))?parseInt(t.height()*(e[1]/100)):parseInt(F.options.dialogHeight||t.height());return Math.min(n,t.height())}}(),buttons:{},cssClass:U,maxWidth:"window",maxHeight:"window",allowMinimize:!0,allowMaximize:!0,openMaximized:q()||r&&r.info&&r.info.openMaximized,btnHoverFocus:!1,closeOnEscape:!1,propagationEvents:["mousemove","mouseup","click"],minimize:function(){var e;g.editor&&b.closest(".ui-dialog").is(":hidden")&&(e=g.editor.confObj).info&&e.info.syncInterval&&E(s.hash)},close:function(){function n(){var e;z.resolve(),g.editor&&(g.editor.close(g[0],g.editor.instance),(e=g.editor.confObj).info&&e.info.syncInterval&&E(s.hash)),g.elfinderdialog("destroy")}var i=void 0!==I.name,a=i?{label:"btnSaveAs",callback:function(){requestAnimationFrame(h)}}:{label:"btnSaveClose",callback:function(){d().done(function(){n()})}};f().done(function(e){var t=["confirmNotSave"];e?("string"==typeof e&&t.unshift(e),D.confirm({title:F.title,text:t,accept:a,cancel:{label:"btnClose",callback:n},buttons:i?null:[{label:"btnSaveAs",callback:function(){requestAnimationFrame(h)}}]})):n()})},open:function(){var e,t,n;if(g.initEditArea.call(g,i,s,a,D),g.editor){if((e=g.editor.load(g[0])||null)&&e.done)e.always(function(){T=!0}).done(function(e){g.editor.instance=e,g.editor.focus(g[0],g.editor.instance),O(j()),requestAnimationFrame(function(){b.trigger("resize")})}).fail(function(e){e&&D.error(e),g.elfinderdialog("destroy")}).always(c);else{if(T=!0,e&&("string"==typeof e||Array.isArray(e)))return D.error(e),void g.elfinderdialog("destroy");g.editor.instance=e,g.editor.focus(g[0],g.editor.instance),O(j()),requestAnimationFrame(function(){b.trigger("resize")}),c()}(t=g.editor.confObj).info&&t.info.syncInterval&&(n=parseInt(t.info.syncInterval))&&setTimeout(function(){S(n)},n)}else T=!0,O(j())},resize:function(e,t){g.editor&&g.editor.resize(g[0],g.editor.instance,e,t||{})}},j=function(){var e=g.getContent.call(g,g[0]);return void 0!==e&&!1!==e&&null!==e||(e=st.Deferred().reject()),e},O=function(e){e&&e.promise?e.done(function(e){v=e}):v=e},S=function(e){b.is(":visible")&&(E(s.hash),setTimeout(function(){S(e)},e))},I={};if(r&&(r.html&&(g=st(r.html)),n={init:r.init||null,load:r.load,getContent:r.getContent||null,save:r.save,beforeclose:"function"==typeof r.beforeclose?r.beforeclose:void 0,close:"function"==typeof r.close?r.close:function(){},focus:"function"==typeof r.focus?r.focus:function(){},resize:"function"==typeof r.resize?r.resize:function(){},instance:null,doSave:p,doCancel:u,doClose:t,file:s,fm:D,confObj:r,trigger:function(e,t){D.trigger("editEditor"+e,Object.assign({},r.info||{},t))}}),!g){if(!D.mimeIsText(s.mime))return z.reject("errEditorNotFound");g=st('<textarea class="elfinder-file-edit" rows="20" id="'+i+'-ta"></textarea>').on("input propertychange",m),r&&r.info&&!r.info.useTextAreaEvent||g.on("keydown",function(e){var t,n,i=e.keyCode;e.stopPropagation(),i==st.ui.keyCode.TAB&&(e.preventDefault(),this.setSelectionRange&&(t=this.value,n=this.selectionStart,this.value=t.substr(0,n)+"\t"+t.substr(this.selectionEnd),n+=1,this.setSelectionRange(n,n))),(e.ctrlKey||e.metaKey)&&(i!="Q".charCodeAt(0)&&i!="W".charCodeAt(0)||(e.preventDefault(),u()),i=="S".charCodeAt(0)&&(e.preventDefault(),p()))}).on("mouseenter",function(){this.focus()}),g.initEditArea=function(e,t,n){g.hide().val(n),this._setupSelEncoding(n)}}return g._setupSelEncoding=function(e){function t(e){e&&i.appendTo(y.parent()),i.empty().append(st("<option></option>").text(y.val())),y.width(i.width())}var n=o&&"unknown"!==o?[{value:o}]:[],i=st("<select></select>").hide();""!==e&&o&&"UTF-8"===o||n.push({value:"UTF-8"}),y=M(n).on("touchstart",function(e){e.stopPropagation()}).on("change",function(){f().done(function(e){e||""===j()||(u(),P(s,y.val(),r).fail(function(e){e&&D.error(e)}))}),t()}).on("mouseover",m),g.parent().next().prepend(st('<div class="ui-dialog-buttonset elfinder-edit-extras"></div>').append(y)),t(!0)},g.data("hash",s.hash),n&&("function"==typeof(g.editor=n).beforeclose&&(A.beforeclose=function(){return n.beforeclose(g[0],n.instance)}),"function"==typeof n.init&&(g.initEditArea=n.init),"function"==typeof n.getContent&&(g.getContent=n.getContent)),g.initEditArea||(g.initEditArea=function(){}),g.getContent||(g.getContent=function(){return g.val().replace(/\s+$/,"")}),r&&r.info&&r.info.preventGet||(A.buttons[D.i18n("btnSave")]=p,A.buttons[D.i18n("btnSaveClose")]=t,A.buttons[D.i18n("btnSaveAs")]=h,A.buttons[D.i18n("btnCancel")]=u),r&&"function"==typeof r.prepare&&r.prepare(g,A,s),b=F.fmDialog(g,A).attr("id",i).on("keydown keyup keypress",function(e){e.stopPropagation()}).css({overflow:"hidden",minHeight:"7em"}).addClass("elfinder-edit-editor").closest(".ui-dialog").on("changeType",function(e,t){var n;t.extention&&t.mime&&(t.extention,t.mime,(n=st(this).children(".ui-dialog-buttonpane").children(".ui-dialog-buttonset")).children(".elfinder-btncnt-0,.elfinder-btncnt-1").hide(),I.name=D.splitFileExtention(s.name)[0]+"."+t.extention,I.mime=t.mime,t.keepEditor||n.children(".elfinder-btncnt-2").trigger("click"))}),w=(D.options.dialogContained?D.getUI():st(window)).width(),b.width()>w&&b.width(w),z.promise()}function h(e,t){e&&t&&(st.isPlainObject(n)||(n={}),n[e]=t.id,D.storage("storedEditors",n),D.trigger("selectfiles",{files:D.selected()}))}function f(){var e=D.storage("useStoredEditor");return e?0<e:F.options.useStoredEditor}function m(n,i){var a=[];return st.each(v,function(e,t){a.push({label:D.escape(t.i18n),icon:t.info&&t.info.icon?t.info.icon:"edit",options:{iconImg:t.info&&t.info.iconImg?D.baseUrl+t.info.iconImg:void 0},callback:function(){h(n[0].mime,t),i&&i.call(t)}})}),a}function g(e){var t=n[e];return t&&Object.keys(v).length?v[t.toLowerCase().replace(/ +/g,"")]:void 0}var n,F=this,D=this.fm,U=D.res("class","editing"),r=[],s=[],l=!1,P=function(a,e,o){var r,t,n,i,s=a.hash,l=(D.options,st.Deferred()),c="edit-"+D.namespace+"-"+a.hash,d=D.getUI().find("#"+c),p=e||0;if(d.length)return d.elfinderdialog("toTop"),l.resolve();if(!(a.read&&(a.write||o.info&&o.info.converter)))return n=["errOpen",a.name,"errPerm"],l.reject(n);if(o&&o.info){if("function"==typeof o.info.edit)return(i=o.info.edit.call(D,a,o)).promise?i.done(function(){l.resolve()}).fail(function(e){l.reject(e)}):i?l.resolve():l.reject(),l;r=o.info.preventGet||o.info.noContent,o.info.urlAsContent||r?(t=st.Deferred(),o.info.urlAsContent?D.url(s,{async:!0,onetime:!0,temporary:!0}).done(function(e){t.resolve({content:e})}):t.resolve({})):(p&&(a.encoding=p,D.cache(a,"change")),t=D.request({data:{cmd:"get",target:s,conv:p,_t:a.ts},options:{type:"get",cache:!0},notify:{type:"file",cnt:1},preventDefault:!0})),t.done(function(n){var i,e,t;n.doconv?D.confirm({title:F.title,text:"unknown"===n.doconv?"confirmNonUTF8":"confirmConvUTF8",accept:{label:"btnConv",callback:function(){l=P(a,i.val(),o)}},cancel:{label:"btnCancel",callback:function(){l.reject()}},optionsCallback:function(e){e.create=function(){var e=st('<div class="elfinder-dialog-confirm-encoding"></div>'),t={value:n.doconv};"unknown"===n.doconv&&(t.caption="-"),i=M([t]),st(this).next().find(".ui-dialog-buttonset").prepend(e.append(st("<label>"+D.i18n("encoding")+" </label>").append(i)))}}}):(!r&&D.mimeIsText(a.mime)&&(e=new RegExp("^(data:"+a.mime.replace(/([.+])/g,"\\$1")+";base64,)","i"),o.info.dataScheme?window.btoa&&!n.content.match(e)&&(n.content="data:"+a.mime+";base64,"+btoa(n.content)):window.atob&&(t=n.content.match(e))&&(n.content=atob(n.content.substr(t[1].length)))),u(c,a,n.content,n.encoding,o,n.toasts).done(function(e){l.resolve(e)}).progress(function(e,t,n,i){var a=this;t&&(s=t),D.request({options:{type:"post"},data:{cmd:"put",target:s,encoding:e||n.encoding,content:n},notify:{type:"save",cnt:1},syncOnFail:!0,preventFail:!0,navigate:{target:"changed",toast:{inbuffer:{msg:D.i18n(["complete",D.i18n("btnSave")])}}}}).fail(function(e){l.reject(e),i.reject()}).done(function(e){requestAnimationFrame(function(){a.trigger("focus"),a.editor&&a.editor.focus(a[0],a.editor.instance)}),i.resolve()})}).fail(function(e){l.reject(e)}))}).fail(function(e){var t=D.parseError(e),t=Array.isArray(t)?t[0]:t;a.encoding&&(a.encoding="",D.cache(a,"change")),"errConvUTF8"!==t&&D.sync(),l.reject(e)})}return l.promise()},v={},t={info:{id:"textarea",name:"TextArea",useTextAreaEvent:!0},load:function(e){this.trigger("Prepare",{node:e,editorObj:void 0,instance:void 0,opts:{}}),e.setSelectionRange&&e.setSelectionRange(0,0),st(e).trigger("focus").show()},save:function(){}},b=function(i,a){var e=F.options.editors||[],o=D.cwd().write;return n=D.storage("storedEditors")||{},v={},e.length||(e=[t]),st.each(e,function(e,t){var n;(1===a||!t.info.single)&&(t.info&&t.info.converter?o:i.write)&&(0<i.size||!t.info.converter&&!1!==t.info.canMakeEmpty&&D.mimesCanMakeEmpty[i.mime])&&(!t.info.maxSize||i.size<=t.info.maxSize)&&function(e,t){if(t){if("*"===t[0]||-1!==st.inArray(e,t))return!0;for(var n=t.length,i=0;i<n;i++)if(0===e.indexOf(t[i]))return!0;return!1}return D.mimeIsText(e)}(i.mime,t.mimes||null)&&function(e,t){if(!t||!t.length)return!0;for(var n=e.replace(/^.+\.([^.]+)|(.+)$/,"$1$2").toLowerCase(),i=t.length,a=0;a<i;a++)if(n===t[a].toLowerCase())return!0;return!1}(i.name,t.exts||null)&&"function"==typeof t.load&&"function"==typeof t.save&&(n=t.info.name?t.info.name:"Editor "+e,t.id=t.info.id?t.info.id:"editor"+e,t.name=n,t.i18n=D.i18n(n),v[t.id]=t)}),!!Object.keys(v).length},q=function(){var e=D.storage("editorMaximized");return e?0<e:F.options.editorMaximized};this.getEncSelect=M,this.shortcuts=[{pattern:"ctrl+e"}],this.init=function(){var t,a=this,o=this.fm,n=this.options,i=[];this.onlyMimes=this.options.mimes||[],o.one("open",function(){n.editors&&Array.isArray(n.editors)&&(o.trigger("canMakeEmptyFile",{mimes:Object.keys(o.storage("mkfileTextMimes")||{}).concat(n.makeTextMimes||["text/plain"])}),st.each(n.editors,function(e,t){t.info&&t.info.cmdCheck&&i.push(t.info.cmdCheck)}),(i.length?2.103<=o.api?o.request({data:{cmd:"editor",name:i,method:"enabled"},preventDefault:!0}).done(function(e){t=e}).fail(function(){t={}}):(t={},st.Deferred().resolve()):st.Deferred().resolve()).always(function(){t&&(n.editors=st.grep(n.editors,function(e){return!e.info||!e.info.cmdCheck||!!t[e.info.cmdCheck]})),st.each(n.editors,function(e,t){t.setup&&"function"==typeof t.setup&&t.setup.call(t,n,o),t.disabled||(t.mimes&&Array.isArray(t.mimes)&&(r=r.concat(t.mimes),t.info&&t.info.single||(s=s.concat(t.mimes))),!l&&t.mimes&&"*"===t.mimes[0]&&(l=!0),t.info||(t.info={}),t.info.integrate&&o.trigger("helpIntegration",Object.assign({cmd:"edit"},t.info.integrate)),t.info.canMakeEmpty&&o.trigger("canMakeEmptyFile",{mimes:Array.isArray(t.info.canMakeEmpty)?t.info.canMakeEmpty:t.mimes}))}),r=(st.uniqueSort||st.unique)(r),s=(st.uniqueSort||st.unique)(s),n.editors=st.grep(n.editors,function(e){return!e.disabled})}))}).bind("select",function(){v=null}).bind("contextmenucreate",function(e){function t(e){var t=a.title;o.one("contextmenucreatedone",function(){a.title=t}),a.title=o.escape(e.i18n),e.info&&e.info.iconImg&&(a.contextmenuOpts={iconImg:o.baseUrl+e.info.iconImg}),delete a.variants}var n,i;a.contextmenuOpts=void 0,"files"===e.data.type&&a.enabled()&&(n=o.file(e.data.targets[0]),b(n,e.data.targets.length)&&(1<Object.keys(v).length?f()&&(i=g(n.mime))?(t(i),a.extra={icon:"menu",node:st("<span></span>").attr({title:o.i18n("select")}).on("click touchstart",function(e){var t;"touchstart"===e.type&&1<e.originalEvent.touches.length||(t=st(this),e.stopPropagation(),e.preventDefault(),o.trigger("contextmenu",{raw:m(o.selectedFiles(),function(){var e=o.selected();o.exec("edit",e,{editor:this}),o.trigger("selectfiles",{files:e})}),x:t.offset().left,y:t.offset().top}))})}):(delete a.extra,a.variants=[],st.each(v,function(e,t){a.variants.push([{editor:t},t.i18n,t.info&&t.info.iconImg?o.baseUrl+t.info.iconImg:"edit"])})):(t(v[Object.keys(v)[0]]),delete a.extra)))}).bind("canMakeEmptyFile",function(e){var n,i;e.data&&e.data.resetTexts&&(n=o.arrayFlip(a.options.makeTextMimes||["text/plain"]),i=a.getMkfileHides(),st.each(o.storage("mkfileTextMimes")||{},function(e,t){n[e]||(delete o.mimesCanMakeEmpty[e],delete i[e])}),o.storage("mkfileTextMimes",null),Object.keys(i).length?o.storage("mkfileHides",i):o.storage("mkfileHides",null))})},this.getstate=function(e){var t=this.files(e),n=t.length;return n&&p(t).length==n?0:-1},this.exec=function(e,t){var n,i,a=this.fm,o=p(this.files(e)),r=st.map(o,function(e){return e.hash}),s=[],l=t&&t.editor?t.editor:null,c=st(t&&t._currentNode?t._currentNode:a.cwdHash2Elm(r[0])),d=st.Deferred();return null===v&&b(o[0],r.length),c.length||(c=a.getUI("cwd")),i=st.Deferred(),(!l&&1<Object.keys(v).length?f()&&(l=g(o[0].mime))?i.resolve(l):(a.trigger("contextmenu",{raw:m(o,function(){i.resolve(this)}),x:c.offset().left,y:c.offset().top+22,opened:function(){a.one("closecontextmenu",function(){requestAnimationFrame(function(){"pending"===i.state()&&i.reject()})})}}),a.trigger("selectfiles",{files:r}),i):(1<Object.keys(v).length&&l&&h(o[0].mime,l),i.resolve(l||(Object.keys(v).length?v[Object.keys(v)[0]]:null)))).done(function(e){for(;n=o.shift();)s.push(P(n,n.encoding||void 0,e).fail(function(e){e&&a.error(e)}));s.length?st.when.apply(null,s).done(function(){d.resolve()}).fail(function(){d.reject()}):d.reject()}).fail(function(){d.reject()}),d},this.getMkfileHides=function(){return D.storage("mkfileHides")||D.arrayFlip(F.options.mkfileHideMimes||[])}},Me.prototype.commands.empty=function(){function s(e){var t=n.files(e);return t.length||(t=[l.cwd()]),t}var n,l;this.linkedCmds=["rm"],this.init=function(){l=(n=this).fm},this.getstate=function(e){var t=s(e),n=t.length;return st.grep(t,function(e){return!(!e.read||!e.write||"directory"!==e.mime)}).length==n?0:-1},this.exec=function(e){function o(e){"number"==typeof e?(a.push(i[e].name),delete i[e].dirs):e&&l.error(e),--r<1&&t[a.length?"resolve":"reject"]()}var i=s(e),r=i.length,t=st.Deferred().done(function(){var n={changed:{}};l.toast({msg:l.i18n(['"'+a.join('", ')+'"',"complete",l.i18n("cmdempty")])}),st.each(i,function(e,t){n.changed[t.hash]=t}),l.change(n)}).always(function(){var t=l.cwd().hash;l.trigger("selectfiles",{files:st.map(i,function(e){return t===e.phash?e.hash:null})})}),a=[];return st.each(i,function(t,i){var a;return i.write&&"directory"===i.mime?l.isCommandEnabled("rm",i.hash)?(a=setTimeout(function(){l.notify({type:"search",cnt:1,hideCnt:!(1<r)})},l.notifyDelay),void l.request({data:{cmd:"open",target:i.hash},preventDefault:!0,asNotOpen:!0}).done(function(e){var n=[];a&&clearTimeout(a),l.ui.notify.children(".elfinder-notify-search").length&&l.notify({type:"search",cnt:-1,hideCnt:!(1<r)}),e&&e.files&&e.files.length?e.files.length>l.maxTargets?o(["errEmpty",i.name,"errMaxTargets",l.maxTargets]):(l.updateCache(e),st.each(e.files,function(e,t){return!t.write||t.locked?(o(["errEmpty",i.name,"errRm",t.name,"errPerm"]),!(n=[])):void n.push(t.hash)}),n.length&&l.exec("rm",n,{_userAction:!0,addTexts:[l.i18n("folderToEmpty",i.name)]}).fail(function(e){l.trigger("unselectfiles",{files:l.selected()}),o(l.parseError(e)||"")}).done(function(){o(t)})):(l.toast({mode:"warning",msg:l.i18n("filderIsEmpty",i.name)}),o(""))}).fail(function(e){o(l.parseError(e)||"")})):(o(["errCmdNoSupport",'"rm"']),null):(o(["errEmpty",i.name,"errPerm"]),null)}),t}},Me.prototype.commands.extract=function(){var e=this,y=e.fm,a=[];this.variants=[],this.disableOnSearch=!0,y.bind("open reload",function(){a=y.option("archivers").extract||[],2<y.api?e.variants=[[{makedir:!0},y.i18n("cmdmkdir")],[{},y.i18n("btnCwd")]]:e.variants=[[{},y.i18n("btnCwd")]],e.change()}),this.getstate=function(e){var t,n=this.files(e),i=n.length;return i&&this.fm.cwd().write&&(t=n,st.grep(t,function(e){return!(!e.read||-1===st.inArray(e.mime,a))}).length==i)?0:-1},this.exec=function(e,t){var r,n,s,i=this.files(e),l=st.Deferred(),c=i.length,d=t&&t.makedir?1:0,p=!1,u=!1,h=0,f=st.map(y.files(e),function(e){return e.name}),m={};st.grep(y.files(e),function(e){return m[e.name]=e,!1});function g(e){switch(e){case"overwrite_all":p=!0;break;case"omit_all":u=!0}}function v(e){e.read&&y.file(e.phash).write?-1===st.inArray(e.mime,a)?(n=["errExtract",e.name,"errNoArchive"],y.error(n),l.reject(n)):y.request({data:{cmd:"extract",target:e.hash,makedir:d},notify:{type:"extract",cnt:1},syncOnFail:!0,navigate:{toast:d?{incwd:{msg:y.i18n(["complete",y.i18n("cmdextract")]),action:{cmd:"open",msg:"cmdopen"}},inbuffer:{msg:y.i18n(["complete",y.i18n("cmdextract")]),action:{cmd:"open",msg:"cmdopen"}}}:{inbuffer:{msg:y.i18n(["complete",y.i18n("cmdextract")])}}}}).fail(function(e){"rejected"!=l.state()&&l.reject(e)}).done(function(){}):(n=["errExtract",e.name,"errPerm"],y.error(n),l.reject(n))}var b=function(t,n){function i(){n+1<c?b(t,n+1):l.resolve()}var a=t[n],e=y.splitFileExtention(a.name)[0],o=0<=st.inArray(e,f);!d&&o&&"directory"!=m[e].mime?y.confirm({title:y.i18n("ntfextract"),text:["errExists",e,"confirmRepl"],accept:{label:"btnYes",callback:function(e){if(g(s=e?"overwrite_all":"overwrite"),p||u){if(p){for(r=n;r<c;r++)v(t[r]);l.resolve()}}else"overwrite"==s&&v(a),n+1<c?b(t,n+1):l.resolve()}},reject:{label:"btnNo",callback:function(e){g(s=e?"omit_all":"omit"),!p&&!u&&n+1<c?b(t,n+1):u&&l.resolve()}},cancel:{label:"btnCancel",callback:function(){l.resolve()}},all:n+1<c}):d?(v(a),i()):0==h?y.confirm({title:y.i18n("cmdextract"),text:[y.i18n("cmdextract")+' "'+a.name+'"',"confirmRepl"],accept:{label:"btnYes",callback:function(e){e&&(h=1),v(a),i()}},reject:{label:"btnNo",callback:function(e){e&&(h=-1),i()}},cancel:{label:"btnCancel",callback:function(){l.resolve()}},all:n+1<c}):(0<h&&v(a),i())};return this.enabled()&&c&&a.length?(0<c&&b(i,0),l):l.reject()}},(Me.prototype.commands.forward=function(){this.alwaysEnabled=!0,this.updateOnSelect=!0,this.shortcuts=[{pattern:"ctrl+right"}],this.getstate=function(){return this.fm.history.canForward()?0:-1},this.exec=function(){return this.fm.history.forward()}}).prototype={forceLoad:!0},Me.prototype.commands.fullscreen=function(){function e(e,t){e.preventDefault(),e.stopPropagation(),t&&t.fullscreen&&n.update(void 0,"on"===t.fullscreen)}var n=this,i=this.fm;this.alwaysEnabled=!0,this.updateOnSelect=!1,this.syncTitleOnChange=!0,this.value=!1,this.options={ui:"fullscreenbutton"},this.getstate=function(){return 0},this.exec=function(){var e=i.getUI().get(0),t=e===i.toggleFullscreen(e);return n.title=i.i18n(t?"reinstate":"cmdfullscreen"),n.update(void 0,t),st.Deferred().resolve()},i.bind("init",function(){i.getUI().off("resize."+i.namespace,e).on("resize."+i.namespace,e)})},(Me.prototype.commands.getfile=function(){var h=this,e=this.fm;this.alwaysEnabled=!0,this.callback=e.options.getFileCallback,this._disabled="function"==typeof this.callback,this.getstate=function(e){var t,n,i=this.files(e),a=i.length;return this.callback&&a&&(t=i,n=h.options,t=st.grep(t,function(e){return!("directory"==e.mime&&!n.folders||!e.read)}),(n.multiple||1==t.length?t:[]).length==a)?0:-1},this.exec=function(e){function t(e){return o.onlyURL?o.multiple?st.map(r,function(e){return e.url}):r[0].url:o.multiple?r:r[0]}for(var n,i,a=this.fm,o=this.options,r=this.files(e),s=r.length,l=a.option("url"),c=a.option("tmbUrl"),d=st.Deferred().done(function(e){function t(){"close"==o.oncomplete?a.hide():"destroy"==o.oncomplete&&a.destroy()}function n(e){"close"==o.onerror?a.hide():"destroy"==o.onerror?a.destroy():e&&a.error(e)}var i;a.trigger("getfile",{files:e});try{i=h.callback(e,a)}catch(e){return void n(["Error in `getFileCallback`.",e.message])}"object"==typeof i&&"function"==typeof i.done?i.done(t).fail(n):t()}),p=[],u=0;u<s;u++){if("directory"==(n=r[u]).mime&&!o.folders)return d.reject();n.baseUrl=l,"1"==n.url?p.push(a.request({data:{cmd:"url",target:n.hash},notify:{type:"url",cnt:1,hideCnt:!0},preventDefault:!0}).done(function(e){e.url&&(a.file(this.hash).url=this.url=e.url)}.bind(n))):n.url=a.url(n.hash),o.onlyURL||(o.getPath&&(n.path=a.path(n.hash),""===n.path&&n.phash&&function(){var e=st.Deferred();p.push(e),a.path(n.hash,!1,{}).done(function(e){n.path=e}).fail(function(){n.path=""}).always(function(){e.resolve()})}()),n.tmb&&1!=n.tmb&&(n.tmb=c+n.tmb),n.width||n.height||(n.dim?(i=n.dim.split("x"),n.width=i[0],n.height=i[1]):o.getImgSize&&-1!==n.mime.indexOf("image")&&p.push(a.request({data:{cmd:"dim",target:n.hash},notify:{type:"dim",cnt:1,hideCnt:!0},preventDefault:!0}).done(function(e){var t,n;e.dim&&(t=e.dim.split("x"),(n=a.file(this.hash)).width=this.width=t[0],n.height=this.height=t[1])}.bind(n)))))}return p.length?(st.when.apply(null,p).always(function(){d.resolve(t())}),d):d.resolve(t())}}).prototype={forceLoad:!0},(Me.prototype.commands.help=function(){function l(){var e=m.theme&&m.theme.author?b[C]("elfinder-help-team","elfinder-help-team elfinder-help-term-theme")[C](x,m.i18n(m.theme.author)+(m.theme.email?" <"+m.theme.email+">":""))[C](k,m.i18n("theme")+" ("+m.i18n(m.theme.name)+")"):'<div class="elfinder-help-team elfinder-help-term-theme" style="display:none"></div>';return e}var c,d,p,u,h,f,m=this.fm,g=this,v='<div class="elfinder-help-link"> <a href="{url}" target="_blank">{link}</a></div>',b='<div class="elfinder-help-team"><div>{author}</div>{work}</div>',y=/\{url\}/,w=/\{link\}/,x=/\{author\}/,k=/\{work\}/,C="replace",z="ui-priority-primary",T="ui-priority-secondary",A="elfinder-help-license",j='<li class="'+m.res("class","tabstab")+' elfinder-help-tab-{id}"><a href="#'+m.namespace+'-help-{id}" class="ui-tabs-anchor">{title}</a></li>',O=['<div class="ui-tabs ui-widget ui-widget-content ui-corner-all elfinder-help">','<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-top">'],S='<div class="elfinder-help-separator"></div>',I=st("base").length?document.location.href.replace(/#.*$/,""):"",M=m.res("class","tabsactive"),E=!1,F=!1,D="";this.alwaysEnabled=!0,this.updateOnSelect=!1,this.state=-1,this.shortcuts=[{pattern:"f1",description:this.title}],m.bind("load",function(){var e,t,n,i,a,o,r,s=g.options.view||["about","shortcuts","help","integrations","debug"];-1!==(e=st.inArray("preference",s))&&s.splice(e,1),st.fn.tabs||-1!==(e=st.inArray(s,"debug"))&&s.splice(e,1),st.each(s,function(e,t){O.push(j[C](/\{id\}/g,t)[C](/\{title\}/,m.i18n(t)))}),O.push("</ul>"),-1!==st.inArray("about",s)&&(O.push('<div id="'+m.namespace+'-help-about" class="ui-tabs-panel ui-widget-content ui-corner-bottom"><div class="elfinder-help-logo"></div>'),O.push("<h3>elFinder</h3>"),O.push('<div class="'+z+'">'+m.i18n("webfm")+"</div>"),O.push('<div class="'+T+'">'+m.i18n("ver")+": "+m.version+"</div>"),O.push('<div class="'+T+'">'+m.i18n("protocolver")+': <span class="apiver"></span></div>'),O.push('<div class="'+T+'">jQuery/jQuery UI: '+st().jquery+"/"+st.ui.version+"</div>"),O.push(S),O.push(v[C](y,"https://studio-42.github.io/elFinder/")[C](w,m.i18n("homepage"))),O.push(v[C](y,"https://github.com/Studio-42/elFinder/wiki")[C](w,m.i18n("docs"))),O.push(v[C](y,"https://github.com/Studio-42/elFinder")[C](w,m.i18n("github"))),O.push(S),O.push('<div class="'+z+'">'+m.i18n("team")+"</div>"),O.push(b[C](x,'Dmitry "dio" Levashov <dio@std42.ru>')[C](k,m.i18n("chiefdev"))),O.push(b[C](x,"Naoki Sawada <hypweb+elfinder@gmail.com>")[C](k,m.i18n("developer"))),O.push(b[C](x,"Troex Nevelin <troex@fury.scancode.ru>")[C](k,m.i18n("maintainer"))),O.push(b[C](x,"Alexey Sukhotin <strogg@yandex.ru>")[C](k,m.i18n("contributor"))),m.i18[m.lang].translator&&st.each(m.i18[m.lang].translator.split(", "),function(){O.push(b[C](x,st.trim(this))[C](k,m.i18n("translator")+" ("+m.i18[m.lang].language+")"))}),O.push(l()),O.push(S),O.push('<div class="'+A+'">'+m.i18n("icons")+': Pixelmixer, <a href="http://p.yusukekamiyamane.com" target="_blank">Fugue</a>, <a href="https://icons8.com" target="_blank">Icons8</a></div>'),O.push(S),O.push('<div class="'+A+'">Licence: 3-clauses BSD Licence</div>'),O.push('<div class="'+A+'">Copyright © 2009-2020, Studio 42</div>'),O.push('<div class="'+A+'">„ …'+m.i18n("dontforget")+" ”</div>"),O.push("</div>")),-1!==st.inArray("shortcuts",s)&&(r=m.shortcuts(),O.push('<div id="'+m.namespace+'-help-shortcuts" class="ui-tabs-panel ui-widget-content ui-corner-bottom">'),r.length?(O.push('<div class="ui-widget-content elfinder-help-shortcuts">'),st.each(r,function(e,t){O.push('<div class="elfinder-help-shortcut"><div class="elfinder-help-shortcut-pattern">{pattern}</div> {descrip}</div>'.replace(/\{pattern\}/,t[0]).replace(/\{descrip\}/,t[1]))}),O.push("</div>")):O.push('<div class="elfinder-help-disabled">'+m.i18n("shortcutsof")+"</div>"),O.push("</div>")),-1!==st.inArray("help",s)&&(t=m.i18nBaseUrl+"help/%s.html.js",O.push('<div id="'+m.namespace+'-help-help" class="ui-tabs-panel ui-widget-content ui-corner-bottom">'),O.push('<a href="https://github.com/Studio-42/elFinder/wiki" target="_blank" class="elfinder-dont-panic"><span>DON\'T PANIC</span></a>'),O.push("</div>")),-1!==st.inArray("integrations",s)&&(E=!0,O.push('<div id="'+m.namespace+'-help-integrations" class="ui-tabs-panel ui-widget-content ui-corner-bottom"></div>')),-1!==st.inArray("debug",s)&&(F=!0,O.push('<div id="'+m.namespace+'-help-debug" class="ui-tabs-panel ui-widget-content ui-corner-bottom">'),O.push('<div class="ui-widget-content elfinder-help-debug"><ul></ul></div>'),O.push("</div>")),O.push("</div>"),(D=st(O.join(""))).find(".ui-tabs-nav li").on("mouseenter mouseleave",function(e){st(this).toggleClass("ui-state-hover","mouseenter"===e.type)}).on("focus blur","a",function(e){st(e.delegateTarget).toggleClass("ui-state-focus","focusin"===e.type)}).children().on("click",function(e){var t=st(this);e.preventDefault(),e.stopPropagation(),t.parent().addClass(M).siblings().removeClass(M),D.children(".ui-tabs-panel").hide().filter(t.attr("href")).show()}).filter(":first").trigger("click"),E&&(d=D.find(".elfinder-help-tab-integrations").hide(),p=D.find("#"+m.namespace+"-help-integrations").hide().append(st('<div class="elfinder-help-integrations-desc"></div>').html(m.i18n("integrationWith"))),m.bind("helpIntegration",function(e){var t,n,i,a,o=p.children("ul:first");e.data&&(st.isPlainObject(e.data)?((t=Object.assign({link:"",title:"",banner:""},e.data)).title||t.link)&&(t.title||(t.title=t.link),n=t.link?st("<a></a>").attr("href",t.link).attr("target","_blank").text(t.title):st("<span></span>").text(t.title),t.banner&&(n=st("<span></span>").append(st("<img/>").attr(t.banner),n))):(n=st(e.data)).filter("a").each(function(){var e=st(this);e.attr("target")||e.attr("target","_blank")}),n&&(d.show(),o.length||(o=st('<ul class="elfinder-help-integrations"></ul>').appendTo(p)),t&&t.cmd?(a="elfinder-help-integration-"+t.cmd,(i=o.find("ul."+a)).length||(i=st('<ul class="'+a+'"></ul>'),o.append(st("<li></li>").append(st("<span></span>").html(m.i18n("cmd"+t.cmd))).append(i))),n=i.append(st("<li></li>").append(n))):o.append(st("<li></li>").append(n))))}).bind("themechange",function(){D.find("div.elfinder-help-term-theme").replaceWith(l())})),F&&(u=D.find(".elfinder-help-tab-debug").hide(),h=D.find("#"+m.namespace+"-help-debug").children("div:first"),f=h.children("ul:first").on("click",function(e){e.preventDefault(),e.stopPropagation()}),g.debug={},m.bind("backenddebug",function(e){var t,n,i,a,o,r,s,l;F&&e.data&&e.data.debug&&(g.debug={options:e.data.options,debug:Object.assign({cmd:m.currentReqCmd},e.data.debug)},g.dialog&&(s=function(n,e){return st.each(e,function(e,t){n.append(st("<dt></dt>").text(e)),void 0===t?n.append(st("<dd></dd>").append(st("<span></span>").text("undfined"))):"object"!=typeof t||t?"object"==typeof t&&(st.isPlainObject(t)||t.length)?n.append(st("<dd></dd>").append(s(st("<dl></dl>"),t))):n.append(st("<dd></dd>").append(st("<span></span>").text(t&&"object"==typeof t?"[]":t||'""'))):n.append(st("<dd></dd>").append(st("<span></span>").text("null")))}),n},l=f.children("li").length,(g.debug.options||g.debug.debug)&&(5<=l&&(o=f.children("li:last"),(r=h.children("div:last")).is(":hidden")?(o.remove(),r.remove()):(o.prev().remove(),r.prev().remove())),i=m.namespace+"-help-debug-"+ +new Date,t=st("<li></li>").html('<a href="'+I+"#"+i+'">'+g.debug.debug.cmd+"</a>").prependTo(f),n=st('<div id="'+i+'"></div>').data("debug",g.debug),t.on("click.debugrender",function(){var e=n.data("debug");n.removeData("debug"),e&&(n.hide(),e.debug&&(a=st("<fieldset>").append(st("<legend></legend>").text("debug"),s(st("<dl></dl>"),e.debug)),n.append(a)),e.options&&(a=st("<fieldset>").append(st("<legend></legend>").text("options"),s(st("<dl></dl>"),e.options)),n.append(a)),n.show()),t.off("click.debugrender")}),f.after(n),c&&h.tabs("refresh"))))})),D.find("#"+m.namespace+"-help-about").find(".apiver").text(m.api),g.dialog=g.fmDialog(D,{title:g.title,width:530,maxWidth:"window",maxHeight:"window",autoOpen:!1,destroyOnClose:!1,close:function(){F&&(u.hide(),h.tabs("destroy")),c=!1}}).on("click",function(e){e.stopPropagation()}).css({overflow:"hidden"}),n=g.dialog.children(".ui-tabs"),i=n.children(".ui-tabs-nav:first"),a=n.children(".ui-tabs-panel"),o=g.dialog.outerHeight(!0)-g.dialog.height(),g.dialog.closest(".ui-dialog").on("resize",function(){a.height(g.dialog.height()-o-i.outerHeight(!0)-20)}),t&&g.dialog.one("initContents",function(){st.ajax({url:g.options.helpSource?g.options.helpSource:t.replace("%s",m.lang),dataType:"html"}).done(function(e){st("#"+m.namespace+"-help-help").html(e)}).fail(function(){st.ajax({url:t.replace("%s","en"),dataType:"html"}).done(function(e){st("#"+m.namespace+"-help-help").html(e)})})}),g.state=0,m.trigger("helpBuilded",g.dialog)}).one("open",function(){var e=!1;m.one("backenddebug",function(){e=!0}).one("opendone",function(){requestAnimationFrame(function(){!e&&F&&(F=!1,u.hide(),h.hide(),f.hide())})})}),this.getstate=function(){return 0},this.exec=function(e,t){var n=t?t.tab:void 0;return F&&(h.tabs(),f.find("a:first").trigger("click"),u.show(),c=!0),this.dialog.trigger("initContents").elfinderdialog("open").find((n?".elfinder-help-tab-"+n:".ui-tabs-nav li")+" a:first").trigger("click"),st.Deferred().resolve()}}).prototype={forceLoad:!0},Me.prototype.commands.hidden=function(){this.hidden=!0,this.updateOnSelect=!1,this.getstate=function(){return-1}},Me.prototype.commands.hide=function(){var c,d,i,p,u=this,h={};this.syncTitleOnChange=!0,this.shortcuts=[{pattern:"ctrl+shift+dot",description:this.fm.i18n("toggleHidden")}],this.init=function(){var e=this.fm;c=e.storage("hide")||{items:{}},d=Object.keys(c.items).length,this.title=e.i18n(c.show?"hideHidden":"showHidden"),u.update(void 0,u.title)},this.fm.bind("select contextmenucreate closecontextmenu",function(e,t){var n=(e.data?e.data.selected||e.data.targets:null)||t.selected();"select"===e.type&&e.data?p=e.data.origin:"contextmenucreate"===e.type&&(i=e.data.type),!n.length||("contextmenucreate"!==e.type&&"navbar"!==p||"cwd"===i)&&n[0]===t.cwd().hash?u.title=t.i18n(c.show?"hideHidden":"showHidden"):u.title=t.i18n("cmdhide"),"closecontextmenu"!==e.type?u.update("cwd"===i?d?0:-1:void 0,u.title):(i="",requestAnimationFrame(function(){u.update(void 0,u.title)}))}),this.getstate=function(e){return this.fm.cookieEnabled&&"cwd"!==i&&(e||this.fm.selected()).length||d?0:-1},this.exec=function(e,t){var i,n,a=this.fm,o=st.Deferred().done(function(){a.trigger("hide",{items:s,opts:t})}).fail(function(e){a.error(e)}),r=t||{},s=r.targets?r.targets:e||a.selected(),l=[];if(c=a.storage("hide")||{},st.isPlainObject(c)||(c={}),st.isPlainObject(c.items)||(c.items={}),"shortcut"!==t._currentType&&s.length&&("navbar"===t._currentType||"navbar"===p||s[0]!==a.cwd().hash)||(c.show?r.hide=!0:Object.keys(c.items).length&&(r.show=!0)),r.reset&&(r.show=!0,d=0),r.show||r.hide){if(r.show?c.show=!0:delete c.show,r.show)return a.storage("hide",r.reset?null:c),u.title=a.i18n("hideHidden"),u.update(r.reset?-1:void 0,u.title),st.each(c.items,function(e){var t=a.file(e,!0);t&&(a.searchStatus.state||!t.phash||a.file(t.phash))&&l.push(t)}),l.length&&(a.updateCache({added:l}),a.add({added:l})),r.reset&&(c={items:{}}),o.resolve();s=Object.keys(c.items)}return s.length&&(st.each(s,function(e,t){var n;c.items[t]||((n=a.file(t))&&(h[t]=n.i18||n.name),c.items[t]=h[t]?h[t]:t)}),d=Object.keys(c.items).length,i=this.files(s),a.storage("hide",c),a.remove({removed:s}),c.show&&this.exec(void 0,{hide:!0}),r.hide||((n={}).undo={cmd:"hide",callback:function(){var n=a.storage("hide");n&&(st.each(s,function(e,t){delete n.items[t]}),d=Object.keys(n.items).length,a.storage("hide",n),a.trigger("hide",{items:s,opts:{}}),u.update(d?0:-1)),a.updateCache({added:i}),a.add({added:i})}},n.redo={cmd:"hide",callback:function(){return a.exec("hide",void 0,{targets:s})}})),"rejected"==o.state()?o:o.resolve(n)}},(Me.prototype.commands.home=function(){this.title="Home",this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+home ctrl+shift+up",description:"Home"}],this.getstate=function(){var e=this.fm.root(),t=this.fm.cwd().hash;return e&&t&&e!=t?0:-1},this.exec=function(){return this.fm.exec("open",this.fm.root())}}).prototype={forceLoad:!0},(Me.prototype.commands.info=function(){function U(e,t){return t?e.replace(/\u200B/g,""):e.replace(/(\/|\\)/g,"$1")}var n=this.fm,P="elfinder-spinner",q={calc:n.i18n("calc"),size:n.i18n("size"),unknown:n.i18n("unknown"),path:n.i18n("path"),aliasfor:n.i18n("aliasfor"),modify:n.i18n("modify"),perms:n.i18n("perms"),locked:n.i18n("locked"),dim:n.i18n("dim"),kind:n.i18n("kind"),files:n.i18n("files"),folders:n.i18n("folders"),roots:n.i18n("volumeRoots"),items:n.i18n("items"),yes:n.i18n("yes"),no:n.i18n("no"),link:n.i18n("link"),owner:n.i18n("owner"),group:n.i18n("group"),perm:n.i18n("perm"),getlink:n.i18n("getLink")};this.items=["size","aliasfor","path","link","dim","modify","perms","locked","owner","group","perm"],this.options.custom&&Object.keys(this.options.custom).length&&st.each(this.options.custom,function(e,t){t.label&&this.items.push(t.label)}),this.tpl={main:'<div class="ui-helper-clearfix elfinder-info-title {dirclass}"><span class="elfinder-cwd-icon {class} ui-corner-all"{style}></span>{title}</div><table class="elfinder-info-tb">{content}</table>',itemTitle:'<strong>{name}</strong><span class="elfinder-info-kind">{kind}</span>',groupTitle:"<strong>{items}: {num}</strong>",row:'<tr><td class="elfinder-info-label">{label} : </td><td class="{class}">{value}</td></tr>',spinner:'<span>{text}</span> <span class="'+P+" "+P+'-{name}"></span>'},this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+i"}],this.init=function(){st.each(q,function(e,t){q[e]=n.i18n(t)})},this.getstate=function(){return 0},this.exec=function(e){var t=this.files(e);t.length||(t=this.files([this.fm.cwd().hash]));function i(e,t,n){S.find("."+P+"-"+t).parent().html(e).addClass(n||"")}var a,n,o,r,s,l,c,d,p,u,h,f,m=this.fm,g=this.options,v=this.tpl,b=v.row,y=t.length,w=[],x=v.main,k="{label}",C="{value}",z=[],T=null,A={title:m.i18n("selectionInfo"),width:"auto",close:function(){st(this).elfinderdialog("destroy"),T&&"pending"===T.state()&&T.reject(),st.grep(z,function(e){e&&"pending"===e.state()&&e.reject()})}},j=[],O=m.namespace+"-info-"+st.map(t,function(e){return e.hash}).join("-"),S=m.getUI().find("#"+O),I=[],M="",E="elfinder-font-mono elfinder-info-hash",F=[],D=m.ui.notify;return D.is(":hidden")&&D.children(".elfinder-notify").length&&D.elfinderdialog("open").height("auto"),y?(S.length?S.elfinderdialog("toTop"):(c=m.storage("infohides")||m.arrayFlip(g.hideItems,!0),1===y?((f=t[0]).icon&&(M=" "+m.getIconStyle(f)),x=x.replace("{dirclass}",f.csscls?m.escape(f.csscls):"").replace("{class}",m.mime2class(f.mime)).replace("{style}",M),o=v.itemTitle.replace("{name}",m.escape(f.i18||f.name)).replace("{kind}",'<span title="'+m.escape(f.mime)+'">'+m.mime2kind(f)+"</span>"),n=m.tmb(f),f.read?"directory"!=f.mime||f.alias?a=m.formatSize(f.size):(a=v.spinner.replace("{text}",q.calc).replace("{name}","size"),j.push(f.hash)):a=q.unknown,c.size||w.push(b.replace(k,q.size).replace(C,a)),!c.aleasfor&&f.alias&&w.push(b.replace(k,q.aliasfor).replace(C,f.alias)),c.path||((l=m.path(f.hash,!0))?w.push(b.replace(k,q.path).replace(C,U(m.escape(l))).replace("{class}","elfinder-info-path")):(w.push(b.replace(k,q.path).replace(C,v.spinner.replace("{text}",q.calc).replace("{name}","path")).replace("{class}","elfinder-info-path")),z.push(m.path(f.hash,!0,{notify:null}).fail(function(){i(q.unknown,"path")}).done(function(e){i(U(e),"path")})))),!c.link&&f.read&&(p=m.escape(f.name),"1"==f.url?w.push(b.replace(k,q.link).replace(C,'<button class="elfinder-info-button '+P+'-url">'+q.getlink+"</button>")):(f.url?h=f.url:"directory"===f.mime?g.nullUrlDirLinkSelf&&null===f.url?h=(u=window.location).pathname+u.search+"#elf_"+f.hash:""!==f.url&&m.option("url",!m.isRoot(f)&&f.phash||f.hash)&&(h=m.url(f.hash)):h=m.url(f.hash),h&&w.push(b.replace(k,q.link).replace(C,'<a href="'+h+'" target="_blank">'+p+"</a>")))),c.dim||(f.dim?w.push(b.replace(k,q.dim).replace(C,f.dim)):-1!==f.mime.indexOf("image")&&(f.width&&f.height?w.push(b.replace(k,q.dim).replace(C,f.width+"x"+f.height)):f.size&&"0"!==f.size&&(w.push(b.replace(k,q.dim).replace(C,v.spinner.replace("{text}",q.calc).replace("{name}","dim"))),z.push(m.request({data:{cmd:"dim",target:f.hash},preventDefault:!0}).fail(function(){i(q.unknown,"dim")}).done(function(e){var t,n;i(e.dim||q.unknown,"dim"),e.dim&&(t=e.dim.split("x"),(n=m.file(f.hash)).width=t[0],n.height=t[1])}))))),c.modify||w.push(b.replace(k,q.modify).replace(C,m.formatDate(f))),c.perms||w.push(b.replace(k,q.perms).replace(C,m.formatPermissions(f))),c.locked||w.push(b.replace(k,q.locked).replace(C,f.locked?q.yes:q.no)),!c.owner&&f.owner&&w.push(b.replace(k,q.owner).replace(C,f.owner)),!c.group&&f.group&&w.push(b.replace(k,q.group).replace(C,f.group)),!c.perm&&f.perm&&w.push(b.replace(k,q.perm).replace(C,m.formatFileMode(f.perm))),window.ArrayBuffer&&(m.options.cdns.sparkmd5||m.options.cdns.jssha)&&"directory"!==f.mime&&0<f.size&&(!g.showHashMaxsize||f.size<=g.showHashMaxsize)&&(F=[],st.each(m.storage("hashchekcer")||g.showHashAlgorisms,function(e,t){f[t]?w.push(b.replace(k,m.i18n(t)).replace(C,f[t]).replace("{class}",E)):(w.push(b.replace(k,m.i18n(t)).replace(C,v.spinner.replace("{text}",q.calc).replace("{name}",t))),F.push(t))}),F.length&&(d=st('<div class="elfinder-quicklook-info-progress"></div>'),z.push(m.getContentsHashes(f.hash,F,g.showHashOpts,{progressBar:d}).progress(function(n){st.each(F,function(e,t){n[t]&&i(n[t],t,E)})}).always(function(){st.each(F,function(e,t){i(q.unknown,t)})})))),g.custom&&st.each(g.custom,function(e,t){c[t.label]||t.mimes&&!st.grep(t.mimes,function(e){return f.mime===e||0===f.mime.indexOf(e+"/")}).length||t.hashRegex&&!f.hash.match(t.hashRegex)||(w.push(b.replace(k,m.i18n(t.label)).replace(C,t.tpl.replace("{id}",O))),t.action&&"function"==typeof t.action&&I.push(t.action))})):(x=x.replace("{class}","elfinder-cwd-icon-group"),o=v.groupTitle.replace("{items}",q.items).replace("{num}",y),(r=st.grep(t,function(e){return"directory"==e.mime}).length)?(r-=s=st.grep(t,function(e){return!("directory"!==e.mime||e.phash&&!e.isroot)}).length,w.push(b.replace(k,q.kind).replace(C,s===y||r===y?q[s?"roots":"folders"]:st.map({roots:s,folders:r,files:y-s-r},function(e,t){return e?q[t]+" "+e:null}).join(", "))),c.size||w.push(b.replace(k,q.size).replace(C,v.spinner.replace("{text}",q.calc).replace("{name}","size"))),j=st.map(t,function(e){return e.hash})):(a=0,st.each(t,function(e,t){var n=parseInt(t.size);0<=n&&0<=a?a+=n:a="unknown"}),w.push(b.replace(k,q.kind).replace(C,q.files)),c.size||w.push(b.replace(k,q.size).replace(C,m.formatSize(a))))),x=x.replace("{title}",o).replace("{content}",w.join("").replace(/{class}/g,"")),(S=this.fmDialog(x,A)).attr("id",O).one("mousedown",".elfinder-info-path",function(){st(this).html(U(st(this).html(),!0))}),F.length&&d.appendTo(S.find("."+P+"-"+F[0]).parent()),m.UA.Mobile&&st.fn.tooltip&&S.children(".ui-dialog-content .elfinder-info-title").tooltip({classes:{"ui-tooltip":"elfinder-ui-tooltip ui-widget-shadow"},tooltipClass:"elfinder-ui-tooltip ui-widget-shadow",track:!0}),f&&"1"==f.url&&S.on("click","."+P+"-url",function(){st(this).parent().html(v.spinner.replace("{text}",m.i18n("ntfurl")).replace("{name}","url")),m.request({data:{cmd:"url",target:f.hash},preventDefault:!0}).fail(function(){i(p,"url")}).done(function(e){e.url?(i('<a href="'+e.url+'" target="_blank">'+p+"</a>"||p,"url"),m.file(f.hash).url=e.url):i(p,"url")})}),n&&st("<img/>").on("load",function(){S.find(".elfinder-cwd-icon").addClass(n.className).css("background-image","url('"+n.url+"')")}).attr("src",n.url),j.length&&(T=m.getSize(j).done(function(e){i(e.formated,"size")}).fail(function(){i(q.unknown,"size")})),I.length&&st.each(I,function(e,t){try{t(f,m,S)}catch(e){m.debug("error",e)}})),st.Deferred().resolve()):st.Deferred().reject()}}).prototype={forceLoad:!0},Me.prototype.commands.mkdir=function(){var a,o=this.fm,i=this;this.value="",this.disableOnSearch=!0,this.updateOnSelect=!1,this.syncTitleOnChange=!0,this.mime="directory",this.prefix="untitled folder",this.exec=function(e,t){var n;return e&&e.length&&t&&t._currentType&&"navbar"===t._currentType?(this.origin=t._currentType,this.data={target:e[0]}):(n=o.cwd().hash===e[0],this.origin=a&&!n?a:"cwd",delete this.data),e||this.options.intoNewFolderToolbtn||o.getUI("cwd").trigger("unselectall"),this.move=this.value===o.i18n("cmdmkdirin"),st.proxy(o.res("mixin","make"),i)()},this.shortcuts=[{pattern:"ctrl+shift+n"}],this.init=function(){this.options.intoNewFolderToolbtn&&(this.syncTitleOnChange=!0)},o.bind("select contextmenucreate closecontextmenu",function(e){var t=(e.data?e.data.selected||e.data.targets:null)||o.selected();i.className="mkdir",a=e.data&&t.length&&(e.data.origin||e.data.type)||"",i.options.intoNewFolderToolbtn||""!==a||(a="cwd"),t.length&&"navbar"!==a&&"cwd"!==a&&o.cwd().hash!==t[0]?(i.title=o.i18n("cmdmkdirin"),i.className+=" elfinder-button-icon-mkdirin"):i.title=o.i18n("cmdmkdir"),"closecontextmenu"!==e.type?i.update(void 0,i.title):requestAnimationFrame(function(){i.update(void 0,i.title)})}),this.getstate=function(e){var t=o.cwd(),n="navbar"===a||e&&e[0]!==t.hash?this.files(e||o.selected()):[],i=n.length;return"navbar"===a?i&&n[0].write&&n[0].read?0:-1:!t.write||i&&st.grep(n,function(e){return!(!e.read||e.locked)}).length!=i?-1:0}},Me.prototype.commands.mkfile=function(){var o=this;this.disableOnSearch=!0,this.updateOnSelect=!1,this.mime="text/plain",this.prefix="untitled file.txt",this.variants=[],this.getTypeName=function(e,t){var n=o.fm,i=(i=n.messages["kind"+n.kinds[e]])?n.i18n(["extentiontype",t.toUpperCase(),i]):n.i18n(["extentionfile",t.toUpperCase()]);return i},this.fm.bind("open reload canMakeEmptyFile",function(){var n=o.fm,i=n.getCommand("edit").getMkfileHides();o.variants=[],n.mimesCanMakeEmpty&&st.each(n.mimesCanMakeEmpty,function(e,t){t&&!i[e]&&n.uploadMimeCheck(e)&&o.variants.push([e,o.getTypeName(e,t)])}),o.change()}),this.getstate=function(){return this.fm.cwd().write?0:-1},this.exec=function(e,t){var n,i,a=o.fm;if(n=a.mimesCanMakeEmpty[t]){if(a.uploadMimeCheck(t))return this.mime=t,this.prefix=a.i18n(["untitled file",n]),st.proxy(a.res("mixin","make"),o)();i=["errMkfile",o.getTypeName(t,n)]}return st.Deferred().reject(i)}},Me.prototype.commands.netmount=function(){var p,u=this,n=!1;this.alwaysEnabled=!0,this.updateOnSelect=!1,this.drivers=[],this.handlers={load:function(){var t=u.fm;t.cookieEnabled&&t.one("open",function(){u.drivers=t.netDrivers,u.drivers.length&&st.each(u.drivers,function(){var e=u.options[this];e&&(n=!0,e.integrateInfo&&t.trigger("helpIntegration",Object.assign({cmd:"netmount"},e.integrateInfo)))})})}},this.getstate=function(){return n?0:-1},this.exec=function(){var i,e,o,t,a,r,s=u.fm,l=st.Deferred(),c=u.options;function n(){o.protocol.trigger("change","winfocus")}function d(){var n,e=o.protocol.val(),a={cmd:"netmount",protocol:e},t=c[e];if(st.each(p.find("input.elfinder-netmount-inputs-"+e),function(e,t){var n,i=st(t);i.is(":radio,:checkbox")&&!i.is(":checked")||(n=st.trim(i.val())),n&&(a[t.name]=n)}),!a.host)return s.trigger("error",{error:"errNetMountHostReq",opts:{modal:!0}});a.mnt2res&&(n=!0),s.request({data:a,notify:{type:"netmount",cnt:1,hideCnt:!0}}).done(function(e){var t;e.added&&e.added.length&&(n&&o.protocol.trigger("change","reset"),e.added[0].phash&&(t=s.file(e.added[0].phash))&&(t.dirs||(t.dirs=1,s.change({changed:[t]}))),s.one("netmountdone",function(){s.exec("open",e.added[0].hash)})),l.resolve()}).fail(function(e){t.fail&&"function"==typeof t.fail&&t.fail(s,s.parseError(e)),l.reject(e)}),u.dialog.elfinderdialog("close")}return u.dialog?u.dialog.elfinderdialog("open"):u.dialog=(o={protocol:st("<select></select>").on("change",function(e,t){var n=this.value;p.find(".elfinder-netmount-tr").hide(),p.find(".elfinder-netmount-tr-"+n).show(),i&&i.children(".ui-dialog-buttonpane:first").find("button").show(),"function"==typeof c[n].select&&c[n].select(s,e,t)}).addClass("ui-corner-all")},t={title:s.i18n("netMountDialogTitle"),resizable:!0,modal:!0,destroyOnClose:!1,open:function(){st(window).on("focus."+s.namespace,n),o.protocol.trigger("change")},close:function(){"pending"==l.state()&&l.reject(),st(window).off("focus."+s.namespace,n)},buttons:{}},a=st('<form autocomplete="off"></form>').on("keydown","input",function(e){var t,n=!0;e.keyCode===st.ui.keyCode.ENTER&&(st.each(a.find("input:visible:not(.elfinder-input-optional)"),function(){if(""===st(this).val())return n=!1,t=st(this),!1}),n?d():t.trigger("focus"))}),r=st("<div></div>"),p=st('<table class="elfinder-info-tb elfinder-netmount-tb"></table>').append(st("<tr></tr>").append(st("<td>"+s.i18n("protocol")+"</td>")).append(st("<td></td>").append(o.protocol))),st.each(u.drivers,function(e,n){c[n]&&(o.protocol.append('<option value="'+n+'">'+s.i18n(c[n].name||n)+"</option>"),st.each(c[n].inputs,function(e,t){t.attr("name",e),"hidden"!=t.attr("type")?(t.addClass("ui-corner-all elfinder-netmount-inputs-"+n),p.append(st("<tr></tr>").addClass("elfinder-netmount-tr elfinder-netmount-tr-"+n).append(st("<td>"+s.i18n(e)+"</td>")).append(st("<td></td>").append(t)))):(t.addClass("elfinder-netmount-inputs-"+n),r.append(t))}),c[n].protocol=o.protocol)}),p.append(r),p.find(".elfinder-netmount-tr").hide(),p.find(".elfinder-netmount-tr-"+u.drivers[0]).show(),t.buttons[s.i18n("btnMount")]=d,t.buttons[s.i18n("btnCancel")]=function(){u.dialog.elfinderdialog("close")},p.find("select,input").addClass("elfinder-tabstop"),e=u.fmDialog(a.append(p),t).ready(function(){o.protocol.trigger("change"),e.elfinderdialog("posInit")}),i=e.closest(".ui-dialog"),e),l.promise()},u.fm.bind("netmount",function(e){function t(){i[n.protocol]&&"function"==typeof i[n.protocol].done&&(i[n.protocol].done(u.fm,n),p.find("select,input").addClass("elfinder-tabstop"),u.dialog.elfinderdialog("tabstopsInit"))}var n=e.data||null,i=u.options;n&&n.protocol&&(n.mode&&"redirect"===n.mode?u.fm.request({data:{cmd:"netmount",protocol:n.protocol,host:n.host,user:"init",pass:"return",options:n.options},preventDefault:!0}).done(function(e){n=JSON.parse(e.body),t()}):t())})},Me.prototype.commands.netunmount=function(){this.alwaysEnabled=!0,this.updateOnSelect=!1,this.drivers=[],this.handlers={load:function(){this.drivers=this.fm.netDrivers}},this.getstate=function(e){var t,n=this.fm;return e&&this.drivers.length&&!this._disabled&&(t=n.file(e[0]))&&t.netkey?0:-1},this.exec=function(e){var c=this,d=this.fm,p=st.Deferred().fail(function(e){e&&d.error(e)}),u=d.file(e[0]);return this._disabled?p.reject():("pending"==p.state()&&d.confirm({title:c.title,text:d.i18n("confirmUnmount",u.name),accept:{label:"btnUnmount",callback:function(){function e(){st.when(s).done(function(){d.request({data:{cmd:"netmount",protocol:"netunmount",host:u.netkey,user:t,pass:"dum"},notify:{type:"netunmount",cnt:1,hideCnt:!0},preventFail:!0}).fail(function(e){p.reject(e)}).done(function(e){u.volumeid&&delete d.volumeExpires[u.volumeid],p.resolve()})}).fail(function(e){l.length&&d.remove({removed:l}),p.reject(e)})}var a,o,n,i,t=u.hash,r=(a=t,n=[],d.leafRoots&&(o=[],st.each(d.leafRoots,function(e,t){var n,i=d.parents(e);-1!==(n=st.inArray(a,i))&&(n=i.length-n,st.each(t,function(e,t){o.push({i:n,hash:t})}))}),o.length&&(o.sort(function(e,t){return e.i<t.i}),st.each(o,function(e,t){n.push(t.hash)}))),n),s=[],l=[];r.length?d.confirm({title:c.title,text:(i=["unmountChildren"],st.each(r,function(e,t){i.push([d.file(t).name])}),i),accept:{label:"btnUnmount",callback:function(){st.each(r,function(e,t){var n=d.file(t);n.netkey&&s.push(d.request({data:{cmd:"netmount",protocol:"netunmount",host:n.netkey,user:n.hash,pass:"dum"},notify:{type:"netunmount",cnt:1,hideCnt:!0},preventDefault:!0}).done(function(e){e.removed&&(n.volumeid&&delete d.volumeExpires[n.volumeid],l=l.concat(e.removed))}))}),e()}},cancel:{label:"btnCancel",callback:function(){p.reject()}}}):(s=null,e())}},cancel:{label:"btnCancel",callback:function(){p.reject()}}}),p)}},(Me.prototype.commands.open=function(){var x=this.fm,n=this;this.alwaysEnabled=!0,this.noChangeDirOnRemovedCwd=!0,this._handlers={dblclick:function(e){var t=e.data&&e.data.file?[e.data.file]:void 0;0===n.getstate(t)&&(e.preventDefault(),x.exec("open",t))},"select enable disable reload":function(e){this.update("disable"==e.type?-1:void 0)}},this.shortcuts=[{pattern:"ctrl+down numpad_enter"+("mac"!=x.OS&&" enter")}],this.getstate=function(e){var t=this.files(e),n=t.length;return 1==n?t[0].read?0:-1:n&&!x.UA.Mobile&&st.grep(t,function(e){return!("directory"==e.mime||!e.read)}).length==n?0:-1},this.exec=function(t,e){var r,s,l,c,d,p,u,n,h,f,i,a,m=st.Deferred().fail(function(e){e&&x.error(e)}),g=this.files(t),v=g.length,o="object"==typeof e&&e.thash,b=this.options,y=b.into||"window";if(!v&&!o)return m.reject();if(o||1==v&&(r=g[0])&&"directory"==r.mime)return o||!r||r.read?x.keyState.ctrlKey&&(x.keyState.shiftKey||"function"!=typeof x.options.getFileCallback)&&x.getCommand("opennew")?x.exec("opennew",[o||r.hash]):x.request({data:{cmd:"open",target:o||r.hash},notify:{type:"open",cnt:1,hideCnt:!0},syncOnFail:!0,lazy:!1}):m.reject(["errOpen",r.name,"errPerm"]);if(g=st.grep(g,function(e){return"directory"!=e.mime}),v!=g.length)return m.reject();function w(){function e(e){var i,t,n=st("<a>").hide().appendTo(st("body"));if(x.UA.Mobile||!f){if(h)f?n.attr("target","_blank"):n.attr("download",r.name),n.attr("href",e).get(0).click();else if(!(a=window.open(e)))return m.reject("errPopup")}else{if(!("string"==typeof b.method&&"get"===b.method.toLowerCase())&&0===e.indexOf(x.options.url)&&x.customData&&Object.keys(x.customData).length&&!r.mime.match(/^(?:video|audio)/)&&(e=""),!(a="window"===y?(c=p=Math.round(2*screen.availWidth/3),d=u=Math.round(2*screen.availHeight/3),parseInt(r.width)&&parseInt(r.height)?(c=parseInt(r.width),d=parseInt(r.height)):r.dim&&(s=r.dim.split("x"),c=parseInt(s[0]),d=parseInt(s[1])),c<=p&&d<=u?(p=c,u=d):d-u<c-p?u=Math.round(d*(p/c)):p=Math.round(c*(u/d)),l="width="+p+",height="+u,window.open(e,o,l+",top=50,left=50,scrollbars=yes,resizable=yes,titlebar=no")):("tabs"===y&&(o=r.hash),window.open("about:blank",o))))return m.reject("errPopup");""===e?((i=document.createElement("form")).action=x.options.url,i.method="POST",i.target=o,i.style.display="none",t=Object.assign({},x.customData,{cmd:"file",target:r.hash,_t:r.ts||parseInt(new Date/1e3)}),st.each(t,function(e,t){var n=document.createElement("input");n.name=e,n.value=t,i.appendChild(n)}),document.body.appendChild(i),i.submit()):"window"!==y&&(a.location=e),st(a).trigger("focus")}n.remove()}var a,o;try{n=new RegExp(x.option("dispInlineRegex"),"i")}catch(e){n=!1}for(h="string"==typeof st("<a>").get(0).download,v=g.length;v--;){if(o="elf_open_window",!(r=g[v]).read)return m.reject(["errOpen",r.name,"errPerm"]);f=n&&r.mime.match(n),x.openUrl(r.hash,!f,e)}return m.resolve(t)}if(1<v)x.confirm({title:"openMulti",text:["openMultiConfirm",v+""],accept:{label:"cmdopen",callback:function(){w()}},cancel:{label:"btnCancel",callback:function(){m.reject()}},buttons:x.getCommand("zipdl")&&x.isCommandEnabled("zipdl",x.cwd().hash)?[{label:"cmddownload",callback:function(){x.exec("download",t),m.reject()}}]:[]});else{if((i=x.storage("selectAction")||b.selectAction)&&(st.each(i.split("/"),function(){var e=this.valueOf();if("open"!==e&&(a=x.getCommand(e))&&a.enabled())return!1;a=null}),a))return x.exec(a.name);w()}return m}}).prototype={forceLoad:!0},Me.prototype.commands.opendir=function(){this.alwaysEnabled=!0,this.getstate=function(){return 1===this.fm.selected().length&&this.fm.getUI("workzone").hasClass("elfinder-search-result")?0:-1},this.exec=function(e){var t,n=this.fm,i=st.Deferred(),a=this.files(e);return a.length&&a[0].phash?(t=a[0].phash,n.trigger("searchend",{noupdate:!0}),n.request({data:{cmd:"open",target:t},notify:{type:"open",cnt:1,hideCnt:!0},syncOnFail:!1}),i):i.reject()}},Me.prototype.commands.opennew=function(){var e=this.fm;this.shortcuts=[{pattern:("function"==typeof e.options.getFileCallback?"shift+":"")+"ctrl+enter"}],this.getstate=function(e){var t=this.files(e);return 1===t.length&&"directory"===t[0].mime&&t[0].read?0:-1},this.exec=function(e){var t,n,i,a,o=st.Deferred(),r=this.files(e),s=r.length,l=this.options;return 1===s&&(t=r[0])&&"directory"===t.mime?(n=window.location,i=l.url?l.url:n.pathname,l.useOriginQuery&&(i.match(/\?/)?n.search&&(i+="&"+n.search.substr(1)):i+=n.search),i+="#elf_"+t.hash,a=window.open(i,"_blank"),setTimeout(function(){a.focus()},1e3),o.resolve()):o.reject()}},Me.prototype.commands.paste=function(){this.updateOnSelect=!1,this.handlers={changeclipboard:function(){this.update()}},this.shortcuts=[{pattern:"ctrl+v shift+insert"}],this.getstate=function(e){if(this._disabled)return-1;if(e){if(Array.isArray(e)){if(1!=e.length)return-1;e=this.fm.file(e[0])}}else e=this.fm.cwd();return this.fm.clipboard().length&&"directory"==e.mime&&e.write?0:-1},this.exec=function(e,t){function n(a){function i(e,t){for(var n=[],i=e.length;i--;)-1!==st.inArray(e[i].name,t)&&n.unshift(i);return n}function t(e){var t,n={};e&&(Array.isArray(e)?e.length&&("string"==typeof e[0]?o=i(a,e):(st.each(e,function(e,t){n[t.name]=t.hash}),o=i(a,st.map(n,function(e,t){return t})),st.each(a,function(e,t){n[t.name]&&(r[n[t.name]]=t.name)}))):(t=[],o=st.map(e,function(e){return"string"==typeof e?e:(t=t.concat(e),!1)}),t.length&&(o=o.concat(t)),o=i(a,o),r=e)),o.length?s(0):c(a)}var e,l=st.Deferred(),o=[],r={},s=function(n){var e=o[n],t=a[e],i=n==o.length-1;t&&p.confirm({title:p.i18n(m+"Files"),text:["errExists",t.name,"restore"===m?"confirmRest":"confirmRepl"],all:!i,accept:{label:"btnYes",callback:function(e){i||e?c(a):s(++n)}},reject:{label:"btnNo",callback:function(e){var t;if(e)for(t=o.length;n<t--;)a[o[t]].remove=!0;else a[o[n]].remove=!0;i||e?c(a):s(++n)}},cancel:{label:"btnCancel",callback:function(){l.resolve()}},buttons:[{label:"btnBackup",callback:function(e){var t;if(e)for(t=o.length;n<t--;)a[o[t]].rename=!0;else a[o[n]].rename=!0;i||e?c(a):s(++n)}}]})},c=function(e){var t,n,i=[],a=st.grep(e,function(e){return e.rename&&i.push(e.name),!e.remove}),o=a.length;if(!o)return l.resolve();t=st.map(a,function(e){return e.hash}),n={cmd:"paste",dst:h.hash,targets:t,cut:f?1:0,renames:i,hashes:r,suffix:p.options.backupSuffix},p.api<2.1&&(n.src=a[0].phash),p.request({data:n,notify:{type:m,cnt:o},cancel:!0,navigate:{toast:u.noToast?{}:{inbuffer:{msg:p.i18n(["complete",p.i18n("cmd"+m)]),action:{cmd:"open",msg:"cmdopendir",data:[h.hash],done:"select",cwdNot:h.hash}}}}}).done(function(e){var r={},s=e.added&&e.added.length?e.added:null;f&&s&&(st.each(a,function(e,t){var n,i,a=t.phash,o=(n=t.name,st.each(s,function(e,t){if(t.name===n)return i=t.hash,!1}),i);o&&(r[a]?r[a].push(o):r[a]=[o])}),Object.keys(r).length&&(e.undo={cmd:"move",callback:function(){var n=[];return st.each(r,function(e,t){n.push(p.request({data:{cmd:"paste",dst:e,targets:t,cut:1},notify:{type:"undo",cnt:t.length}}))}),st.when.apply(null,n)}},e.redo={cmd:"move",callback:function(){return p.request({data:n,notify:{type:"redo",cnt:o}})}})),l.resolve(e)}).fail(function(e){l.reject(),0===e&&p.sync()}).always(function(){p.unlockfiles({files:a})})};return p.isCommandEnabled(d.name,h.hash)&&a.length?(!p.oldAPI&&p.option("copyOverwrite",h.hash)?(e=st.map(a,function(e){return e.name}),h.hash==p.cwd().hash?t(st.map(p.files(),function(e){return e.phash==h.hash?{hash:e.hash,name:e.name}:null})):p.request({data:{cmd:"ls",target:h.hash,intersect:e},notify:{type:"prepare",cnt:1,hideCnt:!0},preventFail:!0}).always(function(e){t(e.list)})):c(a),l):l.resolve()}var i,a,o,d=this,p=d.fm,u=t||{},h=e?this.files(e)[0]:p.cwd(),r=p.clipboard(),s=r.length,f=!!s&&r[0].cut,m=u._cmd?u._cmd:f?"move":"copy",l="err"+m.charAt(0).toUpperCase()+m.substr(1),c=[],g=[],v=st.Deferred().fail(function(e){e&&p.error(e)}).always(function(){p.unlockfiles({files:st.map(r,function(e){return e.hash})})});return s&&h&&"directory"==h.mime?h.write?(i=p.parents(h.hash),st.each(r,function(e,n){return n.read?f&&n.locked?!v.reject(["errLocked",n.name]):-1!==st.inArray(n.hash,i)?!v.reject(["errCopyInItself",n.name]):n.mime&&"directory"!==n.mime&&!p.uploadMimeCheck(n.mime,h.hash)?!v.reject([l,n.name,"errUploadMime"]):((a=p.parents(n.hash)).pop(),-1!==st.inArray(h.hash,a)&&st.grep(a,function(e){var t=p.file(e);return t.phash==h.hash&&t.name==n.name}).length?!v.reject(["errReplByChild",n.name]):void(n.phash==h.hash?g.push(n.hash):c.push({hash:n.hash,phash:n.phash,name:n.name}))):!v.reject([l,n.name,"errPerm"])}),"rejected"===v.state()||(o=st.Deferred(),f&&d.options.moveConfirm?p.confirm({title:"moveFiles",text:p.i18n("confirmMove",h.i18||h.name),accept:{label:"btnYes",callback:function(){o.resolve()}},cancel:{label:"btnCancel",callback:function(){o.reject()}}}):o.resolve(),o.done(function(){var e;st.when((e=g).length&&p._commands.duplicate?p.exec("duplicate",e):st.Deferred().resolve(),n(c)).done(function(e,t){v.resolve(t&&t.undo?t:void 0)}).fail(function(){v.reject()}).always(function(){f&&p.clipboard([])})}).fail(function(){v.reject()})),v):v.reject([l,r[0].name,"errPerm"]):v.reject()}},Me.prototype.commands.places=function(){var a=this,e=this.fm,o=null;this.getstate=function(e){var t,n=this.hashes(e),i=n.length;return o&&i&&i==(t=n,st.grep(a.files(t),function(e){return"directory"==e.mime}).length)?0:-1},this.exec=function(e){var t=this.files(e);return o.trigger("regist",[t]),st.Deferred().resolve()},e.one("load",function(){o=e.ui.places})},Me.prototype.commands.preference=function(){function q(e){st("#"+N.namespace+"-preference-tab-"+e).trigger("mouseover").trigger("click"),H=e}function n(){var e,n,t,i,a,o,r,s,l,c,d,p,u,h,f,m,g,v,b,y,w,x,k,C,z,T,A,j,O,S,I,M,E,F=_.options.categories||{language:["language"],theme:["theme"],toolbar:["toolbarPref"],workspace:["iconSize","columnPref","selectAction","makefileTypes","useStoredEditor","editorMaximized","useFullscreen","showHidden"],dialog:["autoFocusDialog"],selectionInfo:["infoItems","hashChecker"],reset:["clearBrowserData"],all:!0},D=_.options.prefs||["language","theme","toolbarPref","iconSize","columnPref","selectAction","makefileTypes","useStoredEditor","editorMaximized","useFullscreen","showHidden","infoItems","hashChecker","autoFocusDialog","clearBrowserData"];function U(){var i=[];return g=N.getCommand("edit").getMkfileHides(),st.each(N.mimesCanMakeEmpty,function(e,t){var n=N.getCommand("mkfile").getTypeName(e,t);i.push('<span class="elfinder-preference-column-item" title="'+N.escape(n)+'"><label><input type="checkbox" value="'+e+'" '+(g[e]?"":"checked")+"/>"+t+"</label></span>")}),i.join(" ")}function P(){var e,t=N.storage("hide"),n=[];t&&t.items&&st.each(t.items,function(e,t){n.push(N.escape(t))}),A.prop("disabled",!n.length)[n.length?"removeClass":"addClass"]("ui-state-disabled"),e=n.length?n.join("\n"):"",D.showHidden.attr("title",e),k&&D.showHidden.tooltip("option","content",e.replace(/\n/g,"<br>")).tooltip("close")}N.cookieEnabled||delete F.language,D=N.arrayFlip(D,!0),N.options.getFileCallback&&delete D.selectAction,N.UA.Fullscreen||delete D.useFullscreen,D.language&&(D.language=(e=st("<select></select>").on("change",function(){var e=st(this).val();N.storage("lang",e),st("#"+N.id).elfinder("reload")}),n=[],t=_.options.langs||{ar:"العربية",bg:"Български",ca:"Català",cs:"Čeština",da:"Dansk",de:"Deutsch",el:"Ελληνικά",en:"English",es:"Español",fa:"فارسی",fo:"Føroyskt",fr:"Français",fr_CA:"Français (Canada)",he:"עברית",hr:"Hrvatski",hu:"Magyar",id:"Bahasa Indonesia",it:"Italiano",ja:"日本語",ko:"한국어",nl:"Nederlands",no:"Norsk",pl:"Polski",pt_BR:"Português",ro:"Română",ru:"Pусский",si:"සිංහල",sk:"Slovenčina",sl:"Slovenščina",sr:"Srpski",sv:"Svenska",tr:"Türkçe",ug_CN:"ئۇيغۇرچە",uk:"Український",vi:"Tiếng Việt",zh_CN:"简体中文",zh_TW:"正體中文"},N.cookieEnabled?(st.each(t,function(e,t){n.push('<option value="'+e+'">'+t+"</option>")}),e.append(n.join("")).val(N.lang)):st())),D.theme&&(D.theme=function(){var e=N.options.themes?Object.keys(N.options.themes).length:0;if(0===e||1===e&&N.options.themes.default)return null;var s=st("<select></select>").on("change",function(){var e=st(this).val();N.changeTheme(e).storage("theme",e)}),l={image:'<img class="elfinder-preference-theme elfinder-preference-theme-image" src="$2" />',link:'<a href="$1" target="_blank" title="$3">$2</a>',data:'<dt>$1</dt><dd><span class="elfinder-preference-theme elfinder-preference-theme-$0">$2</span></dd>'},c=["image","description","author","email","license"],t=st('<button class="ui-button ui-corner-all ui-widget elfinder-preference-theme-default"></button>').text(N.i18n("default")).on("click",function(e){s.val("default").trigger("change")}),a=st('<div class="elfinder-reference-hide-taball"></div>').on("click","button",function(){var e=st(this).data("themeid");s.val(e).trigger("change")});return N.options.themes.default||s.append('<option value="default">'+N.i18n("default")+"</option>"),st.each(N.options.themes,function(r,e){var t,n=st('<option class="elfinder-theme-option-'+r+'" value="'+r+'">'+N.i18n(r)+"</option>"),i=st('<fieldset class="ui-widget ui-widget-content ui-corner-all elfinder-theme-list-'+r+'"><legend>'+N.i18n(r)+'</legend><div><span class="elfinder-spinner"></span></div></fieldset>');s.append(n),a.append(i),t=setTimeout(function(){i.find("span.elfinder-spinner").replaceWith(N.i18n(["errRead",r]))},1e4),N.getTheme(r).always(function(){t&&clearTimeout(t)}).done(function(a){var e=st(),o=st("<dl></dl>"),t=a.link?l.link.replace(/\$1/g,a.link).replace(/\$3/g,N.i18n("website")):"$2";a.name&&n.html(N.i18n(a.name)),i.children("legend").html(t.replace(/\$2/g,N.i18n(a.name)||r)),st.each(c,function(e,t){var n,i=l[t]||l.data;a[t]&&(n=i.replace(/\$0/g,N.escape(t)).replace(/\$1/g,N.i18n(t)).replace(/\$2/g,N.i18n(a[t])),"image"===t&&a.link&&(n=st(n).on("click",function(){s.val(r).trigger("change")}).attr("title",N.i18n("select"))),o.append(n))}),e=(e=e.add(o)).add(st('<div class="elfinder-preference-theme-btn"></div>').append(st('<button class="ui-button ui-corner-all ui-widget"></button>').data("themeid",r).html(N.i18n("select")))),i.find("span.elfinder-spinner").replaceWith(e)}).fail(function(){i.find("span.elfinder-spinner").replaceWith(N.i18n(["errRead",r]))})}),st("<div></div>").append(s.val(N.theme&&N.theme.id?N.theme.id:"default"),t,a)}()),D.toolbarPref&&(D.toolbarPref=(i=st.map(N.options.uiOptions.toolbar,function(e){return st.isArray(e)?e:null}),a=[],o=N.storage("toolbarhides")||{},st.each(i,function(){var e=N.i18n("cmd"+this);e==="cmd"+this&&(e=N.i18n(this)),a.push('<span class="elfinder-preference-toolbar-item"><label><input type="checkbox" value="'+this+'" '+(o[this]?"":"checked")+"/>"+e+"</label></span>")}),st(a.join(" ")).on("change","input",function(){var e=st(this).val(),t=st(this).is(":checked");t||o[e]?t&&o[e]&&delete o[e]:o[e]=!0,N.storage("toolbarhides",o),N.trigger("toolbarpref")}))),D.iconSize&&(D.iconSize=(r=N.options.uiOptions.cwd.iconsView.sizeMax||3,s=N.storage("iconsize")||N.options.uiOptions.cwd.iconsView.size||0,l=st('<div class="touch-punch"></div>').slider({classes:{"ui-slider-handle":"elfinder-tabstop"},value:s,max:r,slide:function(e,t){N.getUI("cwd").trigger("iconpref",{size:t.value})},change:function(e,t){N.storage("iconsize",t.value)}}),N.getUI("cwd").on("iconpref",function(e,t){l.slider("option","value",t.size)}),l)),D.columnPref&&(D.columnPref=(c=N.options.uiOptions.cwd.listView.columns,d=[],p=N.storage("columnhides")||{},st.each(c,function(){var e=N.getColumnName(this);d.push('<span class="elfinder-preference-column-item"><label><input type="checkbox" value="'+this+'" '+(p[this]?"":"checked")+"/>"+e+"</label></span>")}),st(d.join(" ")).on("change","input",function(){var e=st(this).val(),t=st(this).is(":checked");t||p[e]?t&&p[e]&&delete p[e]:p[e]=!0,N.storage("columnhides",p),N.trigger("columnpref",{repaint:!0})}))),D.selectAction&&(D.selectAction=(u=st("<select></select>").on("change",function(){var e=st(this).val();N.storage("selectAction","default"===e?null:e)}),h=[],f=_.options.selectActions,m=N.getCommand("open").options.selectAction||"open",-1===st.inArray(m,f)&&f.unshift(m),st.each(f,function(e,t){var n=st.map(t.split("/"),function(e){var t=N.i18n("cmd"+e);return t==="cmd"+e&&(t=N.i18n(e)),t});h.push('<option value="'+t+'">'+n.join("/")+"</option>")}),u.append(h.join("")).val(N.storage("selectAction")||m))),D.makefileTypes&&(D.makefileTypes=(g=N.getCommand("edit").getMkfileHides(),v=st("<div></div>").on("change","input",function(){var e=st(this).val(),t=st(this).is(":checked");t||g[e]?t&&g[e]&&delete g[e]:g[e]=!0,N.storage("mkfileHides",g),N.trigger("canMakeEmptyFile")}).append(U()),b=st("<div></div>").append(st('<input type="text" placeholder="'+N.i18n("typeOfTextfile")+'"/>').on("keydown",function(e){e.keyCode===st.ui.keyCode.ENTER&&st(this).next().trigger("click")}),st('<button class="ui-button"></button>').html(N.i18n("add")).on("click",function(){function e(){return a.appendTo(n.closest(".ui-dialog")),N.toast({msg:N.i18n("errUsupportType"),mode:"warning",onHidden:function(){1===a.children().length&&a.appendTo(N.getUI())}}),n.trigger("focus"),!1}var t,n=st(this).prev(),i=n.val(),a=N.getUI("toast");if(!i.match(/\//)){if(!(i=N.arrayFlip(N.mimeTypes)[i]))return e();n.val(i)}if(!N.mimeIsText(i)||!N.mimeTypes[i])return e();N.trigger("canMakeEmptyFile",{mimes:[i],unshift:!0}),(t={})[i]=N.mimeTypes[i],N.storage("mkfileTextMimes",Object.assign(t,N.storage("mkfileTextMimes")||{})),n.val(""),a.appendTo(n.closest(".ui-dialog")),N.toast({msg:N.i18n(["complete",i+" ("+t[i]+")"]),onHidden:function(){1===a.children().length&&a.appendTo(N.getUI())}})}),st('<button class="ui-button"></button>').html(N.i18n("reset")).on("click",function(){N.one("canMakeEmptyFile",{done:function(){v.empty().append(U())}}),N.trigger("canMakeEmptyFile",{resetTexts:!0})})),N.bind("canMakeEmptyFile",{done:function(e){e.data&&e.data.mimes&&e.data.mimes.length&&v.empty().append(U())}}),st("<div></div>").append(v,b))),D.useStoredEditor&&(D.useStoredEditor=st('<input type="checkbox"/>').prop("checked",(y=N.storage("useStoredEditor"))?0<y:N.options.commandsOptions.edit.useStoredEditor).on("change",function(e){N.storage("useStoredEditor",st(this).is(":checked")?1:-1)})),D.editorMaximized&&(D.editorMaximized=st('<input type="checkbox"/>').prop("checked",(w=N.storage("editorMaximized"))?0<w:N.options.commandsOptions.edit.editorMaximized).on("change",function(e){N.storage("editorMaximized",st(this).is(":checked")?1:-1)})),D.useFullscreen&&(D.useFullscreen=st('<input type="checkbox"/>').prop("checked",(x=N.storage("useFullscreen"))?0<x:"screen"===N.options.commandsOptions.fullscreen.mode).on("change",function(e){N.storage("useFullscreen",st(this).is(":checked")?1:-1)})),D.showHidden&&(z=st('<input type="checkbox"/>').prop("checked",(C=N.storage("hide"))&&C.show).on("change",function(e){var t={};t[st(this).is(":checked")?"show":"hide"]=!0,N.exec("hide",void 0,t)}),T=st('<button class="ui-button ui-corner-all ui-widget"></button>').append(N.i18n("reset")).on("click",function(){N.exec("hide",void 0,{reset:!0}),st(this).parent().find("input:first").prop("checked",!1),P()}),A=st().add(z).add(T),D.showHidden=st("<div></div>").append(z,T),N.bind("hide",function(e){var t=e.data;t.opts&&(t.opts.show||t.opts.hide)||P()}),N.UA.Mobile&&st.fn.tooltip&&(k=!0,D.showHidden.tooltip({classes:{"ui-tooltip":"elfinder-ui-tooltip ui-widget-shadow"},tooltipClass:"elfinder-ui-tooltip ui-widget-shadow",track:!0}).css("user-select","none"),T.css("user-select","none")),P()),D.infoItems&&(D.infoItems=(j=N.getCommand("info").items,O=[],S=N.storage("infohides")||N.arrayFlip(N.options.commandsOptions.info.hideItems,!0),st.each(j,function(){var e=N.i18n(this);O.push('<span class="elfinder-preference-info-item"><label><input type="checkbox" value="'+this+'" '+(S[this]?"":"checked")+"/>"+e+"</label></span>")}),st(O.join(" ")).on("change","input",function(){var e=st(this).val(),t=st(this).is(":checked");t||S[e]?t&&S[e]&&delete S[e]:S[e]=!0,N.storage("infohides",S),N.trigger("infopref",{repaint:!0})}))),D.hashChecker&&N.hashCheckers.length&&(D.hashChecker=(I=[],M=N.arrayFlip(N.storage("hashchekcer")||N.options.commandsOptions.info.showHashAlgorisms,!0),st.each(N.hashCheckers,function(){var e=N.i18n(this);I.push('<span class="elfinder-preference-hashchecker-item"><label><input type="checkbox" value="'+this+'" '+(M[this]?"checked":"")+"/>"+e+"</label></span>")}),st(I.join(" ")).on("change","input",function(){var e=st(this).val();st(this).is(":checked")?M[e]=!0:M[e]&&delete M[e],N.storage("hashchekcer",st.grep(N.hashCheckers,function(e){return M[e]}))}))),D.autoFocusDialog&&(D.autoFocusDialog=st('<input type="checkbox"/>').prop("checked",(E=N.storage("autoFocusDialog"))?0<E:N.options.uiOptions.dialog.focusOnMouseOver).on("change",function(e){N.storage("autoFocusDialog",st(this).is(":checked")?1:-1)})),D.clearBrowserData&&(D.clearBrowserData=st("<button></button>").text(N.i18n("reset")).button().on("click",function(e){e.preventDefault(),N.storage(),st("#"+N.id).elfinder("reload")})),st.each(F,function(e,t){var r,s;!0===t?s=1:t&&(r=st(),st.each(t,function(e,t){var n,i,a,o="";(n=D[t])&&(s=2,i=N.i18n(t),(a=st(n).filter('input[type="checkbox"]')).length||(a=st(n).find('input[type="checkbox"]')),1===a.length?(a.attr("id")||a.attr("id","elfinder-preference-"+t+"-checkbox"),i='<label for="'+a.attr("id")+'">'+i+"</label>"):1<a.length&&(o=" elfinder-preference-checkboxes"),r=r.add(st('<dt class="elfinder-preference-'+t+o+'">'+i+"</dt>")).add(st('<dd class="elfinder-preference-'+t+o+'"></dd>').append(n)))})),s&&($.append(W[L](/\{id\}/g,e)[L](/\{title\}/,N.i18n(e))[L](/\{class\}/,H===e?"elfinder-focus":"")),2===s&&V.append(st('<div id="'+N.namespace+"-preference-"+e+'" class="elfinder-preference-content"></div>').hide().append(st("<dl></dl>").append(r))))}),$.on("click","a",function(e){var t=st(e.target),n=t.attr("href");e.preventDefault(),e.stopPropagation(),$.children().removeClass(K),t.removeClass("ui-state-hover").parent().addClass(K),n.match(/all$/)?V.addClass("elfinder-preference-taball").children().show():(V.removeClass("elfinder-preference-taball").children().hide(),st(n).show())}).on("focus blur","a",function(e){st(this).parent().toggleClass("ui-state-focus","focusin"===e.type)}).on("mouseenter mouseleave","li",function(e){st(this).toggleClass("ui-state-hover","mouseenter"===e.type)}),V.find("a,input,select,button").addClass("elfinder-tabstop"),B.append($,V),(R=_.fmDialog(B,{title:_.title,width:_.options.width||600,height:_.options.height||400,maxWidth:"window",maxHeight:"window",autoOpen:!1,destroyOnClose:!1,allowMinimize:!1,open:function(){H&&q(H),H=null},resize:function(){V.height(R.height()-$.outerHeight(!0)-(V.outerHeight(!0)-V.height())-5)}}).on("click",function(e){e.stopPropagation()}).css({overflow:"hidden"})).closest(".ui-dialog").css({overflow:"hidden"}).addClass("elfinder-bg-translucent"),H="all"}var R,H,_=this,N=this.fm,L="replace",W='<li class="'+N.res("class","tabstab")+' elfinder-preference-tab-{id}"><a href="#'+N.namespace+'-preference-{id}" id="'+N.namespace+'-preference-tab-{id}" class="ui-tabs-anchor {class}">{title}</a></li>',B=st('<div class="ui-tabs ui-widget ui-widget-content ui-corner-all elfinder-preference">'),$=st('<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-top">'),V=st('<div class="elfinder-preference-tabs ui-tabs-panel ui-widget-content ui-corner-bottom"></div>'),K=(st("base").length&&document.location.href.replace(/#.*$/,""),N.res("class","tabsactive"));this.shortcuts=[{pattern:"ctrl+comma",description:this.title}],this.alwaysEnabled=!0,this.getstate=function(){return 0},this.exec=function(e,t){return R||n(),t&&(t.tab?q(t.tab):"cwd"===t._currentType&&q("workspace")),R.elfinderdialog("open"),st.Deferred().resolve()}},(Me.prototype.commands.quicklook=function(){function t(e){st(document).trigger(st.Event("keydown",{keyCode:e,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1}))}function p(e){var t,n=v.getUI().offset(),i=(t=e.find(".elfinder-cwd-file-wrapper")).length?t:e,a=i.offset()||{top:0,left:0};return{opacity:0,width:i.width(),height:i.height()-30,top:a.top-n.top,left:a.left-n.left}}function e(e,t){var n=t||e.substr(0,e.indexOf("/")),i=o[n]?o[n]:o[n]=document.createElement(n),a=!1;try{a=i.canPlayType&&i.canPlayType(e)}catch(e){}return!(!a||""===a||"no"==a)}function n(){g.update(void 0,function(){var i,e=g.fm,t=e.selectedFiles(),n=t.length;g.docked();return n||(n=1,t=[e.cwd()]),1===n?t[0]:(i=0,st.each(t,function(e,t){var n=parseInt(t.ts);0<=i?i<n&&(i=n):i="unknown"}),{hash:t[0].hash+"/"+ +new Date,name:e.i18n("items")+": "+n,mime:"group",size:L,ts:i,files:st.map(t,function(e){return e.hash}),getSize:!0})}())}var u,h,r,s,l,f,c,d,m,i,g=this,v=g.fm,b=0,y=Element.update?"quicklookupdate":"update",w="elfinder-quicklook-navbar-icon",x="elfinder-quicklook-fullscreen",k="elfinder-quicklook-info-wrapper",o={},a=-1!=window.navigator.platform.indexOf("Win"),C=!1,z=!1,T=!1,A=null,j=st.ui.keyCode.LEFT,O=st.ui.keyCode.RIGHT,S="mousemove touchstart "+("onwheel"in document?"wheel":"onmousewheel"in document?"mousewheel":"DOMMouseScroll"),I=st('<span class="elfinder-dialog-title elfinder-quicklook-title"></span>'),M=st("<div></div>"),E=st('<div class="elfinder-quicklook-info"></div>'),F=st('<div class="ui-front elfinder-quicklook-cover"></div>'),D=st('<div class="'+w+" "+w+'-fullscreen"></div>').on("click touchstart",function(e){var t,n,i,a,o;T||(n=(t=g.window).hasClass(x),i=st(window),a=function(){g.preview.trigger("changesize")},e.stopPropagation(),e.preventDefault(),n?(W="",U(),t.toggleClass(x).css(t.data("position")),i.trigger(g.resize).off(g.resize,a),H.off("mouseenter mouseleave"),F.off(S)):(t.toggleClass(x).data("position",{left:t.css("left"),top:t.css("top"),width:t.width(),height:t.height(),display:"block"}).removeAttr("style"),st(window).on(g.resize,a).trigger(g.resize),F.on(S,function(e){z||("mousemove"!==e.type&&"touchstart"!==e.type||(U(),A=setTimeout(function(){(v.UA.Mobile||H.parent().find(".elfinder-quicklook-navbar:hover").length<1)&&H.fadeOut("slow",function(){F.show()})},3e3)),F.is(":visible")&&(P(),F.data("tm",setTimeout(function(){F.show()},3e3))))}).show().trigger("mousemove"),H.on("mouseenter mouseleave",function(e){z||("mouseenter"===e.type?U():F.trigger("mousemove"))})),v.zIndex&&t.css("z-index",v.zIndex+1),v.UA.Mobile?H.attr("style",W):H.attr("style",W).draggable(n?"destroy":{start:function(){T=z=!0,F.show(),U()},stop:function(){z=!1,W=g.navbar.attr("style"),requestAnimationFrame(function(){T=!1})}}),st(this).toggleClass(w+"-fullscreen-off"),o=t,s.is(".ui-resizable")&&(o=o.add(s)),o.resizable(n?"enable":"disable").removeClass("ui-state-disabled"),t.trigger("viewchange"))}),U=function(){g.window.hasClass(x)&&(A&&clearTimeout(A),A=null,H.stop(!0,!0).css("display","block"),P())},P=function(){F.data("tm")&&clearTimeout(F.data("tm")),F.removeData("tm"),F.hide()},q=st('<div class="'+w+" "+w+'-prev"></div>').on("click touchstart",function(e){return T||t(j),!1}),R=st('<div class="'+w+" "+w+'-next"></div>').on("click touchstart",function(e){return T||t(O),!1}),H=st('<div class="elfinder-quicklook-navbar"></div>').append(q).append(D).append(R).append('<div class="elfinder-quicklook-navbar-separator"></div>').append(st('<div class="'+w+" "+w+'-close"></div>').on("click touchstart",function(e){return T||g.window.trigger("close"),!1})),_=st('<span class="ui-front ui-icon elfinder-icon-close ui-icon-closethick"></span>').on("mousedown",function(e){e.stopPropagation(),g.window.trigger("close")}),N=st('<span class="ui-front ui-icon elfinder-icon-minimize ui-icon-minusthick"></span>').on("mousedown",function(e){e.stopPropagation(),g.docked()?g.window.trigger("navdockout"):g.window.trigger("navdockin")}),L='<span class="elfinder-spinner-text">'+v.i18n("calc")+'</span><span class="elfinder-spinner"></span>',W="",B=!0;this.flags={},this.cover=F,this.evUpdate=y,(this.navbar=H)._show=U,this.resize="resize."+v.namespace,this.info=st("<div></div>").addClass(k).append(M).append(E),this.autoPlay=function(){return!!g.opened()&&!!g.options[g.docked()?"dockAutoplay":"autoplay"]},this.preview=st('<div class="elfinder-quicklook-preview ui-helper-clearfix"></div>').on("change",function(){U(),H.attr("style",W),g.docked()&&H.hide(),g.preview.attr("style","").removeClass("elfinder-overflow-auto"),g.info.attr("style","").hide(),g.cover.removeClass("elfinder-quicklook-coverbg"),M.removeAttr("class").attr("style",""),E.html("")}).on(y,function(e){g.preview;var t,n,i,a=e.file,o='<div class="elfinder-quicklook-info-data">{value}</div>',r=[];a&&!Object.keys(a).length&&(a=v.cwd()),a&&d&&"pending"===d.state()&&d._hash!==a.hash&&d.reject(),a&&(e.forceUpdate||g.window.data("hash")!==a.hash)?(i=g.window.css("overflow","hidden"),n=v.escape(a.i18||a.name),a.read||e.stopImmediatePropagation(),g.window.data("hash",a.hash),g.preview.off("changesize").trigger("change").children().remove(),I.html(n),q.css("visibility",""),R.css("visibility",""),a.hash===v.cwdId2Hash(l.find("[id]:not(.elfinder-cwd-parent):first").attr("id"))&&q.css("visibility","hidden"),a.hash===v.cwdId2Hash(l.find("[id]:last").attr("id"))&&R.css("visibility","hidden"),"directory"===a.mime?r=[a.hash]:"group"===a.mime&&a.getSize&&(r=a.files),E.html(o.replace(/\{value\}/,n)+o.replace(/\{value\}/,v.mime2kind(a))+o.replace(/\{value\}/,r.length?L:v.formatSize(a.size))+o.replace(/\{value\}/,v.i18n("modify")+": "+v.formatDate(a))),r.length&&((d=v.getSize(r).done(function(e){E.find("span.elfinder-spinner").parent().html(e.formated)}).fail(function(){E.find("span.elfinder-spinner").parent().html(v.i18n("unknown"))}).always(function(){d=null}))._hash=a.hash),M.addClass("elfinder-cwd-icon ui-corner-all "+v.mime2class(a.mime)),a.icon&&M.css(v.getIconStyle(a,!0)),g.info.attr("class",k),a.csscls&&g.info.addClass(a.csscls),a.read&&(t=v.tmb(a))&&st("<img/>").hide().appendTo(g.preview).on("load",function(){M.addClass(t.className).css("background-image","url('"+t.url+"')"),st(this).remove()}).attr("src",t.url),g.info.delay(100).fadeIn(10),g.window.hasClass(x)&&F.trigger("mousemove"),i.css("overflow","")):e.stopImmediatePropagation()}),this.window=st('<div class="ui-front ui-helper-reset ui-widget elfinder-quicklook touch-punch" style="position:absolute"></div>').hide().addClass(v.UA.Touch?"elfinder-touch":"").on("click",function(e){var t=this;e.stopPropagation(),2===b&&requestAnimationFrame(function(){2===b&&v.toFront(t)})}).append(st('<div class="ui-dialog-titlebar ui-widget-header ui-corner-top ui-helper-clearfix elfinder-quicklook-titlebar"></div>').append(st('<span class="ui-widget-header ui-dialog-titlebar-close ui-corner-all elfinder-titlebar-button elfinder-quicklook-titlebar-icon'+(a?" elfinder-titlebar-button-right":"")+'"></span>').append(_,N),I),this.preview,g.info.hide(),F.hide(),H).draggable({handle:"div.elfinder-quicklook-titlebar"}).on("open",function(e,t){function n(e){b=e,g.update(1,g.value),g.change(),l.trigger("resize."+v.namespace)}var i,a,o,r,s,l=g.window,c=g.value,d=v.getUI("cwd");B||0!==b?4===b&&(v.getUI("navdock").data("addNode")(m),n(3),g.preview.trigger("changesize"),v.storage("previewDocked","1"),0===v.getUI("navdock").width()&&l.trigger("navdockout")):(c&&c.hash!==f&&(d=v.cwdHash2Elm(c.hash.split("/",2)[0])),W="",H.attr("style",""),b=1,d.trigger("scrolltoview"),P(),l.css(t||p(d)).show().animate((i=g.options.contain||v.options.dialogContained,a=i?v.getUI():st(window),o=v.getUI().offset(),r=Math.min(u,a.width()-10),s=Math.min(h,a.height()-80),{opacity:1,width:r,height:s,top:parseInt((a.height()-s-60)/2+(i?0:a.scrollTop()-o.top)),left:parseInt((a.width()-r)/2+(i?0:a.scrollLeft()-o.left))}),550,function(){n(2),U()}),v.toFront(l))}).on("close",function(e,n){function t(e,t){b=e,t&&v.toHide(a),o.children().remove(),g.update(0,g.value),a.data("hash",""),n&&n.resolve()}var i,a=g.window,o=g.preview.trigger("change"),r=(g.value,(a.data("hash")||"").split("/",2)[0]);g.opened()&&(d&&"pending"===d.state()&&d.reject(),g.docked()?(m=v.getUI("navdock").data("removeNode")(g.window.attr("id"),"detach"),t(4),v.storage("previewDocked","2")):(b=1,a.hasClass(x)&&D.click(),r&&(i=l.find("#"+r)).length?a.animate(p(i),500,function(){o.off("changesize"),t(0,!0)}):t(0,!0)))}).on("navdockin",function(e,t){var n=g.window,i=v.getUI("navdock"),a=c||i.width(),o=t||{};B&&(o.init=!0),b=3,r=n.attr("style"),n.toggleClass("ui-front").removeClass("ui-widget").draggable("disable").resizable("disable").removeAttr("style").css({width:"100%",height:a,boxSizing:"border-box",paddingBottom:0,zIndex:"unset"}),H.hide(),N.toggleClass("ui-icon-plusthick ui-icon-minusthick elfinder-icon-full elfinder-icon-minimize"),v.toHide(n,!0),i.data("addNode")(n,o),g.preview.trigger("changesize"),v.storage("previewDocked","1")}).on("navdockout",function(e){var t=g.window,n=v.getUI("navdock"),i=(st.Deferred(),p(g.preview));c=t.outerHeight(),n.data("removeNode")(t.attr("id"),v.getUI()),t.toggleClass("ui-front").addClass("ui-widget").draggable("enable").resizable("enable").attr("style",r),N.toggleClass("ui-icon-plusthick ui-icon-minusthick elfinder-icon-full elfinder-icon-minimize"),b=0,t.trigger("open",i),v.storage("previewDocked","0")}).on("resize."+v.namespace,function(){g.preview.trigger("changesize")}),this.alwaysEnabled=!0,this.value=null,this.handlers={select:function(e,t){i&&cancelAnimationFrame(i),e.data&&e.data.selected&&e.data.selected.length?g.opened()&&n():i=requestAnimationFrame(function(){g.opened()&&n()})},error:function(){g.window.is(":visible")&&g.window.trigger("close")},"searchshow searchhide":function(){this.opened()&&this.window.trigger("close")},navbarshow:function(){requestAnimationFrame(function(){g.docked()&&g.preview.trigger("changesize")})},destroy:function(){g.window.remove()}},this.shortcuts=[{pattern:"space"}],this.support={audio:{ogg:e("audio/ogg;"),webm:e("audio/webm;"),mp3:e("audio/mpeg;"),wav:e("audio/wav;"),m4a:e("audio/mp4;")||e("audio/x-m4a;")||e("audio/aac;"),flac:e("audio/flac;"),amr:e("audio/amr;")},video:{ogg:e("video/ogg;"),webm:e("video/webm;"),mp4:e("video/mp4;"),mkv:e("video/x-matroska;")||e("video/webm;"),"3gp":e("video/3gpp;")||e("video/mp4;"),m3u8:e("application/x-mpegURL","video")||e("application/vnd.apple.mpegURL","video"),mpd:e("application/dash+xml","video")}},o={},this.closed=function(){return 0==b||4==b},this.opened=function(){return 2==b||3==b},this.docked=function(){return 3==b},this.addIntegration=function(e){requestAnimationFrame(function(){v.trigger("helpIntegration",Object.assign({cmd:"quicklook"},e))})},this.init=function(){var a,o=this.options,t=this.window,e=this.preview;u=0<o.width?parseInt(o.width):450,h=0<o.height?parseInt(o.height):300,"auto"!==o.dockHeight&&(c=(c=parseInt(o.dockHeight))||void 0),v.one("load",function(){(C=v.getUI("navdock").data("dockEnabled"))||N.hide(),s=v.getUI(),l=v.getUI("cwd"),v.zIndex&&t.css("z-index",v.zIndex+1),t.appendTo(s),st(document).on("keydown."+v.namespace,function(e){e.keyCode==st.ui.keyCode.ESCAPE&&g.opened()&&!g.docked()&&t.hasClass("elfinder-frontmost")&&t.trigger("close")}),t.resizable({handles:"se",minWidth:350,minHeight:120,resize:function(){e.trigger("changesize")}}),g.change(function(){g.opened()&&g.value&&(g.value.tmb&&1==g.value.tmb&&(g.value=Object.assign({},v.file(g.value.hash))),e.trigger(st.Event(y,{file:g.value})))}),e.on(y,function(e){var t,n,i;if(t=e.file){if(n=t.hash,i=v.searchStatus.mixed&&1<v.searchStatus.state,"directory"!==t.mime)if(parseInt(t.size)||t.mime.match(o.mimeRegexNotEmptyCheck)){if(g.dispInlineRegex=a,i||v.optionsByHashes[n])try{g.dispInlineRegex=new RegExp(v.option("dispInlineRegex",n),"i")}catch(e){try{g.dispInlineRegex=new RegExp(v.isRoot(t)?v.options.dispInlineRegex:v.option("dispInlineRegex",t.phash),"i")}catch(e){g.dispInlineRegex=/^$/}}}else e.stopImmediatePropagation();else g.dispInlineRegex=/^$/;g.info.show()}else e.stopImmediatePropagation()}),st.each(v.commands.quicklook.plugins||[],function(e,t){"function"==typeof t&&new t(g)})}).one("open",function(){var e,t=Number(v.storage("previewDocked")||o.docked);C&&1<=t&&(e=g.window,g.exec(),e.trigger("navdockin",{init:!0}),2===t?e.trigger("close"):(g.update(void 0,v.cwd()),g.change())),B=!1}).bind("open",function(){f=v.cwd().hash,g.value=v.cwd();try{a=new RegExp(v.option("dispInlineRegex"),"i")}catch(e){a=/^$/}}).bind("change",function(e){e.data&&e.data.changed&&g.opened()&&st.each(e.data.changed,function(){if(g.window.data("hash")===this.hash)return g.window.data("hash",null),g.preview.trigger(y),!1})}).bind("navdockresizestart navdockresizestop",function(e){F["navdockresizestart"===e.type?"show":"hide"]()})},this.getstate=function(){return g.opened()?1:0},this.exec=function(){return g.closed()&&n(),g.enabled()&&g.window.trigger(g.opened()?"close":"open"),st.Deferred().resolve()},this.hideinfo=function(){this.info.stop(!0,!0).hide()}}).prototype={forceLoad:!0},Me.prototype.commands.quicklook.plugins=[function(p){var u,h=["image/jpeg","image/png","image/gif","image/svg+xml","image/x-ms-bmp"],f=p.fm.returnBytes(p.options.getDimThreshold||0),m=p.preview,e=new Image;e.onload=e.onerror=function(){2==e.height&&h.push("image/webp")},e.src="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA",st.each(navigator.mimeTypes,function(e,t){var n=t.type;0===n.indexOf("image/")&&st.inArray(n,h)&&h.push(n)}),m.on(p.evUpdate,function(e){function o(e){var t=s.file(l.hash);t.width=e[0],t.height=e[1]}function n(){var e,t,n,i,a;d&&d.state&&"pending"===d.state()&&d.reject(),c||(c=!0,e=r.get(0),(t=l.width&&l.height?{w:l.width,h:l.height}:e.naturalWidth?null:{w:r.width(),h:r.height()})&&r.removeAttr("width").removeAttr("height"),n=l.width||e.naturalWidth||e.width||r.width(),i=l.height||e.naturalHeight||e.height||r.height(),l.width&&l.height||o([n,i]),t&&r.width(t.w).height(t.h),a=(n/i).toFixed(2),m.on("changesize",function(){var e,t,n=parseInt(m.width()),i=parseInt(m.height());a<(n/i).toFixed(2)?(t=i,e=Math.floor(t*a)):(e=n,t=Math.floor(e/a)),r.width(e).height(t).css("margin-top",t<i?Math.floor((i-t)/2):0)}).trigger("changesize"),r.fadeIn(100))}var r,t,i,a,s=p.fm,l=e.file,c=!1,d=null;(u=u||s.arrayFlip(h))[l.mime]&&p.dispInlineRegex.test(l.mime)&&(e.stopImmediatePropagation(),t=st('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+s.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(p.info.find(".elfinder-quicklook-info")),i=st('<div class="elfinder-quicklook-info-progress"></div>').appendTo(t),r=st("<img/>").hide().appendTo(m).on("load",function(){t.remove(),p.hideinfo(),n()}).on("error",function(){t.remove()}),a=s.openUrl(l.hash,!1,function(e){r.attr("src",e)},{progressBar:i}),m.one("change",function(){a&&a.state&&"pending"===a.state()&&a.reject()}),l.width&&l.height?n():l.size>f&&(d=s.request({data:{cmd:"dim",target:l.hash},preventDefault:!0}).done(function(e){var t;e.dim&&(t=e.dim.split("x"),l.width=t[0],l.height=t[1],o(t),n())})))})},function(u){var h=u.fm,f=u.preview;window.Worker&&window.Uint8Array&&f.on(u.evUpdate,function(e){function t(e){d&&d.terminate(),l.remove(),h.debug("error",e)}var l,n,c,d,i,p=e.file;"image/tiff"===p.mime&&(e.stopImmediatePropagation(),l=st('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+h.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(u.info.find(".elfinder-quicklook-info")),n=st('<div class="elfinder-quicklook-info-progress"></div>').appendTo(l),f.one("change",function(){d&&d.terminate(),l.remove()}),i=h.getContents(p.hash,"arraybuffer",{progressBar:n}).done(function(e){if(e){c=st("<div></div>").css({width:"100%",height:"100%"}).hide().appendTo(f);try{(d=h.getWorker()).onmessage=function(e){var a,t,n,o,i,r,s=e.data;d&&d.terminate(),t=(a=document.createElement("canvas")).getContext("2d"),a.width=s.width,a.height=s.height,(n=t.createImageData(s.width,s.height)).data.set(new Uint8Array(s.image)),t.putImageData(n,0,0),c.append(a).show(),l.remove(),o=(s.width/s.height).toFixed(2),f.on("changesize",function(){var e,t,n=parseInt(f.width()),i=parseInt(f.height());o<(n/i).toFixed(2)?(t=i,e=Math.floor(t*o)):(e=n,t=Math.floor(e/o)),st(a).width(e).height(t).css("margin-top",t<i?Math.floor((i-t)/2):0)}).trigger("changesize"),p.width&&p.height||(i=[s.width,s.height],(r=h.file(p.hash)).width=i[0],r.height=i[1]),u.hideinfo()},d.onerror=t,d.postMessage({scripts:[h.options.cdns.tiff,h.getWorkerUrl("quicklook.tiff.js")],data:{data:e}})}catch(e){t(e)}}else t()}),f.one("change",function(){i&&i.state&&"pending"===i.state()&&i.reject()}))})},function(l){function c(e,o,t){try{p.replaceXhrSend(),d.fromURL(e).then(function(e){var a;o.attr("src",e.image.toBase64()),requestAnimationFrame(function(){a=(o.width()/o.height()).toFixed(2),h.on("changesize",function(){var e,t,n=parseInt(h.width()),i=parseInt(h.height());a<(n/i).toFixed(2)?(t=i,e=Math.floor(t*a)):(e=n,t=Math.floor(e/a)),o.width(e).height(t).css("margin-top",t<i?Math.floor((i-t)/2):0)}).trigger("changesize"),t.remove(),l.hideinfo(),o.fadeIn(100)})},function(){t.remove(),o.remove()}),p.restoreXhrSend()}catch(e){p.restoreXhrSend(),t.remove(),o.remove()}}var d,p=l.fm,u=p.arrayFlip(["image/vnd.adobe.photoshop","image/x-photoshop"]),h=l.preview;h.on(l.evUpdate,function(e){var t,n,i,a,o,r,s=e.file;u[s.mime]&&p.options.cdns.psd&&!p.UA.ltIE10&&l.dispInlineRegex.test(s.mime)&&(e.stopImmediatePropagation(),n=st('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+p.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(l.info.find(".elfinder-quicklook-info")),i=st('<div class="elfinder-quicklook-info-progress"></div>').appendTo(n),r=p.openUrl(s.hash,"sameorigin",function(e){e&&(t=st("<img/>").hide().appendTo(h),d?c(e,t,n):(a=window.define,o=window.require,window.require=null,window.define=null,p.loadScript([p.options.cdns.psd],function(){d=require("psd"),a?window.define=a:delete window.define,o?window.require=o:delete window.require,c(e,t,n)})))},{progressBar:i}),h.one("change",function(){r&&r.state&&"pending"===r.state()&&r.reject()}))})},function(o){var r=o.fm,s=r.arrayFlip(["text/html","application/xhtml+xml"]),l=o.preview;l.on(o.evUpdate,function(e){var t,n,i,a=e.file;s[a.mime]&&o.dispInlineRegex.test(a.mime)&&(!o.options.getSizeMax||a.size<=o.options.getSizeMax)&&(e.stopImmediatePropagation(),n=st('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+r.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(o.info.find(".elfinder-quicklook-info")),i=st('<div class="elfinder-quicklook-info-progress"></div>').appendTo(n),l.one("change",function(){"pending"==t.state()&&t.reject()}).addClass("elfinder-overflow-auto"),t=r.request({data:{cmd:"get",target:a.hash,conv:1,_t:a.ts},options:{type:"get",cache:!0},preventDefault:!0,progressBar:i}).done(function(e){o.hideinfo();var t=st('<iframe class="elfinder-quicklook-preview-html"></iframe>').appendTo(l)[0].contentWindow.document;t.open(),t.write(e.content),t.close()}).always(function(){n.remove()}))})},function(o){function r(e,t){o.hideinfo();var n=st('<iframe class="elfinder-quicklook-preview-html"></iframe>').appendTo(d)[0].contentWindow.document;n.open(),n.write(p(e.content)),n.close(),t.remove()}function s(e){p=!1,e.remove()}var l=o.fm,c=l.arrayFlip(["text/x-markdown"]),d=o.preview,p=null;d.on(o.evUpdate,function(e){var t,n,i,a=e.file;c[a.mime]&&l.options.cdns.marked&&!1!==p&&o.dispInlineRegex.test(a.mime)&&(!o.options.getSizeMax||a.size<=o.options.getSizeMax)&&(e.stopImmediatePropagation(),n=st('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+l.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(o.info.find(".elfinder-quicklook-info")),i=st('<div class="elfinder-quicklook-info-progress"></div>').appendTo(n),d.one("change",function(){"pending"==t.state()&&t.reject()}).addClass("elfinder-overflow-auto"),t=l.request({data:{cmd:"get",target:a.hash,conv:1,_t:a.ts},options:{type:"get",cache:!0},preventDefault:!0,progressBar:i}).done(function(t){p||window.marked?(p=p||window.marked,r(t,n)):l.loadScript([l.options.cdns.marked],function(e){p=e||window.marked||!1,delete window.marked,p?r(t,n):s(n)},{tryRequire:!0,error:function(){s(n)}})}).fail(function(){s(n)}))})},function(r){var s,l,c,d,p,e,u;r.options.viewerjs&&(s=r.fm,l=r.preview,c=r.options.viewerjs,d=c.url?s.arrayFlip(c.mimes||[]):[],p=r.window,e=r.navbar,u=function(){e.css("bottom",p.hasClass("elfinder-quicklook-fullscreen")?"30px":"")},c.url&&l.on("update",function(e){var t,n,i,a,o=e.file;!d[o.mime]||"application/pdf"===o.mime&&c.pdfNative&&r.flags.pdfNative||(e.stopImmediatePropagation(),n=st('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+s.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(r.info.find(".elfinder-quicklook-info")),i=st('<div class="elfinder-quicklook-info-progress"></div>').appendTo(n),a=s.openUrl(o.hash,"sameorigin",function(e){e&&(t=st('<iframe class="elfinder-quicklook-preview-iframe"></iframe>').css("background-color","transparent").on("load",function(){r.hideinfo(),n.remove(),t.css("background-color","#fff")}).on("error",function(){n.remove(),t.remove()}).appendTo(l).attr("src",c.url+"#"+e),p.on("viewchange.viewerjs",u),u(),l.one("change",function(){p.off("viewchange.viewerjs"),n.remove(),t.off("load").remove()}))},{progressBar:i}),l.one("change",function(){a&&a.state&&"pending"===a.state()&&a.reject()}))}))},function(i){var a=i.fm,o="application/pdf",r=i.preview,s=!1,l="";a.UA.Safari&&"mac"===a.OS&&!a.UA.iOS||a.UA.IE||a.UA.Firefox?s=!0:st.each(navigator.plugins,function(e,t){st.each(t,function(e,t){if(t.type===o)return!(s=!0)})}),(i.flags.pdfNative=s)&&(void 0===i.options.pdfToolbar||i.options.pdfToolbar||(l="#toolbar=0"),r.on(i.evUpdate,function(e){var t,n=e.file;s&&n.mime===o&&i.dispInlineRegex.test(n.mime)&&(e.stopImmediatePropagation(),t=a.openUrl(n.hash,!1,function(e){e&&(i.hideinfo(),i.cover.addClass("elfinder-quicklook-coverbg"),st('<object class="elfinder-quicklook-preview-pdf" data="'+e+l+'" type="application/pdf" ></object>').on("error",function(e){s=!1,i.update(void 0,a.cwd()),i.update(void 0,n)}).appendTo(r))}),r.one("change",function(){t&&t.state&&"pending"===t.state()&&t.reject()}))}))},function(i){var a=i.fm,o="application/x-shockwave-flash",r=i.preview,n=!1;st.each(navigator.plugins,function(e,t){st.each(t,function(e,t){if(t.type===o)return!(n=!0)})}),n&&r.on(i.evUpdate,function(e){var t,n=e.file;n.mime===o&&i.dispInlineRegex.test(n.mime)&&(e.stopImmediatePropagation(),t=a.openUrl(n.hash,!1,function(e){e&&(i.hideinfo(),st('<embed class="elfinder-quicklook-preview-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+e+'" quality="high" type="application/x-shockwave-flash" wmode="transparent" />').appendTo(r))}),r.one("change",function(){t&&t.state&&"pending"===t.state()&&t.reject()}))})},function(c){function d(){e.css("bottom",k.hasClass("elfinder-quicklook-fullscreen")?"50px":"")}function p(e,t){return st('<audio class="elfinder-quicklook-preview-audio ui-front" controls'+n+' preload="auto" autobuffer><source src="'+e+'" ></source></audio>').on("change",function(e){e.stopPropagation()}).on("error",function(e){h&&h.data("hash")===t&&i()}).data("hash",t).appendTo(w)}function u(t){var e,n=h.data("hash");g&&(e=t.play()),e&&e.catch&&e.catch(function(e){t.paused||h&&h.data("hash")===n&&i()})}var h,f,m,g,v,b,y=c.fm,w=c.preview,x={"audio/mpeg":"mp3","audio/mpeg3":"mp3","audio/mp3":"mp3","audio/x-mpeg3":"mp3","audio/x-mp3":"mp3","audio/x-wav":"wav","audio/wav":"wav","audio/x-m4a":"m4a","audio/aac":"m4a","audio/mp4":"m4a","audio/x-mp4":"m4a","audio/ogg":"ogg","audio/webm":"webm","audio/flac":"flac","audio/x-flac":"flac","audio/amr":"amr"},k=c.window,e=c.navbar,n="string"==typeof c.options.mediaControlsList&&c.options.mediaControlsList?' controlsList="'+y.escape(c.options.mediaControlsList)+'"':"",i=function(){if(h&&h.parent().length){var e=h[0],t=h.children("source").attr("src");k.off("viewchange.audio");try{e.pause(),h.empty(),t.match(/^blob:/)&&URL.revokeObjectURL(t),e.src="",e.load()}catch(e){}h.remove(),h=null}};w.on(c.evUpdate,function(e){var t,n,i,a,o,r,s=e.file,l=x[s.mime];x[s.mime]&&c.dispInlineRegex.test(s.mime)&&((t=c.support.audio[l])||"amr"===l)&&(g=c.autoPlay(),f=s.hash,t?(e.stopImmediatePropagation(),v=st('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+y.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(c.info.find(".elfinder-quicklook-info")),b=st('<div class="elfinder-quicklook-info-progress"></div>').appendTo(v),n=y.openUrl(f,!1,function(e){v.remove(),e?(h=p(e,f),u(h[0]),k.on("viewchange.audio",d),d()):h.remove()},{progressBar:b}),w.one("change",function(){n&&n.state&&"pending"===n.state()&&n.reject()})):y.options.cdns.amr&&"amr"===l&&!1!==m&&(e.stopImmediatePropagation(),v=st('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+y.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(c.info.find(".elfinder-quicklook-info")),b=st('<div class="elfinder-quicklook-info-progress"></div>').appendTo(v),h=p("",f),i=s.hash,o=st.Deferred(),r=st.Deferred().done(function(){var e=y.getContents(i,"arraybuffer",{progressBar:b}).done(function(e){try{var t=m.toWAV(new Uint8Array(e));t?o.resolve(URL.createObjectURL(new Blob([t],{type:"audio/x-wav"}))):o.reject()}catch(e){o.reject()}}).fail(function(){o.reject()});w.one("change",function(){e&&e.state&&"pending"===e.state()&&e.reject()})}).fail(function(){m=!1,o.reject()}),window.TextEncoder&&window.URL&&URL.createObjectURL&&void 0===m?(a=window.AMR,delete window.AMR,y.loadScript([y.options.cdns.amr],function(){m=!!window.AMR&&window.AMR,window.AMR=a,r[m?"resolve":"reject"]()},{error:function(){r.reject()}})):r[m?"resolve":"reject"](),o.done(function(t){if(v.remove(),f===s.hash){var e=h[0];try{h.children("source").attr("src",t),e.pause(),e.load(),u(e),k.on("viewchange.audio",d),d()}catch(e){URL.revokeObjectURL(t),h.remove()}}else URL.revokeObjectURL(t)}).fail(function(){h.remove()})))}).one("change",i)},function(r){function o(){k.UA.iOS?T.hasClass("elfinder-quicklook-fullscreen")?(C.css("height","-webkit-calc(100% - 50px)"),e._show()):C.css("height",""):e.css("bottom",T.hasClass("elfinder-quicklook-fullscreen")?"50px":"")}function s(e,t){function n(e){1<a&&(y&&clearTimeout(y),y=setTimeout(function(){i||O(!0)},800))}var i,a=0;m=null,t=t||{},r.hideinfo(),(u=st('<video class="elfinder-quicklook-preview-video" controls'+A+' preload="auto" autobuffer playsinline></video>').on("change",function(e){e.stopPropagation()}).on("timeupdate progress",n).on("canplay",function(){i=!0}).data("hash",e.hash))[0].addEventListener("error",function(e){t.src&&k.convAbsUrl(t.src)===k.convAbsUrl(e.target.src)&&(++a,n())},!0),t.src&&u.append('<source src="'+t.src+'" type="'+e.mime+'"></source><source src="'+t.src+'"></source>'),u.appendTo(C),T.on("viewchange.video",o),o()}function l(t){var n,e=k.openUrl(t.hash,!1,function(e){w.remove(),e&&(s(t),(n=new h).loadSource(e),n.attachMedia(u[0]),b&&n.on(h.Events.MANIFEST_PARSED,function(){j(u[0])}))},{progressBar:x});C.one("change",function(){e&&e.state&&"pending"===e.state()&&e.reject()})}function c(n){var e=k.openUrl(n.hash,!1,function(e){var t;w.remove(),e&&(s(n),(t=(m=window.dashjs.MediaPlayer().create()).getDebug()).setLogLevel?t.setLogLevel(dashjs.Debug.LOG_LEVEL_FATAL):t.setLogToBrowserConsole&&t.setLogToBrowserConsole(!1),m.initialize(u[0],e,b),m.on("error",function(e){O(!0)}))},{progressBar:x});C.one("change",function(){e&&e.state&&"pending"===e.state()&&e.reject()})}function d(n){var e;g.isSupported()?(e=k.openUrl(n.hash,!1,function(e){var t;w.remove(),e&&(t=g.createPlayer({type:"flv",url:e}),s(n),t.on(g.Events.ERROR,function(){t.destroy(),O(!0)}),t.attachMediaElement(u[0]),t.load(),j(t))},{progressBar:x}),C.one("change",function(){e&&e.state&&"pending"===e.state()&&e.reject()})):g=!1}function p(t){var e=k.openUrl(t.hash,!1,function(e){w.remove(),e&&(s(t),u[0].src=e,v(u[0],{src:e}))},{progressBar:x});C.one("change",function(){e&&e.state&&"pending"===e.state()&&e.reject()})}var u,h,f,m,g,v,b,y,w,x,k=r.fm,C=r.preview,z={"video/mp4":"mp4","video/x-m4v":"mp4","video/quicktime":"mp4","video/mpeg":"mpeg","video/ogg":"ogg","application/ogg":"ogg","video/webm":"webm","video/x-matroska":"mkv","video/3gpp":"3gp","application/vnd.apple.mpegurl":"m3u8","application/x-mpegurl":"m3u8","application/dash+xml":"mpd","video/x-flv":"flv","video/x-msvideo":"avi"},T=r.window,e=r.navbar,A="string"==typeof r.options.mediaControlsList&&r.options.mediaControlsList?' controlsList="'+k.escape(r.options.mediaControlsList)+'"':"",j=function(t){var e,n=u.data("hash");b&&(e=t.play()),e&&e.catch&&e.catch(function(e){t.paused||u&&u.data("hash")===n&&O(!0)})},O=function(e){if(y&&clearTimeout(y),u&&u.parent().length){var t=u[0];T.off("viewchange.video"),m&&m.reset();try{t.pause(),u.empty(),t.src="",t.load()}catch(e){}u.remove(),u=null}e&&r.info.show()};C.on(r.evUpdate,function(e){var t,n,i=e.file,a=i.mime.toLowerCase(),o=z[a];z[a]&&r.dispInlineRegex.test(i.mime)&&(b=r.autoPlay(),w=st('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+k.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>'),x=st('<div class="elfinder-quicklook-info-progress"></div>').appendTo(w),r.support.video[o]&&("m3u8"!==o||k.UA.Safari)?(e.stopImmediatePropagation(),w.appendTo(r.info.find(".elfinder-quicklook-info")),n=k.openUrl(i.hash,!1,function(e){w.remove(),e&&(s(i,{src:e}),j(u[0]))},{progressBar:x}),C.one("change",function(){n&&n.state&&"pending"===n.state()&&n.reject()})):!1!==h&&k.options.cdns.hls&&"m3u8"===o?(e.stopImmediatePropagation(),w.appendTo(r.info.find(".elfinder-quicklook-info")),h?l(i):(t=window.Hls,delete window.Hls,k.loadScript([k.options.cdns.hls],function(e){h=e||window.Hls||!1,window.Hls=t,h&&l(i)},{tryRequire:!0,error:function(){h=!1}}))):!1!==f&&k.options.cdns.dash&&"mpd"===o?(e.stopImmediatePropagation(),w.appendTo(r.info.find(".elfinder-quicklook-info")),f?c(i):k.loadScript([k.options.cdns.dash],function(){(f=!!window.dashjs)&&c(i)},{tryRequire:!0,error:function(){f=!1}})):!1!==g&&k.options.cdns.flv&&"flv"===o?(e.stopImmediatePropagation(),w.appendTo(r.info.find(".elfinder-quicklook-info")),g?d(i):(t=window.flvjs,delete window.flvjs,k.loadScript([k.options.cdns.flv],function(e){g=e||window.flvjs||!1,window.flvjs=t,g&&d(i)},{tryRequire:!0,error:function(){g=!1}}))):k.options.cdns.videojs&&(e.stopImmediatePropagation(),w.appendTo(r.info.find(".elfinder-quicklook-info")),v?p(i):k.loadScript([k.options.cdns.videojs+"/video.min.js"],function(e){(v=e||window.videojs||!1)&&p(i)},{tryRequire:!0,error:function(){v=!1}}).loadCss([k.options.cdns.videojs+"/video-js.min.css"])))}).one("change",O)},function(l){var c,d=l.preview,p=[],u=l.window,h=l.navbar;st.each(navigator.plugins,function(e,t){st.each(t,function(e,t){0!==t.type.indexOf("audio/")&&0!==t.type.indexOf("video/")||p.push(t.type)})}),p=l.fm.arrayFlip(p),d.on(l.evUpdate,function(e){function t(){h.css("bottom",u.hasClass("elfinder-quicklook-fullscreen")?"50px":"")}var n,i,a,o,r=e.file,s=r.mime;p[r.mime]&&l.dispInlineRegex.test(r.mime)&&(e.stopImmediatePropagation(),a=st('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+fm.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(l.info.find(".elfinder-quicklook-info")),o=st('<div class="elfinder-quicklook-info-progress"></div>').appendTo(a),i=l.fm.openUrl(r.hash,!1,function(e){a.remove(),e&&((n=0===s.indexOf("video/"))&&l.hideinfo(),c=st('<embed src="'+e+'" type="'+s+'" class="elfinder-quicklook-preview-'+(n?"video":"audio")+'"/>').appendTo(d),u.on("viewchange.embed",t),t())},{progressBar:o}),d.one("change",function(){i&&i.state&&"pending"===i.state()&&i.reject()}))}).one("change",function(){c&&c.parent().length&&(u.off("viewchange.embed"),c.remove(),c=null)})},function(d){var p=d.fm,u=p.arrayFlip(["application/zip","application/x-gzip","application/x-tar","application/x-bzip2"]),h=d.preview,f=p.returnBytes(d.options.unzipMaxSize||0),m=!(!p.options.cdns.zlibUnzip||!p.options.cdns.zlibGunzip),g=!!p.options.cdns.bzip2;window.Worker&&window.Uint8Array&&window.DataView&&h.on(d.evUpdate,function(e){var t,n,a,i,o,r=e.file,s="application/x-tar"===r.mime,l="application/x-bzip2"===r.mime,c="application/zip"===r.mime||"application/x-gzip"===r.mime;u[r.mime]&&(!f||r.size<=f)&&(s||l&&g||c&&m)&&(o=function(e){var t,n,i=0;e&&e.length&&((e=st.map(e,function(e){return p.decodeRawString(e)})).sort(),n=p.escape(e.join("\n").replace(/\{formatSize\((\d+)\)\}/g,function(e,t){return i+=parseInt(t),p.formatSize(t)})),t="<strong>"+p.escape(r.mime)+"</strong> ("+p.formatSize(r.size)+" / "+p.formatSize(i)+")<hr/>",st('<div class="elfinder-quicklook-preview-archive-wrapper">'+t+'<pre class="elfinder-quicklook-preview-text">'+n+"</pre></div>").on("touchstart",function(e){5<st(this)["scroll"+("ltr"===p.direction?"Right":"Left")]()&&(e.originalEvent._preventSwipeX=!0)}).appendTo(h),d.hideinfo()),a.remove()},e.stopImmediatePropagation(),a=st('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+p.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(d.info.find(".elfinder-quicklook-info")),i=st('<div class="elfinder-quicklook-info-progress"></div>').appendTo(a),h.one("change",function(){"pending"===t.state()&&t.reject(),n&&n.terminate(),a.remove()}),t=p.getContents(r.hash,"arraybuffer",{progressBar:i}).fail(function(){a.remove()}).done(function(e){function t(e){n&&n.terminate(),a.remove(),c?m=!1:l&&(g=!1),p.debug("error",e)}try{(n=p.getWorker()).onmessage=function(e){n&&n.terminate(),a.remove(),!e.data||e.data.error?new Error(e.data&&e.data.error?e.data.error:""):o(e.data.files)},n.onerror=t,"application/x-tar"===r.mime?n.postMessage({scripts:[p.getWorkerUrl("quicklook.unzip.js")],data:{type:"tar",bin:e}}):"application/zip"===r.mime?n.postMessage({scripts:[p.options.cdns.zlibUnzip,p.getWorkerUrl("quicklook.unzip.js")],data:{type:"zip",bin:e}}):"application/x-gzip"===r.mime?n.postMessage({scripts:[p.options.cdns.zlibGunzip,p.getWorkerUrl("quicklook.unzip.js")],data:{type:"gzip",bin:e}}):"application/x-bzip2"===r.mime&&n.postMessage({scripts:[p.options.cdns.bzip2,p.getWorkerUrl("quicklook.unzip.js")],data:{type:"bzip2",bin:e}})}catch(e){t(e)}}))})},function(d){var p,u=d.fm,h=u.arrayFlip(["application/x-rar"]),f=d.preview;window.DataView&&f.on(d.evUpdate,function(e){var i,t,a,o,n,r,s,l,c=e.file;h[c.mime]&&u.options.cdns.rar&&!1!==p&&(n=function(e){if(o)i.remove();else try{a=p({file:e,type:2,xhrHeaders:u.customHeaders,xhrFields:u.xhrFields},function(e){i.remove();var t,n=[];o||e?e&&u.debug("error",e):(st.each(a.entries,function(){n.push(this.path+(this.size?" ("+u.formatSize(this.size)+")":""))}),n.length&&((n=st.map(n,function(e){return u.decodeRawString(e)})).sort(),t="<strong>"+u.escape(c.mime)+"</strong> ("+u.formatSize(c.size)+")<hr/>",st('<div class="elfinder-quicklook-preview-archive-wrapper">'+t+'<pre class="elfinder-quicklook-preview-text">'+u.escape(n.join("\n"))+"</pre></div>").on("touchstart",function(e){5<st(this)["scroll"+("ltr"===u.direction?"Right":"Left")]()&&(e.originalEvent._preventSwipeX=!0)}).appendTo(f),d.hideinfo()))})}catch(e){i.remove()}},r=function(){p=!1,i.remove()},e.stopImmediatePropagation(),i=st('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+u.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(d.info.find(".elfinder-quicklook-info")),t=st('<div class="elfinder-quicklook-info-progress"></div>').appendTo(i),f.one("change",function(){a&&(a.abort=!0),i.remove(),o=!0}),l=u.openUrl(c.hash,"sameorigin",function(t){t&&(p?n(t):(window.RarArchive&&(s=window.RarArchive,delete window.RarArchive),u.loadScript([u.options.cdns.rar],function(){u.hasRequire?require(["rar"],function(e){p=e,n(t)},r):(p=window.RarArchive)?(s?window.RarArchive=s:delete window.RarArchive,n(t)):r()},{tryRequire:!0,error:r})))},{progressBar:t,temporary:!0}),f.one("change",function(){l&&l.state&&"pending"===l.state()&&l.reject()}))})},function(o){var r,s=o.fm,l=s.arrayFlip(o.options.sharecadMimes||[]),c=o.preview;o.window;o.options.sharecadMimes.length&&o.addIntegration({title:"ShareCAD.org CAD and 3D-Models viewer",link:"https://sharecad.org/DWGOnlinePlugin"}),c.on(o.evUpdate,function(e){var t,n,i,a=e.file;l[a.mime.toLowerCase()]&&s.option("onetimeUrl",a.hash)&&(o.window,e.stopImmediatePropagation(),"1"==a.url&&(c.hide(),st('<div class="elfinder-quicklook-info-data"><button class="elfinder-info-button">'+s.i18n("getLink")+"</button></div>").appendTo(o.info.find(".elfinder-quicklook-info")).on("click",function(){var e=st(this);e.html('<span class="elfinder-spinner">'),s.request({data:{cmd:"url",target:a.hash},preventDefault:!0,progressBar:n}).always(function(){e.html("")}).done(function(e){var t=s.file(a.hash);a.url=t.url=e.url||"",a.url&&c.trigger({type:o.evUpdate,file:a,forceUpdate:!0})})})),""!==a.url&&"1"!=a.url&&(c.one("change",function(){t.remove(),r.off("load").remove(),r=null}).addClass("elfinder-overflow-auto"),t=st('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+s.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(o.info.find(".elfinder-quicklook-info")),n=st('<div class="elfinder-quicklook-info-progress"></div>').appendTo(t),i=s.convAbsUrl(s.url(a.hash)),r=st('<iframe class="elfinder-quicklook-preview-iframe" scrolling="no"></iframe>').css("background-color","transparent").appendTo(c).on("load",function(){o.hideinfo(),t.remove(),o.preview.after(o.info),st(this).css("background-color","#fff").show()}).on("error",function(){t.remove(),o.preview.after(o.info)}).attr("src","//sharecad.org/cadframe/load?url="+encodeURIComponent(i)),o.info.after(o.preview)))})},function(r){var s,l,e,a,c,d=r.fm,p={"application/vnd.google-earth.kml+xml":!0,"application/vnd.google-earth.kmz":!0},u=r.preview;r.options.googleMapsApiKey&&(r.addIntegration({title:"Google Maps",link:"https://www.google.com/intl/"+d.lang.replace("_","-")+"/help/terms_maps.html"}),s=window.google&&google.maps,l=function(e,t,n){var i=r.options.googleMapsOpts.maps;d.forExternalUrl(e.hash,{progressBar:n}).done(function(e){if(e)try{new s.KmlLayer(e,Object.assign({map:new s.Map(t.get(0),i)},r.options.googleMapsOpts.kml)),r.hideinfo()}catch(e){a()}else a()})},e=window.gm_authFailure,a=function(){c=null},c="https://maps.googleapis.com/maps/api/js?key="+r.options.googleMapsApiKey,window.gm_authFailure=function(){a(),e&&e()},u.on(r.evUpdate,function(e){var t,n,i,a,o=e.file;c&&p[o.mime.toLowerCase()]&&(r.window,t="1"==o.url&&!d.option("onetimeUrl",o.hash),e.stopImmediatePropagation(),n=st('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+d.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(r.info.find(".elfinder-quicklook-info")),i=st('<div class="elfinder-quicklook-info-progress"></div>').appendTo(n),t&&(u.hide(),st('<div class="elfinder-quicklook-info-data"><button class="elfinder-info-button">'+d.i18n("getLink")+"</button></div>").appendTo(r.info.find(".elfinder-quicklook-info")).on("click",function(){var e=st(this);e.html('<span class="elfinder-spinner">'),d.request({data:{cmd:"url",target:o.hash},preventDefault:!0,progressBar:i}).always(function(){n.remove(),e.html("")}).done(function(e){var t=d.file(o.hash);o.url=t.url=e.url||"",o.url&&u.trigger({type:r.evUpdate,file:o,forceUpdate:!0})})})),""===o.url||t||(a=st('<div style="width:100%;height:100%;"></div>').appendTo(u),u.one("change",function(){a.remove(),a=null}),s?l(o,a,i):d.loadScript([c],function(){(s=window.google&&google.maps)&&l(o,a,i)})))}))},function(p){var u,e,h=p.fm,f=Object.assign(h.arrayFlip(p.options.googleDocsMimes||[],"g"),h.arrayFlip(p.options.officeOnlineMimes||[],"m")),m=p.preview,g=(p.window,p.navbar),v={g:"docs.google.com/gview?embedded=true&url=",m:"view.officeapps.live.com/op/embed.aspx?wdStartOn=0&src="},b={g:"56px",m:"24px"},y={xls:5242880,xlsb:5242880,xlsx:5242880,xlsm:5242880,other:10485760};p.options.googleDocsMimes.length&&(e=!0,p.addIntegration({title:"Google Docs Viewer",link:"https://docs.google.com/"})),p.options.officeOnlineMimes.length&&(e=!0,p.addIntegration({title:"MS Online Doc Viewer",link:"https://products.office.com/office-online/view-office-documents-online"})),e&&m.on(p.evUpdate,function(e){var n,t,i,a,o,r,s,l,c,d=e.file;d.size<=26214400&&(n=f[d.mime])&&(i=p.window,a=function(){g.css("bottom",i.hasClass("elfinder-quicklook-fullscreen")?b[n]:"")},o=h.mimeTypes[d.mime],r="1"==d.url&&!h.option("onetimeUrl",d.hash),"m"===n&&(y[o]&&d.size>y[o]||d.size>y.other)&&(n="g"),r&&(m.hide(),st('<div class="elfinder-quicklook-info-data"><button class="elfinder-info-button">'+h.i18n("getLink")+"</button></div>").appendTo(p.info.find(".elfinder-quicklook-info")).on("click",function(){var e=st(this);e.html('<span class="elfinder-spinner">'),h.request({data:{cmd:"url",target:d.hash},preventDefault:!0}).always(function(){e.html("")}).done(function(e){var t=h.file(d.hash);d.url=t.url=e.url||"",d.url&&m.trigger({type:p.evUpdate,file:d,forceUpdate:!0})})})),""===d.url||r||(e.stopImmediatePropagation(),m.one("change",function(){t&&t.status&&"pending"===t.status()&&t.reject(),i.off("viewchange.googledocs"),s.remove(),u.off("load").remove(),u=null}).addClass("elfinder-overflow-auto"),s=st('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+h.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(p.info.find(".elfinder-quicklook-info")),l=st('<div class="elfinder-quicklook-info-progress"></div>').appendTo(s),u=st('<iframe class="elfinder-quicklook-preview-iframe"></iframe>').css("background-color","transparent").appendTo(m),t=h.forExternalUrl(d.hash,{progressBar:l}).done(function(e){var t=function(){try{!u||u.attr("src")&&!u.get(0).contentWindow.document||(u.attr("src","https://"+v[n]+encodeURIComponent(e)),c=setTimeout(t,2e3))}catch(e){}};e?(d.ts&&(e+=(e.match(/\?/)?"&":"?")+"_t="+d.ts),u.on("load",function(){c&&clearTimeout(c),p.hideinfo(),s.remove(),p.preview.after(p.info),st(this).css("background-color","#fff").show()}).on("error",function(){c&&clearTimeout(c),s.remove(),p.preview.after(p.info)}),t()):(s.remove(),u.remove())}),i.on("viewchange.googledocs",a),a(),p.info.after(p.preview)))})},function(c){"use strict";function n(){o=function(){return!1},a&&(window.PR=a),i=!1}var i,a,d=c.fm,p=c.preview,u=parseInt(c.options.textInitialLines)||150,h=parseInt(c.options.prettifyMaxLines)||500,o=function(t){d.options.cdns.prettify?(o=function(e){return setTimeout(function(){f(e)},100),"pending"},window.PR&&(a=window.PR),d.loadScript([d.options.cdns.prettify+(d.options.cdns.prettify.match(/\?/)?"&":"?")+"autorun=false"],function(e){"object"==typeof(i=e||window.PR)?(o=function(){return!0},a?window.PR=a:delete window.PR,r(t)):n()},{tryRequire:!0,error:n})):n()},r=function(e){e&&!e.hasClass("prettyprinted")&&(e.css("cursor","wait"),requestAnimationFrame(function(){i.prettyPrint&&i.prettyPrint(null,e.get(0)),e.css("cursor","")}))},f=function(e){!0===o(e)&&r(e)};p.on(c.evUpdate,function(e){var t,a,n,o,l=e.file;l.mime;d.mimeIsText(l.mime)&&(!c.options.getSizeMax||l.size<=c.options.getSizeMax)&&!1!==i&&(e.stopImmediatePropagation(),a=st('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+d.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(c.info.find(".elfinder-quicklook-info")),n=st('<div class="elfinder-quicklook-info-progress"></div>').appendTo(a),p.one("change",function(){"pending"==t.state()&&t.reject(),o&&o.remove()}),t=d.request({data:{cmd:"get",target:l.hash,conv:l.encoding||1,_t:l.ts},options:{type:"get",cache:!0},preventDefault:!0,progressBar:n}).done(function(e){var t,n,i,a,o,r=new RegExp("^(data:"+l.mime.replace(/([.+])/g,"\\$1")+";base64,)","i"),s=e.content;"string"==typeof s&&(c.hideinfo(),window.atob&&(o=s.match(r))&&(s=atob(s.substr(o[1].length))),10<(n=(a=s.match(/([^\r\n]{1,100}[\r\n]*)/g)).length-u)?t=a.splice(0,u).join(""):n=0,i=st('<div class="elfinder-quicklook-preview-text-wrapper"><pre class="elfinder-quicklook-preview-text prettyprint"></pre></div>'),n&&i.append(st('<div class="elfinder-quicklook-preview-charsleft"><hr/><span>'+d.i18n("linesLeft",d.toLocaleString(n))+"</span></div>").on("click",function(){var e=i.scrollTop();st(this).remove(),i.children("pre").removeClass("prettyprinted").text(s).scrollTop(e),a.length<=h&&f(i)})),i.children("pre").text(t||s),i.on("touchstart",function(e){5<st(this)["scroll"+("ltr"===d.direction?"Right":"Left")]()&&(e.originalEvent._preventSwipeX=!0)}).appendTo(p),e.toasts&&Array.isArray(e.toasts)&&st.each(e.toasts,function(){this.msg&&d.toast(this)}),f(i))}).always(function(e){var t,n,i;(t=d.getCommand("edit"))&&(i=[],e&&e.encoding&&i.push({value:e.encoding}),i.push({value:"UTF-8"}),(n=t.getEncSelect(i)).on("change",function(){l.encoding=n.val(),d.cache(l,"change"),p.trigger({type:c.evUpdate,file:l,forceUpdate:!0})}),o=st('<div class="elfinder-quicklook-encoding"></div>').append(n),c.window.append(o)),a.remove()}))})}],(Me.prototype.commands.reload=function(){"use strict";var e=this,i=!1;this.alwaysEnabled=!0,this.updateOnSelect=!0,this.shortcuts=[{pattern:"ctrl+shift+r f5"}],this.getstate=function(){return 0},this.init=function(){this.fm.bind("search searchend",function(){i="search"==this.type})},this.fm.bind("contextmenu",function(){var t=e.fm;1e3<=t.options.sync&&(e.extra={icon:"accept",node:st("<span></span>").attr({title:t.i18n("autoSync")}).on("click touchstart",function(e){"touchstart"===e.type&&1<e.originalEvent.touches.length||(e.stopPropagation(),e.preventDefault(),st(this).parent().toggleClass("ui-state-disabled",t.options.syncStart).parent().removeClass("ui-state-hover"),t.options.syncStart=!t.options.syncStart,t.autoSync(t.options.syncStart?null:"stop"))}).on("ready",function(){st(this).parent().toggleClass("ui-state-disabled",!t.options.syncStart).css("pointer-events","auto")})})}),this.exec=function(){var e=this.fm;if(!i){var t=e.sync(),n=setTimeout(function(){e.notify({type:"reload",cnt:1,hideCnt:!0}),t.always(function(){e.notify({type:"reload",cnt:-1})})},e.notifyDelay);return t.always(function(){clearTimeout(n),e.trigger("reload")})}st("div.elfinder-toolbar > div."+e.res("class","searchbtn")+" > span.ui-icon-search").click()}}).prototype={forceLoad:!0},Me.prototype.commands.rename=function(){"use strict";this.alwaysEnabled=!0,this.syncTitleOnChange=!0;function z(n,e,i,a){var t,o=e?[i.hash].concat(e):[i.hash],r=o.length,s={};if(A.lockfiles({files:o}),A.isRoot(i)&&!i.netkey){if((t=A.storage("rootNames"))||(t={}),""===a){if(!t[i.hash])return n&&n.reject(),A.unlockfiles({files:o}).trigger("selectfiles",{files:o}),0;i.name=i._name,i.i18=i._i18,delete t[i.hash],delete i._name,delete i._i18}else void 0===i._name&&(i._name=i.name,i._i18=i.i18),i.name=t[i.hash]=a,delete i.i18;return A.storage("rootNames",t),s={changed:[i]},A.updateCache(s),A.change(s),n&&n.resolve(s),A.unlockfiles({files:o}).trigger("selectfiles",{files:o}),0}s={cmd:"rename",name:a,target:i.hash},1<r&&(s.targets=e,a.match(/\*/)&&(s.q=a)),A.request({data:s,notify:{type:"rename",cnt:r},navigate:{}}).fail(function(e){var t=A.parseError(e);n&&n.reject(),t&&Array.isArray(t)&&"errRename"===t[0]||A.sync()}).done(function(e){var t;e.added&&e.added.length&&1===r&&(e.undo={cmd:"rename",callback:function(){return A.request({data:{cmd:"rename",target:e.added[0].hash,name:i.name},notify:{type:"undo",cnt:1}})}},e.redo={cmd:"rename",callback:function(){return A.request({data:{cmd:"rename",target:i.hash,name:a},notify:{type:"rename",cnt:1}})}}),n&&n.resolve(e),(t=A.cwd().hash)&&t!==i.hash||A.exec("open",st.map(e.added,function(e){return"directory"===e.mime?e.hash:null})[0])}).always(function(){A.unlockfiles({files:o}).trigger("selectfiles",{files:o})})}function T(e,t){var n,i,a=t||A.selected(),o=A.splitFileExtention(e),r=A.file(a[0]),s=A.file(a[1]),l=o[1]?"."+o[1]:"";return o[1]&&"*"===o[0]?(n='"'+A.splitFileExtention(r.name)[0]+l+'", ',n+='"'+A.splitFileExtention(s.name)[0]+l+'"'):1<o[0].length&&("*"===o[0].substr(-1)?(n='"'+(i=o[0].substr(0,o[0].length-1))+r.name+'", ',n+='"'+i+s.name+'"'):"*"===o[0].substr(0,1)&&(i=o[0].substr(1),n='"'+A.splitFileExtention(r.name)[0]+i+l+'", ',n+='"'+A.splitFileExtention(s.name)[0]+i+l+'"')),n=n||'"'+o[0]+"1"+l+'", "'+o[0]+"2"+l+'"',2<a.length&&(n+=" ..."),n}function c(){function e(e,t){return st('<label class="elfinder-rename-batch-checks">'+A.i18n(t)+"</label>").prepend(e)}function i(){var e=n.val(),t=A.splitFileExtention(A.file(o[0]).name)[1];return""===e&&!r.is(":checked")||(s.is(":checked")?e+="*":l.is(":checked")?e="*"+e+"."+t:c.is(":checked")?e="*."+e:t&&(e+="."+t)),e}var a,o=A.selected(),t='<input name="type" type="radio" class="elfinder-tabstop">',n=st('<input type="text" class="ui-corner-all elfinder-tabstop">'),r=st(t),s=st(t),l=st(t),c=st(t),d=st("<div></div>").append(e(r,"plusNumber"),e(s,"asPrefix"),e(l,"asSuffix"),e(c,"changeExtention")),p=st('<div class="elfinder-rename-batch-preview"></div>'),u=st('<div class="elfinder-rename-batch"></div>').append(st('<div class="elfinder-rename-batch-name"></div>').append(n),st('<div class="elfinder-rename-batch-type"></div>').append(d),p),h={title:A.i18n("batchRename"),modal:!0,destroyOnClose:!0,width:Math.min(380,A.getUI().width()-20),buttons:{},open:function(){n.on("input",f).trigger("focus")}},f=function(){var e=i();""!==e?p.html(A.i18n(["renameMultiple",o.length,T(e)])):p.empty()},m=d.find("input:radio").on("change",f);h.buttons[A.i18n("btnApply")]=function(){var e,t,n=i();""!==n&&(a.elfinderdialog("close"),t=o,e=A.file(t.shift()),z(void 0,t,e,n))},h.buttons[A.i18n("btnCancel")]=function(){a.elfinderdialog("close")},st.fn.checkboxradio?m.checkboxradio({create:function(e,t){this===r.get(0)&&r.prop("checked",!0).change()}}):d.buttonset({create:function(e,t){r.prop("checked",!0).change()}}),a=g.fmDialog(u,h)}var g=this,A=g.fm;this.noChangeDirOnRemovedCwd=!0,this.shortcuts=[{pattern:"f2"+("mac"==A.OS?" enter":"")},{pattern:"shift+f2",description:"batchRename",callback:function(){1<A.selected().length&&c()}}],this.getstate=function(e){var t,n,i,a,o,r,s=this.files(e),l=s.length;return l?(1<l&&s[0].phash&&(t=s[0].phash,n=A.splitFileExtention(s[0].name)[1].toLowerCase(),i=s[0].mime),1===l&&(r=A.isRoot(s[0])),o=1===l&&(A.cookieEnabled&&r||!s[0].locked)||2.103<A.api&&l===st.grep(s,function(e){return!(a||e.locked||e.phash!==t||A.isRoot(e)||i!==e.mime&&n!==A.splitFileExtention(e.name)[1].toLowerCase())||(a=a&&!0,!1)}).length?0:-1,!r&&0===o&&A.option("disabledFlip",s[0].hash).rename&&(o=-1),-1!==o&&1<l?g.extra={icon:"preference",node:st("<span></span>").attr({title:A.i18n("batchRename")}).on("click touchstart",function(e){"touchstart"===e.type&&1<e.originalEvent.touches.length||(e.stopPropagation(),e.preventDefault(),A.getUI().trigger("click"),c())})}:delete g.extra,o):-1},this.exec=function(e,t){A.getUI("cwd");function n(){requestAnimationFrame(function(){g&&g.trigger("blur")})}function a(){w.is(":hidden")||w.elfinderoverlay("hide").off("click close",x),y.removeClass("ui-front").css("position","").off("unselect."+A.namespace,n),f?b&&b.css("max-height",""):u||y.css("width","").parent("td").css("overflow","")}function i(e){function t(){g.off(),a(),u?g.replaceWith(A.escape(n)):b.html(A.escape(n)),z(m,r,l,n)}var n=st.trim(g.val()),i=(A.splitFileExtention(n),!0);if(w.is(":hidden")||y.css("z-index",""),""===n){if(!A.isRoot(l))return x();u?g.replaceWith(A.escape(l.name)):b.html(A.escape(l.name))}if(!C&&y.length){if(g.off("blur"),1===s&&n===l.name)return m.reject();if(A.options.validName&&A.options.validName.test)try{i=A.options.validName.test(n)}catch(e){i=!1}if("."===n||".."===n||!i)return C=!0,A.error("directory"===l.mime?"errInvDirname":"errInvName",{modal:!0,close:function(){setTimeout(v,120)}}),!1;if(1===s&&A.fileByName(n,l.phash))return C=!0,A.error(["errExists",n],{modal:!0,close:function(){setTimeout(v,120)}}),!1;1===s?t():(A.confirm({title:"cmdrename",text:["renameMultiple",s,T(n,[l.hash].concat(r))],accept:{label:"btnYes",callback:t},cancel:{label:"btnCancel",callback:function(){setTimeout(function(){C=!0,v()},120)}}}),setTimeout(function(){A.trigger("unselectfiles",{files:A.selected()}).trigger("selectfiles",{files:[l.hash].concat(r)})},120))}}var o,r=e||!!A.selected().length&&A.selected()||[A.cwd().hash],s=r.length,l=A.file(r.shift()),c=".elfinder-cwd-filename",d=t||{},p=A.cwd().hash==l.hash,u="files"!==("navbar"===d._currentType||"files"===d._currentType?d._currentType:p?"navbar":"files"),h=A[u?"navHash2Elm":"cwdHash2Elm"](l.hash),f=!u&&"list"!=A.storage("view"),m=st.Deferred().fail(function(e){var t=g.parent(),n=A.escape(l.i18||l.name);g.off(),f&&(n=n.replace(/([_.])/g,"​$1")),requestAnimationFrame(function(){u?g.replaceWith(n):t.length?(g.remove(),t.html(n)):h.find(c).html(n)}),e&&A.error(e)}).always(function(){a(),A.unbind("resize",k),A.enable()}),g=st(f?"<textarea></textarea>":'<input type="text"/>').on("keyup text",function(){f?(this.style.height="1px",this.style.height=this.scrollHeight+"px"):o&&(this.style.width=o+"px",this.scrollWidth>o&&(this.style.width=this.scrollWidth+10+"px"))}).on("keydown",function(e){e.stopImmediatePropagation(),e.keyCode==st.ui.keyCode.ESCAPE?m.reject():e.keyCode==st.ui.keyCode.ENTER&&(e.preventDefault(),g.trigger("blur"))}).on("mousedown click dblclick",function(e){e.stopPropagation(),"dblclick"===e.type&&e.preventDefault()}).on("blur",i).on("dragenter dragleave dragover drop",function(e){e.stopPropagation()}),v=function(){var e=A.splitFileExtention(g.val())[0];C||!A.UA.Mobile||A.UA.iOS||(w.on("click close",x).elfinderoverlay("show"),y.css("z-index",w.css("z-index")+1)),A.enabled()||A.enable(),C&&(C=!1,g.on("blur",i)),g.trigger("focus").trigger("select"),g[0].setSelectionRange&&g[0].setSelectionRange(0,e.length)},b=u?h.contents().filter(function(){return 3==this.nodeType&&st(this).parent().attr("id")===A.navHash2Id(l.hash)}):h.find(c),y=b.parent(),w=A.getUI("overlay"),x=function(e){w.is(":hidden")||y.css("z-index",""),C||(m.reject(),e&&(e.stopPropagation(),e.preventDefault()))},k=function(){h.trigger("scrolltoview",{blink:!1})},C=!1;return y.addClass("ui-front").css("position","relative").on("unselect."+A.namespace,n),A.bind("resize",k),u?b.replaceWith(g.val(l.name)):(f?b.css("max-height","none"):u||(o=y.width(),y.width(o-15).parent("td").css("overflow","visible")),b.empty().append(g.val(l.name))),1<s&&A.api<=2.103?m.reject():l&&b.length?l.locked&&!A.isRoot(l)?m.reject(["errLocked",l.name]):(A.one("select",function(){g.parent().length&&l&&-1===st.inArray(l.hash,A.selected())&&g.trigger("blur")}),g.trigger("keyup"),v(),m):m.reject("errCmdParams",this.title)},A.bind("select contextmenucreate closecontextmenu",function(e){var t,n=(e.data?e.data.selected||e.data.targets:null)||A.selected();n&&1===n.length&&(t=A.file(n[0]))&&A.isRoot(t)?g.title=A.i18n("kindAlias")+" ("+A.i18n("preference")+")":g.title=A.i18n("cmdrename"),"closecontextmenu"!==e.type?g.update(void 0,g.title):requestAnimationFrame(function(){g.update(void 0,g.title)})}).remove(function(e){var n;e.data&&e.data.removed&&(n=A.storage("rootNames"))&&(st.each(e.data.removed,function(e,t){n[t]&&delete n[t]}),A.storage("rootNames",n))})},Me.prototype.commands.resize=function(){"use strict";var ot=this.fm,rt=0;this.updateOnSelect=!1,this.getstate=function(){var e=ot.selectedFiles();return 1==e.length&&e[0].read&&e[0].write&&-1!==e[0].mime.indexOf("image/")?0:-1},this.resizeRequest=function(e,t,n){var i=t||ot.file(e.target);i&&i.tmb;if(ot.isCommandEnabled("resize",e.target)&&(!i||i&&i.read&&i.write&&-1!==i.mime.indexOf("image/")))return ot.request({data:Object.assign(e,{cmd:"resize"}),notify:{type:"resize",cnt:1}}).fail(function(e){n&&n.reject(e)}).done(function(){e.quality&&ot.storage("jpgQuality",e.quality===ot.option("jpgQuality")?null:e.quality),n&&n.resolve()});var a=i?-1===i.mime.indexOf("image/")?["errResize",i.name,"errUsupportType"]:["errResize",i.name,"errPerm"]:["errResize",e.target,"errPerm"];return n?n.reject(a):ot.error(a),st.Deferred().reject(a)},this.exec=function(e){function t(o,e,a){function r(){z=!0}function t(){z&&(z=!1,T.trigger("change"))}function n(e){var t,n,i,a;try{t=Y[Math.round(e.offsetX)][Math.round(e.offsetY)]}catch(e){}t&&(n=t[0],i=t[1],a=t[2],t[3],t[4],t[5],Q(n,i,a,"click"===e.type))}function i(e){Q(st(this).css("backgroundColor"),"","","click"===e.type)}function c(){function e(){ne.parent().hide(),ie.hide()}var t=Math.min(de,pe)/Math.sqrt(Math.pow(re,2)+Math.pow(se,2));u=Math.ceil(re*t),h=Math.ceil(se*t),Te.width(u).height(h).css("margin-top",(pe-h)/2+"px").css("margin-left",(de-u)/2+"px"),Te.is(":visible")&&ne.is(":visible")&&("image/png"!==o.mime?(A.css("backgroundColor",ne.val()),S=st("<img>"),ot.isCORS&&S.attr("crossorigin","use-credentials"),S.on("load",function(){I&&I.width!==u&&be()}).on("error",e).attr("src",_e)):e())}function d(){Oe.updateView(re,se),c(),ke.width(xe.width()).height(xe.height()),Ce.width(xe.width()).height(xe.height()),Se.updateView(),Le()}function s(e){var t=ot.file(o.hash);t.width=e[0],t.height=e[1]}function l(){var e,t,n;we||(we=!0,ye&&ye.state&&"pending"===ye.state()&&ye.reject(),2.103<=ot.api?0===rt&&ot.request({data:{cmd:"resize",target:o.hash,degree:0,mode:"rotate"},preventDefault:!0}).done(function(e){1===(rt=e.losslessRotate?1:-1)&&J.val()%90==0&&U.children("div.elfinder-resize-quality").hide()}).fail(function(){rt=-1}):rt=-1,e=xe.get(0),(t=o.width&&o.height?{w:o.width,h:o.height}:e.naturalWidth?null:{w:xe.width(),h:xe.height()})&&xe.removeAttr("width").removeAttr("height"),re=o.width||e.naturalWidth||e.width||xe.width(),se=o.height||e.naturalHeight||e.height||xe.height(),o.width&&o.height||s([re,se]),t&&xe.width(t.w).height(t.h),f.show(),(n=se/re)<1&&A.height()>A.width()*n&&A.height(A.width()*n),A.height()>xe.height()+20&&A.height(xe.height()+20),pe=A.height()-(O.outerHeight()-O.height()),j.remove(),ae=re/se,O.append(xe.show()).show(),L.val(re),W.val(se),function(){try{I=document.createElement("canvas"),M=I.getContext("2d")}catch(e){ee.hide(),ie.hide()}}(),Be.on("click","span.elfinder-resize-preset",function(){var e=st(this),t=e.data("s")[0],n=e.data("s")[1],i=re/se;e.data("s",[n,t]).text(n+"x"+t),t<re||n<se?!(re<=t)&&(se<=n||se-n<re-t)?n=Ae(t/i):t=Ae(n*i):(t=re,n=se),L.val(t),W.val(n),Oe.updateView(t,n),Le()}),$e.on("click","span.elfinder-resize-preset",function(){var e=st(this),t=e.data("s")[0],n=e.data("s")[1],i=B.val(),a=$.val();e.data("s",[n,t]).text(n+"x"+t),t<=re&&n<=se&&(re-t-i<0&&(i=re-t),se-n-a<0&&(a=se-n),B.val(i),$.val(a),V.val(t),K.val(n),Se.updateView(),Le())}),$e.children("span.elfinder-resize-preset").each(function(){var e=st(this),t=e.data("s")[0],n=e.data("s")[1];e[t<=re&&n<=se?"show":"hide"]()}),d(),_[et]("enable"),T.find("input,select").prop("disabled",!1).filter(":text").on("keydown",function(e){var t;if(e.keyCode==st.ui.keyCode.ENTER)return e.stopPropagation(),e.preventDefault(),t={title:st("input:checked",_).val(),text:"confirmReq",accept:{label:"btnApply",callback:function(){De()}},cancel:{label:"btnCancel",callback:function(){st(this).trigger("focus")}}},Ve&&(t.buttons=[{label:"btnSaveAs",callback:function(){requestAnimationFrame(Ue)}}]),void ot.confirm(t)}).on("keyup",function(){var e=st(this);e.hasClass("elfinder-resize-bg")||requestAnimationFrame(function(){e.val(e.val().replace(/[^0-9]/g,""))})}).filter(":first"),ve(),ot.UA.Mobile||L.trigger("focus"),Me())}function p(){var e,t,n,i,a,o,r="";if("resize"==N)e=parseInt(L.val())||0,t=parseInt(W.val())||0;else if("crop"==N)e=parseInt(V.val())||0,t=parseInt(K.val())||0,n=parseInt(B.val())||0,i=parseInt($.val())||0;else if("rotate"==N){if(e=re,t=se,(a=parseInt(J.val())||0)<0||360<a)return ot.error("Invalid rotate degree"),!1;if(0==a||360==a)return ot.error("errResizeNoChange"),!1;r=ne.val()}if(o=X?parseInt(X.val()):0,"rotate"!=N){if(e<=0||t<=0)return ot.error("Invalid image size"),!1;if(e==re&&t==se&&parseInt(Ke/1e3)===parseInt(Xe/1e3))return ot.error("errResizeNoChange"),!1}return{w:e,h:t,x:n,y:i,d:a,q:o,b:r}}var S,I,M,u,h,f,m,g,v,b="image/jpeg"===o.mime,y=st('<div class="elfinder-resize-container"></div>'),w='<input type="number" class="ui-corner-all"/>',x='<div class="elfinder-resize-row"></div>',k='<div class="elfinder-resize-label"></div>',C=null,z=!1,T=st('<div class="elfinder-resize-control"></div>').on("focus","input[type=text],input[type=number]",function(){st(this).trigger("select")}).on("change",function(){C&&cancelAnimationFrame(C),C=requestAnimationFrame(function(){var e,t,n,i,a,o,r,s,l,c,d,p,u,h,f,m,g,v,b;Ne&&!z&&(n=Ne.data("canvas"))&&(e=T.children("div.elfinder-resize-control-panel:visible"),(t=e.find("input.elfinder-resize-quality")).is(":visible")&&(i=Ne.data("ctx"),a=Ne.get(0),e.hasClass("elfinder-resize-uiresize")?(s=n.width=L.val(),l=n.height=W.val(),i.drawImage(a,0,0,s,l)):e.hasClass("elfinder-resize-uicrop")?(o=B.val(),r=$.val(),s=V.val(),l=K.val(),n.width=s,n.height=l,i.drawImage(a,o,r,s,l,0,0,s,l)):(c=J.val(),d=J.val()*Math.PI/180,f=d,m=[{x:(u=re)/2,y:(h=se)/2},{x:-u/2,y:h/2},{x:-u/2,y:-h/2},{x:u/2,y:-h/2}],g=[],v={x:Number.MAX_VALUE,y:Number.MAX_VALUE},b={x:Number.MIN_VALUE,y:Number.MIN_VALUE},st.each(m,function(e,t){g.push({x:t.x*Math.cos(f)-t.y*Math.sin(f),y:t.x*Math.sin(f)+t.y*Math.cos(f)})}),st.each(g,function(e,t){v.x=Math.min(v.x,t.x),v.y=Math.min(v.y,t.y),b.x=Math.max(b.x,t.x),b.y=Math.max(b.y,t.y)}),p={width:b.x-v.x,height:b.y-v.y},s=n.width=p.width,l=n.height=p.height,i.save(),c%90!=0&&(i.fillStyle=ne.val()||"#FFF",i.fillRect(0,0,s,l)),i.translate(s/2,l/2),i.rotate(d),i.drawImage(a,-a.width/2,-a.height/2,re,se),i.restore()),n.toBlob(function(e){e&&(Xe=e.size,t.next("span").text(" ("+ot.formatSize(e.size)+")"))},"image/jpeg",Math.max(Math.min(t.val(),100),1)/100)))})}).on("mouseup","input",function(e){st(e.target).trigger("change")}),A=st('<div class="elfinder-resize-preview"></div>').on("touchmove",function(e){st(e.target).hasClass("touch-punch")&&(e.stopPropagation(),e.preventDefault())}),j=st('<div class="elfinder-resize-loading">'+ot.i18n("ntfloadimg")+"</div>"),O=st('<div class="elfinder-resize-handle touch-punch"></div>'),E=st('<div class="elfinder-resize-handle touch-punch"></div>'),F=st('<div class="elfinder-resize-uiresize elfinder-resize-control-panel"></div>'),D=st('<div class="elfinder-resize-uicrop elfinder-resize-control-panel"></div>'),U=st('<div class="elfinder-resize-rotate elfinder-resize-control-panel"></div>'),P=st("<button></button>").attr("title",ot.i18n("rotate-cw")).append(st('<span class="elfinder-button-icon elfinder-button-icon-rotate-l"></span>')),q=st("<button></button>").attr("title",ot.i18n("rotate-ccw")).append(st('<span class="elfinder-button-icon elfinder-button-icon-rotate-r"></span>')),R=st("<span ></span>"),H=st('<button class="elfinder-resize-reset">').text(ot.i18n("reset")).on("click",function(){je()}).button({icons:{primary:"ui-icon-arrowrefresh-1-n"},text:!1}),_=st('<div class="elfinder-resize-type"></div>').append('<input type="radio" name="type" id="'+e+'-resize" value="resize" checked="checked" /><label for="'+e+'-resize">'+ot.i18n("resize")+"</label>",'<input class="api2" type="radio" name="type" id="'+e+'-crop" value="crop" /><label class="api2" for="'+e+'-crop">'+ot.i18n("crop")+"</label>",'<input class="api2" type="radio" name="type" id="'+e+'-rotate" value="rotate" /><label class="api2" for="'+e+'-rotate">'+ot.i18n("rotate")+"</label>"),N="resize",L=(_[et]()[et]("disable").find("input").on("change",function(){N=st(this).val(),je(),Me(!0),Ee(!0),Fe(!0),"resize"==N?(F.show(),U.hide(),D.hide(),Me(),b&&ge.insertAfter(F.find(".elfinder-resize-grid8"))):"crop"==N?(U.hide(),F.hide(),D.show(),Ee(),b&&ge.insertAfter(D.find(".elfinder-resize-grid8"))):"rotate"==N&&(F.hide(),D.hide(),U.show(),Fe())}),st(w).on("change",function(){var e=Ae(parseInt(L.val())),t=Ae(le?e/ae:parseInt(W.val()));0<e&&0<t&&(Oe.updateView(e,t),L.val(e),W.val(t))}).addClass("elfinder-focus")),W=st(w).on("change",function(){var e=Ae(parseInt(W.val())),t=Ae(le?e*ae:parseInt(L.val()));0<t&&0<e&&(Oe.updateView(t,e),L.val(t),W.val(e))}),B=st(w).on("change",function(){Se.updateView()}),$=st(w).on("change",function(){Se.updateView()}),V=st(w).on("change",function(){Se.updateView("w")}),K=st(w).on("change",function(){Se.updateView("h")}),X=b&&Ye?st(w).val(0<ot.storage("jpgQuality")?ot.storage("jpgQuality"):ot.option("jpgQuality")).addClass("elfinder-resize-quality").attr("min","1").attr("max","100").attr("title","1 - 100").on("blur",function(){var e=Math.min(100,Math.max(1,parseInt(this.value)));T.find("input.elfinder-resize-quality").val(e)}):null,J=st('<input type="number" class="ui-corner-all" maxlength="3" value="0" />').on("change",function(){Ie.update()}),G=st('<div class="elfinder-resize-rotate-slider touch-punch"></div>').slider({min:0,max:360,value:J.val(),animate:!0,start:r,stop:t,change:function(e,t){t.value!=G.slider("value")&&Ie.update(t.value)},slide:function(e,t){Ie.update(t.value,!1)}}).find(".ui-slider-handle").addClass("elfinder-tabstop").off("keydown").on("keydown",function(e){e.keyCode!=st.ui.keyCode.LEFT&&e.keyCode!=st.ui.keyCode.RIGHT||(e.stopPropagation(),e.preventDefault(),Ie.update(Number(J.val())+(e.keyCode==st.ui.keyCode.RIGHT?1:-1),!1))}).end(),Y={},Q=function(e,t,n,i){var a,o,r;"string"==typeof e&&(t="",e&&(a=st("<span>").css("backgroundColor",e).css("backgroundColor"))&&(o=a.match(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i))&&(e=Number(o[1]),t=Number(o[2]),n=Number(o[3]))),r=""===t?e:"#"+Z(e,t,n),ne.val(r).css({backgroundColor:r,backgroundImage:"none",color:e+t+n<384?"#fff":"#000"}),A.css("backgroundColor",r),i&&(Te.off(".picker").removeClass("elfinder-resize-picking"),ie.off(".picker").removeClass("elfinder-resize-picking"))},Z=function(e,t,n){return st.map([e,t,n],function(e){return("0"+parseInt(e).toString(16)).slice(-2)}).join("")},ee=st("<button>").text(ot.i18n("colorPicker")).on("click",function(){Te.on("mousemove.picker click.picker",n).addClass("elfinder-resize-picking"),ie.on("mousemove.picker click.picker","span",i).addClass("elfinder-resize-picking")}).button({icons:{primary:"ui-icon-pin-s"},text:!1}),te=st("<button>").text(ot.i18n("reset")).on("click",function(){Q("","","",!0)}).button({icons:{primary:"ui-icon-arrowrefresh-1-n"},text:!1}),ne=st('<input class="ui-corner-all elfinder-resize-bg" type="text">').on("focus",function(){st(this).attr("style","")}).on("blur",function(){Q(st(this).val())}),ie=st('<div class="elfinder-resize-pallet">').on("click","span",function(){Q(st(this).css("backgroundColor"))}),ae=1,oe=1,re=0,se=0,le=!0,ce=!1,de=0,pe=0,ue=0,he=b&&tt,fe=st("<button>").html(ot.i18n("aspectRatio")).on("click",function(){le=!le,fe.button("option",{icons:{primary:le?"ui-icon-locked":"ui-icon-unlocked"}}),Oe.fixHeight(),O.resizable("option","aspectRatio",le).data("uiResizable")._aspectRatio=le}).button({icons:{primary:le?"ui-icon-locked":"ui-icon-unlocked"},text:!1}),me=st("<button>").html(ot.i18n("aspectRatio")).on("click",function(){ce=!ce,me.button("option",{icons:{primary:ce?"ui-icon-locked":"ui-icon-unlocked"}}),E.resizable("option","aspectRatio",ce).data("uiResizable")._aspectRatio=ce}).button({icons:{primary:ce?"ui-icon-locked":"ui-icon-unlocked"},text:!1}),ge=st("<button>").html(ot.i18n(he?"enabled":"disabled")).toggleClass("ui-state-active",he).on("click",function(){he=!he,ge.html(ot.i18n(he?"enabled":"disabled")).toggleClass("ui-state-active",he),ve()}).button(),ve=function(){var e=he?8:1;st.each([L,W,V,K,B,$],function(){this.attr("step",e)}),he&&(L.val(Ae(L.val())),W.val(Ae(W.val())),V.val(Ae(V.val())),K.val(Ae(K.val())),B.val(Ae(B.val())),$.val(Ae($.val())),F.is(":visible")?Oe.updateView(L.val(),W.val()):D.is(":visible")&&Se.updateView())},be=function(){if(M){var e,t,n,i,a,o,r,s,l,c,d,p,u,h,f,m,g,v,b={},y=[],w=function(e){return 8*Math.round(e/8)};e:try{t=I.width=Te.width(),n=I.height=Te.height(),p=t/re,M.scale(p,p),M.drawImage(S.get(0),0,0),d=M.getImageData(0,0,t,n).data,u=.1*t,h=.9*t,f=.1*n,m=.9*n;for(var x=0;x<n-1;x++)for(var k=0;k<t-1;k++){if(i=d[e=4*k+x*t*4],a=d[1+e],o=d[2+e],255!==d[3+e]){ne.parent().hide(),ie.hide();break e}C=i,z=a,T=o,O=j=A=void 0,j=Math.max(Math.max(C,z),T),O=Math.min(Math.min(C,z),T),j===O?A=0:C===j?A=((z-T)/(j-O)*60+360)%360:z===j?A=(T-C)/(j-O)*60+120:T===j&&(A=(C-z)/(j-O)*60+240),l=[A,(j-O)/j,(.3*C+.59*z+.11*T)/255,"hsl"],c=Math.round(l[0]),r=Math.round(100*l[1]),s=Math.round(100*l[2]),Y[k]||(Y[k]={}),Y[k][x]=[i,a,o,c,r,s],(k<u||h<k)&&(x<f||m<x)&&(b[g=w(i)+","+w(a)+","+w(o)]?++b[g]:b[g]=1)}ie.children(":first").length||(v=1,st.each(b,function(e,t){y.push({c:e,v:t})}),st.each(y.sort(function(e,t){return e.v>t.v?-1:1}),function(){return!(this.v<2||10<v)&&(ie.append(st('<span style="width:20px;height:20px;display:inline-block;background-color:rgb('+this.c+');">')),void++v)}))}catch(e){ee.hide(),ie.hide()}}var C,z,T,A,j,O},ye=null,we=!1,xe=st("<img/>").on("load",l).on("error",function(){j.html(ot.i18n("ntfsmth")).css("background","transparent")}),ke=st("<div></div>"),Ce=st("<img/>"),ze=st("<div></div>"),Te=st('<img class="elfinder-resize-imgrotate" />'),Ae=function(e,t){return e=he?8*Math.round(e/8):Math.round(e),e=Math.max(0,e),t&&t<e&&(e=he?8*Math.floor(t/8):t),e},je=function(){L.val(re),W.val(se),Oe.updateView(re,se),B.val(0),$.val(0),V.val(re),K.val(se),Se.updateView(),Le()},Oe={update:function(){L.val(Ae(xe.width()/oe)),W.val(Ae(xe.height()/oe)),Le()},updateView:function(e,t){de<e||pe<t?t/pe<e/de?(oe=de/e,xe.width(de).height(Ae(t*oe))):(oe=pe/t,xe.height(pe).width(Ae(e*oe))):xe.width(Ae(e)).height(Ae(t)),oe=xe.width()/e,R.text("1 : "+(1/oe).toFixed(2)),Oe.updateHandle()},updateHandle:function(){O.width(xe.width()).height(xe.height())},fixHeight:function(){var e,t;le&&(e=L.val(),t=Ae(e/ae),Oe.updateView(e,t),W.val(t))}},Se={update:function(e){B.val(Ae((E.data("x")||E.position().left)/oe,re)),$.val(Ae((E.data("y")||E.position().top)/oe,se)),"xy"!==e&&(V.val(Ae((E.data("w")||E.width())/oe,re-B.val())),K.val(Ae((E.data("h")||E.height())/oe,se-$.val()))),Le()},updateView:function(e){var t,n,i,a,o;B.val(Ae(B.val(),re-(he?8:1))),$.val(Ae($.val(),se-(he?8:1))),V.val(Ae(V.val(),re-B.val())),K.val(Ae(K.val(),se-$.val())),ce&&(t=ze.width()/ze.height(),"w"===e?K.val(Ae(parseInt(V.val())/t)):"h"===e&&V.val(Ae(parseInt(K.val())*t))),n=Math.round(parseInt(B.val())*oe),i=Math.round(parseInt($.val())*oe),o="xy"!==e?(a=Math.round(parseInt(V.val())*oe),Math.round(parseInt(K.val())*oe)):(a=E.data("w"),E.data("h")),E.data({x:n,y:i,w:a,h:o}).width(a).height(o).css({left:n,top:i}),ze.width(a).height(o)},resize_update:function(e,t){E.data({x:t.position.left,y:t.position.top,w:t.size.width,h:t.size.height}),Se.update(),Se.updateView()},drag_update:function(e,t){E.data({x:t.position.left,y:t.position.top}),Se.update("xy")}},Ie={mouseStartAngle:0,imageStartAngle:0,imageBeingRotated:!1,setQuality:function(){U.children("div.elfinder-resize-quality")[0<rt&&J.val()%90==0?"hide":"show"]()},update:function(e,t){void 0===e&&(ue=e=parseInt(J.val())),void 0===t&&(t=!0),!t||ot.UA.Opera||ot.UA.ltIE8?Te.rotate(e):Te.animate({rotate:e+"deg"}),(e%=360)<0&&(e+=360),J.val(parseInt(e)),G.slider("value",J.val()),Ie.setQuality()},execute:function(e){if(Ie.imageBeingRotated){var t=Ie.getCenter(Te),n=e.originalEvent.touches?e.originalEvent.touches[0]:e,i=n.pageX-t[0],a=n.pageY-t[1],o=Math.atan2(a,i)-Ie.mouseStartAngle+Ie.imageStartAngle,o=Math.round(180*parseFloat(o)/Math.PI);return e.shiftKey&&(o=15*Math.round((o+6)/15)),Te.rotate(o),(o%=360)<0&&(o+=360),J.val(o),G.slider("value",J.val()),Ie.setQuality(),!1}},start:function(e){if(!Te.hasClass("elfinder-resize-picking")){r(),Ie.imageBeingRotated=!0;var t=Ie.getCenter(Te),n=e.originalEvent.touches?e.originalEvent.touches[0]:e,i=n.pageX-t[0],a=n.pageY-t[1];return Ie.mouseStartAngle=Math.atan2(a,i),Ie.imageStartAngle=parseFloat(Te.rotate())*Math.PI/180,st(document).on("mousemove",Ie.execute),Te.on("touchmove",Ie.execute),!1}},stop:function(e){if(Ie.imageBeingRotated)return st(document).off("mousemove",Ie.execute),Te.off("touchmove",Ie.execute),requestAnimationFrame(function(){Ie.imageBeingRotated=!1}),t(),!1},getCenter:function(e){var t=Te.rotate();Te.rotate(0);var n=Te.offset(),i=n.left+Te.width()/2,a=n.top+Te.height()/2;return Te.rotate(t),Array(i,a)}},Me=function(e){e?(O.filter(":ui-resizable").resizable("destroy"),O.hide()):(O.show(),O.resizable({alsoResize:xe,aspectRatio:le,resize:Oe.update,start:r,stop:function(e){Oe.fixHeight,Oe.updateView(L.val(),W.val()),t()}}),We())},Ee=function(e){e?(E.filter(":ui-resizable").resizable("destroy").filter(":ui-draggable").draggable("destroy"),ke.hide()):(ke.show(),E.resizable({containment:ke,aspectRatio:ce,resize:Se.resize_update,start:r,stop:t,handles:"all"}).draggable({handle:ze,containment:Ce,drag:Se.drag_update,start:r,stop:function(){Se.updateView("xy"),t()}}),We(),Se.update())},Fe=function(e){e?Te.hide():(Te.show(),We())},De=function(){var e;(e=p())&&(y.elfinderdialog("close"),Je.resizeRequest({target:o.hash,width:e.w,height:e.h,x:e.x,y:e.y,degree:e.d,quality:e.q,bg:e.b,mode:N},o,Ge))},Ue=function(){function i(){a.addClass(at).fadeIn(function(){m.addClass(it)}),ot.disable()}function e(){Je.mime=o.mime,Je.prefix=o.name.replace(/ \d+(\.[^.]+)?$/,"$1"),Je.requestCmd="mkfile",Je.nextAction={},Je.data={target:o.phash},st.proxy(ot.res("mixin","make"),Je)().done(function(e){var t,n;e.added&&e.added.length?(t=e.added[0].hash,n=ot.api<2.1032?ot.url(o.hash,{async:!0,temporary:!0}):null,st.when(n).done(function(e){ot.request({options:{type:"post"},data:{cmd:"put",target:t,encoding:n?"scheme":"hash",content:n?ot.convAbsUrl(e):o.hash},notify:{type:"copy",cnt:1},syncOnFail:!0}).fail(i).done(function(e){e=ot.normalize(e),ot.updateCache(e),o=ot.file(t),e.changed&&e.changed.length&&ot.change(e),m.show().find(".elfinder-dialog-title").html(ot.escape(o.name)),De(),a.fadeIn()})}).fail(i)):i()}).fail(i).always(function(){delete Je.mime,delete Je.prefix,delete Je.nextAction,delete Je.data}),ot.trigger("unselectfiles",{files:[o.hash]})}var a,t=null;p()&&(a=Ze.children("."+Je.dialogClass+":visible").removeClass(at).fadeOut(),m.removeClass(it),ot.enable(),ot.searchStatus.state<2&&o.phash!==ot.cwd().hash&&(t=ot.exec("open",[o.phash],{thash:o.phash})),st.when([t]).done(function(){t?ot.one("cwdrender",e):e()}).fail(i))},Pe={},qe="elfinder-resize-handle-hline",Re="elfinder-resize-handle-vline",He="elfinder-resize-handle-point",_e=a,Ne=X?st("<img>").attr("crossorigin",ot.isCORS?"use-credentials":"").attr("src",_e).on("load",function(){try{var e=document.createElement("canvas");Ne.data("canvas",e).data("ctx",e.getContext("2d")),Le()}catch(e){Ne.removeData("canvas").removeData("ctx")}}):null,Le=function(){T.find("input.elfinder-resize-quality:visible").trigger("change")},We=function(e){var t,n,i,a,o,r,s,l;m.hasClass("elfinder-dialog-minimized")||m.is(":hidden")||(Be.hide(),$e.hide(),n=(t=ot.options.dialogContained?Ze:st(window)).height(),i=t.width(),a="auto",o=!0,m.width(Math.min(650,i-30)),A.attr("style",""),re&&se&&(de=A.width()-(O.outerWidth()-O.width()),pe=A.height()-(O.outerHeight()-O.height()),Oe.updateView(re,se)),s=y.find("div.elfinder-resize-control").width(),l=A.width(),(r=y.width()-20)<l?(A.width(r),o=!1):r-l<s&&(n<i?A.width(r-s-20):(A.css({float:"none",marginLeft:"auto",marginRight:"auto"}),o=!1)),o&&(a=s),de=A.width()-(O.outerWidth()-O.width()),Ze.hasClass("elfinder-fullscreen")?m.height()>n&&(n-=2,A.height(n-m.height()+A.height()),m.css("top",0-Ze.offset().top)):(n-=30,A.height()>n&&A.height(n)),pe=A.height()-(O.outerHeight()-O.height()),re&&se&&d(),xe.height()&&A.height()>xe.height()+20&&(A.height(xe.height()+20),pe=A.height()-(O.outerHeight()-O.height()),c()),Be.css("width",a).show(),$e.css("width",a).show(),$e.children("span.elfinder-resize-preset:visible").length||$e.hide(),y.elfinderdialog("posInit"))},Be=(v=st('<fieldset class="elfinder-resize-preset-container">').append(st("<legend>").html(ot.i18n("presets"))).css("box-sizing","border-box").hide(),st.each(nt,function(e,t){2===t.length&&(g=!0,v.append(st('<span class="elfinder-resize-preset"></span>').data("s",t).text(t[0]+"x"+t[1]).button()))}),g?v:st()),$e=Be.clone(!0),Ve=ot.uploadMimeCheck(o.mime,o.phash);Ke=Xe=o.size,F.append(st(x).append(st(k).text(ot.i18n("width")),L),st(x).append(st(k).text(ot.i18n("height")),W,st('<div class="elfinder-resize-whctrls">').append(fe,H)),X?st(x).append(st(k).text(ot.i18n("quality")),X,st("<span></span>")):st(),b?st(x).append(st(k).text(ot.i18n("8pxgrid")).addClass("elfinder-resize-grid8"),ge):st(),st(x).append(st(k).text(ot.i18n("scale")),R),st(x).append(Be)),Ye&&(D.append(st(x).append(st(k).text("X"),B),st(x).append(st(k).text("Y")).append($),st(x).append(st(k).text(ot.i18n("width")),V),st(x).append(st(k).text(ot.i18n("height")),K,st('<div class="elfinder-resize-whctrls">').append(me,H.clone(!0))),X?st(x).append(st(k).text(ot.i18n("quality")),X.clone(!0),st("<span></span>")):st(),b?st(x).append(st(k).text(ot.i18n("8pxgrid")).addClass("elfinder-resize-grid8")):st(),st(x).append($e)),U.append(st(x).addClass("elfinder-resize-degree").append(st(k).text(ot.i18n("rotate")),J,st("<span></span>").text(ot.i18n("degree")),st("<div></div>").append(P,q)[et]()),st(x).css("height","20px").append(G),X?st(x)[rt<1?"show":"hide"]().addClass("elfinder-resize-quality").append(st(k).text(ot.i18n("quality")),X.clone(!0),st("<span></span>")):st(),st(x).append(st(k).text(ot.i18n("bgcolor")),ne,ee,te),st(x).css("height","20px").append(ie)),P.on("click",function(){ue-=90,Ie.update(ue)}),q.on("click",function(){ue+=90,Ie.update(ue)})),y.append(_).on("resize",function(e){e.stopPropagation()}),Ye?T.append(F,D.hide(),U.hide()):T.append(F),O.append('<div class="'+qe+" "+qe+'-top"></div>','<div class="'+qe+" "+qe+'-bottom"></div>','<div class="'+Re+" "+Re+'-left"></div>','<div class="'+Re+" "+Re+'-right"></div>','<div class="'+He+" "+He+'-e"></div>','<div class="'+He+" "+He+'-se"></div>','<div class="'+He+" "+He+'-s"></div>'),A.append(j).append(O.hide()).append(xe.hide()),Ye&&(E.css("position","absolute").append('<div class="'+qe+" "+qe+'-top"></div>','<div class="'+qe+" "+qe+'-bottom"></div>','<div class="'+Re+" "+Re+'-left"></div>','<div class="'+Re+" "+Re+'-right"></div>','<div class="'+He+" "+He+'-n"></div>','<div class="'+He+" "+He+'-e"></div>','<div class="'+He+" "+He+'-s"></div>','<div class="'+He+" "+He+'-w"></div>','<div class="'+He+" "+He+'-ne"></div>','<div class="'+He+" "+He+'-se"></div>','<div class="'+He+" "+He+'-sw"></div>','<div class="'+He+" "+He+'-nw"></div>'),A.append(ke.css("position","absolute").hide().append(Ce,E.append(ze))),A.append(Te.hide())),A.css("overflow","hidden"),y.append(A,T),Pe[ot.i18n("btnApply")]=De,Ve&&(Pe[ot.i18n("btnSaveAs")]=function(){requestAnimationFrame(Ue)}),Pe[ot.i18n("btnCancel")]=function(){y.elfinderdialog("close")},y.find("input,button").addClass("elfinder-tabstop"),m=Je.fmDialog(y,{title:ot.escape(o.name),width:650,resizable:!1,buttons:Pe,open:function(){function e(e){ye=ot.request({data:{cmd:"dim",target:o.hash,substitute:t?400:""},preventDefault:!0}).done(function(e){if(!e.url&&n)y.elfinderdialog("close"),ot.error(["errOpen",o.name]);else if(e.dim){var t=e.dim.split("x");return o.width=t[0],o.height=t[1],s(t),e.url&&(xe.attr("src",e.url),Ce.attr("src",e.url),Te.attr("src",e.url)),l()}})}var n=!{"image/jpeg":!0,"image/png":!0,"image/gif":!0}[o.mime],t=!(!ot.option("substituteImg",o.hash)||!(n||o.size>Qe.dimSubImgSize)),i=!(!o.width||!o.height);if(f=m.find(".ui-dialog-titlebar .elfinder-titlebar-minimize").hide(),ot.bind("resize",We),xe.attr("src",a).one("error.dimreq",function(){e()}),Ce.attr("src",a),Te.attr("src",a),Ye&&(Te.on("mousedown touchstart",Ie.start).on("touchend",Ie.stop),m.on("mouseup",Ie.stop)),i&&!t)return l();if(o.size>(Qe.getDimThreshold||0))xe.off("error.dimreq"),e();else if(i)return l()},close:function(){Ye&&(Te.off("mousedown touchstart",Ie.start).off("touchend",Ie.stop),st(document).off("mouseup",Ie.stop)),ot.unbind("resize",We),st(this).elfinderdialog("destroy")},resize:function(e,t){t&&"off"===t.minimize&&We()}}).attr("id",e).closest(".ui-dialog").addClass(at),ot.UA.ltIE8&&st(".elfinder-dialog").css("filter",""),ze.css({opacity:.2,"background-color":"#fff",position:"absolute"}),E.css("cursor","move"),E.find(".elfinder-resize-handle-point").css({"background-color":"#fff",opacity:.5,"border-color":"#000"}),Ye||_.find(".api2").remove(),T.find("input,select").prop("disabled",!0),T.find("input.elfinder-resize-quality").next("span").addClass("elfinder-resize-jpgsize").attr("title",ot.i18n("roughFileSize"))}var n,i,Ke,Xe,Je=this,a=this.files(e),Ge=st.Deferred(),Ye=1<ot.api,Qe=this.options,Ze=ot.getUI(),et=st().controlgroup?"controlgroup":"buttonset",tt=void 0===Qe.grid8px||"disable"!==Qe.grid8px,nt=Array.isArray(Qe.presetSize)?Qe.presetSize:[],it="elfinder-dialog-active",at=ot.res("class","editing");return a.length&&-1!==a[0].mime.indexOf("image/")?(n="resize-"+ot.namespace+"-"+a[0].hash,(i=Ze.find("#"+n)).length?(i.elfinderdialog("toTop"),Ge.resolve()):(ot.openUrl(a[0].hash,"sameorigin",function(e){t(a[0],n,e)}),Ge)):Ge.reject()}},(w=jQuery).cssHooks.rotate={get:function(e,t,n){return w(e).rotate()},set:function(e,t){return w(e).rotate(t),t}},w.cssHooks.transform={get:function(e,t,n){var i=z(e.style,["WebkitTransform","MozTransform","OTransform","msTransform","transform"]);return e.style[i]},set:function(e,t){var n=z(e.style,["WebkitTransform","MozTransform","OTransform","msTransform","transform"]);return e.style[n]=t}},w.fn.rotate=function(e){var t;return void 0===e?window.opera?(t=this.css("transform").match(/rotate\((.*?)\)/))&&t[1]?Math.round(180*parseFloat(t[1])/Math.PI):0:(t=this.css("transform").match(/rotate\((.*?)\)/))&&t[1]?parseInt(t[1]):0:(this.css("transform",this.css("transform").replace(/none|rotate\(.*?\)/,"")+"rotate("+parseInt(e)+"deg)"),this)},w.fx.step.rotate=function(e){0==e.state&&(e.start=w(e.elem).rotate(),e.now=e.start),w(e.elem).rotate(e.now)},void 0===window.addEventListener&&void 0===document.getElementsByClassName&&(x=function(e){var t;"static"==e.currentStyle.position&&(t=function(e){for(var t=e,n=t.offsetLeft,i=t.offsetTop;t.offsetParent&&((t=t.offsetParent)==document.body||"static"==t.currentStyle.position);)t!=document.body&&t!=document.documentElement&&(n-=t.scrollLeft,i-=t.scrollTop),n+=t.offsetLeft,i+=t.offsetTop;return{x:n,y:i}}(e),e.style.position="absolute",e.style.left=t.x+"px",e.style.top=t.y+"px")},k=w.cssHooks.transform.set,w.cssHooks.transform.set=function(e,t){return k.apply(this,[e,t]),function(e,t){var n,i=1,a=1,o=1,r=1;if(void 0!==e.style.msTransform)return;x(e);var s=(n=t.match(/rotate\((.*?)\)/))&&n[1]?parseInt(n[1]):0;(s%=360)<0&&(s=360+s);var l=s*Math.PI/180,c=Math.cos(l),d=Math.sin(l);i*=c,a*=-d,o*=d,r*=c,e.style.filter=(e.style.filter||"").replace(/progid:DXImageTransform\.Microsoft\.Matrix\([^)]*\)/,"")+"progid:DXImageTransform.Microsoft.Matrix(M11="+i+",M12="+a+",M21="+o+",M22="+r+",FilterType='bilinear',sizingMethod='auto expand')";var p=parseInt(e.style.width||e.width||0),u=parseInt(e.style.height||e.height||0),l=s*Math.PI/180,h=Math.abs(Math.cos(l)),f=Math.abs(Math.sin(l)),m=(p-(p*h+u*f))/2,g=(u-(p*f+u*h))/2;e.style.marginLeft=Math.floor(m)+"px",e.style.marginTop=Math.floor(g)+"px"}(e,t),t}),(Me.prototype.commands.restore=function(){"use strict";var a=this,u=this.fm,h=0,f=function(e){var t,i=st.Deferred(),n=[],a=[],o=[],r=[];return i._xhrReject=function(){st.each(o,function(){this&&this.reject&&this.reject()}),t&&t._xhrReject()},st.each(e,function(e,t){"directory"===t.mime?n.push(t):a.push(t)}),n.length?(st.each(n,function(e,t){o.push(u.request({data:{cmd:"open",target:t.hash},preventDefault:!0,asNotOpen:!0})),r[e]=t.hash}),st.when.apply(st,o).fail(function(){i.reject()}).done(function(){var n=[];st.each(arguments,function(e,t){t.files&&(t.files.length?n=n.concat(t.files):n.push({hash:"fakefile_"+h++,phash:r[e],mime:"fakefile",name:"fakefile",ts:0}))}),u.cache(n),t=f(n).done(function(e){a=a.concat(e),i.resolve(a)})})):i.resolve(a),i};this.restore=function(s,e,i,t){var n,a,o,l={},c=[],d=!1,p=t||{},r=+new Date;u.lockfiles({files:i}),n=st.map(e,function(e){return"directory"===e.mime?e.hash:null}),s.done(function(){n&&u.exec("rm",n,{forceRm:!0,quiet:!0})}).always(function(){u.unlockfiles({files:i})}),a=setTimeout(function(){u.notify({type:"search",id:r,cnt:1,hideCnt:!0,cancel:function(){o&&o._xhrReject(),s.reject()}})},u.notifyDelay),h=0,o=f(e).always(function(){a&&clearTimeout(a),u.notify({type:"search",id:r,cnt:-1,hideCnt:!0})}).fail(function(){s.reject("errRestore","errFileNotFound")}).done(function(e){var o=["errRestore","errFolderNotFound"],r="";e.length?(st.each(e,function(e,i){for(var t,n,a,o=i.phash;o;){if(n=u.trashes[o]){if(!l[n]){if(d)return c.push(i.hash),null;l[n]={},d=!0}""===(a=(a=u.path(i.hash).substr(u.path(o).length).replace(/\\/g,"/")).replace(/\/[^\/]+?$/,""))&&(a="/"),l[n][a]||(l[n][a]=[]),"fakefile"===i.mime?u.updateCache({removed:[i.hash]}):l[n][a].push(i.hash),(!r||r.length>a.length)&&(r=a);break}(t=u.file(o))?o=t.phash:(o=!1,st.each(u.trashes,function(e){var t=u.file(e),n=u.path(e);if((!t.volumeid||0===i.hash.indexOf(t.volumeid))&&0===u.path(i.hash).indexOf(n))return o=e,!1}))}}),d?st.each(l,function(e,t){var n=Object.keys(t),a=n.length;u.request({data:{cmd:"mkdir",target:e,dirs:n},notify:{type:"chkdir",cnt:a},preventFail:!0}).fail(function(e){s.reject(e),u.unlockfiles({files:i})}).done(function(e){var i;(i=e.hashes)?u.getCommand("paste")?u.one("mkdirdone",function(){var n=!1;st.each(t,function(e,t){i[e]&&(t.length?u.file(i[e])?(u.clipboard(t,!0),u.exec("paste",[i[e]],{_cmd:"restore",noToast:p.noToast||e!==r}).done(function(e){e&&(e.error||e.warning)&&(n=!0)}).fail(function(){n=!0}).always(function(){--a<1&&(s[n?"reject":"resolve"](),c.length&&u.exec("restore",c))})):s.reject(o):--a<1&&(s.resolve(),c.length&&u.exec("restore",c)))})}):s.reject(["errRestore","errCmdNoSupport","(paste)"]):s.reject(o)})}):s.reject(o)):(s.reject("errFileNotFound"),n&&u.exec("rm",n,{forceRm:!0,quiet:!0}))})},this.linkedCmds=["copy","paste","mkdir","rm"],this.updateOnSelect=!1,this.init=function(){u=(a=this).fm},this.getstate=function(e,t){return(e=e||u.selected()).length&&st.grep(e,function(e){var t=u.file(e);return!(!t||t.locked||u.isRoot(t))}).length==e.length?0:-1},this.exec=function(e,t){var n=st.Deferred().fail(function(e){e&&u.error(e)}),i=a.files(e);return i.length?(st.each(i,function(e,t){return u.isRoot(t)?!n.reject(["errRestore",t.name]):t.locked?!n.reject(["errLocked",t.name]):void 0}),"pending"===n.state()&&this.restore(n,i,e,t),n):n.reject()}}).prototype={forceLoad:!0},Me.prototype.commands.rm=function(){"use strict";function p(e){var t,n=null;return e&&e.length&&(1<e.length&&2===g.searchStatus.state?(t=g.file(g.root(e[0])).volumeid,st.grep(e,function(e){return 0!==e.indexOf(t)}).length||(n=g.option("trashHash",e[0]))):n=g.option("trashHash",e[0])),n}var m=this,g=this.fm,v='<div class="ui-helper-clearfix elfinder-rm-title"><span class="elfinder-cwd-icon {class} ui-corner-all"></span>{title}<div class="elfinder-rm-desc">{desc}</div></div>',b=function(t,e,n){var i=n?{}:{type:"rm",cnt:e.length};g.request({data:{cmd:"rm",targets:e},notify:i,preventFail:!0}).fail(function(e){t.reject(e)}).done(function(e){(e.error||e.warning)&&(e.sync=!0),t.resolve(e)}).always(function(){g.unlockfiles({files:e})})},y=!1;this.confirm=function(e,t,n,i,a){var o,r,s,l,c,d=t.length,p=g.cwd().hash,u=[],h=g.i18n("calc")+'<span class="elfinder-spinner"></span>',f=1<d?(s=0,st.each(n,function(e,t){if(!t.size||"unknown"==t.size||"directory"===t.mime)return!(s="unknown");var n=parseInt(t.size);0<=n&&0<=s&&(s+=n)}),y="unknown"===s,u.push(g.i18n("size")+": "+(y?h:g.formatSize(s))),[st(v.replace("{class}","elfinder-cwd-icon-group").replace("{title}","<strong>"+g.i18n("items")+": "+d+"</strong>").replace("{desc}",u.join("<br>")))]):(l=n[0],r=g.tmb(l),y="directory"===l.mime,u.push(g.i18n("size")+": "+(y?h:g.formatSize(l.size))),u.push(g.i18n("modify")+": "+g.formatDate(l)),c=g.escape(l.i18||l.name).replace(/([_.])/g,"​$1"),[st(v.replace("{class}",g.mime2class(l.mime)).replace("{title}","<strong>"+c+"</strong>").replace("{desc}",u.join("<br>")))]);a&&(f=f.concat(a)),f.push(i?"confirmTrash":"confirmRm"),o=g.confirm({title:m.title,text:f,accept:{label:"btnRm",callback:function(){i?m.toTrash(e,t,i):b(e,t)}},cancel:{label:"btnCancel",callback:function(){g.unlockfiles({files:t}),1===t.length&&g.file(t[0]).phash!==p?g.select({selected:t}):g.selectfiles({files:t}),e.reject()}}}),r&&st("<img/>").on("load",function(){o.find(".elfinder-cwd-icon").addClass(r.className).css("background-image","url('"+r.url+"')")}).attr("src",r.url),y=y&&g.getSize(st.map(n,function(e){return"directory"===e.mime?e.hash:null})).done(function(e){o.find("span.elfinder-spinner").parent().html(g.i18n("size")+": "+e.formated)}).fail(function(){o.find("span.elfinder-spinner").parent().html(g.i18n("size")+": "+g.i18n("unknown"))}).always(function(){y=!1})},this.toTrash=function(d,p,e){var t,n,u,s={},i=p.length,a=m.options.toTrashMaxItems,o=[],r=st.Deferred();a<i?m.confirm(d,p,m.files(p),null,[g.i18n("tooManyToTrash")]):(st.each(p,function(e,t){var n=g.file(t),i=g.path(t).replace(/\\/g,"/").match(/^[^\/]+?(\/(?:[^\/]+?\/)*)[^\/]+?$/);n&&(i&&(i[1]=i[1].replace(/(^\/.*?)\/?$/,"$1"),s[i[1]]||(s[i[1]]=[]),s[i[1]].push(t)),"directory"===n.mime&&o.push(t))}),o.length?(t=g.request({data:{cmd:"size",targets:o},notify:{type:"readdir",cnt:1,hideCnt:!0},preventDefault:!0}).done(function(e){var t=0;e.fileCnt&&(t+=parseInt(e.fileCnt)),e.dirCnt&&(t+=parseInt(e.dirCnt)),r[a<t?"reject":"resolve"]()}).fail(function(){r.reject()}),setTimeout(function(){var e=t&&t.xhr?t.xhr:null;e&&"pending"==e.state()&&(t.syncOnFail(!1),t.reject(),r.reject())},1e3*m.options.infoCheckWait)):r.resolve(),r.done(function(){n=Object.keys(s),(u=n.length)?g.request({data:{cmd:"mkdir",target:e,dirs:n},notify:{type:"chkdir",cnt:u},preventFail:!0}).fail(function(e){d.reject(e),g.unlockfiles({files:p})}).done(function(e){function n(){return g.ui.notify.children(".elfinder-notify-trash").length}var i,a,o,r,l=["errTrash"],c={};(i=e.hashes)?(o=1/u*100,r=1===u?100:5,a=setTimeout(function(){g.notify({type:"trash",cnt:1,hideCnt:!0,progress:r})},g.notifyDelay),st.each(s,function(e,t){var s;g.file(t[0]).phash;i[e]&&(s={cmd:"paste",dst:i[e],targets:t,cut:1},g.request({data:s,preventDefault:!0}).fail(function(e){e&&(l=l.concat(e))}).done(function(e){var t,n,i,a,o,r;e=g.normalize(e),g.updateCache(e),t=e,n=s,st.each(t,function(e,t){Array.isArray(t)&&(c[e]?c[e]=c[e].concat(t):c[e]=t)}),t.sync&&(c.sync=1),t.added&&t.added.length&&(i=function(){var n=[],i=st.map(t.added,function(e){return"directory"===e.mime?e.hash:null});return st.each(t.added,function(e,t){-1===st.inArray(t.phash,i)&&n.push(t.hash)}),g.exec("restore",n,{noToast:!0})},o=function(){return g.request({data:n,notify:{type:"redo",cnt:p.length}})},c.undo?(a=c.undo,c.undo=function(){i(),a()}):c.undo=i,c.redo?(r=c.redo,c.redo=function(){o(),r()}):c.redo=o),e.warning&&(l=l.concat(e.warning),delete e.warning),e.removed&&e.removed.length&&g.remove(e),e.added&&e.added.length&&g.add(e),e.changed&&e.changed.length&&g.change(e),g.trigger("paste",e),g.trigger("pastedone"),e.sync&&g.sync()}).always(function(){var e=[],t=2;n()?g.notify({type:"trash",cnt:0,hideCnt:!0,progress:o}):r+=o,--u<1&&(a&&clearTimeout(a),n()&&g.notify({type:"trash",cnt:-1}),g.unlockfiles({files:p}),Object.keys(c).length?(1<l.length&&((c.removed||c.removed.length)&&(e=st.grep(p,function(e){return-1===st.inArray(e,c.removed)})),e.length?(l.length>t&&(t=-1===(g.messages[l[t-1]]||"").indexOf("$")?t:t+1),d.reject(),g.exec("rm",e,{addTexts:l.slice(0,t),forceRm:!0})):g.error(l)),c._noSound=!0,c.undo&&c.redo&&(c.undo={cmd:"trash",callback:c.undo},c.redo={cmd:"trash",callback:c.redo}),d.resolve(c)):d.reject(l))}))})):(d.reject("errFolderNotFound"),g.unlockfiles({files:p}))}):(d.reject(["error","The folder hierarchy to be deleting can not be determined."]),g.unlockfiles({files:p}))}).fail(function(){m.confirm(d,p,m.files(p),null,[g.i18n("tooManyToTrash")])}))},this.remove=b,this.syncTitleOnChange=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"delete ctrl+backspace shift+delete"}],this.value="rm",this.init=function(){g=(m=this).fm,m.change(function(){var n;delete m.extra,m.title=g.i18n("cmd"+m.value),m.className=m.value,m.button&&m.button.children("span.elfinder-button-icon")["trash"===m.value?"addClass":"removeClass"]("elfinder-button-icon-trash"),"trash"===m.value&&(m.extra={icon:"rm",node:st("<span></span>").attr({title:g.i18n("cmdrm")}).on("ready",function(e,t){n=t.targets}).on("click touchstart",function(e){"touchstart"===e.type&&1<e.originalEvent.touches.length||(e.stopPropagation(),e.preventDefault(),g.getUI().trigger("click"),g.exec("rm",n,{_userAction:!0,forceRm:!0}))})})})},this.getstate=function(e){var t=this.hashes(e);return t.length&&st.grep(t,function(e){var t=g.file(e);return!(!t||t.locked||g.isRoot(t))}).length==t.length?0:-1},this.exec=function(e,t){var n,i=t||{},a=st.Deferred().always(function(){y&&y.state&&"pending"===y.state()&&y.reject()}).fail(function(e){e&&g.error(e)}).done(function(e){!i.quiet&&!e._noSound&&e.removed&&e.removed.length&&g.trigger("playsound",{soundFile:"rm.wav"})}),o=m.files(e),r=o.length,s=null,l=i.addTexts?i.addTexts:null,c=i.forceRm,d=i.quiet;return r?(st.each(o,function(e,t){return g.isRoot(t)?!a.reject(["errRm",t.name,"errPerm"]):t.locked?!a.reject(["errLocked",t.name]):void 0}),"pending"===a.state()&&(n=m.hashes(e),o.length,(c||m.event&&m.event.originalEvent&&m.event.originalEvent.shiftKey)&&(s="",m.title=g.i18n("cmdrm")),null===s&&(s=p(n)),g.lockfiles({files:n}),s&&m.options.quickTrash?m.toTrash(a,n,s):d?b(a,n,d):m.confirm(a,n,o,s,l)),a):a.reject()},g.bind("select contextmenucreate closecontextmenu",function(e){var t=(e.data?e.data.selected||e.data.targets:null)||g.selected();t&&t.length&&m.update(void 0,(t?p(t):g.option("trashHash"))?"trash":"rm")})},Me.prototype.commands.search=function(){"use strict";this.title="Find files",this.options={ui:"searchbutton"},this.alwaysEnabled=!0,this.updateOnSelect=!1,this.getstate=function(){return 0},this.exec=function(n,i,a,e){function o(e){return t&&"SearchName"!==t&&"SearchMime"!==t&&(e.type=t),e}var r,s,l=this.fm,c=[],t=e||"",d=l.options.onlyMimes,p=[];return"string"==typeof n&&n?("object"==typeof i&&(a=i.mime||"",i=i.target||""),i=i||"",a?(a=st.trim(a).replace(","," ").split(" "),d.length&&(a=st.map(a,function(t){return(t=st.trim(t))&&(-1!==st.inArray(t,d)||st.grep(d,function(e){return 0===t.indexOf(e)}).length)?t:null}))):a=[].concat(d),l.trigger("searchstart",o({query:n,target:i,mimes:a})),!d.length||a.length?""===i&&2.1<=l.api?(s=Object.keys(l.roots).length,st.each(l.roots,function(e,t){c.push(l.request({data:o({cmd:"search",q:n,target:t,mimes:a}),notify:{type:"search",cnt:1,hideCnt:!(1<s)},cancel:!0,preventDone:!0}))})):(c.push(l.request({data:o({cmd:"search",q:n,target:i,mimes:a}),notify:{type:"search",cnt:1,hideCnt:!0},cancel:!0,preventDone:!0})),""!==i&&2.1<=l.api&&Object.keys(l.leafRoots).length&&st.each(l.leafRoots,function(e,t){for(r=e;r;)i===r&&st.each(t,function(){var e=l.file(this);e&&e.volumeid&&p.push(e.volumeid),c.push(l.request({data:o({cmd:"search",q:n,target:this,mimes:a}),notify:{type:"search",cnt:1,hideCnt:!1},cancel:!0,preventDone:!0}))}),r=(l.file(r)||{}).phash})):c=[st.Deferred().resolve({files:[]})],l.searchStatus.mixed=1<c.length&&p,st.when.apply(st,c).done(function(e){var t,n=arguments.length;if(e.warning&&l.error(e.warning),1<n)for(e.files=e.files||[],t=1;t<n;t++)arguments[t].warning&&l.error(arguments[t].warning),arguments[t].files&&e.files.push.apply(e.files,arguments[t].files);e.files&&e.files.length&&l.cache(e.files),l.lazy(function(){l.trigger("search",e)}).then(function(){return l.lazy(function(){l.trigger("searchdone")})}).then(function(){e.sync&&l.sync()})})):(l.getUI("toolbar").find("."+l.res("class","searchbtn")+" :text").trigger("focus"),st.Deferred().reject())}},Me.prototype.commands.selectall=function(){"use strict";var t=0;this.fm.bind("select",function(e){t=e.data&&e.data.selectall?-1:0}),this.state=0,this.updateOnSelect=!1,this.getstate=function(){return t},this.exec=function(){return st(document).trigger(st.Event("keydown",{keyCode:65,ctrlKey:!0,shiftKey:!1,altKey:!1,metaKey:!1})),st.Deferred().resolve()}},Me.prototype.commands.selectinvert=function(){"use strict";this.updateOnSelect=!1,this.getstate=function(){return 0},this.exec=function(){return st(document).trigger(st.Event("keydown",{keyCode:73,ctrlKey:!0,shiftKey:!0,altKey:!1,metaKey:!1})),st.Deferred().resolve()}},Me.prototype.commands.selectnone=function(){"use strict";var e=this.fm,t=-1;e.bind("select",function(e){t=e.data&&e.data.unselectall?-1:0}),this.state=-1,this.updateOnSelect=!1,this.getstate=function(){return t},this.exec=function(){return e.getUI("cwd").trigger("unselectall"),st.Deferred().resolve()}},Me.prototype.commands.sort=function(){"use strict";function e(){i.variants=[],st.each(s.sortRules,function(e,t){var n;s.sorters[e]&&(n=e===s.sortType?"asc"===s.sortOrder?"n":"s":"",i.variants.push([e,(n?'<span class="ui-icon ui-icon-arrowthick-1-'+n+'"></span>':"")+" "+s.i18n("sort"+e)]))}),i.variants.push("|"),i.variants.push(["stick",(s.sortStickFolders?'<span class="ui-icon ui-icon-check"></span>':"")+" "+s.i18n("sortFoldersFirst")]),s.ui.tree&&null!==s.options.sortAlsoTreeview&&(i.variants.push("|"),i.variants.push(["tree",(s.sortAlsoTreeview?'<span class="ui-icon ui-icon-check"></span>':"")+" "+s.i18n("sortAlsoTreeview")])),t()}var i=this,s=i.fm,t=function(){var e,t=s.getUI("contextmenu");t.is(":visible")&&((e=t.find("span.elfinder-button-icon-sort").siblings("div.elfinder-contextmenu-sub")).find("span.ui-icon").remove(),e.children("div.elfinder-contextsubmenu-item").each(function(){var e,t=st(this).children("span"),n=t.text().trim();n===(a.stick||(a.stick=s.i18n("sortFoldersFirst")))?s.sortStickFolders&&t.prepend('<span class="ui-icon ui-icon-check"></span>'):n===(a.tree||(a.tree=s.i18n("sortAlsoTreeview")))?s.sortAlsoTreeview&&t.prepend('<span class="ui-icon ui-icon-check"></span>'):n===(a[s.sortType]||(a[s.sortType]=s.i18n("sort"+s.sortType)))&&(e="asc"===s.sortOrder?"n":"s",t.prepend('<span class="ui-icon ui-icon-arrowthick-1-'+e+'"></span>'))}))},a={};this.options={ui:"sortbutton"},this.keepContextmenu=!0,s.bind("sortchange",e).bind("sorterupdate",function(){e(),s.getUI().children(".elfinder-button-sort-menu").children(".elfinder-button-menu-item").each(function(){var e=st(this),t=e.attr("rel");e.toggle(!(t&&!s.sorters[t]))})}).bind("cwdrender",function(){var r=st(s.cwd).find("div.elfinder-cwd-wrapper-list table");r.length&&st.each(s.sortRules,function(e,t){var n,i,a,o=r.find("thead tr td.elfinder-cwd-view-th-"+e);o.length&&(n=e==s.sortType,i={type:e,order:n?"asc"==s.sortOrder?"desc":"asc":s.sortOrder},n&&(o.addClass("ui-state-active"),a="asc"==s.sortOrder?"n":"s",st('<span class="ui-icon ui-icon-triangle-1-'+a+'"></span>').appendTo(o)),st(o).on("click",function(e){st(this).data("dragging")||(e.stopPropagation(),s.getUI("cwd").data("longtap")||s.exec("sort",[],i))}).on("mouseenter mouseleave",function(e){st(this).toggleClass("ui-state-hover","mouseenter"===e.type)}))})}),this.getstate=function(){return 0},this.exec=function(e,t){var n,i=this.fm,a=st.isPlainObject(t)?t:(n={},"stick"===(t+="")?n.stick=!i.sortStickFolders:"tree"===t?n.tree=!i.sortAlsoTreeview:i.sorters[t]&&(i.sortType===t?n.order="asc"===i.sortOrder?"desc":"asc":n.type=t),n),o=Object.assign({type:i.sortType,order:i.sortOrder,stick:i.sortStickFolders,tree:i.sortAlsoTreeview},a);return i.lazy(function(){i.setSort(o.type,o.order,o.stick,o.tree),this.resolve()})}},Me.prototype.commands.undo=function(){"use strict";function o(e){e?(n.title=r.i18n("cmdundo")+" "+r.i18n("cmd"+e.cmd),n.state=0):(n.title=r.i18n("cmdundo"),n.state=-1),n.change()}var n=this,r=this.fm,s=[];this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+z"}],this.syncTitleOnChange=!0,this.getstate=function(){return s.length?0:-1},this.setUndo=function(e,t){var n={};e&&st.isPlainObject(e)&&e.cmd&&e.callback&&(Object.assign(n,e),t?(delete t.undo,n.redo=t):r.getCommand("redo").setRedo(null),s.push(n),o(n))},this.exec=function(){var e,t,n=r.getCommand("redo"),i=st.Deferred(),a={};return s.length?((e=s.pop()).redo?(Object.assign(a,e.redo),delete e.redo):a=null,i.done(function(){a&&n.setRedo(a,e)}),o(s.length?s[s.length-1]:void 0),(t=e.callback())&&t.done?t.done(function(){i.resolve()}).fail(function(){i.reject()}):i.resolve(),s.length?this.update(0,s[s.length-1].name):this.update(-1,"")):i.reject(),i},r.bind("exec",function(e){var t=e.data||{};t.opts&&t.opts._userAction&&t.dfrd&&t.dfrd.done&&t.dfrd.done(function(e){e&&e.undo&&e.redo&&(e.undo.redo=e.redo,n.setUndo(e.undo))})})},Me.prototype.commands.redo=function(){"use strict";function r(e){e&&e.callback?(t.title=s.i18n("cmdredo")+" "+s.i18n("cmd"+e.cmd),t.state=0):(t.title=s.i18n("cmdredo"),t.state=-1),t.change()}var t=this,s=this.fm,l=[];this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"shift+ctrl+z ctrl+y"}],this.syncTitleOnChange=!0,this.getstate=function(){return l.length?0:-1},this.setRedo=function(e,t){null===e?(l=[],r()):e&&e.cmd&&e.callback&&(t&&(e.undo=t),l.push(e),r(e))},this.exec=function(){var e,t,n=s.getCommand("undo"),i=st.Deferred(),a={},o={};return l.length?((e=l.pop()).undo&&(Object.assign(a,e.undo),Object.assign(o,e),delete o.undo,i.done(function(){n.setUndo(a,o)})),r(l.length?l[l.length-1]:void 0),(t=e.callback())&&t.done?t.done(function(){i.resolve()}).fail(function(){i.reject()}):i.resolve(),i):i.reject()}},(Me.prototype.commands.up=function(){"use strict";this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+up"}],this.getstate=function(){return this.fm.cwd().phash?0:-1},this.exec=function(){var e=this.fm,t=e.cwd().hash;return this.fm.cwd().phash?this.fm.exec("open",this.fm.cwd().phash).done(function(){e.one("opendone",function(){e.selectfiles({files:[t]})})}):st.Deferred().reject()}}).prototype={forceLoad:!0},Me.prototype.commands.upload=function(){"use strict";var y=this.fm.res("class","hover");this.disableOnSearch=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+u"}],this.getstate=function(e){var t,n=this.fm,i=e||[n.cwd().hash];return this._disabled||1!=i.length||(t=n.file(i[0])),t&&"directory"==t.mime&&t.write?0:-1},this.exec=function(e){function d(e){u.upload(e).fail(function(e){v.reject(e)}).done(function(e){var t,n;u.getUI("cwd");v.resolve(e),e&&e.added&&e.added[0]&&!u.ui.notify.children(".elfinder-notify-upload").length&&((n=u.findCwdNodes(e.added)).length?n.trigger("scrolltoview"):(g.hash!==h?t=st("<div></div>").append(st('<button type="button" class="ui-button ui-widget ui-state-default ui-corner-all elfinder-tabstop"><span class="ui-button-text">'+u.i18n("cmdopendir")+"</span></button>").on("mouseenter mouseleave",function(e){st(this).toggleClass("ui-state-hover","mouseenter"==e.type)}).on("click",function(){u.exec("open",m).done(function(){u.one("opendone",function(){u.trigger("selectfiles",{files:st.map(e.added,function(e){return e.hash})})})})})):u.trigger("selectfiles",{files:st.map(e.added,function(e){return e.hash})}),u.toast({msg:u.i18n(["complete",u.i18n("cmdupload")]),extNode:t})))}).progress(function(){v.notifyWith(this,Array.from(arguments))})}function s(e){r.elfinderdialog("close"),f&&(e.target=f[0]),d(e)}function t(){var e=g.hash,t=st.map(u.files(e),function(e){return"directory"===e.mime&&e.write?e:null});return t.length?st('<div class="elfinder-upload-dirselect elfinder-tabstop" title="'+u.i18n("folders")+'"></div>').on("click",function(e){e.stopPropagation(),e.preventDefault(),t=u.sortFiles(t);function n(t,e){return{label:u.escape(t.i18||t.name),icon:e,remain:!1,callback:function(){var e=a.children(".ui-dialog-titlebar:first").find("span.elfinder-upload-target");f=[t.hash],e.html(" - "+u.escape(t.i18||t.name)),i.trigger("focus")},options:{className:f&&f.length&&t.hash===f[0]?"ui-state-active":"",iconClass:t.csscls||"",iconImg:t.icon||""}}}var i=st(this),a=(u.cwd(),r.closest("div.ui-dialog")),o=[n(g,"opendir"),"|"];st.each(t,function(e,t){o.push(n(t,"dir"))}),i.trigger("blur"),u.trigger("contextmenu",{raw:o,x:e.pageX||st(this).offset().left,y:e.pageY||st(this).offset().top,prevNode:a,fitHeight:!0})}).append('<span class="elfinder-button-icon elfinder-button-icon-dir" ></span>'):st()}function n(e,t){var n=st('<input type="file" '+e+"/>").on("click",function(){u.UA.IE&&setTimeout(function(){i.css("display","none").css("position","relative"),requestAnimationFrame(function(){i.css("display","").css("position","")})},100)}).on("change",function(){s({input:n.get(0),type:"files"})}).on("dragover",function(e){e.originalEvent.dataTransfer.dropEffect="copy"}),i=st("<form></form>").append(n).on("click",function(e){e.stopPropagation()});return st('<div class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only elfinder-tabstop elfinder-focus"><span class="ui-button-text">'+u.i18n(t)+"</span></div>").append(i).on("click",function(e){e.stopPropagation(),e.preventDefault(),n.trigger("click")}).on("mouseenter mouseleave",function(e){st(this).toggleClass(y,"mouseenter"===e.type)})}var r,i,a,o,l,c,p,u=this.fm,h=u.cwd().hash,f=(c=e&&e instanceof Array?e:null,(!e||e instanceof Array)&&(c||1!==(l=u.selected()).length||"directory"!==u.file(l[0]).mime?c&&1===c.length&&"directory"===u.file(c[0]).mime||(c=[h]):c=l),c),m=f?f[0]:e&&e.target?e.target:null,g=m?u.file(m):u.cwd(),v=st.Deferred(),b=function(e){e.stopPropagation(),e.preventDefault();var t,n,i,a=!1,o="",r=null,s=e._target||null,l=e.dataTransfer||null,c=l.items&&l.items.length&&l.items[0].kind?l.items[0].kind:"";if(l){try{if((t=l.getData("elfinderfrom"))&&(n=window.location.href+u.cwd().hash,!s&&t===n||s===n))return void v.reject()}catch(e){}if("file"===c&&(l.items[0].getAsEntry||l.items[0].webkitGetAsEntry))a=l,o="data";else if("string"!==c&&l.files&&l.files.length&&-1===st.inArray("Text",l.types))a=l.files,o="files";else{try{(r=l.getData("text/html"))&&r.match(/<(?:img|a)/i)&&(a=[r],o="html")}catch(e){}a||((r=l.getData("text"))?(a=[r],o="text"):l&&l.files&&(c="file"))}}a?d({files:a,type:o,target:s,dropEvt:e}):(i=["errUploadNoFiles"],"file"===c&&i.push("errFolderUpload"),u.error(i),v.reject())};return!f&&e?e.input||e.files?(e.type="files",d(e)):e.dropEvt&&b(e.dropEvt):(i=function(e){var t,n,i=e.originalEvent||e,a=[];if(i.clipboardData){if(i.clipboardData.items&&i.clipboardData.items.length){t=i.clipboardData.items;for(var o=0;o<t.length;o++)"file"==i.clipboardData.items[o].kind&&(n=i.clipboardData.items[o].getAsFile(),a.push(n))}else i.clipboardData.files&&i.clipboardData.files.length&&(a=i.clipboardData.files);if(a.length)return void s({files:a,type:"files",clipdata:!0})}var r=i.target||i.srcElement;requestAnimationFrame(function(){var e,t="text";r.innerHTML&&(st(r).find("img").each(function(e,t){t.src.match(/^webkit-fake-url:\/\//)&&st(t).remove()}),st(r).find("a,img").length&&(t="html"),e=r.innerHTML,r.innerHTML="",s({files:[e],type:t}))})},r=st('<div class="elfinder-upload-dialog-wrapper"></div>').append(n("multiple","selectForUpload")),u.UA.Mobile||void 0===(p=document.createElement("input")).webkitdirectory&&void 0===p.directory||r.append(n("multiple webkitdirectory directory","selectFolder")),g.dirs&&(g.hash===h||u.navHash2Elm(g.hash).hasClass("elfinder-subtree-loaded")?t().appendTo(r):(a=st('<div class="elfinder-upload-dirselect" title="'+u.i18n("nowLoading")+'"></div>').append('<span class="elfinder-button-icon elfinder-button-icon-spinner" ></span>').appendTo(r),u.request({cmd:"tree",target:g.hash}).done(function(){u.one("treedone",function(){a.replaceWith(t()),o.elfinderdialog("tabstopsInit")})}).fail(function(){a.remove()}))),u.dragUpload?st('<div class="ui-corner-all elfinder-upload-dropbox elfinder-tabstop" contenteditable="true" data-ph="'+u.i18n("dropPasteFiles")+'"></div>').on("paste",function(e){i(e)}).on("mousedown click",function(){st(this).trigger("focus")}).on("focus",function(){this.innerHTML=""}).on("mouseover",function(){st(this).addClass(y)}).on("mouseout",function(){st(this).removeClass(y)}).on("dragenter",function(e){e.stopPropagation(),e.preventDefault(),st(this).addClass(y)}).on("dragleave",function(e){e.stopPropagation(),e.preventDefault(),st(this).removeClass(y)}).on("dragover",function(e){e.stopPropagation(),e.preventDefault(),e.originalEvent.dataTransfer.dropEffect="copy",st(this).addClass(y)}).on("drop",function(e){r.elfinderdialog("close"),f&&(e.originalEvent._target=f[0]),b(e.originalEvent)}).prependTo(r).after('<div class="elfinder-upload-dialog-or">'+u.i18n("or")+"</div>")[0]:st('<div class="ui-corner-all elfinder-upload-dropbox" contenteditable="true">'+u.i18n("dropFilesBrowser")+"</div>").on("paste drop",function(e){i(e)}).on("mousedown click",function(){st(this).trigger("focus")}).on("focus",function(){this.innerHTML=""}).on("dragenter mouseover",function(){st(this).addClass(y)}).on("dragleave mouseout",function(){st(this).removeClass(y)}).prependTo(r).after('<div class="elfinder-upload-dialog-or">'+u.i18n("or")+"</div>")[0],o=this.fmDialog(r,{title:this.title+'<span class="elfinder-upload-target">'+(g?" - "+u.escape(g.i18||g.name):"")+"</span>",modal:!0,resizable:!1,destroyOnClose:!0,propagationEvents:["mousemove","mouseup","click"],close:function(){var e=u.getUI("contextmenu");e.is(":visible")&&e.click()}})),v}},Me.prototype.commands.view=function(){"use strict";var a,o=this,r=this.fm;this.value=r.viewType,this.alwaysEnabled=!0,this.updateOnSelect=!1,this.options={ui:"viewbutton"},this.getstate=function(){return 0},this.extra={icon:"menu",node:st("<span></span>").attr({title:r.i18n("viewtype")}).on("click touchstart",function(e){var t;"touchstart"===e.type&&1<e.originalEvent.touches.length||(t=st(this),e.stopPropagation(),e.preventDefault(),r.trigger("contextmenu",{raw:getSubMenuRaw(),x:t.offset().left,y:t.offset().top}))})},this.exec=function(){var e=this,t="list"==this.value?"icons":"list";return r.storage("view",t),r.lazy(function(){r.viewchange(),e.update(void 0,t),this.resolve()})},r.bind("init",function(){a=function(){for(var t=r.getUI("cwd"),e=[],n=r.options.uiOptions.cwd.iconsView.sizeNames,i=r.options.uiOptions.cwd.iconsView.sizeMax,a=0;a<=i;a++)e.push({label:r.i18n(n[a]||"Size-"+a+" icons"),icon:"view",callback:function(e){return function(){t.trigger("iconpref",{size:e}),r.storage("iconsize",e),"list"===o.value&&o.exec()}}(a)});return e.push("|"),e.push({label:r.i18n("viewlist"),icon:"view-list",callback:function(){"list"!==o.value&&o.exec()}}),e}()}).bind("contextmenucreate",function(){o.extra={icon:"menu",node:st("<span></span>").attr({title:r.i18n("cmdview")}).on("click touchstart",function(e){if(!("touchstart"===e.type&&1<e.originalEvent.touches.length)){for(var t=st(this),n=(a.concat(),"list"===o.value?a.length-1:parseInt(r.storage("iconsize")||0)),i=0;i<a.length;i++)"|"!==a[i]&&(a[i].options=i===n?{className:"ui-state-active"}:void 0);e.stopPropagation(),e.preventDefault(),r.trigger("contextmenu",{raw:a,x:t.offset().left,y:t.offset().top})}})}})},Me});
- !function(e,r){"function"==typeof define&&define.amd?define(["elfinder"],r):"undefined"!=typeof exports?module.exports=r(require("elfinder")):r(e.elFinder)}(this,function(e){e.prototype.i18.ru={translator:'Dmitry "dio" Levashov <dio@std42.ru>, Andrew Berezovsky <andrew.berezovsky@gmail.com>, Alex Yashkin <alex@yashkin.by>',language:"Русский язык",direction:"ltr",dateFormat:"d M Y H:i",fancyDateFormat:"$1 H:i",nonameDateFormat:"ymd-His",messages:{error:"Ошибка",errUnknown:"Неизвестная ошибка.",errUnknownCmd:"Неизвестная команда.",errJqui:"Отсутствуют необходимые компоненты jQuery UI - selectable, draggable и droppable.",errNode:"Отсутствует DOM элемент для инициализации elFinder.",errURL:"Неверная конфигурация elFinder! Не указан URL.",errAccess:"Доступ запрещен.",errConnect:"Не удалось соединиться с сервером.",errAbort:"Соединение прервано.",errTimeout:"Таймаут соединения.",errNotFound:"Сервер не найден.",errResponse:"Некорректный ответ сервера.",errConf:"Некорректная настройка сервера.",errJSON:"Модуль PHP JSON не установлен.",errNoVolumes:"Отсутствуют корневые директории достуные для чтения.",errCmdParams:'Некорректные параметры команды "$1".',errDataNotJSON:"Данные не в формате JSON.",errDataEmpty:"Данные отсутствуют.",errCmdReq:"Для запроса к серверу необходимо указать имя команды.",errOpen:'Не удалось открыть "$1".',errNotFolder:"Объект не является папкой.",errNotFile:"Объект не является файлом.",errRead:'Ошибка чтения "$1".',errWrite:'Ошибка записи в "$1".',errPerm:"Доступ запрещен.",errLocked:'"$1" защищен и не может быть переименован, перемещен или удален.',errExists:'В папке уже существует файл с именем "$1".',errInvName:"Недопустимое имя файла.",errInvDirname:"Недопустимое имя папки.",errFolderNotFound:"Папка не найдена.",errFileNotFound:"Файл не найден.",errTrgFolderNotFound:'Целевая папка "$1" не найдена.',errPopup:"Браузер заблокировал открытие нового окна. Чтобы открыть файл, измените настройки браузера.",errMkdir:'Ошибка создания папки "$1".',errMkfile:'Ошибка создания файла "$1".',errRename:'Ошибка переименования "$1".',errCopyFrom:'Копирование файлов из директории "$1" запрещено.',errCopyTo:'Копирование файлов в директорию "$1" запрещено.',errMkOutLink:"Невозможно создать ссылку вне корня раздела.",errUpload:"Ошибка загрузки.",errUploadFile:'Невозможно загрузить "$1".',errUploadNoFiles:"Нет файлов для загрузки.",errUploadTotalSize:"Превышен допустимый размер загружаемых данных.",errUploadFileSize:"Размер файла превышает допустимый.",errUploadMime:"Недопустимый тип файла.",errUploadTransfer:'Ошибка передачи файла "$1".',errUploadTemp:"Невозможно создать временный файл для загрузки.",errNotReplace:'Объект "$1" по этому адресу уже существует и не может быть заменен объектом другого типа.',errReplace:'Невозможно заменить "$1".',errSave:'Невозможно сохранить "$1".',errCopy:'Невозможно скопировать "$1".',errMove:'Невозможно переместить "$1".',errCopyInItself:'Невозможно скопировать "$1" в самого себя.',errRm:'Невозможно удалить "$1".',errTrash:"Невозможно переместить в корзину.",errRmSrc:"Невозможно удалить файлы источника.",errExtract:'Невозможно извлечь фалы из "$1".',errArchive:"Невозможно создать архив.",errArcType:"Неподдерживаемый тип архива.",errNoArchive:"Файл не является архивом или неподдерживаемый тип архива.",errCmdNoSupport:"Сервер не поддерживает эту команду.",errReplByChild:'Невозможно заменить папку "$1" содержащимся в ней объектом.',errArcSymlinks:"По соображениям безопасности запрещена распаковка архивов, содержащих ссылки (symlinks) или файлы с недопустимыми именами.",errArcMaxSize:"Размер файлов в архиве превышает максимально разрешенный.",errResize:'Не удалось изменить размер "$1".',errResizeDegree:"Некорректный градус поворота.",errResizeRotate:"Невозможно повернуть изображение.",errResizeSize:"Некорректный размер изображения.",errResizeNoChange:"Размер изображения не изменился.",errUsupportType:"Неподдерживаемый тип файла.",errNotUTF8Content:'Файл "$1" содержит текст в кодировке отличной от UTF-8 и не может быть отредактирован.',errNetMount:'Невозможно подключить "$1".',errNetMountNoDriver:"Неподдерживаемый протокол.",errNetMountFailed:"Ошибка монтирования.",errNetMountHostReq:"Требуется указать хост.",errSessionExpires:"Сессия была завершена так как превышено время отсутствия активности.",errCreatingTempDir:'Невозможно создать временную директорию: "$1"',errFtpDownloadFile:'Невозможно скачать файл с FTP: "$1"',errFtpUploadFile:'Невозможно загрузить файл на FTP: "$1"',errFtpMkdir:'Невозможно создать директорию на FTP: "$1"',errArchiveExec:'Ошибка при выполнении архивации: "$1"',errExtractExec:'Ошибка при выполнении распаковки: "$1"',errNetUnMount:"Невозможно отключить",errConvUTF8:"Не конвертируется в UTF-8",errFolderUpload:"Если вы хотите загружать папки, попробуйте Google Chrome.",errSearchTimeout:'Превышено время ожидания при поиске "$1". Результаты поиска частичные.',errReauthRequire:"Требуется повторная авторизация.",errMaxTargets:"Максимальное число выбираемых файлов: $1.",errRestore:"Невозможно восстановить из корзины. Не удалось определить путь для восстановления.",errEditorNotFound:"Не найден редактор для этого типа файлов.",errServerError:"Возникла ошибка на стороне сервера.",errEmpty:'Невозможно очистить папку "$1".',moreErrors:"Еще ошибок: $1",cmdarchive:"Создать архив",cmdback:"Назад",cmdcopy:"Копировать",cmdcut:"Вырезать",cmddownload:"Скачать",cmdduplicate:"Сделать копию",cmdedit:"Редактировать файл",cmdextract:"Распаковать архив",cmdforward:"Вперед",cmdgetfile:"Выбрать файлы",cmdhelp:"О программе",cmdhome:"Домой",cmdinfo:"Свойства",cmdmkdir:"Новая папка",cmdmkdirin:"В новую папку",cmdmkfile:"Новый файл",cmdopen:"Открыть",cmdpaste:"Вставить",cmdquicklook:"Быстрый просмотр",cmdreload:"Обновить",cmdrename:"Переименовать",cmdrm:"Удалить",cmdtrash:"Переместить в корзину",cmdrestore:"Восстановить",cmdsearch:"Поиск файлов",cmdup:"Наверх",cmdupload:"Загрузить файлы",cmdview:"Вид",cmdresize:"Изменить размер и повернуть",cmdsort:"Сортировать",cmdnetmount:"Подключить сетевой раздел",cmdnetunmount:"Отключить",cmdplaces:"В избранное",cmdchmod:"Изменить права доступа",cmdopendir:"Открыть папку",cmdcolwidth:"Сбросить ширину колонок",cmdfullscreen:"Полный экран",cmdmove:"Переместить",cmdempty:"Очистить папку",cmdundo:"Отменить",cmdredo:"Вернуть",cmdpreference:"Предпочтения",cmdselectall:"Выбрать все",cmdselectnone:"Отменить выбор",cmdselectinvert:"Инвертировать выбор",cmdopennew:"Открыть в новом окне",cmdhide:"Скрыть (персонально)",btnClose:"Закрыть",btnSave:"Сохранить",btnRm:"Удалить",btnApply:"Применить",btnCancel:"Отмена",btnNo:"Нет",btnYes:"Да",btnMount:"Подключить",btnApprove:"Перейти в $1 и применить",btnUnmount:"Отключить",btnConv:"Конвертировать",btnCwd:"Здесь",btnVolume:"Раздел",btnAll:"Все",btnMime:"MIME тип",btnFileName:"Имя файла",btnSaveClose:"Сохранить и закрыть",btnBackup:"Резервная копия",btnRename:"Переименовать",btnRenameAll:"Переименовать (все)",btnPrevious:"Пред. ($1/$2)",btnNext:"След. ($1/$2)",btnSaveAs:"Сохранить как",ntfopen:"Открыть папку",ntffile:"Открыть файл",ntfreload:"Обновить текущую папку",ntfmkdir:"Создание папки",ntfmkfile:"Создание файлов",ntfrm:"Удалить файлы",ntfcopy:"Скопировать файлы",ntfmove:"Переместить файлы",ntfprepare:"Подготовка к копированию файлов",ntfrename:"Переименовать файлы",ntfupload:"Загрузка файлов",ntfdownload:"Скачивание файлов",ntfsave:"Сохранить файлы",ntfarchive:"Создание архива",ntfextract:"Распаковка архива",ntfsearch:"Поиск файлов",ntfresize:"Изменение размеров изображений",ntfsmth:"Занят важным делом",ntfloadimg:"Загрузка изображения",ntfnetmount:"Подключение сетевого диска",ntfnetunmount:"Отключение сетевого диска",ntfdim:"Получение размеров изображения",ntfreaddir:"Чтение информации о папке",ntfurl:"Получение URL ссылки",ntfchmod:"Изменение прав доступа к файлу",ntfpreupload:"Проверка измени загруженного файла",ntfzipdl:"Создание файла для скачки",ntfparents:"Получение информации о пути",ntfchunkmerge:"Обработка загруженного файла",ntftrash:"Перемещение в корзину",ntfrestore:"Восстановление из корзины",ntfchkdir:"Проверка папки назначения",ntfundo:"Отмена предыдущей операции",ntfredo:"Восстановление предыдущей операции",ntfchkcontent:"Проверка содержимого",volume_Trash:"Корзина",dateUnknown:"неизвестно",Today:"Сегодня",Yesterday:"Вчера",msJan:"Янв",msFeb:"Фев",msMar:"Мар",msApr:"Апр",msMay:"Май",msJun:"Июн",msJul:"Июл",msAug:"Авг",msSep:"Сен",msOct:"Окт",msNov:"Ноя",msDec:"Дек",January:"Январь",February:"Февраль",March:"Март",April:"Апрель",May:"Май",June:"Июнь",July:"Июль",August:"Август",September:"Сентябрь",October:"Октябрь",November:"Ноябрь",December:"Декабрь",Sunday:"Воскресенье",Monday:"Понедельник",Tuesday:"Вторник",Wednesday:"Среда",Thursday:"Четверг",Friday:"Пятница",Saturday:"Суббота",Sun:"Вск",Mon:"Пнд",Tue:"Втр",Wed:"Срд",Thu:"Чтв",Fri:"Птн",Sat:"Сбт",sortname:"по имени",sortkind:"по типу",sortsize:"по размеру",sortdate:"по дате",sortFoldersFirst:"Папки в начале",sortperm:"по разрешениям",sortmode:"по режиму",sortowner:"по владельцу",sortgroup:"по группе",sortAlsoTreeview:"Также и дерево каталогов","untitled file.txt":"НовыйФайл.txt","untitled folder":"НоваяПапка",Archive:"НовыйАрхив","untitled file":"НовыйФайл.$1",extentionfile:"$1 Файл",extentiontype:"$1: $2",confirmReq:"Необходимо подтверждение",confirmRm:"Вы уверены, что хотите удалить файлы?<br>Действие необратимо!",confirmRepl:"Заменить старый файл новым?",confirmRest:"Заменить существующий файл файлом из корзины?",confirmConvUTF8:"Не UTF-8<br/>Сконвертировать в UTF-8?<br/>Данные станут UTF-8 при сохранении после конвертации.",confirmNonUTF8:"Невозможно определить кодировку файла. Необходима предварительная конвертация файла в UTF-8 для дальнейшего редактирования.<br/>Выберите кодировку файла.",confirmNotSave:"Произошли изменения.<br/>Если не сохраните изменения, то потеряете их.",confirmTrash:"Вы уверены, что хотите переместить файлы в корзину?",confirmMove:'Вы уверены, что хотите переместить файлы в "$1"?',apllyAll:"Применить для всех",name:"Имя",size:"Размер",perms:"Доступ",modify:"Изменен",kind:"Тип",read:"чтение",write:"запись",noaccess:"нет доступа",and:"и",unknown:"неизвестно",selectall:"Выбрать все файлы",selectfiles:"Выбрать файл(ы)",selectffile:"Выбрать первый файл",selectlfile:"Выбрать последний файл",viewlist:"В виде списка",viewicons:"В виде иконок",viewSmall:"Маленькие иконки",viewMedium:"Средние иконки",viewLarge:"Большие иконки",viewExtraLarge:"Очень большие иконки",places:"Избранное",calc:"Вычислить",path:"Путь",aliasfor:"Указывает на",locked:"Защита",dim:"Размеры",files:"Файлы",folders:"Папки",items:"Объекты",yes:"да",no:"нет",link:"Ссылка",searcresult:"Результаты поиска",selected:"выбрано",about:"О программе",shortcuts:"Горячие клавиши",help:"Помощь",webfm:"Файловый менеджер для Web",ver:"Версия",protocolver:"версия протокола",homepage:"Сайт проекта",docs:"Документация",github:"Форкните на GitHub",twitter:"Следите в Twitter",facebook:"Присоединяйтесь на Facebook",team:"Команда",chiefdev:"ведущий разработчик",developer:"разработчик",contributor:"участник",maintainer:"сопровождение проекта",translator:"переводчик",icons:"Иконки",dontforget:"и не забудьте взять своё полотенце",shortcutsof:"Горячие клавиши отключены",dropFiles:"Перетащите файлы сюда",or:"или",selectForUpload:"Выбрать файлы для загрузки",moveFiles:"Переместить файлы",copyFiles:"Скопировать файлы",restoreFiles:"Восстановить файлы",rmFromPlaces:"Удалить из избранного",aspectRatio:"Соотношение сторон",scale:"Масштаб",width:"Ширина",height:"Высота",resize:"Изменить размер",crop:"Обрезать",rotate:"Повернуть","rotate-cw":"Повернуть на 90 градусов по часовой стрелке","rotate-ccw":"Повернуть на 90 градусов против часовой стрелке",degree:"°",netMountDialogTitle:"Подключить сетевой диск",protocol:"Протокол",host:"Хост",port:"Порт",user:"Пользователь",pass:"Пароль",confirmUnmount:"Вы хотите отключить $1?",dropFilesBrowser:"Перетащите или вставьте файлы из браузера",dropPasteFiles:"Перетащите или вставьте файлы и ссылки сюда",encoding:"Кодировка",locale:"Локаль",searchTarget:"Цель: $1",searchMime:"Поиск по введенному MIME типу",owner:"Владелец",group:"Группа",other:"Остальные",execute:"Исполнить",perm:"Разрешение",mode:"Режим",emptyFolder:"Папка пуста",emptyFolderDrop:"Папка пуста\\A Перетащите чтобы добавить",emptyFolderLTap:"Папка пуста\\A Долгое нажатие чтобы добавить",quality:"Качество",autoSync:"Авто синхронизация",moveUp:"Передвинуть вверх",getLink:"Получить URL ссылку",selectedItems:"Выбранные объекты ($1)",folderId:"ID папки",offlineAccess:"Позволить автономный доступ",reAuth:"Авторизоваться повторно",nowLoading:"Загружается...",openMulti:"Открыть несколько файлов",openMultiConfirm:"Вы пытаетесь открыть $1 файл(а/ов). Вы уверены, что хотите открыть их в браузере?",emptySearch:"Ничего не найдено",editingFile:"Это редактируемый файл.",hasSelected:"Вы выбрали $1 файл(-ов).",hasClipboard:"У вас $1 файл(-ов) в буфере обмена.",incSearchOnly:"Инкрементный поиск возможен только из текущего вида.",reinstate:"Восстановить",complete:"$1 завершен",contextmenu:"Контекстное меню",pageTurning:"Переключение страницы",volumeRoots:"Корни томов",reset:"Сбросить",bgcolor:"Фоновый цвет",colorPicker:"Выбор цвета","8pxgrid":"8px сетка",enabled:"Включено",disabled:"Отключено",emptyIncSearch:"Ничего не найдено в текущем виде.\\AНажмите [Enter] для развертывания цели поиска.",emptyLetSearch:"Поиск по первому символу не дал результатов в текущем виде.",textLabel:"Текстовая метка",minsLeft:"$1 минут осталось",openAsEncoding:"Переоткрыть с выбранной кодировкой",saveAsEncoding:"Сохранить с выбранной кодировкой",selectFolder:"Выбрать папку",firstLetterSearch:"Поиск по первому символу",presets:"Пресеты",tooManyToTrash:"Слишком много файлов для перемещения в корзину.",TextArea:"Текстовая область",folderToEmpty:'Очистить папку "$1".',filderIsEmpty:'Нет файлов в паке "$1".',preference:"Настройки",language:"Язык",clearBrowserData:"Сбросить настройки для этого браузера",toolbarPref:"Настройки панели",charsLeft:"... еще символов: $1.",linesLeft:"... еще строк: $1.",sum:"Общий размер",roughFileSize:"Приблизительный размер файла",autoFocusDialog:"Фокус на элементе диалога при наведении мыши",select:"Выбрать",selectAction:"Действие при выборе файла",useStoredEditor:"Открывать в редакторе, выбранном в прошлый раз",selectinvert:"Выбрать элементы с инвертированием",renameMultiple:"Переименовать выбранные элементы ($1 шт.) в $2?<br/>Действие нельзя отменить!",batchRename:"Групповое переименование",plusNumber:"+ Число",asPrefix:"Добавить префикс",asSuffix:"Добавить суффикс",changeExtention:"Изменить расширение",columnPref:"Настройки колонок (для просмотра в виде списка)",reflectOnImmediate:"Все изменения будут немедленно отражены в архиве.",reflectOnUnmount:"Изменения не вступят в силу до тех пор, пока вы не размонтируете этот том.",unmountChildren:"Тома, смонтированные на этом томе, также будут размонтированы. Вы хотите отключить его?",selectionInfo:"Свойства",hashChecker:"Алгоритмы для отображения хеш-сумм файлов",infoItems:"Элементы в панели свойств",pressAgainToExit:"Нажмите снова для выхода.",toolbar:"Панель",workspace:"Рабочая область",dialog:"Диалог",all:"Все",iconSize:"Размер иконок (В виде иконок)",editorMaximized:"Открывать редактор в развернутом виде",editorConvNoApi:"Так как конвертация с помощью API недоступно, произведите конвертацию на веб-сайте.",editorConvNeedUpload:"После конвертации вы должны загрузить скачанный файл, чтобы сохранить его.",convertOn:"Конвертировать на сайте $1",integrations:"Интеграции",integrationWith:"Менеджер elFinder интегрирован со следующими внешними сервисами. Ознакомьтесь с правилами пользования, политиками безопасности и др. перед их использованием.",showHidden:"Показать скрытые элементы",hideHidden:"Скрыть скрытые элементы",toggleHidden:"Показать/скрыть скрытые элементы",makefileTypes:'Типы файлов в меню "Новый файл"',typeOfTextfile:"Тип текстового файла",add:"Добавить",theme:"Тема",default:"По умолчанию",description:"Описание",website:"Веб-сайт",author:"Автор",email:"Email",license:"Лицензия",exportToSave:"Невозможно сохранить файл. Чтобы не потерять изменения, экспортируйте их на свой ПК.",dblclickToSelect:"Двойной клик по файлу для его выбора.",useFullscreen:"Использовать полноэкранный режим",kindUnknown:"Неизвестный",kindRoot:"Корень тома",kindFolder:"Папка",kindSelects:"Выбор",kindAlias:"Ссылка",kindAliasBroken:"Битая ссылка",kindApp:"Приложение",kindPostscript:"Документ Postscript",kindMsOffice:"Документ Microsoft Office",kindMsWord:"Документ Microsoft Word",kindMsExcel:"Документ Microsoft Excel",kindMsPP:"Презентация Microsoft Powerpoint",kindOO:"Документ Open Office",kindAppFlash:"Приложение Flash",kindPDF:"Документ PDF",kindTorrent:"Файл Bittorrent",kind7z:"Архив 7z",kindTAR:"Архив TAR",kindGZIP:"Архив GZIP",kindBZIP:"Архив BZIP",kindXZ:"Архив XZ",kindZIP:"Архив ZIP",kindRAR:"Архив RAR",kindJAR:"Файл Java JAR",kindTTF:"Шрифт True Type",kindOTF:"Шрифт Open Type",kindRPM:"Пакет RPM",kindText:"Текстовый документ",kindTextPlain:"Простой текст",kindPHP:"Исходник PHP",kindCSS:"Таблицы стилей CSS",kindHTML:"Документ HTML",kindJS:"Исходник Javascript",kindRTF:"Rich Text Format",kindC:"Исходник C",kindCHeader:"Заголовочный файл C",kindCPP:"Исходник C++",kindCPPHeader:"Заголовочный файл C++",kindShell:"Скрипт Unix shell",kindPython:"Исходник Python",kindJava:"Исходник Java",kindRuby:"Исходник Ruby",kindPerl:"Исходник Perl",kindSQL:"Исходник SQL",kindXML:"Документ XML",kindAWK:"Исходник AWK",kindCSV:"Текст с разделителями",kindDOCBOOK:"Документ Docbook XML",kindMarkdown:"Текст Markdown",kindImage:"Изображение",kindBMP:"Изображение BMP",kindJPEG:"Изображение JPEG",kindGIF:"Изображение GIF",kindPNG:"Изображение PNG",kindTIFF:"Изображение TIFF",kindTGA:"Изображение TGA",kindPSD:"Изображение Adobe Photoshop",kindXBITMAP:"Изображение X bitmap",kindPXM:"Изображение Pixelmator",kindAudio:"Аудио файл",kindAudioMPEG:"Аудио MPEG",kindAudioMPEG4:"Аудио MPEG-4",kindAudioMIDI:"Аудио MIDI",kindAudioOGG:"Аудио Ogg Vorbis",kindAudioWAV:"Аудио WAV",AudioPlaylist:"Плейлист MP3",kindVideo:"Видео файл",kindVideoDV:"Видео DV",kindVideoMPEG:"Видео MPEG",kindVideoMPEG4:"Видео MPEG-4",kindVideoAVI:"Видео AVI",kindVideoMOV:"Видео Quick Time",kindVideoWM:"Видео Windows Media",kindVideoFlash:"Видео Flash",kindVideoMKV:"Видео Matroska",kindVideoOGG:"Видео Ogg"}}});
- !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(x){x.ui=x.ui||{};x.ui.version="1.12.1";var n,i=0,r=Array.prototype.slice;x.cleanData=(n=x.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)try{(e=x._data(i,"events"))&&e.remove&&x(i).triggerHandler("remove")}catch(t){}n(t)}),x.widget=function(t,i,e){var s,n,o,a={},r=t.split(".")[0],h=r+"-"+(t=t.split(".")[1]);return e||(e=i,i=x.Widget),x.isArray(e)&&(e=x.extend.apply(null,[{}].concat(e))),x.expr[":"][h.toLowerCase()]=function(t){return!!x.data(t,h)},x[r]=x[r]||{},s=x[r][t],n=x[r][t]=function(t,e){if(!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},x.extend(n,s,{version:e.version,_proto:x.extend({},e),_childConstructors:[]}),(o=new i).options=x.widget.extend({},o.options),x.each(e,function(e,s){function n(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}x.isFunction(s)?a[e]=function(){var t,e=this._super,i=this._superApply;return this._super=n,this._superApply=o,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:a[e]=s}),n.prototype=x.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},a,{constructor:n,namespace:r,widgetName:t,widgetFullName:h}),s?(x.each(s._childConstructors,function(t,e){var i=e.prototype;x.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),x.widget.bridge(t,n),n},x.widget.extend=function(t){for(var e,i,s=r.call(arguments,1),n=0,o=s.length;n<o;n++)for(e in s[n])i=s[n][e],s[n].hasOwnProperty(e)&&void 0!==i&&(x.isPlainObject(i)?t[e]=x.isPlainObject(t[e])?x.widget.extend({},t[e],i):x.widget.extend({},i):t[e]=i);return t},x.widget.bridge=function(o,e){var a=e.prototype.widgetFullName||o;x.fn[o]=function(i){var t="string"==typeof i,s=r.call(arguments,1),n=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=x.data(this,a);return"instance"===i?(n=e,!1):e?x.isFunction(e[i])&&"_"!==i.charAt(0)?(t=e[i].apply(e,s))!==e&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:x.error("no such method '"+i+"' for "+o+" widget instance"):x.error("cannot call methods on "+o+" prior to initialization; attempted to call method '"+i+"'")}):n=void 0:(s.length&&(i=x.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=x.data(this,a);t?(t.option(i||{}),t._init&&t._init()):x.data(this,a,new e(i,this))})),n}},x.Widget=function(){},x.Widget._childConstructors=[],x.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=x(e||this.defaultElement||this)[0],this.element=x(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=x(),this.hoverable=x(),this.focusable=x(),this.classesElementLookup={},e!==this&&(x.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=x(e.style?e.ownerDocument:e.document||e),this.window=x(this.document[0].defaultView||this.document[0].parentWindow)),this.options=x.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:x.noop,_create:x.noop,_init:x.noop,destroy:function(){var i=this;this._destroy(),x.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:x.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return x.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=x.widget.extend({},this.options[t]),n=0;n<i.length-1;n++)s[i[n]]=s[i[n]]||{},s=s[i[n]];if(t=i.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=e}return this._setOptions(o),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,s;for(e in t)s=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&s&&s.length&&(i=x(s.get()),this._removeClass(s,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(n){var o=[],a=this;function t(t,e){for(var i,s=0;s<t.length;s++)i=a.classesElementLookup[t[s]]||x(),i=n.add?x(x.unique(i.get().concat(n.element.get()))):x(i.not(n.element).get()),a.classesElementLookup[t[s]]=i,o.push(t[s]),e&&n.classes[t[s]]&&o.push(n.classes[t[s]])}return n=x.extend({element:this.element,classes:this.options.classes||{}},n),this._on(n.element,{remove:"_untrackClassesElement"}),n.keys&&t(n.keys.match(/\S+/g)||[],!0),n.extra&&t(n.extra.match(/\S+/g)||[]),o.join(" ")},_untrackClassesElement:function(i){var s=this;x.each(s.classesElementLookup,function(t,e){-1!==x.inArray(i.target,e)&&(s.classesElementLookup[t]=x(e.not(i.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(a,r,t){var h,l=this;"boolean"!=typeof a&&(t=r,r=a,a=!1),t?(r=h=x(r),this.bindings=this.bindings.add(r)):(t=r,r=this.element,h=this.widget()),x.each(t,function(t,e){function i(){if(a||!0!==l.options.disabled&&!x(this).hasClass("ui-state-disabled"))return("string"==typeof e?l[e]:e).apply(l,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||x.guid++);var s=t.match(/^([\w:-]*)\s*(.*)$/),n=s[1]+l.eventNamespace,o=s[2];o?h.on(n,o,i):r.on(n,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e).off(e),this.bindings=x(this.bindings.not(t).get()),this.focusable=x(this.focusable.not(t).get()),this.hoverable=x(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(x(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(x(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(x(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(x(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,n,o=this.options[t];if(i=i||{},(e=x.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],n=e.originalEvent)for(s in n)s in e||(e[s]=n[s]);return this.element.trigger(e,i),!(x.isFunction(o)&&!1===o.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},x.each({show:"fadeIn",hide:"fadeOut"},function(o,a){x.Widget.prototype["_"+o]=function(e,t,i){var s;"string"==typeof t&&(t={effect:t});var n=t?!0!==t&&"number"!=typeof t&&t.effect||a:o;"number"==typeof(t=t||{})&&(t={duration:t}),s=!x.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),s&&x.effects&&x.effects.effect[n]?e[o](t):n!==o&&e[n]?e[n](t.duration,t.easing,i):e.queue(function(t){x(this)[o](),i&&i.call(e[0]),t()})}});var o,k,C,s,a,h,l,c,D;x.widget;function I(t,e,i){return[parseFloat(t[0])*(c.test(t[0])?e/100:1),parseFloat(t[1])*(c.test(t[1])?i/100:1)]}function T(t,e){return parseInt(x.css(t,e),10)||0}k=Math.max,C=Math.abs,s=/left|center|right/,a=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,l=/^\w+/,c=/%$/,D=x.fn.position,x.position={scrollbarWidth:function(){if(void 0!==o)return o;var t,e,i=x("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),s=i.children()[0];return x("body").append(i),t=s.offsetWidth,i.css("overflow","scroll"),t===(e=s.offsetWidth)&&(e=i[0].clientWidth),i.remove(),o=t-e},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),s="scroll"===e||"auto"===e&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?x.position.scrollbarWidth():0,height:s?x.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=x(t||window),i=x.isWindow(e[0]),s=!!e[0]&&9===e[0].nodeType;return{element:e,isWindow:i,isDocument:s,offset:!i&&!s?x(t).offset():{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:e.outerWidth(),height:e.outerHeight()}}},x.fn.position=function(u){if(!u||!u.of)return D.apply(this,arguments);u=x.extend({},u);var d,p,f,g,m,t,e,_=x(u.of),v=x.position.getWithinInfo(u.within),b=x.position.getScrollInfo(v),y=(u.collision||"flip").split(" "),w={},i=9===(e=(t=_)[0]).nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:x.isWindow(e)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:e.preventDefault?{width:0,height:0,offset:{top:e.pageY,left:e.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()};return _[0].preventDefault&&(u.at="left top"),p=i.width,f=i.height,g=i.offset,m=x.extend({},g),x.each(["my","at"],function(){var t,e,i=(u[this]||"").split(" ");1===i.length&&(i=s.test(i[0])?i.concat(["center"]):a.test(i[0])?["center"].concat(i):["center","center"]),i[0]=s.test(i[0])?i[0]:"center",i[1]=a.test(i[1])?i[1]:"center",t=h.exec(i[0]),e=h.exec(i[1]),w[this]=[t?t[0]:0,e?e[0]:0],u[this]=[l.exec(i[0])[0],l.exec(i[1])[0]]}),1===y.length&&(y[1]=y[0]),"right"===u.at[0]?m.left+=p:"center"===u.at[0]&&(m.left+=p/2),"bottom"===u.at[1]?m.top+=f:"center"===u.at[1]&&(m.top+=f/2),d=I(w.at,p,f),m.left+=d[0],m.top+=d[1],this.each(function(){var i,t,a=x(this),r=a.outerWidth(),h=a.outerHeight(),e=T(this,"marginLeft"),s=T(this,"marginTop"),n=r+e+T(this,"marginRight")+b.width,o=h+s+T(this,"marginBottom")+b.height,l=x.extend({},m),c=I(w.my,a.outerWidth(),a.outerHeight());"right"===u.my[0]?l.left-=r:"center"===u.my[0]&&(l.left-=r/2),"bottom"===u.my[1]?l.top-=h:"center"===u.my[1]&&(l.top-=h/2),l.left+=c[0],l.top+=c[1],i={marginLeft:e,marginTop:s},x.each(["left","top"],function(t,e){x.ui.position[y[t]]&&x.ui.position[y[t]][e](l,{targetWidth:p,targetHeight:f,elemWidth:r,elemHeight:h,collisionPosition:i,collisionWidth:n,collisionHeight:o,offset:[d[0]+c[0],d[1]+c[1]],my:u.my,at:u.at,within:v,elem:a})}),u.using&&(t=function(t){var e=g.left-l.left,i=e+p-r,s=g.top-l.top,n=s+f-h,o={target:{element:_,left:g.left,top:g.top,width:p,height:f},element:{element:a,left:l.left,top:l.top,width:r,height:h},horizontal:i<0?"left":0<e?"right":"center",vertical:n<0?"top":0<s?"bottom":"middle"};p<r&&C(e+i)<p&&(o.horizontal="center"),f<h&&C(s+n)<f&&(o.vertical="middle"),k(C(e),C(i))>k(C(s),C(n))?o.important="horizontal":o.important="vertical",u.using.call(this,t,o)}),a.offset(x.extend(l,{using:t}))})},x.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,o=s.width,a=t.left-e.collisionPosition.marginLeft,r=n-a,h=a+e.collisionWidth-o-n;e.collisionWidth>o?0<r&&h<=0?(i=t.left+r+e.collisionWidth-o-n,t.left+=r-i):t.left=!(0<h&&r<=0)&&h<r?n+o-e.collisionWidth:n:0<r?t.left+=r:0<h?t.left-=h:t.left=k(t.left-a,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,o=e.within.height,a=t.top-e.collisionPosition.marginTop,r=n-a,h=a+e.collisionHeight-o-n;e.collisionHeight>o?0<r&&h<=0?(i=t.top+r+e.collisionHeight-o-n,t.top+=r-i):t.top=!(0<h&&r<=0)&&h<r?n+o-e.collisionHeight:n:0<r?t.top+=r:0<h?t.top-=h:t.top=k(t.top-a,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,a=n.width,r=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,l=h-r,c=h+e.collisionWidth-a-r,u="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,d="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,p=-2*e.offset[0];l<0?((i=t.left+u+d+p+e.collisionWidth-a-o)<0||i<C(l))&&(t.left+=u+d+p):0<c&&(0<(s=t.left-e.collisionPosition.marginLeft+u+d+p-r)||C(s)<c)&&(t.left+=u+d+p)},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,a=n.height,r=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,l=h-r,c=h+e.collisionHeight-a-r,u="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,d="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,p=-2*e.offset[1];l<0?((s=t.top+u+d+p+e.collisionHeight-a-o)<0||s<C(l))&&(t.top+=u+d+p):0<c&&(0<(i=t.top-e.collisionPosition.marginTop+u+d+p-r)||C(i)<c)&&(t.top+=u+d+p)}},flipfit:{left:function(){x.ui.position.flip.left.apply(this,arguments),x.ui.position.fit.left.apply(this,arguments)},top:function(){x.ui.position.flip.top.apply(this,arguments),x.ui.position.fit.top.apply(this,arguments)}}};x.ui.position,x.extend(x.expr[":"],{data:x.expr.createPseudo?x.expr.createPseudo(function(e){return function(t){return!!x.data(t,e)}}):function(t,e,i){return!!x.data(t,i[3])}}),x.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}});var t,u,d,p,f,e,g,m,_,v,b,y,w,P,M,S,H,z,O,A,N,W,E="ui-effects-",F="ui-effects-style",L="ui-effects-animated",R=x;function B(t,e,i){var s=_[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:t<0?0:s.max<t?s.max:t)}function Y(a){var r=g(),h=r._rgba=[];return a=a.toLowerCase(),y(e,function(t,e){var i,s=e.re.exec(a),n=s&&e.parse(s),o=e.space||"rgba";if(n)return i=r[o](n),r[m[o].cache]=i[m[o].cache],h=r._rgba=i._rgba,!1}),h.length?("0,0,0,0"===h.join()&&u.extend(h,p.transparent),r):p[a]}function j(t,e,i){return 6*(i=(i+1)%1)<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}function q(t){var e,i,s=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,n={};if(s&&s.length&&s[0]&&s[s[0]])for(i=s.length;i--;)"string"==typeof s[e=s[i]]&&(n[x.camelCase(e)]=s[e]);else for(e in s)"string"==typeof s[e]&&(n[e]=s[e]);return n}function K(t,e,i,s){return x.isPlainObject(t)&&(t=(e=t).effect),t={effect:t},null==e&&(e={}),x.isFunction(e)&&(s=e,i=null,e={}),"number"!=typeof e&&!x.fx.speeds[e]||(s=i,i=e,e={}),x.isFunction(i)&&(s=i,i=null),e&&x.extend(t,e),i=i||e.duration,t.duration=x.fx.off?0:"number"==typeof i?i:i in x.fx.speeds?x.fx.speeds[i]:x.fx.speeds._default,t.complete=s||e.complete,t}function U(t){return!t||"number"==typeof t||x.fx.speeds[t]||("string"==typeof t&&!x.effects.effect[t]||(x.isFunction(t)||"object"==typeof t&&!t.effect))}function V(t,e){var i=e.outerWidth(),s=e.outerHeight(),n=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(t)||["",0,i,s,0];return{top:parseFloat(n[1])||0,right:"auto"===n[2]?i:parseFloat(n[2]),bottom:"auto"===n[3]?s:parseFloat(n[3]),left:parseFloat(n[4])||0}}x.effects={effect:{}},f=/^([\-+])=\s*(\d+\.?\d*)/,e=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],g=(u=R).Color=function(t,e,i,s){return new u.Color.fn.parse(t,e,i,s)},m={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},_={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},v=g.support={},b=u("<p>")[0],y=u.each,b.style.cssText="background-color:rgba(1,1,1,.5)",v.rgba=-1<b.style.backgroundColor.indexOf("rgba"),y(m,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),g.fn=u.extend(g.prototype,{parse:function(n,t,e,i){if(n===d)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=u(n).css(t),t=d);var o=this,s=u.type(n),a=this._rgba=[];return t!==d&&(n=[n,t,e,i],s="array"),"string"===s?this.parse(Y(n)||p._default):"array"===s?(y(m.rgba.props,function(t,e){a[e.idx]=B(n[e.idx],e)}),this):"object"===s?(y(m,n instanceof g?function(t,e){n[e.cache]&&(o[e.cache]=n[e.cache].slice())}:function(t,i){var s=i.cache;y(i.props,function(t,e){if(!o[s]&&i.to){if("alpha"===t||null==n[t])return;o[s]=i.to(o._rgba)}o[s][e.idx]=B(n[t],e,!0)}),o[s]&&u.inArray(null,o[s].slice(0,3))<0&&(o[s][3]=1,i.from&&(o._rgba=i.from(o[s])))}),this):void 0},is:function(t){var n=g(t),o=!0,a=this;return y(m,function(t,e){var i,s=n[e.cache];return s&&(i=a[e.cache]||e.to&&e.to(a._rgba)||[],y(e.props,function(t,e){if(null!=s[e.idx])return o=s[e.idx]===i[e.idx]})),o}),o},_space:function(){var i=[],s=this;return y(m,function(t,e){s[e.cache]&&i.push(t)}),i.pop()},transition:function(t,a){var e=(l=g(t))._space(),i=m[e],s=0===this.alpha()?g("transparent"):this,r=s[i.cache]||i.to(s._rgba),h=r.slice(),l=l[i.cache];return y(i.props,function(t,e){var i=e.idx,s=r[i],n=l[i],o=_[e.type]||{};null!==n&&(null===s?h[i]=n:(o.mod&&(o.mod/2<n-s?s+=o.mod:o.mod/2<s-n&&(s-=o.mod)),h[i]=B((n-s)*a+s,e)))}),this[e](h)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),i=e.pop(),s=g(t)._rgba;return g(u.map(e,function(t,e){return(1-i)*s[e]+i*t}))},toRgbaString:function(){var t="rgba(",e=u.map(this._rgba,function(t,e){return null==t?2<e?1:0:t});return 1===e[3]&&(e.pop(),t="rgb("),t+e.join()+")"},toHslaString:function(){var t="hsla(",e=u.map(this.hsla(),function(t,e){return null==t&&(t=2<e?1:0),e&&e<3&&(t=Math.round(100*t)+"%"),t});return 1===e[3]&&(e.pop(),t="hsl("),t+e.join()+")"},toHexString:function(t){var e=this._rgba.slice(),i=e.pop();return t&&e.push(~~(255*i)),"#"+u.map(e,function(t){return 1===(t=(t||0).toString(16)).length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),g.fn.parse.prototype=g.fn,m.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/255,i=t[1]/255,s=t[2]/255,n=t[3],o=Math.max(e,i,s),a=Math.min(e,i,s),r=o-a,h=o+a,l=.5*h,c=a===o?0:e===o?60*(i-s)/r+360:i===o?60*(s-e)/r+120:60*(e-i)/r+240,u=0==r?0:l<=.5?r/h:r/(2-h);return[Math.round(c)%360,u,l,null==n?1:n]},m.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],n=t[3],o=s<=.5?s*(1+i):s+i-s*i,a=2*s-o;return[Math.round(255*j(a,o,e+1/3)),Math.round(255*j(a,o,e)),Math.round(255*j(a,o,e-1/3)),n]},y(m,function(h,t){var i=t.props,a=t.cache,r=t.to,l=t.from;g.fn[h]=function(t){if(r&&!this[a]&&(this[a]=r(this._rgba)),t===d)return this[a].slice();var e,s=u.type(t),n="array"===s||"object"===s?t:arguments,o=this[a].slice();return y(i,function(t,e){var i=n["object"===s?t:e.idx];null==i&&(i=o[e.idx]),o[e.idx]=B(i,e)}),l?((e=g(l(o)))[a]=o,e):g(o)},y(i,function(a,r){g.fn[a]||(g.fn[a]=function(t){var e,i=u.type(t),s="alpha"===a?this._hsla?"hsla":"rgba":h,n=this[s](),o=n[r.idx];return"undefined"===i?o:("function"===i&&(t=t.call(this,o),i=u.type(t)),null==t&&r.empty?this:("string"===i&&(e=f.exec(t))&&(t=o+parseFloat(e[2])*("+"===e[1]?1:-1)),n[r.idx]=t,this[s](n)))})})}),g.hook=function(t){var e=t.split(" ");y(e,function(t,o){u.cssHooks[o]={set:function(t,e){var i,s,n="";if("transparent"!==e&&("string"!==u.type(e)||(i=Y(e)))){if(e=g(i||e),!v.rgba&&1!==e._rgba[3]){for(s="backgroundColor"===o?t.parentNode:t;(""===n||"transparent"===n)&&s&&s.style;)try{n=u.css(s,"backgroundColor"),s=s.parentNode}catch(t){}e=e.blend(n&&"transparent"!==n?n:"_default")}e=e.toRgbaString()}try{t.style[o]=e}catch(t){}}},u.fx.step[o]=function(t){t.colorInit||(t.start=g(t.elem,o),t.end=g(t.end),t.colorInit=!0),u.cssHooks[o].set(t.elem,t.start.transition(t.end,t.pos))}})},g.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),u.cssHooks.borderColor={expand:function(i){var s={};return y(["Top","Right","Bottom","Left"],function(t,e){s["border"+e+"Color"]=i}),s}},p=u.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"},S=["add","remove","toggle"],H={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1},x.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,e){x.fx.step[e]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(R.style(t.elem,e,t.end),t.setAttr=!0)}}),x.fn.addBack||(x.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),x.effects.animateClass=function(n,t,e,i){var o=x.speed(t,e,i);return this.queue(function(){var i=x(this),t=i.attr("class")||"",e=(e=o.children?i.find("*").addBack():i).map(function(){return{el:x(this),start:q(this)}}),s=function(){x.each(S,function(t,e){n[e]&&i[e+"Class"](n[e])})};s(),e=e.map(function(){return this.end=q(this.el[0]),this.diff=function(t,e){var i,s,n={};for(i in e)s=e[i],t[i]!==s&&(H[i]||!x.fx.step[i]&&isNaN(parseFloat(s))||(n[i]=s));return n}(this.start,this.end),this}),i.attr("class",t),e=e.map(function(){var t=this,e=x.Deferred(),i=x.extend({},o,{queue:!1,complete:function(){e.resolve(t)}});return this.el.animate(this.diff,i),e.promise()}),x.when.apply(x,e.get()).done(function(){s(),x.each(arguments,function(){var e=this.el;x.each(this.diff,function(t){e.css(t,"")})}),o.complete.call(i[0])})})},x.fn.extend({addClass:(M=x.fn.addClass,function(t,e,i,s){return e?x.effects.animateClass.call(this,{add:t},e,i,s):M.apply(this,arguments)}),removeClass:(P=x.fn.removeClass,function(t,e,i,s){return 1<arguments.length?x.effects.animateClass.call(this,{remove:t},e,i,s):P.apply(this,arguments)}),toggleClass:(w=x.fn.toggleClass,function(t,e,i,s,n){return"boolean"==typeof e||void 0===e?i?x.effects.animateClass.call(this,e?{add:t}:{remove:t},i,s,n):w.apply(this,arguments):x.effects.animateClass.call(this,{toggle:t},e,i,s)}),switchClass:function(t,e,i,s,n){return x.effects.animateClass.call(this,{add:e,remove:t},i,s,n)}}),x.expr&&x.expr.filters&&x.expr.filters.animated&&(x.expr.filters.animated=(z=x.expr.filters.animated,function(t){return!!x(t).data(L)||z(t)})),!1!==x.uiBackCompat&&x.extend(x.effects,{save:function(t,e){for(var i=0,s=e.length;i<s;i++)null!==e[i]&&t.data(E+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;s<n;s++)null!==e[s]&&(i=t.data(E+e[s]),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},createWrapper:function(i){if(i.parent().is(".ui-effects-wrapper"))return i.parent();var s={width:i.outerWidth(!0),height:i.outerHeight(!0),float:i.css("float")},t=x("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:i.width(),height:i.height()},n=document.activeElement;try{n.id}catch(t){n=document.body}return i.wrap(t),i[0]!==n&&!x.contains(i[0],n)||x(n).trigger("focus"),t=i.parent(),"static"===i.css("position")?(t.css({position:"relative"}),i.css({position:"relative"})):(x.extend(s,{position:i.css("position"),zIndex:i.css("z-index")}),x.each(["top","left","bottom","right"],function(t,e){s[e]=i.css(e),isNaN(parseInt(s[e],10))&&(s[e]="auto")}),i.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),i.css(e),t.css(s).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!x.contains(t[0],e)||x(e).trigger("focus")),t}}),x.extend(x.effects,{version:"1.12.1",define:function(t,e,i){return i||(i=e,e="effect"),x.effects.effect[t]=i,x.effects.effect[t].mode=e,i},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,n="vertical"!==i?(e||100)/100:1;return{height:t.height()*n,width:t.width()*s,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();1<e&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(F,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(F)||"",t.removeData(F)},mode:function(t,e){var i=t.is(":hidden");return"toggle"===e&&(e=i?"show":"hide"),(i?"hide"===e:"show"===e)&&(e="none"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(t){var e,i=t.css("position"),s=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(i)&&(i="absolute",e=x("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(E+"placeholder",e)),t.css({position:i,left:s.left,top:s.top}),e},removePlaceholder:function(t){var e=E+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(t){x.effects.restoreStyle(t),x.effects.removePlaceholder(t)},setTransition:function(s,t,n,o){return o=o||{},x.each(t,function(t,e){var i=s.cssUnit(e);0<i[0]&&(o[e]=i[0]*n+i[1])}),o}}),x.fn.extend({effect:function(){function t(t){var e=x(this),i=x.effects.mode(e,r)||o;e.data(L,!0),h.push(i),o&&("show"===i||i===o&&"hide"===i)&&e.show(),o&&"none"===i||x.effects.saveStyle(e),x.isFunction(t)&&t()}var s=K.apply(this,arguments),n=x.effects.effect[s.effect],o=n.mode,e=s.queue,i=e||"fx",a=s.complete,r=s.mode,h=[];if(x.fx.off||!n)return r?this[r](s.duration,a):this.each(function(){a&&a.call(this)});function l(t){var e=x(this);function i(){x.isFunction(a)&&a.call(e[0]),x.isFunction(t)&&t()}s.mode=h.shift(),!1===x.uiBackCompat||o?"none"===s.mode?(e[r](),i()):n.call(e[0],s,function(){e.removeData(L),x.effects.cleanUp(e),"hide"===s.mode&&e.hide(),i()}):(e.is(":hidden")?"hide"===r:"show"===r)?(e[r](),i()):n.call(e[0],s,i)}return!1===e?this.each(t).each(l):this.queue(i,t).queue(i,l)},show:(N=x.fn.show,function(t){if(U(t))return N.apply(this,arguments);var e=K.apply(this,arguments);return e.mode="show",this.effect.call(this,e)}),hide:(A=x.fn.hide,function(t){if(U(t))return A.apply(this,arguments);var e=K.apply(this,arguments);return e.mode="hide",this.effect.call(this,e)}),toggle:(O=x.fn.toggle,function(t){if(U(t)||"boolean"==typeof t)return O.apply(this,arguments);var e=K.apply(this,arguments);return e.mode="toggle",this.effect.call(this,e)}),cssUnit:function(t){var i=this.css(t),s=[];return x.each(["em","px","%","pt"],function(t,e){0<i.indexOf(e)&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):V(this.css("clip"),this)},transfer:function(t,e){var i=x(this),s=x(t.to),n="fixed"===s.css("position"),o=x("body"),a=n?o.scrollTop():0,r=n?o.scrollLeft():0,h=s.offset(),l={top:h.top-a,left:h.left-r,height:s.innerHeight(),width:s.innerWidth()},c=i.offset(),u=x("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(t.className).css({top:c.top-a,left:c.left-r,height:i.innerHeight(),width:i.innerWidth(),position:n?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){u.remove(),x.isFunction(e)&&e()})}}),x.fx.step.clip=function(t){t.clipInit||(t.start=x(t.elem).cssClip(),"string"==typeof t.end&&(t.end=V(t.end,t.elem)),t.clipInit=!0),x(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},W={},x.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){W[t]=function(t){return Math.pow(t,e+2)}}),x.extend(W,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),x.each(W,function(t,e){x.easing["easeIn"+t]=e,x.easing["easeOut"+t]=function(t){return 1-e(1-t)},x.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}});x.effects,x.effects.define("blind","hide",function(t,e){var i={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},s=x(this),n=t.direction||"up",o=s.cssClip(),a={clip:x.extend({},o)},r=x.effects.createPlaceholder(s);a.clip[i[n][0]]=a.clip[i[n][1]],"show"===t.mode&&(s.cssClip(a.clip),r&&r.css(x.effects.clipToBox(a)),a.clip=o),r&&r.animate(x.effects.clipToBox(a),t.duration,t.easing),s.animate(a,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),x.effects.define("bounce",function(t,e){var i,s,n,o=x(this),a=t.mode,r="hide"===a,h="show"===a,l=t.direction||"up",c=t.distance,u=t.times||5,d=2*u+(h||r?1:0),p=t.duration/d,f=t.easing,g="up"===l||"down"===l?"top":"left",m="up"===l||"left"===l,_=0,v=o.queue().length;for(x.effects.createPlaceholder(o),n=o.css(g),c=c||o["top"==g?"outerHeight":"outerWidth"]()/3,h&&((s={opacity:1})[g]=n,o.css("opacity",0).css(g,m?2*-c:2*c).animate(s,p,f)),r&&(c/=Math.pow(2,u-1)),(s={})[g]=n;_<u;_++)(i={})[g]=(m?"-=":"+=")+c,o.animate(i,p,f).animate(s,p,f),c=r?2*c:c/2;r&&((i={opacity:0})[g]=(m?"-=":"+=")+c,o.animate(i,p,f)),o.queue(e),x.effects.unshift(o,v,1+d)}),x.effects.define("clip","hide",function(t,e){var i={},s=x(this),n=t.direction||"vertical",o="both"===n,a=o||"horizontal"===n,r=o||"vertical"===n,h=s.cssClip();i.clip={top:r?(h.bottom-h.top)/2:h.top,right:a?(h.right-h.left)/2:h.right,bottom:r?(h.bottom-h.top)/2:h.bottom,left:a?(h.right-h.left)/2:h.left},x.effects.createPlaceholder(s),"show"===t.mode&&(s.cssClip(i.clip),i.clip=h),s.animate(i,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),x.effects.define("drop","hide",function(t,e){var i,s=x(this),n="show"===t.mode,o=t.direction||"left",a="up"===o||"down"===o?"top":"left",r="up"===o||"left"===o?"-=":"+=",h="+="==r?"-=":"+=",l={opacity:0};x.effects.createPlaceholder(s),i=t.distance||s["top"==a?"outerHeight":"outerWidth"](!0)/2,l[a]=r+i,n&&(s.css(l),l[a]=h+i,l.opacity=1),s.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),x.effects.define("explode","hide",function(t,e){var i,s,n,o,a,r,h=t.pieces?Math.round(Math.sqrt(t.pieces)):3,l=h,c=x(this),u="show"===t.mode,d=c.show().css("visibility","hidden").offset(),p=Math.ceil(c.outerWidth()/l),f=Math.ceil(c.outerHeight()/h),g=[];function m(){g.push(this),g.length===h*l&&(c.css({visibility:"visible"}),x(g).remove(),e())}for(i=0;i<h;i++)for(o=d.top+i*f,r=i-(h-1)/2,s=0;s<l;s++)n=d.left+s*p,a=s-(l-1)/2,c.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-s*p,top:-i*f}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:p,height:f,left:n+(u?a*p:0),top:o+(u?r*f:0),opacity:u?0:1}).animate({left:n+(u?0:a*p),top:o+(u?0:r*f),opacity:u?1:0},t.duration||500,t.easing,m)}),x.effects.define("fade","toggle",function(t,e){var i="show"===t.mode;x(this).css("opacity",i?0:1).animate({opacity:i?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),x.effects.define("fold","hide",function(e,t){var i=x(this),s=e.mode,n="show"===s,o="hide"===s,a=e.size||15,r=/([0-9]+)%/.exec(a),h=!!e.horizFirst?["right","bottom"]:["bottom","right"],l=e.duration/2,c=x.effects.createPlaceholder(i),u=i.cssClip(),d={clip:x.extend({},u)},p={clip:x.extend({},u)},f=[u[h[0]],u[h[1]]],g=i.queue().length;r&&(a=parseInt(r[1],10)/100*f[o?0:1]),d.clip[h[0]]=a,p.clip[h[0]]=a,p.clip[h[1]]=0,n&&(i.cssClip(p.clip),c&&c.css(x.effects.clipToBox(p)),p.clip=u),i.queue(function(t){c&&c.animate(x.effects.clipToBox(d),l,e.easing).animate(x.effects.clipToBox(p),l,e.easing),t()}).animate(d,l,e.easing).animate(p,l,e.easing).queue(t),x.effects.unshift(i,g,4)}),x.effects.define("highlight","show",function(t,e){var i=x(this),s={backgroundColor:i.css("backgroundColor")};"hide"===t.mode&&(s.opacity=0),x.effects.saveStyle(i),i.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(s,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),x.effects.define("size",function(n,e){var t,o,i,s=x(this),a=["fontSize"],r=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],l=n.mode,c="effect"!==l,u=n.scale||"both",d=n.origin||["middle","center"],p=s.css("position"),f=s.position(),g=x.effects.scaledDimensions(s),m=n.from||g,_=n.to||x.effects.scaledDimensions(s,0);x.effects.createPlaceholder(s),"show"===l&&(i=m,m=_,_=i),o={from:{y:m.height/g.height,x:m.width/g.width},to:{y:_.height/g.height,x:_.width/g.width}},"box"!==u&&"both"!==u||(o.from.y!==o.to.y&&(m=x.effects.setTransition(s,r,o.from.y,m),_=x.effects.setTransition(s,r,o.to.y,_)),o.from.x!==o.to.x&&(m=x.effects.setTransition(s,h,o.from.x,m),_=x.effects.setTransition(s,h,o.to.x,_))),"content"!==u&&"both"!==u||o.from.y!==o.to.y&&(m=x.effects.setTransition(s,a,o.from.y,m),_=x.effects.setTransition(s,a,o.to.y,_)),d&&(t=x.effects.getBaseline(d,g),m.top=(g.outerHeight-m.outerHeight)*t.y+f.top,m.left=(g.outerWidth-m.outerWidth)*t.x+f.left,_.top=(g.outerHeight-_.outerHeight)*t.y+f.top,_.left=(g.outerWidth-_.outerWidth)*t.x+f.left),s.css(m),"content"!==u&&"both"!==u||(r=r.concat(["marginTop","marginBottom"]).concat(a),h=h.concat(["marginLeft","marginRight"]),s.find("*[width]").each(function(){var t=x(this),e=x.effects.scaledDimensions(t),i={height:e.height*o.from.y,width:e.width*o.from.x,outerHeight:e.outerHeight*o.from.y,outerWidth:e.outerWidth*o.from.x},s={height:e.height*o.to.y,width:e.width*o.to.x,outerHeight:e.height*o.to.y,outerWidth:e.width*o.to.x};o.from.y!==o.to.y&&(i=x.effects.setTransition(t,r,o.from.y,i),s=x.effects.setTransition(t,r,o.to.y,s)),o.from.x!==o.to.x&&(i=x.effects.setTransition(t,h,o.from.x,i),s=x.effects.setTransition(t,h,o.to.x,s)),c&&x.effects.saveStyle(t),t.css(i),t.animate(s,n.duration,n.easing,function(){c&&x.effects.restoreStyle(t)})})),s.animate(_,{queue:!1,duration:n.duration,easing:n.easing,complete:function(){var t=s.offset();0===_.opacity&&s.css("opacity",m.opacity),c||(s.css("position","static"===p?"relative":p).offset(t),x.effects.saveStyle(s)),e()}})}),x.effects.define("scale",function(t,e){var i=x(this),s=t.mode,n=parseInt(t.percent,10)||(0===parseInt(t.percent,10)||"effect"!==s?0:100),o=x.extend(!0,{from:x.effects.scaledDimensions(i),to:x.effects.scaledDimensions(i,n,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(o.from.opacity=1,o.to.opacity=0),x.effects.effect.size.call(this,o,e)}),x.effects.define("puff","hide",function(t,e){var i=x.extend(!0,{},t,{fade:!0,percent:parseInt(t.percent,10)||150});x.effects.effect.scale.call(this,i,e)}),x.effects.define("pulsate","show",function(t,e){var i=x(this),s=t.mode,n="show"===s,o=n||"hide"===s,a=2*(t.times||5)+(o?1:0),r=t.duration/a,h=0,l=1,c=i.queue().length;for(!n&&i.is(":visible")||(i.css("opacity",0).show(),h=1);l<a;l++)i.animate({opacity:h},r,t.easing),h=1-h;i.animate({opacity:h},r,t.easing),i.queue(e),x.effects.unshift(i,c,1+a)}),x.effects.define("shake",function(t,e){var i=1,s=x(this),n=t.direction||"left",o=t.distance||20,a=t.times||3,r=2*a+1,h=Math.round(t.duration/r),l="up"===n||"down"===n?"top":"left",c="up"===n||"left"===n,u={},d={},p={},f=s.queue().length;for(x.effects.createPlaceholder(s),u[l]=(c?"-=":"+=")+o,d[l]=(c?"+=":"-=")+2*o,p[l]=(c?"-=":"+=")+2*o,s.animate(u,h,t.easing);i<a;i++)s.animate(d,h,t.easing).animate(p,h,t.easing);s.animate(d,h,t.easing).animate(u,h/2,t.easing).queue(e),x.effects.unshift(s,f,1+r)}),x.effects.define("slide","show",function(t,e){var i,s,n=x(this),o={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},a=t.mode,r=t.direction||"left",h="up"===r||"down"===r?"top":"left",l="up"===r||"left"===r,c=t.distance||n["top"==h?"outerHeight":"outerWidth"](!0),u={};x.effects.createPlaceholder(n),i=n.cssClip(),s=n.position()[h],u[h]=(l?-1:1)*c+s,u.clip=n.cssClip(),u.clip[o[r][1]]=u.clip[o[r][0]],"show"===a&&(n.cssClip(u.clip),n.css(h,u[h]),u.clip=i,u[h]=s),n.animate(u,{queue:!1,duration:t.duration,easing:t.easing,complete:e})});!1!==x.uiBackCompat&&x.effects.define("transfer",function(t,e){x(this).transfer(t,e)});x.ui.focusable=function(t,e){var i,s,n,o,a,r=t.nodeName.toLowerCase();return"area"===r?(s=(i=t.parentNode).name,!(!t.href||!s||"map"!==i.nodeName.toLowerCase())&&(0<(n=x("img[usemap='#"+s+"']")).length&&n.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(r)?(o=!t.disabled)&&(a=x(t).closest("fieldset")[0])&&(o=!a.disabled):o="a"===r&&t.href||e,o&&x(t).is(":visible")&&function(t){var e=t.css("visibility");for(;"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}(x(t)))},x.extend(x.expr[":"],{focusable:function(t){return x.ui.focusable(t,null!=x.attr(t,"tabindex"))}});x.ui.focusable,x.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):x(this[0].form)},x.ui.formResetMixin={_formResetHandler:function(){var e=x(this);setTimeout(function(){var t=e.data("ui-form-reset-instances");x.each(t,function(){this.refresh()})})},_bindFormResetHandler:function(){var t;this.form=this.element.form(),this.form.length&&((t=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(x.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}};"1.7"===x.fn.jquery.substring(0,3)&&(x.each(["Width","Height"],function(t,i){var n="Width"===i?["Left","Right"]:["Top","Bottom"],s=i.toLowerCase(),o={innerWidth:x.fn.innerWidth,innerHeight:x.fn.innerHeight,outerWidth:x.fn.outerWidth,outerHeight:x.fn.outerHeight};function a(t,e,i,s){return x.each(n,function(){e-=parseFloat(x.css(t,"padding"+this))||0,i&&(e-=parseFloat(x.css(t,"border"+this+"Width"))||0),s&&(e-=parseFloat(x.css(t,"margin"+this))||0)}),e}x.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){x(this).css(s,a(this,t)+"px")})},x.fn["outer"+i]=function(t,e){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){x(this).css(s,a(this,t,!0,e)+"px")})}}),x.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))});var $,X;x.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},x.ui.escapeSelector=($=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g,function(t){return t.replace($,"\\$1")}),x.fn.labels=function(){var t,e,i,s,n;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(s=this.eq(0).parents("label"),(i=this.attr("id"))&&(n=(t=this.eq(0).parents().last()).add(t.length?t.siblings():this.siblings()),e="label[for='"+x.ui.escapeSelector(i)+"']",s=s.add(n.find(e).addBack(e))),this.pushStack(s))},x.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,n=this.parents().filter(function(){var t=x(this);return(!i||"static"!==t.css("position"))&&s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&n.length?n:x(this[0].ownerDocument||document)},x.extend(x.expr[":"],{tabbable:function(t){var e=x.attr(t,"tabindex"),i=null!=e;return(!i||0<=e)&&x.ui.focusable(t,i)}}),x.fn.extend({uniqueId:(X=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++X)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&x(this).removeAttr("id")})}}),x.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=x(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||!1!==t.active&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():x()}},_createIcons:function(){var t,e,i=this.options.icons;i&&(t=x("<span>"),this._addClass(t,"ui-accordion-header-icon","ui-icon "+i.header),t.prependTo(this.headers),e=this.active.children(".ui-accordion-header-icon"),this._removeClass(e,i.header)._addClass(e,null,i.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){"active"!==t?("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons())):this._activate(e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var e=x.ui.keyCode,i=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case e.RIGHT:case e.DOWN:n=this.headers[(s+1)%i];break;case e.LEFT:case e.UP:n=this.headers[(s-1+i)%i];break;case e.SPACE:case e.ENTER:this._eventHandler(t);break;case e.HOME:n=this.headers[0];break;case e.END:n=this.headers[i-1]}n&&(x(t.target).attr("tabIndex",-1),x(n).attr("tabIndex",0),x(n).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===x.ui.keyCode.UP&&t.ctrlKey&&x(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),!1===t.active&&!0===t.collapsible||!this.headers.length?(t.active=!1,this.active=x()):!1===t.active?this._activate(0):this.active.length&&!x.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=x()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var i,t=this.options,e=t.heightStyle,s=this.element.parent();this.active=this._findActive(t.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=x(this),e=t.uniqueId().attr("id"),i=t.next(),s=i.uniqueId().attr("id");t.attr("aria-controls",s),i.attr("aria-labelledby",e)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(t.event),"fill"===e?(i=s.height(),this.element.siblings(":visible").each(function(){var t=x(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=x(this).outerHeight(!0)}),this.headers.next().each(function(){x(this).height(Math.max(0,i-x(this).innerHeight()+x(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.headers.next().each(function(){var t=x(this).is(":visible");t||x(this).show(),i=Math.max(i,x(this).css("height","").height()),t||x(this).hide()}).height(i))},_activate:function(t){var e=this._findActive(t)[0];e!==this.active[0]&&(e=e||this.active[0],this._eventHandler({target:e,currentTarget:e,preventDefault:x.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):x()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&x.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var e,i,s=this.options,n=this.active,o=x(t.currentTarget),a=o[0]===n[0],r=a&&s.collapsible,h=r?x():o.next(),l=n.next(),c={oldHeader:n,oldPanel:l,newHeader:r?x():o,newPanel:h};t.preventDefault(),a&&!s.collapsible||!1===this._trigger("beforeActivate",t,c)||(s.active=!r&&this.headers.index(o),this.active=a?x():o,this._toggle(c),this._removeClass(n,"ui-accordion-header-active","ui-state-active"),s.icons&&(e=n.children(".ui-accordion-header-icon"),this._removeClass(e,null,s.icons.activeHeader)._addClass(e,null,s.icons.header)),a||(this._removeClass(o,"ui-accordion-header-collapsed")._addClass(o,"ui-accordion-header-active","ui-state-active"),s.icons&&(i=o.children(".ui-accordion-header-icon"),this._removeClass(i,null,s.icons.header)._addClass(i,null,s.icons.activeHeader)),this._addClass(o.next(),"ui-accordion-content-active")))},_toggle:function(t){var e=t.newPanel,i=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=e,this.prevHide=i,this.options.animate?this._animate(e,i,t):(i.hide(),e.show(),this._toggleComplete(t)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),e.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):e.length&&this.headers.filter(function(){return 0===parseInt(x(this).attr("tabIndex"),10)}).attr("tabIndex",-1),e.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,i,e){function s(){r._toggleComplete(e)}var n,o,a,r=this,h=0,l=t.css("box-sizing"),c=t.length&&(!i.length||t.index()<i.index()),u=this.options.animate||{},d=c&&u.down||u;return"number"==typeof d&&(a=d),"string"==typeof d&&(o=d),o=o||d.easing||u.easing,a=a||d.duration||u.duration,i.length?t.length?(n=t.show().outerHeight(),i.animate(this.hideProps,{duration:a,easing:o,step:function(t,e){e.now=Math.round(t)}}),void t.hide().animate(this.showProps,{duration:a,easing:o,complete:s,step:function(t,e){e.now=Math.round(t),"height"!==e.prop?"content-box"===l&&(h+=e.now):"content"!==r.options.heightStyle&&(e.now=Math.round(n-i.outerHeight()-h),h=0)}})):i.animate(this.hideProps,a,o,s):t.animate(this.showProps,a,o,s)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),x.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return(i=i||e.body).nodeName||(i=e.body),i},x.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(t){var e=x(t.target),i=x(x.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&e.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),e.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var e,i;this.previousFilter||(e=x(t.target).closest(".ui-menu-item"),i=x(t.currentTarget),e[0]===i[0]&&(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i)))},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(t){this._delay(function(){x.contains(this.element[0],x.ui.safeActiveElement(this.document[0]))||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=x(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var e,i,s,n,o=!0;switch(t.keyCode){case x.ui.keyCode.PAGE_UP:this.previousPage(t);break;case x.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case x.ui.keyCode.HOME:this._move("first","first",t);break;case x.ui.keyCode.END:this._move("last","last",t);break;case x.ui.keyCode.UP:this.previous(t);break;case x.ui.keyCode.DOWN:this.next(t);break;case x.ui.keyCode.LEFT:this.collapse(t);break;case x.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case x.ui.keyCode.ENTER:case x.ui.keyCode.SPACE:this._activate(t);break;case x.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,i=this.previousFilter||"",n=!1,s=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),s===i?n=!0:s=i+s,e=this._filterMenuItems(s),(e=n&&-1!==e.index(this.active.next())?this.active.nextAll(".ui-menu-item"):e).length||(s=String.fromCharCode(t.keyCode),e=this._filterMenuItems(s)),e.length?(this.focus(t,e),this.previousFilter=s,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var t,e,i,s,n=this,o=this.options.icons.submenu,a=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),e=a.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=x(this),e=t.prev(),i=x("<span>").data("ui-menu-submenu-caret",!0);n._addClass(i,"ui-menu-icon","ui-icon "+o),e.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",e.attr("id"))}),this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front"),(t=a.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=x(this);n._isDivider(t)&&n._addClass(t,"ui-menu-divider","ui-widget-content")}),s=(i=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(i,"ui-menu-item")._addClass(s,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!x.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){var i;"icons"===t&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i,s,n;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children(".ui-menu-item-wrapper"),this._addClass(s,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),n=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(n,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(t){var e,i,s,n,o,a;this._hasScroll()&&(e=parseFloat(x.css(this.activeMenu[0],"borderTopWidth"))||0,i=parseFloat(x.css(this.activeMenu[0],"paddingTop"))||0,s=t.offset().top-this.activeMenu.offset().top-e-i,n=this.activeMenu.scrollTop(),o=this.activeMenu.height(),a=t.outerHeight(),s<0?this.activeMenu.scrollTop(n+s):o<s+a&&this.activeMenu.scrollTop(n+s-o+a))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(t){var e=x.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(e)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var t=i?this.element:x(e&&e.target).closest(this.element.find(".ui-menu"));t.length||(t=this.element),this._close(t),this.blur(e),this._removeClass(t.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=t},this.delay)},_close:function(t){(t=t||(this.active?this.active.parent():this.element)).find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(t){return!x(t.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[e]()),this.focus(i,s)},nextPage:function(t){var e,i,s;this.active?this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return(e=x(this)).offset().top-i-s<0}),this.focus(t,e)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())):this.next(t)},previousPage:function(t){var e,i,s;this.active?this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return 0<(e=x(this)).offset().top-i+s}),this.focus(t,e)):this.focus(t,this.activeMenu.find(this.options.items).first())):this.next(t)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||x(t.target).closest(".ui-menu-item");var e={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,e)},_filterMenuItems:function(t){var e=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),i=new RegExp("^"+e,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return i.test(x.trim(x(this).children(".ui-menu-item-wrapper").text()))})}});x.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var i,s,n,t=this.element[0].nodeName.toLowerCase(),e="textarea"===t,o="input"===t;this.isMultiLine=e||!o&&this._isContentEditable(this.element),this.valueMethod=this.element[e||o?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(t){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var e=x.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:i=!0,this._move("previousPage",t);break;case e.PAGE_DOWN:i=!0,this._move("nextPage",t);break;case e.UP:i=!0,this._keyEvent("previous",t);break;case e.DOWN:i=!0,this._keyEvent("next",t);break;case e.ENTER:this.menu.active&&(i=!0,t.preventDefault(),this.menu.select(t));break;case e.TAB:this.menu.active&&this.menu.select(t);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(t),t.preventDefault());break;default:s=!0,this._searchTimeout(t)}}},keypress:function(t){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||t.preventDefault());if(!s){var e=x.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:this._move("previousPage",t);break;case e.PAGE_DOWN:this._move("nextPage",t);break;case e.UP:this._keyEvent("previous",t);break;case e.DOWN:this._keyEvent("next",t)}}},input:function(t){if(n)return n=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(clearTimeout(this.searching),this.close(t),this._change(t))}}),this._initSource(),this.menu=x("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==x.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(t,e){var i,s;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){x(t.target).trigger(t.originalEvent)});s=e.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:s})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value),(i=e.item.attr("aria-label")||s.value)&&x.trim(i).length&&(this.liveRegion.children().hide(),x("<div>").text(i).appendTo(this.liveRegion))},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==x.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=x("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||x.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return(t=t&&(t.jquery||t.nodeType?x(t):this.document.find(t).eq(0)))&&t[0]||(t=this.element.closest(".ui-front, dialog")),t.length||(t=this.document[0].body),t},_initSource:function(){var i,s,n=this;x.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(x.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=x.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(!t||e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return x.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(t){t=t&&this._normalize(t),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:x.map(t,function(t){return"string"==typeof t?{label:t,value:t}:x.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var e=this.menu.element.empty();this._renderMenu(e,t),this.isNewMenu=!0,this.menu.refresh(),e.show(),this._resizeMenu(),e.position(x.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(i,t){var s=this;x.each(t,function(t,e){s._renderItemData(i,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(t,e){return x("<li>").append(x("<div>").text(e.label)).appendTo(t)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),x.extend(x.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(x.ui.autocomplete.escapeRegex(e),"i");return x.grep(t,function(t){return i.test(t.label||t.value||t)})}}),x.widget("ui.autocomplete",x.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1<t?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),x("<div>").text(e).appendTo(this.liveRegion))}});x.ui.autocomplete;var G=/ui-corner-([a-z]){2,6}/g;x.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var a=this,r=[];x.each(this.options.items,function(n,t){var e,o={};if(t)return"controlgroupLabel"===n?((e=a.element.find(t)).each(function(){var t=x(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),a._addClass(e,null,"ui-widget ui-widget-content ui-state-default"),void(r=r.concat(e.get()))):void(x.fn[n]&&(o=a["_"+n+"Options"]?a["_"+n+"Options"]("middle"):{classes:{}},a.element.find(t).each(function(){var t,e=x(this),i=e[n]("instance"),s=x.widget.extend({},o);"button"===n&&e.parent(".ui-spinner").length||((i=i||e[n]()[n]("instance"))&&(s.classes=a._resolveClassesValues(s.classes,i)),e[n](s),t=e[n]("widget"),x.data(t[0],"ui-controlgroup-data",i||e[n]("instance")),r.push(t[0]))})))}),this.childWidgets=x(x.unique(r)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var t=x(this).data("ui-controlgroup-data");t&&t[e]&&t[e]()})},_updateCornerClass:function(t,e){var i=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,i)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,s){var n={};return x.each(i,function(t){var e=s.options.classes[t]||"",e=x.trim(e.replace(G,""));n[t]=(e+" "+i[t]).replace(/\s+/g," ")}),n},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var n,o=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),n=this.childWidgets,this.options.onlyVisible&&(n=n.filter(":visible")),n.length&&(x.each(["first","last"],function(t,e){var i,s=n[e]().data("ui-controlgroup-data");s&&o["_"+s.widgetName+"Options"]?((i=o["_"+s.widgetName+"Options"](1===n.length?"only":e)).classes=o._resolveClassesValues(i.classes,s),s.element[s.widgetName](i)):o._updateCornerClass(n[e](),e)}),this._callChildMethod("refresh"))}});x.widget("ui.checkboxradio",[x.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,e,i=this,s=this._super()||{};return this._readType(),e=this.element.labels(),this.label=x(e[e.length-1]),this.label.length||x.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){i.originalLabel+=3===this.nodeType?x(this).text():this.outerHTML}),this.originalLabel&&(s.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(s.disabled=t),s},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||x.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,e="input[name='"+x.ui.escapeSelector(t)+"']";return t?(this.form.length?x(this.form[0].elements).filter(e):x(e).filter(function(){return 0===x(this).form().length})).not(this.element):x([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=x(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(t){var e="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=x("<span>"),this.iconSpace=x("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(e+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):e+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",e),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]);var Q;x.ui.checkboxradio;x.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),null!=(t=this.element[0].disabled)&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(t){t.keyCode===x.ui.keyCode.SPACE&&(t.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(t,e){var i="iconPosition"!==t,s=i?this.options.iconPosition:e,n="top"===s||"bottom"===s;this.icon?i&&this._removeClass(this.icon,null,this.options.icon):(this.icon=x("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),i&&this._addClass(this.icon,null,e),this._attachIcon(s),n?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=x("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(s))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,i=void 0===t.icon?this.options.icon:t.icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),(this.element[0].disabled=e)&&this.element.blur())},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),!1!==x.uiBackCompat&&(x.widget("ui.button",x.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){"text"!==t?("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments)):this._super("showLabel",e)}}),x.fn.button=(Q=x.fn.button,function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?Q.apply(this,arguments):(x.ui.checkboxradio||x.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}),x.fn.buttonset=function(){return x.ui.controlgroup||x.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))});var J;x.ui.button;function Z(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},x.extend(this._defaults,this.regional[""]),this.regional.en=x.extend(!0,{},this.regional[""]),this.regional["en-US"]=x.extend(!0,{},this.regional.en),this.dpDiv=tt(x("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function tt(t){var e="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.on("mouseout",e,function(){x(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&x(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&x(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",e,et)}function et(){x.datepicker._isDisabledDatepicker(J.inline?J.dpDiv.parent()[0]:J.input[0])||(x(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),x(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&x(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&x(this).addClass("ui-datepicker-next-hover"))}function it(t,e){for(var i in x.extend(t,e),e)null==e[i]&&(t[i]=e[i]);return t}x.extend(x.ui,{datepicker:{version:"1.12.1"}}),x.extend(Z.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return it(this._defaults,t||{}),this},_attachDatepicker:function(t,e){var i,s=t.nodeName.toLowerCase(),n="div"===s||"span"===s;t.id||(this.uuid+=1,t.id="dp"+this.uuid),(i=this._newInst(x(t),n)).settings=x.extend({},e||{}),"input"===s?this._connectDatepicker(t,i):n&&this._inlineDatepicker(t,i)},_newInst:function(t,e){return{id:t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:e,dpDiv:e?tt(x("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,e){var i=x(t);e.append=x([]),e.trigger=x([]),i.hasClass(this.markerClassName)||(this._attachments(i,e),i.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(e),x.data(t,"datepicker",e),e.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,e){var i,s,n,o=this._get(e,"appendText"),a=this._get(e,"isRTL");e.append&&e.append.remove(),o&&(e.append=x("<span class='"+this._appendClass+"'>"+o+"</span>"),t[a?"before":"after"](e.append)),t.off("focus",this._showDatepicker),e.trigger&&e.trigger.remove(),"focus"!==(i=this._get(e,"showOn"))&&"both"!==i||t.on("focus",this._showDatepicker),"button"!==i&&"both"!==i||(s=this._get(e,"buttonText"),n=this._get(e,"buttonImage"),e.trigger=x(this._get(e,"buttonImageOnly")?x("<img/>").addClass(this._triggerClass).attr({src:n,alt:s,title:s}):x("<button type='button'></button>").addClass(this._triggerClass).html(n?x("<img/>").attr({src:n,alt:s,title:s}):s)),t[a?"before":"after"](e.trigger),e.trigger.on("click",function(){return x.datepicker._datepickerShowing&&x.datepicker._lastInput===t[0]?x.datepicker._hideDatepicker():(x.datepicker._datepickerShowing&&x.datepicker._lastInput!==t[0]&&x.datepicker._hideDatepicker(),x.datepicker._showDatepicker(t[0])),!1}))},_autoSize:function(t){var e,i,s,n,o,a;this._get(t,"autoSize")&&!t.inline&&(o=new Date(2009,11,20),(a=this._get(t,"dateFormat")).match(/[DM]/)&&(e=function(t){for(n=s=i=0;n<t.length;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length))},_inlineDatepicker:function(t,e){var i=x(t);i.hasClass(this.markerClassName)||(i.addClass(this.markerClassName).append(e.dpDiv),x.data(t,"datepicker",e),this._setDate(e,this._getDefaultDate(e),!0),this._updateDatepicker(e),this._updateAlternate(e),e.settings.disabled&&this._disableDatepicker(t),e.dpDiv.css("display","block"))},_dialogDatepicker:function(t,e,i,s,n){var o,a,r,h,l,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=x("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),x("body").append(this._dialogInput),(c=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},x.data(this._dialogInput[0],"datepicker",c)),it(c.settings,s||{}),e=e&&e.constructor===Date?this._formatDate(c,e):e,this._dialogInput.val(e),this._pos=n?n.length?n:[n.pageX,n.pageY]:null,this._pos||(a=document.documentElement.clientWidth,r=document.documentElement.clientHeight,h=document.documentElement.scrollLeft||document.body.scrollLeft,l=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[a/2-100+h,r/2-150+l]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=i,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),x.blockUI&&x.blockUI(this.dpDiv),x.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var e,i=x(t),s=x.data(t,"datepicker");i.hasClass(this.markerClassName)&&(e=t.nodeName.toLowerCase(),x.removeData(t,"datepicker"),"input"===e?(s.append.remove(),s.trigger.remove(),i.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==e&&"span"!==e||i.removeClass(this.markerClassName).empty(),J===s&&(J=null))},_enableDatepicker:function(e){var t,i,s=x(e),n=x.data(e,"datepicker");s.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==t&&"span"!==t||((i=s.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=x.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var t,i,s=x(e),n=x.data(e,"datepicker");s.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==t&&"span"!==t||((i=s.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=x.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;e<this._disabledInputs.length;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(t){try{return x.data(t,"datepicker")}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,e,i){var s,n,o,a,r=this._getInst(t);if(2===arguments.length&&"string"==typeof e)return"defaults"===e?x.extend({},x.datepicker._defaults):r?"all"===e?x.extend({},r.settings):this._get(r,e):null;s=e||{},"string"==typeof e&&((s={})[e]=i),r&&(this._curInst===r&&this._hideDatepicker(),n=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(r,"min"),a=this._getMinMaxDate(r,"max"),it(r.settings,s),null!==o&&void 0!==s.dateFormat&&void 0===s.minDate&&(r.settings.minDate=this._formatDate(r,o)),null!==a&&void 0!==s.dateFormat&&void 0===s.maxDate&&(r.settings.maxDate=this._formatDate(r,a)),"disabled"in s&&(s.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(x(t),r),this._autoSize(r),this._setDate(r,n),this._updateAlternate(r),this._updateDatepicker(r))},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(t){var e,i,s,n=x.datepicker._getInst(t.target),o=!0,a=n.dpDiv.is(".ui-datepicker-rtl");if(n._keyEvent=!0,x.datepicker._datepickerShowing)switch(t.keyCode){case 9:x.datepicker._hideDatepicker(),o=!1;break;case 13:return(s=x("td."+x.datepicker._dayOverClass+":not(."+x.datepicker._currentClass+")",n.dpDiv))[0]&&x.datepicker._selectDay(t.target,n.selectedMonth,n.selectedYear,s[0]),(e=x.datepicker._get(n,"onSelect"))?(i=x.datepicker._formatDate(n),e.apply(n.input?n.input[0]:null,[i,n])):x.datepicker._hideDatepicker(),!1;case 27:x.datepicker._hideDatepicker();break;case 33:x.datepicker._adjustDate(t.target,t.ctrlKey?-x.datepicker._get(n,"stepBigMonths"):-x.datepicker._get(n,"stepMonths"),"M");break;case 34:x.datepicker._adjustDate(t.target,t.ctrlKey?+x.datepicker._get(n,"stepBigMonths"):+x.datepicker._get(n,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&x.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&x.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&x.datepicker._adjustDate(t.target,a?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&x.datepicker._adjustDate(t.target,t.ctrlKey?-x.datepicker._get(n,"stepBigMonths"):-x.datepicker._get(n,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&x.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&x.datepicker._adjustDate(t.target,a?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&x.datepicker._adjustDate(t.target,t.ctrlKey?+x.datepicker._get(n,"stepBigMonths"):+x.datepicker._get(n,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&x.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?x.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var e,i,s=x.datepicker._getInst(t.target);if(x.datepicker._get(s,"constrainInput"))return e=x.datepicker._possibleChars(x.datepicker._get(s,"dateFormat")),i=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||i<" "||!e||-1<e.indexOf(i)},_doKeyUp:function(t){var e=x.datepicker._getInst(t.target);if(e.input.val()!==e.lastVal)try{x.datepicker.parseDate(x.datepicker._get(e,"dateFormat"),e.input?e.input.val():null,x.datepicker._getFormatConfig(e))&&(x.datepicker._setDateFromField(e),x.datepicker._updateAlternate(e),x.datepicker._updateDatepicker(e))}catch(t){}return!0},_showDatepicker:function(t){var e,i,s,n,o,a,r;"input"!==(t=t.target||t).nodeName.toLowerCase()&&(t=x("input",t.parentNode)[0]),x.datepicker._isDisabledDatepicker(t)||x.datepicker._lastInput===t||(r=x.datepicker._getInst(t),x.datepicker._curInst&&x.datepicker._curInst!==r&&(x.datepicker._curInst.dpDiv.stop(!0,!0),r&&x.datepicker._datepickerShowing&&x.datepicker._hideDatepicker(x.datepicker._curInst.input[0])),!1!==(i=(e=x.datepicker._get(r,"beforeShow"))?e.apply(t,[t,r]):{})&&(it(r.settings,i),r.lastVal=null,x.datepicker._lastInput=t,x.datepicker._setDateFromField(r),x.datepicker._inDialog&&(t.value=""),x.datepicker._pos||(x.datepicker._pos=x.datepicker._findPos(t),x.datepicker._pos[1]+=t.offsetHeight),s=!1,x(t).parents().each(function(){return!(s|="fixed"===x(this).css("position"))}),n={left:x.datepicker._pos[0],top:x.datepicker._pos[1]},x.datepicker._pos=null,r.dpDiv.empty(),r.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),x.datepicker._updateDatepicker(r),n=x.datepicker._checkOffset(r,n,s),r.dpDiv.css({position:x.datepicker._inDialog&&x.blockUI?"static":s?"fixed":"absolute",display:"none",left:n.left+"px",top:n.top+"px"}),r.inline||(o=x.datepicker._get(r,"showAnim"),a=x.datepicker._get(r,"duration"),r.dpDiv.css("z-index",function(t){for(var e,i;t.length&&t[0]!==document;){if(("absolute"===(e=t.css("position"))||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}(x(t))+1),x.datepicker._datepickerShowing=!0,x.effects&&x.effects.effect[o]?r.dpDiv.show(o,x.datepicker._get(r,"showOptions"),a):r.dpDiv[o||"show"](o?a:null),x.datepicker._shouldFocusInput(r)&&r.input.trigger("focus"),x.datepicker._curInst=r)))},_updateDatepicker:function(t){this.maxRows=4,(J=t).dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var e,i=this._getNumberOfMonths(t),s=i[1],n=t.dpDiv.find("."+this._dayOverClass+" a");0<n.length&&et.apply(n.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),1<s&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",17*s+"em"),t.dpDiv[(1!==i[0]||1!==i[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===x.datepicker._curInst&&x.datepicker._datepickerShowing&&x.datepicker._shouldFocusInput(t)&&t.input.trigger("focus"),t.yearshtml&&(e=t.yearshtml,setTimeout(function(){e===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),e=t.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(t,e,i){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,a=t.input?t.input.outerHeight():0,r=document.documentElement.clientWidth+(i?0:x(document).scrollLeft()),h=document.documentElement.clientHeight+(i?0:x(document).scrollTop());return e.left-=this._get(t,"isRTL")?s-o:0,e.left-=i&&e.left===t.input.offset().left?x(document).scrollLeft():0,e.top-=i&&e.top===t.input.offset().top+a?x(document).scrollTop():0,e.left-=Math.min(e.left,e.left+s>r&&s<r?Math.abs(e.left+s-r):0),e.top-=Math.min(e.top,e.top+n>h&&n<h?Math.abs(n+a):0),e},_findPos:function(t){for(var e,i=this._getInst(t),s=this._get(i,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||x.expr.filters.hidden(t));)t=t[s?"previousSibling":"nextSibling"];return[(e=x(t).offset()).left,e.top]},_hideDatepicker:function(t){var e,i,s,n,o=this._curInst;!o||t&&o!==x.data(t,"datepicker")||this._datepickerShowing&&(e=this._get(o,"showAnim"),i=this._get(o,"duration"),s=function(){x.datepicker._tidyDialog(o)},x.effects&&(x.effects.effect[e]||x.effects[e])?o.dpDiv.hide(e,x.datepicker._get(o,"showOptions"),i,s):o.dpDiv["slideDown"===e?"slideUp":"fadeIn"===e?"fadeOut":"hide"](e?i:null,s),e||s(),this._datepickerShowing=!1,(n=this._get(o,"onClose"))&&n.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),x.blockUI&&(x.unblockUI(),x("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(t){var e,i;x.datepicker._curInst&&(e=x(t.target),i=x.datepicker._getInst(e[0]),(e[0].id===x.datepicker._mainDivId||0!==e.parents("#"+x.datepicker._mainDivId).length||e.hasClass(x.datepicker.markerClassName)||e.closest("."+x.datepicker._triggerClass).length||!x.datepicker._datepickerShowing||x.datepicker._inDialog&&x.blockUI)&&(!e.hasClass(x.datepicker.markerClassName)||x.datepicker._curInst===i)||x.datepicker._hideDatepicker())},_adjustDate:function(t,e,i){var s=x(t),n=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(n,e+("M"===i?this._get(n,"showCurrentAtPos"):0),i),this._updateDatepicker(n))},_gotoToday:function(t){var e,i=x(t),s=this._getInst(i[0]);this._get(s,"gotoCurrent")&&s.currentDay?(s.selectedDay=s.currentDay,s.drawMonth=s.selectedMonth=s.currentMonth,s.drawYear=s.selectedYear=s.currentYear):(e=new Date,s.selectedDay=e.getDate(),s.drawMonth=s.selectedMonth=e.getMonth(),s.drawYear=s.selectedYear=e.getFullYear()),this._notifyChange(s),this._adjustDate(i)},_selectMonthYear:function(t,e,i){var s=x(t),n=this._getInst(s[0]);n["selected"+("M"===i?"Month":"Year")]=n["draw"+("M"===i?"Month":"Year")]=parseInt(e.options[e.selectedIndex].value,10),this._notifyChange(n),this._adjustDate(s)},_selectDay:function(t,e,i,s){var n,o=x(t);x(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||((n=this._getInst(o[0])).selectedDay=n.currentDay=x("a",s).html(),n.selectedMonth=n.currentMonth=e,n.selectedYear=n.currentYear=i,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){var e=x(t);this._selectDate(e,"")},_selectDate:function(t,e){var i,s=x(t),n=this._getInst(s[0]);e=null!=e?e:this._formatDate(n),n.input&&n.input.val(e),this._updateAlternate(n),(i=this._get(n,"onSelect"))?i.apply(n.input?n.input[0]:null,[e,n]):n.input&&n.input.trigger("change"),n.inline?this._updateDatepicker(n):(this._hideDatepicker(),this._lastInput=n.input[0],"object"!=typeof n.input[0]&&n.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(t){var e,i,s,n=this._get(t,"altField");n&&(e=this._get(t,"altFormat")||this._get(t,"dateFormat"),i=this._getDate(t),s=this.formatDate(e,i,this._getFormatConfig(t)),x(n).val(s))},noWeekends:function(t){var e=t.getDay();return[0<e&&e<6,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(i,o,t){if(null==i||null==o)throw"Invalid arguments";if(""===(o="object"==typeof o?o.toString():o+""))return null;function a(t){var e=k+1<i.length&&i.charAt(k+1)===t;return e&&k++,e}function e(t){var e=a(t),i="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,s=new RegExp("^\\d{"+("y"===t?i:1)+","+i+"}"),n=o.substring(c).match(s);if(!n)throw"Missing number at position "+c;return c+=n[0].length,parseInt(n[0],10)}function s(t,e,i){var s=-1,n=x.map(a(t)?i:e,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(x.each(n,function(t,e){var i=e[1];if(o.substr(c,i.length).toLowerCase()===i.toLowerCase())return s=e[0],c+=i.length,!1}),-1!==s)return s+1;throw"Unknown name at position "+c}function n(){if(o.charAt(c)!==i.charAt(k))throw"Unexpected literal at position "+c;c++}for(var r,h,l,c=0,u=(t?t.shortYearCutoff:null)||this._defaults.shortYearCutoff,d="string"!=typeof u?u:(new Date).getFullYear()%100+parseInt(u,10),p=(t?t.dayNamesShort:null)||this._defaults.dayNamesShort,f=(t?t.dayNames:null)||this._defaults.dayNames,g=(t?t.monthNamesShort:null)||this._defaults.monthNamesShort,m=(t?t.monthNames:null)||this._defaults.monthNames,_=-1,v=-1,b=-1,y=-1,w=!1,k=0;k<i.length;k++)if(w)"'"!==i.charAt(k)||a("'")?n():w=!1;else switch(i.charAt(k)){case"d":b=e("d");break;case"D":s("D",p,f);break;case"o":y=e("o");break;case"m":v=e("m");break;case"M":v=s("M",g,m);break;case"y":_=e("y");break;case"@":_=(l=new Date(e("@"))).getFullYear(),v=l.getMonth()+1,b=l.getDate();break;case"!":_=(l=new Date((e("!")-this._ticksTo1970)/1e4)).getFullYear(),v=l.getMonth()+1,b=l.getDate();break;case"'":a("'")?n():w=!0;break;default:n()}if(c<o.length&&(h=o.substr(c),!/^\s+/.test(h)))throw"Extra/unparsed characters found in date: "+h;if(-1===_?_=(new Date).getFullYear():_<100&&(_+=(new Date).getFullYear()-(new Date).getFullYear()%100+(_<=d?0:-100)),-1<y)for(v=1,b=y;;){if(b<=(r=this._getDaysInMonth(_,v-1)))break;v++,b-=r}if((l=this._daylightSavingAdjust(new Date(_,v-1,b))).getFullYear()!==_||l.getMonth()+1!==v||l.getDate()!==b)throw"Invalid date";return l},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(i,t,e){if(!t)return"";function n(t){var e=a+1<i.length&&i.charAt(a+1)===t;return e&&a++,e}function s(t,e,i){var s=""+e;if(n(t))for(;s.length<i;)s="0"+s;return s}function o(t,e,i,s){return n(t)?s[e]:i[e]}var a,r=(e?e.dayNamesShort:null)||this._defaults.dayNamesShort,h=(e?e.dayNames:null)||this._defaults.dayNames,l=(e?e.monthNamesShort:null)||this._defaults.monthNamesShort,c=(e?e.monthNames:null)||this._defaults.monthNames,u="",d=!1;if(t)for(a=0;a<i.length;a++)if(d)"'"!==i.charAt(a)||n("'")?u+=i.charAt(a):d=!1;else switch(i.charAt(a)){case"d":u+=s("d",t.getDate(),2);break;case"D":u+=o("D",t.getDay(),r,h);break;case"o":u+=s("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=s("m",t.getMonth()+1,2);break;case"M":u+=o("M",t.getMonth(),l,c);break;case"y":u+=n("y")?t.getFullYear():(t.getFullYear()%100<10?"0":"")+t.getFullYear()%100;break;case"@":u+=t.getTime();break;case"!":u+=1e4*t.getTime()+this._ticksTo1970;break;case"'":n("'")?u+="'":d=!0;break;default:u+=i.charAt(a)}return u},_possibleChars:function(i){function t(t){var e=n+1<i.length&&i.charAt(n+1)===t;return e&&n++,e}for(var e="",s=!1,n=0;n<i.length;n++)if(s)"'"!==i.charAt(n)||t("'")?e+=i.charAt(n):s=!1;else switch(i.charAt(n)){case"d":case"m":case"y":case"@":e+="0123456789";break;case"D":case"M":return null;case"'":t("'")?e+="'":s=!0;break;default:e+=i.charAt(n)}return e},_get:function(t,e){return void 0!==t.settings[e]?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(t){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(r,t,e){var i,s,n=null==t||""===t?e:"string"==typeof t?function(t){try{return x.datepicker.parseDate(x.datepicker._get(r,"dateFormat"),t,x.datepicker._getFormatConfig(r))}catch(t){}for(var e=(t.toLowerCase().match(/^c/)?x.datepicker._getDate(r):null)||new Date,i=e.getFullYear(),s=e.getMonth(),n=e.getDate(),o=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,a=o.exec(t);a;){switch(a[2]||"d"){case"d":case"D":n+=parseInt(a[1],10);break;case"w":case"W":n+=7*parseInt(a[1],10);break;case"m":case"M":s+=parseInt(a[1],10),n=Math.min(n,x.datepicker._getDaysInMonth(i,s));break;case"y":case"Y":i+=parseInt(a[1],10),n=Math.min(n,x.datepicker._getDaysInMonth(i,s))}a=o.exec(t)}return new Date(i,s,n)}(t):"number"==typeof t?isNaN(t)?e:(i=t,(s=new Date).setDate(s.getDate()+i),s):new Date(t.getTime());return(n=n&&"Invalid Date"===n.toString()?e:n)&&(n.setHours(0),n.setMinutes(0),n.setSeconds(0),n.setMilliseconds(0)),this._daylightSavingAdjust(n)},_daylightSavingAdjust:function(t){return t?(t.setHours(12<t.getHours()?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){return!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay))},_attachHandlers:function(t){var e=this._get(t,"stepMonths"),i="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){x.datepicker._adjustDate(i,-e,"M")},next:function(){x.datepicker._adjustDate(i,+e,"M")},hide:function(){x.datepicker._hideDatepicker()},today:function(){x.datepicker._gotoToday(i)},selectDay:function(){return x.datepicker._selectDay(i,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return x.datepicker._selectMonthYear(i,this,"M"),!1},selectYear:function(){return x.datepicker._selectMonthYear(i,this,"Y"),!1}};x(this).on(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,h,l,c,u,d,p,f,g,m,_,v,b,y,w,k,x,C,D,I,T,P,M,S,H,z,O,A,N,W,E,F,L,R=new Date,B=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),Y=this._get(t,"isRTL"),j=this._get(t,"showButtonPanel"),q=this._get(t,"hideIfNoPrevNext"),K=this._get(t,"navigationAsDateFormat"),U=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),$=this._get(t,"stepMonths"),X=1!==U[0]||1!==U[1],G=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),Q=this._getMinMaxDate(t,"min"),J=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,tt=t.drawYear;if(Z<0&&(Z+=12,tt--),J)for(e=this._daylightSavingAdjust(new Date(J.getFullYear(),J.getMonth()-U[0]*U[1]+1,J.getDate())),e=Q&&e<Q?Q:e;this._daylightSavingAdjust(new Date(tt,Z,1))>e;)--Z<0&&(Z=11,tt--);for(t.drawMonth=Z,t.drawYear=tt,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(tt,Z-$,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,tt,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":q?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(tt,Z+$,1)),this._getFormatConfig(t)):n,o=this._canAdjustMonth(t,1,tt,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":q?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?G:B,a=K?this.formatDate(a,r,this._getFormatConfig(t)):a,h=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",l=j?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(t,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(Y?"":h)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),_=this._get(t,"showOtherMonths"),v=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;k<U[0];k++){for(x="",this.maxRows=4,C=0;C<U[1];C++){if(D=this._daylightSavingAdjust(new Date(tt,Z,t.selectedDay)),I=" ui-corner-all",T="",X){if(T+="<div class='ui-datepicker-group",1<U[1])switch(C){case 0:T+=" ui-datepicker-group-first",I=" ui-corner-"+(Y?"right":"left");break;case U[1]-1:T+=" ui-datepicker-group-last",I=" ui-corner-"+(Y?"left":"right");break;default:T+=" ui-datepicker-group-middle",I=""}T+="'>"}for(T+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+I+"'>"+(/all|left/.test(I)&&0===k?Y?o:s:"")+(/all|right/.test(I)&&0===k?Y?s:o:"")+this._generateMonthYearHeader(t,Z,tt,Q,J,0<k||0<C,f,g)+"</div><table class='ui-datepicker-calendar'><thead><tr>",P=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;w<7;w++)P+="<th scope='col'"+(5<=(w+c+6)%7?" class='ui-datepicker-week-end'":"")+"><span title='"+d[M=(w+c)%7]+"'>"+p[M]+"</span></th>";for(T+=P+"</tr></thead><tbody>",S=this._getDaysInMonth(tt,Z),tt===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,S)),H=(this._getFirstDayOfMonth(tt,Z)-c+7)%7,z=Math.ceil((H+S)/7),O=X&&this.maxRows>z?this.maxRows:z,this.maxRows=O,A=this._daylightSavingAdjust(new Date(tt,Z,1-H)),N=0;N<O;N++){for(T+="<tr>",W=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(A)+"</td>":"",w=0;w<7;w++)E=m?m.apply(t.input?t.input[0]:null,[A]):[!0,""],L=(F=A.getMonth()!==Z)&&!v||!E[0]||Q&&A<Q||J&&J<A,W+="<td class='"+(5<=(w+c+6)%7?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(A.getTime()===D.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===A.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!_?"":" "+E[1]+(A.getTime()===G.getTime()?" "+this._currentClass:"")+(A.getTime()===B.getTime()?" ui-datepicker-today":""))+"'"+(F&&!_||!E[2]?"":" title='"+E[2].replace(/'/g,"'")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+A.getMonth()+"' data-year='"+A.getFullYear()+"'")+">"+(F&&!_?" ":L?"<span class='ui-state-default'>"+A.getDate()+"</span>":"<a class='ui-state-default"+(A.getTime()===B.getTime()?" ui-state-highlight":"")+(A.getTime()===G.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+A.getDate()+"</a>")+"</td>",A.setDate(A.getDate()+1),A=this._daylightSavingAdjust(A);T+=W+"</tr>"}11<++Z&&(Z=0,tt++),x+=T+="</tbody></table>"+(X?"</div>"+(0<U[0]&&C===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}y+=x}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var h,l,c,u,d,p,f,g,m=this._get(t,"changeMonth"),_=this._get(t,"changeYear"),v=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(o||!m)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;c<12;c++)(!h||c>=s.getMonth())&&(!l||c<=n.getMonth())&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(v||(b+=y+(!o&&m&&_?"":" ")),!t.yearshtml)if(t.yearshtml="",o||!_)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),f=(p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e})(u[0]),g=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,g=n?Math.min(g,n.getFullYear()):g,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";f<=g;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),v&&(b+=(!o&&m&&_?"":" ")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&e<i?i:e;return s&&s<n?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(i,s+(e<0?e:n[0]*n[1]),1));return e<0&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),a=null,r=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||e.getTime()>=n.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||e.getFullYear()<=r)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),x.fn.datepicker=function(t){if(!this.length)return this;x.datepicker.initialized||(x(document).on("mousedown",x.datepicker._checkExternalClick),x.datepicker.initialized=!0),0===x("#"+x.datepicker._mainDivId).length&&x("body").append(x.datepicker.dpDiv);var e=Array.prototype.slice.call(arguments,1);return"string"==typeof t&&("isDisabled"===t||"getDate"===t||"widget"===t)||"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?x.datepicker["_"+t+"Datepicker"].apply(x.datepicker,[this[0]].concat(e)):this.each(function(){"string"==typeof t?x.datepicker["_"+t+"Datepicker"].apply(x.datepicker,[this].concat(e)):x.datepicker._attachDatepicker(this,t)})},x.datepicker=new Z,x.datepicker.initialized=!1,x.datepicker.uuid=(new Date).getTime(),x.datepicker.version="1.12.1";x.datepicker,x.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var st=!1;x(document).on("mouseup",function(){st=!1});x.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(t){if(!0===x.data(t.target,e.widgetName+".preventClickEvent"))return x.removeData(t.target,e.widgetName+".preventClickEvent"),t.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!st){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var e=this,i=1===t.which,s=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&x(t.target).closest(this.options.cancel).length;return i&&!s&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===x.data(t.target,this.widgetName+".preventClickEvent")&&x.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return e._mouseMove(t)},this._mouseUpDelegate=function(t){return e._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),st=!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(x.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&x.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,st=!1,t.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),x.ui.plugin={add:function(t,e,i){var s,n=x.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n<o.length;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},x.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&x(t).trigger("blur")};x.widget("ui.draggable",x.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var e=this.options;return!(this.helper||e.disabled||0<x(t.target).closest(".ui-resizable-handle").length)&&(this.handle=this._getHandle(t),!!this.handle&&(this._blurActiveElement(t),this._blockFrames(!0===e.iframeFix?"iframe":e.iframeFix),!0))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=x(this);return x("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=x.ui.safeActiveElement(this.document[0]);x(t.target).closest(e).length||x.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),x.ui.ddmanager&&(x.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0<this.helper.parents().filter(function(){return"fixed"===x(this).css("position")}).length,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),x.ui.ddmanager&&!e.dropBehaviour&&x.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),x.ui.ddmanager&&x.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(t,e){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!e){var i=this._uiHash();if(!1===this._trigger("drag",t,i))return this._mouseUp(new x.Event("mouseup",t)),!1;this.position=i.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",x.ui.ddmanager&&x.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var e=this,i=!1;return x.ui.ddmanager&&!this.options.dropBehaviour&&(i=x.ui.ddmanager.drop(this,t)),this.dropped&&(i=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!i||"valid"===this.options.revert&&i||!0===this.options.revert||x.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)?x(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==e._trigger("stop",t)&&e._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),x.ui.ddmanager&&x.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),x.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new x.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!x(t.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var e=this.options,i=x.isFunction(e.helper),s=i?x(e.helper.apply(this.element[0],[t])):"clone"===e.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===e.appendTo?this.element[0].parentNode:e.appendTo),i&&s[0]===this.element[0]&&this._setPositionRelative(),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),x.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),e=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==e&&x.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i,s=this.options,n=this.document[0];this.relativeContainer=null,s.containment?"window"!==s.containment?"document"!==s.containment?s.containment.constructor!==Array?("parent"===s.containment&&(s.containment=this.helper[0].parentNode),(i=(e=x(s.containment))[0])&&(t=/(scroll|auto)/.test(e.css("overflow")),this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(t?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=e)):this.containment=s.containment:this.containment=[0,0,x(n).width()-this.helperProportions.width-this.margins.left,(x(n).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[x(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,x(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,x(window).scrollLeft()+x(window).width()-this.helperProportions.width-this.margins.left,x(window).scrollTop()+(x(window).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,n,o,a=this.options,r=this._isRootNode(this.scrollParent[0]),h=t.pageX,l=t.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(i=this.relativeContainer?(s=this.relativeContainer.offset(),[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):this.containment,t.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,l=!i||n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1],o=a.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,h=!i||o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]),"y"===a.axis&&(h=this.originalPageX),"x"===a.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,e,i){return i=i||this._uiHash(),x.ui.plugin.call(this,t,[e,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),x.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),x.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=x.extend({},t,{item:i.element});i.sortables=[],x(i.options.connectToSortable).each(function(){var t=x(this).sortable("instance");t&&!t.options.disabled&&(i.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,s))})},stop:function(e,t,i){var s=x.extend({},t,{item:i.element});i.cancelHelperRemoval=!1,x.each(i.sortables,function(){var t=this;t.isOver?(t.isOver=0,i.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(i,s,n){x.each(n.sortables,function(){var t=!1,e=this;e.positionAbs=n.positionAbs,e.helperProportions=n.helperProportions,e.offset.click=n.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,x.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,this!==e&&this._intersectsWith(this.containerCache)&&x.contains(e.element[0],this.element[0])&&(t=!1),t})),t?(e.isOver||(e.isOver=1,n._parent=s.helper.parent(),e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return s.helper[0]},i.target=e.currentItem[0],e._mouseCapture(i,!0),e._mouseStart(i,!0,!0),e.offset.click.top=n.offset.click.top,e.offset.click.left=n.offset.click.left,e.offset.parent.left-=n.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=n.offset.parent.top-e.offset.parent.top,n._trigger("toSortable",i),n.dropped=e.element,x.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,e.fromOutside=n),e.currentItem&&(e._mouseDrag(i),s.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",i,e._uiHash(e)),e._mouseStop(i,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),s.helper.appendTo(n._parent),n._refreshOffsets(i),s.position=n._generatePosition(i,!0),n._trigger("fromSortable",i),n.dropped=!1,x.each(n.sortables,function(){this.refreshPositions()}))})}}),x.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=x("body"),n=i.options;s.css("cursor")&&(n._cursor=s.css("cursor")),s.css("cursor",n.cursor)},stop:function(t,e,i){var s=i.options;s._cursor&&x("body").css("cursor",s._cursor)}}),x.ui.plugin.add("draggable","opacity",{start:function(t,e,i){var s=x(e.helper),n=i.options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(t,e,i){var s=i.options;s._opacity&&x(e.helper).css("opacity",s._opacity)}}),x.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,e,i){var s=i.options,n=!1,o=i.scrollParentNotHidden[0],a=i.document[0];o!==a&&"HTML"!==o.tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+o.offsetHeight-t.pageY<s.scrollSensitivity?o.scrollTop=n=o.scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(o.scrollTop=n=o.scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+o.offsetWidth-t.pageX<s.scrollSensitivity?o.scrollLeft=n=o.scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(o.scrollLeft=n=o.scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-x(a).scrollTop()<s.scrollSensitivity?n=x(a).scrollTop(x(a).scrollTop()-s.scrollSpeed):x(window).height()-(t.pageY-x(a).scrollTop())<s.scrollSensitivity&&(n=x(a).scrollTop(x(a).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-x(a).scrollLeft()<s.scrollSensitivity?n=x(a).scrollLeft(x(a).scrollLeft()-s.scrollSpeed):x(window).width()-(t.pageX-x(a).scrollLeft())<s.scrollSensitivity&&(n=x(a).scrollLeft(x(a).scrollLeft()+s.scrollSpeed)))),!1!==n&&x.ui.ddmanager&&!s.dropBehaviour&&x.ui.ddmanager.prepareOffsets(i,t)}}),x.ui.plugin.add("draggable","snap",{start:function(t,e,i){var s=i.options;i.snapElements=[],x(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var t=x(this),e=t.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:e.top,left:e.left})})},drag:function(t,e,i){for(var s,n,o,a,r,h,l,c,u,d=i.options,p=d.snapTolerance,f=e.offset.left,g=f+i.helperProportions.width,m=e.offset.top,_=m+i.helperProportions.height,v=i.snapElements.length-1;0<=v;v--)h=(r=i.snapElements[v].left-i.margins.left)+i.snapElements[v].width,c=(l=i.snapElements[v].top-i.margins.top)+i.snapElements[v].height,g<r-p||h+p<f||_<l-p||c+p<m||!x.contains(i.snapElements[v].item.ownerDocument,i.snapElements[v].item)?(i.snapElements[v].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,t,x.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=!1):("inner"!==d.snapMode&&(s=Math.abs(l-_)<=p,n=Math.abs(c-m)<=p,o=Math.abs(r-g)<=p,a=Math.abs(h-f)<=p,s&&(e.position.top=i._convertPositionTo("relative",{top:l-i.helperProportions.height,left:0}).top),n&&(e.position.top=i._convertPositionTo("relative",{top:c,left:0}).top),o&&(e.position.left=i._convertPositionTo("relative",{top:0,left:r-i.helperProportions.width}).left),a&&(e.position.left=i._convertPositionTo("relative",{top:0,left:h}).left)),u=s||n||o||a,"outer"!==d.snapMode&&(s=Math.abs(l-m)<=p,n=Math.abs(c-_)<=p,o=Math.abs(r-f)<=p,a=Math.abs(h-g)<=p,s&&(e.position.top=i._convertPositionTo("relative",{top:l,left:0}).top),n&&(e.position.top=i._convertPositionTo("relative",{top:c-i.helperProportions.height,left:0}).top),o&&(e.position.left=i._convertPositionTo("relative",{top:0,left:r}).left),a&&(e.position.left=i._convertPositionTo("relative",{top:0,left:h-i.helperProportions.width}).left)),!i.snapElements[v].snapping&&(s||n||o||a||u)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,t,x.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=s||n||o||a||u)}}),x.ui.plugin.add("draggable","stack",{start:function(t,e,i){var s,n=i.options,o=x.makeArray(x(n.stack)).sort(function(t,e){return(parseInt(x(t).css("zIndex"),10)||0)-(parseInt(x(e).css("zIndex"),10)||0)});o.length&&(s=parseInt(x(o[0]).css("zIndex"),10)||0,x(o).each(function(t){x(this).css("zIndex",s+t)}),this.css("zIndex",s+o.length))}}),x.ui.plugin.add("draggable","zIndex",{start:function(t,e,i){var s=x(e.helper),n=i.options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(t,e,i){var s=i.options;s._zIndex&&x(e.helper).css("zIndex",s._zIndex)}});x.ui.draggable;x.widget("ui.resizable",x.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(t,e){if("hidden"===x(t).css("overflow"))return!1;var i,s=e&&"left"===e?"scrollLeft":"scrollTop";return 0<t[s]||(t[s]=1,i=0<t[s],t[s]=0,i)},_create:function(){var t,e=this.options,i=this;this._addClass("ui-resizable"),x.extend(this,{_aspectRatio:!!e.aspectRatio,aspectRatio:e.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:e.helper||e.ghost||e.animate?e.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(x("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&x(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();function t(t){x(t).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){this._super(t,e),"handles"===t&&(this._removeHandles(),this._setupHandles())},_setupHandles:function(){var t,e,i,s,n,o=this.options,a=this;if(this.handles=o.handles||(x(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=x(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e<i.length;e++)s="ui-resizable-"+(t=x.trim(i[e])),n=x("<div>"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.append(n);this._renderAxis=function(t){var e,i,s,n;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=x(this.handles[e]),this._on(this.handles[e],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=x(this.handles[e],this.element),n=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),s=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(s,n),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=x(this.handles[e])[0])!==t.target&&!x.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s,n=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),n.containment&&(e+=x(n.containment).scrollLeft()||0,i+=x(n.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof n.aspectRatio?n.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=x(".ui-resizable-"+this.axis).css("cursor"),x("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e,i,s=this.originalMousePosition,n=this.axis,o=t.pageX-s.left||0,a=t.pageY-s.top||0,r=this._change[n];return this._updatePrevProperties(),r&&(e=r.apply(this,[t,o,a]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),i=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),x.isEmptyObject(i)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n,o,a,r,h=this.options,l=this;return this._helper&&(s=(i=(e=this._proportionallyResizeElements).length&&/textarea/i.test(e[0].nodeName))&&this._hasScroll(e[0],"left")?0:l.sizeDiff.height,n=i?0:l.sizeDiff.width,o={width:l.helper.width()-n,height:l.helper.height()-s},a=parseFloat(l.element.css("left"))+(l.position.left-l.originalPosition.left)||null,r=parseFloat(l.element.css("top"))+(l.position.top-l.originalPosition.top)||null,h.animate||this.element.css(x.extend(o,{top:r,left:a})),l.helper.height(l.size.height),l.helper.width(l.size.width),this._helper&&!h.animate&&this._proportionallyResize()),x("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o=this.options,a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0};(this._aspectRatio||t)&&(e=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,e>a.minWidth&&(a.minWidth=e),s>a.minHeight&&(a.minHeight=s),i<a.maxWidth&&(a.maxWidth=i),n<a.maxHeight&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,n=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=r-e.minWidth),s&&l&&(t.left=r-e.maxWidth),a&&c&&(t.top=h-e.minHeight),n&&c&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e<this._proportionallyResizeElements.length;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,e=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||x("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return x.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return x.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return x.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return x.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){x.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),x.ui.plugin.add("resizable","animate",{stop:function(e){var i=x(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,a=n?0:i.sizeDiff.width,r={width:i.size.width-a,height:i.size.height-o},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,l=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(x.extend(r,l&&h?{top:l,left:h}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&x(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),x.ui.plugin.add("resizable","containment",{start:function(){var i,s,t,e,n,o,a,r=x(this).resizable("instance"),h=r.options,l=r.element,c=h.containment,u=c instanceof x?c.get(0):/parent/.test(c)?l.parent().get(0):c;u&&(r.containerElement=x(u),/document/.test(c)||c===document?(r.containerOffset={left:0,top:0},r.containerPosition={left:0,top:0},r.parentData={element:x(document),left:0,top:0,width:x(document).width(),height:x(document).height()||document.body.parentNode.scrollHeight}):(i=x(u),s=[],x(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=r._num(i.css("padding"+e))}),r.containerOffset=i.offset(),r.containerPosition=i.position(),r.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=r.containerOffset,e=r.containerSize.height,n=r.containerSize.width,o=r._hasScroll(u,"left")?u.scrollWidth:n,a=r._hasScroll(u)?u.scrollHeight:e,r.parentData={element:u,left:t.left,top:t.top,width:o,height:a}))},resize:function(t){var e,i,s,n,o=x(this).resizable("instance"),a=o.options,r=o.containerOffset,h=o.position,l=o._aspectRatio||t.shiftKey,c={top:0,left:0},u=o.containerElement,d=!0;u[0]!==document&&/static/.test(u.css("position"))&&(c=r),h.left<(o._helper?r.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-r.left:o.position.left-c.left),l&&(o.size.height=o.size.width/o.aspectRatio,d=!1),o.position.left=a.helper?r.left:0),h.top<(o._helper?r.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-r.top:o.position.top),l&&(o.size.width=o.size.height*o.aspectRatio,d=!1),o.position.top=o._helper?r.top:0),s=o.containerElement.get(0)===o.element.parent().get(0),n=/relative|absolute/.test(o.containerElement.css("position")),s&&n?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),e=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-c.left:o.offset.left-r.left)),i=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-c.top:o.offset.top-r.top)),e+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-e,l&&(o.size.height=o.size.width/o.aspectRatio,d=!1)),i+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-i,l&&(o.size.width=o.size.height*o.aspectRatio,d=!1)),d||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=x(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=x(t.helper),a=o.offset(),r=o.outerWidth()-t.sizeDiff.width,h=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&x(this).css({left:a.left-s.left-i.left,width:r,height:h}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&x(this).css({left:a.left-s.left-i.left,width:r,height:h})}}),x.ui.plugin.add("resizable","alsoResize",{start:function(){var t=x(this).resizable("instance").options;x(t.alsoResize).each(function(){var t=x(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=x(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,a={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};x(s.alsoResize).each(function(){var t=x(this),s=x(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];x.each(e,function(t,e){var i=(s[e]||0)+(a[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){x(this).removeData("ui-resizable-alsoresize")}}),x.ui.plugin.add("resizable","ghost",{start:function(){var t=x(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==x.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=x(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=x(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),x.ui.plugin.add("resizable","grid",{resize:function(){var t,e=x(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,a=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,c=Math.round((s.width-n.width)/h)*h,u=Math.round((s.height-n.height)/l)*l,d=n.width+c,p=n.height+u,f=i.maxWidth&&i.maxWidth<d,g=i.maxHeight&&i.maxHeight<p,m=i.minWidth&&i.minWidth>d,_=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=h),_&&(p+=l),f&&(d-=h),g&&(p-=l),/^(se|s|e)$/.test(a)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.top=o.top-u):/^(sw)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.left=o.left-c):((p-l<=0||d-h<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0<p-l?(e.size.height=p,e.position.top=o.top-u):(p=l-t.height,e.size.height=p,e.position.top=o.top+n.height-p),0<d-h?(e.size.width=d,e.position.left=o.left-c):(d=h-t.width,e.size.width=d,e.position.left=o.left+n.width-d))}});x.ui.resizable;x.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var e=x(this).css(t).offset().top;e<0&&x(this).css("top",t.top-e)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&x.fn.draggable&&this._makeDraggable(),this.options.resizable&&x.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?x(t):this.document.find(t||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(t=e.parent.children().eq(e.index)).length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:x.noop,enable:x.noop,close:function(t){var e=this;this._isOpen&&!1!==this._trigger("beforeClose",t)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||x.ui.safeBlur(x.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){e._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!1,s=this.uiDialog.siblings(".ui-front:visible").map(function(){return+x(this).css("z-index")}).get(),n=Math.max.apply(null,s);return n>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",n+1),i=!0),i&&!e&&this._trigger("focus",t),i},open:function(){var t=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=x(x.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;(t=t||this.element.find("[autofocus]")).length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).trigger("focus")},_keepFocus:function(t){function e(){var t=x.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===t||x.contains(this.uiDialog[0],t)||this._focusTabbable()}t.preventDefault(),e.call(this),this._delay(e)},_createWrapper:function(){this.uiDialog=x("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===x.ui.keyCode.ESCAPE)return t.preventDefault(),void this.close(t);var e,i,s;t.keyCode!==x.ui.keyCode.TAB||t.isDefaultPrevented()||(e=this.uiDialog.find(":tabbable"),i=e.filter(":first"),s=e.filter(":last"),t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==i[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){s.trigger("focus")}),t.preventDefault()):(this._delay(function(){i.trigger("focus")}),t.preventDefault()))},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=x("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){x(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=x("<button type='button'></button>").button({label:x("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),t=x("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html(" ")},_createButtonPane:function(){this.uiDialogButtonPane=x("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=x("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var n=this,t=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),x.isEmptyObject(t)||x.isArray(t)&&!t.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(x.each(t,function(t,e){var i,s;e=x.isFunction(e)?{click:e,text:t}:e,e=x.extend({type:"button"},e),i=e.click,s={icon:e.icon,iconPosition:e.iconPosition,showLabel:e.showLabel,icons:e.icons,text:e.text},delete e.click,delete e.icon,delete e.iconPosition,delete e.showLabel,delete e.icons,"boolean"==typeof e.text&&delete e.text,x("<button></button>",e).button(s).appendTo(n.uiButtonSet).on("click",function(){i.apply(n.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var n=this,o=this.options;function a(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(t,e){n._addClass(x(this),"ui-dialog-dragging"),n._blockFrames(),n._trigger("dragStart",t,a(e))},drag:function(t,e){n._trigger("drag",t,a(e))},stop:function(t,e){var i=e.offset.left-n.document.scrollLeft(),s=e.offset.top-n.document.scrollTop();o.position={my:"left top",at:"left"+(0<=i?"+":"")+i+" top"+(0<=s?"+":"")+s,of:n.window},n._removeClass(x(this),"ui-dialog-dragging"),n._unblockFrames(),n._trigger("dragStop",t,a(e))}})},_makeResizable:function(){var o=this,a=this.options,t=a.resizable,e=this.uiDialog.css("position"),i="string"==typeof t?t:"n,e,s,w,se,sw,ne,nw";function r(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:a.maxWidth,maxHeight:a.maxHeight,minWidth:a.minWidth,minHeight:this._minHeight(),handles:i,start:function(t,e){o._addClass(x(this),"ui-dialog-resizing"),o._blockFrames(),o._trigger("resizeStart",t,r(e))},resize:function(t,e){o._trigger("resize",t,r(e))},stop:function(t,e){var i=o.uiDialog.offset(),s=i.left-o.document.scrollLeft(),n=i.top-o.document.scrollTop();a.height=o.uiDialog.height(),a.width=o.uiDialog.width(),a.position={my:"left top",at:"left"+(0<=s?"+":"")+s+" top"+(0<=n?"+":"")+n,of:o.window},o._removeClass(x(this),"ui-dialog-resizing"),o._unblockFrames(),o._trigger("resizeStop",t,r(e))}}).css("position",e)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=x(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),e=x.inArray(this,t);-1!==e&&t.splice(e,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||(t=[],this.document.data("ui-dialog-instances",t)),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};x.each(t,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(t,e){var i,s,n=this.uiDialog;"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:x("<a>").text(""+this.options.closeText).html()}),"draggable"===t&&((i=n.is(":data(ui-draggable)"))&&!e&&n.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&((s=n.is(":data(ui-resizable)"))&&!e&&n.resizable("destroy"),s&&"string"==typeof e&&n.resizable("option","handles",e),s||!1===e||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=x(this);return x("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return!!x(t.target).closest(".ui-dialog").length||!!x(t.target).closest(".ui-datepicker").length},_createOverlay:function(){var e;this.options.modal&&(e=!0,this._delay(function(){e=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(t){e||this._allowInteraction(t)||(t.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=x("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1))},_destroyOverlay:function(){var t;this.options.modal&&this.overlay&&((t=this.document.data("ui-dialog-overlays")-1)?this.document.data("ui-dialog-overlays",t):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null)}}),!1!==x.uiBackCompat&&x.widget("ui.dialog",x.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}});x.ui.dialog;x.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,e=this.options,i=e.accept;this.isover=!1,this.isout=!0,this.accept=x.isFunction(i)?i:function(t){return t.is(i)},this.proportions=function(){if(!arguments.length)return t||(t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight});t=arguments[0]},this._addToManager(e.scope),e.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){x.ui.ddmanager.droppables[t]=x.ui.ddmanager.droppables[t]||[],x.ui.ddmanager.droppables[t].push(this)},_splice:function(t){for(var e=0;e<t.length;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var t=x.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,e){var i;"accept"===t?this.accept=x.isFunction(e)?e:function(t){return t.is(e)}:"scope"===t&&(i=x.ui.ddmanager.droppables[this.options.scope],this._splice(i),this._addToManager(e)),this._super(t,e)},_activate:function(t){var e=x.ui.ddmanager.current;this._addActiveClass(),e&&this._trigger("activate",t,this.ui(e))},_deactivate:function(t){var e=x.ui.ddmanager.current;this._removeActiveClass(),e&&this._trigger("deactivate",t,this.ui(e))},_over:function(t){var e=x.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(e)))},_out:function(t){var e=x.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(e)))},_drop:function(e,t){var i=t||x.ui.ddmanager.current,s=!1;return!(!i||(i.currentItem||i.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=x(this).droppable("instance");if(t.options.greedy&&!t.options.disabled&&t.options.scope===i.options.scope&&t.accept.call(t.element[0],i.currentItem||i.element)&&nt(i,x.extend(t,{offset:t.element.offset()}),t.options.tolerance,e))return!(s=!0)}),!s&&(!!this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(i)),this.element)))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var nt=x.ui.intersect=function(t,e,i,s){if(!e.offset)return!1;var n=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,a=n+t.helperProportions.width,r=o+t.helperProportions.height,h=e.offset.left,l=e.offset.top,c=h+e.proportions().width,u=l+e.proportions().height;switch(i){case"fit":return h<=n&&a<=c&&l<=o&&r<=u;case"intersect":return h<n+t.helperProportions.width/2&&a-t.helperProportions.width/2<c&&l<o+t.helperProportions.height/2&&r-t.helperProportions.height/2<u;case"pointer":return ot(s.pageY,l,e.proportions().height)&&ot(s.pageX,h,e.proportions().width);case"touch":return(l<=o&&o<=u||l<=r&&r<=u||o<l&&u<r)&&(h<=n&&n<=c||h<=a&&a<=c||n<h&&c<a);default:return!1}};function ot(t,e,i){return e<=t&&t<e+i}!(x.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,e){var i,s,n=x.ui.ddmanager.droppables[t.options.scope]||[],o=e?e.type:null,a=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();t:for(i=0;i<n.length;i++)if(!(n[i].options.disabled||t&&!n[i].accept.call(n[i].element[0],t.currentItem||t.element))){for(s=0;s<a.length;s++)if(a[s]===n[i].element[0]){n[i].proportions().height=0;continue t}n[i].visible="none"!==n[i].element.css("display"),n[i].visible&&("mousedown"===o&&n[i]._activate.call(n[i],e),n[i].offset=n[i].element.offset(),n[i].proportions({width:n[i].element[0].offsetWidth,height:n[i].element[0].offsetHeight}))}},drop:function(t,e){var i=!1;return x.each((x.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&nt(t,this,this.options.tolerance,e)&&(i=this._drop.call(this,e)||i),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,e)))}),i},dragStart:function(t,e){t.element.parentsUntil("body").on("scroll.droppable",function(){t.options.refreshPositions||x.ui.ddmanager.prepareOffsets(t,e)})},drag:function(o,a){o.options.refreshPositions&&x.ui.ddmanager.prepareOffsets(o,a),x.each(x.ui.ddmanager.droppables[o.options.scope]||[],function(){var t,e,i,s,n;this.options.disabled||this.greedyChild||!this.visible||(n=!(s=nt(o,this,this.options.tolerance,a))&&this.isover?"isout":s&&!this.isover?"isover":null)&&(this.options.greedy&&(e=this.options.scope,(i=this.element.parents(":data(ui-droppable)").filter(function(){return x(this).droppable("instance").options.scope===e})).length&&((t=x(i[0]).droppable("instance")).greedyChild="isover"===n)),t&&"isover"===n&&(t.isover=!1,t.isout=!0,t._out.call(t,a)),this[n]=!0,this["isout"===n?"isover":"isout"]=!1,this["isover"===n?"_over":"_out"].call(this,a),t&&"isout"===n&&(t.isout=!1,t.isover=!0,t._over.call(t,a)))})},dragStop:function(t,e){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||x.ui.ddmanager.prepareOffsets(t,e)}})!==x.uiBackCompat&&x.widget("ui.droppable",x.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}});x.ui.droppable,x.widget("ui.progressbar",{version:"1.12.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=x("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){if(void 0===t)return this.options.value;this.options.value=this._constrainedValue(t),this._refreshValue()},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=!1===t,"number"!=typeof t&&(t=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,e=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).width(e.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,t===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=x("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),x.widget("ui.selectable",x.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var s=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){s.elementPos=x(s.element[0]).offset(),s.selectees=x(s.options.filter,s.element[0]),s._addClass(s.selectees,"ui-selectee"),s.selectees.each(function(){var t=x(this),e=t.offset(),i={left:e.left-s.elementPos.left,top:e.top-s.elementPos.top};x.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=x("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(i){var s=this,t=this.options;this.opos=[i.pageX,i.pageY],this.elementPos=x(this.element[0]).offset(),this.options.disabled||(this.selectees=x(t.filter,this.element[0]),this._trigger("start",i),x(t.appendTo).append(this.helper),this.helper.css({left:i.pageX,top:i.pageY,width:0,height:0}),t.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var t=x.data(this,"selectable-item");t.startselected=!0,i.metaKey||i.ctrlKey||(s._removeClass(t.$element,"ui-selected"),t.selected=!1,s._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,s._trigger("unselecting",i,{unselecting:t.element}))}),x(i.target).parents().addBack().each(function(){var t,e=x.data(this,"selectable-item");if(e)return t=!i.metaKey&&!i.ctrlKey||!e.$element.hasClass("ui-selected"),s._removeClass(e.$element,t?"ui-unselecting":"ui-selected")._addClass(e.$element,t?"ui-selecting":"ui-unselecting"),e.unselecting=!t,e.selecting=t,(e.selected=t)?s._trigger("selecting",i,{selecting:e.element}):s._trigger("unselecting",i,{unselecting:e.element}),!1}))},_mouseDrag:function(s){if(this.dragged=!0,!this.options.disabled){var t,n=this,o=this.options,a=this.opos[0],r=this.opos[1],h=s.pageX,l=s.pageY;return h<a&&(t=h,h=a,a=t),l<r&&(t=l,l=r,r=t),this.helper.css({left:a,top:r,width:h-a,height:l-r}),this.selectees.each(function(){var t=x.data(this,"selectable-item"),e=!1,i={};t&&t.element!==n.element[0]&&(i.left=t.left+n.elementPos.left,i.right=t.right+n.elementPos.left,i.top=t.top+n.elementPos.top,i.bottom=t.bottom+n.elementPos.top,"touch"===o.tolerance?e=!(i.left>h||i.right<a||i.top>l||i.bottom<r):"fit"===o.tolerance&&(e=i.left>a&&i.right<h&&i.top>r&&i.bottom<l),e?(t.selected&&(n._removeClass(t.$element,"ui-selected"),t.selected=!1),t.unselecting&&(n._removeClass(t.$element,"ui-unselecting"),t.unselecting=!1),t.selecting||(n._addClass(t.$element,"ui-selecting"),t.selecting=!0,n._trigger("selecting",s,{selecting:t.element}))):(t.selecting&&((s.metaKey||s.ctrlKey)&&t.startselected?(n._removeClass(t.$element,"ui-selecting"),t.selecting=!1,n._addClass(t.$element,"ui-selected"),t.selected=!0):(n._removeClass(t.$element,"ui-selecting"),t.selecting=!1,t.startselected&&(n._addClass(t.$element,"ui-unselecting"),t.unselecting=!0),n._trigger("unselecting",s,{unselecting:t.element}))),t.selected&&(s.metaKey||s.ctrlKey||t.startselected||(n._removeClass(t.$element,"ui-selected"),t.selected=!1,n._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,n._trigger("unselecting",s,{unselecting:t.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,x(".ui-unselecting",this.element[0]).each(function(){var t=x.data(this,"selectable-item");i._removeClass(t.$element,"ui-unselecting"),t.unselecting=!1,t.startselected=!1,i._trigger("unselected",e,{unselected:t.element})}),x(".ui-selecting",this.element[0]).each(function(){var t=x.data(this,"selectable-item");i._removeClass(t.$element,"ui-selecting")._addClass(t.$element,"ui-selected"),t.selecting=!1,t.selected=!0,t.startselected=!0,i._trigger("selected",e,{selected:t.element})}),this._trigger("stop",e),this.helper.remove(),!1}}),x.widget("ui.selectmenu",[x.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var t=this.element.uniqueId().attr("id");this.ids={element:t,button:t+"-button",menu:t+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=x()},_drawButton:function(){var t,e=this,i=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.focus(),t.preventDefault()}}),this.element.hide(),this.button=x("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),t=x("<span>").appendTo(this.button),this._addClass(t,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(i).appendTo(this.button),!1!==this.options.width&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){e._rendered||e._refreshMenu()})},_drawMenu:function(){var s=this;this.menu=x("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=x("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,e){t.preventDefault(),s._setSelection(),s._select(e.item.data("ui-selectmenu-item"),t)},focus:function(t,e){var i=e.item.data("ui-selectmenu-item");null!=s.focusIndex&&i.index!==s.focusIndex&&(s._trigger("focus",t,{item:i}),s.isOpen||s._select(i,t)),s.focusIndex=i.index,s.button.attr("aria-activedescendant",s.menuItems.eq(i.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t,e=this.element.find("option");this.menu.empty(),this._parseOptions(e),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,e.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(x.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(t){var e=x("<span>");return this._setText(e,t.label),this._addClass(e,"ui-selectmenu-text"),e},_renderMenu:function(s,t){var n=this,o="";x.each(t,function(t,e){var i;e.optgroup!==o&&(i=x("<li>",{text:e.optgroup}),n._addClass(i,"ui-selectmenu-optgroup","ui-menu-divider"+(e.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),i.appendTo(s),o=e.optgroup),n._renderItemData(s,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(t,e){var i=x("<li>"),s=x("<div>",{title:e.element.attr("title")});return e.disabled&&this._addClass(i,null,"ui-state-disabled"),this._setText(s,e.label),i.append(s).appendTo(t)},_setText:function(t,e){e?t.text(e):t.html(" ")},_move:function(t,e){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),n+=":not(.ui-state-disabled)"),(s="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](n).eq(-1):i[t+"All"](n).eq(0)).length&&this.menuInstance.focus(e,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?((t=window.getSelection()).removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){this.isOpen&&(x(t.target).closest(".ui-selectmenu-menu, #"+x.ui.escapeSelector(this.ids.button)).length||this.close(t))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection()).rangeCount&&(this.range=t.getRangeAt(0)):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(t){var e=!0;switch(t.keyCode){case x.ui.keyCode.TAB:case x.ui.keyCode.ESCAPE:this.close(t),e=!1;break;case x.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case x.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case x.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case x.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case x.ui.keyCode.LEFT:this._move("prev",t);break;case x.ui.keyCode.RIGHT:this._move("next",t);break;case x.ui.keyCode.HOME:case x.ui.keyCode.PAGE_UP:this._move("first",t);break;case x.ui.keyCode.END:case x.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),e=!1}e&&t.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){var e=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":e,"aria-activedescendant":e}),this.menu.attr("aria-activedescendant",e)},_setOption:function(t,e){var i;"icons"===t&&(i=this.button.find("span.ui-icon"),this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)),this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var t=this.options.appendTo;return(t=t&&(t.jquery||t.nodeType?x(t):this.document.find(t).eq(0)))&&t[0]||(t=this.element.closest(".ui-front, dialog")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;!1!==t?(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t)):this.button.css("width","")},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(t){var i=this,s=[];t.each(function(t,e){s.push(i._parseOption(x(e),t))}),this.items=s},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),x.widget("ui.slider",x.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,e=this.options,i=this.element.find(".ui-slider-handle"),s=[],n=e.values&&e.values.length||1;for(i.length>n&&(i.slice(n).remove(),i=i.slice(0,n)),t=i.length;t<n;t++)s.push("<span tabindex='0'></span>");this.handles=i.add(x(s.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(t){x(this).data("ui-slider-handle-index",t).attr("tabIndex",0)})},_createRange:function(){var t=this.options;t.range?(!0===t.range&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:x.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=x("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==t.range&&"max"!==t.range||this._addClass(this.range,"ui-slider-range-"+t.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(t){var e,i,s,n,o,a,r,h=this,l=this.options;return!l.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var e=Math.abs(i-h.values(t));(e<s||s===e&&(t===h._lastChangedValue||h.values(t)===l.min))&&(s=e,n=x(this),o=t)}),!1!==this._start(t,o)&&(this._mouseSliding=!0,this._handleIndex=o,this._addClass(n,null,"ui-state-active"),n.trigger("focus"),a=n.offset(),r=!x(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=r?{left:0,top:0}:{left:t.pageX-a.left-n.width()/2,top:t.pageY-a.top-n.height()/2-(parseInt(n.css("borderTopWidth"),10)||0)-(parseInt(n.css("borderBottomWidth"),10)||0)+(parseInt(n.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,i),this._animateOff=!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n="horizontal"===this.orientation?(e=this.elementSize.width,t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),o=n/e;return 1<o&&(o=1),o<0&&(o=0),"vertical"===this.orientation&&(o=1-o),i=this._valueMax()-this._valueMin(),s=this._valueMin()+o*i,this._trimAlignValue(s)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n=this.value(),o=this.values();this._hasMultipleValues()&&(s=this.values(e?0:1),n=this.values(e),2===this.options.values.length&&!0===this.options.range&&(i=0===e?Math.min(s,i):Math.max(s,i)),o[e]=i),i!==n&&!1!==this._trigger("slide",t,this._uiHash(e,i,o))&&(this._hasMultipleValues()?this.values(e,i):this.value(i))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value()},values:function(t,e){var i,s,n;if(1<arguments.length)return this.options.values[t]=this._trimAlignValue(e),this._refreshValue(),void this._change(null,t);if(!arguments.length)return this._values();if(!x.isArray(t))return this._hasMultipleValues()?this._values(t):this.value();for(i=this.options.values,s=t,n=0;n<i.length;n+=1)i[n]=this._trimAlignValue(s[n]),this._change(null,n);this._refreshValue()},_setOption:function(t,e){var i,s=0;switch("range"===t&&!0===this.options.range&&("min"===e?(this.options.value=this._values(0),this.options.values=null):"max"===e&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),x.isArray(this.options.values)&&(s=this.options.values.length),this._super(t,e),t){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(e),this.handles.css("horizontal"===e?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=s-1;0<=i;i--)this._change(null,i);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],this._trimAlignValue(e);if(this._hasMultipleValues()){for(i=this.options.values.slice(),s=0;s<i.length;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(t<=this._valueMin())return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=0<this.options.step?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=0<i?e:-e),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step;(t=Math.round((t-e)/i)*i+e)>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=t.toString(),i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,t,s,n,o=this.options.range,a=this.options,r=this,h=!this._animateOff&&a.animate,l={};this._hasMultipleValues()?this.handles.each(function(t){i=(r.values(t)-r._valueMin())/(r._valueMax()-r._valueMin())*100,l["horizontal"===r.orientation?"left":"bottom"]=i+"%",x(this).stop(1,1)[h?"animate":"css"](l,a.animate),!0===r.options.range&&("horizontal"===r.orientation?(0===t&&r.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},a.animate),1===t&&r.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:a.animate})):(0===t&&r.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},a.animate),1===t&&r.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:a.animate}))),e=i}):(t=this.value(),s=this._valueMin(),n=this._valueMax(),i=n!==s?(t-s)/(n-s)*100:0,l["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](l,a.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},a.animate),"max"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:100-i+"%"},a.animate),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},a.animate),"max"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:100-i+"%"},a.animate))},_handleEvents:{keydown:function(t){var e,i,s,n=x(t.target).data("ui-slider-handle-index");switch(t.keyCode){case x.ui.keyCode.HOME:case x.ui.keyCode.END:case x.ui.keyCode.PAGE_UP:case x.ui.keyCode.PAGE_DOWN:case x.ui.keyCode.UP:case x.ui.keyCode.RIGHT:case x.ui.keyCode.DOWN:case x.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(x(t.target),null,"ui-state-active"),!1===this._start(t,n)))return}switch(s=this.options.step,e=i=this._hasMultipleValues()?this.values(n):this.value(),t.keyCode){case x.ui.keyCode.HOME:i=this._valueMin();break;case x.ui.keyCode.END:i=this._valueMax();break;case x.ui.keyCode.PAGE_UP:i=this._trimAlignValue(e+(this._valueMax()-this._valueMin())/this.numPages);break;case x.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(e-(this._valueMax()-this._valueMin())/this.numPages);break;case x.ui.keyCode.UP:case x.ui.keyCode.RIGHT:if(e===this._valueMax())return;i=this._trimAlignValue(e+s);break;case x.ui.keyCode.DOWN:case x.ui.keyCode.LEFT:if(e===this._valueMin())return;i=this._trimAlignValue(e-s)}this._slide(t,n,i)},keyup:function(t){var e=x(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,e),this._change(t,e),this._removeClass(x(t.target),null,"ui-state-active"))}}}),x.widget("ui.sortable",x.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return e<=t&&t<e+i},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),x.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;0<=t;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,e){var i=null,s=!1,n=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(t),x(t.target).parents().each(function(){if(x.data(this,n.widgetName+"-item")===n)return i=x(this),!1}),x.data(t.target,n.widgetName+"-item")===n&&(i=x(t.target)),!!i&&(!(this.options.handle&&!e&&(x(this.options.handle,i).find("*").addBack().each(function(){this===t.target&&(s=!0)}),!s))&&(this.currentItem=i,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(t,e,i){var s,n,o=this.options;if((this.currentContainer=this).refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},x.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(n=this.document.find("body"),this.storedCursor=n.css("cursor"),n.css("cursor",o.cursor),this.storedStylesheet=x("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(n)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return x.ui.ddmanager&&(x.ui.ddmanager.current=this),x.ui.ddmanager&&!o.dropBehaviour&&x.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var e,i,s,n,o=this.options,a=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?a=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(a=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?a=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(a=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),!1!==a&&x.ui.ddmanager&&!o.dropBehaviour&&x.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e=this.items.length-1;0<=e;e--)if(s=(i=this.items[e]).item[0],(n=this._intersectsWithPointer(i))&&i.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===n?"next":"prev"]()[0]===s||x.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&x.contains(this.element[0],s))){if(this.direction=1===n?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(t,i),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),x.ui.ddmanager&&x.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,e){var i,s,n,o;if(t)return x.ui.ddmanager&&!this.options.dropBehaviour&&x.ui.ddmanager.drop(this,t),this.options.revert?(s=(i=this).placeholder.offset(),o={},(n=this.options.axis)&&"x"!==n||(o.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),n&&"y"!==n||(o.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,x(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){i._clear(t)})):this._clear(t,e),!1},cancel:function(){if(this.dragging){this._mouseUp(new x.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;0<=t;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),x.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?x(this.domPosition.prev).after(this.currentItem):x(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var t=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},x(t).each(function(){var t=(x(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);t&&i.push((e.key||t[1]+"[]")+"="+(e.key&&e.expression?t[1]:t[2]))}),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e.each(function(){i.push(x(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||r<s+l&&s+l<h,d="y"===this.options.axis||o<e+c&&e+c<a,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:o<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<a&&r<s+this.helperProportions.height/2&&n-this.helperProportions.height/2<h},_intersectsWithPointer:function(t){var e,i,s="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!s||!n)&&(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(0<t?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(0<t?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e,i,s,n,o=[],a=[],r=this._connectWith();if(r&&t)for(e=r.length-1;0<=e;e--)for(i=(s=x(r[e],this.document[0])).length-1;0<=i;i--)(n=x.data(s[i],this.widgetFullName))&&n!==this&&!n.options.disabled&&a.push([x.isFunction(n.options.items)?n.options.items.call(n.element):x(n.options.items,n.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),n]);function h(){o.push(this)}for(a.push([x.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):x(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),e=a.length-1;0<=e;e--)a[e][0].each(h);return x(o)},_removeCurrentsFromItems:function(){var i=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=x.grep(this.items,function(t){for(var e=0;e<i.length;e++)if(i[e]===t.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var e,i,s,n,o,a,r,h,l=this.items,c=[[x.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):x(this.options.items,this.element),this]],u=this._connectWith();if(u&&this.ready)for(e=u.length-1;0<=e;e--)for(i=(s=x(u[e],this.document[0])).length-1;0<=i;i--)(n=x.data(s[i],this.widgetFullName))&&n!==this&&!n.options.disabled&&(c.push([x.isFunction(n.options.items)?n.options.items.call(n.element[0],t,{item:this.currentItem}):x(n.options.items,n.element),n]),this.containers.push(n));for(e=c.length-1;0<=e;e--)for(o=c[e][1],i=0,h=(a=c[e][0]).length;i<h;i++)(r=x(a[i])).data(this.widgetName+"-item",o),l.push({item:r,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){var e,i,s,n;for(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),e=this.items.length-1;0<=e;e--)(i=this.items[e]).instance!==this.currentContainer&&this.currentContainer&&i.item[0]!==this.currentItem[0]||(s=this.options.toleranceElement?x(this.options.toleranceElement,i.item):i.item,t||(i.width=s.outerWidth(),i.height=s.outerHeight()),n=s.offset(),i.left=n.left,i.top=n.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;0<=e;e--)n=this.containers[e].element.offset(),this.containers[e].containerCache.left=n.left,this.containers[e].containerCache.top=n.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight();return this},_createPlaceholder:function(i){var s,n=(i=i||this).options;n.placeholder&&n.placeholder.constructor!==String||(s=n.placeholder,n.placeholder={element:function(){var t=i.currentItem[0].nodeName.toLowerCase(),e=x("<"+t+">",i.document[0]);return i._addClass(e,"ui-sortable-placeholder",s||i.currentItem[0].className)._removeClass(e,"ui-sortable-helper"),"tbody"===t?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),x("<tr>",i.document[0]).appendTo(e)):"tr"===t?i._createTrPlaceholder(i.currentItem,e):"img"===t&&e.attr("src",i.currentItem.attr("src")),s||e.css("visibility","hidden"),e},update:function(t,e){s&&!n.forcePlaceholderSize||(e.height()||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width()||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10)))}}),i.placeholder=x(n.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),n.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){x("<td> </td>",i.document[0]).attr("colspan",x(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){for(var e,i,s,n,o,a,r,h,l,c=null,u=null,d=this.containers.length-1;0<=d;d--)if(!x.contains(this.currentItem[0],this.containers[d].element[0]))if(this._intersectsWith(this.containers[d].containerCache)){if(c&&x.contains(this.containers[d].element[0],c.element[0]))continue;c=this.containers[d],u=d}else this.containers[d].containerCache.over&&(this.containers[d]._trigger("out",t,this._uiHash(this)),this.containers[d].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[u].containerCache.over||(this.containers[u]._trigger("over",t,this._uiHash(this)),this.containers[u].containerCache.over=1);else{for(i=1e4,s=null,n=(h=c.floating||this._isFloating(this.currentItem))?"left":"top",o=h?"width":"height",l=h?"pageX":"pageY",e=this.items.length-1;0<=e;e--)x.contains(this.containers[u].element[0],this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(a=this.items[e].item.offset()[n],r=!1,t[l]-a>this.items[e][o]/2&&(r=!0),Math.abs(t[l]-a)<i&&(i=Math.abs(t[l]-a),s=this.items[e],this.direction=r?"up":"down"));if(!s&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[u])return void(this.currentContainer.containerCache.over||(this.containers[u]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1));s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[u].element,!0),this._trigger("change",t,this._uiHash()),this.containers[u]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[u],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[u]._trigger("over",t,this._uiHash(this)),this.containers[u].containerCache.over=1}},_createHelper:function(t){var e=this.options,i=x.isFunction(e.helper)?x(e.helper.apply(this.element[0],[t,this.currentItem])):"clone"===e.helper?this.currentItem.clone():this.currentItem;return i.parents("body").length||x("parent"!==e.appendTo?e.appendTo:this.currentItem[0].parentNode)[0].appendChild(i[0]),i[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),i[0].style.width&&!e.forceHelperSize||i.width(this.currentItem.width()),i[0].style.height&&!e.forceHelperSize||i.height(this.currentItem.height()),i},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),x.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&x.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&x.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i,s=this.options;"parent"===s.containment&&(s.containment=this.helper[0].parentNode),"document"!==s.containment&&"window"!==s.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===s.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===s.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(s.containment)||(t=x(s.containment)[0],e=x(s.containment).offset(),i="hidden"!==x(t).css("overflow"),this.containment=[e.left+(parseInt(x(t).css("borderLeftWidth"),10)||0)+(parseInt(x(t).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(x(t).css("borderTopWidth"),10)||0)+(parseInt(x(t).css("paddingTop"),10)||0)-this.margins.top,e.left+(i?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(x(t).css("borderLeftWidth"),10)||0)-(parseInt(x(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(i?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(x(t).css("borderTopWidth"),10)||0)-(parseInt(x(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&x.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,n=/(html|body)/i.test(s[0].tagName);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():n?0:s.scrollTop())*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():n?0:s.scrollLeft())*i}},_generatePosition:function(t){var e,i,s=this.options,n=t.pageX,o=t.pageY,a="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&x.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(a[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(n=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(n=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),s.grid&&(e=this.originalPageY+Math.round((o-this.originalPageY)/s.grid[1])*s.grid[1],o=!this.containment||e-this.offset.click.top>=this.containment[1]&&e-this.offset.click.top<=this.containment[3]?e:e-this.offset.click.top>=this.containment[1]?e-s.grid[1]:e+s.grid[1],i=this.originalPageX+Math.round((n-this.originalPageX)/s.grid[0])*s.grid[0],n=!this.containment||i-this.offset.click.left>=this.containment[0]&&i-this.offset.click.left<=this.containment[2]?i:i-this.offset.click.left>=this.containment[0]?i-s.grid[0]:i+s.grid[0])),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():r?0:a.scrollTop()),left:n-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():r?0:a.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function n(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)e||s.push(n("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(n("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i<s.length;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===x.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var e=t||this;return{helper:e.helper,placeholder:e.placeholder||x([]),position:e.position,originalPosition:e.originalPosition,offset:e.positionAbs,item:e.currentItem,sender:t?t.element:null}}});function at(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}x.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var s=this._super(),n=this.element;return x.each(["min","max","step"],function(t,e){var i=n.attr(e);null!=i&&i.length&&(s[e]=i)}),s},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t))},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((0<e?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(t){var e;function i(){this.element[0]===x.ui.safeActiveElement(this.document[0])||(this.element.trigger("focus"),this.previous=e,this._delay(function(){this.previous=e}))}e=this.element[0]===x.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),!1!==this._start(t)&&this._repeat(null,x(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(x(t.currentTarget).hasClass("ui-state-active"))return!1!==this._start(t)&&void this._repeat(null,x(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&0<this.uiSpinner.height()&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(t){var e=this.options,i=x.ui.keyCode;switch(t.keyCode){case i.UP:return this._repeat(null,1,t),!0;case i.DOWN:return this._repeat(null,-1,t),!0;case i.PAGE_UP:return this._repeat(null,e.page,t),!0;case i.PAGE_DOWN:return this._repeat(null,-e.page,t),!0}return!1},_start:function(t){return!(!this.spinning&&!1===this._trigger("start",t))&&(this.counter||(this.counter=1),this.spinning=!0)},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",e,{value:i})||(this._value(i),this.counter++)},_increment:function(t){var e=this.options.incremental;return e?x.isFunction(e)?e(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=t.toString(),i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e=this.options,i=null!==e.min?e.min:0,s=t-i;return t=i+Math.round(s/e.step)*e.step,t=parseFloat(t.toFixed(this._precision())),null!==e.max&&t>e.max?e.max:null!==e.min&&t<e.min?e.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i,s,n;if("culture"===t||"numberFormat"===t)return i=this._parse(this.element.val()),this.options[t]=e,void this.element.val(this._format(i));"max"!==t&&"min"!==t&&"step"!==t||"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(s=this.buttons.first().find(".ui-icon"),this._removeClass(s,null,this.options.icons.up),this._addClass(s,null,e.up),n=this.buttons.last().find(".ui-icon"),this._removeClass(n,null,this.options.icons.down),this._addClass(n,null,e.down)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:at(function(t){this._super(t)}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null!==t&&t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&null!==(i=this._parse(t))&&(e||(i=this._adjustValue(i)),t=this._format(i)),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:at(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:at(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:at(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:at(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){if(!arguments.length)return this._parse(this.element.val());at(this._value).call(this,t)},widget:function(){return this.uiSpinner}}),!1!==x.uiBackCompat&&x.widget("ui.spinner",x.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}});var rt;x.ui.spinner;x.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(rt=/#.*$/,function(t){var e=t.href.replace(rt,""),i=location.href.replace(rt,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return 1<t.hash.length&&e===i}),_create:function(){var e=this,t=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,t.collapsible),this._processTabs(),t.active=this._initialActive(),x.isArray(t.disabled)&&(t.disabled=x.unique(t.disabled.concat(x.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(t.active):this.active=x(),this._refresh(),this.active.length&&this.load(t.active)},_initialActive:function(){var i=this.options.active,t=this.options.collapsible,s=location.hash.substring(1);return null===i&&(s&&this.tabs.each(function(t,e){if(x(e).attr("aria-controls")===s)return i=t,!1}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==i&&-1!==i||(i=!!this.tabs.length&&0)),!1!==i&&-1===(i=this.tabs.index(this.tabs.eq(i)))&&(i=!t&&0),!t&&!1===i&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):x()}},_tabKeydown:function(t){var e=x(x.ui.safeActiveElement(this.document[0])).closest("li"),i=this.tabs.index(e),s=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case x.ui.keyCode.RIGHT:case x.ui.keyCode.DOWN:i++;break;case x.ui.keyCode.UP:case x.ui.keyCode.LEFT:s=!1,i--;break;case x.ui.keyCode.END:i=this.anchors.length-1;break;case x.ui.keyCode.HOME:i=0;break;case x.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i);case x.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i);default:return}t.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,s),t.ctrlKey||t.metaKey||(e.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===x.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===x.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===x.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,e){var i=this.tabs.length-1;for(;-1!==x.inArray((i<t&&(t=0),t<0&&(t=i),t),this.options.disabled);)t=e?t+1:t-1;return t},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){"active"!==t?(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e)):this._activate(e)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=x.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!x.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=x()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=x()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var h=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){x(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){x(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return x("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=x(),this.anchors.each(function(t,e){var i,s,n,o=x(e).uniqueId().attr("id"),a=x(e).closest("li"),r=a.attr("aria-controls");h._isLocal(e)?(n=(i=e.hash).substring(1),s=h.element.find(h._sanitizeSelector(i))):(i="#"+(n=a.attr("aria-controls")||x({}).uniqueId()[0].id),(s=h.element.find(i)).length||(s=h._createPanel(n)).insertAfter(h.panels[t-1]||h.tablist),s.attr("aria-live","polite")),s.length&&(h.panels=h.panels.add(s)),r&&a.data("ui-tabs-aria-controls",r),a.attr({"aria-controls":n,"aria-labelledby":o}),s.attr("aria-labelledby",o)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return x("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var e,i,s;for(x.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),s=0;i=this.tabs[s];s++)e=x(i),!0===t||-1!==x.inArray(s,t)?(e.attr("aria-disabled","true"),this._addClass(e,null,"ui-state-disabled")):(e.removeAttr("aria-disabled"),this._removeClass(e,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&x.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=x(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=x(this).outerHeight(!0)}),this.panels.each(function(){x(this).height(Math.max(0,i-x(this).innerHeight()+x(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,x(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,s=x(t.currentTarget).closest("li"),n=s[0]===i[0],o=n&&e.collapsible,a=o?x():this._getPanelForTab(s),r=i.length?this._getPanelForTab(i):x(),h={oldTab:i,oldPanel:r,newTab:o?x():s,newPanel:a};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||n&&!e.collapsible||!1===this._trigger("beforeActivate",t,h)||(e.active=!o&&this.tabs.index(s),this.active=n?x():s,this.xhr&&this.xhr.abort(),r.length||a.length||x.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,h))},_toggle:function(t,e){var i=this,s=e.newPanel,n=e.oldPanel;function o(){i.running=!1,i._trigger("activate",t,e)}function a(){i._addClass(e.newTab.closest("li"),"ui-tabs-active","ui-state-active"),s.length&&i.options.show?i._show(s,i.options.show,o):(s.show(),o())}this.running=!0,n.length&&this.options.hide?this._hide(n,this.options.hide,function(){i._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),a()}):(this._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n.hide(),a()),n.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),s.length&&n.length?e.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===x(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var e,i=this._findActive(t);i[0]!==this.active[0]&&(i.length||(i=this.active),e=i.find(".ui-tabs-anchor")[0],this._eventHandler({target:e,currentTarget:e,preventDefault:x.noop}))},_findActive:function(t){return!1===t?x():this.tabs.eq(t)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+x.ui.escapeSelector(t)+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){x.data(this,"ui-tabs-destroy")?x(this).remove():x(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=x(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),x.isArray(t)?x.map(t,function(t){return t!==i?t:null}):x.map(this.tabs,function(t,e){return e!==i?e:null})),this._setOptionDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==x.inArray(t,e))return;e=x.isArray(e)?x.merge([t],e).sort():[t]}this._setOptionDisabled(e)}},load:function(t,s){t=this._getIndex(t);function n(t,e){"abort"===e&&o.panels.stop(!1,!0),o._removeClass(i,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===o.xhr&&delete o.xhr}var o=this,i=this.tabs.eq(t),e=i.find(".ui-tabs-anchor"),a=this._getPanelForTab(i),r={tab:i,panel:a};this._isLocal(e[0])||(this.xhr=x.ajax(this._ajaxSettings(e,s,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,i){setTimeout(function(){a.html(t),o._trigger("load",s,r),n(i,e)},1)}).fail(function(t,e){setTimeout(function(){n(t,e)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,e){return n._trigger("beforeLoad",i,x.extend({jqXHR:t,ajaxSettings:e},s))}}},_getPanelForTab:function(t){var e=x(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+e))}}),!1!==x.uiBackCompat&&x.widget("ui.tabs",x.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}});x.ui.tabs;x.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var t=x(this).attr("title")||"";return x("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(t,e){var i=(t.attr("aria-describedby")||"").split(/\s+/);i.push(e),t.data("ui-tooltip-id",e).attr("aria-describedby",x.trim(i.join(" ")))},_removeDescribedBy:function(t){var e=t.data("ui-tooltip-id"),i=(t.attr("aria-describedby")||"").split(/\s+/),s=x.inArray(e,i);-1!==s&&i.splice(s,1),t.removeData("ui-tooltip-id"),(i=x.trim(i.join(" ")))?t.attr("aria-describedby",i):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=x("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=x([])},_setOption:function(t,e){var i=this;this._super(t,e),"content"===t&&x.each(this.tooltips,function(t,e){i._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var s=this;x.each(this.tooltips,function(t,e){var i=x.Event("blur");i.target=i.currentTarget=e.element[0],s.close(i,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var t=x(this);if(t.is("[title]"))return t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var t=x(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))}),this.disabledTitles=x([])},open:function(t){var i=this,e=x(t?t.target:this.element).closest(this.options.items);e.length&&!e.data("ui-tooltip-id")&&(e.attr("title")&&e.data("ui-tooltip-title",e.attr("title")),e.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&e.parents().each(function(){var t,e=x(this);e.data("ui-tooltip-open")&&((t=x.Event("blur")).target=t.currentTarget=this,i.close(t,!0)),e.attr("title")&&(e.uniqueId(),i.parents[this.id]={element:this,title:e.attr("title")},e.attr("title",""))}),this._registerCloseHandlers(t,e),this._updateContent(e,t))},_updateContent:function(e,i){var t,s=this.options.content,n=this,o=i?i.type:null;if("string"==typeof s||s.nodeType||s.jquery)return this._open(i,e,s);(t=s.call(e[0],function(t){n._delay(function(){e.data("ui-tooltip-open")&&(i&&(i.type=o),this._open(i,e,t))})}))&&this._open(i,e,t)},_open:function(t,e,i){var s,n,o,a,r=x.extend({},this.options.position);function h(t){r.of=t,n.is(":hidden")||n.position(r)}i&&((s=this._find(e))?s.tooltip.find(".ui-tooltip-content").html(i):(e.is("[title]")&&(t&&"mouseover"===t.type?e.attr("title",""):e.removeAttr("title")),s=this._tooltip(e),n=s.tooltip,this._addDescribedBy(e,n.attr("id")),n.find(".ui-tooltip-content").html(i),this.liveRegion.children().hide(),(a=x("<div>").html(n.find(".ui-tooltip-content").html())).removeAttr("name").find("[name]").removeAttr("name"),a.removeAttr("id").find("[id]").removeAttr("id"),a.appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:h}),h(t)):n.position(x.extend({of:e},this.options.position)),n.hide(),this._show(n,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(o=this.delayedShow=setInterval(function(){n.is(":visible")&&(h(r.of),clearInterval(o))},x.fx.interval)),this._trigger("open",t,{tooltip:n})))},_registerCloseHandlers:function(t,i){var e={keyup:function(t){var e;t.keyCode===x.ui.keyCode.ESCAPE&&((e=x.Event(t)).currentTarget=i[0],this.close(e,!0))}};i[0]!==this.element[0]&&(e.remove=function(){this._removeTooltip(this._find(i).tooltip)}),t&&"mouseover"!==t.type||(e.mouseleave="close"),t&&"focusin"!==t.type||(e.focusout="close"),this._on(!0,i,e)},close:function(t){var e,i=this,s=x(t?t.currentTarget:this.element),n=this._find(s);n?(e=n.tooltip,n.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&!s.attr("title")&&s.attr("title",s.data("ui-tooltip-title")),this._removeDescribedBy(s),n.hiding=!0,e.stop(!0),this._hide(e,this.options.hide,function(){i._removeTooltip(x(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&x.each(this.parents,function(t,e){x(e.element).attr("title",e.title),delete i.parents[t]}),n.closing=!0,this._trigger("close",t,{tooltip:e}),n.hiding||(n.closing=!1))):s.removeData("ui-tooltip-open")},_tooltip:function(t){var e=x("<div>").attr("role","tooltip"),i=x("<div>").appendTo(e),s=e.uniqueId().attr("id");return this._addClass(i,"ui-tooltip-content"),this._addClass(e,"ui-tooltip","ui-widget ui-widget-content"),e.appendTo(this._appendTo(t)),this.tooltips[s]={element:t,tooltip:e}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var n=this;x.each(this.tooltips,function(t,e){var i=x.Event("blur"),s=e.element;i.target=i.currentTarget=s[0],n.close(i,!0),x("#"+t).remove(),s.data("ui-tooltip-title")&&(s.attr("title")||s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),!1!==x.uiBackCompat&&x.widget("ui.tooltip",x.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}});x.ui.tooltip});
|