filecat 1.0.17 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/build/dist/34.bundle.js +1 -1
- package/build/dist/445.bundle.js +2 -0
- package/build/dist/623.bundle.js +2 -0
- package/build/dist/665.bundle.js +1 -1
- package/build/dist/674.bundle.js +1 -1
- package/build/dist/734.bundle.js +1 -1
- package/build/dist/802.bundle.js +2 -0
- package/build/dist/859.bundle.js +1 -1
- package/build/dist/859.bundle.js.LICENSE.txt +1 -1
- package/build/dist/892.bundle.js +1 -1
- package/build/dist/943.bundle.js +1 -1
- package/build/dist/977.bundle.js +1 -1
- package/build/dist/bundle.js +1 -1
- package/build/main.js +10 -10
- package/package.json +1 -1
- package/build/dist/313.bundle.js +0 -2
- package/build/dist/489.bundle.js +0 -2
- package/build/dist/530.bundle.js +0 -2
- /package/build/dist/{313.bundle.js.LICENSE.txt → 445.bundle.js.LICENSE.txt} +0 -0
- /package/build/dist/{489.bundle.js.LICENSE.txt → 623.bundle.js.LICENSE.txt} +0 -0
- /package/build/dist/{530.bundle.js.LICENSE.txt → 802.bundle.js.LICENSE.txt} +0 -0
package/build/dist/674.bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 674.bundle.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[674],{2674:(t,e,r)=>{r.r(e),r.d(e,{default:()=>T});var n=r(6540),o=r(6417),a=r(7444),i=r(5997),c=r(7952),u=r(7022);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var a=e&&e.prototype instanceof w?e:w,i=Object.create(a.prototype),c=new G(n||[]);return o(i,"_invoke",{value:O(t,r,c)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var y="suspendedStart",v="suspendedYield",d="executing",m="completed",g={};function w(){}function b(){}function x(){}var E={};f(E,i,(function(){return this}));var L=Object.getPrototypeOf,k=L&&L(L(C([])));k&&k!==r&&n.call(k,i)&&(E=k);var _=x.prototype=w.prototype=Object.create(E);function S(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function r(o,a,i,c){var u=p(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==l(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function O(e,r,n){var o=y;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=p(e,r,n);if("normal"===l.type){if(o=n.done?m:v,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=p(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(l(e)+" is not iterable")}return b.prototype=x,o(_,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:b,configurable:!0}),b.displayName=f(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},S(N.prototype),f(N.prototype,c,(function(){return this})),e.AsyncIterator=N,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new N(h(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},S(_),f(_,u,"Generator"),f(_,i,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function f(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function h(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){f(a,n,o,i,c,"next",t)}function c(t){f(a,n,o,i,c,"throw",t)}i(void 0)}))}}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return y(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function v(t){var e=p((0,n.useState)(!1),2),r=e[0],o=e[1],a=p((0,n.useState)([]),2),i=a[0],c=a[1],l=function(t){c(t)},f=function(){var e=h(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("folder"!==t.type){e.next=7;break}if(r||!t.click||i){e.next=4;break}return e.next=4,t.click(t,l,t.pre_path);case 4:o(!r),e.next=10;break;case 7:if(!t.click){e.next=10;break}return e.next=10,t.click(t,l,t.pre_path);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),y=function(){var e=h(s().mark((function e(){var r,n=arguments;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.length>0&&void 0!==n[0]&&n[0],"folder"!==t.type||r){e.next=6;break}return e.next=4,t.click(t,l,t.pre_path);case 4:e.next=7;break;case 6:t.fatherNowToggleExpansion&&t.fatherNowToggleExpansion();case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,n.useEffect)((function(){c(t.children)}),[t.children]),n.createElement("div",{className:"studio-item"},n.createElement("div",{onClick:f,onContextMenu:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),t.handleContextMenu&&t.handleContextMenu(e,t.name,t.pre_path,t.type===u.Iw.folder,y)},className:"studio-item-title"},n.createElement("i",{className:"material-icons studio-item-title-tag"},"file"==t.type?"":r?"arrow_drop_down":"arrow_right"),n.createElement("i",{className:"material-icons","file-type":t.type},"folder"===t.type?"folder":"text_snippet"),n.createElement("span",{className:"studio-item-name"},t.name)),r&&i&&n.createElement("div",{style:{marginLeft:20}},i.map((function(e,r){return n.createElement(n.Fragment,{key:r},n.createElement(v,{type:e.type,click:t.click,name:e.name,key:r,children:e.children,pre_path:"".concat(t.pre_path).concat(e.name).concat(e.type===u.Iw.folder?"/":""),handleContextMenu:t.handleContextMenu,fatherNowToggleExpansion:y}))}))))}function d(t){return n.createElement("div",null,t.list.map((function(e,r){return n.createElement(v,{pre_path:"".concat(t.pre_path).concat(e.name).concat(e.type===u.Iw.folder?"/":""),key:r,name:e.name,type:e.type,handleContextMenu:t.handleContextMenu,fatherNowToggleExpansion:t.fatherNowToggleExpansion,children:e.children,click:t.click})})))}var m=r(9653),g=r(4289),w=r(3459),b=r(8247),x=r(470),E=r(1499),L=r(2042),k=r(2543),_=r.n(k),S=r(4251),N=r(5489),O=r(2389);function j(t){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(t)}function P(){P=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof m?e:m,i=Object.create(a.prototype),c=new G(n||[]);return o(i,"_invoke",{value:S(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",d={};function m(){}function g(){}function w(){}var b={};l(b,i,(function(){return this}));var x=Object.getPrototypeOf,E=x&&x(x(C([])));E&&E!==r&&n.call(E,i)&&(b=E);var L=w.prototype=m.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==j(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function S(e,r,n){var o=h;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=N(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function N(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,N(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,d;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(j(e)+" is not iterable")}return g.prototype=w,o(L,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},k(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new _(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},k(L),l(L,u,"Generator"),l(L,i,(function(){return this})),l(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function A(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function G(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){A(a,n,o,i,c,"next",t)}function c(t){A(a,n,o,i,c,"throw",t)}i(void 0)}))}}function C(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return F(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function T(t){var e=C((0,a.L4)(o.A.studio),2),r=e[0],l=e[1],s=C((0,n.useState)([]),2),f=s[0],h=s[1],p=C((0,n.useState)(""),2),y=p[0],v=p[1],k=C((0,n.useState)(""),2),j=k[0],A=k[1],F=C((0,n.useState)(!1),2),T=(F[0],F[1],C((0,n.useState)("text"),2)),M=T[0],I=T[1],D=C((0,n.useState)({path:"",name:""}),2),Y=D[0],$=D[1],K=C((0,n.useState)(""),2),z=K[0],U=K[1],B=C((0,a.L4)(o.A.confirm),2),R=(B[0],B[1]),W=C((0,n.useState)(!1),2),X=W[0],V=W[1],q=C((0,a.L4)(o.A.fileShellShow),2),H=q[0],J=q[1],Q=C((0,a.L4)(o.A.file_shell_hidden),2),Z=Q[0],tt=Q[1],et=(0,n.useRef)(null),rt=(0,n.useRef)(null),nt=C((0,n.useState)(!1),2),ot=nt[0],at=nt[1],it=C((0,n.useState)(16),2),ct=it[0],ut=it[1],lt=C((0,a.L4)(o.A.showPrompt),2),st=(lt[0],lt[1]),ft=(0,O.Bd)().t,ht=function(){var t=G(P().mark((function t(){var e,n;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=(0,g.GG)("file",r.folder_path),v(e),t.next=4,m.$M.post("studio/get/item",{path:e});case 4:(n=t.sent).code===w.m.Sucess&&h(n.data.list);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();(0,n.useEffect)((function(){A(""),$({}),V(!1),r.folder_path&&ht()}),[r]);var pt=function(){var t=G(P().mark((function t(e,r){var n,o,a;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=null!==(n=(0,E.kr)(e))&&void 0!==n?n:"text",I(o),t.next=4,m.$M.get("".concat(r));case 4:if((a=t.sent).code!==w.m.File_Max){t.next=8;break}return(0,L.zN)("超过20MB"),t.abrupt("return");case 8:A(a.data),b.xK.set_value_temp(a.data),$({path:r,name:e}),U(r);case 12:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),yt=function(){var t=G(P().mark((function t(e,r,n){var o;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("folder"!==e.type){t.next=7;break}return t.next=3,m.$M.post("studio/get/item",{path:"".concat(n)});case 3:(o=t.sent).code===w.m.Sucess&&r(o.data.list),t.next=12;break;case 7:if(!X){t.next=10;break}return R({open:!0,handle:function(){pt(e.name,n),R({open:!1,handle:null}),V(!1)},title:"确定不保存就切换吗?"}),t.abrupt("return");case 10:return t.next=12,pt(e.name,n);case 12:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}();function vt(){return dt.apply(this,arguments)}function dt(){return(dt=G(P().mark((function t(){var e;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(X){t.next=2;break}return t.abrupt("return");case 2:return e={context:b.xK.get_value_temp()},t.next=5,m.$M.post("save/".concat(z),e);case 5:0===t.sent.code&&V(!1);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var mt=function(t){t.ctrlKey&&"s"===t.key&&(t.preventDefault(),vt())};(0,n.useEffect)((function(){return document.addEventListener("keydown",mt),function(){document.removeEventListener("keydown",mt)}}),[X]);var gt=(0,n.useCallback)(_().throttle((function(t){var e=parseFloat(getComputedStyle(rt.current).fontSize),r=window.innerWidth/e-4,n=t.clientX/e,o=2.25+et.current.offsetWidth/e;n<=r&&n>=o&&ut(parseFloat(n.toFixed(2)))}),32),[]),wt=function(){at(!1),rt.current.removeEventListener("pointermove",gt)};if(r.folder_path){var bt=[{r:ft("创建文件"),v:"创建文件"},{r:ft("创建目录"),v:"创建目录"},{r:ft("重命名"),v:"重命名"},{r:ft("删除"),v:"删除"}],xt=[{r:ft("重命名"),v:"重命名"},{r:ft("删除"),v:"删除"}],Et=function(t,e,r,n,o){t.preventDefault();var a=new S.i;a.path=r,a.filename=e,a.x=t.clientX,a.y=t.clientY,a.items=n?bt:xt,o===ht&&(a.items=a.items.slice(0,2)),a.type=n?u.Iw.studio_folder:u.Iw.studio_file;var i=function(t){o(t)};a.textClick=function(t){switch(t){case"创建文件":st({show:!0,type:N.PromptEnum.FileNew,overlay:!0,data:{dir:r,call:i}});break;case"创建目录":st({show:!0,type:N.PromptEnum.DirNew,overlay:!0,data:{dir:r,call:i}});break;case"删除":if(X&&(Y.path===r||Y.path.includes(r))){st({show:!0,type:N.PromptEnum.FilesDelete,overlay:!0,data:{path:r,call:function(){i(n),V(!1),$({}),A(""),b.xK.set_value_temp("")}}});break}st({show:!0,type:N.PromptEnum.FilesDelete,overlay:!0,data:{path:r,call:n?function(){i(!0)}:i}});break;case"重命名":st({show:!0,type:N.PromptEnum.FileRename,overlay:!0,data:{path:r,dir:(0,g.Yp)(r),call:function(){i(!0)},filename:e}})}},st({show:!0,type:N.PromptEnum.FileMenu,overlay:!1,data:a})};return n.createElement("div",{className:"studio"},n.createElement(c.A,{ignore_tags:!0,left_children:[n.createElement(i.rA,{key:1,title:"取消",icon:"close",onClick:function(){l({}),J({show:!1,path:""}),tt(void 0)}}),n.createElement("title",{key:2},Y.name)]},n.createElement(i.rA,{icon:"terminal",title:"shell",onClick:function(){void 0===Z?H.show?J({show:!1,path:""}):(J({show:!0,path:(0,g.GG)("file",r.folder_path)}),tt(!1)):tt(!Z)}}),X&&n.createElement(i.rA,{title:"保存",icon:"save",onClick:vt})),n.createElement("div",{className:"studio-body",ref:rt},n.createElement("div",{className:"studio-nav",style:{width:"".concat(ct-1,"em")},onContextMenu:function(t){Et(t,Y.name,(0,g.GG)("file",r.folder_path),!0,ht)}},n.createElement(d,{pre_path:y,list:f,click:yt,handleContextMenu:Et,fatherNowToggleExpansion:ht})),n.createElement("div",{className:"studio__divider",ref:et,onPointerDown:function(){at(!0),rt.current.addEventListener("pointermove",gt)},onPointerUp:wt}),ot&&n.createElement("div",{className:"shell__overlay",onPointerUp:wt}),n.createElement("div",{className:"studio-editor",key:Y.path},Y.name&&n.createElement(x.Ay,{mode:M,width:"100%",height:"100%",theme:"github",onChange:function(t){b.xK.set_value_temp(t),X||V(!0)},fontSize:14,showPrintMargin:!1,showGutter:!0,highlightActiveLine:!1,defaultValue:j,setOptions:{useWorker:!1,enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:!0,tabSize:2}}))))}}}}]);
|
|
2
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[674],{2674:(t,e,r)=>{r.r(e),r.d(e,{default:()=>T});var n=r(6540),o=r(6417),a=r(7444),i=r(5997),c=r(7952),u=r(7022);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var a=e&&e.prototype instanceof w?e:w,i=Object.create(a.prototype),c=new G(n||[]);return o(i,"_invoke",{value:O(t,r,c)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var y="suspendedStart",v="suspendedYield",d="executing",m="completed",g={};function w(){}function b(){}function x(){}var E={};f(E,i,(function(){return this}));var L=Object.getPrototypeOf,k=L&&L(L(C([])));k&&k!==r&&n.call(k,i)&&(E=k);var _=x.prototype=w.prototype=Object.create(E);function S(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function r(o,a,i,c){var u=p(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==l(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function O(e,r,n){var o=y;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=p(e,r,n);if("normal"===l.type){if(o=n.done?m:v,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=p(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(l(e)+" is not iterable")}return b.prototype=x,o(_,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:b,configurable:!0}),b.displayName=f(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},S(N.prototype),f(N.prototype,c,(function(){return this})),e.AsyncIterator=N,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new N(h(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},S(_),f(_,u,"Generator"),f(_,i,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function f(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function h(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){f(a,n,o,i,c,"next",t)}function c(t){f(a,n,o,i,c,"throw",t)}i(void 0)}))}}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return y(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function v(t){var e=p((0,n.useState)(!1),2),r=e[0],o=e[1],a=p((0,n.useState)([]),2),i=a[0],c=a[1],l=function(t){c(t)},f=function(){var e=h(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("folder"!==t.type){e.next=7;break}if(r||!t.click||i){e.next=4;break}return e.next=4,t.click(t,l,t.pre_path);case 4:o(!r),e.next=10;break;case 7:if(!t.click){e.next=10;break}return e.next=10,t.click(t,l,t.pre_path);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),y=function(){var e=h(s().mark((function e(){var r,n=arguments;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.length>0&&void 0!==n[0]&&n[0],"folder"!==t.type||r){e.next=6;break}return e.next=4,t.click(t,l,t.pre_path);case 4:e.next=7;break;case 6:t.fatherNowToggleExpansion&&t.fatherNowToggleExpansion();case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,n.useEffect)((function(){c(t.children)}),[t.children]),n.createElement("div",{className:"studio-item"},n.createElement("div",{onClick:f,onContextMenu:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),t.handleContextMenu&&t.handleContextMenu(e,t.name,t.pre_path,t.type===u.Iw.folder,y)},className:"studio-item-title"},n.createElement("i",{className:"material-icons studio-item-title-tag"},"file"==t.type?"":r?"arrow_drop_down":"arrow_right"),n.createElement("i",{className:"material-icons","file-type":t.type},"folder"===t.type?"folder":"text_snippet"),n.createElement("span",{className:"studio-item-name"},t.name)),r&&i&&n.createElement("div",{style:{marginLeft:20}},i.map((function(e,r){return n.createElement(n.Fragment,{key:r},n.createElement(v,{type:e.type,click:t.click,name:e.name,key:r,children:e.children,pre_path:"".concat(t.pre_path).concat(e.name).concat(e.type===u.Iw.folder?"/":""),handleContextMenu:t.handleContextMenu,fatherNowToggleExpansion:y}))}))))}function d(t){return n.createElement("div",null,t.list.map((function(e,r){return n.createElement(v,{pre_path:"".concat(t.pre_path).concat(e.name).concat(e.type===u.Iw.folder?"/":""),key:r,name:e.name,type:e.type,handleContextMenu:t.handleContextMenu,fatherNowToggleExpansion:t.fatherNowToggleExpansion,children:e.children,click:t.click})})))}var m=r(9653),g=r(4289),w=r(3459),b=r(8247),x=r(470),E=r(1499),L=r(2042),k=r(2543),_=r.n(k),S=r(4251),N=r(5421),O=r(2389);function j(t){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(t)}function P(){P=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof m?e:m,i=Object.create(a.prototype),c=new G(n||[]);return o(i,"_invoke",{value:S(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",d={};function m(){}function g(){}function w(){}var b={};l(b,i,(function(){return this}));var x=Object.getPrototypeOf,E=x&&x(x(C([])));E&&E!==r&&n.call(E,i)&&(b=E);var L=w.prototype=m.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==j(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function S(e,r,n){var o=h;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=N(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function N(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,N(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,d;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(j(e)+" is not iterable")}return g.prototype=w,o(L,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},k(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new _(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},k(L),l(L,u,"Generator"),l(L,i,(function(){return this})),l(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function A(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function G(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){A(a,n,o,i,c,"next",t)}function c(t){A(a,n,o,i,c,"throw",t)}i(void 0)}))}}function C(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return F(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function T(t){var e=C((0,a.L4)(o.A.studio),2),r=e[0],l=e[1],s=C((0,n.useState)([]),2),f=s[0],h=s[1],p=C((0,n.useState)(""),2),y=p[0],v=p[1],k=C((0,n.useState)(""),2),j=k[0],A=k[1],F=C((0,n.useState)(!1),2),T=(F[0],F[1],C((0,n.useState)("text"),2)),M=T[0],I=T[1],D=C((0,n.useState)({path:"",name:""}),2),Y=D[0],$=D[1],K=C((0,n.useState)(""),2),z=K[0],U=K[1],B=C((0,a.L4)(o.A.confirm),2),R=(B[0],B[1]),W=C((0,n.useState)(!1),2),X=W[0],V=W[1],q=C((0,a.L4)(o.A.fileShellShow),2),H=q[0],J=q[1],Q=C((0,a.L4)(o.A.file_shell_hidden),2),Z=Q[0],tt=Q[1],et=(0,n.useRef)(null),rt=(0,n.useRef)(null),nt=C((0,n.useState)(!1),2),ot=nt[0],at=nt[1],it=C((0,n.useState)(16),2),ct=it[0],ut=it[1],lt=C((0,a.L4)(o.A.showPrompt),2),st=(lt[0],lt[1]),ft=(0,O.Bd)().t,ht=function(){var t=G(P().mark((function t(){var e,n;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=(0,g.GG)("file",r.folder_path),v(e),t.next=4,m.$M.post("studio/get/item",{path:e});case 4:(n=t.sent).code===w.m.Sucess&&h(n.data.list);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();(0,n.useEffect)((function(){A(""),$({}),V(!1),r.folder_path&&ht()}),[r]);var pt=function(){var t=G(P().mark((function t(e,r){var n,o,a;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=null!==(n=(0,E.kr)(e))&&void 0!==n?n:"text",I(o),t.next=4,m.$M.get("".concat(r));case 4:if((a=t.sent).code!==w.m.File_Max){t.next=8;break}return(0,L.zN)("超过20MB"),t.abrupt("return");case 8:A(a.data),b.xK.set_value_temp(a.data),$({path:r,name:e}),U(r);case 12:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),yt=function(){var t=G(P().mark((function t(e,r,n){var o;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("folder"!==e.type){t.next=7;break}return t.next=3,m.$M.post("studio/get/item",{path:"".concat(n)});case 3:(o=t.sent).code===w.m.Sucess&&r(o.data.list),t.next=12;break;case 7:if(!X){t.next=10;break}return R({open:!0,handle:function(){pt(e.name,n),R({open:!1,handle:null}),V(!1)},title:"确定不保存就切换吗?"}),t.abrupt("return");case 10:return t.next=12,pt(e.name,n);case 12:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}();function vt(){return dt.apply(this,arguments)}function dt(){return(dt=G(P().mark((function t(){var e;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(X){t.next=2;break}return t.abrupt("return");case 2:return e={context:b.xK.get_value_temp()},t.next=5,m.$M.post("save/".concat(z),e);case 5:0===t.sent.code&&V(!1);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var mt=function(t){t.ctrlKey&&"s"===t.key&&(t.preventDefault(),vt())};(0,n.useEffect)((function(){return document.addEventListener("keydown",mt),function(){document.removeEventListener("keydown",mt)}}),[X]);var gt=(0,n.useCallback)(_().throttle((function(t){var e=parseFloat(getComputedStyle(rt.current).fontSize),r=window.innerWidth/e-4,n=t.clientX/e,o=2.25+et.current.offsetWidth/e;n<=r&&n>=o&&ut(parseFloat(n.toFixed(2)))}),32),[]),wt=function(){at(!1),rt.current.removeEventListener("pointermove",gt)};if(r.folder_path){var bt=[{r:ft("创建文件"),v:"创建文件"},{r:ft("创建目录"),v:"创建目录"},{r:ft("重命名"),v:"重命名"},{r:ft("删除"),v:"删除"}],xt=[{r:ft("重命名"),v:"重命名"},{r:ft("删除"),v:"删除"}],Et=function(t,e,r,n,o){t.preventDefault();var a=new S.i;a.path=r,a.filename=e,a.x=t.clientX,a.y=t.clientY,a.items=n?bt:xt,o===ht&&(a.items=a.items.slice(0,2)),a.type=n?u.Iw.studio_folder:u.Iw.studio_file;var i=function(t){o(t)};a.textClick=function(t){switch(t){case"创建文件":st({show:!0,type:N.PromptEnum.FileNew,overlay:!0,data:{dir:r,call:i}});break;case"创建目录":st({show:!0,type:N.PromptEnum.DirNew,overlay:!0,data:{dir:r,call:i}});break;case"删除":if(X&&(Y.path===r||Y.path.includes(r))){st({show:!0,type:N.PromptEnum.FilesDelete,overlay:!0,data:{path:r,call:function(){i(n),V(!1),$({}),A(""),b.xK.set_value_temp("")}}});break}st({show:!0,type:N.PromptEnum.FilesDelete,overlay:!0,data:{path:r,call:n?function(){i(!0)}:i}});break;case"重命名":st({show:!0,type:N.PromptEnum.FileRename,overlay:!0,data:{path:r,dir:(0,g.Yp)(r),call:function(){i(!0)},filename:e}})}},st({show:!0,type:N.PromptEnum.FileMenu,overlay:!1,data:a})};return n.createElement("div",{className:"studio"},n.createElement(c.A,{ignore_tags:!0,left_children:[n.createElement(i.rA,{key:1,title:"取消",icon:"close",onClick:function(){l({}),J({show:!1,path:""}),tt(void 0)}}),n.createElement("title",{key:2},Y.name)]},n.createElement(i.rA,{icon:"terminal",title:"shell",onClick:function(){void 0===Z?H.show?J({show:!1,path:""}):(J({show:!0,path:(0,g.GG)("file",r.folder_path)}),tt(!1)):tt(!Z)}}),X&&n.createElement(i.rA,{title:"保存",icon:"save",onClick:vt})),n.createElement("div",{className:"studio-body",ref:rt},n.createElement("div",{className:"studio-nav",style:{width:"".concat(ct-1,"em")},onContextMenu:function(t){Et(t,Y.name,(0,g.GG)("file",r.folder_path),!0,ht)}},n.createElement(d,{pre_path:y,list:f,click:yt,handleContextMenu:Et,fatherNowToggleExpansion:ht})),n.createElement("div",{className:"studio__divider",ref:et,onPointerDown:function(){at(!0),rt.current.addEventListener("pointermove",gt)},onPointerUp:wt}),ot&&n.createElement("div",{className:"shell__overlay",onPointerUp:wt}),n.createElement("div",{className:"studio-editor",key:Y.path},Y.name&&n.createElement(x.Ay,{mode:M,width:"100%",height:"100%",theme:"github",onChange:function(t){b.xK.set_value_temp(t),X||V(!0)},fontSize:14,showPrintMargin:!1,showGutter:!0,highlightActiveLine:!1,defaultValue:j,setOptions:{useWorker:!1,enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:!0,tabSize:2}}))))}}}}]);
|
package/build/dist/734.bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 734.bundle.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[734],{4734:(t,e,r)=>{r.r(e),r.d(e,{FileListShowTypeEmum:()=>ct,default:()=>ft});var n=r(6540),o=r(7022),i=r(7444),a=r(6417),c=r(7767),u=r(4694),l=r(8844),f=r(5489),s=r(4251),h=r(2389),p=r(8247);function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function v(){v=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof w?e:w,a=Object.create(i.prototype),c=new I(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",d="executing",m="completed",g={};function w(){}function b(){}function E(){}var L={};l(L,a,(function(){return this}));var x=Object.getPrototypeOf,k=x&&x(x(N([])));k&&k!==r&&n.call(k,a)&&(L=k);var _=E.prototype=w.prototype=Object.create(L);function S(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==y(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=s(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function F(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(F,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(y(e)+" is not iterable")}return b.prototype=E,o(_,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:b,configurable:!0}),b.displayName=l(E,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},S(A.prototype),l(A.prototype,c,(function(){return this})),e.AsyncIterator=A,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new A(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(_),l(_,u,"Generator"),l(_,a,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function d(t){return function(t){if(Array.isArray(t))return b(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||w(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||w(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(t,e){if(t){if("string"==typeof t)return b(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(t,e):void 0}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function E(t){var e=g((0,i.L4)(a.A.selectedFileList),2),r=e[0],y=e[1],w=g((0,i.L4)(a.A.clickFileList),2),b=w[0],E=w[1],L=g((0,i.L4)(a.A.enterKey),2),x=L[0],k=(L[1],(0,p.kZ)().click_file),_=((0,h.Bd)().t,(0,c.Zp)()),S=(0,c.zy)(),A=function(){var e,n=(e=v().mark((function e(n,i){var a,c,l,f,s,h;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(0,u.kW)(r,n))y((0,u.P1)(r,n));else if("ctrl"===x)y([].concat(d(r),[n]));else if("shift"===x){if(a=(0,u.a7)(r),c=a.max,l=a.min,f=[],n>=c)for(s=c;s<=n;s++)f.push(s);else for(h=l;h>=n;h--)f.push(h);y(f)}else y([n]);if(E([].concat(d(b),[n])),setTimeout((function(){E((0,u.P1)(b,n))}),300),t.type!==o.Iw.folder){e.next=13;break}if(void 0===b.find((function(t){return t===n}))){e.next=11;break}return _((0,u.IO)(S.pathname,i)),y([]),E([]),e.abrupt("return");case 11:e.next=15;break;case 13:void 0!==b.find((function(t){return t===n}))&&k({name:i});case 15:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){m(i,n,o,a,c,"next",t)}function c(t){m(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t,e){return n.apply(this,arguments)}}(),O=g((0,i.L4)(a.A.showPrompt),2),j=(O[0],O[1]);return n.createElement(l.B,{extraAttr:{onContextMenu:function(e){!function(t,e,r){t.preventDefault();var n=new s.i;n.path=(0,u.IO)(S.pathname,e),n.filename=e,n.x=t.clientX,n.y=t.clientY,n.type=r?o.Iw.folder:(0,s.u)(e),j({show:!0,type:f.PromptEnum.FileMenu,overlay:!1,data:n})}(e,t.name,t.type===o.Iw.folder)}},name:t.name,index:t.index,mtime:t.mtime,size:t.size,type:t.type,isLink:t.isLink,path:t.path,click:A,itemWidth:t.itemWidth})}var L=r(4976);function x(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return k(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function _(t){var e=(0,c.zy)(),r=x((0,n.useState)([]),2),o=r[0],i=r[1],a=x((0,n.useState)("/"),2),l=a[0],f=a[1];return n.useEffect((function(){var r="",n=e.pathname.split("/");n=n.filter((function(t){return t}));var o=n.indexOf(t.baseRoute),a=[];if(-1!=o){r=(0,u.IO)(n.slice(0,o),t.baseRoute);for(var c=n.slice(o+1),l=0;l<c.length;l++){var s=c[l];a.push({value:s,href:0===l?"".concat(r).concat(s,"/"):(0,u.IO)(a[l-1].href,s)})}f(r),i(a)}}),[e]),n.createElement("div",{className:"breadcrumbs"},n.createElement("span",null,n.createElement("span",{className:"chevron"},n.createElement(L.N_,{to:l,onClick:t.clickFun},n.createElement("i",{className:"material-icons"},"home"))),o.map((function(e,r){return n.createElement("span",{className:"chevron",key:r},n.createElement("i",{className:"material-icons"},"keyboard_arrow_right"),n.createElement(L.N_,{to:e.href,onClick:t.clickFun},decodeURIComponent(e.value)))}))))}var S=r(9653),A=r(5997),O=r(7952),j=r(5726),F=r(4289),P=r(3459),I=r(7856),N=r(4238),G=r(4944),C=r(7704),T=r(4405);function M(t){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(t)}function Y(){Y=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new F(n||[]);return o(a,"_invoke",{value:S(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",d={};function m(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,L=E&&E(E(P([])));L&&L!==r&&n.call(L,a)&&(b=L);var x=w.prototype=m.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==M(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function S(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=A(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=s(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function P(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(M(e)+" is not iterable")}return g.prototype=w,o(x,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},k(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(x),l(x,u,"Generator"),l(x,a,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=P,F.prototype={constructor:F,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function z(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function $(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){z(i,n,o,a,c,"next",t)}function c(t){z(i,n,o,a,c,"throw",t)}a(void 0)}))}}function K(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return U(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?U(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function D(t){var e=K((0,n.useState)(null),2),r=e[0],o=e[1],c=K((0,i.L4)(a.A.fileShellShow),2),u=c[0],l=(c[1],K((0,i.L4)(a.A.file_shell_hidden),2)),f=l[0],s=(l[1],K((0,n.useState)(!1),2)),h=s[0],p=s[1],y=function(){var t=$(Y().mark((function t(){var e,r,n;return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=new I.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:"#000000",cursor:"#000000",selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4}),n=function(t){e.write(t)},r=function(t){e.clear(),e.write(t),r=n},G.ws.addMsg(N.HK.shell_getting,(function(t){r(t.context)})),e.onData(function(){var t=$(Y().mark((function t(e){var r;return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(r=new N.hf(N.HK.shell_send)).context=e,t.next=4,G.ws.send(r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o(e);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),v=function(){$(Y().mark((function t(){return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r&&(r.dispose(),o(null)),G.ws.isAilive()&&G.ws.setPromise(function(){var t=$(Y().mark((function t(e){var r;return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(r=new N.hf(N.HK.shell_cancel)).context="",G.ws.unSubscribeUnconnect(),t.next=5,G.ws.send(r);case 5:return t.next=7,G.ws.unConnect();case 7:e();case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 2:case"end":return t.stop()}}),t)})))()};return(0,n.useEffect)((function(){return function(){v()}}),[]),(0,n.useEffect)((function(){if(u.show)if(r){if(h){var t=new N.hf(N.HK.shell_cd),e=new T.n;e.init_path=u.path,e.http_token=localStorage.getItem("token"),t.context=e,G.ws.send(t)}}else y(),p(!0);else v()}),[u]),n.createElement(C.$,{show:u.show,file_shell_hidden:f,terminal:r,init:function(t,e){r.writeln("[38;2;29;153;243mopen shell...[0m ");var n=new N.hf(N.HK.shell_open),o=new T.n;o.init_path=u.path,o.rows=t,o.cols=e,o.http_token=localStorage.getItem("token"),n.context=o,G.ws.send(n)}})}var W=r(9214),H=r(3413),R=r.n(H),B=r(5725),Z=r(3033),q=r(2042),X=r(7523);function J(t){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J(t)}function Q(){return Q=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Q.apply(null,arguments)}function V(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ot(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function tt(){tt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new F(n||[]);return o(a,"_invoke",{value:S(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",d={};function m(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,L=E&&E(E(P([])));L&&L!==r&&n.call(L,a)&&(b=L);var x=w.prototype=m.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==J(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function S(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=A(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=s(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function P(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(J(e)+" is not iterable")}return g.prototype=w,o(x,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},k(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(x),l(x,u,"Generator"),l(x,a,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=P,F.prototype={constructor:F,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function et(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function rt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){et(i,n,o,a,c,"next",t)}function c(t){et(i,n,o,a,c,"throw",t)}a(void 0)}))}}function nt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||ot(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ot(t,e){if(t){if("string"==typeof t)return it(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?it(t,e):void 0}}function it(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var at,ct=function(t){return t.block="",t.gallery="gallery",t.list="list",t}({}),ut=Object.values(ct),lt=280;function ft(){var t=nt((0,i.L4)(a.A.editorSetting),2),e=(t[0],t[1]),r=nt((0,i.L4)(a.A.file_preview),2),l=(r[0],r[1]),s=(0,h.Bd)().t,y=(0,n.useRef)(null),v=(0,c.zy)(),d=(0,c.Zp)(),m=nt((0,i.L4)(a.A.nowFileList),2),g=m[0],w=m[1],b=nt((0,i.L4)(a.A.fileShowType),2),L=b[0],x=b[1],k=nt((0,i.L4)(a.A.uploadFiles),2),I=(k[0],k[1]),N=nt((0,i.L4)(a.A.showPrompt),2),G=(N[0],N[1]),C=nt((0,i.L4)(a.A.selectedFileList),2),T=C[0],M=(C[1],nt((0,i.L4)(a.A.copyedFileList),2)),Y=M[0],z=M[1],$=nt((0,i.L4)(a.A.enterKey),2),K=($[0],$[1]),U=nt((0,i.L4)(a.A.cutedFileList),2),H=U[0],J=U[1],et=nt((0,i.L4)(a.A.selectedFileList),2),ot=(et[0],et[1]),it=nt((0,i.L4)(a.A.clickFileList),2),ct=(it[0],it[1]),ft=nt((0,i.L4)(a.A.fileShellShow),2),st=ft[0],ht=ft[1],pt=nt((0,i.L4)(a.A.file_root_list),2),yt=pt[0],vt=(pt[1],nt((0,i.L4)(a.A.file_root_index),2)),dt=vt[0],mt=vt[1],gt=nt((0,n.useState)(void 0),2),wt=gt[0],bt=gt[1],Et=nt((0,n.useState)(""),2),Lt=Et[0],xt=Et[1],kt=(0,n.useContext)(X.F).reloadUserInfo,_t=(0,p.kZ)().click_file,St=nt((0,i.L4)(a.A.prompt_card),2),At=(St[0],St[1]),Ot=function(){var t=rt(tt().mark((function t(){var e;return tt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,S.$M.get((0,F.GG)("file",v.pathname));case 2:if((e=t.sent).code!==P.m.PreFile){t.next=6;break}return _t({name:e.message,context:e.data}),t.abrupt("return");case 6:if(e.code===P.m.Sucess){t.next=9;break}return e.message&&(0,q.zN)(e.message),t.abrupt("return");case 9:w(e.data),at=e.data;case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),jt=function(){var t=Math.floor(document.querySelector("main").offsetWidth/lt);0===t&&(t=1),bt("calc(".concat(100/t,"% - 1em)"))};(0,n.useEffect)((function(){var t=function(){var t=rt(tt().mark((function t(){return tt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ot();case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();t(),e({open:!1}),l({open:!1})}),[v]);var Ft=function(){var t=rt(tt().mark((function t(e){var r,n,o,i;return tt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.preventDefault(),r=e.dataTransfer,n=e.target,!(r.files.length<=0)){t.next=5;break}return t.abrupt("return");case 5:for(o=0;o<5;o++)null===n||n.classList.contains("item")||(n=n.parentElement);return t.next=8,(0,j.T)(r);case 8:i=t.sent,I(i),G({show:!0,type:f.PromptEnum.FilesUpload,overlay:!1,data:{}});case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Pt=function(t){t.preventDefault()};function It(t){new(R())({type:"success",text:t,timeout:1e3,layout:"bottomLeft"}).show()}(0,n.useEffect)((function(){var t=y.current.ownerDocument;return t.addEventListener("dragover",Pt),t.addEventListener("drop",Ft),jt(),window.addEventListener("resize",jt),function(){t.removeEventListener("dragover",Pt),t.removeEventListener("drop",Ft),window.removeEventListener("resize",jt),st.show&&ht({show:!1,path:""})}}),[]);var Nt=function(){var t=rt(tt().mark((function t(e){return tt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return mt(e),t.next=3,S.$M.post("base_switch",{root_index:e});case 3:return t.next=5,kt();case 5:d("/file/"),ot([]),ct([]);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Gt=function(){var t=rt(tt().mark((function t(){var e;return tt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,S.$M.post("file/info",{type:o.Iw.folder,path:(0,F.GG)("file",v.pathname)});case 2:(e=t.sent).code===P.m.Sucess&&At({open:!0,title:"信息",context_div:n.createElement("div",null,n.createElement(B.Yh,{left:s("挂载位置磁盘"),right:e.data&&e.data.total_size}),n.createElement(B.Yh,{left:"".concat(s("磁盘剩余")),right:e.data&&e.data.left_size}),n.createElement(B.Yh,{left:"".concat(s("文件系统")),right:e.data&&e.data.fs_type}),n.createElement(B.Yh,{left:"".concat(s("文件夹数")),right:g.folders.length}),n.createElement(B.Yh,{left:"".concat(s("文件数")),right:g.files.length}))});case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Ct=nt((0,n.useState)(!1),2),Tt=Ct[0],Mt=Ct[1];(0,n.useEffect)((function(){var t=function(t){if(Tt)if(t.ctrlKey)if("a"===t.key||"A"===t.key){for(var e=g.files.length,r=g.folders.length,n=[],o=0;o<e+r;o++)n.push(o);ot(n)}else K("ctrl");else"Escape"===t.key?ot([]):"Shift"===t.key&&K("shift")},e=function(t){t.ctrlKey||K("")};return window.addEventListener("keydown",t),window.addEventListener("keyup",e),function(){window.removeEventListener("keydown",t),window.removeEventListener("keyup",e)}}),[g,Tt]);var Yt=function(t){t.target===t.currentTarget&&ot([])};return n.createElement("div",{className:"not-select-div"},n.createElement(O.A,{left_children:n.createElement(Z.$Z,{handleEnterPress:function(){var t,e;if(at){ot([]),ct([]);var r,n=[],o=[],i=V(null!==(t=at.files)&&void 0!==t?t:[]);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.name.includes(Lt)&&n.push(a)}}catch(t){i.e(t)}finally{i.f()}var c,u=V(null!==(e=at.folders)&&void 0!==e?e:[]);try{for(u.s();!(c=u.n()).done;){var l=c.value;l.name.includes(Lt)&&o.push(l)}}catch(t){u.e(t)}finally{u.f()}w({files:n,folders:o})}},placeholder:s("搜索当前目录"),icon:"search",value:"",handleInputChange:function(t){xt(t)},max_width:"25em"})},T.length>0&&n.createElement(A.rA,{icon:"delete",title:s("删除"),onClick:function(){G({show:!0,type:f.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),T.length>0&&n.createElement(A.rA,{icon:"content_copy",title:s("复制"),onClick:function(){var t=(0,W.i)(g,T);z(t.map((function(t){return(0,W.O)(v,t.name)}))),J([]),It("已复制")}}),T.length>0&&n.createElement(A.rA,{icon:"content_cut",title:s("剪切"),onClick:function(){var t=(0,W.i)(g,T);J(t.map((function(t){return(0,W.O)(v,t.name)}))),z([]),It("已剪切")}}),(Y.length>0||H.length>0)&&n.createElement(A.rA,{onClick:function(){G({show:!0,type:f.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:s("粘贴到此处"),tip:Y.length+H.length}),T.length>0&&n.createElement(A.rA,{icon:"download",title:s("下载"),onClick:function(){for(var t=(0,W.i)(g,T),e=0;e<t.length;e++){var r=t[e];t[e]=(0,W.O)(v,r.name)}var n=S.$M.getDownloadUrl(t);window.open(n)}}),T.length>0&&n.createElement(A.rA,{icon:"compress",title:s("压缩"),onClick:function(){for(var t=(0,W.i)(g,T),e=0;e<t.length;e++){var r=t[e];t[e]=(0,W.O)(v,r.name)}t&&0!==t.length?G({show:!0,type:f.PromptEnum.Compress,overlay:!0,data:{files:t}}):(0,q.zN)("没有选中")}}),1===T.length&&n.createElement(A.rA,{icon:"edit_attributes",title:s("重命名"),onClick:function(){G({show:!0,type:f.PromptEnum.FileRename,overlay:!0,data:{}})}}),n.createElement(A.rA,{icon:"terminal",title:"shell",onClick:function(){st.show?ht({show:!1,path:""}):ht({show:!0,path:(0,F.GG)("file",v.pathname)})}}),n.createElement(A.rA,{icon:"grid_view",title:s("切换样式"),onClick:function(){x((0,u.jH)(ut,L))}}),n.createElement(A.rA,{icon:"create_new_folder",title:s("创建文件夹"),onClick:function(){G({show:!0,type:f.PromptEnum.DirNew,overlay:!0,data:{dir:(0,F.GG)("file",v.pathname)}})}}),n.createElement(A.rA,{icon:"note_add",title:s("创建文本文件"),onClick:function(){G({show:!0,type:f.PromptEnum.FileNew,overlay:!0,data:{dir:(0,F.GG)("file",v.pathname)}})}}),n.createElement(A.rA,{icon:"info",title:s("信息"),onClick:Gt}),n.createElement(B.EF,{title:s("切换目录"),items:yt,click:function(t){Nt(t)},pre_value:dt})),n.createElement("div",{id:"listing",className:"mosaic file-icons ".concat(L),ref:y,onMouseEnter:function(){Mt(!0)},onMouseLeave:function(){Mt(!1)}},n.createElement(_,{baseRoute:"file",clickFun:function(){ot([]),ct([])}}),g.folders&&g.folders.length>0&&n.createElement("h2",null,s("文件夹")),g.folders&&n.createElement("div",{onClick:Yt},g.folders.map((function(t,e){return n.createElement(E,Q({itemWidth:wt,index:e,key:e},t))}))),g.files&&g.files.length>0&&n.createElement("h2",{onClick:Yt},s("文件")),g.files&&n.createElement("div",{onClick:Yt},g.files.map((function(t,e){return n.createElement(E,Q({itemWidth:wt,index:e+g.folders.length,key:e},t))})))),n.createElement(D,null))}}}]);
|
|
2
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[734],{4734:(t,e,r)=>{r.r(e),r.d(e,{FileListShowTypeEmum:()=>ut,default:()=>st});var n=r(6540),o=r(7022),i=r(7444),a=r(6417),c=r(7767),u=r(4694),l=r(8844),f=r(5421),s=r(4251),h=r(2389),p=r(8247);function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function v(){v=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof w?e:w,a=Object.create(i.prototype),c=new I(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",d="executing",m="completed",g={};function w(){}function b(){}function E(){}var L={};l(L,a,(function(){return this}));var x=Object.getPrototypeOf,k=x&&x(x(N([])));k&&k!==r&&n.call(k,a)&&(L=k);var _=E.prototype=w.prototype=Object.create(L);function S(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==y(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=s(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function F(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(F,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(y(e)+" is not iterable")}return b.prototype=E,o(_,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:b,configurable:!0}),b.displayName=l(E,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},S(A.prototype),l(A.prototype,c,(function(){return this})),e.AsyncIterator=A,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new A(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(_),l(_,u,"Generator"),l(_,a,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function d(t){return function(t){if(Array.isArray(t))return b(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||w(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||w(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(t,e){if(t){if("string"==typeof t)return b(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(t,e):void 0}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function E(t){var e=g((0,i.L4)(a.A.selectedFileList),2),r=e[0],y=e[1],w=g((0,i.L4)(a.A.clickFileList),2),b=w[0],E=w[1],L=g((0,i.L4)(a.A.enterKey),2),x=L[0],k=(L[1],(0,p.kZ)().click_file),_=((0,h.Bd)().t,(0,c.Zp)()),S=(0,c.zy)(),A=function(){var e,n=(e=v().mark((function e(n,i){var a,c,l,f,s,h;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(0,u.kW)(r,n))y((0,u.P1)(r,n));else if("ctrl"===x)y([].concat(d(r),[n]));else if("shift"===x){if(a=(0,u.a7)(r),c=a.max,l=a.min,f=[],n>=c)for(s=c;s<=n;s++)f.push(s);else for(h=l;h>=n;h--)f.push(h);y(f)}else y([n]);if(E([].concat(d(b),[n])),setTimeout((function(){E((0,u.P1)(b,n))}),300),t.type!==o.Iw.folder){e.next=13;break}if(void 0===b.find((function(t){return t===n}))){e.next=11;break}return _((0,u.IO)(S.pathname,i)),y([]),E([]),e.abrupt("return");case 11:e.next=15;break;case 13:void 0!==b.find((function(t){return t===n}))&&k({name:i,size:t.origin_size});case 15:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){m(i,n,o,a,c,"next",t)}function c(t){m(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t,e){return n.apply(this,arguments)}}(),O=g((0,i.L4)(a.A.showPrompt),2),j=(O[0],O[1]);return n.createElement(l.B,{extraAttr:{onContextMenu:function(e){!function(t,e,r,n){t.preventDefault();var i=new s.i;i.path=(0,u.IO)(S.pathname,e),i.filename=e,i.x=t.clientX,i.y=t.clientY,i.type=r?o.Iw.folder:(0,s.u)(e),i.size=n,j({show:!0,type:f.PromptEnum.FileMenu,overlay:!1,data:i})}(e,t.name,t.type===o.Iw.folder,t.origin_size)}},name:t.name,index:t.index,mtime:t.mtime,size:t.size,type:t.type,isLink:t.isLink,path:t.path,click:A,itemWidth:t.itemWidth})}var L=r(4976);function x(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return k(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function _(t){var e=(0,c.zy)(),r=x((0,n.useState)([]),2),o=r[0],i=r[1],a=x((0,n.useState)("/"),2),l=a[0],f=a[1];return n.useEffect((function(){var r="",n=e.pathname.split("/");n=n.filter((function(t){return t}));var o=n.indexOf(t.baseRoute),a=[];if(-1!=o){r=(0,u.IO)(n.slice(0,o),t.baseRoute);for(var c=n.slice(o+1),l=0;l<c.length;l++){var s=c[l];a.push({value:s,href:0===l?"".concat(r).concat(s,"/"):(0,u.IO)(a[l-1].href,s)})}f(r),i(a)}}),[e]),n.createElement("div",{className:"breadcrumbs"},n.createElement("span",null,n.createElement("span",{className:"chevron"},n.createElement(L.N_,{to:l,onClick:t.clickFun},n.createElement("i",{className:"material-icons"},"home"))),o.map((function(e,r){return n.createElement("span",{className:"chevron",key:r},n.createElement("i",{className:"material-icons"},"keyboard_arrow_right"),n.createElement(L.N_,{to:e.href,onClick:t.clickFun},decodeURIComponent(e.value)))}))))}var S=r(9653),A=r(5997),O=r(7952),j=r(5726),F=r(4289),P=r(3459),I=r(7856),N=r(4238),G=r(4944),C=r(7704),T=r(4405);function z(t){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function M(){M=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new F(n||[]);return o(a,"_invoke",{value:S(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",d={};function m(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,L=E&&E(E(P([])));L&&L!==r&&n.call(L,a)&&(b=L);var x=w.prototype=m.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==z(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function S(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=A(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=s(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function P(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(z(e)+" is not iterable")}return g.prototype=w,o(x,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},k(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(x),l(x,u,"Generator"),l(x,a,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=P,F.prototype={constructor:F,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function Y(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function $(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Y(i,n,o,a,c,"next",t)}function c(t){Y(i,n,o,a,c,"throw",t)}a(void 0)}))}}function K(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return U(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?U(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function D(t){var e=K((0,n.useState)(null),2),r=e[0],o=e[1],c=K((0,i.L4)(a.A.fileShellShow),2),u=c[0],l=(c[1],K((0,i.L4)(a.A.file_shell_hidden),2)),f=l[0],s=(l[1],K((0,n.useState)(!1),2)),h=s[0],p=s[1],y=function(){var t=$(M().mark((function t(){var e,r,n;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=new I.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:"#000000",cursor:"#000000",selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4}),n=function(t){e.write(t)},r=function(t){e.clear(),e.write(t),r=n},G.ws.addMsg(N.HK.shell_getting,(function(t){r(t.context)})),e.onData(function(){var t=$(M().mark((function t(e){var r;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(r=new N.hf(N.HK.shell_send)).context=e,t.next=4,G.ws.send(r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o(e);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),v=function(){$(M().mark((function t(){return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r&&(r.dispose(),o(null)),G.ws.isAilive()&&G.ws.setPromise(function(){var t=$(M().mark((function t(e){var r;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(r=new N.hf(N.HK.shell_cancel)).context="",G.ws.unSubscribeUnconnect(),t.next=5,G.ws.send(r);case 5:return t.next=7,G.ws.unConnect();case 7:e();case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 2:case"end":return t.stop()}}),t)})))()};return(0,n.useEffect)((function(){return function(){v()}}),[]),(0,n.useEffect)((function(){if(u.show)if(r){if(h){var t=new N.hf(N.HK.shell_cd),e=new T.n;e.init_path=u.path,e.http_token=localStorage.getItem("token"),t.context=e,G.ws.send(t)}}else y(),p(!0);else v()}),[u]),n.createElement(C.$,{show:u.show,file_shell_hidden:f,terminal:r,init:function(t,e){r.writeln("[38;2;29;153;243mopen shell...[0m ");var n=new N.hf(N.HK.shell_open),o=new T.n;o.init_path=u.path,o.rows=t,o.cols=e,o.http_token=localStorage.getItem("token"),n.context=o,G.ws.send(n)}})}var W=r(9214),H=r(3413),R=r.n(H),B=r(5725),Z=r(3033),q=r(2042),X=r(7523),J=r(8815);function Q(t){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(t)}function V(){return V=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},V.apply(null,arguments)}function tt(){tt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new F(n||[]);return o(a,"_invoke",{value:S(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",d={};function m(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,L=E&&E(E(P([])));L&&L!==r&&n.call(L,a)&&(b=L);var x=w.prototype=m.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==Q(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function S(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=A(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=s(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function P(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Q(e)+" is not iterable")}return g.prototype=w,o(x,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},k(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(x),l(x,u,"Generator"),l(x,a,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=P,F.prototype={constructor:F,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function et(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=it(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function rt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function nt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){rt(i,n,o,a,c,"next",t)}function c(t){rt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function ot(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||it(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function it(t,e){if(t){if("string"==typeof t)return at(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?at(t,e):void 0}}function at(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var ct,ut=function(t){return t.block="",t.gallery="gallery",t.list="list",t}({}),lt=Object.values(ut),ft=280;function st(){var t=ot((0,i.L4)(a.A.editorSetting),2),e=(t[0],t[1]),r=ot((0,i.L4)(a.A.file_preview),2),l=(r[0],r[1]),s=(0,h.Bd)().t,y=(0,n.useRef)(null),v=(0,c.zy)(),d=(0,c.Zp)(),m=ot((0,i.L4)(a.A.nowFileList),2),g=m[0],w=m[1],b=ot((0,i.L4)(a.A.fileShowType),2),L=b[0],x=b[1],k=ot((0,i.L4)(a.A.uploadFiles),2),I=(k[0],k[1]),N=ot((0,i.L4)(a.A.showPrompt),2),G=(N[0],N[1]),C=ot((0,i.L4)(a.A.selectedFileList),2),T=C[0],z=(C[1],ot((0,i.L4)(a.A.copyedFileList),2)),M=z[0],Y=z[1],$=ot((0,i.L4)(a.A.enterKey),2),K=($[0],$[1]),U=ot((0,i.L4)(a.A.cutedFileList),2),H=U[0],Q=U[1],rt=ot((0,i.L4)(a.A.selectedFileList),2),it=(rt[0],rt[1]),at=ot((0,i.L4)(a.A.clickFileList),2),ut=(at[0],at[1]),st=ot((0,i.L4)(a.A.fileShellShow),2),ht=st[0],pt=st[1],yt=ot((0,i.L4)(a.A.file_root_list),2),vt=yt[0],dt=(yt[1],ot((0,i.L4)(a.A.file_root_index),2)),mt=dt[0],gt=dt[1],wt=ot((0,n.useState)(void 0),2),bt=wt[0],Et=wt[1],Lt=ot((0,n.useState)(""),2),xt=Lt[0],kt=Lt[1],_t=(0,n.useContext)(X.F).reloadUserInfo,St=(0,p.kZ)().click_file,At=ot((0,i.L4)(a.A.prompt_card),2),Ot=(At[0],At[1]),jt=function(){var t=nt(tt().mark((function t(){var e,r,n,o,i,a;return tt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,S.$M.get((0,F.GG)("file",v.pathname));case 2:if((r=t.sent).code!==P.m.PreFile){t.next=6;break}return St({name:r.message,context:r.data}),t.abrupt("return");case 6:if(r.code===P.m.Sucess){t.next=9;break}return r.message&&(0,q.zN)(r.message),t.abrupt("return");case 9:n=r.data,o=et(null!==(e=n.files)&&void 0!==e?e:[]);try{for(o.s();!(i=o.n()).done;)(a=i.value).origin_size=a.size,a.size=(0,J.v7)(a.size)}catch(t){o.e(t)}finally{o.f()}w(r.data),ct=r.data;case 14:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Ft=function(){var t=Math.floor(document.querySelector("main").offsetWidth/ft);0===t&&(t=1),Et("calc(".concat(100/t,"% - 1em)"))};(0,n.useEffect)((function(){var t=function(){var t=nt(tt().mark((function t(){return tt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,jt();case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();t(),e({open:!1}),l({open:!1})}),[v]);var Pt=function(){var t=nt(tt().mark((function t(e){var r,n,o,i;return tt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.preventDefault(),r=e.dataTransfer,n=e.target,!(r.files.length<=0)){t.next=5;break}return t.abrupt("return");case 5:for(o=0;o<5;o++)null===n||n.classList.contains("item")||(n=n.parentElement);return t.next=8,(0,j.T)(r);case 8:i=t.sent,I(i),G({show:!0,type:f.PromptEnum.FilesUpload,overlay:!1,data:{}});case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),It=function(t){t.preventDefault()};function Nt(t){new(R())({type:"success",text:t,timeout:1e3,layout:"bottomLeft"}).show()}(0,n.useEffect)((function(){var t=y.current.ownerDocument;return t.addEventListener("dragover",It),t.addEventListener("drop",Pt),Ft(),window.addEventListener("resize",Ft),function(){t.removeEventListener("dragover",It),t.removeEventListener("drop",Pt),window.removeEventListener("resize",Ft),ht.show&&pt({show:!1,path:""})}}),[]);var Gt=function(){var t=nt(tt().mark((function t(e){return tt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return gt(e),t.next=3,S.$M.post("base_switch",{root_index:e});case 3:return t.next=5,_t();case 5:d("/file/"),it([]),ut([]);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Ct=function(){var t=nt(tt().mark((function t(){var e;return tt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,S.$M.post("file/info",{type:o.Iw.folder,path:(0,F.GG)("file",v.pathname)});case 2:(e=t.sent).code===P.m.Sucess&&Ot({open:!0,title:"信息",context_div:n.createElement("div",null,n.createElement(B.Yh,{left:s("挂载位置磁盘"),right:e.data&&e.data.total_size}),n.createElement(B.Yh,{left:"".concat(s("磁盘剩余")),right:e.data&&e.data.left_size}),n.createElement(B.Yh,{left:"".concat(s("文件系统")),right:e.data&&e.data.fs_type}),n.createElement(B.Yh,{left:"".concat(s("文件夹数")),right:g.folders.length}),n.createElement(B.Yh,{left:"".concat(s("文件数")),right:g.files.length}))});case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Tt=ot((0,n.useState)(!1),2),zt=Tt[0],Mt=Tt[1];(0,n.useEffect)((function(){var t=function(t){if(zt)if(t.ctrlKey)if("a"===t.key||"A"===t.key){for(var e=g.files.length,r=g.folders.length,n=[],o=0;o<e+r;o++)n.push(o);it(n)}else K("ctrl");else"Escape"===t.key?it([]):"Shift"===t.key&&K("shift")},e=function(t){t.ctrlKey||K("")};return window.addEventListener("keydown",t),window.addEventListener("keyup",e),function(){window.removeEventListener("keydown",t),window.removeEventListener("keyup",e)}}),[g,zt]);var Yt=function(t){t.target===t.currentTarget&&it([])};return n.createElement("div",{className:"not-select-div"},n.createElement(O.A,{left_children:n.createElement(Z.$Z,{handleEnterPress:function(){var t,e;if(ct){it([]),ut([]);var r,n=[],o=[],i=et(null!==(t=ct.files)&&void 0!==t?t:[]);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.name.includes(xt)&&n.push(a)}}catch(t){i.e(t)}finally{i.f()}var c,u=et(null!==(e=ct.folders)&&void 0!==e?e:[]);try{for(u.s();!(c=u.n()).done;){var l=c.value;l.name.includes(xt)&&o.push(l)}}catch(t){u.e(t)}finally{u.f()}w({files:n,folders:o})}},placeholder:s("搜索当前目录"),icon:"search",value:"",handleInputChange:function(t){kt(t)},max_width:"25em"})},T.length>0&&n.createElement(A.rA,{icon:"delete",title:s("删除"),onClick:function(){G({show:!0,type:f.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),T.length>0&&n.createElement(A.rA,{icon:"content_copy",title:s("复制"),onClick:function(){var t=(0,W.i)(g,T);Y(t.map((function(t){return(0,W.O)(v,t.name)}))),Q([]),Nt("已复制")}}),T.length>0&&n.createElement(A.rA,{icon:"content_cut",title:s("剪切"),onClick:function(){var t=(0,W.i)(g,T);Q(t.map((function(t){return(0,W.O)(v,t.name)}))),Y([]),Nt("已剪切")}}),(M.length>0||H.length>0)&&n.createElement(A.rA,{onClick:function(){G({show:!0,type:f.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:s("粘贴到此处"),tip:M.length+H.length}),T.length>0&&n.createElement(A.rA,{icon:"download",title:s("下载"),onClick:function(){for(var t=(0,W.i)(g,T),e=0;e<t.length;e++){var r=t[e];t[e]=(0,W.O)(v,r.name)}var n=S.$M.getDownloadUrl(t);window.open(n)}}),T.length>0&&n.createElement(A.rA,{icon:"compress",title:s("压缩"),onClick:function(){for(var t=(0,W.i)(g,T),e=0;e<t.length;e++){var r=t[e];t[e]=(0,W.O)(v,r.name)}t&&0!==t.length?G({show:!0,type:f.PromptEnum.Compress,overlay:!0,data:{files:t}}):(0,q.zN)("没有选中")}}),1===T.length&&n.createElement(A.rA,{icon:"edit_attributes",title:s("重命名"),onClick:function(){G({show:!0,type:f.PromptEnum.FileRename,overlay:!0,data:{}})}}),n.createElement(A.rA,{icon:"terminal",title:"shell",onClick:function(){ht.show?pt({show:!1,path:""}):pt({show:!0,path:(0,F.GG)("file",v.pathname)})}}),n.createElement(A.rA,{icon:"grid_view",title:s("切换样式"),onClick:function(){x((0,u.jH)(lt,L))}}),n.createElement(A.rA,{icon:"create_new_folder",title:s("创建文件夹"),onClick:function(){G({show:!0,type:f.PromptEnum.DirNew,overlay:!0,data:{dir:(0,F.GG)("file",v.pathname)}})}}),n.createElement(A.rA,{icon:"note_add",title:s("创建文本文件"),onClick:function(){G({show:!0,type:f.PromptEnum.FileNew,overlay:!0,data:{dir:(0,F.GG)("file",v.pathname)}})}}),n.createElement(A.rA,{icon:"info",title:s("信息"),onClick:Ct}),n.createElement(B.EF,{title:s("切换目录"),items:vt,click:function(t){Gt(t)},pre_value:mt})),n.createElement("div",{id:"listing",className:"mosaic file-icons ".concat(L),ref:y,onMouseEnter:function(){Mt(!0)},onMouseLeave:function(){Mt(!1)}},n.createElement(_,{baseRoute:"file",clickFun:function(){it([]),ut([])}}),g.folders&&g.folders.length>0&&n.createElement("h2",null,s("文件夹")),g.folders&&n.createElement("div",{onClick:Yt},g.folders.map((function(t,e){return n.createElement(E,V({itemWidth:bt,index:e,key:e},t))}))),g.files&&g.files.length>0&&n.createElement("h2",{onClick:Yt},s("文件")),g.files&&n.createElement("div",{onClick:Yt},g.files.map((function(t,e){return n.createElement(E,V({itemWidth:bt,index:e+g.folders.length,key:e},t))})))),n.createElement(D,null))}}}]);
|