cloudcmd 16.1.1 → 16.2.0

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.
@@ -1,2 +1,2 @@
1
- !function(e){function r(r){for(var n,l,u=r[0],p=r[1],a=r[2],f=0,s=[];f<u.length;f++)l=u[f],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in p)Object.prototype.hasOwnProperty.call(p,n)&&(e[n]=p[n]);for(c&&c(r);s.length;)s.shift()();return i.push.apply(i,a||[]),t()}function t(){for(var e,r=0;r<i.length;r++){for(var t=i[r],n=!0,u=1;u<t.length;u++){var p=t[u];0!==o[p]&&(n=!1)}n&&(i.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},i=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/dist/";var u=window.webpackJsonp=window.webpackJsonp||[],p=u.push.bind(u);u.push=r,u=u.slice();for(var a=0;a<u.length;a++)r(u[a]);var c=p;i.push([116,0]),t()}({116:function(e,r,t){"use strict";const n=t(5),o=t(0),i=t(4),{log:l}=CloudCmd,{ajax:u}=t(13),p=t(14),a=t(1),c=o((function(e,r){const{url:t,filename:o}=r,i=n.with(e,o);u({url:t,responseType:"arraybuffer",success:i})}));CloudCmd.Cloud=e.exports,e.exports.init=async()=>{const[e]=await Promise.all([p.get("modules"),i.js("//api.filepicker.io/v2/filepicker.js")]),{key:r}=e.data.FilePicker;filepicker.setKey(r),a.hide()},e.exports.uploadFile=(e,r)=>{filepicker.store(r,{mimetype:"",filename:e},e=>{filepicker.exportFile(e,l,l)})},e.exports.saveFile=e=>{filepicker.pick(c(e))}}});
1
+ !function(e){function r(r){for(var n,l,u=r[0],p=r[1],a=r[2],f=0,s=[];f<u.length;f++)l=u[f],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in p)Object.prototype.hasOwnProperty.call(p,n)&&(e[n]=p[n]);for(c&&c(r);s.length;)s.shift()();return i.push.apply(i,a||[]),t()}function t(){for(var e,r=0;r<i.length;r++){for(var t=i[r],n=!0,u=1;u<t.length;u++){var p=t[u];0!==o[p]&&(n=!1)}n&&(i.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},i=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/dist/";var u=window.webpackJsonp=window.webpackJsonp||[],p=u.push.bind(u);u.push=r,u=u.slice();for(var a=0;a<u.length;a++)r(u[a]);var c=p;i.push([116,0]),t()}({116:function(e,r,t){"use strict";const n=t(5),o=t(0),i=t(4),{ajax:l}=t(14),u=t(15),p=t(1),{log:a}=CloudCmd,c=o((function(e,r){const{url:t,filename:o}=r,i=n.with(e,o);l({url:t,responseType:"arraybuffer",success:i})}));CloudCmd.Cloud=e.exports,e.exports.init=async()=>{const[e]=await Promise.all([u.get("modules"),i.js("//api.filepicker.io/v2/filepicker.js")]),{key:r}=e.data.FilePicker;filepicker.setKey(r),p.hide()},e.exports.uploadFile=(e,r)=>{filepicker.store(r,{mimetype:"",filename:e},e=>{filepicker.exportFile(e,a,a)})},e.exports.saveFile=e=>{filepicker.pick(c(e))}}});
2
2
  //# sourceMappingURL=cloud.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["file://cloudcmd/modules/cloud.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","1","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","116","exec","currify","load","log","CloudCmd","ajax","Files","Images","upload","callback","file","url","filename","success","with","responseType","init","async","Promise","all","js","FilePicker","filepicker","setKey","hide","uploadFile","store","mimetype","fpFile","exportFile","saveFile","pick"],"mappings":"CAAS,SAAUA,GAET,SAASC,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW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AAU9B,EAAQD,EAASJ,GAEjC,aAIA,MAAMoC,EAAOpC,EAAoB,GAE3BqC,EAAUrC,EAAoB,GAE9BsC,EAAOtC,EAAoB,IAE3BuC,IACJA,GACEC,UAEEC,KACJA,GACEzC,EAAoB,IAElB0C,EAAQ1C,EAAoB,IAE5B2C,EAAS3C,EAAoB,GAE7B4C,EAASP,GA2Bf,SAAiBQ,EAAUC,GACzB,MAAMC,IACJA,EAAGC,SACHA,GACEF,EAEEG,EAAUb,EAAKc,KAAKL,EAAUG,GACpCP,EAAK,CACHM,MACAI,aAJmB,cAKnBF,eAnCJT,SAAa,MAAInC,EAAOD,QAExBC,EAAOD,QAAQgD,KAAOC,UACpB,MAAOjF,SAsCAkF,QAAQC,IAAI,CAACb,EAAM3B,IAAI,WAAYuB,EAAKkB,GADpC,2CApCL/B,IACJA,GACErD,EAAQE,KAAKmF,WACjBC,WAAWC,OAAOlC,GAClBkB,EAAOiB,QAGTvD,EAAOD,QAAQyD,WAAa,CAACb,EAAU1E,KAErCoF,WAAWI,MAAMxF,EAAM,CACrByF,SAFe,GAGff,YACCgB,IACDN,WAAWO,WAAWD,EAAQzB,EAAKA,MAIvClC,EAAOD,QAAQ8D,SAAWrB,IACxBa,WAAWS,KAAKvB,EAAOC","file":"./modules/cloud.js","sourceRoot":""}
1
+ {"version":3,"sources":["file://cloudcmd/modules/cloud.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","1","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","116","exec","currify","load","ajax","Files","Images","log","CloudCmd","upload","callback","file","url","filename","success","with","responseType","init","async","Promise","all","js","FilePicker","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KAAOf,EAClB0D,EAAaA,EAAWG,QACxB,IAAI,IAAItD,EAAI,EAAGA,EAAImD,EAAWjD,OAAQF,IAAKP,EAAqB0D,EAAWnD,IAC3E,IAAIS,EAAsB4C,EAI1B1C,EAAgBH,KAAK,CAAC,IAAI,IAEnBK,IAxJR,CA2JC,CAEJ0C,IACA,SAAU9B,EAAQD,EAASJ,GAEjC,aAIA,MAAMoC,EAAOpC,EAAoB,GAE3BqC,EAAUrC,EAAoB,GAE9BsC,EAAOtC,EAAoB,IAE3BuC,KACJA,GACEvC,EAAoB,IAElBwC,EAAQxC,EAAoB,IAE5ByC,EAASzC,EAAoB,IAE7B0C,IACJA,GACEC,SACEC,EAASP,GA2Bf,SAAiBQ,EAAUC,GACzB,MAAMC,IACJA,EAAGC,SACHA,GACEF,EAEEG,EAAUb,EAAKc,KAAKL,EAAUG,GACpCT,EAAK,CACHQ,MACAI,aAJmB,cAKnBF,eAnCJN,SAAa,MAAItC,EAAOD,QAExBC,EAAOD,QAAQgD,KAAOC,UACpB,MAAOjF,SAsCAkF,QAAQC,IAAI,CAACf,EAAMzB,IAAI,WAAYuB,EAAKkB,GADpC,2CApCL/B,IACJA,GACErD,EAAQE,KAAKmF,WACjBC,WAAWC,OAAOlC,GAClBgB,EAAOmB,QAGTvD,EAAOD,QAAQyD,WAAa,CAACb,EAAU1E,KAErCoF,WAAWI,MAAMxF,EAAM,CACrByF,SAFe,GAGff,YACCgB,IACDN,WAAWO,WAAWD,EAAQtB,EAAKA,MAIvCrC,EAAOD,QAAQ8D,SAAWrB,IACxBa,WAAWS,KAAKvB,EAAOC","file":"./modules/cloud.js","sourceRoot":""}
@@ -1,2 +1,2 @@
1
- !function(e){function t(t){for(var o,s,i=t[0],a=t[1],u=t[2],f=0,d=[];f<i.length;f++)s=i[f],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&d.push(r[s][0]),r[s]=0;for(o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o]);for(l&&l(t);d.length;)d.shift()();return c.push.apply(c,u||[]),n()}function n(){for(var e,t=0;t<c.length;t++){for(var n=c[t],o=!0,i=1;i<n.length;i++){var a=n[i];0!==r[a]&&(o=!1)}o&&(c.splice(t--,1),e=s(s.s=n[0]))}return e}var o={},r={2:0},c=[];function s(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=e,s.c=o,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(n,o,function(t){return e[t]}.bind(null,o));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/dist/";var i=window.webpackJsonp=window.webpackJsonp||[],a=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=a;c.push([102,0]),n()}({102:function(e,t,n){"use strict";n(179);const o=n(12),r=n(0),c=n(8),s=n(37),{promisify:i}=n(15),a=n(3),u=n(4),l=n(2),f=n(103),d=n(1),p=n(16),g=n(14),{getTitle:m}=n(6),{Dialog:y,setTitle:h}=DOM;CloudCmd.Config=e.exports;const b=i(DOM.loadSocket),w=r((e,t)=>(p.addKey(t,e),t)),C=r((e,t)=>(p.add("change",t,e),t)),v={};let x;const k=u.css;e.exports.init=async()=>{if(!CloudCmd.config("configDialog"))return;d.show.load("top");const{prefix:e}=CloudCmd;[x]=await Promise.all([g.get("config-tmpl"),b(),k(e+"/dist/config.css"),CloudCmd.View()]),function(){const e=function(){const{host:e,origin:t,protocol:n}=location;return t||`${n}//${e}`}(),{prefixSocket:t,prefix:n}=CloudCmd,o=io.connect(e+t+"/config",{reconnectionAttempts:1/0,reconnectionDelay:6e4,path:n+"/socket.io"}),r=e=>{P(e),o.send(e)};(function(e){e.emit("auth",O("username"),O("password")),e.on("reject",c(y.alert,"Wrong credentials!"))})(o),o.on("connect",()=>{v.save=r}),o.on("message",P),o.on("log",CloudCmd.log),o.on("disconnect",()=>{v.save=D}),o.on("err",y.alert)}()};const{config:O,Key:j}=CloudCmd;let S;function M(){CloudCmd.View.hide()}async function N(e){const t={},n=f.getName(e),o=f.getValue(n,S);"name"===n?function(e){h(m({name:e}))}(o):"auth"===n&&E(o),t[n]=o,await v.save(t)}function P(e){for(const t of Object.keys(e)){const n=e[t];CloudCmd._config(t,n),f.setValue(t,n,S)}}async function D(e){const{RESTful:t}=DOM,[n]=await t.Config.write(e);n||P(e)}function E(e){const t=f.getElementByName("username",S),n=f.getElementByName("password",S);t.disabled=n.disabled=!e}async function T(e){let{keyCode:t,target:n}=e;switch(t){case j.ESC:return M();case j.ENTER:return await N(n)}}v.save=D,e.exports.show=async function(){if(!CloudCmd.config("configDialog"))return;await async function(){const[e,t]=await a(g.get,"config");if(e)return y.alert("Could not load config!");const{editor:n,packer:r,columns:c,configAuth:i,...u}=f.convert(t);u[n+"-selected"]="selected",u[r+"-selected"]="selected",u[c+"-selected"]="selected",u.configAuth=i?"":"hidden";const d=o(x,u);S=l("form",{className:"config",innerHTML:d});const p=document.querySelectorAll("input, select",S),[m]=p;let h;m&&(E(m.checked),h=m.focus.bind(m));const b=s(N,e=>{let{target:t}=e;return t});Array.from(p).map(w(T)).map(C(b));CloudCmd.View.show(S,{autoSize:!0,afterShow:h})}()},e.exports.hide=M},103:function(e,t,n){"use strict";const o=n(0)((e,t,n)=>typeof t[n]===e)("boolean");function r(e,t){const n=`[data-name="js-${e}"]`;return t.querySelector(n)}function c(e){return e?" checked":""}e.exports.getElementByName=r,e.exports.getName=e=>e.getAttribute("data-name").replace(/^js-/,""),e.exports.convert=e=>{const t=e,n=Object.keys(e).filter(o(e));for(const o of n){const n=e[o];t[o]=c(n)}return t},e.exports.getValue=(e,t)=>{const n=r(e,t),{type:o}=n;switch(o){case"checkbox":return n.checked;case"number":return Number(n.value);default:return n.value}},e.exports.setValue=(e,t,n)=>{const o=r(e,n),{type:c}=o;switch(c){case"checkbox":o.checked=t;break;default:o.value=t}}},179:function(e,t){}});
1
+ !function(e){function t(t){for(var o,s,i=t[0],a=t[1],u=t[2],f=0,d=[];f<i.length;f++)s=i[f],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&d.push(r[s][0]),r[s]=0;for(o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o]);for(l&&l(t);d.length;)d.shift()();return c.push.apply(c,u||[]),n()}function n(){for(var e,t=0;t<c.length;t++){for(var n=c[t],o=!0,i=1;i<n.length;i++){var a=n[i];0!==r[a]&&(o=!1)}o&&(c.splice(t--,1),e=s(s.s=n[0]))}return e}var o={},r={2:0},c=[];function s(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=e,s.c=o,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(n,o,function(t){return e[t]}.bind(null,o));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/dist/";var i=window.webpackJsonp=window.webpackJsonp||[],a=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=a;c.push([102,0]),n()}({102:function(e,t,n){"use strict";n(179);const o=n(12),r=n(0),c=n(8),s=n(37),{promisify:i}=n(13),a=n(3),u=n(4),l=n(2),f=n(103),d=n(1),p=n(16),g=n(15),{getTitle:m}=n(6),{Dialog:y,setTitle:h}=DOM;CloudCmd.Config=e.exports;const b=i(DOM.loadSocket),w=r((e,t)=>(p.addKey(t,e),t)),C=r((e,t)=>(p.add("change",t,e),t)),v={};let x;const k=u.css;e.exports.init=async()=>{if(!CloudCmd.config("configDialog"))return;d.show.load("top");const{prefix:e}=CloudCmd;[x]=await Promise.all([g.get("config-tmpl"),b(),k(e+"/dist/config.css"),CloudCmd.View()]),function(){const e=function(){const{host:e,origin:t,protocol:n}=location;return t||`${n}//${e}`}(),{prefixSocket:t,prefix:n}=CloudCmd,o=io.connect(e+t+"/config",{reconnectionAttempts:1/0,reconnectionDelay:6e4,path:n+"/socket.io"}),r=e=>{P(e),o.send(e)};(function(e){e.emit("auth",O("username"),O("password")),e.on("reject",c(y.alert,"Wrong credentials!"))})(o),o.on("connect",()=>{v.save=r}),o.on("message",P),o.on("log",CloudCmd.log),o.on("disconnect",()=>{v.save=D}),o.on("err",y.alert)}()};const{config:O,Key:j}=CloudCmd;let S;function M(){CloudCmd.View.hide()}async function N(e){const t={},n=f.getName(e),o=f.getValue(n,S);"name"===n?function(e){h(m({name:e}))}(o):"auth"===n&&E(o),t[n]=o,await v.save(t)}function P(e){for(const t of Object.keys(e)){const n=e[t];CloudCmd._config(t,n),f.setValue(t,n,S)}}async function D(e){const{RESTful:t}=DOM,[n]=await t.Config.write(e);n||P(e)}function E(e){const t=f.getElementByName("username",S),n=f.getElementByName("password",S);t.disabled=n.disabled=!e}async function T(e){let{keyCode:t,target:n}=e;switch(t){case j.ESC:return M();case j.ENTER:return await N(n)}}v.save=D,e.exports.show=async function(){if(!CloudCmd.config("configDialog"))return;await async function(){const[e,t]=await a(g.get,"config");if(e)return y.alert("Could not load config!");const{editor:n,packer:r,columns:c,configAuth:i,...u}=f.convert(t);u[n+"-selected"]="selected",u[r+"-selected"]="selected",u[c+"-selected"]="selected",u.configAuth=i?"":"hidden";const d=o(x,u);S=l("form",{className:"config",innerHTML:d});const p=document.querySelectorAll("input, select",S),[m]=p;let h;m&&(E(m.checked),h=m.focus.bind(m));const b=s(N,e=>{let{target:t}=e;return t});Array.from(p).map(w(T)).map(C(b));CloudCmd.View.show(S,{autoSize:!0,afterShow:h})}()},e.exports.hide=M},103:function(e,t,n){"use strict";const o=n(0)((e,t,n)=>typeof t[n]===e)("boolean");function r(e,t){const n=`[data-name="js-${e}"]`;return t.querySelector(n)}function c(e){return e?" checked":""}e.exports.getElementByName=r,e.exports.getName=e=>e.getAttribute("data-name").replace(/^js-/,""),e.exports.convert=e=>{const t=e,n=Object.keys(e).filter(o(e));for(const o of n){const n=e[o];t[o]=c(n)}return t},e.exports.getValue=(e,t)=>{const n=r(e,t),{type:o}=n;switch(o){case"checkbox":return n.checked;case"number":return Number(n.value);default:return n.value}},e.exports.setValue=(e,t,n)=>{const o=r(e,n),{type:c}=o;switch(c){case"checkbox":o.checked=t;break;default:o.value=t}}},179:function(e,t){}});
2
2
  //# sourceMappingURL=config.js.map
@@ -1,2 +1,2 @@
1
- !function(t){function e(e){for(var n,u,f=e[0],c=e[1],s=e[2],d=0,l=[];d<f.length;d++)u=f[d],Object.prototype.hasOwnProperty.call(r,u)&&r[u]&&l.push(r[u][0]),r[u]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(t[n]=c[n]);for(a&&a(e);l.length;)l.shift()();return i.push.apply(i,s||[]),o()}function o(){for(var t,e=0;e<i.length;e++){for(var o=i[e],n=!0,f=1;f<o.length;f++){var c=o[f];0!==r[c]&&(n=!1)}n&&(i.splice(e--,1),t=u(u.s=o[0]))}return t}var n={},r={4:0},i=[];function u(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,u),o.l=!0,o.exports}u.m=t,u.c=n,u.d=function(t,e,o){u.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},u.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},u.t=function(t,e){if(1&e&&(t=u(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(u.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)u.d(o,n,function(e){return t[e]}.bind(null,n));return o},u.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return u.d(e,"a",e),e},u.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},u.p="/dist/";var f=window.webpackJsonp=window.webpackJsonp||[],c=f.push.bind(f);f.push=e,f=f.slice();for(var s=0;s<f.length;s++)e(f[s]);var a=c;i.push([83,0]),o()}({83:function(t,e,o){"use strict";const{promisify:n}=o(15),r=o(3),i=o(2),u=o(4).js,{MAX_FILE_SIZE:f}=o(6),{time:c,timeEnd:s}=o(9);CloudCmd.Edit=e;const a=CloudCmd.config("editor");let d,l,p=!0;const h={afterShow:()=>{l.moveCursorTo(0,0).focus()}};function w(t,e){if("function"!=typeof e)throw Error(t+" should be a function!")}function y(){return l}t.exports.init=async()=>{const t=function(){const t=i("div",{style:'width : 100%;height : 100%;font-family: "Droid Sans Mono";',notAppend:!0});return d=t,t}();await CloudCmd.View(),await m(t)},t.exports.show=t=>{p||(CloudCmd.View.show(d,function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={...t,...h};if(!t.afterShow)return e;w("options.afterShow",t.afterShow);const o={config:e};return e.afterShow=()=>{o(),t.afterShow()},e}(t)),y().setOptions({fontSize:16}))},t.exports.getEditor=y,t.exports.getElement=()=>d,t.exports.hide=()=>{CloudCmd.View.hide()};const m=async t=>{const e=`${CloudCmd.prefix}/${a}`,o=CloudCmd.prefix,i=`${CloudCmd.prefixSocket}/${a}`,d=`${e}/${a}.js`;c("Edit load"),await u(d);const h=n(window[a]),[w]=await r(h,t,{maxSize:f,prefix:e,prefixSocket:i,socketPath:o});s("Edit load"),l=w,p=!1}}});
1
+ !function(t){function e(e){for(var n,u,f=e[0],c=e[1],s=e[2],d=0,l=[];d<f.length;d++)u=f[d],Object.prototype.hasOwnProperty.call(r,u)&&r[u]&&l.push(r[u][0]),r[u]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(t[n]=c[n]);for(a&&a(e);l.length;)l.shift()();return i.push.apply(i,s||[]),o()}function o(){for(var t,e=0;e<i.length;e++){for(var o=i[e],n=!0,f=1;f<o.length;f++){var c=o[f];0!==r[c]&&(n=!1)}n&&(i.splice(e--,1),t=u(u.s=o[0]))}return t}var n={},r={4:0},i=[];function u(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,u),o.l=!0,o.exports}u.m=t,u.c=n,u.d=function(t,e,o){u.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},u.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},u.t=function(t,e){if(1&e&&(t=u(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(u.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)u.d(o,n,function(e){return t[e]}.bind(null,n));return o},u.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return u.d(e,"a",e),e},u.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},u.p="/dist/";var f=window.webpackJsonp=window.webpackJsonp||[],c=f.push.bind(f);f.push=e,f=f.slice();for(var s=0;s<f.length;s++)e(f[s]);var a=c;i.push([83,0]),o()}({83:function(t,e,o){"use strict";const{promisify:n}=o(13),r=o(3),i=o(2),u=o(4),{MAX_FILE_SIZE:f}=o(6),{time:c,timeEnd:s}=o(9),a=u.js;CloudCmd.Edit=e;const d=CloudCmd.config("editor");let l,p,h=!0;const w={afterShow:()=>{p.moveCursorTo(0,0).focus()}};function y(t,e){if("function"!=typeof e)throw Error(t+" should be a function!")}function m(){return p}t.exports.init=async()=>{const t=function(){const t=i("div",{style:'width : 100%;height : 100%;font-family: "Droid Sans Mono";',notAppend:!0});return l=t,t}();await CloudCmd.View(),await b(t)},t.exports.show=t=>{h||(CloudCmd.View.show(l,function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={...t,...w};if(!t.afterShow)return e;y("options.afterShow",t.afterShow);const o={config:e};return e.afterShow=()=>{o(),t.afterShow()},e}(t)),m().setOptions({fontSize:16}))},t.exports.getEditor=m,t.exports.getElement=()=>l,t.exports.hide=()=>{CloudCmd.View.hide()};const b=async t=>{const e=`${CloudCmd.prefix}/${d}`,o=CloudCmd.prefix,i=`${CloudCmd.prefixSocket}/${d}`,u=`${e}/${d}.js`;c("Edit load"),await a(u);const l=n(window[d]),[w]=await r(l,t,{maxSize:f,prefix:e,prefixSocket:i,socketPath:o});s("Edit load"),p=w,h=!1}}});
2
2
  //# sourceMappingURL=edit.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["file://cloudcmd/modules/edit.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","4","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","83","promisify","tryToCatch","createElement","loadJS","js","MAX_FILE_SIZE","maxSize","time","timeEnd","CloudCmd","EditorName","config","Element","editor","Loading","ConfigView","afterShow","moveCursorTo","focus","checkFn","fn","Error","getEditor","init","async","element","style","notAppend","View","loadFiles","show","options","arguments","undefined","initConfig","setOptions","fontSize","getElement","hide","prefix","socketPath","prefixSocket","url","Name","word","ed"],"mappings":"CAAS,SAAUA,GAET,SAASC,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDH,EAAQG,GAAYG,EAAYH,IAKlC,IAFGc,GAAqBA,EAAoBf,GAEtCO,EAASC,QACdD,EAASS,OAATT,GAOD,OAHAU,EAAgBH,KAAKI,MAAMD,EAAiBZ,GAAkB,IAGvDc,IAER,SAASA,IAER,IADA,IAAIC,EACId,EAAI,EAAGA,EAAIW,EAAgBT,OAAQF,IAAK,CAG/C,IAFA,IAAIe,EAAiBJ,EAAgBX,GACjCgB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAeb,OAAQe,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BV,EAAgBW,KAAcF,GAAY,GAE3CA,IACFL,EAAgBQ,OAAOnB,IAAK,GAC5Bc,EAASM,EAAoBA,EAAoBC,EAAIN,EAAe,KAItE,OAAOD,EAIR,IAAIQ,EAAmB,GAKnBf,EAAkB,CACrBgB,EAAG,GAGAZ,EAAkB,GAGtB,SAASS,EAAoBzB,GAG5B,GAAG2B,EAAi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AAS,IAAKoB,KACfhB,GAEL,IAAKgB,EAAQf,UAAW,OAAOL,EAC/BQ,EAAQ,oBAAqBY,EAAQf,WACrC,MAAMA,EAAY,CAChBL,UAQF,OALAA,EAAOK,UAAY,KACjBA,IACAe,EAAQf,aAGHL,EAKqBuB,CAAWH,IACvCT,IAAYa,WAAW,CACrBC,SAAU,OAIdnE,EAAOD,QAAQsD,UAAYA,EAM3BrD,EAAOD,QAAQqE,WAAa,IAAMzB,EAElC3C,EAAOD,QAAQsE,KAAO,KACpB7B,SAASmB,KAAKU,QAGhB,MAAMT,EAAYL,UAChB,MAAMe,EAAS,GAAG9B,SAAS8B,UAAU7B,IAC/B8B,EAAa/B,SAAS8B,OACtBE,EAAe,GAAGhC,SAASgC,gBAAgB/B,IAC3CgC,EAAM,GAAGH,KAAU7B,OACzBH,EAAKoC,mBACCxC,EAAOuC,GACb,MAAME,EAAO5C,EAAUJ,OAAOc,KACvBmC,SAAY5C,EAAW2C,EAAMnB,EAAS,CAC3CnB,UACAiC,SACAE,eACAD,eAEFhC,EAAQmC,aACR9B,EAASgC,EACT/B,GAAU","file":"./modules/edit.js","sourceRoot":""}
1
+ {"version":3,"sources":["file://cloudcmd/modules/edit.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","4","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","83","promisify","tryToCatch","createElement","load","MAX_FILE_SIZE","maxSize","time","timeEnd","loadJS","js","CloudCmd","EditorName","config","Element","editor","Loading","ConfigView","afterShow","moveCursorTo","focus","checkFn","fn","Error","getEditor","init","async","element","style","notAppend","View","loadFiles","show","options","arguments","undefined","initConfig","setOptions","fontSize","getElement","hide","prefix","socketPath","prefixSocket","url","Name","word","ed"],"mappings":"CAAS,SAAUA,GAET,SAASC,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDH,EAAQG,GAAYG,EAAYH,IAKlC,IAFGc,GAAqBA,EAAoBf,GAEtCO,EAASC,QACdD,EAASS,OAATT,GAOD,OAHAU,EAAgBH,KAAKI,MAAMD,EAAiBZ,GAAkB,IAGvDc,IAER,SAASA,IAER,IADA,IAAIC,EACId,EAAI,EAAGA,EAAIW,EAAgBT,OAAQF,IAAK,CAG/C,IAFA,IAAIe,EAAiBJ,EAAgBX,GACjCgB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAeb,OAAQe,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BV,EAAgBW,KAAcF,GAAY,GAE3CA,IACFL,EAAgBQ,OAAOnB,IAAK,GAC5Bc,EAASM,EAAoBA,EAAoBC,EAAIN,EAAe,KAItE,OAAOD,EAIR,IAAIQ,EAAmB,GAKnBf,EAAkB,CACrBgB,EAAG,GAGAZ,EAAkB,GAGtB,SAASS,EAAoBzB,GAG5B,GAAG2B,EAAiB3B,GACnB,OAAO2B,EAAiB3B,GAAU6B,QAGnC,IAAIC,EAASH,EAAiB3B,GAAY,CACzCK,EAAGL,EACH+B,GAAG,EACHF,QAAS,IAUV,OANAhC,EAAQG,GAAUW,KAAKmB,EAAOD,QAASC,EAAQA,EAAOD,QAASJ,GAG/D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CAAWH,IACvCT,IAAYa,WAAW,CACrBC,SAAU,OAIdpE,EAAOD,QAAQuD,UAAYA,EAM3BtD,EAAOD,QAAQsE,WAAa,IAAMzB,EAElC5C,EAAOD,QAAQuE,KAAO,KACpB7B,SAASmB,KAAKU,QAGhB,MAAMT,EAAYL,UAChB,MAAMe,EAAS,GAAG9B,SAAS8B,UAAU7B,IAC/B8B,EAAa/B,SAAS8B,OACtBE,EAAe,GAAGhC,SAASgC,gBAAgB/B,IAC3CgC,EAAM,GAAGH,KAAU7B,OACzBL,EAAKsC,mBACCpC,EAAOmC,GACb,MAAME,EAAO7C,EAAUJ,OAAOe,KACvBmC,SAAY7C,EAAW4C,EAAMnB,EAAS,CAC3CrB,UACAmC,SACAE,eACAD,eAEFlC,EAAQqC,aACR9B,EAASgC,EACT/B,GAAU","file":"./modules/edit.js","sourceRoot":""}
@@ -1,2 +1,2 @@
1
- !function(e){function t(t){for(var n,a,u=t[0],l=t[1],s=t[2],p=0,d=[];p<u.length;p++)a=u[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&d.push(o[a][0]),o[a]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n]);for(c&&c(t);d.length;)d.shift()();return i.push.apply(i,s||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,u=1;u<r.length;u++){var l=r[u];0!==o[l]&&(n=!1)}n&&(i.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={11:0},i=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/dist/";var u=window.webpackJsonp=window.webpackJsonp||[],l=u.push.bind(u);u.push=t,u=u.slice();for(var s=0;s<u.length;s++)t(u[s]);var c=l;i.push([101,0]),r()}({101:function(e,t,r){"use strict";CloudCmd.Markdown=t;const n=r(2),o=r(1),{Markdown:i}=r(19),{alert:a}=r(11);e.exports.init=async()=>{o.show.load("top"),await CloudCmd.View()},e.exports.show=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r="?relative",{positionLoad:u,relative:l}=t;o.show.load(u),l&&(e+=r);const[s,c]=await i.read(e);if(o.hide(),s)return a(s.message,{cancel:!1});const p="help",d=n("div",{className:p,innerHTML:c});CloudCmd.View.show(d)},e.exports.hide=()=>{CloudCmd.View.hide()}}});
1
+ !function(e){function t(t){for(var n,a,u=t[0],l=t[1],s=t[2],p=0,d=[];p<u.length;p++)a=u[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&d.push(o[a][0]),o[a]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n]);for(c&&c(t);d.length;)d.shift()();return i.push.apply(i,s||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,u=1;u<r.length;u++){var l=r[u];0!==o[l]&&(n=!1)}n&&(i.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={11:0},i=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/dist/";var u=window.webpackJsonp=window.webpackJsonp||[],l=u.push.bind(u);u.push=t,u=u.slice();for(var s=0;s<u.length;s++)t(u[s]);var c=l;i.push([101,0]),r()}({101:function(e,t,r){"use strict";CloudCmd.Markdown=t;const n=r(2),o=r(1),{Markdown:i}=r(18),{alert:a}=r(11);e.exports.init=async()=>{o.show.load("top"),await CloudCmd.View()},e.exports.show=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{positionLoad:r,relative:u}=t;o.show.load(r),u&&(e+="?relative");const[l,s]=await i.read(e);if(o.hide(),l)return a(l.message,{cancel:!1});const c="help",p=n("div",{className:c,innerHTML:s});CloudCmd.View.show(p)},e.exports.hide=()=>{CloudCmd.View.hide()}}});
2
2
  //# sourceMappingURL=markdown.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["file://cloudcmd/modules/markdown.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","11","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","101","CloudCmd","Markdown","createElement","Images","alert","init","async","show","load","View","options","arguments","undefined","relativeQuery","positionLoad","relative","error","innerHTML","read","hide","message","cancel","className","div"],"mappings":"CAAS,SAAUA,GAET,SAASC,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDH,EAAQG,GAAYG,EAAYH,IAKlC,IAFGc,GAAqBA,EAAoBf,GAEtCO,EAASC,QACdD,EAASS,OAATT,GAOD,OAHAU,EAAgBH,KAAKI,MAAMD,EAAiBZ,GAAkB,IAGvDc,IAER,SAASA,IAER,IADA,IAAIC,EACId,EAAI,EAAGA,EAAIW,EAAgBT,OAAQF,IAAK,CAG/C,IAFA,IAAIe,EAAiBJ,EAAgBX,GACjCgB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAeb,OAAQe,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BV,EAAgBW,KAAcF,GAAY,GAE3CA,IACFL,EAAgBQ,OAAOnB,IAAK,GAC5Bc,EAASM,EAAoBA,EAAoBC,EAAIN,EAAe,KAItE,OAAOD,EAIR,IAAIQ,EAAmB,GAKnBf,EAAkB,CACrBgB,GAAI,GAGDZ,EAAkB,GAGtB,SAASS,EAAoBzB,GAG5B,GAAG2B,EAAiB3B,GACnB,OAAO2B,EAAiB3B,GAAU6B,QAGnC,IAAIC,EAASH,EAAiB3B,GAAY,CACzCK,EAAGL,EACH+B,GAAG,EACHF,QAAS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qB,aAAIA,OAAqB,cAAK,GAChEC,EAAmBF,EAAW3C,KAAKsC,KAAKK,GAC5CA,EAAW3C,KAAOf,EAClB0D,EAAaA,EAAWG,QACxB,IAAI,IAAItD,EAAI,EAAGA,EAAImD,EAAWjD,OAAQF,IAAKP,EAAqB0D,EAAWnD,IAC3E,IAAIS,EAAsB4C,EAI1B1C,EAAgBH,KAAK,CAAC,IAAI,IAEnBK,IAxJR,CA2JC,CAEJ0C,IACA,SAAU9B,EAAQD,EAASJ,GAEjC,aAIAoC,SAASC,SAAWjC,EAEpB,MAAMkC,EAAgBtC,EAAoB,GAEpCuC,EAASvC,EAAoB,IAE7BqC,SACJA,GACErC,EAAoB,KAElBwC,MACJA,GACExC,EAAoB,IAExBK,EAAOD,QAAQqC,KAAOC,UACpBH,EAAOI,KAAKC,KAAK,aACXR,SAASS,QAGjBxC,EAAOD,QAAQuC,KAMfD,eAAoBhC,GAClB,IAAIoC,EAAUC,UAAUjE,OAAS,QAAsBkE,IAAjBD,UAAU,GAAmBA,UAAU,GAAK,GAClF,MAAME,EAAgB,aAChBC,aACJA,EAAYC,SACZA,GACEL,EACJP,EAAOI,KAAKC,KAAKM,GACbC,IAAUzC,GAAQuC,GACtB,MAAOG,EAAOC,SAAmBhB,EAASiB,KAAK5C,GAE/C,GADA6B,EAAOgB,OACHH,EAAO,OAAOZ,EAAMY,EAAMI,QAAS,CACrCC,QAAQ,IAEV,MAAMC,EAAY,OACZC,EAAMrB,EAAc,MAAO,CAC/BoB,YACAL,cAEFjB,SAASS,KAAKF,KAAKgB,IAvBrBtD,EAAOD,QAAQmD,KAAO,KACpBnB,SAASS,KAAKU","file":"./modules/markdown.js","sourceRoot":""}
1
+ {"version":3,"sources":["file://cloudcmd/modules/markdown.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","11","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","101","CloudCmd","Markdown","createElement","Images","alert","init","async","show","load","View","options","arguments","undefined","positionLoad","relative","error","innerHTML","read","hide","message","cancel","className","div"],"mappings":"CAAS,SAAUA,GAET,SAASC,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDH,EAAQG,GAAYG,EAAYH,IAKlC,IAFGc,GAAqBA,EAAoBf,GAEtCO,EAASC,QACdD,EAASS,OAATT,GAOD,OAHAU,EAAgBH,KAAKI,MAAMD,EAAiBZ,GAAkB,IAGvDc,IAER,SAASA,IAER,IADA,IAAIC,EACId,EAAI,EAAGA,EAAIW,EAAgBT,OAAQF,IAAK,CAG/C,IAFA,IAAIe,EAAiBJ,EAAgBX,GACjCgB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAeb,OAAQe,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BV,EAAgBW,KAAcF,GAAY,GAE3CA,IACFL,EAAgBQ,OAAOnB,IAAK,GAC5Bc,EAASM,EAAoBA,EAAoBC,EAAIN,EAAe,KAItE,OAAOD,EAIR,IAAIQ,EAAmB,GAKnBf,EAAkB,CACrBgB,GAAI,GAGDZ,EAAkB,GAGtB,SAASS,EAAoBzB,GAG5B,GAAG2B,EAA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s],Object.prototype.hasOwnProperty.call(r,u)&&r[u]&&f.push(r[u][0]),r[u]=0;for(o in c)Object.prototype.hasOwnProperty.call(c,o)&&(e[o]=c[o]);for(a&&a(t);f.length;)f.shift()();return i.push.apply(i,d||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],o=!0,l=1;l<n.length;l++){var c=n[l];0!==r[c]&&(o=!1)}o&&(i.splice(t--,1),e=u(u.s=n[0]))}return e}var o={},r={12:0},i=[];function u(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.m=e,u.c=o,u.d=function(e,t,n){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)u.d(n,o,function(t){return e[t]}.bind(null,o));return n},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/dist/";var l=window.webpackJsonp=window.webpackJsonp||[],c=l.push.bind(l);l.push=t,l=l.slice();for(var d=0;d<l.length;d++)t(l[d]);var a=c;i.push([93,0]),n()}({93:function(e,t,n){"use strict";const o=n(5),r=n(8),i=n(22),u=n(2),{FS:l}=n(6),{getIdBySrc:c}=n(13),d=n(19),{config:a,Key:s}=CloudCmd,{Buffer:f,Events:p,Dialog:C,Images:m}=DOM,h=DOM.CurrentInfo,y=C.alert.noFiles,g=r((async function(e){const[t,n]=await h.getData();if(t)return;const{name:o}=h;CloudCmd.execFromModule(e,"uploadFile",o,n),CloudCmd.log("Uploading to "+o+"...")}));let w,x,O;function D(){x.hide(),O.hide()}function M(e){let t,n,{type:r}=e;"context"===r?(t="context",n=s.unsetBind):"file"===r&&(t="contextFile");return{icon:!0,beforeClose:s.setBind,beforeShow:o.with(v,n),beforeClick:P,name:t}}function b(e){const t={Paste:f.paste,New:{File:DOM.promptNewFile,Directory:DOM.promptNewDir},Upload:()=>{CloudCmd.Upload.show()},"Upload From Cloud":S,"(Un)Select All":DOM.toggleAllSelectedFiles};return e&&(t["Log Out"]=CloudCmd.logOut),t}function F(e,t){if(".."!==h.name)return e();t()}function v(e,t){const{name:n}=t;let r="contextFile"!==function(e){return e?".."===DOM.getCurrentName(e)?"context":"contextFile":"context"}(DOM.getCurrentByPosition({x:t.x,y:t.y}));return"contextFile"===t.name&&(r=!r),r&&(w=n),o(e),r&&(r=function(e,t){const{panel:n}=h;if(!n)return!1;const o=document.elementFromPoint(e,t),r=n.querySelectorAll('[data-name="js-path"] *');return~[].indexOf.call(r,o)}(t.x,t.y)),r}function P(e){return w!==e}function S(){m.show.load("top"),CloudCmd.execFromModule("Cloud","saveFile",async(e,t)=>{const n=DOM.getCurrentDirPath()+e,[o]=await d.write(n,t);o||await CloudCmd.refresh({currentName:e})})}function j(){!function(e){const{prefixURL:t}=CloudCmd,n=Date.now(),o=DOM.getActiveFiles();if(!o.length)return y();for(const r of o){const o=DOM.isSelected(r),i=DOM.isCurrentIsDir(r),d=DOM.getCurrentPath(r);CloudCmd.log("downloading file "+d+"...");const a=encodeURI(d).replace(/#/g,"%23"),s=c(d);let f;f=i?t+"/pack"+a+DOM.getPackerExt(e):t+l+a+"?download";const p=u("iframe",{id:s+"-"+n,async:!1,className:"hidden",src:f}),{body:C}=document,m=C.removeChild.bind(C,p);setTimeout(m,3e4),o&&DOM.toggleSelectedFile(r)}}(a("packer"))}function k(){const e=h.element.getBoundingClientRect();return{x:Math.round(e.left+e.width/3),y:Math.round(e.top)}}function E(e){const{F9:t,ESC:n}=s,o=e.keyCode;if(s.isBind()){if(o===n)return D();if(o===t){const t=k();x.show(t.x,t.y),e.preventDefault()}}}e.exports.ENABLED=!1,CloudCmd.Menu=t,e.exports.init=()=>{const{isAuth:e,menuDataFile:t}=function(){const e=CloudCmd.config("auth"),t=b(e),n={View:()=>{CloudCmd.View.show()},Edit:()=>{const e=a("vim")?"EditFileVim":"EditFile";CloudCmd[e].show()},Rename:()=>{setTimeout(DOM.renameCurrent,100)},Delete:()=>{CloudCmd.Operation.show("delete")},Pack:()=>{CloudCmd.Operation.show("pack")},Extract:()=>{CloudCmd.Operation.show("extract")},Download:j,"Upload To Cloud":g("Cloud"),Cut:()=>{F(f.cut,y)},Copy:()=>{F(f.copy,y)},...t};return{isAuth:e,menuDataFile:n}}(),n=DOM.getFM(),o=b(e),r=M({type:"context"}),u=M({type:"file"});x=i(n,r,o),O=i(n,u,t),x.addContextMenuListener(),O.addContextMenuListener(),p.addKey(E)},e.exports.hide=D,e.exports.show=e=>{const{x:t,y:n}=function(e){return e?{x:e.x,y:e.y}:k()}(e);x.show(t,n),O.show(t,n),m.hide()}}});
1
+ !function(e){function t(t){for(var o,u,l=t[0],c=t[1],d=t[2],s=0,f=[];s<l.length;s++)u=l[s],Object.prototype.hasOwnProperty.call(r,u)&&r[u]&&f.push(r[u][0]),r[u]=0;for(o in c)Object.prototype.hasOwnProperty.call(c,o)&&(e[o]=c[o]);for(a&&a(t);f.length;)f.shift()();return i.push.apply(i,d||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],o=!0,l=1;l<n.length;l++){var c=n[l];0!==r[c]&&(o=!1)}o&&(i.splice(t--,1),e=u(u.s=n[0]))}return e}var o={},r={12:0},i=[];function u(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.m=e,u.c=o,u.d=function(e,t,n){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)u.d(n,o,function(t){return e[t]}.bind(null,o));return n},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/dist/";var l=window.webpackJsonp=window.webpackJsonp||[],c=l.push.bind(l);l.push=t,l=l.slice();for(var d=0;d<l.length;d++)t(l[d]);var a=c;i.push([93,0]),n()}({93:function(e,t,n){"use strict";const o=n(5),r=n(8),i=n(22),u=n(2),{FS:l}=n(6),{getIdBySrc:c}=n(14),d=n(18),{config:a,Key:s}=CloudCmd,{Buffer:f,Events:p,Dialog:C,Images:m}=DOM,h=DOM.CurrentInfo,y=C.alert.noFiles,g=r((async function(e){const[t,n]=await h.getData();if(t)return;const{name:o}=h;CloudCmd.execFromModule(e,"uploadFile",o,n),CloudCmd.log("Uploading to "+o+"...")}));let w,x,O;function D(){x.hide(),O.hide()}function M(e){let t,n,{type:r}=e;"context"===r?(t="context",n=s.unsetBind):"file"===r&&(t="contextFile");return{icon:!0,beforeClose:s.setBind,beforeShow:o.with(v,n),beforeClick:P,name:t}}function b(e){const t={Paste:f.paste,New:{File:DOM.promptNewFile,Directory:DOM.promptNewDir},Upload:()=>{CloudCmd.Upload.show()},"Upload From Cloud":S,"(Un)Select All":DOM.toggleAllSelectedFiles};return e&&(t["Log Out"]=CloudCmd.logOut),t}function F(e,t){if(".."!==h.name)return e();t()}function v(e,t){const{name:n}=t;let r="contextFile"!==function(e){return e?".."===DOM.getCurrentName(e)?"context":"contextFile":"context"}(DOM.getCurrentByPosition({x:t.x,y:t.y}));return"contextFile"===t.name&&(r=!r),r&&(w=n),o(e),r&&(r=function(e,t){const{panel:n}=h;if(!n)return!1;const o=document.elementFromPoint(e,t),r=n.querySelectorAll('[data-name="js-path"] *');return~[].indexOf.call(r,o)}(t.x,t.y)),r}function P(e){return w!==e}function S(){m.show.load("top"),CloudCmd.execFromModule("Cloud","saveFile",async(e,t)=>{const n=DOM.getCurrentDirPath()+e,[o]=await d.write(n,t);o||await CloudCmd.refresh({currentName:e})})}function j(){!function(e){const{prefixURL:t}=CloudCmd,n=Date.now(),o=DOM.getActiveFiles();if(!o.length)return y();for(const r of o){const o=DOM.isSelected(r),i=DOM.isCurrentIsDir(r),d=DOM.getCurrentPath(r);CloudCmd.log("downloading file "+d+"...");const a=encodeURI(d).replace(/#/g,"%23"),s=c(d);let f;f=i?t+"/pack"+a+DOM.getPackerExt(e):t+l+a+"?download";const p=u("iframe",{id:s+"-"+n,async:!1,className:"hidden",src:f}),{body:C}=document,m=C.removeChild.bind(C,p);setTimeout(m,3e4),o&&DOM.toggleSelectedFile(r)}}(a("packer"))}function k(){const e=h.element.getBoundingClientRect();return{x:Math.round(e.left+e.width/3),y:Math.round(e.top)}}function E(e){const{F9:t,ESC:n}=s,o=e.keyCode;if(s.isBind()){if(o===n)return D();if(o===t){const t=k();x.show(t.x,t.y),e.preventDefault()}}}e.exports.ENABLED=!1,CloudCmd.Menu=t,e.exports.init=()=>{const{isAuth:e,menuDataFile:t}=function(){const e=CloudCmd.config("auth"),t=b(e),n={View:()=>{CloudCmd.View.show()},Edit:()=>{const e=a("vim")?"EditFileVim":"EditFile";CloudCmd[e].show()},Rename:()=>{setTimeout(DOM.renameCurrent,100)},Delete:()=>{CloudCmd.Operation.show("delete")},Pack:()=>{CloudCmd.Operation.show("pack")},Extract:()=>{CloudCmd.Operation.show("extract")},Download:j,"Upload To Cloud":g("Cloud"),Cut:()=>{F(f.cut,y)},Copy:()=>{F(f.copy,y)},...t};return{isAuth:e,menuDataFile:n}}(),n=DOM.getFM(),o=b(e),r=M({type:"context"}),u=M({type:"file"});x=i(n,r,o),O=i(n,u,t),x.addContextMenuListener(),O.addContextMenuListener(),p.addKey(E)},e.exports.hide=D,e.exports.show=e=>{const{x:t,y:n}=function(e){return e?{x:e.x,y:e.y}:k()}(e);x.show(t,n),O.show(t,n),m.hide()}}});
2
2
  //# sourceMappingURL=menu.js.map
@@ -1,2 +1,2 @@
1
- !function(e){function t(t){for(var o,a,c=t[0],s=t[1],l=t[2],f=0,p=[];f<c.length;f++)a=c[f],Object.prototype.hasOwnProperty.call(r,a)&&r[a]&&p.push(r[a][0]),r[a]=0;for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o]);for(u&&u(t);p.length;)p.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],o=!0,c=1;c<n.length;c++){var s=n[c];0!==r[s]&&(o=!1)}o&&(i.splice(t--,1),e=a(a.s=n[0]))}return e}var o={},r={13:0},i=[];function a(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=o,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(n,o,function(t){return e[t]}.bind(null,o));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/dist/";var c=window.webpackJsonp=window.webpackJsonp||[],s=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var u=s;i.push([107,0]),n()}({107:function(e,t,n){"use strict";const o=n(0),r=n(8),{promisify:i}=n(15),a=n(5),c=n(4),s=n(3),{encode:l}=n(17),u=n(108),f=n(109),p=n(112);CloudCmd.Operation=t;const{config:m}=CloudCmd,{Dialog:d,Images:g}=DOM,h=r((function(e,t){const n=r(t),o=r(d.alert);e.on("accept",n(e)),e.on("reject",o("Wrong credentials!")),e.emit("auth",m("username"),m("password"))})),y={};let O,v,C,b,M,D,x;const w=DOM.CurrentInfo,k=g.show.load.bind(null,"top"),P=o((async function(e,t){let n,o,r,i,a,c="",s="",u=[];t?(c=t.from,s=t.to,u=t.names,r=w.panel):(c=w.dirPath,s=DOM.getNotCurrentDirPath(),n=DOM.getSelectedFiles(),u=DOM.getFilenames(n),t={},i=!0,r=w.panelPassive);u.length||u.push(DOM.getCurrentName());const[f]=u,p=DOM.getCurrentByName(f,r);if(!t&&j())return;const{type:g}=e,h="copy"===g,y=h?"confirmCopy":"confirmMove",O=h?"Copy":"Rename/Move",b=h?v:C;if(i&&m(y)){const[e,t]=await async function(e,t,n){const o=n.length,[r]=n;e+=" ",n.length>1?e+=o+" file(s)":e+='"'+r+'"';return e+=" to",await d.prompt(e,t)}(O,s,u.map(l));return void(e||M(t))}function M(e){if(a=c!==e&&e,a&&!i||!p)return n();const t=`"${f}" already exist. Overwrite?`;function n(){k(),o={from:c,to:e,names:u},b(o,async()=>{await DOM.Storage.remove(c);const{panel:e,panelPassive:t}=w;w.isOnePanel||CloudCmd.refresh({panel:t,noCurrent:!0}),CloudCmd.refresh({panel:e})})}d.confirm(t,{cancel:!1}).then(n)}M(s)})),j=()=>{const{length:e}=DOM.getActiveFiles(),t=Boolean(!e);return t?d.alert.noFiles():t};e.exports.init=i(e=>{k(),a.series([DOM.loadSocket,async e=>{if(m("dropbox"))return e();const{prefix:t,prefixSocket:n}=CloudCmd;await async function(){const{prefix:e}=CloudCmd,t=e+"/fileop/fileop.js",[n]=await s(c.js,t);n&&d.alert(n.message);O=!0}(),await async function(e,t,n){t+="/fileop";const o=await fileop({prefix:e,socketPrefix:t});o.on("connect",h(o,F(n)))}(t,n,e)},e=>{O=!0,g.hide(),e()}],e)});const F=o((e,t)=>{!function(e){x=(t,n)=>{let{from:o,to:r,names:i}=t;const a=f({operation:"Tar",callback:n,noContinue:!0,from:o,to:r});e.tar(o,r,i).then(a)},D=(t,n)=>{let{from:o,to:r,names:i}=t;const a=f({operation:"Zip",callback:n,noContinue:!0,from:o,to:r});e.zip(o,r,i).then(a)},b=(t,n,o)=>{t=t.replace(/\?.*/,"");const r=f({operation:"Delete",callback:o,from:t});e.remove(t,n).then(r)},v=(t,n)=>{let{from:o,to:r,names:i}=t;const a=f({operation:"Copy",callback:n,from:o,to:r,names:i});e.copy(o,r,i).then(a)},C=(t,n)=>{let{from:o,to:r,names:i}=t;const a=f({operation:"Move",callback:n,from:o,to:r});e.move(o,r,i).then(a)},M=(t,n)=>{let{from:o,to:r}=t;const i=f({operation:"Extract",callback:n,noContinue:!0,from:o,to:r});e.extract(o,r).then(i)}}(t),e()});function S(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:DOM.getActiveFiles();const t="?files",n=w.dirPath;if(j())return;k();const o=DOM.getFilenames(e),r=DOM.CurrentInfo.files.map(DOM.getCurrentName),i=DOM.getCurrentName(),a=p(i,r,o);b(n+t,o,async()=>{await CloudCmd.refresh();const e=w.files.map(DOM.getCurrentName).includes(i)?i:a;DOM.setCurrentByName(e)})}function N(e,t){let n,o,r=w.name;const{path:i,dirPath:a}=w,c=DOM.getActiveFiles(),s=DOM.getFilenames(c);if(function(e,t){if(!t)throw Error(e+" could not be empty!")}("operation",e),!s.length)return d.alert.noFiles();switch(e){case"extract":n=M,o={from:i,to:a},r=u(r);break;case"pack":n=function(e){return"zip"===e?D:x}(t),s.length>1&&(r=w.dir),r+=DOM.getPackerExt(t),o={from:a,to:a+r,names:s}}k(),n(o,e=>{!e&&CloudCmd.refresh({currentName:r})})}e.exports.hide=()=>{CloudCmd.View.hide()},e.exports.show=(e,t)=>{if(O)return"copy"===e?y.copy(t):"move"===e?y.move(t):"delete"===e?y.delete():"delete:silent"===e?y.deleteSilent():"pack"===e?y.pack():"extract"===e?y.extract():void 0},y.copy=P({type:"copy"}),y.move=P({type:"move"}),y.delete=async function(){if(j())return;const e="Do you really want to delete the ",t=DOM.getActiveFiles(),n=DOM.getFilenames(t),o=n.length;let r;if(o){let t="";for(let e=0;e<5&&e<o;e++)t+="\n"+n[e];o>=5&&(t+="\n..."),r=e+"selected "+o+" files/directories?\n"+l(t)}else{const t=DOM.getCurrentFile(),n=DOM.isCurrentIsDir(t),o=(e=>e?"directory":"file")(n)+" ",i=DOM.getCurrentName(t);r=e+"selected "+o+i+"?"}const[i]=await d.confirm(r);if(i)return;S(t)},y.deleteSilent=S,y.pack=()=>{N("pack","zip"===m("packer")?"zip":"tar")},y.extract=()=>{N("extract")}},108:function(e,t,n){"use strict";const{getExt:o}=n(9);e.exports=e=>{const t=function(e){return/\.tar\.gz$/.test(e)?".tar.gz":/\.tar\.bz2$/.test(e)?".tar.bz2":o(e)}(e);return e.replace(t,"")}},109:function(e,t,n){"use strict";const{Dialog:o,Images:r}=DOM,i=n(110),a=n(8),c=n(111);e.exports=e=>t=>{const{operation:n,callback:s,noContinue:l,from:u,to:f}=e;let p,m;const d=a(e=>{let{emitter:t,operation:n}=e;t.abort();const r=n+" aborted";m=!0,o.alert(r,{cancel:!1})}),g=t.removeListener.bind(t),h=t.on.bind(t),y=c(n,u,f),O=o.progress(y);O.catch(d({emitter:t,operation:n}));const v={progress:e=>{p=100===e,O.setProgress(e)},end:()=>{r.hide(),i(g,v),O.remove(),(m||p)&&s()},error:async e=>{if(m=e,l)return v.end(e),o.alert(e),void O.remove();const[n]=await o.confirm(e+"\n Continue?");if(!p&&!n)return t.continue();t.abort(),O.remove()}};i(h,v)}},111:function(e,t,n){"use strict";e.exports=(e,t,n)=>n?`${e} ${t} -> ${n}`:`${e} ${t}`},112:function(e,t,n){"use strict";const o=n(0),r=o((e,t)=>!e.includes(t)),i=o((e,t)=>e.filter(r(t)));e.exports=(e,t,n)=>{const o=t.indexOf(e),r=i(t,n),{length:a}=r;return r[o]?r[o]:r[a-1]}}});
1
+ !function(e){function t(t){for(var o,a,c=t[0],s=t[1],l=t[2],f=0,p=[];f<c.length;f++)a=c[f],Object.prototype.hasOwnProperty.call(r,a)&&r[a]&&p.push(r[a][0]),r[a]=0;for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o]);for(u&&u(t);p.length;)p.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],o=!0,c=1;c<n.length;c++){var s=n[c];0!==r[s]&&(o=!1)}o&&(i.splice(t--,1),e=a(a.s=n[0]))}return e}var o={},r={13:0},i=[];function a(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=o,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(n,o,function(t){return e[t]}.bind(null,o));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/dist/";var c=window.webpackJsonp=window.webpackJsonp||[],s=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var u=s;i.push([107,0]),n()}({107:function(e,t,n){"use strict";const o=n(0),r=n(8),{promisify:i}=n(13),a=n(5),c=n(4),s=n(3),{encode:l}=n(17),u=n(108),f=n(109),p=n(112);CloudCmd.Operation=t;const{config:m}=CloudCmd,{Dialog:d,Images:g}=DOM,h=r((function(e,t){const n=r(t),o=r(d.alert);e.on("accept",n(e)),e.on("reject",o("Wrong credentials!")),e.emit("auth",m("username"),m("password"))})),y={};let O,v,C,b,M,D,x;const w=DOM.CurrentInfo,k=g.show.load.bind(null,"top"),P=o((async function(e,t){let n,o,r,i,a,c="",s="",u=[];t?(c=t.from,s=t.to,u=t.names,r=w.panel):(c=w.dirPath,s=DOM.getNotCurrentDirPath(),n=DOM.getSelectedFiles(),u=DOM.getFilenames(n),t={},i=!0,r=w.panelPassive);u.length||u.push(DOM.getCurrentName());const[f]=u,p=DOM.getCurrentByName(f,r);if(!t&&j())return;const{type:g}=e,h="copy"===g,y=h?"confirmCopy":"confirmMove",O=h?"Copy":"Rename/Move",b=h?v:C;if(i&&m(y)){const[e,t]=await async function(e,t,n){const o=n.length,[r]=n;e+=" ",n.length>1?e+=o+" file(s)":e+='"'+r+'"';return e+=" to",await d.prompt(e,t)}(O,s,u.map(l));return void(e||M(t))}function M(e){if(a=c!==e&&e,a&&!i||!p)return n();const t=`"${f}" already exist. Overwrite?`;function n(){k(),o={from:c,to:e,names:u},b(o,async()=>{await DOM.Storage.remove(c);const{panel:e,panelPassive:t}=w;w.isOnePanel||CloudCmd.refresh({panel:t,noCurrent:!0}),CloudCmd.refresh({panel:e})})}d.confirm(t,{cancel:!1}).then(n)}M(s)})),j=()=>{const{length:e}=DOM.getActiveFiles(),t=Boolean(!e);return t?d.alert.noFiles():t};e.exports.init=i(e=>{k(),a.series([DOM.loadSocket,async e=>{if(m("dropbox"))return e();const{prefix:t,prefixSocket:n}=CloudCmd;await async function(){const{prefix:e}=CloudCmd,t=e+"/fileop/fileop.js",[n]=await s(c.js,t);n&&d.alert(n.message);O=!0}(),await async function(e,t,n){t+="/fileop";const o=await fileop({prefix:e,socketPrefix:t});o.on("connect",h(o,F(n)))}(t,n,e)},e=>{O=!0,g.hide(),e()}],e)});const F=o((e,t)=>{!function(e){x=(t,n)=>{let{from:o,to:r,names:i}=t;const a=f({operation:"Tar",callback:n,noContinue:!0,from:o,to:r});e.tar(o,r,i).then(a)},D=(t,n)=>{let{from:o,to:r,names:i}=t;const a=f({operation:"Zip",callback:n,noContinue:!0,from:o,to:r});e.zip(o,r,i).then(a)},b=(t,n,o)=>{t=t.replace(/\?.*/,"");const r=f({operation:"Delete",callback:o,from:t});e.remove(t,n).then(r)},v=(t,n)=>{let{from:o,to:r,names:i}=t;const a=f({operation:"Copy",callback:n,from:o,to:r,names:i});e.copy(o,r,i).then(a)},C=(t,n)=>{let{from:o,to:r,names:i}=t;const a=f({operation:"Move",callback:n,from:o,to:r});e.move(o,r,i).then(a)},M=(t,n)=>{let{from:o,to:r}=t;const i=f({operation:"Extract",callback:n,noContinue:!0,from:o,to:r});e.extract(o,r).then(i)}}(t),e()});function S(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:DOM.getActiveFiles();const t="?files",n=w.dirPath;if(j())return;k();const o=DOM.getFilenames(e),r=DOM.CurrentInfo.files.map(DOM.getCurrentName),i=DOM.getCurrentName(),a=p(i,r,o);b(n+t,o,async()=>{await CloudCmd.refresh();const e=w.files.map(DOM.getCurrentName).includes(i)?i:a;DOM.setCurrentByName(e)})}function N(e,t){let n,o,r=w.name;const{path:i,dirPath:a}=w,c=DOM.getActiveFiles(),s=DOM.getFilenames(c);if(function(e,t){if(!t)throw Error(e+" could not be empty!")}("operation",e),!s.length)return d.alert.noFiles();switch(e){case"extract":n=M,o={from:i,to:a},r=u(r);break;case"pack":n=function(e){return"zip"===e?D:x}(t),s.length>1&&(r=w.dir),r+=DOM.getPackerExt(t),o={from:a,to:a+r,names:s}}k(),n(o,e=>{!e&&CloudCmd.refresh({currentName:r})})}e.exports.hide=()=>{CloudCmd.View.hide()},e.exports.show=(e,t)=>{if(O)return"copy"===e?y.copy(t):"move"===e?y.move(t):"delete"===e?y.delete():"delete:silent"===e?y.deleteSilent():"pack"===e?y.pack():"extract"===e?y.extract():void 0},y.copy=P({type:"copy"}),y.move=P({type:"move"}),y.delete=async function(){if(j())return;const e="Do you really want to delete the ",t=DOM.getActiveFiles(),n=DOM.getFilenames(t),o=n.length;let r;if(o){let t="";for(let e=0;e<5&&e<o;e++)t+="\n"+n[e];o>=5&&(t+="\n..."),r=e+"selected "+o+" files/directories?\n"+l(t)}else{const t=DOM.getCurrentFile(),n=DOM.isCurrentIsDir(t),o=(e=>e?"directory":"file")(n)+" ",i=DOM.getCurrentName(t);r=e+"selected "+o+i+"?"}const[i]=await d.confirm(r);if(i)return;S(t)},y.deleteSilent=S,y.pack=()=>{N("pack","zip"===m("packer")?"zip":"tar")},y.extract=()=>{N("extract")}},108:function(e,t,n){"use strict";const{getExt:o}=n(9);e.exports=e=>{const t=function(e){return/\.tar\.gz$/.test(e)?".tar.gz":/\.tar\.bz2$/.test(e)?".tar.bz2":o(e)}(e);return e.replace(t,"")}},109:function(e,t,n){"use strict";const o=n(110),r=n(8),i=n(111),{Dialog:a,Images:c}=DOM;e.exports=e=>t=>{const{operation:n,callback:s,noContinue:l,from:u,to:f}=e;let p,m;const d=r(e=>{let{emitter:t,operation:n}=e;t.abort();const o=n+" aborted";m=!0,a.alert(o,{cancel:!1})}),g=t.removeListener.bind(t),h=t.on.bind(t),y=i(n,u,f),O=a.progress(y);O.catch(d({emitter:t,operation:n}));const v={progress:e=>{p=100===e,O.setProgress(e)},end:()=>{c.hide(),o(g,v),O.remove(),(m||p)&&s()},error:async e=>{if(m=e,l)return v.end(e),a.alert(e),void O.remove();const[n]=await a.confirm(e+"\n Continue?");if(!p&&!n)return t.continue();t.abort(),O.remove()}};o(h,v)}},111:function(e,t,n){"use strict";e.exports=(e,t,n)=>n?`${e} ${t} -> ${n}`:`${e} ${t}`},112:function(e,t,n){"use strict";const o=n(0),r=o((e,t)=>!e.includes(t)),i=o((e,t)=>e.filter(r(t)));e.exports=(e,t,n)=>{const o=t.indexOf(e),r=i(t,n),{length:a}=r;return r[o]?r[o]:r[a-1]}}});
2
2
  //# sourceMappingURL=operation.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["file://cloudcmd/modules/operation.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","13","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","107","currify","wraptile","promisify","exec","load","tryToCatch","encode","removeExtension","setListeners","getNextCurrentName","CloudCmd","config","Dialog","Images","DOM","authCheck","spawn","ok","accept","alertDialog","alert","on","emit","Operation","Loaded","copyFn","moveFn","deleteFn","extractFn","packZipFn","packTarFn","Info","CurrentInfo","showLoad","show","processFiles","async","options","selFiles","files","panel","shouldAsk","from","to","names","dirPath","getNotCurrentDirPath","getSelectedFiles","getFilenames","panelPassive","getCurrentName","sameName","getCurrentByName","noFilesCheck","type","isCopy","option","title","operation","cancel","newTo","msg","prompt","map","ask","go","str","Storage","remove","isOnePanel","refresh","noCurrent","confirm","then","getActiveFiles","is","Boolean","noFiles","init","callback","series","loadSocket","prefix","prefixSocket","file","error","js","message","loadAll","socketPrefix","fn","operator","fileop","onConnect","initOperations","hide","_ref","listen","noContinue","tar","_ref2","zip","replace","_ref3","copy","_ref4","move","_ref5","extract","setOperations","deleteSilent","arguments","undefined","query","path","removedNames","currentName","nextCurrentName","includes","setCurrentByName","twopack","op","fileFrom","activeFiles","Error","checkEmpty","getPacker","dir","getPackerExt","View","delete","pack","msgAsk","current","getCurrentFile","isDir","isCurrentIsDir","getType","108","getExt","ext","test","getExtension","109","forEachKey","format","emitter","done","lastError","onAbort","abort","removeListener","progress","catch","listeners","setProgress","end","continue","111","112","not","array","notOneOf","a","b","filter","indexOf","nextNames"],"mappings":"CAAS,SAAUA,GAET,SAASC,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDH,EAAQG,GAAYG,EAAYH,IAKlC,IAFGc,GAAqBA,EAAoBf,GAEtCO,EAASC,QACdD,EAASS,OAATT,GAOD,OAHAU,EAAgBH,KAAKI,MAAMD,EAAiBZ,GAAkB,IAGvDc,IAER,SAASA,IAER,IADA,IAAIC,EACId,EAAI,EAAGA,EAAIW,EAAgBT,OAAQF,IAAK,CAG/C,IAFA,IAAIe,EAAiBJ,EAAgBX,GACjCgB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAeb,OAAQe,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BV,EAAgBW,KAAcF,GAAY,GAE3CA,IACFL,EAAgBQ,OAAOnB,IAAK,GAC5Bc,EAASM,EAAoBA,EAAoBC,EAAIN,EAAe,KAItE,OAAOD,EAIR,IAAIQ,EAAmB,GAKnBf,EAAkB,CACrBgB,GAAI,GAGDZ,EAAkB,GAGtB,SAASS,EAAoBzB,GAG5B,GAAG2B,EAAiB3B,GACnB,OAAO2B,EAAiB3B,GAAU6B,QAGnC,IAAIC,EAASH,EAAiB3B,GAAY,CACzCK,EAAGL,EACH+B,GAAG,EACHF,QAAS,IAUV,OANAhC,EAAQG,GAAUW,KAAKmB,EAAO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,KAEhDnM,EAAOD,QAAU,CAACoJ,EAAaxE,EAAOuE,KACpC,MAAM3K,EAAIoG,EAAM0H,QAAQlD,GAClBmD,EAAYL,EAAStH,EAAOuE,IAC5BzK,OACJA,GACE6N,EACJ,OAAIA,EAAU/N,GAAW+N,EAAU/N,GAC5B+N,EAAU7N,EAAS","file":"./modules/operation.js","sourceRoot":""}
1
+ {"version":3,"sources":["file://cloudcmd/modules/operation.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","13","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","107","currify","wraptile","promisify","exec","load","tryToCatch","encode","removeExtension","setListeners","getNextCurrentName","CloudCmd","config","Dialog","Images","DOM","authCheck","spawn","ok","accept","alertDialog","alert","on","emit","Operation","Loaded","copyFn","moveFn","deleteFn","extractFn","packZipFn","packTarFn","Info","CurrentInfo","showLoad","show","processFiles","async","options","selFiles","files","panel","shouldAsk","from","to","names","dirPath","getNotCurrentDirPath","getSelectedFiles","getFilenames","panelPassive","getCurrentName","sameName","getCurrentByName","noFilesCheck","type","isCopy","option","title","operation","cancel","newTo","msg","prompt","map","ask","go","str","Storage","remove","isOnePanel","refresh","noCurrent","confirm","then","getActiveFiles","is","Boolean","noFiles","init","callback","series","loadSocket","prefix","prefixSocket","file","error","js","message","loadAll","socketPrefix","fn","operator","fileop","onConnect","initOperations","hide","_ref","listen","noContinue","tar","_ref2","zip","replace","_ref3","copy","_ref4","move","_ref5","extract","setOperations","deleteSilent","arguments","undefined","query","path","removedNames","currentName","nextCurrentName","includes","setCurrentByName","twopack","op","fileFrom","activeFiles","Error","checkEmpty","getPacker","dir","getPackerExt","View","delete","pack","msgAsk","current","getCurrentFile","isDir","isCurrentIsDir","getType","108","getExt","ext","test","getExtension","109","forEachKey","format","emitter","done","lastError","onAbort","abort","removeListener","progress","catch","listeners","setProgress","end","continue","111","112","not","array","notOneOf","a","b","filter","indexOf","nextNames"],"mappings":"CAAS,SAAUA,GAET,SAASC,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDH,EAAQG,GAAYG,EAAYH,IAKlC,IAFGc,GAAqBA,EAAoBf,GAEtCO,EAASC,QACdD,EAASS,OAATT,GAOD,OAHAU,EAAgBH,KAAKI,MAAMD,EAAiBZ,GAAkB,IAGvDc,IAER,SAASA,IAER,IADA,IAAIC,EACId,EAAI,EAAGA,EAAIW,EAAgBT,OAAQF,IAAK,CAG/C,IAFA,IAAIe,EAAiBJ,EAAgBX,GACjCgB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAeb,OAAQe,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BV,EAAgBW,KAAcF,GAAY,GAE3CA,IACFL,EAAgBQ,OAAOnB,IAAK,GAC5Bc,EAASM,EAAoBA,EAAoBC,EAAIN,EAAe,KAItE,OAAOD,EAIR,IAAIQ,EAAmB,GAKnBf,EAAkB,CACrBgB,GAAI,GAGDZ,EAAkB,GAGtB,SAASS,EAAoBzB,GAG5B,GAAG2B,EAAiB3B,GACnB,OAAO2B,EAAiB3B,GAAU6B,QAGnC,IAAIC,EAASH,EAAiB3B,G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AAWkL,EAAM3C,SAASvI,IAChDmL,EAAWlK,EAAQ,CAACmK,EAAGC,IAAMD,EAAEE,OAAOL,EAAII,KAEhDnM,EAAOD,QAAU,CAACoJ,EAAaxE,EAAOuE,KACpC,MAAM3K,EAAIoG,EAAM0H,QAAQlD,GAClBmD,EAAYL,EAAStH,EAAOuE,IAC5BzK,OACJA,GACE6N,EACJ,OAAIA,EAAU/N,GAAW+N,EAAU/N,GAC5B+N,EAAU7N,EAAS","file":"./modules/operation.js","sourceRoot":""}
@@ -1,2 +1,2 @@
1
- !function(e){function t(t){for(var r,a,l=t[0],u=t[1],c=t[2],d=0,f=[];d<l.length;d++)a=l[d],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&f.push(o[a][0]),o[a]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(e[r]=u[r]);for(s&&s(t);f.length;)f.shift()();return i.push.apply(i,c||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,l=1;l<n.length;l++){var u=n[l];0!==o[u]&&(r=!1)}r&&(i.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},o={16:0},i=[];function a(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/dist/";var l=window.webpackJsonp=window.webpackJsonp||[],u=l.push.bind(l);l.push=t,l=l.slice();for(var c=0;c<l.length;c++)t(l[c]);var s=u;i.push([115,0]),n()}({115:function(e,t,n){"use strict";const{promisify:r}=n(15),o=n(3),i=n(7);n(180);const a=n(5),l=n(4),u=n(10),c=n(1),{Dialog:s}=u,{Key:d,config:f}=CloudCmd;let p,m,y;CloudCmd.TerminalRun=t;const h=i(),C=async()=>{const{prefix:e}=CloudCmd,t=CloudCmd.prefix+"/gritty"+"/gritty.js",n=e+"/dist/terminal.css",[r]=await o(l.parallel,[t,n]);if(r){const e=r.target.src.replace(window.location.href,"");return s.alert(`file ${e} could not be loaded`)}p=!0};function g(){CloudCmd.View.hide()}function w(e){const{cwd:t=u.getCurrentDirPath(),command:n,autoClose:r,closeMessage:o="Press any key to close Terminal..."}=e,i={cwd:t,env:{ACTIVE_DIR:u.getCurrentDirPath,PASSIVE_DIR:u.getNotCurrentDirPath,CURRENT_NAME:u.getCurrentName,CURRENT_PATH:u.getCurrentPath},prefix:CloudCmd.prefixSocket+"/gritty",socketPath:CloudCmd.prefix,fontFamily:"Droid Sans Mono",command:n,autoRestart:!1};let l=!1;const{socket:c,terminal:s}=gritty(document.body,i);y=c,m=s,m.onKey(e=>{let{domEvent:t}=e;const{keyCode:n,shiftKey:r}=t;l&&g(),r&&n===d.ESC&&g()}),y.on("exit",e=>{if(h(e),r)return g();s.write("\n"+o),l=!0}),y.on("connect",a.with(b,c))}function b(e){e.emit("auth",f("username"),f("password")),e.on("reject",()=>{s.alert("Wrong credentials!")})}e.exports.init=async()=>{f("terminal")&&(c.show.load("top"),await CloudCmd.View(),await C())},e.exports.show=r((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;p&&f("terminal")&&(w(e),CloudCmd.View.show(m.element,{afterShow:()=>{m.focus()},afterClose:()=>{t(null,h())}}))})),e.exports.hide=g}});
1
+ !function(e){function t(t){for(var r,a,l=t[0],u=t[1],c=t[2],d=0,f=[];d<l.length;d++)a=l[d],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&f.push(o[a][0]),o[a]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(e[r]=u[r]);for(s&&s(t);f.length;)f.shift()();return i.push.apply(i,c||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,l=1;l<n.length;l++){var u=n[l];0!==o[u]&&(r=!1)}r&&(i.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},o={16:0},i=[];function a(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/dist/";var l=window.webpackJsonp=window.webpackJsonp||[],u=l.push.bind(l);l.push=t,l=l.slice();for(var c=0;c<l.length;c++)t(l[c]);var s=u;i.push([115,0]),n()}({115:function(e,t,n){"use strict";const{promisify:r}=n(13),o=n(3),i=n(7);n(180);const a=n(5),l=n(4),u=n(10),c=n(1),{Dialog:s}=u,{Key:d,config:f}=CloudCmd;let p,m,y;CloudCmd.TerminalRun=t;const h=i(),C=async()=>{const{prefix:e}=CloudCmd,t=CloudCmd.prefix+"/gritty"+"/gritty.js",n=e+"/dist/terminal.css",[r]=await o(l.parallel,[t,n]);if(r){const e=r.target.src.replace(window.location.href,"");return s.alert(`file ${e} could not be loaded`)}p=!0};function g(){CloudCmd.View.hide()}function w(e){const{cwd:t=u.getCurrentDirPath(),command:n,autoClose:r,closeMessage:o="Press any key to close Terminal..."}=e,i={cwd:t,env:{ACTIVE_DIR:u.getCurrentDirPath,PASSIVE_DIR:u.getNotCurrentDirPath,CURRENT_NAME:u.getCurrentName,CURRENT_PATH:u.getCurrentPath},prefix:CloudCmd.prefixSocket+"/gritty",socketPath:CloudCmd.prefix,fontFamily:"Droid Sans Mono",command:n,autoRestart:!1};let l=!1;const{socket:c,terminal:s}=gritty(document.body,i);y=c,m=s,m.onKey(e=>{let{domEvent:t}=e;const{keyCode:n,shiftKey:r}=t;l&&g(),r&&n===d.ESC&&g()}),y.on("exit",e=>{if(h(e),r)return g();s.write("\n"+o),l=!0}),y.on("connect",a.with(b,c))}function b(e){e.emit("auth",f("username"),f("password")),e.on("reject",()=>{s.alert("Wrong credentials!")})}e.exports.init=async()=>{f("terminal")&&(c.show.load("top"),await CloudCmd.View(),await C())},e.exports.show=r((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;p&&f("terminal")&&(w(e),CloudCmd.View.show(m.element,{afterShow:()=>{m.focus()},afterClose:()=>{t(null,h())}}))})),e.exports.hide=g}});
2
2
  //# sourceMappingURL=terminal-run.js.map
@@ -1,2 +1,2 @@
1
- !function(t){function e(e){for(var o,i,u=e[0],l=e[1],s=e[2],c=0,f=[];c<u.length;c++)i=u[c],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&f.push(r[i][0]),r[i]=0;for(o in l)Object.prototype.hasOwnProperty.call(l,o)&&(t[o]=l[o]);for(p&&p(e);f.length;)f.shift()();return a.push.apply(a,s||[]),n()}function n(){for(var t,e=0;e<a.length;e++){for(var n=a[e],o=!0,u=1;u<n.length;u++){var l=n[u];0!==r[l]&&(o=!1)}o&&(a.splice(e--,1),t=i(i.s=n[0]))}return t}var o={},r={17:0},a=[];function i(e){if(o[e])return o[e].exports;var n=o[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=t,i.c=o,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/dist/";var u=window.webpackJsonp=window.webpackJsonp||[],l=u.push.bind(u);u.push=e,u=u.slice();for(var s=0;s<u.length;s++)e(u[s]);var p=l;a.push([106,0]),n()}({106:function(t,e,n){"use strict";CloudCmd.Upload=e;const o=n(14),r=n(1),a=n(38),i=n(2);function u(){CloudCmd.View.hide()}function l(){const t=DOM.getByDataName("js-upload-file-button");r.hide(),DOM.Events.add("change",t,t=>{let{target:e}=t;const{files:n}=e;u(),a(n)})}t.exports.init=async()=>{r.show.load("top"),await CloudCmd.View()},t.exports.show=async function(){r.show.load("top");const t=await o.get("upload"),e=i("div",{innerHTML:t});CloudCmd.View.show(e,{autoSize:!0,afterShow:l});const n=['"Droid Sans Mono"','"Ubuntu Mono"','"Consolas"',"monospace"].join(", ");i("style",{dataName:"upload-css",innerText:`[data-name=js-upload-file-button] {\n font-family: ${n};\n font-size: 16px;\n margin: 10px 0 10px 0;\n }`})},t.exports.hide=u}});
1
+ !function(t){function e(e){for(var o,i,u=e[0],l=e[1],s=e[2],c=0,f=[];c<u.length;c++)i=u[c],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&f.push(r[i][0]),r[i]=0;for(o in l)Object.prototype.hasOwnProperty.call(l,o)&&(t[o]=l[o]);for(p&&p(e);f.length;)f.shift()();return a.push.apply(a,s||[]),n()}function n(){for(var t,e=0;e<a.length;e++){for(var n=a[e],o=!0,u=1;u<n.length;u++){var l=n[u];0!==r[l]&&(o=!1)}o&&(a.splice(e--,1),t=i(i.s=n[0]))}return t}var o={},r={17:0},a=[];function i(e){if(o[e])return o[e].exports;var n=o[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=t,i.c=o,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/dist/";var u=window.webpackJsonp=window.webpackJsonp||[],l=u.push.bind(u);u.push=e,u=u.slice();for(var s=0;s<u.length;s++)e(u[s]);var p=l;a.push([106,0]),n()}({106:function(t,e,n){"use strict";CloudCmd.Upload=e;const o=n(15),r=n(1),a=n(38),i=n(2);function u(){CloudCmd.View.hide()}function l(){const t=DOM.getByDataName("js-upload-file-button");r.hide(),DOM.Events.add("change",t,t=>{let{target:e}=t;const{files:n}=e;u(),a(n)})}t.exports.init=async()=>{r.show.load("top"),await CloudCmd.View()},t.exports.show=async function(){r.show.load("top");const t=await o.get("upload"),e=i("div",{innerHTML:t});CloudCmd.View.show(e,{autoSize:!0,afterShow:l});const n=['"Droid Sans Mono"','"Ubuntu Mono"','"Consolas"',"monospace"].join(", ");i("style",{dataName:"upload-css",innerText:`[data-name=js-upload-file-button] {\n font-family: ${n};\n font-size: 16px;\n margin: 10px 0 10px 0;\n }`})},t.exports.hide=u}});
2
2
  //# sourceMappingURL=upload.js.map
@@ -1,2 +1,2 @@
1
- !function(e){function t(t){for(var r,u,c=t[0],i=t[1],a=t[2],d=0,f=[];d<c.length;d++)u=c[d],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&f.push(o[u][0]),o[u]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(l&&l(t);f.length;)f.shift()();return s.push.apply(s,a||[]),n()}function n(){for(var e,t=0;t<s.length;t++){for(var n=s[t],r=!0,c=1;c<n.length;c++){var i=n[c];0!==o[i]&&(r=!1)}r&&(s.splice(t--,1),e=u(u.s=n[0]))}return e}var r={},o={18:0},s=[];function u(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.m=e,u.c=r,u.d=function(e,t,n){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)u.d(n,r,function(t){return e[t]}.bind(null,r));return n},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/dist/";var c=window.webpackJsonp=window.webpackJsonp||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var a=0;a<c.length;a++)t(c[a]);var l=i;s.push([117,0]),n()}({117:function(e,t,n){"use strict";n(181);const r=n(0),o=n(8),s=n(7),u=n(4),c=n(2),i=n(27),a=n(3),{codeFrameColumns:l}=n(118),d=n(1),f=n(11),p=n(133),m=n(134),y=n(135),h=n(136),{runSelected:b}=n(137),x=u.css,C=s();CloudCmd.UserMenu=e.exports;const{Key:g}=CloudCmd;e.exports.init=async()=>{await Promise.all([x(CloudCmd.prefix+"/dist/user-menu.css"),CloudCmd.View()])},e.exports.show=async function(){d.show.load("top");const{dirPath:e}=w,t=await fetch(`${CloudCmd.prefix}/api/v1/user-menu?dir=${e}`),n=await t.text(),[r,o]=i(p,n);if(d.hide(),r)return f.alert(S({error:r,source:n}));C(n);const{names:s,keys:u,items:a,settings:l}=h(o);if(l.run)return b(l.select,a,P);const m=c("button",{className:"cloudcmd-user-menu-button",innerText:"User Menu",notAppend:!0}),y=c("select",{className:"cloudcmd-user-menu",innerHTML:v(s),notAppend:!0,size:10});m.addEventListener("click",M(o,y)),y.addEventListener("dblclick",k(o)),y.addEventListener("keydown",j({keys:u,userMenu:o}));CloudCmd.View.show([m,y],{autoSize:!0,afterShow:()=>y.focus()})},e.exports.hide=O;const{CurrentInfo:w}=DOM;function v(e){const t=[];for(const n of e)t.push(`<option>${n}</option>`);return t.join("")}function O(){CloudCmd.View.hide()}const k=r(async(e,t)=>{const{value:n}=t.target;await P(e[n])}),M=o(async(e,t)=>{let{value:n}=t;await P(e[n])}),j=r(async(e,t)=>{let{keys:n,userMenu:r}=e;const{keyCode:o,target:s}=t,u=t.key.toUpperCase();let c;if(t.preventDefault(),t.stopPropagation(),o===g.ESC)return O();if(o===g.ENTER)c=r[s.value];else{if(!n[u])return m(s,t);c=n[u]}await P(c)}),P=async e=>{O();const[t]=await a(e,{DOM:DOM,CloudCmd:CloudCmd,tryToCatch:a});if(!t)return;const n=C();return f.alert(S({error:t,source:n}))};function S(e){let{error:t,source:n}=e;const{code:r}=t;if(!r||"frame"===r)return t.message;const[o,s]=y(t);return`<pre>${l(n,{start:{line:o,column:s}},{message:t.message,highlightCode:!1})}</pre>`}},133:function(e,t,n){"use strict";e.exports=e=>{const t={};return Function("module",e)(t),t.exports}},134:function(e,t,n){"use strict";const{J:r,K:o,UP:s,DOWN:u}=n(36);e.exports=(e,t)=>{let{keyCode:n}=t;return n===u||n===r?function(e){const{length:t}=e;e.selectedIndex===t-1?e.selectedIndex=0:++e.selectedIndex}(e):n===s||n===o?function(e){const{length:t}=e;e.selectedIndex?--e.selectedIndex:e.selectedIndex=t-1}(e):void 0}},135:function(e,t,n){"use strict";const r=e=>"number"==typeof e;e.exports=e=>{const{lineNumber:t,columnNumber:n}=e;if(r(t)&&r(n))return[t,n];const o=e.stack.indexOf(">"),s=e.stack.slice(o+1),u=s.indexOf(")"),c=s.slice(1,u),[i,a]=c.split(":");return[Number(i),Number(a)]}},136:function(e,t,n){"use strict";const{entries:r,assign:o}=Object;e.exports=e=>{const t=[],n={},s={},u={};for(const[c,i]of r(e)){if("__settings"===c){o(u,e[c]);continue}if(c.startsWith("_"))continue;t.push(c);const[r,a]=c.split(" - ");n[r]=i,s[a]=i}return{names:t,keys:n,items:s,settings:u}}},137:function(e,t,n){"use strict";e.exports.runSelected=async(e,t,n)=>{for(const r of e)await n(t[r])}},181:function(e,t){}});
1
+ !function(e){function t(t){for(var r,u,c=t[0],i=t[1],a=t[2],d=0,f=[];d<c.length;d++)u=c[d],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&f.push(o[u][0]),o[u]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(l&&l(t);f.length;)f.shift()();return s.push.apply(s,a||[]),n()}function n(){for(var e,t=0;t<s.length;t++){for(var n=s[t],r=!0,c=1;c<n.length;c++){var i=n[c];0!==o[i]&&(r=!1)}r&&(s.splice(t--,1),e=u(u.s=n[0]))}return e}var r={},o={18:0},s=[];function u(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.m=e,u.c=r,u.d=function(e,t,n){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)u.d(n,r,function(t){return e[t]}.bind(null,r));return n},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/dist/";var c=window.webpackJsonp=window.webpackJsonp||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var a=0;a<c.length;a++)t(c[a]);var l=i;s.push([117,0]),n()}({117:function(e,t,n){"use strict";n(181);const r=n(0),o=n(8),s=n(7),u=n(4),c=n(2),i=n(28),a=n(3),{codeFrameColumns:l}=n(118),d=n(1),f=n(11),p=n(133),m=n(134),y=n(135),h=n(136),{runSelected:b}=n(137),x=u.css,C=s();CloudCmd.UserMenu=e.exports;const{Key:g}=CloudCmd;e.exports.init=async()=>{await Promise.all([x(CloudCmd.prefix+"/dist/user-menu.css"),CloudCmd.View()])},e.exports.show=async function(){d.show.load("top");const{dirPath:e}=w,t=await fetch(`${CloudCmd.prefix}/api/v1/user-menu?dir=${e}`),n=await t.text(),[r,o]=i(p,n);if(d.hide(),r)return f.alert(S({error:r,source:n}));C(n);const{names:s,keys:u,items:a,settings:l}=h(o);if(l.run)return b(l.select,a,P);const m=c("button",{className:"cloudcmd-user-menu-button",innerText:"User Menu",notAppend:!0}),y=c("select",{className:"cloudcmd-user-menu",innerHTML:v(s),notAppend:!0,size:10});m.addEventListener("click",M(o,y)),y.addEventListener("dblclick",k(o)),y.addEventListener("keydown",j({keys:u,userMenu:o}));CloudCmd.View.show([m,y],{autoSize:!0,afterShow:()=>y.focus()})},e.exports.hide=O;const{CurrentInfo:w}=DOM;function v(e){const t=[];for(const n of e)t.push(`<option>${n}</option>`);return t.join("")}function O(){CloudCmd.View.hide()}const k=r(async(e,t)=>{const{value:n}=t.target;await P(e[n])}),M=o(async(e,t)=>{let{value:n}=t;await P(e[n])}),j=r(async(e,t)=>{let{keys:n,userMenu:r}=e;const{keyCode:o,target:s}=t,u=t.key.toUpperCase();let c;if(t.preventDefault(),t.stopPropagation(),o===g.ESC)return O();if(o===g.ENTER)c=r[s.value];else{if(!n[u])return m(s,t);c=n[u]}await P(c)}),P=async e=>{O();const[t]=await a(e,{DOM:DOM,CloudCmd:CloudCmd,tryToCatch:a});if(!t)return;const n=C();return f.alert(S({error:t,source:n}))};function S(e){let{error:t,source:n}=e;const{code:r}=t;if(!r||"frame"===r)return t.message;const[o,s]=y(t);return`<pre>${l(n,{start:{line:o,column:s}},{message:t.message,highlightCode:!1})}</pre>`}},133:function(e,t,n){"use strict";e.exports=e=>{const t={};return Function("module",e)(t),t.exports}},134:function(e,t,n){"use strict";const{J:r,K:o,UP:s,DOWN:u}=n(36);e.exports=(e,t)=>{let{keyCode:n}=t;return n===u||n===r?function(e){const{length:t}=e;e.selectedIndex===t-1?e.selectedIndex=0:++e.selectedIndex}(e):n===s||n===o?function(e){const{length:t}=e;e.selectedIndex?--e.selectedIndex:e.selectedIndex=t-1}(e):void 0}},135:function(e,t,n){"use strict";const r=e=>"number"==typeof e;e.exports=e=>{const{lineNumber:t,columnNumber:n}=e;if(r(t)&&r(n))return[t,n];const o=e.stack.indexOf(">"),s=e.stack.slice(o+1),u=s.indexOf(")"),c=s.slice(1,u),[i,a]=c.split(":");return[Number(i),Number(a)]}},136:function(e,t,n){"use strict";const{entries:r,assign:o}=Object;e.exports=e=>{const t=[],n={},s={},u={};for(const[c,i]of r(e)){if("__settings"===c){o(u,e[c]);continue}if(c.startsWith("_"))continue;t.push(c);const[r,a]=c.split(" - ");n[r]=i,s[a]=i}return{names:t,keys:n,items:s,settings:u}}},137:function(e,t,n){"use strict";e.exports.runSelected=async(e,t,n)=>{for(const r of e)await n(t[r])}},181:function(e,t){}});
2
2
  //# sourceMappingURL=user-menu.js.map
@@ -1,2 +1,2 @@
1
- !function(e){function t(t){for(var o,s,a=t[0],c=t[1],u=t[2],d=0,p=[];d<a.length;d++)s=a[d],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&p.push(r[s][0]),r[s]=0;for(o in c)Object.prototype.hasOwnProperty.call(c,o)&&(e[o]=c[o]);for(f&&f(t);p.length;)p.shift()();return i.push.apply(i,u||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],o=!0,a=1;a<n.length;a++){var c=n[a];0!==r[c]&&(o=!1)}o&&(i.splice(t--,1),e=s(s.s=n[0]))}return e}var o={},r={19:0},i=[];function s(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=e,s.c=o,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(n,o,function(t){return e[t]}.bind(null,o));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/dist/";var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var f=c;i.push([94,0]),n()}({174:function(e,t){},94:function(e,t,n){"use strict";n(174);const o=n(12),r=n(0),i=n(8),s=n(3),a=n(4),c=n(95),u=n(2),{time:f}=n(9),{FS:d}=n(6),{isImage:p,isAudio:l,getType:m}=n(98),h=n(14),w=n(16),y=n(1),{encode:g}=n(17),{assign:v}=Object,{isArray:b}=Array,x=r((e,t,n,o)=>e(o,t,n)),C=i((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(const e of t)e()})),O=e=>"function"==typeof e,S=x(w.add),j=a.css;e.exports.show=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=CloudCmd.prefixURL+d;if(k)return;t&&!1===t.bindKeys||w.addKey(z);if(P=u("div",{className:"view",notAppend:!0}),P.tabIndex=0,e)return b(e)?P.append(...e):P.append(e),void c.open(P,B(t));y.show.load();const o=n+M.path,r=t.raw?"":await m(o);switch(r){default:return await I();case"markdown":return await CloudCmd.Markdown.show(M.path);case"html":return E(o);case"image":return L(M.path,n);case"media":return await F(o);case"pdf":return T(o)}},e.exports.hide=K;let k=!1;CloudCmd.View=e.exports;const M=DOM.CurrentInfo,{Key:_}=CloudCmd;let P,$;const A={beforeShow:()=>{y.hide(),_.unsetBind()},beforeClose:()=>{w.rmKey(z),_.setBind()},afterShow:()=>{P.focus()},onOverlayClick:N,afterClose:()=>{},autoSize:!1,helpers:{title:{}}};function D(e){const t=u("iframe",{src:e,width:"100%",height:"100%"});return t.addEventListener("load",()=>{t.contentWindow.addEventListener("keydown",z)}),t}function E(e){c.open(D(e),A)}function T(e){const t=D(e),n=v({},A);CloudCmd.config("showFileName")&&(n.title=M.name),c.open(t,n)}async function F(e){const[t,n]=await async function(e){!function(e){if("string"!=typeof e)throw Error("src should be a string!")}(e);const[t,n]=await s(h.get,"view/media-tmpl");if(t)return[t];const{name:r}=M;$||($=n);const i=l(r),a=o($,{src:e,type:i?"audio":"video",name:r});return[null,u("div",{innerHTML:a})]}(e);if(t)return alert(t);const r={...A,autoSize:!0,afterShow:()=>{n.querySelector("audio, video").focus()}};c.open(n,r)}async function I(){const[e,t]=await M.getData();if(e)return y.hide();const n=document.createTextNode(t),o=A;CloudCmd.config("showFileName")&&(o.title=M.name),P.append(n),c.open(P,o)}e.exports._Config=A,e.exports.init=async()=>{await async function(){const{prefix:e}=CloudCmd;f("View load"),k=!0,await j(e+"/dist/view.css"),k=!1}();["click","contextmenu"].forEach(S(void 0,N))},e.exports._createIframe=D,e.exports._viewHtml=E;function B(e){const t=v({},A);if(!e)return t;const n=Object.keys(e);for(const o of n){const n=Boolean(t[o]),r=e[o];if(!O(r)||!n){t[o]=e[o];continue}const i=t[o];t[o]=C(i,r)}return t}function K(){c.close()}function L(e,t){const n=M.files.map(DOM.getCurrentPath).filter(t=>p(t)||t===e),o=n.map(e=>{return{href:`${t}${e}`,title:g((n=e,n.split("/").pop()))};var n}),r={index:n.indexOf(M.path),autoSize:!0,arrows:!0,keys:!0,helpers:{title:{}}},i={...A,...r};c.open(o,i)}function N(e){!function(e){const t=DOM.getCurrentByPosition(e);if(!t)return;const{files:n,filesPassive:o}=M,r=n.includes(t),i=o.includes(t);if(!r&&!i)return;if(DOM.isCurrentFile(t))return;DOM.setCurrentFile(t)}({x:e.clientX,y:e.clientY})}function z(e){let{keyCode:t}=e;t===_.ESC&&K()}e.exports._initConfig=B},98:function(e,t,n){"use strict";const{extname:o}=n(99),r=n(0)((e,t)=>t.test(e)),i=e=>RegExp(`\\.${e}$`,"i");function s(e){return["jp(e|g|eg)","gif","png","bmp","webp","svg","ico"].map(i).some(r(e))}function a(e){return/\.(mp3|ogg|m4a)$/i.test(e)}async function c(e){const{headers:t}=await fetch(e,{method:"HEAD"});for(const[e,n]of t)if("content-type"===e)return"."+n.split("/").pop();return""}e.exports.getType=async e=>{return o(e)||(e=await c(e)),/\.pdf$/i.test(e)?"pdf":s(e)?"image":a(t=e)||function(e){return/\.(mp4|avi|webm)$/i.test(e)}(t)?"media":(e=>/\.html$/.test(e))(e)?"html":(e=>/.\.md$/.test(e))(e)?"markdown":void 0;var t},e.exports.isImage=s,e.exports.isAudio=a,e.exports._detectType=c}});
1
+ !function(e){function t(t){for(var o,s,a=t[0],c=t[1],u=t[2],d=0,p=[];d<a.length;d++)s=a[d],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&p.push(r[s][0]),r[s]=0;for(o in c)Object.prototype.hasOwnProperty.call(c,o)&&(e[o]=c[o]);for(f&&f(t);p.length;)p.shift()();return i.push.apply(i,u||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],o=!0,a=1;a<n.length;a++){var c=n[a];0!==r[c]&&(o=!1)}o&&(i.splice(t--,1),e=s(s.s=n[0]))}return e}var o={},r={19:0},i=[];function s(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=e,s.c=o,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(n,o,function(t){return e[t]}.bind(null,o));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/dist/";var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var f=c;i.push([94,0]),n()}({174:function(e,t){},94:function(e,t,n){"use strict";n(174);const o=n(12),r=n(0),i=n(8),s=n(3),a=n(4),c=n(95),u=n(2),{time:f}=n(9),{FS:d}=n(6),{isImage:p,isAudio:l,getType:m}=n(98),h=n(15),w=n(16),y=n(1),{encode:g}=n(17),{assign:v}=Object,{isArray:b}=Array,x=r((e,t,n,o)=>e(o,t,n)),C=i((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(const e of t)e()})),O=e=>"function"==typeof e,S=x(w.add),j=a.css;e.exports.show=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=CloudCmd.prefixURL+d;if(k)return;t&&!1===t.bindKeys||w.addKey(z);if(P=u("div",{className:"view",notAppend:!0}),P.tabIndex=0,e)return b(e)?P.append(...e):P.append(e),void c.open(P,B(t));y.show.load();const o=n+M.path,r=t.raw?"":await m(o);switch(r){default:return await I();case"markdown":return await CloudCmd.Markdown.show(M.path);case"html":return E(o);case"image":return L(M.path,n);case"media":return await F(o);case"pdf":return T(o)}},e.exports.hide=K;let k=!1;CloudCmd.View=e.exports;const M=DOM.CurrentInfo,{Key:_}=CloudCmd;let P,$;const A={beforeShow:()=>{y.hide(),_.unsetBind()},beforeClose:()=>{w.rmKey(z),_.setBind()},afterShow:()=>{P.focus()},onOverlayClick:N,afterClose:()=>{},autoSize:!1,helpers:{title:{}}};function D(e){const t=u("iframe",{src:e,width:"100%",height:"100%"});return t.addEventListener("load",()=>{t.contentWindow.addEventListener("keydown",z)}),t}function E(e){c.open(D(e),A)}function T(e){const t=D(e),n=v({},A);CloudCmd.config("showFileName")&&(n.title=M.name),c.open(t,n)}async function F(e){const[t,n]=await async function(e){!function(e){if("string"!=typeof e)throw Error("src should be a string!")}(e);const[t,n]=await s(h.get,"view/media-tmpl");if(t)return[t];const{name:r}=M;$||($=n);const i=l(r),a=o($,{src:e,type:i?"audio":"video",name:r});return[null,u("div",{innerHTML:a})]}(e);if(t)return alert(t);const r={...A,autoSize:!0,afterShow:()=>{n.querySelector("audio, video").focus()}};c.open(n,r)}async function I(){const[e,t]=await M.getData();if(e)return y.hide();const n=document.createTextNode(t),o=A;CloudCmd.config("showFileName")&&(o.title=M.name),P.append(n),c.open(P,o)}e.exports._Config=A,e.exports.init=async()=>{await async function(){const{prefix:e}=CloudCmd;f("View load"),k=!0,await j(e+"/dist/view.css"),k=!1}();["click","contextmenu"].forEach(S(void 0,N))},e.exports._createIframe=D,e.exports._viewHtml=E;function B(e){const t=v({},A);if(!e)return t;const n=Object.keys(e);for(const o of n){const n=Boolean(t[o]),r=e[o];if(!O(r)||!n){t[o]=e[o];continue}const i=t[o];t[o]=C(i,r)}return t}function K(){c.close()}function L(e,t){const n=M.files.map(DOM.getCurrentPath).filter(t=>p(t)||t===e),o=n.map(e=>{return{href:`${t}${e}`,title:g((n=e,n.split("/").pop()))};var n}),r={index:n.indexOf(M.path),autoSize:!0,arrows:!0,keys:!0,helpers:{title:{}}},i={...A,...r};c.open(o,i)}function N(e){!function(e){const t=DOM.getCurrentByPosition(e);if(!t)return;const{files:n,filesPassive:o}=M,r=n.includes(t),i=o.includes(t);if(!r&&!i)return;if(DOM.isCurrentFile(t))return;DOM.setCurrentFile(t)}({x:e.clientX,y:e.clientY})}function z(e){let{keyCode:t}=e;t===_.ESC&&K()}e.exports._initConfig=B},98:function(e,t,n){"use strict";const{extname:o}=n(99),r=n(0)((e,t)=>t.test(e)),i=e=>RegExp(`\\.${e}$`,"i");function s(e){return["jp(e|g|eg)","gif","png","bmp","webp","svg","ico"].map(i).some(r(e))}function a(e){return/\.(mp3|ogg|m4a)$/i.test(e)}async function c(e){const{headers:t}=await fetch(e,{method:"HEAD"});for(const[e,n]of t)if("content-type"===e)return"."+n.split("/").pop();return""}e.exports.getType=async e=>{return o(e)||(e=await c(e)),/\.pdf$/i.test(e)?"pdf":s(e)?"image":a(t=e)||function(e){return/\.(mp4|avi|webm)$/i.test(e)}(t)?"media":(e=>/\.html$/.test(e))(e)?"html":(e=>/.\.md$/.test(e))(e)?"markdown":void 0;var t},e.exports.isImage=s,e.exports.isAudio=a,e.exports._detectType=c}});
2
2
  //# sourceMappingURL=view.js.map
package/dist/sw.js CHANGED
@@ -5,5 +5,5 @@ var serviceWorkerOption = {
5
5
  ]
6
6
  };
7
7
 
8
- !function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=0)}([function(t,e,n){"use strict";const r=n(1),o=n(2),i=o((t,e)=>e.waitUntil(t())),c=o((t,e)=>{const{request:n}=e,{url:r}=n,o=u(r);r.endsWith("/")||/\^\/fs/.test(o)||"GET"===n.method&&(t=>"basic"===t.type)(n)&&(o.startsWith("/api")||/^socket.io/.test(o)||e.respondWith(t(e)))}),u=t=>new URL(t).pathname,a="cloudcmd: Thu May 12 2022 14:45:07 GMT+0300 (Eastern European Summer Time)",s=(t,e)=>"/"!==t?e:(t=>new Request(t,{credentials:"same-origin"}))("/");self.addEventListener("install",i((async function(){console.info("cloudcmd: sw: install: "+a),await self.skipWaiting()}))),self.addEventListener("fetch",c((async function(t){const{request:e}=t,{url:n}=e,o=u(n),i=s(o,t.request),c=await caches.open(a),f=await c.match(e);if(f)return f;const[l,d]=await r(fetch,i,{credentials:"same-origin"});return l?new Response(l.message):(await async function(t,e){return(await caches.open(a)).put(t,e)}(e,d.clone()),d)}))),self.addEventListener("activate",i((async function(){console.info("cloudcmd: sw: activate: "+a),await self.clients.claim();const t=await caches.keys(),e=caches.delete.bind(caches);await Promise.all(t.map(e))})))},function(t,e,n){"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,n){"use strict";const r=(t,...e)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),e.length>=t.length)return t(...e);const n=(...n)=>r(t,...e,...n),o=t.length-e.length-1;return(t=>[function(e){return t(...arguments)},function(e,n){return t(...arguments)},function(e,n,r){return t(...arguments)},function(e,n,r,o){return t(...arguments)},function(e,n,r,o,i){return t(...arguments)}])(n)[o]||n};t.exports=r}]);
8
+ !function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=0)}([function(t,e,n){"use strict";const r=n(1),o=n(2),i=o((t,e)=>e.waitUntil(t())),c=o((t,e)=>{const{request:n}=e,{url:r}=n,o=u(r);r.endsWith("/")||/\^\/fs/.test(o)||"GET"===n.method&&(t=>"basic"===t.type)(n)&&(o.startsWith("/api")||/^socket.io/.test(o)||e.respondWith(t(e)))}),u=t=>new URL(t).pathname,s="cloudcmd: Fri Jun 17 2022 16:49:40 GMT+0300 (Eastern European Summer Time)",a=(t,e)=>"/"!==t?e:(t=>new Request(t,{credentials:"same-origin"}))("/");self.addEventListener("install",i((async function(){console.info("cloudcmd: sw: install: "+s),await self.skipWaiting()}))),self.addEventListener("fetch",c((async function(t){const{request:e}=t,{url:n}=e,o=u(n),i=a(o,t.request),c=await caches.open(s),f=await c.match(e);if(f)return f;const[l,d]=await r(fetch,i,{credentials:"same-origin"});return l?new Response(l.message):(await async function(t,e){return(await caches.open(s)).put(t,e)}(e,d.clone()),d)}))),self.addEventListener("activate",i((async function(){console.info("cloudcmd: sw: activate: "+s),await self.clients.claim();const t=await caches.keys(),e=caches.delete.bind(caches);await Promise.all(t.map(e))})))},function(t,e,n){"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,n){"use strict";const r=(t,...e)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),e.length>=t.length)return t(...e);const n=(...n)=>r(t,...e,...n),o=t.length-e.length-1;return(t=>[function(e){return t(...arguments)},function(e,n){return t(...arguments)},function(e,n,r){return t(...arguments)},function(e,n,r,o){return t(...arguments)},function(e,n,r,o,i){return t(...arguments)}])(n)[o]||n};t.exports=r}]);
9
9
  //# sourceMappingURL=sw.js.map
@@ -116,7 +116,7 @@ eval("/* global DOM */\n\n\nconst createElement = __webpack_require__(/*! @cloud
116
116
  /***/ (function(module, exports, __webpack_require__) {
117
117
 
118
118
  "use strict";
119
- eval("\n/* global CloudCmd */\n\nconst Util = __webpack_require__(/*! ../../common/util */ \"./common/util.js\");\n\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\n\nconst load = __webpack_require__(/*! ./load */ \"./client/dom/load.js\");\n\nconst Files = __webpack_require__(/*! ./files */ \"./client/dom/files.js\");\n\nconst RESTful = __webpack_require__(/*! ./rest */ \"./client/dom/rest.js\");\n\nconst IO = __webpack_require__(/*! ./io */ \"./client/dom/io/index.js\");\n\nconst Storage = __webpack_require__(/*! ./storage */ \"./client/dom/storage.js\");\n\nconst Dialog = __webpack_require__(/*! ./dialog */ \"./client/dom/dialog.js\");\n\nconst renameCurrent = __webpack_require__(/*! ./operations/rename-current */ \"./client/dom/operations/rename-current.js\");\n\nconst CurrentFile = __webpack_require__(/*! ./current-file */ \"./client/dom/current-file.js\");\n\nconst DOMTree = __webpack_require__(/*! ./dom-tree */ \"./client/dom/dom-tree.js\");\n\nconst Cmd = module.exports;\nconst DOM = { ...DOMTree,\n ...CurrentFile,\n ...Cmd\n};\nconst CurrentInfo = {};\nDOM.Images = Images;\nDOM.load = load;\nDOM.Files = Files;\nDOM.RESTful = RESTful;\nDOM.IO = IO;\nDOM.Storage = Storage;\nDOM.Dialog = Dialog;\nDOM.CurrentInfo = CurrentInfo;\nmodule.exports = DOM;\nDOM.uploadDirectory = __webpack_require__(/*! ./directory */ \"./client/dom/directory.js\");\nDOM.Buffer = __webpack_require__(/*! ./buffer */ \"./client/dom/buffer.js\");\nDOM.Events = __webpack_require__(/*! ./events */ \"./client/dom/events/index.js\");\n\nconst loadRemote = __webpack_require__(/*! ./load-remote */ \"./client/dom/load-remote.js\");\n\nconst selectByPattern = __webpack_require__(/*! ./select-by-pattern */ \"./client/dom/select-by-pattern.js\");\n\nconst SELECTED_FILE = 'selected-file';\nconst TabPanel = {\n 'js-left': null,\n 'js-right': null\n};\n\nmodule.exports.loadRemote = (name, options, callback) => {\n loadRemote(name, options, callback);\n return DOM;\n};\n\nmodule.exports.loadSocket = callback => {\n DOM.loadRemote('socket', {\n name: 'io'\n }, callback);\n return DOM;\n};\n/**\n * create new folder\n *\n */\n\n\nmodule.exports.promptNewDir = async function () {\n await promptNew('directory');\n};\n/**\n * create new file\n *\n * @typeName\n * @type\n */\n\n\nmodule.exports.promptNewFile = async () => {\n await promptNew('file');\n};\n\nasync function promptNew(typeName) {\n const {\n Dialog\n } = DOM;\n const dir = DOM.getCurrentDirPath();\n const msg = 'New ' + typeName || false;\n\n const getName = () => {\n const name = DOM.getCurrentName();\n if (name === '..') return '';\n return name;\n };\n\n const name = getName();\n const [cancel, currentName] = await Dialog.prompt(msg, name);\n if (cancel) return;\n const path = `${dir}${currentName}`;\n if (typeName === 'directory') await RESTful.createDirectory(path);else await RESTful.write(path);\n await CloudCmd.refresh({\n currentName\n });\n}\n/**\n * get current direcotory name\n */\n\n\nmodule.exports.getCurrentDirName = () => {\n const href = DOM.getCurrentDirPath().replace(/\\/$/, '');\n const substr = href.substr(href, href.lastIndexOf('/'));\n const ret = href.replace(substr + '/', '') || '/';\n return ret;\n};\n/**\n * get current direcotory path\n */\n\n\nmodule.exports.getParentDirPath = panel => {\n const path = DOM.getCurrentDirPath(panel);\n const dirName = DOM.getCurrentDirName() + '/';\n const index = path.lastIndexOf(dirName);\n if (path !== '/') return path.slice(0, index);\n return path;\n};\n/**\n * get not current direcotory path\n */\n\n\nmodule.exports.getNotCurrentDirPath = () => {\n const panel = DOM.getPanel({\n active: false\n });\n const path = DOM.getCurrentDirPath(panel);\n return path;\n};\n/**\n * unified way to get selected files\n *\n * @currentFile\n */\n\n\nmodule.exports.getSelectedFiles = () => {\n const panel = DOM.getPanel();\n const selected = DOM.getByClassAll(SELECTED_FILE, panel);\n return Array.from(selected);\n};\n/*\n * unselect all files\n */\n\n\nmodule.exports.unselectFiles = files => {\n files = files || DOM.getSelectedFiles();\n Array.from(files).forEach(DOM.toggleSelectedFile);\n};\n/**\n * get all selected files or current when none selected\n *\n * @currentFile\n */\n\n\nmodule.exports.getActiveFiles = () => {\n const current = DOM.getCurrentFile();\n const files = DOM.getSelectedFiles();\n const name = DOM.getCurrentName(current);\n if (!files.length && name !== '..') return [current];\n return files;\n};\n\nmodule.exports.getCurrentDate = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const date = DOM.getByDataName('js-date', current).textContent;\n return date;\n};\n/**\n * get size\n * @currentFile\n */\n\n\nmodule.exports.getCurrentSize = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n /* если это папка - возвращаем слово dir вместо размера*/\n\n const size = DOM.getByDataName('js-size', current).textContent.replace(/^<|>$/g, '');\n return size;\n};\n/**\n * get size\n * @currentFile\n */\n\n\nmodule.exports.loadCurrentSize = async currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?size';\n const link = DOM.getCurrentPath(current);\n Images.show.load();\n if (name === '..') return;\n const [, size] = await RESTful.read(link + query);\n DOM.setCurrentSize(size, current);\n Images.hide();\n return current;\n};\n/**\n * load hash\n * @callback\n * @currentFile\n */\n\n\nmodule.exports.loadCurrentHash = async currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?hash';\n const link = DOM.getCurrentPath(current);\n const [, data] = await RESTful.read(link + query);\n return data;\n};\n/**\n * set size\n * @currentFile\n */\n\n\nmodule.exports.setCurrentSize = (size, currentFile) => {\n const current = currentFile || DOM.getCurrentFile();\n const sizeElement = DOM.getByDataName('js-size', current);\n sizeElement.textContent = size;\n};\n/**\n * @currentFile\n */\n\n\nmodule.exports.getCurrentMode = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const mode = DOM.getByDataName('js-mode', current);\n return mode.textContent;\n};\n/**\n * @currentFile\n */\n\n\nmodule.exports.getCurrentOwner = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const owner = DOM.getByDataName('js-owner', current);\n return owner.textContent;\n};\n/**\n * unified way to get current file content\n *\n * @param currentFile\n */\n\n\nmodule.exports.getCurrentData = async currentFile => {\n const {\n Dialog\n } = DOM;\n const Info = DOM.CurrentInfo;\n const current = currentFile || DOM.getCurrentFile();\n const path = DOM.getCurrentPath(current);\n const isDir = DOM.isCurrentIsDir(current);\n\n if (Info.name === '..') {\n Dialog.alert.noFiles();\n return [Error('No Files')];\n }\n\n if (isDir) return await RESTful.read(path);\n const [hashNew, hash] = await DOM.checkStorageHash(path);\n if (!hashNew) return [Error(`Can't get hash of a file`)];\n if (hash === hashNew) return [null, await Storage.get(`${path}-data`)];\n const [e, data] = await RESTful.read(path);\n if (e) return [e, null];\n const ONE_MEGABYTE = 1024 * 1024 * 1024;\n const {\n length\n } = data;\n if (hash && length < ONE_MEGABYTE) await DOM.saveDataToStorage(path, data, hashNew);\n return [null, data];\n};\n/**\n * unified way to get RefreshButton\n */\n\n\nmodule.exports.getRefreshButton = function () {\n let panel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DOM.getPanel();\n return DOM.getByDataName('js-refresh', panel);\n};\n/**\n * select current file\n * @param currentFile\n */\n\n\nmodule.exports.selectFile = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n current.classList.add(SELECTED_FILE);\n return Cmd;\n};\n\nmodule.exports.unselectFile = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n current.classList.remove(SELECTED_FILE);\n return Cmd;\n};\n\nmodule.exports.toggleSelectedFile = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const name = DOM.getCurrentName(current);\n if (name === '..') return Cmd;\n current.classList.toggle(SELECTED_FILE);\n return Cmd;\n};\n\nmodule.exports.toggleAllSelectedFiles = () => {\n DOM.getAllFiles().map(DOM.toggleSelectedFile);\n return Cmd;\n};\n\nmodule.exports.selectAllFiles = () => {\n DOM.getAllFiles().map(DOM.selectFile);\n return Cmd;\n};\n\nmodule.exports.getAllFiles = () => {\n const panel = DOM.getPanel();\n const files = DOM.getFiles(panel);\n const name = DOM.getCurrentName(files[0]);\n\n const from = a => a === '..' ? 1 : 0;\n\n const i = from(name);\n return Array.from(files).slice(i);\n};\n/**\n * open dialog with expand selection\n */\n\n\nmodule.exports.expandSelection = () => {\n const msg = 'expand';\n const {\n files\n } = CurrentInfo;\n selectByPattern(msg, files);\n};\n/**\n * open dialog with shrink selection\n */\n\n\nmodule.exports.shrinkSelection = () => {\n const msg = 'shrink';\n const {\n files\n } = CurrentInfo;\n selectByPattern(msg, files);\n};\n/**\n * setting history wrapper\n */\n\n\nmodule.exports.setHistory = (data, title, url) => {\n const ret = window.history;\n const {\n prefix\n } = CloudCmd;\n url = prefix + url;\n if (ret) history.pushState(data, title, url);\n return ret;\n};\n/**\n * selected file check\n *\n * @param currentFile\n */\n\n\nmodule.exports.isSelected = selected => {\n if (!selected) return false;\n return DOM.isContainClass(selected, SELECTED_FILE);\n};\n/**\n * get link from current (or param) file\n *\n * @param currentFile - current file by default\n */\n\n\nmodule.exports.getCurrentLink = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const link = DOM.getByTag('a', current);\n return link[0];\n};\n\nmodule.exports.getFilenames = files => {\n if (!files) throw Error('AllFiles could not be empty');\n const first = files[0] || DOM.getCurrentFile();\n const name = DOM.getCurrentName(first);\n const allFiles = Array.from(files);\n if (name === '..') allFiles.shift();\n const names = allFiles.map(current => {\n return DOM.getCurrentName(current);\n });\n return names;\n};\n/**\n * check storage hash\n */\n\n\nmodule.exports.checkStorageHash = async name => {\n const nameHash = name + '-hash';\n if (typeof name !== 'string') throw Error('name should be a string!');\n const [loadHash, storeHash] = await Promise.all([DOM.loadCurrentHash(), Storage.get(nameHash)]);\n return [loadHash, storeHash];\n};\n/**\n * save data to storage\n *\n * @param name\n * @param data\n * @param hash\n * @param callback\n */\n\n\nmodule.exports.saveDataToStorage = async (name, data, hash) => {\n const isDir = DOM.isCurrentIsDir();\n if (isDir) return;\n hash = hash || (await DOM.loadCurrentHash());\n const nameHash = name + '-hash';\n const nameData = name + '-data';\n await Storage.set(nameHash, hash);\n await Storage.set(nameData, data);\n return hash;\n};\n\nmodule.exports.getFM = () => DOM.getPanel().parentElement;\n\nmodule.exports.getPanelPosition = panel => {\n panel = panel || DOM.getPanel();\n return panel.dataset.name.replace('js-', '');\n};\n/** function getting panel active, or passive\n * @param options = {active: true}\n */\n\n\nmodule.exports.getPanel = options => {\n let files;\n let panel;\n let isLeft;\n let dataName = 'js-';\n const current = DOM.getCurrentFile();\n\n if (!current) {\n panel = DOM.getByDataName('js-left');\n } else {\n files = current.parentElement;\n panel = files.parentElement;\n isLeft = panel.getAttribute('data-name') === 'js-left';\n }\n /* if {active : false} getting passive panel */\n\n\n if (options && !options.active) {\n dataName += isLeft ? 'right' : 'left';\n panel = DOM.getByDataName(dataName);\n }\n /* if two panels showed\n * then always work with passive\n * panel\n */\n\n\n if (window.innerWidth < CloudCmd.MIN_ONE_PANEL_WIDTH) panel = DOM.getByDataName('js-left');\n if (!panel) throw Error('can not find Active Panel!');\n return panel;\n};\n\nmodule.exports.getFiles = element => {\n const files = DOM.getByDataName('js-files', element);\n return files.children || [];\n};\n/**\n * shows panel right or left (or active)\n */\n\n\nmodule.exports.showPanel = active => {\n const panel = DOM.getPanel({\n active\n });\n if (!panel) return false;\n DOM.show(panel);\n return true;\n};\n/**\n * hides panel right or left (or active)\n */\n\n\nmodule.exports.hidePanel = active => {\n const panel = DOM.getPanel({\n active\n });\n if (!panel) return false;\n return DOM.hide(panel);\n};\n/**\n * remove child of element\n * @param pChild\n * @param element\n */\n\n\nmodule.exports.remove = (child, element) => {\n const parent = element || document.body;\n parent.removeChild(child);\n return DOM;\n};\n/**\n * remove current file from file table\n * @param current\n *\n */\n\n\nmodule.exports.deleteCurrent = current => {\n if (!current) DOM.getCurrentFile();\n const parent = current === null || current === void 0 ? void 0 : current.parentElement;\n const name = DOM.getCurrentName(current);\n\n if (current && name !== '..') {\n const next = current.nextSibling;\n const prev = current.previousSibling;\n DOM.setCurrentFile(next || prev);\n parent.removeChild(current);\n }\n};\n/**\n * remove selected files from file table\n * @Selected\n */\n\n\nmodule.exports.deleteSelected = selected => {\n selected = selected || DOM.getSelectedFiles();\n if (!selected) return;\n selected.map(DOM.deleteCurrent);\n};\n/**\n * rename current file\n *\n * @currentFile\n */\n\n\nmodule.exports.renameCurrent = renameCurrent;\n/**\n * unified way to scrollIntoViewIfNeeded\n * (native suporte by webkit only)\n * @param element\n * @param center - to scroll as small as possible param should be false\n */\n\nmodule.exports.scrollIntoViewIfNeeded = function (element) {\n let center = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (!element || !element.scrollIntoViewIfNeeded) return;\n element.scrollIntoViewIfNeeded(center);\n};\n/* scroll on one page */\n\n\nmodule.exports.scrollByPages = (element, pPages) => {\n const ret = (element === null || element === void 0 ? void 0 : element.scrollByPages) && pPages;\n if (ret) element.scrollByPages(pPages);\n return ret;\n};\n\nmodule.exports.changePanel = () => {\n const Info = CurrentInfo;\n let panel = DOM.getPanel();\n CloudCmd.emit('passive-dir', Info.dirPath);\n const panelPassive = DOM.getPanel({\n active: false\n });\n let name = DOM.getCurrentName();\n const filesPassive = DOM.getFiles(panelPassive);\n let dataName = panel.getAttribute('data-name');\n TabPanel[dataName] = name;\n panel = panelPassive;\n dataName = panel.getAttribute('data-name');\n name = TabPanel[dataName];\n let files;\n let current;\n\n if (name) {\n current = DOM.getCurrentByName(name, panel);\n if (current) files = current.parentElement;\n }\n\n if (!files || !files.parentElement) {\n current = DOM.getCurrentByName(name, panel);\n if (!current) [current] = filesPassive;\n }\n\n DOM.setCurrentFile(current, {\n history: true\n });\n CloudCmd.emit('active-dir', Info.dirPath);\n return DOM;\n};\n\nmodule.exports.getPackerExt = type => {\n if (type === 'zip') return '.zip';\n return '.tar.gz';\n};\n\nmodule.exports.goToDirectory = async () => {\n const msg = 'Go to directory:';\n const {\n Dialog\n } = DOM;\n const {\n dirPath\n } = CurrentInfo;\n const [cancel, path = dirPath] = await Dialog.prompt(msg, dirPath);\n if (cancel) return;\n await CloudCmd.loadDir({\n path\n });\n};\n\nmodule.exports.duplicatePanel = async () => {\n const Info = CurrentInfo;\n const {\n isDir\n } = Info;\n const panel = Info.panelPassive;\n const noCurrent = !Info.isOnePanel;\n\n const getPath = isDir => {\n if (isDir) return Info.path;\n return Info.dirPath;\n };\n\n const path = getPath(isDir);\n await CloudCmd.loadDir({\n path,\n panel,\n noCurrent\n });\n};\n\nmodule.exports.swapPanels = async () => {\n const Info = CurrentInfo;\n const {\n panel,\n files,\n element,\n panelPassive\n } = Info;\n const path = DOM.getCurrentDirPath();\n const dirPathPassive = DOM.getNotCurrentDirPath();\n let currentIndex = files.indexOf(element);\n await CloudCmd.loadDir({\n path,\n panel: panelPassive,\n noCurrent: true\n });\n await CloudCmd.loadDir({\n path: dirPathPassive,\n panel\n });\n const length = Info.files.length - 1;\n if (currentIndex > length) currentIndex = length;\n const el = Info.files[currentIndex];\n DOM.setCurrentFile(el);\n};\n\nmodule.exports.CurrentInfo = CurrentInfo;\n\nmodule.exports.updateCurrentInfo = currentFile => {\n const info = DOM.CurrentInfo;\n const current = currentFile || DOM.getCurrentFile();\n const files = current.parentElement;\n const panel = files.parentElement || DOM.getPanel();\n const panelPassive = DOM.getPanel({\n active: false\n });\n const filesPassive = DOM.getFiles(panelPassive);\n const name = DOM.getCurrentName(current);\n info.dir = DOM.getCurrentDirName();\n info.dirPath = DOM.getCurrentDirPath();\n info.parentDirPath = DOM.getParentDirPath();\n info.element = current;\n info.ext = Util.getExt(name);\n info.files = Array.from(files.children);\n info.filesPassive = Array.from(filesPassive);\n info.first = files.firstChild;\n info.getData = DOM.getCurrentData;\n info.last = files.lastChild;\n info.link = DOM.getCurrentLink(current);\n info.mode = DOM.getCurrentMode(current);\n info.name = name;\n info.path = DOM.getCurrentPath(current);\n info.panel = panel;\n info.panelPassive = panelPassive;\n info.size = DOM.getCurrentSize(current);\n info.isDir = DOM.isCurrentIsDir();\n info.isSelected = DOM.isSelected(current);\n info.panelPosition = DOM.getPanel().dataset.name.replace('js-', '');\n info.isOnePanel = info.panel.getAttribute('data-name') === info.panelPassive.getAttribute('data-name');\n};\n\n//# sourceURL=file://cloudcmd/client/dom/index.js");
119
+ eval("\n/* global CloudCmd */\n\nconst Util = __webpack_require__(/*! ../../common/util */ \"./common/util.js\");\n\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\n\nconst RESTful = __webpack_require__(/*! ./rest */ \"./client/dom/rest.js\");\n\nconst Storage = __webpack_require__(/*! ./storage */ \"./client/dom/storage.js\");\n\nconst renameCurrent = __webpack_require__(/*! ./operations/rename-current */ \"./client/dom/operations/rename-current.js\");\n\nconst CurrentFile = __webpack_require__(/*! ./current-file */ \"./client/dom/current-file.js\");\n\nconst DOMTree = __webpack_require__(/*! ./dom-tree */ \"./client/dom/dom-tree.js\");\n\nconst Cmd = module.exports;\nconst DOM = { ...DOMTree,\n ...CurrentFile,\n ...Cmd\n};\nconst CurrentInfo = {};\nDOM.Images = Images;\nDOM.load = __webpack_require__(/*! ./load */ \"./client/dom/load.js\");\nDOM.Files = __webpack_require__(/*! ./files */ \"./client/dom/files.js\");\nDOM.RESTful = RESTful;\nDOM.IO = __webpack_require__(/*! ./io */ \"./client/dom/io/index.js\");\nDOM.Storage = Storage;\nDOM.Dialog = __webpack_require__(/*! ./dialog */ \"./client/dom/dialog.js\");\nDOM.CurrentInfo = CurrentInfo;\nmodule.exports = DOM;\nDOM.uploadDirectory = __webpack_require__(/*! ./directory */ \"./client/dom/directory.js\");\nDOM.Buffer = __webpack_require__(/*! ./buffer */ \"./client/dom/buffer.js\");\nDOM.Events = __webpack_require__(/*! ./events */ \"./client/dom/events/index.js\");\n\nconst loadRemote = __webpack_require__(/*! ./load-remote */ \"./client/dom/load-remote.js\");\n\nconst selectByPattern = __webpack_require__(/*! ./select-by-pattern */ \"./client/dom/select-by-pattern.js\");\n\nconst SELECTED_FILE = 'selected-file';\nconst TabPanel = {\n 'js-left': null,\n 'js-right': null\n};\n\nmodule.exports.loadRemote = (name, options, callback) => {\n loadRemote(name, options, callback);\n return DOM;\n};\n\nmodule.exports.loadSocket = callback => {\n DOM.loadRemote('socket', {\n name: 'io'\n }, callback);\n return DOM;\n};\n/**\n * create new folder\n *\n */\n\n\nmodule.exports.promptNewDir = async function () {\n await promptNew('directory');\n};\n/**\n * create new file\n *\n * @typeName\n * @type\n */\n\n\nmodule.exports.promptNewFile = async () => {\n await promptNew('file');\n};\n\nasync function promptNew(typeName) {\n const {\n Dialog\n } = DOM;\n const dir = DOM.getCurrentDirPath();\n const msg = 'New ' + typeName || false;\n\n const getName = () => {\n const name = DOM.getCurrentName();\n if (name === '..') return '';\n return name;\n };\n\n const name = getName();\n const [cancel, currentName] = await Dialog.prompt(msg, name);\n if (cancel) return;\n const path = `${dir}${currentName}`;\n if (typeName === 'directory') await RESTful.createDirectory(path);else await RESTful.write(path);\n await CloudCmd.refresh({\n currentName\n });\n}\n/**\n * get current direcotory name\n */\n\n\nmodule.exports.getCurrentDirName = () => {\n const href = DOM.getCurrentDirPath().replace(/\\/$/, '');\n const substr = href.substr(href, href.lastIndexOf('/'));\n const ret = href.replace(substr + '/', '') || '/';\n return ret;\n};\n/**\n * get current direcotory path\n */\n\n\nmodule.exports.getParentDirPath = panel => {\n const path = DOM.getCurrentDirPath(panel);\n const dirName = DOM.getCurrentDirName() + '/';\n const index = path.lastIndexOf(dirName);\n if (path !== '/') return path.slice(0, index);\n return path;\n};\n/**\n * get not current direcotory path\n */\n\n\nmodule.exports.getNotCurrentDirPath = () => {\n const panel = DOM.getPanel({\n active: false\n });\n const path = DOM.getCurrentDirPath(panel);\n return path;\n};\n/**\n * unified way to get selected files\n *\n * @currentFile\n */\n\n\nmodule.exports.getSelectedFiles = () => {\n const panel = DOM.getPanel();\n const selected = DOM.getByClassAll(SELECTED_FILE, panel);\n return Array.from(selected);\n};\n/*\n * unselect all files\n */\n\n\nmodule.exports.unselectFiles = files => {\n files = files || DOM.getSelectedFiles();\n Array.from(files).forEach(DOM.toggleSelectedFile);\n};\n/**\n * get all selected files or current when none selected\n *\n * @currentFile\n */\n\n\nmodule.exports.getActiveFiles = () => {\n const current = DOM.getCurrentFile();\n const files = DOM.getSelectedFiles();\n const name = DOM.getCurrentName(current);\n if (!files.length && name !== '..') return [current];\n return files;\n};\n\nmodule.exports.getCurrentDate = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const date = DOM.getByDataName('js-date', current).textContent;\n return date;\n};\n/**\n * get size\n * @currentFile\n */\n\n\nmodule.exports.getCurrentSize = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n /* если это папка - возвращаем слово dir вместо размера*/\n\n const size = DOM.getByDataName('js-size', current).textContent.replace(/^<|>$/g, '');\n return size;\n};\n/**\n * get size\n * @currentFile\n */\n\n\nmodule.exports.loadCurrentSize = async currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?size';\n const link = DOM.getCurrentPath(current);\n Images.show.load();\n if (name === '..') return;\n const [, size] = await RESTful.read(link + query);\n DOM.setCurrentSize(size, current);\n Images.hide();\n return current;\n};\n/**\n * load hash\n * @callback\n * @currentFile\n */\n\n\nmodule.exports.loadCurrentHash = async currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?hash';\n const link = DOM.getCurrentPath(current);\n const [, data] = await RESTful.read(link + query);\n return data;\n};\n/**\n * set size\n * @currentFile\n */\n\n\nmodule.exports.setCurrentSize = (size, currentFile) => {\n const current = currentFile || DOM.getCurrentFile();\n const sizeElement = DOM.getByDataName('js-size', current);\n sizeElement.textContent = size;\n};\n/**\n * @currentFile\n */\n\n\nmodule.exports.getCurrentMode = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const mode = DOM.getByDataName('js-mode', current);\n return mode.textContent;\n};\n/**\n * @currentFile\n */\n\n\nmodule.exports.getCurrentOwner = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const owner = DOM.getByDataName('js-owner', current);\n return owner.textContent;\n};\n/**\n * unified way to get current file content\n *\n * @param currentFile\n */\n\n\nmodule.exports.getCurrentData = async currentFile => {\n const {\n Dialog\n } = DOM;\n const Info = DOM.CurrentInfo;\n const current = currentFile || DOM.getCurrentFile();\n const path = DOM.getCurrentPath(current);\n const isDir = DOM.isCurrentIsDir(current);\n\n if (Info.name === '..') {\n Dialog.alert.noFiles();\n return [Error('No Files')];\n }\n\n if (isDir) return await RESTful.read(path);\n const [hashNew, hash] = await DOM.checkStorageHash(path);\n if (!hashNew) return [Error(`Can't get hash of a file`)];\n if (hash === hashNew) return [null, await Storage.get(`${path}-data`)];\n const [e, data] = await RESTful.read(path);\n if (e) return [e, null];\n const ONE_MEGABYTE = 1024 ** 2 * 1024;\n const {\n length\n } = data;\n if (hash && length < ONE_MEGABYTE) await DOM.saveDataToStorage(path, data, hashNew);\n return [null, data];\n};\n/**\n * unified way to get RefreshButton\n */\n\n\nmodule.exports.getRefreshButton = function () {\n let panel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DOM.getPanel();\n return DOM.getByDataName('js-refresh', panel);\n};\n/**\n * select current file\n * @param currentFile\n */\n\n\nmodule.exports.selectFile = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n current.classList.add(SELECTED_FILE);\n return Cmd;\n};\n\nmodule.exports.unselectFile = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n current.classList.remove(SELECTED_FILE);\n return Cmd;\n};\n\nmodule.exports.toggleSelectedFile = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const name = DOM.getCurrentName(current);\n if (name === '..') return Cmd;\n current.classList.toggle(SELECTED_FILE);\n return Cmd;\n};\n\nmodule.exports.toggleAllSelectedFiles = () => {\n DOM.getAllFiles().map(DOM.toggleSelectedFile);\n return Cmd;\n};\n\nmodule.exports.selectAllFiles = () => {\n DOM.getAllFiles().map(DOM.selectFile);\n return Cmd;\n};\n\nmodule.exports.getAllFiles = () => {\n const panel = DOM.getPanel();\n const files = DOM.getFiles(panel);\n const name = DOM.getCurrentName(files[0]);\n\n const from = a => a === '..' ? 1 : 0;\n\n const i = from(name);\n return Array.from(files).slice(i);\n};\n/**\n * open dialog with expand selection\n */\n\n\nmodule.exports.expandSelection = () => {\n const msg = 'expand';\n const {\n files\n } = CurrentInfo;\n selectByPattern(msg, files);\n};\n/**\n * open dialog with shrink selection\n */\n\n\nmodule.exports.shrinkSelection = () => {\n const msg = 'shrink';\n const {\n files\n } = CurrentInfo;\n selectByPattern(msg, files);\n};\n/**\n * setting history wrapper\n */\n\n\nmodule.exports.setHistory = (data, title, url) => {\n const ret = window.history;\n const {\n prefix\n } = CloudCmd;\n url = prefix + url;\n if (ret) history.pushState(data, title, url);\n return ret;\n};\n/**\n * selected file check\n *\n * @param currentFile\n */\n\n\nmodule.exports.isSelected = selected => {\n if (!selected) return false;\n return DOM.isContainClass(selected, SELECTED_FILE);\n};\n/**\n * get link from current (or param) file\n *\n * @param currentFile - current file by default\n */\n\n\nmodule.exports.getCurrentLink = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const link = DOM.getByTag('a', current);\n return link[0];\n};\n\nmodule.exports.getFilenames = files => {\n if (!files) throw Error('AllFiles could not be empty');\n const first = files[0] || DOM.getCurrentFile();\n const name = DOM.getCurrentName(first);\n const allFiles = Array.from(files);\n if (name === '..') allFiles.shift();\n const names = allFiles.map(current => {\n return DOM.getCurrentName(current);\n });\n return names;\n};\n/**\n * check storage hash\n */\n\n\nmodule.exports.checkStorageHash = async name => {\n const nameHash = name + '-hash';\n if (typeof name !== 'string') throw Error('name should be a string!');\n const [loadHash, storeHash] = await Promise.all([DOM.loadCurrentHash(), Storage.get(nameHash)]);\n return [loadHash, storeHash];\n};\n/**\n * save data to storage\n *\n * @param name\n * @param data\n * @param hash\n * @param callback\n */\n\n\nmodule.exports.saveDataToStorage = async (name, data, hash) => {\n const isDir = DOM.isCurrentIsDir();\n if (isDir) return;\n hash = hash || (await DOM.loadCurrentHash());\n const nameHash = name + '-hash';\n const nameData = name + '-data';\n await Storage.set(nameHash, hash);\n await Storage.set(nameData, data);\n return hash;\n};\n\nmodule.exports.getFM = () => DOM.getPanel().parentElement;\n\nmodule.exports.getPanelPosition = panel => {\n panel = panel || DOM.getPanel();\n return panel.dataset.name.replace('js-', '');\n};\n/** function getting panel active, or passive\n * @param options = {active: true}\n */\n\n\nmodule.exports.getPanel = options => {\n let files;\n let panel;\n let isLeft;\n let dataName = 'js-';\n const current = DOM.getCurrentFile();\n\n if (!current) {\n panel = DOM.getByDataName('js-left');\n } else {\n files = current.parentElement;\n panel = files.parentElement;\n isLeft = panel.getAttribute('data-name') === 'js-left';\n }\n /* if {active : false} getting passive panel */\n\n\n if (options && !options.active) {\n dataName += isLeft ? 'right' : 'left';\n panel = DOM.getByDataName(dataName);\n }\n /* if two panels showed\n * then always work with passive\n * panel\n */\n\n\n if (window.innerWidth < CloudCmd.MIN_ONE_PANEL_WIDTH) panel = DOM.getByDataName('js-left');\n if (!panel) throw Error('can not find Active Panel!');\n return panel;\n};\n\nmodule.exports.getFiles = element => {\n const files = DOM.getByDataName('js-files', element);\n return files.children || [];\n};\n/**\n * shows panel right or left (or active)\n */\n\n\nmodule.exports.showPanel = active => {\n const panel = DOM.getPanel({\n active\n });\n if (!panel) return false;\n DOM.show(panel);\n return true;\n};\n/**\n * hides panel right or left (or active)\n */\n\n\nmodule.exports.hidePanel = active => {\n const panel = DOM.getPanel({\n active\n });\n if (!panel) return false;\n return DOM.hide(panel);\n};\n/**\n * remove child of element\n * @param pChild\n * @param element\n */\n\n\nmodule.exports.remove = (child, element) => {\n const parent = element || document.body;\n parent.removeChild(child);\n return DOM;\n};\n/**\n * remove current file from file table\n * @param current\n *\n */\n\n\nmodule.exports.deleteCurrent = current => {\n if (!current) DOM.getCurrentFile();\n const parent = current === null || current === void 0 ? void 0 : current.parentElement;\n const name = DOM.getCurrentName(current);\n\n if (current && name !== '..') {\n const next = current.nextSibling;\n const prev = current.previousSibling;\n DOM.setCurrentFile(next || prev);\n parent.removeChild(current);\n }\n};\n/**\n * remove selected files from file table\n * @Selected\n */\n\n\nmodule.exports.deleteSelected = selected => {\n selected = selected || DOM.getSelectedFiles();\n if (!selected) return;\n selected.map(DOM.deleteCurrent);\n};\n/**\n * rename current file\n *\n * @currentFile\n */\n\n\nmodule.exports.renameCurrent = renameCurrent;\n/**\n * unified way to scrollIntoViewIfNeeded\n * (native suporte by webkit only)\n * @param element\n * @param center - to scroll as small as possible param should be false\n */\n\nmodule.exports.scrollIntoViewIfNeeded = function (element) {\n let center = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (!element || !element.scrollIntoViewIfNeeded) return;\n element.scrollIntoViewIfNeeded(center);\n};\n/* scroll on one page */\n\n\nmodule.exports.scrollByPages = (element, pPages) => {\n const ret = (element === null || element === void 0 ? void 0 : element.scrollByPages) && pPages;\n if (ret) element.scrollByPages(pPages);\n return ret;\n};\n\nmodule.exports.changePanel = () => {\n const Info = CurrentInfo;\n let panel = DOM.getPanel();\n CloudCmd.emit('passive-dir', Info.dirPath);\n const panelPassive = DOM.getPanel({\n active: false\n });\n let name = DOM.getCurrentName();\n const filesPassive = DOM.getFiles(panelPassive);\n let dataName = panel.getAttribute('data-name');\n TabPanel[dataName] = name;\n panel = panelPassive;\n dataName = panel.getAttribute('data-name');\n name = TabPanel[dataName];\n let files;\n let current;\n\n if (name) {\n current = DOM.getCurrentByName(name, panel);\n if (current) files = current.parentElement;\n }\n\n if (!files || !files.parentElement) {\n current = DOM.getCurrentByName(name, panel);\n if (!current) [current] = filesPassive;\n }\n\n DOM.setCurrentFile(current, {\n history: true\n });\n CloudCmd.emit('active-dir', Info.dirPath);\n return DOM;\n};\n\nmodule.exports.getPackerExt = type => {\n if (type === 'zip') return '.zip';\n return '.tar.gz';\n};\n\nmodule.exports.goToDirectory = async () => {\n const msg = 'Go to directory:';\n const {\n Dialog\n } = DOM;\n const {\n dirPath\n } = CurrentInfo;\n const [cancel, path = dirPath] = await Dialog.prompt(msg, dirPath);\n if (cancel) return;\n await CloudCmd.loadDir({\n path\n });\n};\n\nmodule.exports.duplicatePanel = async () => {\n const Info = CurrentInfo;\n const {\n isDir\n } = Info;\n const panel = Info.panelPassive;\n const noCurrent = !Info.isOnePanel;\n\n const getPath = isDir => {\n if (isDir) return Info.path;\n return Info.dirPath;\n };\n\n const path = getPath(isDir);\n await CloudCmd.loadDir({\n path,\n panel,\n noCurrent\n });\n};\n\nmodule.exports.swapPanels = async () => {\n const Info = CurrentInfo;\n const {\n panel,\n files,\n element,\n panelPassive\n } = Info;\n const path = DOM.getCurrentDirPath();\n const dirPathPassive = DOM.getNotCurrentDirPath();\n let currentIndex = files.indexOf(element);\n await CloudCmd.loadDir({\n path,\n panel: panelPassive,\n noCurrent: true\n });\n await CloudCmd.loadDir({\n path: dirPathPassive,\n panel\n });\n const length = Info.files.length - 1;\n if (currentIndex > length) currentIndex = length;\n const el = Info.files[currentIndex];\n DOM.setCurrentFile(el);\n};\n\nmodule.exports.CurrentInfo = CurrentInfo;\n\nmodule.exports.updateCurrentInfo = currentFile => {\n const info = DOM.CurrentInfo;\n const current = currentFile || DOM.getCurrentFile();\n const files = current.parentElement;\n const panelPassive = DOM.getPanel({\n active: false\n });\n const filesPassive = DOM.getFiles(panelPassive);\n const name = DOM.getCurrentName(current);\n info.dir = DOM.getCurrentDirName();\n info.dirPath = DOM.getCurrentDirPath();\n info.parentDirPath = DOM.getParentDirPath();\n info.element = current;\n info.ext = Util.getExt(name);\n info.files = Array.from(files.children);\n info.filesPassive = Array.from(filesPassive);\n info.first = files.firstChild;\n info.getData = DOM.getCurrentData;\n info.last = files.lastChild;\n info.link = DOM.getCurrentLink(current);\n info.mode = DOM.getCurrentMode(current);\n info.name = name;\n info.path = DOM.getCurrentPath(current);\n info.panel = files.parentElement || DOM.getPanel();\n info.panelPassive = panelPassive;\n info.size = DOM.getCurrentSize(current);\n info.isDir = DOM.isCurrentIsDir();\n info.isSelected = DOM.isSelected(current);\n info.panelPosition = DOM.getPanel().dataset.name.replace('js-', '');\n info.isOnePanel = info.panel.getAttribute('data-name') === info.panelPassive.getAttribute('data-name');\n};\n\n//# sourceURL=file://cloudcmd/client/dom/index.js");
120
120
 
121
121
  /***/ }),
122
122
 
@@ -224,7 +224,7 @@ eval("\n\nconst {\n parse,\n stringify\n} = JSON;\n\nmodule.exports.set = asyn
224
224
  /***/ (function(module, exports, __webpack_require__) {
225
225
 
226
226
  "use strict";
227
- eval("\n/* global CloudCmd */\n\nconst {\n eachSeries\n} = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\n\nconst load = __webpack_require__(/*! ./load */ \"./client/dom/load.js\");\n\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\n\nconst {\n alert\n} = __webpack_require__(/*! ./dialog */ \"./client/dom/dialog.js\");\n\nconst {\n FS\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\n\nconst onEnd = wraptile(_onEnd);\nconst loadFile = wraptile(_loadFile);\n\nconst {\n getCurrentDirPath: getPathWhenRootEmpty\n} = __webpack_require__(/*! . */ \"./client/dom/index.js\");\n\nmodule.exports = (dir, files) => {\n if (!files) {\n files = dir;\n dir = getPathWhenRootEmpty();\n }\n\n const n = files.length;\n if (!n) return;\n const array = Array.from(files);\n const {\n name\n } = files[0];\n eachSeries(array, loadFile(dir, n), onEnd(name));\n};\n\nfunction _onEnd(currentName) {\n CloudCmd.refresh({\n currentName\n });\n}\n\nfunction _loadFile(dir, n, file, callback) {\n let i = 0;\n const {\n name\n } = file;\n const path = dir + name;\n const {\n prefixURL\n } = CloudCmd;\n const api = prefixURL + FS;\n\n const percent = function (i, n) {\n let per = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;\n return Math.round(i * per / n);\n };\n\n const step = n => 100 / n;\n\n ++i;\n load.put(api + path, file).on('error', showError).on('end', callback).on('progress', count => {\n const max = step(n);\n const value = (i - 1) * max + percent(count, 100, max);\n Images.show.load('top');\n Images.setProgress(Math.round(value));\n });\n}\n\nfunction showError(_ref) {\n let {\n message\n } = _ref;\n alert(message);\n}\n\n//# sourceURL=file://cloudcmd/client/dom/upload-files.js");
227
+ eval("\n/* global CloudCmd */\n\nconst {\n eachSeries\n} = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\n\nconst load = __webpack_require__(/*! ./load */ \"./client/dom/load.js\");\n\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\n\nconst {\n alert\n} = __webpack_require__(/*! ./dialog */ \"./client/dom/dialog.js\");\n\nconst {\n FS\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\n\nconst {\n getCurrentDirPath: getPathWhenRootEmpty\n} = __webpack_require__(/*! . */ \"./client/dom/index.js\");\n\nconst loadFile = wraptile(_loadFile);\nconst onEnd = wraptile(_onEnd);\n\nmodule.exports = (dir, files) => {\n if (!files) {\n files = dir;\n dir = getPathWhenRootEmpty();\n }\n\n const n = files.length;\n if (!n) return;\n const array = Array.from(files);\n const {\n name\n } = files[0];\n eachSeries(array, loadFile(dir, n), onEnd(name));\n};\n\nfunction _onEnd(currentName) {\n CloudCmd.refresh({\n currentName\n });\n}\n\nfunction _loadFile(dir, n, file, callback) {\n let i = 0;\n const {\n name\n } = file;\n const path = dir + name;\n const {\n prefixURL\n } = CloudCmd;\n const api = prefixURL + FS;\n\n const percent = function (i, n) {\n let per = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;\n return Math.round(i * per / n);\n };\n\n const step = n => 100 / n;\n\n ++i;\n load.put(api + path, file).on('error', showError).on('end', callback).on('progress', count => {\n const max = step(n);\n const value = (i - 1) * max + percent(count, 100, max);\n Images.show.load('top');\n Images.setProgress(Math.round(value));\n });\n}\n\nfunction showError(_ref) {\n let {\n message\n } = _ref;\n alert(message);\n}\n\n//# sourceURL=file://cloudcmd/client/dom/upload-files.js");
228
228
 
229
229
  /***/ }),
230
230