").text(n)),u.lockfiles({files:[I]}),u.request({data:Object.assign({cmd:f,name:n,target:A},M||{}),notify:{type:h,cnt:1},preventFail:!0,syncOnFail:!0,navigate:{toast:t}}).fail(function(e){u.unlockfiles({files:[I]}),q=!0,F.show().prev().remove(),u.error(e,{modal:!0,close:P})}).done(function(n){if(T.resolve(n),n&&n.added&&n.added[0]){var o=n.added[0],r=o.hash,s=(v.find("#"+u[y](r)),{directory:{cmd:"open",msg:"cmdopendir"},text:{cmd:"edit",msg:"cmdedit"},"default":{cmd:"open",msg:"cmdopen"}});x&&k&&u.one(f+"done",function(){u.exec("paste",r)}),k||(Object.assign(i,a||s[o.mime]||s[o.mime.split("/")[0]]||s[e.inArray(o.mime,u.resources.mimes.text)!==-1?"text":"none"]||s["default"]),Object.assign(t,i.cmd?{incwd:{msg:u.i18n(["complete",u.i18n("cmd"+h)]),action:i},inbuffer:{msg:u.i18n(["complete",u.i18n("cmd"+h)]),action:i}}:{inbuffer:{msg:u.i18n(["complete",u.i18n("cmd"+h)])}}))}})}).fail(function(){T.reject()})}}),P=function(){var e=F.val().replace(/\.((tar\.(gz|bz|bz2|z|lzo))|cpio\.gz|ps\.gz|xcf\.(gz|bz2)|[a-z0-9]{1,4})$/gi,"");!q&&u.UA.Mobile&&j.on("click",E).removeClass("ui-front").elfinderoverlay("show"),q=!1,F.select().focus(),F[0].setSelectionRange&&F[0].setSelectionRange(0,e.length)},R=function(){U.trigger("scrolltoview")},H=function(){T&&"pending"===T.state()&&T.reject()},q=!1;return u.isCommandEnabled(f,A)&&U.length?(e.isPlainObject(p.nextAction)&&(a=Object.assign({},p.nextAction)),b?(o=e("#"+u[y](A)),s=u.res("class","navcollapse"),l=u.res("class","navexpand"),c=u.res("class","navarrow"),d=u.res("class","navsubtree"),U.closest("."+d).show(),o.hasClass(s)||(r=o.attr("class"),o.addClass(s+" "+l+" elfinder-subtree-loaded")),o.is("."+s+":not(."+l+")")&&o.children("."+c).click().data("dfrd").done(function(){F.val()===O.name&&F.val(u.uniqueName(this.prefix,A)).select().focus()}.bind(this)),n=U.contents().filter(function(){return 3==this.nodeType&&e(this).parent().attr("id")===u.navHash2Id(O.hash)}),n.replaceWith(F.val(O.name))):(C&&m.removeClass("elfinder-cwd-wrapper-empty"),n=U.find(".elfinder-cwd-filename"),i=n.parent(),U.css("position","relative").addClass("ui-front"),w?n.css("max-height","none"):(t=i.width(),i.width(t-15).parent("td").css("overflow","visible")),n.empty("").append(F.val(O.name))),u.bind("resize",R).one("open",H),F.trigger("keyup"),P(),T):T.reject()}},blink:function(e,t){var n,i={slowonce:function(){e.hide().delay(250).fadeIn(750).delay(500).fadeOut(3500)},lookme:function(){e.show().fadeOut(500).fadeIn(750)}};t=t||"slowonce",n=i[t]||i.lookme,e.stop(!0,!0),n()}},e.fn.dialogelfinder=function(t){var n="elfinderPosition",i="elfinderDestroyOnClose";if(this.not(".elfinder").each(function(){var a=(e(document),e('")),o=(e(' ').appendTo(a).click(function(e){e.preventDefault(),o.dialogelfinder("close")}),e(this).addClass("dialogelfinder").css("position","absolute").hide().appendTo("body").draggable({handle:".dialogelfinder-drag",containment:"window",stop:function(){o.trigger("resize"),r.trigger("resize")}}).elfinder(t).prepend(a)),r=o.elfinder("instance");o.width(parseInt(o.width())||840).data(i,!!t.destroyOnClose).find(".elfinder-toolbar").removeClass("ui-corner-top"),t.position&&o.data(n,t.position),t.autoOpen!==!1&&e(this).dialogelfinder("open")}),"open"==t){var a=e(this),o=a.data(n)||{top:parseInt(e(document).scrollTop()+(e(window).height()This cannot be undone!",confirmRepl:"Replace old item with new one?",confirmRest:"Replace existing item with the item in trash?",confirmConvUTF8:"Not in UTF-8
Convert to UTF-8?
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.
Please select character encoding of this file.",confirmNotSave:"It has been modified.
Losing work if you do not save changes.",confirmTrash:"Are you sure you want to move items to trash bin?",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 files",selectfiles:"Select file(s)",selectffile:"Select first file",selectlfile:"Select last file",viewlist:"List view",viewicons:"Icons view",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 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.\\APress [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 setting",clearBrowserData:"Initialize the settings saved in this browser",toolbarPref:"Toolbar setting",charsLeft:"... $1 chars left.",sum:"Sum",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"}}),e.fn.elfinderbutton=function(t){return this.each(function(){var n,i="class",a=t.fm,o=a.res(i,"disabled"),r=a.res(i,"active"),s=a.res(i,"hover"),l="elfinder-button-menu-item",c="elfinder-button-menu-item-selected",d=e(''+t.title+""),p=e(this).addClass("ui-state-default elfinder-button").attr("title",t.title).append('',d).hover(function(e){!p.hasClass(o)&&p["mouseleave"==e.type?"removeClass":"addClass"](s)}).click(function(e){p.hasClass(o)||(n&&t.variants.length>=1?(n.is(":hidden")&&t.fm.getUI().click(),e.stopPropagation(),n.slideToggle(100)):a.exec(t.name,void 0,{_userAction:!0,_currentType:"toolbar",_currentNode:p}))}),u=function(){n.hide()};d.hide(),t.button=p,Array.isArray(t.variants)&&(p.addClass("elfinder-menubutton"),n=e('').hide().appendTo(p).on("mouseenter mouseleave","."+l,function(){e(this).toggleClass(s)}).on("click","."+l,function(i){var o=e(this).data("value");i.preventDefault(),i.stopPropagation(),p.removeClass(s),n.hide(),"undefined"==typeof o&&(o={}),"object"==typeof o&&(o._userAction=!0),a.exec(t.name,a.selected(),o)}),t.fm.bind("disable select",u).getUI().click(u),t.change(function(){n.html(""),e.each(t.variants,function(i,a){n.append(e(''+a[1]+"
").data("value",a[0]).addClass(a[0]==t.value?c:""))})})),t.change(function(){t.disabled()?p.removeClass(r+" "+s).addClass(o):(p.removeClass(o),p[t.active()?"addClass":"removeClass"](r)),t.syncTitleOnChange&&(d.html(t.title),p.attr("title",t.title))}).change()})},e.fn.elfindercontextmenu=function(t){return this.each(function(){var n,i,a,o,r,s,l,c="elfinder-contextmenu-item",d="elfinder-contextsubmenu-item",p="elfinder-contextmenu-extra-icon",u={distance:8,start:function(){h.data("drag",!0).data("touching")&&h.find(".ui-state-hover").removeClass("ui-state-hover")},stop:function(){h.data("draged",!0).removeData("drag")}},h=e(this).addClass("touch-punch ui-helper-reset ui-front ui-widget ui-state-default ui-corner-all elfinder-contextmenu elfinder-contextmenu-"+t.direction).hide().on("touchstart",function(e){h.data("touching",!0).children().removeClass("ui-state-hover")}).on("touchend",function(e){h.removeData("touching")}).on("mouseenter mouseleave","."+c,function(t){e(this).toggleClass("ui-state-hover",!("mouseenter"!==t.type&&(h.data("draged")||!h.data("submenuKeep")))),h.data("draged")&&h.data("submenuKeep")&&h.find(".elfinder-contextmenu-sub:visible").parent().addClass("ui-state-hover")}).on("mouseenter mouseleave","."+p,function(t){e(this).parent().toggleClass("ui-state-hover","mouseleave"===t.type)}).on("mouseenter mouseleave","."+c+",."+d,function(t){var n=function(t,n){e.each(n?r:a,function(e,i){if(t[0]===i)return(n?r:a)._cur=e,n?s=t:o=t,!1})};if(t.originalEvent){var i=e(this),l=function(){o&&!o.children("div.elfinder-contextmenu-sub:visible").length&&o.removeClass("ui-state-hover")};"mouseenter"===t.type?i.hasClass(d)?(s&&s.removeClass("ui-state-hover"),o&&(r=o.find("div."+d)),n(i,!0)):(l(),n(i)):i.hasClass(d)?(s=null,r=null):(l(),function(e){setTimeout(function(){e===o&&(o=null)},250)}(o))}}).on("contextmenu",function(){return!1}).on("mouseup",function(){setTimeout(function(){h.removeData("draged")},100)}).draggable(u),f="ltr"==t.direction?"left":"right",m=Object.assign({},t.options.contextmenu),g='{label}
',v=function(n,i,a,o){var r="",s="",l="";return o&&(o.className&&(r=" "+o.className),o.iconClass&&(l=o.iconClass,i=""),o.iconImg&&(s=" style=\"background:url('"+t.escape(o.iconImg)+"') 0 0 no-repeat;background-size:contain;\"")),e(g.replace("{icon}",i?"elfinder-button-icon-"+i:l?l:"").replace("{label}",n).replace("{style}",s).replace("{className}",r)).click(function(e){e.stopPropagation(),e.preventDefault(),a()})},b=function(e){return{backgroundImage:'url("'+e+'")',backgroundRepeat:"no-repeat",backgroundSize:"contain"}},y=function(){var n="touchstart.contextmenuAutoToggle";h.data("hideTm")&&clearTimeout(h.data("hideTm")),h.is(":visible")&&h.on("touchstart",function(e){e.originalEvent.touches.length>1||(h.stop().show(),h.data("hideTm")&&clearTimeout(h.data("hideTm")))}).data("hideTm",setTimeout(function(){i.find(".elfinder-cwd-file").off(n),i.find(".elfinder-cwd-file.ui-selected").one(n,function(t){if(!(t.originalEvent.touches.length>1)){var a=e(t.target);return!h.first().length||a.is("input:checkbox")||a.hasClass("elfinder-cwd-select")?void i.find(".elfinder-cwd-file").off(n):(x(t.originalEvent.touches[0].pageX,t.originalEvent.touches[0].pageY),!1)}}).one("unselect."+t.namespace,function(){i.find(".elfinder-cwd-file").off(n)}),h.fadeOut({duration:300,fail:function(){h.css("opacity","1").show()}})},4500))},w=function(n){var i=n.keyCode,l=e.ui.keyCode.ESCAPE,c=e.ui.keyCode.ENTER,p=e.ui.keyCode.LEFT,u=e.ui.keyCode.RIGHT,h=e.ui.keyCode.UP,f=e.ui.keyCode.DOWN,m="ltr"===t.direction?u:p,g=m===u?p:u;e.inArray(i,[l,c,p,u,h,f])!==-1&&(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),i==l||i===g?o&&r&&s?(s.trigger("mouseleave"),o.addClass("ui-state-hover"),r=null,s=null):i==l&&k():i==h||i==f?r?(s&&s.trigger("mouseleave"),i==f&&(!s||r.length<=++r._cur)?r._cur=0:i==h&&(!s||--r._cur<0)&&(r._cur=r.length-1),s=r.eq(r._cur).trigger("mouseenter")):(r=null,o&&o.trigger("mouseleave"),i==f&&(!o||a.length<=++a._cur)?a._cur=0:i==h&&(!o||--a._cur<0)&&(a._cur=a.length-1),o=a.eq(a._cur).addClass("ui-state-hover")):!o||i!=c&&i!==m||(o.hasClass("elfinder-contextmenu-group")?s?i==c&&s.click():(o.trigger("mouseenter"),r=o.find("div."+d),r._cur=0,s=r.first().addClass("ui-state-hover")):i==c&&o.click()))},x=function(i,a,c){var d,p=h.outerWidth(),u=h.outerHeight(),m=n.attr("style"),g=n.offset(),v=n.width(),b=n.height(),x=t.UA.Mobile?40:2,C=t.UA.Mobile?20:2,i=i-(g?g.left:0),a=a-(g?g.top:0),c=Object.assign(c||{},{top:Math.max(0,a+C+u1&&h.append('"),a=e(),e.each(m[i]||[],function(m,g){var y,w,x,C,z,T;if("|"===g)return void(s&&(l=!0));if(r[g]?(w=r[g],x=!0):w=g,y=t.getCommand(w),!y||u||t.searchStatus.state&&y.disableOnSearch||(y.__disabled=y._disabled,y._disabled=!(y.alwaysEnabled||!!t._commands[w]&&(e.inArray(g,p)===-1&&(!x||e.inArray(w,p)===-1))),e.each(y.linkedCmds,function(n,i){var a;(a=t.getCommand(i))&&(a.__disabled=a._disabled,a._disabled=!(a.alwaysEnabled||!!t._commands[i]&&e.inArray(i,p)===-1))})),y&&!y._disabled&&y.getstate(o)!=-1){if(y.variants){if(!y.variants.length)return;C=v(y.title,y.className?y.className:y.name,function(){}),z=e('').hide().appendTo(C.append('')),T=function(e){if(e){var i=n.attr("style");n.width(n.width()),z.css({left:"auto",right:"auto"});var a,o,r,s=C.offset(),l=s.left,c=s.top,d=C.outerWidth(),p=z.outerWidth(!0),u=z.outerHeight(!0),m=n.offset(),g=m.left+n.width(),v=m.top+n.height();r=l+d+p-g,a=l>p&&r>0?t.UA.Mobile?10-p:d-r:d,"right"===f&&l0&&c0?30-u:5,h.find(".elfinder-contextmenu-sub:visible").hide(),z.css({top:o}).css(f,a).show(),n.attr("style",i)}else z.hide()},C.addClass("elfinder-contextmenu-group").on("mouseleave",".elfinder-contextmenu-sub",function(e){h.data("draged")||h.removeData("submenuKeep")}).on("click","."+d,function(n){var a,r;n.stopPropagation(),h.data("draged")||(h.hide(),r=e(this),a=r.data("exec"),"undefined"==typeof a&&(a={}),"object"==typeof a&&(a._userAction=!0,a._currentType=i,a._currentNode=r),k(),t.exec(y.name,o,a))}).on("touchend",function(e){h.data("drag")||(T(!0),h.data("submenuKeep",!0))}).on("mouseenter mouseleave",function(e){h.data("touching")||(C.data("timer")&&(clearTimeout(C.data("timer")),C.removeData("timer")),"mouseleave"===e.type?h.data("submenuKeep")||C.data("timer",setTimeout(function(){C.removeData("timer"),T(!1)},250)):C.data("timer",setTimeout(function(){C.removeData("timer"),T(!0)},a.find("div.elfinder-contextmenu-sub:visible").length?250:0)))}),e.each(y.variants,function(t,n){var i,a="|"===n?'':e(''+n[1]+"
").data("exec",n[0]);"undefined"!=typeof n[2]&&(i=e("").addClass("elfinder-button-icon elfinder-contextmenu-icon"),/\//.test(n[2])?i.css(b(n[2])):i.addClass("elfinder-button-icon-"+n[2]),a.prepend(i).addClass(d+"-icon")),z.append(a)})}else C=v(y.title,y.className?y.className:y.name,function(){h.data("draged")||(k(),t.exec(y.name,o,{_userAction:!0,_currentType:i,_currentNode:C}))}),y.extra&&y.extra.node?(e('').append(y.extra.node).appendTo(C),e(y.extra.node).trigger("ready")):C.remove(".elfinder-contextmenu-extra-icon");y.extendsCmd&&C.children("span.elfinder-button-icon").addClass("elfinder-button-icon-"+y.extendsCmd),l&&h.append(''),h.append(C),s=!0,l=!1}y&&"undefined"!=typeof y.__disabled&&(y._disabled=y.__disabled,delete y.__disabled,e.each(y.linkedCmds,function(e,n){var i;(i=t.getCommand(n))&&(i._disabled=i.__disabled,delete i.__disabled)}))}),a=h.children("div."+c)},z=function(t){T="raw",e.each(t,function(e,t){var n;"|"===t?h.append(''):t.label&&"function"==typeof t.callback&&(n=v(t.label,t.icon,function(){h.data("draged")||(!t.remain&&k(),t.callback())},t.options||null),h.append(n))}),a=h.children("div."+c)},T=null,I=null;t.one("load",function(){n=t.getUI(),i=t.getUI("cwd"),t.bind("contextmenu",function(n){var a,o=n.data,r={};o.type&&"files"!==o.type&&i.trigger("unselectall"),k(),o.type&&o.targets?C(o.type,o.targets):o.raw&&z(o.raw),h.children().length&&(a=o.prevNode||null,a&&(h.data("prevNode",h.prev()),a.after(h)),o.fitHeight&&(r={maxHeight:Math.min(t.getUI().height(),e(window).height()),overflowY:"auto"},h.draggable("destroy").removeClass("ui-draggable")),x(o.x,o.y,r),o.opened&&"function"==typeof o.opened&&o.opened.call(h))}).one("destroy",function(){h.remove()}).bind("disable",k).bind("select",function(e){"files"===T&&(!e.data||e.data.selected.toString()!==I.toString())&&k()})}).shortcut({pattern:"mac"===t.OS?"ctrl+m":"contextmenu shift+f10",description:"contextmenu",callback:function(n){n.stopPropagation(),n.preventDefault(),e(document).one("contextmenu."+t.namespace,function(e){e.preventDefault(),e.stopPropagation()});var i,a,o,r,s=t.selected();s.length?(i="files",a=s,r=e("#"+t.cwdHash2Id(s[0]))):(i="cwd",a=[t.cwd().hash],o=t.getUI("workzone").offset()),r&&r.length||(r=t.getUI("workzone")),o=r.offset(),o.top+=r.height()/2,o.left+=r.width()/2,t.trigger("contextmenu",{type:i,targets:a,x:o.left,y:o.top})}})})},e.fn.elfindercwd=function(t,n){return this.not(".elfinder-cwd").each(function(){var i,a,o,r=t.UA.Mobile,s="list"==t.viewType,l="select."+t.namespace,c="unselect."+t.namespace,d="disable."+t.namespace,p="enable."+t.namespace,u="class",h=t.res(u,"cwdfile"),f="."+h+(n.oldSchool?":not(.elfinder-cwd-parent)":""),m="ui-selected",g=t.res(u,"disabled"),v=t.res(u,"draggable"),b=t.res(u,"droppable"),y=t.res(u,"hover"),w=t.res(u,"adroppable"),x=h+"-tmp",k=t.options.loadTmbs>0?t.options.loadTmbs:5,C="",z={},T=[],I=[],A=void 0,S=[],O="",M=function(){for(var e="",t=0;t{'+S[t]+"}";return e},U=function(){return'{marker}{name} '+j+" | "+M()+"
"},j=e.map(n.showSelectCheckboxUA,function(e){return!(!t.UA[e]&&!e.match(/^all$/i))||null}).length?'':"",D=!1,E=null,F={icon:'",row:""},P=t.res("tpl","perms"),R=t.res("tpl","lock"),H=t.res("tpl","symlink"),q={id:function(e){return t.cwdHash2Id(e.hash)},name:function(e){var n=t.escape(e.i18||e.name);return!s&&(n=n.replace(/([_.])/g,"$1")),n},nametitle:function(e){return t.escape(e.i18||e.name)},permsclass:function(e){return t.perms2class(e)},perm:function(e){return t.formatPermissions(e)},dirclass:function(e){var i="directory"==e.mime?"directory":"";return e.isroot&&(i+=" isroot"),e.csscls&&(i+=" "+t.escape(e.csscls)),n.getClass&&(i+=" "+n.getClass(e)),i},style:function(e){return e.icon?t.getIconStyle(e):""},mime:function(e){return t.mime2class(e.mime)},size:function(e){return"directory"!==e.mime||e.size?t.formatSize(e.size):"-"},date:function(e){return t.formatDate(e)},kind:function(e){return t.mime2kind(e)},mode:function(e){return e.perm?t.formatFileMode(e.perm):""},modestr:function(e){return e.perm?t.formatFileMode(e.perm,"string"):""},modeoct:function(e){return e.perm?t.formatFileMode(e.perm,"octal"):""},modeboth:function(e){return e.perm?t.formatFileMode(e.perm,"both"):""},marker:function(e){return(e.alias||"symlink-broken"==e.mime?H:"")+(e.read&&e.write?"":P)+(e.locked?R:"")},tooltip:function(e){var n=t.formatDate(e)+(e.size>0?" ("+t.formatSize(e.size)+")":""),i="";return i=C&&e.path?t.escape(e.path.replace(/\/[^\/]*$/,"")):e.tooltip?t.escape(e.tooltip).replace(/\r/g,"
"):"",s&&(i+=(i?"
":"")+t.escape(e.i18||e.name)),i?i+"
"+n:n}},N={},_=function(n,a){var o,r,s;if(!N[n]&&("undefined"==typeof i&&(e("#elfinderAddBadgeStyle"+t.namespace).length&&e("#elfinderAddBadgeStyle"+t.namespace).remove(),i=e('').insertBefore(e("head").children(":first")).get(0).sheet||null),i)){if(n=n.toLowerCase(),s=n.split("/"),r=t.escape(t.mimeTypes[n]||(a.replace(/.bac?k$/i,"").match(/\.([^.]+)$/)||["",""])[1])){o=".elfinder-cwd-icon-"+s[0].replace(/(\.|\+)/g,"-"),"undefined"!=typeof s[1]&&(o+=".elfinder-cwd-icon-"+s[1].replace(/(\.|\+)/g,"-"));try{i.insertRule(o+':before{content:"'+r.toLowerCase()+'"}',0)}catch(l){}}N[n]=!0}},L=function(e){return e.mime&&"directory"!==e.mime&&!N[e.mime]&&_(e.mime,e.name),F[s?"row":"icon"].replace(/\{([a-z0-9_]+)\}/g,function(n,i){return q[i]?q[i](e,t):e[i]?e[i]:""})},W=e(),$=!1,B=function(t,n){function i(e,t){return e[t+"All"]("[id]:not(."+g+"):not(.elfinder-cwd-parent):first")}var a,o,r,d,p,u=e.ui.keyCode,h=t==u.LEFT||t==u.UP,f=Ae.find("[id]."+m);if(f.length)if(a=f.filter(h?":first":":last"),r=i(a,h?"prev":"next"),r.length)if(s||t==u.LEFT||t==u.RIGHT)o=r;else if(d=a.position().top,p=a.position().left,o=a,h){do o=o.prev("[id]");while(o.length&&!(o.position().topd&&o.position().left>=p));o.hasClass(g)&&(o=i(o,"prev")),o.length||(r=Ae.find("[id]:not(."+g+"):last"),r.position().top>d&&(o=r))}else o=a;else o=W.length?h?W.prev():W:Ae.find("[id]:not(."+g+"):not(.elfinder-cwd-parent):"+(h?"last":"first"));o&&o.length&&!o.hasClass("elfinder-cwd-parent")&&(a&&n?o=a.add(a[h?"prevUntil":"nextUntil"]("#"+o.attr("id"))).add(o):f.trigger(c),o.trigger(l),ee(o.filter(h?":first":":last")),Q())},V={},K=function(n){e("#"+t.cwdHash2Id(n)).trigger(l)},X=!1,G=function(){t.cwd().hash;j&&Me.find("input").prop("checked",!0),t.lazy(function(){var n;Ae.find("[id]:not(."+m+"):not(.elfinder-cwd-parent)").trigger(l),t.maxTargets&&(A||I).length>t.maxTargets?(n=e.map(A||I,function(e){return t.file(e)||null}),n=t.sortFiles(n).slice(0,t.maxTargets),V={},e.each(n,function(e,t){V[t.hash]=!0}),t.toast({mode:"warning",msg:t.i18n(["errMaxTargets",t.maxTargets])})):V=t.arrayFlip(A||I,!0),Q(),j&&Me.data("pending",!1)},0,{repaint:!0})},J=function(){j&&Me.find("input").prop("checked",!1),Object.keys(V).length&&($=!1,V={},Ae.find("[id]."+m).trigger(c),j&&Ae.find("input:checkbox").prop("checked",!1)),Q(),j&&Me.data("pending",!1),Ae.removeClass("elfinder-cwd-allselected")},Y=function(){var n={};X?J():Object.keys(V).length?(e.each(A||I,function(i,a){var o=e("#"+t.cwdHash2Id(a));V[a]?o.length&&o.trigger(c):(n[a]=!0,o.length&&o.trigger(l))}),V=n,Q()):G()},Z=void 0,Q=function(){var e=Object.keys(V),n={selected:e};X=e.length&&e.length===(A||I).length&&(!t.maxTargets||e.length<=t.maxTargets),j&&(Me.find("input").prop("checked",X),Ae[X?"addClass":"removeClass"]("elfinder-cwd-allselected")),X?n.selectall=!0:e.length||(n.unselectall=!0),t.trigger("select",n)},ee=function(e,n){if(e.length){var i=e.position().top,a=e.outerHeight(!0),o=Se.scrollTop(),r=Se.get(0).clientHeight,l=he?he.outerHeight(!0):0;i+l+a>o+r?Se.scrollTop(parseInt(i+l+a-r)):i"),p=function(n){var i,a,p,u,n=n||null,h=[],f=!1,g={},v="self"===t.option("tmbUrl"),u=!ne.renderd;i=te.splice(0,pe+(n||0)/(ne.hpi||1)),ne.renderd+=i.length,te.length||(Oe.hide(),Se.off(oe,ue)),a=[],h=e.map(i,function(e){return e.hash&&e.name?("directory"==e.mime&&(f=!0),(e.tmb||v&&0===e.mime.indexOf("image/"))&&(g[e.hash]=e.tmb),z[e.hash]&&a.push(e.hash),L(e)):null}),d.empty().append(h.join("")),f&&!r&&ve(d),p=[],Object.keys(V).length&&d.find("[id]:not(."+m+"):not(.elfinder-cwd-parent)").each(function(){V[t.cwdId2Hash(this.id)]&&p.push(e(this))}),o.append(c?d:d.children()),p.length&&(e.each(p,function(e,t){t.trigger(l)}),Q()),a.length&&t.trigger("lockfiles",{files:a}),!ne.hpi&&ze(o,i.length),s&&(Ae.find("thead").show(),fe({fitWidth:!E})),Object.keys(g).length&&Object.assign(ne.attachTmbs,g),u&&(r||Ae.data("selectable")||Ae.selectable(se).data("selectable",!0),ce(!0)),!re&&Se.trigger(oe)};ne.renderd||(ne.rendering=!0,Se.scrollTop(0),i=t.cwd().phash,p(),n.oldSchool&&i&&!C&&de(i),s&&(E&&me(),fe({fitWidth:!0})),ne.itemH=(s?o.find("tr:first"):o.find("[id]:first")).outerHeight(!0),t.trigger("cwdrender"),ne.rendering=!1),!ne.rendering&&te.length&&(a=Se.height()+Se.scrollTop()+t.options.showThreshold+ne.row-ne.renderd*ne.hpi)>0&&(ne.rendering=!0,t.lazy(function(){p(a),ne.rendering=!1}))}},he=null,fe=function(i){if(n.listView.fixedHeader){var a,o,r,s,l,c,d,p,u,h,f,m,g,v=function(){var e;e="ltr"===t.direction?Se.scrollLeft()*-1:r.outerWidth(!0)-Se.width()-Se.scrollLeft(),o.css("left")!==e&&o.css("left",e)},i=i||{};if(l=Ae.find("tbody"),p=l.children("tr:first"),p.length){if(r=l.parent(),he?(s=e("#"+t.namespace+"-cwd-thead"),d=s.children("tr:first")):(g=!0,l.addClass("elfinder-cwd-fixheader"),s=Ae.find("thead").attr("id",t.namespace+"-cwd-thead"),d=s.children("tr:first"),c=d.outerHeight(!0),Ae.css("margin-top",c-parseInt(r.css("padding-top"))),o=e("").addClass(Ae.attr("class")).append(e("").append(s)),he=e("").addClass(Se.attr("class")+" elfinder-cwd-fixheader").removeClass("ui-droppable native-droppable").css(Se.position()).css({height:c,width:Ae.outerWidth()}).append(o),"rtl"===t.direction&&he.css("left",Se.data("width")-Se.width()+"px"),v(),Se.after(he).on("scroll.fixheader resize.fixheader",function(e){v(),"resize"===e.type&&(e.stopPropagation(),he.css(Se.position()),Se.data("width",Se.css("overflow","hidden").width()),Se.css("overflow","auto"),fe())})),g||i.fitWidth||Math.abs(p.outerWidth()-d.outerWidth())>2){a=S.length+1;for(var b=0;b").on("load",function(){t.find(".elfinder-cwd-icon").addClass(n.className).css("background-image","url('"+n.url+"')")}).attr("src",n.url)},o=function(n,o){var r,s,l=e("#"+t.cwdHash2Id(n));l.length&&("1"!=o?(r=t.file(n),r.tmb!==o&&(r.tmb=o),s=t.tmb(r),i?l.find(".elfinder-cwd-icon").addClass(s.className).css("background-image","url('"+s.url+"')"):a(l,s),delete ne.attachTmbs[n]):i?ye([n]):ne.tmbLoading[n]||ne.getTmbs.push(n))};e.isPlainObject(n)&&Object.keys(n).length&&(Object.assign(ne.attachTmbs,n),e.each(n,o),i||!ne.getTmbs.length||Object.keys(ne.tmbLoading).length||ye())},ye=function(n){var i=[],a=!1;return t.oldAPI?void t.request({data:{cmd:"tmb",current:t.cwd().hash},preventFail:!0}).done(function(e){e.images&&Object.keys(e.images).length&&be(e.images),e.tmb&&ye()}):(n?(a=!0,i=n.splice(0,k)):i=ne.getTmbs.splice(0,k),void(i.length&&(a||le[i[0]]||le[i[i.length-1]])&&(e.each(i,function(e,t){ne.tmbLoading[t]=!0}),t.request({data:{cmd:"tmb",targets:i},preventFail:!0}).done(function(t){var o,r=[];t.images&&((o=Object.keys(t.images).length)?(o");if(u>pe)Ie(),V=t.arrayFlip(n,!0),Q();else{for(u&&Ee.removeClass("elfinder-cwd-wrapper-empty");u--;)a=n[u],o=a.hash,e("#"+t.cwdHash2Id(o)).length||((l=f(a))&&!l.length&&(l=null),!l&&(d=m(a))>=0?te.splice(d,0,a):(v.empty().append(L(a)),"directory"===a.mime&&!r&&ve(v),c=g?v:v.children(),l?l.before(c):p.append(c)),e("#"+t.cwdHash2Id(o)).length&&a.tmb&&(h[o]=a.tmb));s&&(me(),fe({fitWidth:!E})),ze(p),Object.keys(h).length&&Object.assign(ne.attachTmbs,h)}},xe=function(n){var i,a,o,r,l=n.length,c=t.searchStatus.state>1,d=t.getCommand(t.currentReqCmd)||{};if(!t.cwd().hash&&!d.noChangeDirOnRemovedCwd)return r=t.files(),void e.each(T.reverse(),function(e,n){if(r[n])return t.one(t.currentReqCmd+"done",function(){!t.cwd().hash&&t.exec("open",n)}),!1});for(;l--;){if(i=n[l],(a=e("#"+t.cwdHash2Id(i))).length)try{a.remove(),--ne.renderd}catch(p){t.debug("error",p)}else(o=ie(i))!==-1&&te.splice(o,1);V[i]&&delete V[i],c&&(o=e.inArray(i,I))!==-1&&I.splice(o,1)}c&&t.trigger("cwdhasheschange",I),s&&(me(),fe({fitWidth:!E}))},ke={name:t.i18n("name"),perm:t.i18n("perms"),date:t.i18n("modify"),size:t.i18n("size"),kind:t.i18n("kind"),modestr:t.i18n("mode"),modeoct:t.i18n("mode"),modeboth:t.i18n("mode")},Ce=function(){for(var e="",i="",a=Object.assign({},ke,n.listView.columnsCustomName),o=0;o'+e+"";return i},ze=function(e,t){var n,i=1;e=e||(s?Ae.find("tbody"):Ae),te.length>0&&(e.css({height:"auto"}),n=e.height(),t&&(s||(i=Math.floor(e.width()/e.find("[id]:first").width()),t=Math.ceil(t/i)*i),ne.hpi=n/t,ne.row=ne.hpi*i),Oe.css({top:ne.hpi*te.length+n+"px"}).show())},Te={contextmenu:function(e){e.preventDefault(),t.trigger("contextmenu",{type:"cwd",targets:[t.cwd().hash],x:e.pageX,y:e.pageY})},touchstart:function(e){e.originalEvent.touches.length>1||(Ae.data("longtap",null),Se.data("touching",{x:e.originalEvent.touches[0].pageX,y:e.originalEvent.touches[0].pageY}),e.target!==this&&e.target!==Ae.get(0)||Ae.data("tmlongtap",setTimeout(function(){Ae.data("longtap",!0),t.trigger("contextmenu",{type:"cwd",targets:[t.cwd().hash],x:Se.data("touching").x,y:Se.data("touching").y})},500)))},touchend:function(e){"touchmove"===e.type&&(!Se.data("touching")||Math.abs(Se.data("touching").x-e.originalEvent.touches[0].pageX)+Math.abs(Se.data("touching").y-e.originalEvent.touches[0].pageY)>4)&&Se.data("touching",null),clearTimeout(Ae.data("tmlongtap"))},click:function(e){Ae.data("longtap")&&(e.preventDefault(),e.stopPropagation())}},Ie=function(){var n;Ee.append(Me).removeClass("elfinder-cwd-wrapper-empty elfinder-search-result elfinder-incsearch-result elfinder-letsearch-result"),(t.searchStatus.state>1||t.searchStatus.ininc)&&Ee.addClass("elfinder-search-result"+(t.searchStatus.ininc?" elfinder-"+("/"===C.substr(0,1)?"let":"inc")+"search-result":"")),ne.attachThumbJob&&ne.attachThumbJob._abort(),Ae.data("selectable")&&Ae.selectable("disable").selectable("destroy").removeData("selectable"),t.trigger("cwdinit"),W=e();try{Ae.empty()}catch(i){Ae.html("")}he&&(Se.off("scroll.fixheader resize.fixheader"),he.remove(),he=null),Ae.removeClass("elfinder-cwd-view-icons elfinder-cwd-view-list").addClass("elfinder-cwd-view-"+(s?"list":"icons")).attr("style","").css("height","auto"),Oe.hide(),Se[s?"addClass":"removeClass"]("elfinder-cwd-wrapper-list")._padding=parseInt(Se.css("padding-top"))+parseInt(Se.css("padding-bottom")),t.UA.iOS&&Se.removeClass("overflow-scrolling-touch").addClass("overflow-scrolling-touch"),s&&(Ae.html(""),n=e(''+ke.name+" | "+Ce()+"
"),Ae.find("thead").hide().append(n.on("contextmenu."+t.namespace,Te.contextmenu).on("touchstart."+t.namespace,"td",Te.touchstart).on("touchmove."+t.namespace+" touchend."+t.namespace+" mouseup."+t.namespace,"td",Te.touchend).on("click."+t.namespace,"td",Te.click)).find("td:first").append(Me),e.fn.sortable&&n.addClass("touch-punch touch-punch-keep-default").sortable({axis:"x",distance:8,items:"> .sortable-item",start:function(t,n){e(n.item[0]).data("dragging",!0),n.placeholder.width(n.helper.removeClass("ui-state-hover").width()).removeClass("ui-state-active").addClass("ui-state-hover").css("visibility","visible")},update:function(n,i){var a,o,r=e(i.item[0]).attr("class").split(" ")[0].replace("elfinder-cwd-view-th-","");S=e.map(e(this).children(),function(t){var n=e(t).attr("class").split(" ")[0].replace("elfinder-cwd-view-th-","");return o||(r===n?o=!0:a=n),"name"===n?null:n}),F.row=U(),t.storage("cwdCols",S),a=".elfinder-col-"+a+":first",r=".elfinder-col-"+r+":first",t.lazy(function(){Ae.find("tbody tr").each(function(){var t=e(this);t.children(a).after(t.children(r))})})},stop:function(t,n){setTimeout(function(){e(n.item[0]).removeData("dragging")},100)}}),n.find("td").addClass("touch-punch").resizable({handles:"ltr"===t.direction?"e":"w",start:function(t,n){var i=Ae.find("td.elfinder-col-"+n.element.attr("class").split(" ")[0].replace("elfinder-cwd-view-th-","")+":first");n.element.data("resizeTarget",i).data("targetWidth",i.width()),D=!0,"fixed"!==Ae.find("table").css("table-layout")&&(Ae.find("tbody tr:first td").each(function(){e(this).width(e(this).width())}),Ae.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(){D=!1,fe({fitWidth:!0}),E={},Ae.find("tbody tr:first td").each(function(){var t=e(this).attr("class").split(" ")[0].replace("elfinder-col-","");E[t]=e(this).width()}),t.storage("cwdColWidth",E)}}).find(".ui-resizable-handle").addClass("ui-icon ui-icon-grip-dotted-vertical")),t.lazy(function(){te=e.map(A||I,function(e){return t.file(e)||null}),te=t.sortFiles(te),ne={renderd:0,attachTmbs:{},getTmbs:[],tmbLoading:{},lazyOpts:{tm:0}},Ee[te.length<1?"addClass":"removeClass"]("elfinder-cwd-wrapper-empty"),Se.off(oe,ue).on(oe,ue).trigger(oe),t.cwd().write?(Se[t.isCommandEnabled("upload")?"addClass":"removeClass"]("native-droppable"),Se.droppable(t.isCommandEnabled("paste")?"enable":"disable")):Se.removeClass("native-droppable").droppable("disable").removeClass("ui-state-disabled")})},Ae=e(this).addClass("ui-helper-clearfix elfinder-cwd").attr("unselectable","on").on("click."+t.namespace,f,function(n){var i,a,o,r,s,d=this.id?e(this):e(this).parents("[id]:first"),p=e(n.target);if(j&&(p.is("input:checkbox")||p.hasClass("elfinder-cwd-select")))return n.stopPropagation(),n.preventDefault(),Se.data("touching")||(d.trigger(d.hasClass(m)?c:l),Q()),setTimeout(function(){p.prop("checked",d.hasClass(m))},10),!1;if(Ae.data("longtap"))return void n.stopPropagation();if(O||(O=d.attr("id"),setTimeout(function(){O=""},500)),n.shiftKey&&(i=d.prevAll(Z||"."+m+":first"),a=d.nextAll(Z||"."+m+":first"),o=i.length,r=a.length),n.shiftKey&&(o||r))s=o?d.prevUntil("#"+i.attr("id")):d.nextUntil("#"+a.attr("id")),s.add(d).trigger(l);else if(n.ctrlKey||n.metaKey)d.trigger(d.hasClass(m)?c:l);else{if(Se.data("touching")&&d.hasClass(m))return Se.data("touching",null),void t.dblclick({file:t.cwdId2Hash(this.id)});J(),d.trigger(l)}Q()}).on("dblclick."+t.namespace,f,function(n){if(O){var i=t.cwdId2Hash(O);n.stopPropagation(),this.id!==O&&(e(this).trigger(c),e("#"+O).trigger(l),Q()),t.dblclick({file:i})}}).on("touchstart."+t.namespace,f,function(n){if(!(n.originalEvent.touches.length>1)){var i,a=this.id?e(this):e(this).parents("[id]:first"),o=e(n.target);return Se.data("touching",{x:n.originalEvent.touches[0].pageX,y:n.originalEvent.touches[0].pageY}),j&&(o.is("input:checkbox")||o.hasClass("elfinder-cwd-select"))?void setTimeout(function(){Se.data("touching")&&(a.trigger(a.hasClass(m)?c:l),Q())},150):void("INPUT"!=n.target.nodeName&&"TEXTAREA"!=n.target.nodeName&&(i=a.prevAll("."+m+":first").length+a.nextAll("."+m+":first").length,Ae.data("longtap",null),a.addClass(y).data("tmlongtap",setTimeout(function(){Ae.data("longtap",!0),("TD"!=n.target.nodeName||t.selected().length>0)&&(a.trigger(l),Q(),t.trigger("contextmenu",{type:"files",targets:t.selected(),x:n.originalEvent.touches[0].pageX,y:n.originalEvent.touches[0].pageY}))},500))))}}).on("touchmove."+t.namespace+" touchend."+t.namespace,f,function(n){if("INPUT"!=n.target.nodeName&&"TEXTAREA"!=n.target.nodeName&&!e(n.target).hasClass("elfinder-cwd-select")){var i=this.id?e(this):e(this).parents("[id]:first");clearTimeout(i.data("tmlongtap")),"touchmove"===n.type?(Se.data("touching",null),i.removeClass(y)):Se.data("touching")&&!Ae.data("longtap")&&i.hasClass(m)&&(n.preventDefault(),Se.data("touching",null),t.dblclick({file:t.cwdId2Hash(this.id)}))}}).on("mouseenter."+t.namespace,f,function(n){if(!re){var i=e(this),a=null,o=s?i:i.children("div.elfinder-cwd-file-wrapper,div.elfinder-cwd-filename");if(!(r||i.data("dragRegisted")||i.hasClass(x)||o.hasClass(v)||o.hasClass(g))){if(i.data("dragRegisted",!0),!t.isCommandEnabled("copy",t.searchStatus.state>1?t.cwdId2Hash(i.attr("id")):void 0))return;o.on("mousedown",function(n){var i=n.shiftKey||n.altKey;i&&!t.UA.IE&&Ae.data("selectable")&&(Ae.selectable("disable").selectable("destroy").removeData("selectable"),setTimeout(function(){Ae.selectable(se).selectable("option",{disabled:!1}).selectable("refresh").data("selectable",!0)},10)),o.draggable("option","disabled",i).removeClass("ui-state-disabled"),i?o.attr("draggable","true"):o.removeAttr("draggable").draggable("option","cursorAt",{left:50-parseInt(e(n.currentTarget).css("margin-left")),top:47})}).on("dragstart",function(n){var i=n.dataTransfer||n.originalEvent.dataTransfer||null;if(a=null,i&&!t.UA.IE){var o,r=this.id?e(this):e(this).parents("[id]:first"),s=e(""),c="",d=null,p=null,u=[],h=function(n){var i,a=n.mime,o=t.tmb(n);return i='',o&&(i=e(i).addClass(o.className).css("background-image","url('"+o.url+"')").get(0).outerHTML),i},f=[];if(r.trigger(l),Q(),e.each(V,function(n){var i=t.file(n),a=i.url;if(i&&"directory"!==i.mime){if(a){if("1"==a)return f.push(n),!0}else a=t.url(i.hash);a&&(a=t.convAbsUrl(a),u.push(n),e("").attr("href",a).text(a).appendTo(s),c+=a+"\n",d||(d=i.mime+":"+i.name+":"+a),p||(p=a+"\n"+i.name))}}),f.length)return e.each(f,function(e,n){var i=t.file(n);i.url="",t.request({data:{cmd:"url",target:n},notify:{type:"url",cnt:1},preventDefault:!0}).always(function(e){i.url=e.url?e.url:"1"})}),!1;if(!c)return!1;i.setDragImage&&(a=e('').append(h(t.file(u[0]))).appendTo(e(document.body)),(o=u.length)>1&&a.append(h(t.file(u[o-1]))+''+o+""),i.setDragImage(a.get(0),50,47)),i.effectAllowed="copyLink",i.setData("DownloadURL",d),i.setData("text/x-moz-url",p),i.setData("text/uri-list",c),i.setData("text/plain",c),i.setData("text/html",s.html()),i.setData("elfinderfrom",window.location.href+t.cwd().hash),i.setData("elfinderfrom:"+i.getData("elfinderfrom"),"")}}).on("dragend",function(e){J(),a&&a.remove()}).draggable(t.draggable)}}}).on(l,f,function(n){var i=e(this),a=t.cwdId2Hash(i.attr("id"));$||i.hasClass(g)||(Z="#"+this.id,i.addClass(m).children().addClass(y).find("input:checkbox").prop("checked",!0),V[a]||(V[a]=!0),W=Ae.find("[id]."+m+":last").next())}).on(c,f,function(n){var i=e(this),a=t.cwdId2Hash(i.attr("id"));$||(i.removeClass(m).children().removeClass(y).find("input:checkbox").prop("checked",!1),Ae.hasClass("elfinder-cwd-allselected")&&(j&&Me.children("input").prop("checked",!1),Ae.removeClass("elfinder-cwd-allselected")),V[a]&&delete V[a])}).on(d,f,function(){var t=e(this).removeClass(y+" "+m).addClass(g),n=t.children(),i=s?t:n.find("div.elfinder-cwd-file-wrapper,div.elfinder-cwd-filename");n.removeClass(y+" "+m),t.hasClass(b)&&t.droppable("disable"),i.hasClass(v)&&i.draggable("disable")}).on(p,f,function(){var t=e(this).removeClass(g),n=s?t:t.children("div.elfinder-cwd-file-wrapper,div.elfinder-cwd-filename");t.hasClass(b)&&t.droppable("enable"),n.hasClass(v)&&n.draggable("enable")}).on("scrolltoview",f,function(t,n){ee(e(this),!n||"undefined"==typeof n.blink||n.blink)}).on("mouseenter."+t.namespace+" mouseleave."+t.namespace,f,function(n){var i="mouseenter"===n.type;i&&re||(t.trigger("hover",{hash:t.cwdId2Hash(e(this).attr("id")),type:n.type}),e(this).toggleClass(y,"mouseenter"==n.type))}).on("contextmenu."+t.namespace,function(n){var i=e(n.target).closest("."+h);i.length&&("TD"!=n.target.nodeName||e.inArray(t.cwdId2Hash(i.get(0).id),t.selected())>-1)&&(n.stopPropagation(),n.preventDefault(),i.hasClass(g)||Se.data("touching")||(i.hasClass(m)||(J(),i.trigger(l),Q()),t.trigger("contextmenu",{type:"files",targets:t.selected(),x:n.pageX,y:n.pageY})))}).on("click."+t.namespace,function(e){e.target!==this||Ae.data("longtap")||!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&J()}).on("create."+t.namespace,function(n,i){var a=s?Ae.find("tbody"):Ae,o=a.find(".elfinder-cwd-parent"),r=i.move||!1,i=e(L(i)).addClass(x),l=t.selected();l.length?r&&t.trigger("lockfiles",{files:l}):J(),o.length?o.after(i):a.prepend(i),me(),Se.scrollTop(0).scrollLeft(0)}).on("unselectall",J).on("selectfile",function(n,i){e("#"+t.cwdHash2Id(i)).trigger(l),Q()}).on("colwidth",function(){s&&(Ae.find("table").css("table-layout","").find("td").css("width",""),fe({fitWidth:!0}),t.storage("cwdColWidth",E=null))}),Se=e('').droppable(Object.assign({},ge,{autoDisable:!1})).on("contextmenu."+t.namespace,Te.contextmenu).on("touchstart."+t.namespace,Te.touchstart).on("touchmove."+t.namespace+" touchend."+t.namespace,Te.touchend).on("click."+t.namespace,Te.click).on("scroll."+t.namespace,function(){re||(Ae.data("selectable")&&Ae.selectable("disable"),Se.trigger(ae)),re=!0,ne.scrtm&&clearTimeout(ne.scrtm),ne.scrtm&&Math.abs((ne.scrolltop||0)-(ne.scrolltop=this.scrollTop||e(this).scrollTop()))<5&&(ne.scrtm=0,Se.trigger(oe)),ne.scrtm=setTimeout(function(){ne.scrtm=0,Se.trigger(oe)},20)}).on(oe,function(){re=!1,ce()}),Oe=e("
").css({position:"absolute",width:"1px",height:"1px"}).hide(),Me=j?e('').attr("title",t.i18n("selectall")).on("touchstart mousedown click",function(t){return t.stopPropagation(),t.preventDefault(),!e(this).data("pending")&&"click"!==t.type&&(Me.data("pending",!0),void(Ae.hasClass("elfinder-cwd-allselected")?(Me.find("input").prop("checked",!1),setTimeout(function(){J()},10)):G()))}):e(),Ue=null,je=function(t){var n=function(){var t=0;Se.siblings("div.elfinder-panel:visible").each(function(){t+=e(this).outerHeight(!0)}),Se.height(Ee.height()-t-Se._padding)};t&&n(),Ue&&clearTimeout(Ue),Ue=setTimeout(function(){!t&&n();var e,i;Ae.css("height","auto"),e=Se[0].clientHeight-parseInt(Se.css("padding-top"))-parseInt(Se.css("padding-bottom"))-parseInt(Ae.css("margin-top")),i=Ae.outerHeight(!0),iS.length&&e.each(n.listView.columns,function(e,t){S.indexOf(t)===-1&&S.push(t)})):S=n.listView.columns,F.row=U(),r&&e("body").on("touchstart touchmove touchend",function(e){}),j&&Ae.addClass("elfinder-has-checkbox"),e(window).on("scroll."+t.namespace,function(){o&&clearTimeout(o),o=setTimeout(function(){Se.trigger(oe)},50)}),e(document).on("keydown."+t.namespace,function(n){n.keyCode==e.ui.keyCode.ESCAPE&&(t.getUI().find(".ui-widget:visible").length||J())}),t.one("init",function(){var n,i,o,s=document.createElement("style"),l=0;document.head&&(document.head.appendChild(s),n=s.sheet,n.insertRule('.elfinder-cwd-wrapper-empty .elfinder-cwd:after{ content:"'+t.i18n("emptyFolder")+'" }',l++),n.insertRule('.elfinder-cwd-wrapper-empty .ui-droppable .elfinder-cwd:after{ content:"'+t.i18n("emptyFolder"+(r?"LTap":"Drop"))+'" }',l++),n.insertRule('.elfinder-cwd-wrapper-empty .ui-droppable-disabled .elfinder-cwd:after{ content:"'+t.i18n("emptyFolder")+'" }',l++),n.insertRule('.elfinder-cwd-wrapper-empty.elfinder-search-result .elfinder-cwd:after{ content:"'+t.i18n("emptySearch")+'" }',l++),n.insertRule('.elfinder-cwd-wrapper-empty.elfinder-search-result.elfinder-incsearch-result .elfinder-cwd:after{ content:"'+t.i18n("emptyIncSearch")+'" }',l++),n.insertRule('.elfinder-cwd-wrapper-empty.elfinder-search-result.elfinder-letsearch-result .elfinder-cwd:after{ content:"'+t.i18n("emptyLetSearch")+'" }',l++)),r||(t.one("open",function(){n&&t.zIndex&&n.insertRule(".ui-selectable-helper{z-index:"+t.zIndex+";}",l++)}),o=e(''),i=t.getUI(),i.on("resize",function(e,t){var n;e.preventDefault(),e.stopPropagation(),t&&t.fullscreen&&(n=i.offset(),"on"===t.fullscreen?(o.css({top:n.top*-1,left:n.left*-1}).appendTo(i),se.appendTo=o):(o.detach(),se.appendTo="body"),Ae.data("selectable")&&Ae.selectable("option",{appendTo:se.appendTo}))})),a=t.getUI("tree").length}).bind("enable",function(){je()}).bind("request.open",function(){ne.getTmbs=[]}).bind("open add remove searchend",function(){var n=t.cwd().hash,i=this.type;if(("open"===i||"searchend"===i||t.searchStatus.state<2)&&(I=e.map(t.files(n),function(e){return e.hash}),t.trigger("cwdhasheschange",I)),"open"===i){var o=function(){var n=!1;return e.each(T,function(e,i){if(t.trashes[i])return n=!0,!1}),n},n=t.cwd().phash,r=n?t.file(n)?null:a?function(){var n=e.Deferred();return t.one("parents",function(){n.resolve()}),n}():t.request({data:{cmd:"parents",target:t.cwd().hash},preventFail:!0}):null;e.when(r).done(function(){T=t.parents(t.cwd().hash),Se[o()?"addClass":"removeClass"]("elfinder-cwd-wrapper-trash")}),A=void 0,J(),Ie(),je()}}).bind("search",function(n){I=e.map(n.data.files,function(e){return e.hash}),t.trigger("cwdhasheschange",I),A=void 0,t.searchStatus.ininc=!1,Ie(),t.autoSync("stop"),je()}).bind("searchend",function(e){(C||A)&&(C="",A?t.trigger("incsearchend",e.data):e.data&&e.data.noupdate||Ie()),t.autoSync(),je()}).bind("searchstart",function(e){J(),C=e.data.query}).bind("incsearchstart",function(n){V={},t.lazy(function(){var i,a,o="";a=C=n.data.query||"",a?("/"===a.substr(0,1)&&(a=a.substr(1),o="^"),i=new RegExp(o+a.replace(/([\\*\;\.\?\[\]\{\}\(\)\^\$\-\|])/g,"\\$1"),"i"),A=e.map(I,function(e){var n=t.file(e);return n&&(n.name.match(i)||n.i18&&n.i18.match(i))?n.hash:null}),t.trigger("incsearch",{hashes:A,query:a}).searchStatus.ininc=!0,Ie(),t.autoSync("stop")):t.trigger("incsearchend"),je()})}).bind("incsearchend",function(e){C="",t.searchStatus.ininc=!1,A=void 0,e.data&&e.data.noupdate||Ie(),t.autoSync()}).bind("sortchange",function(){var e=Se.scrollLeft();Ie(),t.one("cwdrender",function(){Se.scrollLeft(e),Object.keys(V).length&&Q(),je()})}).bind("viewchange",function(){var e="list"==t.storage("view"),n=Ae.hasClass("elfinder-cwd-allselected");e!=s&&(s=e,t.viewType=s?"list":"icons",Ie(),n&&(Ae.addClass("elfinder-cwd-allselected"),Me.find("input").prop("checked",!0)),Object.keys(V).length&&Q()),je()}).bind("wzresize",function(){var e,n=s?Ae.find("tbody"):Ae;je(!0),ne.hpi&&ze(n,n.find("[id]").length),e=Ae.offset(),Ee.data("rectangle",Object.assign({width:Ee.width(),height:Ee.height(),cwdEdge:"ltr"===t.direction?e.left:e.left+Ae.width()},Ee.offset())),ne.itemH=(s?n.find("tr:first"):n.find("[id]:first")).outerHeight(!0)}).bind("changeclipboard",function(t){z={},t.data&&t.data.clipboard&&t.data.clipboard.length&&e.each(t.data.clipboard,function(e,t){t.cut&&(z[t.hash]=!0)})}).bind("resMixinMake",function(){me()}).bind("tmbreload",function(t){var n={},i=t.data&&t.data.files?t.data.files:null;e.each(i,function(e,t){t.tmb&&"1"!=t.tmb&&(n[t.hash]=t.tmb)}),Object.keys(n).length&&be(n,!0)}).add(function(n){var i=C?new RegExp(C.replace(/([\\*\;\.\?\[\]\{\}\(\)\^\$\-\|])/g,"\\$1"),"i"):null,a=t.searchStatus.mime,o=t.searchStatus.state>1,r=o&&t.searchStatus.target?t.searchStatus.target:t.cwd().hash,l=t.path(r),c=function(n){var s,c;return s=n.phash===r,!s&&o&&(c=n.path||t.path(n.hash),s=l&&0===c.indexOf(l),!s&&t.searchStatus.mixed&&(s=!!e.map(t.searchStatus.mixed,function(e){return 0===n.hash.indexOf(e)||null}).length)),s&&o&&(s=a?0===n.mime.indexOf(a):!!(n.name.match(i)||n.i18&&n.i18.match(i))),s},d=e.map(n.data.added||[],function(e){return c(e)?e:null});we(d),2===t.searchStatus.state&&(e.each(d,function(t,n){e.inArray(n.hash,I)===-1&&I.push(n.hash)}),t.trigger("cwdhasheschange",I)),s&&je(),Se.trigger(oe)}).change(function(n){var i,a=t.cwd().hash,o=t.selected();C?e.each(n.data.changed||[],function(t,n){xe([n.hash]),n.name.indexOf(C)!==-1&&(we([n],"change"),e.inArray(n.hash,o)!==-1&&K(n.hash),i=!0)}):e.each(e.map(n.data.changed||[],function(e){return e.phash==a?e:null}),function(t,n){xe([n.hash]),we([n],"change"),e.inArray(n.hash,o)!==-1&&K(n.hash),i=!0}),i&&(t.trigger("cwdhasheschange",I),s&&je(),Se.trigger(oe)),Q()}).remove(function(e){var t=s?Ae.find("tbody"):Ae;xe(e.data.removed||[]),Q(),te.length<1&&t.children(f).length<1?(Ee.addClass("elfinder-cwd-wrapper-empty"),j&&Me.find("input").prop("checked",!1),Oe.hide(),Se.off(oe,ue),je()):(ze(t),Se.trigger(oe))}).dragstart(function(t){var n=e(t.data.target),i=t.data.originalEvent;n.hasClass(h)&&(n.hasClass(m)||(!(i.ctrlKey||i.metaKey||i.shiftKey)&&J(),n.trigger(l),Q())),Ae.removeClass(g).data("selectable")&&Ae.selectable("disable"),$=!0}).dragstop(function(){Ae.data("selectable")&&Ae.selectable("enable"),$=!1}).bind("lockfiles unlockfiles selectfiles unselectfiles",function(n){var i,a,o,r={lockfiles:d,unlockfiles:p,selectfiles:l,unselectfiles:c},s=r[n.type],u=n.data.files||[],h=u.length,f=n.data.helper||e();if(h>0&&(i=t.parents(u[0])),s!==l&&s!==c||(o=s===l,e.each(u,function(e,t){var n=Ae.hasClass("elfinder-cwd-allselected");V[t]?(n&&(j&&Me.children("input").prop("checked",!1),Ae.removeClass("elfinder-cwd-allselected"),n=!1),!o&&delete V[t]):o&&(V[t]=!0)})),!f.data("locked")){for(;h--;)try{e("#"+t.cwdHash2Id(u[h])).trigger(s)}catch(n){}!n.data.inselect&&Q()}Se.data("dropover")&&i.indexOf(Se.data("dropover"))!==-1&&(a="lockfiles"!==n.type,f.toggleClass("elfinder-drag-helper-plus",a),Se.toggleClass(w,a))}).bind("mkdir mkfile duplicate upload rename archive extract paste multiupload",function(n){if("upload"!=n.type||!n.data._multiupload){var i=t.cwd().hash;J(),e.each((n.data.added||[]).concat(n.data.changed||[]),function(e,t){t&&t.phash==i&&K(t.hash)}),Q()}}).shortcut({pattern:"ctrl+a",description:"selectall",callback:G}).shortcut({pattern:"ctrl+shift+i",description:"selectinvert",callback:Y}).shortcut({pattern:"left right up down shift+left shift+right shift+up shift+down",description:"selectfiles",type:"keydown",callback:function(e){B(e.keyCode,e.shiftKey)}}).shortcut({pattern:"home",description:"selectffile",callback:function(e){J(),ee(Ae.find("[id]:first").trigger(l)),Q()}}).shortcut({pattern:"end",description:"selectlfile",callback:function(e){J(),ee(Ae.find("[id]:last").trigger(l)),Q()}}).shortcut({pattern:"page_up",description:"pageTurning",callback:function(e){ne.itemH&&Se.scrollTop(Math.round(Se.scrollTop()-Math.floor((Se.height()+(s?ne.itemH*-1:16))/ne.itemH)*ne.itemH))}}).shortcut({pattern:"page_down",description:"pageTurning",callback:function(e){ne.itemH&&Se.scrollTop(Math.round(Se.scrollTop()+Math.floor((Se.height()+(s?ne.itemH*-1:16))/ne.itemH)*ne.itemH))}})}),this},e.fn.elfinderdialog=function(t,n){var i,a,o,r=window.navigator.platform.indexOf("Win")!=-1,s={},l={enabled:!1,width:!1,height:!1,defaultSize:null},c=function(t){var i,a;l.enabled&&(a=n.options.dialogContained?o:e(window),i={maxWidth:l.width?a.width()-s.width:null,maxHeight:l.height?a.height()-s.height:null},t.css(i).trigger("resize"),t.data("hasResizable")&&(t.resizable("option","maxWidth")