@syncfusion/ej2-filemanager 29.2.4 → 30.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +2 -0
- package/dist/ej2-filemanager.min.js +2 -2
- package/dist/ej2-filemanager.umd.min.js +2 -2
- package/dist/ej2-filemanager.umd.min.js.map +1 -1
- package/dist/es6/ej2-filemanager.es2015.js +181 -20
- package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
- package/dist/es6/ej2-filemanager.es5.js +182 -20
- package/dist/es6/ej2-filemanager.es5.js.map +1 -1
- package/dist/global/ej2-filemanager.min.js +2 -2
- package/dist/global/ej2-filemanager.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/dist/ts/file-manager/actions/breadcrumb-bar.d.ts +60 -0
- package/dist/ts/file-manager/actions/breadcrumb-bar.ts +423 -0
- package/dist/ts/file-manager/actions/index.d.ts +6 -0
- package/dist/ts/file-manager/actions/index.ts +6 -0
- package/dist/ts/file-manager/actions/toolbar.d.ts +54 -0
- package/dist/ts/file-manager/actions/toolbar.ts +609 -0
- package/dist/ts/file-manager/actions/virtualization.d.ts +93 -0
- package/dist/ts/file-manager/actions/virtualization.ts +324 -0
- package/dist/ts/file-manager/base/classes.d.ts +224 -0
- package/dist/ts/file-manager/base/classes.ts +225 -0
- package/dist/ts/file-manager/base/constant.d.ts +136 -0
- package/dist/ts/file-manager/base/constant.ts +137 -0
- package/dist/ts/file-manager/base/file-manager-model.d.ts +520 -0
- package/dist/ts/file-manager/base/file-manager.d.ts +867 -0
- package/dist/ts/file-manager/base/file-manager.ts +2061 -0
- package/dist/ts/file-manager/base/index.d.ts +8 -0
- package/dist/ts/file-manager/base/index.ts +8 -0
- package/dist/ts/file-manager/base/interface.d.ts +952 -0
- package/dist/ts/file-manager/base/interface.ts +931 -0
- package/dist/ts/file-manager/common/index.d.ts +5 -0
- package/dist/ts/file-manager/common/index.ts +5 -0
- package/dist/ts/file-manager/common/operations.d.ts +122 -0
- package/dist/ts/file-manager/common/operations.ts +1369 -0
- package/dist/ts/file-manager/common/utility.d.ts +644 -0
- package/dist/ts/file-manager/common/utility.ts +1728 -0
- package/dist/ts/file-manager/index.d.ts +9 -0
- package/dist/ts/file-manager/index.ts +9 -0
- package/dist/ts/file-manager/layout/details-view.d.ts +152 -0
- package/dist/ts/file-manager/layout/details-view.ts +1990 -0
- package/dist/ts/file-manager/layout/index.d.ts +6 -0
- package/dist/ts/file-manager/layout/index.ts +6 -0
- package/dist/ts/file-manager/layout/large-icons-view.d.ts +157 -0
- package/dist/ts/file-manager/layout/large-icons-view.ts +1684 -0
- package/dist/ts/file-manager/layout/navigation-pane.d.ts +104 -0
- package/dist/ts/file-manager/layout/navigation-pane.ts +919 -0
- package/dist/ts/file-manager/models/ajax-settings-model.d.ts +36 -0
- package/dist/ts/file-manager/models/ajax-settings.d.ts +30 -0
- package/dist/ts/file-manager/models/ajax-settings.ts +39 -0
- package/dist/ts/file-manager/models/column-model.d.ts +155 -0
- package/dist/ts/file-manager/models/column.d.ts +179 -0
- package/dist/ts/file-manager/models/column.ts +216 -0
- package/dist/ts/file-manager/models/contextMenu-settings-model.d.ts +36 -0
- package/dist/ts/file-manager/models/contextMenu-settings.d.ts +33 -0
- package/dist/ts/file-manager/models/contextMenu-settings.ts +44 -0
- package/dist/ts/file-manager/models/default-locale.d.ts +4 -0
- package/dist/ts/file-manager/models/default-locale.ts +101 -0
- package/dist/ts/file-manager/models/details-view-settings-model.d.ts +30 -0
- package/dist/ts/file-manager/models/details-view-settings.d.ts +31 -0
- package/dist/ts/file-manager/models/details-view-settings.ts +54 -0
- package/dist/ts/file-manager/models/index.d.ts +19 -0
- package/dist/ts/file-manager/models/index.ts +19 -0
- package/dist/ts/file-manager/models/navigation-pane-settings-model.d.ts +40 -0
- package/dist/ts/file-manager/models/navigation-pane-settings.d.ts +34 -0
- package/dist/ts/file-manager/models/navigation-pane-settings.ts +42 -0
- package/dist/ts/file-manager/models/search-settings-model.d.ts +42 -0
- package/dist/ts/file-manager/models/search-settings.d.ts +44 -0
- package/dist/ts/file-manager/models/search-settings.ts +53 -0
- package/dist/ts/file-manager/models/toolbar-settings-model.d.ts +197 -0
- package/dist/ts/file-manager/models/toolbar-settings.d.ts +174 -0
- package/dist/ts/file-manager/models/toolbar-settings.ts +198 -0
- package/dist/ts/file-manager/models/upload-settings-model.d.ts +70 -0
- package/dist/ts/file-manager/models/upload-settings.d.ts +61 -0
- package/dist/ts/file-manager/models/upload-settings.ts +75 -0
- package/dist/ts/file-manager/pop-up/context-menu.d.ts +64 -0
- package/dist/ts/file-manager/pop-up/context-menu.ts +693 -0
- package/dist/ts/file-manager/pop-up/dialog.d.ts +31 -0
- package/dist/ts/file-manager/pop-up/dialog.ts +1009 -0
- package/dist/ts/file-manager/pop-up/index.d.ts +5 -0
- package/dist/ts/file-manager/pop-up/index.ts +5 -0
- package/dist/ts/index.d.ts +4 -0
- package/dist/ts/index.ts +4 -0
- package/package.json +16 -17
- package/src/file-manager/base/interface.d.ts +10 -0
- package/src/file-manager/common/operations.d.ts +18 -1
- package/src/file-manager/common/operations.js +59 -0
- package/src/file-manager/common/utility.d.ts +3 -3
- package/src/file-manager/common/utility.js +20 -6
- package/src/file-manager/layout/details-view.js +4 -3
- package/src/file-manager/layout/large-icons-view.d.ts +3 -0
- package/src/file-manager/layout/large-icons-view.js +67 -9
- package/src/file-manager/layout/navigation-pane.js +2 -0
- package/src/file-manager/pop-up/dialog.d.ts +3 -3
- package/src/file-manager/pop-up/dialog.js +34 -6
- package/styles/bds-lite.css +51 -1
- package/styles/bds.css +51 -1
- package/styles/bootstrap-dark-lite.css +51 -0
- package/styles/bootstrap-dark.css +51 -0
- package/styles/bootstrap-lite.css +51 -0
- package/styles/bootstrap.css +51 -0
- package/styles/bootstrap4-lite.css +51 -0
- package/styles/bootstrap4.css +51 -0
- package/styles/bootstrap5-dark-lite.css +51 -1
- package/styles/bootstrap5-dark.css +51 -1
- package/styles/bootstrap5-lite.css +51 -1
- package/styles/bootstrap5.3-lite.css +51 -0
- package/styles/bootstrap5.3.css +51 -0
- package/styles/bootstrap5.css +51 -1
- package/styles/fabric-dark-lite.css +51 -0
- package/styles/fabric-dark.css +51 -0
- package/styles/fabric-lite.css +51 -0
- package/styles/fabric.css +51 -0
- package/styles/file-manager/_bds-definition.scss +1 -0
- package/styles/file-manager/_bootstrap5-definition.scss +1 -0
- package/styles/file-manager/_layout.scss +46 -4
- package/styles/file-manager/_material3-definition.scss +2 -2
- package/styles/file-manager/_tailwind-definition.scss +1 -0
- package/styles/file-manager/_tailwind3-definition.scss +1 -0
- package/styles/file-manager/bds.css +51 -1
- package/styles/file-manager/bootstrap-dark.css +51 -0
- package/styles/file-manager/bootstrap.css +51 -0
- package/styles/file-manager/bootstrap4.css +51 -0
- package/styles/file-manager/bootstrap5-dark.css +51 -1
- package/styles/file-manager/bootstrap5.3.css +51 -0
- package/styles/file-manager/bootstrap5.css +51 -1
- package/styles/file-manager/fabric-dark.css +51 -0
- package/styles/file-manager/fabric.css +51 -0
- package/styles/file-manager/fluent-dark.css +51 -0
- package/styles/file-manager/fluent.css +51 -0
- package/styles/file-manager/fluent2.css +51 -0
- package/styles/file-manager/highcontrast-light.css +51 -0
- package/styles/file-manager/highcontrast.css +51 -0
- package/styles/file-manager/material-dark.css +51 -0
- package/styles/file-manager/material.css +51 -0
- package/styles/file-manager/material3-dark.css +53 -2
- package/styles/file-manager/material3.css +53 -2
- package/styles/file-manager/tailwind-dark.css +51 -1
- package/styles/file-manager/tailwind.css +51 -1
- package/styles/file-manager/tailwind3.css +51 -0
- package/styles/fluent-dark-lite.css +51 -0
- package/styles/fluent-dark.css +51 -0
- package/styles/fluent-lite.css +51 -0
- package/styles/fluent.css +51 -0
- package/styles/fluent2-lite.css +51 -0
- package/styles/fluent2.css +51 -0
- package/styles/highcontrast-light-lite.css +51 -0
- package/styles/highcontrast-light.css +51 -0
- package/styles/highcontrast-lite.css +51 -0
- package/styles/highcontrast.css +51 -0
- package/styles/material-dark-lite.css +51 -0
- package/styles/material-dark.css +51 -0
- package/styles/material-lite.css +51 -0
- package/styles/material.css +51 -0
- package/styles/material3-dark-lite.css +51 -0
- package/styles/material3-dark.css +53 -2
- package/styles/material3-lite.css +51 -0
- package/styles/material3.css +53 -2
- package/styles/tailwind-dark-lite.css +51 -1
- package/styles/tailwind-dark.css +51 -1
- package/styles/tailwind-lite.css +51 -1
- package/styles/tailwind.css +51 -1
- package/styles/tailwind3-lite.css +51 -0
- package/styles/tailwind3.css +51 -0
@@ -1,11 +1,11 @@
|
|
1
1
|
/*!
|
2
2
|
* filename: ej2-filemanager.min.js
|
3
|
-
* version :
|
3
|
+
* version : 30.1.37
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
|
5
5
|
* Use of this code is subject to the terms of our license.
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
8
8
|
* applicable laws.
|
9
9
|
*/
|
10
|
-
this.ej=this.ej||{},this.ej.filemanager=function(e,t,i,n,a,s,r,o,l,h,d){"use strict";function p(e,t){var i=/\.\S+/.test(e),n=/\.\S+/.test(t);if(i&&!n)return 1;if(!i&&n)return-1;var a=[],s=[];for((e+"").replace(/(\d+)|(\D+)/g,function(e,t,i){return a.push([t||1/0,i||""]),""}),(t+"").replace(/(\d+)|(\D+)/g,function(e,t,i){return s.push([t||1/0,i||""]),""});a.length&&s.length;){var r=a.shift(),o=s.shift();if(r&&o){var l=r[0]-o[0]||r[1].localeCompare(o[1]);if(l)return l}}return a.length-s.length}function c(e,i,n){var a=t.getValue("name",i),s=e.getAttribute("data-id"),r=t.isNullOrUndefined(s)?a:s;n.setProperties({path:u(e,r,n.hasId)},!0),n.pathId=f(e),n.pathNames=g(e,a)}function u(e,t,i){for(var n=m(e,t,!1,i),a="/",s=n.length-2;s>=0;s--)a+=n[s]+"/";return a}function f(e){for(var t=m(e,e.getAttribute("data-uid"),!0),i=[],n=t.length-1;n>=0;n--)i.push(t[n]);return i}function g(e,t){for(var i=m(e,t,!1),n=[],a=i.length-1;a>=0;a--)n.push(i[a]);return n}function m(e,i,n,a){for(var s=[i],r=e.parentNode;!t.isNullOrUndefined(r);){if(t.matches(r,"."+Ai)){var o=n?r.getAttribute("data-uid"):a?r.getAttribute("data-id"):t.select("."+Fi,r).textContent;s.push(o)}if((r=r.parentNode).classList.contains(ln))break}return s}function b(e){var i=e.hasId?"id":"name",n="/",a=1;for(a;a<e.pathId.length;a++){var s=t.getValue(e.pathId[parseInt(a.toString(),10)],e.feParent);n+=t.getValue(i,s)+"/"}e.setProperties({path:n},!0)}function v(e){e.isCut&&(O(e),e.selectedNodes=[],e.actionRecords=[],e.enablePaste=!1,e.notify(Gn,{}))}function y(e,i){if(i.isSearchCut=!1,i.actionRecords=[],i.activeElements=[],i.notify(Jn,{}),0===i.activeElements.length)return!1;O(i);var n=i.activeElements;"navigationpane"!==i.activeModule?i.targetPath=i.path:i.targetPath=X(i.path);var a=0;if(n&&(w(i,n[0]),"cut"===e))for(;a<n.length;)I(n[a]),a++;for(a=0,i.selectedNodes=[],i.enablePaste=!0,i.notify(Yn,{});a<i.activeRecords.length;)i.actionRecords.push(i.activeRecords[a]),i.selectedNodes.push(t.getValue("name",i.activeRecords[a])),a++;if((""!==i.breadcrumbbarModule.searchObj.element.value||i.isFiltered)&&"navigationpane"!==i.activeModule){i.selectedNodes=[],i.isSearchCut=!0;for(var s=0;s<i.selectedItems.length;)i.selectedNodes.push(i.selectedItems[s]),s++}return!0}function I(e){e.classList.add(_i)}function O(e,t){for(var i=t?e.element.querySelectorAll("."+Bi):e.element.querySelectorAll("."+_i),n=0;n<i.length;)i[n].classList.remove(t?Bi:_i),n++}function w(e,i){i&&(i.classList.contains(Yi)?e.activeModule="detailsview":t.closest(i,"."+sn)?e.activeModule="largeiconsview":e.activeModule="navigationpane")}function D(e,t){var i=e.fileSystemData.filter(function(e){return String(e.parentId)===String(t)}),n=i.slice();return i.forEach(function(t){var i=t.id;n=n.concat(D(e,i))}),n}function S(e,i,n){var s;if(0!==i.length||e.isFiltered||e.notify(ea,{args:e}),Ae(e))if(""===i)e.itemData=e.fileSystemData,Ee(e,n?_n:Tn,e.path);else{e.searchSettings.filterType=t.isNullOrUndefined(e.searchSettings.filterType)?"contains":e.searchSettings.filterType;var r=t.getValue(e.pathId[e.pathId.length-1],e.feParent),o=D(e,t.getValue("id",r)),l=new a.DataManager(o).executeLocal((new a.Query).where("name",e.searchSettings.filterType,i,e.searchSettings.ignoreCase)),h=e.searchSettings.ignoreCase?i.toLowerCase():i;e.itemData=l,ht(e,n?_n:Tn,e.path,h,e.showHiddenItems,!e.searchSettings.ignoreCase)}else if(s="startsWith"===e.searchSettings.filterType?i+"*":"endsWith"===e.searchSettings.filterType?"*"+i:"*"+i+"*",e.searchWord=s,e.itemData=[E(e)],i.length>0){var d=e.searchSettings.ignoreCase,p=e.showHiddenItems;ht(e,n?_n:Tn,e.path,s,p,!d)}else e.isFiltered?Re(e,_n):e.isSortByClicked?(e.notify(_n,{files:"Details"===e.oldView?e.detailsviewModule.gridObj.dataSource:e.largeiconsviewModule.allItems}),e.isSortByClicked=!1):Ee(e,n?_n:Tn,e.path)}function C(e,t){e.oldView=e.view,e.setProperties({view:t},!0),(""!==e.breadcrumbbarModule.searchObj.element.value||e.isFiltered)&&(e.layoutSelectedItems=e.selectedItems);var i="";e.breadcrumbbarModule.searchObj.element.value&&(i=e.breadcrumbbarModule.searchObj.element.value),e.isLayoutChange=!0,S(e,i,!0)}function x(e,i){var n="";i&&(n=t.closest(i,"."+Pi+"."+Ri+" ."+pn)?"detailsview":t.closest(i,"."+Ti)?"largeiconsview":i.classList.contains("e-fullrow")||i.classList.contains("e-icon-expandable")?"navigationpane":t.closest(i,".e-address-list-item")?"breadcrumbbar":""),e.targetModule=n}function j(e){e.itemData=[E(e)],ye(e.itemData[0])?Ee(e,jn,e.path):be(e,e.itemData[0],oa)}function N(e){Ee(e,Fn,e.path)}function E(e){return t.getValue(e.pathId[e.pathId.length-1],e.feParent)}function P(e){y("copy",e)&&(e.fileAction="copy")}function R(e){y("cut",e)&&(e.isCut=!0,e.fileAction="move")}function M(e){if(!t.getValue("isFile",e))return en;var i=["bmp","dib","jpg","jpeg","jpe","jfif","gif","tif","tiff","png","ico"],n=["mp3","wav","aac","ogg","wma","aif","fla","m4a"],a=["webm","mkv","flv","vob","ogv","ogg","avi","wmv","mp4","3gp"],s=["css","exe","html","js","msi","pdf","pptx","ppt","rar","zip","txt","docx","doc","xlsx","xls","xml","rtf","php"],r=t.getValue("type",e);-1!==(r=r.toLowerCase()).indexOf(".")&&(r=r.split(".").join(""));return-1!==i.indexOf(r)?tn:-1!==n.indexOf(r)?nn:-1!==a.indexOf(r)?an:-1!==s.indexOf(r)?"e-fe-"+r:"e-fe-unknown e-fe-"+r}function k(e,i){var n=Ae(e)?t.getValue("imageUrl",i):"";if(Ae(e)){var a={fileDetails:[i],imageUrl:n};return e.trigger("beforeImageLoad",a),a.imageUrl}var s=e.ajaxSettings.getImageUrl?e.ajaxSettings.getImageUrl:e.ajaxSettings.url,r=-1!==s.indexOf("?")?"&path=":"?path=",o=encodeURIComponent(t.getValue("name",i)),l=t.getValue("filterPath",i);if(e.hasId){var h=t.getValue("id",i);n=s+r+e.path+"&id="+h}else n=t.isNullOrUndefined(l)?s+r+e.path+o:s+r+encodeURIComponent(l.replace(/\\/g,"/"))+o;var d={fileDetails:[i],imageUrl:n=n+"&time="+(new Date).getTime().toString()};return e.trigger("beforeImageLoad",d),d.imageUrl}function L(e,i,n){var a=t.getValue(e.hasId?"id":"name",i)+"/",s=t.getValue(e.hasId?"filterId":"filterPath",i);return t.isNullOrUndefined(s)?n+a:s.replace(/\\/g,"/").replace(/^.*?(?=\/)/,"")+a}function T(e,i){var n=t.getValue("name",i),a=t.getValue("filterPath",i);return""===e.breadcrumbbarModule.searchObj.element.value&&!e.isFiltered||t.isNullOrUndefined(a)||(n=(a=a.replace(/\\/g,"/")).replace(e.path,"")+n),n}function A(e,i){if(0===i.length)return i;var n;n="None"===e.sortOrder||t.isNullOrUndefined(e.sortOrder)?(new a.Query).group("isFile"):(new a.Query).sortBy(e.sortBy,e.sortOrder.toLowerCase(),!0).group("isFile");var s=new a.DataManager(i).executeLocal(n);return t.getValue("records",s)}function F(e,i,n){return t.getValue(e.pathId[e.pathId.length-1],e.feFiles).filter(function(e){return e[i].toString()===n})[0]}function U(e,i,n){var a,s=t.select("#"+e.element.id+Oi,e.element),r=t.select("#"+e.element.id+Ni,s).offsetHeight;if(a=s.offsetHeight-r,"Details"===e.view&&(a-=t.select("."+on,s).offsetHeight),t.isNullOrUndefined(i.querySelector("."+Gi))){var o=t.createElement("div",{className:Gi}),l=t.createElement("div",{className:rn}),h=t.createElement("div",{className:Ji}),d=t.createElement("div",{className:Qi});"Details"===e.view?i.querySelector("."+dn).appendChild(o):i.appendChild(o),o.appendChild(l),o.appendChild(h),o.appendChild(d)}i.querySelector("."+Gi)&&(t.isNullOrUndefined(n.error)?e.isFiltered?(i.querySelector("."+Ji).innerHTML=B(e,"Filter-Empty"),i.querySelector("."+Qi).innerHTML=B(e,"Filter-Key")):""!==e.breadcrumbbarModule.searchObj.element.value?(i.querySelector("."+Ji).innerHTML=B(e,"Search-Empty"),i.querySelector("."+Qi).innerHTML=B(e,"Search-Key")):(i.querySelector("."+Ji).innerHTML=B(e,"Folder-Empty"),i.querySelector("."+Qi).innerHTML=B(e,"File-Upload")):(i.querySelector("."+Ji).innerHTML=B(e,"Access-Denied"),i.querySelector("."+Qi).innerHTML=B(e,"Access-Details")));var p=t.select("."+Gi,i);a=(a-p.offsetHeight)/2,p.style.marginTop=a+"px"}function V(e){return new a.DataManager(e).executeLocal((new a.Query).where(yn,"equal",!1,!1))}function _(e,i){for(var n=V(e.files),a=0,s=n.length;a<s;a++)t.setValue("_fm_id",i+"_"+a,n[a])}function H(e){for(var i=0;i<e.length;i++){var n=new Date(t.getValue("dateCreated",e[i])),a=new Date(t.getValue("dateModified",e[i]));t.setValue("_fm_created",n,e[i]),t.setValue("_fm_modified",a,e[i])}}function B(e,t){var i=e.localeObj.getConstant(t);return""===i?t:i}function z(e,i){var n=e.cssClass;return n=t.isNullOrUndefined(n)||""===n?i:n+" "+i}function q(e,t){e.isSortByClicked=!0,-1!==t.item.id.indexOf("ascending")||-1!==t.item.id.indexOf("descending")||-1!==t.item.id.indexOf("none")?e.sortOrder=W(t.item.id):e.sortBy=W(t.item.id,e),e.itemData=[E(e)],"Details"===e.view&&(e.isMobile?C(e,"Details"):(e.notify(Zn,{module:"detailsview"}),e.isSortByClicked=!1)),"LargeIcons"===e.view&&C(e,"LargeIcons"),e.notify(Hn,{})}function W(e,t){var i,n=e.substring(e.lastIndexOf("_")+1),a=n;switch(t&&(i=t.detailsViewSettings.columns),n){case"date":for(var s=0,r=i.length;s<r;s++){if("dateModified"===i[s].field||"dateCreated"===i[s].field){a=i[s].field;break}a="_fm_modified"}break;case"ascending":a="Ascending";break;case"descending":a="Descending";break;case"none":a="None"}return a}function K(e,i){for(var n=i.split("/"),a=e.originalPath.split("/"),s=t.getValue(e.pathId[0],e.feParent),r=t.isNullOrUndefined(t.getValue("id",s))?"name":"id",o=n.length-1,l=a.length-1;o<l;o++){var h=""===a[o+1]?wn:On,d=""===a[o]?"/":e.path+a[o]+"/",p=F(e,r,a[parseInt(o.toString(),10)]),c=t.getValue("_fm_id",p);e.setProperties({path:d},!0),t.isNullOrUndefined(c)||e.pathId.push(c),e.itemData=[p],e.pathNames.push(t.getValue("name",p)),Ee(e,h,e.path);break}}function Y(e,i){e.originalPath=L(e,i,e.path);var n=t.getValue(e.pathId[0],e.feParent),a=e.feParent[t.getValue("_fm_id",e.itemData[0])],s=t.isNullOrUndefined(a)||"fe_tree"===t.getValue("_fm_id",a),r=F(e,t.isNullOrUndefined(t.getValue("id",n))?"name":"id",Ae(e)?t.getValue("id",i):t.getValue("name",i));if(t.isNullOrUndefined(r)){if(s)return void K(e,e.path);e.notify(Vn,{selectedNode:e.pathId[e.pathId.length-1]})}else{var o=t.getValue("_fm_id",r);e.setProperties({path:e.originalPath},!0),e.pathId.push(o),e.itemData=[r],e.pathNames.push(t.getValue("name",r))}Ee(e,e.path!==e.originalPath?On:wn,e.path)}function G(e){if(e.isDragDrop=!1,0!==e.selectedNodes.length&&e.enablePaste){var t=""===e.folderPath?e.path:e.folderPath;"navigationpane"!==e.activeModule||e.selectedNodes[0].includes("/")||(e.targetPath=je(e,e.actionRecords[0])),J(e,e.actionRecords,t,e.path)||("move"===e.fileAction&&e.targetPath!==t||"copy"===e.fileAction?(e.notify(Qn,{}),ke(e,e.targetPath,e.selectedNodes,t,e.fileAction,[],e.actionRecords)):(e.enablePaste=!1,e.notify(Gn,{}),O(e),ut(e,"Error",{files:null,error:{code:"402",message:B(e,"Same-Folder-Error"),fileExists:null}})))}}function J(e,i,n,a){for(var s=!1,r=0;r<i.length;r++)if(t.getValue("isFile",i[r])){var o=e.dragData[r]?e.dragData[r].name:null,l=Ae(e)?o:e.dragNodes[r],h=0;l&&(h=l.lastIndexOf("/"));var d="";if(h>0&&(d=a+l.substring(0,h+1)),d===n){var p={files:null,error:{code:"402",message:B(e,"Same-Folder-Error"),fileExists:null}};ut(e,"Error",p),s=!0;break}}else{var c=L(e,i[r],a);if(0===n.indexOf(c)){ut(e,"Error",p={files:null,error:{code:"402",message:B(e,"Sub-Folder-Error"),fileExists:null}}),s=!0;break}}return s}function Q(e){e.isDragDrop=!0,0!==e.dragData.length&&(e.dragPath=e.dragPath.replace(/\\/g,"/"),e.dropPath=e.dropPath.replace(/\\/g,"/"),J(e,e.dragData,e.dropPath,e.dragPath)||e.dragPath===e.dropPath||(e.itemData=[e.dropData],ke(e,e.dragPath,e.dragNodes,e.dropPath,"move",[],e.dragData),e.notify(Qn,{})))}function X(e){for(var t=e.split("/"),i=t[0]+"/",n=1;n<t.length-2;n++)i+=t[n]+"/";return i}function $(e,i){var n=t.getValue(e.hasId?"id":"name",i.cwd)+"/",a=t.getValue(e.hasId&&!t.isNullOrUndefined(e.ajaxSettings.url)?"filterId":"filterPath",i.cwd);return t.isNullOrUndefined(a)?Ae(e)?n:e.path+n:""===a?"/":a.replace(/\\/g,"/").replace(/^.*?(?=\/)/,"")+n}function Z(e,t,i){"move"===t&&(e.isDragDrop?e.notify(na,i):(e.enablePaste=!1,e.notify(Gn,{}),e.notify($n,i))),0===e.duplicateItems.length&&(e.pasteNodes=[]);for(var n=0;n<i.files.length;n++)e.pasteNodes.push(i.files[n][e.hasId?"id":"name"]),e.isDragDrop&&e.droppedObjects.push(i.files[n]);e.duplicateItems=[],e.duplicateRecords=[],e.isDragDrop&&!e.isPasteError?e.isDropEnd=!0:e.isDropEnd=!1,e.trigger("success",{action:t,result:i}),!e.isDragDrop||e.path===e.dragPath||e.path===e.dropPath||e.isSearchDrag?(e.isPathDrag=!1,Ee(e,Xn,e.path)):ee(e)}function ee(e){var i=t.getValue("_fm_id",e.dropData);if(e.expandedId=i,e.itemData=[e.dropData],e.isPathDrag)e.notify(Sn,e.itemData);else{if(e.navigationpaneModule){var n=t.select('[data-uid="'+i+'"]',e.navigationpaneModule.treeObj.element);n||(i=document.querySelector('[data-id = "'+t.getValue("id",e.dropData)+'"]').getAttribute("data-uid"),n=t.select('[data-uid="'+i+'"]',e.navigationpaneModule.treeObj.element)),c(n,e.dropData,e)}Ee(e,aa,e.dropPath)}}function te(e,i){for(var n=null,a=e.isDragDrop?e.dragData:e.actionRecords,s=0;s<a.length;s++)if(t.getValue("name",a[s])===i){n=a[s];break}return n}function ie(e){if(e.isSearchDrag=!1,""!==e.breadcrumbbarModule.searchObj.element.value&&(e.isSearchDrag=!0),"navigationpane"!==e.activeModule){e.dragNodes=[];for(var t=0;t<e.selectedItems.length;)e.dragNodes.push(e.selectedItems[t]),t++;0===e.selectedItems.length&&e.dragData&&1===e.dragData.length&&e.dragNodes.push(pe(e,e.dragData[0]))}var i=e.createElement("div",{className:"e-fe-icon "+M(e.dragData[0])}),n=e.createElement("div",{className:"e-fe-name",innerHTML:e.dragData[0].name}),a=e.createElement("div",{className:"e-fe-content"});a.appendChild(i),a.appendChild(n);var s=e.createElement("div",{className:Xi});if(s.appendChild(a),e.dragNodes.length>1){var r=e.createElement("span",{className:"e-fe-count",innerHTML:e.dragNodes.length.toString(10)});s.appendChild(r)}e.virtualDragElement=s,e.element.appendChild(e.virtualDragElement)}function ne(e,i){var n=i;n.cancel=!1,null!=e.treeExpandTimer&&(window.clearTimeout(e.treeExpandTimer),e.treeExpandTimer=null),re(e),e.element.classList.remove("e-fe-drop","e-no-drop"),O(e),e.uploadObj.dropArea=t.select("#"+e.element.id+ji,e.element);var a=t.select("."+Xi,e.element);a&&t.detach(a),x(e,i.target),e.notify(ia,i),O(e,"hover"),n.fileDetails=e.dragData,e.trigger("fileDragStop",n,function(i){!i.cancel&&!t.isNullOrUndefined(e.targetModule)&&""!==e.targetModule&&e.dragCount>2&&Q(e),e.dragCount=0})}function ae(e,i,n){var a=i;if(a.cancel=!1,a.fileDetails=e.dragData,e.dragCount=0,e.droppedObjects=[],(!e.allowDragAndDrop||"navigationpane"===e.activeModule&&t.closest(i.element,"li").getAttribute("data-uid")===e.pathId[0])&&(a.cancel=!0),"navigationpane"===e.activeModule&&-1!==e.pathId.indexOf(t.closest(i.element,"li").getAttribute("data-uid"))?e.isPathDrag=!0:e.isPathDrag=!1,O(e),a.cancel)n.intDestroy(i.event),se(e);else if(!a.cancel){for(var s=0;s<e.activeElements.length;)I(e.activeElements[s]),s++;e.trigger("fileDragStart",a,function(t){t.cancel?(n.intDestroy(i.event),se(e)):e.uploadObj.dropArea=null})}}function se(e){O(e);var i=t.select("."+Xi,e.element);i&&t.detach(i)}function re(e){oe(e,$i),oe(e,Zi)}function oe(e,t){for(var i=e.element.querySelectorAll("."+t),n=0;n<i.length;n++)i[n].classList.remove(t)}function le(e,i,n,a){var s,r=e.getBoundingClientRect(),o=t.select("."+n,e);a>=r.top+e.clientHeight-30&&!t.isNullOrUndefined(o)&&(s="navigationpane"===i.targetModule||"detailsview"===i.targetModule?o.offsetHeight/2.5:o.offsetHeight/4.5,e.scrollBy(0,s)),!t.isNullOrUndefined(o)&&a<=r.top+30&&(s="navigationpane"===i.targetModule||"detailsview"===i.targetModule?o.offsetHeight/2.5:o.offsetHeight/4.5,e.scrollBy(0,-s))}function he(e,i){var n=i;n.fileDetails=e.dragData;var a=!1;x(e,i.target),re(e),null!=e.treeExpandTimer&&(window.clearTimeout(e.treeExpandTimer),e.treeExpandTimer=null),O(e,"hover");var s=null;"navigationpane"===e.targetModule?((s=t.closest(i.target,"li")).classList.add(Bi,$i),a=!0,e.treeExpandTimer=window.setTimeout(function(){e.notify(sa,i)},800),le(e.navigationpaneModule.treeObj.element.parentElement,e,"e-level-2",i.event.y)):"detailsview"===e.targetModule?((s=t.closest(i.target,"tr"))&&s.querySelector("."+en)&&!s.classList.contains(_i)?s.classList.add($i):!s||s.querySelector("."+en)||s.classList.contains(_i)||s.classList.add(Zi),a=!0,le(e.detailsviewModule.gridObj.element.querySelector(".e-content"),e,"e-row",i.event.y)):"largeiconsview"===e.targetModule?((s=t.closest(i.target,"li"))&&s.querySelector("."+en)&&!s.classList.contains(_i)&&s.classList.add(Bi,$i),a=!0,le(e.largeiconsviewModule.element.firstElementChild,e,"e-large-icon",i.event.y)):"breadcrumbbar"===e.targetModule&&(a=!0),e.element.classList.remove("e-fe-drop","e-no-drop"),e.element.classList.add(a?"e-fe-drop":"e-no-drop"),e.dragCount=e.dragCount+1,e.trigger("fileDragging",n)}function de(e){for(var i="",n=Object.keys(e),a=0;a<n.length;a++)"message"!==n[a]&&(i+=(0===a?"":", ")+n[a]+": "+t.getValue(n[a],e));return i}function pe(e,i){return e.hasId?t.getValue("id",i):T(e,i)}function ce(e,i){e.itemData=[i],e.currentItemText=t.getValue("name",i),e.isFile=t.getValue("isFile",i),e.filterPath=t.getValue("filterPath",i)}function ue(e){Ie(e.itemData[0])?ut(e,"Rename"):be(e,e.itemData[0],la)}function fe(e){for(var t=e.itemData,i=0;i<t.length;i++)if(!De(t[i]))return void be(e,t[i],pa);e.selectedItems.length>0&&pt(e,e.path,e.selectedItems)}function ge(e,t,i){for(var n=0;n<t.length;n++)if(!Ie(t[n]))return void be(e,t[n],la);e.itemData=t,Le(e,i,e.path,"delete")}function me(e,t,i){for(var n=0;n<t.length;n++)if(!De(t[n]))return void be(e,t[n],pa);e.itemData=t,i.length>0&&pt(e,e.path,i)}function be(e,i,n){var a=t.getValue("message",t.getValue("permission",i));""===a&&(a=B(e,"Access-Message").replace("{0}",t.getValue("name",i)).replace("{1}",n)),ut(e,"Error",{error:{code:"401",fileExists:null,message:a}})}function ve(e){return ye(e)?"e-fe-locked":"e-fe-locked e-fe-hidden"}function ye(e){var i=t.getValue("permission",e);return!(i&&!t.getValue("read",i))}function Ie(e){var i=t.getValue("permission",e);return!i||t.getValue("read",i)&&t.getValue("write",i)}function Oe(e){var i=t.getValue("permission",e);return!i||t.getValue("read",i)&&t.getValue("writeContents",i)}function we(e){var i=t.getValue("permission",e);return!i||t.getValue("read",i)&&t.getValue("upload",i)}function De(e){var i=t.getValue("permission",e);return!i||t.getValue("read",i)&&t.getValue("download",i)}function Se(e){var t=e.itemData[0];Oe(t)?ut(e,"NewFolder"):be(e,t,ha)}function Ce(e){var t=e.itemData[0];if(we(t)){var i="#"+e.element.id+Ei;document.querySelector(i).click()}else be(e,t,da)}function xe(e){t.isNullOrUndefined(e.dialogObj)||e.dialogObj.hide()}function je(e,i){return e.hasId&&!t.isNullOrUndefined(t.getValue("filterId",i))?t.getValue("filterId",i).replace(/\\/g,"/").replace(/^[^/]+\//,"/"):t.getValue("filterPath",i).replace(/\\/g,"/")}function Ne(e,i,n,a){for(var s="",r=0;r<i.length;r++){var o=t.getValue("permission",i[r]);if(null==o&&(o=void 0),a)!o||t.getValue("read",o)&&t.getValue("writeContents",o)||""===(s=t.getValue("message",t.getValue("permission",i[r])))&&(s=B(e,"Access-Message").replace("{0}",t.getValue("name",i[r])).replace("{1}","writeContents"));else{var l="copy"===n?t.getValue("copy",o):t.getValue("write",o);!o||t.getValue("read",o)&&l||""===(s=t.getValue("message",t.getValue("permission",i[r])))&&(s=B(e,"Access-Message").replace("{0}",t.getValue("name",i[r])).replace("{1}",n))}if(""!==s){e.responseData={cwd:null,details:null,error:{code:"401",message:s,fileExists:null},files:null};break}}return s}function Ee(e,i,n){for(var a=e.itemData,s=0;s<a.length;s++)t.isNullOrUndefined(t.getValue("hasChild",a[s]))&&t.setValue("hasChild",!1,a[s]);Qe(e,{action:"read",path:n,showHiddenItems:e.showHiddenItems,data:a},tt,i)}function Pe(e,t){Qe(e,{action:"create",path:e.path,name:t,data:e.itemData},nt,t)}function Re(e,i){var n={action:"filter",path:e.path,showHiddenItems:e.showHiddenItems,data:[E(e)]},a=e.filterData?t.extend(void 0,n,e.filterData):n;Qe(e,a,it,i,t.getValue("action",a))}function Me(e,t,i){var n,a;if(""!==e.breadcrumbbarModule.searchObj.element.value||e.isFiltered){var s=e.filterPath;e.hasId?(n=e.currentItemText,a=i):(n=(s=s.replace(/\\/g,"/")).replace(t,"")+e.currentItemText,a=s.replace(t,"")+i)}else n=e.currentItemText,a=i;Qe(e,{action:"rename",path:t,name:n,newName:a,data:e.itemData,showFileExtension:e.showFileExtension},at,t)}function ke(e,t,i,n,a,s,r){var o={action:a,path:t,targetData:e.itemData[0],targetPath:n,names:i,renameFiles:s,data:r};e.destinationPath=n,Qe(e,o,st,t,a,n)}function Le(e,t,i,n){Qe(e,{action:n,path:i,names:t,data:e.itemData},rt,i)}function Te(e,t,i,n){Qe(e,{action:n,path:i,names:t,data:e.itemData},ot,i,n)}function Ae(e){return e.fileSystemData.length>=0&&t.isNullOrUndefined(e.ajaxSettings.url)}function Fe(e,t){return e.some(function(e){return e.name===t})}function Ue(e,i){return e.fileSystemData.findIndex(function(e){return!t.isNullOrUndefined(e)&&String(e.id)===String(i)})}function Ve(e,t){return e.fileSystemData.filter(function(e){return String(e.id)===String(t)})[0]}function _e(e,t){return e.fileSystemData.filter(function(e){return String(e.parentId)===String(t)})}function He(e,i,n,a){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=null);var l=new Date,h=String(i.id)===String(0)||t.isNullOrUndefined(i.parentId)?"\\":i.filterPath+i.name+"\\";return Object.assign(r,{dateCreated:l,dateModified:l,filterPath:h,hasChild:!!a&&e.hasChild,id:s.getUid(null===n?e.name:n),isFile:!!a&&e.isFile,name:null===n?e.name:n,parentId:i.id,size:a?e.size:0,type:a?e.type:""}),r}function Be(e,t,i,n){e.responseData={cwd:null,details:null,error:{code:i,message:t,fileExists:null!=n?n:null},files:null}}function ze(e,i,n){var a={folderName:t.getValue("name",i),cancel:!1,path:t.getValue("path",i),parentFolder:t.getValue("data",i)};e.trigger("beforeFolderCreate",a,function(t){if(t.cancel)return void(n.cancel=!0);if(Ae(e))if(Fe(e.fileSystemData,t.folderName)){var i="A file or folder with the name "+t.folderName+" already exists.";Be(e,i,"400",null)}else{var a=t.parentFolder[0],s=He(a,a,t.folderName,!1);e.fileSystemData.push(s)}})}function qe(e,i,n){var a={cancel:!1,itemData:t.getValue("data",i),path:t.getValue("path",i)};e.trigger("beforeDelete",a,function(t){if(t.cancel)return void(n.cancel=!0);Ae(e)&&t.itemData.forEach(function(t){var i=Ue(e,t.id);-1!==i&&e.fileSystemData.splice(i,1),t.isFile||e.fileSystemData.filter(function(e){return e.filterPath.includes(t.name)}).forEach(function(t){var i=Ue(e,t.id);-1!==i&&e.fileSystemData.splice(i,1)})})})}function We(e,i,n){var a={cancel:!1,newName:t.getValue("newName",i),itemData:t.getValue("data",i),path:t.getValue("path",i)};e.trigger("beforeRename",a,function(t){if(t.cancel)return void(n.cancel=!0);if(Ae(e))if(Fe(e.fileSystemData,t.newName)){var i="Cannot rename"+t.itemData[0].name+"to"+t.newName+": destination already exists.";Be(e,i,"400",null)}else{var a=Ve(e,t.itemData[0].id),s=a.name;a.name=t.newName,Ke(e,a.id,s,t.newName)}})}function Ke(e,t,i,n){e.fileSystemData.forEach(function(a){if(String(a.parentId)===String(t)){var s=a.filterPath.replace(i+"\\",n+"\\");a.filterPath=s,Ke(e,a.id,i,n)}})}function Ye(e,i,n){var a={cancel:!1,itemData:t.getValue("data",i),isCopy:"copy"===t.getValue("action",i),path:t.getValue("path",i),targetData:t.getValue("targetData",i),targetPath:t.getValue("targetPath",i)};e.trigger("beforeMove",a,function(a){if(a.cancel)return void(n.cancel=!0);if(Ae(e)){var s=t.getValue("action",i),r=Ne(e,a.itemData,s,!1),o=Ne(e,[a.targetData],s,!0),l=[];if(e.pasteNodes=[],""===r&&""===o){if(a.isCopy){var h=_e(e,a.targetData.id);return a.itemData.forEach(function(n){if(!Fe(h,n.name)||t.getValue("renameFiles",i).length>0){if(t.getValue("renameFiles",i).length>0){var s=n.name.split("."),r=n.name.includes(".")?s[0]+"("+e.existingFileCount+")."+s[1]:s[0]+"("+e.existingFileCount+")";return Ze(e,n,a.targetData,r),e.responseData.error=null,void e.existingFileCount++}Ze(e,n,a.targetData,null)}else l.push(n.name)}),void(l.length>0&&Be(e,"File Already Exists","400",l))}for(var d=a.targetData,p=_e(e,d.id),c=0;c<a.itemData.length;c++){var u=a.itemData[c];if(!Fe(p,u.name)||t.getValue("renameFiles",i).length>0){if(!d.hasChild){d.hasChild=!u.isFile;var f=e.fileSystemData.filter(function(e){return String(e.id)===String(d.id)});f.length>0&&(f[0].hasChild=d.hasChild)}if(!u.isFile){var g=0!==u.parentId?_e(e,u.parentId):[];Ve(e,u.parentId).hasChild=g.length>1}var m=Ve(e,u.id);if(t.getValue("renameFiles",i).length>0){var b=u.name.split(".");u.name=u.name.includes(".")?b[0]+"("+e.existingFileCount+")."+b[1]:b[0]+"("+e.existingFileCount+")",m.name=u.name,e.responseData.error=null,e.existingFileCount++,e.dropData=d,e.dropPath=a.path;var v=a.targetPath.replace(/^\/|\/$/g,"").split("/");d=Ve(e,v[v.length-1])}m.parentId=d.id,m.filterPath=0===d.id?"\\":d.filterPath+d.name+"\\"}else l.push(u.name)}l.length>0&&Be(e,"File Already Exists","400",l)}}})}function Ge(e,i,n){var a={searchResults:t.getValue("data",i),cancel:!1,path:t.getValue("path",i),searchText:t.getValue("searchString",i),caseSensitive:t.getValue("caseSensitive",i),showHiddenItems:t.getValue("showHiddenItems",i)};e.trigger("search",a,function(e){t.setValue("data",e.searchResults,i),e.cancel&&(n.cancel=!0)})}function Je(e,i,n){switch(t.getValue("action",i)){case"create":ze(e,i,n);break;case"delete":qe(e,i,n);break;case"rename":We(e,i,n);break;case"move":case"copy":Ye(e,i,n);break;case"search":Ge(e,i,n)}}function Qe(e,i,n,a,s,r){var o={url:e.ajaxSettings.url,type:"POST",mode:!0,dataType:"json",contentType:"application/json",data:JSON.stringify(i),onSuccess:null,onFailure:null,beforeSend:null},l={action:t.getValue("action",i),ajaxSettings:o,cancel:!1};Je(e,i,l),e.trigger("beforeSend",l,function(o){if(!o.cancel){if(e.notify(Rn,{}),Ae(e)){var l=("node-expand"===a||"finalize-end"===a||"rename-end-parent"===a?t.getValue("path",i):e.path).replace(/^\/|\/$/g,"").split("/"),h="rename-end-parent"===a||"path-changed"===a&&0!==t.getValue("data",i).length&&t.isNullOrUndefined(e.renamedItem)?t.getValue("data",i)[0].id:l[l.length-1],d=t.getValue("action",i),p=("move"===d||"rename"===d||"copy"===d||"delete"===d||"search"===d)&&"rename-end"!==a;if("read"===d||"create"===d||"rename-end"===a){var c=e.fileSystemData.filter(function(e){return t.isNullOrUndefined(e.parentId)}).length>0?e.fileSystemData.filter(function(e){return t.isNullOrUndefined(e.parentId)})[0].id:0;if(e.responseData={cwd:Ve(e,"/"===e.path&&"node-expand"!==a&&"rename-end-parent"!==a?c:h),details:null,error:null,files:_e(e,"/"===e.path&&"node-expand"!==a&&"rename-end-parent"!==a?c:h)},t.isNullOrUndefined(e.responseData.cwd)){Be(e,"Cannot load empty data within the File Manager.","400",null)}}else if(p&&null===e.responseData.error)0===(u="search"===d||"delete"===d?t.getValue("data",i):[]).length&&(u="copy"===d?e.pasteNodes.map(function(t){return Ve(e,t)}):t.getValue("data",i).map(function(t){return Ve(e,t.id)})),e.responseData={cwd:null,details:null,error:null,files:u};else if("details"===t.getValue("action",i)){var u=t.getValue("data",i),f=u[0],g=u.length>1,m=u.map(function(e){return e.name}),b=Xe(g?u.reduce(function(e,t){return e+(t.size||0)},0):f.size),v=e.pathNames.includes(f.name)||g?e.pathNames.join("/"):e.pathNames.join("/")+"/"+f.name;e.responseData.details=Object.assign({location:v,multipleFiles:g,name:m.join(", "),size:b},g?{}:{created:f.dateCreated,isFile:f.isFile,modified:f.dateModified,permission:f.permission})}return void $e(e,e.responseData,n,i,a,s,r,o)}new t.Ajax({url:t.getValue("url",o.ajaxSettings),type:t.getValue("type",o.ajaxSettings),mode:t.getValue("mode",o.ajaxSettings),dataType:t.getValue("dataType",o.ajaxSettings),contentType:t.getValue("contentType",o.ajaxSettings),data:t.getValue("data",o.ajaxSettings),beforeSend:t.getValue("beforeSend",o.ajaxSettings),onSuccess:function(l){if(t.isNullOrUndefined(l)){var h={error:{fileExists:null,message:B(e,"Server-Error")+" "+e.ajaxSettings.url,code:"406"},files:null};return void et(e,o,n,h,a,s,r)}"string"==typeof l&&(l=JSON.parse(l)),$e(e,l,n,i,a,s,r,o)},onFailure:function(){var t={files:null,error:{code:"404",message:B(e,"Network-Error")+" "+e.ajaxSettings.url,fileExists:null}};et(e,o,n,t,a,s,r)}}).send()}})}function Xe(e){return e<1024?e+" B":e<1048576?(e/1024).toFixed(2)+" KB":e<1073741824?(e/1024/1024).toFixed(2)+" MB":(e/1024/1024/1024).toFixed(2)+" GB"}function $e(e,i,n,a,s,r,o,l){e.notify(kn,{action:"success"});var h=e.expandedId?e.expandedId:e.pathId[e.pathId.length-1];if(!t.isNullOrUndefined(i.cwd)&&"read"===t.getValue("action",a)&&(i.cwd.name=1===e.pathId.length?e.rootAliasName||i.cwd.name:i.cwd.name,t.setValue("_fm_id",h,i.cwd),t.setValue(h,i.cwd,e.feParent),!t.isNullOrUndefined(i.files)||"401"===i.error.code)){if(("finalize-end"===s||"initial-end"===s)&&0===e.pathNames.length){var d=t.getValue(e.pathId[0],e.feParent);e.pathNames[0]=t.getValue("name",d),e.hasId=!t.isNullOrUndefined(t.getValue("id",d))}"finalize-end"===s&&b(e)}if(!t.isNullOrUndefined(i.files)){H(i.files);for(var p=0,c=i.files.length;p<c;p++){var u=i.files[p];t.setValue("_fm_iconClass",M(u),u)}"read"===t.getValue("action",a)&&(_(i,h),t.setValue(h,i.files,e.feFiles))}if(!t.isNullOrUndefined(i.details)&&!t.isNullOrUndefined(e.rootAliasName)){var f=e.rootAliasName||t.getValue("name",i.details),g=t.getValue("location",i.details).replace(new RegExp("/","g"),"\\");"/"===t.getValue("path",a)||e.hasId&&1===t.getValue("path",a).match(/[/]/g).length?(0===t.getValue("names",a).length&&t.setValue("name",f,i.details),g=-1===g.indexOf("\\")?f:g.replace(g.substring(0,g.indexOf("\\")),f)):g=g.replace(g.substring(0,g.indexOf("\\")),f),t.setValue("location",g,i.details)}n(e,i,s,r,o),t.isNullOrUndefined(i.files)||"path-changed"!==s&&"finalize-end"!==s&&"open-end"!==s&&"drop-path"!==s||e.notify(ta,i),"function"==typeof t.getValue("onSuccess",l.ajaxSettings)&&t.getValue("onSuccess",l.ajaxSettings)()}function Ze(e,t,i,n){var a=He(t,i,n,!0);e.fileSystemData.push(a),e.pasteNodes.push(a.id);for(var s=_e(e,t.id),r=0;r<s.length;r++)Ze(e,s[r],a,null)}function et(e,i,n,a,s,r,o){e.notify(kn,{action:"failure"}),n(e,a,s,r,o),"function"==typeof t.getValue("onFailure",i.ajaxSettings)&&t.getValue("onFailure",i.ajaxSettings)()}function tt(e,i,n){try{if(t.isNullOrUndefined(i.files))t.isNullOrUndefined(i.error)||"401"!==i.error.code||(i.files=[],e.notify(n,i),e.notify(Un,{})),lt(e,i,"read"),e.setProperties({path:e.oldPath},!0),e.pathNames.pop();else{e.notify(n,i),e.notify(Un,{});a={action:"read",result:i};e.trigger("success",a)}}catch(t){ct(e,t,"read"),e.setProperties({path:e.oldPath},!0),e.pathNames.pop()}if(e.isDragDrop&&e.isDropEnd){if(0!==e.droppedObjects.length){var a={fileDetails:e.droppedObjects};e.trigger("fileDropped",a)}e.isDropEnd=e.isDragDrop=!1}}function it(e,i,n,a){try{if(t.isNullOrUndefined(i.files))lt(e,i,a);else{e.notify(n,i);var s={action:a,result:i};e.trigger("success",s)}}catch(t){ct(e,t,a)}}function nt(e,i,n){try{if(t.isNullOrUndefined(i.files))if("400"===i.error.code){if(e.dialogObj&&e.dialogObj.visible){var a=t.select("#newname",e.dialogObj.element),s=B(e,"Validation-NewFolder-Exists").replace("{0}",'"'+a.value+'"');a.parentElement.nextElementSibling.innerHTML=s}else ut(e,"Error",{files:null,error:{code:"400",message:B(e,"Validation-NewFolder-Exists").replace("{0}",'"'+n+'"'),fileExists:null}});o={action:"create",error:i.error};e.trigger("failure",o)}else e.dialogObj&&e.dialogObj.visible&&e.dialogObj.hide(),lt(e,i,"create");else{e.dialogObj&&e.dialogObj.visible&&e.dialogObj.hide(),e.createdItem=Ae(e)?i.files[i.files.length-1]:i.files[0],e.breadcrumbbarModule.searchObj.value="";var r={folderName:n,path:e.path,parentFolder:e.itemData};e.trigger("folderCreate",r);var o={action:"create",result:i};e.trigger("success",o),e.itemData=[E(e)],Ee(e,Dn,e.path)}}catch(s){e.dialogObj&&e.dialogObj.visible&&e.dialogObj.hide(),ct(e,s,"create")}}function at(e,i){try{if(t.isNullOrUndefined(i.files))if("400"===i.error.code&&e.dialogObj&&e.dialogObj.visible){var n=t.select("#rename",e.dialogObj.element),a=B(e,"Validation-Rename-Exists").replace("{0}",'"'+e.currentItemText+'"');a=a.replace("{1}",'"'+n.value+'"'),n.parentElement.nextElementSibling.innerHTML=a;s={action:"rename",error:i.error};e.trigger("failure",s)}else t.isNullOrUndefined(e.dialogObj)||e.dialogObj.hide(),lt(e,i,"rename");else{t.isNullOrUndefined(e.dialogObj)||e.dialogObj.hide();var s={action:"rename",result:i};e.trigger("success",s),e.renamedItem=Array.isArray(i.files)?i.files[0]:i.files;var r={newName:e.renamedItem.name,itemData:[e.renamedItem],path:e.path};if(e.trigger("rename",r),"navigationpane"===e.activeModule){var o=E(e),l=e.pathId[e.pathId.length-1].split("_").length-2;e.pathId.pop(),e.itemData=[t.getValue(e.pathId[e.pathId.length-1],e.feParent)];var h=je(e,e.renamedItem);Ee(e,Wn,h),!t.isNullOrUndefined(o)&&e.pathNames.length>1&&l<=e.pathNames.length-1&&(e.pathNames[l]=e.renameText,e.hasId||e.setProperties({path:"/"+e.pathNames.slice(1).join("/")+"/"},!0)),e.itemData=e.navigationpaneModule.previousSelected.length>0?e.navigationpaneModule.treeObj.getTreeData(e.navigationpaneModule.previousSelected[0]):e.itemData,Ee(e,En,e.path),e.itemData[0]=e.renamedItem,e.renamedItem=null}else e.itemData=[E(e)],""!==e.breadcrumbbarModule.searchObj.value?ht(e,Kn,e.path,e.searchWord,e.showHiddenItems,!e.searchSettings.ignoreCase):e.isFiltered?Re(e,Kn):Ee(e,Kn,e.path)}}catch(a){t.isNullOrUndefined(e.dialogObj)||e.dialogObj.hide(),ct(e,a,"rename")}}function st(e,i,n,a){try{var s={itemData:i.files,isCopy:"copy"===a,path:n,targetData:e.itemData[0],targetPath:e.path};e.trigger("move",s),i.error&&i.error.fileExists?(e.fileLength=0,t.isNullOrUndefined(i.files)||(e.isPasteError=!0,Z(e,a,i)),ft(e,"DuplicateItems",i.error.fileExists),"404"===i.error.code&&ut(e,"Error",i)):i.error||t.isNullOrUndefined(i.files)?i.error&&!t.isNullOrUndefined(i.files)?(e.isPasteError=!0,Z(e,a,i),ut(e,"Error",i)):lt(e,i,a):(e.isPasteError=!1,Z(e,a,i))}catch(t){ct(e,t,a)}}function rt(e,i,n){try{var a={itemData:i.files,path:n};if(e.trigger("delete",a),t.isNullOrUndefined(i.files))lt(e,i,"delete");else if(e.setProperties({path:n},!0),e.itemData=[E(e)],Ee(e,xn,e.path),i.error)lt(e,i,"delete");else{var s={action:"delete",result:i};e.trigger("success",s)}}catch(t){ct(e,t,"delete")}}function ot(e,i,n,a){try{if(t.isNullOrUndefined(i.details))lt(e,i,"details");else{ut(e,a,null,i.details);var s={action:"details",result:i};e.trigger("success",s)}}catch(t){ct(e,t,"details")}}function lt(e,t,i){ut(e,"Error",t);var n={action:i,error:t.error};e.trigger("failure",n)}function ht(e,t,i,n,a,s){Qe(e,{action:"search",path:i,searchString:n,showHiddenItems:a,caseSensitive:s,data:e.itemData},dt,t)}function dt(e,i,n){try{if(t.isNullOrUndefined(i.files))lt(e,i,"search");else{e.notify(n,i);var a={action:"search",result:i};e.trigger("success",a)}}catch(t){ct(e,t,"search")}}function pt(e,i,n){var a=e.ajaxSettings.downloadUrl?e.ajaxSettings.downloadUrl:e.ajaxSettings.url,s={action:"download",path:i,names:n,data:e.itemData},r={data:s,cancel:!1,useFormPost:!0,ajaxSettings:{url:a,type:"POST",contentType:"application/json",responseType:"blob",data:JSON.stringify(s),onSuccess:null,onFailure:null,beforeSend:null}};e.trigger("beforeDownload",r,function(i){if(!i.cancel)if(i.useFormPost){var n=t.createElement("form",{id:e.element.id+"_downloadForm",attrs:{action:a,method:"post",name:"downloadForm",download:""}}),s=t.createElement("input",{id:e.element.id+"_hiddenForm",attrs:{name:"downloadInput",value:JSON.stringify(i.data),type:"hidden"}});n.appendChild(s),e.element.appendChild(n),document.forms.namedItem("downloadForm").submit(),e.element.removeChild(n)}else try{var r,o;new t.Fetch({url:t.getValue("url",i.ajaxSettings),type:t.getValue("type",i.ajaxSettings),contentType:t.getValue("contentType",i.ajaxSettings),responseType:t.getValue("responseType",i.ajaxSettings),beforeSend:t.getValue("beforeSend",i.ajaxSettings),onLoad:function(i){if(r=i.headers.get("Content-Disposition")){var n=r.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/),a=n&&n[1];o=a?a.replace(/['"]/g,""):o}else o=e.itemData.length>1?"files.zip":t.getValue("isFile",e.itemData[0])?t.getValue("name",e.itemData[0]):t.getValue("name",e.itemData[0])+".zip"},onSuccess:function(t){e.trigger("success",i);var n=t,a=URL.createObjectURL(n),s=document.createElement("a");s.href=a,s.download=o,document.body.appendChild(s),s.click(),document.body.removeChild(s)},onFailure:function(t){var n={error:{code:t.status.toString(),message:B(e,"Network-Error")+" "+e.ajaxSettings.downloadUrl}};ut(e,"Error",n),e.trigger("failure",i)}}).send(JSON.stringify(i.data))}catch(t){ct(e,t,"download")}})}function ct(e,t,i){lt(e,{files:null,error:{message:t.message,fileExists:null}},i)}function ut(e,i,a,s){var r=Pt(e,i,a,s);t.isNullOrUndefined(e.dialogObj)?(e.dialogObj=new n.Dialog({beforeOpen:Rt.bind(this,e,r.dialogName),beforeClose:function(t){mt(e,e.dialogObj,t,r.dialogName)},header:r.header,content:r.content,buttons:r.buttons,animationSettings:{effect:"None"},showCloseIcon:!0,closeOnEscape:!0,visible:!0,allowDragging:!0,isModal:!0,target:e.popupTarget?e.popupTarget:"#"+e.element.id,cssClass:z(e,e.isMobile?ki:Mi),width:"350px",open:r.open,close:r.close,enableRtl:e.enableRtl,enableHtmlSanitizer:e.enableHtmlSanitizer,locale:e.locale}),e.dialogObj.isStringTemplate=!0,e.dialogObj.appendTo("#"+e.element.id+Si)):Lt(e,r)}function ft(e,i,a,s){var r=yt(e,i,a,s);e.isApplySame=!1,t.isNullOrUndefined(e.extDialogObj)?(e.extDialogObj=new n.Dialog({beforeOpen:Mt.bind(this,e,r.dialogName),beforeClose:function(t){mt(e,e.extDialogObj,t,r.dialogName)},content:r.content,header:r.header,closeOnEscape:!0,allowDragging:!0,animationSettings:{effect:"None"},target:e.popupTarget?e.popupTarget:"#"+e.element.id,cssClass:z(e,e.isMobile?ki:Mi),enableRtl:e.enableRtl,showCloseIcon:!0,isModal:!0,width:350,buttons:r.buttons,open:r.open,close:r.close,enableHtmlSanitizer:e.enableHtmlSanitizer,locale:e.locale}),e.extDialogObj.isStringTemplate=!0,e.extDialogObj.appendTo("#"+e.element.id+xi)):(e.extDialogObj.header=r.header,e.extDialogObj.close=r.close,e.extDialogObj.open=r.open,e.extDialogObj.close=r.close,e.extDialogObj.content=r.content,e.extDialogObj.buttons=r.buttons,e.extDialogObj.enableRtl=e.enableRtl,e.extDialogObj.locale=e.locale,e.extDialogObj.beforeOpen=Mt.bind(this,e,r.dialogName),e.extDialogObj.beforeClose=function(t){mt(e,e.extDialogObj,t,r.dialogName)},e.extDialogObj.dataBind(),e.extDialogObj.show())}function gt(e,t,i,n){var a={cancel:i.cancel,popupName:n,popupModule:t};e.trigger("beforePopupOpen",a,function(e){i.cancel=e.cancel})}function mt(e,t,i,n){var a={cancel:i.cancel,popupModule:t,popupName:n};e.trigger("beforePopupClose",a,function(t){i.cancel=t.cancel,i.cancel||!i.isInteracted||"Rename"!==n&&"Create Folder"!==n||e.trigger(Ln,{})})}function bt(e,t,i){var n={popupModule:t,element:t.element,popupName:i};e.trigger("popupOpen",n)}function vt(e,t,i){var n={popupModule:t,element:t.element,popupName:i};e.trigger("popupClose",n)}function yt(e,t,i,n){var a,s,r,o={header:"",content:"",buttons:[],dialogName:""};switch(o.open=function(){bt(e,e.extDialogObj,o.dialogName)},o.close=function(){vt(e,e.extDialogObj,o.dialogName)},t){case"Extension":o.header=B(e,"Header-Rename-Confirmation"),o.content="<div>"+B(e,"Content-Rename-Confirmation")+"</div>",o.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Yes")},click:function(){e.extDialogObj.hide(),Me(e,n,e.renameText)}},{buttonModel:{content:B(e,"Button-No")},click:function(){e.extDialogObj.hide(),e.dialogObj.hide()}}],o.dialogName="Extension Change";break;case"DuplicateItems":o.dialogName="Duplicate Items",e.replaceItems=i,s=-1===(r=(s=e.replaceItems[e.fileLength]).lastIndexOf("/"))?s:s.substring(r),o.header=B(e,"Header-Duplicate"),a="<div>"+B(e,"Content-Duplicate")+"</div>",o.content=a.replace("{0}",s),o.close=function(){if(!e.isDropEnd&&0===e.duplicateItems.length){var t={fileDetails:e.droppedObjects};e.trigger("fileDropped",t),e.isDropEnd=e.isDragDrop=!1}vt(e,e.extDialogObj,o.dialogName)},o.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Yes")},click:function(){if(e.duplicateItems.push(e.replaceItems[e.fileLength]),e.duplicateRecords.push(te(e,e.replaceItems[e.fileLength])),e.fileLength++,i[e.fileLength]){var t=e.replaceItems[e.fileLength],n=t.lastIndexOf("/");t=-1===n?t:t.substring(n),e.extDialogObj.content=a.replace("{0}",t),e.extDialogObj.show()}else{e.extDialogObj.hide();var s=e.isDragDrop?e.dragPath:e.targetPath,r=e.isDragDrop?e.dropPath:""===e.folderPath?e.path:e.folderPath,o=e.isDragDrop?"move":e.fileAction;ke(e,s,e.duplicateItems,r,o,e.duplicateItems,e.duplicateRecords)}}},{buttonModel:{content:B(e,"Button-No")},click:function(){if(e.fileLength++,i[e.fileLength]){var t=e.replaceItems[e.fileLength],n=t.lastIndexOf("/");t=-1===n?t:t.substring(n),e.extDialogObj.content=a.replace("{0}",t),e.extDialogObj.show()}else if(e.extDialogObj.hide(),0!==e.duplicateItems.length){var s=e.isDragDrop?"move":e.fileAction,r=e.isDragDrop?e.dragPath:e.targetPath,o=e.isDragDrop?e.dropPath:""===e.folderPath?e.path:e.folderPath;ke(e,r,e.duplicateItems,o,s,e.duplicateItems,e.duplicateRecords)}}}];break;case"UploadRetry":o.dialogName="Retry Upload",o.header=B(e,"Header-Retry"),o.content=e.retryFiles[0].name+'<div class="e-fe-retrycontent">'+B(e,"Content-Retry")+"</div>",o.open=wt.bind(this,e),o.close=function(){e.isRetryOpened=!1,Ot(e),vt(e,e.extDialogObj,o.dialogName)},o.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Keep-Both")},click:function(){It(e,!0)}},{buttonModel:{isPrimary:!0,content:B(e,"Button-Replace")},click:function(){It(e,!1)}},{buttonModel:{isPrimary:!0,content:B(e,"Button-Skip")},click:function(){var t=0;e.isApplySame?(t=e.retryFiles.length,e.retryFiles=[],Ot(e)):(t=1,e.retryFiles.splice(0,1),0!==e.retryFiles.length?ft(e,"UploadRetry"):Ot(e)),e.notify(Mn,{count:t})}}]}return o}function It(e,t){e.isApplySame?(t?Dt(e):St(e),Ot(e)):(e.retryArgs.push({action:t?"keepboth":"replace",file:e.retryFiles[0]}),e.uploadObj.retry(e.retryFiles[0]),e.retryFiles.splice(0,1),0!==e.retryFiles.length?ft(e,"UploadRetry"):Ot(e))}function Ot(e){var i=!0;e.isRetryOpened?e.isRetryOpened=!1:i=!1;var n=t.select(".e-dlg-checkbox",e.extDialogObj.element);n&&t.remove(n),i?e.extDialogObj.hide():e.retryFiles=[]}function wt(e,i){e.isRetryOpened=!0;var n=t.getValue("element",i),a=t.select(".e-dlg-content",n),s=e.createElement("div",{className:"e-dlg-checkbox"}),r=e.createElement("input",{id:e.element.id+"_applyall"});s.appendChild(r),a.appendChild(s),new o.CheckBox({label:B(e,"ApplyAll-Label"),change:function(t){e.isApplySame=t.checked}}).appendTo("#"+e.element.id+"_applyall"),bt(e,e.extDialogObj,"Retry Upload")}function Dt(e){for(;0!==e.retryFiles.length;)e.retryArgs.push({action:"keepboth",file:e.retryFiles[0]}),e.uploadObj.retry(e.retryFiles[0]),e.retryFiles.splice(0,1)}function St(e){for(;0!==e.retryFiles.length;)e.retryArgs.push({action:"replace",file:e.retryFiles[0]}),e.uploadObj.retry(e.retryFiles[0]),e.retryFiles.splice(0,1)}function Ct(e){var i=t.select("#newname",e.dialogObj.element);i.focus(),i.value="";var n=i.value.length;i.setSelectionRange(0,n)}function xt(e){var i=t.select("#newname",e.dialogObj.element);i.parentElement.classList.contains("e-control-wrapper")||Et(i,B(e,"Content-NewFolder")),i.parentElement.nextElementSibling.innerHTML="",i.oninput=function(){Ut(e,i)},i.onkeyup=function(t){13===Ht(t)&&Tt(e)},Ct(e),bt(e,e.dialogObj,"Create Folder")}function jt(e){var i=t.select("#rename",e.dialogObj.element);i.parentElement.classList.contains("e-control-wrapper")||Et(i,B(e,"Content-Rename")),i.parentElement.nextElementSibling.innerHTML="",i.oninput=function(){Ut(e,i)},i.onkeyup=function(t){13===Ht(t)&&At(e)},Nt(e,i),bt(e,e.dialogObj,"Rename")}function Nt(e,t){t.focus();var i="";if(e.isFile&&!e.showFileExtension){var n=e.currentItemText.lastIndexOf(".");i=-1===n?e.currentItemText:e.currentItemText.substring(0,n)}else i=e.currentItemText;t.value=i,e.isFile&&e.showFileExtension&&-1!==t.value.indexOf(".")?t.setSelectionRange(0,t.value.lastIndexOf(".")):t.setSelectionRange(0,t.value.length)}function Et(e,t){r.Input.createInput({element:e,properties:{placeholder:t}})}function Pt(e,i,n,a){var s,r,o,l,h,d={header:"",content:"",buttons:[],dialogName:""};d.open=function(){bt(e,e.dialogObj,d.dialogName)},d.close=function(){vt(e,e.dialogObj,d.dialogName)};var p;switch(i=a&&!0===a.multipleFiles?"MultipleFileDetails":i){case"NewFolder":d.dialogName="Create Folder",d.header=B(e,"Header-NewFolder"),d.content='<input type="text" value="New folder" id="newname"><div class="e-fe-error"></div>',d.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Create")},click:function(t){"keydown"!==t.type&&Tt(e)}}],d.open=xt.bind(this,e);break;case"Delete":d.dialogName="Delete",e.selectedItems.length>1?(d.content=("<div>"+B(e,"Content-Multiple-Delete")+"</div>").replace("{0}",e.selectedItems.length.toString()),d.header=B(e,"Header-Multiple-Delete")):(d.content="<div>"+B(e,e.isFile?"Content-Delete":"Content-Folder-Delete")+"</div>",d.header=B(e,e.isFile?"Header-Delete":"Header-Folder-Delete")),d.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Yes")},click:function(){Ft(e)}},{buttonModel:{content:B(e,"Button-No")},click:function(){e.dialogObj.hide()}}];break;case"Rename":d.dialogName="Rename",d.header=B(e,"Header-Rename"),d.content='<input type="text" class="e-input" id="rename"><div class="e-fe-error"></div>',d.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Save")},click:function(t){"keydown"!==t.type&&At(e)}}],d.open=jt.bind(this,e);break;case"details":d.dialogName="File Details",r=new t.Internationalization(e.locale).formatDate(new Date(a.modified),{format:"MMMM dd, yyyy HH:mm:ss"}),s="",t.isNullOrUndefined(a.permission)||(s="<tr><td>"+B(e,"Permission")+'</td><td class="'+vn+'" >'+de(a.permission)+"</td></tr>"),d.header=a.name,d.content="<table><tr><td>"+B(e,"Type")+'</td><td class="'+vn+'" title="'+(a.isFile?"File":"Folder")+'">'+(a.isFile?"File":"Folder")+"</td></tr><tr><td>"+B(e,"Size")+'</td><td><span class="'+vn+'" title ="'+a.size+'">'+a.size+"</span></td></tr><tr><td>"+B(e,"Location")+'</td><td class="'+vn+'" title="'+a.location+'">'+a.location+"</td></tr><tr><td>"+B(e,"Modified")+'</td><td class="'+vn+'" >'+r+"</td></tr>"+s+"</table>",d.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Ok")},click:function(){e.dialogObj.hide()}}];break;case"MultipleFileDetails":d.dialogName="File Details",void 0===(o=e.itemData.map(function(e){return p=e.name.indexOf(".")+1,0!==p||e.isFile?0!==p?e.name.substr(p).replace(" ",""):"undetermined":"Folder"}))[0]&&(o=a.name.split(",").map(function(e){return p=e.indexOf(".")+1,0===p?"Folder":e.substr(p).replace(" ","")})),l=o.every(function(e,t,i){return e===i[0]})?"Folder"===o[0]?"Folder":o[0].toLocaleUpperCase()+" Type":"Multiple Types",h=a.location,d.header=a.name,d.content="<table><tr><td>"+B(e,"Type")+':</td><td class="'+vn+'">'+l+"</td></tr><tr><td>"+B(e,"Size")+":</td><td>"+a.size+'<span class="'+vn+'" title ="'+a.size+'"></span></td></tr><tr><td>'+B(e,"Location")+':</td><td class="'+vn+'" title="'+h+'">'+h+"</td></tr></table>",d.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Ok")},click:function(t){"keydown"!==t.type&&e.dialogObj.hide()}}];break;case"Error":e.notify(Ln,{}),d.dialogName="Error","401"===n.error.code?d.header='<span class="e-fe-icon e-fe-access-error"></span><div class="e-fe-access-header">'+B(e,"Access-Denied")+"</div>":d.header=B(e,"Error"),d.content='<div class="'+gn+'">'+n.error.message+"</div>",d.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Ok")},click:function(){e.dialogObj.hide()}}]}return d}function Rt(e,i,n){kt(t.selectAll(".e-btn",e.dialogObj.element)),gt(e,e.dialogObj,n,i)}function Mt(e,i,n){kt(t.selectAll(".e-btn",e.extDialogObj.element)),gt(e,e.extDialogObj,n,i)}function kt(e){for(var t=0;t<e.length;t++)!function(t){e[t].onkeydown=function(e){13===e.keyCode&&e.preventDefault()},e[t].onkeyup=function(i){13===i.keyCode&&e[t].click()}}(t)}function Lt(e,t){e.dialogObj.header=t.header,e.dialogObj.content=t.content,e.dialogObj.buttons=t.buttons,e.dialogObj.enableRtl=e.enableRtl,e.dialogObj.open=t.open,e.dialogObj.close=t.close,e.dialogObj.beforeOpen=Rt.bind(this,e,t.dialogName),e.dialogObj.beforeClose=function(i){mt(e,e.dialogObj,i,t.dialogName)},e.dialogObj.dataBind(),e.dialogObj.show()}function Tt(e){var i=t.select("#newname",e.dialogObj.element);Vt(e,i),""===i.parentElement.nextElementSibling.innerHTML&&Pe(e,i.value)}function At(e){var i=t.select("#rename",e.dialogObj.element);if(Vt(e,i),""===i.parentElement.nextElementSibling.innerHTML){var n=i.value,a=e.currentItemText.lastIndexOf(".");if(e.isFile&&!e.showFileExtension&&(n+=-1===a?"":e.currentItemText.substr(a)),e.renameText=n,e.currentItemText===n)return void e.dialogObj.hide();var s="";if(s="navigationpane"===e.activeModule?je(e,e.itemData[0]):e.path,e.renamedId=t.getValue("id",e.itemData[0]),e.isFile){var r=-1===a?"":e.currentItemText.substr(a),o=n.lastIndexOf("."),l=-1===o?"":n.substr(o);e.showFileExtension&&r!==l?ft(e,"Extension",null,s):Me(e,s,n)}else Me(e,s,n)}}function Ft(e){e.dialogObj.hide(),e.notify(Cn,{})}function Ut(e,t){/[/\\|*?"<>:]/.test(t.value)?_t(e,t):""===t.value?t.parentElement.nextElementSibling.innerHTML=B(e,"Validation-Empty"):t.parentElement.nextElementSibling.innerHTML=""}function Vt(e,t){Ut(e,t);var i=t.value.length-1;""===t.value||t.value.lastIndexOf(".")!==i&&t.value.lastIndexOf(" ")!==i||!e.showFileExtension&&-1!==t.value.lastIndexOf(".")&&0!==t.value.substring(t.value.indexOf(".")+1).length||_t(e,t)}function _t(e,t){var i=B(e,"Validation-Invalid").replace("{0}",'"'+t.value+'"');e.enableHtmlSanitizer?t.parentElement.nextElementSibling.textContent=i:t.parentElement.nextElementSibling.innerHTML=i}function Ht(e){return e.keyCode?e.keyCode:e.which?e.which:e.charCode}function Bt(e,i,a){var s=t.createElement("div",{className:"e-image-wrap"}),r=t.createElement("img",{className:"e-image",attrs:{src:a,alt:i}});s.appendChild(r),t.isNullOrUndefined(e.viewerObj)?(e.viewerObj=new n.Dialog({header:i,content:s,animationSettings:{effect:"None"},showCloseIcon:!0,closeOnEscape:!0,visible:!0,isModal:!0,width:"350px",height:"350px",target:e.popupTarget?e.popupTarget:"#"+e.element.id,cssClass:z(e,e.isMobile?ki:Mi),locale:e.locale,enableResize:!0,allowDragging:!0,enableHtmlSanitizer:e.enableHtmlSanitizer,position:{X:"center",Y:"center"},enableRtl:e.enableRtl,open:zt.bind(this,e),close:function(){vt(e,e.viewerObj,"Image Preview")},beforeOpen:function(t){gt(e,e.viewerObj,t,"Image Preview")},beforeClose:function(t){mt(e,e.viewerObj,t,"Image Preview")},resizing:qt.bind(this,e),resizeStop:qt.bind(this,e)}),e.viewerObj.isStringTemplate=!0,e.viewerObj.appendTo("#"+e.element.id+Ci)):(e.viewerObj.refresh(),e.viewerObj.header=i,e.viewerObj.content=s,e.viewerObj.enableRtl=e.enableRtl,e.viewerObj.dataBind(),e.viewerObj.show())}function zt(e){setTimeout(function(){e.viewerObj&&e.viewerObj.element.focus()}),qt(e),bt(e,e.viewerObj,"Image Preview")}function qt(e){var i=t.select(".e-dlg-content",e.viewerObj.element),n=t.select(".e-image-wrap",e.viewerObj.element),a=window.getComputedStyle(i,null),s=a?2*parseFloat(a.paddingRight):36,r=a?2*parseFloat(a.paddingBottom):20;n.style.width=i.offsetWidth-s+"px",n.style.height=i.offsetHeight-r+"px"}var Wt=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Kt=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Yt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Wt(i,e),Kt([t.Property(null)],i.prototype,"downloadUrl",void 0),Kt([t.Property(null)],i.prototype,"getImageUrl",void 0),Kt([t.Property(null)],i.prototype,"uploadUrl",void 0),Kt([t.Property(null)],i.prototype,"url",void 0),i}(t.ChildProperty),Gt=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Jt=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Qt=["NewFolder","Upload","Cut","Copy","Paste","Delete","Download","Rename","SortBy","Refresh","Selection","View","Details"],Xt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Gt(i,e),Jt([t.Property(Qt)],i.prototype,"items",void 0),Jt([t.Property(!0)],i.prototype,"visible",void 0),i}(t.ChildProperty),$t=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Gt(i,e),Jt([t.Property("")],i.prototype,"id",void 0),Jt([t.Property("")],i.prototype,"text",void 0),Jt([t.Property("auto")],i.prototype,"width",void 0),Jt([t.Property("")],i.prototype,"cssClass",void 0),Jt([t.Property(!1)],i.prototype,"showAlwaysInPopup",void 0),Jt([t.Property(!1)],i.prototype,"disabled",void 0),Jt([t.Property("")],i.prototype,"prefixIcon",void 0),Jt([t.Property("")],i.prototype,"suffixIcon",void 0),Jt([t.Property(!0)],i.prototype,"visible",void 0),Jt([t.Property("None")],i.prototype,"overflow",void 0),Jt([t.Property("")],i.prototype,"template",void 0),Jt([t.Property("Button")],i.prototype,"type",void 0),Jt([t.Property("Both")],i.prototype,"showTextOn",void 0),Jt([t.Property(null)],i.prototype,"htmlAttributes",void 0),Jt([t.Property("")],i.prototype,"tooltipText",void 0),Jt([t.Property("Left")],i.prototype,"align",void 0),Jt([t.Property(-1)],i.prototype,"tabIndex",void 0),Jt([t.Property()],i.prototype,"name",void 0),i}(t.ChildProperty),Zt=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ei=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},ti=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Zt(i,e),ei([t.Property(!0)],i.prototype,"allowSearchOnTyping",void 0),ei([t.Property("contains")],i.prototype,"filterType",void 0),ei([t.Property(!0)],i.prototype,"ignoreCase",void 0),ei([t.Property(null)],i.prototype,"placeholder",void 0),i}(t.ChildProperty),ii=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ni=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},ai=[{field:"name",headerText:"Name",minWidth:120,template:'<span class="e-fe-text">${name}</span>',customAttributes:{class:"e-fe-grid-name"}},{field:"_fm_modified",headerText:"DateModified",type:"dateTime",format:"MMMM dd, yyyy HH:mm",minWidth:120,width:"190"},{field:"size",headerText:"Size",minWidth:90,width:"110",template:t.initializeCSPTemplate(function(e){return'<span class="e-fe-size">'+e.size+"</span>"}),format:"n2"}],si=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ii(i,e),ni([t.Property(!0)],i.prototype,"columnResizing",void 0),ni([t.Property(ai)],i.prototype,"columns",void 0),i}(t.ChildProperty),ri=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),oi=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},li=["Open","|","Cut","Copy","|","Delete","Download","Rename","|","Details"],hi=["Open","|","Cut","Copy","Paste","|","Delete","Rename","Download","|","Details"],di=["SortBy","View","Refresh","|","Paste","|","NewFolder","Upload","|","Details","|","SelectAll"],pi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ri(i,e),oi([t.Property(li)],i.prototype,"file",void 0),oi([t.Property(hi)],i.prototype,"folder",void 0),oi([t.Property(di)],i.prototype,"layout",void 0),oi([t.Property(!0)],i.prototype,"visible",void 0),i}(t.ChildProperty),ci=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ui=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},fi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ci(i,e),ui([t.Property("650px")],i.prototype,"maxWidth",void 0),ui([t.Property("240px")],i.prototype,"minWidth",void 0),ui([t.Property(!0)],i.prototype,"visible",void 0),ui([t.Property("None")],i.prototype,"sortOrder",void 0),i}(t.ChildProperty),gi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),mi=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},bi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return gi(i,e),mi([t.Property("")],i.prototype,"allowedExtensions",void 0),mi([t.Property(!0)],i.prototype,"autoUpload",void 0),mi([t.Property(!1)],i.prototype,"autoClose",void 0),mi([t.Property(!1)],i.prototype,"directoryUpload",void 0),mi([t.Property(0)],i.prototype,"minFileSize",void 0),mi([t.Property(3e7)],i.prototype,"maxFileSize",void 0),mi([t.Property(0)],i.prototype,"chunkSize",void 0),i}(t.ChildProperty),vi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),yi=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Ii=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return vi(i,e),yi([t.Property("")],i.prototype,"field",void 0),yi([t.Property("")],i.prototype,"headerText",void 0),yi([t.Property("")],i.prototype,"width",void 0),yi([t.Property("")],i.prototype,"minWidth",void 0),yi([t.Property("")],i.prototype,"maxWidth",void 0),yi([t.Property("Left")],i.prototype,"textAlign",void 0),yi([t.Property(null)],i.prototype,"headerTextAlign",void 0),yi([t.Property(null)],i.prototype,"type",void 0),yi([t.Property(null)],i.prototype,"format",void 0),yi([t.Property(null)],i.prototype,"template",void 0),yi([t.Property(null)],i.prototype,"sortComparer",void 0),yi([t.Property(null)],i.prototype,"headerTemplate",void 0),yi([t.Property(!0)],i.prototype,"allowSorting",void 0),yi([t.Property(!0)],i.prototype,"allowResizing",void 0),yi([t.Property(null)],i.prototype,"customAttributes",void 0),yi([t.Property("")],i.prototype,"hideAtMedia",void 0),yi([t.Property(null)],i.prototype,"customFormat",void 0),yi([t.Property(!1)],i.prototype,"isPrimaryKey",void 0),i}(t.ChildProperty),Oi="_layout",wi="_grid",Di="_largeicons",Si="_dialog",Ci="_img_dialog",xi="_extn_dialog",ji="_content",Ni="_breadcrumbbar",Ei="_upload",Pi="e-filemanager",Ri="e-control",Mi="e-fe-popup",ki="e-fe-popup e-fe-mobile",Li="e-fe-m-filter",Ti="e-large-icons",Ai="e-list-item",Fi="e-list-text",Ui="e-icons e-fe-tick",Vi="e-icons e-fe-dot",_i="e-blur",Hi="e-active",Bi="e-hover",zi="e-focus",qi="e-focused",Wi="e-check",Ki="e-checkbox-wrapper",Yi="e-row",Gi="e-empty",Ji="e-empty-content",Qi="e-empty-inner-content",Xi="e-fe-clone",$i="e-fe-drop-folder",Zi="e-fe-drop-file",en="e-fe-folder",tn="e-fe-image",nn="e-fe-music",an="e-fe-video",sn="e-large-icon",rn="e-empty-icon e-fe-folder",on="e-gridheader",ln="e-treeview",hn="e-menu-icon",dn="e-content",pn="e-gridcontent",cn="e-icons e-fe-cut",un="e-icons e-fe-grid",fn="e-icons e-fe-large",gn="e-fe-errorcontent",mn="e-rtl",bn="e-display-none",vn="e-fe-value",yn="isFile",In="model-changed",On="initial-end",wn="finalize-end",Dn="create-end",Sn="path-drag",Cn="delete-init",xn="delete-end",jn="refresh-end",Nn="resize-end",En="path-changed",Pn="destroy",Rn="before-request",Mn="skip-upload",kn="after-request",Ln="actionFailure",Tn="search",An="open-init",Fn="open-end",Un="selection-changed",Vn="clear-path-init",_n="layout-change",Hn="sort-by-change",Bn="details-init",zn="menu-item-data",qn="rename-init",Wn="rename-end-parent",Kn="rename-end",Yn="show-paste",Gn="hide-paste",Jn="cut-copy-init",Qn="paste-init",Xn="paste-end",$n="cut-end",Zn="sort-column",ea="path-column",ta="search-change",ia="drop-init",na="drag-end",aa="drop-path",sa="dragging",ra="method-call",oa="read",la="write",ha="writeContents",da="upload",pa="download",ca=function(){function e(e){this.isInteraction=!0,this.uploadOperation=!1,this.count=0,this.isRendered=!0,this.tapCount=0,this.isSelectAllCalled=!1,this.isPasteOperation=!1,this.isInteracted=!0,this.parent=e,this.element=t.select("#"+this.parent.element.id+Di,this.parent.element),t.addClass([this.element],Ti),this.addEventListener(),this.keyConfigs={end:"end",home:"home",tab:"tab",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",ctrlEnd:"ctrl+end",ctrlHome:"ctrl+home",ctrlDown:"ctrl+downarrow",ctrlLeft:"ctrl+leftarrow",ctrlRight:"ctrl+rightarrow",ctrlUp:"ctrl+uparrow",shiftEnd:"shift+end",shiftHome:"shift+home",shiftDown:"shift+downarrow",shiftLeft:"shift+leftarrow",shiftRight:"shift+rightarrow",shiftUp:"shift+uparrow",csEnd:"ctrl+shift+end",csHome:"ctrl+shift+home",csDown:"ctrl+shift+downarrow",csLeft:"ctrl+shift+leftarrow",csRight:"ctrl+shift+rightarrow",csUp:"ctrl+shift+uparrow",space:"space",ctrlSpace:"ctrl+space",shiftSpace:"shift+space",csSpace:"ctrl+shift+space",ctrlA:"ctrl+a",enter:"enter",altEnter:"alt+enter",esc:"escape",del:"delete",ctrlX:this.parent.isMac?"cmd+x":"ctrl+x",ctrlC:this.parent.isMac?"cmd+c":"ctrl+c",ctrlV:this.parent.isMac?"cmd+v":"ctrl+v",f2:"f2",shiftdel:"shift+delete",back:"backspace",ctrlD:"ctrl+d"}}return e.prototype.render=function(e){if(this.parent.visitedItem=null,this.startItem=null,n.showSpinner(this.parent.element),"LargeIcons"===this.parent.view){this.resetMultiSelect(),this.element.setAttribute("tabindex","0"),this.listObj&&(this.unWireEvents(),this.removeEventListener()),this.parent.notify("hide-layout",{});var i=t.select("#"+this.parent.element.id+Di,this.parent.element),s=t.select("ul",i);if(s&&t.remove(s),this.listObj={ariaAttributes:{itemRole:"option",listRole:"listbox",itemText:"",groupItemRole:"group",wrapperRole:""},showIcon:!0,fields:{text:"name",iconCss:"_fm_icon",imageUrl:"_fm_imageUrl",htmlAttributes:"_fm_htmlAttr"},sortOrder:this.parent.sortOrder,itemCreated:this.onItemCreated.bind(this),enableHtmlSanitizer:this.parent.enableHtmlSanitizer},this.items=[],this.items=this.renderList(e),this.parent.sortComparer&&"None"!==this.parent.sortBy?this.items=this.allItems=a.DataUtil.sort(this.items,this.parent.sortBy,this.comparer.bind(this)):this.items=this.allItems=A(this.parent,this.items),i.classList.remove(bn),this.parent.enableVirtualization&&this.allItems.length>0&&!t.isNullOrUndefined(this.parent.virtualizationModule)&&this.parent.virtualizationModule.setUIVirtualization(),this.listElements=l.ListBase.createListFromJson(t.createElement,this.items,this.listObj),this.itemList=Array.prototype.slice.call(t.selectAll("."+Ai,this.listElements)),this.element.appendChild(this.listElements),this.listElements.setAttribute("aria-label","listbox"),this.preventImgDrag(),this.createDragObj(),0===this.itemList.length){var r=this.element.querySelector(".e-list-parent");this.element.removeChild(r),U(this.parent,this.element,e)}else 0!==this.itemList.length&&this.element.querySelector("."+Gi)&&this.element.removeChild(this.element.querySelector("."+Gi));!0===this.isPasteOperation&&(this.selectItems(this.parent.pasteNodes),this.isPasteOperation=!1),!0===this.uploadOperation&&(this.selectItems(this.parent.uploadItem),this.parent.setProperties({selectedItems:[]},!0),++this.count===this.parent.uploadItem.length&&(this.uploadOperation=!1,this.parent.uploadItem=[]));var o=this.element.querySelectorAll("."+Hi);0!==o.length&&(this.parent.activeModule="largeiconsview");for(var h=0;h<o.length;h++)o[h].setAttribute("aria-selected","true");this.element.style.maxHeight="100%",this.getItemCount(),this.addEventListener(),this.wireEvents(),this.parent.enableVirtualization&&this.allItems.length>0&&!t.isNullOrUndefined(this.parent.virtualizationModule)&&(this.parent.virtualizationModule.setUlElementHeight(),this.parent.virtualizationModule.wireScrollEvent(!1)),this.isRendered=!0,n.hideSpinner(this.parent.element),this.parent.selectedItems.length&&this.checkItem()}},e.prototype.comparer=function(e,t){if("Descending"===this.parent.sortOrder){var i=e;e=t,t=i}return this.parent.sortComparer(e,t)},e.prototype.preventImgDrag=function(){for(var e=0;e<this.itemList.length;)this.itemList[e].querySelector("img")&&(this.itemList[e].ondragstart=function(){return!1}),e++},e.prototype.createDragObj=function(){var e=this;this.listObj&&(this.parent.allowDragAndDrop?(this.dragObj&&this.dragObj.destroy(),this.dragObj=new t.Draggable(this.listElements,{enableTailMode:!0,distance:5,enableAutoScroll:!1,dragTarget:"."+sn,helper:this.dragHelper.bind(this),cursorAt:this.parent.dragCursorPosition,dragArea:this.parent.element,dragStop:ne.bind(this,this.parent),drag:he.bind(this,this.parent),clone:!0,dragStart:function(t){ae(e.parent,t,e.dragObj)}})):this.dragObj&&!this.parent.allowDragAndDrop&&this.dragObj.destroy())},e.prototype.dragHelper=function(e){var i=e.sender.target,n=t.closest(i,".e-list-item");if(!n)return null;n&&!n.classList.contains("e-active")&&this.setFocus(n);var a=this.element.querySelectorAll("."+Hi);this.parent.activeElements=[],this.parent.dragData=[];for(var s=0;s<a.length;s++)this.parent.dragData.push(this.getItemObject(a[parseInt(s.toString(),10)])),this.parent.activeElements.push(a[s]);return w(this.parent,n),this.parent.dragPath=this.parent.path,ie(this.parent),this.parent.virtualDragElement},e.prototype.onDropInit=function(e){if(this.parent.targetModule===this.getModuleName()){var i=t.closest(e.target,".e-list-item"),n=t.getValue(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent);if(i){var a=this.getItemObject(i);this.parent.dropPath=a.isFile?this.parent.path:L(this.parent,a,this.parent.path),this.parent.dropData=a.isFile?n:a}else this.parent.dropPath=this.parent.path,this.parent.dropData=n}},e.prototype.getModuleName=function(){return"largeiconsview"},e.prototype.onItemCreated=function(e){if(e.item.removeAttribute("aria-level"),!this.parent.showFileExtension&&t.getValue("isFile",e.curData)){var i=e.item.querySelector("."+Fi),n=t.getValue("name",e.curData),a=t.getValue("type",e.curData);-1!==n.indexOf(a)&&(i.innerHTML=n.substr(0,n.length-a.length))}this.renderCheckbox(e);var s={element:e.item,fileDetails:e.curData,module:"LargeIconsView"};this.parent.trigger("fileLoad",s)},e.prototype.renderCheckbox=function(e){if(this.parent.showItemCheckBoxes){var i=o.createCheckBox(t.createElement,!1,{checked:!1,cssClass:"e-small"});i.setAttribute("role","checkbox"),i.setAttribute("aria-checked","false"),i.setAttribute("aria-label","checkbox"),e.item.firstElementChild.insertBefore(i,e.item.firstElementChild.childNodes[0])}},e.prototype.onLayoutChange=function(e){if("LargeIcons"===this.parent.view){if(this.destroy(),this.parent.enableVirtualization&&this.parent.setProperties({selectedItems:[]},!0),this.render(e),"layout-change"===t.getValue("name",e)&&"move"===this.parent.fileAction&&this.parent.isCut&&this.parent.selectedNodes&&0!==this.parent.selectedNodes.length)for(var i=this.getIndexes(this.parent.selectedNodes),n=0;n<i.length;)I(this.itemList[i[n]]),n++;0!==this.element.querySelectorAll("."+Hi).length&&this.element.focus(),this.checkItem(),this.parent.isLayoutChange=!1}else this.element.setAttribute("tabindex","-1")},e.prototype.checkItem=function(){var e=this.element.querySelectorAll("."+Hi);if(e)for(var t=0;t<e.length;)this.checkState(e[t],!0),t++},e.prototype.renderList=function(e){for(var i=0,n=JSON.parse(JSON.stringify(e.files));i<n.length;){var a=M(n[i]),s=t.getValue("name",n[i]),r=pe(this.parent,n[i]),o=this.parent.selectedItems&&-1!==this.parent.selectedItems.indexOf(r)?sn+" e-active":sn;if(Ie(n[i])||(o+=" "+ve(n[i])),a===tn&&this.parent.showThumbnail&&ye(n[i])){var l=k(this.parent,n[i]);t.setValue("_fm_imageUrl",l,n[i]),t.setValue("_fm_imageAttr",{alt:s},n[i])}else t.setValue("_fm_icon",a,n[i]);t.setValue("_fm_htmlAttr",{class:o,title:s},n[i]),i++}return n},e.prototype.onFinalizeEnd=function(e){this.render(e)},e.prototype.onCreateEnd=function(e){"LargeIcons"===this.parent.view&&(this.onLayoutChange(e),this.clearSelect(),this.selectItems([t.getValue(this.parent.hasId?"id":"name",this.parent.createdItem)]),this.parent.createdItem=null,this.parent.largeiconsviewModule.element.focus(),this.parent.activeModule="largeiconsview")},e.prototype.onSelectedData=function(){"largeiconsview"===this.parent.activeModule&&this.updateSelectedData()},e.prototype.onDeleteInit=function(){"largeiconsview"===this.parent.activeModule&&Le(this.parent,this.parent.selectedItems,this.parent.path,"delete")},e.prototype.onDeleteEnd=function(e){"LargeIcons"===this.parent.view&&(this.onLayoutChange(e),this.parent.setProperties({selectedItems:[]},!0),this.clearSelect())},e.prototype.onRefreshEnd=function(e){"LargeIcons"===this.parent.view&&this.onLayoutChange(e)},e.prototype.onRenameInit=function(){"largeiconsview"===this.parent.activeModule&&1===this.parent.selectedItems.length&&this.updateRenameData()},e.prototype.onPathChanged=function(e){this.parent.isCut=!1,""===this.parent.breadcrumbbarModule.searchObj.element.value&&(this.parent.searchedItems=[]),"LargeIcons"===this.parent.view&&(O(this.parent),this.parent.setProperties({selectedItems:[]},!0),this.onLayoutChange(e),this.parent.renamedItem&&"largeiconsview"===this.parent.activeModule&&(this.clearSelect(),this.addSelection(this.parent.renamedItem)))},e.prototype.onOpenInit=function(e){"largeiconsview"===this.parent.activeModule&&this.doOpenAction(e.target)},e.prototype.onHideLayout=function(){"LargeIcons"!==this.parent.view&&this.element&&this.element.classList.add(bn)},e.prototype.onSelectAllInit=function(){if("LargeIcons"===this.parent.view){this.startItem=this.getFirstItem();var e=this.getLastItem(),t={ctrlKey:!0,shiftKey:!0};this.doSelection(e,t),this.isInteraction=!0,this.isInteracted=!0}},e.prototype.onClearAllInit=function(){"LargeIcons"===this.parent.view&&(this.clearSelection(),this.isInteraction=!0,this.isInteracted=!0)},e.prototype.onBeforeRequest=function(){this.isRendered=!1},e.prototype.onAfterRequest=function(){this.isRendered=!0},e.prototype.onSearch=function(e){"LargeIcons"===this.parent.view&&(this.parent.setProperties({selectedItems:[]},!0),this.parent.notify(Un,{}),this.parent.searchedItems=e.files,this.onLayoutChange(e))},e.prototype.onLayoutRefresh=function(){this.parent.view},e.prototype.onUpdateSelectionData=function(){"LargeIcons"===this.parent.view&&this.updateSelectedData()},e.prototype.onPathColumn=function(){"LargeIcons"!==this.parent.view||t.isNullOrUndefined(this.listObj)||""!==this.parent.breadcrumbbarModule.searchObj.element.value||this.parent.isFiltered||"filterPath"!==this.parent.sortBy||(this.parent.sortBy="name",this.parent.notify(Hn,{}))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ea,this.onPathColumn),this.parent.off(wn,this.onFinalizeEnd),this.parent.off(Dn,this.onCreateEnd),this.parent.off("selected-data",this.onSelectedData),this.parent.off(Cn,this.onDeleteInit),this.parent.off(xn,this.onDeleteEnd),this.parent.off(jn,this.onRefreshEnd),this.parent.off(En,this.onPathChanged),this.parent.off(_n,this.onLayoutChange),this.parent.off(Tn,this.onSearch),this.parent.off(An,this.onOpenInit),this.parent.off(Fn,this.onPathChanged),this.parent.off(In,this.onPropertyChanged),this.parent.off(ra,this.onMethodCall),this.parent.off(Ln,this.onActionFailure),this.parent.off(qn,this.onRenameInit),this.parent.off(Kn,this.onPathChanged),this.parent.off("hide-layout",this.onHideLayout),this.parent.off("select-all-init",this.onSelectAllInit),this.parent.off("clear-all-init",this.onClearAllInit),this.parent.off(zn,this.onMenuItemData),this.parent.off(Rn,this.onBeforeRequest),this.parent.off(kn,this.onAfterRequest),this.parent.off("splitter-resize",this.splitterResizeHandler),this.parent.off(Nn,this.resizeHandler),this.parent.off(Qn,this.onpasteInit),this.parent.off(Xn,this.onpasteEnd),this.parent.off(Jn,this.oncutCopyInit),this.parent.off(ia,this.onDropInit),this.parent.off(Bn,this.onDetailsInit),this.parent.off("layout-refresh",this.onLayoutRefresh),this.parent.off(aa,this.onDropPath),this.parent.off("update-selection-data",this.onUpdateSelectionData),this.parent.off("filter-end",this.onPathChanged))},e.prototype.addEventListener=function(){this.parent.on(ea,this.onPathColumn,this),this.parent.on(wn,this.onFinalizeEnd,this),this.parent.on(Dn,this.onCreateEnd,this),this.parent.on(jn,this.onRefreshEnd,this),this.parent.on("selected-data",this.onSelectedData,this),this.parent.on(En,this.onPathChanged,this),this.parent.on(Cn,this.onDeleteInit,this),this.parent.on(Qn,this.onpasteInit,this),this.parent.on(xn,this.onDeleteEnd,this),this.parent.on(_n,this.onLayoutChange,this),this.parent.on(Tn,this.onSearch,this),this.parent.on(An,this.onOpenInit,this),this.parent.on(qn,this.onRenameInit,this),this.parent.on(Kn,this.onPathChanged,this),this.parent.on(Fn,this.onPathChanged,this),this.parent.on(In,this.onPropertyChanged,this),this.parent.on(ra,this.onMethodCall,this),this.parent.on(Ln,this.onActionFailure,this),this.parent.on("hide-layout",this.onHideLayout,this),this.parent.on("select-all-init",this.onSelectAllInit,this),this.parent.on("clear-all-init",this.onClearAllInit,this),this.parent.on(zn,this.onMenuItemData,this),this.parent.on(Rn,this.onBeforeRequest,this),this.parent.on(kn,this.onAfterRequest,this),this.parent.on(ia,this.onDropInit,this),this.parent.on(Bn,this.onDetailsInit,this),this.parent.on("splitter-resize",this.splitterResizeHandler,this),this.parent.on(Nn,this.resizeHandler,this),this.parent.on(Xn,this.onpasteEnd,this),this.parent.on(Jn,this.oncutCopyInit,this),this.parent.on("layout-refresh",this.onLayoutRefresh,this),this.parent.on(aa,this.onDropPath,this),this.parent.on("update-selection-data",this.onUpdateSelectionData,this),this.parent.on("filter-end",this.onPathChanged,this)},e.prototype.onActionFailure=function(){this.isInteraction=!0,this.isInteracted=!0},e.prototype.onMenuItemData=function(e){if(this.parent.activeModule===this.getModuleName()){var i=t.closest(e.target,"li");this.parent.itemData=[this.getItemObject(i)]}},e.prototype.onDetailsInit=function(){this.parent.activeModule===this.getModuleName()&&(0!==this.parent.selectedItems.length?this.updateSelectedData():this.parent.itemData=[t.getValue(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent)])},e.prototype.onpasteInit=function(){this.parent.activeModule===this.getModuleName()&&(this.parent.itemData=""===this.parent.folderPath?[E(this.parent)]:[this.getItemObject(t.select(".e-active",this.element))])},e.prototype.oncutCopyInit=function(){if(this.parent.activeModule===this.getModuleName()){var e=this.element.querySelectorAll("."+Hi);this.parent.activeRecords=[],this.parent.activeElements=[];for(var t=0;t<e.length;t++)this.parent.activeElements.push(e[t]),this.parent.activeRecords.push(this.getItemObject(e[t]))}},e.prototype.onpasteEnd=function(e){"LargeIcons"===this.parent.view&&(this.isPasteOperation=!0,(this.parent.path===this.parent.destinationPath||this.parent.path===$(this.parent,e)||this.parent.hasId)&&this.onPathChanged(e))},e.prototype.onDropPath=function(e){"LargeIcons"===this.parent.view&&(this.isPasteOperation=!0,this.onPathChanged(e))},e.prototype.onPropertyChanged=function(e){var i;if(e.module===this.getModuleName()||"common"===e.module)for(var n=0,a=Object.keys(e.newProp);n<a.length;n++)switch(a[n]){case"allowDragAndDrop":this.createDragObj();break;case"selectedItems":this.isInteraction=!1,this.isInteracted=!1,i=t.isNullOrUndefined(this.parent.selectedItems)?[]:this.parent.selectedItems.slice(0),i=this.parent.allowMultiSelection?i:i.slice(i.length-1),this.parent.setProperties({selectedItems:[]},!0),this.onClearAllInit(),i.length&&this.selectItems(i),this.parent.setProperties({selectedItems:this.parent.selectedItems},!0),this.isInteraction=!0,this.isInteracted=!0;break;case"showThumbnail":j(this.parent);break;case"showFileExtension":case"showHiddenItems":Ee(this.parent,En,this.parent.path);break;case"allowMultiSelection":case"showItemCheckBoxes":if("LargeIcons"!==this.parent.view)break;j(this.parent);break;case"view":C(this.parent,"LargeIcons")}},e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),this.listObj&&this.unWireEvents(),this.startItem=null,this.listElements=null)},e.prototype.wireEvents=function(){this.wireClickEvent(!0),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keyup"}),this.keyboardDownModule=new t.KeyboardEvents(this.element,{keyAction:this.keydownActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),t.EventHandler.add(this.element,"mouseover",this.onMouseOver,this)},e.prototype.unWireEvents=function(){this.wireClickEvent(!1),t.EventHandler.remove(this.element,"mouseover",this.onMouseOver),this.keyboardModule.destroy(),this.keyboardDownModule.destroy()},e.prototype.onMouseOver=function(e){var i=t.closest(e.target,".e-list-item");O(this.parent,"hover"),null!==i&&i.classList.add(Bi)},e.prototype.wireClickEvent=function(e){var i=this;e?this.clickObj=new t.Touch(this.element,{tap:function(e){i.parent.isDevice?(i.tapCount=e.tapCount,i.tapEvent=e,setTimeout(function(){i.tapCount>0&&i.doTapAction(i.tapEvent),i.tapCount=0},350)):2===e.tapCount&&3!==e.originalEvent.which?i.dblClickHandler(e):i.clickHandler(e)},tapHold:function(e){i.parent.isDevice&&(i.multiSelect=!!i.parent.allowMultiSelection,i.parent.allowMultiSelection&&t.addClass([i.parent.element],"e-fe-m-select"),i.clickHandler(e))}}):this.clickObj&&this.clickObj.destroy()},e.prototype.doTapAction=function(e){var i=e.originalEvent.target,n=t.closest(i,"."+Ai);this.multiSelect||i.classList.contains("e-list-parent")||t.isNullOrUndefined(n)?this.clickHandler(e):(this.parent.isFile=!1,this.updateType(n),this.parent.isFile?2===e.tapCount?(this.clickHandler(e),this.dblClickHandler(e)):this.clickHandler(e):this.dblClickHandler(e))},e.prototype.clickHandler=function(e){var t=e.originalEvent.target;O(this.parent,"hover"),this.doSelection(t,e.originalEvent),this.parent.activeModule="largeiconsview"},e.prototype.doSelection=function(e,i){var n=this.parent.isMac?i.metaKey:i.ctrlKey,a=this.parent.isMac&&i.ctrlKey&&i.shiftKey,s=t.closest(e,"."+Ai),r=e.classList;this.parent.isFile=!1;var o="select";if((3===i.which||a)&&!t.isNullOrUndefined(s)&&s.classList.contains(Hi))return this.addActive(s),void this.updateType(s);if(t.isNullOrUndefined(s))this.parent.selectedItems.length===this.itemList.length&&(this.isSelectAllCalled=!0),this.clearSelection();else if(this.parent.allowMultiSelection&&s.classList.contains(Hi)&&(n||e.classList.contains(Wi))&&(o="unselect"),n&&i.shiftKey&&!a&&(this.isSelectAllCalled=!0),!0!==this.triggerSelection(o,s).cancel){if(this.parent.allowMultiSelection&&(this.multiSelect||!i||n)||r.contains("e-frame")||(this.updateType(s),this.clearSelect()),this.parent.allowMultiSelection&&i.shiftKey&&!a){i&&n||this.clearSelect(),this.startItem||(this.startItem=s);var l=this.itemList.indexOf(this.startItem),h=this.itemList.indexOf(s);if(l>h)for(d=l;d>=h;d--)this.addActive(this.itemList[d]);else for(var d=l;d<=h;d++)this.addActive(this.itemList[d]);this.addFocus(this.itemList[h])}else this.startItem=s,this.parent.allowMultiSelection&&s.classList.contains(Hi)?this.removeActive(s):this.addActive(s),this.addFocus(s);0===this.parent.selectedItems.length&&this.resetMultiSelect(),this.parent.notify(Un,{}),this.triggerSelect(o,s)}t.isNullOrUndefined(s)||(this.isSelectAllCalled=!1,this.updateType(s))},e.prototype.dblClickHandler=function(e){this.parent.activeModule="largeiconsview";var t=e.originalEvent.target;this.doOpenAction(t)},e.prototype.clearSelection=function(){this.clearSelect(),this.resetMultiSelect(),this.parent.notify(Un,{})},e.prototype.resetMultiSelect=function(){this.multiSelect=!1,t.removeClass([this.parent.element],"e-fe-m-select")},e.prototype.doOpenAction=function(e){var i=this;if(!t.isNullOrUndefined(e)){var n=t.closest(e,"."+Ai);if(this.parent.isFile=!1,!t.isNullOrUndefined(n)){this.updateType(n);var a=this.getItemObject(n);if(!ye(a))return void be(this.parent,a,oa);var s={cancel:!1,fileDetails:a,module:"LargeIconsView"};this.parent.trigger("fileOpen",s,function(e){if(!e.cancel){var n=t.getValue("name",a);if(i.parent.isFile){if(M(a)===tn){var s=k(i.parent,a);Bt(i.parent,n,s)}}else{if(""!==i.parent.breadcrumbbarModule.searchObj.element.value||i.parent.isFiltered)Y(i.parent,a);else{var r=t.getValue("id",a);i.parent.oldPath=i.parent.path;var o=i.parent.path+(t.isNullOrUndefined(r)?n:r)+"/";i.parent.setProperties({path:o},!0),i.parent.pathNames.push(n),i.parent.pathId.push(t.getValue("_fm_id",a)),i.parent.itemData=[a],N(i.parent)}i.parent.isFiltered=!1,i.parent.setProperties({selectedItems:[]},!0)}}})}}},e.prototype.updateType=function(e){var i=t.select("."+en,e);this.parent.isFile=!!t.isNullOrUndefined(i)},e.prototype.keydownActionHandler=function(e){if(this.isRendered)switch(e.action){case"end":case"home":case"moveDown":case"moveLeft":case"moveRight":case"moveUp":case"ctrlEnd":case"shiftEnd":case"csEnd":case"ctrlHome":case"shiftHome":case"csHome":case"ctrlDown":case"shiftDown":case"csDown":case"ctrlLeft":case"shiftLeft":case"csLeft":case"ctrlRight":case"shiftRight":case"csRight":case"space":case"ctrlSpace":case"shiftSpace":case"csSpace":case"ctrlA":case"enter":case"altEnter":case"esc":case"del":case"shiftdel":case"ctrlC":case"ctrlV":case"ctrlX":case"f2":case"ctrlD":e.preventDefault()}},e.prototype.keyActionHandler=function(e){var i=this;if(this.isRendered){var n=this.getFocusedItem(),a=this.getFirstItem(),s=this.getLastItem();switch(e.action){case"end":this.parent.enableVirtualization?(this.clearSelect(),this.element.firstElementChild.scrollTo(0,this.element.firstElementChild.scrollHeight),setTimeout(function(){i.navigateItem(i.itemList[i.itemList.length-1])},10)):this.navigateItem(s);break;case"home":this.parent.enableVirtualization?(this.clearSelect(),this.element.firstElementChild.scrollTop=0,setTimeout(function(){i.navigateItem(i.itemList[0])},10)):this.navigateItem(a);break;case"tab":t.isNullOrUndefined(n)?t.isNullOrUndefined(a)||this.addFocus(a):this.addFocus(n);break;case"moveDown":this.navigateDown(n,!0);break;case"moveLeft":this.navigateRight(n,!1);break;case"moveRight":this.navigateRight(n,!0);break;case"moveUp":this.navigateDown(n,!1);break;case"ctrlEnd":case"shiftEnd":case"csEnd":this.csEndKey(s,e);break;case"ctrlHome":case"shiftHome":case"csHome":this.csHomeKey(a,e);break;case"ctrlDown":case"shiftDown":case"csDown":this.csDownKey(n,e);break;case"ctrlLeft":case"shiftLeft":case"csLeft":this.csLeftKey(n,e);break;case"ctrlRight":case"shiftRight":case"csRight":this.csRightKey(n,e);break;case"ctrlUp":case"shiftUp":case"csUp":this.csUpKey(n,e);break;case"space":this.spaceKey(n);break;case"ctrlSpace":case"shiftSpace":case"csSpace":t.isNullOrUndefined(n)||this.doSelection(n,e);break;case"ctrlA":this.ctrlAKey(a,s);break;case"enter":this.doOpenAction(this.parent.visitedItem?this.parent.visitedItem:this.getVisitedItem());break;case"altEnter":this.parent.notify(Bn,{}),Te(this.parent,this.parent.selectedItems,this.parent.path,"details");break;case"esc":v(this.parent);break;case"del":case"shiftdel":this.performDelete();break;case"ctrlC":P(this.parent);break;case"ctrlV":this.parent.folderPath="",G(this.parent);break;case"ctrlX":R(this.parent);break;case"f2":this.performRename();break;case"ctrlD":this.doDownload();break;case"back":this.parent.traverseBackward()}}},e.prototype.doDownload=function(){this.updateSelectedData(),fe(this.parent)},e.prototype.performDelete=function(){if(this.parent.selectedItems&&this.parent.selectedItems.length>0){this.updateSelectedData();for(var e=this.parent.itemData,t=0;t<e.length;t++)if(!Ie(e[t]))return void be(this.parent,e[t],la);ut(this.parent,"Delete")}},e.prototype.performRename=function(){1===this.parent.selectedItems.length&&(this.updateRenameData(),ue(this.parent))},e.prototype.updateRenameData=function(){var e=t.select("."+Ai+"."+Hi,this.element),i=this.getItemObject(e);ce(this.parent,i)},e.prototype.getVisitedItem=function(){var e=this.parent.selectedItems[this.parent.selectedItems.length-1],t=this.getIndexes([e],this.parent.hasId);return this.itemList[t[0]]},e.prototype.getFocusedItem=function(){return t.select("."+Ai+"."+zi,this.element)},e.prototype.getActiveItem=function(){return t.select("."+Ai+"."+Hi,this.element)},e.prototype.getFirstItem=function(){return this.itemList[0]},e.prototype.getLastItem=function(){return this.itemList[this.itemList.length-1]},e.prototype.navigateItem=function(e){this.setFocus(e)},e.prototype.navigateDown=function(e,t){var i=this.getNextItem(e,t,this.perRow);this.setFocus(i)},e.prototype.navigateRight=function(e,t){var i=this.getNextItem(e,t);this.setFocus(i)},e.prototype.getNextItem=function(e,i,n){if(t.isNullOrUndefined(e))return this.getFocusedItem()||this.getActiveItem()||this.getFirstItem();var a,s=this.itemList.indexOf(e);do{if(s=i?n?s+n:s+1:n?s-n:s-1,a=this.itemList[s],this.parent.enableVirtualization&&t.isNullOrUndefined(a)){var r=parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue("margin-top"),10)+parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue("margin-bottom"),10),o=this.itemList[0].getBoundingClientRect().height+r;this.element.firstElementChild.scrollTo(this.element.firstElementChild.scrollTop,this.element.firstElementChild.scrollTop+o)}if(t.isNullOrUndefined(a))return e}while(!t.isVisible(a));return a},e.prototype.setFocus=function(e){t.isNullOrUndefined(e)||!0!==this.triggerSelection("select",e).cancel&&(this.startItem=e,this.clearSelect(),this.addActive(e),this.addFocus(e),this.parent.notify(Un,{}),this.triggerSelect("select",e))},e.prototype.spaceKey=function(e){t.isNullOrUndefined(e)||e.classList.contains(Hi)||!0!==this.triggerSelection("select",e).cancel&&(this.addActive(e),this.parent.notify(Un,{}),this.triggerSelect("select",e))},e.prototype.ctrlAKey=function(e,i){if(this.parent.allowMultiSelection&&!t.isNullOrUndefined(e)){this.startItem=e;var n={ctrlKey:!0,shiftKey:!0},a=this.element.querySelector(".e-list-parent"),s=a.scrollTop,r=this.getFocusedItem();this.doSelection(i,n),a.scrollTop=s,t.isNullOrUndefined(r)||this.addFocus(r)}},e.prototype.csEndKey=function(e,i){this.parent.allowMultiSelection?t.isNullOrUndefined(e)||("ctrlEnd"===i.action?this.addFocus(e):this.doSelection(e,i)):this.navigateItem(e)},e.prototype.csHomeKey=function(e,i){this.parent.allowMultiSelection?t.isNullOrUndefined(e)||("ctrlHome"===i.action?this.addFocus(e):this.doSelection(e,i)):this.navigateItem(e)},e.prototype.csDownKey=function(e,i){if(this.parent.allowMultiSelection){var n=this.getNextItem(e,!0,this.perRow);t.isNullOrUndefined(n)||("ctrlDown"===i.action?this.addFocus(n):this.doSelection(n,i))}else this.navigateDown(e,!0)},e.prototype.csLeftKey=function(e,i){if(this.parent.allowMultiSelection){var n=this.getNextItem(e,!1);t.isNullOrUndefined(n)||("ctrlLeft"===i.action?this.addFocus(n):this.doSelection(n,i))}else this.navigateRight(e,!1)},e.prototype.csRightKey=function(e,i){if(this.parent.allowMultiSelection){var n=this.getNextItem(e,!0);t.isNullOrUndefined(n)||("ctrlRight"===i.action?this.addFocus(n):this.doSelection(n,i))}else this.navigateRight(e,!0)},e.prototype.csUpKey=function(e,i){if(this.parent.allowMultiSelection){var n=this.getNextItem(e,!1,this.perRow);t.isNullOrUndefined(n)||("ctrlUp"===i.action?this.addFocus(n):this.doSelection(n,i))}else this.navigateDown(e,!1)},e.prototype.addActive=function(e){t.isNullOrUndefined(e)||(e.classList.contains(Hi)||(this.parent.selectedItems.push(this.getDataName(e)),this.parent.setProperties({selectedItems:this.parent.selectedItems},!0),t.addClass([e],[Hi]),e.setAttribute("aria-selected","true"),this.checkState(e,!0)),this.parent.visitedItem=e)},e.prototype.removeActive=function(e){if(!t.isNullOrUndefined(e)){t.removeClass([e],[Hi]),this.parent.allowMultiSelection?e.setAttribute("aria-selected","false"):e.removeAttribute("aria-selected"),this.checkState(e,!1);var i=this.parent.selectedItems.indexOf(this.getDataName(e));i>-1&&(this.parent.selectedItems.splice(i,1),this.parent.setProperties({selectedItems:this.parent.selectedItems},!0)),this.parent.visitedItem=null}},e.prototype.getDataName=function(e){var t=this.getItemObject(e);return pe(this.parent,t)},e.prototype.addFocus=function(e){this.element.setAttribute("tabindex","-1");var i=this.getFocusedItem();i&&(i.removeAttribute("tabindex"),t.removeClass([i],[zi])),t.addClass([e],[zi]),e.setAttribute("tabindex","0"),e.focus()},e.prototype.checkState=function(e,i){if(this.parent.showItemCheckBoxes){var n=t.select(".e-frame",e);t.isNullOrUndefined(n)||(i?n.classList.contains(Wi)||(t.addClass([n],Wi),t.closest(n,"."+Ki).setAttribute("aria-checked","true")):n.classList.contains(Wi)&&(t.removeClass([n],Wi),t.closest(n,"."+Ki).setAttribute("aria-checked","false")))}},e.prototype.clearSelect=function(){var e=Array.prototype.slice.call(t.selectAll("."+Hi,this.listElements));if(0!==e.length){if(!0!==this.triggerSelection("unselect",e[0]).cancel)for(var i=0,n=e.length;i<n;i++)this.removeActive(e[i]);this.triggerSelect("unselect",e[0])}},e.prototype.resizeHandler=function(){this.getItemCount()},e.prototype.splitterResizeHandler=function(){this.getItemCount()},e.prototype.getItemCount=function(){var e=1;if(this.itemList)for(var t=0,i=this.itemList.length-1;t<i&&this.itemList[t].getBoundingClientRect().top===this.itemList[t+1].getBoundingClientRect().top;t++)e++;this.perRow=e},e.prototype.triggerSelection=function(e,t){var i=[];if(this.isSelectAllCalled)for(var n=0,a=this.itemList.length;n<a;n++)i[n]=this.getItemObject(this.itemList[n]);else i[0]=this.getItemObject(t);var s={action:e,fileDetails:i.length>1?i:i[0],isInteracted:this.isInteraction,cancel:!1,target:this.isSelectAllCalled?null:t};return this.parent.trigger("fileSelection",s),this.isInteraction=!0,s},e.prototype.triggerSelect=function(e,t){var i=[];if(this.isSelectAllCalled){for(var n=0,a=this.itemList.length;n<a;n++)i[n]=this.getItemObject(this.itemList[n]);this.isSelectAllCalled=!1}else i[0]=this.getItemObject(t);this.parent.visitedData=i.length>1?i[i.length-1]:i[0];var s={action:e,fileDetails:i.length>1?i:i[0],isInteracted:this.isInteracted};this.parent.trigger("fileSelect",s),this.isInteracted=!0},e.prototype.selectItems=function(e){for(var t=this.getIndexes(e,this.parent.hasId),i=0,n=t.length;i<n;i++){var a={ctrlKey:!0,shiftKey:!1};this.doSelection(this.itemList[t[i]],a)}},e.prototype.getIndexes=function(e,i){for(var n=[],a=i?"id":"name",s=0,r=this.items.length;s<r;s++)-1!==e.indexOf(t.getValue(a,this.items[s]))&&n.push(s);return n},e.prototype.getItemObject=function(e){var t=this.itemList.indexOf(e);return this.items[t]},e.prototype.addSelection=function(e){var i=[];if(this.parent.hasId)i=new a.DataManager(this.items).executeLocal((new a.Query).where("id","equal",this.parent.renamedId,!1));else{var n=new a.DataManager(this.items).executeLocal((new a.Query).where("name","equal",t.getValue("name",e),!1));n.length>0&&(i=new a.DataManager(n).executeLocal((new a.Query).where("filterPath","equal",this.parent.filterPath,!1)))}if(i.length>0){var s=this.items.indexOf(i[0]),r={ctrlKey:!0,shiftKey:!1};this.doSelection(this.itemList[s],r)}},e.prototype.updateSelectedData=function(){for(var e=[],i=t.selectAll("."+Ai+"."+Hi,this.element),n=0;n<i.length;n++)e[n]=this.getItemObject(i[n]);this.parent.itemData=e},e.prototype.onMethodCall=function(e){if("LargeIcons"===this.parent.view)switch(t.getValue("action",e)){case"deleteFiles":this.deleteFiles(t.getValue("ids",e));break;case"downloadFiles":this.downloadFiles(t.getValue("ids",e));break;case"openFile":this.openFile(t.getValue("id",e));break;case"renameFile":this.isInteraction=!1,this.isInteracted=!1,this.renameFile(t.getValue("id",e),t.getValue("newName",e));break;case"createFolder":this.isInteraction=!1,this.isInteracted=!1;break;case"clearSelection":this.isInteraction=!1,this.isInteracted=!1,this.onClearAllInit();break;case"selectAll":this.isInteraction=!1,this.isInteracted=!1,this.onSelectAllInit()}},e.prototype.getItemsIndex=function(e){var i=[],n=!(""===this.parent.breadcrumbbarModule.searchObj.element.value&&!this.parent.isFiltered),a=this.parent.hasId?"id":"name";if(this.parent.hasId||!n)for(var s=0,r=this.items.length;s<r;s++)-1!==e.indexOf(t.getValue(a,this.items[s]))&&i.push(s);else for(var s=0,r=this.items.length;s<r;s++){var o=t.getValue("filterPath",this.items[s])+t.getValue("name",this.items[s]);-1===e.indexOf(o)&&-1===e.indexOf(t.getValue(a,this.items[s]))||i.push(s)}return i},e.prototype.deleteFiles=function(e){if(this.parent.activeModule="largeiconsview",t.isNullOrUndefined(e))return void this.performDelete();var i=this.getItemsIndex(e);if(0!==i.length){for(var n=[],a=[],s=0;s<i.length;s++)n[s]=this.items[i[s]],a[s]=pe(this.parent,n[s]);ge(this.parent,n,a)}},e.prototype.downloadFiles=function(e){if(t.isNullOrUndefined(e))return void this.doDownload();var i=this.getItemsIndex(e);if(0!==i.length){for(var n=[],a=[],s=0;s<i.length;s++)n[s]=this.items[i[s]],a[s]=pe(this.parent,n[s]);me(this.parent,n,a)}},e.prototype.openFile=function(e){if(!t.isNullOrUndefined(e)){var i=this.getItemsIndex([e]);i.length>0&&this.doOpenAction(this.itemList[i[0]])}},e.prototype.renameFile=function(e,i){if(this.parent.activeModule="largeiconsview",t.isNullOrUndefined(e))return void this.performRename();var n=this.getItemsIndex([e]);n.length>0&&(ce(this.parent,this.items[n[0]]),t.isNullOrUndefined(i)?ue(this.parent):Ie(this.parent.itemData[0])?Me(this.parent,this.parent.path,i):be(this.parent,this.parent.itemData[0],la))},e}(),ua=function(){function e(e){this.addressPath="",this.addressBarLink="",this.searchTimer=null,this.searchWrapWidth=null,this.parent=e,this.keyConfigs={enter:"enter"},this.render()}return e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()||"common"===e.module)for(var i=0,n=Object.keys(e.newProp);i<n.length;i++){var a=n[i],s=e.newProp.searchSettings;switch(a){case"searchSettings":t.isNullOrUndefined(s.allowSearchOnTyping)||this.searchEventBind(s.allowSearchOnTyping),!this.parent.breadcrumbbarModule.searchObj.value||""===this.parent.breadcrumbbarModule.searchObj.value||!t.isNullOrUndefined(s.allowSearchOnTyping)&&t.isNullOrUndefined(s.filterType)&&t.isNullOrUndefined(s.ignoreCase)||S(this.parent,this.parent.breadcrumbbarModule.searchObj.value,!1)}}},e.prototype.render=function(){this.addEventListener()},e.prototype.onPathChange=function(){var e=this.parent.pathNames,i=this.parent.path.split("/"),n=this.parent.createElement("ul",{className:"e-addressbar-ul"}),a=null,s=e.length;if(e.length>0){for(var r="",o=0;o<s;o++){var l=null;a=this.parent.createElement("li",{className:"e-address-list-item"});for(var h=0;h<=o;h++)r=r+i[h]+"/";if(a.setAttribute("data-utext",r),0!==o){var d=t.createElement("span",{className:"e-icons"});a.appendChild(d)}s-o!=1?(l=t.createElement("a",{className:Fi}),a.setAttribute("tabindex","0")):l=t.createElement("span",{className:Fi}),r="",l.innerText=e[o],a.appendChild(l),n.appendChild(a)}var p=this.parent.breadCrumbBarNavigation.querySelector(".e-addressbar-ul");t.isNullOrUndefined(p)||(t.isNullOrUndefined(this.subMenuObj)||this.subMenuObj.destroy(),t.remove(p));var c=this.parent.breadCrumbBarNavigation.querySelector(".e-search-wrap");c?this.parent.breadCrumbBarNavigation.appendChild(n):this.parent.breadCrumbBarNavigation.insertBefore(n,c),this.updateBreadCrumbBar(n)}},e.prototype.updateBreadCrumbBar=function(e){for(var i=e.querySelectorAll("li"),n=this.parent.breadCrumbBarNavigation.querySelector(".e-addressbar-ul"),a=window.getComputedStyle(n,null),s=parseFloat(a.getPropertyValue("padding-right")),o=parseFloat(a.getPropertyValue("padding-left")),l=n.offsetWidth-s-o,d=this.parent.createElement("ul",{className:"e-addressbar-ul"}),p=0,c=[],u=0;u<i.length;u++){var f=i[u].clientWidth;c.push(f),p+=f}t.isNullOrUndefined(n)||t.remove(n);var g=this.parent.createElement("div");g.setAttribute("class","e-search-wrap");var m=this.parent.element.id+"_search",b=t.createElement("input",{id:m,attrs:{autocomplete:"off","aria-label":B(this.parent,"Search")}});g.appendChild(b);var v=this.parent.breadCrumbBarNavigation.querySelector(".e-search-wrap .e-input");if(t.isNullOrUndefined(v)){this.parent.breadCrumbBarNavigation.appendChild(g);var y=t.createElement("span",{className:"e-icons e-fe-search"});t.EventHandler.add(y,"click",this.onShowInput,this),b.parentElement.insertBefore(y,b),this.searchObj=new r.TextBox({value:"",showClearButton:!0,placeholder:B(this.parent,"Search"),focus:this.onFocus.bind(this),blur:this.onBlur.bind(this)}),this.searchObj.appendTo("#"+this.parent.element.id+"_search"),this.searchEventBind(this.parent.searchSettings.allowSearchOnTyping);var I=this.searchObj.element.nextElementSibling;t.EventHandler.add(I,"mousedown",this.searchChangeHandler.bind(this),this),t.EventHandler.add(this.searchObj.element,"keyup",this.onKeyUp.bind(this),this)}var O=this.parent.breadCrumbBarNavigation.querySelector(".e-search-wrap");if(l-=this.searchWrapWidth?this.searchWrapWidth:O.offsetWidth,p>l){for(u=i.length;u--;){var w=l-c[u];if(!(w>40)){for(var D=[],S=0;S<=u;S++){var C=i[S];D.push({text:C.innerText,utext:C.getAttribute("data-utext")})}var x=this.parent.createElement("li",{className:"e-breadcrumb-menu"}),j={className:"e-breadcrumb-submenu"},N=this.parent.createElement("button",j);x.appendChild(N),d.insertBefore(x,d.querySelector("li")),this.subMenuObj=new h.DropDownButton({items:D,cssClass:"e-caret-hide e-submenu",iconCss:"e-icons e-fe-breadcrumb",iconPosition:"Top",enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeItemRender:this.addSubMenuAttributes.bind(this),select:this.subMenuSelectOperations.bind(this)}),this.subMenuObj.isStringTemplate=!0,this.subMenuObj.appendTo(N);break}d.insertBefore(i[u],d.querySelector("li")),l=w}this.parent.breadCrumbBarNavigation.insertBefore(d,O)}else this.parent.breadCrumbBarNavigation.insertBefore(e,O)},e.prototype.onFocus=function(){t.closest(this.searchObj.element,".e-search-wrap").classList.add("e-focus")},e.prototype.onKeyUp=function(){this.parent.notify(ea,{args:this.parent})},e.prototype.onBlur=function(){t.closest(this.searchObj.element,".e-search-wrap").classList.remove("e-focus")},e.prototype.subMenuSelectOperations=function(e){var t={target:e.element};this.addressPathClickHandler(t)},e.prototype.addSubMenuAttributes=function(e){e.element.setAttribute("data-utext",t.getValue("utext",e.item));var i=this.parent.createElement("a",{className:"e-list-text"});e.element.appendChild(i)},e.prototype.searchEventBind=function(e){e?(this.searchObj.input=this.searchChangeHandler.bind(this),this.searchObj.change=null):(this.searchObj.change=this.searchChangeHandler.bind(this),this.searchObj.input=null)},e.prototype.searchChangeHandler=function(e){var i=this;t.isNullOrUndefined(e.value)||(this.parent.isFiltered=!1,this.parent.searchSettings.allowSearchOnTyping?(window.clearTimeout(this.searchTimer),this.searchTimer=window.setTimeout(function(){S(i.parent,e.value,!1)},300)):S(this.parent,e.value,!1))},e.prototype.addressPathClickHandler=function(e){var i=e.target;if("LI"===i.nodeName||"A"===i.nodeName){var n="LI"===i.nodeName?i.children[0]:i;if(!t.isNullOrUndefined(n)){this.parent.isFiltered=!1;var a=this.updatePath(n);this.parent.itemData=[t.getValue(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent)],this.triggerFileOpen(this.parent.itemData[0]),Ee(this.parent,En,a);var s=this.parent.pathId[this.parent.pathId.length-1];this.parent.notify("update-tree-selection",{module:"treeview",selectedNode:s})}}},e.prototype.triggerFileOpen=function(e){var t={cancel:!1,fileDetails:e,module:"BreadCrumbBar"};delete t.cancel,this.parent.trigger("fileOpen",t)},e.prototype.onShowInput=function(){if(this.parent.isMobile)if(this.parent.element.classList.contains(Li))t.removeClass([this.parent.element],Li),this.searchWrapWidth=null;else{var e=this.parent.breadCrumbBarNavigation.querySelector(".e-search-wrap");this.searchWrapWidth=e.offsetWidth,t.addClass([this.parent.element],Li),this.searchObj.element.focus()}},e.prototype.updatePath=function(e){var i=t.closest(e,"li").getAttribute("data-utext");this.addressBarLink=i;var n=this.addressBarLink.split("/"),a=this.parent.pathId,s=this.parent.pathNames;this.parent.pathId=[],this.parent.pathNames=[];for(var r="",o=0,l=n.length-1;o<l;o++)this.parent.pathId.push(a[o]),this.parent.pathNames.push(s[o]),r+=n[o]+"/";return this.parent.setProperties({path:r},!0),r},e.prototype.onUpdatePath=function(){this.onPathChange(),this.removeSearchValue()},e.prototype.onCreateEnd=function(){this.onPathChange()},e.prototype.onRenameEnd=function(){this.onPathChange()},e.prototype.onDeleteEnd=function(){this.onUpdatePath()},e.prototype.removeSearchValue=function(){this.parent.isFiltered=!1,!this.searchObj||""===this.searchObj.value&&""===this.searchObj.element.value||(this.searchObj.value="",this.searchObj.element.value="",this.searchObj.dataBind())},e.prototype.onResize=function(){this.onPathChange()},e.prototype.onPasteEnd=function(){this.onPathChange()},e.prototype.addEventListener=function(){this.keyboardModule=new t.KeyboardEvents(this.parent.breadCrumbBarNavigation,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.parent.on(In,this.onPropertyChanged,this),t.EventHandler.add(this.parent.breadCrumbBarNavigation,"click",this.addressPathClickHandler,this),this.parent.on(Pn,this.destroy,this),this.parent.on(En,this.onUpdatePath,this),this.parent.on(wn,this.onUpdatePath,this),this.parent.on(jn,this.onUpdatePath,this),this.parent.on(Fn,this.onUpdatePath,this),this.parent.on(Dn,this.onCreateEnd,this),this.parent.on(Kn,this.onRenameEnd,this),this.parent.on(xn,this.onDeleteEnd,this),this.parent.on("splitter-resize",this.onResize,this),this.parent.on(Xn,this.onPasteEnd,this),this.parent.on(Nn,this.onResize,this),this.parent.on(ta,this.onSearchTextChange,this),this.parent.on(ia,this.onDropInit,this),this.parent.on("layout-refresh",this.onResize,this),this.parent.on(aa,this.onPathChange,this)},e.prototype.keyActionHandler=function(e){switch(e.action){case"enter":this.addressPathClickHandler(e)}},e.prototype.removeEventListener=function(){this.keyboardModule.destroy(),this.parent.off(En,this.onUpdatePath),this.parent.off(wn,this.onUpdatePath),this.parent.off(jn,this.onUpdatePath),this.parent.off(Fn,this.onUpdatePath),this.parent.off(Xn,this.onPasteEnd),this.parent.off(Dn,this.onCreateEnd),this.parent.off(Kn,this.onRenameEnd),this.parent.off(xn,this.onDeleteEnd),this.parent.off("splitter-resize",this.onResize),this.parent.off(Nn,this.onResize),this.parent.off(ta,this.onSearchTextChange),this.parent.off(ia,this.onDropInit),this.parent.off("layout-refresh",this.onResize),this.parent.off(aa,this.onPathChange)},e.prototype.onDropInit=function(e){if(this.parent.targetModule===this.getModuleName()){var i=e.target.closest("li");this.parent.dropPath=this.updatePath(i.children[0]),this.parent.dropData=t.getValue(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent),this.triggerFileOpen(this.parent.dropData);var n=this.parent.pathId[this.parent.pathId.length-1];this.parent.notify("update-tree-selection",{module:"treeview",selectedNode:n})}},e.prototype.getModuleName=function(){return"breadcrumbbar"},e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),t.isNullOrUndefined(this.subMenuObj)||this.subMenuObj.destroy(),t.isNullOrUndefined(this.searchObj)||this.searchObj.destroy())},e.prototype.onSearchTextChange=function(e){this.searchObj.element.placeholder=null!=this.parent.searchSettings.placeholder?this.parent.searchSettings.placeholder:B(this.parent,"Search")+" "+B(this.parent,e.cwd.name.toString())},e}(),fa=function(){function e(e){this.isMenuItemClicked=!1,this.currentItems=[],this.currentElement=null,this.disabledItems=[],this.parent=e,this.render()}return e.prototype.render=function(){this.keyConfigs={downarrow:"downarrow",uparrow:"uparrown"},this.contextMenu=new d.ContextMenu({enableRtl:this.parent.enableRtl,locale:this.parent.locale,target:"#"+this.parent.element.id,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeItemRender:this.onBeforeItemRender.bind(this),select:this.onSelect.bind(this),beforeOpen:this.onBeforeOpen.bind(this),beforeClose:this.onBeforeClose.bind(this),cssClass:z(this.parent,Mi)}),this.contextMenu.isStringTemplate=!0,this.contextMenu.appendTo("#"+this.parent.element.id+"_contextmenu"),this.addEventListener()},e.prototype.onBeforeItemRender=function(e){if(e.item.id===this.getMenuId("largeiconsview")){i=t.createElement("span");(n=e.element).insertBefore(i,"LargeIcons"===this.parent.view?n.childNodes[1]:n.childNodes[0]),i.setAttribute("class",fn+" "+hn)}if(e.item.id===this.getMenuId("detailsview")){var i=t.createElement("span"),n=e.element;n.insertBefore(i,"Details"===this.parent.view?n.childNodes[1]:n.childNodes[0]),i.setAttribute("class",un+" "+hn)}},e.prototype.onBeforeClose=function(e){var i={cancel:!1,element:e.element,event:e.event,isFocused:e.isFocused,fileDetails:[this.menuItemData],items:e.items,parentItem:e.parentItem,menuType:this.menuType};if(this.parent.trigger("menuClose",i,function(t){if(t.cancel)return void(e.cancel=t.cancel)}),this.menuTarget=null,!this.isMenuItemClicked&&this.parent.pathId.length>1&&"navigationpane"===this.parent.activeModule){this.parent.pathId.pop();for(var n=[],a=0,s=Object.keys(this.parent.feParent);a<s.length;a++){var r=s[a],o=t.getValue(r,this.parent.feParent);-1!==this.parent.pathNames.indexOf(o.name)&&n.push(o._fm_id)}this.parent.pathId.push(n[n.length-1]),this.parent.navigationpaneModule.treeObj.setProperties({selectedNodes:[this.parent.pathId[this.parent.pathId.length-1]]})}this.isMenuItemClicked=!1},e.prototype.onBeforeOpen=function(e){var i,n,a=this,s=!1,r=!1,o=e.event.target;this.menuTarget=this.targetNodeElement=o,this.currentElement=e.element,o.classList.contains("e-spinner-pane")&&(o=this.parent.navigationpaneModule.activeNode.getElementsByClassName("e-fullrow")[0],this.menuTarget=this.targetNodeElement=o),this.targetElement="Details"===this.parent.view?t.closest(o,"tr.e-row"):o,this.parent.enableVirtualization&&(o.classList.contains("e-virtual-bottom")||o.classList.contains("e-virtualtable"))&&(o=o.parentElement.closest("div"));var l=this.getTargetView(o);if(this.updateActiveModule(),o.classList.contains(ln)||t.closest(o,"th")||t.closest(o,"#"+this.parent.element.id+Ni)||t.closest(o,"#"+this.parent.element.id+"_toolbar"))e.cancel=!0;else if("LargeIcons"!==this.parent.view&&this.targetElement&&this.targetElement.classList.contains("e-emptyrow"))this.setLayoutItem(o);else if(t.closest(o,"."+Gi))this.setLayoutItem(o);else if(!o.classList.contains("e-menu-item")&&!o.classList.contains(hn)&&!o.classList.contains("e-caret")){if("LargeIcons"!==this.parent.view||t.isNullOrUndefined(t.closest(o,"li"))||t.closest(o,"#"+this.parent.element.id+"_tree"))t.isNullOrUndefined(t.closest(o,"tr.e-row"))?t.closest(o,"#"+this.parent.element.id+"_tree")&&(i=t.closest(o,"li").getAttribute("data-uid"),t.isNullOrUndefined(i)||(this.navUid=i),r=!0):(i=this.targetElement.getAttribute("data-uid"),n=this.parent.detailsviewModule.gridObj.getRowObjectFromUID(i).data,t.isNullOrUndefined(this.targetElement.getAttribute("aria-selected"))&&this.parent.detailsviewModule.gridObj.selectRows([parseInt(this.targetElement.getAttribute("aria-rowindex"),10)-1]),s=!0);else{var h={ctrlKey:!0,shiftKey:!0};t.closest(o,"li").classList.contains("e-active")||this.parent.largeiconsviewModule.doSelection(o,h),n=this.parent.visitedData,s=!0}if(s)!0===t.getValue("isFile",n)?this.setFileItem():this.setFolderItem(!1);else if(r)if(this.setFolderItem(!0),i===this.parent.pathId[0])this.disabledItems.push("Delete","Rename","Cut","Copy");else for(var d=["Delete","Rename","Cut","Copy"],p=0;p<this.disabledItems.length;p++){var c=this.disabledItems[p];-1!==d.indexOf(c)&&(this.disabledItems.splice(p,1),p--)}else"TreeView"===l||"GridView"===l||"LargeIcon"===l?this.setLayoutItem(o):e.cancel=!0}var u=t.select("#"+this.getMenuId("Paste"),this.contextMenu.element);if(e.cancel||this.parent.enablePaste||!u||u.classList.contains("e-disabled")){var f=this.disabledItems.indexOf("Paste");-1!==f&&this.disabledItems.splice(f,1)}else-1===this.disabledItems.indexOf("Paste")&&this.disabledItems.push("Paste");if(e.cancel)return void(this.menuTarget=this.currentElement=null);this.contextMenu.dataBind();var g=!1;(o.classList.contains("e-menu-item")||o.classList.contains(hn)||o.classList.contains("e-caret"))&&(g=!0),this.menuItemData=g?this.menuItemData:this.getMenuItemData();var m={fileDetails:[this.menuItemData],element:e.element,target:o,items:g?e.items:this.contextMenu.items,menuModule:this.contextMenu,cancel:!1,menuType:this.menuType,isSubMenu:g};this.currentItems=m.items,this.parent.trigger("menuOpen",m,function(t){g||(a.contextMenu.dataBind(),a.contextMenu.items=t.items,a.contextMenu.dataBind()),a.enableItems(a.disabledItems,!1,!0),e.cancel=t.cancel,t.cancel&&(a.menuTarget=a.targetNodeElement=a.currentElement=null)})},e.prototype.updateActiveModule=function(){this.parent.activeModule=t.closest(this.menuTarget,"#"+this.parent.element.id+"_tree")?"navigationpane":t.closest(this.menuTarget,"#"+this.parent.element.id+wi)?"detailsview":t.closest(this.menuTarget,"#"+this.parent.element.id+Di)?"largeiconsview":this.parent.activeModule},e.prototype.getTargetView=function(e){return e.classList.contains(ln)?"TreeView":e.classList.contains(dn)?"GridView":e.classList.contains("e-list-parent")?"LargeIcon":e.classList.contains(Ti)?"LargeIcon":""},e.prototype.getItemIndex=function(e){for(var t=this.getMenuId(e),i=0;i<this.currentItems.length;i++)if(this.currentItems[i].id===t||this.currentItems[i].id===e)return i;return-1},e.prototype.disableItem=function(e){0!==e.length&&(this.disabledItems=this.disabledItems.concat(e))},e.prototype.enableItems=function(e,t,i){t&&(this.disabledItems=this.disabledItems.filter(function(t){return-1===e.indexOf(t)}));for(var n=0;n<e.length;n++){var a=this.checkValidItem(e[n]);1===a?this.contextMenu.enableItems([this.getMenuId(e[n])],t,i):2===a&&this.contextMenu.enableItems([e[n]],t,i)}},e.prototype.setFolderItem=function(e){if(this.menuType="folder",this.contextMenu.items=this.getItemData(this.parent.contextMenuSettings.folder.map(function(e){return e.trim()})),this.contextMenu.dataBind(),e){var i=t.select('[data-uid="'+this.navUid+'"]',this.parent.navigationpaneModule.treeObj.element);if(t.isNullOrUndefined(i)||this.parent.pathNames[this.parent.pathNames.length-1]!==i.querySelector(".e-list-text").innerHTML||"navigationpane"!==this.parent.activeModule){var n=this.disabledItems.indexOf("Open");-1!==n&&this.disabledItems.splice(n,1)}else this.disabledItems.push("Open");0===this.parent.selectedItems.length&&-1!==(a=this.disabledItems.indexOf("Rename"))&&this.disabledItems.splice(a,1)}else if("navigationpane"!==this.parent.activeModule)if(1===this.parent.selectedItems.length){var a=this.disabledItems.indexOf("Rename");-1!==a&&this.disabledItems.splice(a,1)}else this.disabledItems.push("Rename","Paste")},e.prototype.setFileItem=function(){if(this.menuType="file",this.contextMenu.items=this.getItemData(this.parent.contextMenuSettings.file.map(function(e){return e.trim()})),this.contextMenu.dataBind(),1===this.parent.selectedItems.length){var e=this.disabledItems.indexOf("Rename");-1!==e&&this.disabledItems.splice(e,1)}else this.disabledItems.push("Rename")},e.prototype.setLayoutItem=function(e){this.menuType="layout",this.contextMenu.items=this.getItemData(this.parent.contextMenuSettings.layout.map(function(e){return e.trim()})),this.contextMenu.dataBind(),!this.parent.allowMultiSelection||"LargeIcons"===this.parent.view&&0!==t.closest(e,"#"+this.parent.element.id+Di).getElementsByClassName(Gi).length||"Details"===this.parent.view&&0!==t.closest(e,"#"+this.parent.element.id+wi).getElementsByClassName(Gi).length?this.disabledItems.push("SelectAll"):this.disabledItems=this.disabledItems.filter(function(e){return"SelectAll"!==e}),0===this.parent.selectedNodes.length&&-1===this.disabledItems.indexOf("Paste")&&this.disabledItems.push("Paste"),this.contextMenu.dataBind()},e.prototype.checkValidItem=function(e){if(!t.isNullOrUndefined(this.currentElement)){if(!t.isNullOrUndefined(t.select("#"+this.getMenuId(e),this.currentElement)))return 1;if(!t.isNullOrUndefined(t.select("#"+e,this.currentElement)))return 2}return-1},e.prototype.getMenuItemData=function(){if("layout"===this.menuType)return E(this.parent);var e={target:this.menuTarget};return this.parent.notify(zn,e),this.parent.itemData[0]},e.prototype.onSelect=function(e){var i=this;if(!t.isNullOrUndefined(e.item)&&e.item.id){var n,a=e.item.id.substr((this.parent.element.id+"_cm_").length);"refresh"===a||"newfolder"===a||"upload"===a?(n=[E(this.parent)],this.parent.itemData=n):(this.parent.notify("selected-data",{}),n="navigationpane"===this.parent.activeModule&&"open"===a?[this.menuItemData]:this.parent.itemData);var s={cancel:!1,element:e.element,fileDetails:n,item:e.item};this.parent.trigger("menuClick",s,function(s){var r;if(!s.cancel)switch("cut"!==a&&"copy"!==a&&(i.isMenuItemClicked=!0),a){case"cut":R(i.parent);break;case"copy":P(i.parent);break;case"paste":"folder"===i.menuType?"navigationpane"===i.parent.activeModule?(i.parent.navigationpaneModule.openFileOnContextMenuClick(t.closest(i.targetNodeElement,"li")),i.parent.folderPath=i.parent.path):i.parent.folderPath=L(i.parent,i.menuItemData,i.parent.path):i.parent.folderPath="",G(i.parent);break;case"delete":for(var o=0;o<n.length;o++)if(!Ie(n[o]))return void be(i.parent,n[o],la);ut(i.parent,"Delete");break;case"download":for(var l=0;l<n.length;l++)if(!De(n[l]))return void be(i.parent,n[l],pa);"navigationpane"===i.parent.activeModule?i.parent.notify("download-init",{}):i.parent.selectedItems.length>0&&pt(i.parent,i.parent.path,i.parent.selectedItems);break;case"rename":Ie(n[0])?(i.parent.notify(qn,{}),ut(i.parent,"Rename")):be(i.parent,n[0],la);break;case"selectall":i.parent.notify("select-all-init",{});break;case"refresh":j(i.parent);break;case"open":i.parent.visitedItem&&"navigationpane"!==i.parent.activeModule?i.parent.notify(An,{target:i.parent.visitedItem}):"navigationpane"===i.parent.activeModule&&(i.parent.visitedItem&&i.parent.notify(An,{target:i.parent.visitedItem}),i.parent.navigationpaneModule.openFileOnContextMenuClick(t.closest(i.targetNodeElement,"li")));break;case"details":i.parent.notify(Bn,{}),r=i.parent.selectedItems,"navigationpane"===i.parent.activeModule&&(r=[],i.parent.navigationpaneModule.openFileOnContextMenuClick(t.closest(i.targetNodeElement,"li"))),Te(i.parent,r,i.parent.path,"details");break;case"newfolder":Se(i.parent);break;case"upload":Ce(i.parent);break;case"name":case"size":case"date":case"ascending":case"descending":case"none":q(i.parent,e);break;case"largeiconsview":C(i.parent,"LargeIcons");break;case"detailsview":C(i.parent,"Details")}})}},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()||"common"===e.module)for(var t=0,i=Object.keys(e.newProp);t<i.length;t++)switch(i[t]){case"cssClass":this.contextMenu.cssClass=z(this.parent,Mi)}},e.prototype.addEventListener=function(){this.parent.on(Pn,this.destroy,this),this.parent.on(In,this.onPropertyChanged,this),this.keyboardModule=new t.KeyboardEvents(this.contextMenu.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},e.prototype.removeEventListener=function(){this.parent.off(Pn,this.destroy),this.parent.off(In,this.onPropertyChanged),this.keyboardModule.destroy()},e.prototype.keyActionHandler=function(e){switch(e.action){case"uparrow":case"downarrow":e.preventDefault()}},e.prototype.getModuleName=function(){return"contextmenu"},e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),this.contextMenu.destroy(),this.targetElement=null)},e.prototype.getItemData=function(e){for(var t=[],i=0;i<e.length;i++){var n=void 0,a=this.getMenuId(e[i]),s=B(this.parent,e[i]);switch(e[i]){case"|":n={separator:!0};break;case"Open":n={id:a,text:s,iconCss:"e-icons e-fe-open"};break;case"Upload":n={id:a,text:s,iconCss:"e-icons e-fe-upload"};break;case"Cut":n={id:a,text:s,iconCss:cn};break;case"Copy":n={id:a,text:s,iconCss:"e-icons e-fe-copy"};break;case"Paste":n={id:a,text:s,iconCss:"e-icons e-fe-paste"};break;case"Delete":n={id:a,text:s,iconCss:"e-icons e-fe-delete"};break;case"Rename":n={id:a,text:s,iconCss:"e-icons e-fe-rename"};break;case"NewFolder":n={id:a,text:s,iconCss:"e-icons e-fe-newfolder"};break;case"Details":n={id:a,text:s,iconCss:"e-icons e-fe-details"};break;case"SortBy":n={id:a,text:s,iconCss:"e-icons e-fe-sort",items:[{id:this.getMenuId("Name"),text:B(this.parent,"Name"),iconCss:"name"===this.parent.sortBy?Vi:null},{id:this.getMenuId("Size"),text:B(this.parent,"Size"),iconCss:"size"===this.parent.sortBy?Vi:null},{id:this.getMenuId("Date"),text:B(this.parent,"DateModified"),iconCss:"_fm_modified"===this.parent.sortBy?Vi:null},{separator:!0},{id:this.getMenuId("Ascending"),text:B(this.parent,"Ascending"),iconCss:"Ascending"===this.parent.sortOrder?Ui:null},{id:this.getMenuId("Descending"),text:B(this.parent,"Descending"),iconCss:"Descending"===this.parent.sortOrder?Ui:null},{id:this.getMenuId("None"),text:B(this.parent,"None"),iconCss:"None"===this.parent.sortOrder?Ui:null}]};break;case"View":n={id:a,text:s,iconCss:"Details"===this.parent.view?un:fn,items:[{id:this.getMenuId("largeiconsview"),text:B(this.parent,"View-LargeIcons"),iconCss:"Details"===this.parent.view?null:Ui},{id:this.getMenuId("detailsview"),text:B(this.parent,"View-Details"),iconCss:"Details"===this.parent.view?Ui:null}]};break;case"Refresh":n={id:a,text:s,iconCss:"e-icons e-fe-refresh"};break;case"SelectAll":n={id:a,text:s,iconCss:"e-icons e-fe-select"};break;case"Download":n={id:a,text:s,iconCss:"e-icons e-fe-download"};break;default:n={id:a,text:s}}t.push(n)}return t},e.prototype.getMenuId=function(e){return this.parent.element.id+"_cm_"+e.split(" ").join("").toLowerCase()},e}(),ga={NewFolder:"New folder",Upload:"Upload",Delete:"Delete",Rename:"Rename",Download:"Download",Cut:"Cut",Copy:"Copy",Paste:"Paste",SortBy:"Sort by",Refresh:"Refresh","Item-Selection":"item selected","Items-Selection":"items selected",View:"View",Details:"Details",SelectAll:"Select all",Open:"Open","Tooltip-NewFolder":"New folder","Tooltip-Upload":"Upload","Tooltip-Delete":"Delete","Tooltip-Rename":"Rename","Tooltip-Download":"Download","Tooltip-Cut":"Cut","Tooltip-Copy":"Copy","Tooltip-Paste":"Paste","Tooltip-SortBy":"Sort by","Tooltip-Refresh":"Refresh","Tooltip-Selection":"Clear selection","Tooltip-View":"View","Tooltip-Details":"Details","Tooltip-SelectAll":"Select all",Name:"Name",Size:"Size",DateModified:"Modified",DateCreated:"Date created",Path:"Path",Modified:"Modified",Created:"Created",Location:"Location",Type:"Type",Permission:"Permission",Ascending:"Ascending",Descending:"Descending",None:"None","View-LargeIcons":"Large icons","View-Details":"Details",Search:"Search","Button-Ok":"OK","Button-Cancel":"Cancel","Button-Yes":"Yes","Button-No":"No","Button-Create":"Create","Button-Save":"Save","Header-NewFolder":"Folder","Content-NewFolder":"Enter your folder name","Header-Rename":"Rename","Content-Rename":"Enter your new name","Header-Rename-Confirmation":"Rename Confirmation","Content-Rename-Confirmation":"If you change a file name extension, the file might become unstable. Are you sure you want to change it?","Header-Delete":"Delete File","Content-Delete":"Are you sure you want to delete this file?","Header-Folder-Delete":"Delete Folder","Content-Folder-Delete":"Are you sure you want to delete this folder?","Header-Multiple-Delete":"Delete Multiple Items","Content-Multiple-Delete":"Are you sure you want to delete these {0} items?","Header-Duplicate":"File/Folder exists","Content-Duplicate":"{0} already exists. Do you want to rename and paste?","Header-Upload":"Upload Files",Error:"Error","Validation-Empty":"The file or folder name cannot be empty.","Validation-Invalid":'The file or folder name {0} contains invalid characters. Please use a different name. Valid file or folder names cannot end with a dot or space, and cannot contain any of the following characters: \\/:*?"<>|',"Validation-NewFolder-Exists":"A file or folder with the name {0} already exists.","Validation-Rename-Exists":"Cannot rename {0} to {1}: destination already exists.","Folder-Empty":"This folder is empty","File-Upload":"Drag files here to upload","Search-Empty":"No results found","Search-Key":"Try with different keywords","Filter-Empty":"No results found","Filter-Key":"Try with different filter","Sub-Folder-Error":"The destination folder is the subfolder of the source folder.","Same-Folder-Error":"The destination folder is the same as the source folder.","Access-Denied":"Access Denied","Access-Details":'You don"t have permission to access this folder.',"Header-Retry":"File Already Exists","Content-Retry":"A file with this name already exists in this folder. What would you like to do?","Button-Keep-Both":"Keep both","Button-Replace":"Replace","Button-Skip":"Skip","ApplyAll-Label":"Do this for all current items",KB:"KB","Access-Message":"{0} is not accessible. You need permission to perform the {1} action.","Network-Error":"NetworkError: Failed to send on XMLHTTPRequest: Failed to load","Server-Error":"ServerError: Invalid response from"},ma=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ba=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},va=function(e){function a(i,n){var a=e.call(this,i,n)||this;return a.filterData=null,a.selectedNodes=[],a.duplicateItems=[],a.duplicateRecords=[],a.previousPath=[],a.nextPath=[],a.existingFileCount=0,a.isLayoutChange=!1,a.layoutSelectedItems=[],a.renamedId=null,a.uploadItem=[],a.deleteRecords=[],a.isFile=!1,a.isCut=!1,a.isSearchCut=!1,a.isSearchDrag=!1,a.isPasteError=!1,a.folderPath="",a.isSameAction=!1,a.isFiltered=!1,a.isSortByClicked=!1,a.enablePaste=!1,a.persistData=!1,a.retryArgs=[],a.isOpened=!1,a.isRetryOpened=!1,a.isPathDrag=!1,a.searchedItems=[],a.retryFiles=[],a.isApplySame=!1,a.dragData=[],a.dragNodes=[],a.dragPath="",a.dropPath="",a.isDragDrop=!1,a.treeExpandTimer=null,a.dragCursorPosition={left:44,top:18},a.isDropEnd=!1,a.dragCount=0,a.droppedObjects=[],a.uploadingCount=0,a.uploadedCount=0,a.isMac=!1,a.dragSelectedItems=[],a.onScrollHandler=function(){t.isNullOrUndefined(a.contextmenuModule)||t.isNullOrUndefined(a.contextmenuModule.contextMenu)||a.contextmenuModule.contextMenu.close()},s.Inject(ua,ca,fa),a}ma(a,e),s=a,a.prototype.getModuleName=function(){return"filemanager"},a.prototype.preRender=function(){(t.isNullOrUndefined(this.element.id)||""===this.element.id)&&this.element.setAttribute("id",t.getUniqueID("filemanager")),this.ensurePath(),this.feParent=[],this.feFiles=[],t.setStyleAttribute(this.element,{width:t.formatUnit(this.width),height:t.formatUnit(this.height)}),this.isDevice=t.Browser.isDevice,this.isMobile=this.checkMobile(),this.isMobile&&this.setProperties({navigationPaneSettings:{visible:!1}},!0);var e=t.closest(this.element,".e-bigger");this.isBigger=!!e,this.activeModule="LargeIcons"===this.view?"largeiconsview":"detailsview",n.createSpinner({target:this.element},t.createElement),this.addWrapper(),this.keyConfigs={altN:"alt+n",f5:"f5",ctrlShift1:"ctrl+shift+1",ctrlShift2:"ctrl+shift+2",ctrlU:"ctrl+u"},this.localeObj=new t.L10n(this.getModuleName(),ga,this.locale)},a.prototype.getPersistData=function(){var e=["view","path","selectedItems"];return this.addOnPersist(e)},a.prototype.requiredModules=function(){var e=[];return e.push({member:"breadcrumbbar",args:[this]}),e.push({member:"largeiconsview",args:[this]}),this.toolbarSettings.visible&&e.push({member:"toolbar",args:[this],name:"Toolbar"}),this.navigationPaneSettings.visible&&e.push({member:"navigationpane",args:[this],name:"NavigationPane"}),this.view&&e.push({member:"detailsview",args:[this],name:"DetailsView"}),this.contextMenuSettings.visible&&!this.isDevice&&e.push({member:"contextmenu",args:[this],name:"ContextMenu"}),this.enableVirtualization&&e.push({member:"virtualization",args:[this],name:"Virtualization"}),e},a.prototype.render=function(){this.initialize();var e=t.isNullOrUndefined(this.selectedItems)?[]:this.allowMultiSelection?this.selectedItems:this.selectedItems.slice(this.selectedItems.length-1);this.setProperties({selectedItems:e},!0),this.fileView=this.view,this.isMac=navigator.platform.toUpperCase().indexOf("MAC")>=0,this.setRtl(this.enableRtl),this.addEventListeners(),Ee(this,this.path!==this.originalPath?On:wn,this.path),"Details"===this.fileView&&this.largeiconsviewModule.element.classList.add(bn),this.adjustHeight(),t.isNullOrUndefined(this.navigationpaneModule)&&(this.splitterObj.collapse(this.enableRtl?1:0),t.select(".e-split-bar",this.element).classList.add(bn)),this.wireEvents(),this.renderComplete()},a.prototype.ensurePath=function(){var e=this.path;t.isNullOrUndefined(e)&&(e="/"),e.lastIndexOf("/")!==e.length-1&&(e+="/"),this.originalPath=e;var i=e.split("/");this.setProperties({path:i[0]+"/"},!0),this.pathNames=[],this.pathId=["fe_tree"],this.itemData=[]},a.prototype.initialize=function(){this.isMobile&&t.addClass([this.element],"e-fe-mobile"),this.allowMultiSelection&&t.addClass([this.element],"e-fe-cb-select"),this.addCssClass(null,this.cssClass),this.renderFileUpload()},a.prototype.addWrapper=function(){var e=this.createElement("div",{id:this.element.id+"_toolbar"});this.element.appendChild(e);var t=this.createElement("div",{id:this.element.id+Oi,className:"e-layout"});this.element.appendChild(t);var n=this.createElement("div",{id:this.element.id+"_navigation",className:"e-navigation"}),a=this.createElement("div",{id:this.element.id+"_tree"});n.appendChild(a);var s=this.createElement("div",{id:this.element.id+ji,className:"e-layout-content"});this.breadCrumbBarNavigation=this.createElement("div",{id:this.element.id+Ni,className:"e-address"}),s.appendChild(this.breadCrumbBarNavigation);var r=this.createElement("div",{id:this.element.id+wi});s.appendChild(r);var o=this.createElement("div",{id:this.element.id+Di,className:Ti,attrs:{role:"group"}});s.appendChild(o);var l=this.createElement("span",{className:"e-fe-overlay"});s.appendChild(l);var h;this.enableRtl?(t.appendChild(s),t.appendChild(n),h=[{size:"75%",min:"270px"},{size:"25%",min:this.navigationPaneSettings.minWidth.toString(),max:this.navigationPaneSettings.maxWidth.toString()}]):(t.appendChild(n),t.appendChild(s),h=[{size:"25%",min:this.navigationPaneSettings.minWidth.toString(),max:this.navigationPaneSettings.maxWidth.toString()},{size:"75%",min:"270px"}]),this.splitterObj=new i.Splitter({paneSettings:h,width:"100%",enableRtl:!1,enableHtmlSanitizer:this.enableHtmlSanitizer,resizing:this.splitterResize.bind(this)}),this.splitterObj.isStringTemplate=!0,this.splitterObj.appendTo(t);var d=this.createElement("div",{id:this.element.id+Si});this.element.appendChild(d);var p=this.createElement("ul",{id:this.element.id+"_contextmenu"});this.element.appendChild(p);var c=this.createElement("div",{id:this.element.id+Ci});this.element.appendChild(c);var u=this.createElement("div",{id:this.element.id+xi});this.element.appendChild(u);var f=this.createElement("div",{id:this.element.id+"_upload_dialog"});this.element.appendChild(f)},a.prototype.adjustHeight=function(){var e=t.select("#"+this.element.id+"_toolbar",this.element),i=e?e.offsetHeight:0;this.splitterObj&&(this.splitterObj.height=(this.element.clientHeight-i).toString(),this.splitterObj.dataBind())},a.prototype.splitterResize=function(){this.notify("splitter-resize",{})},a.prototype.splitterAdjust=function(){var e=t.select(".e-split-bar",this.element);this.navigationPaneSettings.visible?(this.splitterObj.expand(this.enableRtl?1:0),e.classList.remove(bn)):(this.splitterObj.collapse(this.enableRtl?1:0),e.classList.add(bn))},a.prototype.addCssClass=function(e,i){t.isNullOrUndefined(e)||""===e||t.removeClass([this.element],e.split(" ")),t.isNullOrUndefined(i)||""===i||t.addClass([this.element],i.split(" "))},a.prototype.showSpinner=function(){n.showSpinner(this.element)},a.prototype.hideSpinner=function(){n.hideSpinner(this.element)},a.prototype.onContextMenu=function(e){e.preventDefault()},a.prototype.checkMobile=function(){return/iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile/i.test(t.Browser.userAgent.toLowerCase())&&/mobile/i.test(t.Browser.userAgent.toLowerCase())},a.prototype.renderFileUpload=function(){var e=this.element.id+Ei,t=this.createElement("input",{id:e,attrs:{name:"uploadFiles",type:"file"}});this.element.appendChild(t),this.uploadDialogObj=new n.Dialog({header:B(this,"Header-Upload"),content:t,animationSettings:{effect:"None"},showCloseIcon:!0,closeOnEscape:!0,visible:!1,isModal:!0,width:"350px",target:this.popupTarget?this.popupTarget:"#"+this.element.id,cssClass:z(this,this.isMobile?ki:Mi),locale:this.locale,allowDragging:!0,position:{X:"center",Y:"center"},enableRtl:this.enableRtl,enableHtmlSanitizer:this.enableHtmlSanitizer,open:this.onOpen.bind(this),close:this.onClose.bind(this),beforeOpen:this.onBeforeOpen.bind(this),beforeClose:this.onBeforeClose.bind(this)}),this.uploadDialogObj.appendTo("#"+this.element.id+"_upload_dialog"),this.renderUploadBox()},a.prototype.renderUploadBox=function(){var e=this.ajaxSettings.uploadUrl?this.ajaxSettings.uploadUrl:this.ajaxSettings.url;this.uploadObj=new r.Uploader({dropArea:t.select("#"+this.element.id+ji,this.element),asyncSettings:{saveUrl:e,removeUrl:e,chunkSize:this.uploadSettings.chunkSize,retryCount:0},locale:this.locale,enableRtl:this.enableRtl,uploading:this.onUploading.bind(this),chunkUploading:this.onChunkUploading.bind(this),removing:this.onRemoving.bind(this),canceling:this.onCancel.bind(this),clearing:this.onClearing.bind(this),selected:this.onSelected.bind(this),success:this.onUploadSuccess.bind(this),failure:this.onUploadFailure.bind(this),autoUpload:this.uploadSettings.autoUpload,minFileSize:this.uploadSettings.minFileSize,maxFileSize:this.uploadSettings.maxFileSize,allowedExtensions:this.uploadSettings.allowedExtensions,directoryUpload:this.uploadSettings.directoryUpload,fileListRendering:this.onFileListRender.bind(this)}),this.uploadObj.appendTo("#"+this.element.id+Ei)},a.prototype.onFileListRender=function(e){this.trigger("uploadListCreate",e)},a.prototype.updateUploader=function(){this.uploadObj.autoUpload=this.uploadSettings.autoUpload,this.uploadObj.minFileSize=this.uploadSettings.minFileSize,this.uploadObj.maxFileSize=this.uploadSettings.maxFileSize,this.uploadObj.allowedExtensions=this.uploadSettings.allowedExtensions,this.uploadObj.directoryUpload=this.uploadSettings.directoryUpload,this.uploadObj.dataBind()},a.prototype.onBeforeOpen=function(e){var t={cancel:e.cancel,popupName:"Upload",popupModule:this.uploadDialogObj};this.trigger("beforePopupOpen",t,function(t){e.cancel=t.cancel})},a.prototype.onBeforeClose=function(e){var t={cancel:e.cancel,popupName:"Upload",popupModule:this.uploadDialogObj};this.trigger("beforePopupClose",t,function(t){e.cancel=t.cancel})},a.prototype.onOpen=function(){this.isOpened=!0,this.uploadDialogObj.element.focus();var e={popupModule:this.uploadDialogObj,popupName:"Upload",element:this.uploadDialogObj.element};this.trigger("popupOpen",e)},a.prototype.onClose=function(){this.isOpened=!1,this.uploadObj.clearAll();var e={popupModule:this.uploadDialogObj,popupName:"Upload",element:this.uploadDialogObj.element};this.trigger("popupClose",e)},a.prototype.onChunkUploading=function(e){var i="save";if(0!==this.retryArgs.length)for(var n=0;n<this.retryArgs.length;n++)e.fileData.name===this.retryArgs[n].file.name&&(i=this.retryArgs[n].action);var a=JSON.stringify(t.getValue(this.pathId[this.pathId.length-1],this.feParent));e.customFormData=[{path:this.path},{size:e.fileData.size},{action:i},{data:a},{filename:e.fileData.name}]},a.prototype.onUploading=function(e){var i="save";if(0!==this.retryArgs.length)for(var n=0;n<this.retryArgs.length;n++)e.fileData.name===this.retryArgs[n].file.name&&(i=this.retryArgs[n].action,0===this.uploadSettings.chunkSize&&(this.retryArgs.splice(n,1),n=this.retryArgs.length));var a=JSON.stringify(t.getValue(this.pathId[this.pathId.length-1],this.feParent));e.customFormData=[{path:this.path},{size:e.fileData.size},{action:i},{data:a},{filename:e.fileData.name}];var s={url:this.ajaxSettings.uploadUrl?this.ajaxSettings.uploadUrl:this.ajaxSettings.url,type:"POST",mode:!0,dataType:null,contentType:null,data:JSON.stringify(e.customFormData),onSuccess:null,onFailure:null,beforeSend:null};this.uploadEventArgs={action:"Upload",ajaxSettings:s,cancel:!1},this.trigger("beforeSend",this.uploadEventArgs,function(i){e.customFormData=JSON.parse(t.getValue("data",i.ajaxSettings)),e.cancel=i.cancel;var n={cancel:!1,httpRequest:e.currentRequest};"function"==typeof t.getValue("beforeSend",i.ajaxSettings)&&(t.getValue("beforeSend",i.ajaxSettings)(n),t.getValue("cancel",n)&&(e.cancel=t.getValue("cancel",n)))})},a.prototype.onRemoving=function(){this.onFileUploadSuccess({count:1}),1===this.uploadObj.getFilesData().length&&this.uploadDialogObj.hide()},a.prototype.onCancel=function(e){var i=JSON.stringify(t.getValue(this.pathId[this.pathId.length-1],this.feParent));e.customFormData=[{path:this.path},{action:"remove"},{data:i}]},a.prototype.onClearing=function(){this.isOpened&&this.uploadDialogObj.hide()},a.prototype.onSelected=function(e){if(0!==e.filesData.length){this.uploadingCount=e.filesData.length,this.uploadedCount=0;var t=E(this);if(!we(t))return e.cancel=!0,void be(this,t,da);this.uploadDialogObj.show()}},a.prototype.onFileUploadSuccess=function(e){this.uploadedCount=this.uploadedCount+e.count,this.uploadSettings.autoClose&&this.uploadingCount===this.uploadedCount&&this.uploadDialogObj.hide()},a.prototype.onChunkUploadComplete=function(e){if(0!==this.retryArgs.length)for(var i=0;i<this.retryArgs.length;i++)(t.isNullOrUndefined(e)?"":t.getValue("file",e).name)===this.retryArgs[i].file.name&&(this.retryArgs.splice(i,1),i=this.retryArgs.length)},a.prototype.onUploadSuccess=function(e){this.uploadSettings.chunkSize>0&&this.onChunkUploadComplete(e);var i={action:"Upload",result:e};this.trigger("success",i),this.itemData=[t.getValue(this.pathId[this.pathId.length-1],this.feParent)],Ee(this,En,this.path),this.onFileUploadSuccess({count:1}),"function"==typeof t.getValue("onSuccess",this.uploadEventArgs.ajaxSettings)&&t.getValue("onSuccess",this.uploadEventArgs.ajaxSettings)()},a.prototype.onUploadFailure=function(e){this.uploadSettings.chunkSize>0&&this.onChunkUploadComplete(e);var i=t.getValue("response",e),n=t.getValue("statusText",i);""!==n&&t.setValue("statusText",n,e);var a={action:"Upload",error:e};this.trigger("failure",a),400===t.getValue("statusCode",i)&&(this.retryFiles.push(t.getValue("file",e)),this.isRetryOpened||ft(this,"UploadRetry")),"function"==typeof t.getValue("onFailure",this.uploadEventArgs.ajaxSettings)&&t.getValue("onFailure",this.uploadEventArgs.ajaxSettings)()},a.prototype.onInitialEnd=function(){K(this,this.path)},a.prototype.addEventListeners=function(){this.on(Rn,this.showSpinner,this),this.on(kn,this.hideSpinner,this),this.on(On,this.onInitialEnd,this),this.on(Bn,this.onDetailsInit,this),this.on(Mn,this.onFileUploadSuccess,this),t.EventHandler.add(this.element,"contextmenu",this.onContextMenu,this)},a.prototype.removeEventListeners=function(){this.isDestroyed||(this.off(Rn,this.showSpinner),this.off(kn,this.hideSpinner),this.off(On,this.onInitialEnd),this.off(Bn,this.onDetailsInit),this.off(Mn,this.onFileUploadSuccess),t.EventHandler.remove(this.element,"contextmenu",this.onContextMenu))},a.prototype.onDetailsInit=function(){t.isNullOrUndefined(this.activeModule)&&(this.itemData=[t.getValue(this.pathId[this.pathId.length-1],this.feParent)])},a.prototype.resizeHandler=function(){this.adjustHeight(),this.notify(Nn,{})},a.prototype.keyActionHandler=function(e){switch(e.action){case"altN":e.preventDefault(),this.itemData=[E(this)],Oe(this.itemData[0])?ut(this,"NewFolder"):be(this,this.itemData[0],ha);break;case"f5":e.preventDefault(),j(this);break;case"ctrlShift1":e.preventDefault(),this.fileView="Details",this.setProperties({view:"Details"},!0),n.showSpinner(this.element),C(this,"Details");break;case"ctrlShift2":e.preventDefault(),this.fileView="LargeIcons",this.setProperties({view:"LargeIcons"},!0),n.showSpinner(this.element),C(this,"LargeIcons");break;case"ctrlU":e.preventDefault(),-1!==this.toolbarSettings.items.indexOf("Upload")&&t.select("#"+this.element.id+Ei,this.element).click()}},a.prototype.wireSelectOnDragEvent=function(e){t.isNullOrUndefined(this.view)||(e&&(this.viewElem="LargeIcons"===this.view?this.largeiconsviewModule.element:this.element.querySelector(".e-gridcontent")),e?this.allowMultiSelection&&(this.on(_n,this.onLayoutChange,this),this.on(Un,this.onLayoutChange,this)):(this.off(_n,this.onLayoutChange),this.off(Un,this.onLayoutChange)),this.viewElem&&(e&&this.allowMultiSelection?t.EventHandler.add(this.viewElem,"mousedown",this.onDragStart,this):t.EventHandler.remove(this.viewElem,"mousedown",this.onDragStart)))},a.prototype.wireEvents=function(){this.enableRangeSelection&&this.wireSelectOnDragEvent(!0),t.EventHandler.add(window,"resize",this.resizeHandler,this),this.contextMenuSettings.visible&&this.element.addEventListener("scroll",this.onScrollHandler,!0),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},a.prototype.unWireEvents=function(){this.wireSelectOnDragEvent(!1),t.EventHandler.remove(window,"resize",this.resizeHandler),this.contextMenuSettings.visible&&this.element.removeEventListener("scroll",this.onScrollHandler,!0),this.keyboardModule.destroy()},a.prototype.onDragStart=function(e){if(this.viewElem){if(this.allowDragAndDrop&&t.closest(e.target,this.viewElem.classList.contains("e-large-icons")?".e-list-item":".e-fe-text"))return;e.preventDefault(),this.dragX=e.pageX,this.dragY=e.pageY,this.dragSelectElement||(this.dragSelectElement=t.createElement("div",{id:this.element.id+"_drag",className:"e-filemanager e-drag-select",styles:"left: "+this.dragX+"px;top: "+this.dragY+"px;"}),document.body.append(this.dragSelectElement)),t.EventHandler.add(document,"mouseup",this.onDragStop,this),t.EventHandler.add(this.viewElem,"mousemove",this.onDrag,this),t.EventHandler.add(this.dragSelectElement,"mousemove",this.onDrag,this)}},a.prototype.onDrag=function(e){if(e.stopPropagation(),this.dragSelectElement){var i=e.pageX-this.dragX,n=e.pageY-this.dragY;t.setStyleAttribute(this.dragSelectElement,{left:i<0?this.dragX+i+"px":this.dragX+"px",top:n<0?this.dragY+n+"px":this.dragY+"px",height:Math.abs(n)+"px",width:Math.abs(i)+"px"}),this.selectItems()}else t.EventHandler.remove(this.viewElem,"mousemove",this.onDrag)},a.prototype.onDragStop=function(){this.viewElem&&(t.EventHandler.remove(document,"mouseup",this.onDragStop),t.EventHandler.remove(this.viewElem,"mousemove",this.onDrag)),this.dragSelectElement&&(t.EventHandler.remove(this.dragSelectElement,"mousemove",this.onDrag),this.dragSelectElement.clientHeight>0&&this.dragSelectElement.clientWidth>0&&this.setProperties({selectedItems:this.dragSelectedItems}),this.dragSelectedItems=[],t.detach(this.dragSelectElement),this.dragSelectElement=null)},a.prototype.selectItems=function(){var e=this.dragSelectElement.getBoundingClientRect();e.height>0&&e.width>0&&(this.dragSelectedItems=[],t.removeClass(t.selectAll(".e-active",this.viewElem),["e-active","e-focus"]),t.removeClass(t.selectAll(".e-check",this.viewElem),["e-check"]));for(var i=0,n=t.selectAll(this.viewElem.classList.contains("e-large-icons")?".e-list-item":".e-row",this.viewElem);i<n.length;i++){var a=n[i],s=a.getBoundingClientRect();!(e.right<s.left||e.left>s.right||e.bottom<s.top||e.top>s.bottom)&&e.height>0&&e.width>0&&(this.viewElem.classList.contains("e-large-icons")?(a.classList.add("e-active"),this.dragSelectedItems.push(a.getAttribute("title"))):(t.addClass(t.selectAll(".e-rowcell",a),["e-active"]),this.dragSelectedItems.push(a.querySelector(".e-drag-text").textContent)),this.showItemCheckBoxes&&a.querySelector(".e-frame").classList.add("e-check"))}},a.prototype.onLayoutChange=function(){this.enableRangeSelection&&(this.unWireEvents(),this.wireEvents())},a.prototype.setPath=function(){this.setProperties({selectedItems:[]},!0),this.ensurePath(),this.notify(Vn,{selectedNode:this.pathId[0]}),Ee(this,this.path!==this.originalPath?On:wn,this.path)},a.prototype.onPropertyChanged=function(e,i){for(var n,a=this,s=!1,r=0,o=Object.keys(e);r<o.length;r++)switch(o[r]){case"ajaxSettings":this.ajaxSettingSetModel(e);break;case"allowDragAndDrop":this.allowDragAndDrop=e.allowDragAndDrop,this.notify(In,{module:"common",newProp:e,oldProp:i});break;case"showItemCheckBoxes":this.showItemCheckBoxes=e.showItemCheckBoxes,this.notify(In,{module:"common",newProp:e,oldProp:i});break;case"enableVirtualization":this.enableVirtualization=e.enableVirtualization,s=!0;break;case"allowMultiSelection":this.allowMultiSelection?t.addClass([this.element],"e-fe-cb-select"):(this.selectedItems.length>1&&this.setProperties({selectedItems:this.selectedItems.slice(this.selectedItems.length-1)},!0),t.removeClass([this.element],"e-fe-cb-select")),this.notify(In,{module:"common",newProp:e,oldProp:i});break;case"cssClass":this.addCssClass(i.cssClass,e.cssClass),this.notify(In,{module:"common",newProp:e,oldProp:i});break;case"detailsViewSettings":this.notify(In,{module:"detailsview",newProp:e,oldProp:i});break;case"enableRangeSelection":this.wireSelectOnDragEvent(!1),e.enableRangeSelection&&this.wireSelectOnDragEvent(!0);break;case"enableRtl":this.enableRtl=e.enableRtl,s=!0;break;case"rootAliasName":this.rootAliasName=e.rootAliasName,s=!0;break;case"height":n=t.isNullOrUndefined(e.height)?e.height:t.formatUnit(e.height),t.setStyleAttribute(this.element,{height:n}),this.adjustHeight(),this.notify(In,{module:"common",newProp:e,oldProp:i});break;case"locale":t.isNullOrUndefined(e.enableRtl)||this.setProperties({enableRtl:e.enableRtl},!0),this.localeSetModelOption(e);break;case"navigationPaneSettings":this.splitterAdjust(),this.notify(In,{module:"navigationpane",newProp:e,oldProp:i});break;case"path":this.oldPath=i.path,this.setPath();break;case"searchSettings":t.isNullOrUndefined(e.searchSettings.allowSearchOnTyping)||this.setProperties({searchSettings:{allowSearchOnTyping:e.searchSettings.allowSearchOnTyping}},!0),t.isNullOrUndefined(e.searchSettings.ignoreCase)&&this.setProperties({searchSettings:{ignoreCase:e.searchSettings.ignoreCase}},!0),t.isNullOrUndefined(e.searchSettings.filterType)&&this.setProperties({searchSettings:{filterType:e.searchSettings.filterType}},!0),this.notify(In,{module:"breadcrumbbar",newProp:e,oldProp:i});break;case"selectedItems":"Details"===this.view?this.notify(In,{module:"detailsview",newProp:e,oldProp:i}):"LargeIcons"===this.view&&this.notify(In,{module:"largeiconsview",newProp:e,oldProp:i});break;case"showFileExtension":case"showHiddenItems":this.notify(In,{module:"common",newProp:e,oldProp:i});break;case"showThumbnail":this.notify(In,{module:"largeiconsview",newProp:e,oldProp:i});break;case"toolbarSettings":case"toolbarItems":this.adjustHeight(),this.notify(In,{module:"toolbar",newProp:e,oldProp:i});break;case"uploadSettings":this.updateUploader();break;case"view":"Details"===e.view?this.notify(In,{module:"detailsview",newProp:e,oldProp:i}):"LargeIcons"===e.view&&this.notify(In,{module:"largeiconsview",newProp:e,oldProp:i});break;case"width":t.setStyleAttribute(this.element,{width:t.isNullOrUndefined(e.width)?e.width:t.formatUnit(e.width)}),this.notify(In,{module:"common",newProp:e,oldProp:i});break;case"sortOrder":j(this),this.notify(Hn,{});break;case"sortBy":if("Details"===this.view){var l=this.detailsViewSettings.columns;if(!(!t.isNullOrUndefined(l)&&-1!==l.findIndex(function(e){return e.field===a.sortBy})))return;j(this),this.notify(Hn,{}),this.notify(Zn,{})}else j(this),this.notify(Hn,{});break;case"popupTarget":this.uploadDialogObj&&(this.uploadDialogObj.target=e.popupTarget),this.dialogObj&&(this.dialogObj.target=e.popupTarget),this.extDialogObj&&(this.extDialogObj.target=e.popupTarget),this.viewerObj&&(this.viewerObj.target=e.popupTarget);break;case"fileSystemData":this.fileSystemData=e.fileSystemData,s=!0}s&&this.refresh()},a.prototype.ajaxSettingSetModel=function(i){t.isNullOrUndefined(i.ajaxSettings.url)||this.setProperties({ajaxSettings:{url:i.ajaxSettings.url}},!0),t.isNullOrUndefined(i.ajaxSettings.uploadUrl)||this.setProperties({ajaxSettings:{uploadUrl:i.ajaxSettings.uploadUrl}},!0),t.isNullOrUndefined(i.ajaxSettings.downloadUrl)||this.setProperties({ajaxSettings:{downloadUrl:i.ajaxSettings.downloadUrl}},!0),t.isNullOrUndefined(i.ajaxSettings.getImageUrl)||this.setProperties({ajaxSettings:{getImageUrl:i.ajaxSettings.getImageUrl}},!0),this.setProperties({path:"/"},!0),this.setProperties({selectedItems:[]},!0),e.prototype.refresh.call(this)},a.prototype.localeSetModelOption=function(t){this.uploadObj.locale=t.locale,e.prototype.refresh.call(this)},a.prototype.destroy=function(){this.isDestroyed||(this.refreshing||this.notify(Pn,{}),this.uploadObj.destroy(),this.uploadObj=null,this.uploadDialogObj.destroy(),this.uploadDialogObj=null,this.splitterObj.destroy(),this.splitterObj=null,this.dialogObj&&(this.dialogObj.destroy(),this.dialogObj=null),this.viewerObj&&(this.viewerObj.destroy(),this.viewerObj=null),this.extDialogObj&&(this.extDialogObj.destroy(),this.extDialogObj=null),this.element.removeAttribute("style"),this.element.removeAttribute("tabindex"),this.removeEventListeners(),this.unWireEvents(),this.addCssClass(this.cssClass,null),t.removeClass([this.element],[mn,"e-fe-mobile","e-fe-cb-select"]),this.element.innerHTML="",this.breadCrumbBarNavigation=null,this.activeElements=null,this.virtualDragElement=null,this.visitedItem=null,e.prototype.destroy.call(this),this.virtualizationModule=null,this.navigationpaneModule=null,this.toolbarModule=null,this.contextmenuModule=null,this.largeiconsviewModule=null,this.detailsviewModule=null,this.breadcrumbbarModule=null,this.viewElem=null,this.dragSelectElement=null,this.dragSelectedItems=null)},a.prototype.createFolder=function(e){this.notify(ra,{action:"createFolder"});var t=[E(this)];this.itemData=t,e?/[/\\|*?"<>:]/.test(e)?ut(this,"Error",{files:null,error:{code:"402",message:B(this,"Validation-Invalid").replace("{0}",'"'+e+'"'),fileExists:null}}):Oe(t[0])?Pe(this,e):be(this,t[0],ha):Se(this)},a.prototype.deleteFiles=function(e){this.notify(ra,{action:"deleteFiles",ids:e})},a.prototype.disableToolbarItems=function(e){!t.isNullOrUndefined(e)&&this.toolbarModule&&this.toolbarModule.enableItems(e,!1)},a.prototype.downloadFiles=function(e){this.notify(ra,{action:"downloadFiles",ids:e})},a.prototype.enableToolbarItems=function(e){!t.isNullOrUndefined(e)&&this.toolbarModule&&this.toolbarModule.enableItems(e,!0)},a.prototype.enableMenuItems=function(e){t.isNullOrUndefined(e)||t.isNullOrUndefined(this.contextmenuModule)||t.isNullOrUndefined(this.contextmenuModule.contextMenu)||this.contextmenuModule.enableItems(e,!0,!0)},a.prototype.disableMenuItems=function(e){t.isNullOrUndefined(e)||t.isNullOrUndefined(this.contextmenuModule)||t.isNullOrUndefined(this.contextmenuModule.contextMenu)||this.contextmenuModule.disableItem(e)},a.prototype.getMenuItemIndex=function(e){return this.contextmenuModule?this.contextmenuModule.getItemIndex(e):-1},a.prototype.getToolbarItemIndex=function(e){return this.toolbarModule?this.toolbarModule.getItemIndex(e):-1},a.prototype.filterFiles=function(e){this.filterData=e||null,this.setProperties({selectedItems:[]},!0),this.notify(Un,{}),this.isFiltered=!0,""!==this.breadcrumbbarModule.searchObj.element.value&&(this.breadcrumbbarModule.searchObj.element.value=""),Re(this,"filter-end")},a.prototype.getSelectedFiles=function(){return this.notify("update-selection-data",{}),this.itemData},a.prototype.openFile=function(e){this.notify(ra,{action:"openFile",id:e})},a.prototype.refreshFiles=function(){j(this)},a.prototype.refreshLayout=function(){this.adjustHeight(),this.notify("layout-refresh",{})},a.prototype.selectAll=function(){this.notify(ra,{action:"selectAll"})},a.prototype.traverseBackward=function(){if(this.pathNames.length>1&&""===this.breadcrumbbarModule.searchObj.element.value&&!this.isFiltered){this.pathId.pop(),this.pathNames.pop();var e=this.pathNames.slice(1).join("/");e=""===e?"/":"/"+e+"/",this.setProperties({path:e},!0),Ee(this,En,this.path);var t=this.pathId[this.pathId.length-1];this.notify("update-tree-selection",{module:"treeview",selectedNode:t})}},a.prototype.clearSelection=function(){this.notify(ra,{action:"clearSelection"})},a.prototype.renameFile=function(e,t){this.notify(ra,{action:"renameFile",id:e,newName:t})},a.prototype.uploadFiles=function(){var e=[E(this)];this.itemData=e,Ce(this)},a.prototype.closeDialog=function(){xe(this)},a.prototype.setRtl=function(e){e?this.addCssClass(null,mn):this.addCssClass(mn,null),this.uploadObj&&(this.uploadDialogObj.enableRtl=e,this.uploadObj.enableRtl=e)};var s;return ba([t.Complex({},Yt)],a.prototype,"ajaxSettings",void 0),ba([t.Property([])],a.prototype,"fileSystemData",void 0),ba([t.Property(!1)],a.prototype,"allowDragAndDrop",void 0),ba([t.Property(!0)],a.prototype,"allowMultiSelection",void 0),ba([t.Property(!0)],a.prototype,"showItemCheckBoxes",void 0),ba([t.Complex({},pi)],a.prototype,"contextMenuSettings",void 0),ba([t.Property("")],a.prototype,"cssClass",void 0),ba([t.Complex({},si)],a.prototype,"detailsViewSettings",void 0),ba([t.Property(!0)],a.prototype,"enableHtmlSanitizer",void 0),ba([t.Property(!1)],a.prototype,"enablePersistence",void 0),ba([t.Property(!1)],a.prototype,"enableVirtualization",void 0),ba([t.Property("400px")],a.prototype,"height",void 0),ba([t.Property("LargeIcons")],a.prototype,"view",void 0),ba([t.Complex({},fi)],a.prototype,"navigationPaneSettings",void 0),ba([t.Property("/")],a.prototype,"path",void 0),ba([t.Property(null)],a.prototype,"popupTarget",void 0),ba([t.Complex({},ti)],a.prototype,"searchSettings",void 0),ba([t.Property()],a.prototype,"selectedItems",void 0),ba([t.Property(!0)],a.prototype,"showFileExtension",void 0),ba([t.Property(null)],a.prototype,"rootAliasName",void 0),ba([t.Property(!1)],a.prototype,"showHiddenItems",void 0),ba([t.Property(!0)],a.prototype,"showThumbnail",void 0),ba([t.Property("Ascending")],a.prototype,"sortOrder",void 0),ba([t.Property("name")],a.prototype,"sortBy",void 0),ba([t.Property(null)],a.prototype,"sortComparer",void 0),ba([t.Property(!1)],a.prototype,"enableRangeSelection",void 0),ba([t.Complex({},Xt)],a.prototype,"toolbarSettings",void 0),ba([t.Collection([],$t)],a.prototype,"toolbarItems",void 0),ba([t.Complex({},bi)],a.prototype,"uploadSettings",void 0),ba([t.Property("100%")],a.prototype,"width",void 0),ba([t.Event()],a.prototype,"fileLoad",void 0),ba([t.Event()],a.prototype,"fileOpen",void 0),ba([t.Event()],a.prototype,"beforeDownload",void 0),ba([t.Event()],a.prototype,"beforeImageLoad",void 0),ba([t.Event()],a.prototype,"beforePopupClose",void 0),ba([t.Event()],a.prototype,"beforePopupOpen",void 0),ba([t.Event()],a.prototype,"beforeSend",void 0),ba([t.Event()],a.prototype,"created",void 0),ba([t.Event()],a.prototype,"beforeFolderCreate",void 0),ba([t.Event()],a.prototype,"folderCreate",void 0),ba([t.Event()],a.prototype,"destroyed",void 0),ba([t.Event()],a.prototype,"beforeDelete",void 0),ba([t.Event()],a.prototype,"delete",void 0),ba([t.Event()],a.prototype,"beforeRename",void 0),ba([t.Event()],a.prototype,"rename",void 0),ba([t.Event()],a.prototype,"beforeMove",void 0),ba([t.Event()],a.prototype,"move",void 0),ba([t.Event()],a.prototype,"search",void 0),ba([t.Event()],a.prototype,"fileDragStart",void 0),ba([t.Event()],a.prototype,"fileDragging",void 0),ba([t.Event()],a.prototype,"fileDragStop",void 0),ba([t.Event()],a.prototype,"fileDropped",void 0),ba([t.Event()],a.prototype,"fileSelection",void 0),ba([t.Event()],a.prototype,"fileSelect",void 0),ba([t.Event()],a.prototype,"menuClick",void 0),ba([t.Event()],a.prototype,"menuOpen",void 0),ba([t.Event()],a.prototype,"menuClose",void 0),ba([t.Event()],a.prototype,"failure",void 0),ba([t.Event()],a.prototype,"popupClose",void 0),ba([t.Event()],a.prototype,"popupOpen",void 0),ba([t.Event()],a.prototype,"success",void 0),ba([t.Event()],a.prototype,"toolbarClick",void 0),ba([t.Event()],a.prototype,"toolbarCreate",void 0),ba([t.Event()],a.prototype,"uploadListCreate",void 0),a=s=ba([t.NotifyPropertyChanges],a)}(t.Component),ya=function(){function e(e){this.default=["Delete","Rename","Download","Cut","Copy","Paste"],this.single=["Delete","Rename","Download","Cut","Copy"],this.multiple=["Delete","Download","Cut","Copy","Refresh"],this.selection=["NewFolder","Upload","SortBy","Refresh"],this.parent=e,this.render(),this.addEventListener()}return e.prototype.render=function(){var e=this;this.items=this.toolbarItemData(this.getItems(this.parent.toolbarSettings.items.map(function(e){return e.trim()})));var t={items:this.items};this.parent.trigger("toolbarCreate",t,function(t){e.items=t.items,e.toolbarObj=new d.Toolbar({items:e.items,created:e.toolbarCreateHandler.bind(e),overflowMode:"Popup",clicked:e.onClicked.bind(e),enableHtmlSanitizer:e.parent.enableHtmlSanitizer,enableRtl:e.parent.enableRtl}),e.toolbarObj.isStringTemplate=!0,e.toolbarObj.root=e.parent.root?e.parent.root:e.parent,e.toolbarObj.appendTo("#"+e.parent.element.id+"_toolbar")})},e.prototype.getItemIndex=function(e){for(var t=this.getId(e),i=0;i<this.items.length;i++)if(this.items[i].id===t)return i;return-1},e.prototype.getItems=function(e){var t=e.slice();return this.parent.isDevice&&this.parent.allowMultiSelection&&t.push("SelectAll"),this.parent.toolbarItems.length>0&&(t=this.parent.toolbarItems.map(function(e){return e.name})),t},e.prototype.onClicked=function(e){var i=this;if(!t.isNullOrUndefined(e.item)&&e.item.id){var n,a=e.item.id.substr((this.parent.element.id+"_tb_").length);"refresh"===a||"newfolder"===a||"upload"===a?(n=[E(this.parent)],this.parent.itemData=n):(this.parent.notify("selected-data",{}),n=this.parent.itemData);var s={cancel:!1,fileDetails:n,item:e.item};this.parent.trigger("toolbarClick",s,function(s){var r,o;if(!s.cancel)switch(a){case"sortby":(o=t.closest(e.originalEvent.target,".e-toolbar-item"))&&o.classList.contains("e-toolbar-popup")&&(e.cancel=!0);break;case"newfolder":Se(i.parent);break;case"cut":R(i.parent);break;case"copy":P(i.parent);break;case"delete":for(var l=0;l<n.length;l++)if(!Ie(n[l]))return void be(i.parent,n[l],la);ut(i.parent,"Delete");break;case"details":i.parent.notify(Bn,{}),r=i.parent.selectedItems,"navigationpane"===i.parent.activeModule&&(r=[]),Te(i.parent,r,i.parent.path,"details");break;case"paste":i.parent.folderPath="",G(i.parent);break;case"refresh":j(i.parent);break;case"download":fe(i.parent);break;case"rename":Ie(n[0])?(i.parent.notify(qn,{}),ut(i.parent,"Rename")):be(i.parent,n[0],la);break;case"upload":Ce(i.parent);break;case"selectall":i.parent.notify("select-all-init",{});break;case"selection":i.parent.notify("clear-all-init",{})}})}},e.prototype.toolbarCreateHandler=function(){var e=this;if(!t.isNullOrUndefined(t.select("#"+this.getId("SortBy"),this.parent.element))){var i=[{id:this.getPupupId("name"),text:B(this.parent,"Name"),iconCss:"name"===this.parent.sortBy?Vi:""},{id:this.getPupupId("size"),text:B(this.parent,"Size"),iconCss:"size"===this.parent.sortBy?Vi:""},{id:this.getPupupId("date"),text:B(this.parent,"DateModified"),iconCss:"_fm_modified"===this.parent.sortBy?Vi:""},{separator:!0},{id:this.getPupupId("ascending"),text:B(this.parent,"Ascending"),iconCss:"Ascending"===this.parent.sortOrder?Ui:""},{id:this.getPupupId("descending"),text:B(this.parent,"Descending"),iconCss:"Descending"===this.parent.sortOrder?Ui:""},{id:this.getPupupId("none"),text:B(this.parent,"None"),iconCss:"None"===this.parent.sortOrder?Ui:""}];this.buttonObj=new h.DropDownButton({items:i,cssClass:z(this.parent,Mi),select:q.bind(this,this.parent),enableHtmlSanitizer:this.parent.enableHtmlSanitizer,enableRtl:this.parent.enableRtl,iconCss:"e-icons e-fe-sort"}),this.buttonObj.isStringTemplate=!0,this.buttonObj.appendTo("#"+this.getId("SortBy"))}if(!t.isNullOrUndefined(t.select("#"+this.getId("View"),this.parent.element))){var n=[{id:this.getPupupId("large"),text:B(this.parent,"View-LargeIcons"),iconCss:"Details"===this.parent.view?"":Ui},{id:this.getPupupId("details"),text:B(this.parent,"View-Details"),iconCss:"Details"===this.parent.view?Ui:""}];this.layoutBtnObj=new h.DropDownButton({iconCss:"Details"===this.parent.view?un:fn,cssClass:z(this.parent,"e-caret-hide "+Mi),items:n,select:this.layoutChange.bind(this),enableRtl:this.parent.enableRtl,content:'<span class="e-tbar-btn-text">'+B(this.parent,"View")+"</span>",beforeItemRender:function(t){var i=t.item.iconCss,n=t.item.text===B(e.parent,"View-LargeIcons"),a=i?" e-menu-icon "+i:"";t.element.innerHTML='<span class="'+a+'"></span>'+(n?'<span class="e-icons e-fe-large e-menu-icon"></span>':'<span class="e-icons e-fe-grid e-menu-icon"></span>')+t.item.text;var s=t.element.firstChild;s&&""===s.className&&t.element.removeChild(s)}}),this.layoutBtnObj.isStringTemplate=!0,this.layoutBtnObj.appendTo("#"+this.getId("View"))}this.hideItems(this.default,!0),this.hideStatus(),this.parent.portals&&this.toolbarObj.portals&&(this.parent.portals=this.parent.portals.concat(this.toolbarObj.portals),this.parent.renderReactTemplates());for(var a=t.selectAll(".e-btn",this.toolbarObj.element),s=0;s<a.length;s++)!function(e){a[e].onkeydown=function(e){13!==e.keyCode||e.target.classList.contains("e-fe-popup")||e.preventDefault()},a[e].onkeyup=function(t){13!==t.keyCode||t.target.classList.contains("e-fe-popup")||a[e].click()}}(s);this.parent.refreshLayout()},e.prototype.updateSortByButton=function(){if(this.buttonObj)for(var e=this.buttonObj.items,t=0;t<e.length;t++)e[t].id===this.getPupupId("name")?e[t].iconCss="name"===this.parent.sortBy?Vi:"":e[t].id===this.getPupupId("size")?e[t].iconCss="size"===this.parent.sortBy?Vi:"":e[t].id===this.getPupupId("date")?"dateModified"===this.parent.sortBy||"dateCreated"===this.parent.sortBy?e[t].iconCss=this.parent.sortBy===this.parent.sortBy?Vi:"":e[t].iconCss="_fm_modified"===this.parent.sortBy?Vi:"":e[t].id===this.getPupupId("ascending")?e[t].iconCss="Ascending"===this.parent.sortOrder?Ui:"":e[t].id===this.getPupupId("descending")?e[t].iconCss="Descending"===this.parent.sortOrder?Ui:"":e[t].id===this.getPupupId("none")&&(e[t].iconCss="None"===this.parent.sortOrder?Ui:"")},e.prototype.getPupupId=function(e){return this.parent.element.id+"_ddl_"+e.toLowerCase()},e.prototype.layoutChange=function(e){"Details"===this.parent.view?e.item.id===this.getPupupId("large")&&C(this.parent,"LargeIcons"):e.item.id===this.getPupupId("details")&&C(this.parent,"Details")},e.prototype.toolbarItemData=function(e){var t=[],i="Both";this.parent.isMobile&&(i="Overflow");for(var n=0;n<e.length;n++){var a=void 0,s=void 0;this.parent.toolbarItems.length>0&&(s=this.getItemModel(this.parent.toolbarItems[parseInt(n.toString(),10)]));var r=this.getId(e[n]),o=B(this.parent,e[n]),l=B(this.parent,"Tooltip-"+e[n]);switch(e[n]){case"|":a={type:"Separator"};break;case"Upload":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-upload",showTextOn:i};break;case"SortBy":var h='<span class="e-tbar-btn-text e-tbar-ddb-text">'+o+"</span>";s&&s.text&&(h='<span class="e-tbar-btn-text e-tbar-ddb-text">'+s.text+"</span>"),a={id:r,tooltipText:l,template:'<button id="'+r+'" class="e-tbar-btn e-tbtn-txt" tabindex="-1">'+h+"</button>"};break;case"Refresh":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-refresh",showTextOn:i};break;case"Selection":a={id:r,text:o,tooltipText:l,suffixIcon:"e-icons e-fe-clear",overflow:"Show",align:"Right"};break;case"View":var d=void 0;d=s&&s.text?s.text:B(this.parent,"View"),a={id:r,tooltipText:l,prefixIcon:"Details"===this.parent.view?un:fn,overflow:"Show",align:"Right",text:o,showTextOn:"Overflow",template:'<button id="'+r+'" class="e-tbar-btn e-tbtn-txt" tabindex="-1" aria-label='+d+"></button>"};break;case"Details":a={id:r,tooltipText:l,prefixIcon:"e-icons e-fe-details",overflow:"Show",align:"Right",text:o,showTextOn:"Overflow"};break;case"NewFolder":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-newfolder",showTextOn:i};break;case"Cut":a={id:r,text:o,tooltipText:l,prefixIcon:cn,showTextOn:i};break;case"Copy":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-copy",showTextOn:i};break;case"Paste":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-paste",showTextOn:i};break;case"Delete":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-delete",showTextOn:i};break;case"Rename":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-rename",showTextOn:i};break;case"Download":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-download",showTextOn:i};break;case"SelectAll":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-select",showTextOn:i};break;default:a={id:r,text:o,tooltipText:l,template:""}}if(this.parent.toolbarItems.length>0&&s){var p=Object.assign({},a,s);t.push(p)}else t.push(a)}return t},e.prototype.getItemModel=function(e){var t={};return e.id&&(t.id=e.id),e.text&&(t.text=e.text),e.tooltipText&&(t.tooltipText=e.tooltipText),e.prefixIcon&&(t.prefixIcon=e.prefixIcon),e.cssClass&&(t.cssClass=e.cssClass),"Both"!==e.showTextOn&&(t.showTextOn=e.showTextOn),e.template&&(t.template=e.template),e.disabled&&(t.disabled=e.disabled),"auto"!==e.width&&(t.width=e.width),e.suffixIcon&&(t.suffixIcon=e.suffixIcon),"Left"!==e.align&&(t.align=e.align),"None"!==e.overflow&&(t.overflow=e.overflow),e.htmlAttributes&&(t.htmlAttributes=e.htmlAttributes),"Button"!==e.type&&(t.type=e.type),!0!==e.visible&&(t.visible=e.visible),e.showAlwaysInPopup&&(t.showAlwaysInPopup=e.showAlwaysInPopup),-1!==e.tabIndex&&(t.tabIndex=e.tabIndex),t},e.prototype.getId=function(e){return this.parent.element.id+"_tb_"+e.toLowerCase()},e.prototype.addEventListener=function(){this.parent.on(In,this.onPropertyChanged,this),this.parent.on(Un,this.onSelectionChanged,this),this.parent.on(_n,this.onLayoutChange,this),this.parent.on(Yn,this.showPaste,this),this.parent.on(Gn,this.hidePaste,this),this.parent.on(Pn,this.destroy,this),this.parent.on(Hn,this.updateSortByButton,this)},e.prototype.reRenderToolbar=function(e){var t=this,i=[];if(this.parent.toolbarItems.length>0?i=this.parent.toolbarItems.map(function(e){return e.name}):void 0!==e.newProp.toolbarSettings.items&&(i=e.newProp.toolbarSettings.items.map(function(e){return e.trim()})),i.length>0){this.items=this.toolbarItemData(this.getItems(i));var n={items:this.items};this.parent.trigger("toolbarCreate",n,function(e){t.buttonObj&&t.buttonObj.destroy(),t.layoutBtnObj&&t.layoutBtnObj.destroy(),t.items=e.items,t.toolbarObj.items=t.items,t.toolbarObj.dataBind(),t.toolbarCreateHandler()})}},e.prototype.onSelectionChanged=function(){this.hideStatus(),this.hideItems(this.single,!0),this.hideItems(this.selection,!1),1===this.parent.selectedItems.length?(this.hideItems(this.single,!1),this.hideItems(this.selection,!0)):this.parent.selectedItems.length>1&&(this.hideItems(this.multiple,!1),this.hideItems(this.selection,!0));var e=t.select("#"+this.getId("Selection"),this.toolbarObj.element);if(this.parent.selectedItems.length>0&&e&&!this.parent.enableVirtualization){var i=void 0;i=1===this.parent.selectedItems.length?this.parent.selectedItems.length+" "+B(this.parent,"Item-Selection"):this.parent.selectedItems.length+" "+B(this.parent,"Items-Selection"),t.select(".e-tbar-btn-text",e).textContent=i,this.toolbarObj.hideItem(e.parentElement,!1)}},e.prototype.hideItems=function(e,i){for(var n=0;n<e.length;n++){var a=t.select("#"+this.getId(e[n]),this.parent.element);a&&this.toolbarObj.hideItem(a.parentElement,i)}},e.prototype.hideStatus=function(){var e=t.select("#"+this.getId("Selection"),this.toolbarObj.element);e&&this.toolbarObj.hideItem(e.parentElement,!0)},e.prototype.showPaste=function(){this.hideItems(["Paste"],!1)},e.prototype.hidePaste=function(){this.hideItems(["Paste"],!0)},e.prototype.onLayoutChange=function(){if(this.layoutBtnObj){this.layoutBtnObj.iconCss="Details"===this.parent.view?un:fn;for(var e=this.layoutBtnObj.items,t=0;t<e.length;t++)e[t].id===this.getPupupId("large")?e[t].iconCss="LargeIcons"===this.parent.view?Ui:"":e[t].id===this.getPupupId("details")&&(e[t].iconCss="Details"===this.parent.view?Ui:"")}},e.prototype.removeEventListener=function(){this.parent.off(In,this.onPropertyChanged),this.parent.off(Un,this.onSelectionChanged),this.parent.off(_n,this.onLayoutChange),this.parent.off(Yn,this.showPaste),this.parent.off(Gn,this.hidePaste),this.parent.off(Pn,this.destroy),this.parent.off(Hn,this.updateSortByButton)},e.prototype.getModuleName=function(){return"toolbar"},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()||"common"===e.module)for(var t=0,i=Object.keys(e.newProp);t<i.length;t++)switch(i[t]){case"cssClass":this.buttonObj&&(this.buttonObj.cssClass=z(this.parent,Mi)),this.layoutBtnObj&&(this.layoutBtnObj.cssClass=z(this.parent,"e-caret-hide "+Mi));break;case"height":case"width":this.toolbarObj.refreshOverflow();break;case"toolbarSettings":case"toolbarItems":this.reRenderToolbar(e)}},e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),this.buttonObj&&this.buttonObj.destroy(),this.layoutBtnObj&&this.layoutBtnObj.destroy(),this.toolbarObj.destroy(),this.parent.refreshLayout())},e.prototype.enableItems=function(e,i){for(var n=0;n<e.length;n++){var a=t.select("#"+this.getId(e[n]),this.parent.element);a&&this.toolbarObj.enableItems(a.parentElement,i)}},e}(),Ia=function(){function e(e){this.filemanagerInstance=e,this.largeIconInstance=e.largeiconsviewModule}return e.prototype.setUIVirtualization=function(){var e=this.largeIconInstance.items,i=e.slice(0,1),n=l.ListBase.createListFromJson(t.createElement,i,this.largeIconInstance.listObj);this.itemList=Array.prototype.slice.call(t.selectAll("."+Ai,n)),this.largeIconInstance.element.appendChild(n),0!==this.itemList.length&&this.largeIconInstance.element.querySelector("."+Gi)&&this.largeIconInstance.element.removeChild(this.largeIconInstance.element.querySelector("."+Gi)),this.itemCount=this.getItemCount(Object.keys(this.largeIconInstance.allItems).length),this.largeIconInstance.element.firstChild.remove(),this.largeIconInstance.items=e.slice(0,this.itemCount)},e.prototype.setUlElementHeight=function(){this.lastRowCount=(this.largeIconInstance.allItems.length-this.itemCount)%this.rowItemCount?(this.largeIconInstance.allItems.length-this.itemCount)%this.rowItemCount:this.rowItemCount,this.topElement=this.filemanagerInstance.createElement("div"),this.topElement.classList.add("e-virtual-top"),this.largeIconInstance.element.firstElementChild.insertBefore(this.topElement,this.largeIconInstance.element.firstElementChild.firstChild),this.bottomElement=this.filemanagerInstance.createElement("div"),this.bottomElement.classList.add("e-virtual-bottom"),this.largeIconInstance.element.firstElementChild.insertBefore(this.bottomElement,null);var e=parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue("margin-top"),10)+parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue("margin-bottom"),10);this.listItemHeight=this.largeIconInstance.itemList[0].getBoundingClientRect().height+e,this.totalHeight=Object.keys(this.largeIconInstance.allItems).length/this.rowItemCount*this.listItemHeight,this.topElement.style.height="0px",this.bottomElement.style.height=this.totalHeight+"px",this.topElementHeight=0,this.bottomElementHeight=this.totalHeight,this.listDiff=0,this.renderedCount=this.itemCount},e.prototype.getItemCount=function(e){var i=parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue("margin-right"),10)+parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue("margin-left"),10);this.rowItemCount=Math.floor(parseFloat(t.formatUnit(this.largeIconInstance.element.firstElementChild.clientWidth))/(this.itemList[0].offsetWidth+i));var n=this.rowItemCount*Math.round(parseFloat(t.formatUnit(this.largeIconInstance.element.clientHeight))/this.itemList[0].offsetHeight);return(n>e||0===n)&&(n=e),n},e.prototype.wireScrollEvent=function(e){e?t.EventHandler.remove(this.largeIconInstance.element.firstElementChild,"scroll",this.onVirtualUiScroll):t.EventHandler.add(this.largeIconInstance.element.firstElementChild,"scroll",this.onVirtualUiScroll,this)},e.prototype.onVirtualUiScroll=function(){var e;this.scrollPosition=t.isNullOrUndefined(this.scrollPosition)?0:this.scrollPosition;var i=this.getscrollerHeight(0);if(this.topElementHeight=this.listItemHeight*Math.floor(i/this.listItemHeight),this.bottomElementHeight=this.totalHeight-this.topElementHeight,e=i<=this.totalHeight?[this.topElementHeight,this.bottomElementHeight]:[this.totalHeight,0],this.topElementHeight=e[0],this.bottomElementHeight=e[1],this.topElementHeight!==parseFloat(this.topElement.style.height))if(this.topElement.style.height=this.topElementHeight+"px",this.bottomElement.style.height=this.bottomElementHeight+"px",i>this.scrollPosition){n=Math.round(this.topElementHeight/this.listItemHeight-this.listDiff);this.onNormalScroll(n,!0)}else{var n=Math.round(this.listDiff-this.topElementHeight/this.listItemHeight);this.onNormalScroll(n,!1)}this.listDiff=Math.round(this.topElementHeight/this.listItemHeight),this.scrollPosition=i,this.largeIconInstance.itemList=Array.prototype.slice.call(t.selectAll("."+Ai,this.largeIconInstance.element)),this.itemCount=this.itemCount!==this.largeIconInstance.itemList.length?this.largeIconInstance.itemList.length:this.itemCount,this.largeIconInstance.items=this.largeIconInstance.allItems.slice(this.renderedCount-this.itemCount,this.renderedCount)},e.prototype.getscrollerHeight=function(e){return this.largeIconInstance.element.firstElementChild.scrollTop-e<=0?0:this.largeIconInstance.element.firstElementChild.scrollTop-e},e.prototype.onNormalScroll=function(e,t){for(var i=0;i<e;i++)this.updateUI(t)},e.prototype.updateUI=function(e){var i=this;if(e){if(this.items=this.largeIconInstance.allItems.slice(this.renderedCount,this.renderedCount+this.rowItemCount),this.items.length>0){r=l.ListBase.createListFromJson(t.createElement,this.items,this.largeIconInstance.listObj);this.itemList=Array.prototype.slice.call(t.selectAll("."+Ai,r)),this.itemList.forEach(function(e){i.largeIconInstance.element.firstElementChild.insertBefore(e,i.bottomElement)}),this.renderedCount=this.largeIconInstance.allItems.length>=this.renderedCount+this.rowItemCount?this.renderedCount+this.rowItemCount:this.renderedCount+this.lastRowCount;for(h=0;h<this.rowItemCount;h++)t.detach(this.topElement.nextElementSibling)}}else{var n=void 0,a=void 0;this.renderedCount===this.largeIconInstance.allItems.length?(n=this.renderedCount-(this.itemCount-this.rowItemCount+this.lastRowCount),this.renderedCount=this.renderedCount-this.lastRowCount<this.itemCount?this.itemCount:this.renderedCount-this.lastRowCount,a=!0):(n=this.renderedCount-this.itemCount,this.renderedCount=this.renderedCount-this.rowItemCount<this.itemCount?this.itemCount:this.renderedCount-this.rowItemCount);var s=n-this.rowItemCount>0?n-this.rowItemCount:0;if(this.items=this.largeIconInstance.allItems.slice(s,n),this.items.length>0){var r=l.ListBase.createListFromJson(t.createElement,this.items,this.largeIconInstance.listObj);this.itemList=Array.prototype.slice.call(t.selectAll("."+Ai,r));for(var o=this.itemList.length;o>0;o--)this.largeIconInstance.element.firstElementChild.insertBefore(this.itemList[o-1],this.topElement.nextElementSibling);for(var h=0;h<(a?this.lastRowCount:this.rowItemCount);h++)t.detach(this.bottomElement.previousElementSibling)}}},e.prototype.getModuleName=function(){return"virtualization"},e.prototype.destroy=function(){this.filemanagerInstance.isDestroyed||t.isNullOrUndefined(this.largeIconInstance.element.firstElementChild)||this.wireScrollEvent(!0)},e}(),Oa=function(){function e(e){this.removeNodes=[],this.moveNames=[],this.previousSelected=[],this.isDrag=!1,this.isPathDragged=!1,this.isRenameParent=!1,this.isRightClick=!1,this.isSameNodeClicked=!1,this.isNodeExpandCalled=!1,this.renameParent=null,this.isNodeClickCalled=!1,this.restrictSelecting=!1,this.parent=e,this.addEventListener(),this.keyConfigs={altEnter:"alt+enter",esc:"escape",del:"delete",ctrlX:this.parent.isMac?"cmd+x":"ctrl+x",ctrlC:this.parent.isMac?"cmd+c":"ctrl+c",ctrlV:this.parent.isMac?"cmd+v":"ctrl+v",ctrlShiftN:"ctrl+shift+n",shiftF10:"shift+F10",f2:"f2"}}return e.prototype.onInit=function(){if(t.isNullOrUndefined(this.treeObj)){var e=t.getValue(this.parent.pathId[0],this.parent.feParent);t.setValue("_fm_icon","e-fe-folder",e);var i={},n=t.getValue("id",e);t.isNullOrUndefined(n)||t.setValue("data-id",n,i),Ie(e)||t.setValue("class",ve(e),i),t.isNullOrUndefined(i)||t.setValue("_fm_htmlAttr",i,e),this.treeObj=new d.TreeView({fields:{dataSource:[e],id:"_fm_id",parentID:"_fm_pId",expanded:"_fm_expanded",selected:"_fm_selected",text:"name",hasChildren:"hasChild",iconCss:"_fm_icon",htmlAttributes:"_fm_htmlAttr",tooltip:"name"},enableHtmlSanitizer:this.parent.enableHtmlSanitizer,sortOrder:this.parent.navigationPaneSettings.sortOrder,nodeSelecting:this.onNodeSelecting.bind(this),nodeSelected:this.onNodeSelected.bind(this),nodeExpanding:this.onNodeExpand.bind(this),nodeClicked:this.onNodeClicked.bind(this),allowEditing:!0,nodeEditing:this.onNodeEditing.bind(this),drawNode:this.onDrowNode.bind(this),enableRtl:this.parent.enableRtl,dataBound:this.addDragDrop.bind(this)}),this.treeObj.isStringTemplate=!0,this.treeObj.appendTo("#"+this.parent.element.id+"_tree"),this.wireEvents()}},e.prototype.addDragDrop=function(){var e=this;!this.parent.isMobile&&this.treeObj&&(this.parent.allowDragAndDrop&&t.isNullOrUndefined(this.dragObj)?this.dragObj=new t.Draggable(this.treeObj.element,{cursorAt:this.parent.dragCursorPosition,dragTarget:".e-fullrow",distance:5,dragArea:this.parent.element,drag:he.bind(this,this.parent),dragStart:function(t){ae(e.parent,t,e.dragObj)},dragStop:ne.bind(this,this.parent),enableTailMode:!0,enableAutoScroll:!1,helper:this.dragHelper.bind(this)}):!this.parent.allowDragAndDrop&&this.dragObj&&(this.dragObj.destroy(),this.dragObj=null))},e.prototype.dragHelper=function(e){var i=e.sender.target;if(!i.classList.contains("e-fullrow"))return null;var n=t.closest(i,"li");return this.parent.dragPath="",this.parent.dragData=[],this.parent.activeElements=[],this.parent.activeElements=[n],this.parent.dragNodes=[],w(this.parent,n),this.parent.dragData=this.getTreeData(n),this.parent.dragPath=this.getDragPath(n,this.parent.dragData[0].name),this.parent.dragNodes.push(this.parent.dragData[0].name),ie(this.parent),this.parent.virtualDragElement},e.prototype.getDragPath=function(e,t){return X(this.getDropPath(e,t))},e.prototype.getDropPath=function(e,t){var i=e.getAttribute("data-id");return u(e,this.parent.hasId?i:t,this.parent.hasId)},e.prototype.onDrowNode=function(e){var t={element:e.node,fileDetails:e.nodeData,module:"NavigationPane"};this.parent.trigger("fileLoad",t)},e.prototype.addChild=function(e,i,n){var a=V(e),s=this.getTreeData(i);if(a.length>0&&s.length>0&&(null==a[0].filterPath||t.isNullOrUndefined(s[0])&&null==s[0].filterPath||a[0].filterPath!==s[0].filterPath)){for(var r=0,o=a;r<a.length;){o[parseInt(r.toString(),10)]._fm_icon="e-fe-folder";var l={},h=t.getValue("id",o[r]);t.isNullOrUndefined(h)||t.setValue("data-id",h,l),Ie(o[r])||t.setValue("class",ve(o[r]),l),t.isNullOrUndefined(l)||t.setValue("_fm_htmlAttr",l,o[r]),r++}var d=t.select('[data-uid="'+i+'"]',this.treeObj.element),p=t.select("ul",d);t.isNullOrUndefined(p)&&this.treeObj.addNodes(a,i,null,n)}},e.prototype.onNodeSelecting=function(e){if(!e.isInteracted&&!this.isRightClick&&!this.isSameNodeClicked&&!this.isPathDragged&&!this.isRenameParent||this.restrictSelecting)return this.restrictSelecting=!1,void(this.isNodeClickCalled=!1);if(!this.renameParent){this.parent.activeModule="navigationpane";var i=this.getTreeData(t.getValue("id",e.nodeData));if(e.node.getAttribute("data-uid")!==this.parent.pathId[this.parent.pathId.length-1]&&!this.isRightClick&&!this.isNodeClickCalled||this.isSameNodeClicked||this.isPathDragged){if(this.isNodeClickCalled=!1,!this.isSameNodeClicked){this.isSameNodeClicked=!0;a={action:e.action,fileDetails:i[0],isInteracted:e.isInteracted};this.parent.trigger("fileSelect",a)}if(!this.isRightClick){var n={cancel:!1,fileDetails:i[0],module:"NavigationPane"};this.parent.trigger("fileOpen",n),e.cancel=n.cancel}e.cancel&&(this.restrictSelecting=!!this.isNodeClickCalled&&this.previousSelected[0]!==e.node.getAttribute("data-uid"),this.isNodeClickCalled=!0,this.isSameNodeClicked=!1,this.isPathDragged=!1,this.previousSelected=this.treeObj.selectedNodes,this.treeObj.setProperties({selectedNodes:[e.node.getAttribute("data-uid")]}))}else if(this.previousSelected[0]!==e.node.getAttribute("data-uid")){var a={action:e.action,fileDetails:i[0],isInteracted:this.isNodeClickCalled};this.parent.trigger("fileSelect",a)}}},e.prototype.openFileOnContextMenuClick=function(e){var t=this.treeObj.getTreeData(e);this.parent.selectedItems=[],this.parent.itemData=t,this.activeNode=e,this.parent.activeModule="navigationpane";var i={cancel:!1,fileDetails:t[0],module:"NavigationPane"};this.parent.trigger("fileOpen",i),this.isNodeClickCalled=!0,i.cancel||(c(e,this.parent.itemData[0],this.parent),Ee(this.parent,this.isPathDragged?Xn:En,this.parent.path),this.parent.visitedItem=e,this.isPathDragged=this.isRenameParent=this.isRightClick=!1,this.treeObj.setProperties({selectedNodes:[e.getAttribute("data-uid")]}))},e.prototype.onNodeSelected=function(e){if(this.parent.breadcrumbbarModule&&this.parent.breadcrumbbarModule.searchObj&&!this.renameParent&&(this.parent.breadcrumbbarModule.searchObj.element.value="",this.parent.isFiltered=!1,this.isNodeClickCalled=!1),this.parent.searchedItems=[],!(e.isInteracted||this.isRightClick||this.isSameNodeClicked||this.isPathDragged||this.isRenameParent))return void(this.parent.pathId=f(e.node));this.activeNode=e.node,this.parent.activeModule="navigationpane";var i=this.getTreeData(t.getValue("id",e.nodeData));this.parent.selectedItems=[],this.parent.itemData=i;var n=this.parent.path;!this.isRightClick&&this.isSameNodeClicked?c(e.node,this.parent.itemData[0],this.parent):(this.parent.pathId=f(e.node),this.parent.visitedItem=e.node),e.node.querySelector(".e-icons")&&null===e.node.querySelector("."+Ai)&&(this.expandNodeTarget="add"),n!==this.parent.path&&(!this.isRightClick&&this.isSameNodeClicked&&Ee(this.parent,this.isPathDragged?Xn:En,this.parent.path),this.parent.visitedItem=e.node),this.isPathDragged=this.isRenameParent=this.isRightClick=this.isSameNodeClicked=!1},e.prototype.onPathDrag=function(e){this.isPathDragged=!0,this.selectResultNode(e[0])},e.prototype.onNodeExpand=function(e){if((e.isInteracted||this.isDrag)&&null===e.node.querySelector("."+Ai)){this.isNodeExpandCalled=!0;var i=t.getValue("text",e.nodeData),n=e.node.getAttribute("data-id"),a=!t.isNullOrUndefined(n),s=t.isNullOrUndefined(n)?i:n,r=u(e.node,s,a);this.expandNodeTarget=e.node.getAttribute("data-uid"),this.parent.expandedId=this.expandNodeTarget,this.parent.itemData=this.getTreeData(t.getValue("id",e.nodeData)),this.parent.pathId.push(t.getValue("id",e.nodeData)),Ee(this.parent,"node-expand",r)}},e.prototype.onNodeExpanded=function(e){this.addChild(e.files,this.expandNodeTarget,!1),this.parent.expandedId=null,this.isNodeExpandCalled=!1},e.prototype.onNodeClicked=function(e){if(this.parent.activeModule="navigationpane",this.previousSelected=this.treeObj.selectedNodes,this.activeNode=e.node,3===e.event.which&&e.node.getAttribute("data-uid")!==this.treeObj.selectedNodes[0])this.isRightClick=!0,this.isNodeClickCalled=!0,this.treeObj.setProperties({selectedNodes:[e.node.getAttribute("data-uid")]});else if(e.node.getAttribute("data-uid")===this.treeObj.selectedNodes[0]&&0!==this.parent.selectedItems.length){this.parent.setProperties({selectedItems:[]},!0);var t="LargeIcons"===this.parent.view?"largeiconsview":"detailsview";this.parent.notify(In,{module:t,newProp:{selectedItems:[]}})}else e.node.getAttribute("data-uid")!==this.treeObj.selectedNodes[0]||this.isNodeClickCalled||this.isNodeExpandCalled||(3===e.event.which&&(this.isRightClick=!0),this.isSameNodeClicked=!0,this.isNodeClickCalled=!0)},e.prototype.onNodeEditing=function(e){t.isNullOrUndefined(e.innerHtml)||(e.cancel=!0)},e.prototype.onPathChanged=function(e){this.parent.isCut=!1;var i=t.getValue(this.parent.pathId[this.parent.pathId.length-1],this.parent.feFiles);if("add"===this.expandNodeTarget){var n=t.select('[data-uid="'+this.treeObj.selectedNodes[0]+'"]',this.treeObj.element),a=t.isNullOrUndefined(n)?null:t.select(".e-list-parent",n);t.isNullOrUndefined(a)&&this.addChild(e.files,this.treeObj.selectedNodes[0],!0),this.expandNodeTarget=""}t.isNullOrUndefined(i)&&t.setValue(this.parent.pathId[this.parent.pathId.length-1],e.files,this.parent.feFiles),this.parent.uploadObj.directoryUpload&&!this.parent.hasId&&this.updateTree(e)},e.prototype.updateTree=function(e){if(this.treeObj){var t=this.treeObj.selectedNodes[0];this.updateTreeNode(e,t)}},e.prototype.updateTreeNode=function(e,t){var i=-1!==this.treeObj.expandedNodes.indexOf(t);this.removeChildNodes(t),this.addChild(e.files,t,!i)},e.prototype.removeChildNodes=function(e){var i=t.select('[data-uid="'+e+'"]',this.treeObj.element),n=t.select(".e-list-parent",i),a=n?Array.prototype.slice.call(n.children):null;a&&this.treeObj.removeNodes(a)},e.prototype.onOpenEnd=function(e){var t=this.parent.pathId[this.parent.pathId.length-1];this.treeObj.expandAll(this.treeObj.selectedNodes),this.treeObj.setProperties({selectedNodes:[t]}),this.expandNodeTarget="add",this.onPathChanged(e)},e.prototype.onOpenInit=function(e){"navigationpane"===this.parent.activeModule&&e.target.querySelector(".e-icons")&&this.treeObj.expandAll(this.treeObj.selectedNodes)},e.prototype.onInitialEnd=function(e){this.onInit(),this.addChild(e.files,t.getValue("_fm_id",e.cwd),!1)},e.prototype.onFinalizeEnd=function(e){this.onInit();var i=t.getValue("_fm_id",e.cwd);this.addChild(e.files,i,!1),this.treeObj.setProperties({selectedNodes:[this.parent.pathId[this.parent.pathId.length-1]]})},e.prototype.onCreateEnd=function(e){this.updateTree(e)},e.prototype.onSelectedData=function(){"navigationpane"===this.parent.activeModule&&this.updateItemData()},e.prototype.onDeleteInit=function(){if("navigationpane"===this.parent.activeModule){this.updateActionData();var e=t.getValue("name",this.parent.itemData[0]);Le(this.parent,[e],this.parent.path,"delete")}},e.prototype.onDeleteEnd=function(e){if("navigationpane"===this.parent.activeModule){var i=this.treeObj.selectedNodes[0],n=t.select('[data-uid="'+i+'"]',this.treeObj.element),a=t.closest(n,".e-list-parent").parentElement;this.treeObj.selectedNodes=[a.getAttribute("data-uid")],this.treeObj.dataBind()}this.updateTree(e)},e.prototype.onRefreshEnd=function(e){this.updateTree(e)},e.prototype.onRenameInit=function(){"navigationpane"===this.parent.activeModule&&this.updateRenameData()},e.prototype.onRenameEndParent=function(e){var i=this.renameParent?this.renameParent:this.parent.pathId[this.parent.pathId.length-1];if(this.updateTreeNode(e,i),this.parent.expandedId=null,this.renameParent)this.renameParent=null;else{var n=[];if(this.parent.hasId)n=new a.DataManager(this.treeObj.getTreeData()).executeLocal((new a.Query).where("id","equal",this.parent.renamedId,!1));else{var s=new a.DataManager(this.treeObj.getTreeData()).executeLocal((new a.Query).where(this.treeObj.fields.text,"equal",this.parent.renameText,!1));s.length>0&&(n=new a.DataManager(s).executeLocal((new a.Query).where("_fm_pId","equal",i,!1)))}if(n.length>0){var r=this.previousSelected.length>0&&0!==this.treeObj.getTreeData(this.previousSelected[0]).length?this.previousSelected[0]:t.getValue(this.treeObj.fields.id,n[0]);this.treeObj.selectedNodes=[r],this.treeObj.dataBind(),this.updateItemData()}}},e.prototype.onRenameEnd=function(e){if(""!==this.parent.breadcrumbbarModule.searchObj.element.value||this.parent.isFiltered){var i=this.treeObj.getTreeData(),n=[];if(this.parent.hasId)n=new a.DataManager(i).executeLocal((new a.Query).where("id","equal",this.parent.renamedId,!1));else{var s=new a.DataManager(i).executeLocal((new a.Query).where(this.treeObj.fields.text,"equal",this.parent.currentItemText,!1));s.length>0&&(n=new a.DataManager(s).executeLocal((new a.Query).where("filterPath","equal",this.parent.filterPath,!1)))}n.length>0&&(this.renameParent=t.getValue(this.treeObj.fields.parentID,n[0]),this.parent.expandedId=this.renameParent,this.parent.itemData=this.getTreeData(this.renameParent),Ee(this.parent,Wn,this.parent.filterPath.replace(/\\/g,"/")))}else this.updateTree(e)},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()||"common"===e.module)for(var t=0,i=Object.keys(e.newProp);t<i.length;t++)switch(i[t]){case"allowDragAndDrop":this.addDragDrop();break;case"navigationPaneSettings":Ee(this.parent,wn,this.parent.path),e.oldProp.navigationPaneSettings.sortOrder!==e.newProp.navigationPaneSettings.sortOrder&&(this.treeObj.sortOrder=e.newProp.navigationPaneSettings.sortOrder)}},e.prototype.onDownLoadInit=function(){this.doDownload()},e.prototype.onSelectionChanged=function(e){this.treeObj.setProperties({selectedNodes:[e.selectedNode]})},e.prototype.onClearPathInit=function(e){this.removeChildNodes(e.selectedNode)},e.prototype.onDragEnd=function(e){if(Ae(this.parent)){this.moveNames=[];for(var i=this.parent.dragData,n=0;n<i.length;n++)!1===t.getValue("isFile",i[n])&&this.moveNames.push(t.getValue("_fm_id",i[n]))}var a=[];a=this.parent.isPasteError||this.parent.isSearchDrag?this.getMoveNames(e.files,this.parent.isSearchDrag,this.parent.dragPath):this.moveNames,this.treeObj.removeNodes(a)},e.prototype.getMoveNames=function(e,i,n){for(var s=[],r=0;r<e.length;r++)if(!e[r].isFile&&!this.parent.hasId){var o=e[r].previousName;if(i){var l=(n+=e[r].previousName).lastIndexOf("/");o=n.substring(l+1),n=n.substring(0,l+1)}for(var h=new a.DataManager(this.treeObj.getTreeData()).executeLocal((new a.Query).where(this.treeObj.fields.text,"equal",o,!1)),d=0;d<h.length;d++){var p=t.getValue("filterPath",h[d]);if((p=p.replace(/\\/g,"/"))===n){s.push(t.getValue(this.treeObj.fields.id,h[d]));break}}}return s},e.prototype.onCutEnd=function(e){var t=[];this.parent.isPasteError||this.parent.isSearchCut?this.moveNames=this.getMoveNames(e.files,this.parent.isSearchCut,this.parent.targetPath):t=this.moveNames,this.treeObj.removeNodes(t)},e.prototype.selectResultNode=function(e){if(this.parent.hasId){var i=this.treeObj.getTreeData().filter(function(t){return t.name===e.name})[0];this.treeObj.selectedNodes=[t.getValue("_fm_id",i)],this.treeObj.dataBind()}else{var n=t.getValue("filterPath",e),s=t.getValue("name",e),r=new a.DataManager(this.treeObj.getTreeData()).executeLocal((new a.Query).where(this.treeObj.fields.text,"equal",s,!1));if(r.length>0){var o=new a.DataManager(r).executeLocal((new a.Query).where("filterPath","equal",n,!1));if(o.length>0){var l=t.getValue(this.treeObj.fields.id,o[0]);this.treeObj.selectedNodes=[l],this.treeObj.dataBind()}}}},e.prototype.onDropPath=function(e){this.onpasteEnd(e),this.selectResultNode(this.parent.dropData),this.parent.isDropEnd=!this.parent.isPasteError},e.prototype.onpasteEnd=function(e){var i=[];if(this.parent.hasId)i=new a.DataManager(this.treeObj.getTreeData()).executeLocal((new a.Query).where("id","equal",t.getValue("id",e.cwd),!1));else{var n=new a.DataManager(this.treeObj.getTreeData()).executeLocal((new a.Query).where(this.treeObj.fields.text,"equal",t.getValue("name",e.cwd),!1));n.length>0&&(i=new a.DataManager(n).executeLocal((new a.Query).where("filterPath","equal",t.getValue("filterPath",e.cwd),!1)))}if(i.length>0){var s=t.getValue(this.treeObj.fields.id,i[0]),r=-1===this.treeObj.expandedNodes.indexOf(s);this.removeChildNodes(s),this.addChild(e.files,s,r)}this.parent.expandedId=null,this.onPathChanged(e),this.parent.isDragDrop&&this.checkDropPath(e)},e.prototype.checkDropPath=function(e){(!Ae(this.parent)||this.parent.path!==this.parent.dropPath&&"navigationpane"!==this.parent.targetModule)&&(-1===this.parent.dropPath.indexOf($(this.parent,e))?(this.parent.isDropEnd=!1,ee(this.parent)):this.parent.isDropEnd=!this.parent.isPasteError)},e.prototype.onpasteInit=function(){this.parent.activeModule===this.getModuleName()&&this.updateItemData(),this.moveNames=[];for(var e=this.parent.isDragDrop?this.parent.dragData:this.parent.actionRecords,i=0;i<e.length;i++)!1===t.getValue("isFile",e[i])&&this.moveNames.push(t.getValue("_fm_id",e[i]))},e.prototype.oncutCopyInit=function(){this.parent.activeModule===this.getModuleName()&&(this.parent.activeRecords=this.getTreeData(this.treeObj.selectedNodes[0]),this.parent.activeElements=[this.activeNode])},e.prototype.addEventListener=function(){this.parent.on(In,this.onPropertyChanged,this),this.parent.on("download-init",this.onDownLoadInit,this),this.parent.on(On,this.onInitialEnd,this),this.parent.on(wn,this.onFinalizeEnd,this),this.parent.on(En,this.onPathChanged,this),this.parent.on(Xn,this.onpasteEnd,this),this.parent.on($n,this.onCutEnd,this),this.parent.on(Qn,this.onpasteInit,this),this.parent.on("node-expand",this.onNodeExpanded,this),this.parent.on(Dn,this.onCreateEnd,this),this.parent.on("selected-data",this.onSelectedData,this),this.parent.on(Cn,this.onDeleteInit,this),this.parent.on(xn,this.onDeleteEnd,this),this.parent.on(jn,this.onRefreshEnd,this),this.parent.on("update-tree-selection",this.onSelectionChanged,this),this.parent.on(An,this.onOpenInit,this),this.parent.on(Fn,this.onOpenEnd,this),this.parent.on(Pn,this.destroy,this),this.parent.on(qn,this.onRenameInit,this),this.parent.on(Kn,this.onRenameEnd,this),this.parent.on(Wn,this.onRenameEndParent,this),this.parent.on(Vn,this.onClearPathInit,this),this.parent.on(Jn,this.oncutCopyInit,this),this.parent.on(ia,this.onDropInit,this),this.parent.on(zn,this.onMenuItemData,this),this.parent.on(na,this.onDragEnd,this),this.parent.on(sa,this.onDragging,this),this.parent.on(aa,this.onDropPath,this),this.parent.on(Bn,this.onDetailsInit,this),this.parent.on(Sn,this.onPathDrag,this)},e.prototype.removeEventListener=function(){this.parent.off(On,this.onInitialEnd),this.parent.off("download-init",this.onDownLoadInit),this.parent.off(wn,this.onFinalizeEnd),this.parent.off("selected-data",this.onSelectedData),this.parent.off(In,this.onPropertyChanged),this.parent.off(En,this.onPathChanged),this.parent.off(Xn,this.onpasteEnd),this.parent.off($n,this.onCutEnd),this.parent.off(Qn,this.onpasteInit),this.parent.off("update-tree-selection",this.onSelectionChanged),this.parent.off("node-expand",this.onNodeExpanded),this.parent.off(Dn,this.onCreateEnd),this.parent.off(jn,this.onRefreshEnd),this.parent.off(An,this.onOpenInit),this.parent.off(Fn,this.onOpenEnd),this.parent.off(Pn,this.destroy),this.parent.off(qn,this.onRenameInit),this.parent.off(Kn,this.onRenameEnd),this.parent.off(Wn,this.onRenameEndParent),this.parent.off(Vn,this.onClearPathInit),this.parent.off(Cn,this.onDeleteInit),this.parent.off(xn,this.onDeleteEnd),this.parent.off(Jn,this.oncutCopyInit),this.parent.off(ia,this.onDropInit),this.parent.off(na,this.onDragEnd),this.parent.off(sa,this.onDragging),this.parent.off(aa,this.onDropPath),this.parent.off(Bn,this.onDetailsInit),this.parent.off(zn,this.onMenuItemData),this.parent.off(Sn,this.onPathDrag)},e.prototype.onDetailsInit=function(){if(this.parent.activeModule===this.getModuleName()){var e=this.getTreeData(this.treeObj.selectedNodes[0]);this.parent.itemData=e}},e.prototype.onMenuItemData=function(e){if(this.parent.activeModule===this.getModuleName()){var i=t.closest(e.target,"li");this.parent.itemData=this.getTreeData(i.getAttribute("data-uid"))}},e.prototype.onDragging=function(e){var i=t.closest(e.target,"li");if(i.classList.contains("e-node-collapsed")){this.isDrag=!0;var n=parseInt(i.getAttribute("aria-level"),10);this.treeObj.expandAll([i.getAttribute("data-uid")],n+1),this.isDrag=!1}},e.prototype.onDropInit=function(e){if(this.parent.targetModule===this.getModuleName()){var i=t.closest(e.target,"li");this.parent.dropData=this.getTreeData(i)[0],this.parent.dropPath=this.getDropPath(i,t.getValue("name",this.parent.dropData))}},e.prototype.getModuleName=function(){return"navigationpane"},e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),this.treeObj&&(this.unWireEvents(),this.treeObj.destroy()))},e.prototype.wireEvents=function(){this.keyboardModule=new t.KeyboardEvents(this.treeObj.element,{keyAction:this.keyDown.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},e.prototype.unWireEvents=function(){this.keyboardModule.destroy()},e.prototype.keyDown=function(e){switch(e.action){case"altEnter":this.parent.notify(Bn,{}),Te(this.parent,[],this.parent.path,"details");break;case"esc":v(this.parent);break;case"del":this.parent.pathId[0]!==this.activeNode.getAttribute("data-uid")&&(this.updateItemData(),Ie(this.parent.itemData[0])?(this.removeNodes=[],ut(this.parent,"Delete")):be(this.parent,this.parent.itemData[0],la));break;case"ctrlC":P(this.parent);break;case"ctrlV":this.parent.folderPath="",G(this.parent);break;case"ctrlX":R(this.parent);break;case"shiftF10":if(this.updateItemData(),!De(this.parent.itemData[0]))return void be(this.parent,this.parent.itemData[0],pa);0!==this.parent.selectedItems.length&&this.doDownload();break;case"f2":if(0===this.parent.selectedItems.length){var t=this.getTreeData(this.treeObj.selectedNodes[0])[0];Ie(t)?(this.updateRenameData(),ut(this.parent,"Rename")):be(this.parent,t,la)}}},e.prototype.getTreeData=function(e){for(var i=this.treeObj.getTreeData(e),n=0;n<i.length;n++)t.isNullOrUndefined(t.getValue("hasChild",i[n]))&&t.setValue("hasChild",!1,i[n]);return i},e.prototype.updateRenameData=function(){this.updateItemData(),this.parent.currentItemText=t.getValue("name",this.parent.itemData[0])},e.prototype.updateItemData=function(){var e=this.getTreeData(this.treeObj.selectedNodes[0])[0];this.parent.itemData=[e],this.parent.isFile=!1},e.prototype.updateActionData=function(){this.updateItemData(),c(t.select('[data-uid="'+this.parent.pathId[this.parent.pathId.length-1]+'"]',this.treeObj.element),this.parent.itemData[0],this.parent);var e=X(this.parent.path);this.parent.setProperties({path:e},!0),this.parent.pathId.pop(),this.parent.pathNames.pop()},e.prototype.doDownload=function(){var e=X(this.parent.path),i=this.treeObj.selectedNodes[0]===this.parent.pathId[0]?"":t.getValue("name",this.parent.itemData[0]);pt(this.parent,e,[i])},e}(),wa=function(){function e(e){this.isInteracted=!0,this.interaction=!0,this.isPasteOperation=!1,this.isColumnRefresh=!1,this.dragObj=null,this.startIndex=null,this.firstItemIndex=null,this.isSelectionUpdate=!1,this.currentSelectedItem=[],this.count=0,this.isRendered=!0,this.isLoaded=!1,this.isNameWidth=!1,this.isMultiSelect=!1,this.pasteOperation=!1,this.uploadOperation=!1,s.Grid.Inject(s.Resize,s.ContextMenu,s.Sort,s.VirtualScroll),this.parent=e,this.element=t.select("#"+this.parent.element.id+wi,this.parent.element),this.addEventListener(),this.keyConfigs={altEnter:"alt+enter",esc:"escape",tab:"tab",moveDown:"downarrow",ctrlEnd:"ctrl+end",ctrlHome:"ctrl+home",ctrlDown:"ctrl+downarrow",ctrlLeft:"ctrl+leftarrow",ctrlRight:"ctrl+rightarrow",shiftEnd:"shift+end",shiftHome:"shift+home",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",ctrlUp:"ctrl+uparrow",csEnd:"ctrl+shift+end",csHome:"ctrl+shift+home",csDown:"ctrl+shift+downarrow",csUp:"ctrl+shift+uparrow",space:"space",ctrlSpace:"ctrl+space",shiftSpace:"shift+space",csSpace:"ctrl+shift+space",end:"end",home:"home",moveUp:"uparrow",del:"delete",ctrlX:this.parent.isMac?"cmd+x":"ctrl+x",ctrlC:this.parent.isMac?"cmd+c":"ctrl+c",ctrlV:this.parent.isMac?"cmd+v":"ctrl+v",ctrlShiftN:"ctrl+shift+n",shiftdel:"shift+delete",ctrlD:"ctrl+d",f2:"f2",ctrlA:"ctrl+a",enter:"enter",back:"backspace"}}return e.prototype.render=function(e){var i=this;if(this.parent.enablePersistence){var a=window.localStorage.getItem("grid"+this.parent.element.id+"_grid");if(!t.isNullOrUndefined(a)){var r=JSON.parse(a);!t.isNullOrUndefined(r)&&Object.keys(r).length>0&&"sortSettings"in r&&(delete r.sortSettings,window.localStorage.setItem("grid"+this.parent.element.id+"_grid",JSON.stringify(r)))}}if(n.showSpinner(this.parent.element),"Details"===this.parent.view){t.removeClass([this.parent.element],"e-fe-m-select");var o=A(this.parent,e.files);this.checkNameWidth();var l=this.getColumns(),h=void 0,d=!t.isNullOrUndefined(l)&&-1!==l.findIndex(function(e){return e.field===i.parent.sortBy});this.parent.isMobile||!d?h=[]:"None"!==this.parent.sortOrder&&(h=[{direction:this.parent.sortOrder,field:this.parent.sortBy}]),this.gridObj=new s.Grid({dataSource:o,allowSorting:!0,rowSelecting:this.onSelection.bind(this,"select"),rowDeselecting:this.onSelection.bind(this,"unselect"),rowSelected:this.onSelected.bind(this),rowDeselected:this.onDeSelection.bind(this),allowResizing:this.parent.detailsViewSettings.columnResizing,selectionSettings:{type:this.parent.allowMultiSelection?"Multiple":"Single",checkboxMode:"ResetOnRowClick"},enableRtl:this.parent.enableRtl,pageSettings:{pageSize:20},enableVirtualization:this.parent.enableVirtualization,enablePersistence:this.parent.enablePersistence,enableVirtualMaskRow:!0,sortSettings:{allowUnsort:!1,columns:h},columns:l,recordDoubleClick:this.DblClickEvents.bind(this),beforeDataBound:this.onBeforeDataBound.bind(this),dataBound:this.onDataBound.bind(this),rowDataBound:this.onRowDataBound.bind(this),actionBegin:this.onActionBegin.bind(this),headerCellInfo:this.onHeaderCellInfo.bind(this),width:"100%",height:this.parent.enableVirtualization?this.getGridHeight():"auto",beforeCopy:function(e){e.cancel=!0},load:function(){this.focusModule.destroy()},locale:this.parent.locale}),this.parent.isReact&&(this.gridObj.isReact=!0,this.gridObj.portals=[],this.gridObj.on("reactTemplateRender",this.reactTemplateRender,this)),this.gridObj.isStringTemplate=!0,this.gridObj.appendTo("#"+this.parent.element.id+wi),0!==this.parent.selectedItems.length&&this.parent.enableVirtualization&&this.parent.enablePersistence&&(this.isLoaded=!0),this.wireEvents(),this.adjustHeight(),this.emptyArgs=e}},e.prototype.reactTemplateRender=function(e){this.parent.portals=e,this.parent.portals&&this.parent.toolbarModule&&this.parent.toolbarModule.toolbarObj&&this.parent.toolbarModule.toolbarObj.portals&&(this.parent.portals=this.parent.portals.concat(this.parent.toolbarModule.toolbarObj.portals)),this.parent.notify("renderReactTemplate",this.parent.portals),this.parent.renderReactTemplates()},e.prototype.getGridHeight=function(){var e=t.select("#"+this.parent.element.id+ji,this.parent.element),i=t.select("#"+this.parent.element.id+Ni,this.parent.element);return e.offsetHeight-i.offsetHeight-36},e.prototype.checkNameWidth=function(){var e=this.parent.detailsViewSettings.columns;this.isNameWidth=!1;for(var i=0;i<e.length;i++)if("name"===e[i].field)return void(this.isNameWidth=!t.isNullOrUndefined(e[i].width))},e.prototype.adjustWidth=function(e,t){if(!this.isNameWidth||"name"!==t)for(var i=0;i<e.length;i++)if(e[i].field===t){var n=void 0;n=""!==this.parent.breadcrumbbarModule.searchObj.element.value||this.parent.isFiltered?this.element.clientWidth<=680?"name"===t?"120px":"180px":"auto":this.element.clientWidth<=500?"120px":"auto",e[i].width=n}},e.prototype.getColumns=function(){var e,i=this.parent.enableHtmlSanitizer;if(this.parent.isMobile)e=[{field:"name",headerText:B(this.parent,"Name"),width:"auto",minWidth:120,headerTextAlign:"Left",template:t.initializeCSPTemplate(function(e){return'<div class="e-fe-text">'+(i?t.SanitizeHtmlHelper.sanitize(e.name):e.name)+'</div><div class="e-fe-date">'+e._fm_modified+'</div><span class="e-fe-size">'+e.size+"</span>"})}];else{e=t.extend([],this.parent.detailsViewSettings.columns,null,!0),this.adjustWidth(e,"name");for(var n=this,a=0,s=e.length;a<s;a++)!function(a,s){if(e[a].headerText=B(n.parent,e[a].headerText),"name"===e[a].field&&!t.isNullOrUndefined(e[a].template)&&"function"!=typeof e[a].template){var r=e[a].template;e[a].template=t.initializeCSPTemplate(function(e){var n=i?t.SanitizeHtmlHelper.sanitize(e.name):e.name;return r.replace(/\${name}/g,n)})}}(a)}var r=this.parent.isMobile||this.parent.isBigger?"54":"46",o={field:"type",width:r,minWidth:r,template:t.initializeCSPTemplate(function(e){return'<span class="e-fe-icon '+e._fm_iconClass+'"></span>'}),allowResizing:!1,allowSorting:!0,customAttributes:{class:"e-fe-grid-icon"},headerTemplate:t.initializeCSPTemplate(function(){return"<span class='e-fe-icon e-fe-folder'></span>"})};if(e.unshift(o),this.parent.showItemCheckBoxes){var l=this.parent.isBigger?"36":"26",h={type:"checkbox",width:l,minWidth:l,customAttributes:{class:"e-fe-checkbox"},allowResizing:!1,allowSorting:!1};this.parent.isMobile?e.push(h):e.unshift(h)}for(var a=0,s=e.length;a<s;a++)e[a].disableHtmlEncode=!this.parent.enableHtmlSanitizer;if(this.parent.enableRangeSelection){var d={field:"name",visible:!1,customAttributes:{class:"e-drag-text"}};e.push(d)}return e},e.prototype.adjustHeight=function(){if(this.gridObj){var e=t.select("#"+this.parent.element.id+ji,this.parent.element),i=t.select("#"+this.parent.element.id+Ni,this.parent.element),n=t.select("."+on,this.parent.element),a=e.offsetHeight-i.offsetHeight-n.offsetHeight;this.gridObj.height=a,this.gridObj.dataBind()}},e.prototype.renderCheckBox=function(){this.gridObj.columns=this.getColumns(),this.isColumnRefresh=!0,this.gridObj.refreshColumns()},e.prototype.onRowDataBound=function(e){var i=t.select(".e-fe-grid-name",e.row);if(!i)for(var n=this.parent.detailsViewSettings.columns,a=0;a<n.length;a++)if("name"===n[a].field){i=e.row.children[this.parent.allowMultiSelection?a+2:a+1];break}if(i&&i.setAttribute("title",t.getValue("name",e.data)),this.parent.isLayoutChange&&this.parent.isCut&&"move"===this.parent.fileAction&&this.parent.selectedNodes&&0!==this.parent.selectedNodes.length&&-1!==this.parent.selectedNodes.indexOf(t.getValue("name",e.data))&&I(e.row),!this.parent.showFileExtension&&t.getValue("isFile",e.data)){var s=t.getValue("name",e.data),r=e.row.querySelector('[title= "'+s+'"]');if(r){var o=t.getValue("name",e.data),l=t.getValue("type",e.data);-1!==o.indexOf(l)&&(r.innerHTML=o.substr(0,o.length-l.length))}}if(void 0!==t.getValue("size",e.data)&&e.row.querySelector(".e-fe-size")){var h=e.row.querySelector(".e-fe-size"),d=void 0;if(t.getValue("isFile",e.data)){for(var p=t.getValue("size",e.data),c=new t.Internationalization(this.parent.locale),u=void 0,n=this.parent.detailsViewSettings.columns,a=0;a<n.length;a++)if("size"===n[a].field){u=t.isNullOrUndefined(n[a].format)?"n":n[a].format.toString();break}d=c.formatNumber(p/1024,{format:u})+" "+B(this.parent,"KB")}else d="";h.innerHTML=d}if(this.parent.isMobile&&void 0!==t.getValue("_fm_modified",e.data)&&e.row.querySelector(".e-fe-date")){for(var f=e.row.querySelector(".e-fe-date"),c=new t.Internationalization(this.parent.locale),n=this.parent.detailsViewSettings.columns,g=void 0,a=0;a<n.length;a++)if("dateModified"===n[a].field){g=n[a].format;break}var m=c.formatDate(new Date(t.getValue("_fm_modified",e.data)),g);f.innerHTML=m}var b=e.row.querySelector("."+Ki);b&&b.classList.add("e-small"),Ie(e.data)||(e.row.className+=" "+ve(e.data));var v={element:e.row,fileDetails:e.data,module:"DetailsView"};this.parent.trigger("fileLoad",v)},e.prototype.onActionBegin=function(e){if("sorting"===e.requestType){if(this.parent.setProperties({sortOrder:e.direction},!0),this.parent.setProperties({sortBy:e.columnName},!0),0!==this.parent.selectedItems.length){this.sortItem=!0;var i=this.gridObj.getSelectedRowIndexes(),n=i.length;for(this.sortSelectedNodes=[];n>0;){var a=this.gridObj.getRowsObject()[i[n-1]].data;this.sortSelectedNodes.push(t.getValue(this.parent.hasId?"id":"name",a)),n--}}this.parent.notify(Hn,{})}},e.prototype.onHeaderCellInfo=function(e){var t=e.node.querySelector("."+Ki);t&&t.classList.add("e-small")},e.prototype.onBeforeDataBound=function(e){var t=this;n.showSpinner(this.parent.element);var i=this.parent.detailsViewSettings.columns.find(function(e){return e.field===t.parent.sortBy});if(i&&!("sortComparer"in i)){var a=A(this.parent,this.parent.enableVirtualization?e.result:this.gridObj.dataSource);e.result=a}},e.prototype.onDataBound=function(){if(this.createDragObj(),(0!==this.parent.selectedItems.length&&!this.parent.enableVirtualization||this.isLoaded)&&this.selectRecords(this.parent.selectedItems),!0===this.isPasteOperation&&!t.isNullOrUndefined(this.gridObj.getDataRows())&&this.gridObj.getDataRows().length>0&&(this.isColumnRefresh?this.isColumnRefresh=!1:(this.selectRecords(this.parent.pasteNodes),this.isPasteOperation=!1)),this.parent.createdItem&&(this.selectRecords([t.getValue(this.parent.hasId?"id":"name",this.parent.createdItem)]),this.parent.createdItem=null),this.parent.layoutSelectedItems.length&&this.selectRecords(this.parent.layoutSelectedItems),this.parent.renamedItem&&(this.addSelection(this.parent.renamedItem),this.parent.renamedItem=null),!0===this.sortItem&&(this.selectRecords(this.sortSelectedNodes),this.sortItem=!1),this.isSelectionUpdate&&(this.isColumnRefresh?this.isColumnRefresh=!1:(this.selectRecords(this.currentSelectedItem),this.isSelectionUpdate=!1)),!0===this.uploadOperation&&(this.count++,this.selectRecords(this.parent.uploadItem),this.count===this.parent.uploadItem.length&&(this.uploadOperation=!1,this.parent.uploadItem=[])),this.gridObj.currentViewData.length*this.gridObj.getRowHeight()<this.gridObj.height)(e=this.gridObj.getHeaderContent()).style.paddingRight="",e.style.paddingLeft="",t.select(".e-headercontent",e).style.borderRightWidth="0",(i=this.gridObj.getContent().querySelector(".e-content")).style.overflowY="",i.classList.add("e-scrollShow");else{var e=this.gridObj.getHeaderContent();this.parent.enableRtl?e.style.paddingLeft="16px":e.style.paddingRight="16px";var i=this.gridObj.getContent().querySelector(".e-content");i.classList.remove("e-scrollShow")}this.isRendered=!0,this.parent.isLayoutChange=!1,n.hideSpinner(this.parent.element),this.checkEmptyDiv(this.emptyArgs),this.isInteracted=!!this.isLoaded||this.isInteracted,this.isLoaded=!1},e.prototype.selectRecords=function(e){for(var i=this.gridObj.getCurrentViewRecords(),n=[],a=0,s=i.length;a<s;a++){var r=this.parent.hasId?t.getValue("id",i[a]):T(this.parent,i[a]);if(-1!==e.indexOf(r))n.push(a);else if(!this.parent.showFileExtension&&!this.parent.hasId&&r.includes(".")){var o=r.split(".").slice(0,-1).join(".");-1!==e.indexOf(o)&&n.push(a)}}0!==n.length&&(this.gridObj.selectRows(n),this.addFocus(this.gridObj.selectedRowIndex))},e.prototype.addSelection=function(e){var i=this.gridObj.getCurrentViewRecords(),n=[];if(this.parent.hasId)n=new a.DataManager(i).executeLocal((new a.Query).where("id","equal",this.parent.renamedId,!1));else{var s=new a.DataManager(i).executeLocal((new a.Query).where("name","equal",t.getValue("name",e),!1));s.length>0&&(n=new a.DataManager(s).executeLocal((new a.Query).where("filterPath","equal",this.parent.filterPath,!1)))}if(n.length>0){var r=i.indexOf(n[0]);this.gridObj.selectRows([r])}},e.prototype.onSortColumn=function(){"None"!==this.parent.sortOrder?this.gridObj.sortModule.sortColumn(this.parent.sortBy,this.parent.sortOrder):this.gridObj.dataSource=A(this.parent,this.gridObj.dataSource),0!==this.element.querySelector(".e-content").scrollTop&&this.gridObj.freezeRefresh()},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()||"common"===e.module)for(var i=0,n=Object.keys(e.newProp);i<n.length;i++)switch(n[i]){case"allowDragAndDrop":this.createDragObj();break;case"height":this.adjustHeight();break;case"detailsViewSettings":if(!t.isNullOrUndefined(this.gridObj)){this.checkNameWidth();var a=this.getColumns();this.gridObj.columns=a,this.gridObj.allowResizing=this.parent.detailsViewSettings.columnResizing,this.gridObj.dataBind(),this.gridObj.refreshColumns()}break;case"selectedItems":if(this.interaction=!1,0!==this.parent.selectedItems.length){if(!this.parent.allowMultiSelection){var s=this.parent.selectedItems.slice(this.parent.selectedItems.length-1);this.parent.setProperties({selectedItems:s},!0)}this.selectRecords(this.parent.selectedItems),this.parent.setProperties({selectedItems:this.parent.selectedItems},!0)}else t.isNullOrUndefined(this.gridObj)||(this.gridObj.clearSelection(),this.interaction=!0);break;case"showFileExtension":case"showHiddenItems":Ee(this.parent,En,this.parent.path);break;case"showItemCheckBoxes":case"allowMultiSelection":t.isNullOrUndefined(this.gridObj)||(this.currentSelectedItem=this.parent.selectedItems,this.gridObj.selectionSettings.type=e.newProp.allowMultiSelection?"Multiple":"Single",this.isSelectionUpdate=!0,this.renderCheckBox());break;case"view":C(this.parent,"Details");break;case"width":this.onDetailsResize()}},e.prototype.onPathChanged=function(e){this.parent.isCut=!1;var i=this.parent.detailsViewSettings.columns.find(function(e){return"filterPath"===e.field});(""===this.parent.breadcrumbbarModule.searchObj.element.value.trim()&&this.gridObj||!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.hideAtMedia)&&""!==i.hideAtMedia)&&(this.parent.searchedItems=[],this.parent.isFiltered?this.updatePathColumn():this.removePathColumn(!1)),O(this.parent),"Details"===this.parent.view&&(this.isInteracted=!1,n.showSpinner(this.parent.element),this.parent.setProperties({selectedItems:[]},!0),this.gridObj.dataSource=A(this.parent,e.files),this.gridObj.freezeRefresh(),this.parent.isReact&&this.gridObj.on("reactTemplateRender",this.reactTemplateRender,this),this.wireClickEvent(!0)),this.emptyArgs=e},e.prototype.updatePathColumn=function(){var e=this.gridObj.columns.length,t=JSON.parse(JSON.stringify(this.gridObj.columns));if(t[e-1].field&&"filterPath"!==t[e-1].field&&!this.parent.isMobile){var i={field:"filterPath",headerText:B(this.parent,"Path"),minWidth:180,width:"auto"};this.gridObj.columns.push(i),this.adjustWidth(this.gridObj.columns,"filterPath"),this.adjustWidth(this.gridObj.columns,"name"),this.isColumnRefresh=!0,this.gridObj.refreshColumns()}},e.prototype.checkEmptyDiv=function(e){var i=A(this.parent,e.files);if(0!==i.length||t.isNullOrUndefined(this.element.querySelector("."+dn))){if(0!==i.length&&this.element.querySelector("."+Gi))if(this.element.querySelector("."+dn).querySelector("."+Gi)){var n=this.element.querySelector("."+dn).querySelector("."+Gi);this.element.querySelector("."+dn).removeChild(n)}else this.element.removeChild(this.element.querySelector("."+Gi))}else U(this.parent,this.element,e)},e.prototype.onOpenInit=function(){if("detailsview"===this.parent.activeModule){var e=this.gridObj.getSelectedRecords()[0];this.openContent(e)}},e.prototype.DblClickEvents=function(e){this.gridObj.selectRows([e.rowIndex]);var t;e.rowData&&(t=JSON.parse(JSON.stringify(e.rowData)),this.openContent(t))},e.prototype.openContent=function(e){var i=this;if(!ye(e))return void be(this.parent,e,oa);var n={cancel:!1,fileDetails:e,module:"DetailsView"};this.parent.trigger("fileOpen",n,function(n){if(!n.cancel){var a=t.getValue("name",e);if(t.getValue("isFile",e)){if(M(e)===tn){var s=k(i.parent,e);Bt(i.parent,a,s)}}else{if(""!==i.parent.breadcrumbbarModule.searchObj.element.value||i.parent.isFiltered)Y(i.parent,e);else{var r=t.getValue("id",e);i.parent.oldPath=i.parent.path;var o=i.parent.path+(t.isNullOrUndefined(r)?a:r)+"/";i.parent.setProperties({path:o},!0),i.parent.pathNames.push(a),i.parent.pathId.push(t.getValue("_fm_id",e)),i.parent.itemData=[e],N(i.parent)}i.parent.isFiltered=!1}i.element.focus(),i.parent.enableVirtualization&&i.parent.element.querySelector("#"+i.parent.element.id+Ci).focus()}})},e.prototype.onLayoutChange=function(e){"Details"===this.parent.view&&(this.parent.enableVirtualization&&this.parent.setProperties({selectedItems:[]},!0),this.gridObj?this.isLoaded=!0:this.render(e),this.parent.isFiltered&&(this.updatePathColumn(),this.parent.setProperties({selectedItems:[]},!0)),this.gridObj.dataSource=A(this.parent,e.files),this.parent.notify("hide-layout",{}),this.gridObj.element.classList.remove(bn),this.isInteracted=!1,this.gridObj.clearSelection(),""!==this.parent.breadcrumbbarModule.searchObj.element.value.trim()&&this.onSearchFiles(e),this.adjustHeight(),this.gridObj.sortSettings.columns.length>0&&this.gridObj.sortSettings.columns[0].field!==this.parent.sortBy&&"None"!==this.parent.sortOrder&&this.gridObj.sortColumn(this.parent.sortBy,this.parent.sortOrder))},e.prototype.onSearchFiles=function(e){"Details"===this.parent.view&&(this.parent.setProperties({selectedItems:[]},!0),this.parent.notify(Un,{}),this.parent.isLayoutChange||(this.parent.layoutSelectedItems=[]),this.updatePathColumn(),this.parent.searchedItems=e.files,this.onPathChanged(e))},e.prototype.removePathColumn=function(e){var i=this.gridObj.columns.length,n=JSON.parse(JSON.stringify(this.gridObj.columns)),a=this.parent.detailsViewSettings.columns.some(function(e){return"filterPath"===e.field});n[i-1].field&&"filterPath"===n[i-1].field&&!a&&(t.isNullOrUndefined(this.gridObj.sortSettings.columns[0])||"filterPath"!==this.gridObj.sortSettings.columns[0].field||("None"!==this.parent.sortOrder?this.gridObj.sortColumn("name",this.parent.sortOrder):this.gridObj.dataSource=A(this.parent,this.gridObj.dataSource),this.parent.notify(Hn,{})),this.gridObj.columns.pop(),e||(this.isColumnRefresh=!0,this.gridObj.refreshColumns()))},e.prototype.onFinalizeEnd=function(e){"Details"===this.parent.view&&(this.gridObj?this.onPathChanged(e):this.render(e))},e.prototype.onCreateEnd=function(e){"Details"===this.parent.view&&this.onPathChanged(e)},e.prototype.onRenameInit=function(){"detailsview"===this.parent.activeModule&&1===this.parent.selectedItems.length&&this.updateRenameData()},e.prototype.onSelectedData=function(){"detailsview"===this.parent.activeModule&&(this.parent.itemData=this.gridObj.getSelectedRecords())},e.prototype.onDeleteInit=function(){"detailsview"===this.parent.activeModule&&Le(this.parent,this.parent.selectedItems,this.parent.path,"delete")},e.prototype.onDeleteEnd=function(e){"Details"===this.parent.view&&(this.onPathChanged(e),this.parent.setProperties({selectedItems:[]},!0))},e.prototype.onRefreshEnd=function(e){"Details"===this.parent.view&&(this.isInteracted=!1,this.removePathColumn(!1),this.gridObj.dataSource=A(this.parent,e.files),this.emptyArgs=e)},e.prototype.onHideLayout=function(){"Details"!==this.parent.view&&this.gridObj&&this.gridObj.element.classList.add(bn)},e.prototype.onSelectAllInit=function(){"Details"===this.parent.view&&(this.isInteracted=!1,this.parent.allowMultiSelection?this.gridObj.selectionModule.selectRowsByRange(0,this.gridObj.getRows().length):this.gridObj.selectRow(this.gridObj.getRows().length-1),this.isInteracted=!0,this.interaction=!0)},e.prototype.onClearAllInit=function(){"Details"===this.parent.view&&(this.removeSelection(),this.interaction=!0)},e.prototype.onSelectionChanged=function(){t.removeClass([this.element],"e-headercheck"),this.parent.selectedItems.length>0&&t.addClass([this.element],"e-headercheck")},e.prototype.onLayoutRefresh=function(){"Details"===this.parent.view&&this.adjustHeight()},e.prototype.onBeforeRequest=function(){this.isRendered=!1},e.prototype.onAfterRequest=function(){this.isRendered=!0},e.prototype.onUpdateSelectionData=function(){"Details"===this.parent.view&&(this.parent.itemData=this.gridObj.getSelectedRecords())},e.prototype.addEventListener=function(){this.parent.on(wn,this.onFinalizeEnd,this),this.parent.on(Pn,this.destroy,this),this.parent.on(_n,this.onLayoutChange,this),this.parent.on(En,this.onPathChanged,this),this.parent.on(Dn,this.onCreateEnd,this),this.parent.on(ia,this.onDropInit,this),this.parent.on(Bn,this.onDetailsInit,this),this.parent.on(jn,this.onRefreshEnd,this),this.parent.on(Tn,this.onSearchFiles,this),this.parent.on(ra,this.onMethodCall,this),this.parent.on(Ln,this.onActionFailure,this),this.parent.on(In,this.onPropertyChanged,this),this.parent.on(Cn,this.onDeleteInit,this),this.parent.on(xn,this.onDeleteEnd,this),this.parent.on("selected-data",this.onSelectedData,this),this.parent.on(qn,this.onRenameInit,this),this.parent.on(Kn,this.onPathChanged,this),this.parent.on(An,this.onOpenInit,this),this.parent.on(Zn,this.onSortColumn,this),this.parent.on(Fn,this.onPathChanged,this),this.parent.on("filter-end",this.onPathChanged,this),this.parent.on(Qn,this.onPasteInit,this),this.parent.on("hide-layout",this.onHideLayout,this),this.parent.on("select-all-init",this.onSelectAllInit,this),this.parent.on("clear-all-init",this.onClearAllInit,this),this.parent.on(ea,this.onPathColumn,this),this.parent.on(Un,this.onSelectionChanged,this),this.parent.on(Rn,this.onBeforeRequest,this),this.parent.on(kn,this.onAfterRequest,this),this.parent.on(Xn,this.onpasteEnd,this),this.parent.on(Jn,this.oncutCopyInit,this),this.parent.on(zn,this.onMenuItemData,this),this.parent.on(Nn,this.onDetailsResizeHandler,this),this.parent.on("splitter-resize",this.onDetailsResize,this),this.parent.on("layout-refresh",this.onLayoutRefresh,this),this.parent.on(aa,this.onDropPath,this),this.parent.on("update-selection-data",this.onUpdateSelectionData,this)},e.prototype.removeEventListener=function(){this.parent.off(wn,this.onFinalizeEnd),this.parent.off(Pn,this.destroy),this.parent.off(_n,this.onLayoutChange),this.parent.off(En,this.onPathChanged),this.parent.off(Qn,this.onPasteInit),this.parent.off(Dn,this.onCreateEnd),this.parent.off(jn,this.onRefreshEnd),this.parent.off(Tn,this.onSearchFiles),this.parent.off(ra,this.onMethodCall),this.parent.off(Ln,this.onActionFailure),this.parent.off(In,this.onPropertyChanged),this.parent.off(qn,this.onRenameInit),this.parent.off(Kn,this.onPathChanged),this.parent.off("filter-end",this.onPathChanged),this.parent.off(An,this.onOpenInit),this.parent.off(Zn,this.onSortColumn),this.parent.off(Fn,this.onPathChanged),this.parent.off("hide-layout",this.onHideLayout),this.parent.off("select-all-init",this.onSelectAllInit),this.parent.off("clear-all-init",this.onClearAllInit),this.parent.off(Cn,this.onDeleteInit),this.parent.off(xn,this.onDeleteEnd),this.parent.off(ea,this.onPathColumn),this.parent.off(Un,this.onSelectionChanged),this.parent.off(Rn,this.onBeforeRequest),this.parent.off(kn,this.onAfterRequest),this.parent.off(Xn,this.onpasteEnd),this.parent.off(Jn,this.oncutCopyInit),this.parent.off(ia,this.onDropInit),this.parent.off("selected-data",this.onSelectedData),this.parent.off(Bn,this.onDetailsInit),this.parent.off(zn,this.onMenuItemData),this.parent.off(Nn,this.onDetailsResizeHandler),this.parent.off("splitter-resize",this.onDetailsResize),this.parent.off("layout-refresh",this.onLayoutRefresh),this.parent.off(aa,this.onDropPath),this.parent.off("update-selection-data",this.onUpdateSelectionData)},e.prototype.onActionFailure=function(){this.interaction=!0},e.prototype.onMenuItemData=function(e){this.parent.activeModule===this.getModuleName()&&(this.parent.itemData=[this.gridObj.getRowInfo(e.target).rowData])},e.prototype.onPasteInit=function(){this.parent.activeModule===this.getModuleName()&&(this.parent.itemData=""!==this.parent.folderPath?this.gridObj.getSelectedRecords():[E(this.parent)])},e.prototype.onDetailsInit=function(){this.parent.activeModule===this.getModuleName()&&(0!==this.parent.selectedItems.length?this.parent.itemData=this.gridObj.getSelectedRecords():this.parent.itemData=[t.getValue(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent)])},e.prototype.dragHelper=function(e){var t=e.sender.target.closest("tr.e-row");if(!t)return null;var i;t.getElementsByClassName("e-fe-text")[0]?i=this.parent.hasId?this.gridObj.getRowInfo(t).rowData.id:t.getElementsByClassName("e-fe-text")[0].innerText:t.getElementsByClassName("e-rowcell e-templatecell")[0].nextElementSibling&&(i=this.parent.hasId?this.gridObj.getRowInfo(t).rowData.id:t.getElementsByClassName("e-rowcell e-templatecell")[0].nextElementSibling.innerText),t&&!t.querySelector(".e-active")&&this.selectRecords([i]),w(this.parent,t),this.parent.activeElements=[],this.parent.dragData=[],this.parent.dragData=this.gridObj.getSelectedRecords();var n;return 0===this.parent.dragData.length&&t&&(n=this.gridObj.getRowInfo(t)),n&&this.parent.dragData.push(n.rowData),this.parent.dragPath=this.parent.path,this.parent.activeElements=this.gridObj.getSelectedRows(),ie(this.parent),this.parent.virtualDragElement},e.prototype.onDetailsResize=function(){if("Details"===this.parent.view&&!this.parent.isMobile&&!t.isNullOrUndefined(this.gridObj))for(var e=this.gridObj.getHeaderContent().querySelector(".e-headercontent").firstChild.childNodes[0],i=this.gridObj.getContent().querySelector(".e-content .e-table").children[0],n=this.gridObj.getColumns(),a=0;a<n.length;a++)(!this.isNameWidth&&"name"===n[a].field||"filterPath"===n[a].field)&&(""!==this.parent.breadcrumbbarModule.searchObj.element.value||this.parent.isFiltered?this.element.clientWidth<=680?"name"===n[a].field?(e.children[a].style.width="120px",i.children[a].style.width="120px"):(e.children[a].style.width="180px",i.children[a].style.width="180px"):this.element.clientWidth>680&&(e.children[a].style.width="auto",i.children[a].style.width="auto"):this.element.clientWidth<=500?(e.children[a].style.width="120px",i.children[a].style.width="120px"):this.element.clientWidth>500&&(e.children[a].style.width="auto",i.children[a].style.width="auto"))},e.prototype.onDetailsResizeHandler=function(){this.onDetailsResize(),"Details"!==this.parent.view||this.parent.isMobile||t.isNullOrUndefined(this.gridObj)||this.adjustHeight()},e.prototype.createDragObj=function(){var e=this;this.gridObj&&(this.parent.allowDragAndDrop&&t.isNullOrUndefined(this.dragObj)?this.dragObj=new t.Draggable(this.gridObj.element,{cursorAt:this.parent.dragCursorPosition,distance:5,enableTailMode:!0,dragArea:this.parent.element,dragTarget:"."+Yi,drag:he.bind(this,this.parent),dragStart:function(t){ae(e.parent,t,e.dragObj)},dragStop:ne.bind(this,this.parent),enableAutoScroll:!1,helper:this.dragHelper.bind(this)}):!this.parent.allowDragAndDrop&&this.dragObj&&(this.dragObj.destroy(),this.dragObj=null))},e.prototype.onDropInit=function(e){if(this.parent.targetModule===this.getModuleName()){var i=t.getValue(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent);if(e.target.closest("tr")){var n=null;n=this.gridObj.getRowInfo(e.target).rowData,this.parent.dropPath=n.isFile?this.parent.path:L(this.parent,n,this.parent.path),this.parent.dropData=n.isFile?i:n}else this.parent.dropPath=this.parent.path,this.parent.dropData=i}},e.prototype.oncutCopyInit=function(){this.parent.activeModule===this.getModuleName()&&(this.parent.activeRecords=this.gridObj.getSelectedRecords(),this.parent.activeElements=this.gridObj.getSelectedRows())},e.prototype.onpasteEnd=function(e){"Details"===this.parent.view&&(this.isPasteOperation=!0,(this.parent.path===this.parent.destinationPath||this.parent.path===$(this.parent,e)||this.parent.hasId)&&this.onPathChanged(e))},e.prototype.onDropPath=function(e){"Details"===this.parent.view&&(this.isPasteOperation=!0,this.onPathChanged(e))},e.prototype.getModuleName=function(){return"detailsview"},e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),this.gridObj&&(this.parent.isReact&&this.gridObj.off("reactTemplateRender",this.reactTemplateRender),this.unWireEvents(),this.gridObj.destroy()))},e.prototype.updateType=function(e){var i=t.select("."+en,e);this.parent.isFile=!!t.isNullOrUndefined(i)},e.prototype.onSelection=function(e,t){var i={action:e,fileDetails:t.data,isInteracted:this.interaction,cancel:!1,target:t.target};if(this.parent.trigger("fileSelection",i),t.cancel=i.cancel,!this.isMultiSelect){if(this.isMultiSelect=!0,(t.isShiftPressed||t.isCtrlPressed)&&!this.parent.allowMultiSelection&&t.target&&t.target.parentElement&&!t.target.parentElement.classList.contains("e-checkbox-wrapper")){t.cancel=!0;var n=t&&t.rowIndexes?t.rowIndexes[t.rowIndexes.length-1]:t.rowIndex;this.gridObj.selectRow(n)}this.isMultiSelect=!1}},e.prototype.onSelected=function(e){this.parent.activeModule="detailsview",this.parent.isLayoutChange&&!this.parent.isFiltered||this.selectedRecords(),this.parent.notify(Un,{}),1===this.gridObj.getSelectedRowIndexes().length&&(this.firstItemIndex=this.gridObj.selectedRowIndex),this.gridObj.element.setAttribute("tabindex","-1"),this.triggerSelect("select",e);var i=this.gridObj.getRowByIndex(this.gridObj.selectedRowIndex);if(this.updateType(i),!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.querySelector(".e-checkselect"))){if(1!==this.gridObj.getSelectedRowIndexes().length){var n=this.gridObj.getSelectedRowIndexes()[this.gridObj.getSelectedRowIndexes().length-2],a=this.gridObj.getRowByIndex(n);t.isNullOrUndefined(a)||a.querySelector(".e-checkselect").setAttribute("tabindex","-1")}i.querySelector(".e-rowcell.e-fe-checkbox").removeAttribute("tabindex")}t.isNullOrUndefined(this.gridObj)||t.isNullOrUndefined(this.gridObj.element.querySelector(".e-checkselectall"))||this.gridObj.element.querySelector(".e-checkselectall").setAttribute("tabindex","-1");var s=this.gridObj.getSelectedRowIndexes();if(!this.parent.allowMultiSelection)for(var r=0;r<s.length;r++)s[r]===this.gridObj.selectedRowIndex?this.gridObj.getRowByIndex(s[r]).setAttribute("tabindex","0"):this.gridObj.getRowByIndex(s[r]).removeAttribute("tabindex");var o=s.length;if(this.parent.enableVirtualization)this.parent.currentItemText=t.getValue("name",e.data);else if(o>0){var l=this.gridObj.getRowsObject()[s[o-1]].data;this.parent.currentItemText=t.getValue("name",l)}var h=t.getValue("rowIndexes",e),d=t.getValue("enableSelectMultiTouch",this.gridObj.selectionModule);this.parent.isDevice&&t.isNullOrUndefined(h)&&e.target&&!d&&!e.target.closest(".e-headercell")&&(this.parent.isFile=t.getValue("isFile",e.data),this.parent.isFile||this.openContent(e.data)),this.parent.visitedItem=e.row,this.parent.enableVirtualization&&e.isHeaderCheckboxClicked||this.addFocus(this.gridObj.selectedRowIndex),this.parent.isLayoutChange||(this.isInteracted=!0)},e.prototype.onPathColumn=function(){"Details"!==this.parent.view||t.isNullOrUndefined(this.gridObj)||""!==this.parent.breadcrumbbarModule.searchObj.element.value||this.parent.isFiltered||this.removePathColumn(!1)},e.prototype.selectedRecords=function(){this.parent.setProperties({selectedItems:[]},!0);for(var e=this.gridSelectNodes(),t=0;t<e.length;){var i=e[t],n=pe(this.parent,i);this.parent.selectedItems.push(n),t++}this.parent.setProperties({selectedItems:this.parent.selectedItems},!0)},e.prototype.onDeSelection=function(e){if(!this.parent.allowMultiSelection&&t.isNullOrUndefined(e.data)){var i=this.gridObj.getRowByIndex(e.rowIndex);t.isNullOrUndefined(i)||i.removeAttribute("tabindex")}else if(this.gridObj.getSelectedRowIndexes().length>1){var n=this.gridObj.getSelectedRowIndexes()[this.gridObj.getSelectedRowIndexes().length-2],a=this.gridObj.getRowByIndex(n);t.isNullOrUndefined(a)||a.querySelector(".e-checkselect").removeAttribute("tabindex")}if(-1===this.gridObj.selectedRowIndex&&this.gridObj.element.setAttribute("tabindex","0"),!this.isInteracted)return void(this.isInteracted=!0);this.selectedRecords(),0===this.parent.selectedItems.length&&(t.setValue("enableSelectMultiTouch",!1,this.gridObj.selectionModule),t.removeClass([this.parent.element],"e-fe-m-select")),this.parent.notify(Un,{}),this.triggerSelect("unselect",e),this.parent.visitedItem=null},e.prototype.triggerSelect=function(e,t){var i={action:e,fileDetails:t.data,isInteracted:this.interaction};this.parent.trigger("fileSelect",i),this.interaction=!0},e.prototype.wireEvents=function(){this.wireClickEvent(!0),this.keyboardModule=new t.KeyboardEvents(this.gridObj.element,{keyAction:this.keyupHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keyup"}),this.keyboardDownModule=new t.KeyboardEvents(this.element,{keyAction:this.keydownHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),t.EventHandler.add(this.gridObj.element,"blur",this.removeFocus,this),t.EventHandler.add(this.parent.element,"focusout",this.onBlur,this)},e.prototype.unWireEvents=function(){this.wireClickEvent(!1),this.keyboardModule.destroy(),this.keyboardDownModule.destroy(),t.EventHandler.remove(this.gridObj.element,"blur",this.removeFocus),t.EventHandler.remove(this.parent.element,"focusout",this.onBlur)},e.prototype.wireClickEvent=function(e){var i=this;if(e){var n=this.gridObj.getContent();this.clickObj=new t.Touch(n,{tap:function(e){1===e.tapCount&&e.originalEvent.target.classList.contains("e-content")&&i.onClearAllInit()},tapHold:function(e){if(i.parent.isDevice){e.originalEvent.preventDefault(),i.parent.allowMultiSelection&&(t.setValue("enableSelectMultiTouch",i.parent.allowMultiSelection,i.gridObj.selectionModule),t.addClass([i.parent.element],"e-fe-m-select"));var n=e.originalEvent.target;if(n){var a=t.closest(n,"."+Yi),s=i.gridObj.getRows().indexOf(a);i.gridObj.selectRow(s)}}}})}else this.clickObj&&this.clickObj.destroy()},e.prototype.removeSelection=function(){t.removeClass([this.parent.element],"e-fe-m-select"),this.gridObj.clearSelection(),this.parent.setProperties({selectedItems:[]},!0),this.parent.notify(Un,{}),-1===this.gridObj.selectedRowIndex&&(this.startIndex=null),this.isInteracted=!0},e.prototype.removeFocus=function(){this.addFocus(null)},e.prototype.onBlur=function(e){if((null===e.relatedTarget||t.closest(e.relatedTarget,".e-grid")===e.relatedTarget)&&!t.isNullOrUndefined(this.gridObj.element))for(var i=this.gridObj.element.querySelectorAll("th"),n=0;n<i.length;n++)i[n].classList.contains("e-focus")&&this.addFocus(null)},e.prototype.getFocusedItemIndex=function(){return t.isNullOrUndefined(this.getFocusedItem())?null:parseInt(this.getFocusedItem().getAttribute("aria-rowindex"),10)-1},e.prototype.keydownHandler=function(e){if(this.isRendered)switch(e.action){case"end":case"home":case"space":case"ctrlSpace":case"shiftSpace":case"csSpace":case"ctrlA":case"enter":case"altEnter":case"ctrlEnd":case"shiftEnd":case"csEnd":case"ctrlHome":case"shiftHome":case"csHome":case"ctrlDown":case"shiftDown":case"csDown":case"ctrlLeft":case"shiftLeft":case"csLeft":case"esc":case"del":case"shiftdel":case"ctrlC":case"ctrlV":case"ctrlX":case"f2":case"moveDown":case"moveUp":case"ctrlD":e.preventDefault()}},e.prototype.keyupHandler=function(e){if(this.isRendered){e.preventDefault();var i,n,a,s=e.action,r=A(this.parent,this.gridObj.dataSource),o=r.length,l=this.getFocusedItemIndex(),h=this.gridObj.selectedRowIndex,d=this.gridObj.getSelectedRowIndexes();switch(s){case"altEnter":this.parent.notify(Bn,{}),Te(this.parent,this.parent.selectedItems,this.parent.path,"details");break;case"esc":v(this.parent);break;case"del":case"shiftdel":this.performDelete();break;case"enter":if(-1===this.gridObj.selectedRowIndex&&!0===this.gridObj.allowSorting){if(!e.target.classList.contains("e-fe-grid-icon")){var p=e.target.getElementsByClassName("e-ascending").length?"Descending":"Ascending",c=this.gridObj.getColumnByUid(e.target.querySelector(".e-headercelldiv").getAttribute("e-mappinguid")).field;this.gridObj.sortColumn(c,p),t.isNullOrUndefined(this.getFocusedItem().nextSibling)||this.getFocusedItem().nextSibling.setAttribute("tabindex","0")}break}if(i=this.gridObj.getRowsObject()[this.gridObj.selectedRowIndex].data){var u=JSON.parse(JSON.stringify(i));this.openContent(u)}break;case"ctrlC":P(this.parent);break;case"ctrlV":this.parent.folderPath="",G(this.parent);break;case"ctrlX":R(this.parent);break;case"ctrlD":this.doDownload();break;case"f2":this.performRename();break;case"ctrlA":if(!t.isNullOrUndefined(r[0])&&this.parent.allowMultiSelection){var f=this.gridObj.getContent().querySelector(".e-content"),g=f.scrollTop,m=this.gridObj.selectedRowIndex;this.gridObj.selectionModule.selectRowsByRange(0,r.length-1),f.scrollTop=g,-1!==m&&this.addFocus(m)}break;case"ctrlHome":case"tab":if(!t.isNullOrUndefined(r[0]))if(this.parent.allowMultiSelection||"ctrlHome"!==e.action){if(-1!==this.gridObj.selectedRowIndex&&"tab"===e.action)return;this.addHeaderFocus(e)}else this.gridObj.selectRow(0);break;case"ctrlEnd":t.isNullOrUndefined(r[0])||(this.parent.allowMultiSelection?this.addFocus(o-1):this.gridObj.selectRow(o-1));break;case"shiftHome":case"shiftEnd":case"csHome":case"csEnd":this.parent.allowMultiSelection?t.isNullOrUndefined(r[0])||(t.isNullOrUndefined(h)||-1===h?"csHome"===e.action||"shiftHome"===e.action?this.gridObj.selectRow(0):this.gridObj.selectionModule.selectRowsByRange(0,r.length-1):this.checkRowsKey(r,h,null,e)):this.gridObj.selectRow("shiftHome"===e.action||"csHome"===e.action?0:r.length-1);break;case"space":case"csSpace":case"shiftSpace":case"ctrlSpace":this.spaceSelection(d,l,h,e);break;case"csUp":case"csDown":case"shiftUp":case"shiftDown":this.shiftMoveMethod(r,h,l,d,e);break;case"ctrlUp":case"ctrlDown":this.parent.allowMultiSelection?this.ctrlMoveFunction(r,e,h):this.moveFunction(r,e,h);break;case"home":n=[t.getValue(this.parent.hasId?"id":"name",r[0])],this.parent.setProperties({selectedItems:n},!0),this.selectRecords(n);break;case"moveUp":case"moveDown":this.moveFunction(r,e,h);break;case"end":a=[t.getValue(this.parent.hasId?"id":"name",r[o-1])],this.parent.setProperties({selectedItems:a},!0),this.selectRecords(a);break;case"back":this.parent.traverseBackward()}}},e.prototype.gridSelectNodes=function(){return this.gridObj.getSelectedRecords()},e.prototype.doDownload=function(){if(0!==this.parent.selectedItems.length){this.parent.itemData=this.gridObj.getSelectedRecords();for(var e=this.parent.itemData,t=0;t<e.length;t++)if(!De(e[t]))return void be(this.parent,e[t],pa);pt(this.parent,this.parent.path,this.parent.selectedItems)}},e.prototype.performDelete=function(){if(this.parent.selectedItems&&this.parent.selectedItems.length>0){this.parent.itemData=this.gridObj.getSelectedRecords();for(var e=this.parent.itemData,t=0;t<e.length;t++)if(!Ie(e[t]))return void be(this.parent,e[t],la);ut(this.parent,"Delete")}},e.prototype.performRename=function(){1===this.parent.selectedItems.length&&(this.updateRenameData(),ue(this.parent))},e.prototype.updateRenameData=function(){var e=this.gridSelectNodes()[0];ce(this.parent,e)},e.prototype.shiftMoveMethod=function(e,t,i,n,a){this.parent.allowMultiSelection?-1!==t||"csUp"!==a.action&&"csDown"!==a.action?-1===t||i===t||("csUp"===a.action||"csDown"===a.action)&&this.isSelected(n,i)?this.shiftSelectedItem(t,n,e,a):this.shiftSelectFocusItem(t,i,n,a):this.ctrlMoveFunction(e,a,t):this.moveFunction(e,a,t)},e.prototype.moveFunction=function(e,i,n){!t.isNullOrUndefined(this.getFocusedItem())&&this.parent.allowMultiSelection?"moveDown"===i.action?this.gridObj.selectRow(this.getFocusedItemIndex()+1):this.gridObj.selectRow(this.getFocusedItemIndex()-1):t.isNullOrUndefined(n)||-1===n?t.isNullOrUndefined(e[0])||this.gridObj.selectRow(0):"moveDown"===i.action||"ctrlDown"===i.action||"shiftDown"===i.action||"csDown"===i.action?this.gridObj.selectRow(n+(n!==e.length-1?1:0)):this.gridObj.selectRow(n-(0!==n?1:0))},e.prototype.spaceSelection=function(e,i,n,a){if(this.isSelected(e,i)||-1===n||"shiftSpace"!==a.action&&"csSpace"!==a.action)if(t.isNullOrUndefined(this.getFocusedItem())||i===n)if(-1!==n&&"ctrlSpace"===a.action&&this.parent.allowMultiSelection){var s=n;e.pop(),this.gridObj.selectRows(e),this.addFocus(s)}else"shiftSpace"===a.action&&this.gridObj.selectRow(n);else e.push(this.getFocusedItemIndex()),this.gridObj.selectRows(e);else i<n?this.gridObj.selectionModule.selectRowsByRange(i,n):this.gridObj.selectionModule.selectRowsByRange(n,i)},e.prototype.ctrlMoveFunction=function(e,i,n){var a;if(t.isNullOrUndefined(this.getFocusedItem()))t.isNullOrUndefined(n)||-1===n?t.isNullOrUndefined(e[0])||(a=0):a="ctrlDown"===i.action||"csDown"===i.action?n+(n<e.length?1:0):n-(n<1?0:1);else{var s=this.getFocusedItemIndex();a="ctrlDown"===i.action||"csDown"===i.action?s+(s<e.length-1?1:0):s-(s<1?0:1)}this.addFocus(a)},e.prototype.checkRowsKey=function(e,i,n,a){"Uncheck"===this.gridObj.checkAllRows||"Intermediate"===this.gridObj.checkAllRows?"csHome"!==a.action&&"csEnd"!==a.action?(t.isNullOrUndefined(this.startIndex)&&this.firstItemIndex!==i&&(this.firstItemIndex=i),"shiftEnd"===a.action?this.gridObj.selectionModule.selectRowsByRange(this.firstItemIndex,e.length-1):this.gridObj.selectionModule.selectRowsByRange(0,this.firstItemIndex),this.startIndex=i):"csEnd"===a.action?this.gridObj.selectRows(this.InnerItems(t.isNullOrUndefined(i)?0:i,t.isNullOrUndefined(n)?e.length-1:n,a)):t.isNullOrUndefined(i)?this.gridObj.selectRow(0):this.gridObj.selectRows(this.InnerItems(t.isNullOrUndefined(n)?0:n,i,a)):this.gridObj.selectionModule.selectRow("shiftHome"===a.action||"csHome"===a.action?0:e.length-1)},e.prototype.InnerItems=function(e,t,i){var n=this.gridObj.getSelectedRowIndexes();if("csEnd"===i.action)for(a=e+1;a<=t;a++)n.push(a);else for(var a=t-1;e<=a;a--)n.push(a);return n},e.prototype.shiftSelectFocusItem=function(e,i,n,a){var s=i+("shiftDown"===a.action||"csDown"===a.action?1:-1),r=t.isNullOrUndefined(this.startIndex)?e:n[0];r===s?this.gridObj.selectRow(r):r<s?"shiftDown"===a.action||"csDown"===a.action?this.gridObj.selectionModule.selectRowsByRange(r,s):this.gridObj.selectionModule.selectRowsByRange(s,r):"shiftDown"===a.action||"csDown"===a.action?this.gridObj.selectionModule.selectRowsByRange(s,r):this.gridObj.selectionModule.selectRowsByRange(r,s),this.startIndex=this.gridObj.selectedRowIndex},e.prototype.addFocus=function(e){var i=this.getFocusedItem(),n=this.gridObj.getRowByIndex(e);i&&(i.removeAttribute("tabindex"),t.removeClass([i],[zi,qi])),t.isNullOrUndefined(n)||(this.gridObj.element.setAttribute("tabindex","-1"),n.setAttribute("tabindex","0"),n.focus(),t.addClass([n],[zi,qi]))},e.prototype.addHeaderFocus=function(e){var i=t.select(".e-row",this.element);this.gridObj.element.setAttribute("tabindex","-1");var n;!t.isNullOrUndefined(e.target)&&e.target.classList.contains("e-defaultcursor")?(this.addFocus(0),n=e.target.nextElementSibling):t.isNullOrUndefined(this.gridObj.element.querySelector(".e-focus"))||"TH"!==this.gridObj.element.querySelector(".e-focus").tagName?n=t.select("th.e-fe-grid-icon",this.element):(n=this.gridObj.element.querySelector(".e-focus").nextElementSibling,this.addFocus(0)),t.isNullOrUndefined(n)||(n.setAttribute("tabindex","0"),n.focus(),t.addClass([n],[zi,qi]),i.setAttribute("tabindex","0"),0===i.tabIndex&&0===n.tabIndex&&t.removeClass([i],[zi,qi]))},e.prototype.getFocusedItem=function(){return t.select("."+qi,this.element)},e.prototype.isSelected=function(e,t){for(var i=!1,n=0;n<=e.length-1;n++)if(e[n]===t){i=!0;break}return i},e.prototype.shiftSelectedItem=function(e,i,n,a){-1===e?this.gridObj.selectRow(0):t.isNullOrUndefined(this.startIndex)&&a.shiftKey?(this.startIndex=this.gridObj.selectedRowIndex,this.gridObj.selectRows([e,"shiftDown"===a.action||"csDown"===a.action?e+(e!==n.length-1?1:0):e-(0!==e?1:0)])):"shiftDown"===a.action||"shiftUp"===a.action?("shiftDown"===a.action&&-1===i.indexOf(e+1)?e!==n.length-1&&i.push(e+1):"shiftUp"===a.action&&-1===i.indexOf(e-1)?0!==e&&i.push(e-1):i.pop(),this.gridObj.selectRows(i)):"csDown"===a.action?this.isSelected(i,this.getFocusedItemIndex()+1)?this.addFocus(this.getFocusedItemIndex()+1):(i.push(this.getFocusedItemIndex()+1),this.gridObj.selectRows(i)):this.isSelected(i,this.getFocusedItemIndex()-1)?this.addFocus(this.getFocusedItemIndex()-1):(i.push(this.getFocusedItemIndex()-1),this.gridObj.selectRows(i))},e.prototype.onMethodCall=function(e){if("Details"===this.parent.view)switch(t.getValue("action",e)){case"deleteFiles":this.deleteFiles(t.getValue("ids",e));break;case"downloadFiles":this.downloadFiles(t.getValue("ids",e));break;case"openFile":this.openFile(t.getValue("id",e));break;case"createFolder":this.interaction=!1;break;case"renameFile":this.interaction=!1,this.renameFile(t.getValue("id",e),t.getValue("newName",e));break;case"selectAll":this.interaction=!1,this.onSelectAllInit();break;case"clearSelection":this.interaction=!1,this.onClearAllInit()}},e.prototype.getRecords=function(e){var i=this.gridObj.getCurrentViewRecords(),n=[],a=!(""===this.parent.breadcrumbbarModule.searchObj.element.value&&!this.parent.isFiltered),s=this.parent.hasId?"id":"name";if(this.parent.hasId||!a)for(var r=0,o=i.length;r<o;r++)-1!==e.indexOf(t.getValue(s,i[r]))&&n.push(i[r]);else for(var r=0,o=i.length;r<o;r++){var l=t.getValue("filterPath",i[r])+t.getValue("name",i[r]);-1!==e.indexOf(l)&&n.push(i[r])}return n},e.prototype.deleteFiles=function(e){if(this.parent.activeModule="detailsview",t.isNullOrUndefined(e))return void this.performDelete();var i=this.getRecords(e);if(0!==i.length){for(var n=[],a=[],s=0;s<i.length;s++)n[s]=i[s],a[s]=pe(this.parent,n[s]);ge(this.parent,n,a)}},e.prototype.downloadFiles=function(e){if(t.isNullOrUndefined(e))return void this.doDownload();var i=this.getRecords(e);if(0!==i.length){for(var n=[],a=[],s=0;s<i.length;s++)n[s]=i[s],a[s]=pe(this.parent,n[s]);me(this.parent,n,a)}},e.prototype.openFile=function(e){if(!t.isNullOrUndefined(e)){var i=this.getRecords([e]);i.length>0&&this.openContent(i[0])}},e.prototype.renameFile=function(e,i){if(this.parent.activeModule="detailsview",t.isNullOrUndefined(e))return void this.performRename();var n=this.getRecords([e]);n.length>0&&(ce(this.parent,n[0]),t.isNullOrUndefined(i)?ue(this.parent):Ie(this.parent.itemData[0])?Me(this.parent,this.parent.path,i):be(this.parent,this.parent.itemData[0],la))},e}();return va.Inject(wa,Oa,ca,ya,fa,ua,Ia),e.ACTIVE=Hi,e.ALT_DIALOG_ID="_alt_dialog",e.AjaxSettings=Yt,e.BLUR=_i,e.BREADCRUMBBAR_ID=Ni,e.BREADCRUMBS="e-address",e.BreadCrumbBar=ua,e.CB_WRAP=Ki,e.CHECK=Wi,e.CHECK_SELECT="e-fe-cb-select",e.CLONE=Xi,e.COLLAPSED="e-node-collapsed",e.CONTENT_ID=ji,e.CONTEXT_MENU_ID="_contextmenu",e.CONTROL=Ri,e.Column=Ii,e.ContextMenu=fa,e.ContextMenuSettings=pi,e.DETAILS_LABEL="e-detailslabel",e.DIALOG_ID=Si,e.DISPLAY_NONE=bn,e.DROP_FILE=Zi,e.DROP_FOLDER=$i,e.Delete=Le,e.DetailsView=wa,e.DetailsViewSettings=si,e.Download=pt,e.EMPTY=Gi,e.EMPTY_CONTENT=Ji,e.EMPTY_INNER_CONTENT=Qi,e.ERROR_CONTENT=gn,e.EXTN_DIALOG_ID=xi,e.FILTER=Li,e.FOCUS=zi,e.FOCUSED=qi,e.FOLDER=en,e.FRAME="e-frame",e.FULLROW="e-fullrow",e.FileManager=va,e.GRID_CONTENT=pn,e.GRID_HEADER=on,e.GRID_ID=wi,e.GRID_VIEW=dn,e.GetDetails=Te,e.HEADER_CHECK="e-headercheck",e.HOVER=Bi,e.ICONS="e-icons",e.ICON_BREADCRUMB="e-icons e-fe-breadcrumb",e.ICON_CLEAR="e-icons e-fe-clear",e.ICON_COLLAPSIBLE="e-icon-collapsible",e.ICON_COPY="e-icons e-fe-copy",e.ICON_CUT=cn,e.ICON_DELETE="e-icons e-fe-delete",e.ICON_DETAILS="e-icons e-fe-details",e.ICON_DOWNLOAD="e-icons e-fe-download",e.ICON_DROP_IN="e-icons e-fe-drop-in",e.ICON_DROP_OUT="e-icons e-fe-drop-out",e.ICON_GRID=un,e.ICON_IMAGE=tn,e.ICON_LARGE=fn,e.ICON_MUSIC=nn,e.ICON_NEWFOLDER="e-icons e-fe-newfolder",e.ICON_NO_DROP="e-icons e-fe-no-drop",e.ICON_OPEN="e-icons e-fe-open",e.ICON_OPTIONS="e-icons e-fe-options",e.ICON_PASTE="e-icons e-fe-paste",e.ICON_REFRESH="e-icons e-fe-refresh",e.ICON_RENAME="e-icons e-fe-rename",e.ICON_SELECTALL="e-icons e-fe-select",e.ICON_SHORTBY="e-icons e-fe-sort",e.ICON_UPLOAD="e-icons e-fe-upload",e.ICON_VIDEO=an,e.ICON_VIEW="e-list-parent",e.IMG_DIALOG_ID=Ci,e.LARGEICON_ID=Di,e.LARGE_EMPTY_FOLDER=rn,e.LARGE_EMPTY_FOLDER_TWO="e-empty-icon.e-fe-folder",e.LARGE_ICON=sn,e.LARGE_ICONS=Ti,e.LARGE_ICON_FOLDER="e-fe-folder",e.LAYOUT="e-layout",e.LAYOUT_CONTENT="e-layout-content",e.LAYOUT_ID=Oi,e.LIST_ITEM=Ai,e.LIST_PARENT="e-list-parent",e.LIST_TEXT=Fi,e.LargeIconsView=ca,e.MENU_ICON=hn,e.MENU_ITEM="e-menu-item",e.MOBILE="e-fe-mobile",e.MOB_POPUP=ki,e.MULTI_SELECT="e-fe-m-select",e.NAVIGATION="e-navigation",e.NAVIGATION_ID="_navigation",e.NavigationPane=Oa,e.NavigationPaneSettings=fi,e.OVERLAY="e-fe-overlay",e.RETRY_DIALOG_ID="_retry_dialog",e.RETRY_ID="_retry",e.ROOT=Pi,e.ROOT_POPUP=Mi,e.ROW=Yi,e.ROWCELL="e-rowcell",e.RTL=mn,e.SEARCH_ID="_search",e.SELECTED_ITEMS="e-items",e.SORTBY_ID="_sortby",e.SPLITTER_ID="_splitter",e.SPLIT_BAR="e-split-bar",e.STATUS="e-status",e.SUBMENU_ICON="e-caret",e.Search=ht,e.SearchSettings=ti,e.TB_ITEM="e-toolbar-item",e.TB_OPTION_DOT=Vi,e.TB_OPTION_TICK=Ui,e.TEMPLATE_CELL="e-templatecell",e.TEXT_CONTENT="e-text-content",e.TOOLBAR_ID="_toolbar",e.TREE_ID="_tree",e.TREE_VIEW=ln,e.Toolbar=ya,e.ToolbarItem=$t,e.ToolbarSettings=Xt,e.UPLOAD_DIALOG_ID="_upload_dialog",e.UPLOAD_ID=Ei,e.UploadSettings=bi,e.VALUE=vn,e.VIEW_ID="_view",e.Virtualization=Ia,e.actionFailure=Ln,e.activeElement=y,e.addBlur=I,e.afterRequest=kn,e.beforeDelete="before-delete",e.beforeDownload="before-download",e.beforeRequest=Rn,e.clearAllInit="clear-all-init",e.clearPathInit=Vn,e.closePopup=xe,e.columnArray=ai,e.copyFiles=P,e.createDeniedDialog=be,e.createDialog=ut,e.createEmptyElement=U,e.createEnd=Dn,e.createExtDialog=ft,e.createFolder=Pe,e.createImageDialog=Bt,e.createNewFolder=Se,e.createVirtualDragElement=ie,e.cutCopyInit=Jn,e.cutEnd=$n,e.cutFiles=R,e.defaultToolbarItems=Qt,e.deleteEnd=xn,e.deleteInit=Cn,e.destroy=Pn,e.detailsInit=Bn,e.doDeleteFiles=ge,e.doDownload=fe,e.doDownloadFiles=me,e.doPasteUpdate=Z,e.doRename=ue,e.download="download",e.downloadInit="download-init",e.dragCancel=se,e.dragEnd=na,e.dragHelper="drag-helper",e.dragStartHandler=ae,e.dragStopHandler=ne,e.dragging=sa,e.draggingHandler=he,e.dropHandler=Q,e.dropInit=ia,e.dropPath=aa,e.fileItems=li,e.fileType=M,e.filter=Re,e.filterEnd="filter-end",e.finalizeEnd=wn,e.folderItems=hi,e.generatePath=b,e.getAccessClass=ve,e.getAccessDetails=Ne,e.getAllChildItems=D,e.getCssClass=z,e.getDirectories=V,e.getDirectoryPath=$,e.getDuplicateData=te,e.getFullPath=L,e.getImageUrl=k,e.getItemName=pe,e.getLocaleText=B,e.getModule=w,e.getName=T,e.getObject=F,e.getParentPath=X,e.getParents=m,e.getPath=u,e.getPathId=f,e.getPathNames=g,e.getPathObject=E,e.getSortField=W,e.getSortedData=A,e.getTargetModule=x,e.getTargetPath=je,e.hasContentAccess=Oe,e.hasDownloadAccess=De,e.hasEditAccess=Ie,e.hasReadAccess=ye,e.hasUploadAccess=we,e.hideLayout="hide-layout",e.hidePaste=Gn,e.initialEnd=On,e.isFile=yn,e.isFileSystemData=Ae,e.layoutChange=_n,e.layoutItems=di,e.layoutRefresh="layout-refresh",e.menuItemData=zn,e.methodCall=ra,e.modelChanged=In,e.nodeExpand="node-expand",e.objectToString=de,e.openAction=N,e.openEnd=Fn,e.openInit=An,e.openSearchFolder=Y,e.paste=ke,e.pasteEnd=Xn,e.pasteHandler=G,e.pasteInit=Qn,e.pathChanged=En,e.pathColumn=ea,e.pathDrag=Sn,e.permissionCopy="copy",e.permissionDownload=pa,e.permissionEdit=la,e.permissionEditContents=ha,e.permissionRead=oa,e.permissionUpload=da,e.read=Ee,e.readDropPath=ee,e.refresh=j,e.refreshEnd=jn,e.removeActive=v,e.removeBlur=O,e.removeDropTarget=re,e.removeItemClass=oe,e.rename=Me,e.renameEnd=Kn,e.renameEndParent=Wn,e.renameInit=qn,e.resizeEnd=Nn,e.scrollHandler=le,e.search=Tn,e.searchTextChange=ta,e.searchWordHandler=S,e.selectAllInit="select-all-init",e.selectedData="selected-data",e.selectionChanged=Un,e.setDateObject=H,e.setNextPath=K,e.setNodeId=_,e.showPaste=Yn,e.skipUpload=Mn,e.sortByChange=Hn,e.sortColumn=Zn,e.sortComparer=p,e.sortbyClickHandler=q,e.splitterResize="splitter-resize",e.treeSelect="select-node",e.updateLayout=C,e.updatePath=c,e.updateRenamingData=ce,e.updateSelectionData="update-selection-data",e.updateTreeSelection="update-tree-selection",e.upload="upload",e.uploadItem=Ce,e.validateSubFolder=J,e}({},ej.base,ej.layouts,ej.popups,ej.data,ej.grids,ej.inputs,ej.buttons,ej.lists,ej.splitbuttons,ej.navigations),this.ejs=ej;
|
10
|
+
this.ej=this.ej||{},this.ej.filemanager=function(e,t,i,n,a,s,r,o,l,h,d){"use strict";function c(e,t){var i=/\.\S+/.test(e),n=/\.\S+/.test(t);if(i&&!n)return 1;if(!i&&n)return-1;var a=[],s=[];for((e+"").replace(/(\d+)|(\D+)/g,function(e,t,i){return a.push([t||1/0,i||""]),""}),(t+"").replace(/(\d+)|(\D+)/g,function(e,t,i){return s.push([t||1/0,i||""]),""});a.length&&s.length;){var r=a.shift(),o=s.shift();if(r&&o){var l=r[0]-o[0]||r[1].localeCompare(o[1]);if(l)return l}}return a.length-s.length}function p(e,i,n){var a=t.getValue("name",i),s=e.getAttribute("data-id"),r=t.isNullOrUndefined(s)?a:s;n.setProperties({path:u(e,r,n.hasId)},!0),n.pathId=f(e),n.pathNames=g(e,a)}function u(e,t,i){for(var n=m(e,t,!1,i),a="/",s=n.length-2;s>=0;s--)a+=n[s]+"/";return a}function f(e){for(var t=m(e,e.getAttribute("data-uid"),!0),i=[],n=t.length-1;n>=0;n--)i.push(t[n]);return i}function g(e,t){for(var i=m(e,t,!1),n=[],a=i.length-1;a>=0;a--)n.push(i[a]);return n}function m(e,i,n,a){for(var s=[i],r=e.parentNode;!t.isNullOrUndefined(r);){if(t.matches(r,"."+Vi)){var o=n?r.getAttribute("data-uid"):a?r.getAttribute("data-id"):t.select("."+_i,r).textContent;s.push(o)}if((r=r.parentNode).classList.contains(cn))break}return s}function b(e){var i=e.hasId?"id":"name",n="/",a=1;for(a;a<e.pathId.length;a++){var s=t.getValue(e.pathId[parseInt(a.toString(),10)],e.feParent);n+=t.getValue(i,s)+"/"}e.setProperties({path:n},!0)}function v(e){e.isCut&&(O(e),e.selectedNodes=[],e.actionRecords=[],e.enablePaste=!1,e.notify(Xn,{}))}function y(e,i){if(i.isSearchCut=!1,i.actionRecords=[],i.activeElements=[],i.notify($n,{}),0===i.activeElements.length)return!1;O(i);var n=i.activeElements;"navigationpane"!==i.activeModule?i.targetPath=i.path:i.targetPath=X(i.path);var a=0;if(n&&(w(i,n[0]),"cut"===e))for(;a<n.length;)I(n[a]),a++;for(a=0,i.selectedNodes=[],i.enablePaste=!0,i.notify(Qn,{});a<i.activeRecords.length;)i.actionRecords.push(i.activeRecords[a]),i.selectedNodes.push(t.getValue("name",i.activeRecords[a])),a++;if((""!==i.breadcrumbbarModule.searchObj.element.value||i.isFiltered)&&"navigationpane"!==i.activeModule){i.selectedNodes=[],i.isSearchCut=!0;for(var s=0;s<i.selectedItems.length;)i.selectedNodes.push(i.selectedItems[s]),s++}return!0}function I(e){e.classList.add(zi)}function O(e,t){for(var i=t?e.element.querySelectorAll("."+Wi):e.element.querySelectorAll("."+zi),n=0;n<i.length;)i[n].classList.remove(t?Wi:zi),n++}function w(e,i){i&&(i.classList.contains(Qi)?e.activeModule="detailsview":t.closest(i,"."+ln)?e.activeModule="largeiconsview":e.activeModule="navigationpane")}function D(e,t){var i=e.fileSystemData.filter(function(e){return String(e.parentId)===String(t)}),n=i.slice();return i.forEach(function(t){var i=t.id;n=n.concat(D(e,i))}),n}function S(e,i,n){var s;if(0!==i.length||e.isFiltered||e.notify(na,{args:e}),Ae(e))if(""===i)e.itemData=e.fileSystemData,Ee(e,n?zn:Un,e.path);else{e.searchSettings.filterType=t.isNullOrUndefined(e.searchSettings.filterType)?"contains":e.searchSettings.filterType;var r=t.getValue(e.pathId[e.pathId.length-1],e.feParent),o=D(e,t.getValue("id",r)),l=new a.DataManager(o).executeLocal((new a.Query).where("name",e.searchSettings.filterType,i,e.searchSettings.ignoreCase)),h=e.searchSettings.ignoreCase?i.toLowerCase():i;e.itemData=l,dt(e,n?zn:Un,e.path,h,e.showHiddenItems,!e.searchSettings.ignoreCase)}else if(s="startsWith"===e.searchSettings.filterType?i+"*":"endsWith"===e.searchSettings.filterType?"*"+i:"*"+i+"*",e.searchWord=s,e.itemData=[E(e)],i.length>0){var d=e.searchSettings.ignoreCase,c=e.showHiddenItems;dt(e,n?zn:Un,e.path,s,c,!d)}else e.isFiltered?Me(e,zn):e.isSortByClicked?(e.notify(zn,{files:"Details"===e.oldView?e.detailsviewModule.gridObj.dataSource:e.largeiconsviewModule.allItems}),e.isSortByClicked=!1):Ee(e,n?zn:Un,e.path)}function C(e,t){e.oldView=e.view,e.setProperties({view:t},!0),(""!==e.breadcrumbbarModule.searchObj.element.value||e.isFiltered)&&(e.layoutSelectedItems=e.selectedItems);var i="";e.breadcrumbbarModule.searchObj.element.value&&(i=e.breadcrumbbarModule.searchObj.element.value),e.isLayoutChange=!0,S(e,i,!0)}function x(e,i){var n="";i&&(n=t.closest(i,"."+ki+"."+Li+" ."+fn)?"detailsview":t.closest(i,"."+Ui)?"largeiconsview":i.classList.contains("e-fullrow")||i.classList.contains("e-icon-expandable")?"navigationpane":t.closest(i,".e-address-list-item")?"breadcrumbbar":""),e.targetModule=n}function j(e){e.itemData=[E(e)],ye(e.itemData[0])?Ee(e,Pn,e.path):be(e,e.itemData[0],da)}function N(e){Ee(e,_n,e.path)}function E(e){return t.getValue(e.pathId[e.pathId.length-1],e.feParent)}function P(e){y("copy",e)&&(e.fileAction="copy")}function M(e){y("cut",e)&&(e.isCut=!0,e.fileAction="move")}function R(e){if(!t.getValue("isFile",e))return an;var i=["bmp","dib","jpg","jpeg","jpe","jfif","gif","tif","tiff","png","ico"],n=["mp3","wav","aac","ogg","wma","aif","fla","m4a"],a=["webm","mkv","flv","vob","ogv","ogg","avi","wmv","mp4","3gp"],s=["css","exe","html","js","msi","pdf","pptx","ppt","rar","zip","txt","docx","doc","xlsx","xls","xml","rtf","php"],r=t.getValue("type",e);-1!==(r=r.toLowerCase()).indexOf(".")&&(r=r.split(".").join(""));return-1!==i.indexOf(r)?sn:-1!==n.indexOf(r)?rn:-1!==a.indexOf(r)?on:-1!==s.indexOf(r)?"e-fe-"+r:"e-fe-unknown e-fe-"+r}function k(e,i){var n=Ae(e)?t.getValue("imageUrl",i):"";if(Ae(e)){var a={fileDetails:[i],imageUrl:n,useImageAsUrl:!0};return e.trigger("beforeImageLoad",a),a}var s=e.ajaxSettings.getImageUrl?e.ajaxSettings.getImageUrl:e.ajaxSettings.url,r=-1!==s.indexOf("?")?"&path=":"?path=",o=encodeURIComponent(t.getValue("name",i)),l=t.getValue("filterPath",i);if(e.hasId){var h=t.getValue("id",i);n=s+r+e.path+"&id="+h}else n=t.isNullOrUndefined(l)?s+r+e.path+o:s+r+encodeURIComponent(l.replace(/\\/g,"/"))+o;n=n+"&time="+(new Date).getTime().toString();var d={action:"getImage",path:e.path+o,id:t.getValue("id",i)},c={fileDetails:[i],imageUrl:n,useImageAsUrl:!0,ajaxSettings:{url:s,type:"POST",contentType:"application/json",responseType:"blob",data:JSON.stringify(d),onSuccess:null,onFailure:null,beforeSend:null}};return e.trigger("beforeImageLoad",c),c}function L(e,i,n){var a=t.getValue(e.hasId?"id":"name",i)+"/",s=t.getValue(e.hasId?"filterId":"filterPath",i);return t.isNullOrUndefined(s)?n+a:s.replace(/\\/g,"/").replace(/^.*?(?=\/)/,"")+a}function T(e,i){var n=t.getValue("name",i),a=t.getValue("filterPath",i);return""===e.breadcrumbbarModule.searchObj.element.value&&!e.isFiltered||t.isNullOrUndefined(a)||(n=(a=a.replace(/\\/g,"/")).replace(e.path,"")+n),n}function A(e,i){if(0===i.length)return i;var n;n="None"===e.sortOrder||t.isNullOrUndefined(e.sortOrder)?(new a.Query).group("isFile"):(new a.Query).sortBy(e.sortBy,e.sortOrder.toLowerCase(),!0).group("isFile");var s=new a.DataManager(i).executeLocal(n);return t.getValue("records",s)}function F(e,i,n){return t.getValue(e.pathId[e.pathId.length-1],e.feFiles).filter(function(e){return e[i].toString()===n})[0]}function U(e,i,n){var a,s=t.select("#"+e.element.id+Si,e.element),r=t.select("#"+e.element.id+Mi,s).offsetHeight;if(a=s.offsetHeight-r,"Details"===e.view&&(a-=t.select("."+dn,s).offsetHeight),t.isNullOrUndefined(i.querySelector("."+Xi))){var o=t.createElement("div",{className:Xi}),l=t.createElement("div",{className:hn}),h=t.createElement("div",{className:$i}),d=t.createElement("div",{className:Zi});"Details"===e.view?i.querySelector("."+un).appendChild(o):i.appendChild(o),o.appendChild(l),o.appendChild(h),o.appendChild(d)}i.querySelector("."+Xi)&&(t.isNullOrUndefined(n.error)?e.isFiltered?(i.querySelector("."+$i).innerHTML=B(e,"Filter-Empty"),i.querySelector("."+Zi).innerHTML=B(e,"Filter-Key")):""!==e.breadcrumbbarModule.searchObj.element.value?(i.querySelector("."+$i).innerHTML=B(e,"Search-Empty"),i.querySelector("."+Zi).innerHTML=B(e,"Search-Key")):(i.querySelector("."+$i).innerHTML=B(e,"Folder-Empty"),i.querySelector("."+Zi).innerHTML=null==e.uploadObj.dropArea?B(e,""):B(e,"File-Upload")):(i.querySelector("."+$i).innerHTML=B(e,"Access-Denied"),i.querySelector("."+Zi).innerHTML=B(e,"Access-Details")));var c=t.select("."+Xi,i);a=(a-c.offsetHeight)/2,c.style.marginTop=a+"px"}function V(e){return new a.DataManager(e).executeLocal((new a.Query).where(wn,"equal",!1,!1))}function _(e,i){for(var n=V(e.files),a=0,s=n.length;a<s;a++)t.setValue("_fm_id",i+"_"+a,n[a])}function H(e){for(var i=0;i<e.length;i++){var n=new Date(t.getValue("dateCreated",e[i])),a=new Date(t.getValue("dateModified",e[i]));t.setValue("_fm_created",n,e[i]),t.setValue("_fm_modified",a,e[i])}}function B(e,t){var i=e.localeObj.getConstant(t);return""===i?t:i}function z(e,i){var n=e.cssClass;return n=t.isNullOrUndefined(n)||""===n?i:n+" "+i}function q(e,t){e.isSortByClicked=!0,-1!==t.item.id.indexOf("ascending")||-1!==t.item.id.indexOf("descending")||-1!==t.item.id.indexOf("none")?e.sortOrder=W(t.item.id):e.sortBy=W(t.item.id,e),e.itemData=[E(e)],"Details"===e.view&&(e.isMobile?C(e,"Details"):(e.notify(ia,{module:"detailsview"}),e.isSortByClicked=!1)),"LargeIcons"===e.view&&C(e,"LargeIcons"),e.notify(qn,{})}function W(e,t){var i,n=e.substring(e.lastIndexOf("_")+1),a=n;switch(t&&(i=t.detailsViewSettings.columns),n){case"date":for(var s=0,r=i.length;s<r;s++){if("dateModified"===i[s].field||"dateCreated"===i[s].field){a=i[s].field;break}a="_fm_modified"}break;case"ascending":a="Ascending";break;case"descending":a="Descending";break;case"none":a="None"}return a}function K(e,i){for(var n=i.split("/"),a=e.originalPath.split("/"),s=t.getValue(e.pathId[0],e.feParent),r=t.isNullOrUndefined(t.getValue("id",s))?"name":"id",o=n.length-1,l=a.length-1;o<l;o++){var h=""===a[o+1]?Cn:Sn,d=""===a[o]?"/":e.path+a[o]+"/",c=F(e,r,a[parseInt(o.toString(),10)]),p=t.getValue("_fm_id",c);e.setProperties({path:d},!0),t.isNullOrUndefined(p)||e.pathId.push(p),e.itemData=[c],e.pathNames.push(t.getValue("name",c)),Ee(e,h,e.path);break}}function Y(e,i){e.originalPath=L(e,i,e.path);var n=t.getValue(e.pathId[0],e.feParent),a=e.feParent[t.getValue("_fm_id",e.itemData[0])],s=t.isNullOrUndefined(a)||"fe_tree"===t.getValue("_fm_id",a),r=F(e,t.isNullOrUndefined(t.getValue("id",n))?"name":"id",Ae(e)?t.getValue("id",i):t.getValue("name",i));if(t.isNullOrUndefined(r)){if(s)return void K(e,e.path);e.notify(Bn,{selectedNode:e.pathId[e.pathId.length-1]})}else{var o=t.getValue("_fm_id",r);e.setProperties({path:e.originalPath},!0),e.pathId.push(o),e.itemData=[r],e.pathNames.push(t.getValue("name",r))}Ee(e,e.path!==e.originalPath?Sn:Cn,e.path)}function G(e){if(e.isDragDrop=!1,0!==e.selectedNodes.length&&e.enablePaste){var t=""===e.folderPath?e.path:e.folderPath;"navigationpane"!==e.activeModule||e.selectedNodes[0].includes("/")||(e.targetPath=je(e,e.actionRecords[0])),J(e,e.actionRecords,t,e.path)||("move"===e.fileAction&&e.targetPath!==t||"copy"===e.fileAction?(e.notify(Zn,{}),ke(e,e.targetPath,e.selectedNodes,t,e.fileAction,[],e.actionRecords)):(e.enablePaste=!1,e.notify(Xn,{}),O(e),mt(e,"Error",{files:null,error:{code:"402",message:B(e,"Same-Folder-Error"),fileExists:null}})))}}function J(e,i,n,a){for(var s=!1,r=0;r<i.length;r++)if(t.getValue("isFile",i[r])){var o=e.dragData[r]?e.dragData[r].name:null,l=Ae(e)?o:e.dragNodes[r],h=0;l&&(h=l.lastIndexOf("/"));var d="";if(h>0&&(d=a+l.substring(0,h+1)),d===n){var c={files:null,error:{code:"402",message:B(e,"Same-Folder-Error"),fileExists:null}};mt(e,"Error",c),s=!0;break}}else{var p=L(e,i[r],a);if(0===n.indexOf(p)){mt(e,"Error",c={files:null,error:{code:"402",message:B(e,"Sub-Folder-Error"),fileExists:null}}),s=!0;break}}return s}function Q(e){e.isDragDrop=!0,0!==e.dragData.length&&(e.dragPath=e.dragPath.replace(/\\/g,"/"),e.dropPath=e.dropPath.replace(/\\/g,"/"),J(e,e.dragData,e.dropPath,e.dragPath)||e.dragPath===e.dropPath||(e.itemData=[e.dropData],ke(e,e.dragPath,e.dragNodes,e.dropPath,"move",[],e.dragData),e.notify(Zn,{})))}function X(e){for(var t=e.split("/"),i=t[0]+"/",n=1;n<t.length-2;n++)i+=t[n]+"/";return i}function $(e,i){var n=t.getValue(e.hasId?"id":"name",i.cwd)+"/",a=t.getValue(e.hasId&&!t.isNullOrUndefined(e.ajaxSettings.url)?"filterId":"filterPath",i.cwd);return t.isNullOrUndefined(a)?Ae(e)?n:e.path+n:""===a?"/":a.replace(/\\/g,"/").replace(/^.*?(?=\/)/,"")+n}function Z(e,t,i){"move"===t&&(e.isDragDrop?e.notify(ra,i):(e.enablePaste=!1,e.notify(Xn,{}),e.notify(ta,i))),0===e.duplicateItems.length&&(e.pasteNodes=[]);for(var n=0;n<i.files.length;n++)e.pasteNodes.push(i.files[n][e.hasId?"id":"name"]),e.isDragDrop&&e.droppedObjects.push(i.files[n]);e.duplicateItems=[],e.duplicateRecords=[],e.isDragDrop&&!e.isPasteError?e.isDropEnd=!0:e.isDropEnd=!1,e.trigger("success",{action:t,result:i}),!e.isDragDrop||e.path===e.dragPath||e.path===e.dropPath||e.isSearchDrag?(e.isPathDrag=!1,Ee(e,ea,e.path)):ee(e)}function ee(e){var i=t.getValue("_fm_id",e.dropData);if(e.expandedId=i,e.itemData=[e.dropData],e.isPathDrag)e.notify(jn,e.itemData);else{if(e.navigationpaneModule){var n=t.select('[data-uid="'+i+'"]',e.navigationpaneModule.treeObj.element);n||(i=document.querySelector('[data-id = "'+t.getValue("id",e.dropData)+'"]').getAttribute("data-uid"),n=t.select('[data-uid="'+i+'"]',e.navigationpaneModule.treeObj.element)),p(n,e.dropData,e)}Ee(e,oa,e.dropPath)}}function te(e,i){for(var n=null,a=e.isDragDrop?e.dragData:e.actionRecords,s=0;s<a.length;s++)if(t.getValue("name",a[s])===i){n=a[s];break}return n}function ie(e){if(e.isSearchDrag=!1,""!==e.breadcrumbbarModule.searchObj.element.value&&(e.isSearchDrag=!0),"navigationpane"!==e.activeModule){e.dragNodes=[];for(var t=0;t<e.selectedItems.length;)e.dragNodes.push(e.selectedItems[t]),t++;0===e.selectedItems.length&&e.dragData&&1===e.dragData.length&&e.dragNodes.push(ce(e,e.dragData[0]))}var i=e.createElement("div",{className:"e-fe-icon "+R(e.dragData[0])}),n=e.createElement("div",{className:"e-fe-name",innerHTML:e.dragData[0].name}),a=e.createElement("div",{className:"e-fe-content"});a.appendChild(i),a.appendChild(n);var s=e.createElement("div",{className:en});if(s.appendChild(a),e.dragNodes.length>1){var r=e.createElement("span",{className:"e-fe-count",innerHTML:e.dragNodes.length.toString(10)});s.appendChild(r)}e.virtualDragElement=s,e.element.appendChild(e.virtualDragElement)}function ne(e,i){var n=i;n.cancel=!1,null!=e.treeExpandTimer&&(window.clearTimeout(e.treeExpandTimer),e.treeExpandTimer=null),re(e),e.element.classList.remove("e-fe-drop","e-no-drop"),O(e),e.uploadObj.dropArea=t.select("#"+e.element.id+Pi,e.element);var a=t.select("."+en,e.element);a&&t.detach(a),x(e,i.target),e.notify(sa,i),O(e,"hover"),n.fileDetails=e.dragData,e.trigger("fileDragStop",n,function(i){!i.cancel&&!t.isNullOrUndefined(e.targetModule)&&""!==e.targetModule&&e.dragCount>2&&Q(e),e.dragCount=0})}function ae(e,i,n){var a=i;if(a.cancel=!1,a.fileDetails=e.dragData,e.dragCount=0,e.droppedObjects=[],(!e.allowDragAndDrop||"navigationpane"===e.activeModule&&t.closest(i.element,"li").getAttribute("data-uid")===e.pathId[0])&&(a.cancel=!0),"navigationpane"===e.activeModule&&-1!==e.pathId.indexOf(t.closest(i.element,"li").getAttribute("data-uid"))?e.isPathDrag=!0:e.isPathDrag=!1,O(e),a.cancel)n.intDestroy(i.event),se(e);else if(!a.cancel){for(var s=0;s<e.activeElements.length;)I(e.activeElements[s]),s++;e.trigger("fileDragStart",a,function(t){t.cancel?(n.intDestroy(i.event),se(e)):e.uploadObj.dropArea=null})}}function se(e){O(e);var i=t.select("."+en,e.element);i&&t.detach(i)}function re(e){oe(e,tn),oe(e,nn)}function oe(e,t){for(var i=e.element.querySelectorAll("."+t),n=0;n<i.length;n++)i[n].classList.remove(t)}function le(e,i,n,a){var s,r=e.getBoundingClientRect(),o=t.select("."+n,e);a>=r.top+e.clientHeight-30&&!t.isNullOrUndefined(o)&&(s="navigationpane"===i.targetModule||"detailsview"===i.targetModule?o.offsetHeight/2.5:o.offsetHeight/4.5,e.scrollBy(0,s)),!t.isNullOrUndefined(o)&&a<=r.top+30&&(s="navigationpane"===i.targetModule||"detailsview"===i.targetModule?o.offsetHeight/2.5:o.offsetHeight/4.5,e.scrollBy(0,-s))}function he(e,i){var n=i;n.fileDetails=e.dragData;var a=!1;x(e,i.target),re(e),null!=e.treeExpandTimer&&(window.clearTimeout(e.treeExpandTimer),e.treeExpandTimer=null),O(e,"hover");var s=null;"navigationpane"===e.targetModule?((s=t.closest(i.target,"li")).classList.add(Wi,tn),a=!0,e.treeExpandTimer=window.setTimeout(function(){e.notify(la,i)},800),le(e.navigationpaneModule.treeObj.element.parentElement,e,"e-level-2",i.event.y)):"detailsview"===e.targetModule?((s=t.closest(i.target,"tr"))&&s.querySelector("."+an)&&!s.classList.contains(zi)?s.classList.add(tn):!s||s.querySelector("."+an)||s.classList.contains(zi)||s.classList.add(nn),a=!0,le(e.detailsviewModule.gridObj.element.querySelector(".e-content"),e,"e-row",i.event.y)):"largeiconsview"===e.targetModule?((s=t.closest(i.target,"li"))&&s.querySelector("."+an)&&!s.classList.contains(zi)&&s.classList.add(Wi,tn),a=!0,le(e.largeiconsviewModule.element.firstElementChild,e,"e-large-icon",i.event.y)):"breadcrumbbar"===e.targetModule&&(a=!0),e.element.classList.remove("e-fe-drop","e-no-drop"),e.element.classList.add(a?"e-fe-drop":"e-no-drop"),e.dragCount=e.dragCount+1,e.trigger("fileDragging",n)}function de(e){for(var i="",n=Object.keys(e),a=0;a<n.length;a++)"message"!==n[a]&&(i+=(0===a?"":", ")+n[a]+": "+t.getValue(n[a],e));return i}function ce(e,i){return e.hasId?t.getValue("id",i):T(e,i)}function pe(e,i){e.itemData=[i],e.currentItemText=t.getValue("name",i),e.isFile=t.getValue("isFile",i),e.filterPath=t.getValue("filterPath",i)}function ue(e){Ie(e.itemData[0])?mt(e,"Rename"):be(e,e.itemData[0],ca)}function fe(e){for(var t=e.itemData,i=0;i<t.length;i++)if(!De(t[i]))return void be(e,t[i],fa);e.selectedItems.length>0&&pt(e,e.path,e.selectedItems)}function ge(e,t,i){for(var n=0;n<t.length;n++)if(!Ie(t[n]))return void be(e,t[n],ca);e.itemData=t,Le(e,i,e.path,"delete")}function me(e,t,i){for(var n=0;n<t.length;n++)if(!De(t[n]))return void be(e,t[n],fa);e.itemData=t,i.length>0&&pt(e,e.path,i)}function be(e,i,n){var a=t.getValue("message",t.getValue("permission",i));""===a&&(a=B(e,"Access-Message").replace("{0}",t.getValue("name",i)).replace("{1}",n)),mt(e,"Error",{error:{code:"401",fileExists:null,message:a}})}function ve(e){return ye(e)?"e-fe-locked":"e-fe-locked e-fe-hidden"}function ye(e){var i=t.getValue("permission",e);return!(i&&!t.getValue("read",i))}function Ie(e){var i=t.getValue("permission",e);return!i||t.getValue("read",i)&&t.getValue("write",i)}function Oe(e){var i=t.getValue("permission",e);return!i||t.getValue("read",i)&&t.getValue("writeContents",i)}function we(e){var i=t.getValue("permission",e);return!i||t.getValue("read",i)&&t.getValue("upload",i)}function De(e){var i=t.getValue("permission",e);return!i||t.getValue("read",i)&&t.getValue("download",i)}function Se(e){var t=e.itemData[0];Oe(t)?mt(e,"NewFolder"):be(e,t,pa)}function Ce(e){var t=e.itemData[0];if(we(t)){var i="#"+e.element.id+Ri;document.querySelector(i).click()}else be(e,t,ua)}function xe(e){t.isNullOrUndefined(e.dialogObj)||e.dialogObj.hide()}function je(e,i){return e.hasId&&!t.isNullOrUndefined(t.getValue("filterId",i))?t.getValue("filterId",i).replace(/\\/g,"/").replace(/^[^/]+\//,"/"):t.getValue("filterPath",i).replace(/\\/g,"/")}function Ne(e,i,n,a){for(var s="",r=0;r<i.length;r++){var o=t.getValue("permission",i[r]);if(null==o&&(o=void 0),a)!o||t.getValue("read",o)&&t.getValue("writeContents",o)||""===(s=t.getValue("message",t.getValue("permission",i[r])))&&(s=B(e,"Access-Message").replace("{0}",t.getValue("name",i[r])).replace("{1}","writeContents"));else{var l="copy"===n?t.getValue("copy",o):t.getValue("write",o);!o||t.getValue("read",o)&&l||""===(s=t.getValue("message",t.getValue("permission",i[r])))&&(s=B(e,"Access-Message").replace("{0}",t.getValue("name",i[r])).replace("{1}",n))}if(""!==s){e.responseData={cwd:null,details:null,error:{code:"401",message:s,fileExists:null},files:null};break}}return s}function Ee(e,i,n){for(var a=e.itemData,s=0;s<a.length;s++)t.isNullOrUndefined(t.getValue("hasChild",a[s]))&&t.setValue("hasChild",!1,a[s]);Qe(e,{action:"read",path:n,showHiddenItems:e.showHiddenItems,data:a},it,i)}function Pe(e,t){Qe(e,{action:"create",path:e.path,name:t,data:e.itemData},at,t)}function Me(e,i){var n={action:"filter",path:e.path,showHiddenItems:e.showHiddenItems,data:[E(e)]},a=e.filterData?t.extend(void 0,n,e.filterData):n;Qe(e,a,nt,i,t.getValue("action",a))}function Re(e,t,i){var n,a;if(""!==e.breadcrumbbarModule.searchObj.element.value||e.isFiltered){var s=e.filterPath;e.hasId?(n=e.currentItemText,a=i):(n=(s=s.replace(/\\/g,"/")).replace(t,"")+e.currentItemText,a=s.replace(t,"")+i)}else n=e.currentItemText,a=i;Qe(e,{action:"rename",path:t,name:n,newName:a,data:e.itemData,showFileExtension:e.showFileExtension},st,t)}function ke(e,t,i,n,a,s,r){var o={action:a,path:t,targetData:e.itemData[0],targetPath:n,names:i,renameFiles:s,data:r};e.destinationPath=n,Qe(e,o,rt,t,a,n)}function Le(e,t,i,n){Qe(e,{action:n,path:i,names:t,data:e.itemData},ot,i)}function Te(e,t,i,n){Qe(e,{action:n,path:i,names:t,data:e.itemData},lt,i,n)}function Ae(e){return e.fileSystemData.length>=0&&t.isNullOrUndefined(e.ajaxSettings.url)}function Fe(e,t){return e.some(function(e){return e.name===t})}function Ue(e,i){return e.fileSystemData.findIndex(function(e){return!t.isNullOrUndefined(e)&&String(e.id)===String(i)})}function Ve(e,t){return e.fileSystemData.filter(function(e){return String(e.id)===String(t)})[0]}function _e(e,t){return e.fileSystemData.filter(function(e){return String(e.parentId)===String(t)})}function He(e,i,n,a){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=null);var l=new Date,h=String(i.id)===String(0)||t.isNullOrUndefined(i.parentId)?"\\":i.filterPath+i.name+"\\";return Object.assign(r,{dateCreated:l,dateModified:l,filterPath:h,hasChild:!!a&&e.hasChild,id:s.getUid(null===n?e.name:n),isFile:!!a&&e.isFile,name:null===n?e.name:n,parentId:i.id,size:a?e.size:0,type:a?e.type:""}),t.isNullOrUndefined(i.filterId)||Object.assign(r,{filterId:i.filterId+i.id+"/"}),r}function Be(e,t,i,n){e.responseData={cwd:null,details:null,error:{code:i,message:t,fileExists:null!=n?n:null},files:null}}function ze(e,i,n){var a={folderName:t.getValue("name",i),cancel:!1,path:t.getValue("path",i),parentFolder:t.getValue("data",i)};e.trigger("beforeFolderCreate",a,function(t){if(t.cancel)return void(n.cancel=!0);if(Ae(e))if(Fe(e.fileSystemData,t.folderName)){var i="A file or folder with the name "+t.folderName+" already exists.";Be(e,i,"400",null)}else{var a=t.parentFolder[0],s=He(a,a,t.folderName,!1);e.fileSystemData.push(s)}})}function qe(e,i,n){var a={cancel:!1,itemData:t.getValue("data",i),path:t.getValue("path",i)};e.trigger("beforeDelete",a,function(t){if(t.cancel)return void(n.cancel=!0);Ae(e)&&t.itemData.forEach(function(t){var i=Ue(e,t.id);-1!==i&&e.fileSystemData.splice(i,1),t.isFile||e.fileSystemData.filter(function(e){return e.filterPath.includes(t.name)}).forEach(function(t){var i=Ue(e,t.id);-1!==i&&e.fileSystemData.splice(i,1)})})})}function We(e,i,n){var a={cancel:!1,newName:t.getValue("newName",i),itemData:t.getValue("data",i),path:t.getValue("path",i)};e.trigger("beforeRename",a,function(t){if(t.cancel)return void(n.cancel=!0);if(Ae(e))if(Fe(e.fileSystemData,t.newName)){var i="Cannot rename"+t.itemData[0].name+"to"+t.newName+": destination already exists.";Be(e,i,"400",null)}else{var a=Ve(e,t.itemData[0].id),s=a.name;a.name=t.newName,Ke(e,a.id,s,t.newName)}})}function Ke(e,t,i,n){e.fileSystemData.forEach(function(a){if(String(a.parentId)===String(t)){var s=a.filterPath.replace(i+"\\",n+"\\");a.filterPath=s,Ke(e,a.id,i,n)}})}function Ye(e,i,n){var a={cancel:!1,itemData:t.getValue("data",i),isCopy:"copy"===t.getValue("action",i),path:t.getValue("path",i),targetData:t.getValue("targetData",i),targetPath:t.getValue("targetPath",i)};e.trigger("beforeMove",a,function(a){if(a.cancel)return void(n.cancel=!0);if(Ae(e)){var s=t.getValue("action",i),r=Ne(e,a.itemData,s,!1),o=Ne(e,[a.targetData],s,!0),l=[];if(e.pasteNodes=[],""===r&&""===o){if(a.isCopy){var h=_e(e,a.targetData.id);return a.itemData.forEach(function(n){if(!Fe(h,n.name)||t.getValue("renameFiles",i).length>0){if(t.getValue("renameFiles",i).length>0){var s=n.name.split("."),r=n.name.includes(".")?s[0]+"("+e.existingFileCount+")."+s[1]:s[0]+"("+e.existingFileCount+")";return Ze(e,n,a.targetData,r),e.responseData.error=null,void e.existingFileCount++}Ze(e,n,a.targetData,null)}else l.push(n.name)}),void(l.length>0&&Be(e,"File Already Exists","400",l))}for(var d=a.targetData,c=_e(e,d.id),p=0;p<a.itemData.length;p++){var u=a.itemData[p];if(!Fe(c,u.name)||t.getValue("renameFiles",i).length>0){if(!d.hasChild){d.hasChild=!u.isFile;var f=e.fileSystemData.filter(function(e){return String(e.id)===String(d.id)});f.length>0&&(f[0].hasChild=d.hasChild)}if(!u.isFile){var g=0!==u.parentId?_e(e,u.parentId):[];Ve(e,u.parentId).hasChild=g.length>1}var m=Ve(e,u.id);if(t.getValue("renameFiles",i).length>0){var b=u.name.split(".");u.name=u.name.includes(".")?b[0]+"("+e.existingFileCount+")."+b[1]:b[0]+"("+e.existingFileCount+")",m.name=u.name,e.responseData.error=null,e.existingFileCount++,e.dropData=d,e.dropPath=a.path;var v=a.targetPath.replace(/^\/|\/$/g,"").split("/");d=Ve(e,v[v.length-1])}m.parentId=d.id,m.filterPath=0===d.id?"\\":d.filterPath+d.name+"\\",t.isNullOrUndefined(d.filterId)||(m.filterId=d.filterId+d.id+"/"),u.isFile||et(e,m)}else l.push(u.name)}l.length>0&&Be(e,"File Already Exists","400",l)}}})}function Ge(e,i,n){var a={searchResults:t.getValue("data",i),cancel:!1,path:t.getValue("path",i),searchText:t.getValue("searchString",i),caseSensitive:t.getValue("caseSensitive",i),showHiddenItems:t.getValue("showHiddenItems",i)};e.trigger("search",a,function(e){t.setValue("data",e.searchResults,i),e.cancel&&(n.cancel=!0)})}function Je(e,i,n){switch(t.getValue("action",i)){case"create":ze(e,i,n);break;case"delete":qe(e,i,n);break;case"rename":We(e,i,n);break;case"move":case"copy":Ye(e,i,n);break;case"search":Ge(e,i,n)}}function Qe(e,i,n,a,s,r){var o={url:e.ajaxSettings.url,type:"POST",mode:!0,dataType:"json",contentType:"application/json",data:JSON.stringify(i),onSuccess:null,onFailure:null,beforeSend:null},l={action:t.getValue("action",i),ajaxSettings:o,cancel:!1};Je(e,i,l),e.trigger("beforeSend",l,function(o){if(!o.cancel){if(e.notify(Ln,{}),Ae(e)){var l=("node-expand"===a||"finalize-end"===a||"rename-end-parent"===a?t.getValue("path",i):e.path).replace(/^\/|\/$/g,"").split("/"),h="rename-end-parent"===a||"path-changed"===a&&0!==t.getValue("data",i).length&&t.isNullOrUndefined(e.renamedItem)?t.getValue("data",i)[0].id:l[l.length-1],d=t.getValue("action",i),c=("move"===d||"rename"===d||"copy"===d||"delete"===d||"search"===d)&&"rename-end"!==a;if("read"===d||"create"===d||"rename-end"===a){var p=e.fileSystemData.filter(function(e){return t.isNullOrUndefined(e.parentId)}).length>0?e.fileSystemData.filter(function(e){return t.isNullOrUndefined(e.parentId)})[0].id:0;if(e.responseData={cwd:Ve(e,"/"===e.path&&"node-expand"!==a&&"rename-end-parent"!==a?p:h),details:null,error:null,files:_e(e,"/"===e.path&&"node-expand"!==a&&"rename-end-parent"!==a?p:h)},t.isNullOrUndefined(e.responseData.cwd)){Be(e,"Cannot load empty data within the File Manager.","400",null)}}else if(c&&null===e.responseData.error)0===(u="search"===d||"delete"===d?t.getValue("data",i):[]).length&&(u="copy"===d?e.pasteNodes.map(function(t){return Ve(e,t)}):t.getValue("data",i).map(function(t){return Ve(e,t.id)})),e.responseData={cwd:null,details:null,error:null,files:u};else if("details"===t.getValue("action",i)){var u=t.getValue("data",i),f=u[0],g=u.length>1,m=u.map(function(e){return e.name}),b=Xe(g?u.reduce(function(e,t){return e+(t.size||0)},0):f.size),v=e.pathNames.includes(f.name)||g?e.pathNames.join("/"):e.pathNames.join("/")+"/"+f.name;e.responseData.details=Object.assign({location:v,multipleFiles:g,name:m.join(", "),size:b},g?{}:{created:f.dateCreated,isFile:f.isFile,modified:f.dateModified,permission:f.permission})}return void $e(e,e.responseData,n,i,a,s,r,o)}new t.Ajax({url:t.getValue("url",o.ajaxSettings),type:t.getValue("type",o.ajaxSettings),mode:t.getValue("mode",o.ajaxSettings),dataType:t.getValue("dataType",o.ajaxSettings),contentType:t.getValue("contentType",o.ajaxSettings),data:t.getValue("data",o.ajaxSettings),beforeSend:t.getValue("beforeSend",o.ajaxSettings),onSuccess:function(l){if(t.isNullOrUndefined(l)){var h={error:{fileExists:null,message:B(e,"Server-Error")+" "+e.ajaxSettings.url,code:"406"},files:null};return void tt(e,o,n,h,a,s,r)}"string"==typeof l&&(l=JSON.parse(l)),$e(e,l,n,i,a,s,r,o)},onFailure:function(){var t={files:null,error:{code:"404",message:B(e,"Network-Error")+" "+e.ajaxSettings.url,fileExists:null}};tt(e,o,n,t,a,s,r)}}).send()}})}function Xe(e){return e<1024?e+" B":e<1048576?(e/1024).toFixed(2)+" KB":e<1073741824?(e/1024/1024).toFixed(2)+" MB":(e/1024/1024/1024).toFixed(2)+" GB"}function $e(e,i,n,a,s,r,o,l){e.notify(An,{action:"success"});var h=e.expandedId?e.expandedId:e.pathId[e.pathId.length-1];if(!t.isNullOrUndefined(i.cwd)&&"read"===t.getValue("action",a)&&(i.cwd.name=1===e.pathId.length?e.rootAliasName||i.cwd.name:i.cwd.name,t.setValue("_fm_id",h,i.cwd),t.setValue(h,i.cwd,e.feParent),!t.isNullOrUndefined(i.files)||"401"===i.error.code)){if(("finalize-end"===s||"initial-end"===s)&&0===e.pathNames.length){var d=t.getValue(e.pathId[0],e.feParent);e.pathNames[0]=t.getValue("name",d),e.hasId=!t.isNullOrUndefined(t.getValue("id",d))}"finalize-end"===s&&b(e)}if(!t.isNullOrUndefined(i.files)){H(i.files);for(var c=0,p=i.files.length;c<p;c++){var u=i.files[c];t.setValue("_fm_iconClass",R(u),u)}"read"===t.getValue("action",a)&&(_(i,h),t.setValue(h,i.files,e.feFiles))}if(!t.isNullOrUndefined(i.details)&&!t.isNullOrUndefined(e.rootAliasName)){var f=e.rootAliasName||t.getValue("name",i.details),g=t.getValue("location",i.details).replace(new RegExp("/","g"),"\\");"/"===t.getValue("path",a)||e.hasId&&1===t.getValue("path",a).match(/[/]/g).length?(0===t.getValue("names",a).length&&t.setValue("name",f,i.details),g=-1===g.indexOf("\\")?f:g.replace(g.substring(0,g.indexOf("\\")),f)):g=g.replace(g.substring(0,g.indexOf("\\")),f),t.setValue("location",g,i.details)}n(e,i,s,r,o),t.isNullOrUndefined(i.files)||"path-changed"!==s&&"finalize-end"!==s&&"open-end"!==s&&"drop-path"!==s||e.notify(aa,i),"function"==typeof t.getValue("onSuccess",l.ajaxSettings)&&t.getValue("onSuccess",l.ajaxSettings)()}function Ze(e,t,i,n){var a=He(t,i,n,!0);e.fileSystemData.push(a),e.pasteNodes.push(a.id);for(var s=_e(e,t.id),r=0;r<s.length;r++)Ze(e,s[r],a,null)}function et(e,i){_e(e,i.id).forEach(function(n){n.filterPath=i.filterPath+i.name+"\\",t.isNullOrUndefined(i.filterId)||(n.filterId=i.filterId+i.id+"/"),n.isFile||et(e,n)})}function tt(e,i,n,a,s,r,o){e.notify(An,{action:"failure"}),n(e,a,s,r,o),"function"==typeof t.getValue("onFailure",i.ajaxSettings)&&t.getValue("onFailure",i.ajaxSettings)()}function it(e,i,n){try{if(t.isNullOrUndefined(i.files))t.isNullOrUndefined(i.error)||"401"!==i.error.code||(i.files=[],e.notify(n,i),e.notify(Hn,{})),ht(e,i,"read"),e.setProperties({path:e.oldPath},!0),e.pathNames.pop();else{e.notify(n,i),e.notify(Hn,{});a={action:"read",result:i};e.trigger("success",a)}}catch(t){ut(e,t,"read"),e.setProperties({path:e.oldPath},!0),e.pathNames.pop()}if(e.isDragDrop&&e.isDropEnd){if(0!==e.droppedObjects.length){var a={fileDetails:e.droppedObjects};e.trigger("fileDropped",a)}e.isDropEnd=e.isDragDrop=!1}}function nt(e,i,n,a){try{if(t.isNullOrUndefined(i.files))ht(e,i,a);else{e.notify(n,i);var s={action:a,result:i};e.trigger("success",s)}}catch(t){ut(e,t,a)}}function at(e,i,n){try{if(t.isNullOrUndefined(i.files))if("400"===i.error.code){if(e.dialogObj&&e.dialogObj.visible){var a=t.select("#newname",e.dialogObj.element),s=B(e,"Validation-NewFolder-Exists").replace("{0}",'"'+a.value+'"');a.parentElement.nextElementSibling.innerHTML=s}else mt(e,"Error",{files:null,error:{code:"400",message:B(e,"Validation-NewFolder-Exists").replace("{0}",'"'+n+'"'),fileExists:null}});o={action:"create",error:i.error};e.trigger("failure",o)}else e.dialogObj&&e.dialogObj.visible&&e.dialogObj.hide(),ht(e,i,"create");else{e.dialogObj&&e.dialogObj.visible&&e.dialogObj.hide(),e.createdItem=Ae(e)?i.files[i.files.length-1]:i.files[0],e.breadcrumbbarModule.searchObj.value="";var r={folderName:n,path:e.path,parentFolder:e.itemData};e.trigger("folderCreate",r);var o={action:"create",result:i};e.trigger("success",o),e.itemData=[E(e)],Ee(e,xn,e.path)}}catch(s){e.dialogObj&&e.dialogObj.visible&&e.dialogObj.hide(),ut(e,s,"create")}}function st(e,i){try{if(t.isNullOrUndefined(i.files))if("400"===i.error.code&&e.dialogObj&&e.dialogObj.visible){var n=t.select("#rename",e.dialogObj.element),a=B(e,"Validation-Rename-Exists").replace("{0}",'"'+e.currentItemText+'"');a=a.replace("{1}",'"'+n.value+'"'),n.parentElement.nextElementSibling.innerHTML=a;s={action:"rename",error:i.error};e.trigger("failure",s)}else t.isNullOrUndefined(e.dialogObj)||e.dialogObj.hide(),ht(e,i,"rename");else{t.isNullOrUndefined(e.dialogObj)||e.dialogObj.hide();var s={action:"rename",result:i};e.trigger("success",s),e.renamedItem=Array.isArray(i.files)?i.files[0]:i.files;var r={newName:e.renamedItem.name,itemData:[e.renamedItem],path:e.path};if(e.trigger("rename",r),"navigationpane"===e.activeModule){var o=E(e),l=e.pathId[e.pathId.length-1].split("_").length-2;e.pathId.pop(),e.itemData=[t.getValue(e.pathId[e.pathId.length-1],e.feParent)];var h=je(e,e.renamedItem);Ee(e,Gn,h),!t.isNullOrUndefined(o)&&e.pathNames.length>1&&l<=e.pathNames.length-1&&(e.pathNames[l]=e.renameText,e.hasId||e.setProperties({path:"/"+e.pathNames.slice(1).join("/")+"/"},!0)),e.itemData=e.navigationpaneModule.previousSelected.length>0?e.navigationpaneModule.treeObj.getTreeData(e.navigationpaneModule.previousSelected[0]):e.itemData,Ee(e,Rn,e.path),e.itemData[0]=e.renamedItem,e.renamedItem=null}else e.itemData=[E(e)],""!==e.breadcrumbbarModule.searchObj.value?dt(e,Jn,e.path,e.searchWord,e.showHiddenItems,!e.searchSettings.ignoreCase):e.isFiltered?Me(e,Jn):Ee(e,Jn,e.path)}}catch(a){t.isNullOrUndefined(e.dialogObj)||e.dialogObj.hide(),ut(e,a,"rename")}}function rt(e,i,n,a){try{var s={itemData:i.files,isCopy:"copy"===a,path:n,targetData:e.itemData[0],targetPath:e.path};e.trigger("move",s),i.error&&i.error.fileExists?(e.fileLength=0,t.isNullOrUndefined(i.files)||(e.isPasteError=!0,Z(e,a,i)),bt(e,"DuplicateItems",i.error.fileExists),"404"===i.error.code&&mt(e,"Error",i)):i.error||t.isNullOrUndefined(i.files)?i.error&&!t.isNullOrUndefined(i.files)?(e.isPasteError=!0,Z(e,a,i),mt(e,"Error",i)):ht(e,i,a):(e.isPasteError=!1,Z(e,a,i))}catch(t){ut(e,t,a)}}function ot(e,i,n){try{var a={itemData:i.files,path:n};if(e.trigger("delete",a),t.isNullOrUndefined(i.files))ht(e,i,"delete");else if(e.setProperties({path:n},!0),e.itemData=[E(e)],Ee(e,En,e.path),i.error)ht(e,i,"delete");else{var s={action:"delete",result:i};e.trigger("success",s)}}catch(t){ut(e,t,"delete")}}function lt(e,i,n,a){try{if(t.isNullOrUndefined(i.details))ht(e,i,"details");else{mt(e,a,null,i.details);var s={action:"details",result:i};e.trigger("success",s)}}catch(t){ut(e,t,"details")}}function ht(e,t,i){mt(e,"Error",t);var n={action:i,error:t.error};e.trigger("failure",n)}function dt(e,t,i,n,a,s){Qe(e,{action:"search",path:i,searchString:n,showHiddenItems:a,caseSensitive:s,data:e.itemData},ct,t)}function ct(e,i,n){try{if(t.isNullOrUndefined(i.files))ht(e,i,"search");else{e.notify(n,i);var a={action:"search",result:i};e.trigger("success",a)}}catch(t){ut(e,t,"search")}}function pt(e,i,n){var a=e.ajaxSettings.downloadUrl?e.ajaxSettings.downloadUrl:e.ajaxSettings.url,s={action:"download",path:i,names:n,data:e.itemData},r={data:s,cancel:!1,useFormPost:!0,ajaxSettings:{url:a,type:"POST",contentType:"application/json",responseType:"blob",data:JSON.stringify(s),onSuccess:null,onFailure:null,beforeSend:null}};e.trigger("beforeDownload",r,function(i){if(!i.cancel)if(i.useFormPost){var n=t.createElement("form",{id:e.element.id+"_downloadForm",attrs:{action:a,method:"post",name:"downloadForm",download:""}}),s=t.createElement("input",{id:e.element.id+"_hiddenForm",attrs:{name:"downloadInput",value:JSON.stringify(i.data),type:"hidden"}});n.appendChild(s),e.element.appendChild(n),document.forms.namedItem("downloadForm").submit(),e.element.removeChild(n)}else try{var r,o;new t.Fetch({url:t.getValue("url",i.ajaxSettings),type:t.getValue("type",i.ajaxSettings),contentType:t.getValue("contentType",i.ajaxSettings),responseType:t.getValue("responseType",i.ajaxSettings),beforeSend:t.getValue("beforeSend",i.ajaxSettings),onLoad:function(i){if(r=i.headers.get("Content-Disposition")){var n=r.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/),a=n&&n[1];o=a?a.replace(/['"]/g,""):o}else o=e.itemData.length>1?"files.zip":t.getValue("isFile",e.itemData[0])?t.getValue("name",e.itemData[0]):t.getValue("name",e.itemData[0])+".zip"},onSuccess:function(t){e.trigger("success",i);var n=t,a=URL.createObjectURL(n),s=document.createElement("a");s.href=a,s.download=o,document.body.appendChild(s),s.click(),document.body.removeChild(s)},onFailure:function(t){var n={error:{code:t.status.toString(),message:B(e,"Network-Error")+" "+e.ajaxSettings.downloadUrl}};mt(e,"Error",n),e.trigger("failure",i)}}).send(JSON.stringify(i.data))}catch(t){ut(e,t,"download")}})}function ut(e,t,i){ht(e,{files:null,error:{message:t.message,fileExists:null}},i)}function ft(e,i){e.notify(An,{action:"success"}),i&&"function"==typeof t.getValue("onSuccess",i)&&t.getValue("onSuccess",i)()}function gt(e,i,n){e.notify(An,{action:"failure"}),mt(e,"Error",n),"function"==typeof t.getValue("onFailure",i)&&t.getValue("onFailure",i)()}function mt(e,i,a,s){var r=kt(e,i,a,s);t.isNullOrUndefined(e.dialogObj)?(e.dialogObj=new n.Dialog({beforeOpen:Lt.bind(this,e,r.dialogName),beforeClose:function(t){yt(e,e.dialogObj,t,r.dialogName)},header:r.header,content:r.content,buttons:r.buttons,animationSettings:{effect:"None"},showCloseIcon:!0,closeOnEscape:!0,visible:!0,allowDragging:!0,isModal:!0,target:e.popupTarget?e.popupTarget:"#"+e.element.id,cssClass:z(e,e.isMobile?Ai:Ti),width:"350px",open:r.open,close:r.close,enableRtl:e.enableRtl,enableHtmlSanitizer:e.enableHtmlSanitizer,locale:e.locale}),e.dialogObj.isStringTemplate=!0,e.dialogObj.appendTo("#"+e.element.id+ji)):Ft(e,r)}function bt(e,i,a,s){var r=wt(e,i,a,s);e.isApplySame=!1,t.isNullOrUndefined(e.extDialogObj)?(e.extDialogObj=new n.Dialog({beforeOpen:Tt.bind(this,e,r.dialogName),beforeClose:function(t){yt(e,e.extDialogObj,t,r.dialogName)},content:r.content,header:r.header,closeOnEscape:!0,allowDragging:!0,animationSettings:{effect:"None"},target:e.popupTarget?e.popupTarget:"#"+e.element.id,cssClass:z(e,e.isMobile?Ai:Ti),enableRtl:e.enableRtl,showCloseIcon:!0,isModal:!0,width:350,buttons:r.buttons,open:r.open,close:r.close,enableHtmlSanitizer:e.enableHtmlSanitizer,locale:e.locale}),e.extDialogObj.isStringTemplate=!0,e.extDialogObj.appendTo("#"+e.element.id+Ei)):(e.extDialogObj.header=r.header,e.extDialogObj.close=r.close,e.extDialogObj.open=r.open,e.extDialogObj.close=r.close,e.extDialogObj.content=r.content,e.extDialogObj.buttons=r.buttons,e.extDialogObj.enableRtl=e.enableRtl,e.extDialogObj.locale=e.locale,e.extDialogObj.beforeOpen=Tt.bind(this,e,r.dialogName),e.extDialogObj.beforeClose=function(t){yt(e,e.extDialogObj,t,r.dialogName)},e.extDialogObj.dataBind(),e.extDialogObj.show())}function vt(e,t,i,n){var a={cancel:i.cancel,popupName:n,popupModule:t};e.trigger("beforePopupOpen",a,function(e){i.cancel=e.cancel})}function yt(e,t,i,n){var a={cancel:i.cancel,popupModule:t,popupName:n};e.trigger("beforePopupClose",a,function(t){i.cancel=t.cancel,i.cancel||!i.isInteracted||"Rename"!==n&&"Create Folder"!==n||e.trigger(Fn,{})})}function It(e,t,i){var n={popupModule:t,element:t.element,popupName:i};e.trigger("popupOpen",n)}function Ot(e,t,i){var n={popupModule:t,element:t.element,popupName:i};e.trigger("popupClose",n)}function wt(e,t,i,n){var a,s,r,o={header:"",content:"",buttons:[],dialogName:""};switch(o.open=function(){It(e,e.extDialogObj,o.dialogName)},o.close=function(){Ot(e,e.extDialogObj,o.dialogName)},t){case"Extension":o.header=B(e,"Header-Rename-Confirmation"),o.content="<div>"+B(e,"Content-Rename-Confirmation")+"</div>",o.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Yes")},click:function(){e.extDialogObj.hide(),Re(e,n,e.renameText)}},{buttonModel:{content:B(e,"Button-No")},click:function(){e.extDialogObj.hide(),e.dialogObj.hide()}}],o.dialogName="Extension Change";break;case"DuplicateItems":o.dialogName="Duplicate Items",e.replaceItems=i,s=-1===(r=(s=e.replaceItems[e.fileLength]).lastIndexOf("/"))?s:s.substring(r),o.header=B(e,"Header-Duplicate"),a="<div>"+B(e,"Content-Duplicate")+"</div>",o.content=a.replace("{0}",s),o.close=function(){if(!e.isDropEnd&&0===e.duplicateItems.length){var t={fileDetails:e.droppedObjects};e.trigger("fileDropped",t),e.isDropEnd=e.isDragDrop=!1}Ot(e,e.extDialogObj,o.dialogName)},o.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Yes")},click:function(){if(e.duplicateItems.push(e.replaceItems[e.fileLength]),e.duplicateRecords.push(te(e,e.replaceItems[e.fileLength])),e.fileLength++,i[e.fileLength]){var t=e.replaceItems[e.fileLength],n=t.lastIndexOf("/");t=-1===n?t:t.substring(n),e.extDialogObj.content=a.replace("{0}",t),e.extDialogObj.show()}else{e.extDialogObj.hide();var s=e.isDragDrop?e.dragPath:e.targetPath,r=e.isDragDrop?e.dropPath:""===e.folderPath?e.path:e.folderPath,o=e.isDragDrop?"move":e.fileAction;ke(e,s,e.duplicateItems,r,o,e.duplicateItems,e.duplicateRecords)}}},{buttonModel:{content:B(e,"Button-No")},click:function(){if(e.fileLength++,i[e.fileLength]){var t=e.replaceItems[e.fileLength],n=t.lastIndexOf("/");t=-1===n?t:t.substring(n),e.extDialogObj.content=a.replace("{0}",t),e.extDialogObj.show()}else if(e.extDialogObj.hide(),0!==e.duplicateItems.length){var s=e.isDragDrop?"move":e.fileAction,r=e.isDragDrop?e.dragPath:e.targetPath,o=e.isDragDrop?e.dropPath:""===e.folderPath?e.path:e.folderPath;ke(e,r,e.duplicateItems,o,s,e.duplicateItems,e.duplicateRecords)}}}];break;case"UploadRetry":o.dialogName="Retry Upload",o.header=B(e,"Header-Retry"),o.content=e.retryFiles[0].name+'<div class="e-fe-retrycontent">'+B(e,"Content-Retry")+"</div>",o.open=Ct.bind(this,e),o.close=function(){e.isRetryOpened=!1,St(e),Ot(e,e.extDialogObj,o.dialogName)},o.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Keep-Both")},click:function(){Dt(e,!0)}},{buttonModel:{isPrimary:!0,content:B(e,"Button-Replace")},click:function(){Dt(e,!1)}},{buttonModel:{isPrimary:!0,content:B(e,"Button-Skip")},click:function(){var t=0;e.isApplySame?(t=e.retryFiles.length,e.retryFiles=[],St(e)):(t=1,e.retryFiles.splice(0,1),0!==e.retryFiles.length?bt(e,"UploadRetry"):St(e)),e.notify(Tn,{count:t})}}]}return o}function Dt(e,t){e.isApplySame?(t?xt(e):jt(e),St(e)):(e.retryArgs.push({action:t?"keepboth":"replace",file:e.retryFiles[0]}),e.uploadObj.retry(e.retryFiles[0]),e.retryFiles.splice(0,1),0!==e.retryFiles.length?bt(e,"UploadRetry"):St(e))}function St(e){var i=!0;e.isRetryOpened?e.isRetryOpened=!1:i=!1;var n=t.select(".e-dlg-checkbox",e.extDialogObj.element);n&&t.remove(n),i?e.extDialogObj.hide():e.retryFiles=[]}function Ct(e,i){e.isRetryOpened=!0;var n=t.getValue("element",i),a=t.select(".e-dlg-content",n),s=e.createElement("div",{className:"e-dlg-checkbox"}),r=e.createElement("input",{id:e.element.id+"_applyall"});s.appendChild(r),a.appendChild(s),new o.CheckBox({label:B(e,"ApplyAll-Label"),change:function(t){e.isApplySame=t.checked}}).appendTo("#"+e.element.id+"_applyall"),It(e,e.extDialogObj,"Retry Upload")}function xt(e){for(;0!==e.retryFiles.length;)e.retryArgs.push({action:"keepboth",file:e.retryFiles[0]}),e.uploadObj.retry(e.retryFiles[0]),e.retryFiles.splice(0,1)}function jt(e){for(;0!==e.retryFiles.length;)e.retryArgs.push({action:"replace",file:e.retryFiles[0]}),e.uploadObj.retry(e.retryFiles[0]),e.retryFiles.splice(0,1)}function Nt(e){var i=t.select("#newname",e.dialogObj.element);i.focus(),i.value="";var n=i.value.length;i.setSelectionRange(0,n)}function Et(e){var i=t.select("#newname",e.dialogObj.element);i.parentElement.classList.contains("e-control-wrapper")||Rt(i,B(e,"Content-NewFolder")),i.parentElement.nextElementSibling.innerHTML="",i.oninput=function(){Ht(e,i)},i.onkeyup=function(t){13===qt(t)&&Ut(e)},Nt(e),It(e,e.dialogObj,"Create Folder")}function Pt(e){var i=t.select("#rename",e.dialogObj.element);i.parentElement.classList.contains("e-control-wrapper")||Rt(i,B(e,"Content-Rename")),i.parentElement.nextElementSibling.innerHTML="",i.oninput=function(){Ht(e,i)},i.onkeyup=function(t){13===qt(t)&&Vt(e)},Mt(e,i),It(e,e.dialogObj,"Rename")}function Mt(e,t){t.focus();var i="";if(e.isFile&&!e.showFileExtension){var n=e.currentItemText.lastIndexOf(".");i=-1===n?e.currentItemText:e.currentItemText.substring(0,n)}else i=e.currentItemText;t.value=i,e.isFile&&e.showFileExtension&&-1!==t.value.indexOf(".")?t.setSelectionRange(0,t.value.lastIndexOf(".")):t.setSelectionRange(0,t.value.length)}function Rt(e,t){r.Input.createInput({element:e,properties:{placeholder:t}})}function kt(e,i,n,a){var s,r,o,l,h,d={header:"",content:"",buttons:[],dialogName:""};d.open=function(){It(e,e.dialogObj,d.dialogName)},d.close=function(){Ot(e,e.dialogObj,d.dialogName)};var c;switch(i=a&&!0===a.multipleFiles?"MultipleFileDetails":i){case"NewFolder":d.dialogName="Create Folder",d.header=B(e,"Header-NewFolder"),d.content='<input type="text" value="New folder" id="newname"><div class="e-fe-error"></div>',d.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Create")},click:function(t){"keydown"!==t.type&&Ut(e)}}],d.open=Et.bind(this,e);break;case"Delete":d.dialogName="Delete",e.selectedItems.length>1?(d.content=("<div>"+B(e,"Content-Multiple-Delete")+"</div>").replace("{0}",e.selectedItems.length.toString()),d.header=B(e,"Header-Multiple-Delete")):(d.content="<div>"+B(e,e.isFile?"Content-Delete":"Content-Folder-Delete")+"</div>",d.header=B(e,e.isFile?"Header-Delete":"Header-Folder-Delete")),d.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Yes")},click:function(){_t(e)}},{buttonModel:{content:B(e,"Button-No")},click:function(){e.dialogObj.hide()}}];break;case"Rename":d.dialogName="Rename",d.header=B(e,"Header-Rename"),d.content='<input type="text" class="e-input" id="rename"><div class="e-fe-error"></div>',d.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Save")},click:function(t){"keydown"!==t.type&&Vt(e)}}],d.open=Pt.bind(this,e);break;case"details":d.dialogName="File Details",r=new t.Internationalization(e.locale).formatDate(new Date(a.modified),{format:"MMMM dd, yyyy HH:mm:ss"}),s="",t.isNullOrUndefined(a.permission)||(s="<tr><td>"+B(e,"Permission")+'</td><td class="'+On+'" >'+de(a.permission)+"</td></tr>"),d.header=a.name,d.content="<table><tr><td>"+B(e,"Type")+'</td><td class="'+On+'" title="'+(a.isFile?"File":"Folder")+'">'+(a.isFile?"File":"Folder")+"</td></tr><tr><td>"+B(e,"Size")+'</td><td><span class="'+On+'" title ="'+a.size+'">'+a.size+"</span></td></tr><tr><td>"+B(e,"Location")+'</td><td class="'+On+'" title="'+a.location+'">'+a.location+"</td></tr><tr><td>"+B(e,"Modified")+'</td><td class="'+On+'" >'+r+"</td></tr>"+s+"</table>",d.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Ok")},click:function(){e.dialogObj.hide()}}];break;case"MultipleFileDetails":d.dialogName="File Details",void 0===(o=e.itemData.map(function(e){return c=e.name.indexOf(".")+1,0!==c||e.isFile?0!==c?e.name.substr(c).replace(" ",""):"undetermined":"Folder"}))[0]&&(o=a.name.split(",").map(function(e){return c=e.indexOf(".")+1,0===c?"Folder":e.substr(c).replace(" ","")})),l=o.every(function(e,t,i){return e===i[0]})?"Folder"===o[0]?"Folder":o[0].toLocaleUpperCase()+" Type":"Multiple Types",h=a.location,d.header=a.name,d.content="<table><tr><td>"+B(e,"Type")+':</td><td class="'+On+'">'+l+"</td></tr><tr><td>"+B(e,"Size")+":</td><td>"+a.size+'<span class="'+On+'" title ="'+a.size+'"></span></td></tr><tr><td>'+B(e,"Location")+':</td><td class="'+On+'" title="'+h+'">'+h+"</td></tr></table>",d.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Ok")},click:function(t){"keydown"!==t.type&&e.dialogObj.hide()}}];break;case"Error":e.notify(Fn,{}),d.dialogName="Error","401"===n.error.code?d.header='<span class="e-fe-icon e-fe-access-error"></span><div class="e-fe-access-header">'+B(e,"Access-Denied")+"</div>":d.header=B(e,"Error"),d.content='<div class="'+vn+'">'+n.error.message+"</div>",d.buttons=[{buttonModel:{isPrimary:!0,content:B(e,"Button-Ok")},click:function(){e.dialogObj.hide()}}]}return d}function Lt(e,i,n){At(t.selectAll(".e-btn",e.dialogObj.element)),vt(e,e.dialogObj,n,i)}function Tt(e,i,n){At(t.selectAll(".e-btn",e.extDialogObj.element)),vt(e,e.extDialogObj,n,i)}function At(e){for(var t=0;t<e.length;t++)!function(t){e[t].onkeydown=function(e){13===e.keyCode&&e.preventDefault()},e[t].onkeyup=function(i){13===i.keyCode&&e[t].click()}}(t)}function Ft(e,t){e.dialogObj.header=t.header,e.dialogObj.content=t.content,e.dialogObj.buttons=t.buttons,e.dialogObj.enableRtl=e.enableRtl,e.dialogObj.open=t.open,e.dialogObj.close=t.close,e.dialogObj.beforeOpen=Lt.bind(this,e,t.dialogName),e.dialogObj.beforeClose=function(i){yt(e,e.dialogObj,i,t.dialogName)},e.dialogObj.dataBind(),e.dialogObj.show()}function Ut(e){var i=t.select("#newname",e.dialogObj.element);Bt(e,i),""===i.parentElement.nextElementSibling.innerHTML&&Pe(e,i.value)}function Vt(e){var i=t.select("#rename",e.dialogObj.element);if(Bt(e,i),""===i.parentElement.nextElementSibling.innerHTML){var n=i.value,a=e.currentItemText.lastIndexOf(".");if(e.isFile&&!e.showFileExtension&&(n+=-1===a?"":e.currentItemText.substr(a)),e.renameText=n,e.currentItemText===n)return void e.dialogObj.hide();var s="";if(s="navigationpane"===e.activeModule?je(e,e.itemData[0]):e.path,e.renamedId=t.getValue("id",e.itemData[0]),e.isFile){var r=-1===a?"":e.currentItemText.substr(a),o=n.lastIndexOf("."),l=-1===o?"":n.substr(o);e.showFileExtension&&r!==l?bt(e,"Extension",null,s):Re(e,s,n)}else Re(e,s,n)}}function _t(e){e.dialogObj.hide(),e.notify(Nn,{})}function Ht(e,t){/[/\\|*?"<>:]/.test(t.value)?zt(e,t):""===t.value?t.parentElement.nextElementSibling.innerHTML=B(e,"Validation-Empty"):t.parentElement.nextElementSibling.innerHTML=""}function Bt(e,t){Ht(e,t);var i=t.value.length-1;""===t.value||t.value.lastIndexOf(".")!==i&&t.value.lastIndexOf(" ")!==i||!e.showFileExtension&&-1!==t.value.lastIndexOf(".")&&0!==t.value.substring(t.value.indexOf(".")+1).length||zt(e,t)}function zt(e,t){var i=B(e,"Validation-Invalid").replace("{0}",'"'+t.value+'"');e.enableHtmlSanitizer?t.parentElement.nextElementSibling.textContent=i:t.parentElement.nextElementSibling.innerHTML=i}function qt(e){return e.keyCode?e.keyCode:e.which?e.which:e.charCode}function Wt(e,i,a){var s=t.createElement("div",{className:"e-image-wrap"});if(a.useImageAsUrl){var r=t.createElement("img",{className:"e-image",attrs:{src:a.imageUrl,alt:i}});s.appendChild(r)}else{var o=new t.Fetch({url:t.getValue("url",a.ajaxSettings),type:t.getValue("type",a.ajaxSettings),contentType:t.getValue("contentType",a.ajaxSettings),responseType:t.getValue("responseType",a.ajaxSettings),beforeSend:t.getValue("beforeSend",a.ajaxSettings),onSuccess:function(n){var r=URL.createObjectURL(n),o=t.createElement("img",{className:"e-image",attrs:{src:r,alt:i}});s.appendChild(o),ft(e,a.ajaxSettings)},onFailure:function(i){var n={error:{code:i.status.toString(),message:B(e,"Network-Error")+" "+t.getValue("url",a.ajaxSettings)}};gt(e,a.ajaxSettings,n)}}),l=t.getValue("data",a.ajaxSettings);o.send(l)}t.isNullOrUndefined(e.viewerObj)?(e.viewerObj=new n.Dialog({header:i,content:s,animationSettings:{effect:"None"},showCloseIcon:!0,closeOnEscape:!0,visible:!0,isModal:!0,width:"350px",height:"350px",target:e.popupTarget?e.popupTarget:"#"+e.element.id,cssClass:z(e,e.isMobile?Ai:Ti),locale:e.locale,enableResize:!0,allowDragging:!0,enableHtmlSanitizer:e.enableHtmlSanitizer,position:{X:"center",Y:"center"},enableRtl:e.enableRtl,open:Kt.bind(this,e),close:function(){Ot(e,e.viewerObj,"Image Preview")},beforeOpen:function(t){vt(e,e.viewerObj,t,"Image Preview")},beforeClose:function(t){yt(e,e.viewerObj,t,"Image Preview")},resizing:Yt.bind(this,e),resizeStop:Yt.bind(this,e)}),e.viewerObj.isStringTemplate=!0,e.viewerObj.appendTo("#"+e.element.id+Ni)):(e.viewerObj.refresh(),e.viewerObj.header=i,e.viewerObj.content=s,e.viewerObj.enableRtl=e.enableRtl,e.viewerObj.dataBind(),e.viewerObj.show())}function Kt(e){setTimeout(function(){e.viewerObj&&e.viewerObj.element.focus()}),Yt(e),It(e,e.viewerObj,"Image Preview")}function Yt(e){var i=t.select(".e-dlg-content",e.viewerObj.element),n=t.select(".e-image-wrap",e.viewerObj.element),a=window.getComputedStyle(i,null),s=a?2*parseFloat(a.paddingRight):36,r=a?2*parseFloat(a.paddingBottom):20;n.style.width=i.offsetWidth-s+"px",n.style.height=i.offsetHeight-r+"px"}var Gt=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Jt=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Qt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Gt(i,e),Jt([t.Property(null)],i.prototype,"downloadUrl",void 0),Jt([t.Property(null)],i.prototype,"getImageUrl",void 0),Jt([t.Property(null)],i.prototype,"uploadUrl",void 0),Jt([t.Property(null)],i.prototype,"url",void 0),i}(t.ChildProperty),Xt=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),$t=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Zt=["NewFolder","Upload","Cut","Copy","Paste","Delete","Download","Rename","SortBy","Refresh","Selection","View","Details"],ei=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xt(i,e),$t([t.Property(Zt)],i.prototype,"items",void 0),$t([t.Property(!0)],i.prototype,"visible",void 0),i}(t.ChildProperty),ti=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xt(i,e),$t([t.Property("")],i.prototype,"id",void 0),$t([t.Property("")],i.prototype,"text",void 0),$t([t.Property("auto")],i.prototype,"width",void 0),$t([t.Property("")],i.prototype,"cssClass",void 0),$t([t.Property(!1)],i.prototype,"showAlwaysInPopup",void 0),$t([t.Property(!1)],i.prototype,"disabled",void 0),$t([t.Property("")],i.prototype,"prefixIcon",void 0),$t([t.Property("")],i.prototype,"suffixIcon",void 0),$t([t.Property(!0)],i.prototype,"visible",void 0),$t([t.Property("None")],i.prototype,"overflow",void 0),$t([t.Property("")],i.prototype,"template",void 0),$t([t.Property("Button")],i.prototype,"type",void 0),$t([t.Property("Both")],i.prototype,"showTextOn",void 0),$t([t.Property(null)],i.prototype,"htmlAttributes",void 0),$t([t.Property("")],i.prototype,"tooltipText",void 0),$t([t.Property("Left")],i.prototype,"align",void 0),$t([t.Property(-1)],i.prototype,"tabIndex",void 0),$t([t.Property()],i.prototype,"name",void 0),i}(t.ChildProperty),ii=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ni=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},ai=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ii(i,e),ni([t.Property(!0)],i.prototype,"allowSearchOnTyping",void 0),ni([t.Property("contains")],i.prototype,"filterType",void 0),ni([t.Property(!0)],i.prototype,"ignoreCase",void 0),ni([t.Property(null)],i.prototype,"placeholder",void 0),i}(t.ChildProperty),si=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ri=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},oi=[{field:"name",headerText:"Name",minWidth:120,template:'<span class="e-fe-text">${name}</span>',customAttributes:{class:"e-fe-grid-name"}},{field:"_fm_modified",headerText:"DateModified",type:"dateTime",format:"MMMM dd, yyyy HH:mm",minWidth:120,width:"190"},{field:"size",headerText:"Size",minWidth:90,width:"110",template:t.initializeCSPTemplate(function(e){return'<span class="e-fe-size">'+e.size+"</span>"}),format:"n2"}],li=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return si(i,e),ri([t.Property(!0)],i.prototype,"columnResizing",void 0),ri([t.Property(oi)],i.prototype,"columns",void 0),i}(t.ChildProperty),hi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),di=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},ci=["Open","|","Cut","Copy","|","Delete","Download","Rename","|","Details"],pi=["Open","|","Cut","Copy","Paste","|","Delete","Rename","Download","|","Details"],ui=["SortBy","View","Refresh","|","Paste","|","NewFolder","Upload","|","Details","|","SelectAll"],fi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return hi(i,e),di([t.Property(ci)],i.prototype,"file",void 0),di([t.Property(pi)],i.prototype,"folder",void 0),di([t.Property(ui)],i.prototype,"layout",void 0),di([t.Property(!0)],i.prototype,"visible",void 0),i}(t.ChildProperty),gi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),mi=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},bi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return gi(i,e),mi([t.Property("650px")],i.prototype,"maxWidth",void 0),mi([t.Property("240px")],i.prototype,"minWidth",void 0),mi([t.Property(!0)],i.prototype,"visible",void 0),mi([t.Property("None")],i.prototype,"sortOrder",void 0),i}(t.ChildProperty),vi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),yi=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Ii=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return vi(i,e),yi([t.Property("")],i.prototype,"allowedExtensions",void 0),yi([t.Property(!0)],i.prototype,"autoUpload",void 0),yi([t.Property(!1)],i.prototype,"autoClose",void 0),yi([t.Property(!1)],i.prototype,"directoryUpload",void 0),yi([t.Property(0)],i.prototype,"minFileSize",void 0),yi([t.Property(3e7)],i.prototype,"maxFileSize",void 0),yi([t.Property(0)],i.prototype,"chunkSize",void 0),i}(t.ChildProperty),Oi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wi=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Di=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Oi(i,e),wi([t.Property("")],i.prototype,"field",void 0),wi([t.Property("")],i.prototype,"headerText",void 0),wi([t.Property("")],i.prototype,"width",void 0),wi([t.Property("")],i.prototype,"minWidth",void 0),wi([t.Property("")],i.prototype,"maxWidth",void 0),wi([t.Property("Left")],i.prototype,"textAlign",void 0),wi([t.Property(null)],i.prototype,"headerTextAlign",void 0),wi([t.Property(null)],i.prototype,"type",void 0),wi([t.Property(null)],i.prototype,"format",void 0),wi([t.Property(null)],i.prototype,"template",void 0),wi([t.Property(null)],i.prototype,"sortComparer",void 0),wi([t.Property(null)],i.prototype,"headerTemplate",void 0),wi([t.Property(!0)],i.prototype,"allowSorting",void 0),wi([t.Property(!0)],i.prototype,"allowResizing",void 0),wi([t.Property(null)],i.prototype,"customAttributes",void 0),wi([t.Property("")],i.prototype,"hideAtMedia",void 0),wi([t.Property(null)],i.prototype,"customFormat",void 0),wi([t.Property(!1)],i.prototype,"isPrimaryKey",void 0),i}(t.ChildProperty),Si="_layout",Ci="_grid",xi="_largeicons",ji="_dialog",Ni="_img_dialog",Ei="_extn_dialog",Pi="_content",Mi="_breadcrumbbar",Ri="_upload",ki="e-filemanager",Li="e-control",Ti="e-fe-popup",Ai="e-fe-popup e-fe-mobile",Fi="e-fe-m-filter",Ui="e-large-icons",Vi="e-list-item",_i="e-list-text",Hi="e-icons e-fe-tick",Bi="e-icons e-fe-dot",zi="e-blur",qi="e-active",Wi="e-hover",Ki="e-focus",Yi="e-focused",Gi="e-check",Ji="e-checkbox-wrapper",Qi="e-row",Xi="e-empty",$i="e-empty-content",Zi="e-empty-inner-content",en="e-fe-clone",tn="e-fe-drop-folder",nn="e-fe-drop-file",an="e-fe-folder",sn="e-fe-image",rn="e-fe-music",on="e-fe-video",ln="e-large-icon",hn="e-empty-icon e-fe-folder",dn="e-gridheader",cn="e-treeview",pn="e-menu-icon",un="e-content",fn="e-gridcontent",gn="e-icons e-fe-cut",mn="e-icons e-fe-grid",bn="e-icons e-fe-large",vn="e-fe-errorcontent",yn="e-rtl",In="e-display-none",On="e-fe-value",wn="isFile",Dn="model-changed",Sn="initial-end",Cn="finalize-end",xn="create-end",jn="path-drag",Nn="delete-init",En="delete-end",Pn="refresh-end",Mn="resize-end",Rn="path-changed",kn="destroy",Ln="before-request",Tn="skip-upload",An="after-request",Fn="actionFailure",Un="search",Vn="open-init",_n="open-end",Hn="selection-changed",Bn="clear-path-init",zn="layout-change",qn="sort-by-change",Wn="details-init",Kn="menu-item-data",Yn="rename-init",Gn="rename-end-parent",Jn="rename-end",Qn="show-paste",Xn="hide-paste",$n="cut-copy-init",Zn="paste-init",ea="paste-end",ta="cut-end",ia="sort-column",na="path-column",aa="search-change",sa="drop-init",ra="drag-end",oa="drop-path",la="dragging",ha="method-call",da="read",ca="write",pa="writeContents",ua="upload",fa="download",ga=function(){function e(e){this.isInteraction=!0,this.uploadOperation=!1,this.count=0,this.isRendered=!0,this.tapCount=0,this.isSelectAllCalled=!1,this.isPasteOperation=!1,this.isInteracted=!0,this.imageEventArgsMap=new Map,this.imageUrlCache=new Map,this.parent=e,this.element=t.select("#"+this.parent.element.id+xi,this.parent.element),t.addClass([this.element],Ui),this.addEventListener(),this.keyConfigs={end:"end",home:"home",tab:"tab",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",ctrlEnd:"ctrl+end",ctrlHome:"ctrl+home",ctrlDown:"ctrl+downarrow",ctrlLeft:"ctrl+leftarrow",ctrlRight:"ctrl+rightarrow",ctrlUp:"ctrl+uparrow",shiftEnd:"shift+end",shiftHome:"shift+home",shiftDown:"shift+downarrow",shiftLeft:"shift+leftarrow",shiftRight:"shift+rightarrow",shiftUp:"shift+uparrow",csEnd:"ctrl+shift+end",csHome:"ctrl+shift+home",csDown:"ctrl+shift+downarrow",csLeft:"ctrl+shift+leftarrow",csRight:"ctrl+shift+rightarrow",csUp:"ctrl+shift+uparrow",space:"space",ctrlSpace:"ctrl+space",shiftSpace:"shift+space",csSpace:"ctrl+shift+space",ctrlA:"ctrl+a",enter:"enter",altEnter:"alt+enter",esc:"escape",del:"delete",ctrlX:this.parent.isMac?"cmd+x":"ctrl+x",ctrlC:this.parent.isMac?"cmd+c":"ctrl+c",ctrlV:this.parent.isMac?"cmd+v":"ctrl+v",f2:"f2",shiftdel:"shift+delete",back:"backspace",ctrlD:"ctrl+d"}}return e.prototype.render=function(e){if(this.parent.visitedItem=null,this.startItem=null,n.showSpinner(this.parent.element),"LargeIcons"===this.parent.view){this.resetMultiSelect(),this.element.setAttribute("tabindex","0"),this.listObj&&(this.unWireEvents(),this.removeEventListener()),this.parent.notify("hide-layout",{});var i=t.select("#"+this.parent.element.id+xi,this.parent.element),s=t.select("ul",i);if(s&&t.remove(s),this.listObj={ariaAttributes:{itemRole:"option",listRole:"listbox",itemText:"",groupItemRole:"group",wrapperRole:""},showIcon:!0,fields:{text:"name",iconCss:"_fm_icon",imageUrl:"_fm_imageUrl",imageAttributes:"_fm_imageAttr",htmlAttributes:"_fm_htmlAttr"},sortOrder:this.parent.sortOrder,itemCreated:this.onItemCreated.bind(this),enableHtmlSanitizer:this.parent.enableHtmlSanitizer},this.items=[],this.items=this.renderList(e),this.parent.sortComparer&&"None"!==this.parent.sortBy?this.items=this.allItems=a.DataUtil.sort(this.items,this.parent.sortBy,this.comparer.bind(this)):this.items=this.allItems=A(this.parent,this.items),i.classList.remove(In),this.parent.enableVirtualization&&this.allItems.length>0&&!t.isNullOrUndefined(this.parent.virtualizationModule)&&this.parent.virtualizationModule.setUIVirtualization(),this.listElements=l.ListBase.createListFromJson(t.createElement,this.items,this.listObj),this.itemList=Array.prototype.slice.call(t.selectAll("."+Vi,this.listElements)),this.element.appendChild(this.listElements),this.imageEventArgsMap.size>0&&this.loadImages(),this.listElements.setAttribute("aria-label","listbox"),this.preventImgDrag(),this.createDragObj(),0===this.itemList.length){var r=this.element.querySelector(".e-list-parent");this.element.removeChild(r),U(this.parent,this.element,e)}else 0!==this.itemList.length&&this.element.querySelector("."+Xi)&&this.element.removeChild(this.element.querySelector("."+Xi));!0===this.isPasteOperation&&(this.selectItems(this.parent.pasteNodes),this.isPasteOperation=!1),!0===this.uploadOperation&&(this.selectItems(this.parent.uploadItem),this.parent.setProperties({selectedItems:[]},!0),++this.count===this.parent.uploadItem.length&&(this.uploadOperation=!1,this.parent.uploadItem=[]));var o=this.element.querySelectorAll("."+qi);0!==o.length&&(this.parent.activeModule="largeiconsview");for(var h=0;h<o.length;h++)o[h].setAttribute("aria-selected","true");this.element.style.maxHeight="100%",this.getItemCount(),this.addEventListener(),this.wireEvents(),this.parent.enableVirtualization&&this.allItems.length>0&&!t.isNullOrUndefined(this.parent.virtualizationModule)&&(this.parent.virtualizationModule.setUlElementHeight(),this.parent.virtualizationModule.wireScrollEvent(!1)),this.isRendered=!0,n.hideSpinner(this.parent.element),this.parent.selectedItems.length&&this.checkItem()}},e.prototype.loadImages=function(){var e=this;this.parent.element.querySelectorAll(".e-list-img").forEach(function(i){var n=i.getAttribute("data-image-key");if(n){if(e.imageUrlCache.has(n))return i.setAttribute("src",e.imageUrlCache.get(n)),void i.classList.remove("image-blur");var a=e.imageEventArgsMap.get(n);a&&new t.Fetch({url:t.getValue("url",a.ajaxSettings),type:t.getValue("type",a.ajaxSettings),contentType:t.getValue("contentType",a.ajaxSettings),responseType:t.getValue("responseType",a.ajaxSettings),beforeSend:t.getValue("beforeSend",a.ajaxSettings),onSuccess:function(t){var s=URL.createObjectURL(t);e.imageUrlCache.set(n,s),i.setAttribute("src",s),i.classList.remove("image-blur"),ft(e.parent,a.ajaxSettings)},onFailure:function(i){var n={files:null,error:{code:i.status?i.status.toString():"404",message:B(e.parent,"Network-Error")+" "+t.getValue("url",a.ajaxSettings),fileExists:null}};gt(e.parent,a.ajaxSettings,n)}}).send(t.getValue("data",a.ajaxSettings))}})},e.prototype.comparer=function(e,t){if("Descending"===this.parent.sortOrder){var i=e;e=t,t=i}return this.parent.sortComparer(e,t)},e.prototype.preventImgDrag=function(){for(var e=0;e<this.itemList.length;)this.itemList[e].querySelector("img")&&(this.itemList[e].ondragstart=function(){return!1}),e++},e.prototype.createDragObj=function(){var e=this;this.listObj&&(this.parent.allowDragAndDrop?(this.dragObj&&this.dragObj.destroy(),this.dragObj=new t.Draggable(this.listElements,{enableTailMode:!0,distance:5,enableAutoScroll:!1,dragTarget:"."+ln,helper:this.dragHelper.bind(this),cursorAt:this.parent.dragCursorPosition,dragArea:this.parent.element,dragStop:ne.bind(this,this.parent),drag:he.bind(this,this.parent),clone:!0,dragStart:function(t){ae(e.parent,t,e.dragObj)}})):this.dragObj&&!this.parent.allowDragAndDrop&&this.dragObj.destroy())},e.prototype.dragHelper=function(e){var i=e.sender.target,n=t.closest(i,".e-list-item");if(!n)return null;n&&!n.classList.contains("e-active")&&this.setFocus(n);var a=this.element.querySelectorAll("."+qi);this.parent.activeElements=[],this.parent.dragData=[];for(var s=0;s<a.length;s++)this.parent.dragData.push(this.getItemObject(a[parseInt(s.toString(),10)])),this.parent.activeElements.push(a[s]);return w(this.parent,n),this.parent.dragPath=this.parent.path,ie(this.parent),this.parent.virtualDragElement},e.prototype.onDropInit=function(e){if(this.parent.targetModule===this.getModuleName()){var i=t.closest(e.target,".e-list-item"),n=t.getValue(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent);if(i){var a=this.getItemObject(i);this.parent.dropPath=a.isFile?this.parent.path:L(this.parent,a,this.parent.path),this.parent.dropData=a.isFile?n:a}else this.parent.dropPath=this.parent.path,this.parent.dropData=n}},e.prototype.getModuleName=function(){return"largeiconsview"},e.prototype.onItemCreated=function(e){if(e.item.removeAttribute("aria-level"),!this.parent.showFileExtension&&t.getValue("isFile",e.curData)){var i=e.item.querySelector("."+_i),n=t.getValue("name",e.curData),a=t.getValue("type",e.curData);-1!==n.indexOf(a)&&(i.innerHTML=n.substr(0,n.length-a.length))}this.renderCheckbox(e);var s={element:e.item,fileDetails:e.curData,module:"LargeIconsView"};this.parent.trigger("fileLoad",s)},e.prototype.renderCheckbox=function(e){if(this.parent.showItemCheckBoxes){var i=o.createCheckBox(t.createElement,!1,{checked:!1,cssClass:"e-small"});i.setAttribute("role","checkbox"),i.setAttribute("aria-checked","false"),i.setAttribute("aria-label","checkbox"),e.item.firstElementChild.insertBefore(i,e.item.firstElementChild.childNodes[0])}},e.prototype.onLayoutChange=function(e){if("LargeIcons"===this.parent.view){if(this.destroy(),this.parent.enableVirtualization&&this.parent.setProperties({selectedItems:[]},!0),this.render(e),"layout-change"===t.getValue("name",e)&&"move"===this.parent.fileAction&&this.parent.isCut&&this.parent.selectedNodes&&0!==this.parent.selectedNodes.length)for(var i=this.getIndexes(this.parent.selectedNodes),n=0;n<i.length;)I(this.itemList[i[n]]),n++;0!==this.element.querySelectorAll("."+qi).length&&this.element.focus(),this.checkItem(),this.parent.isLayoutChange=!1}else this.element.setAttribute("tabindex","-1")},e.prototype.checkItem=function(){var e=this.element.querySelectorAll("."+qi);if(e)for(var t=0;t<e.length;)this.checkState(e[t],!0),t++},e.prototype.renderList=function(e){for(var i=0,n=JSON.parse(JSON.stringify(e.files));i<n.length;){var a=R(n[i]),s=t.getValue("name",n[i]),r=ce(this.parent,n[i]),o=this.parent.selectedItems&&-1!==this.parent.selectedItems.indexOf(r)?ln+" e-active":ln;if(Ie(n[i])||(o+=" "+ve(n[i])),a===sn&&this.parent.showThumbnail&&ye(n[i])){var l=k(this.parent,n[i]);if(l.useImageAsUrl)t.setValue("_fm_imageUrl",l.imageUrl,n[i]),t.setValue("_fm_imageAttr",{alt:s},n[i]);else{var h="img_"+s+"_"+i;this.imageEventArgsMap.set(h,l),t.setValue("_fm_imageUrl","",n[i]),t.setValue("_fm_imageAttr",{alt:s,class:"e-list-img image-blur","data-image-key":h},n[i])}}else t.setValue("_fm_icon",a,n[i]);t.setValue("_fm_htmlAttr",{class:o,title:s},n[i]),i++}return n},e.prototype.onFinalizeEnd=function(e){this.render(e)},e.prototype.onCreateEnd=function(e){"LargeIcons"===this.parent.view&&(this.onLayoutChange(e),this.clearSelect(),this.selectItems([t.getValue(this.parent.hasId?"id":"name",this.parent.createdItem)]),this.parent.createdItem=null,this.parent.largeiconsviewModule.element.focus(),this.parent.activeModule="largeiconsview")},e.prototype.onSelectedData=function(){"largeiconsview"===this.parent.activeModule&&this.updateSelectedData()},e.prototype.onDeleteInit=function(){"largeiconsview"===this.parent.activeModule&&Le(this.parent,this.parent.selectedItems,this.parent.path,"delete")},e.prototype.onDeleteEnd=function(e){"LargeIcons"===this.parent.view&&(this.onLayoutChange(e),this.parent.setProperties({selectedItems:[]},!0),this.clearSelect())},e.prototype.onRefreshEnd=function(e){"LargeIcons"===this.parent.view&&this.onLayoutChange(e)},e.prototype.onRenameInit=function(){"largeiconsview"===this.parent.activeModule&&1===this.parent.selectedItems.length&&this.updateRenameData()},e.prototype.onPathChanged=function(e){this.parent.isCut=!1,""===this.parent.breadcrumbbarModule.searchObj.element.value&&(this.parent.searchedItems=[]),"LargeIcons"===this.parent.view&&(O(this.parent),this.parent.setProperties({selectedItems:[]},!0),this.onLayoutChange(e),this.parent.renamedItem&&"largeiconsview"===this.parent.activeModule&&(this.clearSelect(),this.addSelection(this.parent.renamedItem)))},e.prototype.onOpenInit=function(e){"largeiconsview"===this.parent.activeModule&&this.doOpenAction(e.target)},e.prototype.onHideLayout=function(){"LargeIcons"!==this.parent.view&&this.element&&this.element.classList.add(In)},e.prototype.onSelectAllInit=function(){if("LargeIcons"===this.parent.view){this.startItem=this.getFirstItem();var e=this.getLastItem(),t={ctrlKey:!0,shiftKey:!0};this.doSelection(e,t),this.isInteraction=!0,this.isInteracted=!0}},e.prototype.onClearAllInit=function(){"LargeIcons"===this.parent.view&&(this.clearSelection(),this.isInteraction=!0,this.isInteracted=!0)},e.prototype.onBeforeRequest=function(){this.isRendered=!1},e.prototype.onAfterRequest=function(){this.isRendered=!0},e.prototype.onSearch=function(e){"LargeIcons"===this.parent.view&&(this.parent.setProperties({selectedItems:[]},!0),this.parent.notify(Hn,{}),this.parent.searchedItems=e.files,this.onLayoutChange(e))},e.prototype.onLayoutRefresh=function(){this.parent.view},e.prototype.onUpdateSelectionData=function(){"LargeIcons"===this.parent.view&&this.updateSelectedData()},e.prototype.onPathColumn=function(){"LargeIcons"!==this.parent.view||t.isNullOrUndefined(this.listObj)||""!==this.parent.breadcrumbbarModule.searchObj.element.value||this.parent.isFiltered||"filterPath"!==this.parent.sortBy||(this.parent.sortBy="name",this.parent.notify(qn,{}))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(na,this.onPathColumn),this.parent.off(Cn,this.onFinalizeEnd),this.parent.off(xn,this.onCreateEnd),this.parent.off("selected-data",this.onSelectedData),this.parent.off(Nn,this.onDeleteInit),this.parent.off(En,this.onDeleteEnd),this.parent.off(Pn,this.onRefreshEnd),this.parent.off(Rn,this.onPathChanged),this.parent.off(zn,this.onLayoutChange),this.parent.off(Un,this.onSearch),this.parent.off(Vn,this.onOpenInit),this.parent.off(_n,this.onPathChanged),this.parent.off(Dn,this.onPropertyChanged),this.parent.off(ha,this.onMethodCall),this.parent.off(Fn,this.onActionFailure),this.parent.off(Yn,this.onRenameInit),this.parent.off(Jn,this.onPathChanged),this.parent.off("hide-layout",this.onHideLayout),this.parent.off("select-all-init",this.onSelectAllInit),this.parent.off("clear-all-init",this.onClearAllInit),this.parent.off(Kn,this.onMenuItemData),this.parent.off(Ln,this.onBeforeRequest),this.parent.off(An,this.onAfterRequest),this.parent.off("splitter-resize",this.splitterResizeHandler),this.parent.off(Mn,this.resizeHandler),this.parent.off(Zn,this.onpasteInit),this.parent.off(ea,this.onpasteEnd),this.parent.off($n,this.oncutCopyInit),this.parent.off(sa,this.onDropInit),this.parent.off(Wn,this.onDetailsInit),this.parent.off("layout-refresh",this.onLayoutRefresh),this.parent.off(oa,this.onDropPath),this.parent.off("update-selection-data",this.onUpdateSelectionData),this.parent.off("filter-end",this.onPathChanged))},e.prototype.addEventListener=function(){this.parent.on(na,this.onPathColumn,this),this.parent.on(Cn,this.onFinalizeEnd,this),this.parent.on(xn,this.onCreateEnd,this),this.parent.on(Pn,this.onRefreshEnd,this),this.parent.on("selected-data",this.onSelectedData,this),this.parent.on(Rn,this.onPathChanged,this),this.parent.on(Nn,this.onDeleteInit,this),this.parent.on(Zn,this.onpasteInit,this),this.parent.on(En,this.onDeleteEnd,this),this.parent.on(zn,this.onLayoutChange,this),this.parent.on(Un,this.onSearch,this),this.parent.on(Vn,this.onOpenInit,this),this.parent.on(Yn,this.onRenameInit,this),this.parent.on(Jn,this.onPathChanged,this),this.parent.on(_n,this.onPathChanged,this),this.parent.on(Dn,this.onPropertyChanged,this),this.parent.on(ha,this.onMethodCall,this),this.parent.on(Fn,this.onActionFailure,this),this.parent.on("hide-layout",this.onHideLayout,this),this.parent.on("select-all-init",this.onSelectAllInit,this),this.parent.on("clear-all-init",this.onClearAllInit,this),this.parent.on(Kn,this.onMenuItemData,this),this.parent.on(Ln,this.onBeforeRequest,this),this.parent.on(An,this.onAfterRequest,this),this.parent.on(sa,this.onDropInit,this),this.parent.on(Wn,this.onDetailsInit,this),this.parent.on("splitter-resize",this.splitterResizeHandler,this),this.parent.on(Mn,this.resizeHandler,this),this.parent.on(ea,this.onpasteEnd,this),this.parent.on($n,this.oncutCopyInit,this),this.parent.on("layout-refresh",this.onLayoutRefresh,this),this.parent.on(oa,this.onDropPath,this),this.parent.on("update-selection-data",this.onUpdateSelectionData,this),this.parent.on("filter-end",this.onPathChanged,this)},e.prototype.onActionFailure=function(){this.isInteraction=!0,this.isInteracted=!0},e.prototype.onMenuItemData=function(e){if(this.parent.activeModule===this.getModuleName()){var i=t.closest(e.target,"li");this.parent.itemData=[this.getItemObject(i)]}},e.prototype.onDetailsInit=function(){this.parent.activeModule===this.getModuleName()&&(0!==this.parent.selectedItems.length?this.updateSelectedData():this.parent.itemData=[t.getValue(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent)])},e.prototype.onpasteInit=function(){this.parent.activeModule===this.getModuleName()&&(this.parent.itemData=""===this.parent.folderPath?[E(this.parent)]:[this.getItemObject(t.select(".e-active",this.element))])},e.prototype.oncutCopyInit=function(){if(this.parent.activeModule===this.getModuleName()){var e=this.element.querySelectorAll("."+qi);this.parent.activeRecords=[],this.parent.activeElements=[];for(var t=0;t<e.length;t++)this.parent.activeElements.push(e[t]),this.parent.activeRecords.push(this.getItemObject(e[t]))}},e.prototype.onpasteEnd=function(e){"LargeIcons"===this.parent.view&&(this.isPasteOperation=!0,(this.parent.path===this.parent.destinationPath||this.parent.path===$(this.parent,e)||this.parent.hasId)&&this.onPathChanged(e))},e.prototype.onDropPath=function(e){"LargeIcons"===this.parent.view&&(this.isPasteOperation=!0,this.onPathChanged(e))},e.prototype.onPropertyChanged=function(e){var i;if(e.module===this.getModuleName()||"common"===e.module)for(var n=0,a=Object.keys(e.newProp);n<a.length;n++)switch(a[n]){case"allowDragAndDrop":this.createDragObj();break;case"selectedItems":this.isInteraction=!1,this.isInteracted=!1,i=t.isNullOrUndefined(this.parent.selectedItems)?[]:this.parent.selectedItems.slice(0),i=this.parent.allowMultiSelection?i:i.slice(i.length-1),this.parent.setProperties({selectedItems:[]},!0),this.onClearAllInit(),i.length&&this.selectItems(i),this.parent.setProperties({selectedItems:this.parent.selectedItems},!0),this.isInteraction=!0,this.isInteracted=!0;break;case"showThumbnail":j(this.parent);break;case"showFileExtension":case"showHiddenItems":Ee(this.parent,Rn,this.parent.path);break;case"allowMultiSelection":case"showItemCheckBoxes":if("LargeIcons"!==this.parent.view)break;j(this.parent);break;case"view":C(this.parent,"LargeIcons")}},e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),this.listObj&&this.unWireEvents(),this.startItem=null,this.listElements=null)},e.prototype.wireEvents=function(){this.wireClickEvent(!0),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keyup"}),this.keyboardDownModule=new t.KeyboardEvents(this.element,{keyAction:this.keydownActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),t.EventHandler.add(this.element,"mouseover",this.onMouseOver,this)},e.prototype.unWireEvents=function(){this.wireClickEvent(!1),t.EventHandler.remove(this.element,"mouseover",this.onMouseOver),this.keyboardModule.destroy(),this.keyboardDownModule.destroy()},e.prototype.onMouseOver=function(e){var i=t.closest(e.target,".e-list-item");O(this.parent,"hover"),null!==i&&i.classList.add(Wi)},e.prototype.wireClickEvent=function(e){var i=this;e?this.clickObj=new t.Touch(this.element,{tap:function(e){i.parent.isDevice?(i.tapCount=e.tapCount,i.tapEvent=e,setTimeout(function(){i.tapCount>0&&i.doTapAction(i.tapEvent),i.tapCount=0},350)):2===e.tapCount&&3!==e.originalEvent.which?i.dblClickHandler(e):i.clickHandler(e)},tapHold:function(e){i.parent.isDevice&&(i.multiSelect=!!i.parent.allowMultiSelection,i.parent.allowMultiSelection&&t.addClass([i.parent.element],"e-fe-m-select"),i.clickHandler(e))}}):this.clickObj&&this.clickObj.destroy()},e.prototype.doTapAction=function(e){var i=e.originalEvent.target,n=t.closest(i,"."+Vi);this.multiSelect||i.classList.contains("e-list-parent")||t.isNullOrUndefined(n)?this.clickHandler(e):(this.parent.isFile=!1,this.updateType(n),this.parent.isFile?2===e.tapCount?(this.clickHandler(e),this.dblClickHandler(e)):this.clickHandler(e):this.dblClickHandler(e))},e.prototype.clickHandler=function(e){var t=e.originalEvent.target;O(this.parent,"hover"),this.doSelection(t,e.originalEvent),this.parent.activeModule="largeiconsview"},e.prototype.doSelection=function(e,i){var n=this.parent.isMac?i.metaKey:i.ctrlKey,a=this.parent.isMac&&i.ctrlKey&&i.shiftKey,s=t.closest(e,"."+Vi),r=e.classList;this.parent.isFile=!1;var o="select";if((3===i.which||a)&&!t.isNullOrUndefined(s)&&s.classList.contains(qi))return this.addActive(s),void this.updateType(s);if(t.isNullOrUndefined(s))this.parent.selectedItems.length===this.itemList.length&&(this.isSelectAllCalled=!0),this.clearSelection();else if(this.parent.allowMultiSelection&&s.classList.contains(qi)&&(n||e.classList.contains(Gi))&&(o="unselect"),n&&i.shiftKey&&!a&&(this.isSelectAllCalled=!0),!0!==this.triggerSelection(o,s).cancel){if(this.parent.allowMultiSelection&&(this.multiSelect||!i||n)||r.contains("e-frame")||(this.updateType(s),this.clearSelect()),this.parent.allowMultiSelection&&i.shiftKey&&!a){i&&n||this.clearSelect(),this.startItem||(this.startItem=s);var l=this.itemList.indexOf(this.startItem),h=this.itemList.indexOf(s);if(l>h)for(d=l;d>=h;d--)this.addActive(this.itemList[d]);else for(var d=l;d<=h;d++)this.addActive(this.itemList[d]);this.addFocus(this.itemList[h])}else this.startItem=s,this.parent.allowMultiSelection&&s.classList.contains(qi)?this.removeActive(s):this.addActive(s),this.addFocus(s);0===this.parent.selectedItems.length&&this.resetMultiSelect(),this.parent.notify(Hn,{}),this.triggerSelect(o,s)}t.isNullOrUndefined(s)||(this.isSelectAllCalled=!1,this.updateType(s))},e.prototype.dblClickHandler=function(e){this.parent.activeModule="largeiconsview";var t=e.originalEvent.target;this.doOpenAction(t)},e.prototype.clearSelection=function(){this.clearSelect(),this.resetMultiSelect(),this.parent.notify(Hn,{})},e.prototype.resetMultiSelect=function(){this.multiSelect=!1,t.removeClass([this.parent.element],"e-fe-m-select")},e.prototype.doOpenAction=function(e){var i=this;if(!t.isNullOrUndefined(e)){var n=t.closest(e,"."+Vi);if(this.parent.isFile=!1,!t.isNullOrUndefined(n)){this.updateType(n);var a=this.getItemObject(n);if(!ye(a))return void be(this.parent,a,da);var s={cancel:!1,fileDetails:a,module:"LargeIconsView"};this.parent.trigger("fileOpen",s,function(e){if(!e.cancel){var n=t.getValue("name",a);if(i.parent.isFile){if(R(a)===sn){var s=k(i.parent,a);Wt(i.parent,n,s)}}else{if(""!==i.parent.breadcrumbbarModule.searchObj.element.value||i.parent.isFiltered)Y(i.parent,a);else{var r=t.getValue("id",a);i.parent.oldPath=i.parent.path;var o=i.parent.path+(t.isNullOrUndefined(r)?n:r)+"/";i.parent.setProperties({path:o},!0),i.parent.pathNames.push(n),i.parent.pathId.push(t.getValue("_fm_id",a)),i.parent.itemData=[a],N(i.parent)}i.parent.isFiltered=!1,i.parent.setProperties({selectedItems:[]},!0)}}})}}},e.prototype.updateType=function(e){var i=t.select("."+an,e);this.parent.isFile=!!t.isNullOrUndefined(i)},e.prototype.keydownActionHandler=function(e){if(this.isRendered)switch(e.action){case"end":case"home":case"moveDown":case"moveLeft":case"moveRight":case"moveUp":case"ctrlEnd":case"shiftEnd":case"csEnd":case"ctrlHome":case"shiftHome":case"csHome":case"ctrlDown":case"shiftDown":case"csDown":case"ctrlLeft":case"shiftLeft":case"csLeft":case"ctrlRight":case"shiftRight":case"csRight":case"space":case"ctrlSpace":case"shiftSpace":case"csSpace":case"ctrlA":case"enter":case"altEnter":case"esc":case"del":case"shiftdel":case"ctrlC":case"ctrlV":case"ctrlX":case"f2":case"ctrlD":e.preventDefault()}},e.prototype.keyActionHandler=function(e){var i=this;if(this.isRendered){var n=this.getFocusedItem(),a=this.getFirstItem(),s=this.getLastItem();switch(e.action){case"end":this.parent.enableVirtualization?(this.clearSelect(),this.element.firstElementChild.scrollTo(0,this.element.firstElementChild.scrollHeight),setTimeout(function(){i.navigateItem(i.itemList[i.itemList.length-1])},10)):this.navigateItem(s);break;case"home":this.parent.enableVirtualization?(this.clearSelect(),this.element.firstElementChild.scrollTop=0,setTimeout(function(){i.navigateItem(i.itemList[0])},10)):this.navigateItem(a);break;case"tab":t.isNullOrUndefined(n)?t.isNullOrUndefined(a)||this.addFocus(a):this.addFocus(n);break;case"moveDown":this.navigateDown(n,!0);break;case"moveLeft":this.navigateRight(n,!1);break;case"moveRight":this.navigateRight(n,!0);break;case"moveUp":this.navigateDown(n,!1);break;case"ctrlEnd":case"shiftEnd":case"csEnd":this.csEndKey(s,e);break;case"ctrlHome":case"shiftHome":case"csHome":this.csHomeKey(a,e);break;case"ctrlDown":case"shiftDown":case"csDown":this.csDownKey(n,e);break;case"ctrlLeft":case"shiftLeft":case"csLeft":this.csLeftKey(n,e);break;case"ctrlRight":case"shiftRight":case"csRight":this.csRightKey(n,e);break;case"ctrlUp":case"shiftUp":case"csUp":this.csUpKey(n,e);break;case"space":this.spaceKey(n);break;case"ctrlSpace":case"shiftSpace":case"csSpace":t.isNullOrUndefined(n)||this.doSelection(n,e);break;case"ctrlA":this.ctrlAKey(a,s);break;case"enter":this.doOpenAction(this.parent.visitedItem?this.parent.visitedItem:this.getVisitedItem());break;case"altEnter":this.parent.notify(Wn,{}),Te(this.parent,this.parent.selectedItems,this.parent.path,"details");break;case"esc":v(this.parent);break;case"del":case"shiftdel":this.performDelete();break;case"ctrlC":P(this.parent);break;case"ctrlV":this.parent.folderPath="",G(this.parent);break;case"ctrlX":M(this.parent);break;case"f2":this.performRename();break;case"ctrlD":this.doDownload();break;case"back":this.parent.traverseBackward()}}},e.prototype.doDownload=function(){this.updateSelectedData(),fe(this.parent)},e.prototype.performDelete=function(){if(this.parent.selectedItems&&this.parent.selectedItems.length>0){this.updateSelectedData();for(var e=this.parent.itemData,t=0;t<e.length;t++)if(!Ie(e[t]))return void be(this.parent,e[t],ca);mt(this.parent,"Delete")}},e.prototype.performRename=function(){1===this.parent.selectedItems.length&&(this.updateRenameData(),ue(this.parent))},e.prototype.updateRenameData=function(){var e=t.select("."+Vi+"."+qi,this.element),i=this.getItemObject(e);pe(this.parent,i)},e.prototype.getVisitedItem=function(){var e=this.parent.selectedItems[this.parent.selectedItems.length-1],t=this.getIndexes([e],this.parent.hasId);return this.itemList[t[0]]},e.prototype.getFocusedItem=function(){return t.select("."+Vi+"."+Ki,this.element)},e.prototype.getActiveItem=function(){return t.select("."+Vi+"."+qi,this.element)},e.prototype.getFirstItem=function(){return this.itemList[0]},e.prototype.getLastItem=function(){return this.itemList[this.itemList.length-1]},e.prototype.navigateItem=function(e){this.setFocus(e)},e.prototype.navigateDown=function(e,t){var i=this.getNextItem(e,t,this.perRow);this.setFocus(i)},e.prototype.navigateRight=function(e,t){var i=this.getNextItem(e,t);this.setFocus(i)},e.prototype.getNextItem=function(e,i,n){if(t.isNullOrUndefined(e))return this.getFocusedItem()||this.getActiveItem()||this.getFirstItem();var a,s=this.itemList.indexOf(e);do{if(s=i?n?s+n:s+1:n?s-n:s-1,a=this.itemList[s],this.parent.enableVirtualization&&t.isNullOrUndefined(a)){var r=parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue("margin-top"),10)+parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue("margin-bottom"),10),o=this.itemList[0].getBoundingClientRect().height+r;this.element.firstElementChild.scrollTo(this.element.firstElementChild.scrollTop,this.element.firstElementChild.scrollTop+o)}if(t.isNullOrUndefined(a))return e}while(!t.isVisible(a));return a},e.prototype.setFocus=function(e){t.isNullOrUndefined(e)||!0!==this.triggerSelection("select",e).cancel&&(this.startItem=e,this.clearSelect(),this.addActive(e),this.addFocus(e),this.parent.notify(Hn,{}),this.triggerSelect("select",e))},e.prototype.spaceKey=function(e){t.isNullOrUndefined(e)||e.classList.contains(qi)||!0!==this.triggerSelection("select",e).cancel&&(this.addActive(e),this.parent.notify(Hn,{}),this.triggerSelect("select",e))},e.prototype.ctrlAKey=function(e,i){if(this.parent.allowMultiSelection&&!t.isNullOrUndefined(e)){this.startItem=e;var n={ctrlKey:!0,shiftKey:!0},a=this.element.querySelector(".e-list-parent"),s=a.scrollTop,r=this.getFocusedItem();this.doSelection(i,n),a.scrollTop=s,t.isNullOrUndefined(r)||this.addFocus(r)}},e.prototype.csEndKey=function(e,i){this.parent.allowMultiSelection?t.isNullOrUndefined(e)||("ctrlEnd"===i.action?this.addFocus(e):this.doSelection(e,i)):this.navigateItem(e)},e.prototype.csHomeKey=function(e,i){this.parent.allowMultiSelection?t.isNullOrUndefined(e)||("ctrlHome"===i.action?this.addFocus(e):this.doSelection(e,i)):this.navigateItem(e)},e.prototype.csDownKey=function(e,i){if(this.parent.allowMultiSelection){var n=this.getNextItem(e,!0,this.perRow);t.isNullOrUndefined(n)||("ctrlDown"===i.action?this.addFocus(n):this.doSelection(n,i))}else this.navigateDown(e,!0)},e.prototype.csLeftKey=function(e,i){if(this.parent.allowMultiSelection){var n=this.getNextItem(e,!1);t.isNullOrUndefined(n)||("ctrlLeft"===i.action?this.addFocus(n):this.doSelection(n,i))}else this.navigateRight(e,!1)},e.prototype.csRightKey=function(e,i){if(this.parent.allowMultiSelection){var n=this.getNextItem(e,!0);t.isNullOrUndefined(n)||("ctrlRight"===i.action?this.addFocus(n):this.doSelection(n,i))}else this.navigateRight(e,!0)},e.prototype.csUpKey=function(e,i){if(this.parent.allowMultiSelection){var n=this.getNextItem(e,!1,this.perRow);t.isNullOrUndefined(n)||("ctrlUp"===i.action?this.addFocus(n):this.doSelection(n,i))}else this.navigateDown(e,!1)},e.prototype.addActive=function(e){t.isNullOrUndefined(e)||(e.classList.contains(qi)||(this.parent.selectedItems.push(this.getDataName(e)),this.parent.setProperties({selectedItems:this.parent.selectedItems},!0),t.addClass([e],[qi]),e.setAttribute("aria-selected","true"),this.checkState(e,!0)),this.parent.visitedItem=e)},e.prototype.removeActive=function(e){if(!t.isNullOrUndefined(e)){t.removeClass([e],[qi]),this.parent.allowMultiSelection?e.setAttribute("aria-selected","false"):e.removeAttribute("aria-selected"),this.checkState(e,!1);var i=this.parent.selectedItems.indexOf(this.getDataName(e));i>-1&&(this.parent.selectedItems.splice(i,1),this.parent.setProperties({selectedItems:this.parent.selectedItems},!0)),this.parent.visitedItem=null}},e.prototype.getDataName=function(e){var t=this.getItemObject(e);return ce(this.parent,t)},e.prototype.addFocus=function(e){this.element.setAttribute("tabindex","-1");var i=this.getFocusedItem();i&&(i.removeAttribute("tabindex"),t.removeClass([i],[Ki])),t.addClass([e],[Ki]),e.setAttribute("tabindex","0"),e.focus()},e.prototype.checkState=function(e,i){if(this.parent.showItemCheckBoxes){var n=t.select(".e-frame",e);t.isNullOrUndefined(n)||(i?n.classList.contains(Gi)||(t.addClass([n],Gi),t.closest(n,"."+Ji).setAttribute("aria-checked","true")):n.classList.contains(Gi)&&(t.removeClass([n],Gi),t.closest(n,"."+Ji).setAttribute("aria-checked","false")))}},e.prototype.clearSelect=function(){var e=Array.prototype.slice.call(t.selectAll("."+qi,this.listElements));if(0!==e.length){if(!0!==this.triggerSelection("unselect",e[0]).cancel)for(var i=0,n=e.length;i<n;i++)this.removeActive(e[i]);this.triggerSelect("unselect",e[0])}},e.prototype.resizeHandler=function(){this.getItemCount()},e.prototype.splitterResizeHandler=function(){this.getItemCount()},e.prototype.getItemCount=function(){var e=1;if(this.itemList)for(var t=0,i=this.itemList.length-1;t<i&&this.itemList[t].getBoundingClientRect().top===this.itemList[t+1].getBoundingClientRect().top;t++)e++;this.perRow=e},e.prototype.triggerSelection=function(e,t){var i=[];if(this.isSelectAllCalled)for(var n=0,a=this.itemList.length;n<a;n++)i[n]=this.getItemObject(this.itemList[n]);else i[0]=this.getItemObject(t);var s={action:e,fileDetails:i.length>1?i:i[0],isInteracted:this.isInteraction,cancel:!1,target:this.isSelectAllCalled?null:t};return this.parent.trigger("fileSelection",s),this.isInteraction=!0,s},e.prototype.triggerSelect=function(e,t){var i=[];if(this.isSelectAllCalled){for(var n=0,a=this.itemList.length;n<a;n++)i[n]=this.getItemObject(this.itemList[n]);this.isSelectAllCalled=!1}else i[0]=this.getItemObject(t);this.parent.visitedData=i.length>1?i[i.length-1]:i[0];var s={action:e,fileDetails:i.length>1?i:i[0],isInteracted:this.isInteracted};this.parent.trigger("fileSelect",s),this.isInteracted=!0},e.prototype.selectItems=function(e){for(var t=this.getIndexes(e,this.parent.hasId),i=0,n=t.length;i<n;i++){var a={ctrlKey:!0,shiftKey:!1};this.doSelection(this.itemList[t[i]],a)}},e.prototype.getIndexes=function(e,i){for(var n=[],a=i?"id":"name",s=0,r=this.items.length;s<r;s++)-1!==e.indexOf(t.getValue(a,this.items[s]))&&n.push(s);return n},e.prototype.getItemObject=function(e){var t=this.itemList.indexOf(e);return this.items[t]},e.prototype.addSelection=function(e){var i=[];if(this.parent.hasId)i=new a.DataManager(this.items).executeLocal((new a.Query).where("id","equal",this.parent.renamedId,!1));else{var n=new a.DataManager(this.items).executeLocal((new a.Query).where("name","equal",t.getValue("name",e),!1));n.length>0&&(i=new a.DataManager(n).executeLocal((new a.Query).where("filterPath","equal",this.parent.filterPath,!1)))}if(i.length>0){var s=this.items.indexOf(i[0]),r={ctrlKey:!0,shiftKey:!1};this.doSelection(this.itemList[s],r)}},e.prototype.updateSelectedData=function(){for(var e=[],i=t.selectAll("."+Vi+"."+qi,this.element),n=0;n<i.length;n++)e[n]=this.getItemObject(i[n]);this.parent.itemData=e},e.prototype.onMethodCall=function(e){if("LargeIcons"===this.parent.view)switch(t.getValue("action",e)){case"deleteFiles":this.deleteFiles(t.getValue("ids",e));break;case"downloadFiles":this.downloadFiles(t.getValue("ids",e));break;case"openFile":this.openFile(t.getValue("id",e));break;case"renameFile":this.isInteraction=!1,this.isInteracted=!1,this.renameFile(t.getValue("id",e),t.getValue("newName",e));break;case"createFolder":this.isInteraction=!1,this.isInteracted=!1;break;case"clearSelection":this.isInteraction=!1,this.isInteracted=!1,this.onClearAllInit();break;case"selectAll":this.isInteraction=!1,this.isInteracted=!1,this.onSelectAllInit()}},e.prototype.getItemsIndex=function(e){var i=[],n=!(""===this.parent.breadcrumbbarModule.searchObj.element.value&&!this.parent.isFiltered),a=this.parent.hasId?"id":"name";if(this.parent.hasId||!n)for(var s=0,r=this.items.length;s<r;s++)-1!==e.indexOf(t.getValue(a,this.items[s]))&&i.push(s);else for(var s=0,r=this.items.length;s<r;s++){var o=t.getValue("filterPath",this.items[s])+t.getValue("name",this.items[s]);-1===e.indexOf(o)&&-1===e.indexOf(t.getValue(a,this.items[s]))||i.push(s)}return i},e.prototype.deleteFiles=function(e){if(this.parent.activeModule="largeiconsview",t.isNullOrUndefined(e))return void this.performDelete();var i=this.getItemsIndex(e);if(0!==i.length){for(var n=[],a=[],s=0;s<i.length;s++)n[s]=this.items[i[s]],a[s]=ce(this.parent,n[s]);ge(this.parent,n,a)}},e.prototype.downloadFiles=function(e){if(t.isNullOrUndefined(e))return void this.doDownload();var i=this.getItemsIndex(e);if(0!==i.length){for(var n=[],a=[],s=0;s<i.length;s++)n[s]=this.items[i[s]],a[s]=ce(this.parent,n[s]);me(this.parent,n,a)}},e.prototype.openFile=function(e){if(!t.isNullOrUndefined(e)){var i=this.getItemsIndex([e]);i.length>0&&this.doOpenAction(this.itemList[i[0]])}},e.prototype.renameFile=function(e,i){if(this.parent.activeModule="largeiconsview",t.isNullOrUndefined(e))return void this.performRename();var n=this.getItemsIndex([e]);n.length>0&&(pe(this.parent,this.items[n[0]]),t.isNullOrUndefined(i)?ue(this.parent):Ie(this.parent.itemData[0])?Re(this.parent,this.parent.path,i):be(this.parent,this.parent.itemData[0],ca))},e}(),ma=function(){function e(e){this.addressPath="",this.addressBarLink="",this.searchTimer=null,this.searchWrapWidth=null,this.parent=e,this.keyConfigs={enter:"enter"},this.render()}return e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()||"common"===e.module)for(var i=0,n=Object.keys(e.newProp);i<n.length;i++){var a=n[i],s=e.newProp.searchSettings;switch(a){case"searchSettings":t.isNullOrUndefined(s.allowSearchOnTyping)||this.searchEventBind(s.allowSearchOnTyping),!this.parent.breadcrumbbarModule.searchObj.value||""===this.parent.breadcrumbbarModule.searchObj.value||!t.isNullOrUndefined(s.allowSearchOnTyping)&&t.isNullOrUndefined(s.filterType)&&t.isNullOrUndefined(s.ignoreCase)||S(this.parent,this.parent.breadcrumbbarModule.searchObj.value,!1)}}},e.prototype.render=function(){this.addEventListener()},e.prototype.onPathChange=function(){var e=this.parent.pathNames,i=this.parent.path.split("/"),n=this.parent.createElement("ul",{className:"e-addressbar-ul"}),a=null,s=e.length;if(e.length>0){for(var r="",o=0;o<s;o++){var l=null;a=this.parent.createElement("li",{className:"e-address-list-item"});for(var h=0;h<=o;h++)r=r+i[h]+"/";if(a.setAttribute("data-utext",r),0!==o){var d=t.createElement("span",{className:"e-icons"});a.appendChild(d)}s-o!=1?(l=t.createElement("a",{className:_i}),a.setAttribute("tabindex","0")):l=t.createElement("span",{className:_i}),r="",l.innerText=e[o],a.appendChild(l),n.appendChild(a)}var c=this.parent.breadCrumbBarNavigation.querySelector(".e-addressbar-ul");t.isNullOrUndefined(c)||(t.isNullOrUndefined(this.subMenuObj)||this.subMenuObj.destroy(),t.remove(c));var p=this.parent.breadCrumbBarNavigation.querySelector(".e-search-wrap");p?this.parent.breadCrumbBarNavigation.appendChild(n):this.parent.breadCrumbBarNavigation.insertBefore(n,p),this.updateBreadCrumbBar(n)}},e.prototype.updateBreadCrumbBar=function(e){for(var i=e.querySelectorAll("li"),n=this.parent.breadCrumbBarNavigation.querySelector(".e-addressbar-ul"),a=window.getComputedStyle(n,null),s=parseFloat(a.getPropertyValue("padding-right")),o=parseFloat(a.getPropertyValue("padding-left")),l=n.offsetWidth-s-o,d=this.parent.createElement("ul",{className:"e-addressbar-ul"}),c=0,p=[],u=0;u<i.length;u++){var f=i[u].clientWidth;p.push(f),c+=f}t.isNullOrUndefined(n)||t.remove(n);var g=this.parent.createElement("div");g.setAttribute("class","e-search-wrap");var m=this.parent.element.id+"_search",b=t.createElement("input",{id:m,attrs:{autocomplete:"off","aria-label":B(this.parent,"Search")}});g.appendChild(b);var v=this.parent.breadCrumbBarNavigation.querySelector(".e-search-wrap .e-input");if(t.isNullOrUndefined(v)){this.parent.breadCrumbBarNavigation.appendChild(g);var y=t.createElement("span",{className:"e-icons e-fe-search"});t.EventHandler.add(y,"click",this.onShowInput,this),b.parentElement.insertBefore(y,b),this.searchObj=new r.TextBox({value:"",showClearButton:!0,placeholder:B(this.parent,"Search"),focus:this.onFocus.bind(this),blur:this.onBlur.bind(this)}),this.searchObj.appendTo("#"+this.parent.element.id+"_search"),this.searchEventBind(this.parent.searchSettings.allowSearchOnTyping);var I=this.searchObj.element.nextElementSibling;t.EventHandler.add(I,"mousedown",this.searchChangeHandler.bind(this),this),t.EventHandler.add(this.searchObj.element,"keyup",this.onKeyUp.bind(this),this)}var O=this.parent.breadCrumbBarNavigation.querySelector(".e-search-wrap");if(l-=this.searchWrapWidth?this.searchWrapWidth:O.offsetWidth,c>l){for(u=i.length;u--;){var w=l-p[u];if(!(w>40)){for(var D=[],S=0;S<=u;S++){var C=i[S];D.push({text:C.innerText,utext:C.getAttribute("data-utext")})}var x=this.parent.createElement("li",{className:"e-breadcrumb-menu"}),j={className:"e-breadcrumb-submenu"},N=this.parent.createElement("button",j);x.appendChild(N),d.insertBefore(x,d.querySelector("li")),this.subMenuObj=new h.DropDownButton({items:D,cssClass:"e-caret-hide e-submenu",iconCss:"e-icons e-fe-breadcrumb",iconPosition:"Top",enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeItemRender:this.addSubMenuAttributes.bind(this),select:this.subMenuSelectOperations.bind(this)}),this.subMenuObj.isStringTemplate=!0,this.subMenuObj.appendTo(N);break}d.insertBefore(i[u],d.querySelector("li")),l=w}this.parent.breadCrumbBarNavigation.insertBefore(d,O)}else this.parent.breadCrumbBarNavigation.insertBefore(e,O)},e.prototype.onFocus=function(){t.closest(this.searchObj.element,".e-search-wrap").classList.add("e-focus")},e.prototype.onKeyUp=function(){this.parent.notify(na,{args:this.parent})},e.prototype.onBlur=function(){t.closest(this.searchObj.element,".e-search-wrap").classList.remove("e-focus")},e.prototype.subMenuSelectOperations=function(e){var t={target:e.element};this.addressPathClickHandler(t)},e.prototype.addSubMenuAttributes=function(e){e.element.setAttribute("data-utext",t.getValue("utext",e.item));var i=this.parent.createElement("a",{className:"e-list-text"});e.element.appendChild(i)},e.prototype.searchEventBind=function(e){e?(this.searchObj.input=this.searchChangeHandler.bind(this),this.searchObj.change=null):(this.searchObj.change=this.searchChangeHandler.bind(this),this.searchObj.input=null)},e.prototype.searchChangeHandler=function(e){var i=this;t.isNullOrUndefined(e.value)||(this.parent.isFiltered=!1,this.parent.searchSettings.allowSearchOnTyping?(window.clearTimeout(this.searchTimer),this.searchTimer=window.setTimeout(function(){S(i.parent,e.value,!1)},300)):S(this.parent,e.value,!1))},e.prototype.addressPathClickHandler=function(e){var i=e.target;if("LI"===i.nodeName||"A"===i.nodeName){var n="LI"===i.nodeName?i.children[0]:i;if(!t.isNullOrUndefined(n)){this.parent.isFiltered=!1;var a=this.updatePath(n);this.parent.itemData=[t.getValue(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent)],this.triggerFileOpen(this.parent.itemData[0]),Ee(this.parent,Rn,a);var s=this.parent.pathId[this.parent.pathId.length-1];this.parent.notify("update-tree-selection",{module:"treeview",selectedNode:s})}}},e.prototype.triggerFileOpen=function(e){var t={cancel:!1,fileDetails:e,module:"BreadCrumbBar"};delete t.cancel,this.parent.trigger("fileOpen",t)},e.prototype.onShowInput=function(){if(this.parent.isMobile)if(this.parent.element.classList.contains(Fi))t.removeClass([this.parent.element],Fi),this.searchWrapWidth=null;else{var e=this.parent.breadCrumbBarNavigation.querySelector(".e-search-wrap");this.searchWrapWidth=e.offsetWidth,t.addClass([this.parent.element],Fi),this.searchObj.element.focus()}},e.prototype.updatePath=function(e){var i=t.closest(e,"li").getAttribute("data-utext");this.addressBarLink=i;var n=this.addressBarLink.split("/"),a=this.parent.pathId,s=this.parent.pathNames;this.parent.pathId=[],this.parent.pathNames=[];for(var r="",o=0,l=n.length-1;o<l;o++)this.parent.pathId.push(a[o]),this.parent.pathNames.push(s[o]),r+=n[o]+"/";return this.parent.setProperties({path:r},!0),r},e.prototype.onUpdatePath=function(){this.onPathChange(),this.removeSearchValue()},e.prototype.onCreateEnd=function(){this.onPathChange()},e.prototype.onRenameEnd=function(){this.onPathChange()},e.prototype.onDeleteEnd=function(){this.onUpdatePath()},e.prototype.removeSearchValue=function(){this.parent.isFiltered=!1,!this.searchObj||""===this.searchObj.value&&""===this.searchObj.element.value||(this.searchObj.value="",this.searchObj.element.value="",this.searchObj.dataBind())},e.prototype.onResize=function(){this.onPathChange()},e.prototype.onPasteEnd=function(){this.onPathChange()},e.prototype.addEventListener=function(){this.keyboardModule=new t.KeyboardEvents(this.parent.breadCrumbBarNavigation,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.parent.on(Dn,this.onPropertyChanged,this),t.EventHandler.add(this.parent.breadCrumbBarNavigation,"click",this.addressPathClickHandler,this),this.parent.on(kn,this.destroy,this),this.parent.on(Rn,this.onUpdatePath,this),this.parent.on(Cn,this.onUpdatePath,this),this.parent.on(Pn,this.onUpdatePath,this),this.parent.on(_n,this.onUpdatePath,this),this.parent.on(xn,this.onCreateEnd,this),this.parent.on(Jn,this.onRenameEnd,this),this.parent.on(En,this.onDeleteEnd,this),this.parent.on("splitter-resize",this.onResize,this),this.parent.on(ea,this.onPasteEnd,this),this.parent.on(Mn,this.onResize,this),this.parent.on(aa,this.onSearchTextChange,this),this.parent.on(sa,this.onDropInit,this),this.parent.on("layout-refresh",this.onResize,this),this.parent.on(oa,this.onPathChange,this)},e.prototype.keyActionHandler=function(e){switch(e.action){case"enter":this.addressPathClickHandler(e)}},e.prototype.removeEventListener=function(){this.keyboardModule.destroy(),this.parent.off(Rn,this.onUpdatePath),this.parent.off(Cn,this.onUpdatePath),this.parent.off(Pn,this.onUpdatePath),this.parent.off(_n,this.onUpdatePath),this.parent.off(ea,this.onPasteEnd),this.parent.off(xn,this.onCreateEnd),this.parent.off(Jn,this.onRenameEnd),this.parent.off(En,this.onDeleteEnd),this.parent.off("splitter-resize",this.onResize),this.parent.off(Mn,this.onResize),this.parent.off(aa,this.onSearchTextChange),this.parent.off(sa,this.onDropInit),this.parent.off("layout-refresh",this.onResize),this.parent.off(oa,this.onPathChange)},e.prototype.onDropInit=function(e){if(this.parent.targetModule===this.getModuleName()){var i=e.target.closest("li");this.parent.dropPath=this.updatePath(i.children[0]),this.parent.dropData=t.getValue(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent),this.triggerFileOpen(this.parent.dropData);var n=this.parent.pathId[this.parent.pathId.length-1];this.parent.notify("update-tree-selection",{module:"treeview",selectedNode:n})}},e.prototype.getModuleName=function(){return"breadcrumbbar"},e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),t.isNullOrUndefined(this.subMenuObj)||this.subMenuObj.destroy(),t.isNullOrUndefined(this.searchObj)||this.searchObj.destroy())},e.prototype.onSearchTextChange=function(e){this.searchObj.element.placeholder=null!=this.parent.searchSettings.placeholder?this.parent.searchSettings.placeholder:B(this.parent,"Search")+" "+B(this.parent,e.cwd.name.toString())},e}(),ba=function(){function e(e){this.isMenuItemClicked=!1,this.currentItems=[],this.currentElement=null,this.disabledItems=[],this.parent=e,this.render()}return e.prototype.render=function(){this.keyConfigs={downarrow:"downarrow",uparrow:"uparrown"},this.contextMenu=new d.ContextMenu({enableRtl:this.parent.enableRtl,locale:this.parent.locale,target:"#"+this.parent.element.id,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeItemRender:this.onBeforeItemRender.bind(this),select:this.onSelect.bind(this),beforeOpen:this.onBeforeOpen.bind(this),beforeClose:this.onBeforeClose.bind(this),cssClass:z(this.parent,Ti)}),this.contextMenu.isStringTemplate=!0,this.contextMenu.appendTo("#"+this.parent.element.id+"_contextmenu"),this.addEventListener()},e.prototype.onBeforeItemRender=function(e){if(e.item.id===this.getMenuId("largeiconsview")){i=t.createElement("span");(n=e.element).insertBefore(i,"LargeIcons"===this.parent.view?n.childNodes[1]:n.childNodes[0]),i.setAttribute("class",bn+" "+pn)}if(e.item.id===this.getMenuId("detailsview")){var i=t.createElement("span"),n=e.element;n.insertBefore(i,"Details"===this.parent.view?n.childNodes[1]:n.childNodes[0]),i.setAttribute("class",mn+" "+pn)}},e.prototype.onBeforeClose=function(e){var i={cancel:!1,element:e.element,event:e.event,isFocused:e.isFocused,fileDetails:[this.menuItemData],items:e.items,parentItem:e.parentItem,menuType:this.menuType};if(this.parent.trigger("menuClose",i,function(t){if(t.cancel)return void(e.cancel=t.cancel)}),this.menuTarget=null,!this.isMenuItemClicked&&this.parent.pathId.length>1&&"navigationpane"===this.parent.activeModule){this.parent.pathId.pop();for(var n=[],a=0,s=Object.keys(this.parent.feParent);a<s.length;a++){var r=s[a],o=t.getValue(r,this.parent.feParent);-1!==this.parent.pathNames.indexOf(o.name)&&n.push(o._fm_id)}this.parent.pathId.push(n[n.length-1]),this.parent.navigationpaneModule.treeObj.setProperties({selectedNodes:[this.parent.pathId[this.parent.pathId.length-1]]})}this.isMenuItemClicked=!1},e.prototype.onBeforeOpen=function(e){var i,n,a=this,s=!1,r=!1,o=e.event.target;this.menuTarget=this.targetNodeElement=o,this.currentElement=e.element,o.classList.contains("e-spinner-pane")&&(o=this.parent.navigationpaneModule.activeNode.getElementsByClassName("e-fullrow")[0],this.menuTarget=this.targetNodeElement=o),this.targetElement="Details"===this.parent.view?t.closest(o,"tr.e-row"):o,this.parent.enableVirtualization&&(o.classList.contains("e-virtual-bottom")||o.classList.contains("e-virtualtable"))&&(o=o.parentElement.closest("div"));var l=this.getTargetView(o);if(this.updateActiveModule(),o.classList.contains(cn)||t.closest(o,"th")||t.closest(o,"#"+this.parent.element.id+Mi)||t.closest(o,"#"+this.parent.element.id+"_toolbar"))e.cancel=!0;else if("LargeIcons"!==this.parent.view&&this.targetElement&&this.targetElement.classList.contains("e-emptyrow"))this.setLayoutItem(o);else if(t.closest(o,"."+Xi))this.setLayoutItem(o);else if(!o.classList.contains("e-menu-item")&&!o.classList.contains(pn)&&!o.classList.contains("e-caret")){if("LargeIcons"!==this.parent.view||t.isNullOrUndefined(t.closest(o,"li"))||t.closest(o,"#"+this.parent.element.id+"_tree"))t.isNullOrUndefined(t.closest(o,"tr.e-row"))?t.closest(o,"#"+this.parent.element.id+"_tree")&&(i=t.closest(o,"li").getAttribute("data-uid"),t.isNullOrUndefined(i)||(this.navUid=i),r=!0):(i=this.targetElement.getAttribute("data-uid"),n=this.parent.detailsviewModule.gridObj.getRowObjectFromUID(i).data,t.isNullOrUndefined(this.targetElement.getAttribute("aria-selected"))&&this.parent.detailsviewModule.gridObj.selectRows([parseInt(this.targetElement.getAttribute("aria-rowindex"),10)-1]),s=!0);else{var h={ctrlKey:!0,shiftKey:!0};t.closest(o,"li").classList.contains("e-active")||this.parent.largeiconsviewModule.doSelection(o,h),n=this.parent.visitedData,s=!0}if(s)!0===t.getValue("isFile",n)?this.setFileItem():this.setFolderItem(!1);else if(r)if(this.setFolderItem(!0),i===this.parent.pathId[0])this.disabledItems.push("Delete","Rename","Cut","Copy");else for(var d=["Delete","Rename","Cut","Copy"],c=0;c<this.disabledItems.length;c++){var p=this.disabledItems[c];-1!==d.indexOf(p)&&(this.disabledItems.splice(c,1),c--)}else"TreeView"===l||"GridView"===l||"LargeIcon"===l?this.setLayoutItem(o):e.cancel=!0}var u=t.select("#"+this.getMenuId("Paste"),this.contextMenu.element);if(e.cancel||this.parent.enablePaste||!u||u.classList.contains("e-disabled")){var f=this.disabledItems.indexOf("Paste");-1!==f&&this.disabledItems.splice(f,1)}else-1===this.disabledItems.indexOf("Paste")&&this.disabledItems.push("Paste");if(e.cancel)return void(this.menuTarget=this.currentElement=null);this.contextMenu.dataBind();var g=!1;(o.classList.contains("e-menu-item")||o.classList.contains(pn)||o.classList.contains("e-caret"))&&(g=!0),this.menuItemData=g?this.menuItemData:this.getMenuItemData();var m={fileDetails:[this.menuItemData],element:e.element,target:o,items:g?e.items:this.contextMenu.items,menuModule:this.contextMenu,cancel:!1,menuType:this.menuType,isSubMenu:g};this.currentItems=m.items,this.parent.trigger("menuOpen",m,function(t){g||(a.contextMenu.dataBind(),a.contextMenu.items=t.items,a.contextMenu.dataBind()),a.enableItems(a.disabledItems,!1,!0),e.cancel=t.cancel,t.cancel&&(a.menuTarget=a.targetNodeElement=a.currentElement=null)})},e.prototype.updateActiveModule=function(){this.parent.activeModule=t.closest(this.menuTarget,"#"+this.parent.element.id+"_tree")?"navigationpane":t.closest(this.menuTarget,"#"+this.parent.element.id+Ci)?"detailsview":t.closest(this.menuTarget,"#"+this.parent.element.id+xi)?"largeiconsview":this.parent.activeModule},e.prototype.getTargetView=function(e){return e.classList.contains(cn)?"TreeView":e.classList.contains(un)?"GridView":e.classList.contains("e-list-parent")?"LargeIcon":e.classList.contains(Ui)?"LargeIcon":""},e.prototype.getItemIndex=function(e){for(var t=this.getMenuId(e),i=0;i<this.currentItems.length;i++)if(this.currentItems[i].id===t||this.currentItems[i].id===e)return i;return-1},e.prototype.disableItem=function(e){0!==e.length&&(this.disabledItems=this.disabledItems.concat(e))},e.prototype.enableItems=function(e,t,i){t&&(this.disabledItems=this.disabledItems.filter(function(t){return-1===e.indexOf(t)}));for(var n=0;n<e.length;n++){var a=this.checkValidItem(e[n]);1===a?this.contextMenu.enableItems([this.getMenuId(e[n])],t,i):2===a&&this.contextMenu.enableItems([e[n]],t,i)}},e.prototype.setFolderItem=function(e){if(this.menuType="folder",this.contextMenu.items=this.getItemData(this.parent.contextMenuSettings.folder.map(function(e){return e.trim()})),this.contextMenu.dataBind(),e){var i=t.select('[data-uid="'+this.navUid+'"]',this.parent.navigationpaneModule.treeObj.element);if(t.isNullOrUndefined(i)||this.parent.pathNames[this.parent.pathNames.length-1]!==i.querySelector(".e-list-text").innerHTML||"navigationpane"!==this.parent.activeModule){var n=this.disabledItems.indexOf("Open");-1!==n&&this.disabledItems.splice(n,1)}else this.disabledItems.push("Open");0===this.parent.selectedItems.length&&-1!==(a=this.disabledItems.indexOf("Rename"))&&this.disabledItems.splice(a,1)}else if("navigationpane"!==this.parent.activeModule)if(1===this.parent.selectedItems.length){var a=this.disabledItems.indexOf("Rename");-1!==a&&this.disabledItems.splice(a,1)}else this.disabledItems.push("Rename","Paste")},e.prototype.setFileItem=function(){if(this.menuType="file",this.contextMenu.items=this.getItemData(this.parent.contextMenuSettings.file.map(function(e){return e.trim()})),this.contextMenu.dataBind(),1===this.parent.selectedItems.length){var e=this.disabledItems.indexOf("Rename");-1!==e&&this.disabledItems.splice(e,1)}else this.disabledItems.push("Rename")},e.prototype.setLayoutItem=function(e){this.menuType="layout",this.contextMenu.items=this.getItemData(this.parent.contextMenuSettings.layout.map(function(e){return e.trim()})),this.contextMenu.dataBind(),!this.parent.allowMultiSelection||"LargeIcons"===this.parent.view&&0!==t.closest(e,"#"+this.parent.element.id+xi).getElementsByClassName(Xi).length||"Details"===this.parent.view&&0!==t.closest(e,"#"+this.parent.element.id+Ci).getElementsByClassName(Xi).length?this.disabledItems.push("SelectAll"):this.disabledItems=this.disabledItems.filter(function(e){return"SelectAll"!==e}),0===this.parent.selectedNodes.length&&-1===this.disabledItems.indexOf("Paste")&&this.disabledItems.push("Paste"),this.contextMenu.dataBind()},e.prototype.checkValidItem=function(e){if(!t.isNullOrUndefined(this.currentElement)){if(!t.isNullOrUndefined(t.select("#"+this.getMenuId(e),this.currentElement)))return 1;if(!t.isNullOrUndefined(t.select("#"+e,this.currentElement)))return 2}return-1},e.prototype.getMenuItemData=function(){if("layout"===this.menuType)return E(this.parent);var e={target:this.menuTarget};return this.parent.notify(Kn,e),this.parent.itemData[0]},e.prototype.onSelect=function(e){var i=this;if(!t.isNullOrUndefined(e.item)&&e.item.id){var n,a=e.item.id.substr((this.parent.element.id+"_cm_").length);"refresh"===a||"newfolder"===a||"upload"===a?(n=[E(this.parent)],this.parent.itemData=n):(this.parent.notify("selected-data",{}),n="navigationpane"===this.parent.activeModule&&"open"===a?[this.menuItemData]:this.parent.itemData);var s={cancel:!1,element:e.element,fileDetails:n,item:e.item};this.parent.trigger("menuClick",s,function(s){var r;if(!s.cancel)switch("cut"!==a&&"copy"!==a&&(i.isMenuItemClicked=!0),a){case"cut":M(i.parent);break;case"copy":P(i.parent);break;case"paste":"folder"===i.menuType?"navigationpane"===i.parent.activeModule?(i.parent.navigationpaneModule.openFileOnContextMenuClick(t.closest(i.targetNodeElement,"li")),i.parent.folderPath=i.parent.path):i.parent.folderPath=L(i.parent,i.menuItemData,i.parent.path):i.parent.folderPath="",G(i.parent);break;case"delete":for(var o=0;o<n.length;o++)if(!Ie(n[o]))return void be(i.parent,n[o],ca);mt(i.parent,"Delete");break;case"download":for(var l=0;l<n.length;l++)if(!De(n[l]))return void be(i.parent,n[l],fa);"navigationpane"===i.parent.activeModule?i.parent.notify("download-init",{}):i.parent.selectedItems.length>0&&pt(i.parent,i.parent.path,i.parent.selectedItems);break;case"rename":Ie(n[0])?(i.parent.notify(Yn,{}),mt(i.parent,"Rename")):be(i.parent,n[0],ca);break;case"selectall":i.parent.notify("select-all-init",{});break;case"refresh":j(i.parent);break;case"open":i.parent.visitedItem&&"navigationpane"!==i.parent.activeModule?i.parent.notify(Vn,{target:i.parent.visitedItem}):"navigationpane"===i.parent.activeModule&&(i.parent.visitedItem&&i.parent.notify(Vn,{target:i.parent.visitedItem}),i.parent.navigationpaneModule.openFileOnContextMenuClick(t.closest(i.targetNodeElement,"li")));break;case"details":i.parent.notify(Wn,{}),r=i.parent.selectedItems,"navigationpane"===i.parent.activeModule&&(r=[],i.parent.navigationpaneModule.openFileOnContextMenuClick(t.closest(i.targetNodeElement,"li"))),Te(i.parent,r,i.parent.path,"details");break;case"newfolder":Se(i.parent);break;case"upload":Ce(i.parent);break;case"name":case"size":case"date":case"ascending":case"descending":case"none":q(i.parent,e);break;case"largeiconsview":C(i.parent,"LargeIcons");break;case"detailsview":C(i.parent,"Details")}})}},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()||"common"===e.module)for(var t=0,i=Object.keys(e.newProp);t<i.length;t++)switch(i[t]){case"cssClass":this.contextMenu.cssClass=z(this.parent,Ti)}},e.prototype.addEventListener=function(){this.parent.on(kn,this.destroy,this),this.parent.on(Dn,this.onPropertyChanged,this),this.keyboardModule=new t.KeyboardEvents(this.contextMenu.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},e.prototype.removeEventListener=function(){this.parent.off(kn,this.destroy),this.parent.off(Dn,this.onPropertyChanged),this.keyboardModule.destroy()},e.prototype.keyActionHandler=function(e){switch(e.action){case"uparrow":case"downarrow":e.preventDefault()}},e.prototype.getModuleName=function(){return"contextmenu"},e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),this.contextMenu.destroy(),this.targetElement=null)},e.prototype.getItemData=function(e){for(var t=[],i=0;i<e.length;i++){var n=void 0,a=this.getMenuId(e[i]),s=B(this.parent,e[i]);switch(e[i]){case"|":n={separator:!0};break;case"Open":n={id:a,text:s,iconCss:"e-icons e-fe-open"};break;case"Upload":n={id:a,text:s,iconCss:"e-icons e-fe-upload"};break;case"Cut":n={id:a,text:s,iconCss:gn};break;case"Copy":n={id:a,text:s,iconCss:"e-icons e-fe-copy"};break;case"Paste":n={id:a,text:s,iconCss:"e-icons e-fe-paste"};break;case"Delete":n={id:a,text:s,iconCss:"e-icons e-fe-delete"};break;case"Rename":n={id:a,text:s,iconCss:"e-icons e-fe-rename"};break;case"NewFolder":n={id:a,text:s,iconCss:"e-icons e-fe-newfolder"};break;case"Details":n={id:a,text:s,iconCss:"e-icons e-fe-details"};break;case"SortBy":n={id:a,text:s,iconCss:"e-icons e-fe-sort",items:[{id:this.getMenuId("Name"),text:B(this.parent,"Name"),iconCss:"name"===this.parent.sortBy?Bi:null},{id:this.getMenuId("Size"),text:B(this.parent,"Size"),iconCss:"size"===this.parent.sortBy?Bi:null},{id:this.getMenuId("Date"),text:B(this.parent,"DateModified"),iconCss:"_fm_modified"===this.parent.sortBy?Bi:null},{separator:!0},{id:this.getMenuId("Ascending"),text:B(this.parent,"Ascending"),iconCss:"Ascending"===this.parent.sortOrder?Hi:null},{id:this.getMenuId("Descending"),text:B(this.parent,"Descending"),iconCss:"Descending"===this.parent.sortOrder?Hi:null},{id:this.getMenuId("None"),text:B(this.parent,"None"),iconCss:"None"===this.parent.sortOrder?Hi:null}]};break;case"View":n={id:a,text:s,iconCss:"Details"===this.parent.view?mn:bn,items:[{id:this.getMenuId("largeiconsview"),text:B(this.parent,"View-LargeIcons"),iconCss:"Details"===this.parent.view?null:Hi},{id:this.getMenuId("detailsview"),text:B(this.parent,"View-Details"),iconCss:"Details"===this.parent.view?Hi:null}]};break;case"Refresh":n={id:a,text:s,iconCss:"e-icons e-fe-refresh"};break;case"SelectAll":n={id:a,text:s,iconCss:"e-icons e-fe-select"};break;case"Download":n={id:a,text:s,iconCss:"e-icons e-fe-download"};break;default:n={id:a,text:s}}t.push(n)}return t},e.prototype.getMenuId=function(e){return this.parent.element.id+"_cm_"+e.split(" ").join("").toLowerCase()},e}(),va={NewFolder:"New folder",Upload:"Upload",Delete:"Delete",Rename:"Rename",Download:"Download",Cut:"Cut",Copy:"Copy",Paste:"Paste",SortBy:"Sort by",Refresh:"Refresh","Item-Selection":"item selected","Items-Selection":"items selected",View:"View",Details:"Details",SelectAll:"Select all",Open:"Open","Tooltip-NewFolder":"New folder","Tooltip-Upload":"Upload","Tooltip-Delete":"Delete","Tooltip-Rename":"Rename","Tooltip-Download":"Download","Tooltip-Cut":"Cut","Tooltip-Copy":"Copy","Tooltip-Paste":"Paste","Tooltip-SortBy":"Sort by","Tooltip-Refresh":"Refresh","Tooltip-Selection":"Clear selection","Tooltip-View":"View","Tooltip-Details":"Details","Tooltip-SelectAll":"Select all",Name:"Name",Size:"Size",DateModified:"Modified",DateCreated:"Date created",Path:"Path",Modified:"Modified",Created:"Created",Location:"Location",Type:"Type",Permission:"Permission",Ascending:"Ascending",Descending:"Descending",None:"None","View-LargeIcons":"Large icons","View-Details":"Details",Search:"Search","Button-Ok":"OK","Button-Cancel":"Cancel","Button-Yes":"Yes","Button-No":"No","Button-Create":"Create","Button-Save":"Save","Header-NewFolder":"Folder","Content-NewFolder":"Enter your folder name","Header-Rename":"Rename","Content-Rename":"Enter your new name","Header-Rename-Confirmation":"Rename Confirmation","Content-Rename-Confirmation":"If you change a file name extension, the file might become unstable. Are you sure you want to change it?","Header-Delete":"Delete File","Content-Delete":"Are you sure you want to delete this file?","Header-Folder-Delete":"Delete Folder","Content-Folder-Delete":"Are you sure you want to delete this folder?","Header-Multiple-Delete":"Delete Multiple Items","Content-Multiple-Delete":"Are you sure you want to delete these {0} items?","Header-Duplicate":"File/Folder exists","Content-Duplicate":"{0} already exists. Do you want to rename and paste?","Header-Upload":"Upload Files",Error:"Error","Validation-Empty":"The file or folder name cannot be empty.","Validation-Invalid":'The file or folder name {0} contains invalid characters. Please use a different name. Valid file or folder names cannot end with a dot or space, and cannot contain any of the following characters: \\/:*?"<>|',"Validation-NewFolder-Exists":"A file or folder with the name {0} already exists.","Validation-Rename-Exists":"Cannot rename {0} to {1}: destination already exists.","Folder-Empty":"This folder is empty","File-Upload":"Drag files here to upload","Search-Empty":"No results found","Search-Key":"Try with different keywords","Filter-Empty":"No results found","Filter-Key":"Try with different filter","Sub-Folder-Error":"The destination folder is the subfolder of the source folder.","Same-Folder-Error":"The destination folder is the same as the source folder.","Access-Denied":"Access Denied","Access-Details":'You don"t have permission to access this folder.',"Header-Retry":"File Already Exists","Content-Retry":"A file with this name already exists in this folder. What would you like to do?","Button-Keep-Both":"Keep both","Button-Replace":"Replace","Button-Skip":"Skip","ApplyAll-Label":"Do this for all current items",KB:"KB","Access-Message":"{0} is not accessible. You need permission to perform the {1} action.","Network-Error":"NetworkError: Failed to send on XMLHTTPRequest: Failed to load","Server-Error":"ServerError: Invalid response from"},ya=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ia=function(e,t,i,n){var a,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s<3?a(r):s>3?a(t,i,r):a(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Oa=function(e){function a(i,n){var a=e.call(this,i,n)||this;return a.filterData=null,a.selectedNodes=[],a.duplicateItems=[],a.duplicateRecords=[],a.previousPath=[],a.nextPath=[],a.existingFileCount=0,a.isLayoutChange=!1,a.layoutSelectedItems=[],a.renamedId=null,a.uploadItem=[],a.deleteRecords=[],a.isFile=!1,a.isCut=!1,a.isSearchCut=!1,a.isSearchDrag=!1,a.isPasteError=!1,a.folderPath="",a.isSameAction=!1,a.isFiltered=!1,a.isSortByClicked=!1,a.enablePaste=!1,a.persistData=!1,a.retryArgs=[],a.isOpened=!1,a.isRetryOpened=!1,a.isPathDrag=!1,a.searchedItems=[],a.retryFiles=[],a.isApplySame=!1,a.dragData=[],a.dragNodes=[],a.dragPath="",a.dropPath="",a.isDragDrop=!1,a.treeExpandTimer=null,a.dragCursorPosition={left:44,top:18},a.isDropEnd=!1,a.dragCount=0,a.droppedObjects=[],a.uploadingCount=0,a.uploadedCount=0,a.isMac=!1,a.dragSelectedItems=[],a.onScrollHandler=function(){t.isNullOrUndefined(a.contextmenuModule)||t.isNullOrUndefined(a.contextmenuModule.contextMenu)||a.contextmenuModule.contextMenu.close()},s.Inject(ma,ga,ba),a}ya(a,e),s=a,a.prototype.getModuleName=function(){return"filemanager"},a.prototype.preRender=function(){(t.isNullOrUndefined(this.element.id)||""===this.element.id)&&this.element.setAttribute("id",t.getUniqueID("filemanager")),this.ensurePath(),this.feParent=[],this.feFiles=[],t.setStyleAttribute(this.element,{width:t.formatUnit(this.width),height:t.formatUnit(this.height)}),this.isDevice=t.Browser.isDevice,this.isMobile=this.checkMobile(),this.isMobile&&this.setProperties({navigationPaneSettings:{visible:!1}},!0);var e=t.closest(this.element,".e-bigger");this.isBigger=!!e,this.activeModule="LargeIcons"===this.view?"largeiconsview":"detailsview",n.createSpinner({target:this.element},t.createElement),this.addWrapper(),this.keyConfigs={altN:"alt+n",f5:"f5",ctrlShift1:"ctrl+shift+1",ctrlShift2:"ctrl+shift+2",ctrlU:"ctrl+u"},this.localeObj=new t.L10n(this.getModuleName(),va,this.locale)},a.prototype.getPersistData=function(){var e=["view","path","selectedItems"];return this.addOnPersist(e)},a.prototype.requiredModules=function(){var e=[];return e.push({member:"breadcrumbbar",args:[this]}),e.push({member:"largeiconsview",args:[this]}),this.toolbarSettings.visible&&e.push({member:"toolbar",args:[this],name:"Toolbar"}),this.navigationPaneSettings.visible&&e.push({member:"navigationpane",args:[this],name:"NavigationPane"}),this.view&&e.push({member:"detailsview",args:[this],name:"DetailsView"}),this.contextMenuSettings.visible&&!this.isDevice&&e.push({member:"contextmenu",args:[this],name:"ContextMenu"}),this.enableVirtualization&&e.push({member:"virtualization",args:[this],name:"Virtualization"}),e},a.prototype.render=function(){this.initialize();var e=t.isNullOrUndefined(this.selectedItems)?[]:this.allowMultiSelection?this.selectedItems:this.selectedItems.slice(this.selectedItems.length-1);this.setProperties({selectedItems:e},!0),this.fileView=this.view,this.isMac=navigator.platform.toUpperCase().indexOf("MAC")>=0,this.setRtl(this.enableRtl),this.addEventListeners(),Ee(this,this.path!==this.originalPath?Sn:Cn,this.path),"Details"===this.fileView&&this.largeiconsviewModule.element.classList.add(In),this.adjustHeight(),t.isNullOrUndefined(this.navigationpaneModule)&&(this.splitterObj.collapse(this.enableRtl?1:0),t.select(".e-split-bar",this.element).classList.add(In)),this.wireEvents(),this.renderComplete()},a.prototype.ensurePath=function(){var e=this.path;t.isNullOrUndefined(e)&&(e="/"),e.lastIndexOf("/")!==e.length-1&&(e+="/"),this.originalPath=e;var i=e.split("/");this.setProperties({path:i[0]+"/"},!0),this.pathNames=[],this.pathId=["fe_tree"],this.itemData=[]},a.prototype.initialize=function(){this.isMobile&&t.addClass([this.element],"e-fe-mobile"),this.allowMultiSelection&&t.addClass([this.element],"e-fe-cb-select"),this.addCssClass(null,this.cssClass),this.renderFileUpload()},a.prototype.addWrapper=function(){var e=this.createElement("div",{id:this.element.id+"_toolbar"});this.element.appendChild(e);var t=this.createElement("div",{id:this.element.id+Si,className:"e-layout"});this.element.appendChild(t);var n=this.createElement("div",{id:this.element.id+"_navigation",className:"e-navigation"}),a=this.createElement("div",{id:this.element.id+"_tree"});n.appendChild(a);var s=this.createElement("div",{id:this.element.id+Pi,className:"e-layout-content"});this.breadCrumbBarNavigation=this.createElement("div",{id:this.element.id+Mi,className:"e-address"}),s.appendChild(this.breadCrumbBarNavigation);var r=this.createElement("div",{id:this.element.id+Ci});s.appendChild(r);var o=this.createElement("div",{id:this.element.id+xi,className:Ui,attrs:{role:"group"}});s.appendChild(o);var l=this.createElement("span",{className:"e-fe-overlay"});s.appendChild(l);var h;this.enableRtl?(t.appendChild(s),t.appendChild(n),h=[{size:"75%",min:"270px"},{size:"25%",min:this.navigationPaneSettings.minWidth.toString(),max:this.navigationPaneSettings.maxWidth.toString()}]):(t.appendChild(n),t.appendChild(s),h=[{size:"25%",min:this.navigationPaneSettings.minWidth.toString(),max:this.navigationPaneSettings.maxWidth.toString()},{size:"75%",min:"270px"}]),this.splitterObj=new i.Splitter({paneSettings:h,width:"100%",enableRtl:!1,enableHtmlSanitizer:this.enableHtmlSanitizer,resizing:this.splitterResize.bind(this)}),this.splitterObj.isStringTemplate=!0,this.splitterObj.appendTo(t);var d=this.createElement("div",{id:this.element.id+ji});this.element.appendChild(d);var c=this.createElement("ul",{id:this.element.id+"_contextmenu"});this.element.appendChild(c);var p=this.createElement("div",{id:this.element.id+Ni});this.element.appendChild(p);var u=this.createElement("div",{id:this.element.id+Ei});this.element.appendChild(u);var f=this.createElement("div",{id:this.element.id+"_upload_dialog"});this.element.appendChild(f)},a.prototype.adjustHeight=function(){var e=t.select("#"+this.element.id+"_toolbar",this.element),i=e?e.offsetHeight:0;this.splitterObj&&(this.splitterObj.height=(this.element.clientHeight-i).toString(),this.splitterObj.dataBind())},a.prototype.splitterResize=function(){this.notify("splitter-resize",{})},a.prototype.splitterAdjust=function(){var e=t.select(".e-split-bar",this.element);this.navigationPaneSettings.visible?(this.splitterObj.expand(this.enableRtl?1:0),e.classList.remove(In)):(this.splitterObj.collapse(this.enableRtl?1:0),e.classList.add(In))},a.prototype.addCssClass=function(e,i){t.isNullOrUndefined(e)||""===e||t.removeClass([this.element],e.split(" ")),t.isNullOrUndefined(i)||""===i||t.addClass([this.element],i.split(" "))},a.prototype.showSpinner=function(){n.showSpinner(this.element)},a.prototype.hideSpinner=function(){n.hideSpinner(this.element)},a.prototype.onContextMenu=function(e){e.preventDefault()},a.prototype.checkMobile=function(){return/iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile/i.test(t.Browser.userAgent.toLowerCase())&&/mobile/i.test(t.Browser.userAgent.toLowerCase())},a.prototype.renderFileUpload=function(){var e=this.element.id+Ri,t=this.createElement("input",{id:e,attrs:{name:"uploadFiles",type:"file"}});this.element.appendChild(t),this.uploadDialogObj=new n.Dialog({header:B(this,"Header-Upload"),content:t,animationSettings:{effect:"None"},showCloseIcon:!0,closeOnEscape:!0,visible:!1,isModal:!0,width:"350px",target:this.popupTarget?this.popupTarget:"#"+this.element.id,cssClass:z(this,this.isMobile?Ai:Ti),locale:this.locale,allowDragging:!0,position:{X:"center",Y:"center"},enableRtl:this.enableRtl,enableHtmlSanitizer:this.enableHtmlSanitizer,open:this.onOpen.bind(this),close:this.onClose.bind(this),beforeOpen:this.onBeforeOpen.bind(this),beforeClose:this.onBeforeClose.bind(this)}),this.uploadDialogObj.appendTo("#"+this.element.id+"_upload_dialog"),this.renderUploadBox()},a.prototype.renderUploadBox=function(){var e=this.ajaxSettings.uploadUrl?this.ajaxSettings.uploadUrl:this.ajaxSettings.url;this.uploadObj=new r.Uploader({dropArea:t.select("#"+this.element.id+Pi,this.element),asyncSettings:{saveUrl:e,removeUrl:e,chunkSize:this.uploadSettings.chunkSize,retryCount:0},locale:this.locale,enableRtl:this.enableRtl,uploading:this.onUploading.bind(this),chunkUploading:this.onChunkUploading.bind(this),removing:this.onRemoving.bind(this),canceling:this.onCancel.bind(this),clearing:this.onClearing.bind(this),selected:this.onSelected.bind(this),success:this.onUploadSuccess.bind(this),failure:this.onUploadFailure.bind(this),autoUpload:this.uploadSettings.autoUpload,minFileSize:this.uploadSettings.minFileSize,maxFileSize:this.uploadSettings.maxFileSize,allowedExtensions:this.uploadSettings.allowedExtensions,directoryUpload:this.uploadSettings.directoryUpload,fileListRendering:this.onFileListRender.bind(this)}),this.uploadObj.appendTo("#"+this.element.id+Ri)},a.prototype.onFileListRender=function(e){this.trigger("uploadListCreate",e)},a.prototype.updateUploader=function(){this.uploadObj.autoUpload=this.uploadSettings.autoUpload,this.uploadObj.minFileSize=this.uploadSettings.minFileSize,this.uploadObj.maxFileSize=this.uploadSettings.maxFileSize,this.uploadObj.allowedExtensions=this.uploadSettings.allowedExtensions,this.uploadObj.directoryUpload=this.uploadSettings.directoryUpload,this.uploadObj.dataBind()},a.prototype.onBeforeOpen=function(e){var t={cancel:e.cancel,popupName:"Upload",popupModule:this.uploadDialogObj};this.trigger("beforePopupOpen",t,function(t){e.cancel=t.cancel})},a.prototype.onBeforeClose=function(e){var t={cancel:e.cancel,popupName:"Upload",popupModule:this.uploadDialogObj};this.trigger("beforePopupClose",t,function(t){e.cancel=t.cancel})},a.prototype.onOpen=function(){this.isOpened=!0,this.uploadDialogObj.element.focus();var e={popupModule:this.uploadDialogObj,popupName:"Upload",element:this.uploadDialogObj.element};this.trigger("popupOpen",e)},a.prototype.onClose=function(){this.isOpened=!1,this.uploadObj.clearAll();var e={popupModule:this.uploadDialogObj,popupName:"Upload",element:this.uploadDialogObj.element};this.trigger("popupClose",e)},a.prototype.onChunkUploading=function(e){var i="save";if(0!==this.retryArgs.length)for(var n=0;n<this.retryArgs.length;n++)e.fileData.name===this.retryArgs[n].file.name&&(i=this.retryArgs[n].action);var a=JSON.stringify(t.getValue(this.pathId[this.pathId.length-1],this.feParent));e.customFormData=[{path:this.path},{size:e.fileData.size},{action:i},{data:a},{filename:e.fileData.name}]},a.prototype.onUploading=function(e){var i="save";if(0!==this.retryArgs.length)for(var n=0;n<this.retryArgs.length;n++)e.fileData.name===this.retryArgs[n].file.name&&(i=this.retryArgs[n].action,0===this.uploadSettings.chunkSize&&(this.retryArgs.splice(n,1),n=this.retryArgs.length));var a=JSON.stringify(t.getValue(this.pathId[this.pathId.length-1],this.feParent));e.customFormData=[{path:this.path},{size:e.fileData.size},{action:i},{data:a},{filename:e.fileData.name}];var s={url:this.ajaxSettings.uploadUrl?this.ajaxSettings.uploadUrl:this.ajaxSettings.url,type:"POST",mode:!0,dataType:null,contentType:null,data:JSON.stringify(e.customFormData),onSuccess:null,onFailure:null,beforeSend:null};this.uploadEventArgs={action:"Upload",ajaxSettings:s,cancel:!1},this.trigger("beforeSend",this.uploadEventArgs,function(i){e.customFormData=JSON.parse(t.getValue("data",i.ajaxSettings)),e.cancel=i.cancel;var n={cancel:!1,httpRequest:e.currentRequest};"function"==typeof t.getValue("beforeSend",i.ajaxSettings)&&(t.getValue("beforeSend",i.ajaxSettings)(n),t.getValue("cancel",n)&&(e.cancel=t.getValue("cancel",n)))})},a.prototype.onRemoving=function(){this.onFileUploadSuccess({count:1}),1===this.uploadObj.getFilesData().length&&this.uploadDialogObj.hide()},a.prototype.onCancel=function(e){var i=JSON.stringify(t.getValue(this.pathId[this.pathId.length-1],this.feParent));e.customFormData=[{path:this.path},{action:"remove"},{data:i}]},a.prototype.onClearing=function(){this.isOpened&&this.uploadDialogObj.hide()},a.prototype.onSelected=function(e){if(0!==e.filesData.length){this.uploadingCount=e.filesData.length,this.uploadedCount=0;var t=E(this);if(!we(t))return e.cancel=!0,void be(this,t,ua);this.uploadDialogObj.show()}},a.prototype.onFileUploadSuccess=function(e){this.uploadedCount=this.uploadedCount+e.count,this.uploadSettings.autoClose&&this.uploadingCount===this.uploadedCount&&this.uploadDialogObj.hide()},a.prototype.onChunkUploadComplete=function(e){if(0!==this.retryArgs.length)for(var i=0;i<this.retryArgs.length;i++)(t.isNullOrUndefined(e)?"":t.getValue("file",e).name)===this.retryArgs[i].file.name&&(this.retryArgs.splice(i,1),i=this.retryArgs.length)},a.prototype.onUploadSuccess=function(e){this.uploadSettings.chunkSize>0&&this.onChunkUploadComplete(e);var i={action:"Upload",result:e};this.trigger("success",i),this.itemData=[t.getValue(this.pathId[this.pathId.length-1],this.feParent)],Ee(this,Rn,this.path),this.onFileUploadSuccess({count:1}),"function"==typeof t.getValue("onSuccess",this.uploadEventArgs.ajaxSettings)&&t.getValue("onSuccess",this.uploadEventArgs.ajaxSettings)()},a.prototype.onUploadFailure=function(e){this.uploadSettings.chunkSize>0&&this.onChunkUploadComplete(e);var i=t.getValue("response",e),n=t.getValue("statusText",i);""!==n&&t.setValue("statusText",n,e);var a={action:"Upload",error:e};this.trigger("failure",a),400===t.getValue("statusCode",i)&&(this.retryFiles.push(t.getValue("file",e)),this.isRetryOpened||bt(this,"UploadRetry")),"function"==typeof t.getValue("onFailure",this.uploadEventArgs.ajaxSettings)&&t.getValue("onFailure",this.uploadEventArgs.ajaxSettings)()},a.prototype.onInitialEnd=function(){K(this,this.path)},a.prototype.addEventListeners=function(){this.on(Ln,this.showSpinner,this),this.on(An,this.hideSpinner,this),this.on(Sn,this.onInitialEnd,this),this.on(Wn,this.onDetailsInit,this),this.on(Tn,this.onFileUploadSuccess,this),t.EventHandler.add(this.element,"contextmenu",this.onContextMenu,this)},a.prototype.removeEventListeners=function(){this.isDestroyed||(this.off(Ln,this.showSpinner),this.off(An,this.hideSpinner),this.off(Sn,this.onInitialEnd),this.off(Wn,this.onDetailsInit),this.off(Tn,this.onFileUploadSuccess),t.EventHandler.remove(this.element,"contextmenu",this.onContextMenu))},a.prototype.onDetailsInit=function(){t.isNullOrUndefined(this.activeModule)&&(this.itemData=[t.getValue(this.pathId[this.pathId.length-1],this.feParent)])},a.prototype.resizeHandler=function(){this.adjustHeight(),this.notify(Mn,{})},a.prototype.keyActionHandler=function(e){switch(e.action){case"altN":e.preventDefault(),this.itemData=[E(this)],Oe(this.itemData[0])?mt(this,"NewFolder"):be(this,this.itemData[0],pa);break;case"f5":e.preventDefault(),j(this);break;case"ctrlShift1":e.preventDefault(),this.fileView="Details",this.setProperties({view:"Details"},!0),n.showSpinner(this.element),C(this,"Details");break;case"ctrlShift2":e.preventDefault(),this.fileView="LargeIcons",this.setProperties({view:"LargeIcons"},!0),n.showSpinner(this.element),C(this,"LargeIcons");break;case"ctrlU":e.preventDefault(),-1!==this.toolbarSettings.items.indexOf("Upload")&&t.select("#"+this.element.id+Ri,this.element).click()}},a.prototype.wireSelectOnDragEvent=function(e){t.isNullOrUndefined(this.view)||(e&&(this.viewElem="LargeIcons"===this.view?this.largeiconsviewModule.element:this.element.querySelector(".e-gridcontent")),e?this.allowMultiSelection&&(this.on(zn,this.onLayoutChange,this),this.on(Hn,this.onLayoutChange,this)):(this.off(zn,this.onLayoutChange),this.off(Hn,this.onLayoutChange)),this.viewElem&&(e&&this.allowMultiSelection?t.EventHandler.add(this.viewElem,"mousedown",this.onDragStart,this):t.EventHandler.remove(this.viewElem,"mousedown",this.onDragStart)))},a.prototype.wireEvents=function(){this.enableRangeSelection&&this.wireSelectOnDragEvent(!0),t.EventHandler.add(window,"resize",this.resizeHandler,this),this.contextMenuSettings.visible&&this.element.addEventListener("scroll",this.onScrollHandler,!0),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},a.prototype.unWireEvents=function(){this.wireSelectOnDragEvent(!1),t.EventHandler.remove(window,"resize",this.resizeHandler),this.contextMenuSettings.visible&&this.element.removeEventListener("scroll",this.onScrollHandler,!0),this.keyboardModule.destroy()},a.prototype.onDragStart=function(e){if(this.viewElem){if(this.allowDragAndDrop&&t.closest(e.target,this.viewElem.classList.contains("e-large-icons")?".e-list-item":".e-fe-text"))return;e.preventDefault(),this.dragX=e.pageX,this.dragY=e.pageY,this.dragSelectElement||(this.dragSelectElement=t.createElement("div",{id:this.element.id+"_drag",className:"e-filemanager e-drag-select",styles:"left: "+this.dragX+"px;top: "+this.dragY+"px;"}),document.body.append(this.dragSelectElement)),t.EventHandler.add(document,"mouseup",this.onDragStop,this),t.EventHandler.add(this.viewElem,"mousemove",this.onDrag,this),t.EventHandler.add(this.dragSelectElement,"mousemove",this.onDrag,this)}},a.prototype.onDrag=function(e){if(e.stopPropagation(),this.dragSelectElement){var i=e.pageX-this.dragX,n=e.pageY-this.dragY;t.setStyleAttribute(this.dragSelectElement,{left:i<0?this.dragX+i+"px":this.dragX+"px",top:n<0?this.dragY+n+"px":this.dragY+"px",height:Math.abs(n)+"px",width:Math.abs(i)+"px"}),this.selectItems()}else t.EventHandler.remove(this.viewElem,"mousemove",this.onDrag)},a.prototype.onDragStop=function(){this.viewElem&&(t.EventHandler.remove(document,"mouseup",this.onDragStop),t.EventHandler.remove(this.viewElem,"mousemove",this.onDrag)),this.dragSelectElement&&(t.EventHandler.remove(this.dragSelectElement,"mousemove",this.onDrag),this.dragSelectElement.clientHeight>0&&this.dragSelectElement.clientWidth>0&&this.setProperties({selectedItems:this.dragSelectedItems}),this.dragSelectedItems=[],t.detach(this.dragSelectElement),this.dragSelectElement=null)},a.prototype.selectItems=function(){var e=this.dragSelectElement.getBoundingClientRect();e.height>0&&e.width>0&&(this.dragSelectedItems=[],t.removeClass(t.selectAll(".e-active",this.viewElem),["e-active","e-focus"]),t.removeClass(t.selectAll(".e-check",this.viewElem),["e-check"]));for(var i=0,n=t.selectAll(this.viewElem.classList.contains("e-large-icons")?".e-list-item":".e-row",this.viewElem);i<n.length;i++){var a=n[i],s=a.getBoundingClientRect();!(e.right<s.left||e.left>s.right||e.bottom<s.top||e.top>s.bottom)&&e.height>0&&e.width>0&&(this.viewElem.classList.contains("e-large-icons")?(a.classList.add("e-active"),this.dragSelectedItems.push(a.getAttribute("title"))):(t.addClass(t.selectAll(".e-rowcell",a),["e-active"]),this.dragSelectedItems.push(a.querySelector(".e-drag-text").textContent)),this.showItemCheckBoxes&&a.querySelector(".e-frame").classList.add("e-check"))}},a.prototype.onLayoutChange=function(){this.enableRangeSelection&&(this.unWireEvents(),this.wireEvents())},a.prototype.setPath=function(){this.setProperties({selectedItems:[]},!0),this.ensurePath(),this.notify(Bn,{selectedNode:this.pathId[0]}),Ee(this,this.path!==this.originalPath?Sn:Cn,this.path)},a.prototype.onPropertyChanged=function(e,i){for(var n,a=this,s=!1,r=0,o=Object.keys(e);r<o.length;r++)switch(o[r]){case"ajaxSettings":this.ajaxSettingSetModel(e);break;case"allowDragAndDrop":this.allowDragAndDrop=e.allowDragAndDrop,this.notify(Dn,{module:"common",newProp:e,oldProp:i});break;case"showItemCheckBoxes":this.showItemCheckBoxes=e.showItemCheckBoxes,this.notify(Dn,{module:"common",newProp:e,oldProp:i});break;case"enableVirtualization":this.enableVirtualization=e.enableVirtualization,s=!0;break;case"allowMultiSelection":this.allowMultiSelection?t.addClass([this.element],"e-fe-cb-select"):(this.selectedItems.length>1&&this.setProperties({selectedItems:this.selectedItems.slice(this.selectedItems.length-1)},!0),t.removeClass([this.element],"e-fe-cb-select")),this.notify(Dn,{module:"common",newProp:e,oldProp:i});break;case"cssClass":this.addCssClass(i.cssClass,e.cssClass),this.notify(Dn,{module:"common",newProp:e,oldProp:i});break;case"detailsViewSettings":this.notify(Dn,{module:"detailsview",newProp:e,oldProp:i});break;case"enableRangeSelection":this.wireSelectOnDragEvent(!1),e.enableRangeSelection&&this.wireSelectOnDragEvent(!0);break;case"enableRtl":this.enableRtl=e.enableRtl,s=!0;break;case"rootAliasName":this.rootAliasName=e.rootAliasName,s=!0;break;case"height":n=t.isNullOrUndefined(e.height)?e.height:t.formatUnit(e.height),t.setStyleAttribute(this.element,{height:n}),this.adjustHeight(),this.notify(Dn,{module:"common",newProp:e,oldProp:i});break;case"locale":t.isNullOrUndefined(e.enableRtl)||this.setProperties({enableRtl:e.enableRtl},!0),this.localeSetModelOption(e);break;case"navigationPaneSettings":this.splitterAdjust(),this.notify(Dn,{module:"navigationpane",newProp:e,oldProp:i});break;case"path":this.oldPath=i.path,this.setPath();break;case"searchSettings":t.isNullOrUndefined(e.searchSettings.allowSearchOnTyping)||this.setProperties({searchSettings:{allowSearchOnTyping:e.searchSettings.allowSearchOnTyping}},!0),t.isNullOrUndefined(e.searchSettings.ignoreCase)&&this.setProperties({searchSettings:{ignoreCase:e.searchSettings.ignoreCase}},!0),t.isNullOrUndefined(e.searchSettings.filterType)&&this.setProperties({searchSettings:{filterType:e.searchSettings.filterType}},!0),this.notify(Dn,{module:"breadcrumbbar",newProp:e,oldProp:i});break;case"selectedItems":"Details"===this.view?this.notify(Dn,{module:"detailsview",newProp:e,oldProp:i}):"LargeIcons"===this.view&&this.notify(Dn,{module:"largeiconsview",newProp:e,oldProp:i});break;case"showFileExtension":case"showHiddenItems":this.notify(Dn,{module:"common",newProp:e,oldProp:i});break;case"showThumbnail":this.notify(Dn,{module:"largeiconsview",newProp:e,oldProp:i});break;case"toolbarSettings":case"toolbarItems":this.adjustHeight(),this.notify(Dn,{module:"toolbar",newProp:e,oldProp:i});break;case"uploadSettings":this.updateUploader();break;case"view":"Details"===e.view?this.notify(Dn,{module:"detailsview",newProp:e,oldProp:i}):"LargeIcons"===e.view&&this.notify(Dn,{module:"largeiconsview",newProp:e,oldProp:i});break;case"width":t.setStyleAttribute(this.element,{width:t.isNullOrUndefined(e.width)?e.width:t.formatUnit(e.width)}),this.notify(Dn,{module:"common",newProp:e,oldProp:i});break;case"sortOrder":j(this),this.notify(qn,{});break;case"sortBy":if("Details"===this.view){var l=this.detailsViewSettings.columns;if(!(!t.isNullOrUndefined(l)&&-1!==l.findIndex(function(e){return e.field===a.sortBy})))return;j(this),this.notify(qn,{}),this.notify(ia,{})}else j(this),this.notify(qn,{});break;case"popupTarget":this.uploadDialogObj&&(this.uploadDialogObj.target=e.popupTarget),this.dialogObj&&(this.dialogObj.target=e.popupTarget),this.extDialogObj&&(this.extDialogObj.target=e.popupTarget),this.viewerObj&&(this.viewerObj.target=e.popupTarget);break;case"fileSystemData":this.fileSystemData=e.fileSystemData,s=!0}s&&this.refresh()},a.prototype.ajaxSettingSetModel=function(i){t.isNullOrUndefined(i.ajaxSettings.url)||this.setProperties({ajaxSettings:{url:i.ajaxSettings.url}},!0),t.isNullOrUndefined(i.ajaxSettings.uploadUrl)||this.setProperties({ajaxSettings:{uploadUrl:i.ajaxSettings.uploadUrl}},!0),t.isNullOrUndefined(i.ajaxSettings.downloadUrl)||this.setProperties({ajaxSettings:{downloadUrl:i.ajaxSettings.downloadUrl}},!0),t.isNullOrUndefined(i.ajaxSettings.getImageUrl)||this.setProperties({ajaxSettings:{getImageUrl:i.ajaxSettings.getImageUrl}},!0),this.setProperties({path:"/"},!0),this.setProperties({selectedItems:[]},!0),e.prototype.refresh.call(this)},a.prototype.localeSetModelOption=function(t){this.uploadObj.locale=t.locale,e.prototype.refresh.call(this)},a.prototype.destroy=function(){this.isDestroyed||(this.refreshing||this.notify(kn,{}),this.uploadObj.destroy(),this.uploadObj=null,this.uploadDialogObj.destroy(),this.uploadDialogObj=null,this.splitterObj.destroy(),this.splitterObj=null,this.dialogObj&&(this.dialogObj.destroy(),this.dialogObj=null),this.viewerObj&&(this.viewerObj.destroy(),this.viewerObj=null),this.extDialogObj&&(this.extDialogObj.destroy(),this.extDialogObj=null),this.element.removeAttribute("style"),this.element.removeAttribute("tabindex"),this.removeEventListeners(),this.unWireEvents(),this.addCssClass(this.cssClass,null),t.removeClass([this.element],[yn,"e-fe-mobile","e-fe-cb-select"]),this.element.innerHTML="",this.breadCrumbBarNavigation=null,this.activeElements=null,this.virtualDragElement=null,this.visitedItem=null,e.prototype.destroy.call(this),this.virtualizationModule=null,this.navigationpaneModule=null,this.toolbarModule=null,this.contextmenuModule=null,this.largeiconsviewModule=null,this.detailsviewModule=null,this.breadcrumbbarModule=null,this.viewElem=null,this.dragSelectElement=null,this.dragSelectedItems=null)},a.prototype.createFolder=function(e){this.notify(ha,{action:"createFolder"});var t=[E(this)];this.itemData=t,e?/[/\\|*?"<>:]/.test(e)?mt(this,"Error",{files:null,error:{code:"402",message:B(this,"Validation-Invalid").replace("{0}",'"'+e+'"'),fileExists:null}}):Oe(t[0])?Pe(this,e):be(this,t[0],pa):Se(this)},a.prototype.deleteFiles=function(e){this.notify(ha,{action:"deleteFiles",ids:e})},a.prototype.disableToolbarItems=function(e){!t.isNullOrUndefined(e)&&this.toolbarModule&&this.toolbarModule.enableItems(e,!1)},a.prototype.downloadFiles=function(e){this.notify(ha,{action:"downloadFiles",ids:e})},a.prototype.enableToolbarItems=function(e){!t.isNullOrUndefined(e)&&this.toolbarModule&&this.toolbarModule.enableItems(e,!0)},a.prototype.enableMenuItems=function(e){t.isNullOrUndefined(e)||t.isNullOrUndefined(this.contextmenuModule)||t.isNullOrUndefined(this.contextmenuModule.contextMenu)||this.contextmenuModule.enableItems(e,!0,!0)},a.prototype.disableMenuItems=function(e){t.isNullOrUndefined(e)||t.isNullOrUndefined(this.contextmenuModule)||t.isNullOrUndefined(this.contextmenuModule.contextMenu)||this.contextmenuModule.disableItem(e)},a.prototype.getMenuItemIndex=function(e){return this.contextmenuModule?this.contextmenuModule.getItemIndex(e):-1},a.prototype.getToolbarItemIndex=function(e){return this.toolbarModule?this.toolbarModule.getItemIndex(e):-1},a.prototype.filterFiles=function(e){this.filterData=e||null,this.setProperties({selectedItems:[]},!0),this.notify(Hn,{}),this.isFiltered=!0,""!==this.breadcrumbbarModule.searchObj.element.value&&(this.breadcrumbbarModule.searchObj.element.value=""),Me(this,"filter-end")},a.prototype.getSelectedFiles=function(){return this.notify("update-selection-data",{}),this.itemData},a.prototype.openFile=function(e){this.notify(ha,{action:"openFile",id:e})},a.prototype.refreshFiles=function(){j(this)},a.prototype.refreshLayout=function(){this.adjustHeight(),this.notify("layout-refresh",{})},a.prototype.selectAll=function(){this.notify(ha,{action:"selectAll"})},a.prototype.traverseBackward=function(){if(this.pathNames.length>1&&""===this.breadcrumbbarModule.searchObj.element.value&&!this.isFiltered){this.pathId.pop(),this.pathNames.pop();var e=this.pathNames.slice(1).join("/");e=""===e?"/":"/"+e+"/",this.setProperties({path:e},!0),Ee(this,Rn,this.path);var t=this.pathId[this.pathId.length-1];this.notify("update-tree-selection",{module:"treeview",selectedNode:t})}},a.prototype.clearSelection=function(){this.notify(ha,{action:"clearSelection"})},a.prototype.renameFile=function(e,t){this.notify(ha,{action:"renameFile",id:e,newName:t})},a.prototype.uploadFiles=function(){var e=[E(this)];this.itemData=e,Ce(this)},a.prototype.closeDialog=function(){xe(this)},a.prototype.setRtl=function(e){e?this.addCssClass(null,yn):this.addCssClass(yn,null),this.uploadObj&&(this.uploadDialogObj.enableRtl=e,this.uploadObj.enableRtl=e)};var s;return Ia([t.Complex({},Qt)],a.prototype,"ajaxSettings",void 0),Ia([t.Property([])],a.prototype,"fileSystemData",void 0),Ia([t.Property(!1)],a.prototype,"allowDragAndDrop",void 0),Ia([t.Property(!0)],a.prototype,"allowMultiSelection",void 0),Ia([t.Property(!0)],a.prototype,"showItemCheckBoxes",void 0),Ia([t.Complex({},fi)],a.prototype,"contextMenuSettings",void 0),Ia([t.Property("")],a.prototype,"cssClass",void 0),Ia([t.Complex({},li)],a.prototype,"detailsViewSettings",void 0),Ia([t.Property(!0)],a.prototype,"enableHtmlSanitizer",void 0),Ia([t.Property(!1)],a.prototype,"enablePersistence",void 0),Ia([t.Property(!1)],a.prototype,"enableVirtualization",void 0),Ia([t.Property("400px")],a.prototype,"height",void 0),Ia([t.Property("LargeIcons")],a.prototype,"view",void 0),Ia([t.Complex({},bi)],a.prototype,"navigationPaneSettings",void 0),Ia([t.Property("/")],a.prototype,"path",void 0),Ia([t.Property(null)],a.prototype,"popupTarget",void 0),Ia([t.Complex({},ai)],a.prototype,"searchSettings",void 0),Ia([t.Property()],a.prototype,"selectedItems",void 0),Ia([t.Property(!0)],a.prototype,"showFileExtension",void 0),Ia([t.Property(null)],a.prototype,"rootAliasName",void 0),Ia([t.Property(!1)],a.prototype,"showHiddenItems",void 0),Ia([t.Property(!0)],a.prototype,"showThumbnail",void 0),Ia([t.Property("Ascending")],a.prototype,"sortOrder",void 0),Ia([t.Property("name")],a.prototype,"sortBy",void 0),Ia([t.Property(null)],a.prototype,"sortComparer",void 0),Ia([t.Property(!1)],a.prototype,"enableRangeSelection",void 0),Ia([t.Complex({},ei)],a.prototype,"toolbarSettings",void 0),Ia([t.Collection([],ti)],a.prototype,"toolbarItems",void 0),Ia([t.Complex({},Ii)],a.prototype,"uploadSettings",void 0),Ia([t.Property("100%")],a.prototype,"width",void 0),Ia([t.Event()],a.prototype,"fileLoad",void 0),Ia([t.Event()],a.prototype,"fileOpen",void 0),Ia([t.Event()],a.prototype,"beforeDownload",void 0),Ia([t.Event()],a.prototype,"beforeImageLoad",void 0),Ia([t.Event()],a.prototype,"beforePopupClose",void 0),Ia([t.Event()],a.prototype,"beforePopupOpen",void 0),Ia([t.Event()],a.prototype,"beforeSend",void 0),Ia([t.Event()],a.prototype,"created",void 0),Ia([t.Event()],a.prototype,"beforeFolderCreate",void 0),Ia([t.Event()],a.prototype,"folderCreate",void 0),Ia([t.Event()],a.prototype,"destroyed",void 0),Ia([t.Event()],a.prototype,"beforeDelete",void 0),Ia([t.Event()],a.prototype,"delete",void 0),Ia([t.Event()],a.prototype,"beforeRename",void 0),Ia([t.Event()],a.prototype,"rename",void 0),Ia([t.Event()],a.prototype,"beforeMove",void 0),Ia([t.Event()],a.prototype,"move",void 0),Ia([t.Event()],a.prototype,"search",void 0),Ia([t.Event()],a.prototype,"fileDragStart",void 0),Ia([t.Event()],a.prototype,"fileDragging",void 0),Ia([t.Event()],a.prototype,"fileDragStop",void 0),Ia([t.Event()],a.prototype,"fileDropped",void 0),Ia([t.Event()],a.prototype,"fileSelection",void 0),Ia([t.Event()],a.prototype,"fileSelect",void 0),Ia([t.Event()],a.prototype,"menuClick",void 0),Ia([t.Event()],a.prototype,"menuOpen",void 0),Ia([t.Event()],a.prototype,"menuClose",void 0),Ia([t.Event()],a.prototype,"failure",void 0),Ia([t.Event()],a.prototype,"popupClose",void 0),Ia([t.Event()],a.prototype,"popupOpen",void 0),Ia([t.Event()],a.prototype,"success",void 0),Ia([t.Event()],a.prototype,"toolbarClick",void 0),Ia([t.Event()],a.prototype,"toolbarCreate",void 0),Ia([t.Event()],a.prototype,"uploadListCreate",void 0),a=s=Ia([t.NotifyPropertyChanges],a)}(t.Component),wa=function(){function e(e){this.default=["Delete","Rename","Download","Cut","Copy","Paste"],this.single=["Delete","Rename","Download","Cut","Copy"],this.multiple=["Delete","Download","Cut","Copy","Refresh"],this.selection=["NewFolder","Upload","SortBy","Refresh"],this.parent=e,this.render(),this.addEventListener()}return e.prototype.render=function(){var e=this;this.items=this.toolbarItemData(this.getItems(this.parent.toolbarSettings.items.map(function(e){return e.trim()})));var t={items:this.items};this.parent.trigger("toolbarCreate",t,function(t){e.items=t.items,e.toolbarObj=new d.Toolbar({items:e.items,created:e.toolbarCreateHandler.bind(e),overflowMode:"Popup",clicked:e.onClicked.bind(e),enableHtmlSanitizer:e.parent.enableHtmlSanitizer,enableRtl:e.parent.enableRtl}),e.toolbarObj.isStringTemplate=!0,e.toolbarObj.root=e.parent.root?e.parent.root:e.parent,e.toolbarObj.appendTo("#"+e.parent.element.id+"_toolbar")})},e.prototype.getItemIndex=function(e){for(var t=this.getId(e),i=0;i<this.items.length;i++)if(this.items[i].id===t)return i;return-1},e.prototype.getItems=function(e){var t=e.slice();return this.parent.isDevice&&this.parent.allowMultiSelection&&t.push("SelectAll"),this.parent.toolbarItems.length>0&&(t=this.parent.toolbarItems.map(function(e){return e.name})),t},e.prototype.onClicked=function(e){var i=this;if(!t.isNullOrUndefined(e.item)&&e.item.id){var n,a=e.item.id.substr((this.parent.element.id+"_tb_").length);"refresh"===a||"newfolder"===a||"upload"===a?(n=[E(this.parent)],this.parent.itemData=n):(this.parent.notify("selected-data",{}),n=this.parent.itemData);var s={cancel:!1,fileDetails:n,item:e.item};this.parent.trigger("toolbarClick",s,function(s){var r,o;if(!s.cancel)switch(a){case"sortby":(o=t.closest(e.originalEvent.target,".e-toolbar-item"))&&o.classList.contains("e-toolbar-popup")&&(e.cancel=!0);break;case"newfolder":Se(i.parent);break;case"cut":M(i.parent);break;case"copy":P(i.parent);break;case"delete":for(var l=0;l<n.length;l++)if(!Ie(n[l]))return void be(i.parent,n[l],ca);mt(i.parent,"Delete");break;case"details":i.parent.notify(Wn,{}),r=i.parent.selectedItems,"navigationpane"===i.parent.activeModule&&(r=[]),Te(i.parent,r,i.parent.path,"details");break;case"paste":i.parent.folderPath="",G(i.parent);break;case"refresh":j(i.parent);break;case"download":fe(i.parent);break;case"rename":Ie(n[0])?(i.parent.notify(Yn,{}),mt(i.parent,"Rename")):be(i.parent,n[0],ca);break;case"upload":Ce(i.parent);break;case"selectall":i.parent.notify("select-all-init",{});break;case"selection":i.parent.notify("clear-all-init",{})}})}},e.prototype.toolbarCreateHandler=function(){var e=this;if(!t.isNullOrUndefined(t.select("#"+this.getId("SortBy"),this.parent.element))){var i=[{id:this.getPupupId("name"),text:B(this.parent,"Name"),iconCss:"name"===this.parent.sortBy?Bi:""},{id:this.getPupupId("size"),text:B(this.parent,"Size"),iconCss:"size"===this.parent.sortBy?Bi:""},{id:this.getPupupId("date"),text:B(this.parent,"DateModified"),iconCss:"_fm_modified"===this.parent.sortBy?Bi:""},{separator:!0},{id:this.getPupupId("ascending"),text:B(this.parent,"Ascending"),iconCss:"Ascending"===this.parent.sortOrder?Hi:""},{id:this.getPupupId("descending"),text:B(this.parent,"Descending"),iconCss:"Descending"===this.parent.sortOrder?Hi:""},{id:this.getPupupId("none"),text:B(this.parent,"None"),iconCss:"None"===this.parent.sortOrder?Hi:""}];this.buttonObj=new h.DropDownButton({items:i,cssClass:z(this.parent,Ti),select:q.bind(this,this.parent),enableHtmlSanitizer:this.parent.enableHtmlSanitizer,enableRtl:this.parent.enableRtl,iconCss:"e-icons e-fe-sort"}),this.buttonObj.isStringTemplate=!0,this.buttonObj.appendTo("#"+this.getId("SortBy"))}if(!t.isNullOrUndefined(t.select("#"+this.getId("View"),this.parent.element))){var n=[{id:this.getPupupId("large"),text:B(this.parent,"View-LargeIcons"),iconCss:"Details"===this.parent.view?"":Hi},{id:this.getPupupId("details"),text:B(this.parent,"View-Details"),iconCss:"Details"===this.parent.view?Hi:""}];this.layoutBtnObj=new h.DropDownButton({iconCss:"Details"===this.parent.view?mn:bn,cssClass:z(this.parent,"e-caret-hide "+Ti),items:n,select:this.layoutChange.bind(this),enableRtl:this.parent.enableRtl,content:'<span class="e-tbar-btn-text">'+B(this.parent,"View")+"</span>",beforeItemRender:function(t){var i=t.item.iconCss,n=t.item.text===B(e.parent,"View-LargeIcons"),a=i?" e-menu-icon "+i:"";t.element.innerHTML='<span class="'+a+'"></span>'+(n?'<span class="e-icons e-fe-large e-menu-icon"></span>':'<span class="e-icons e-fe-grid e-menu-icon"></span>')+t.item.text;var s=t.element.firstChild;s&&""===s.className&&t.element.removeChild(s)}}),this.layoutBtnObj.isStringTemplate=!0,this.layoutBtnObj.appendTo("#"+this.getId("View"))}this.hideItems(this.default,!0),this.hideStatus(),this.parent.portals&&this.toolbarObj.portals&&(this.parent.portals=this.parent.portals.concat(this.toolbarObj.portals),this.parent.renderReactTemplates());for(var a=t.selectAll(".e-btn",this.toolbarObj.element),s=0;s<a.length;s++)!function(e){a[e].onkeydown=function(e){13!==e.keyCode||e.target.classList.contains("e-fe-popup")||e.preventDefault()},a[e].onkeyup=function(t){13!==t.keyCode||t.target.classList.contains("e-fe-popup")||a[e].click()}}(s);this.parent.refreshLayout()},e.prototype.updateSortByButton=function(){if(this.buttonObj)for(var e=this.buttonObj.items,t=0;t<e.length;t++)e[t].id===this.getPupupId("name")?e[t].iconCss="name"===this.parent.sortBy?Bi:"":e[t].id===this.getPupupId("size")?e[t].iconCss="size"===this.parent.sortBy?Bi:"":e[t].id===this.getPupupId("date")?"dateModified"===this.parent.sortBy||"dateCreated"===this.parent.sortBy?e[t].iconCss=this.parent.sortBy===this.parent.sortBy?Bi:"":e[t].iconCss="_fm_modified"===this.parent.sortBy?Bi:"":e[t].id===this.getPupupId("ascending")?e[t].iconCss="Ascending"===this.parent.sortOrder?Hi:"":e[t].id===this.getPupupId("descending")?e[t].iconCss="Descending"===this.parent.sortOrder?Hi:"":e[t].id===this.getPupupId("none")&&(e[t].iconCss="None"===this.parent.sortOrder?Hi:"")},e.prototype.getPupupId=function(e){return this.parent.element.id+"_ddl_"+e.toLowerCase()},e.prototype.layoutChange=function(e){"Details"===this.parent.view?e.item.id===this.getPupupId("large")&&C(this.parent,"LargeIcons"):e.item.id===this.getPupupId("details")&&C(this.parent,"Details")},e.prototype.toolbarItemData=function(e){var t=[],i="Both";this.parent.isMobile&&(i="Overflow");for(var n=0;n<e.length;n++){var a=void 0,s=void 0;this.parent.toolbarItems.length>0&&(s=this.getItemModel(this.parent.toolbarItems[parseInt(n.toString(),10)]));var r=this.getId(e[n]),o=B(this.parent,e[n]),l=B(this.parent,"Tooltip-"+e[n]);switch(e[n]){case"|":a={type:"Separator"};break;case"Upload":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-upload",showTextOn:i};break;case"SortBy":var h='<span class="e-tbar-btn-text e-tbar-ddb-text">'+o+"</span>";s&&s.text&&(h='<span class="e-tbar-btn-text e-tbar-ddb-text">'+s.text+"</span>"),a={id:r,tooltipText:l,template:'<button id="'+r+'" class="e-tbar-btn e-tbtn-txt" tabindex="-1">'+h+"</button>"};break;case"Refresh":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-refresh",showTextOn:i};break;case"Selection":a={id:r,text:o,tooltipText:l,suffixIcon:"e-icons e-fe-clear",overflow:"Show",align:"Right"};break;case"View":var d=void 0;d=s&&s.text?s.text:B(this.parent,"View"),a={id:r,tooltipText:l,prefixIcon:"Details"===this.parent.view?mn:bn,overflow:"Show",align:"Right",text:o,showTextOn:"Overflow",template:'<button id="'+r+'" class="e-tbar-btn e-tbtn-txt" tabindex="-1" aria-label='+d+"></button>"};break;case"Details":a={id:r,tooltipText:l,prefixIcon:"e-icons e-fe-details",overflow:"Show",align:"Right",text:o,showTextOn:"Overflow"};break;case"NewFolder":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-newfolder",showTextOn:i};break;case"Cut":a={id:r,text:o,tooltipText:l,prefixIcon:gn,showTextOn:i};break;case"Copy":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-copy",showTextOn:i};break;case"Paste":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-paste",showTextOn:i};break;case"Delete":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-delete",showTextOn:i};break;case"Rename":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-rename",showTextOn:i};break;case"Download":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-download",showTextOn:i};break;case"SelectAll":a={id:r,text:o,tooltipText:l,prefixIcon:"e-icons e-fe-select",showTextOn:i};break;default:a={id:r,text:o,tooltipText:l,template:""}}if(this.parent.toolbarItems.length>0&&s){var c=Object.assign({},a,s);t.push(c)}else t.push(a)}return t},e.prototype.getItemModel=function(e){var t={};return e.id&&(t.id=e.id),e.text&&(t.text=e.text),e.tooltipText&&(t.tooltipText=e.tooltipText),e.prefixIcon&&(t.prefixIcon=e.prefixIcon),e.cssClass&&(t.cssClass=e.cssClass),"Both"!==e.showTextOn&&(t.showTextOn=e.showTextOn),e.template&&(t.template=e.template),e.disabled&&(t.disabled=e.disabled),"auto"!==e.width&&(t.width=e.width),e.suffixIcon&&(t.suffixIcon=e.suffixIcon),"Left"!==e.align&&(t.align=e.align),"None"!==e.overflow&&(t.overflow=e.overflow),e.htmlAttributes&&(t.htmlAttributes=e.htmlAttributes),"Button"!==e.type&&(t.type=e.type),!0!==e.visible&&(t.visible=e.visible),e.showAlwaysInPopup&&(t.showAlwaysInPopup=e.showAlwaysInPopup),-1!==e.tabIndex&&(t.tabIndex=e.tabIndex),t},e.prototype.getId=function(e){return this.parent.element.id+"_tb_"+e.toLowerCase()},e.prototype.addEventListener=function(){this.parent.on(Dn,this.onPropertyChanged,this),this.parent.on(Hn,this.onSelectionChanged,this),this.parent.on(zn,this.onLayoutChange,this),this.parent.on(Qn,this.showPaste,this),this.parent.on(Xn,this.hidePaste,this),this.parent.on(kn,this.destroy,this),this.parent.on(qn,this.updateSortByButton,this)},e.prototype.reRenderToolbar=function(e){var t=this,i=[];if(this.parent.toolbarItems.length>0?i=this.parent.toolbarItems.map(function(e){return e.name}):void 0!==e.newProp.toolbarSettings.items&&(i=e.newProp.toolbarSettings.items.map(function(e){return e.trim()})),i.length>0){this.items=this.toolbarItemData(this.getItems(i));var n={items:this.items};this.parent.trigger("toolbarCreate",n,function(e){t.buttonObj&&t.buttonObj.destroy(),t.layoutBtnObj&&t.layoutBtnObj.destroy(),t.items=e.items,t.toolbarObj.items=t.items,t.toolbarObj.dataBind(),t.toolbarCreateHandler()})}},e.prototype.onSelectionChanged=function(){this.hideStatus(),this.hideItems(this.single,!0),this.hideItems(this.selection,!1),1===this.parent.selectedItems.length?(this.hideItems(this.single,!1),this.hideItems(this.selection,!0)):this.parent.selectedItems.length>1&&(this.hideItems(this.multiple,!1),this.hideItems(this.selection,!0));var e=t.select("#"+this.getId("Selection"),this.toolbarObj.element);if(this.parent.selectedItems.length>0&&e&&!this.parent.enableVirtualization){var i=void 0;i=1===this.parent.selectedItems.length?this.parent.selectedItems.length+" "+B(this.parent,"Item-Selection"):this.parent.selectedItems.length+" "+B(this.parent,"Items-Selection"),t.select(".e-tbar-btn-text",e).textContent=i,this.toolbarObj.hideItem(e.parentElement,!1)}},e.prototype.hideItems=function(e,i){for(var n=0;n<e.length;n++){var a=t.select("#"+this.getId(e[n]),this.parent.element);a&&this.toolbarObj.hideItem(a.parentElement,i)}},e.prototype.hideStatus=function(){var e=t.select("#"+this.getId("Selection"),this.toolbarObj.element);e&&this.toolbarObj.hideItem(e.parentElement,!0)},e.prototype.showPaste=function(){this.hideItems(["Paste"],!1)},e.prototype.hidePaste=function(){this.hideItems(["Paste"],!0)},e.prototype.onLayoutChange=function(){if(this.layoutBtnObj){this.layoutBtnObj.iconCss="Details"===this.parent.view?mn:bn;for(var e=this.layoutBtnObj.items,t=0;t<e.length;t++)e[t].id===this.getPupupId("large")?e[t].iconCss="LargeIcons"===this.parent.view?Hi:"":e[t].id===this.getPupupId("details")&&(e[t].iconCss="Details"===this.parent.view?Hi:"")}},e.prototype.removeEventListener=function(){this.parent.off(Dn,this.onPropertyChanged),this.parent.off(Hn,this.onSelectionChanged),this.parent.off(zn,this.onLayoutChange),this.parent.off(Qn,this.showPaste),this.parent.off(Xn,this.hidePaste),this.parent.off(kn,this.destroy),this.parent.off(qn,this.updateSortByButton)},e.prototype.getModuleName=function(){return"toolbar"},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()||"common"===e.module)for(var t=0,i=Object.keys(e.newProp);t<i.length;t++)switch(i[t]){case"cssClass":this.buttonObj&&(this.buttonObj.cssClass=z(this.parent,Ti)),this.layoutBtnObj&&(this.layoutBtnObj.cssClass=z(this.parent,"e-caret-hide "+Ti));break;case"height":case"width":this.toolbarObj.refreshOverflow();break;case"toolbarSettings":case"toolbarItems":this.reRenderToolbar(e)}},e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),this.buttonObj&&this.buttonObj.destroy(),this.layoutBtnObj&&this.layoutBtnObj.destroy(),this.toolbarObj.destroy(),this.parent.refreshLayout())},e.prototype.enableItems=function(e,i){for(var n=0;n<e.length;n++){var a=t.select("#"+this.getId(e[n]),this.parent.element);a&&this.toolbarObj.enableItems(a.parentElement,i)}},e}(),Da=function(){function e(e){this.filemanagerInstance=e,this.largeIconInstance=e.largeiconsviewModule}return e.prototype.setUIVirtualization=function(){var e=this.largeIconInstance.items,i=e.slice(0,1),n=l.ListBase.createListFromJson(t.createElement,i,this.largeIconInstance.listObj);this.itemList=Array.prototype.slice.call(t.selectAll("."+Vi,n)),this.largeIconInstance.element.appendChild(n),0!==this.itemList.length&&this.largeIconInstance.element.querySelector("."+Xi)&&this.largeIconInstance.element.removeChild(this.largeIconInstance.element.querySelector("."+Xi)),this.itemCount=this.getItemCount(Object.keys(this.largeIconInstance.allItems).length),this.largeIconInstance.element.firstChild.remove(),this.largeIconInstance.items=e.slice(0,this.itemCount)},e.prototype.setUlElementHeight=function(){this.lastRowCount=(this.largeIconInstance.allItems.length-this.itemCount)%this.rowItemCount?(this.largeIconInstance.allItems.length-this.itemCount)%this.rowItemCount:this.rowItemCount,this.topElement=this.filemanagerInstance.createElement("div"),this.topElement.classList.add("e-virtual-top"),this.largeIconInstance.element.firstElementChild.insertBefore(this.topElement,this.largeIconInstance.element.firstElementChild.firstChild),this.bottomElement=this.filemanagerInstance.createElement("div"),this.bottomElement.classList.add("e-virtual-bottom"),this.largeIconInstance.element.firstElementChild.insertBefore(this.bottomElement,null);var e=parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue("margin-top"),10)+parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue("margin-bottom"),10);this.listItemHeight=this.largeIconInstance.itemList[0].getBoundingClientRect().height+e,this.totalHeight=Object.keys(this.largeIconInstance.allItems).length/this.rowItemCount*this.listItemHeight,this.topElement.style.height="0px",this.bottomElement.style.height=this.totalHeight+"px",this.topElementHeight=0,this.bottomElementHeight=this.totalHeight,this.listDiff=0,this.renderedCount=this.itemCount},e.prototype.getItemCount=function(e){var i=parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue("margin-right"),10)+parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue("margin-left"),10);this.rowItemCount=Math.floor(parseFloat(t.formatUnit(this.largeIconInstance.element.firstElementChild.clientWidth))/(this.itemList[0].offsetWidth+i));var n=this.rowItemCount*Math.round(parseFloat(t.formatUnit(this.largeIconInstance.element.clientHeight))/this.itemList[0].offsetHeight);return(n>e||0===n)&&(n=e),n},e.prototype.wireScrollEvent=function(e){e?t.EventHandler.remove(this.largeIconInstance.element.firstElementChild,"scroll",this.onVirtualUiScroll):t.EventHandler.add(this.largeIconInstance.element.firstElementChild,"scroll",this.onVirtualUiScroll,this)},e.prototype.onVirtualUiScroll=function(){var e;this.scrollPosition=t.isNullOrUndefined(this.scrollPosition)?0:this.scrollPosition;var i=this.getscrollerHeight(0);if(this.topElementHeight=this.listItemHeight*Math.floor(i/this.listItemHeight),this.bottomElementHeight=this.totalHeight-this.topElementHeight,e=i<=this.totalHeight?[this.topElementHeight,this.bottomElementHeight]:[this.totalHeight,0],this.topElementHeight=e[0],this.bottomElementHeight=e[1],this.topElementHeight!==parseFloat(this.topElement.style.height))if(this.topElement.style.height=this.topElementHeight+"px",this.bottomElement.style.height=this.bottomElementHeight+"px",i>this.scrollPosition){n=Math.round(this.topElementHeight/this.listItemHeight-this.listDiff);this.onNormalScroll(n,!0)}else{var n=Math.round(this.listDiff-this.topElementHeight/this.listItemHeight);this.onNormalScroll(n,!1)}this.listDiff=Math.round(this.topElementHeight/this.listItemHeight),this.scrollPosition=i,this.largeIconInstance.itemList=Array.prototype.slice.call(t.selectAll("."+Vi,this.largeIconInstance.element)),this.itemCount=this.itemCount!==this.largeIconInstance.itemList.length?this.largeIconInstance.itemList.length:this.itemCount,this.largeIconInstance.items=this.largeIconInstance.allItems.slice(this.renderedCount-this.itemCount,this.renderedCount)},e.prototype.getscrollerHeight=function(e){return this.largeIconInstance.element.firstElementChild.scrollTop-e<=0?0:this.largeIconInstance.element.firstElementChild.scrollTop-e},e.prototype.onNormalScroll=function(e,t){for(var i=0;i<e;i++)this.updateUI(t)},e.prototype.updateUI=function(e){var i=this;if(e){if(this.items=this.largeIconInstance.allItems.slice(this.renderedCount,this.renderedCount+this.rowItemCount),this.items.length>0){r=l.ListBase.createListFromJson(t.createElement,this.items,this.largeIconInstance.listObj);this.itemList=Array.prototype.slice.call(t.selectAll("."+Vi,r)),this.itemList.forEach(function(e){i.largeIconInstance.element.firstElementChild.insertBefore(e,i.bottomElement)}),this.renderedCount=this.largeIconInstance.allItems.length>=this.renderedCount+this.rowItemCount?this.renderedCount+this.rowItemCount:this.renderedCount+this.lastRowCount;for(h=0;h<this.rowItemCount;h++)t.detach(this.topElement.nextElementSibling)}}else{var n=void 0,a=void 0;this.renderedCount===this.largeIconInstance.allItems.length?(n=this.renderedCount-(this.itemCount-this.rowItemCount+this.lastRowCount),this.renderedCount=this.renderedCount-this.lastRowCount<this.itemCount?this.itemCount:this.renderedCount-this.lastRowCount,a=!0):(n=this.renderedCount-this.itemCount,this.renderedCount=this.renderedCount-this.rowItemCount<this.itemCount?this.itemCount:this.renderedCount-this.rowItemCount);var s=n-this.rowItemCount>0?n-this.rowItemCount:0;if(this.items=this.largeIconInstance.allItems.slice(s,n),this.items.length>0){var r=l.ListBase.createListFromJson(t.createElement,this.items,this.largeIconInstance.listObj);this.itemList=Array.prototype.slice.call(t.selectAll("."+Vi,r));for(var o=this.itemList.length;o>0;o--)this.largeIconInstance.element.firstElementChild.insertBefore(this.itemList[o-1],this.topElement.nextElementSibling);for(var h=0;h<(a?this.lastRowCount:this.rowItemCount);h++)t.detach(this.bottomElement.previousElementSibling)}}},e.prototype.getModuleName=function(){return"virtualization"},e.prototype.destroy=function(){this.filemanagerInstance.isDestroyed||t.isNullOrUndefined(this.largeIconInstance.element.firstElementChild)||this.wireScrollEvent(!0)},e}(),Sa=function(){function e(e){this.removeNodes=[],this.moveNames=[],this.previousSelected=[],this.isDrag=!1,this.isPathDragged=!1,this.isRenameParent=!1,this.isRightClick=!1,this.isSameNodeClicked=!1,this.isNodeExpandCalled=!1,this.renameParent=null,this.isNodeClickCalled=!1,this.restrictSelecting=!1,this.parent=e,this.addEventListener(),this.keyConfigs={altEnter:"alt+enter",esc:"escape",del:"delete",ctrlX:this.parent.isMac?"cmd+x":"ctrl+x",ctrlC:this.parent.isMac?"cmd+c":"ctrl+c",ctrlV:this.parent.isMac?"cmd+v":"ctrl+v",ctrlShiftN:"ctrl+shift+n",shiftF10:"shift+F10",f2:"f2"}}return e.prototype.onInit=function(){if(t.isNullOrUndefined(this.treeObj)){var e=t.getValue(this.parent.pathId[0],this.parent.feParent);t.setValue("_fm_icon","e-fe-folder",e);var i={},n=t.getValue("id",e);t.isNullOrUndefined(n)||t.setValue("data-id",n,i),Ie(e)||t.setValue("class",ve(e),i),t.isNullOrUndefined(i)||t.setValue("_fm_htmlAttr",i,e),this.treeObj=new d.TreeView({fields:{dataSource:[e],id:"_fm_id",parentID:"_fm_pId",expanded:"_fm_expanded",selected:"_fm_selected",text:"name",hasChildren:"hasChild",iconCss:"_fm_icon",htmlAttributes:"_fm_htmlAttr",tooltip:"name"},enableHtmlSanitizer:this.parent.enableHtmlSanitizer,sortOrder:this.parent.navigationPaneSettings.sortOrder,nodeSelecting:this.onNodeSelecting.bind(this),nodeSelected:this.onNodeSelected.bind(this),nodeExpanding:this.onNodeExpand.bind(this),nodeClicked:this.onNodeClicked.bind(this),allowEditing:!0,nodeEditing:this.onNodeEditing.bind(this),drawNode:this.onDrowNode.bind(this),enableRtl:this.parent.enableRtl,dataBound:this.addDragDrop.bind(this)}),this.treeObj.isStringTemplate=!0,this.treeObj.appendTo("#"+this.parent.element.id+"_tree"),this.wireEvents()}},e.prototype.addDragDrop=function(){var e=this;!this.parent.isMobile&&this.treeObj&&(this.parent.allowDragAndDrop&&t.isNullOrUndefined(this.dragObj)?this.dragObj=new t.Draggable(this.treeObj.element,{cursorAt:this.parent.dragCursorPosition,dragTarget:".e-fullrow",distance:5,dragArea:this.parent.element,drag:he.bind(this,this.parent),dragStart:function(t){ae(e.parent,t,e.dragObj)},dragStop:ne.bind(this,this.parent),enableTailMode:!0,enableAutoScroll:!1,helper:this.dragHelper.bind(this)}):!this.parent.allowDragAndDrop&&this.dragObj&&(this.dragObj.destroy(),this.dragObj=null))},e.prototype.dragHelper=function(e){var i=e.sender.target;if(!i.classList.contains("e-fullrow"))return null;var n=t.closest(i,"li");return this.parent.dragPath="",this.parent.dragData=[],this.parent.activeElements=[],this.parent.activeElements=[n],this.parent.dragNodes=[],w(this.parent,n),this.parent.dragData=this.getTreeData(n),this.parent.dragPath=this.getDragPath(n,this.parent.dragData[0].name),this.parent.dragNodes.push(this.parent.dragData[0].name),ie(this.parent),this.parent.virtualDragElement},e.prototype.getDragPath=function(e,t){return X(this.getDropPath(e,t))},e.prototype.getDropPath=function(e,t){var i=e.getAttribute("data-id");return u(e,this.parent.hasId?i:t,this.parent.hasId)},e.prototype.onDrowNode=function(e){var t={element:e.node,fileDetails:e.nodeData,module:"NavigationPane"};this.parent.trigger("fileLoad",t)},e.prototype.addChild=function(e,i,n){var a=V(e),s=this.getTreeData(i);if(a.length>0&&s.length>0&&(null==a[0].filterPath||t.isNullOrUndefined(s[0])&&null==s[0].filterPath||a[0].filterPath!==s[0].filterPath)){for(var r=0,o=a;r<a.length;){o[parseInt(r.toString(),10)]._fm_icon="e-fe-folder";var l={},h=t.getValue("id",o[r]);t.isNullOrUndefined(h)||t.setValue("data-id",h,l),Ie(o[r])||t.setValue("class",ve(o[r]),l),t.isNullOrUndefined(l)||t.setValue("_fm_htmlAttr",l,o[r]),r++}var d=t.select('[data-uid="'+i+'"]',this.treeObj.element),c=t.select("ul",d);t.isNullOrUndefined(c)&&this.treeObj.addNodes(a,i,null,n)}},e.prototype.onNodeSelecting=function(e){if(!e.isInteracted&&!this.isRightClick&&!this.isSameNodeClicked&&!this.isPathDragged&&!this.isRenameParent||this.restrictSelecting)return this.restrictSelecting=!1,void(this.isNodeClickCalled=!1);if(!this.renameParent){this.parent.activeModule="navigationpane";var i=this.getTreeData(t.getValue("id",e.nodeData));if(e.node.getAttribute("data-uid")!==this.parent.pathId[this.parent.pathId.length-1]&&!this.isRightClick&&!this.isNodeClickCalled||this.isSameNodeClicked||this.isPathDragged){if(this.isNodeClickCalled=!1,!this.isSameNodeClicked){this.isSameNodeClicked=!0;a={action:e.action,fileDetails:i[0],isInteracted:e.isInteracted};this.parent.trigger("fileSelect",a)}if(!this.isRightClick){var n={cancel:!1,fileDetails:i[0],module:"NavigationPane"};this.parent.trigger("fileOpen",n),e.cancel=n.cancel}e.cancel&&(this.restrictSelecting=!!this.isNodeClickCalled&&this.previousSelected[0]!==e.node.getAttribute("data-uid"),this.isNodeClickCalled=!0,this.isSameNodeClicked=!1,this.isPathDragged=!1,this.previousSelected=this.treeObj.selectedNodes,this.treeObj.setProperties({selectedNodes:[e.node.getAttribute("data-uid")]}))}else if(this.previousSelected[0]!==e.node.getAttribute("data-uid")){this.isSameNodeClicked=!0;var a={action:e.action,fileDetails:i[0],isInteracted:this.isNodeClickCalled};this.parent.trigger("fileSelect",a)}}},e.prototype.openFileOnContextMenuClick=function(e){var t=this.treeObj.getTreeData(e);this.parent.selectedItems=[],this.parent.itemData=t,this.activeNode=e,this.parent.activeModule="navigationpane";var i={cancel:!1,fileDetails:t[0],module:"NavigationPane"};this.parent.trigger("fileOpen",i),this.isNodeClickCalled=!0,i.cancel||(p(e,this.parent.itemData[0],this.parent),Ee(this.parent,this.isPathDragged?ea:Rn,this.parent.path),this.parent.visitedItem=e,this.isPathDragged=this.isRenameParent=this.isRightClick=!1,this.treeObj.setProperties({selectedNodes:[e.getAttribute("data-uid")]}))},e.prototype.onNodeSelected=function(e){if(this.parent.breadcrumbbarModule&&this.parent.breadcrumbbarModule.searchObj&&!this.renameParent&&(this.parent.breadcrumbbarModule.searchObj.element.value="",this.parent.isFiltered=!1,this.isNodeClickCalled=!1),this.parent.searchedItems=[],!(e.isInteracted||this.isRightClick||this.isSameNodeClicked||this.isPathDragged||this.isRenameParent))return void(this.parent.pathId=f(e.node));this.activeNode=e.node,this.parent.activeModule="navigationpane";var i=this.getTreeData(t.getValue("id",e.nodeData));this.parent.selectedItems=[],this.parent.itemData=i;var n=this.parent.path;!this.isRightClick&&this.isSameNodeClicked?p(e.node,this.parent.itemData[0],this.parent):(this.parent.pathId=f(e.node),this.parent.visitedItem=e.node),e.node.querySelector(".e-icons")&&null===e.node.querySelector("."+Vi)&&(this.expandNodeTarget="add"),n!==this.parent.path&&(!this.isRightClick&&this.isSameNodeClicked&&(Ee(this.parent,this.isPathDragged?ea:Rn,this.parent.path),this.isNodeClickCalled=!0),this.parent.visitedItem=e.node),this.isPathDragged=this.isRenameParent=this.isRightClick=this.isSameNodeClicked=!1},e.prototype.onPathDrag=function(e){this.isPathDragged=!0,this.selectResultNode(e[0])},e.prototype.onNodeExpand=function(e){if((e.isInteracted||this.isDrag)&&null===e.node.querySelector("."+Vi)){this.isNodeExpandCalled=!0;var i=t.getValue("text",e.nodeData),n=e.node.getAttribute("data-id"),a=!t.isNullOrUndefined(n),s=t.isNullOrUndefined(n)?i:n,r=u(e.node,s,a);this.expandNodeTarget=e.node.getAttribute("data-uid"),this.parent.expandedId=this.expandNodeTarget,this.parent.itemData=this.getTreeData(t.getValue("id",e.nodeData)),this.parent.pathId.push(t.getValue("id",e.nodeData)),Ee(this.parent,"node-expand",r)}},e.prototype.onNodeExpanded=function(e){this.addChild(e.files,this.expandNodeTarget,!1),this.parent.expandedId=null,this.isNodeExpandCalled=!1},e.prototype.onNodeClicked=function(e){if(this.parent.activeModule="navigationpane",this.previousSelected=this.treeObj.selectedNodes,this.activeNode=e.node,3===e.event.which&&e.node.getAttribute("data-uid")!==this.treeObj.selectedNodes[0])this.isRightClick=!0,this.isNodeClickCalled=!0,this.treeObj.setProperties({selectedNodes:[e.node.getAttribute("data-uid")]});else if(e.node.getAttribute("data-uid")===this.treeObj.selectedNodes[0]&&0!==this.parent.selectedItems.length){this.parent.setProperties({selectedItems:[]},!0);var t="LargeIcons"===this.parent.view?"largeiconsview":"detailsview";this.parent.notify(Dn,{module:t,newProp:{selectedItems:[]}})}else e.node.getAttribute("data-uid")!==this.treeObj.selectedNodes[0]||this.isNodeClickCalled||this.isNodeExpandCalled||(3===e.event.which&&(this.isRightClick=!0),this.isSameNodeClicked=!0,this.isNodeClickCalled=!0)},e.prototype.onNodeEditing=function(e){t.isNullOrUndefined(e.innerHtml)||(e.cancel=!0)},e.prototype.onPathChanged=function(e){this.parent.isCut=!1;var i=t.getValue(this.parent.pathId[this.parent.pathId.length-1],this.parent.feFiles);if("add"===this.expandNodeTarget){var n=t.select('[data-uid="'+this.treeObj.selectedNodes[0]+'"]',this.treeObj.element),a=t.isNullOrUndefined(n)?null:t.select(".e-list-parent",n);t.isNullOrUndefined(a)&&this.addChild(e.files,this.treeObj.selectedNodes[0],!0),this.expandNodeTarget=""}t.isNullOrUndefined(i)&&t.setValue(this.parent.pathId[this.parent.pathId.length-1],e.files,this.parent.feFiles),this.parent.uploadObj.directoryUpload&&!this.parent.hasId&&this.updateTree(e)},e.prototype.updateTree=function(e){if(this.treeObj){var t=this.treeObj.selectedNodes[0];this.updateTreeNode(e,t)}},e.prototype.updateTreeNode=function(e,t){var i=-1!==this.treeObj.expandedNodes.indexOf(t);this.removeChildNodes(t),this.addChild(e.files,t,!i)},e.prototype.removeChildNodes=function(e){var i=t.select('[data-uid="'+e+'"]',this.treeObj.element),n=t.select(".e-list-parent",i),a=n?Array.prototype.slice.call(n.children):null;a&&this.treeObj.removeNodes(a)},e.prototype.onOpenEnd=function(e){var t=this.parent.pathId[this.parent.pathId.length-1];this.treeObj.expandAll(this.treeObj.selectedNodes),this.treeObj.setProperties({selectedNodes:[t]}),this.expandNodeTarget="add",this.onPathChanged(e)},e.prototype.onOpenInit=function(e){"navigationpane"===this.parent.activeModule&&e.target.querySelector(".e-icons")&&this.treeObj.expandAll(this.treeObj.selectedNodes)},e.prototype.onInitialEnd=function(e){this.onInit(),this.addChild(e.files,t.getValue("_fm_id",e.cwd),!1)},e.prototype.onFinalizeEnd=function(e){this.onInit();var i=t.getValue("_fm_id",e.cwd);this.addChild(e.files,i,!1),this.treeObj.setProperties({selectedNodes:[this.parent.pathId[this.parent.pathId.length-1]]})},e.prototype.onCreateEnd=function(e){this.updateTree(e)},e.prototype.onSelectedData=function(){"navigationpane"===this.parent.activeModule&&this.updateItemData()},e.prototype.onDeleteInit=function(){if("navigationpane"===this.parent.activeModule){this.updateActionData();var e=t.getValue("name",this.parent.itemData[0]);Le(this.parent,[e],this.parent.path,"delete")}},e.prototype.onDeleteEnd=function(e){if("navigationpane"===this.parent.activeModule){var i=this.treeObj.selectedNodes[0],n=t.select('[data-uid="'+i+'"]',this.treeObj.element),a=t.closest(n,".e-list-parent").parentElement;this.treeObj.selectedNodes=[a.getAttribute("data-uid")],this.treeObj.dataBind()}this.updateTree(e)},e.prototype.onRefreshEnd=function(e){this.updateTree(e)},e.prototype.onRenameInit=function(){"navigationpane"===this.parent.activeModule&&this.updateRenameData()},e.prototype.onRenameEndParent=function(e){var i=this.renameParent?this.renameParent:this.parent.pathId[this.parent.pathId.length-1];if(this.updateTreeNode(e,i),this.parent.expandedId=null,this.renameParent)this.renameParent=null;else{var n=[];if(this.parent.hasId)n=new a.DataManager(this.treeObj.getTreeData()).executeLocal((new a.Query).where("id","equal",this.parent.renamedId,!1));else{var s=new a.DataManager(this.treeObj.getTreeData()).executeLocal((new a.Query).where(this.treeObj.fields.text,"equal",this.parent.renameText,!1));s.length>0&&(n=new a.DataManager(s).executeLocal((new a.Query).where("_fm_pId","equal",i,!1)))}if(n.length>0){var r=this.previousSelected.length>0&&0!==this.treeObj.getTreeData(this.previousSelected[0]).length?this.previousSelected[0]:t.getValue(this.treeObj.fields.id,n[0]);this.treeObj.selectedNodes=[r],this.treeObj.dataBind(),this.updateItemData()}}},e.prototype.onRenameEnd=function(e){if(""!==this.parent.breadcrumbbarModule.searchObj.element.value||this.parent.isFiltered){var i=this.treeObj.getTreeData(),n=[];if(this.parent.hasId)n=new a.DataManager(i).executeLocal((new a.Query).where("id","equal",this.parent.renamedId,!1));else{var s=new a.DataManager(i).executeLocal((new a.Query).where(this.treeObj.fields.text,"equal",this.parent.currentItemText,!1));s.length>0&&(n=new a.DataManager(s).executeLocal((new a.Query).where("filterPath","equal",this.parent.filterPath,!1)))}n.length>0&&(this.renameParent=t.getValue(this.treeObj.fields.parentID,n[0]),this.parent.expandedId=this.renameParent,this.parent.itemData=this.getTreeData(this.renameParent),Ee(this.parent,Gn,this.parent.filterPath.replace(/\\/g,"/")))}else this.updateTree(e)},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()||"common"===e.module)for(var t=0,i=Object.keys(e.newProp);t<i.length;t++)switch(i[t]){case"allowDragAndDrop":this.addDragDrop();break;case"navigationPaneSettings":Ee(this.parent,Cn,this.parent.path),e.oldProp.navigationPaneSettings.sortOrder!==e.newProp.navigationPaneSettings.sortOrder&&(this.treeObj.sortOrder=e.newProp.navigationPaneSettings.sortOrder)}},e.prototype.onDownLoadInit=function(){this.doDownload()},e.prototype.onSelectionChanged=function(e){this.treeObj.setProperties({selectedNodes:[e.selectedNode]})},e.prototype.onClearPathInit=function(e){this.removeChildNodes(e.selectedNode)},e.prototype.onDragEnd=function(e){if(Ae(this.parent)){this.moveNames=[];for(var i=this.parent.dragData,n=0;n<i.length;n++)!1===t.getValue("isFile",i[n])&&this.moveNames.push(t.getValue("_fm_id",i[n]))}var a=[];a=this.parent.isPasteError||this.parent.isSearchDrag?this.getMoveNames(e.files,this.parent.isSearchDrag,this.parent.dragPath):this.moveNames,this.treeObj.removeNodes(a)},e.prototype.getMoveNames=function(e,i,n){for(var s=[],r=0;r<e.length;r++)if(!e[r].isFile&&!this.parent.hasId){var o=e[r].previousName;if(i){var l=(n+=e[r].previousName).lastIndexOf("/");o=n.substring(l+1),n=n.substring(0,l+1)}for(var h=new a.DataManager(this.treeObj.getTreeData()).executeLocal((new a.Query).where(this.treeObj.fields.text,"equal",o,!1)),d=0;d<h.length;d++){var c=t.getValue("filterPath",h[d]);if((c=c.replace(/\\/g,"/"))===n){s.push(t.getValue(this.treeObj.fields.id,h[d]));break}}}return s},e.prototype.onCutEnd=function(e){var t=[];this.parent.isPasteError||this.parent.isSearchCut?this.moveNames=this.getMoveNames(e.files,this.parent.isSearchCut,this.parent.targetPath):t=this.moveNames,this.treeObj.removeNodes(t)},e.prototype.selectResultNode=function(e){if(this.parent.hasId){var i=this.treeObj.getTreeData().filter(function(t){return t.name===e.name})[0];this.treeObj.selectedNodes=[t.getValue("_fm_id",i)],this.treeObj.dataBind()}else{var n=t.getValue("filterPath",e),s=t.getValue("name",e),r=new a.DataManager(this.treeObj.getTreeData()).executeLocal((new a.Query).where(this.treeObj.fields.text,"equal",s,!1));if(r.length>0){var o=new a.DataManager(r).executeLocal((new a.Query).where("filterPath","equal",n,!1));if(o.length>0){var l=t.getValue(this.treeObj.fields.id,o[0]);this.treeObj.selectedNodes=[l],this.treeObj.dataBind()}}}},e.prototype.onDropPath=function(e){this.onpasteEnd(e),this.selectResultNode(this.parent.dropData),this.parent.isDropEnd=!this.parent.isPasteError},e.prototype.onpasteEnd=function(e){var i=[];if(this.parent.hasId)i=new a.DataManager(this.treeObj.getTreeData()).executeLocal((new a.Query).where("id","equal",t.getValue("id",e.cwd),!1));else{var n=new a.DataManager(this.treeObj.getTreeData()).executeLocal((new a.Query).where(this.treeObj.fields.text,"equal",t.getValue("name",e.cwd),!1));n.length>0&&(i=new a.DataManager(n).executeLocal((new a.Query).where("filterPath","equal",t.getValue("filterPath",e.cwd),!1)))}if(i.length>0){var s=t.getValue(this.treeObj.fields.id,i[0]),r=-1===this.treeObj.expandedNodes.indexOf(s);this.removeChildNodes(s),this.addChild(e.files,s,r)}this.parent.expandedId=null,this.onPathChanged(e),this.parent.isDragDrop&&this.checkDropPath(e)},e.prototype.checkDropPath=function(e){(!Ae(this.parent)||this.parent.path!==this.parent.dropPath&&"navigationpane"!==this.parent.targetModule)&&(-1===this.parent.dropPath.indexOf($(this.parent,e))?(this.parent.isDropEnd=!1,ee(this.parent)):this.parent.isDropEnd=!this.parent.isPasteError)},e.prototype.onpasteInit=function(){this.parent.activeModule===this.getModuleName()&&this.updateItemData(),this.moveNames=[];for(var e=this.parent.isDragDrop?this.parent.dragData:this.parent.actionRecords,i=0;i<e.length;i++)!1===t.getValue("isFile",e[i])&&this.moveNames.push(t.getValue("_fm_id",e[i]))},e.prototype.oncutCopyInit=function(){this.parent.activeModule===this.getModuleName()&&(this.parent.activeRecords=this.getTreeData(this.treeObj.selectedNodes[0]),this.parent.activeElements=[this.activeNode])},e.prototype.addEventListener=function(){this.parent.on(Dn,this.onPropertyChanged,this),this.parent.on("download-init",this.onDownLoadInit,this),this.parent.on(Sn,this.onInitialEnd,this),this.parent.on(Cn,this.onFinalizeEnd,this),this.parent.on(Rn,this.onPathChanged,this),this.parent.on(ea,this.onpasteEnd,this),this.parent.on(ta,this.onCutEnd,this),this.parent.on(Zn,this.onpasteInit,this),this.parent.on("node-expand",this.onNodeExpanded,this),this.parent.on(xn,this.onCreateEnd,this),this.parent.on("selected-data",this.onSelectedData,this),this.parent.on(Nn,this.onDeleteInit,this),this.parent.on(En,this.onDeleteEnd,this),this.parent.on(Pn,this.onRefreshEnd,this),this.parent.on("update-tree-selection",this.onSelectionChanged,this),this.parent.on(Vn,this.onOpenInit,this),this.parent.on(_n,this.onOpenEnd,this),this.parent.on(kn,this.destroy,this),this.parent.on(Yn,this.onRenameInit,this),this.parent.on(Jn,this.onRenameEnd,this),this.parent.on(Gn,this.onRenameEndParent,this),this.parent.on(Bn,this.onClearPathInit,this),this.parent.on($n,this.oncutCopyInit,this),this.parent.on(sa,this.onDropInit,this),this.parent.on(Kn,this.onMenuItemData,this),this.parent.on(ra,this.onDragEnd,this),this.parent.on(la,this.onDragging,this),this.parent.on(oa,this.onDropPath,this),this.parent.on(Wn,this.onDetailsInit,this),this.parent.on(jn,this.onPathDrag,this)},e.prototype.removeEventListener=function(){this.parent.off(Sn,this.onInitialEnd),this.parent.off("download-init",this.onDownLoadInit),this.parent.off(Cn,this.onFinalizeEnd),this.parent.off("selected-data",this.onSelectedData),this.parent.off(Dn,this.onPropertyChanged),this.parent.off(Rn,this.onPathChanged),this.parent.off(ea,this.onpasteEnd),this.parent.off(ta,this.onCutEnd),this.parent.off(Zn,this.onpasteInit),this.parent.off("update-tree-selection",this.onSelectionChanged),this.parent.off("node-expand",this.onNodeExpanded),this.parent.off(xn,this.onCreateEnd),this.parent.off(Pn,this.onRefreshEnd),this.parent.off(Vn,this.onOpenInit),this.parent.off(_n,this.onOpenEnd),this.parent.off(kn,this.destroy),this.parent.off(Yn,this.onRenameInit),this.parent.off(Jn,this.onRenameEnd),this.parent.off(Gn,this.onRenameEndParent),this.parent.off(Bn,this.onClearPathInit),this.parent.off(Nn,this.onDeleteInit),this.parent.off(En,this.onDeleteEnd),this.parent.off($n,this.oncutCopyInit),this.parent.off(sa,this.onDropInit),this.parent.off(ra,this.onDragEnd),this.parent.off(la,this.onDragging),this.parent.off(oa,this.onDropPath),this.parent.off(Wn,this.onDetailsInit),this.parent.off(Kn,this.onMenuItemData),this.parent.off(jn,this.onPathDrag)},e.prototype.onDetailsInit=function(){if(this.parent.activeModule===this.getModuleName()){var e=this.getTreeData(this.treeObj.selectedNodes[0]);this.parent.itemData=e}},e.prototype.onMenuItemData=function(e){if(this.parent.activeModule===this.getModuleName()){var i=t.closest(e.target,"li");this.parent.itemData=this.getTreeData(i.getAttribute("data-uid"))}},e.prototype.onDragging=function(e){var i=t.closest(e.target,"li");if(i.classList.contains("e-node-collapsed")){this.isDrag=!0;var n=parseInt(i.getAttribute("aria-level"),10);this.treeObj.expandAll([i.getAttribute("data-uid")],n+1),this.isDrag=!1}},e.prototype.onDropInit=function(e){if(this.parent.targetModule===this.getModuleName()){var i=t.closest(e.target,"li");this.parent.dropData=this.getTreeData(i)[0],this.parent.dropPath=this.getDropPath(i,t.getValue("name",this.parent.dropData))}},e.prototype.getModuleName=function(){return"navigationpane"},e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),this.treeObj&&(this.unWireEvents(),this.treeObj.destroy()))},e.prototype.wireEvents=function(){this.keyboardModule=new t.KeyboardEvents(this.treeObj.element,{keyAction:this.keyDown.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},e.prototype.unWireEvents=function(){this.keyboardModule.destroy()},e.prototype.keyDown=function(e){switch(e.action){case"altEnter":this.parent.notify(Wn,{}),Te(this.parent,[],this.parent.path,"details");break;case"esc":v(this.parent);break;case"del":this.parent.pathId[0]!==this.activeNode.getAttribute("data-uid")&&(this.updateItemData(),Ie(this.parent.itemData[0])?(this.removeNodes=[],mt(this.parent,"Delete")):be(this.parent,this.parent.itemData[0],ca));break;case"ctrlC":P(this.parent);break;case"ctrlV":this.parent.folderPath="",G(this.parent);break;case"ctrlX":M(this.parent);break;case"shiftF10":if(this.updateItemData(),!De(this.parent.itemData[0]))return void be(this.parent,this.parent.itemData[0],fa);0!==this.parent.selectedItems.length&&this.doDownload();break;case"f2":if(0===this.parent.selectedItems.length){var t=this.getTreeData(this.treeObj.selectedNodes[0])[0];Ie(t)?(this.updateRenameData(),mt(this.parent,"Rename")):be(this.parent,t,ca)}}},e.prototype.getTreeData=function(e){for(var i=this.treeObj.getTreeData(e),n=0;n<i.length;n++)t.isNullOrUndefined(t.getValue("hasChild",i[n]))&&t.setValue("hasChild",!1,i[n]);return i},e.prototype.updateRenameData=function(){this.updateItemData(),this.parent.currentItemText=t.getValue("name",this.parent.itemData[0])},e.prototype.updateItemData=function(){var e=this.getTreeData(this.treeObj.selectedNodes[0])[0];this.parent.itemData=[e],this.parent.isFile=!1},e.prototype.updateActionData=function(){this.updateItemData(),p(t.select('[data-uid="'+this.parent.pathId[this.parent.pathId.length-1]+'"]',this.treeObj.element),this.parent.itemData[0],this.parent);var e=X(this.parent.path);this.parent.setProperties({path:e},!0),this.parent.pathId.pop(),this.parent.pathNames.pop()},e.prototype.doDownload=function(){var e=X(this.parent.path),i=this.treeObj.selectedNodes[0]===this.parent.pathId[0]?"":t.getValue("name",this.parent.itemData[0]);pt(this.parent,e,[i])},e}(),Ca=function(){function e(e){this.isInteracted=!0,this.interaction=!0,this.isPasteOperation=!1,this.isColumnRefresh=!1,this.dragObj=null,this.startIndex=null,this.firstItemIndex=null,this.isSelectionUpdate=!1,this.currentSelectedItem=[],this.count=0,this.isRendered=!0,this.isLoaded=!1,this.isNameWidth=!1,this.isMultiSelect=!1,this.pasteOperation=!1,this.uploadOperation=!1,s.Grid.Inject(s.Resize,s.ContextMenu,s.Sort,s.VirtualScroll),this.parent=e,this.element=t.select("#"+this.parent.element.id+Ci,this.parent.element),this.addEventListener(),this.keyConfigs={altEnter:"alt+enter",esc:"escape",tab:"tab",moveDown:"downarrow",ctrlEnd:"ctrl+end",ctrlHome:"ctrl+home",ctrlDown:"ctrl+downarrow",ctrlLeft:"ctrl+leftarrow",ctrlRight:"ctrl+rightarrow",shiftEnd:"shift+end",shiftHome:"shift+home",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",ctrlUp:"ctrl+uparrow",csEnd:"ctrl+shift+end",csHome:"ctrl+shift+home",csDown:"ctrl+shift+downarrow",csUp:"ctrl+shift+uparrow",space:"space",ctrlSpace:"ctrl+space",shiftSpace:"shift+space",csSpace:"ctrl+shift+space",end:"end",home:"home",moveUp:"uparrow",del:"delete",ctrlX:this.parent.isMac?"cmd+x":"ctrl+x",ctrlC:this.parent.isMac?"cmd+c":"ctrl+c",ctrlV:this.parent.isMac?"cmd+v":"ctrl+v",ctrlShiftN:"ctrl+shift+n",shiftdel:"shift+delete",ctrlD:"ctrl+d",f2:"f2",ctrlA:"ctrl+a",enter:"enter",back:"backspace"}}return e.prototype.render=function(e){var i=this;if(this.parent.enablePersistence){var a=window.localStorage.getItem("grid"+this.parent.element.id+"_grid");if(!t.isNullOrUndefined(a)){var r=JSON.parse(a);!t.isNullOrUndefined(r)&&Object.keys(r).length>0&&"sortSettings"in r&&(delete r.sortSettings,window.localStorage.setItem("grid"+this.parent.element.id+"_grid",JSON.stringify(r)))}}if(n.showSpinner(this.parent.element),"Details"===this.parent.view){t.removeClass([this.parent.element],"e-fe-m-select");var o=A(this.parent,e.files);this.checkNameWidth();var l=this.getColumns(),h=void 0,d=!t.isNullOrUndefined(l)&&-1!==l.findIndex(function(e){return e.field===i.parent.sortBy});this.parent.isMobile||!d?h=[]:"None"!==this.parent.sortOrder&&(h=[{direction:this.parent.sortOrder,field:this.parent.sortBy}]),this.gridObj=new s.Grid({dataSource:o,allowSorting:!0,rowSelecting:this.onSelection.bind(this,"select"),rowDeselecting:this.onSelection.bind(this,"unselect"),rowSelected:this.onSelected.bind(this),rowDeselected:this.onDeSelection.bind(this),allowResizing:this.parent.detailsViewSettings.columnResizing,selectionSettings:{type:this.parent.allowMultiSelection?"Multiple":"Single",checkboxMode:"ResetOnRowClick"},enableRtl:this.parent.enableRtl,pageSettings:{pageSize:20},enableVirtualization:this.parent.enableVirtualization,enablePersistence:this.parent.enablePersistence,enableVirtualMaskRow:!0,sortSettings:{allowUnsort:!1,columns:h},columns:l,recordDoubleClick:this.DblClickEvents.bind(this),beforeDataBound:this.onBeforeDataBound.bind(this),dataBound:this.onDataBound.bind(this),rowDataBound:this.onRowDataBound.bind(this),actionBegin:this.onActionBegin.bind(this),headerCellInfo:this.onHeaderCellInfo.bind(this),width:"100%",height:this.parent.enableVirtualization?this.getGridHeight():"auto",beforeCopy:function(e){e.cancel=!0},load:function(){this.focusModule.destroy()},locale:this.parent.locale}),this.parent.isReact&&(this.gridObj.isReact=!0,this.gridObj.portals=[],this.gridObj.on("reactTemplateRender",this.reactTemplateRender,this)),this.gridObj.isStringTemplate=!0,this.gridObj.appendTo("#"+this.parent.element.id+Ci),0!==this.parent.selectedItems.length&&this.parent.enableVirtualization&&this.parent.enablePersistence&&(this.isLoaded=!0),this.wireEvents(),this.adjustHeight(),this.emptyArgs=e}},e.prototype.reactTemplateRender=function(e){this.parent.portals=e,this.parent.portals&&this.parent.toolbarModule&&this.parent.toolbarModule.toolbarObj&&this.parent.toolbarModule.toolbarObj.portals&&(this.parent.portals=this.parent.portals.concat(this.parent.toolbarModule.toolbarObj.portals)),this.parent.notify("renderReactTemplate",this.parent.portals),this.parent.renderReactTemplates()},e.prototype.getGridHeight=function(){var e=t.select("#"+this.parent.element.id+Pi,this.parent.element),i=t.select("#"+this.parent.element.id+Mi,this.parent.element);return e.offsetHeight-i.offsetHeight-36},e.prototype.checkNameWidth=function(){var e=this.parent.detailsViewSettings.columns;this.isNameWidth=!1;for(var i=0;i<e.length;i++)if("name"===e[i].field)return void(this.isNameWidth=!t.isNullOrUndefined(e[i].width))},e.prototype.adjustWidth=function(e,t){if(!this.isNameWidth||"name"!==t)for(var i=0;i<e.length;i++)if(e[i].field===t){var n=void 0;n=""!==this.parent.breadcrumbbarModule.searchObj.element.value||this.parent.isFiltered?this.element.clientWidth<=680?"name"===t?"120px":"180px":"auto":this.element.clientWidth<=500?"120px":"auto",e[i].width=n}},e.prototype.getColumns=function(){var e,i=this.parent.enableHtmlSanitizer;if(this.parent.isMobile)e=[{field:"name",headerText:B(this.parent,"Name"),width:"auto",minWidth:120,headerTextAlign:"Left",template:t.initializeCSPTemplate(function(e){return'<div class="e-fe-text">'+(i?t.SanitizeHtmlHelper.sanitize(e.name):e.name)+'</div><div class="e-fe-date">'+e._fm_modified+'</div><span class="e-fe-size">'+e.size+"</span>"})}];else{e=t.extend([],this.parent.detailsViewSettings.columns,null,!0),this.adjustWidth(e,"name");for(var n=this,a=0,s=e.length;a<s;a++)!function(a,s){if(e[a].headerText=B(n.parent,e[a].headerText),"name"===e[a].field&&!t.isNullOrUndefined(e[a].template)&&"function"!=typeof e[a].template){var r=e[a].template;e[a].template=t.initializeCSPTemplate(function(e){var n=i?t.SanitizeHtmlHelper.sanitize(e.name):e.name;return r.replace(/\${name}/g,n)})}}(a)}var r=this.parent.isMobile||this.parent.isBigger?"54":"46",o={field:"type",width:r,minWidth:r,template:t.initializeCSPTemplate(function(e){return'<span class="e-fe-icon '+e._fm_iconClass+'"></span>'}),allowResizing:!1,allowSorting:!0,customAttributes:{class:"e-fe-grid-icon"},headerTemplate:t.initializeCSPTemplate(function(){return"<span class='e-fe-icon e-fe-folder'></span>"})};if(e.unshift(o),this.parent.showItemCheckBoxes){var l=this.parent.isBigger?"36":"26",h={type:"checkbox",width:l,minWidth:l,customAttributes:{class:"e-fe-checkbox"},allowResizing:!1,allowSorting:!1};this.parent.isMobile?e.push(h):e.unshift(h)}for(var a=0,s=e.length;a<s;a++)e[a].disableHtmlEncode=!this.parent.enableHtmlSanitizer;if(this.parent.enableRangeSelection){var d={field:"name",visible:!1,customAttributes:{class:"e-drag-text"}};e.push(d)}return e},e.prototype.adjustHeight=function(){if(this.gridObj){var e=t.select("#"+this.parent.element.id+Pi,this.parent.element),i=t.select("#"+this.parent.element.id+Mi,this.parent.element),n=t.select("."+dn,this.parent.element),a=e.offsetHeight-i.offsetHeight-n.offsetHeight;this.gridObj.height=a,this.gridObj.dataBind()}},e.prototype.renderCheckBox=function(){this.gridObj.columns=this.getColumns(),this.isColumnRefresh=!0,this.gridObj.refreshColumns()},e.prototype.onRowDataBound=function(e){var i=t.select(".e-fe-grid-name",e.row);if(!i)for(var n=this.parent.detailsViewSettings.columns,a=0;a<n.length;a++)if("name"===n[a].field){i=e.row.children[this.parent.allowMultiSelection?a+2:a+1];break}if(i&&i.setAttribute("title",t.getValue("name",e.data)),this.parent.isLayoutChange&&this.parent.isCut&&"move"===this.parent.fileAction&&this.parent.selectedNodes&&0!==this.parent.selectedNodes.length&&-1!==this.parent.selectedNodes.indexOf(t.getValue("name",e.data))&&I(e.row),!this.parent.showFileExtension&&t.getValue("isFile",e.data)){var s=t.getValue("name",e.data),r=e.row.querySelector('[title= "'+s+'"]');if(r){var o=t.getValue("name",e.data),l=t.getValue("type",e.data);-1!==o.indexOf(l)&&(r.innerHTML=o.substr(0,o.length-l.length))}}if(void 0!==t.getValue("size",e.data)&&e.row.querySelector(".e-fe-size")){var h=e.row.querySelector(".e-fe-size"),d=void 0;if(t.getValue("isFile",e.data)){for(var c=t.getValue("size",e.data),p=new t.Internationalization(this.parent.locale),u=void 0,n=this.parent.detailsViewSettings.columns,a=0;a<n.length;a++)if("size"===n[a].field){u=t.isNullOrUndefined(n[a].format)?"n":n[a].format.toString();break}d=p.formatNumber(c/1024,{format:u})+" "+B(this.parent,"KB")}else d="";h.innerHTML=d}if(this.parent.isMobile&&void 0!==t.getValue("_fm_modified",e.data)&&e.row.querySelector(".e-fe-date")){for(var f=e.row.querySelector(".e-fe-date"),p=new t.Internationalization(this.parent.locale),n=this.parent.detailsViewSettings.columns,g=void 0,a=0;a<n.length;a++)if("dateModified"===n[a].field){g=n[a].format;break}var m=p.formatDate(new Date(t.getValue("_fm_modified",e.data)),g);f.innerHTML=m}var b=e.row.querySelector("."+Ji);b&&b.classList.add("e-small"),Ie(e.data)||(e.row.className+=" "+ve(e.data));var v={element:e.row,fileDetails:e.data,module:"DetailsView"};this.parent.trigger("fileLoad",v)},e.prototype.onActionBegin=function(e){if("sorting"===e.requestType){if(this.parent.setProperties({sortOrder:e.direction},!0),this.parent.setProperties({sortBy:e.columnName},!0),0!==this.parent.selectedItems.length){this.sortItem=!0;var i=this.gridObj.getSelectedRowIndexes(),n=i.length;for(this.sortSelectedNodes=[];n>0;){var a=this.gridObj.getRowsObject()[i[n-1]].data;this.sortSelectedNodes.push(t.getValue(this.parent.hasId?"id":"name",a)),n--}}this.parent.notify(qn,{})}},e.prototype.onHeaderCellInfo=function(e){var t=e.node.querySelector("."+Ji);t&&t.classList.add("e-small")},e.prototype.onBeforeDataBound=function(e){var t=this;n.showSpinner(this.parent.element);var i=this.parent.detailsViewSettings.columns.find(function(e){return e.field===t.parent.sortBy});if(i&&!("sortComparer"in i)){var a=A(this.parent,this.parent.enableVirtualization?e.result:this.gridObj.dataSource);e.result=a}},e.prototype.onDataBound=function(){if(this.createDragObj(),(0!==this.parent.selectedItems.length&&!this.parent.enableVirtualization||this.isLoaded)&&this.selectRecords(this.parent.selectedItems),!0===this.isPasteOperation&&!t.isNullOrUndefined(this.gridObj.getDataRows())&&this.gridObj.getDataRows().length>0&&(this.isColumnRefresh?this.isColumnRefresh=!1:(this.selectRecords(this.parent.pasteNodes),this.isPasteOperation=!1)),this.parent.createdItem&&(this.selectRecords([t.getValue(this.parent.hasId?"id":"name",this.parent.createdItem)]),this.parent.createdItem=null),this.parent.layoutSelectedItems.length&&this.selectRecords(this.parent.layoutSelectedItems),this.parent.renamedItem&&0===this.parent.selectedItems.length&&(this.gridObj.clearSelection(),this.addSelection(this.parent.renamedItem),this.parent.renamedItem=null),!0===this.sortItem&&(this.selectRecords(this.sortSelectedNodes),this.sortItem=!1),this.isSelectionUpdate&&(this.isColumnRefresh?this.isColumnRefresh=!1:(this.selectRecords(this.currentSelectedItem),this.isSelectionUpdate=!1)),!0===this.uploadOperation&&(this.count++,this.selectRecords(this.parent.uploadItem),this.count===this.parent.uploadItem.length&&(this.uploadOperation=!1,this.parent.uploadItem=[])),this.gridObj.currentViewData.length*this.gridObj.getRowHeight()<this.gridObj.height)(e=this.gridObj.getHeaderContent()).style.paddingRight="",e.style.paddingLeft="",t.select(".e-headercontent",e).style.borderRightWidth="0",(i=this.gridObj.getContent().querySelector(".e-content")).style.overflowY="",i.classList.add("e-scrollShow");else{var e=this.gridObj.getHeaderContent();this.parent.enableRtl?e.style.paddingLeft="16px":e.style.paddingRight="16px";var i=this.gridObj.getContent().querySelector(".e-content");i.classList.remove("e-scrollShow")}this.isRendered=!0,this.parent.isLayoutChange=!1,n.hideSpinner(this.parent.element),this.checkEmptyDiv(this.emptyArgs),this.isInteracted=!!this.isLoaded||this.isInteracted,this.isLoaded=!1},e.prototype.selectRecords=function(e){for(var i=this.gridObj.getCurrentViewRecords(),n=[],a=0,s=i.length;a<s;a++){var r=this.parent.hasId?t.getValue("id",i[a]):T(this.parent,i[a]);if(-1!==e.indexOf(r))n.push(a);else if(!this.parent.showFileExtension&&!this.parent.hasId&&r.includes(".")){var o=r.split(".").slice(0,-1).join(".");-1!==e.indexOf(o)&&n.push(a)}}0!==n.length&&(this.gridObj.selectRows(n),this.addFocus(this.gridObj.selectedRowIndex))},e.prototype.addSelection=function(e){var i=this.gridObj.getCurrentViewRecords(),n=[];if(this.parent.hasId)n=new a.DataManager(i).executeLocal((new a.Query).where("id","equal",this.parent.renamedId,!1));else{var s=new a.DataManager(i).executeLocal((new a.Query).where("name","equal",t.getValue("name",e),!1));s.length>0&&(n=new a.DataManager(s).executeLocal((new a.Query).where("filterPath","equal",this.parent.filterPath,!1)))}if(n.length>0){var r=i.indexOf(n[0]);this.gridObj.selectRows([r])}},e.prototype.onSortColumn=function(){"None"!==this.parent.sortOrder?this.gridObj.sortModule.sortColumn(this.parent.sortBy,this.parent.sortOrder):this.gridObj.dataSource=A(this.parent,this.gridObj.dataSource),0!==this.element.querySelector(".e-content").scrollTop&&this.gridObj.freezeRefresh()},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()||"common"===e.module)for(var i=0,n=Object.keys(e.newProp);i<n.length;i++)switch(n[i]){case"allowDragAndDrop":this.createDragObj();break;case"height":this.adjustHeight();break;case"detailsViewSettings":if(!t.isNullOrUndefined(this.gridObj)){this.checkNameWidth();var a=this.getColumns();this.gridObj.columns=a,this.gridObj.allowResizing=this.parent.detailsViewSettings.columnResizing,this.gridObj.dataBind(),this.gridObj.refreshColumns()}break;case"selectedItems":if(this.interaction=!1,0!==this.parent.selectedItems.length){if(!this.parent.allowMultiSelection){var s=this.parent.selectedItems.slice(this.parent.selectedItems.length-1);this.parent.setProperties({selectedItems:s},!0)}this.selectRecords(this.parent.selectedItems),this.parent.setProperties({selectedItems:this.parent.selectedItems},!0)}else t.isNullOrUndefined(this.gridObj)||(this.gridObj.clearSelection(),this.interaction=!0);break;case"showFileExtension":case"showHiddenItems":Ee(this.parent,Rn,this.parent.path);break;case"showItemCheckBoxes":case"allowMultiSelection":t.isNullOrUndefined(this.gridObj)||(this.currentSelectedItem=this.parent.selectedItems,this.gridObj.selectionSettings.type=e.newProp.allowMultiSelection?"Multiple":"Single",this.isSelectionUpdate=!0,this.renderCheckBox());break;case"view":C(this.parent,"Details");break;case"width":this.onDetailsResize()}},e.prototype.onPathChanged=function(e){this.parent.isCut=!1;var i=this.parent.detailsViewSettings.columns.find(function(e){return"filterPath"===e.field});(""===this.parent.breadcrumbbarModule.searchObj.element.value.trim()&&this.gridObj||!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.hideAtMedia)&&""!==i.hideAtMedia)&&(this.parent.searchedItems=[],this.parent.isFiltered?this.updatePathColumn():this.removePathColumn(!1)),O(this.parent),"Details"===this.parent.view&&(this.isInteracted=!1,n.showSpinner(this.parent.element),this.parent.setProperties({selectedItems:[]},!0),this.gridObj.dataSource=A(this.parent,e.files),this.gridObj.freezeRefresh(),this.parent.isReact&&this.gridObj.on("reactTemplateRender",this.reactTemplateRender,this),this.wireClickEvent(!0)),this.emptyArgs=e},e.prototype.updatePathColumn=function(){var e=this.gridObj.columns.length,t=JSON.parse(JSON.stringify(this.gridObj.columns));if(t[e-1].field&&"filterPath"!==t[e-1].field&&!this.parent.isMobile){var i={field:"filterPath",headerText:B(this.parent,"Path"),minWidth:180,width:"auto"};this.gridObj.columns.push(i),this.adjustWidth(this.gridObj.columns,"filterPath"),this.adjustWidth(this.gridObj.columns,"name"),this.isColumnRefresh=!0,this.gridObj.refreshColumns()}},e.prototype.checkEmptyDiv=function(e){var i=A(this.parent,e.files);if(0!==i.length||t.isNullOrUndefined(this.element.querySelector("."+un))){if(0!==i.length&&this.element.querySelector("."+Xi))if(this.element.querySelector("."+un).querySelector("."+Xi)){var n=this.element.querySelector("."+un).querySelector("."+Xi);this.element.querySelector("."+un).removeChild(n)}else this.element.removeChild(this.element.querySelector("."+Xi))}else U(this.parent,this.element,e)},e.prototype.onOpenInit=function(){if("detailsview"===this.parent.activeModule){var e=this.gridObj.getSelectedRecords()[0];this.openContent(e)}},e.prototype.DblClickEvents=function(e){this.gridObj.selectRows([e.rowIndex]);var t;e.rowData&&(t=JSON.parse(JSON.stringify(e.rowData)),this.openContent(t))},e.prototype.openContent=function(e){var i=this;if(!ye(e))return void be(this.parent,e,da);var n={cancel:!1,fileDetails:e,module:"DetailsView"};this.parent.trigger("fileOpen",n,function(n){if(!n.cancel){var a=t.getValue("name",e);if(t.getValue("isFile",e)){if(R(e)===sn){var s=k(i.parent,e);Wt(i.parent,a,s)}}else{if(""!==i.parent.breadcrumbbarModule.searchObj.element.value||i.parent.isFiltered)Y(i.parent,e);else{var r=t.getValue("id",e);i.parent.oldPath=i.parent.path;var o=i.parent.path+(t.isNullOrUndefined(r)?a:r)+"/";i.parent.setProperties({path:o},!0),i.parent.pathNames.push(a),i.parent.pathId.push(t.getValue("_fm_id",e)),i.parent.itemData=[e],N(i.parent)}i.parent.isFiltered=!1}i.element.focus(),i.parent.enableVirtualization&&i.parent.element.querySelector("#"+i.parent.element.id+Ni).focus()}})},e.prototype.onLayoutChange=function(e){"Details"===this.parent.view&&(this.parent.enableVirtualization&&this.parent.setProperties({selectedItems:[]},!0),this.gridObj?this.isLoaded=!0:this.render(e),this.parent.isFiltered&&(this.updatePathColumn(),this.parent.setProperties({selectedItems:[]},!0)),this.gridObj.dataSource=A(this.parent,e.files),this.parent.notify("hide-layout",{}),this.gridObj.element.classList.remove(In),this.isInteracted=!1,this.gridObj.clearSelection(),""!==this.parent.breadcrumbbarModule.searchObj.element.value.trim()&&this.onSearchFiles(e),this.adjustHeight(),this.gridObj.sortSettings.columns.length>0&&this.gridObj.sortSettings.columns[0].field!==this.parent.sortBy&&"None"!==this.parent.sortOrder&&this.gridObj.sortColumn(this.parent.sortBy,this.parent.sortOrder))},e.prototype.onSearchFiles=function(e){"Details"===this.parent.view&&(this.parent.setProperties({selectedItems:[]},!0),this.parent.notify(Hn,{}),this.parent.isLayoutChange||(this.parent.layoutSelectedItems=[]),this.updatePathColumn(),this.parent.searchedItems=e.files,this.onPathChanged(e))},e.prototype.removePathColumn=function(e){var i=this.gridObj.columns.length,n=JSON.parse(JSON.stringify(this.gridObj.columns)),a=this.parent.detailsViewSettings.columns.some(function(e){return"filterPath"===e.field});n[i-1].field&&"filterPath"===n[i-1].field&&!a&&(t.isNullOrUndefined(this.gridObj.sortSettings.columns[0])||"filterPath"!==this.gridObj.sortSettings.columns[0].field||("None"!==this.parent.sortOrder?this.gridObj.sortColumn("name",this.parent.sortOrder):this.gridObj.dataSource=A(this.parent,this.gridObj.dataSource),this.parent.notify(qn,{})),this.gridObj.columns.pop(),e||(this.isColumnRefresh=!0,this.gridObj.refreshColumns()))},e.prototype.onFinalizeEnd=function(e){"Details"===this.parent.view&&(this.gridObj?this.onPathChanged(e):this.render(e))},e.prototype.onCreateEnd=function(e){"Details"===this.parent.view&&this.onPathChanged(e)},e.prototype.onRenameInit=function(){"detailsview"===this.parent.activeModule&&1===this.parent.selectedItems.length&&this.updateRenameData()},e.prototype.onSelectedData=function(){"detailsview"===this.parent.activeModule&&(this.parent.itemData=this.gridObj.getSelectedRecords())},e.prototype.onDeleteInit=function(){"detailsview"===this.parent.activeModule&&Le(this.parent,this.parent.selectedItems,this.parent.path,"delete")},e.prototype.onDeleteEnd=function(e){"Details"===this.parent.view&&(this.onPathChanged(e),this.parent.setProperties({selectedItems:[]},!0))},e.prototype.onRefreshEnd=function(e){"Details"===this.parent.view&&(this.isInteracted=!1,this.removePathColumn(!1),this.gridObj.dataSource=A(this.parent,e.files),this.emptyArgs=e)},e.prototype.onHideLayout=function(){"Details"!==this.parent.view&&this.gridObj&&this.gridObj.element.classList.add(In)},e.prototype.onSelectAllInit=function(){"Details"===this.parent.view&&(this.isInteracted=!1,this.parent.allowMultiSelection?this.gridObj.selectionModule.selectRowsByRange(0,this.gridObj.getRows().length):this.gridObj.selectRow(this.gridObj.getRows().length-1),this.isInteracted=!0,this.interaction=!0)},e.prototype.onClearAllInit=function(){"Details"===this.parent.view&&(this.removeSelection(),this.interaction=!0)},e.prototype.onSelectionChanged=function(){t.removeClass([this.element],"e-headercheck"),this.parent.selectedItems.length>0&&t.addClass([this.element],"e-headercheck")},e.prototype.onLayoutRefresh=function(){"Details"===this.parent.view&&this.adjustHeight()},e.prototype.onBeforeRequest=function(){this.isRendered=!1},e.prototype.onAfterRequest=function(){this.isRendered=!0},e.prototype.onUpdateSelectionData=function(){"Details"===this.parent.view&&(this.parent.itemData=this.gridObj.getSelectedRecords())},e.prototype.addEventListener=function(){this.parent.on(Cn,this.onFinalizeEnd,this),this.parent.on(kn,this.destroy,this),this.parent.on(zn,this.onLayoutChange,this),this.parent.on(Rn,this.onPathChanged,this),this.parent.on(xn,this.onCreateEnd,this),this.parent.on(sa,this.onDropInit,this),this.parent.on(Wn,this.onDetailsInit,this),this.parent.on(Pn,this.onRefreshEnd,this),this.parent.on(Un,this.onSearchFiles,this),this.parent.on(ha,this.onMethodCall,this),this.parent.on(Fn,this.onActionFailure,this),this.parent.on(Dn,this.onPropertyChanged,this),this.parent.on(Nn,this.onDeleteInit,this),this.parent.on(En,this.onDeleteEnd,this),this.parent.on("selected-data",this.onSelectedData,this),this.parent.on(Yn,this.onRenameInit,this),this.parent.on(Jn,this.onPathChanged,this),this.parent.on(Vn,this.onOpenInit,this),this.parent.on(ia,this.onSortColumn,this),this.parent.on(_n,this.onPathChanged,this),this.parent.on("filter-end",this.onPathChanged,this),this.parent.on(Zn,this.onPasteInit,this),this.parent.on("hide-layout",this.onHideLayout,this),this.parent.on("select-all-init",this.onSelectAllInit,this),this.parent.on("clear-all-init",this.onClearAllInit,this),this.parent.on(na,this.onPathColumn,this),this.parent.on(Hn,this.onSelectionChanged,this),this.parent.on(Ln,this.onBeforeRequest,this),this.parent.on(An,this.onAfterRequest,this),this.parent.on(ea,this.onpasteEnd,this),this.parent.on($n,this.oncutCopyInit,this),this.parent.on(Kn,this.onMenuItemData,this),this.parent.on(Mn,this.onDetailsResizeHandler,this),this.parent.on("splitter-resize",this.onDetailsResize,this),this.parent.on("layout-refresh",this.onLayoutRefresh,this),this.parent.on(oa,this.onDropPath,this),this.parent.on("update-selection-data",this.onUpdateSelectionData,this)},e.prototype.removeEventListener=function(){this.parent.off(Cn,this.onFinalizeEnd),this.parent.off(kn,this.destroy),this.parent.off(zn,this.onLayoutChange),this.parent.off(Rn,this.onPathChanged),this.parent.off(Zn,this.onPasteInit),this.parent.off(xn,this.onCreateEnd),this.parent.off(Pn,this.onRefreshEnd),this.parent.off(Un,this.onSearchFiles),this.parent.off(ha,this.onMethodCall),this.parent.off(Fn,this.onActionFailure),this.parent.off(Dn,this.onPropertyChanged),this.parent.off(Yn,this.onRenameInit),this.parent.off(Jn,this.onPathChanged),this.parent.off("filter-end",this.onPathChanged),this.parent.off(Vn,this.onOpenInit),this.parent.off(ia,this.onSortColumn),this.parent.off(_n,this.onPathChanged),this.parent.off("hide-layout",this.onHideLayout),this.parent.off("select-all-init",this.onSelectAllInit),this.parent.off("clear-all-init",this.onClearAllInit),this.parent.off(Nn,this.onDeleteInit),this.parent.off(En,this.onDeleteEnd),this.parent.off(na,this.onPathColumn),this.parent.off(Hn,this.onSelectionChanged),this.parent.off(Ln,this.onBeforeRequest),this.parent.off(An,this.onAfterRequest),this.parent.off(ea,this.onpasteEnd),this.parent.off($n,this.oncutCopyInit),this.parent.off(sa,this.onDropInit),this.parent.off("selected-data",this.onSelectedData),this.parent.off(Wn,this.onDetailsInit),this.parent.off(Kn,this.onMenuItemData),this.parent.off(Mn,this.onDetailsResizeHandler),this.parent.off("splitter-resize",this.onDetailsResize),this.parent.off("layout-refresh",this.onLayoutRefresh),this.parent.off(oa,this.onDropPath),this.parent.off("update-selection-data",this.onUpdateSelectionData)},e.prototype.onActionFailure=function(){this.interaction=!0},e.prototype.onMenuItemData=function(e){this.parent.activeModule===this.getModuleName()&&(this.parent.itemData=[this.gridObj.getRowInfo(e.target).rowData])},e.prototype.onPasteInit=function(){this.parent.activeModule===this.getModuleName()&&(this.parent.itemData=""!==this.parent.folderPath?this.gridObj.getSelectedRecords():[E(this.parent)])},e.prototype.onDetailsInit=function(){this.parent.activeModule===this.getModuleName()&&(0!==this.parent.selectedItems.length?this.parent.itemData=this.gridObj.getSelectedRecords():this.parent.itemData=[t.getValue(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent)])},e.prototype.dragHelper=function(e){var t=e.sender.target.closest("tr.e-row");if(!t)return null;var i;t.getElementsByClassName("e-fe-text")[0]?i=this.parent.hasId?this.gridObj.getRowInfo(t).rowData.id:t.getElementsByClassName("e-fe-text")[0].innerText:t.getElementsByClassName("e-rowcell e-templatecell")[0].nextElementSibling&&(i=this.parent.hasId?this.gridObj.getRowInfo(t).rowData.id:t.getElementsByClassName("e-rowcell e-templatecell")[0].nextElementSibling.innerText),t&&!t.querySelector(".e-active")&&this.selectRecords([i]),w(this.parent,t),this.parent.activeElements=[],this.parent.dragData=[],this.parent.dragData=this.gridObj.getSelectedRecords();var n;return 0===this.parent.dragData.length&&t&&(n=this.gridObj.getRowInfo(t)),n&&this.parent.dragData.push(n.rowData),this.parent.dragPath=this.parent.path,this.parent.activeElements=this.gridObj.getSelectedRows(),ie(this.parent),this.parent.virtualDragElement},e.prototype.onDetailsResize=function(){if("Details"===this.parent.view&&!this.parent.isMobile&&!t.isNullOrUndefined(this.gridObj))for(var e=this.gridObj.getHeaderContent().querySelector(".e-headercontent").firstChild.childNodes[0],i=this.gridObj.getContent().querySelector(".e-content .e-table").children[0],n=this.gridObj.getColumns(),a=0;a<n.length;a++)(!this.isNameWidth&&"name"===n[a].field||"filterPath"===n[a].field)&&(""!==this.parent.breadcrumbbarModule.searchObj.element.value||this.parent.isFiltered?this.element.clientWidth<=680?"name"===n[a].field?(e.children[a].style.width="120px",i.children[a].style.width="120px"):(e.children[a].style.width="180px",i.children[a].style.width="180px"):this.element.clientWidth>680&&(e.children[a].style.width="auto",i.children[a].style.width="auto"):this.element.clientWidth<=500?(e.children[a].style.width="120px",i.children[a].style.width="120px"):this.element.clientWidth>500&&(e.children[a].style.width="auto",i.children[a].style.width="auto"))},e.prototype.onDetailsResizeHandler=function(){this.onDetailsResize(),"Details"!==this.parent.view||this.parent.isMobile||t.isNullOrUndefined(this.gridObj)||this.adjustHeight()},e.prototype.createDragObj=function(){var e=this;this.gridObj&&(this.parent.allowDragAndDrop&&t.isNullOrUndefined(this.dragObj)?this.dragObj=new t.Draggable(this.gridObj.element,{cursorAt:this.parent.dragCursorPosition,distance:5,enableTailMode:!0,dragArea:this.parent.element,dragTarget:"."+Qi,drag:he.bind(this,this.parent),dragStart:function(t){ae(e.parent,t,e.dragObj)},dragStop:ne.bind(this,this.parent),enableAutoScroll:!1,helper:this.dragHelper.bind(this)}):!this.parent.allowDragAndDrop&&this.dragObj&&(this.dragObj.destroy(),this.dragObj=null))},e.prototype.onDropInit=function(e){if(this.parent.targetModule===this.getModuleName()){var i=t.getValue(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent);if(e.target.closest("tr")){var n=null;n=this.gridObj.getRowInfo(e.target).rowData,this.parent.dropPath=n.isFile?this.parent.path:L(this.parent,n,this.parent.path),this.parent.dropData=n.isFile?i:n}else this.parent.dropPath=this.parent.path,this.parent.dropData=i}},e.prototype.oncutCopyInit=function(){this.parent.activeModule===this.getModuleName()&&(this.parent.activeRecords=this.gridObj.getSelectedRecords(),this.parent.activeElements=this.gridObj.getSelectedRows())},e.prototype.onpasteEnd=function(e){"Details"===this.parent.view&&(this.isPasteOperation=!0,(this.parent.path===this.parent.destinationPath||this.parent.path===$(this.parent,e)||this.parent.hasId)&&this.onPathChanged(e))},e.prototype.onDropPath=function(e){"Details"===this.parent.view&&(this.isPasteOperation=!0,this.onPathChanged(e))},e.prototype.getModuleName=function(){return"detailsview"},e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),this.gridObj&&(this.parent.isReact&&this.gridObj.off("reactTemplateRender",this.reactTemplateRender),this.unWireEvents(),this.gridObj.destroy()))},e.prototype.updateType=function(e){var i=t.select("."+an,e);this.parent.isFile=!!t.isNullOrUndefined(i)},e.prototype.onSelection=function(e,t){var i={action:e,fileDetails:t.data,isInteracted:this.interaction,cancel:!1,target:t.target};if(this.parent.trigger("fileSelection",i),t.cancel=i.cancel,!this.isMultiSelect){if(this.isMultiSelect=!0,(t.isShiftPressed||t.isCtrlPressed)&&!this.parent.allowMultiSelection&&t.target&&t.target.parentElement&&!t.target.parentElement.classList.contains("e-checkbox-wrapper")){t.cancel=!0;var n=t&&t.rowIndexes?t.rowIndexes[t.rowIndexes.length-1]:t.rowIndex;this.gridObj.selectRow(n)}this.isMultiSelect=!1}},e.prototype.onSelected=function(e){this.parent.activeModule="detailsview",this.parent.isLayoutChange&&!this.parent.isFiltered||this.selectedRecords(),this.parent.notify(Hn,{}),1===this.gridObj.getSelectedRowIndexes().length&&(this.firstItemIndex=this.gridObj.selectedRowIndex),this.gridObj.element.setAttribute("tabindex","-1"),this.triggerSelect("select",e);var i=this.gridObj.getRowByIndex(this.gridObj.selectedRowIndex);if(this.updateType(i),!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.querySelector(".e-checkselect"))){if(1!==this.gridObj.getSelectedRowIndexes().length){var n=this.gridObj.getSelectedRowIndexes()[this.gridObj.getSelectedRowIndexes().length-2],a=this.gridObj.getRowByIndex(n);t.isNullOrUndefined(a)||a.querySelector(".e-checkselect").setAttribute("tabindex","-1")}i.querySelector(".e-rowcell.e-fe-checkbox").removeAttribute("tabindex")}t.isNullOrUndefined(this.gridObj)||t.isNullOrUndefined(this.gridObj.element.querySelector(".e-checkselectall"))||this.gridObj.element.querySelector(".e-checkselectall").setAttribute("tabindex","-1");var s=this.gridObj.getSelectedRowIndexes();if(!this.parent.allowMultiSelection)for(var r=0;r<s.length;r++)s[r]===this.gridObj.selectedRowIndex?this.gridObj.getRowByIndex(s[r]).setAttribute("tabindex","0"):this.gridObj.getRowByIndex(s[r]).removeAttribute("tabindex");var o=s.length;if(this.parent.enableVirtualization)this.parent.currentItemText=t.getValue("name",e.data);else if(o>0){var l=this.gridObj.getRowsObject()[s[o-1]].data;this.parent.currentItemText=t.getValue("name",l)}var h=t.getValue("rowIndexes",e),d=t.getValue("enableSelectMultiTouch",this.gridObj.selectionModule);this.parent.isDevice&&t.isNullOrUndefined(h)&&e.target&&!d&&!e.target.closest(".e-headercell")&&(this.parent.isFile=t.getValue("isFile",e.data),this.parent.isFile||this.openContent(e.data)),this.parent.visitedItem=e.row,this.parent.enableVirtualization&&e.isHeaderCheckboxClicked||this.addFocus(this.gridObj.selectedRowIndex),this.parent.isLayoutChange||(this.isInteracted=!0)},e.prototype.onPathColumn=function(){"Details"!==this.parent.view||t.isNullOrUndefined(this.gridObj)||""!==this.parent.breadcrumbbarModule.searchObj.element.value||this.parent.isFiltered||this.removePathColumn(!1)},e.prototype.selectedRecords=function(){this.parent.setProperties({selectedItems:[]},!0);for(var e=this.gridSelectNodes(),t=0;t<e.length;){var i=e[t],n=ce(this.parent,i);this.parent.selectedItems.push(n),t++}this.parent.setProperties({selectedItems:this.parent.selectedItems},!0)},e.prototype.onDeSelection=function(e){if(!this.parent.allowMultiSelection&&t.isNullOrUndefined(e.data)){var i=this.gridObj.getRowByIndex(e.rowIndex);t.isNullOrUndefined(i)||i.removeAttribute("tabindex")}else if(this.gridObj.getSelectedRowIndexes().length>1){var n=this.gridObj.getSelectedRowIndexes()[this.gridObj.getSelectedRowIndexes().length-2],a=this.gridObj.getRowByIndex(n);t.isNullOrUndefined(a)||a.querySelector(".e-checkselect").removeAttribute("tabindex")}if(-1===this.gridObj.selectedRowIndex&&this.gridObj.element.setAttribute("tabindex","0"),!this.isInteracted)return void(this.isInteracted=!0);this.selectedRecords(),0===this.parent.selectedItems.length&&(t.setValue("enableSelectMultiTouch",!1,this.gridObj.selectionModule),t.removeClass([this.parent.element],"e-fe-m-select")),this.parent.notify(Hn,{}),this.triggerSelect("unselect",e),this.parent.visitedItem=null},e.prototype.triggerSelect=function(e,t){var i={action:e,fileDetails:t.data,isInteracted:this.interaction};this.parent.trigger("fileSelect",i),this.interaction=!0},e.prototype.wireEvents=function(){this.wireClickEvent(!0),this.keyboardModule=new t.KeyboardEvents(this.gridObj.element,{keyAction:this.keyupHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keyup"}),this.keyboardDownModule=new t.KeyboardEvents(this.element,{keyAction:this.keydownHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),t.EventHandler.add(this.gridObj.element,"blur",this.removeFocus,this),t.EventHandler.add(this.parent.element,"focusout",this.onBlur,this)},e.prototype.unWireEvents=function(){this.wireClickEvent(!1),this.keyboardModule.destroy(),this.keyboardDownModule.destroy(),t.EventHandler.remove(this.gridObj.element,"blur",this.removeFocus),t.EventHandler.remove(this.parent.element,"focusout",this.onBlur)},e.prototype.wireClickEvent=function(e){var i=this;if(e){var n=this.gridObj.getContent();this.clickObj=new t.Touch(n,{tap:function(e){1===e.tapCount&&e.originalEvent.target.classList.contains("e-content")&&i.onClearAllInit()},tapHold:function(e){if(i.parent.isDevice){e.originalEvent.preventDefault(),i.parent.allowMultiSelection&&(t.setValue("enableSelectMultiTouch",i.parent.allowMultiSelection,i.gridObj.selectionModule),t.addClass([i.parent.element],"e-fe-m-select"));var n=e.originalEvent.target;if(n){var a=t.closest(n,"."+Qi),s=i.gridObj.getRows().indexOf(a);i.gridObj.selectRow(s)}}}})}else this.clickObj&&this.clickObj.destroy()},e.prototype.removeSelection=function(){t.removeClass([this.parent.element],"e-fe-m-select"),this.gridObj.clearSelection(),this.parent.setProperties({selectedItems:[]},!0),this.parent.notify(Hn,{}),-1===this.gridObj.selectedRowIndex&&(this.startIndex=null),this.isInteracted=!0},e.prototype.removeFocus=function(){this.addFocus(null)},e.prototype.onBlur=function(e){if((null===e.relatedTarget||t.closest(e.relatedTarget,".e-grid")===e.relatedTarget)&&!t.isNullOrUndefined(this.gridObj.element))for(var i=this.gridObj.element.querySelectorAll("th"),n=0;n<i.length;n++)i[n].classList.contains("e-focus")&&this.addFocus(null)},e.prototype.getFocusedItemIndex=function(){return t.isNullOrUndefined(this.getFocusedItem())?null:parseInt(this.getFocusedItem().getAttribute("aria-rowindex"),10)-1},e.prototype.keydownHandler=function(e){if(this.isRendered)switch(e.action){case"end":case"home":case"space":case"ctrlSpace":case"shiftSpace":case"csSpace":case"ctrlA":case"enter":case"altEnter":case"ctrlEnd":case"shiftEnd":case"csEnd":case"ctrlHome":case"shiftHome":case"csHome":case"ctrlDown":case"shiftDown":case"csDown":case"ctrlLeft":case"shiftLeft":case"csLeft":case"esc":case"del":case"shiftdel":case"ctrlC":case"ctrlV":case"ctrlX":case"f2":case"moveDown":case"moveUp":case"ctrlD":e.preventDefault()}},e.prototype.keyupHandler=function(e){if(this.isRendered){e.preventDefault();var i,n,a,s=e.action,r=A(this.parent,this.gridObj.dataSource),o=r.length,l=this.getFocusedItemIndex(),h=this.gridObj.selectedRowIndex,d=this.gridObj.getSelectedRowIndexes();switch(s){case"altEnter":this.parent.notify(Wn,{}),Te(this.parent,this.parent.selectedItems,this.parent.path,"details");break;case"esc":v(this.parent);break;case"del":case"shiftdel":this.performDelete();break;case"enter":if(-1===this.gridObj.selectedRowIndex&&!0===this.gridObj.allowSorting){if(!e.target.classList.contains("e-fe-grid-icon")){var c=e.target.getElementsByClassName("e-ascending").length?"Descending":"Ascending",p=this.gridObj.getColumnByUid(e.target.querySelector(".e-headercelldiv").getAttribute("e-mappinguid")).field;this.gridObj.sortColumn(p,c),t.isNullOrUndefined(this.getFocusedItem().nextSibling)||this.getFocusedItem().nextSibling.setAttribute("tabindex","0")}break}if(i=this.gridObj.getRowsObject()[this.gridObj.selectedRowIndex].data){var u=JSON.parse(JSON.stringify(i));this.openContent(u)}break;case"ctrlC":P(this.parent);break;case"ctrlV":this.parent.folderPath="",G(this.parent);break;case"ctrlX":M(this.parent);break;case"ctrlD":this.doDownload();break;case"f2":this.performRename();break;case"ctrlA":if(!t.isNullOrUndefined(r[0])&&this.parent.allowMultiSelection){var f=this.gridObj.getContent().querySelector(".e-content"),g=f.scrollTop,m=this.gridObj.selectedRowIndex;this.gridObj.selectionModule.selectRowsByRange(0,r.length-1),f.scrollTop=g,-1!==m&&this.addFocus(m)}break;case"ctrlHome":case"tab":if(!t.isNullOrUndefined(r[0]))if(this.parent.allowMultiSelection||"ctrlHome"!==e.action){if(-1!==this.gridObj.selectedRowIndex&&"tab"===e.action)return;this.addHeaderFocus(e)}else this.gridObj.selectRow(0);break;case"ctrlEnd":t.isNullOrUndefined(r[0])||(this.parent.allowMultiSelection?this.addFocus(o-1):this.gridObj.selectRow(o-1));break;case"shiftHome":case"shiftEnd":case"csHome":case"csEnd":this.parent.allowMultiSelection?t.isNullOrUndefined(r[0])||(t.isNullOrUndefined(h)||-1===h?"csHome"===e.action||"shiftHome"===e.action?this.gridObj.selectRow(0):this.gridObj.selectionModule.selectRowsByRange(0,r.length-1):this.checkRowsKey(r,h,null,e)):this.gridObj.selectRow("shiftHome"===e.action||"csHome"===e.action?0:r.length-1);break;case"space":case"csSpace":case"shiftSpace":case"ctrlSpace":this.spaceSelection(d,l,h,e);break;case"csUp":case"csDown":case"shiftUp":case"shiftDown":this.shiftMoveMethod(r,h,l,d,e);break;case"ctrlUp":case"ctrlDown":this.parent.allowMultiSelection?this.ctrlMoveFunction(r,e,h):this.moveFunction(r,e,h);break;case"home":n=[t.getValue(this.parent.hasId?"id":"name",r[0])],this.parent.setProperties({selectedItems:n},!0),this.selectRecords(n);break;case"moveUp":case"moveDown":this.moveFunction(r,e,h);break;case"end":a=[t.getValue(this.parent.hasId?"id":"name",r[o-1])],this.parent.setProperties({selectedItems:a},!0),this.selectRecords(a);break;case"back":this.parent.traverseBackward()}}},e.prototype.gridSelectNodes=function(){return this.gridObj.getSelectedRecords()},e.prototype.doDownload=function(){if(0!==this.parent.selectedItems.length){this.parent.itemData=this.gridObj.getSelectedRecords();for(var e=this.parent.itemData,t=0;t<e.length;t++)if(!De(e[t]))return void be(this.parent,e[t],fa);pt(this.parent,this.parent.path,this.parent.selectedItems)}},e.prototype.performDelete=function(){if(this.parent.selectedItems&&this.parent.selectedItems.length>0){this.parent.itemData=this.gridObj.getSelectedRecords();for(var e=this.parent.itemData,t=0;t<e.length;t++)if(!Ie(e[t]))return void be(this.parent,e[t],ca);mt(this.parent,"Delete")}},e.prototype.performRename=function(){1===this.parent.selectedItems.length&&(this.updateRenameData(),ue(this.parent))},e.prototype.updateRenameData=function(){var e=this.gridSelectNodes()[0];pe(this.parent,e)},e.prototype.shiftMoveMethod=function(e,t,i,n,a){this.parent.allowMultiSelection?-1!==t||"csUp"!==a.action&&"csDown"!==a.action?-1===t||i===t||("csUp"===a.action||"csDown"===a.action)&&this.isSelected(n,i)?this.shiftSelectedItem(t,n,e,a):this.shiftSelectFocusItem(t,i,n,a):this.ctrlMoveFunction(e,a,t):this.moveFunction(e,a,t)},e.prototype.moveFunction=function(e,i,n){!t.isNullOrUndefined(this.getFocusedItem())&&this.parent.allowMultiSelection?"moveDown"===i.action?this.gridObj.selectRow(this.getFocusedItemIndex()+1):this.gridObj.selectRow(this.getFocusedItemIndex()-1):t.isNullOrUndefined(n)||-1===n?t.isNullOrUndefined(e[0])||this.gridObj.selectRow(0):"moveDown"===i.action||"ctrlDown"===i.action||"shiftDown"===i.action||"csDown"===i.action?this.gridObj.selectRow(n+(n!==e.length-1?1:0)):this.gridObj.selectRow(n-(0!==n?1:0))},e.prototype.spaceSelection=function(e,i,n,a){if(this.isSelected(e,i)||-1===n||"shiftSpace"!==a.action&&"csSpace"!==a.action)if(t.isNullOrUndefined(this.getFocusedItem())||i===n)if(-1!==n&&"ctrlSpace"===a.action&&this.parent.allowMultiSelection){var s=n;e.pop(),this.gridObj.selectRows(e),this.addFocus(s)}else"shiftSpace"===a.action&&this.gridObj.selectRow(n);else e.push(this.getFocusedItemIndex()),this.gridObj.selectRows(e);else i<n?this.gridObj.selectionModule.selectRowsByRange(i,n):this.gridObj.selectionModule.selectRowsByRange(n,i)},e.prototype.ctrlMoveFunction=function(e,i,n){var a;if(t.isNullOrUndefined(this.getFocusedItem()))t.isNullOrUndefined(n)||-1===n?t.isNullOrUndefined(e[0])||(a=0):a="ctrlDown"===i.action||"csDown"===i.action?n+(n<e.length?1:0):n-(n<1?0:1);else{var s=this.getFocusedItemIndex();a="ctrlDown"===i.action||"csDown"===i.action?s+(s<e.length-1?1:0):s-(s<1?0:1)}this.addFocus(a)},e.prototype.checkRowsKey=function(e,i,n,a){"Uncheck"===this.gridObj.checkAllRows||"Intermediate"===this.gridObj.checkAllRows?"csHome"!==a.action&&"csEnd"!==a.action?(t.isNullOrUndefined(this.startIndex)&&this.firstItemIndex!==i&&(this.firstItemIndex=i),"shiftEnd"===a.action?this.gridObj.selectionModule.selectRowsByRange(this.firstItemIndex,e.length-1):this.gridObj.selectionModule.selectRowsByRange(0,this.firstItemIndex),this.startIndex=i):"csEnd"===a.action?this.gridObj.selectRows(this.InnerItems(t.isNullOrUndefined(i)?0:i,t.isNullOrUndefined(n)?e.length-1:n,a)):t.isNullOrUndefined(i)?this.gridObj.selectRow(0):this.gridObj.selectRows(this.InnerItems(t.isNullOrUndefined(n)?0:n,i,a)):this.gridObj.selectionModule.selectRow("shiftHome"===a.action||"csHome"===a.action?0:e.length-1)},e.prototype.InnerItems=function(e,t,i){var n=this.gridObj.getSelectedRowIndexes();if("csEnd"===i.action)for(a=e+1;a<=t;a++)n.push(a);else for(var a=t-1;e<=a;a--)n.push(a);return n},e.prototype.shiftSelectFocusItem=function(e,i,n,a){var s=i+("shiftDown"===a.action||"csDown"===a.action?1:-1),r=t.isNullOrUndefined(this.startIndex)?e:n[0];r===s?this.gridObj.selectRow(r):r<s?"shiftDown"===a.action||"csDown"===a.action?this.gridObj.selectionModule.selectRowsByRange(r,s):this.gridObj.selectionModule.selectRowsByRange(s,r):"shiftDown"===a.action||"csDown"===a.action?this.gridObj.selectionModule.selectRowsByRange(s,r):this.gridObj.selectionModule.selectRowsByRange(r,s),this.startIndex=this.gridObj.selectedRowIndex},e.prototype.addFocus=function(e){var i=this.getFocusedItem(),n=this.gridObj.getRowByIndex(e);i&&(i.removeAttribute("tabindex"),t.removeClass([i],[Ki,Yi])),t.isNullOrUndefined(n)||(this.gridObj.element.setAttribute("tabindex","-1"),n.setAttribute("tabindex","0"),n.focus(),t.addClass([n],[Ki,Yi]))},e.prototype.addHeaderFocus=function(e){var i=t.select(".e-row",this.element);this.gridObj.element.setAttribute("tabindex","-1");var n;!t.isNullOrUndefined(e.target)&&e.target.classList.contains("e-defaultcursor")?(this.addFocus(0),n=e.target.nextElementSibling):t.isNullOrUndefined(this.gridObj.element.querySelector(".e-focus"))||"TH"!==this.gridObj.element.querySelector(".e-focus").tagName?n=t.select("th.e-fe-grid-icon",this.element):(n=this.gridObj.element.querySelector(".e-focus").nextElementSibling,this.addFocus(0)),t.isNullOrUndefined(n)||(n.setAttribute("tabindex","0"),n.focus(),t.addClass([n],[Ki,Yi]),i.setAttribute("tabindex","0"),0===i.tabIndex&&0===n.tabIndex&&t.removeClass([i],[Ki,Yi]))},e.prototype.getFocusedItem=function(){return t.select("."+Yi,this.element)},e.prototype.isSelected=function(e,t){for(var i=!1,n=0;n<=e.length-1;n++)if(e[n]===t){i=!0;break}return i},e.prototype.shiftSelectedItem=function(e,i,n,a){-1===e?this.gridObj.selectRow(0):t.isNullOrUndefined(this.startIndex)&&a.shiftKey?(this.startIndex=this.gridObj.selectedRowIndex,this.gridObj.selectRows([e,"shiftDown"===a.action||"csDown"===a.action?e+(e!==n.length-1?1:0):e-(0!==e?1:0)])):"shiftDown"===a.action||"shiftUp"===a.action?("shiftDown"===a.action&&-1===i.indexOf(e+1)?e!==n.length-1&&i.push(e+1):"shiftUp"===a.action&&-1===i.indexOf(e-1)?0!==e&&i.push(e-1):i.pop(),this.gridObj.selectRows(i)):"csDown"===a.action?this.isSelected(i,this.getFocusedItemIndex()+1)?this.addFocus(this.getFocusedItemIndex()+1):(i.push(this.getFocusedItemIndex()+1),this.gridObj.selectRows(i)):this.isSelected(i,this.getFocusedItemIndex()-1)?this.addFocus(this.getFocusedItemIndex()-1):(i.push(this.getFocusedItemIndex()-1),this.gridObj.selectRows(i))},e.prototype.onMethodCall=function(e){if("Details"===this.parent.view)switch(t.getValue("action",e)){case"deleteFiles":this.deleteFiles(t.getValue("ids",e));break;case"downloadFiles":this.downloadFiles(t.getValue("ids",e));break;case"openFile":this.openFile(t.getValue("id",e));break;case"createFolder":this.interaction=!1;break;case"renameFile":this.interaction=!1,this.renameFile(t.getValue("id",e),t.getValue("newName",e));break;case"selectAll":this.interaction=!1,this.onSelectAllInit();break;case"clearSelection":this.interaction=!1,this.onClearAllInit()}},e.prototype.getRecords=function(e){var i=this.gridObj.getCurrentViewRecords(),n=[],a=!(""===this.parent.breadcrumbbarModule.searchObj.element.value&&!this.parent.isFiltered),s=this.parent.hasId?"id":"name";if(this.parent.hasId||!a)for(var r=0,o=i.length;r<o;r++)-1!==e.indexOf(t.getValue(s,i[r]))&&n.push(i[r]);else for(var r=0,o=i.length;r<o;r++){var l=t.getValue("filterPath",i[r])+t.getValue("name",i[r]);-1!==e.indexOf(l)&&n.push(i[r])}return n},e.prototype.deleteFiles=function(e){if(this.parent.activeModule="detailsview",t.isNullOrUndefined(e))return void this.performDelete();var i=this.getRecords(e);if(0!==i.length){for(var n=[],a=[],s=0;s<i.length;s++)n[s]=i[s],a[s]=ce(this.parent,n[s]);ge(this.parent,n,a)}},e.prototype.downloadFiles=function(e){if(t.isNullOrUndefined(e))return void this.doDownload();var i=this.getRecords(e);if(0!==i.length){for(var n=[],a=[],s=0;s<i.length;s++)n[s]=i[s],a[s]=ce(this.parent,n[s]);me(this.parent,n,a)}},e.prototype.openFile=function(e){if(!t.isNullOrUndefined(e)){var i=this.getRecords([e]);i.length>0&&this.openContent(i[0])}},e.prototype.renameFile=function(e,i){if(this.parent.activeModule="detailsview",t.isNullOrUndefined(e))return void this.performRename();var n=this.getRecords([e]);n.length>0&&(pe(this.parent,n[0]),t.isNullOrUndefined(i)?ue(this.parent):Ie(this.parent.itemData[0])?Re(this.parent,this.parent.path,i):be(this.parent,this.parent.itemData[0],ca))},e}();return Oa.Inject(Ca,Sa,ga,wa,ba,ma,Da),e.ACTIVE=qi,e.ALT_DIALOG_ID="_alt_dialog",e.AjaxSettings=Qt,e.BLUR=zi,e.BREADCRUMBBAR_ID=Mi,e.BREADCRUMBS="e-address",e.BreadCrumbBar=ma,e.CB_WRAP=Ji,e.CHECK=Gi,e.CHECK_SELECT="e-fe-cb-select",e.CLONE=en,e.COLLAPSED="e-node-collapsed",e.CONTENT_ID=Pi,e.CONTEXT_MENU_ID="_contextmenu",e.CONTROL=Li,e.Column=Di,e.ContextMenu=ba,e.ContextMenuSettings=fi,e.DETAILS_LABEL="e-detailslabel",e.DIALOG_ID=ji,e.DISPLAY_NONE=In,e.DROP_FILE=nn,e.DROP_FOLDER=tn,e.Delete=Le,e.DetailsView=Ca,e.DetailsViewSettings=li,e.Download=pt,e.EMPTY=Xi,e.EMPTY_CONTENT=$i,e.EMPTY_INNER_CONTENT=Zi,e.ERROR_CONTENT=vn,e.EXTN_DIALOG_ID=Ei,e.FILTER=Fi,e.FOCUS=Ki,e.FOCUSED=Yi,e.FOLDER=an,e.FRAME="e-frame",e.FULLROW="e-fullrow",e.FileManager=Oa,e.GRID_CONTENT=fn,e.GRID_HEADER=dn,e.GRID_ID=Ci,e.GRID_VIEW=un,e.GetDetails=Te,e.HEADER_CHECK="e-headercheck",e.HOVER=Wi,e.ICONS="e-icons",e.ICON_BREADCRUMB="e-icons e-fe-breadcrumb",e.ICON_CLEAR="e-icons e-fe-clear",e.ICON_COLLAPSIBLE="e-icon-collapsible",e.ICON_COPY="e-icons e-fe-copy",e.ICON_CUT=gn,e.ICON_DELETE="e-icons e-fe-delete",e.ICON_DETAILS="e-icons e-fe-details",e.ICON_DOWNLOAD="e-icons e-fe-download",e.ICON_DROP_IN="e-icons e-fe-drop-in",e.ICON_DROP_OUT="e-icons e-fe-drop-out",e.ICON_GRID=mn,e.ICON_IMAGE=sn,e.ICON_LARGE=bn,e.ICON_MUSIC=rn,e.ICON_NEWFOLDER="e-icons e-fe-newfolder",e.ICON_NO_DROP="e-icons e-fe-no-drop",e.ICON_OPEN="e-icons e-fe-open",e.ICON_OPTIONS="e-icons e-fe-options",e.ICON_PASTE="e-icons e-fe-paste",e.ICON_REFRESH="e-icons e-fe-refresh",e.ICON_RENAME="e-icons e-fe-rename",e.ICON_SELECTALL="e-icons e-fe-select",e.ICON_SHORTBY="e-icons e-fe-sort",e.ICON_UPLOAD="e-icons e-fe-upload",e.ICON_VIDEO=on,e.ICON_VIEW="e-list-parent",e.IMG_DIALOG_ID=Ni,e.LARGEICON_ID=xi,e.LARGE_EMPTY_FOLDER=hn,e.LARGE_EMPTY_FOLDER_TWO="e-empty-icon.e-fe-folder",e.LARGE_ICON=ln,e.LARGE_ICONS=Ui,e.LARGE_ICON_FOLDER="e-fe-folder",e.LAYOUT="e-layout",e.LAYOUT_CONTENT="e-layout-content",e.LAYOUT_ID=Si,e.LIST_ITEM=Vi,e.LIST_PARENT="e-list-parent",e.LIST_TEXT=_i,e.LargeIconsView=ga,e.MENU_ICON=pn,e.MENU_ITEM="e-menu-item",e.MOBILE="e-fe-mobile",e.MOB_POPUP=Ai,e.MULTI_SELECT="e-fe-m-select",e.NAVIGATION="e-navigation",e.NAVIGATION_ID="_navigation",e.NavigationPane=Sa,e.NavigationPaneSettings=bi,e.OVERLAY="e-fe-overlay",e.RETRY_DIALOG_ID="_retry_dialog",e.RETRY_ID="_retry",e.ROOT=ki,e.ROOT_POPUP=Ti,e.ROW=Qi,e.ROWCELL="e-rowcell",e.RTL=yn,e.SEARCH_ID="_search",e.SELECTED_ITEMS="e-items",e.SORTBY_ID="_sortby",e.SPLITTER_ID="_splitter",e.SPLIT_BAR="e-split-bar",e.STATUS="e-status",e.SUBMENU_ICON="e-caret",e.Search=dt,e.SearchSettings=ai,e.TB_ITEM="e-toolbar-item",e.TB_OPTION_DOT=Bi,e.TB_OPTION_TICK=Hi,e.TEMPLATE_CELL="e-templatecell",e.TEXT_CONTENT="e-text-content",e.TOOLBAR_ID="_toolbar",e.TREE_ID="_tree",e.TREE_VIEW=cn,e.Toolbar=wa,e.ToolbarItem=ti,e.ToolbarSettings=ei,e.UPLOAD_DIALOG_ID="_upload_dialog",e.UPLOAD_ID=Ri,e.UploadSettings=Ii,e.VALUE=On,e.VIEW_ID="_view",e.Virtualization=Da,e.actionFailure=Fn,e.activeElement=y,e.addBlur=I,e.afterRequest=An,e.beforeDelete="before-delete",e.beforeDownload="before-download",e.beforeRequest=Ln,e.clearAllInit="clear-all-init",e.clearPathInit=Bn,e.closePopup=xe,e.columnArray=oi,e.copyFiles=P,e.createDeniedDialog=be,e.createDialog=mt,e.createEmptyElement=U,e.createEnd=xn,e.createExtDialog=bt,e.createFolder=Pe,e.createImageDialog=Wt,e.createNewFolder=Se,e.createVirtualDragElement=ie,e.cutCopyInit=$n,e.cutEnd=ta,e.cutFiles=M,e.defaultToolbarItems=Zt,e.deleteEnd=En,e.deleteInit=Nn,e.destroy=kn,e.detailsInit=Wn,e.doDeleteFiles=ge,e.doDownload=fe,e.doDownloadFiles=me,e.doPasteUpdate=Z,e.doRename=ue,e.download="download",e.downloadInit="download-init",e.dragCancel=se,e.dragEnd=ra,e.dragHelper="drag-helper",e.dragStartHandler=ae,e.dragStopHandler=ne,e.dragging=la,e.draggingHandler=he,e.dropHandler=Q,e.dropInit=sa,e.dropPath=oa,e.fileItems=ci,e.fileType=R,e.filter=Me,e.filterEnd="filter-end",e.finalizeEnd=Cn,e.folderItems=pi,e.generatePath=b,e.getAccessClass=ve,e.getAccessDetails=Ne,e.getAllChildItems=D,e.getCssClass=z,e.getDirectories=V,e.getDirectoryPath=$,e.getDuplicateData=te,e.getFullPath=L,e.getImageUrl=k,e.getItemName=ce,e.getLocaleText=B,e.getModule=w,e.getName=T,e.getObject=F,e.getParentPath=X,e.getParents=m,e.getPath=u,e.getPathId=f,e.getPathNames=g,e.getPathObject=E,e.getSortField=W,e.getSortedData=A,e.getTargetModule=x,e.getTargetPath=je,e.hasContentAccess=Oe,e.hasDownloadAccess=De,e.hasEditAccess=Ie,e.hasReadAccess=ye,e.hasUploadAccess=we,e.hideLayout="hide-layout",e.hidePaste=Xn,e.initialEnd=Sn,e.isFile=wn,e.isFileSystemData=Ae,e.layoutChange=zn,e.layoutItems=ui,e.layoutRefresh="layout-refresh",e.menuItemData=Kn,e.methodCall=ha,e.modelChanged=Dn,e.nodeExpand="node-expand",e.objectToString=de,e.openAction=N,e.openEnd=_n,e.openInit=Vn,e.openSearchFolder=Y,e.paste=ke,e.pasteEnd=ea,e.pasteHandler=G,e.pasteInit=Zn,e.pathChanged=Rn,e.pathColumn=na,e.pathDrag=jn,e.permissionCopy="copy",e.permissionDownload=fa,e.permissionEdit=ca,e.permissionEditContents=pa,e.permissionRead=da,e.permissionUpload=ua,e.read=Ee,e.readDropPath=ee,e.refresh=j,e.refreshEnd=Pn,e.removeActive=v,e.removeBlur=O,e.removeDropTarget=re,e.removeItemClass=oe,e.rename=Re,e.renameEnd=Jn,e.renameEndParent=Gn,e.renameInit=Yn,e.resizeEnd=Mn,e.scrollHandler=le,e.search=Un,e.searchTextChange=aa,e.searchWordHandler=S,e.selectAllInit="select-all-init",e.selectedData="selected-data",e.selectionChanged=Hn,e.setDateObject=H,e.setNextPath=K,e.setNodeId=_,e.showPaste=Qn,e.skipUpload=Tn,e.sortByChange=qn,e.sortColumn=ia,e.sortComparer=c,e.sortbyClickHandler=q,e.splitterResize="splitter-resize",e.treeSelect="select-node",e.triggerFetchFailure=gt,e.triggerFetchSuccess=ft,e.updateLayout=C,e.updatePath=p,e.updateRenamingData=pe,e.updateSelectionData="update-selection-data",e.updateTreeSelection="update-tree-selection",e.upload="upload",e.uploadItem=Ce,e.validateSubFolder=J,e}({},ej.base,ej.layouts,ej.popups,ej.data,ej.grids,ej.inputs,ej.buttons,ej.lists,ej.splitbuttons,ej.navigations),this.ejs=ej;
|
11
11
|
//# sourceMappingURL=ej2-filemanager.min.js.map
|