System.register(["./index-legacy-BGUFxny_.js","./index-legacy-CwkvHJvM.js"],function(e,r){"use strict";var n,t,o,l,a,u,g,c,h,d,i,s,p,f,w,C,b,m,$,y,k,v,F,O,S,x,I,_,E,z,H,R,M,P,j,B,G,J;return{setters:[e=>{n=e.aY,t=e.D,o=e.I,l=e.o,a=e.S,u=e.K,g=e.aw,c=e.M,h=e.E,d=e.bu,i=e.F,s=e.G,p=e.J,f=e.L,w=e.B,C=e.dF,b=e.an,m=e.C,$=e.ab,y=e.bU,k=e.dG,v=e.b9,F=e.dJ,O=e._,S=e.dH,x=e.aj,I=e.aM,_=e.aE,E=e.dI,z=e.ag,H=e.l,R=e.$,M=e.ah,P=e.R,j=e.z,B=e.bt},e=>{G=e.o,J=e.E}],execute:function(){const r=C(),T=e("F",e=>{const[n,o]=w("/");return e.handle?.({setPath:o}),t(b,{class:"folder-tree-box",w:"$full",overflowX:"auto",get children(){return t(r.Provider,{get value(){return{value:n,onChange:r=>{o(r),e.onChange(r)},autoOpen:e.autoOpen??!1,forceRoot:e.forceRoot??!1,showEmptyIcon:e.showEmptyIcon??!1,showHiddenFolder:e.showHiddenFolder??!0}},get children(){return t(D,{path:"/"})}})}})}),D=e=>{const{isHidePath:o}=y(),[l,u]=w(),{value:c,onChange:h,forceRoot:d,autoOpen:i,showEmptyIcon:s,showHiddenFolder:p}=k(r),[f,C]=v(()=>F(e.path,O(),d));let T=!1;const K=async()=>{if(l()?.length)return;const e=await C();B(e,e=>{T=!0,u(e)},()=>{L()&&U()})},{isOpen:L,onToggle:U}=n(),V=()=>c()===e.path,W=S(e.path);return m(x(c,async e=>{i&&W(e)&&(L()||U(),T||K())})),t(a,{get when(){return p||!(o(e.path)&&!W(c()))},get children(){return t(b,{get children(){return[t(g,{spacing:"$2",get children(){return[t(a,{get when(){return!f()},get fallback(){return t(E,{size:"sm",get color(){return _()}})},get children(){return t(a,{get when(){return!Boolean(s&&void 0!==l()&&!l()?.length)},get fallback(){return t(I,{get color(){return _()},as:J})},get children(){return t(I,{get color(){return _()},as:G,get transform(){return L()?"rotate(90deg)":"none"},transition:"transform 0.2s",cursor:"pointer",onClick:()=>{U(),L()&&K()}})}})}}),t(z,{css:{whiteSpace:"nowrap"},fontSize:"$md",cursor:"pointer",px:"$1",rounded:"$md",get bgColor(){return V()?"$info8":"transparent"},get _hover(){return{bgColor:V()?"$info8":R()}},onClick:()=>{h(e.path)},get children(){return $(()=>"/"===e.path)()?"root":H(e.path)}})]}}),t(a,{get when(){return L()},get children(){return t(M,{mt:"$1",pl:"$4",alignItems:"start",spacing:"$1",get children(){return t(P,{get each(){return l()},children:r=>t(D,{get path(){return j(e.path,r.name)}})})}})}})]}})}})};e("M",e=>{const r=l(),[n,o]=w(e.defaultValue??"/"),[g,d]=w();return m(()=>{e.opened&&g()?.setPath(n())}),t(f,{size:"xl",blockScrollOnMount:!1,get opened(){return e.opened},get onClose(){return e.onClose},get children(){return[t(c,{}),t(h,{get children(){return[t(i,{w:"$full",css:{overflowWrap:"break-word"},get children(){return e.header}}),t(s,{get children(){return[$(()=>e.children),t(T,{onChange:o,handle:e=>d(e),autoOpen:!0})]}}),t(p,{display:"flex",gap:"$2",get children(){return[t(a,{get when(){return e.footerSlot},get children(){return e.footerSlot}}),t(u,{get onClick(){return e.onClose},colorScheme:"neutral",get children(){return r("global.cancel")}}),t(u,{get loading(){return e.loading},onClick:()=>e.onSubmit?.(n()),get children(){return r("global.ok")}})]}})]}})]}})}),e("a",e=>{const{isOpen:r,onOpen:w,onClose:C}=n(),b=l();return[t(g,{w:"$full",spacing:"$2",get children(){return[t(o,{get id(){return e.id},get value(){return e.value},onInput:r=>e.onChange(r.currentTarget.value),get readOnly(){return e.onlyFolder},get onClick(){return e.onlyFolder?w:()=>{}},get placeholder(){return b("global."+(e.onlyFolder?"choose_folder":"choose_or_input_path"))}}),t(a,{get when(){return!e.onlyFolder},get children(){return t(u,{onClick:w,get children(){return b("global.choose")}})}})]}}),t(f,{size:"xl",get opened(){return r()},onClose:C,get children(){return[t(c,{}),t(h,{get children(){return[t(d,{}),t(i,{get children(){return b("global.choose_folder")}}),t(s,{get children(){return t(T,{forceRoot:!0,get onChange(){return e.onChange}})}}),t(p,{get children(){return t(u,{onClick:C,get children(){return b("global.confirm")}})}})]}})]}})]})}}});
