cloudcmd 15.9.10 → 15.9.14

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/ChangeLog CHANGED
@@ -1,3 +1,28 @@
1
+ 2022.01.13, v15.9.14
2
+
3
+ fix:
4
+ - (cloudcmd) client: edit-names in vim mode
5
+ - (docker) images: make dockerfiles use node:lts-buster and node:lts-buster-slim for alpine (#363)
6
+ - (docker) images: make dockerfiles use node:lts-buster-slim as base image (#357)
7
+ feature:
8
+ - (package) eslint-plugin-putout v13.0.1
9
+ - (package) putout v24.0.2
10
+
11
+ 2021.12.23, v15.9.13
12
+
13
+ feature:
14
+ - (package) putout v23.0.0
15
+
16
+ 2021.12.16, v15.9.12
17
+
18
+ fix:
19
+ - (client) loadDir: history enabled by default
20
+
21
+ 2021.12.09, v15.9.11
22
+
23
+ fix:
24
+ - (client) load: Upload stuck for zero byte files (#359)
25
+
1
26
  2021.12.04, v15.9.10
2
27
 
3
28
  fix:
package/HELP.md CHANGED
@@ -1,4 +1,4 @@
1
- # Cloud Commander v15.9.10
1
+ # Cloud Commander v15.9.14
2
2
 
3
3
  ### [Main][MainURL] [Blog][BlogURL]
4
4
 
@@ -1082,6 +1082,10 @@ There are a lot of ways to be involved in `Cloud Commander` development:
1082
1082
 
1083
1083
  ## Version history
1084
1084
 
1085
+ - *2022.01.13*, **[v15.9.14](//github.com/coderaiser/cloudcmd/releases/tag/v15.9.14)**
1086
+ - *2021.12.23*, **[v15.9.13](//github.com/coderaiser/cloudcmd/releases/tag/v15.9.13)**
1087
+ - *2021.12.16*, **[v15.9.12](//github.com/coderaiser/cloudcmd/releases/tag/v15.9.12)**
1088
+ - *2021.12.09*, **[v15.9.11](//github.com/coderaiser/cloudcmd/releases/tag/v15.9.11)**
1085
1089
  - *2021.12.04*, **[v15.9.10](//github.com/coderaiser/cloudcmd/releases/tag/v15.9.10)**
1086
1090
  - *2021.11.22*, **[v15.9.9](//github.com/coderaiser/cloudcmd/releases/tag/v15.9.9)**
1087
1091
  - *2021.02.03*, **[v15.6.0](//github.com/coderaiser/cloudcmd/releases/tag/v15.6.0)**
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Cloud Commander v15.9.10 [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Codacy][CodacyIMG]][CodacyURL] [![Gitter][GitterIMGURL]][GitterURL]
1
+ # Cloud Commander v15.9.14 [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Codacy][CodacyIMG]][CodacyURL] [![Gitter][GitterIMGURL]][GitterURL]
2
2
 
3
3
  ### [Main][MainURL] [Blog][BlogURL]
4
4
 
@@ -1,4 +1,4 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[0],[function(t,e,r){"use strict";const n=(t,...e)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),e.length>=t.length)return t(...e);const r=(...r)=>n(t,...e,...r),o=t.length-e.length-1;return(t=>[function(e){return t(...arguments)},function(e,r){return t(...arguments)},function(e,r,n){return t(...arguments)},function(e,r,n,o){return t(...arguments)},function(e,r,n,o,i){return t(...arguments)}])(r)[o]||r};t.exports=n},function(t,e,r){"use strict";const n=r(2),o=t.exports;function i(){return function(){const t=document.createElementNS;if(!t)return!1;const e=t.bind(document),r=e("http://www.w3.org/2000/svg","animate").toString();return/SVGAnimate/.test(r)}()?"-svg":"-gif"}function s(){return n("span",{id:"js-status-image",className:"icon",dataName:"progress",notAppend:!0})}function a(t,e){const r=o.loading(),n=r.parentElement,i=DOM.getRefreshButton(e);let s;return"top"===t?s=i.parentElement:(s=DOM.getCurrentFile(),s=s?DOM.getByDataName("js-name",s):i.parentElement),(!n||n&&n!==s)&&s.appendChild(r),DOM.show(r),r}t.exports.get=s,t.exports.loading=()=>{const t=s(),{classList:e}=t,r="loading"+i();return e.add("loading",r),e.remove("error","hidden"),t},t.exports.error=()=>{const t=s(),{classList:e}=t,r="loading"+i();return e.add("error"),e.remove("hidden","loading",r),t},t.exports.show=a,t.exports.show.load=a,t.exports.show.error=function(t){const e=o.error();return DOM.show(e),e.title=t,e},t.exports.hide=()=>{const t=o.get();return DOM.hide(t),o},t.exports.setProgress=(t,e)=>{const r=o.get();return r?(r.setAttribute("data-progress",t+"%"),e&&(r.title=e),o):o},t.exports.clearProgress=()=>{const t=o.get();return t?(t.setAttribute("data-progress",""),t.title="",o):o}},function(t,e,r){"use strict";const n=r(0),o=n((t,e,r)=>t.setAttribute(r,e[r])),i=n((t,e,r)=>t[r]=e[r]),s=n((t,e)=>!t(e)),a=t=>t!=t.toLowerCase();function u(t){var e;if(t)return e=t,document.querySelector(`[data-name="${e}"]`)}t.exports=(t,e={})=>{const{dataName:r,notAppend:n,parent:c=document.body,uniq:l=!0,...f}=e,h=u(r);if(l&&h)return h;const p=document.createElement(t);return r&&(p.dataset.name=r),Object.keys(f).filter(a).map(i(p,e)),Object.keys(f).filter(s(a)).map(o(p,e)),n||c.appendChild(p),p},t.exports.isElementPresent=u},function(t,e,r){"use strict";t.exports=async(t,...e)=>{!function(t){if("function"!=typeof t)throw Error("fn should be a function!")}(t);try{return[null,await t(...e)]}catch(t){return[t]}}},function(t,e,r){"use strict";const{promisify:n}=r(42),o=r(2),i=()=>{},s=(t,e,r)=>{t.addEventListener(e,n=>{r(n),t.removeEventListener(e,r)})},a=async t=>{switch(function(t){let e,r="";"string"==typeof t&&(e=t.lastIndexOf("."),~e&&(r=t.substr(e)));return r}(t)){case".js":return await a.js(t);case".css":return await a.css(t);case".json":return await a.json(t);default:return await a.ajax(t)}};function u(t){if(!("string"==typeof t))return"";~t.indexOf(":")&&(t+="-join");const e=t.lastIndexOf("/")+1,r=t.substr(t,e);return t.replace(r,"").replace(/\./g,"-")}a.onerror=i,a.onload=i,a.addLoadListener=t=>{a.onload=t},a.addErrorListener=t=>{a.onerror=t},t.exports=a,a.js=n((t,e)=>{const r=u(t);let n=document.getElementById(r);if(n)return e();n=o("script",{id:r,src:t}),s(n,"load",t=>{e(null,t),a.onload()}),s(n,"error",r=>{e(r),document.body.removeChild(n),a.onerror(r,t)})}),a.css=n((t,e)=>{const r=u(t);let n=document.getElementById(r);if(n)return e();n=o("link",{id:u(t),rel:"stylesheet",href:t,parent:document.head}),n.addEventListener("load",t=>{e(null,t),a.onload()}),n.addEventListener("error",r=>{e(r),document.head.removeChild(n),a.onerror(r,t)})}),a.ajax=n((t,e)=>{const r=new XMLHttpRequest;r.open("GET",t,!0),r.addEventListener("load",()=>{if(r.status>=200&&r.status<400){const t=r.responseText;e(null,t),a.onload()}}),r.addEventListener("error",t=>{a.onerror(t),e(t)}),r.send()}),a.json=n((t,e)=>{a.ajax(t,(t,r)=>{let n;t||(n=JSON.parse(r)),e(t,n)})}),a.series=async t=>{const e=t.shift();e&&(await a(e),await a.series(t))},a.parallel=async t=>{const e=t.map(a);return await Promise.all(e)},a.getIdBySrc=u},function(t,e,r){!function(e){"use strict";function r(){var t=Array.prototype.slice,e=function(e){var r,n="function"==typeof e,o=t.call(arguments,1);return n&&(r=e.apply(null,o)),r};return e.with=function(t){var e=Array.prototype.slice,r=e.call(arguments,1);return function(){var n=e.call(arguments),o=r.concat(n);return t.apply(null,o)}},e.ret=function(){var r=t.call(arguments);return r.unshift(e),e.with.apply(null,r)},e.if=function(t,r,n){t?e(r):e(n,r)},e.ifExist=function(t,e,r){var n=t&&t[e];n&&(n=n.apply(t,r))},e.parallel=function(r,n){var o,i,s="could not be empty!",a=[],u=!1,c=[],l=0,f=0,h=(o=r,i=new RegExp("\\s([a-zA-Z]+)"),{}.toString.call(o).match(i)[1].toLowerCase());if(!r)throw Error("funcs "+s);if(!n)throw Error("callback "+s);switch(h){case"array":f=r.length,r.forEach((function(t,r){e(t,(function(){p(r,arguments)}))}));break;case"object":a=Object.keys(r),f=a.length,a.forEach((function(t){var n=r[t];e(n,(function(){p(t,arguments)}))}))}function p(e,r){var o,i=t.call(r,1),s=r[0],a=i.length;o=++l===f,s||(c[e]=a>=2?i:i[0]),u||!s&&!o||(u=!0,"array"===h?n.apply(null,[s].concat(c)):n(s,c))}},e.series=function(t,r){var n,o=t.length;if(!Array.isArray(t))throw Error("funcs should be array!");n=t.shift(),e(n,(function(n){(function(t){var n;return--o&&!t||(n=!0,e(r,t)),n})(n)||e.series(t,r)}))},e.each=function(t,r,n){var o=t.map((function(t){return r.bind(null,t)}));o.length?e.parallel(o,n):n()},e.eachSeries=function(t,r,n){var o=t.map((function(t){return r.bind(null,t)}));if("function"!=typeof n)throw Error("callback should be function");o.length?e.series(o,n):n()},e.try=function(t){var e;try{e=t()}catch(t){e=t}return e},e}t.exports?t.exports=new r:e.exec=new r}(this)},function(t,e,r){"use strict";const n=r(12),o=r(0),i=r(7),{encode:s}=r(17),{btoa:a}=r(26),u=o((function(t,e,r){const n="asc"===e?"↑":"↓";return t!==r||"name"===t&&"asc"===e?r:`${r}${n}`})),c="/fs",l=i();function f(t,e,r){if(!t)throw Error("url could not be empty!");if(!r)throw Error("template could not be empty!");const o=["/",...t.split("/").slice(1,-1)],i=[],s=o.length;let a="/";for(let t=0;t<s;t++){const u=o[t],c=t===s-1;if(t&&(a+=u+"/"),t&&c){i.push(u+"/");continue}const l=t?"/":"";i.push(n(r,{path:a,name:u,slash:l,prefix:e}))}return i.join("")}l("/"),t.exports.FS=c,t.exports.apiURL="/api/v1",t.exports.MAX_FILE_SIZE=512e3,t.exports.getHeaderField=u,t.exports.getPathLink=f,t.exports.getDotDot=m,t.exports.formatMsg=(t,e,r)=>((e=e||"")&&(e='("'+e+'")'),t+": "+(r=r||"ok")+e),t.exports.getTitle=t=>{t=t||{};const{path:e=l(),name:r}=t;return[r||"Cloud Commander",e].filter(Boolean).join(" - ")};const h=t=>`data-name="js-file-${a(encodeURI(t))}" `;function p(t){return{...t,date:t.date||"--.--.----",owner:t.owner||"root",size:g(t)}}function d(t){return"directory"===t?"":'target="_blank" '}function g(t){const{size:e,type:r}=t;return"directory"===r?"&lt;dir&gt;":/link/.test(r)?"&lt;link&gt;":e}function m(t){const e=t.substr(t,t.lastIndexOf("/")),r=e.substr(e,e.lastIndexOf("/"));return r||"/"}t.exports.buildFromJSON=t=>{const{prefix:e,template:r,sort:o="name",order:i="asc"}=t,a=r.file,g=r.link,y=t.data,w=s(y.path),{files:v}=y,b=f(w,e,r.pathLink);let x=n(r.path,{link:e+c+w,fullPath:w,path:b});const C=u(o,i),E=C("name"),P=C("size"),A=C("date"),k=n(a,{tag:"div",attribute:'data-name="js-fm-header" ',className:"fm-header",type:"",name:E,size:P,date:A,owner:"owner",mode:"mode"});if(l(w),x+=k+'<ul data-name="js-files" class="files">',"/"!==w){const t=m(w),o=e+c+t,i=n(r.link,{link:o,title:"..",name:".."}),s='draggable="true" '+h("..");x+=n(r.file,{tag:"li",attribute:s,className:"",type:"directory",name:i,size:"&lt;dir&gt;",date:"--.--.----",owner:".",mode:"--- --- ---"})}return x+=v.map(p).map(t=>{const r=s(t.name),o=e+c+w+r,{type:i,mode:u,date:l,owner:f,size:p}=t,m=n(g,{link:o,title:r,name:r,attribute:d(t.type)}),y=h(t.name);return n(a,{tag:"li",attribute:'draggable="true" '+y,className:"",type:i,name:m,size:p,date:l,owner:f,mode:u})}).join(""),x+="</ul>",x},t.exports._getSize=g},function(t,e,r){"use strict";t.exports=t=>{const e={value:t};return(...t)=>{const[r]=t;return t.length?(e.value=r,r):e.value}}},function(t,e,r){"use strict";const n=t=>(...e)=>(...r)=>t(...e,...r);t.exports=(t,...e)=>(function(t){if("function"!=typeof t)throw Error("fn should be a function!")}(t),e.length?n(t)(...e):n(t))},function(t,e,r){"use strict";const n=r(5);t.exports.escapeRegExp=t=>("string"==typeof t&&(t=t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),t),t.exports.getRegExp=t=>{const e="^"+t.replace(/\./g,"\\.").replace(/\*/g,".*").replace("?",".?")+"$";return RegExp(e)},t.exports.exec=n,t.exports.getExt=t=>{if(!("string"==typeof t))return"";const e=t.lastIndexOf(".");return~e?t.substr(e):""},t.exports.findObjByNameInArr=(t,e)=>{let r;if(!Array.isArray(t))throw Error("array should be array!");if("string"!=typeof e)throw Error("name should be string!");return t.some(t=>{const n=t.name===e,o=Array.isArray(t);return n?(r=t,n):o?t.some(t=>{const n=t.name===e;return n&&(r=t.data),n}):n}),r},t.exports.time=t=>{n.ifExist(console,"time",[t])},t.exports.timeEnd=t=>{n.ifExist(console,"timeEnd",[t])}},function(t,e,r){"use strict";const n=r(9),o=r(1),i=r(13),s=r(14),a=r(19),u=r(28),c=r(21),l=r(11),f=r(51),h=r(29),p=r(53),d=t.exports,g={...p,...h,...d},m={};g.Images=o,g.load=i,g.Files=s,g.RESTful=a,g.IO=u,g.Storage=c,g.Dialog=l,g.CurrentInfo=m,t.exports=g,g.uploadDirectory=r(54),g.Buffer=r(31),g.Events=r(16);const y=r(65),w=r(66),v={"js-left":null,"js-right":null};async function b(t){const{Dialog:e}=g,r=g.getCurrentDirPath(),n="New "+t||!1,o=(()=>{const t=g.getCurrentName();return".."===t?"":t})(),[i,s]=await e.prompt(n,o);if(i)return;const u=`${r}${s}`;"directory"===t?await a.createDirectory(u):await a.write(u),await CloudCmd.refresh({currentName:s})}t.exports.loadRemote=(t,e,r)=>(y(t,e,r),g),t.exports.loadSocket=t=>(g.loadRemote("socket",{name:"io"},t),g),t.exports.promptNewDir=async function(){await b("directory")},t.exports.promptNewFile=async()=>{await b("file")},t.exports.getCurrentDirName=()=>{const t=g.getCurrentDirPath().replace(/\/$/,""),e=t.substr(t,t.lastIndexOf("/"));return t.replace(e+"/","")||"/"},t.exports.getParentDirPath=t=>{const e=g.getCurrentDirPath(t),r=g.getCurrentDirName()+"/",n=e.lastIndexOf(r);return"/"!==e?e.slice(0,n):e},t.exports.getNotCurrentDirPath=()=>{const t=g.getPanel({active:!1});return g.getCurrentDirPath(t)},t.exports.getCurrentByName=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m.panel;const r="js-file-"+btoa(encodeURI(t)),n=g.getByDataName(r,e);return n},t.exports.getSelectedFiles=()=>{const t=g.getPanel(),e=g.getByClassAll("selected-file",t);return Array.from(e)},t.exports.unselectFiles=t=>{t=t||g.getSelectedFiles(),Array.from(t).forEach(g.toggleSelectedFile)},t.exports.getActiveFiles=()=>{const t=g.getCurrentFile(),e=g.getSelectedFiles(),r=g.getCurrentName(t);return e.length||".."===r?e:[t]},t.exports.getCurrentDate=t=>{const e=t||g.getCurrentFile();return g.getByDataName("js-date",e).textContent},t.exports.getCurrentSize=t=>{const e=t||g.getCurrentFile();return g.getByDataName("js-size",e).textContent.replace(/^<|>$/g,"")},t.exports.loadCurrentSize=async t=>{const e=t||g.getCurrentFile(),r=g.getCurrentPath(e);if(o.show.load(),".."===name)return;const[,n]=await a.read(r+"?size");return g.setCurrentSize(n,e),o.hide(),e},t.exports.loadCurrentHash=async t=>{const e=t||g.getCurrentFile(),r=g.getCurrentPath(e),[,n]=await a.read(r+"?hash");return n},t.exports.setCurrentSize=(t,e)=>{const r=e||g.getCurrentFile();g.getByDataName("js-size",r).textContent=t},t.exports.getCurrentMode=t=>{const e=t||g.getCurrentFile();return g.getByDataName("js-mode",e).textContent},t.exports.getCurrentOwner=t=>{const e=t||g.getCurrentFile();return g.getByDataName("js-owner",e).textContent},t.exports.getCurrentData=async t=>{const{Dialog:e}=g,r=g.CurrentInfo,n=t||g.getCurrentFile(),o=g.getCurrentPath(n),i=g.isCurrentIsDir(n);if(".."===r.name)return e.alert.noFiles(),[Error("No Files")];if(i)return await a.read(o);const[s,u]=await g.checkStorageHash(o);if(!s)return[Error("Can't get hash of a file")];if(u===s)return[null,await c.get(o+"-data")];const[l,f]=await a.read(o);if(l)return[l,null];const{length:h}=f;return u&&h<1073741824&&await g.saveDataToStorage(o,f,s),[null,f]},t.exports.getRefreshButton=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g.getPanel();return g.getByDataName("js-refresh",t)},t.exports.selectFile=t=>((t||g.getCurrentFile()).classList.add("selected-file"),d),t.exports.unselectFile=t=>((t||g.getCurrentFile()).classList.remove("selected-file"),d),t.exports.toggleSelectedFile=t=>{const e=t||g.getCurrentFile();return".."===g.getCurrentName(e)||e.classList.toggle("selected-file"),d},t.exports.toggleAllSelectedFiles=()=>(g.getAllFiles().map(g.toggleSelectedFile),d),t.exports.selectAllFiles=()=>(g.getAllFiles().map(g.selectFile),d),t.exports.getAllFiles=()=>{const t=g.getPanel(),e=g.getFiles(t),r=g.getCurrentName(e[0]),n=".."===r?1:0;return Array.from(e).slice(n)},t.exports.expandSelection=()=>{const{files:t}=m;w("expand",t)},t.exports.shrinkSelection=()=>{const{files:t}=m;w("shrink",t)},t.exports.setHistory=(t,e,r)=>{const n=window.history,{prefix:o}=CloudCmd;return r=o+r,n&&history.pushState(t,e,r),n},t.exports.isSelected=t=>!!t&&g.isContainClass(t,"selected-file"),t.exports.getCurrentLink=t=>{const e=t||g.getCurrentFile();return g.getByTag("a",e)[0]},t.exports.getFilenames=t=>{if(!t)throw Error("AllFiles could not be empty");const e=t[0]||g.getCurrentFile(),r=g.getCurrentName(e),n=Array.from(t);".."===r&&n.shift();return n.map(t=>g.getCurrentName(t))},t.exports.checkStorageHash=async t=>{const e=t+"-hash";if("string"!=typeof t)throw Error("name should be a string!");const[r,n]=await Promise.all([g.loadCurrentHash(),c.get(e)]);return[r,n]},t.exports.saveDataToStorage=async(t,e,r)=>{if(g.isCurrentIsDir())return;r=r||await g.loadCurrentHash();const n=t+"-hash",o=t+"-data";return await c.set(n,r),await c.set(o,e),r},t.exports.getFM=()=>g.getPanel().parentElement,t.exports.getPanelPosition=t=>(t=t||g.getPanel()).dataset.name.replace("js-",""),t.exports.getPanel=t=>{let e,r,n,o="js-";const i=g.getCurrentFile();if(i?(e=i.parentElement,r=e.parentElement,n="js-left"===r.getAttribute("data-name")):r=g.getByDataName("js-left"),t&&!t.active&&(o+=n?"right":"left",r=g.getByDataName(o)),window.innerWidth<CloudCmd.MIN_ONE_PANEL_WIDTH&&(r=g.getByDataName("js-left")),!r)throw Error("can not find Active Panel!");return r},t.exports.getFiles=t=>g.getByDataName("js-files",t).children||[],t.exports.showPanel=t=>{const e=g.getPanel({active:t});return!!e&&(g.show(e),!0)},t.exports.hidePanel=t=>{const e=g.getPanel({active:t});return!!e&&g.hide(e)},t.exports.remove=(t,e)=>((e||document.body).removeChild(t),g),t.exports.deleteCurrent=t=>{t||g.getCurrentFile();const e=null==t?void 0:t.parentElement,r=g.getCurrentName(t);if(t&&".."!==r){const r=t.nextSibling,n=t.previousSibling;g.setCurrentFile(r||n),e.removeChild(t)}},t.exports.deleteSelected=t=>{(t=t||g.getSelectedFiles())&&t.map(g.deleteCurrent)},t.exports.renameCurrent=f,t.exports.scrollIntoViewIfNeeded=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&t.scrollIntoViewIfNeeded&&t.scrollIntoViewIfNeeded(e)},t.exports.scrollByPages=(t,e)=>{const r=(null==t?void 0:t.scrollByPages)&&e;return r&&t.scrollByPages(e),r},t.exports.changePanel=()=>{const t=m;let e=g.getPanel();CloudCmd.emit("passive-dir",t.dirPath);const r=g.getPanel({active:!1});let n=g.getCurrentName();const o=g.getFiles(r);let i,s,a=e.getAttribute("data-name");return v[a]=n,e=r,a=e.getAttribute("data-name"),n=v[a],n&&(s=g.getCurrentByName(n,e),s&&(i=s.parentElement)),i&&i.parentElement||(s=g.getCurrentByName(n,e),s||([s]=o)),g.setCurrentFile(s,{history:!0}),CloudCmd.emit("active-dir",t.dirPath),g},t.exports.getPackerExt=t=>"zip"===t?".zip":".tar.gz",t.exports.goToDirectory=async()=>{const{Dialog:t}=g,{dirPath:e}=m,[r,n=e]=await t.prompt("Go to directory:",e);r||await CloudCmd.loadDir({path:n})},t.exports.duplicatePanel=async()=>{const t=m,{isDir:e}=t,r=t.panelPassive,n=!t.isOnePanel,o=(e=>e?t.path:t.dirPath)(e);await CloudCmd.loadDir({path:o,panel:r,noCurrent:n})},t.exports.swapPanels=async()=>{const t=m,{panel:e,files:r,element:n,panelPassive:o}=t,i=g.getCurrentDirPath(),s=g.getNotCurrentDirPath();let a=r.indexOf(n);await CloudCmd.loadDir({path:i,panel:o,noCurrent:!0}),await CloudCmd.loadDir({path:s,panel:e});const u=t.files.length-1;a>u&&(a=u);const c=t.files[a];g.setCurrentFile(c)},t.exports.CurrentInfo=m,t.exports.updateCurrentInfo=t=>{const e=g.CurrentInfo,r=t||g.getCurrentFile(),o=r.parentElement,i=o.parentElement||g.getPanel(),s=g.getPanel({active:!1}),a=g.getFiles(s),u=g.getCurrentName(r);e.dir=g.getCurrentDirName(),e.dirPath=g.getCurrentDirPath(),e.parentDirPath=g.getParentDirPath(),e.element=r,e.ext=n.getExt(u),e.files=Array.from(o.children),e.filesPassive=Array.from(a),e.first=o.firstChild,e.getData=g.getCurrentData,e.last=o.lastChild,e.link=g.getCurrentLink(r),e.mode=g.getCurrentMode(r),e.name=u,e.path=g.getCurrentPath(r),e.panel=i,e.panelPassive=s,e.size=g.getCurrentSize(r),e.isDir=g.isCurrentIsDir(),e.isSelected=g.isSelected(r),e.panelPosition=g.getPanel().dataset.name.replace("js-",""),e.isOnePanel=e.panel.getAttribute("data-name")===e.panelPassive.getAttribute("data-name")}},function(t,e,r){"use strict";const n=r(3),{alert:o,prompt:i,confirm:s,progress:a}=r(50),u="Cloud Commander";t.exports.alert=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return o(u,...e,{cancel:!1})},t.exports.prompt=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return n(i,u,...e)},t.exports.confirm=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return n(s,u,...e)},t.exports.progress=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return a(u,...e)},t.exports.alert.noFiles=()=>o(u,"No files selected!",{cancel:!1})},function(t,e,r){"use strict";t.exports=(t,e)=>{!function(t,e){if("string"!=typeof t)throw Error("template should be a string!");if("object"!=typeof e)throw Error("data should be an object!")}(t,e);let r=t;return Object.keys(e).forEach(t=>{const n="{{ "+t+" }}",o=(i=e[t],()=>i);for(var i;r.includes(n);)r=r.replace(n,o)}),r.includes("{{")&&(r=r.replace(/{{.*?}}/g,"")),r}},function(t,e,r){"use strict";const n=r(18),o=r(48),i=r(20),s=r(5),a=r(1);t.exports.getIdBySrc=function(t){if(!n.string(t))return;t.includes(":")&&(t+="-join");const e=t.lastIndexOf("/")+1,r=t.substr(t,e);return t.replace(r,"").replace(/\./g,"-")},t.exports.ajax=t=>{const e=t,r=n.object(e.data),i=n.array(e.data),u="arraybuffer"===n(e.data),c=e.type||e.method||"GET",{headers:l={}}=e,f=new XMLHttpRequest;f.open(c,e.url,!0);for(const t of Object.keys(l)){const e=l[t];f.setRequestHeader(t,e)}let h;e.responseType&&(f.responseType=e.responseType),h=!u&&r||i?o.stringify(e.data):e.data,f.onreadystatechange=t=>{const r=t.target;if(r.readyState!==r.DONE)return;a.clearProgress();const n=r.getResponseHeader("content-type");if(200!==r.status)return s(e.error,r);const i="text"!==e.dataType,u=n.includes("application/json");let c=r.response;n&&u&&i&&(c=o.parse(r.response)||r.response),s(e.success,c,r.statusText,r)},f.send(h)},t.exports.put=(t,e)=>{const r=i(),n=new XMLHttpRequest;return t=encodeURI(t).replace(/#/g,"%23"),n.open("put",t,!0),n.upload.onprogress=t=>{if(!t.lengthComputable)return;const e=t.loaded/t.total*100,n=Math.round(e);r.emit("progress",n)},n.onreadystatechange=()=>{if(!(n.readyState===n.DONE))return;if(200===n.status)return r.emit("end");const t=Error(n.responseText);r.emit("error",t)},n.send(e),r}},function(t,e,r){"use strict";const n=r(18),{promisify:o}=r(15),i=r(13),s=r(19),a={},u=function(t){let e;return r=>{e||(e=!0,setTimeout(()=>{e=!1,r()},t))}}(2e3);t.exports.get=function t(e){const r=n(e);if(function(t){if(!t)throw Error("name could not be empty!")}(e),"string"===r)return function(t){const e=new RegExp("file|path|link|pathLink|media|view/media-tmpl|config-tmpl|upload"),r=new RegExp("config|modules"),n=e.test(t),o=r.test(t);if(!n&&!o)return function(t){throw Error("Wrong file name: "+t)}(t);if("config"===t)return l();const i=function(t,e,r){let n;const o=new RegExp("view/media-tmpl|config-tmpl|upload").test(t);e?(n=o?"/tmpl/"+t.replace("-tmpl",""):"/tmpl/fs/"+t,n+=".hbs"):r&&(n="/json/"+t+".json");return n}(t,n,o);return c(i)}(e);if("array"===r)return Promise.all(e.map(t))};const c=o((t,e)=>{const{prefix:r}=CloudCmd;a[t]||(a[t]=new Promise((e,n)=>{const o=r+t;i.ajax({url:o,success:e,error:n})})),a[t].then(t=>{e(null,t)},r=>{a[t]=null,e(r)})}),l=async()=>{let t;a.config||(a.config=()=>(t=!0,s.Config.read()));const[,e]=await a.config();return e&&(t=!1),u(()=>{t||(a.config=null)}),e}},function(t,e,r){"use strict";r.r(e),r.d(e,"promisify",(function(){return n}));function n(t){if("function"!=typeof t)throw new TypeError("Argument to promisify must be a function");var e=t["__ES6-PROMISIFY--CUSTOM-ARGUMENTS__"],r=n.Promise||Promise;if("function"!=typeof r)throw new Error("No Promise implementation found; do you need a polyfill?");return function(){for(var n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];return new r((r,n)=>{o.push((function(t){if(t)return n(t);for(var o=arguments.length,i=Array(1<o?o-1:0),s=1;s<o;s++)i[s-1]=arguments[s];if(1===i.length||!e)return r(i[0]);var a={};i.forEach((t,r)=>{var n=e[r];n&&(a[n]=t)}),r(a)})),t.apply(this,o)})}}n.argumentNames="__ES6-PROMISIFY--CUSTOM-ARGUMENTS__",n.Promise=void 0},function(t,e,r){"use strict";const n=r(18),o=r(64);t.exports=new function(){const t=this,e=t=>"touchstart"===t&&{passive:!0};function r(t,o,i,s){let a;const u=[t,o,i,s],c=n(t);switch(c){default:if(!/element$/.test(c))throw Error("unknown eventName: "+c);r(u[1],u[0],i,s);break;case"string":a=n.function(o),a&&(i=o,o=null),o||(o=window),s(o,[t,i,e(t)]);break;case"array":for(const e of t)r(e,o,i,s);break;case"object":for(const e of Object.keys(t)){r(e,o,t[e],s)}}}function i(t){if(!t)throw Error("type could not be empty!")}this.add=(e,n,s)=>(i(e),r(e,n,s,(t,e)=>{const[r,n,i]=e;t.addEventListener(r,n,i),o.add(t,r,n)}),t),this.addOnce=(e,r,n)=>{const o=i=>{t.remove(e,r,o),n(i)};return n||(n=r,r=null),this.add(e,r,o),t},this.remove=(e,n,o)=>(i(e),r(e,n,o,(t,e)=>{t.removeEventListener(...e)}),t),this.removeAll=()=>{const t=o.get();for(const[e,r,n]of t)e.removeEventListener(r,n);o.clear()},this.addKey=function(){const e="keydown";for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const i=[e,...n];return t.add(...i)},this.rmKey=function(){const e="keydown";for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const i=[e,...n];return t.remove(...i)},this.addClick=function(){const e="click";for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const i=[e,...n];return t.add(...i)},this.rmClick=function(){const e="click";for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const i=[e,...n];return t.remove(...i)},this.addContextMenu=function(){const e="contextmenu";for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const i=[e,...n];return t.add(...i)},this.addError=function(){const e="error";for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const i=[e,...n];return t.add(...i)},this.addLoad=function(){const e="load";for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const i=[e,...n];return t.add(...i)}}},function(t,e,r){"use strict";const n={"&nbsp;":" ","&lt;":"<","&gt;":">","&quot;":'"'},o=Object.keys(n);t.exports.encode=t=>{for(const e of o){const r=RegExp(n[e],"g");t=t.replace(r,e)}return t},t.exports.decode=t=>{for(const e of o){const r=n[e],o=RegExp(e,"g");t=t.replace(o,r)}return t}},function(t,e,r){"use strict";t.exports=n;for(const t of["null","arrayBuffer","file","array","object"])n[t]=o.bind(null,t);for(const t of["string","undefined","boolean","number","function"])n[t]=i.bind(null,t);function n(t){return{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function o(t,e){return n(e)===t}function i(t,e){return typeof e===t}},function(t,e,r){"use strict";const n=r(3),{encode:o}=r(17),i=r(1),s=r(28),a=r(11),u=t=>async function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];const[u,c]=await n(t,...r);if(!u)return[u,c];const l=o(u.message);return i.show.error(l),a.alert(l),[u,c]};t.exports.delete=u(s.delete),t.exports.patch=u(s.patch),t.exports.write=u(s.write),t.exports.createDirectory=u(s.createDirectory),t.exports.read=u(s.read),t.exports.copy=u(s.copy),t.exports.pack=u(s.pack),t.exports.extract=u(s.extract),t.exports.move=u(s.move),t.exports.rename=u(s.rename),t.exports.Config={read:u(s.Config.read),write:u(s.Config.write)},t.exports.Markdown={read:u(s.Markdown.read),render:u(s.Markdown.render)}},function(t,e,r){"use strict";function n(){if(!(this instanceof n))return new n;this._all={}}function o(t){if("string"!=typeof t)throw Error("event should be string!")}function i(t,e){o(t),function(t){if("function"!=typeof t)throw Error("callback should be function!")}(e)}t.exports=n,n.prototype.on=function(t,e){const r=this._all[t];return i(t,e),r?r.push(e):this._all[t]=[e],this},n.prototype.addListener=n.prototype.on,n.prototype.once=function(t,e){const r=this;return i(t,e),this.on(t,(function n(...o){e(...o),r.off(t,n)})),this},n.prototype.off=function(t,e){const r=this._all[t]||[];let n=r.indexOf(e);for(i(t,e);~n;)r.splice(n,1),n=r.indexOf(e);return this},n.prototype.removeListener=n.prototype.off,n.prototype.emit=function(t,...e){const r=this._all[t];if(o(t),!r&&"error"===t)throw e[0];if(!r)return this;for(const t of r)t(...e);return this},n.prototype.removeAllListeners=function(t){return o(t),this._all[t]=[],this}},function(t,e,r){"use strict";const{parse:n,stringify:o}=JSON;t.exports.set=async(t,e)=>{localStorage.setItem(t,e)},t.exports.setJson=async(t,e)=>{localStorage.setItem(t,o(e))},t.exports.get=async t=>localStorage.getItem(t),t.exports.getJson=async t=>{const e=localStorage.getItem(t);return n(e)},t.exports.clear=()=>{localStorage.clear()},t.exports.remove=t=>{localStorage.removeItem(t)}},function(t,e,r){"use strict";r(173);const n=r(2),o=r(85),i=r(87),s=(t,...e)=>(t=>"function"==typeof t)(t)&&t(...e);t.exports=function t(e,r,a){if(!(this instanceof t))return new t(e,r,a);const u=new i;let c,l,f,h,p={};a?(c=h=e,p=r):r?(c=h=e,a=r):(c=document.body,h=window,a=e);const d={},g=function(t){const e=o(t,d,p);return n("ul",{dataName:"js-menu",className:"menu menu-hidden",innerHTML:e,parent:c,uniq:!1})}(a);function m(t,e){let r=u.getItem(t),n=u.isName(r),o=u.isItem(r),i=u.isSubMenu(r);return n&&o||(r=document.elementFromPoint(e.x,e.y),i=u.isSubMenu(r),n=u.isName(r),o=u.isItem(r)),{name:n,item:o,sub:i}}function y(t,e){t.stopPropagation();const{afterClick:r,beforeClick:n,beforeHide:o,afterHide:i,name:a}=p,c=t.target,l=e||m(c,{x:t.clientX,y:t.clientY}),f=s(n,a);if(l.sub)return t.preventDefault();if(s(o),x(),s(i),!f&&(l.name||l.item)){const t=function(t){const e=u.getName(t);if(!e)return null;const r=e.getAttribute("data-menu-path");return d[r]}(c);s(t),s(r)}}function w(t){t.preventDefault();const e=t.target,r=t.clientX,n=t.clientY,o=m(e,{x:r,y:n});if(o.name||o.item||o.sub)return y(t,o);x(),b(r,n)}function v(t,e){const r="number"==typeof t,n="number"==typeof e,o=function(){if(!l){const{height:t}=getComputedStyle(g);l=parseInt(t,10)}return l}(),i=function(){if(!f){const{width:t}=getComputedStyle(g);f=parseInt(t,10)}return f}(),s=window.innerHeight;window.innerWidth<i+t&&(t-=i)<0&&(t=0),s<o+e&&(e-=o)<0&&(e=0),r&&(g.style.left=t+"px"),n&&(g.style.top=e-14+"px")}function b(t,e){const{name:r,beforeShow:n,afterShow:o}=p,i={x:t,y:e,name:r},a=s(n,i);(a||!1!==a)&&(g.classList.remove("menu-hidden"),v(i.x,i.y),s(o,i))}function x(){s(p.beforeClose)||g.classList.add("menu-hidden")}h.addEventListener("click",y),this.show=b,this.hide=x,this.addContextMenuListener=()=>{h.addEventListener("contextmenu",w)},this.removeContextMenuListener=()=>{h.addEventListener("contextmenu",w)},this.remove=function(){h.removeEventListener("click",y),h.removeEventListener("contextmenu",w),c.removeChild(g)}}},function(t,e,r){"use strict";t.exports=t=>document.querySelector(`[data-name="modal-${t}"]`)},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&p())}function p(){if(!l){var t=a(h);l=!0;for(var e=c.length;e;){for(u=c,c=[];++f<e;)u&&u[f].run();f=-1,e=c.length}u=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function g(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new d(t,e)),1!==c.length||l||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},,function(t,e,r){"use strict";(function(e){t.exports.btoa=t=>"function"==typeof btoa?btoa(t):e.from(t).toString("base64"),t.exports.atob=t=>"function"==typeof atob?atob(t):e.from(t,"base64").toString("binary")}).call(this,r(43).Buffer)},function(t,e,r){"use strict";t.exports=(t,...e)=>{try{return[null,t(...e)]}catch(t){return[t]}}},function(t,e,r){"use strict";const{FS:n}=r(6),o=r(49),i={top:!0};t.exports.delete=async(t,e)=>await o({method:"DELETE",url:n+t,data:e,imgPosition:{top:Boolean(e)}}),t.exports.patch=async(t,e)=>await o({method:"PATCH",url:n+t,data:e,imgPosition:i}),t.exports.write=async(t,e)=>await o({method:"PUT",url:n+t,data:e,imgPosition:i}),t.exports.createDirectory=async t=>await o({method:"PUT",url:`${n}${t}?dir`,imgPosition:i}),t.exports.read=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";const r=!t.includes("?");return await o({method:"GET",url:n+t,notLog:r,dataType:e})},t.exports.copy=async(t,e,r)=>await o({method:"PUT",url:"/copy",data:{from:t,to:e,names:r},imgPosition:i}),t.exports.pack=async t=>await o({method:"PUT",url:"/pack",data:t}),t.exports.extract=async t=>await o({method:"PUT",url:"/extract",data:t}),t.exports.move=async(t,e,r)=>await o({method:"PUT",url:"/move",data:{from:t,to:e,names:r},imgPosition:i}),t.exports.rename=async(t,e)=>await o({method:"PUT",url:"/rename",data:{from:t,to:e},imgPosition:i}),t.exports.Config={read:async()=>await o({method:"GET",url:"/config",imgPosition:i,notLog:!0}),write:async t=>await o({method:"PATCH",url:"/config",data:t,imgPosition:i})},t.exports.Markdown={read:async t=>await o({method:"GET",url:"/markdown"+t,imgPosition:i,notLog:!0}),render:async t=>await o({method:"PUT",url:"/markdown",data:t,imgPosition:i,notLog:!0})}},function(t,e,r){"use strict";const{atob:n,btoa:o}=r(26),i=r(2),{encode:s,decode:a}=r(17),{getTitle:u,FS:c}=r(6);let l;const f=RegExp(String.fromCharCode(160),"g");t.exports._CURRENT_FILE="current-file",t.exports.setCurrentName=(t,e)=>{const r=DOM.CurrentInfo,{link:n}=r,{prefix:o}=CloudCmd,i=o+c+r.dirPath,a=s(t);return n.title=a,n.href=i+a,n.innerHTML=a,e.setAttribute("data-name",h(t)),CloudCmd.emit("current-file",e),n},t.exports.getCurrentName=t=>{const e=t||DOM.getCurrentFile();return e?p(e.getAttribute("data-name")):""};const h=t=>"js-file-"+o(encodeURI(t)),p=t=>(t=t.replace("js-file-",""),decodeURI(n(t)));t.exports.getCurrentDirPath=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:DOM.getPanel();const e=DOM.getByDataName("js-path",t);return e.textContent.replace(f," ")},t.exports.getCurrentPath=t=>{const e=t||DOM.getCurrentFile(),[r]=DOM.getByTag("a",e),{prefix:n}=CloudCmd,o=r.getAttribute("href").replace(RegExp("^"+n+c),"").replace(f," ");return a(o)},t.exports.getCurrentDirName=()=>{const t=DOM.getCurrentDirPath().replace(/\/$/,""),e=t.substr(t,t.lastIndexOf("/"));return t.replace(e+"/","")||"/"},t.exports.getParentDirPath=t=>{const e=DOM.getCurrentDirPath(t),r=DOM.getCurrentDirName()+"/",n=e.lastIndexOf(r);return"/"===e?e:e.slice(0,n)},t.exports.getNotCurrentDirPath=()=>{const t=DOM.getPanel({active:!1});return DOM.getCurrentDirPath(t)},t.exports.getCurrentFile=()=>DOM.getByClass("current-file"),t.exports.getCurrentByName=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:DOM.CurrentInfo.panel;const r="js-file-"+o(encodeURI(t));return DOM.getByDataName(r,e)},t.exports.setCurrentFile=(t,e)=>{const r=e,n=DOM.getCurrentFile();if(!t)return DOM;let o="";n&&(o=DOM.getCurrentDirPath(),function(t){DOM.isCurrentFile(t)&&t.classList.remove("current-file")}(n)),t.classList.add("current-file");const i=DOM.getCurrentDirPath(),s=CloudCmd.config("name");if(i!==o&&(DOM.setTitle(u({name:s,path:i})),!r||r.history)){const t="/"===i?i:c+i;DOM.setHistory(t,null,t)}return DOM.scrollIntoViewIfNeeded(t,!0),CloudCmd.emit("current-file",t),CloudCmd.emit("current-path",i),CloudCmd.emit("current-name",DOM.getCurrentName(t)),DOM},this.setCurrentByName=t=>{const e=DOM.getCurrentByName(t);return DOM.setCurrentFile(e)},t.exports.getCurrentByPosition=t=>{let{x:e,y:r}=t;const n=(t=>{const{tagName:e}=t;return/A|SPAN|LI/.test(e)?"A"===e?t.parentElement.parentElement:"SPAN"===e?t.parentElement:t:null})(document.elementFromPoint(e,r));return n&&"LI"!==n.tagName?null:n},t.exports.isCurrentFile=t=>!!t&&DOM.isContainClass(t,"current-file"),t.exports.setTitle=t=>(l||(l=DOM.getByTag("title")[0]||i("title",{innerHTML:t,parent:document.head})),l.textContent=t,DOM),t.exports.isCurrentIsDir=t=>{const e=t||DOM.getCurrentFile(),r=DOM.getCurrentPath(e),n=DOM.getCurrentType(e),o=/\.zip$/.test(r);return/^directory(-link)?/.test(n)||o},t.exports.getCurrentType=t=>{const e=t||DOM.getCurrentFile();return DOM.getByDataName("js-type",e).className.split(" ").pop()}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){"use strict";const n=r(63),o=r(21),i=r(10);t.exports=new function(){const t=i.CurrentInfo;function e(t){i.Dialog.alert(t)}function r(){const t=i.getActiveFiles();return i.getFilenames(t)}function s(t){if(CloudCmd.config("buffer"))return t();e("Buffer disabled in config!")}async function a(){await o.remove("copy"),await o.remove("cut"),function(){const t=i.getByClassAll("cut-file");for(const e of t)e.classList.remove("cut-file")}()}return{cut:s.bind(null,(async function(){const e=r(),n=t.dirPath;await a(),e.length&&(!function(){const t=i.getActiveFiles();for(const e of t)e.classList.add("cut-file")}(),await o.setJson("cut",{from:n,names:e}))})),copy:s.bind(null,(async function(){const e=r(),n=t.dirPath;await a(),e.length&&(await o.remove("cut"),await o.setJson("copy",{from:n,names:e}))})),clear:s.bind(null,a),paste:s.bind(null,(async function(){const[r,i,s]=await async function(){const[t,e,r]=await n([o.getJson("copy"),o.getJson("cut")]);return[t,e,r]}();if(r||!i&&!s)return e(r||"Buffer is empty!");const u=i?"copy":"move",c=i||s,{Operation:l}=CloudCmd,f=t.dirPath;if(c.from===f)return e("Path is same!");l.show(u,{...c,to:f}),await a()}))}}},function(t,e,r){"use strict";t.exports.addSlashToEnd=t=>{if(!t)throw Error("path could not be empty!");return"/"===t[t.length-1]?t:t+"/"},t.exports.size=t=>{const e=1073741824,r=1024*e,n=1024*r;return"number"==typeof t?t<1024?t+"b":t<1048576?(t/1024).toFixed(2)+"kb":t<e?(t/1048576).toFixed(2)+"mb":t<r?(t/e).toFixed(2)+"gb":t<n?(t/r).toFixed(2)+"tb":(t/n).toFixed(2)+"pb":t},t.exports.permissions=r(68)},function(t,e){t.exports=function(t){for(var e=t.split(r),n=e.length,o=new Array(n),i=0;i<n;i++){var s=e[i];""!==s&&(o[i]=s[0].toUpperCase()+s.slice(1))}return o.join("")};var r=/[\s\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,\-.\/:;<=>?@\[\]^_`{|}~]+/},,function(t,e,r){"use strict";t.exports=navigator.clipboard||{readText:function(){return Promise.reject()},writeText:async function(t){const e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select();const r=document.execCommand("copy");if(document.body.removeChild(e),r)return;return Promise.reject()}}},function(t,e,r){"use strict";t.exports={BACKSPACE:8,TAB:9,ENTER:13,CAPSLOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DELETE:46,ZERO:48,SEMICOLON:52,COLON:54,A:65,C:67,D:68,G:71,J:74,K:75,M:77,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,X:88,Z:90,INSERT_MAC:96,ASTERISK:106,PLUS:107,MINUS:109,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,EQUAL:187,HYPHEN:189,DOT:190,SLASH:191,TRA:192,BACKSLASH:220,BRACKET_CLOSE:221}},function(t,e,r){"use strict";const n=[()=>()=>{},t=>(...e)=>t(...e),(t,e)=>(...r)=>t(e(...r)),(t,e,r)=>(...n)=>t(e(r(...n))),(t,e,r,n)=>(...o)=>t(e(r(n(...o)))),(t,e,r,n,o)=>(...i)=>t(e(r(n(o(...i))))),(t,e,r,n,o,i)=>(...s)=>t(e(r(n(o(i(...s)))))),(t,e,r,n,o,i,s)=>(...a)=>t(e(r(n(o(i(s(...a)))))))];t.exports=(...t)=>t.length<n.length?n[t.length](...t):function(t){return(...e)=>{let r=t.length-1,n=t[r](...e);for(;--r;)n=t[r](n);return n}}(t)},function(t,e,r){"use strict";const{eachSeries:n}=r(5),o=r(8),i=r(13),s=r(1),{alert:a}=r(11),{FS:u}=r(6),c=o((function(t){CloudCmd.refresh({currentName:t})})),l=o((function(t,e,r,n){const{name:o}=r,a=t+o,{prefixURL:c}=CloudCmd,l=c+u;i.put(l+a,r).on("error",h).on("end",n).on("progress",t=>{const r=(t=>100/t)(e),n=0*r+function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return Math.round(t*r/e)}(t,100,r);s.show.load("top"),s.setProgress(Math.round(n))})})),{getCurrentDirPath:f}=r(10);function h(t){let{message:e}=t;a(e)}t.exports=(t,e)=>{e||(e=t,t=f());const r=e.length;if(!r)return;const o=Array.from(e),{name:i}=e[0];n(o,l(t,r),c(i))}},function(t,e,r){"use strict";const n=r(2),o=r(23);t.exports=(t,e)=>{if(o("title"))return void(o("title-text").textContent=t);const r=n("div",{className:"modal-title",dataName:"modal-title",parent:e});n("span",{parent:r,textContent:t,className:"modal-title-text",dataName:"modal-title-text"})}},function(t,e,r){var n=r(129),o={};for(var i in n)n.hasOwnProperty(i)&&(o[n[i]]=i);var s=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in s)if(s.hasOwnProperty(a)){if(!("channels"in s[a]))throw new Error("missing channels property: "+a);if(!("labels"in s[a]))throw new Error("missing channel labels property: "+a);if(s[a].labels.length!==s[a].channels)throw new Error("channel and label counts mismatch: "+a);var u=s[a].channels,c=s[a].labels;delete s[a].channels,delete s[a].labels,Object.defineProperty(s[a],"channels",{value:u}),Object.defineProperty(s[a],"labels",{value:c})}s.rgb.hsl=function(t){var e,r,n=t[0]/255,o=t[1]/255,i=t[2]/255,s=Math.min(n,o,i),a=Math.max(n,o,i),u=a-s;return a===s?e=0:n===a?e=(o-i)/u:o===a?e=2+(i-n)/u:i===a&&(e=4+(n-o)/u),(e=Math.min(60*e,360))<0&&(e+=360),r=(s+a)/2,[e,100*(a===s?0:r<=.5?u/(a+s):u/(2-a-s)),100*r]},s.rgb.hsv=function(t){var e,r,n,o,i,s=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(s,a,u),l=c-Math.min(s,a,u),f=function(t){return(c-t)/6/l+.5};return 0===l?o=i=0:(i=l/c,e=f(s),r=f(a),n=f(u),s===c?o=n-r:a===c?o=1/3+e-n:u===c&&(o=2/3+r-e),o<0?o+=1:o>1&&(o-=1)),[360*o,100*i,100*c]},s.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2];return[s.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(r,n))),100*(n=1-1/255*Math.max(e,Math.max(r,n)))]},s.rgb.cmyk=function(t){var e,r=t[0]/255,n=t[1]/255,o=t[2]/255;return[100*((1-r-(e=Math.min(1-r,1-n,1-o)))/(1-e)||0),100*((1-n-e)/(1-e)||0),100*((1-o-e)/(1-e)||0),100*e]},s.rgb.keyword=function(t){var e=o[t];if(e)return e;var r,i,s,a=1/0;for(var u in n)if(n.hasOwnProperty(u)){var c=n[u],l=(i=t,s=c,Math.pow(i[0]-s[0],2)+Math.pow(i[1]-s[1],2)+Math.pow(i[2]-s[2],2));l<a&&(a=l,r=u)}return r},s.keyword.rgb=function(t){return n[t]},s.rgb.xyz=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*r+.0722*n),100*(.0193*e+.1192*r+.9505*n)]},s.rgb.lab=function(t){var e=s.rgb.xyz(t),r=e[0],n=e[1],o=e[2];return n/=100,o/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},s.hsl.rgb=function(t){var e,r,n,o,i,s=t[0]/360,a=t[1]/100,u=t[2]/100;if(0===a)return[i=255*u,i,i];e=2*u-(r=u<.5?u*(1+a):u+a-u*a),o=[0,0,0];for(var c=0;c<3;c++)(n=s+1/3*-(c-1))<0&&n++,n>1&&n--,i=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,o[c]=255*i;return o},s.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,o=r,i=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,o*=i<=1?i:2-i,[e,100*(0===n?2*o/(i+o):2*r/(n+r)),100*((n+r)/2)]},s.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,o=Math.floor(e)%6,i=e-Math.floor(e),s=255*n*(1-r),a=255*n*(1-r*i),u=255*n*(1-r*(1-i));switch(n*=255,o){case 0:return[n,u,s];case 1:return[a,n,s];case 2:return[s,n,u];case 3:return[s,a,n];case 4:return[u,s,n];case 5:return[n,s,a]}},s.hsv.hsl=function(t){var e,r,n,o=t[0],i=t[1]/100,s=t[2]/100,a=Math.max(s,.01);return n=(2-i)*s,r=i*a,[o,100*(r=(r/=(e=(2-i)*a)<=1?e:2-e)||0),100*(n/=2)]},s.hwb.rgb=function(t){var e,r,n,o,i,s,a,u=t[0]/360,c=t[1]/100,l=t[2]/100,f=c+l;switch(f>1&&(c/=f,l/=f),n=6*u-(e=Math.floor(6*u)),0!=(1&e)&&(n=1-n),o=c+n*((r=1-l)-c),e){default:case 6:case 0:i=r,s=o,a=c;break;case 1:i=o,s=r,a=c;break;case 2:i=c,s=r,a=o;break;case 3:i=c,s=o,a=r;break;case 4:i=o,s=c,a=r;break;case 5:i=r,s=c,a=o}return[255*i,255*s,255*a]},s.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,o=t[3]/100;return[255*(1-Math.min(1,e*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o))]},s.xyz.rgb=function(t){var e,r,n,o=t[0]/100,i=t[1]/100,s=t[2]/100;return r=-.9689*o+1.8758*i+.0415*s,n=.0557*o+-.204*i+1.057*s,e=(e=3.2406*o+-1.5372*i+-.4986*s)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(e=Math.min(Math.max(0,e),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},s.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2];return r/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(e-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},s.lab.xyz=function(t){var e,r,n,o=t[0];e=t[1]/500+(r=(o+16)/116),n=r-t[2]/200;var i=Math.pow(r,3),s=Math.pow(e,3),a=Math.pow(n,3);return r=i>.008856?i:(r-16/116)/7.787,e=s>.008856?s:(e-16/116)/7.787,n=a>.008856?a:(n-16/116)/7.787,[e*=95.047,r*=100,n*=108.883]},s.lab.lch=function(t){var e,r=t[0],n=t[1],o=t[2];return(e=360*Math.atan2(o,n)/2/Math.PI)<0&&(e+=360),[r,Math.sqrt(n*n+o*o),e]},s.lch.lab=function(t){var e,r=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[r,n*Math.cos(e),n*Math.sin(e)]},s.rgb.ansi16=function(t){var e=t[0],r=t[1],n=t[2],o=1 in arguments?arguments[1]:s.rgb.hsv(t)[2];if(0===(o=Math.round(o/50)))return 30;var i=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return 2===o&&(i+=60),i},s.hsv.ansi16=function(t){return s.rgb.ansi16(s.hsv.rgb(t),t[2])},s.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},s.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var r=.5*(1+~~(t>50));return[(1&e)*r*255,(e>>1&1)*r*255,(e>>2&1)*r*255]},s.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var r;return t-=16,[Math.floor(t/36)/5*255,Math.floor((r=t%36)/6)/5*255,r%6/5*255]},s.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},s.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];3===e[0].length&&(r=r.split("").map((function(t){return t+t})).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},s.rgb.hcg=function(t){var e,r=t[0]/255,n=t[1]/255,o=t[2]/255,i=Math.max(Math.max(r,n),o),s=Math.min(Math.min(r,n),o),a=i-s;return e=a<=0?0:i===r?(n-o)/a%6:i===n?2+(o-r)/a:4+(r-n)/a+4,e/=6,[360*(e%=1),100*a,100*(a<1?s/(1-a):0)]},s.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=1,o=0;return(n=r<.5?2*e*r:2*e*(1-r))<1&&(o=(r-.5*n)/(1-n)),[t[0],100*n,100*o]},s.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,o=0;return n<1&&(o=(r-n)/(1-n)),[t[0],100*n,100*o]},s.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(0===r)return[255*n,255*n,255*n];var o,i=[0,0,0],s=e%1*6,a=s%1,u=1-a;switch(Math.floor(s)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=u,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=u,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=u}return o=(1-r)*n,[255*(r*i[0]+o),255*(r*i[1]+o),255*(r*i[2]+o)]},s.hcg.hsv=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e),n=0;return r>0&&(n=e/r),[t[0],100*n,100*r]},s.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100*(1-e)+.5*e,n=0;return r>0&&r<.5?n=e/(2*r):r>=.5&&r<1&&(n=e/(2*(1-r))),[t[0],100*n,100*r]},s.hcg.hwb=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e);return[t[0],100*(r-e),100*(1-r)]},s.hwb.hcg=function(t){var e=t[1]/100,r=1-t[2]/100,n=r-e,o=0;return n<1&&(o=(r-n)/(1-n)),[t[0],100*n,100*o]},s.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},s.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},s.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},s.gray.hsl=s.gray.hsv=function(t){return[0,0,t[0]]},s.gray.hwb=function(t){return[0,100,t[0]]},s.gray.cmyk=function(t){return[0,0,0,t[0]]},s.gray.lab=function(t){return[t[0],0,0]},s.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r},s.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.promisify=n;function n(t){if("function"!=typeof t)throw new TypeError("Argument to promisify must be a function");var e=t["__ES6-PROMISIFY--CUSTOM-ARGUMENTS__"],r=n.Promise||Promise;if("function"!=typeof r)throw new Error("No Promise implementation found; do you need a polyfill?");return function(){for(var n=this,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return new r((function(r,o){i.push((function(t){if(t)return o(t);for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];if(1===i.length||!e)return r(i[0]);var a={};i.forEach((function(t,r){var n=e[r];n&&(a[n]=t)})),r(a)})),t.apply(n,i)}))}}n.argumentNames="__ES6-PROMISIFY--CUSTOM-ARGUMENTS__",n.Promise=void 0},function(t,e,r){"use strict";(function(t){
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[0],[function(t,e,r){"use strict";const n=(t,...e)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),e.length>=t.length)return t(...e);const r=(...r)=>n(t,...e,...r),o=t.length-e.length-1;return(t=>[function(e){return t(...arguments)},function(e,r){return t(...arguments)},function(e,r,n){return t(...arguments)},function(e,r,n,o){return t(...arguments)},function(e,r,n,o,i){return t(...arguments)}])(r)[o]||r};t.exports=n},function(t,e,r){"use strict";const n=r(2),o=t.exports;function i(){return function(){const t=document.createElementNS;if(!t)return!1;const e=t.bind(document),r=e("http://www.w3.org/2000/svg","animate").toString();return/SVGAnimate/.test(r)}()?"-svg":"-gif"}function s(){return n("span",{id:"js-status-image",className:"icon",dataName:"progress",notAppend:!0})}function a(t,e){const r=o.loading(),n=r.parentElement,i=DOM.getRefreshButton(e);let s;return"top"===t?s=i.parentElement:(s=DOM.getCurrentFile(),s=s?DOM.getByDataName("js-name",s):i.parentElement),(!n||n&&n!==s)&&s.appendChild(r),DOM.show(r),r}t.exports.get=s,t.exports.loading=()=>{const t=s(),{classList:e}=t,r="loading"+i();return e.add("loading",r),e.remove("error","hidden"),t},t.exports.error=()=>{const t=s(),{classList:e}=t,r="loading"+i();return e.add("error"),e.remove("hidden","loading",r),t},t.exports.show=a,t.exports.show.load=a,t.exports.show.error=function(t){const e=o.error();return DOM.show(e),e.title=t,e},t.exports.hide=()=>{const t=o.get();return DOM.hide(t),o},t.exports.setProgress=(t,e)=>{const r=o.get();return r?(r.setAttribute("data-progress",t+"%"),e&&(r.title=e),o):o},t.exports.clearProgress=()=>{const t=o.get();return t?(t.setAttribute("data-progress",""),t.title="",o):o}},function(t,e,r){"use strict";const n=r(0),o=n((t,e,r)=>t.setAttribute(r,e[r])),i=n((t,e,r)=>t[r]=e[r]),s=n((t,e)=>!t(e)),a=t=>t!=t.toLowerCase();function u(t){var e;if(t)return e=t,document.querySelector(`[data-name="${e}"]`)}t.exports=(t,e={})=>{const{dataName:r,notAppend:n,parent:c=document.body,uniq:l=!0,...f}=e,h=u(r);if(l&&h)return h;const p=document.createElement(t);return r&&(p.dataset.name=r),Object.keys(f).filter(a).map(i(p,e)),Object.keys(f).filter(s(a)).map(o(p,e)),n||c.appendChild(p),p},t.exports.isElementPresent=u},function(t,e,r){"use strict";t.exports=async(t,...e)=>{!function(t){if("function"!=typeof t)throw Error("fn should be a function!")}(t);try{return[null,await t(...e)]}catch(t){return[t]}}},function(t,e,r){"use strict";const{promisify:n}=r(42),o=r(2),i=()=>{},s=(t,e,r)=>{t.addEventListener(e,n=>{r(n),t.removeEventListener(e,r)})},a=async t=>{switch(function(t){let e,r="";"string"==typeof t&&(e=t.lastIndexOf("."),~e&&(r=t.substr(e)));return r}(t)){case".js":return await a.js(t);case".css":return await a.css(t);case".json":return await a.json(t);default:return await a.ajax(t)}};function u(t){if(!("string"==typeof t))return"";~t.indexOf(":")&&(t+="-join");const e=t.lastIndexOf("/")+1,r=t.substr(t,e);return t.replace(r,"").replace(/\./g,"-")}a.onerror=i,a.onload=i,a.addLoadListener=t=>{a.onload=t},a.addErrorListener=t=>{a.onerror=t},t.exports=a,a.js=n((t,e)=>{const r=u(t);let n=document.getElementById(r);if(n)return e();n=o("script",{id:r,src:t}),s(n,"load",t=>{e(null,t),a.onload()}),s(n,"error",r=>{e(r),document.body.removeChild(n),a.onerror(r,t)})}),a.css=n((t,e)=>{const r=u(t);let n=document.getElementById(r);if(n)return e();n=o("link",{id:u(t),rel:"stylesheet",href:t,parent:document.head}),n.addEventListener("load",t=>{e(null,t),a.onload()}),n.addEventListener("error",r=>{e(r),document.head.removeChild(n),a.onerror(r,t)})}),a.ajax=n((t,e)=>{const r=new XMLHttpRequest;r.open("GET",t,!0),r.addEventListener("load",()=>{if(r.status>=200&&r.status<400){const t=r.responseText;e(null,t),a.onload()}}),r.addEventListener("error",t=>{a.onerror(t),e(t)}),r.send()}),a.json=n((t,e)=>{a.ajax(t,(t,r)=>{let n;t||(n=JSON.parse(r)),e(t,n)})}),a.series=async t=>{const e=t.shift();e&&(await a(e),await a.series(t))},a.parallel=async t=>{const e=t.map(a);return await Promise.all(e)},a.getIdBySrc=u},function(t,e,r){!function(e){"use strict";function r(){var t=Array.prototype.slice,e=function(e){var r,n="function"==typeof e,o=t.call(arguments,1);return n&&(r=e.apply(null,o)),r};return e.with=function(t){var e=Array.prototype.slice,r=e.call(arguments,1);return function(){var n=e.call(arguments),o=r.concat(n);return t.apply(null,o)}},e.ret=function(){var r=t.call(arguments);return r.unshift(e),e.with.apply(null,r)},e.if=function(t,r,n){t?e(r):e(n,r)},e.ifExist=function(t,e,r){var n=t&&t[e];n&&(n=n.apply(t,r))},e.parallel=function(r,n){var o,i,s="could not be empty!",a=[],u=!1,c=[],l=0,f=0,h=(o=r,i=new RegExp("\\s([a-zA-Z]+)"),{}.toString.call(o).match(i)[1].toLowerCase());if(!r)throw Error("funcs "+s);if(!n)throw Error("callback "+s);switch(h){case"array":f=r.length,r.forEach((function(t,r){e(t,(function(){p(r,arguments)}))}));break;case"object":a=Object.keys(r),f=a.length,a.forEach((function(t){var n=r[t];e(n,(function(){p(t,arguments)}))}))}function p(e,r){var o,i=t.call(r,1),s=r[0],a=i.length;o=++l===f,s||(c[e]=a>=2?i:i[0]),u||!s&&!o||(u=!0,"array"===h?n.apply(null,[s].concat(c)):n(s,c))}},e.series=function(t,r){var n,o=t.length;if(!Array.isArray(t))throw Error("funcs should be array!");n=t.shift(),e(n,(function(n){(function(t){var n;return--o&&!t||(n=!0,e(r,t)),n})(n)||e.series(t,r)}))},e.each=function(t,r,n){var o=t.map((function(t){return r.bind(null,t)}));o.length?e.parallel(o,n):n()},e.eachSeries=function(t,r,n){var o=t.map((function(t){return r.bind(null,t)}));if("function"!=typeof n)throw Error("callback should be function");o.length?e.series(o,n):n()},e.try=function(t){var e;try{e=t()}catch(t){e=t}return e},e}t.exports?t.exports=new r:e.exec=new r}(this)},function(t,e,r){"use strict";const n=r(12),o=r(0),i=r(7),{encode:s}=r(17),{btoa:a}=r(26),u=o((function(t,e,r){const n="asc"===e?"↑":"↓";return t!==r||"name"===t&&"asc"===e?r:`${r}${n}`})),c="/fs",l=i();function f(t,e,r){if(!t)throw Error("url could not be empty!");if(!r)throw Error("template could not be empty!");const o=["/",...t.split("/").slice(1,-1)],i=[],s=o.length;let a="/";for(let t=0;t<s;t++){const u=o[t],c=t===s-1;if(t&&(a+=u+"/"),t&&c){i.push(u+"/");continue}const l=t?"/":"";i.push(n(r,{path:a,name:u,slash:l,prefix:e}))}return i.join("")}l("/"),t.exports.FS=c,t.exports.apiURL="/api/v1",t.exports.MAX_FILE_SIZE=512e3,t.exports.getHeaderField=u,t.exports.getPathLink=f,t.exports.getDotDot=m,t.exports.formatMsg=(t,e,r)=>((e=e||"")&&(e='("'+e+'")'),t+": "+(r=r||"ok")+e),t.exports.getTitle=t=>{t=t||{};const{path:e=l(),name:r}=t;return[r||"Cloud Commander",e].filter(Boolean).join(" - ")};const h=t=>`data-name="js-file-${a(encodeURI(t))}" `;function p(t){return{...t,date:t.date||"--.--.----",owner:t.owner||"root",size:g(t)}}function d(t){return"directory"===t?"":'target="_blank" '}function g(t){const{size:e,type:r}=t;return"directory"===r?"&lt;dir&gt;":/link/.test(r)?"&lt;link&gt;":e}function m(t){const e=t.substr(t,t.lastIndexOf("/")),r=e.substr(e,e.lastIndexOf("/"));return r||"/"}t.exports.buildFromJSON=t=>{const{prefix:e,template:r,sort:o="name",order:i="asc"}=t,a=r.file,g=r.link,y=t.data,w=s(y.path),{files:v}=y,b=f(w,e,r.pathLink);let x=n(r.path,{link:e+c+w,fullPath:w,path:b});const C=u(o,i),E=C("name"),P=C("size"),A=C("date"),k=n(a,{tag:"div",attribute:'data-name="js-fm-header" ',className:"fm-header",type:"",name:E,size:P,date:A,owner:"owner",mode:"mode"});if(l(w),x+=k+'<ul data-name="js-files" class="files">',"/"!==w){const t=m(w),o=e+c+t,i=n(r.link,{link:o,title:"..",name:".."}),s='draggable="true" '+h("..");x+=n(r.file,{tag:"li",attribute:s,className:"",type:"directory",name:i,size:"&lt;dir&gt;",date:"--.--.----",owner:".",mode:"--- --- ---"})}return x+=v.map(p).map(t=>{const r=s(t.name),o=e+c+w+r,{type:i,mode:u,date:l,owner:f,size:p}=t,m=n(g,{link:o,title:r,name:r,attribute:d(t.type)}),y=h(t.name);return n(a,{tag:"li",attribute:'draggable="true" '+y,className:"",type:i,name:m,size:p,date:l,owner:f,mode:u})}).join(""),x+="</ul>",x},t.exports._getSize=g},function(t,e,r){"use strict";t.exports=t=>{const e={value:t};return(...t)=>{const[r]=t;return t.length?(e.value=r,r):e.value}}},function(t,e,r){"use strict";const n=t=>(...e)=>(...r)=>t(...e,...r);t.exports=(t,...e)=>(function(t){if("function"!=typeof t)throw Error("fn should be a function!")}(t),e.length?n(t)(...e):n(t))},function(t,e,r){"use strict";const n=r(5);t.exports.escapeRegExp=t=>("string"==typeof t&&(t=t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),t),t.exports.getRegExp=t=>{const e="^"+t.replace(/\./g,"\\.").replace(/\*/g,".*").replace("?",".?")+"$";return RegExp(e)},t.exports.exec=n,t.exports.getExt=t=>{if(!("string"==typeof t))return"";const e=t.lastIndexOf(".");return~e?t.substr(e):""},t.exports.findObjByNameInArr=(t,e)=>{let r;if(!Array.isArray(t))throw Error("array should be array!");if("string"!=typeof e)throw Error("name should be string!");return t.some(t=>{const n=t.name===e,o=Array.isArray(t);return n?(r=t,n):o?t.some(t=>{const n=t.name===e;return n&&(r=t.data),n}):n}),r},t.exports.time=t=>{n.ifExist(console,"time",[t])},t.exports.timeEnd=t=>{n.ifExist(console,"timeEnd",[t])}},function(t,e,r){"use strict";const n=r(9),o=r(1),i=r(13),s=r(14),a=r(19),u=r(28),c=r(21),l=r(11),f=r(51),h=r(29),p=r(53),d=t.exports,g={...p,...h,...d},m={};g.Images=o,g.load=i,g.Files=s,g.RESTful=a,g.IO=u,g.Storage=c,g.Dialog=l,g.CurrentInfo=m,t.exports=g,g.uploadDirectory=r(54),g.Buffer=r(31),g.Events=r(16);const y=r(65),w=r(66),v={"js-left":null,"js-right":null};async function b(t){const{Dialog:e}=g,r=g.getCurrentDirPath(),n="New "+t||!1,o=(()=>{const t=g.getCurrentName();return".."===t?"":t})(),[i,s]=await e.prompt(n,o);if(i)return;const u=`${r}${s}`;"directory"===t?await a.createDirectory(u):await a.write(u),await CloudCmd.refresh({currentName:s})}t.exports.loadRemote=(t,e,r)=>(y(t,e,r),g),t.exports.loadSocket=t=>(g.loadRemote("socket",{name:"io"},t),g),t.exports.promptNewDir=async function(){await b("directory")},t.exports.promptNewFile=async()=>{await b("file")},t.exports.getCurrentDirName=()=>{const t=g.getCurrentDirPath().replace(/\/$/,""),e=t.substr(t,t.lastIndexOf("/"));return t.replace(e+"/","")||"/"},t.exports.getParentDirPath=t=>{const e=g.getCurrentDirPath(t),r=g.getCurrentDirName()+"/",n=e.lastIndexOf(r);return"/"!==e?e.slice(0,n):e},t.exports.getNotCurrentDirPath=()=>{const t=g.getPanel({active:!1});return g.getCurrentDirPath(t)},t.exports.getCurrentByName=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m.panel;const r="js-file-"+btoa(encodeURI(t)),n=g.getByDataName(r,e);return n},t.exports.getSelectedFiles=()=>{const t=g.getPanel(),e=g.getByClassAll("selected-file",t);return Array.from(e)},t.exports.unselectFiles=t=>{t=t||g.getSelectedFiles(),Array.from(t).forEach(g.toggleSelectedFile)},t.exports.getActiveFiles=()=>{const t=g.getCurrentFile(),e=g.getSelectedFiles(),r=g.getCurrentName(t);return e.length||".."===r?e:[t]},t.exports.getCurrentDate=t=>{const e=t||g.getCurrentFile();return g.getByDataName("js-date",e).textContent},t.exports.getCurrentSize=t=>{const e=t||g.getCurrentFile();return g.getByDataName("js-size",e).textContent.replace(/^<|>$/g,"")},t.exports.loadCurrentSize=async t=>{const e=t||g.getCurrentFile(),r=g.getCurrentPath(e);if(o.show.load(),".."===name)return;const[,n]=await a.read(r+"?size");return g.setCurrentSize(n,e),o.hide(),e},t.exports.loadCurrentHash=async t=>{const e=t||g.getCurrentFile(),r=g.getCurrentPath(e),[,n]=await a.read(r+"?hash");return n},t.exports.setCurrentSize=(t,e)=>{const r=e||g.getCurrentFile();g.getByDataName("js-size",r).textContent=t},t.exports.getCurrentMode=t=>{const e=t||g.getCurrentFile();return g.getByDataName("js-mode",e).textContent},t.exports.getCurrentOwner=t=>{const e=t||g.getCurrentFile();return g.getByDataName("js-owner",e).textContent},t.exports.getCurrentData=async t=>{const{Dialog:e}=g,r=g.CurrentInfo,n=t||g.getCurrentFile(),o=g.getCurrentPath(n),i=g.isCurrentIsDir(n);if(".."===r.name)return e.alert.noFiles(),[Error("No Files")];if(i)return await a.read(o);const[s,u]=await g.checkStorageHash(o);if(!s)return[Error("Can't get hash of a file")];if(u===s)return[null,await c.get(o+"-data")];const[l,f]=await a.read(o);if(l)return[l,null];const{length:h}=f;return u&&h<1073741824&&await g.saveDataToStorage(o,f,s),[null,f]},t.exports.getRefreshButton=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g.getPanel();return g.getByDataName("js-refresh",t)},t.exports.selectFile=t=>((t||g.getCurrentFile()).classList.add("selected-file"),d),t.exports.unselectFile=t=>((t||g.getCurrentFile()).classList.remove("selected-file"),d),t.exports.toggleSelectedFile=t=>{const e=t||g.getCurrentFile();return".."===g.getCurrentName(e)||e.classList.toggle("selected-file"),d},t.exports.toggleAllSelectedFiles=()=>(g.getAllFiles().map(g.toggleSelectedFile),d),t.exports.selectAllFiles=()=>(g.getAllFiles().map(g.selectFile),d),t.exports.getAllFiles=()=>{const t=g.getPanel(),e=g.getFiles(t),r=g.getCurrentName(e[0]),n=".."===r?1:0;return Array.from(e).slice(n)},t.exports.expandSelection=()=>{const{files:t}=m;w("expand",t)},t.exports.shrinkSelection=()=>{const{files:t}=m;w("shrink",t)},t.exports.setHistory=(t,e,r)=>{const n=window.history,{prefix:o}=CloudCmd;return r=o+r,n&&history.pushState(t,e,r),n},t.exports.isSelected=t=>!!t&&g.isContainClass(t,"selected-file"),t.exports.getCurrentLink=t=>{const e=t||g.getCurrentFile();return g.getByTag("a",e)[0]},t.exports.getFilenames=t=>{if(!t)throw Error("AllFiles could not be empty");const e=t[0]||g.getCurrentFile(),r=g.getCurrentName(e),n=Array.from(t);".."===r&&n.shift();return n.map(t=>g.getCurrentName(t))},t.exports.checkStorageHash=async t=>{const e=t+"-hash";if("string"!=typeof t)throw Error("name should be a string!");const[r,n]=await Promise.all([g.loadCurrentHash(),c.get(e)]);return[r,n]},t.exports.saveDataToStorage=async(t,e,r)=>{if(g.isCurrentIsDir())return;r=r||await g.loadCurrentHash();const n=t+"-hash",o=t+"-data";return await c.set(n,r),await c.set(o,e),r},t.exports.getFM=()=>g.getPanel().parentElement,t.exports.getPanelPosition=t=>(t=t||g.getPanel()).dataset.name.replace("js-",""),t.exports.getPanel=t=>{let e,r,n,o="js-";const i=g.getCurrentFile();if(i?(e=i.parentElement,r=e.parentElement,n="js-left"===r.getAttribute("data-name")):r=g.getByDataName("js-left"),t&&!t.active&&(o+=n?"right":"left",r=g.getByDataName(o)),window.innerWidth<CloudCmd.MIN_ONE_PANEL_WIDTH&&(r=g.getByDataName("js-left")),!r)throw Error("can not find Active Panel!");return r},t.exports.getFiles=t=>g.getByDataName("js-files",t).children||[],t.exports.showPanel=t=>{const e=g.getPanel({active:t});return!!e&&(g.show(e),!0)},t.exports.hidePanel=t=>{const e=g.getPanel({active:t});return!!e&&g.hide(e)},t.exports.remove=(t,e)=>((e||document.body).removeChild(t),g),t.exports.deleteCurrent=t=>{t||g.getCurrentFile();const e=null==t?void 0:t.parentElement,r=g.getCurrentName(t);if(t&&".."!==r){const r=t.nextSibling,n=t.previousSibling;g.setCurrentFile(r||n),e.removeChild(t)}},t.exports.deleteSelected=t=>{(t=t||g.getSelectedFiles())&&t.map(g.deleteCurrent)},t.exports.renameCurrent=f,t.exports.scrollIntoViewIfNeeded=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&t.scrollIntoViewIfNeeded&&t.scrollIntoViewIfNeeded(e)},t.exports.scrollByPages=(t,e)=>{const r=(null==t?void 0:t.scrollByPages)&&e;return r&&t.scrollByPages(e),r},t.exports.changePanel=()=>{const t=m;let e=g.getPanel();CloudCmd.emit("passive-dir",t.dirPath);const r=g.getPanel({active:!1});let n=g.getCurrentName();const o=g.getFiles(r);let i,s,a=e.getAttribute("data-name");return v[a]=n,e=r,a=e.getAttribute("data-name"),n=v[a],n&&(s=g.getCurrentByName(n,e),s&&(i=s.parentElement)),i&&i.parentElement||(s=g.getCurrentByName(n,e),s||([s]=o)),g.setCurrentFile(s,{history:!0}),CloudCmd.emit("active-dir",t.dirPath),g},t.exports.getPackerExt=t=>"zip"===t?".zip":".tar.gz",t.exports.goToDirectory=async()=>{const{Dialog:t}=g,{dirPath:e}=m,[r,n=e]=await t.prompt("Go to directory:",e);r||await CloudCmd.loadDir({path:n})},t.exports.duplicatePanel=async()=>{const t=m,{isDir:e}=t,r=t.panelPassive,n=!t.isOnePanel,o=(e=>e?t.path:t.dirPath)(e);await CloudCmd.loadDir({path:o,panel:r,noCurrent:n})},t.exports.swapPanels=async()=>{const t=m,{panel:e,files:r,element:n,panelPassive:o}=t,i=g.getCurrentDirPath(),s=g.getNotCurrentDirPath();let a=r.indexOf(n);await CloudCmd.loadDir({path:i,panel:o,noCurrent:!0}),await CloudCmd.loadDir({path:s,panel:e});const u=t.files.length-1;a>u&&(a=u);const c=t.files[a];g.setCurrentFile(c)},t.exports.CurrentInfo=m,t.exports.updateCurrentInfo=t=>{const e=g.CurrentInfo,r=t||g.getCurrentFile(),o=r.parentElement,i=o.parentElement||g.getPanel(),s=g.getPanel({active:!1}),a=g.getFiles(s),u=g.getCurrentName(r);e.dir=g.getCurrentDirName(),e.dirPath=g.getCurrentDirPath(),e.parentDirPath=g.getParentDirPath(),e.element=r,e.ext=n.getExt(u),e.files=Array.from(o.children),e.filesPassive=Array.from(a),e.first=o.firstChild,e.getData=g.getCurrentData,e.last=o.lastChild,e.link=g.getCurrentLink(r),e.mode=g.getCurrentMode(r),e.name=u,e.path=g.getCurrentPath(r),e.panel=i,e.panelPassive=s,e.size=g.getCurrentSize(r),e.isDir=g.isCurrentIsDir(),e.isSelected=g.isSelected(r),e.panelPosition=g.getPanel().dataset.name.replace("js-",""),e.isOnePanel=e.panel.getAttribute("data-name")===e.panelPassive.getAttribute("data-name")}},function(t,e,r){"use strict";const n=r(3),{alert:o,prompt:i,confirm:s,progress:a}=r(50),u="Cloud Commander";t.exports.alert=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return o(u,...e,{cancel:!1})},t.exports.prompt=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return n(i,u,...e)},t.exports.confirm=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return n(s,u,...e)},t.exports.progress=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return a(u,...e)},t.exports.alert.noFiles=()=>o(u,"No files selected!",{cancel:!1})},function(t,e,r){"use strict";t.exports=(t,e)=>{!function(t,e){if("string"!=typeof t)throw Error("template should be a string!");if("object"!=typeof e)throw Error("data should be an object!")}(t,e);let r=t;return Object.keys(e).forEach(t=>{const n="{{ "+t+" }}",o=(i=e[t],()=>i);for(var i;r.includes(n);)r=r.replace(n,o)}),r.includes("{{")&&(r=r.replace(/{{.*?}}/g,"")),r}},function(t,e,r){"use strict";const n=r(18),o=r(48),i=r(20),s=r(5),a=r(1);t.exports.getIdBySrc=function(t){if(!n.string(t))return;t.includes(":")&&(t+="-join");const e=t.lastIndexOf("/")+1,r=t.substr(t,e);return t.replace(r,"").replace(/\./g,"-")},t.exports.ajax=t=>{const e=t,r=n.object(e.data),i=n.array(e.data),u="arraybuffer"===n(e.data),c=e.type||e.method||"GET",{headers:l={}}=e,f=new XMLHttpRequest;f.open(c,e.url,!0);for(const t of Object.keys(l)){const e=l[t];f.setRequestHeader(t,e)}let h;e.responseType&&(f.responseType=e.responseType),h=!u&&r||i?o.stringify(e.data):e.data,f.onreadystatechange=t=>{const r=t.target;if(r.readyState!==r.DONE)return;a.clearProgress();const n=r.getResponseHeader("content-type");if(200!==r.status)return s(e.error,r);const i="text"!==e.dataType,u=n.includes("application/json");let c=r.response;n&&u&&i&&(c=o.parse(r.response)||r.response),s(e.success,c,r.statusText,r)},f.send(h)},t.exports.put=(t,e)=>{const r=i(),n=new XMLHttpRequest;return t=encodeURI(t).replace(/#/g,"%23"),n.open("put",t,!0),n.upload.onprogress=t=>{if(!t.lengthComputable)return;const e=t.loaded/t.total*100,n=Math.round(e);r.emit("progress",n)},n.onreadystatechange=()=>{if(!(n.readyState===n.DONE))return;if(200===n.status)return r.emit("progress",100),r.emit("end");const t=Error(n.responseText);r.emit("error",t)},n.send(e),r}},function(t,e,r){"use strict";const n=r(18),{promisify:o}=r(15),i=r(13),s=r(19),a={},u=function(t){let e;return r=>{e||(e=!0,setTimeout(()=>{e=!1,r()},t))}}(2e3);t.exports.get=function t(e){const r=n(e);if(function(t){if(!t)throw Error("name could not be empty!")}(e),"string"===r)return function(t){const e=new RegExp("file|path|link|pathLink|media|view/media-tmpl|config-tmpl|upload"),r=new RegExp("config|modules"),n=e.test(t),o=r.test(t);if(!n&&!o)return function(t){throw Error("Wrong file name: "+t)}(t);if("config"===t)return l();const i=function(t,e,r){let n;const o=new RegExp("view/media-tmpl|config-tmpl|upload").test(t);e?(n=o?"/tmpl/"+t.replace("-tmpl",""):"/tmpl/fs/"+t,n+=".hbs"):r&&(n="/json/"+t+".json");return n}(t,n,o);return c(i)}(e);if("array"===r)return Promise.all(e.map(t))};const c=o((t,e)=>{const{prefix:r}=CloudCmd;a[t]||(a[t]=new Promise((e,n)=>{const o=r+t;i.ajax({url:o,success:e,error:n})})),a[t].then(t=>{e(null,t)},r=>{a[t]=null,e(r)})}),l=async()=>{let t;a.config||(a.config=()=>(t=!0,s.Config.read()));const[,e]=await a.config();return e&&(t=!1),u(()=>{t||(a.config=null)}),e}},function(t,e,r){"use strict";r.r(e),r.d(e,"promisify",(function(){return n}));function n(t){if("function"!=typeof t)throw new TypeError("Argument to promisify must be a function");var e=t["__ES6-PROMISIFY--CUSTOM-ARGUMENTS__"],r=n.Promise||Promise;if("function"!=typeof r)throw new Error("No Promise implementation found; do you need a polyfill?");return function(){for(var n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];return new r((r,n)=>{o.push((function(t){if(t)return n(t);for(var o=arguments.length,i=Array(1<o?o-1:0),s=1;s<o;s++)i[s-1]=arguments[s];if(1===i.length||!e)return r(i[0]);var a={};i.forEach((t,r)=>{var n=e[r];n&&(a[n]=t)}),r(a)})),t.apply(this,o)})}}n.argumentNames="__ES6-PROMISIFY--CUSTOM-ARGUMENTS__",n.Promise=void 0},function(t,e,r){"use strict";const n=r(18),o=r(64);t.exports=new function(){const t=this,e=t=>"touchstart"===t&&{passive:!0};function r(t,o,i,s){let a;const u=[t,o,i,s],c=n(t);switch(c){default:if(!/element$/.test(c))throw Error("unknown eventName: "+c);r(u[1],u[0],i,s);break;case"string":a=n.function(o),a&&(i=o,o=null),o||(o=window),s(o,[t,i,e(t)]);break;case"array":for(const e of t)r(e,o,i,s);break;case"object":for(const e of Object.keys(t)){r(e,o,t[e],s)}}}function i(t){if(!t)throw Error("type could not be empty!")}this.add=(e,n,s)=>(i(e),r(e,n,s,(t,e)=>{const[r,n,i]=e;t.addEventListener(r,n,i),o.add(t,r,n)}),t),this.addOnce=(e,r,n)=>{const o=i=>{t.remove(e,r,o),n(i)};return n||(n=r,r=null),this.add(e,r,o),t},this.remove=(e,n,o)=>(i(e),r(e,n,o,(t,e)=>{t.removeEventListener(...e)}),t),this.removeAll=()=>{const t=o.get();for(const[e,r,n]of t)e.removeEventListener(r,n);o.clear()},this.addKey=function(){const e="keydown";for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const i=[e,...n];return t.add(...i)},this.rmKey=function(){const e="keydown";for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const i=[e,...n];return t.remove(...i)},this.addClick=function(){const e="click";for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const i=[e,...n];return t.add(...i)},this.rmClick=function(){const e="click";for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const i=[e,...n];return t.remove(...i)},this.addContextMenu=function(){const e="contextmenu";for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const i=[e,...n];return t.add(...i)},this.addError=function(){const e="error";for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const i=[e,...n];return t.add(...i)},this.addLoad=function(){const e="load";for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const i=[e,...n];return t.add(...i)}}},function(t,e,r){"use strict";const n={"&nbsp;":" ","&lt;":"<","&gt;":">","&quot;":'"'},o=Object.keys(n);t.exports.encode=t=>{for(const e of o){const r=RegExp(n[e],"g");t=t.replace(r,e)}return t},t.exports.decode=t=>{for(const e of o){const r=n[e],o=RegExp(e,"g");t=t.replace(o,r)}return t}},function(t,e,r){"use strict";t.exports=n;for(const t of["null","arrayBuffer","file","array","object"])n[t]=o.bind(null,t);for(const t of["string","undefined","boolean","number","function"])n[t]=i.bind(null,t);function n(t){return{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function o(t,e){return n(e)===t}function i(t,e){return typeof e===t}},function(t,e,r){"use strict";const n=r(3),{encode:o}=r(17),i=r(1),s=r(28),a=r(11),u=t=>async function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];const[u,c]=await n(t,...r);if(!u)return[u,c];const l=o(u.message);return i.show.error(l),a.alert(l),[u,c]};t.exports.delete=u(s.delete),t.exports.patch=u(s.patch),t.exports.write=u(s.write),t.exports.createDirectory=u(s.createDirectory),t.exports.read=u(s.read),t.exports.copy=u(s.copy),t.exports.pack=u(s.pack),t.exports.extract=u(s.extract),t.exports.move=u(s.move),t.exports.rename=u(s.rename),t.exports.Config={read:u(s.Config.read),write:u(s.Config.write)},t.exports.Markdown={read:u(s.Markdown.read),render:u(s.Markdown.render)}},function(t,e,r){"use strict";function n(){if(!(this instanceof n))return new n;this._all={}}function o(t){if("string"!=typeof t)throw Error("event should be string!")}function i(t,e){o(t),function(t){if("function"!=typeof t)throw Error("callback should be function!")}(e)}t.exports=n,n.prototype.on=function(t,e){const r=this._all[t];return i(t,e),r?r.push(e):this._all[t]=[e],this},n.prototype.addListener=n.prototype.on,n.prototype.once=function(t,e){const r=this;return i(t,e),this.on(t,(function n(...o){e(...o),r.off(t,n)})),this},n.prototype.off=function(t,e){const r=this._all[t]||[];let n=r.indexOf(e);for(i(t,e);~n;)r.splice(n,1),n=r.indexOf(e);return this},n.prototype.removeListener=n.prototype.off,n.prototype.emit=function(t,...e){const r=this._all[t];if(o(t),!r&&"error"===t)throw e[0];if(!r)return this;for(const t of r)t(...e);return this},n.prototype.removeAllListeners=function(t){return o(t),this._all[t]=[],this}},function(t,e,r){"use strict";const{parse:n,stringify:o}=JSON;t.exports.set=async(t,e)=>{localStorage.setItem(t,e)},t.exports.setJson=async(t,e)=>{localStorage.setItem(t,o(e))},t.exports.get=async t=>localStorage.getItem(t),t.exports.getJson=async t=>{const e=localStorage.getItem(t);return n(e)},t.exports.clear=()=>{localStorage.clear()},t.exports.remove=t=>{localStorage.removeItem(t)}},function(t,e,r){"use strict";r(173);const n=r(2),o=r(85),i=r(87),s=(t,...e)=>(t=>"function"==typeof t)(t)&&t(...e);t.exports=function t(e,r,a){if(!(this instanceof t))return new t(e,r,a);const u=new i;let c,l,f,h,p={};a?(c=h=e,p=r):r?(c=h=e,a=r):(c=document.body,h=window,a=e);const d={},g=function(t){const e=o(t,d,p);return n("ul",{dataName:"js-menu",className:"menu menu-hidden",innerHTML:e,parent:c,uniq:!1})}(a);function m(t,e){let r=u.getItem(t),n=u.isName(r),o=u.isItem(r),i=u.isSubMenu(r);return n&&o||(r=document.elementFromPoint(e.x,e.y),i=u.isSubMenu(r),n=u.isName(r),o=u.isItem(r)),{name:n,item:o,sub:i}}function y(t,e){t.stopPropagation();const{afterClick:r,beforeClick:n,beforeHide:o,afterHide:i,name:a}=p,c=t.target,l=e||m(c,{x:t.clientX,y:t.clientY}),f=s(n,a);if(l.sub)return t.preventDefault();if(s(o),x(),s(i),!f&&(l.name||l.item)){const t=function(t){const e=u.getName(t);if(!e)return null;const r=e.getAttribute("data-menu-path");return d[r]}(c);s(t),s(r)}}function w(t){t.preventDefault();const e=t.target,r=t.clientX,n=t.clientY,o=m(e,{x:r,y:n});if(o.name||o.item||o.sub)return y(t,o);x(),b(r,n)}function v(t,e){const r="number"==typeof t,n="number"==typeof e,o=function(){if(!l){const{height:t}=getComputedStyle(g);l=parseInt(t,10)}return l}(),i=function(){if(!f){const{width:t}=getComputedStyle(g);f=parseInt(t,10)}return f}(),s=window.innerHeight;window.innerWidth<i+t&&(t-=i)<0&&(t=0),s<o+e&&(e-=o)<0&&(e=0),r&&(g.style.left=t+"px"),n&&(g.style.top=e-14+"px")}function b(t,e){const{name:r,beforeShow:n,afterShow:o}=p,i={x:t,y:e,name:r},a=s(n,i);(a||!1!==a)&&(g.classList.remove("menu-hidden"),v(i.x,i.y),s(o,i))}function x(){s(p.beforeClose)||g.classList.add("menu-hidden")}h.addEventListener("click",y),this.show=b,this.hide=x,this.addContextMenuListener=()=>{h.addEventListener("contextmenu",w)},this.removeContextMenuListener=()=>{h.addEventListener("contextmenu",w)},this.remove=function(){h.removeEventListener("click",y),h.removeEventListener("contextmenu",w),c.removeChild(g)}}},function(t,e,r){"use strict";t.exports=t=>document.querySelector(`[data-name="modal-${t}"]`)},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&p())}function p(){if(!l){var t=a(h);l=!0;for(var e=c.length;e;){for(u=c,c=[];++f<e;)u&&u[f].run();f=-1,e=c.length}u=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function g(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new d(t,e)),1!==c.length||l||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},,function(t,e,r){"use strict";(function(e){t.exports.btoa=t=>"function"==typeof btoa?btoa(t):e.from(t).toString("base64"),t.exports.atob=t=>"function"==typeof atob?atob(t):e.from(t,"base64").toString("binary")}).call(this,r(43).Buffer)},function(t,e,r){"use strict";t.exports=(t,...e)=>{try{return[null,t(...e)]}catch(t){return[t]}}},function(t,e,r){"use strict";const{FS:n}=r(6),o=r(49),i={top:!0};t.exports.delete=async(t,e)=>await o({method:"DELETE",url:n+t,data:e,imgPosition:{top:Boolean(e)}}),t.exports.patch=async(t,e)=>await o({method:"PATCH",url:n+t,data:e,imgPosition:i}),t.exports.write=async(t,e)=>await o({method:"PUT",url:n+t,data:e,imgPosition:i}),t.exports.createDirectory=async t=>await o({method:"PUT",url:`${n}${t}?dir`,imgPosition:i}),t.exports.read=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";const r=!t.includes("?");return await o({method:"GET",url:n+t,notLog:r,dataType:e})},t.exports.copy=async(t,e,r)=>await o({method:"PUT",url:"/copy",data:{from:t,to:e,names:r},imgPosition:i}),t.exports.pack=async t=>await o({method:"PUT",url:"/pack",data:t}),t.exports.extract=async t=>await o({method:"PUT",url:"/extract",data:t}),t.exports.move=async(t,e,r)=>await o({method:"PUT",url:"/move",data:{from:t,to:e,names:r},imgPosition:i}),t.exports.rename=async(t,e)=>await o({method:"PUT",url:"/rename",data:{from:t,to:e},imgPosition:i}),t.exports.Config={read:async()=>await o({method:"GET",url:"/config",imgPosition:i,notLog:!0}),write:async t=>await o({method:"PATCH",url:"/config",data:t,imgPosition:i})},t.exports.Markdown={read:async t=>await o({method:"GET",url:"/markdown"+t,imgPosition:i,notLog:!0}),render:async t=>await o({method:"PUT",url:"/markdown",data:t,imgPosition:i,notLog:!0})}},function(t,e,r){"use strict";const{atob:n,btoa:o}=r(26),i=r(2),{encode:s,decode:a}=r(17),{getTitle:u,FS:c}=r(6);let l;const f=RegExp(String.fromCharCode(160),"g");t.exports._CURRENT_FILE="current-file",t.exports.setCurrentName=(t,e)=>{const r=DOM.CurrentInfo,{link:n}=r,{prefix:o}=CloudCmd,i=o+c+r.dirPath,a=s(t);return n.title=a,n.href=i+a,n.innerHTML=a,e.setAttribute("data-name",h(t)),CloudCmd.emit("current-file",e),n},t.exports.getCurrentName=t=>{const e=t||DOM.getCurrentFile();return e?p(e.getAttribute("data-name")):""};const h=t=>"js-file-"+o(encodeURI(t)),p=t=>(t=t.replace("js-file-",""),decodeURI(n(t)));t.exports.getCurrentDirPath=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:DOM.getPanel();const e=DOM.getByDataName("js-path",t);return e.textContent.replace(f," ")},t.exports.getCurrentPath=t=>{const e=t||DOM.getCurrentFile(),[r]=DOM.getByTag("a",e),{prefix:n}=CloudCmd,o=r.getAttribute("href").replace(RegExp("^"+n+c),"").replace(f," ");return a(o)},t.exports.getCurrentDirName=()=>{const t=DOM.getCurrentDirPath().replace(/\/$/,""),e=t.substr(t,t.lastIndexOf("/"));return t.replace(e+"/","")||"/"},t.exports.getParentDirPath=t=>{const e=DOM.getCurrentDirPath(t),r=DOM.getCurrentDirName()+"/",n=e.lastIndexOf(r);return"/"===e?e:e.slice(0,n)},t.exports.getNotCurrentDirPath=()=>{const t=DOM.getPanel({active:!1});return DOM.getCurrentDirPath(t)},t.exports.getCurrentFile=()=>DOM.getByClass("current-file"),t.exports.getCurrentByName=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:DOM.CurrentInfo.panel;const r="js-file-"+o(encodeURI(t));return DOM.getByDataName(r,e)},t.exports.setCurrentFile=(t,e)=>{const r=e,n=DOM.getCurrentFile();if(!t)return DOM;let o="";n&&(o=DOM.getCurrentDirPath(),function(t){DOM.isCurrentFile(t)&&t.classList.remove("current-file")}(n)),t.classList.add("current-file");const i=DOM.getCurrentDirPath(),s=CloudCmd.config("name");if(i!==o&&(DOM.setTitle(u({name:s,path:i})),!r||r.history)){const t="/"===i?i:c+i;DOM.setHistory(t,null,t)}return DOM.scrollIntoViewIfNeeded(t,!0),CloudCmd.emit("current-file",t),CloudCmd.emit("current-path",i),CloudCmd.emit("current-name",DOM.getCurrentName(t)),DOM},this.setCurrentByName=t=>{const e=DOM.getCurrentByName(t);return DOM.setCurrentFile(e)},t.exports.getCurrentByPosition=t=>{let{x:e,y:r}=t;const n=(t=>{const{tagName:e}=t;return/A|SPAN|LI/.test(e)?"A"===e?t.parentElement.parentElement:"SPAN"===e?t.parentElement:t:null})(document.elementFromPoint(e,r));return n&&"LI"!==n.tagName?null:n},t.exports.isCurrentFile=t=>!!t&&DOM.isContainClass(t,"current-file"),t.exports.setTitle=t=>(l||(l=DOM.getByTag("title")[0]||i("title",{innerHTML:t,parent:document.head})),l.textContent=t,DOM),t.exports.isCurrentIsDir=t=>{const e=t||DOM.getCurrentFile(),r=DOM.getCurrentPath(e),n=DOM.getCurrentType(e),o=/\.zip$/.test(r);return/^directory(-link)?/.test(n)||o},t.exports.getCurrentType=t=>{const e=t||DOM.getCurrentFile();return DOM.getByDataName("js-type",e).className.split(" ").pop()}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){"use strict";const n=r(63),o=r(21),i=r(10);t.exports=new function(){const t=i.CurrentInfo;function e(t){i.Dialog.alert(t)}function r(){const t=i.getActiveFiles();return i.getFilenames(t)}function s(t){if(CloudCmd.config("buffer"))return t();e("Buffer disabled in config!")}async function a(){await o.remove("copy"),await o.remove("cut"),function(){const t=i.getByClassAll("cut-file");for(const e of t)e.classList.remove("cut-file")}()}return{cut:s.bind(null,(async function(){const e=r(),n=t.dirPath;await a(),e.length&&(!function(){const t=i.getActiveFiles();for(const e of t)e.classList.add("cut-file")}(),await o.setJson("cut",{from:n,names:e}))})),copy:s.bind(null,(async function(){const e=r(),n=t.dirPath;await a(),e.length&&(await o.remove("cut"),await o.setJson("copy",{from:n,names:e}))})),clear:s.bind(null,a),paste:s.bind(null,(async function(){const[r,i,s]=await async function(){const[t,e,r]=await n([o.getJson("copy"),o.getJson("cut")]);return[t,e,r]}();if(r||!i&&!s)return e(r||"Buffer is empty!");const u=i?"copy":"move",c=i||s,{Operation:l}=CloudCmd,f=t.dirPath;if(c.from===f)return e("Path is same!");l.show(u,{...c,to:f}),await a()}))}}},function(t,e,r){"use strict";t.exports.addSlashToEnd=t=>{if(!t)throw Error("path could not be empty!");return"/"===t[t.length-1]?t:t+"/"},t.exports.size=t=>{const e=1073741824,r=1024*e,n=1024*r;return"number"==typeof t?t<1024?t+"b":t<1048576?(t/1024).toFixed(2)+"kb":t<e?(t/1048576).toFixed(2)+"mb":t<r?(t/e).toFixed(2)+"gb":t<n?(t/r).toFixed(2)+"tb":(t/n).toFixed(2)+"pb":t},t.exports.permissions=r(68)},function(t,e){t.exports=function(t){for(var e=t.split(r),n=e.length,o=new Array(n),i=0;i<n;i++){var s=e[i];""!==s&&(o[i]=s[0].toUpperCase()+s.slice(1))}return o.join("")};var r=/[\s\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,\-.\/:;<=>?@\[\]^_`{|}~]+/},,function(t,e,r){"use strict";t.exports=navigator.clipboard||{readText:function(){return Promise.reject()},writeText:async function(t){const e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select();const r=document.execCommand("copy");if(document.body.removeChild(e),r)return;return Promise.reject()}}},function(t,e,r){"use strict";t.exports={BACKSPACE:8,TAB:9,ENTER:13,CAPSLOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DELETE:46,ZERO:48,SEMICOLON:52,COLON:54,A:65,C:67,D:68,G:71,J:74,K:75,M:77,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,X:88,Z:90,INSERT_MAC:96,ASTERISK:106,PLUS:107,MINUS:109,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,EQUAL:187,HYPHEN:189,DOT:190,SLASH:191,TRA:192,BACKSLASH:220,BRACKET_CLOSE:221}},function(t,e,r){"use strict";const n=[()=>()=>{},t=>(...e)=>t(...e),(t,e)=>(...r)=>t(e(...r)),(t,e,r)=>(...n)=>t(e(r(...n))),(t,e,r,n)=>(...o)=>t(e(r(n(...o)))),(t,e,r,n,o)=>(...i)=>t(e(r(n(o(...i))))),(t,e,r,n,o,i)=>(...s)=>t(e(r(n(o(i(...s)))))),(t,e,r,n,o,i,s)=>(...a)=>t(e(r(n(o(i(s(...a)))))))];t.exports=(...t)=>t.length<n.length?n[t.length](...t):function(t){return(...e)=>{let r=t.length-1,n=t[r](...e);for(;--r;)n=t[r](n);return n}}(t)},function(t,e,r){"use strict";const{eachSeries:n}=r(5),o=r(8),i=r(13),s=r(1),{alert:a}=r(11),{FS:u}=r(6),c=o((function(t){CloudCmd.refresh({currentName:t})})),l=o((function(t,e,r,n){const{name:o}=r,a=t+o,{prefixURL:c}=CloudCmd,l=c+u;i.put(l+a,r).on("error",h).on("end",n).on("progress",t=>{const r=(t=>100/t)(e),n=0*r+function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return Math.round(t*r/e)}(t,100,r);s.show.load("top"),s.setProgress(Math.round(n))})})),{getCurrentDirPath:f}=r(10);function h(t){let{message:e}=t;a(e)}t.exports=(t,e)=>{e||(e=t,t=f());const r=e.length;if(!r)return;const o=Array.from(e),{name:i}=e[0];n(o,l(t,r),c(i))}},function(t,e,r){"use strict";const n=r(2),o=r(23);t.exports=(t,e)=>{if(o("title"))return void(o("title-text").textContent=t);const r=n("div",{className:"modal-title",dataName:"modal-title",parent:e});n("span",{parent:r,textContent:t,className:"modal-title-text",dataName:"modal-title-text"})}},function(t,e,r){var n=r(129),o={};for(var i in n)n.hasOwnProperty(i)&&(o[n[i]]=i);var s=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in s)if(s.hasOwnProperty(a)){if(!("channels"in s[a]))throw new Error("missing channels property: "+a);if(!("labels"in s[a]))throw new Error("missing channel labels property: "+a);if(s[a].labels.length!==s[a].channels)throw new Error("channel and label counts mismatch: "+a);var u=s[a].channels,c=s[a].labels;delete s[a].channels,delete s[a].labels,Object.defineProperty(s[a],"channels",{value:u}),Object.defineProperty(s[a],"labels",{value:c})}s.rgb.hsl=function(t){var e,r,n=t[0]/255,o=t[1]/255,i=t[2]/255,s=Math.min(n,o,i),a=Math.max(n,o,i),u=a-s;return a===s?e=0:n===a?e=(o-i)/u:o===a?e=2+(i-n)/u:i===a&&(e=4+(n-o)/u),(e=Math.min(60*e,360))<0&&(e+=360),r=(s+a)/2,[e,100*(a===s?0:r<=.5?u/(a+s):u/(2-a-s)),100*r]},s.rgb.hsv=function(t){var e,r,n,o,i,s=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(s,a,u),l=c-Math.min(s,a,u),f=function(t){return(c-t)/6/l+.5};return 0===l?o=i=0:(i=l/c,e=f(s),r=f(a),n=f(u),s===c?o=n-r:a===c?o=1/3+e-n:u===c&&(o=2/3+r-e),o<0?o+=1:o>1&&(o-=1)),[360*o,100*i,100*c]},s.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2];return[s.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(r,n))),100*(n=1-1/255*Math.max(e,Math.max(r,n)))]},s.rgb.cmyk=function(t){var e,r=t[0]/255,n=t[1]/255,o=t[2]/255;return[100*((1-r-(e=Math.min(1-r,1-n,1-o)))/(1-e)||0),100*((1-n-e)/(1-e)||0),100*((1-o-e)/(1-e)||0),100*e]},s.rgb.keyword=function(t){var e=o[t];if(e)return e;var r,i,s,a=1/0;for(var u in n)if(n.hasOwnProperty(u)){var c=n[u],l=(i=t,s=c,Math.pow(i[0]-s[0],2)+Math.pow(i[1]-s[1],2)+Math.pow(i[2]-s[2],2));l<a&&(a=l,r=u)}return r},s.keyword.rgb=function(t){return n[t]},s.rgb.xyz=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*r+.0722*n),100*(.0193*e+.1192*r+.9505*n)]},s.rgb.lab=function(t){var e=s.rgb.xyz(t),r=e[0],n=e[1],o=e[2];return n/=100,o/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},s.hsl.rgb=function(t){var e,r,n,o,i,s=t[0]/360,a=t[1]/100,u=t[2]/100;if(0===a)return[i=255*u,i,i];e=2*u-(r=u<.5?u*(1+a):u+a-u*a),o=[0,0,0];for(var c=0;c<3;c++)(n=s+1/3*-(c-1))<0&&n++,n>1&&n--,i=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,o[c]=255*i;return o},s.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,o=r,i=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,o*=i<=1?i:2-i,[e,100*(0===n?2*o/(i+o):2*r/(n+r)),100*((n+r)/2)]},s.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,o=Math.floor(e)%6,i=e-Math.floor(e),s=255*n*(1-r),a=255*n*(1-r*i),u=255*n*(1-r*(1-i));switch(n*=255,o){case 0:return[n,u,s];case 1:return[a,n,s];case 2:return[s,n,u];case 3:return[s,a,n];case 4:return[u,s,n];case 5:return[n,s,a]}},s.hsv.hsl=function(t){var e,r,n,o=t[0],i=t[1]/100,s=t[2]/100,a=Math.max(s,.01);return n=(2-i)*s,r=i*a,[o,100*(r=(r/=(e=(2-i)*a)<=1?e:2-e)||0),100*(n/=2)]},s.hwb.rgb=function(t){var e,r,n,o,i,s,a,u=t[0]/360,c=t[1]/100,l=t[2]/100,f=c+l;switch(f>1&&(c/=f,l/=f),n=6*u-(e=Math.floor(6*u)),0!=(1&e)&&(n=1-n),o=c+n*((r=1-l)-c),e){default:case 6:case 0:i=r,s=o,a=c;break;case 1:i=o,s=r,a=c;break;case 2:i=c,s=r,a=o;break;case 3:i=c,s=o,a=r;break;case 4:i=o,s=c,a=r;break;case 5:i=r,s=c,a=o}return[255*i,255*s,255*a]},s.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,o=t[3]/100;return[255*(1-Math.min(1,e*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o))]},s.xyz.rgb=function(t){var e,r,n,o=t[0]/100,i=t[1]/100,s=t[2]/100;return r=-.9689*o+1.8758*i+.0415*s,n=.0557*o+-.204*i+1.057*s,e=(e=3.2406*o+-1.5372*i+-.4986*s)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(e=Math.min(Math.max(0,e),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},s.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2];return r/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(e-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},s.lab.xyz=function(t){var e,r,n,o=t[0];e=t[1]/500+(r=(o+16)/116),n=r-t[2]/200;var i=Math.pow(r,3),s=Math.pow(e,3),a=Math.pow(n,3);return r=i>.008856?i:(r-16/116)/7.787,e=s>.008856?s:(e-16/116)/7.787,n=a>.008856?a:(n-16/116)/7.787,[e*=95.047,r*=100,n*=108.883]},s.lab.lch=function(t){var e,r=t[0],n=t[1],o=t[2];return(e=360*Math.atan2(o,n)/2/Math.PI)<0&&(e+=360),[r,Math.sqrt(n*n+o*o),e]},s.lch.lab=function(t){var e,r=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[r,n*Math.cos(e),n*Math.sin(e)]},s.rgb.ansi16=function(t){var e=t[0],r=t[1],n=t[2],o=1 in arguments?arguments[1]:s.rgb.hsv(t)[2];if(0===(o=Math.round(o/50)))return 30;var i=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return 2===o&&(i+=60),i},s.hsv.ansi16=function(t){return s.rgb.ansi16(s.hsv.rgb(t),t[2])},s.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},s.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var r=.5*(1+~~(t>50));return[(1&e)*r*255,(e>>1&1)*r*255,(e>>2&1)*r*255]},s.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var r;return t-=16,[Math.floor(t/36)/5*255,Math.floor((r=t%36)/6)/5*255,r%6/5*255]},s.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},s.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];3===e[0].length&&(r=r.split("").map((function(t){return t+t})).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},s.rgb.hcg=function(t){var e,r=t[0]/255,n=t[1]/255,o=t[2]/255,i=Math.max(Math.max(r,n),o),s=Math.min(Math.min(r,n),o),a=i-s;return e=a<=0?0:i===r?(n-o)/a%6:i===n?2+(o-r)/a:4+(r-n)/a+4,e/=6,[360*(e%=1),100*a,100*(a<1?s/(1-a):0)]},s.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=1,o=0;return(n=r<.5?2*e*r:2*e*(1-r))<1&&(o=(r-.5*n)/(1-n)),[t[0],100*n,100*o]},s.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,o=0;return n<1&&(o=(r-n)/(1-n)),[t[0],100*n,100*o]},s.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(0===r)return[255*n,255*n,255*n];var o,i=[0,0,0],s=e%1*6,a=s%1,u=1-a;switch(Math.floor(s)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=u,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=u,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=u}return o=(1-r)*n,[255*(r*i[0]+o),255*(r*i[1]+o),255*(r*i[2]+o)]},s.hcg.hsv=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e),n=0;return r>0&&(n=e/r),[t[0],100*n,100*r]},s.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100*(1-e)+.5*e,n=0;return r>0&&r<.5?n=e/(2*r):r>=.5&&r<1&&(n=e/(2*(1-r))),[t[0],100*n,100*r]},s.hcg.hwb=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e);return[t[0],100*(r-e),100*(1-r)]},s.hwb.hcg=function(t){var e=t[1]/100,r=1-t[2]/100,n=r-e,o=0;return n<1&&(o=(r-n)/(1-n)),[t[0],100*n,100*o]},s.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},s.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},s.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},s.gray.hsl=s.gray.hsv=function(t){return[0,0,t[0]]},s.gray.hwb=function(t){return[0,100,t[0]]},s.gray.cmyk=function(t){return[0,0,0,t[0]]},s.gray.lab=function(t){return[t[0],0,0]},s.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r},s.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.promisify=n;function n(t){if("function"!=typeof t)throw new TypeError("Argument to promisify must be a function");var e=t["__ES6-PROMISIFY--CUSTOM-ARGUMENTS__"],r=n.Promise||Promise;if("function"!=typeof r)throw new Error("No Promise implementation found; do you need a polyfill?");return function(){for(var n=this,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return new r((function(r,o){i.push((function(t){if(t)return o(t);for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];if(1===i.length||!e)return r(i[0]);var a={};i.forEach((function(t,r){var n=e[r];n&&(a[n]=t)})),r(a)})),t.apply(n,i)}))}}n.argumentNames="__ES6-PROMISIFY--CUSTOM-ARGUMENTS__",n.Promise=void 0},function(t,e,r){"use strict";(function(t){
2
2
  /*!
3
3
  * The buffer module from node.js, for the browser.
4
4
  *