filecat 7.32.2 → 7.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/build/dist/1246.2504cc1737e1f6c1b7df.js +1 -0
  2. package/build/dist/1793.388505f01a0f2cfa51ee.js +1 -0
  3. package/build/dist/{2136.20ea58a65c7fb22d5e43.js → 2136.6a16e77023578d9b1d94.js} +1 -1
  4. package/build/dist/2539.4a8af43f286966a85f50.js +1 -0
  5. package/build/dist/{5308.073eb181f5ca0d6d2594.js → 2927.0c19d87ad8ee4eaaf334.js} +1 -1
  6. package/build/dist/{3355.fe615f78b2015ec080c2.js → 3355.b6d8493bf1901b761473.js} +1 -1
  7. package/build/dist/{4598.7f2b7c8ee1751b912cc6.js → 4598.d7b34a6ecf05aee2caf9.js} +1 -1
  8. package/build/dist/{47.d5cc6abee0da2951a189.js → 47.a2da5cd3257ddf268be7.js} +1 -1
  9. package/build/dist/526.bff76b57b88c2d4ffa93.js +1 -0
  10. package/build/dist/5308.48f7ed633a2ccd08e9a4.js +1 -0
  11. package/build/dist/5599.3106e89134ff993bc90b.js +1 -0
  12. package/build/dist/{6097.fa01bd2ab412cdcb52df.js → 6097.e3c8830eb391ed4af10f.js} +1 -1
  13. package/build/dist/{6439.e984788ff732b4eeaed8.js → 6439.ee22062f4138f66a40b3.js} +1 -1
  14. package/build/dist/6471.c5f6de5c28d0ce0ece0e.js +1 -0
  15. package/build/dist/676.d6c4977162563e3414d5.js +1 -0
  16. package/build/dist/6930.155cf4ed8fff0398c4b1.js +1 -0
  17. package/build/dist/7518.39a7d163fd064dd730ea.js +1 -0
  18. package/build/dist/{7678.954622f85bb32a50ad25.js → 7678.4adb2a0c9f541878bbb8.js} +1 -1
  19. package/build/dist/8891.bdc07e7b0fdb9b33cb83.js +1 -0
  20. package/build/dist/{9260.fd785c5b4418123dd54f.js → 9260.7efb31121354032f37f9.js} +1 -1
  21. package/build/dist/9724.e50b15571a3aed321e10.js +1 -0
  22. package/build/dist/{9765.046a87c8c6ed9427eb45.js → 9765.041a6563b8a199f68331.js} +1 -1
  23. package/build/dist/9984.ab2ec08866b8f1eca3ca.js +1 -0
  24. package/build/dist/index.html +1 -1
  25. package/build/dist/main.33ce288c271cbe87de33.js +2 -0
  26. package/build/main.js +1 -1
  27. package/package.json +2 -1
  28. package/build/dist/676.82cbafd4308ac08d1e69.js +0 -1
  29. package/build/dist/main.89376a85f16c77177628.js +0 -2
  30. /package/build/dist/{main.89376a85f16c77177628.js.LICENSE.txt → main.33ce288c271cbe87de33.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1246],{61246(e,t,n){n.d(t,{searchMatcher:()=>i});const s=e=>e.replace(/\s+/g," "),a=(e,{startIndex:t,startOffset:n,endIndex:a,endOffset:r})=>{const i=e[t],l=e[a],o=i===l?i.slice(n,r):i.slice(n)+e.slice(i+1,l).join("")+l.slice(0,r),c=s(i.slice(0,n)).trimStart(),g=s(l.slice(r)).trimEnd(),f=c.length<50?"":"…",d=g.length<50?"":"…";return{pre:`${f}${c.slice(-50)}`,match:o,post:`${g.slice(0,50)}${d}`}},r=(e,t,n)=>{const{granularity:s="grapheme",sensitivity:r="base"}=n;return Intl?.Segmenter&&("grapheme"!==s||"variant"!==r&&"accent"!==r)?function*(e,t,n={}){const{locales:s="en",granularity:r="word",sensitivity:i="base"}=n;let l,o;try{l=new Intl.Segmenter(s,{usage:"search",granularity:r}),o=new Intl.Collator(s,{sensitivity:i})}catch(e){console.warn(e),l=new Intl.Segmenter("en",{usage:"search",granularity:r}),o=new Intl.Collator("en",{sensitivity:i})}const c=Array.from(l.segment(t)).length,g=[];let f=0,d=l.segment(e[f])[Symbol.iterator]();e:for(;f<e.length;){for(;g.length<c;){const{done:t,value:n}=d.next();if(t){if(f++,f<e.length){d=l.segment(e[f])[Symbol.iterator]();continue}break e}const{index:s,segment:a}=n;/[^\p{Format}]/u.test(a)&&(/\s/u.test(a)?/\s/u.test(g[g.length-1]?.segment)||g.push({strIndex:f,index:s,segment:" "}):(n.strIndex=f,g.push(n)))}const n=g.map(e=>e.segment).join("");if(0===o.compare(t,n)){const t=f,n=g[g.length-1],s=n.index+n.segment.length,r={startIndex:g[0].strIndex,startOffset:g[0].index,endIndex:t,endOffset:s};yield{range:r,excerpt:a(e,r)}}g.shift()}}(e,t,n):function*(e,t,n={}){const{locales:s="en",sensitivity:r}=n,i="variant"===r,l=e.join(""),o=i?l:l.toLocaleLowerCase(s),c=i?t:t.toLocaleLowerCase(s),g=c.length;let f=-1,d=-1,h=0;do{if(f=o.indexOf(c,f+1),f>-1){for(;h<=f;)h+=e[++d].length;const t=d,n=f-(h-e[d].length),s=f+g;for(;h<=s;)h+=e[++d].length;const r={startIndex:t,startOffset:n,endIndex:d,endOffset:s-(h-e[d].length)};yield{range:r,excerpt:a(e,r)}}}while(f>-1)}(e,t,n)},i=(e,t)=>{const{defaultLocale:n,matchCase:s,matchDiacritics:a,matchWholeWords:i}=t;return function*(t,l){const o=e(t,function*(e,o){for(const c of r(e,l,{locales:t.body.lang||t.documentElement.lang||n||"en",granularity:i?"word":"grapheme",sensitivity:a&&s?"variant":a&&!s?"accent":!a&&s?"case":"base"})){const{startIndex:e,startOffset:t,endIndex:n,endOffset:s}=c.range;c.range=o(e,t,n,s),yield c}});for(const e of o)yield e}}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1793],{93742(){!function(){"use strict";if("undefined"!=typeof document&&!("adoptedStyleSheets"in document)){var e="ShadyCSS"in window&&!ShadyCSS.nativeShadow,t=document.implementation.createHTMLDocument(""),n=new WeakMap,i="object"==typeof DOMException?Error:DOMException,r=Object.defineProperty,o=Array.prototype.forEach,s=/@import.+?;?$/gm,a=CSSStyleSheet.prototype;a.replace=function(){return Promise.reject(new i("Can't call replace on non-constructed CSSStyleSheets."))},a.replaceSync=function(){throw new i("Failed to execute 'replaceSync' on 'CSSStyleSheet': Can't call replaceSync on non-constructed CSSStyleSheets.")};var c=new WeakMap,h=new WeakMap,l=new WeakMap,d=new WeakMap,u=M.prototype;u.replace=function(e){try{return this.replaceSync(e),Promise.resolve(this)}catch(e){return Promise.reject(e)}},u.replaceSync=function(e){if(O(this),"string"==typeof e){var t=this;c.get(t).textContent=function(e){var t=e.replace(s,"");return t!==e&&console.warn("@import rules are not allowed here. See https://github.com/WICG/construct-stylesheets/issues/119#issuecomment-588352418"),t.trim()}(e),d.set(t,[]),h.get(t).forEach(function(e){e.isConnected()&&k(t,C(t,e))})}},r(u,"cssRules",{configurable:!0,enumerable:!0,get:function(){return O(this),c.get(this).sheet.cssRules}}),r(u,"media",{configurable:!0,enumerable:!0,get:function(){return O(this),c.get(this).sheet.media}}),["addRule","deleteRule","insertRule","removeRule"].forEach(function(e){u[e]=function(){var t=this;O(t);var n=arguments;d.get(t).push({method:e,args:n}),h.get(t).forEach(function(i){if(i.isConnected()){var r=C(t,i).sheet;r[e].apply(r,n)}});var i=c.get(t).sheet;return i[e].apply(i,n)}}),r(M,Symbol.hasInstance,{configurable:!0,value:x});var f={childList:!0,subtree:!0},p=new WeakMap,g=new WeakMap,m=new WeakMap,y=new WeakMap;if(W.prototype={isConnected:function(){var e=g.get(this);return e instanceof Document?"loading"!==e.readyState:function(e){return"isConnected"in e?e.isConnected:document.contains(e)}(e.host)},connect:function(){var e=T(this);y.get(this).observe(e,f),m.get(this).length>0&&A(this),R(e,function(e){F(e).connect()})},disconnect:function(){y.get(this).disconnect()},update:function(e){var t=this,n=g.get(t)===document?"Document":"ShadowRoot";if(!Array.isArray(e))throw new TypeError("Failed to set the 'adoptedStyleSheets' property on "+n+": Iterator getter is not callable.");if(!e.every(x))throw new TypeError("Failed to set the 'adoptedStyleSheets' property on "+n+": Failed to convert value to 'CSSStyleSheet'");if(e.some(E))throw new TypeError("Failed to set the 'adoptedStyleSheets' property on "+n+": Can't adopt non-constructed stylesheets");t.sheets=e;var i,r,o=m.get(t),s=(i=e).filter(function(e,t){return i.indexOf(e)===t});(r=s,o.filter(function(e){return-1===r.indexOf(e)})).forEach(function(e){var n;(n=C(e,t)).parentNode.removeChild(n),function(e,t){l.get(e).delete(t),h.set(e,h.get(e).filter(function(e){return e!==t}))}(e,t)}),m.set(t,s),t.isConnected()&&s.length>0&&A(t)}},window.CSSStyleSheet=M,L(Document),"ShadowRoot"in window){L(ShadowRoot);var w=Element.prototype,S=w.attachShadow;w.attachShadow=function(e){var t=S.call(this,e);return"closed"===e.mode&&n.set(this,t),t}}var v=F(document);v.isConnected()?v.connect():document.addEventListener("DOMContentLoaded",v.connect.bind(v))}function b(e){return e.shadowRoot||n.get(e)}function x(e){return"object"==typeof e&&(u.isPrototypeOf(e)||a.isPrototypeOf(e))}function E(e){return"object"==typeof e&&a.isPrototypeOf(e)}function C(e,t){return l.get(e).get(t)}function k(e,t){requestAnimationFrame(function(){t.textContent=c.get(e).textContent,d.get(e).forEach(function(e){return t.sheet[e.method].apply(t.sheet,e.args)})})}function O(e){if(!c.has(e))throw new TypeError("Illegal invocation")}function M(){var e=this,n=document.createElement("style");t.body.appendChild(n),c.set(e,n),h.set(e,[]),l.set(e,new WeakMap),d.set(e,[])}function F(e){var t=p.get(e);return t||(t=new W(e),p.set(e,t)),t}function L(e){r(e.prototype,"adoptedStyleSheets",{configurable:!0,enumerable:!0,get:function(){return F(this).sheets},set:function(e){F(this).update(e)}})}function R(e,t){for(var n=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,function(e){return b(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT},null,!1),i=void 0;i=n.nextNode();)t(b(i))}function T(e){var t=g.get(e);return t instanceof Document?t.body:t}function A(e){var t=document.createDocumentFragment(),n=m.get(e),i=y.get(e),r=T(e);i.disconnect(),n.forEach(function(n){t.appendChild(C(n,e)||function(e,t){var n=document.createElement("style");return l.get(e).set(t,n),h.get(e).push(t),n}(n,e))}),r.insertBefore(t,null),i.observe(r,f),n.forEach(function(t){k(t,C(t,e))})}function W(t){var n=this;n.sheets=[],g.set(n,t),m.set(n,[]),y.set(n,new MutationObserver(function(t,i){document?t.forEach(function(t){e||o.call(t.addedNodes,function(e){e instanceof Element&&R(e,function(e){F(e).connect()})}),o.call(t.removedNodes,function(t){t instanceof Element&&(function(e,t){return t instanceof HTMLStyleElement&&m.get(e).some(function(t){return C(t,e)})}(n,t)&&A(n),e||R(t,function(e){F(e).disconnect()}))})}):i.disconnect()}))}}()},51793(e,t,n){"use strict";n.r(t),n.d(t,{FixedLayout:()=>r});n(93742);const i=e=>e?.split(/[,;\s]/)?.filter(e=>e)?.map(e=>e.split("=").map(e=>e.trim()));class r extends HTMLElement{static observedAttributes=["zoom"];#e=this.attachShadow({mode:"closed"});#t=new ResizeObserver(()=>this.#n());#i;#r=-1;defaultViewport;spread;#o=!1;#s;#a;#c;#h;#l;constructor(){super();const e=new CSSStyleSheet;this.#e.adoptedStyleSheets=[e],e.replaceSync(":host {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n overflow: auto;\n }"),this.#t.observe(this)}attributeChangedCallback(e,t,n){if("zoom"===e)this.#l="fit-width"!==n&&"fit-page"!==n?parseFloat(n):n,this.#n()}async#d({index:e,src:t}){const n="string"==typeof t,r=n?t:t?.src,o=n?null:t?.onZoom,s=document.createElement("div"),a=document.createElement("iframe");return s.append(a),Object.assign(a.style,{border:"0",display:"none",overflow:"hidden"}),a.setAttribute("sandbox","allow-same-origin allow-scripts"),a.setAttribute("scrolling","no"),a.setAttribute("part","filter"),this.#e.append(s),r?new Promise(t=>{a.addEventListener("load",()=>{const n=a.contentDocument;this.dispatchEvent(new CustomEvent("load",{detail:{doc:n,index:e}}));const{width:r,height:c}=((e,t)=>{if("svg"===e.documentElement.localName){const[,,t,n]=e.documentElement.getAttribute("viewBox")?.split(/\s/)??[];return{width:t,height:n}}const n=i(e.querySelector('meta[name="viewport"]')?.getAttribute("content"));if(n)return Object.fromEntries(n);if("string"==typeof t)return i(t);if(t)return t;const r=e.querySelector("img");return r?{width:r.naturalWidth,height:r.naturalHeight}:(console.warn(new Error("Missing viewport properties")),{width:1e3,height:2e3})})(n,this.defaultViewport);t({element:s,iframe:a,width:parseFloat(r),height:parseFloat(c),onZoom:o})},{once:!0}),a.src=r}):{blank:!0,element:s,iframe:a}}#n(e=this.#h){if(!e)return;const t=this.#s??{},n=this.#c??this.#a,i="left"===e?t:n,{width:r,height:o}=this.getBoundingClientRect(),s="both"!==this.spread&&"portrait"!==this.spread&&o>r;this.#o=s;const a=t.width??n.width,c=t.height??n.height,h="number"!=typeof this.#l||isNaN(this.#l)?"fit-width"===this.#l?s||this.#c?r/(i.width??a):r/((t.width??a)+(n.width??a)):s||this.#c?Math.min(r/(i.width??a),o/(i.height??c)):Math.min(r/((t.width??a)+(n.width??a)),o/Math.max(t.height??c,n.height??c)):this.#l,l=e=>{let{element:t,iframe:n,width:r,height:o,blank:l,onZoom:d}=e;d&&d({doc:e.iframe.contentDocument,scale:h});const u=d?h:1;Object.assign(n.style,{width:r*u+"px",height:o*u+"px",transform:d?"none":`scale(${h})`,transformOrigin:"top left",display:l?"none":"block"}),Object.assign(t.style,{width:(r??a)*h+"px",height:(o??c)*h+"px",overflow:"hidden",display:"block",flexShrink:"0",marginBlock:"auto"}),s&&e!==i&&(t.style.display="none")};this.#c?l(this.#c):(l(t),l(n))}async#u({left:e,right:t,center:n,side:i}){this.#e.replaceChildren(),this.#s=null,this.#a=null,this.#c=null,n?(this.#c=await this.#d(n),this.#h="center",this.#n()):(this.#s=await this.#d(e),this.#a=await this.#d(t),this.#h=this.#s.blank?"right":this.#a.blank?"left":i,this.#n())}#f(){if(!this.#c&&!this.#s?.blank)return this.#o&&"none"===this.#s?.element?.style?.display?(this.#a.element.style.display="none",this.#s.element.style.display="block",this.#h="left",!0):void 0}#p(){if(!this.#c&&!this.#a?.blank)return this.#o&&"none"===this.#a?.element?.style?.display?(this.#s.element.style.display="none",this.#a.element.style.display="block",this.#h="right",!0):void 0}open(e){this.book=e;const{rendition:t}=e;this.spread=t?.spread,this.defaultViewport=t?.viewport;const n="rtl"===e.dir,i=!n;this.rtl=n,this.#i="none"===t?.spread?e.sections.map(e=>({center:e})):e.sections.reduce((e,t,r)=>{const o=e[e.length-1],{pageSpread:s}=t,a=()=>{const t={};return e.push(t),t};if("center"===s){(o.left||o.right?a():o).center=t}else if("left"===s){(o.center||o.left||i&&r?a():o).left=t}else if("right"===s){(o.center||o.right||n&&r?a():o).right=t}else i?o.center||o.right?a().left=t:o.left||!r?o.right=t:o.left=t:o.center||o.left?a().right=t:o.right||!r?o.left=t:o.right=t;return e},[{}])}get index(){const e=this.#i[this.#r],t=e?.center??("left"===this.side?e.left??e.right:e.right??e.left);return this.book.sections.indexOf(t)}#g(e){this.dispatchEvent(new CustomEvent("relocate",{detail:{reason:e,range:null,index:this.index,fraction:0,size:1}}))}getSpreadOf(e){const t=this.#i;for(let n=0;n<t.length;n++){const{left:i,right:r,center:o}=t[n];if(i===e)return{index:n,side:"left"};if(r===e)return{index:n,side:"right"};if(o===e)return{index:n,side:"center"}}}async goToSpread(e,t,n){if(e<0||e>this.#i.length-1)return;if(e===this.#r)return void this.#n(t);this.#r=e;const i=this.#i[e];if(i.center){const e=this.book.sections.indexOf(i.center),t=await(i.center?.load?.());await this.#u({center:{index:e,src:t}})}else{const e=this.book.sections.indexOf(i.left),n=this.book.sections.indexOf(i.right),r={index:e,src:await(i.left?.load?.())},o={index:n,src:await(i.right?.load?.())};await this.#u({left:r,right:o,side:t})}this.#g(n)}async select(e){await this.goTo(e)}async goTo(e){const{book:t}=this,n=await e,i=t.sections[n.index];if(!i)return;const{index:r,side:o}=this.getSpreadOf(i);await this.goToSpread(r,o)}async next(){if(!(this.rtl?this.#f():this.#p()))return this.goToSpread(this.#r+1,this.rtl?"right":"left","page");this.#g("page")}async prev(){if(!(this.rtl?this.#p():this.#f()))return this.goToSpread(this.#r-1,this.rtl?"left":"right","page");this.#g("page")}getContents(){return Array.from(this.#e.querySelectorAll("iframe"),e=>({doc:e.contentDocument}))}destroy(){this.#t.unobserve(this)}}customElements.define("foliate-fxl",r)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2136],{47374(e,t,s){s.d(t,{e:()=>h});var n=s(96540),i=s(52671),a=s(64694),l=s(34289),o=s(61443),r=s(75725),c=s(22022),d=s(85997),_=s(74848);function h(e){let t=(0,i.zy)();const s=(0,i.Zp)(),[h,p]=(0,n.useState)([]),[m,f]=(0,n.useState)("/"),[u,x]=(0,n.useState)(void 0),{t:g,i18n:v}=(0,c.Bd)();n.useEffect(()=>{let t="",s=(0,l.vX)().split("/");s=s.filter(e=>e);const n=s.indexOf(e.baseRoute),i=[];if(-1!=n){t=(0,a.IO)(s.slice(0,n),e.baseRoute);const l=s.slice(n+1);for(let e=0;e<l.length;e++){const s=l[e];i.push({value:s,href:0===e?`${t}${s}/`:(0,a.IO)(i[e-1].href,s)})}f(t),p(i)}},[t]);const w=t=>{t.stopPropagation(),e.clickFun(t)},[j,y]=(0,n.useState)(0),k=(0,n.useRef)(null),A=(0,n.useRef)(null),b=()=>{const e=k.current,t=A.current;if(!e||!t)return;const s=[];for(const e of Array.from(t.children))s.push(e.getBoundingClientRect().width);const n=e.clientWidth;if(s.reduce((e,t)=>e+t,0)<=n||s.length<=2)return void y(e=>0===e?e:0);let i=s[0]+48,a=0;for(let e=s.length-1;e>=1&&!(i+s[e]>n);e--)i+=s[e],a++;const l=Math.max(s.length-1-a,0);y(e=>e===l?e:l)};(0,n.useEffect)(()=>{b();const e=new ResizeObserver(b);return k.current&&e.observe(k.current),()=>e.disconnect()},[h,m,t]),(0,n.useEffect)(()=>{const e=k.current;e&&0!==j&&e.scrollWidth>e.clientWidth&&j<h.length-1&&y(e=>e+1)});const G=j>0?1+j:1,N=j>0?h.slice(1,G):[],[C,S]=(0,n.useState)(null);return(0,n.useEffect)(()=>{S(null)},[t,j]),(0,_.jsxs)("div",{className:"breadcrumbs",ref:k,onClick:e=>{x(void 0!==u?void 0:"")},children:[(0,_.jsx)(n.Fragment,{children:void 0===u?(0,_.jsxs)(n.Fragment,{children:[(0,_.jsx)("span",{className:"chevron",children:(0,_.jsx)(i.N_,{to:m,onClick:w,children:(0,_.jsx)(d.In,{icon:"home"})})}),h.map((e,t)=>j>0&&t>=1&&t<G?1!==t?null:(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)("span",{className:"breadcrumbs-fold-dot",onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();S({x:t.left,y:t.bottom})},children:"..."})]},"fold"):(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)(i.N_,{to:e.href,onClick:w,children:decodeURIComponent(e.value)})]},t)),(0,_.jsxs)("div",{className:"breadcrumbs-measure",ref:A,"aria-hidden":!0,children:[(0,_.jsx)("span",{className:"chevron",children:(0,_.jsx)(i.N_,{to:m,children:(0,_.jsx)(d.In,{icon:"home"})})}),h.map((e,t)=>(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)(i.N_,{to:e.href,children:decodeURIComponent(e.value)})]},t))]})]}):(0,_.jsx)(r.QM,{click:()=>{x(void 0)},children:(0,_.jsx)(o.Sm,{width:"100%",placeholder:g("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),x(void 0)}})})}),C&&(0,_.jsx)(r.rY,{click:()=>S(null),children:(0,_.jsx)(r.sw,{x:C.x,y:C.y,items:N.map(e=>({r:decodeURIComponent(e.value),v:e.href})),click:e=>{S(null),s(e)}})})]})}},22136(e,t,s){s.r(t),s.d(t,{default:()=>ee});var n=s(96540),i=s(47374),a=s(34843),l=s(52035),o=s(82893),r=s(14284),c=s(52671),d=s(4412),_=s(78150),h=s(34289),p=s(53459),m=s(99214),f=s(61443),u=s(32768),x=s(62042),g=s(22022),v=s(7523),w=s(78247),j=s(88815),y=s(6960),k=s(47071),A=s(14944),b=s(92275),G=s(23430),N=s(72458),C=s(34251),S=s(60096),I=s(87361),M=s(59096),$=s(85997),z=s(23496),E=s(74848);function P(e){const{t}=(0,g.Bd)(),[s,i]=(0,n.useState)([]),[a,l]=(0,n.useState)(!1),[o,c]=(0,n.useState)(""),[d,_]=(0,n.useState)(""),h=t=>{const s=e.base_path.endsWith("/")?e.base_path:e.base_path+"/",n=t.type===u.Iw.folder?s+t.name:t.path??s+t.name;return n.startsWith("/")?n:"/"+n};(0,n.useEffect)(()=>{(async()=>{if(a)return;l(!0);const t=await r.$M.post("file_get_page",{param_path:e.base_path,page_num:1,page_size:1e4});if(t?.code!==p.m.Success)return;const s=t.data.files??[],n=s.filter(e=>e.type===u.Iw.folder).sort((e,t)=>e.name.localeCompare(t.name)),o=s.filter(e=>e.type!==u.Iw.folder).sort((e,t)=>e.name.localeCompare(t.name));i([...n,...o])})()},[]);const m=(0,n.useMemo)(()=>{const e=o.trim().toLowerCase();return e?s.filter(t=>t.name.toLowerCase().includes(e)):s},[s,o]),x=()=>{const t=d.trim();t&&!e.ignore_names.includes(t)&&(e.on_change_names([...e.ignore_names,t]),_(""))};return(0,E.jsxs)("div",{className:"search-exclude",children:[(0,E.jsxs)("div",{className:"search-exclude__section",children:[(0,E.jsx)("div",{className:"search-exclude__title",children:t("排除当前目录下的项")}),(0,E.jsx)(f.$Z,{icon:"search",value:o,placeholder:t("过滤列表"),handleInputChange:e=>c(e),handleEnterPress:()=>{}}),(0,E.jsxs)("div",{className:"search-exclude__list",children:[0===m.length&&(0,E.jsx)("div",{className:"search-exclude__empty",children:t(a?"无匹配":"加载中")}),m.map(t=>{const s=h(t),n=e.exclude_paths.includes(s),i=t.type===u.Iw.folder;return(0,E.jsxs)("label",{className:"search-exclude__item",children:[(0,E.jsx)("input",{type:"checkbox",checked:n,onChange:()=>(t=>{const s=h(t),n=e.exclude_paths.includes(s);e.on_change_paths(n?e.exclude_paths.filter(e=>e!==s):[...e.exclude_paths,s])})(t)}),(0,E.jsx)("span",{className:"material-symbols-outlined"+(i?" search-exclude__icon--dir":""),children:i?"folder":"draft"}),(0,E.jsx)("span",{className:"search-exclude__item-name",title:t.name,children:t.name})]},s)})]}),e.exclude_paths.length>0&&(0,E.jsx)("div",{className:"search-exclude__chosen",children:e.exclude_paths.map(t=>(0,E.jsxs)("span",{className:"search-exclude__tag",children:[t.split("/").filter(Boolean).pop(),(0,E.jsx)("span",{className:"material-symbols-outlined",onClick:()=>e.on_change_paths(e.exclude_paths.filter(e=>e!==t)),children:"close"})]},t))})]}),(0,E.jsxs)("div",{className:"search-exclude__section search-exclude__section--ignore",children:[(0,E.jsx)("div",{className:"search-exclude__title",children:t("忽略名字")}),(0,E.jsx)("div",{className:"search-exclude__hint",children:t("按名字忽略")}),(0,E.jsxs)("div",{className:"search-exclude__chosen",children:[0===e.ignore_names.length&&(0,E.jsx)("span",{className:"search-exclude__hint",children:t("暂无")}),e.ignore_names.map(t=>(0,E.jsxs)("span",{className:"search-exclude__tag",children:[t,(0,E.jsx)("span",{className:"material-symbols-outlined",onClick:()=>(t=>{e.on_change_names(e.ignore_names.filter(e=>e!==t))})(t),children:"close"})]},t))]}),(0,E.jsxs)("div",{className:"search-exclude__add",children:[(0,E.jsx)(f.Sm,{value:d,placeholder:t("如 node_modules"),handleInputChange:e=>_(e),handlerEnter:x,width:"12em"}),(0,E.jsx)($.rA,{icon:"add",title:t("添加"),onClick:x})]}),(0,E.jsxs)("div",{className:"div-row",children:[(0,E.jsx)($.rA,{icon:"save",title:t("保存忽略名字"),onClick:async()=>{await r.wm.post(z.s.user_save_private_attr,{is_search_exclude:!0,search_exclude_names:e.ignore_names})}}),(0,E.jsx)($.rA,{icon:"settings",title:t("忽略名字设置"),onClick:e.on_open_setting})]})]})]})}function F(e){const{t}=(0,g.Bd)(),{initUserInfo:s}=(0,n.useContext)(v.F),[i]=(0,a.fp)(o.AG.user_base_info),l=i?.user_data?.search_exclude_names,[c,d]=(0,n.useState)(Array.isArray(l)?[...l]:[]),[_,h]=(0,n.useState)(""),[m,u]=(0,n.useState)(!1),x=()=>{const e=_.trim();e&&!c.includes(e)&&(d([...c,e]),h(""))};return(0,E.jsxs)("div",{className:"search-ignore-setting",children:[(0,E.jsx)("div",{className:"search-ignore-setting__desc",children:t("按名字忽略说明")}),(0,E.jsxs)("div",{className:"search-ignore-setting__add",children:[(0,E.jsx)(f.Sm,{value:_,placeholder:t("如 node_modules"),handleInputChange:e=>h(e),handlerEnter:x,width:"20em"}),(0,E.jsx)($.rA,{icon:"add",title:t("添加"),onClick:x})]}),(0,E.jsxs)("div",{className:"search-ignore-setting__list",children:[0===c.length&&(0,E.jsx)("div",{className:"search-ignore-setting__empty",children:t("暂无")}),c.map(e=>(0,E.jsxs)("div",{className:"search-ignore-setting__item",children:[(0,E.jsx)("span",{className:"material-symbols-outlined",children:"block"}),(0,E.jsx)("span",{className:"search-ignore-setting__item-name",children:e}),(0,E.jsx)($.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>d(c.filter(t=>t!==e)))(e)})]},e))]}),(0,E.jsxs)("div",{className:"div-row div-row--end search-ignore-setting__footer",children:[(0,E.jsx)($.rA,{icon:"arrow_back",title:t("返回"),onClick:e.on_back}),(0,E.jsx)($.rA,{icon:"save",title:t("保存"),onClick:async()=>{if(m)return;u(!0);const t=await r.wm.post(z.s.user_save_private_attr,{is_search_exclude:!0,search_exclude_names:c});u(!1),t?.code===p.m.Success&&(await s(),e.on_back())}})]})]})}const R=500;function X(e){const{t}=(0,g.Bd)(),s=(0,c.Zp)(),[,i]=(0,a.fp)(o.AG.prompt_card),[l]=(0,a.fp)(o.AG.user_base_info),{click_file:r}=(0,m.kZ)(),[d,_]=(0,n.useState)(""),[h,p]=(0,n.useState)("name"),[u,x]=(0,n.useState)(!1),[v,w]=(0,n.useState)(!1),[j,y]=(0,n.useState)(!0),[k,G]=(0,n.useState)([]),[N,C]=(0,n.useState)([]),[S,z]=(0,n.useState)(!1),[X,K]=(0,n.useState)(!1),[L,D]=(0,n.useState)(!1),[U,H]=(0,n.useState)([]),[B,Z]=(0,n.useState)(0),[Y,O]=(0,n.useState)(!1),W=(0,n.useRef)(!1),T=(0,n.useMemo)(()=>new M.I((0,A.s)(),"file_deep_search"),[]),q=(0,n.useRef)(!1),V=(0,n.useRef)(!1),J=decodeURIComponent(e.base_path),Q=()=>i({open:!1}),ee=()=>{const e=l?.user_data?.search_exclude_names;return Array.isArray(e)?e:[]};(0,n.useEffect)(()=>{C(ee())},[l?.user_data?.search_exclude_names]),(0,n.useEffect)(()=>{let e=[],t=null;const s=()=>{if(t=null,q.current||V.current||!e.length)return;const s=e;e=[],Z(e=>e+s.length),H(e=>e.length>=R?e:[...e,...s].slice(0,R))},n=()=>{q.current||D(!1)};return T.addMsg(b.HK.file_deep_search_data,n=>{q.current||V.current||(e.push(...n.context??[]),null===t&&(t=setTimeout(s,100)))}),T.addMsg(b.HK.file_deep_search_end,()=>{q.current||V.current||(s(),D(!1))}),T.on_message("close",n),()=>{q.current=!0,clearTimeout(t),W.current&&T.sendNotify(b.HK.file_deep_search_cancel,{}).catch(()=>{}).finally(()=>T.close()),T.removeMsg(b.HK.file_deep_search_data),T.removeMsg(b.HK.file_deep_search_end),T.off_message("close",n)}},[]);const te=()=>{const t=d.trim();if(!t||L)return;V.current=!1,H([]),Z(0),O(!0),W.current=!0,D(!0);const s={param_path:e.base_path,keyword:t,search_type:h,is_regex:u,ignore_case:v};"content"===h&&(s.show_match_line=j),k.length&&(s.exclude_paths=k),N.length&&(s.exclude_names=N),T.sendData(b.HK.file_deep_search,s).catch(()=>{})},se=e=>{let t=e.is_dir?e.path:e.path.slice(0,e.path.lastIndexOf("/")+1);t.endsWith("/")||(t+="/"),Q(),s(I.o.file+t.split("/").map(encodeURIComponent).join("/"))},ne=async e=>{if(e.is_dir)return se(e);const t=e.path.slice(0,e.path.lastIndexOf("/")+1)||"/";Q(),s(I.o.file+t.split("/").map(encodeURIComponent).join("/")),await new Promise(e=>setTimeout(e,300)),await r({name:e.name,opt_shell:!0})},ie="content"===h;return X?(0,E.jsx)(F,{on_back:()=>{K(!1),C(ee())}}):(0,E.jsxs)("div",{className:"file-deep-search",children:[(0,E.jsxs)("div",{className:"file-deep-search__bar",children:[(0,E.jsx)(f.$Z,{icon:"search",value:d,placeholder:t(ie?"搜文件内容":"搜文件名"),handleInputChange:e=>_(e),handleEnterPress:te}),(0,E.jsx)("button",{className:"button button--flat",onClick:L?()=>{V.current=!0,T.sendNotify(b.HK.file_deep_search_cancel,{}).catch(()=>{}),D(!1)}:te,children:t(L?"取消":"搜索")}),(0,E.jsx)($.rA,{icon:"close",title:t("关闭"),onClick:Q})]}),(0,E.jsxs)("div",{className:"file-deep-search__tabs",children:[(0,E.jsx)("button",{className:"file-deep-search__tab"+(ie?"":" file-deep-search__tab--active"),onClick:()=>p("name"),children:t("文件名")}),(0,E.jsx)("button",{className:"file-deep-search__tab"+(ie?" file-deep-search__tab--active":""),onClick:()=>p("content"),children:t("文件内容")})]}),(0,E.jsxs)("div",{className:"file-deep-search__options",children:[(0,E.jsx)(f.GL,{context:t("正则"),selected:u,onchange:()=>x(!u)}),(0,E.jsx)(f.GL,{context:t("忽略大小写"),selected:v,onchange:()=>w(!v)}),ie&&(0,E.jsx)(f.GL,{context:t("显示匹配行"),selected:j,onchange:()=>y(!j)})]}),(0,E.jsxs)("div",{className:"file-deep-search__hint",children:[(0,E.jsxs)("span",{children:[t("范围"),":",J]}),(0,E.jsxs)("span",{className:"file-deep-search__hint-right",children:[(k.length>0||N.length>0)&&(0,E.jsxs)("span",{className:"file-deep-search__excluded",children:[t("已排除")," ",k.length+N.length]}),(0,E.jsxs)("button",{className:"file-deep-search__filter"+(S?" file-deep-search__filter--active":""),onClick:()=>z(!S),children:[(0,E.jsx)("span",{className:"material-symbols-outlined",children:"filter_alt"}),t("过滤")]}),B>0&&(0,E.jsx)("span",{className:"file-deep-search__count",children:B>R?`${t("已显示")} 500 / ${B}`:`${B}`})]})]}),S&&(0,E.jsx)(P,{base_path:e.base_path,exclude_paths:k,ignore_names:N,on_change_paths:G,on_change_names:C,on_open_setting:()=>K(!0)}),(0,E.jsxs)("div",{className:"file-deep-search__body"+(ie&&j?" file-deep-search__body--line":""),children:[U.length>0&&(0,E.jsx)("div",{className:"file-deep-search__results",children:U.map(e=>{const s=e.path.slice(0,e.path.lastIndexOf("/")+1);return(0,E.jsxs)("div",{className:"file-deep-search__row",children:[(0,E.jsxs)("div",{className:"file-deep-search__name",children:[e.is_dir?(0,E.jsx)("span",{className:"file-deep-search__dir",children:e.name}):(0,E.jsx)("span",{className:"file-deep-search__file",title:e.name,children:e.name}),(0,E.jsx)("span",{className:"file-deep-search__path",children:s}),e.lines&&e.lines.length>0&&(0,E.jsx)("div",{className:"file-deep-search__lines",children:e.lines.map(t=>(0,E.jsxs)("div",{className:"file-deep-search__line",onClick:()=>ne(e),children:[(0,E.jsx)("span",{className:"file-deep-search__line-no",children:t.line}),(0,E.jsx)("span",{className:"file-deep-search__line-text",children:t.text})]},t.line))})]}),(0,E.jsxs)("div",{className:"file-deep-search__actions",children:[(0,E.jsx)($.rA,{icon:"open_in_new",title:e.is_dir?t("打开"):t("打开文件"),onClick:()=>ne(e)}),(0,E.jsx)($.rA,{icon:"folder_open",title:t("打开所在目录"),onClick:()=>se(e)})]})]},e.path)})}),L&&(0,E.jsxs)("div",{className:"file-deep-search__empty",children:[(0,E.jsx)("span",{className:"chat-session-running",title:t("搜索中")}),t("搜索中")]}),!L&&B>R&&(0,E.jsx)("div",{className:"file-deep-search__more",children:t("结果过多")}),!L&&0===U.length&&(0,E.jsx)("div",{className:"file-deep-search__empty",children:t(Y?"无匹配":ie?"输入内容后搜":"输入后搜")})]})]})}var K=s(64694),L=s(12730),D=s(75725),U=s(7572),H=s(40505);let B={};function Z(){const{t:e}=(0,g.Bd)();let t=(0,c.zy)();const s=(0,c.Zp)(),{check_user_auth:i}=(0,w.MH)(),[l,d]=(0,a.fp)(o.AG.nowFileList),[p,f]=(0,a.fp)(o.AG.uploadFiles),[j,y]=(0,a.fp)(o.AG.showPrompt),[k,N]=(0,a.fp)(o.AG.selectedFileList),[S,M]=(0,a.fp)(o.AG.copyedFileList),[z,P]=(0,a.fp)(o.AG.cutedFileList),[F,R]=(0,a.fp)(o.AG.selectedFileList),[X,H]=(0,a.fp)(o.AG.clickFileList),[Z,Y]=(0,a.fp)(o.AG.fileShellShow),O=(0,m.Cf)(),[W,T]=(0,a.fp)(o.AG.file_root_list),[q,V]=(0,a.fp)(o.AG.file_root_index),[J,Q]=(0,n.useState)(void 0),[ee,te]=(0,n.useState)(""),[se,ne]=(0,a.fp)(o.AG.workflow_show),[ie,ae]=(0,a.fp)(o.AG.workflow_realtime_show),[le,oe]=(0,a.fp)(o.AG.work_flow_show),{initUserInfo:re}=(0,n.useContext)(v.F),[ce,de]=(0,a.fp)(o.AG.user_base_info),{click_file:_e}=(0,m.kZ)(),[he,pe]=(0,a.fp)(o.AG.prompt_card),me=(0,n.useMemo)(()=>l.files.reduce((e,t)=>e+(t.type!==u.Iw.folder?1:0),0),[l]),fe=(0,n.useMemo)(()=>l.files.reduce((e,t)=>e+(t.type===u.Iw.folder?1:0),0)+(l.folders?.length??0),[l]);function ue(e){(0,x.SK)(e)}(0,n.useEffect)(()=>{B={}},[t]),(0,n.useEffect)(()=>()=>{Y({show:!1,path:""})},[]);const xe=(0,m.Vs)(),ge=t=>{pe({open:!0,title:e("信息"),context_div:(0,E.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,E.jsx)(D.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,E.jsx)(D.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,E.jsx)(D.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,E.jsx)(D.Yh,{left:`${e("文件夹数")}`,right:fe}),(0,E.jsx)(D.Yh,{left:`${e("文件数")}`,right:me}),(0,E.jsx)(D.Yh,{left:`${e("当前位置")}`,right:(0,E.jsx)(U.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{A.ws.removeMsg(b.HK.file_info)}})};return(0,E.jsxs)(n.Fragment,{children:[k.length>0&&(0,E.jsx)($.rA,{icon:"delete",title:e("删除"),onClick:()=>{y({show:!0,type:_.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),k.length>0&&(0,E.jsx)($.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,m.ib)(l,k);M(e.map(e=>(0,m.Ok)(e.name))),P([]),ue("已复制")}}),k.length>0&&(0,E.jsx)($.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,m.ib)(l,k);P(e.map(e=>(0,m.Ok)(e.name))),M([]),ue("已剪切")}}),(S.length>0||z.length>0)&&(0,E.jsx)($.rA,{onClick:function(){y({show:!0,type:_.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:S.length+z.length}),k.length>0&&(0,E.jsx)($.rA,{icon:"download",title:e("下载"),onClick:function(){const e=(0,m.ib)(l,k);for(let t=0;t<e.length;t++){const s=e[t];e[t]=encodeURIComponent((0,m.Ok)(s.name))}const t=r.$M.getDownloadUrl(e);window.open(t)}}),k.length>0&&(0,E.jsx)($.rA,{icon:"compress",title:e("压缩"),onClick:function(){const t=(0,m.ib)(l,k);for(let e=0;e<t.length;e++){const s=t[e];t[e]=(0,m.Ok)(s.name)}t&&0!==t.length?y({show:!0,type:_.PromptEnum.Compress,overlay:!0,data:{files:t}}):(0,x.zN)(e("没有选中"))}}),1===k.length&&(0,E.jsx)($.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){y({show:!0,type:_.PromptEnum.FileRename,overlay:!0,data:{}})}}),le&&(0,E.jsx)($.rA,{icon:"api",title:"workflow",onClick:()=>{ne(!se)}}),O.can_terminal&&(0,E.jsx)($.rA,{icon:"terminal",title:"shell",onClick:function(){Z.show?Y({show:!1,path:""}):Y({show:!0,path:(0,h.GG)("file",(0,h.vX)())})}}),i(G.oV.share_file)&&(0,E.jsx)($.rA,{icon:"share",title:e("文件分享"),onClick:()=>{s(`${I.o.share_list_setting_page}`)}}),(0,E.jsx)($.rA,{icon:"grid_view",title:e("切换样式"),onClick:xe}),(0,E.jsx)($.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){y({show:!0,type:_.PromptEnum.DirNew,overlay:!0,data:{dir:(0,h.GG)("file",(0,h.vX)())}})}}),(0,E.jsx)($.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){y({show:!0,type:_.PromptEnum.FileNew,overlay:!0,data:{dir:(0,h.GG)("file",(0,h.vX)())}})}}),(0,E.jsx)($.rA,{icon:"upload_file",title:e("上传"),onClick:()=>{y({show:!0,type:_.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let s=!!t[0].webkitRelativePath;const n=[],i=new Set;for(let e=0;e<t.length;e++){const a=t[e],l=s?a.webkitRelativePath:`${a.webkitRelativePath}${a.name}`;a.fullPath=l,s&&i.add((0,L.S)(l)),n.push(a)}const a=[];if(s)for(const e of i)a.push({isDir:!0,fullPath:e,name:e});a.push(...n),f(a),y({show:!0,type:_.PromptEnum.FilesUpload,overlay:!1,data:{}})}}})}}),(0,E.jsx)($.rA,{icon:"info",title:e("信息"),onClick:async()=>{let e;if(!B.now_absolute_path){A.ws.addMsg(b.HK.file_info,t=>{const s=t.context;e&&(B={...B,...s},A.ws.removeMsg(b.HK.file_info),ge(B))});const t=await A.ws.sendData(b.HK.file_info,{type:u.Iw.folder,path:(0,h.GG)("file",(0,h.vX)())});e=t.context,B=e,ge(B)}ge(B)}}),(0,E.jsx)($.rA,{icon:"more_vert",title:e("切换目录"),onClick:t=>{const n=new C.ik;n.x=t.clientX,n.y=t.clientY,n.type=u.Iw.directory,n.items=W,n.item_pre_value=q,n.textClick=async t=>{if(t.type===C.LU.add)return s(`${I.o.setting_private_env_setting}`),y({data:void 0,overlay:!1,type:"",show:!1}),void(0,x.N9)(e("请配置 文件夹路径"));y({data:void 0,overlay:!1,type:"",show:!1}),t.type!==C.LU.child?(async e=>{V(e),await r.$M.post("base_switch",{root_index:e}),await re(),s("/file/"),R([]),H([])})(t.index):s((0,K.IO)(I.o.file,t.rel))},y({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:n})}})]})}var Y=s(32918),O=s(2543),W=s(21499);const T=n.lazy(()=>Promise.all([s.e(7856),s.e(6349),s.e(3659)]).then(s.bind(s,63659))),q=n.lazy(()=>Promise.all([s.e(7856),s.e(1636)]).then(s.bind(s,81636))),V=n.lazy(()=>Promise.all([s.e(3277),s.e(9345)]).then(s.bind(s,49345)));let J,Q="";function ee(){const[e,t]=(0,a.fp)(o.AG.editorSetting),[,s]=(0,a.fp)(o.AG.md_editor),[,x]=(0,a.fp)(o.AG.log_viewer),[,M]=(0,a.fp)(o.AG.image_editor),[,P]=(0,a.fp)(o.AG.markdown),[,F]=(0,a.fp)(o.AG.excalidraw_editor),[,R]=(0,a.fp)(o.AG.mind_editor),[,L]=(0,a.fp)(o.AG.timeline_editor),[,D]=(0,a.fp)(o.AG.excel_editor),[,U]=(0,a.fp)(o.AG.docx_editor),[,B]=(0,a.fp)(o.AG.pptx_editor),[ee,te]=(0,a.fp)(o.AG.file_preview),{t:se}=(0,g.Bd)();let ne=(0,c.zy)();const ie=(0,c.Zp)(),[ae,le]=(0,a.fp)(o.AG.nowFileList),[oe]=(0,a.fp)(o.AG.file_list_refresh),[re,ce]=(0,a.fp)(o.AG.current_mount),[de,_e]=(0,a.fp)(o.AG.showPrompt),[he,pe]=(0,a.fp)(o.AG.selectedFileList),[me,fe]=(0,a.fp)(o.AG.clickFileList),[ue,xe]=(0,a.fp)(o.AG.fileShellShow),[ge,ve]=(0,n.useState)(""),[we,je]=(0,a.fp)(o.AG.workflow_show),[ye,ke]=(0,a.fp)(o.AG.workflow_realtime_show),[Ae,be]=(0,a.fp)(o.AG.work_flow_show),[Ge,Ne]=(0,n.useState)(!1),{initUserInfo:Ce}=(0,n.useContext)(v.F),[Se,Ie]=(0,a.fp)(o.AG.user_base_info),{check_user_auth:Me}=(0,w.MH)(),{click_file:$e}=(0,m.kZ)(),[ze]=(0,c.ok)(),Ee=(0,m._A)(),Pe=n.useRef(null),[Fe,Re]=(0,a.fp)(o.AG.to_running_files),[Xe,Ke]=(0,a.fp)(o.AG.file_page),[Le]=(0,a.fp)(o.AG.blank_search_mode),[,De]=(0,a.fp)(o.AG.prompt_card),[Ue,He]=(0,a.fp)(o.AG.blank_search_mode_for_temp),Be=(0,m.oT)(),Ze="1"===ze.get("chat_open"),Ye=Me(G.oV.ai_agent_page),Oe=(0,m.Cf)();(0,n.useEffect)(()=>{Se?.user_data&&Ze&&!Ye&&Be("chat_open",null)},[Ze,Ye,Se]);const[We,Te]=(0,a.fp)(o.AG.studio_chat_width),qe=n.useRef(null),[Ve,Je]=(0,n.useState)(!1),[Qe,et]=(0,n.useState)(void 0),tt=(0,m.dN)();(0,m.rJ)(tt());const[st,nt]=(0,a.fp)(o.AG.ai_chat_session_by_cwd),it=function(){const e=(0,m.Cf)(),[t,s]=(0,a.fp)(o.AG.user_base_info),{t:i}=(0,g.Bd)(),{check_user_auth:l}=(0,w.MH)(),[d,p]=(0,a.fp)(o.AG.router_jump),f=(0,c.Zp)(),{initUserInfo:x}=(0,n.useContext)(v.F),[j,y]=(0,a.fp)(o.AG.nowFileList),[k,N]=(0,a.fp)(o.AG.showPrompt),[S,M]=(0,a.fp)(o.AG.fileShellShow),[$,P]=(0,a.fp)(o.AG.blank_search_mode);return s=>{s.preventDefault(),s.stopPropagation();const n=new C.ik;n.x=s.clientX,n.y=s.clientY,n.type=u.Iw.directory;const a=[{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===G.t8.time_minx_max),children:i("时间逆序")}),v:G.t8.time_minx_max},{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===G.t8.time_max_min),children:i("时间顺序")}),v:G.t8.time_max_min}],o=[{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===G.t8.size_min_max),children:i("大小顺序")}),v:G.t8.size_min_max},{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===G.t8.size_max_min),children:i("大小逆序")}),v:G.t8.size_max_min}],c=[{r:(0,E.jsx)("span",{style:(0,H.ok)(!t.user_data.file_list_pagination_mode||t.user_data.file_list_pagination_mode===G.yM.all),children:i("全部加载文件")}),v:G.yM.all},{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.file_list_pagination_mode===G.yM.pagination),children:i("scrll_l")}),v:G.yM.pagination}],d=[{r:(0,E.jsx)("span",{style:(0,H.ok)(!t.user_data.file_time_show_type||t.user_data.file_time_show_type===G.KD.current),children:i("最近时间")}),v:G.KD.current},{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.file_time_show_type===G.KD.time),children:i("准确时间")}),v:G.KD.time}],g=[{r:i("文件列表展示"),items:[{r:i("文件排序"),v:"",items:[{r:(0,E.jsx)("span",{style:(0,H.ok)(!t.user_data.dir_show_type),children:i("系统默认")}),v:G.t8.defualt},{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===G.t8.name),children:i("名字")}),v:G.t8.name},{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===G.t8.time_minx_max||t.user_data.dir_show_type===G.t8.time_max_min),children:i("修改时间")}),v:!1,items:a},{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===G.t8.size_min_max||t.user_data.dir_show_type===G.t8.size_max_min),children:i("文件大小")}),v:!1,items:o}]},{r:i("文件加载方式"),v:"",items:c},{r:i("时间展示"),v:"",items:d},{r:i("缩放调整"),v:"zoom_adjust"},{r:(0,E.jsx)("span",{style:(0,H.ok)($),children:i("srchbln")}),v:"blank_search_mode"}]}];e.git_available&&j?.folders?.find(e=>".git"===e.name)&&g.push({r:i("查看Git提交"),v:"git_page"}),g.push({r:i("o_stdo"),v:"studio_page"}),l(G.oV.http_proxy)&&g.push({r:i("dl_here"),v:"http_resource"}),t?.user_data?.quick_cmd&&(0,m.LL)([...t.user_data.quick_cmd],g),n.items=g,n.textClick=async e=>{if(console.log(e),!1===e)return;const t={};if("gcfg_dir_config"===e){const e=(0,h.GG)("file",(0,h.vX)());return N({data:void 0,overlay:!1,type:"",show:!1}),void f(`${I.o.gcfg_page}/${encodeURIComponent(e)}`)}if("git_page"===e){const e=(0,h.GG)("file",(0,h.vX)());return N({data:void 0,overlay:!1,type:"",show:!1}),void f(`${I.o.git_page}/${encodeURIComponent(e)}`)}if("studio_page"===e){const e=(0,h.GG)("file",(0,h.vX)());return N({data:void 0,overlay:!1,type:"",show:!1}),void f(`${I.o.studio_page}/${encodeURIComponent(`/file/${e}`)}`)}if("http_resource"===e){const e=await A.ws.sendData(b.HK.file_info,{path:(0,h.GG)("file",(0,h.vX)())});return p({http_download_map_path:e.context.now_absolute_path}),N({data:void 0,overlay:!1,type:"",show:!1}),void f("/proxy/http/")}if("zoom_adjust"===e)return N({data:void 0,overlay:!1,type:"",show:!1}),void setTimeout(()=>{N({show:!0,type:_.PromptEnum.ZoomAdjust,overlay:!1,data:{}})},0);if("object"==typeof e&&"quick_cmd"===e.tag){let t=e.cmd;t&&(t.endsWith("\r")||(t+="\r",M({show:!0,path:(0,h.GG)("file",(0,h.vX)()),cmd:t})))}else{if("blank_search_mode"===e)return P(!$),void N({data:void 0,overlay:!1,type:"",show:!1});if(e===G.yM.all||e===G.yM.pagination)t.is_pagination_mode=!0;else if(e===G.KD.current||e===G.KD.time)t.is_file_show_type=!0;else{if(e!==G.t8.defualt&&e!==G.t8.name&&e!==G.t8.size_max_min&&e!==G.t8.size_min_max&&e!==G.t8.time_max_min&&e!==G.t8.time_minx_max)return;t.is_dir_list_type=!0}}await r.wm.post(z.s.user_save_private_attr,{type:e,...t}),await x(),N({data:void 0,overlay:!1,type:"",show:!1}),f((0,h.vX)())},N({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:n})}}(),at=async e=>{let t=!1;for(const s of e.files??[])s.origin_size=s.size,s.size=(0,j.v7)(s.size),Se.user_data.file_time_show_type===G.KD.time?s.show_mtime=s.mtime?(0,W.Yq)(s.mtime):"":s.show_mtime=s.mtime?(0,y.s)(s.mtime):"",t||!s.name.endsWith(".workflow.yml")&&!s.name.endsWith(".act")||Ne(!0),s.name===k.SB&&(t=!0);for(const s of e.folders??[])Se.user_data.file_time_show_type===G.KD.time?s.show_mtime=s.mtime?(0,W.Yq)(s.mtime):"":s.show_mtime=s.mtime?(0,y.s)(s.mtime):"",s.name===k.SB&&(t=!0);be(t)},lt=async e=>{ce(e??null)};(0,n.useEffect)(()=>{Ge&&(async()=>{const e=new k.Nd,t=(0,l.zp)().get(o.AG.current_mount);e.dir_path=(0,m.Zl)((0,h.GG)("file",(0,h.vX)()),t),A.ws.removeMsg(b.HK.workflow_realtime),A.ws.addMsg(b.HK.workflow_realtime,e=>{const t=e.context;if(e.context){for(const e of t.sucess_file_list)(0,m.Ys)(e);for(const e of t.failed_file_list)(0,m.V$)(e);Re(new Set(t.running_file_list))}}),await A.ws.sendData(b.HK.workflow_realtime,e)})()},[Ae,Ge,re,ne]);const ot=async()=>{const e=(0,h.GG)("file",(0,h.vX)());if(Le||Ue)return;let t;if(Se.user_data.file_list_pagination_mode===G.yM.pagination){if(Q!==e){if(Q=e,1!==Xe.page_num)return void Ke({page_size:Xe.page_size,page_num:1})}else if(Xe.page_num<0)return;if(t=await r.$M.post("file_get_page",{param_path:e,page_num:Xe.page_num,page_size:Xe.page_size}),t.code!==p.m.Success)return;const s=t.data;return at(s),lt(s.mount_info),s.files?.length?(le(e=>{const t=(0,O.cloneDeep)(1===Xe.page_num?s.files:[...e?.files??[],...s.files]),n={...e,files:t};return(0,m.yC)(n,Se.user_data.dir_show_type),n}),void(J=t.data)):void Ke({page_size:Xe.page_size,page_num:-1})}if(t=await r.$M.get(e),t.code!==p.m.Success)return;const s=t.data;(0,m.yC)(s,Se.user_data.dir_show_type),at(t.data),lt(s.mount_info),le(t.data),J=t.data};(0,n.useEffect)(()=>async()=>{Re(new Set),re&&await A.ws.close()},[]);const rt=()=>{be(!1),(()=>{const e=ze.get("preview_file_name"),t=ze.get("preview_mode");if(!e||!t)return!1;const n=(0,h.GG)("file",(0,h.vX)());if(Pe.current===n+e)return!0;Pe.current=n+e;const i=()=>Ee(null);return"md"===t?(s({url:r.$M.getDownloadUrl(`${encodeURIComponent(n)}${e}`),path:`${n}${e}`,name:e,close:i}),!0):"log"===t?(x({show:!0,fileName:e,encoding:ze.get("preview_log_enc")??"utf8",wrap:ze.get("preview_log_wrap")??"wrap",close:i}),!0):"image_edit"===t?(M({path:(0,K.IO)((0,h.vX)(),e),name:e,close:i}),!0):($e({name:e,opt_shell:!0,..."text"===t?{model:"text"}:{},close:i}),!0)})()||(t({open:!1}),te({open:!1}),s({}),x({show:!1}),M({}),P({}),F({}),R({}),L({}),D({}),U({}),B({}),ot())};(0,n.useEffect)(()=>{rt()},[ne,Xe]),(0,n.useEffect)(()=>{oe>0&&ot()},[oe]);n.useRef(!1);const ct=()=>{const e=(0,h.GG)("file",(0,h.vX)());De({open:!0,title:se("深搜"),context_div:(0,E.jsx)(X,{base_path:e})})},dt=e=>{e.target===e.currentTarget&&(pe([]),fe([]))},_t=n.useCallback((0,O.throttle)(e=>{const t=qe.current;if(!t||!t.parentElement)return;const s=parseFloat(getComputedStyle(t).fontSize),n=t.parentElement.getBoundingClientRect(),i=n.right-e.clientX,a=Math.min(Math.max(i,0),n.width);Te(parseFloat((a/s).toFixed(2)))},32),[]),ht=()=>{Je(!1),document.removeEventListener("pointermove",_t)},pt=(0,E.jsxs)("div",{className:"file-list-main",children:[(0,E.jsx)(i.e,{baseRoute:"file",clickFun:function(){if(pe([]),fe([]),Se.user_data.file_list_pagination_mode===G.yM.pagination){const e=document.getElementById("listing");e&&(e.scrollTop=0),Ke({page_size:Xe.page_size,page_num:1})}},input_path_enter:e=>{pe([]),fe([]),le({files:[],folders:[]}),(0,N.Z1)(e)?(e=e.replace((0,Y.m)(Se.user_data),""),ie(e)):ie((0,N.Jn)((0,h.vX)(),e))}}),re&&(0,E.jsxs)("div",{className:"mount-tip-bar",style:{borderLeftColor:re.color},children:[(0,E.jsx)("span",{className:"material-icons",style:{color:re.color},children:"cloud"}),(0,E.jsx)("span",{children:[{v:re.driver,t:se("驱动")},{v:re.credential_note,t:se("凭据")},{v:re.account_note,t:se("账号")}].filter(e=>Boolean(e.v)).map(e=>`${e.v}(${e.t})`).join(" - ")}),re.readonly&&(0,E.jsx)("span",{className:"mount-readonly-tag",children:se("只读")})]}),Se.user_data.file_list_pagination_mode===G.yM.pagination?(0,E.jsx)(S.$J,{handleContextMenu:it,clickBlank:dt,list:ae.files}):(0,E.jsx)(S.t$,{handleContextMenu:it,file_list:ae.files,folder_list:ae.folders,clickBlank:dt})]});return(0,E.jsxs)(n.Fragment,{children:[(0,E.jsxs)(d.aZ,{children:[(0,E.jsx)("div",{className:"mobile-deep-search-btn",children:(0,E.jsx)($.rA,{icon:"search",title:se("搜索"),onClick:ct})}),(0,E.jsx)(f.$Z,{handleEnterPress:async()=>{if(Le||Ue){if(pe([]),fe([]),!ge||!ge.trim())return void le({files:[],folders:[]});const e=(0,h.GG)("file",(0,h.vX)()),t=await r.$M.post("file_get_page",{param_path:e,page_num:1,page_size:1e4,search:ge.trim()});if(t.code!==p.m.Success)return;const s=t.data;return(0,m.yC)(s,Se.user_data.dir_show_type),at(s),le(s),void(J=s)}if(!J)return;pe([]),fe([]);const e=[],t=[];for(const t of J.files??[])t.name.includes(ge)&&e.push(t);for(const e of J.folders??[])e.name.includes(ge)&&t.push(e);le({files:e,folders:t})},placeholder:se("搜索当前目录"),icon:"search",value:"",mobile_hidden:!0,handleIconClick:ct,handleInputChange:e=>{ve(e)},max_width:"25em"})]}),(0,E.jsxs)(d.aZ,{position:"right",children:[Me(G.oV.ai_agent_page)&&Oe.ai_chat_available&&(0,E.jsx)($.rA,{icon:"smart_toy",title:se("AI 聊天"),selected:Ze,onClick:()=>Be("chat_open",!Ze?"1":null)}),(0,E.jsx)("div",{className:"mobile-context-btn",children:(0,E.jsx)($.rA,{icon:"more_horiz",title:se("右键"),onClick:()=>{const e=he[he.length-1];if(void 0!==e){const t=[...ae.folders??[],...ae.files??[]][e];if(t){const s=document.querySelectorAll(".item")[e],n=s?s.getBoundingClientRect():{left:window.innerWidth/2,bottom:100},i={preventDefault:()=>{},stopPropagation:()=>{},clientX:n.left+10,clientY:n.bottom??100},a=new C.ik;a.path=(0,K.IO)((0,h.vX)(),t.name),a.filename=t.name,a.x=i.clientX,a.y=i.clientY,a.type=t.type===u.Iw.folder?u.Iw.folder:(0,C.uL)(t.name),a.size=t.origin_size,_e({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:a})}}else{const e={preventDefault:()=>{},stopPropagation:()=>{},clientX:window.innerWidth/2,clientY:window.innerHeight/2};it(e)}}})}),(0,E.jsx)(Z,{})]}),(0,E.jsxs)("div",{className:"file-list-split"+(Ze?" file-list-split--chat":""),children:[pt,Ze&&(0,E.jsxs)(n.Fragment,{children:[(0,E.jsx)("div",{className:"studio__divider studio__divider--chat",ref:qe,onPointerDown:e=>{e.preventDefault(),Je(!0),document.addEventListener("pointermove",_t),document.addEventListener("pointerup",ht,{once:!0})}}),(0,E.jsx)("div",{className:"studio-chat-panel",style:{width:`${We}em`},children:(0,E.jsx)(n.Suspense,{fallback:null,children:(0,E.jsx)(V,{inline_header:!0,sync_url:!1,file_cwd_path:tt(),session_id:Qe??(mt=tt(),o.AG.get_ai_chat_session(st,mt)),on_session_change:e=>{et(e),((e,t)=>{nt({...st,[e]:t})})(tt(),e)}})})})]})]}),Ve&&(0,E.jsx)("div",{className:"shell__overlay",onPointerUp:ht}),we&&(0,E.jsx)(T,{}),ye.open&&(0,E.jsx)(q,{})]});var mt}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2136],{47374(e,t,s){s.d(t,{e:()=>h});var n=s(96540),i=s(52671),a=s(64694),l=s(34289),o=s(61443),r=s(75725),c=s(22022),d=s(85997),_=s(74848);function h(e){let t=(0,i.zy)();const s=(0,i.Zp)(),[h,p]=(0,n.useState)([]),[m,f]=(0,n.useState)("/"),[u,x]=(0,n.useState)(void 0),{t:g,i18n:v}=(0,c.Bd)();n.useEffect(()=>{let t="",s=(0,l.vX)().split("/");s=s.filter(e=>e);const n=s.indexOf(e.baseRoute),i=[];if(-1!=n){t=(0,a.IO)(s.slice(0,n),e.baseRoute);const l=s.slice(n+1);for(let e=0;e<l.length;e++){const s=l[e];i.push({value:s,href:0===e?`${t}${s}/`:(0,a.IO)(i[e-1].href,s)})}f(t),p(i)}},[t]);const w=t=>{t.stopPropagation(),e.clickFun(t)},[j,y]=(0,n.useState)(0),k=(0,n.useRef)(null),A=(0,n.useRef)(null),b=()=>{const e=k.current,t=A.current;if(!e||!t)return;const s=[];for(const e of Array.from(t.children))s.push(e.getBoundingClientRect().width);const n=e.clientWidth;if(s.reduce((e,t)=>e+t,0)<=n||s.length<=2)return void y(e=>0===e?e:0);let i=s[0]+48,a=0;for(let e=s.length-1;e>=1&&!(i+s[e]>n);e--)i+=s[e],a++;const l=Math.max(s.length-1-a,0);y(e=>e===l?e:l)};(0,n.useEffect)(()=>{b();const e=new ResizeObserver(b);return k.current&&e.observe(k.current),()=>e.disconnect()},[h,m,t]),(0,n.useEffect)(()=>{const e=k.current;e&&0!==j&&e.scrollWidth>e.clientWidth&&j<h.length-1&&y(e=>e+1)});const G=j>0?1+j:1,N=j>0?h.slice(1,G):[],[C,S]=(0,n.useState)(null);return(0,n.useEffect)(()=>{S(null)},[t,j]),(0,_.jsxs)("div",{className:"breadcrumbs",ref:k,onClick:e=>{x(void 0!==u?void 0:"")},children:[(0,_.jsx)(n.Fragment,{children:void 0===u?(0,_.jsxs)(n.Fragment,{children:[(0,_.jsx)("span",{className:"chevron",children:(0,_.jsx)(i.N_,{to:m,onClick:w,children:(0,_.jsx)(d.In,{icon:"home"})})}),h.map((e,t)=>j>0&&t>=1&&t<G?1!==t?null:(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)("span",{className:"breadcrumbs-fold-dot",onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();S({x:t.left,y:t.bottom})},children:"..."})]},"fold"):(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)(i.N_,{to:e.href,onClick:w,children:decodeURIComponent(e.value)})]},t)),(0,_.jsxs)("div",{className:"breadcrumbs-measure",ref:A,"aria-hidden":!0,children:[(0,_.jsx)("span",{className:"chevron",children:(0,_.jsx)(i.N_,{to:m,children:(0,_.jsx)(d.In,{icon:"home"})})}),h.map((e,t)=>(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)(i.N_,{to:e.href,children:decodeURIComponent(e.value)})]},t))]})]}):(0,_.jsx)(r.QM,{click:()=>{x(void 0)},children:(0,_.jsx)(o.Sm,{width:"100%",placeholder:g("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),x(void 0)}})})}),C&&(0,_.jsx)(r.rY,{click:()=>S(null),children:(0,_.jsx)(r.sw,{x:C.x,y:C.y,items:N.map(e=>({r:decodeURIComponent(e.value),v:e.href})),click:e=>{S(null),s(e)}})})]})}},22136(e,t,s){s.r(t),s.d(t,{default:()=>ee});var n=s(96540),i=s(47374),a=s(34843),l=s(52035),o=s(82893),r=s(14284),c=s(52671),d=s(4412),_=s(78150),h=s(34289),p=s(53459),m=s(99214),f=s(61443),u=s(32768),x=s(62042),g=s(22022),v=s(7523),w=s(78247),j=s(88815),y=s(6960),k=s(47071),A=s(14944),b=s(92275),G=s(23430),N=s(72458),C=s(34251),S=s(60096),I=s(87361),M=s(59096),$=s(85997),z=s(23496),E=s(74848);function P(e){const{t}=(0,g.Bd)(),[s,i]=(0,n.useState)([]),[a,l]=(0,n.useState)(!1),[o,c]=(0,n.useState)(""),[d,_]=(0,n.useState)(""),h=t=>{const s=e.base_path.endsWith("/")?e.base_path:e.base_path+"/",n=t.type===u.Iw.folder?s+t.name:t.path??s+t.name;return n.startsWith("/")?n:"/"+n};(0,n.useEffect)(()=>{(async()=>{if(a)return;l(!0);const t=await r.$M.post("file_get_page",{param_path:e.base_path,page_num:1,page_size:1e4});if(t?.code!==p.m.Success)return;const s=t.data.files??[],n=s.filter(e=>e.type===u.Iw.folder).sort((e,t)=>e.name.localeCompare(t.name)),o=s.filter(e=>e.type!==u.Iw.folder).sort((e,t)=>e.name.localeCompare(t.name));i([...n,...o])})()},[]);const m=(0,n.useMemo)(()=>{const e=o.trim().toLowerCase();return e?s.filter(t=>t.name.toLowerCase().includes(e)):s},[s,o]),x=()=>{const t=d.trim();t&&!e.ignore_names.includes(t)&&(e.on_change_names([...e.ignore_names,t]),_(""))};return(0,E.jsxs)("div",{className:"search-exclude",children:[(0,E.jsxs)("div",{className:"search-exclude__section",children:[(0,E.jsx)("div",{className:"search-exclude__title",children:t("排除当前目录下的项")}),(0,E.jsx)(f.$Z,{icon:"search",value:o,placeholder:t("过滤列表"),handleInputChange:e=>c(e),handleEnterPress:()=>{}}),(0,E.jsxs)("div",{className:"search-exclude__list",children:[0===m.length&&(0,E.jsx)("div",{className:"search-exclude__empty",children:t(a?"无匹配":"加载中")}),m.map(t=>{const s=h(t),n=e.exclude_paths.includes(s),i=t.type===u.Iw.folder;return(0,E.jsxs)("label",{className:"search-exclude__item",children:[(0,E.jsx)("input",{type:"checkbox",checked:n,onChange:()=>(t=>{const s=h(t),n=e.exclude_paths.includes(s);e.on_change_paths(n?e.exclude_paths.filter(e=>e!==s):[...e.exclude_paths,s])})(t)}),(0,E.jsx)("span",{className:"material-symbols-outlined"+(i?" search-exclude__icon--dir":""),children:i?"folder":"draft"}),(0,E.jsx)("span",{className:"search-exclude__item-name",title:t.name,children:t.name})]},s)})]}),e.exclude_paths.length>0&&(0,E.jsx)("div",{className:"search-exclude__chosen",children:e.exclude_paths.map(t=>(0,E.jsxs)("span",{className:"search-exclude__tag",children:[t.split("/").filter(Boolean).pop(),(0,E.jsx)("span",{className:"material-symbols-outlined",onClick:()=>e.on_change_paths(e.exclude_paths.filter(e=>e!==t)),children:"close"})]},t))})]}),(0,E.jsxs)("div",{className:"search-exclude__section search-exclude__section--ignore",children:[(0,E.jsx)("div",{className:"search-exclude__title",children:t("忽略名字")}),(0,E.jsx)("div",{className:"search-exclude__hint",children:t("按名字忽略")}),(0,E.jsxs)("div",{className:"search-exclude__chosen",children:[0===e.ignore_names.length&&(0,E.jsx)("span",{className:"search-exclude__hint",children:t("暂无")}),e.ignore_names.map(t=>(0,E.jsxs)("span",{className:"search-exclude__tag",children:[t,(0,E.jsx)("span",{className:"material-symbols-outlined",onClick:()=>(t=>{e.on_change_names(e.ignore_names.filter(e=>e!==t))})(t),children:"close"})]},t))]}),(0,E.jsxs)("div",{className:"search-exclude__add",children:[(0,E.jsx)(f.Sm,{value:d,placeholder:t("如 node_modules"),handleInputChange:e=>_(e),handlerEnter:x,width:"12em"}),(0,E.jsx)($.rA,{icon:"add",title:t("添加"),onClick:x})]}),(0,E.jsxs)("div",{className:"div-row",children:[(0,E.jsx)($.rA,{icon:"save",title:t("保存忽略名字"),onClick:async()=>{await r.wm.post(z.s.user_save_private_attr,{is_search_exclude:!0,search_exclude_names:e.ignore_names})}}),(0,E.jsx)($.rA,{icon:"settings",title:t("忽略名字设置"),onClick:e.on_open_setting})]})]})]})}function F(e){const{t}=(0,g.Bd)(),{initUserInfo:s}=(0,n.useContext)(v.F),[i]=(0,a.fp)(o.AG.user_base_info),l=i?.user_data?.search_exclude_names,[c,d]=(0,n.useState)(Array.isArray(l)?[...l]:[]),[_,h]=(0,n.useState)(""),[m,u]=(0,n.useState)(!1),x=()=>{const e=_.trim();e&&!c.includes(e)&&(d([...c,e]),h(""))};return(0,E.jsxs)("div",{className:"search-ignore-setting",children:[(0,E.jsx)("div",{className:"search-ignore-setting__desc",children:t("按名字忽略说明")}),(0,E.jsxs)("div",{className:"search-ignore-setting__add",children:[(0,E.jsx)(f.Sm,{value:_,placeholder:t("如 node_modules"),handleInputChange:e=>h(e),handlerEnter:x,width:"20em"}),(0,E.jsx)($.rA,{icon:"add",title:t("添加"),onClick:x})]}),(0,E.jsxs)("div",{className:"search-ignore-setting__list",children:[0===c.length&&(0,E.jsx)("div",{className:"search-ignore-setting__empty",children:t("暂无")}),c.map(e=>(0,E.jsxs)("div",{className:"search-ignore-setting__item",children:[(0,E.jsx)("span",{className:"material-symbols-outlined",children:"block"}),(0,E.jsx)("span",{className:"search-ignore-setting__item-name",children:e}),(0,E.jsx)($.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>d(c.filter(t=>t!==e)))(e)})]},e))]}),(0,E.jsxs)("div",{className:"div-row div-row--end search-ignore-setting__footer",children:[(0,E.jsx)($.rA,{icon:"arrow_back",title:t("返回"),onClick:e.on_back}),(0,E.jsx)($.rA,{icon:"save",title:t("保存"),onClick:async()=>{if(m)return;u(!0);const t=await r.wm.post(z.s.user_save_private_attr,{is_search_exclude:!0,search_exclude_names:c});u(!1),t?.code===p.m.Success&&(await s(),e.on_back())}})]})]})}const R=500;function X(e){const{t}=(0,g.Bd)(),s=(0,c.Zp)(),[,i]=(0,a.fp)(o.AG.prompt_card),[l]=(0,a.fp)(o.AG.user_base_info),{click_file:r}=(0,m.kZ)(),[d,_]=(0,n.useState)(""),[h,p]=(0,n.useState)("name"),[u,x]=(0,n.useState)(!1),[v,w]=(0,n.useState)(!1),[j,y]=(0,n.useState)(!0),[k,G]=(0,n.useState)([]),[N,C]=(0,n.useState)([]),[S,z]=(0,n.useState)(!1),[X,K]=(0,n.useState)(!1),[L,D]=(0,n.useState)(!1),[U,H]=(0,n.useState)([]),[B,Z]=(0,n.useState)(0),[Y,O]=(0,n.useState)(!1),W=(0,n.useRef)(!1),T=(0,n.useMemo)(()=>new M.I((0,A.s)(),"file_deep_search"),[]),q=(0,n.useRef)(!1),V=(0,n.useRef)(!1),J=decodeURIComponent(e.base_path),Q=()=>i({open:!1}),ee=()=>{const e=l?.user_data?.search_exclude_names;return Array.isArray(e)?e:[]};(0,n.useEffect)(()=>{C(ee())},[l?.user_data?.search_exclude_names]),(0,n.useEffect)(()=>{let e=[],t=null;const s=()=>{if(t=null,q.current||V.current||!e.length)return;const s=e;e=[],Z(e=>e+s.length),H(e=>e.length>=R?e:[...e,...s].slice(0,R))},n=()=>{q.current||D(!1)};return T.addMsg(b.HK.file_deep_search_data,n=>{q.current||V.current||(e.push(...n.context??[]),null===t&&(t=setTimeout(s,100)))}),T.addMsg(b.HK.file_deep_search_end,()=>{q.current||V.current||(s(),D(!1))}),T.on_message("close",n),()=>{q.current=!0,clearTimeout(t),W.current&&T.sendNotify(b.HK.file_deep_search_cancel,{}).catch(()=>{}).finally(()=>T.close()),T.removeMsg(b.HK.file_deep_search_data),T.removeMsg(b.HK.file_deep_search_end),T.off_message("close",n)}},[]);const te=()=>{const t=d.trim();if(!t||L)return;V.current=!1,H([]),Z(0),O(!0),W.current=!0,D(!0);const s={param_path:e.base_path,keyword:t,search_type:h,is_regex:u,ignore_case:v};"content"===h&&(s.show_match_line=j),k.length&&(s.exclude_paths=k),N.length&&(s.exclude_names=N),T.sendData(b.HK.file_deep_search,s).catch(()=>{})},se=e=>{let t=e.is_dir?e.path:e.path.slice(0,e.path.lastIndexOf("/")+1);t.endsWith("/")||(t+="/"),Q(),s(I.o.file+t.split("/").map(encodeURIComponent).join("/"))},ne=async e=>{if(e.is_dir)return se(e);const t=e.path.slice(0,e.path.lastIndexOf("/")+1)||"/";Q(),s(I.o.file+t.split("/").map(encodeURIComponent).join("/")),await new Promise(e=>setTimeout(e,300)),await r({name:e.name,opt_shell:!0})},ie="content"===h;return X?(0,E.jsx)(F,{on_back:()=>{K(!1),C(ee())}}):(0,E.jsxs)("div",{className:"file-deep-search",children:[(0,E.jsxs)("div",{className:"file-deep-search__bar",children:[(0,E.jsx)(f.$Z,{icon:"search",value:d,placeholder:t(ie?"搜文件内容":"搜文件名"),handleInputChange:e=>_(e),handleEnterPress:te}),(0,E.jsx)("button",{className:"button button--flat",onClick:L?()=>{V.current=!0,T.sendNotify(b.HK.file_deep_search_cancel,{}).catch(()=>{}),D(!1)}:te,children:t(L?"取消":"搜索")}),(0,E.jsx)($.rA,{icon:"close",title:t("关闭"),onClick:Q})]}),(0,E.jsxs)("div",{className:"file-deep-search__tabs",children:[(0,E.jsx)("button",{className:"file-deep-search__tab"+(ie?"":" file-deep-search__tab--active"),onClick:()=>p("name"),children:t("文件名")}),(0,E.jsx)("button",{className:"file-deep-search__tab"+(ie?" file-deep-search__tab--active":""),onClick:()=>p("content"),children:t("文件内容")})]}),(0,E.jsxs)("div",{className:"file-deep-search__options",children:[(0,E.jsx)(f.GL,{context:t("正则"),selected:u,onchange:()=>x(!u)}),(0,E.jsx)(f.GL,{context:t("忽略大小写"),selected:v,onchange:()=>w(!v)}),ie&&(0,E.jsx)(f.GL,{context:t("显示匹配行"),selected:j,onchange:()=>y(!j)})]}),(0,E.jsxs)("div",{className:"file-deep-search__hint",children:[(0,E.jsxs)("span",{children:[t("范围"),":",J]}),(0,E.jsxs)("span",{className:"file-deep-search__hint-right",children:[(k.length>0||N.length>0)&&(0,E.jsxs)("span",{className:"file-deep-search__excluded",children:[t("已排除")," ",k.length+N.length]}),(0,E.jsxs)("button",{className:"file-deep-search__filter"+(S?" file-deep-search__filter--active":""),onClick:()=>z(!S),children:[(0,E.jsx)("span",{className:"material-symbols-outlined",children:"filter_alt"}),t("过滤")]}),B>0&&(0,E.jsx)("span",{className:"file-deep-search__count",children:B>R?`${t("已显示")} 500 / ${B}`:`${B}`})]})]}),S&&(0,E.jsx)(P,{base_path:e.base_path,exclude_paths:k,ignore_names:N,on_change_paths:G,on_change_names:C,on_open_setting:()=>K(!0)}),(0,E.jsxs)("div",{className:"file-deep-search__body"+(ie&&j?" file-deep-search__body--line":""),children:[U.length>0&&(0,E.jsx)("div",{className:"file-deep-search__results",children:U.map(e=>{const s=e.path.slice(0,e.path.lastIndexOf("/")+1);return(0,E.jsxs)("div",{className:"file-deep-search__row",children:[(0,E.jsxs)("div",{className:"file-deep-search__name",children:[e.is_dir?(0,E.jsx)("span",{className:"file-deep-search__dir",children:e.name}):(0,E.jsx)("span",{className:"file-deep-search__file",title:e.name,children:e.name}),(0,E.jsx)("span",{className:"file-deep-search__path",children:s}),e.lines&&e.lines.length>0&&(0,E.jsx)("div",{className:"file-deep-search__lines",children:e.lines.map(t=>(0,E.jsxs)("div",{className:"file-deep-search__line",onClick:()=>ne(e),children:[(0,E.jsx)("span",{className:"file-deep-search__line-no",children:t.line}),(0,E.jsx)("span",{className:"file-deep-search__line-text",children:t.text})]},t.line))})]}),(0,E.jsxs)("div",{className:"file-deep-search__actions",children:[(0,E.jsx)($.rA,{icon:"open_in_new",title:e.is_dir?t("打开"):t("打开文件"),onClick:()=>ne(e)}),(0,E.jsx)($.rA,{icon:"folder_open",title:t("打开所在目录"),onClick:()=>se(e)})]})]},e.path)})}),L&&(0,E.jsxs)("div",{className:"file-deep-search__empty",children:[(0,E.jsx)("span",{className:"chat-session-running",title:t("搜索中")}),t("搜索中")]}),!L&&B>R&&(0,E.jsx)("div",{className:"file-deep-search__more",children:t("结果过多")}),!L&&0===U.length&&(0,E.jsx)("div",{className:"file-deep-search__empty",children:t(Y?"无匹配":ie?"输入内容后搜":"输入后搜")})]})]})}var K=s(64694),L=s(12730),D=s(75725),U=s(7572),H=s(40505);let B={};function Z(){const{t:e}=(0,g.Bd)();let t=(0,c.zy)();const s=(0,c.Zp)(),{check_user_auth:i}=(0,w.MH)(),[l,d]=(0,a.fp)(o.AG.nowFileList),[p,f]=(0,a.fp)(o.AG.uploadFiles),[j,y]=(0,a.fp)(o.AG.showPrompt),[k,N]=(0,a.fp)(o.AG.selectedFileList),[S,M]=(0,a.fp)(o.AG.copyedFileList),[z,P]=(0,a.fp)(o.AG.cutedFileList),[F,R]=(0,a.fp)(o.AG.selectedFileList),[X,H]=(0,a.fp)(o.AG.clickFileList),[Z,Y]=(0,a.fp)(o.AG.fileShellShow),O=(0,m.Cf)(),[W,T]=(0,a.fp)(o.AG.file_root_list),[q,V]=(0,a.fp)(o.AG.file_root_index),[J,Q]=(0,n.useState)(void 0),[ee,te]=(0,n.useState)(""),[se,ne]=(0,a.fp)(o.AG.workflow_show),[ie,ae]=(0,a.fp)(o.AG.workflow_realtime_show),[le,oe]=(0,a.fp)(o.AG.work_flow_show),{initUserInfo:re}=(0,n.useContext)(v.F),[ce,de]=(0,a.fp)(o.AG.user_base_info),{click_file:_e}=(0,m.kZ)(),[he,pe]=(0,a.fp)(o.AG.prompt_card),me=(0,n.useMemo)(()=>l.files.reduce((e,t)=>e+(t.type!==u.Iw.folder?1:0),0),[l]),fe=(0,n.useMemo)(()=>l.files.reduce((e,t)=>e+(t.type===u.Iw.folder?1:0),0)+(l.folders?.length??0),[l]);function ue(e){(0,x.SK)(e)}(0,n.useEffect)(()=>{B={}},[t]),(0,n.useEffect)(()=>()=>{Y({show:!1,path:""})},[]);const xe=(0,m.Vs)(),ge=t=>{pe({open:!0,title:e("信息"),context_div:(0,E.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,E.jsx)(D.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,E.jsx)(D.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,E.jsx)(D.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,E.jsx)(D.Yh,{left:`${e("文件夹数")}`,right:fe}),(0,E.jsx)(D.Yh,{left:`${e("文件数")}`,right:me}),(0,E.jsx)(D.Yh,{left:`${e("当前位置")}`,right:(0,E.jsx)(U.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{A.ws.removeMsg(b.HK.file_info)}})};return(0,E.jsxs)(n.Fragment,{children:[k.length>0&&(0,E.jsx)($.rA,{icon:"delete",title:e("删除"),onClick:()=>{y({show:!0,type:_.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),k.length>0&&(0,E.jsx)($.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,m.ib)(l,k);M(e.map(e=>(0,m.Ok)(e.name))),P([]),ue("已复制")}}),k.length>0&&(0,E.jsx)($.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,m.ib)(l,k);P(e.map(e=>(0,m.Ok)(e.name))),M([]),ue("已剪切")}}),(S.length>0||z.length>0)&&(0,E.jsx)($.rA,{onClick:function(){y({show:!0,type:_.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:S.length+z.length}),k.length>0&&(0,E.jsx)($.rA,{icon:"download",title:e("下载"),onClick:function(){const e=(0,m.ib)(l,k);for(let t=0;t<e.length;t++){const s=e[t];e[t]=encodeURIComponent((0,m.Ok)(s.name))}const t=r.$M.getDownloadUrl(e);window.open(t)}}),k.length>0&&(0,E.jsx)($.rA,{icon:"compress",title:e("压缩"),onClick:function(){const t=(0,m.ib)(l,k);for(let e=0;e<t.length;e++){const s=t[e];t[e]=(0,m.Ok)(s.name)}t&&0!==t.length?y({show:!0,type:_.PromptEnum.Compress,overlay:!0,data:{files:t}}):(0,x.zN)(e("没有选中"))}}),1===k.length&&(0,E.jsx)($.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){y({show:!0,type:_.PromptEnum.FileRename,overlay:!0,data:{}})}}),le&&(0,E.jsx)($.rA,{icon:"api",title:"workflow",onClick:()=>{ne(!se)}}),O.can_terminal&&(0,E.jsx)($.rA,{icon:"terminal",title:"shell",onClick:function(){Z.show?Y({show:!1,path:""}):Y({show:!0,path:(0,h.GG)("file",(0,h.vX)())})}}),i(G.oV.share_file)&&(0,E.jsx)($.rA,{icon:"share",title:e("文件分享"),onClick:()=>{s(`${I.o.share_list_setting_page}`)}}),(0,E.jsx)($.rA,{icon:"grid_view",title:e("切换样式"),onClick:xe}),(0,E.jsx)($.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){y({show:!0,type:_.PromptEnum.DirNew,overlay:!0,data:{dir:(0,h.GG)("file",(0,h.vX)())}})}}),(0,E.jsx)($.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){y({show:!0,type:_.PromptEnum.FileNew,overlay:!0,data:{dir:(0,h.GG)("file",(0,h.vX)())}})}}),(0,E.jsx)($.rA,{icon:"upload_file",title:e("上传"),onClick:()=>{y({show:!0,type:_.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let s=!!t[0].webkitRelativePath;const n=[],i=new Set;for(let e=0;e<t.length;e++){const a=t[e],l=s?a.webkitRelativePath:`${a.webkitRelativePath}${a.name}`;a.fullPath=l,s&&i.add((0,L.S)(l)),n.push(a)}const a=[];if(s)for(const e of i)a.push({isDir:!0,fullPath:e,name:e});a.push(...n),f(a),y({show:!0,type:_.PromptEnum.FilesUpload,overlay:!1,data:{}})}}})}}),(0,E.jsx)($.rA,{icon:"info",title:e("信息"),onClick:async()=>{let e;if(!B.now_absolute_path){A.ws.addMsg(b.HK.file_info,t=>{const s=t.context;e&&(B={...B,...s},A.ws.removeMsg(b.HK.file_info),ge(B))});const t=await A.ws.sendData(b.HK.file_info,{type:u.Iw.folder,path:(0,h.GG)("file",(0,h.vX)())});e=t.context,B=e,ge(B)}ge(B)}}),(0,E.jsx)($.rA,{icon:"more_vert",title:e("切换目录"),onClick:t=>{const n=new C.ik;n.x=t.clientX,n.y=t.clientY,n.type=u.Iw.directory,n.items=W,n.item_pre_value=q,n.textClick=async t=>{if(t.type===C.LU.add)return s(`${I.o.setting_private_env_setting}`),y({data:void 0,overlay:!1,type:"",show:!1}),void(0,x.N9)(e("请配置 文件夹路径"));y({data:void 0,overlay:!1,type:"",show:!1}),t.type!==C.LU.child?(async e=>{V(e),await r.$M.post("base_switch",{root_index:e}),await re(),s("/file/"),R([]),H([])})(t.index):s((0,K.IO)(I.o.file,t.rel))},y({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:n})}})]})}var Y=s(32918),O=s(2543),W=s(21499);const T=n.lazy(()=>Promise.all([s.e(7856),s.e(6349),s.e(3659)]).then(s.bind(s,63659))),q=n.lazy(()=>Promise.all([s.e(7856),s.e(1636)]).then(s.bind(s,81636))),V=n.lazy(()=>Promise.all([s.e(3277),s.e(9345)]).then(s.bind(s,49345)));let J,Q="";function ee(){const[e,t]=(0,a.fp)(o.AG.editorSetting),[,s]=(0,a.fp)(o.AG.md_editor),[,x]=(0,a.fp)(o.AG.log_viewer),[,M]=(0,a.fp)(o.AG.image_editor),[,P]=(0,a.fp)(o.AG.markdown),[,F]=(0,a.fp)(o.AG.excalidraw_editor),[,R]=(0,a.fp)(o.AG.mind_editor),[,L]=(0,a.fp)(o.AG.timeline_editor),[,D]=(0,a.fp)(o.AG.excel_editor),[,U]=(0,a.fp)(o.AG.docx_editor),[,B]=(0,a.fp)(o.AG.pptx_editor),[,ee]=(0,a.fp)(o.AG.ebook_reader),[te,se]=(0,a.fp)(o.AG.file_preview),{t:ne}=(0,g.Bd)();let ie=(0,c.zy)();const ae=(0,c.Zp)(),[le,oe]=(0,a.fp)(o.AG.nowFileList),[re]=(0,a.fp)(o.AG.file_list_refresh),[ce,de]=(0,a.fp)(o.AG.current_mount),[_e,he]=(0,a.fp)(o.AG.showPrompt),[pe,me]=(0,a.fp)(o.AG.selectedFileList),[fe,ue]=(0,a.fp)(o.AG.clickFileList),[xe,ge]=(0,a.fp)(o.AG.fileShellShow),[ve,we]=(0,n.useState)(""),[je,ye]=(0,a.fp)(o.AG.workflow_show),[ke,Ae]=(0,a.fp)(o.AG.workflow_realtime_show),[be,Ge]=(0,a.fp)(o.AG.work_flow_show),[Ne,Ce]=(0,n.useState)(!1),{initUserInfo:Se}=(0,n.useContext)(v.F),[Ie,Me]=(0,a.fp)(o.AG.user_base_info),{check_user_auth:$e}=(0,w.MH)(),{click_file:ze}=(0,m.kZ)(),[Ee]=(0,c.ok)(),Pe=(0,m._A)(),Fe=n.useRef(null),[Re,Xe]=(0,a.fp)(o.AG.to_running_files),[Ke,Le]=(0,a.fp)(o.AG.file_page),[De]=(0,a.fp)(o.AG.blank_search_mode),[,Ue]=(0,a.fp)(o.AG.prompt_card),[He,Be]=(0,a.fp)(o.AG.blank_search_mode_for_temp),Ze=(0,m.oT)(),Ye="1"===Ee.get("chat_open"),Oe=$e(G.oV.ai_agent_page),We=(0,m.Cf)();(0,n.useEffect)(()=>{Ie?.user_data&&Ye&&!Oe&&Ze("chat_open",null)},[Ye,Oe,Ie]);const[Te,qe]=(0,a.fp)(o.AG.studio_chat_width),Ve=n.useRef(null),[Je,Qe]=(0,n.useState)(!1),[et,tt]=(0,n.useState)(void 0),st=(0,m.dN)();(0,m.rJ)(st());const[nt,it]=(0,a.fp)(o.AG.ai_chat_session_by_cwd),at=function(){const e=(0,m.Cf)(),[t,s]=(0,a.fp)(o.AG.user_base_info),{t:i}=(0,g.Bd)(),{check_user_auth:l}=(0,w.MH)(),[d,p]=(0,a.fp)(o.AG.router_jump),f=(0,c.Zp)(),{initUserInfo:x}=(0,n.useContext)(v.F),[j,y]=(0,a.fp)(o.AG.nowFileList),[k,N]=(0,a.fp)(o.AG.showPrompt),[S,M]=(0,a.fp)(o.AG.fileShellShow),[$,P]=(0,a.fp)(o.AG.blank_search_mode);return s=>{s.preventDefault(),s.stopPropagation();const n=new C.ik;n.x=s.clientX,n.y=s.clientY,n.type=u.Iw.directory;const a=[{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===G.t8.time_minx_max),children:i("时间逆序")}),v:G.t8.time_minx_max},{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===G.t8.time_max_min),children:i("时间顺序")}),v:G.t8.time_max_min}],o=[{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===G.t8.size_min_max),children:i("大小顺序")}),v:G.t8.size_min_max},{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===G.t8.size_max_min),children:i("大小逆序")}),v:G.t8.size_max_min}],c=[{r:(0,E.jsx)("span",{style:(0,H.ok)(!t.user_data.file_list_pagination_mode||t.user_data.file_list_pagination_mode===G.yM.all),children:i("全部加载文件")}),v:G.yM.all},{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.file_list_pagination_mode===G.yM.pagination),children:i("scrll_l")}),v:G.yM.pagination}],d=[{r:(0,E.jsx)("span",{style:(0,H.ok)(!t.user_data.file_time_show_type||t.user_data.file_time_show_type===G.KD.current),children:i("最近时间")}),v:G.KD.current},{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.file_time_show_type===G.KD.time),children:i("准确时间")}),v:G.KD.time}],g=[{r:i("文件列表展示"),items:[{r:i("文件排序"),v:"",items:[{r:(0,E.jsx)("span",{style:(0,H.ok)(!t.user_data.dir_show_type),children:i("系统默认")}),v:G.t8.defualt},{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===G.t8.name),children:i("名字")}),v:G.t8.name},{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===G.t8.time_minx_max||t.user_data.dir_show_type===G.t8.time_max_min),children:i("修改时间")}),v:!1,items:a},{r:(0,E.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===G.t8.size_min_max||t.user_data.dir_show_type===G.t8.size_max_min),children:i("文件大小")}),v:!1,items:o}]},{r:i("文件加载方式"),v:"",items:c},{r:i("时间展示"),v:"",items:d},{r:i("缩放调整"),v:"zoom_adjust"},{r:(0,E.jsx)("span",{style:(0,H.ok)($),children:i("srchbln")}),v:"blank_search_mode"}]}];e.git_available&&j?.folders?.find(e=>".git"===e.name)&&g.push({r:i("查看Git提交"),v:"git_page"}),g.push({r:i("o_stdo"),v:"studio_page"}),l(G.oV.http_proxy)&&g.push({r:i("dl_here"),v:"http_resource"}),t?.user_data?.quick_cmd&&(0,m.LL)([...t.user_data.quick_cmd],g),n.items=g,n.textClick=async e=>{if(console.log(e),!1===e)return;const t={};if("gcfg_dir_config"===e){const e=(0,h.GG)("file",(0,h.vX)());return N({data:void 0,overlay:!1,type:"",show:!1}),void f(`${I.o.gcfg_page}/${encodeURIComponent(e)}`)}if("git_page"===e){const e=(0,h.GG)("file",(0,h.vX)());return N({data:void 0,overlay:!1,type:"",show:!1}),void f(`${I.o.git_page}/${encodeURIComponent(e)}`)}if("studio_page"===e){const e=(0,h.GG)("file",(0,h.vX)());return N({data:void 0,overlay:!1,type:"",show:!1}),void f(`${I.o.studio_page}/${encodeURIComponent(`/file/${e}`)}`)}if("http_resource"===e){const e=await A.ws.sendData(b.HK.file_info,{path:(0,h.GG)("file",(0,h.vX)())});return p({http_download_map_path:e.context.now_absolute_path}),N({data:void 0,overlay:!1,type:"",show:!1}),void f("/proxy/http/")}if("zoom_adjust"===e)return N({data:void 0,overlay:!1,type:"",show:!1}),void setTimeout(()=>{N({show:!0,type:_.PromptEnum.ZoomAdjust,overlay:!1,data:{}})},0);if("object"==typeof e&&"quick_cmd"===e.tag){let t=e.cmd;t&&(t.endsWith("\r")||(t+="\r",M({show:!0,path:(0,h.GG)("file",(0,h.vX)()),cmd:t})))}else{if("blank_search_mode"===e)return P(!$),void N({data:void 0,overlay:!1,type:"",show:!1});if(e===G.yM.all||e===G.yM.pagination)t.is_pagination_mode=!0;else if(e===G.KD.current||e===G.KD.time)t.is_file_show_type=!0;else{if(e!==G.t8.defualt&&e!==G.t8.name&&e!==G.t8.size_max_min&&e!==G.t8.size_min_max&&e!==G.t8.time_max_min&&e!==G.t8.time_minx_max)return;t.is_dir_list_type=!0}}await r.wm.post(z.s.user_save_private_attr,{type:e,...t}),await x(),N({data:void 0,overlay:!1,type:"",show:!1}),f((0,h.vX)())},N({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:n})}}(),lt=async e=>{let t=!1;for(const s of e.files??[])s.origin_size=s.size,s.size=(0,j.v7)(s.size),Ie.user_data.file_time_show_type===G.KD.time?s.show_mtime=s.mtime?(0,W.Yq)(s.mtime):"":s.show_mtime=s.mtime?(0,y.s)(s.mtime):"",t||!s.name.endsWith(".workflow.yml")&&!s.name.endsWith(".act")||Ce(!0),s.name===k.SB&&(t=!0);for(const s of e.folders??[])Ie.user_data.file_time_show_type===G.KD.time?s.show_mtime=s.mtime?(0,W.Yq)(s.mtime):"":s.show_mtime=s.mtime?(0,y.s)(s.mtime):"",s.name===k.SB&&(t=!0);Ge(t)},ot=async e=>{de(e??null)};(0,n.useEffect)(()=>{Ne&&(async()=>{const e=new k.Nd,t=(0,l.zp)().get(o.AG.current_mount);e.dir_path=(0,m.Zl)((0,h.GG)("file",(0,h.vX)()),t),A.ws.removeMsg(b.HK.workflow_realtime),A.ws.addMsg(b.HK.workflow_realtime,e=>{const t=e.context;if(e.context){for(const e of t.sucess_file_list)(0,m.Ys)(e);for(const e of t.failed_file_list)(0,m.V$)(e);Xe(new Set(t.running_file_list))}}),await A.ws.sendData(b.HK.workflow_realtime,e)})()},[be,Ne,ce,ie]);const rt=async()=>{const e=(0,h.GG)("file",(0,h.vX)());if(De||He)return;let t;if(Ie.user_data.file_list_pagination_mode===G.yM.pagination){if(Q!==e){if(Q=e,1!==Ke.page_num)return void Le({page_size:Ke.page_size,page_num:1})}else if(Ke.page_num<0)return;if(t=await r.$M.post("file_get_page",{param_path:e,page_num:Ke.page_num,page_size:Ke.page_size}),t.code!==p.m.Success)return;const s=t.data;return lt(s),ot(s.mount_info),s.files?.length?(oe(e=>{const t=(0,O.cloneDeep)(1===Ke.page_num?s.files:[...e?.files??[],...s.files]),n={...e,files:t};return(0,m.yC)(n,Ie.user_data.dir_show_type),n}),void(J=t.data)):void Le({page_size:Ke.page_size,page_num:-1})}if(t=await r.$M.get(e),t.code!==p.m.Success)return;const s=t.data;(0,m.yC)(s,Ie.user_data.dir_show_type),lt(t.data),ot(s.mount_info),oe(t.data),J=t.data};(0,n.useEffect)(()=>async()=>{Xe(new Set),ce&&await A.ws.close()},[]);const ct=()=>{Ge(!1),(()=>{const e=Ee.get("preview_file_name"),t=Ee.get("preview_mode");if(!e||!t)return!1;const n=(0,h.GG)("file",(0,h.vX)());if(Fe.current===n+e)return!0;Fe.current=n+e;const i=()=>Pe(null);return"md"===t?(s({url:r.$M.getDownloadUrl(`${encodeURIComponent(n)}${e}`),path:`${n}${e}`,name:e,close:i}),!0):"log"===t?(x({show:!0,fileName:e,encoding:Ee.get("preview_log_enc")??"utf8",wrap:Ee.get("preview_log_wrap")??"wrap",close:i}),!0):"image_edit"===t?(M({path:(0,K.IO)((0,h.vX)(),e),name:e,close:i}),!0):(ze({name:e,opt_shell:!0,mode:t,..."text"===t?{model:"text"}:{},close:i}),!0)})()||(t({open:!1}),se({open:!1}),s({}),x({show:!1}),M({}),P({}),F({}),R({}),L({}),D({}),U({}),B({}),ee({}),rt())};(0,n.useEffect)(()=>{ct()},[ie,Ke]),(0,n.useEffect)(()=>{re>0&&rt()},[re]);n.useRef(!1);const dt=()=>{const e=(0,h.GG)("file",(0,h.vX)());Ue({open:!0,title:ne("深搜"),context_div:(0,E.jsx)(X,{base_path:e})})},_t=e=>{e.target===e.currentTarget&&(me([]),ue([]))},ht=n.useCallback((0,O.throttle)(e=>{const t=Ve.current;if(!t||!t.parentElement)return;const s=parseFloat(getComputedStyle(t).fontSize),n=t.parentElement.getBoundingClientRect(),i=n.right-e.clientX,a=Math.min(Math.max(i,0),n.width);qe(parseFloat((a/s).toFixed(2)))},32),[]),pt=()=>{Qe(!1),document.removeEventListener("pointermove",ht)},mt=(0,E.jsxs)("div",{className:"file-list-main",children:[(0,E.jsx)(i.e,{baseRoute:"file",clickFun:function(){if(me([]),ue([]),Ie.user_data.file_list_pagination_mode===G.yM.pagination){const e=document.getElementById("listing");e&&(e.scrollTop=0),Le({page_size:Ke.page_size,page_num:1})}},input_path_enter:e=>{me([]),ue([]),oe({files:[],folders:[]}),(0,N.Z1)(e)?(e=e.replace((0,Y.m)(Ie.user_data),""),ae(e)):ae((0,N.Jn)((0,h.vX)(),e))}}),ce&&(0,E.jsxs)("div",{className:"mount-tip-bar",style:{borderLeftColor:ce.color},children:[(0,E.jsx)("span",{className:"material-icons",style:{color:ce.color},children:"cloud"}),(0,E.jsx)("span",{children:[{v:ce.driver,t:ne("驱动")},{v:ce.credential_note,t:ne("凭据")},{v:ce.account_note,t:ne("账号")}].filter(e=>Boolean(e.v)).map(e=>`${e.v}(${e.t})`).join(" - ")}),ce.readonly&&(0,E.jsx)("span",{className:"mount-readonly-tag",children:ne("只读")})]}),Ie.user_data.file_list_pagination_mode===G.yM.pagination?(0,E.jsx)(S.$J,{handleContextMenu:at,clickBlank:_t,list:le.files}):(0,E.jsx)(S.t$,{handleContextMenu:at,file_list:le.files,folder_list:le.folders,clickBlank:_t})]});return(0,E.jsxs)(n.Fragment,{children:[(0,E.jsxs)(d.aZ,{children:[(0,E.jsx)("div",{className:"mobile-deep-search-btn",children:(0,E.jsx)($.rA,{icon:"search",title:ne("搜索"),onClick:dt})}),(0,E.jsx)(f.$Z,{handleEnterPress:async()=>{if(De||He){if(me([]),ue([]),!ve||!ve.trim())return void oe({files:[],folders:[]});const e=(0,h.GG)("file",(0,h.vX)()),t=await r.$M.post("file_get_page",{param_path:e,page_num:1,page_size:1e4,search:ve.trim()});if(t.code!==p.m.Success)return;const s=t.data;return(0,m.yC)(s,Ie.user_data.dir_show_type),lt(s),oe(s),void(J=s)}if(!J)return;me([]),ue([]);const e=[],t=[];for(const t of J.files??[])t.name.includes(ve)&&e.push(t);for(const e of J.folders??[])e.name.includes(ve)&&t.push(e);oe({files:e,folders:t})},placeholder:ne("搜索当前目录"),icon:"search",value:"",mobile_hidden:!0,handleIconClick:dt,handleInputChange:e=>{we(e)},max_width:"25em"})]}),(0,E.jsxs)(d.aZ,{position:"right",children:[$e(G.oV.ai_agent_page)&&We.ai_chat_available&&(0,E.jsx)($.rA,{icon:"smart_toy",title:ne("AI 聊天"),selected:Ye,onClick:()=>Ze("chat_open",!Ye?"1":null)}),(0,E.jsx)("div",{className:"mobile-context-btn",children:(0,E.jsx)($.rA,{icon:"more_horiz",title:ne("右键"),onClick:()=>{const e=pe[pe.length-1];if(void 0!==e){const t=[...le.folders??[],...le.files??[]][e];if(t){const s=document.querySelectorAll(".item")[e],n=s?s.getBoundingClientRect():{left:window.innerWidth/2,bottom:100},i={preventDefault:()=>{},stopPropagation:()=>{},clientX:n.left+10,clientY:n.bottom??100},a=new C.ik;a.path=(0,K.IO)((0,h.vX)(),t.name),a.filename=t.name,a.x=i.clientX,a.y=i.clientY,a.type=t.type===u.Iw.folder?u.Iw.folder:(0,C.uL)(t.name),a.size=t.origin_size,he({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:a})}}else{const e={preventDefault:()=>{},stopPropagation:()=>{},clientX:window.innerWidth/2,clientY:window.innerHeight/2};at(e)}}})}),(0,E.jsx)(Z,{})]}),(0,E.jsxs)("div",{className:"file-list-split"+(Ye?" file-list-split--chat":""),children:[mt,Ye&&(0,E.jsxs)(n.Fragment,{children:[(0,E.jsx)("div",{className:"studio__divider studio__divider--chat",ref:Ve,onPointerDown:e=>{e.preventDefault(),Qe(!0),document.addEventListener("pointermove",ht),document.addEventListener("pointerup",pt,{once:!0})}}),(0,E.jsx)("div",{className:"studio-chat-panel",style:{width:`${Te}em`},children:(0,E.jsx)(n.Suspense,{fallback:null,children:(0,E.jsx)(V,{inline_header:!0,sync_url:!1,file_cwd_path:st(),session_id:et??(ft=st(),o.AG.get_ai_chat_session(nt,ft)),on_session_change:e=>{tt(e),((e,t)=>{it({...nt,[e]:t})})(st(),e)}})})})]})]}),Je&&(0,E.jsx)("div",{className:"shell__overlay",onPointerUp:pt}),je&&(0,E.jsx)(T,{}),ke.open&&(0,E.jsx)(q,{})]});var ft}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2539],{2539(e,t,a){a.d(t,{makeComicBook:()=>n});const n=async({entries:e,loadBlob:t,getSize:a,getComment:n},o)=>{const i=new Map,r=new Map,s=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg",".jxl",".avif"],l=e.map(e=>e.filename).filter(e=>s.some(t=>e.endsWith(t))).sort();if(!l.length)throw new Error("No supported image files in archive");const c={};try{const e=JSON.parse(await n()||"")["ComicBookInfo/1.0"];if(e){const t=e.publicationYear,a=e.publicationMonth,n=a&&a>=1&&a<=12?String(a).padStart(2,"0"):null;c.metadata={title:e.title||o.name,publisher:e.publisher,language:e.language||e.lang,author:e.credits?e.credits.map(e=>`${e.person} (${e.role})`).join(", "):"",published:t&&a?`${t}-${n}`:void 0}}else c.metadata={title:o.name}}catch{c.metadata={title:o.name}}return c.getCover=()=>t(l[0]),c.sections=l.map(e=>({id:e,load:()=>(async e=>{if(i.has(e))return i.get(e);const a=URL.createObjectURL(await t(e)),n=URL.createObjectURL(new Blob([`<body style="margin: 0"><img src="${a}">`],{type:"text/html"}));return r.set(e,[a,n]),i.set(e,n),n})(e),unload:()=>(e=>{r.get(e)?.forEach?.(e=>URL.revokeObjectURL(e)),r.delete(e),i.delete(e)})(e),size:a(e)})),c.toc=l.map(e=>({label:e,href:e})),c.rendition={layout:"pre-paginated"},c.resolveHref=e=>({index:c.sections.findIndex(t=>t.id===e)}),c.splitTOCHref=e=>[e,null],c.getTOCFragment=e=>e.documentElement,c.destroy=()=>{for(const e of r.values())for(const t of e)URL.revokeObjectURL(t)},c}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5308],{65308(e,t,n){n.r(t),n.d(t,{default:()=>w});var o=n(96540),a=n(34843),i=n(82893),r=n(34289),c=n(14284),d=n(38240),s=n(62042),l=n(52671),u=n(93245),m=n(23430),f=n(22022),p=n(74848);let v,g=!1;function w(){const[e,t]=(0,a.fp)(i.AG.image_editor),n=(0,l.Zp)(),{t:w}=((0,l.zy)(),(0,f.Bd)()),T=o.useRef(!1),x=o.useRef(!1);return(0,o.useEffect)(()=>((async()=>{if(!g)try{await(0,d.J)("filerobot-image-editor.min.js"),g=!0}catch(e){return void(0,s.zN)(w("加载资源失败"))}const o=(0,r.GG)("file",e.path),a=window.FilerobotImageEditor,{TABS:i,TOOLS:l}=a,u={defaultSavedImageName:e.name,source:c.$M.getDownloadUrl(o),onSave:async(t,n)=>{const a=t.extension,i=t.name??e.name,d=await new Promise(e=>t.imageCanvas.toBlob(e,t.mimeType));await c.$M.put(`${encodeURIComponent(`${(0,r.Yp)(o)}${i}.${a}`)}`,d,void 0),T.current=!1,x.current||(0,s.SK)(w("保存成功")),x.current=!1},onModify:()=>{T.current=!0},annotationsCommon:{fill:"#151717",stroke:"#ec0f42",shadowColor:"#151717"},Text:{text:""},Rotate:{angle:90,componentType:"slider"},tabsIds:[Object.values(i)],defaultTabId:i.ANNOTATE,defaultToolId:l.ANNOTATE};v=new a(document.querySelector("#editor_container"),u),v.render({onClose:o=>{v.terminate();const a=e.close;t({}),a?.(),n((0,r.vX)())}})})(),()=>{v&&v.terminate()}),[]),(0,u.a)(m.nE.image,()=>T.current,e=>{const t=Array.from(document.querySelectorAll("#editor_container button")).find(e=>(e.textContent||"").includes("Save")||(e.textContent||"").includes("保存"));t&&(x.current=!!e,t.click())}),(0,p.jsx)("div",{id:"image-editor-container",children:(0,p.jsx)("div",{className:"image-editor-context",children:(0,p.jsx)("div",{id:"editor_container",className:"image-editor-context"})})})}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2927],{65308(e,t,n){n.r(t),n.d(t,{default:()=>w});var o=n(96540),a=n(34843),i=n(82893),r=n(34289),c=n(14284),d=n(38240),s=n(62042),l=n(52671),u=n(93245),m=n(23430),f=n(22022),p=n(74848);let v,g=!1;function w(){const[e,t]=(0,a.fp)(i.AG.image_editor),n=(0,l.Zp)(),{t:w}=((0,l.zy)(),(0,f.Bd)()),T=o.useRef(!1),x=o.useRef(!1);return(0,o.useEffect)(()=>((async()=>{if(!g)try{await(0,d.J)("filerobot-image-editor.min.js"),g=!0}catch(e){return void(0,s.zN)(w("加载资源失败"))}const o=(0,r.GG)("file",e.path),a=window.FilerobotImageEditor,{TABS:i,TOOLS:l}=a,u={defaultSavedImageName:e.name,source:c.$M.getDownloadUrl(o),onSave:async(t,n)=>{const a=t.extension,i=t.name??e.name,d=await new Promise(e=>t.imageCanvas.toBlob(e,t.mimeType));await c.$M.put(`${encodeURIComponent(`${(0,r.Yp)(o)}${i}.${a}`)}`,d,void 0),T.current=!1,x.current||(0,s.SK)(w("保存成功")),x.current=!1},onModify:()=>{T.current=!0},annotationsCommon:{fill:"#151717",stroke:"#ec0f42",shadowColor:"#151717"},Text:{text:""},Rotate:{angle:90,componentType:"slider"},tabsIds:[Object.values(i)],defaultTabId:i.ANNOTATE,defaultToolId:l.ANNOTATE};v=new a(document.querySelector("#editor_container"),u),v.render({onClose:o=>{v.terminate();const a=e.close;t({}),a?.(),n((0,r.vX)())}})})(),()=>{v&&v.terminate()}),[]),(0,u.a)(m.nE.image,()=>T.current,e=>{const t=Array.from(document.querySelectorAll("#editor_container button")).find(e=>(e.textContent||"").includes("Save")||(e.textContent||"").includes("保存"));t&&(x.current=!!e,t.click())}),(0,p.jsx)("div",{id:"image-editor-container",children:(0,p.jsx)("div",{className:"image-editor-context",children:(0,p.jsx)("div",{id:"editor_container",className:"image-editor-context"})})})}}}]);