mcp-ssh-manager 4.3.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/Formula/ssh-manager.rb +2 -2
- package/README.md +6 -4
- package/desktop/electron/package-lock.json +2 -2
- package/desktop/electron/package.json +1 -1
- package/dist/ui/app.js +4 -4
- package/docs/DEPLOYMENT_GUIDE.md +8 -0
- package/docs/MIGRATION.md +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/src/index.js +1 -1
package/dist/ui/app.js
CHANGED
|
@@ -86,7 +86,7 @@ Error generating stack: `+c.message+`
|
|
|
86
86
|
`)},q0=function(){var e=parseInt(document.body.getAttribute(ia)||"0",10);return isFinite(e)?e:0},yA=function(){w.useEffect(function(){return document.body.setAttribute(ia,(q0()+1).toString()),function(){var e=q0()-1;e<=0?document.body.removeAttribute(ia):document.body.setAttribute(ia,e.toString())}},[])},bA=function(e){var t=e.noRelative,i=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;yA();var l=w.useMemo(function(){return gA(o)},[o]);return w.createElement(vA,{styles:_A(l,!t,o,i?"":"!important")})},km=!1;if(typeof window<"u")try{var Tu=Object.defineProperty({},"passive",{get:function(){return km=!0,!0}});window.addEventListener("test",Tu,Tu),window.removeEventListener("test",Tu,Tu)}catch{km=!1}var qo=km?{passive:!1}:!1,xA=function(e){return e.tagName==="TEXTAREA"},i1=function(e,t){if(!(e instanceof Element))return!1;var i=window.getComputedStyle(e);return i[t]!=="hidden"&&!(i.overflowY===i.overflowX&&!xA(e)&&i[t]==="visible")},SA=function(e){return i1(e,"overflowY")},wA=function(e){return i1(e,"overflowX")},Y0=function(e,t){var i=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=r1(e,n);if(o){var l=n1(e,n),u=l[1],f=l[2];if(u>f)return!0}n=n.parentNode}while(n&&n!==i.body);return!1},CA=function(e){var t=e.scrollTop,i=e.scrollHeight,n=e.clientHeight;return[t,i,n]},kA=function(e){var t=e.scrollLeft,i=e.scrollWidth,n=e.clientWidth;return[t,i,n]},r1=function(e,t){return e==="v"?SA(t):wA(t)},n1=function(e,t){return e==="v"?CA(t):kA(t)},EA=function(e,t){return e==="h"&&t==="rtl"?-1:1},NA=function(e,t,i,n,o){var l=EA(e,window.getComputedStyle(t).direction),u=l*n,f=i.target,p=t.contains(f),d=!1,_=u>0,v=0,b=0;do{if(!f)break;var x=n1(e,f),y=x[0],S=x[1],E=x[2],N=S-E-l*y;(y||N)&&r1(e,f)&&(v+=N,b+=y);var T=f.parentNode;f=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!p&&f!==document.body||p&&(t.contains(f)||t===f));return(_&&Math.abs(v)<1||!_&&Math.abs(b)<1)&&(d=!0),d},ju=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},W0=function(e){return[e.deltaX,e.deltaY]},K0=function(e){return e&&"current"in e?e.current:e},RA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},AA=function(e){return`
|
|
87
87
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
88
88
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
89
|
-
`)},DA=0,Yo=[];function TA(e){var t=w.useRef([]),i=w.useRef([0,0]),n=w.useRef(),o=w.useState(DA++)[0],l=w.useState(s1)[0],u=w.useRef(e);w.useEffect(function(){u.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var S=QR([e.lockRef.current],(e.shards||[]).map(K0),!0).filter(Boolean);return S.forEach(function(E){return E.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),S.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var f=w.useCallback(function(S,E){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var N=ju(S),T=i.current,A="deltaX"in S?S.deltaX:T[0]-N[0],j="deltaY"in S?S.deltaY:T[1]-N[1],M,P=S.target,D=Math.abs(A)>Math.abs(j)?"h":"v";if("touches"in S&&D==="h"&&P.type==="range")return!1;var L=window.getSelection(),V=L&&L.anchorNode,te=V?V===P||V.contains(P):!1;if(te)return!1;var U=Y0(D,P);if(!U)return!0;if(U?M=D:(M=D==="v"?"h":"v",U=Y0(D,P)),!U)return!1;if(!n.current&&"changedTouches"in S&&(A||j)&&(n.current=M),!M)return!0;var H=n.current||M;return NA(H,E,S,H==="h"?A:j)},[]),p=w.useCallback(function(S){var E=S;if(!(!Yo.length||Yo[Yo.length-1]!==l)){var N="deltaY"in E?W0(E):ju(E),T=t.current.filter(function(M){return M.name===E.type&&(M.target===E.target||E.target===M.shadowParent)&&RA(M.delta,N)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var A=(u.current.shards||[]).map(K0).filter(Boolean).filter(function(M){return M.contains(E.target)}),j=A.length>0?f(E,A[0]):!u.current.noIsolation;j&&E.cancelable&&E.preventDefault()}}},[]),d=w.useCallback(function(S,E,N,T){var A={name:S,delta:E,target:N,should:T,shadowParent:jA(N)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(j){return j!==A})},1)},[]),_=w.useCallback(function(S){i.current=ju(S),n.current=void 0},[]),v=w.useCallback(function(S){d(S.type,W0(S),S.target,f(S,e.lockRef.current))},[]),b=w.useCallback(function(S){d(S.type,ju(S),S.target,f(S,e.lockRef.current))},[]);w.useEffect(function(){return Yo.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:b}),document.addEventListener("wheel",p,qo),document.addEventListener("touchmove",p,qo),document.addEventListener("touchstart",_,qo),function(){Yo=Yo.filter(function(S){return S!==l}),document.removeEventListener("wheel",p,qo),document.removeEventListener("touchmove",p,qo),document.removeEventListener("touchstart",_,qo)}},[]);var x=e.removeScrollBar,y=e.inert;return w.createElement(w.Fragment,null,y?w.createElement(l,{styles:AA(o)}):null,x?w.createElement(bA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function jA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const MA=aA(t1,TA);var $g=w.forwardRef(function(e,t){return w.createElement(Oh,Ri({},e,{ref:t,sideCar:MA}))});$g.classNames=Oh.classNames;var OA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Wo=new WeakMap,Mu=new WeakMap,Ou={},jp=0,o1=function(e){return e&&(e.host||o1(e.parentNode))},LA=function(e,t){return t.map(function(i){if(e.contains(i))return i;var n=o1(i);return n&&e.contains(n)?n:(console.error("aria-hidden",i,"in not contained inside",e,". Doing nothing"),null)}).filter(function(i){return!!i})},zA=function(e,t,i,n){var o=LA(t,Array.isArray(e)?e:[e]);Ou[i]||(Ou[i]=new WeakMap);var l=Ou[i],u=[],f=new Set,p=new Set(o),d=function(v){!v||f.has(v)||(f.add(v),d(v.parentNode))};o.forEach(d);var _=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(b){if(f.has(b))_(b);else try{var x=b.getAttribute(n),y=x!==null&&x!=="false",S=(Wo.get(b)||0)+1,E=(l.get(b)||0)+1;Wo.set(b,S),l.set(b,E),u.push(b),S===1&&y&&Mu.set(b,!0),E===1&&b.setAttribute(i,"true"),y||b.setAttribute(n,"true")}catch(N){console.error("aria-hidden: cannot operate on ",b,N)}})};return _(t),f.clear(),jp++,function(){u.forEach(function(v){var b=Wo.get(v)-1,x=l.get(v)-1;Wo.set(v,b),l.set(v,x),b||(Mu.has(v)||v.removeAttribute(n),Mu.delete(v)),x||v.removeAttribute(i)}),jp--,jp||(Wo=new WeakMap,Wo=new WeakMap,Mu=new WeakMap,Ou={})}},a1=function(e,t,i){i===void 0&&(i="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=OA(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),zA(n,o,i,"aria-hidden")):function(){return null}},BA=Object.defineProperty,$s=(e,t)=>BA(e,"name",{value:t,configurable:!0}),Ug="Dialog",[l1,c1]=mi(Ug),[PA,gi]=l1(Ug),u1=$s(e=>{const{__scopeDialog:t,children:i,open:n,defaultOpen:o,onOpenChange:l,modal:u=!0}=e,f=w.useRef(null),p=w.useRef(null),[d,_]=_a({prop:n,defaultProp:o??!1,onChange:l,caller:Ug}),[v,b]=w.useState(0),[x,y]=w.useState(0);return h.jsx(PA,{scope:t,triggerRef:f,contentRef:p,contentId:In(),titleId:In(),descriptionId:In(),titlePresent:v>0,descriptionPresent:x>0,setTitleCount:b,setDescriptionCount:y,open:d,onOpenChange:_,onOpenToggle:w.useCallback(()=>_(S=>!S),[_]),modal:u,children:i})},"Dialog"),HA="DialogTrigger",IA=w.forwardRef($s(function(t,i){const{__scopeDialog:n,...o}=t,l=gi(HA,n),u=gt(i,l.triggerRef);return h.jsx(vt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":zh(l.open),...o,ref:u,onClick:Oe(t.onClick,l.onOpenToggle)})},"DialogTrigger")),h1="DialogPortal",[$A,d1]=l1(h1,{forceMount:void 0}),f1=$s(e=>{const{__scopeDialog:t,forceMount:i,children:n,container:o}=e,l=gi(h1,t);return h.jsx($A,{scope:t,forceMount:i,children:w.Children.map(n,u=>h.jsx(ln,{present:i||l.open,children:h.jsx(Hg,{asChild:!0,container:o,children:u})}))})},"DialogPortal"),Em="DialogOverlay",p1=w.forwardRef($s(function(t,i){const n=d1(Em,t.__scopeDialog),{forceMount:o=n.forceMount,...l}=t,u=gi(Em,t.__scopeDialog);return u.modal?h.jsx(ln,{present:o||u.open,children:h.jsx(FA,{...l,ref:i})}):null},"DialogOverlay")),UA=dr("DialogOverlay.RemoveScroll"),FA=w.forwardRef($s(function(t,i){const{__scopeDialog:n,...o}=t,l=gi(Em,n),u=Fw(),f=gt(i,u);return h.jsx($g,{as:UA,allowPinchZoom:!0,shards:[l.contentRef],children:h.jsx(vt.div,{"data-state":zh(l.open),...o,ref:f,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),$l="DialogContent",m1=w.forwardRef($s(function(t,i){const n=d1($l,t.__scopeDialog),{forceMount:o=n.forceMount,...l}=t,u=gi($l,t.__scopeDialog);return h.jsx(ln,{present:o||u.open,children:u.modal?h.jsx(VA,{...l,ref:i}):h.jsx(qA,{...l,ref:i})})},"DialogContent")),VA=w.forwardRef($s(function(t,i){const n=gi($l,t.__scopeDialog),o=w.useRef(null),l=gt(i,n.contentRef,o);return w.useEffect(()=>{const u=o.current;if(u)return a1(u)},[]),h.jsx(g1,{...t,ref:l,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Oe(t.onCloseAutoFocus,u=>{var f;u.preventDefault(),(f=n.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Oe(t.onPointerDownOutside,u=>{const f=u.detail.originalEvent,p=f.button===0&&f.ctrlKey===!0;(f.button===2||p)&&u.preventDefault()}),onFocusOutside:Oe(t.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),qA=w.forwardRef($s(function(t,i){const n=gi($l,t.__scopeDialog),o=w.useRef(!1),l=w.useRef(!1);return h.jsx(g1,{...t,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var f,p;(f=t.onCloseAutoFocus)==null||f.call(t,u),u.defaultPrevented||(o.current||(p=n.triggerRef.current)==null||p.focus(),u.preventDefault()),o.current=!1,l.current=!1},onInteractOutside:u=>{var d,_;(d=t.onInteractOutside)==null||d.call(t,u),u.defaultPrevented||(o.current=!0,u.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const f=u.target;((_=n.triggerRef.current)==null?void 0:_.contains(f))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&l.current&&u.preventDefault()}})},"DialogContentNonModal")),g1=w.forwardRef($s(function(t,i){const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:u,...f}=t,p=gi($l,n);return Mh(),h.jsx(h.Fragment,{children:h.jsx(Yw,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:l,onUnmountAutoFocus:u,children:h.jsx(zg,{role:"dialog",id:p.contentId,"aria-describedby":p.descriptionPresent?p.descriptionId:void 0,"aria-labelledby":p.titlePresent?p.titleId:void 0,"data-state":zh(p.open),...f,ref:i,deferPointerDownOutside:!0,onDismiss:()=>p.onOpenChange(!1)})})})},"DialogContentImpl")),YA="DialogTitle",v1=w.forwardRef($s(function(t,i){const{__scopeDialog:n,...o}=t,l=gi(YA,n),{setTitleCount:u}=l;return Cs(()=>(u(f=>f+1),()=>u(f=>f-1)),[u]),h.jsx(vt.h2,{id:l.titleId,...o,ref:i})},"DialogTitle")),WA="DialogDescription",_1=w.forwardRef($s(function(t,i){const{__scopeDialog:n,...o}=t,l=gi(WA,n),{setDescriptionCount:u}=l;return Cs(()=>(u(f=>f+1),()=>u(f=>f-1)),[u]),h.jsx(vt.p,{id:l.descriptionId,...o,ref:i})},"DialogDescription")),KA="DialogClose",Lh=w.forwardRef($s(function(t,i){const{__scopeDialog:n,...o}=t,l=gi(KA,n);return h.jsx(vt.button,{type:"button",...o,ref:i,onClick:Oe(t.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function zh(e){return e?"open":"closed"}$s(zh,"getState");var GA=Object.defineProperty,vr=(e,t)=>GA(e,"name",{value:t,configurable:!0}),XA="AlertDialog",[ZA,MU]=mi(XA,[c1]),_r=c1(),QA=vr(e=>{const{__scopeAlertDialog:t,...i}=e,n=_r(t);return h.jsx(u1,{...n,...i,modal:!0})},"AlertDialog");w.forwardRef(vr(function(t,i){const{__scopeAlertDialog:n,...o}=t,l=_r(n);return h.jsx(IA,{...l,...o,ref:i})},"AlertDialogTrigger"));var JA=vr(e=>{const{__scopeAlertDialog:t,...i}=e,n=_r(t);return h.jsx(f1,{...n,...i})},"AlertDialogPortal"),eD=w.forwardRef(vr(function(t,i){const{__scopeAlertDialog:n,...o}=t,l=_r(n);return h.jsx(p1,{...l,...o,ref:i})},"AlertDialogOverlay")),tD="AlertDialogContent",[sD,iD]=ZA(tD),rD=w.forwardRef(vr(function(t,i){const{__scopeAlertDialog:n,children:o,...l}=t,u=_r(n),f=w.useRef(null),p=gt(i,f),d=w.useRef(null);return h.jsx(sD,{scope:n,cancelRef:d,children:h.jsx(m1,{role:"alertdialog",...u,...l,ref:p,onOpenAutoFocus:Oe(l.onOpenAutoFocus,_=>{var v;_.preventDefault(),(v=d.current)==null||v.focus({preventScroll:!0})}),onPointerDownOutside:_=>_.preventDefault(),onInteractOutside:_=>_.preventDefault(),children:o})})},"AlertDialogContent")),nD=w.forwardRef(vr(function(t,i){const{__scopeAlertDialog:n,...o}=t,l=_r(n);return h.jsx(v1,{...l,...o,ref:i})},"AlertDialogTitle")),oD=w.forwardRef(vr(function(t,i){const{__scopeAlertDialog:n,...o}=t,l=_r(n);return h.jsx(_1,{...l,...o,ref:i})},"AlertDialogDescription")),aD=w.forwardRef(vr(function(t,i){const{__scopeAlertDialog:n,...o}=t,l=_r(n);return h.jsx(Lh,{...l,...o,ref:i})},"AlertDialogAction")),lD="AlertDialogCancel",cD=w.forwardRef(vr(function(t,i){const{__scopeAlertDialog:n,...o}=t,{cancelRef:l}=iD(lD,n),u=_r(n),f=gt(i,l);return h.jsx(Lh,{...u,...o,ref:f})},"AlertDialogCancel")),uD=QA,hD=JA,dD=eD,fD=rD,pD=aD,mD=cD,gD=nD,vD=oD,_D=Object.defineProperty,yD=(e,t)=>_D(e,"name",{value:t,configurable:!0});function y1(e){const[t,i]=w.useState(void 0);return Cs(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const l=o[0];let u,f;if("borderBoxSize"in l){const p=l.borderBoxSize,d=Array.isArray(p)?p[0]:p;u=d.inlineSize,f=d.blockSize}else u=e.offsetWidth,f=e.offsetHeight;i({width:u,height:f})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else i(void 0)},[e]),t}yD(y1,"useSize");const bD=["top","right","bottom","left"],on=Math.min,lr=Math.max,hh=Math.round,Lu=Math.floor,cr=e=>({x:e,y:e}),xD={left:"right",right:"left",bottom:"top",top:"bottom"};function b1(e,t,i){return lr(e,on(t,i))}function mr(e,t){return typeof e=="function"?e(t):e}function an(e){return e.split("-")[0]}function ya(e){return e.split("-")[1]}function Fg(e){return e==="x"?"y":"x"}function Vg(e){return e==="y"?"height":"width"}function Di(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function qg(e){return Fg(Di(e))}function SD(e,t,i){i===void 0&&(i=!1);const n=ya(e),o=qg(e),l=Vg(o);let u=o==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(u=dh(u)),[u,dh(u)]}function wD(e){const t=dh(e);return[Nm(e),t,Nm(t)]}function Nm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const G0=["left","right"],X0=["right","left"],CD=["top","bottom"],kD=["bottom","top"];function ED(e,t,i){switch(e){case"top":case"bottom":return i?t?X0:G0:t?G0:X0;case"left":case"right":return t?CD:kD;default:return[]}}function ND(e,t,i,n){const o=ya(e);let l=ED(an(e),i==="start",n);return o&&(l=l.map(u=>u+"-"+o),t&&(l=l.concat(l.map(Nm)))),l}function dh(e){const t=an(e);return xD[t]+e.slice(t.length)}function RD(e){var t,i,n,o;return{top:(t=e.top)!=null?t:0,right:(i=e.right)!=null?i:0,bottom:(n=e.bottom)!=null?n:0,left:(o=e.left)!=null?o:0}}function x1(e){return typeof e!="number"?RD(e):{top:e,right:e,bottom:e,left:e}}function fh(e){const{x:t,y:i,width:n,height:o}=e;return{width:n,height:o,top:i,left:t,right:t+n,bottom:i+o,x:t,y:i}}function Z0(e,t,i){let{reference:n,floating:o}=e;const l=Di(t),u=qg(t),f=Vg(u),p=an(t),d=l==="y",_=n.x+n.width/2-o.width/2,v=n.y+n.height/2-o.height/2,b=n[f]/2-o[f]/2;let x;switch(p){case"top":x={x:_,y:n.y-o.height};break;case"bottom":x={x:_,y:n.y+n.height};break;case"right":x={x:n.x+n.width,y:v};break;case"left":x={x:n.x-o.width,y:v};break;default:x={x:n.x,y:n.y}}const y=ya(t);return y&&(x[u]+=b*(y==="end"?1:-1)*(i&&d?-1:1)),x}async function AD(e,t){var i;t===void 0&&(t={});const{x:n,y:o,platform:l,rects:u,elements:f,strategy:p}=e,{boundary:d="clippingAncestors",rootBoundary:_="viewport",elementContext:v="floating",altBoundary:b=!1,padding:x=0}=mr(t,e),y=x1(x),E=f[b?v==="floating"?"reference":"floating":v],N=fh(await l.getClippingRect({element:(i=await(l.isElement==null?void 0:l.isElement(E)))==null||i?E:E.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(f.floating)),boundary:d,rootBoundary:_,strategy:p})),T=v==="floating"?{x:n,y:o,width:u.floating.width,height:u.floating.height}:u.reference,A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f.floating)),j=await(l.isElement==null?void 0:l.isElement(A))&&await(l.getScale==null?void 0:l.getScale(A))||{x:1,y:1},M=fh(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:T,offsetParent:A,strategy:p}):T);return{top:(N.top-M.top+y.top)/j.y,bottom:(M.bottom-N.bottom+y.bottom)/j.y,left:(N.left-M.left+y.left)/j.x,right:(M.right-N.right+y.right)/j.x}}const DD=50,TD=async(e,t,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:l=[],platform:u}=i,f=u.detectOverflow?u:{...u,detectOverflow:AD},p=await(u.isRTL==null?void 0:u.isRTL(t));let d=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:_,y:v}=Z0(d,n,p),b=n,x=0;const y={};for(let S=0;S<l.length;S++){const E=l[S];if(!E)continue;const{name:N,fn:T}=E,{x:A,y:j,data:M,reset:P}=await T({x:_,y:v,initialPlacement:n,placement:b,strategy:o,middlewareData:y,rects:d,platform:f,elements:{reference:e,floating:t}});_=A??_,v=j??v,y[N]={...y[N],...M},P&&x<DD&&(x++,typeof P=="object"&&(P.placement&&(b=P.placement),P.rects&&(d=P.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:_,y:v}=Z0(d,b,p)),S=-1)}return{x:_,y:v,placement:b,strategy:o,middlewareData:y}},jD=e=>({name:"arrow",options:e,async fn(t){const{x:i,y:n,placement:o,rects:l,platform:u,elements:f,middlewareData:p}=t,{element:d,padding:_=0}=mr(e,t)||{};if(d==null)return{};const v=x1(_),b={x:i,y:n},x=qg(o),y=Vg(x),S=await u.getDimensions(d),E=x==="y",N=E?"top":"left",T=E?"bottom":"right",A=E?"clientHeight":"clientWidth",j=l.reference[y]+l.reference[x]-b[x]-l.floating[y],M=b[x]-l.reference[x],P=await(u.getOffsetParent==null?void 0:u.getOffsetParent(d));let D=P?P[A]:0;(!D||!await(u.isElement==null?void 0:u.isElement(P)))&&(D=f.floating[A]||l.floating[y]);const L=j/2-M/2,V=D/2-S[y]/2-1,te=on(v[N],V),U=on(v[T],V),H=D-S[y]-U,B=D/2-S[y]/2+L,W=b1(te,B,H),K=!p.arrow&&ya(o)!=null&&B!==W&&l.reference[y]/2-(B<te?te:U)-S[y]/2<0,O=K?B<te?B-te:B-H:0;return{[x]:b[x]+O,data:{[x]:W,centerOffset:B-W-O,...K&&{alignmentOffset:O}},reset:K}}}),MD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var i,n;const{placement:o,middlewareData:l,rects:u,initialPlacement:f,platform:p,elements:d}=t,{mainAxis:_=!0,crossAxis:v=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:S=!0,...E}=mr(e,t);if((i=l.arrow)!=null&&i.alignmentOffset)return{};const N=an(o),T=Di(f),A=an(f)===f,j=await(p.isRTL==null?void 0:p.isRTL(d.floating)),M=b||(A||!S?[dh(f)]:wD(f)),P=y!=="none";!b&&P&&M.push(...ND(f,S,y,j));const D=[f,...M],L=await p.detectOverflow(t,E),V=[];let te=((n=l.flip)==null?void 0:n.overflows)||[];if(_&&V.push(L[N]),v){const W=SD(o,u,j);V.push(L[W[0]],L[W[1]])}if(te=[...te,{placement:o,overflows:V}],!V.every(W=>W<=0)){var U,H;const W=(((U=l.flip)==null?void 0:U.index)||0)+1,K=D[W];if(K&&(!(v==="alignment"?T!==Di(K):!1)||te.every(F=>Di(F.placement)===T?F.overflows[0]>0:!0)))return{data:{index:W,overflows:te},reset:{placement:K}};let O=(H=te.filter($=>$.overflows[0]<=0).sort(($,F)=>$.overflows[1]-F.overflows[1])[0])==null?void 0:H.placement;if(!O)switch(x){case"bestFit":{var B;const $=(B=te.filter(F=>{if(P){const ae=Di(F.placement);return ae===T||ae==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(ae=>ae>0).reduce((ae,G)=>ae+G,0)]).sort((F,ae)=>F[1]-ae[1])[0])==null?void 0:B[0];$&&(O=$);break}case"initialPlacement":O=f;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function Q0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function J0(e){return bD.some(t=>e[t]>=0)}const OD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:i,platform:n}=t,{strategy:o="referenceHidden",...l}=mr(e,t);switch(o){case"referenceHidden":{const u=await n.detectOverflow(t,{...l,elementContext:"reference"}),f=Q0(u,i.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:J0(f)}}}case"escaped":{const u=await n.detectOverflow(t,{...l,altBoundary:!0}),f=Q0(u,i.floating);return{data:{escapedOffsets:f,escaped:J0(f)}}}default:return{}}}}},S1=new Set(["left","top"]);async function LD(e,t){const{placement:i,platform:n,elements:o}=e,l=await(n.isRTL==null?void 0:n.isRTL(o.floating)),u=an(i),f=ya(i),p=Di(i)==="y",d=S1.has(u)?-1:1,_=l&&p?-1:1,v=mr(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:y}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof y=="number"&&(x=f==="end"?y*-1:y),p?{x:x*_,y:b*d}:{x:b*d,y:x*_}}const zD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var i,n;const{x:o,y:l,placement:u,middlewareData:f}=t,p=await LD(t,e);return u===((i=f.offset)==null?void 0:i.placement)&&(n=f.arrow)!=null&&n.alignmentOffset?{}:{x:o+p.x,y:l+p.y,data:{...p,placement:u}}}}},BD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:o,platform:l}=t,{mainAxis:u=!0,crossAxis:f=!1,limiter:p={fn:T=>{let{x:A,y:j}=T;return{x:A,y:j}}},...d}=mr(e,t),_={x:i,y:n},v=await l.detectOverflow(t,d),b=Di(o),x=Fg(b);let y=_[x],S=_[b];const E=(T,A)=>b1(A+v[T==="y"?"top":"left"],A,A-v[T==="y"?"bottom":"right"]);u&&(y=E(x,y)),f&&(S=E(b,S));const N=p.fn({...t,[x]:y,[b]:S});return{...N,data:{x:N.x-i,y:N.y-n,enabled:{[x]:u,[b]:f}}}}}},PD=function(e){return e===void 0&&(e={}),{options:e,fn(t){var i,n;const{x:o,y:l,placement:u,rects:f,middlewareData:p}=t,{offset:d=0,mainAxis:_=!0,crossAxis:v=!0}=mr(e,t),b={x:o,y:l},x=Di(u),y=Fg(x);let S=b[y],E=b[x];const N=mr(d,t),T=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:(i=N.mainAxis)!=null?i:0,crossAxis:(n=N.crossAxis)!=null?n:0};if(_){const M=y==="y"?"height":"width",P=f.reference[y]-f.floating[M]+T.mainAxis,D=f.reference[y]+f.reference[M]-T.mainAxis;S<P?S=P:S>D&&(S=D)}if(v){var A,j;const M=y==="y"?"width":"height",P=S1.has(an(u)),D=f.reference[x]-f.floating[M]+(P&&((A=p.offset)==null?void 0:A[x])||0)+(P?0:T.crossAxis),L=f.reference[x]+f.reference[M]+(P?0:((j=p.offset)==null?void 0:j[x])||0)-(P?T.crossAxis:0);E<D?E=D:E>L&&(E=L)}return{[y]:S,[x]:E}}}},HD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:i,rects:n,platform:o,elements:l}=t,{apply:u=()=>{},...f}=mr(e,t),p=await o.detectOverflow(t,f),d=an(i),_=ya(i),v=Di(i)==="y",{width:b,height:x}=n.floating;let y,S;d==="top"||d==="bottom"?(y=d,S=_===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(S=d,y=_==="end"?"top":"bottom");const E=x-p.top-p.bottom,N=b-p.left-p.right,T=on(x-p[y],E),A=on(b-p[S],N),j=t.middlewareData.shift,M=!j;let P=T,D=A;j!=null&&j.enabled.x&&(D=N),j!=null&&j.enabled.y&&(P=E),M&&!_&&(v?D=b-2*lr(p.left,p.right):P=x-2*lr(p.top,p.bottom)),await u({...t,availableWidth:D,availableHeight:P});const L=await o.getDimensions(l.floating);return b!==L.width||x!==L.height?{reset:{rects:!0}}:{}}}};function Bh(){return typeof window<"u"}function ba(e){return w1(e)?(e.nodeName||"").toLowerCase():"#document"}function ks(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yr(e){var t;return(t=(w1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function w1(e){return Bh()?e instanceof Node||e instanceof ks(e).Node:!1}function Oi(e){return Bh()?e instanceof Element||e instanceof ks(e).Element:!1}function cn(e){return Bh()?e instanceof HTMLElement||e instanceof ks(e).HTMLElement:!1}function ex(e){return!Bh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ks(e).ShadowRoot}function Ph(e){const{overflow:t,overflowX:i,overflowY:n,display:o}=Li(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&o!=="inline"&&o!=="contents"}function ID(e){return/^(table|td|th)$/.test(ba(e))}function Hh(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const $D=/transform|translate|scale|rotate|perspective|filter/,UD=/paint|layout|strict|content/,jn=e=>!!e&&e!=="none";let Mp;function Yg(e){const t=Oi(e)?Li(e):e;return jn(t.transform)||jn(t.translate)||jn(t.scale)||jn(t.rotate)||jn(t.perspective)||!Wg()&&(jn(t.backdropFilter)||jn(t.filter))||$D.test(t.willChange||"")||UD.test(t.contain||"")}function FD(e){let t=Fn(e);for(;cn(t)&&!Ul(t);){if(Yg(t))return t;if(Hh(t))return null;t=Fn(t)}return null}function Wg(){return Mp==null&&(Mp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Mp}function Ul(e){return/^(html|body|#document)$/.test(ba(e))}function Li(e){return ks(e).getComputedStyle(e)}function Ih(e){return Oi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fn(e){if(ba(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ex(e)&&e.host||yr(e);return ex(t)?t.host:t}function C1(e){const t=Fn(e);return Ul(t)?(e.ownerDocument||e).body:cn(t)&&Ph(t)?t:C1(t)}function Fl(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const o=C1(e),l=o===((n=e.ownerDocument)==null?void 0:n.body),u=ks(o);if(l){const f=Rm(u);return t.concat(u,u.visualViewport||[],Ph(o)?o:[],f&&i?Fl(f):[])}else return t.concat(o,Fl(o,[],i))}function Rm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function k1(e){const t=Li(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=cn(e),l=o?e.offsetWidth:i,u=o?e.offsetHeight:n,f=hh(i)!==l||hh(n)!==u;return f&&(i=l,n=u),{width:i,height:n,$:f}}function Kg(e){return Oi(e)?e:e.contextElement}function ra(e){const t=Kg(e);if(!cn(t))return cr(1);const i=t.getBoundingClientRect(),{width:n,height:o,$:l}=k1(t);let u=(l?hh(i.width):i.width)/n,f=(l?hh(i.height):i.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const VD=cr(0);function E1(e){const t=ks(e);return!Wg()||!t.visualViewport?VD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qD(e,t,i){return t===void 0&&(t=!1),!!i&&t&&i===ks(e)}function Vn(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const o=e.getBoundingClientRect(),l=Kg(e);let u=cr(1);t&&(n?Oi(n)&&(u=ra(n)):u=ra(e));const f=qD(l,i,n)?E1(l):cr(0);let p=(o.left+f.x)/u.x,d=(o.top+f.y)/u.y,_=o.width/u.x,v=o.height/u.y;if(l&&n){const b=ks(l),x=Oi(n)?ks(n):n;let y=b,S=Rm(y);for(;S&&x!==y;){const E=ra(S),N=S.getBoundingClientRect(),T=Li(S),A=N.left+(S.clientLeft+parseFloat(T.paddingLeft))*E.x,j=N.top+(S.clientTop+parseFloat(T.paddingTop))*E.y;p*=E.x,d*=E.y,_*=E.x,v*=E.y,p+=A,d+=j,y=ks(S),S=Rm(y)}}return fh({width:_,height:v,x:p,y:d})}function $h(e,t){const i=Ih(e).scrollLeft;return t?t.left+i:Vn(yr(e)).left+i}function N1(e,t){const i=e.getBoundingClientRect(),n=i.left+t.scrollLeft-$h(e,i),o=i.top+t.scrollTop;return{x:n,y:o}}function YD(e){let{elements:t,rect:i,offsetParent:n,strategy:o}=e;const l=o==="fixed",u=yr(n),f=t?Hh(t.floating):!1;if(n===u||f&&l)return i;let p={scrollLeft:0,scrollTop:0},d=cr(1);const _=cr(0),v=cn(n);if((v||!l)&&((ba(n)!=="body"||Ph(u))&&(p=Ih(n)),v)){const x=Vn(n);d=ra(n),_.x=x.x+n.clientLeft,_.y=x.y+n.clientTop}const b=u&&!v&&!l?N1(u,p):cr(0);return{width:i.width*d.x,height:i.height*d.y,x:i.x*d.x-p.scrollLeft*d.x+_.x+b.x,y:i.y*d.y-p.scrollTop*d.y+_.y+b.y}}function WD(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function KD(e){const t=Ih(e),i=e.ownerDocument.body,n=lr(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=lr(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let l=-t.scrollLeft+$h(e);const u=-t.scrollTop;return Li(i).direction==="rtl"&&(l+=lr(e.clientWidth,i.clientWidth)-n),{width:n,height:o,x:l,y:u}}const GD=25;function XD(e,t,i){i===void 0&&(i="viewport");const n=i==="layoutViewport",o=ks(e),l=yr(e),u=o.visualViewport;let f=l.clientWidth,p=l.clientHeight,d=0,_=0;if(u){const b=!Wg()||t==="fixed";n?b||(d=-u.offsetLeft,_=-u.offsetTop):(f=u.width,p=u.height,b&&(d=u.offsetLeft,_=u.offsetTop))}if($h(l)<=0){const b=l.ownerDocument,x=b.body,y=getComputedStyle(x),S=b.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,E=Math.abs(l.clientWidth-x.clientWidth-S),N=getComputedStyle(l).scrollbarGutter==="stable both-edges"?E/2:E;N<=GD&&(f-=N)}return{width:f,height:p,x:d,y:_}}function ZD(e,t){const i=Vn(e,!0,t==="fixed"),n=i.top+e.clientTop,o=i.left+e.clientLeft,l=ra(e),u=e.clientWidth*l.x,f=e.clientHeight*l.y,p=o*l.x,d=n*l.y;return{width:u,height:f,x:p,y:d}}function tx(e,t,i){let n;if(t==="viewport"||t==="layoutViewport")n=XD(e,i,t);else if(t==="document")n=KD(yr(e));else if(Oi(t))n=ZD(t,i);else{const o=E1(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return fh(n)}function QD(e,t){const i=t.get(e);if(i)return i;let n=Fl(e,[],!1).filter(f=>Oi(f)&&ba(f)!=="body"),o=null;const l=Li(e).position==="fixed";let u=l?Fn(e):e;for(;Oi(u)&&!Ul(u);){const f=Li(u),p=Yg(u),d=o?o.position:l?"fixed":"";!p&&(d==="fixed"||d==="absolute"&&f.position==="static")?n=n.filter(v=>v!==u):o=f,u=Fn(u)}return t.set(e,n),n}function JD(e){let{element:t,boundary:i,rootBoundary:n,strategy:o}=e;const u=[...i==="clippingAncestors"?Hh(t)?[]:QD(t,this._c):[].concat(i),n],f=tx(t,u[0],o);let p=f.top,d=f.right,_=f.bottom,v=f.left;for(let b=1;b<u.length;b++){const x=tx(t,u[b],o);p=lr(x.top,p),d=on(x.right,d),_=on(x.bottom,_),v=lr(x.left,v)}return{width:d-v,height:_-p,x:v,y:p}}function eT(e){const{width:t,height:i}=k1(e);return{width:t,height:i}}function tT(e,t,i){const n=cn(t),o=yr(t),l=i==="fixed",u=Vn(e,!0,l,t);let f={scrollLeft:0,scrollTop:0};const p=cr(0);if((n||!l)&&((ba(t)!=="body"||Ph(o))&&(f=Ih(t)),n)){const b=Vn(t,!0,l,t);p.x=b.x+t.clientLeft,p.y=b.y+t.clientTop}!n&&o&&(p.x=$h(o));const d=o&&!n&&!l?N1(o,f):cr(0),_=u.left+f.scrollLeft-p.x-d.x,v=u.top+f.scrollTop-p.y-d.y;return{x:_,y:v,width:u.width,height:u.height}}function Op(e){return Li(e).position==="static"}function sx(e,t){if(!cn(e)||Li(e).position==="fixed")return null;if(t)return t(e);let i=e.offsetParent;return yr(e)===i&&(i=i.ownerDocument.body),i}function R1(e,t){const i=ks(e);if(Hh(e))return i;if(!cn(e)){let o=Fn(e);for(;o&&!Ul(o);){if(Oi(o)&&!Op(o))return o;o=Fn(o)}return i}let n=sx(e,t);for(;n&&ID(n)&&Op(n);)n=sx(n,t);return n&&Ul(n)&&Op(n)&&!Yg(n)?i:n||FD(e)||i}const sT=async function(e){const t=this.getOffsetParent||R1,i=this.getDimensions,n=await i(e.floating);return{reference:tT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function iT(e){return Li(e).direction==="rtl"}const rT={convertOffsetParentRelativeRectToViewportRelativeRect:YD,getDocumentElement:yr,getClippingRect:JD,getOffsetParent:R1,getElementRects:sT,getClientRects:WD,getDimensions:eT,getScale:ra,isElement:Oi,isRTL:iT};function A1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nT(e,t,i){let n=null,o;const l=yr(e);function u(){var _;clearTimeout(o),(_=n)==null||_.disconnect(),n=null}function f(_,v){_===void 0&&(_=!1),v===void 0&&(v=1),u();const b=e.getBoundingClientRect(),{left:x,top:y,width:S,height:E}=b;if(_||t(),!S||!E)return;const N=Lu(y),T=Lu(l.clientWidth-(x+S)),A=Lu(l.clientHeight-(y+E)),j=Lu(x),P={rootMargin:-N+"px "+-T+"px "+-A+"px "+-j+"px",threshold:lr(0,on(1,v))||1};let D=!0;function L(V){const te=V[0].intersectionRatio;if(!A1(b,e.getBoundingClientRect()))return f();if(te!==v){if(!D)return f();te?f(!1,te):o=setTimeout(()=>{f(!1,1e-7)},1e3)}D=!1}try{n=new IntersectionObserver(L,{...P,root:l.ownerDocument})}catch{n=new IntersectionObserver(L,P)}n.observe(e)}const p=ks(e),d=()=>f(i);return p.addEventListener("resize",d),f(!0),()=>{p.removeEventListener("resize",d),u()}}function oT(e,t,i,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:p=!1}=n,d=Kg(e),_=o||l?[...d?Fl(d):[],...t?Fl(t):[]]:[];_.forEach(N=>{o&&N.addEventListener("scroll",i),l&&N.addEventListener("resize",i)});const v=d&&f?nT(d,i,l):null;let b=-1,x=null;u&&(x=new ResizeObserver(N=>{let[T]=N;T&&T.target===d&&x&&t&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=x)==null||A.observe(t)})),i()}),d&&!p&&x.observe(d),t&&x.observe(t));let y,S=p?Vn(e):null;p&&E();function E(){const N=Vn(e);S&&!A1(S,N)&&i(),S=N,y=requestAnimationFrame(E)}return i(),()=>{var N;_.forEach(T=>{o&&T.removeEventListener("scroll",i),l&&T.removeEventListener("resize",i)}),v==null||v(),(N=x)==null||N.disconnect(),x=null,p&&cancelAnimationFrame(y)}}const aT=zD,lT=BD,cT=MD,uT=HD,hT=OD,ix=jD,dT=PD,fT=(e,t,i)=>{const n=new Map,o=i??{},l={...rT,...o.platform,_c:n};return TD(e,t,{...o,platform:l})};var pT=typeof document<"u",mT=function(){},eh=pT?w.useLayoutEffect:mT;function ph(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let i,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(i=e.length,i!==t.length)return!1;for(n=i;n--!==0;)if(!ph(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),i=o.length,i!==Object.keys(t).length)return!1;for(n=i;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=i;n--!==0;){const l=o[n];if(!(l==="_owner"&&e.$$typeof)&&!ph(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function D1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rx(e,t){const i=D1(e);return Math.round(t*i)/i}function Lp(e){const t=w.useRef(e);return eh(()=>{t.current=e}),t}function gT(e){e===void 0&&(e={});const{placement:t="bottom",strategy:i="absolute",middleware:n=[],platform:o,elements:{reference:l,floating:u}={},transform:f=!0,whileElementsMounted:p,open:d}=e,[_,v]=w.useState({x:0,y:0,strategy:i,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=w.useState(n);ph(b,n)||x(n);const[y,S]=w.useState(null),[E,N]=w.useState(null),T=w.useCallback(F=>{F!==P.current&&(P.current=F,S(F))},[]),A=w.useCallback(F=>{F!==D.current&&(D.current=F,N(F))},[]),j=l||y,M=u||E,P=w.useRef(null),D=w.useRef(null),L=w.useRef(_),V=p!=null,te=Lp(p),U=Lp(o),H=Lp(d),B=w.useCallback(()=>{if(!P.current||!D.current)return;const F={placement:t,strategy:i,middleware:b};U.current&&(F.platform=U.current),fT(P.current,D.current,F).then(ae=>{const G={...ae,isPositioned:H.current!==!1};W.current&&!ph(L.current,G)&&(L.current=G,Tg.flushSync(()=>{v(G)}))})},[b,t,i,U,H]);eh(()=>{d===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,v(F=>({...F,isPositioned:!1})))},[d]);const W=w.useRef(!1);eh(()=>(W.current=!0,()=>{W.current=!1}),[]),eh(()=>{if(j&&(P.current=j),M&&(D.current=M),j&&M){if(te.current)return te.current(j,M,B);B()}},[j,M,B,te,V]);const K=w.useMemo(()=>({reference:P,floating:D,setReference:T,setFloating:A}),[T,A]),O=w.useMemo(()=>({reference:j,floating:M}),[j,M]),$=w.useMemo(()=>{const F={position:i,left:0,top:0};if(!O.floating)return F;const ae=rx(O.floating,_.x),G=rx(O.floating,_.y);return f?{...F,transform:"translate("+ae+"px, "+G+"px)",...D1(O.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:ae,top:G}},[i,f,O.floating,_.x,_.y]);return w.useMemo(()=>({..._,update:B,refs:K,elements:O,floatingStyles:$}),[_,B,K,O,$])}const vT=e=>{function t(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){const{element:n,padding:o}=typeof e=="function"?e(i):e;return n&&t(n)?n.current!=null?ix({element:n.current,padding:o}).fn(i):{}:n?ix({element:n,padding:o}).fn(i):{}}}},_T=(e,t)=>{const i=aT(e);return{name:i.name,fn:i.fn,options:[e,t]}},yT=(e,t)=>{const i=lT(e);return{name:i.name,fn:i.fn,options:[e,t]}},bT=(e,t)=>({fn:dT(e).fn,options:[e,t]}),xT=(e,t)=>{const i=cT(e);return{name:i.name,fn:i.fn,options:[e,t]}},ST=(e,t)=>{const i=uT(e);return{name:i.name,fn:i.fn,options:[e,t]}},wT=(e,t)=>{const i=hT(e);return{name:i.name,fn:i.fn,options:[e,t]}},CT=(e,t)=>{const i=vT(e);return{name:i.name,fn:i.fn,options:[e,t]}};var kT=Object.defineProperty,ET=(e,t)=>kT(e,"name",{value:t,configurable:!0}),NT=w.forwardRef(ET(function(t,i){const{children:n,width:o=10,height:l=5,...u}=t;return h.jsx(vt.svg,{...u,ref:i,width:o,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),RT=NT,AT=Object.defineProperty,ur=(e,t)=>AT(e,"name",{value:t,configurable:!0}),T1="Popper",[j1,Uh]=mi(T1),[DT,M1]=j1(T1),TT=ur(e=>{const{__scopePopper:t,children:i}=e,[n,o]=w.useState(null),[l,u]=w.useState(void 0);return h.jsx(DT,{scope:t,anchor:n,onAnchorChange:o,placementState:l,setPlacementState:u,children:i})},"Popper"),jT="PopperAnchor",MT=w.forwardRef(ur(function(t,i){const{__scopePopper:n,virtualRef:o,...l}=t,u=M1(jT,n),f=w.useRef(null),p=u.onAnchorChange,d=w.useCallback(S=>{f.current=S,S&&p(S)},[p]),_=gt(i,d),v=w.useRef(null);w.useEffect(()=>{if(!o)return;const S=v.current;v.current=o.current,S!==v.current&&p(v.current)});const b=u.placementState&&Fh(u.placementState),x=b==null?void 0:b[0],y=b==null?void 0:b[1];return o?null:h.jsx(vt.div,{"data-radix-popper-side":x,"data-radix-popper-align":y,...l,ref:_})},"PopperAnchor")),O1="PopperContent",[OT,LT]=j1(O1),zT=w.forwardRef(ur(function(t,i){var ce,ke,Ae,rt,De,ft,wr;const{__scopePopper:n,side:o="bottom",sideOffset:l=0,align:u="center",alignOffset:f=0,arrowPadding:p=0,avoidCollisions:d=!0,collisionBoundary:_=[],collisionPadding:v=0,sticky:b="partial",hideWhenDetached:x=!1,updatePositionStrategy:y="optimized",onPlaced:S,...E}=t,N=M1(O1,n),[T,A]=w.useState(null),j=gt(i,A),[M,P]=w.useState(null),D=y1(M),L=(D==null?void 0:D.width)??0,V=(D==null?void 0:D.height)??0,te=o+(u!=="center"?"-"+u:""),U=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},H=Array.isArray(_)?_:[_],B=H.length>0,W={padding:U,boundary:H.filter(L1),altBoundary:B},{refs:K,floatingStyles:O,placement:$,isPositioned:F,middlewareData:ae}=gT({strategy:"fixed",placement:te,whileElementsMounted:ur((...Bi)=>oT(...Bi,{animationFrame:y==="always"}),"whileElementsMounted"),elements:{reference:N.anchor},middleware:[_T({mainAxis:l+V,alignmentAxis:f}),d&&yT({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?bT():void 0,...W}),d&&xT({...W}),ST({...W,apply:ur(({elements:Bi,rects:hn,availableWidth:dn,availableHeight:Cr})=>{const{width:fn,height:Pi}=hn.reference,Se=Bi.floating.style;Se.setProperty("--radix-popper-available-width",`${dn}px`),Se.setProperty("--radix-popper-available-height",`${Cr}px`),Se.setProperty("--radix-popper-anchor-width",`${fn}px`),Se.setProperty("--radix-popper-anchor-height",`${Pi}px`)},"apply")}),M&&CT({element:M,padding:p}),IT({arrowWidth:L,arrowHeight:V}),x&&wT({strategy:"referenceHidden",...W,boundary:B?W.boundary:void 0})]}),G=N.setPlacementState;Cs(()=>(G($),()=>{G(void 0)}),[$,G]);const[z,Q]=Fh($),se=pr(S);Cs(()=>{F&&(se==null||se())},[F,se]);const le=(ce=ae.arrow)==null?void 0:ce.x,ue=(ke=ae.arrow)==null?void 0:ke.y,de=((Ae=ae.arrow)==null?void 0:Ae.centerOffset)!==0,[we,me]=w.useState();return Cs(()=>{T&&me(window.getComputedStyle(T).zIndex)},[T]),h.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:F?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:we,"--radix-popper-transform-origin":[(rt=ae.transformOrigin)==null?void 0:rt.x,(De=ae.transformOrigin)==null?void 0:De.y].join(" "),...((ft=ae.hide)==null?void 0:ft.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:h.jsx(OT,{scope:n,placedSide:z,placedAlign:Q,onArrowChange:P,arrowX:le,arrowY:ue,shouldHideArrow:de,children:h.jsx(vt.div,{"data-side":z,"data-align":Q,...E,ref:j,style:{...E.style,animation:F?(wr=E.style)==null?void 0:wr.animation:"none"}})})})},"PopperContent")),BT="PopperArrow",PT={top:"bottom",right:"left",bottom:"top",left:"right"},HT=w.forwardRef(ur(function(t,i){const{__scopePopper:n,...o}=t,l=LT(BT,n),u=PT[l.placedSide];return h.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:h.jsx(RT,{...o,ref:i,style:{...o.style,display:"block"}})})},"PopperArrow"));function L1(e){return e!==null}ur(L1,"isNotNull");var IT=ur(e=>({name:"transformOrigin",options:e,fn(t){var E,N,T;const{placement:i,rects:n,middlewareData:o}=t,u=((E=o.arrow)==null?void 0:E.centerOffset)!==0,f=u?0:e.arrowWidth,p=u?0:e.arrowHeight,[d,_]=Fh(i),v={start:"0%",center:"50%",end:"100%"}[_],b=(((N=o.arrow)==null?void 0:N.x)??0)+f/2,x=(((T=o.arrow)==null?void 0:T.y)??0)+p/2;let y="",S="";return d==="bottom"?(y=u?v:`${b}px`,S=`${-p}px`):d==="top"?(y=u?v:`${b}px`,S=`${n.floating.height+p}px`):d==="right"?(y=`${-p}px`,S=u?v:`${x}px`):d==="left"&&(y=`${n.floating.width+p}px`,S=u?v:`${x}px`),{data:{x:y,y:S}}}}),"transformOrigin");function Fh(e){const[t,i="center"]=e.split("-");return[t,i]}ur(Fh,"getSideAndAlignFromPlacement");var z1=TT,B1=MT,P1=zT,$T=HT,UT=Object.defineProperty,Gg=(e,t)=>UT(e,"name",{value:t,configurable:!0}),zp=!1;function H1(){const[e,t]=w.useState(zp);return w.useEffect(()=>{zp||(zp=!0,t(!0))},[]),e}Gg(H1,"useIsHydrated");var I1=ga[" useSyncExternalStore ".trim().toString()];function $1(){return()=>{}}Gg($1,"subscribe");function U1(){return I1($1,()=>!0,()=>!1)}Gg(U1,"useIsHydratedModern");var FT=typeof I1=="function"?U1:H1,VT=Object.defineProperty,Zn=(e,t)=>VT(e,"name",{value:t,configurable:!0}),Bp="rovingFocusGroup.onEntryFocus",qT={bubbles:!1,cancelable:!0},Vh="RovingFocusGroup",[Am,F1,YT]=Og(Vh),[WT,qh]=mi(Vh,[YT]),[KT,GT]=WT(Vh),XT=w.forwardRef(Zn(function(t,i){return h.jsx(Am.Provider,{scope:t.__scopeRovingFocusGroup,children:h.jsx(Am.Slot,{scope:t.__scopeRovingFocusGroup,children:h.jsx(ZT,{...t,ref:i})})})},"RovingFocusGroup")),ZT=w.forwardRef(Zn(function(t,i){const{__scopeRovingFocusGroup:n,orientation:o,loop:l=!1,dir:u,currentTabStopId:f,defaultCurrentTabStopId:p,onCurrentTabStopIdChange:d,onEntryFocus:_,preventScrollOnEntryFocus:v=!1,...b}=t,x=w.useRef(null),y=gt(i,x),S=jh(u),[E,N]=_a({prop:f,defaultProp:p??null,onChange:d,caller:Vh}),[T,A]=w.useState(!1),j=pr(_),M=F1(n),P=w.useRef(!1),[D,L]=w.useState(0);return w.useEffect(()=>{const V=x.current;if(V)return V.addEventListener(Bp,j),()=>V.removeEventListener(Bp,j)},[j]),h.jsx(KT,{scope:n,orientation:o,dir:S,loop:l,currentTabStopId:E,onItemFocus:w.useCallback(V=>N(V),[N]),onItemShiftTab:w.useCallback(()=>A(!0),[]),onFocusableItemAdd:w.useCallback(()=>L(V=>V+1),[]),onFocusableItemRemove:w.useCallback(()=>L(V=>V-1),[]),children:h.jsx(vt.div,{tabIndex:T||D===0?-1:0,"data-orientation":o,...b,ref:y,style:{outline:"none",...t.style},onMouseDown:Oe(t.onMouseDown,()=>{P.current=!0}),onFocus:Oe(t.onFocus,V=>{const te=!P.current;if(V.target===V.currentTarget&&te&&!T){const U=new CustomEvent(Bp,qT);if(V.currentTarget.dispatchEvent(U),!U.defaultPrevented){const H=M().filter($=>$.focusable),B=H.find($=>$.active),W=H.find($=>$.id===E),O=[B,W,...H].filter(Boolean).map($=>$.ref.current);Xg(O,v)}}P.current=!1}),onBlur:Oe(t.onBlur,()=>A(!1))})})},"RovingFocusGroupImpl")),QT="RovingFocusGroupItem",JT=w.forwardRef(Zn(function(t,i){const{__scopeRovingFocusGroup:n,focusable:o=!0,active:l=!1,tabStopId:u,children:f,...p}=t,d=In(),_=u||d,v=GT(QT,n),b=v.currentTabStopId===_,x=F1(n),{onFocusableItemAdd:y,onFocusableItemRemove:S,currentTabStopId:E}=v,N=FT();return Cs(()=>{if(!(!N||!o))return y(),()=>S()},[N,o,y,S]),w.useEffect(()=>{if(!(N||!o))return y(),()=>S()},[N,o,y,S]),h.jsx(Am.ItemSlot,{scope:n,id:_,focusable:o,active:l,children:h.jsx(vt.span,{tabIndex:b?0:-1,"data-orientation":v.orientation,...p,ref:i,onMouseDown:Oe(t.onMouseDown,T=>{o?v.onItemFocus(_):T.preventDefault()}),onFocus:Oe(t.onFocus,()=>v.onItemFocus(_)),onKeyDown:Oe(t.onKeyDown,T=>{if(T.key==="Tab"&&T.shiftKey){v.onItemShiftTab();return}if(T.target!==T.currentTarget)return;const A=q1(T,v.orientation,v.dir);if(A!==void 0){if(T.metaKey||T.ctrlKey||T.altKey||T.shiftKey)return;T.preventDefault();let M=x().filter(P=>P.focusable).map(P=>P.ref.current);if(A==="last")M.reverse();else if(A==="prev"||A==="next"){A==="prev"&&M.reverse();const P=M.indexOf(T.currentTarget);M=v.loop?Y1(M,P+1):M.slice(P+1)}setTimeout(()=>Xg(M))}}),children:typeof f=="function"?f({isCurrentTabStop:b,hasTabStop:E!=null}):f})})},"RovingFocusGroupItem")),e5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function V1(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Zn(V1,"getDirectionAwareKey");function q1(e,t,i){const n=V1(e.key,i);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return e5[n]}Zn(q1,"getFocusIntent");function Xg(e,t=!1){const i=document.activeElement;for(const n of e)if(n===i||(n.focus({preventScroll:t}),document.activeElement!==i))return}Zn(Xg,"focusFirst");function Y1(e,t){return e.map((i,n)=>e[(t+n)%e.length])}Zn(Y1,"wrapArray");var W1=XT,K1=JT,t5=Object.defineProperty,at=(e,t)=>t5(e,"name",{value:t,configurable:!0}),s5=["Enter"," "],i5=["ArrowDown","PageUp","Home"],G1=["ArrowUp","PageDown","End"],r5=[...i5,...G1],Yh="Menu",[Dm,n5,o5]=Og(Yh),[Qn,X1]=mi(Yh,[o5,Uh,qh]),Zg=Uh(),Z1=qh(),[a5,Jl]=Qn(Yh),[l5,Qg]=Qn(Yh),c5=at(e=>{const{__scopeMenu:t,open:i=!1,children:n,dir:o,onOpenChange:l,modal:u=!0}=e,f=Zg(t),[p,d]=w.useState(null),_=w.useRef(!1),v=pr(l),b=jh(o);return w.useEffect(()=>{const x=at(()=>{_.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},"handleKeyDown"),y=at(()=>_.current=!1,"handlePointer");return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),w.useEffect(()=>{if(!i)return;const x=at(()=>v(!1),"handleBlur");return window.addEventListener("blur",x),()=>window.removeEventListener("blur",x)},[i,v]),h.jsx(z1,{...f,children:h.jsx(a5,{scope:t,open:i,onOpenChange:v,content:p,onContentChange:d,children:h.jsx(l5,{scope:t,onClose:w.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:_,dir:b,modal:u,children:n})})})},"Menu"),u5=w.forwardRef(at(function(t,i){const{__scopeMenu:n,...o}=t,l=Zg(n);return h.jsx(B1,{...l,...o,ref:i})},"MenuAnchor")),Q1="MenuPortal",[h5,d5]=Qn(Q1,{forceMount:void 0}),f5=at(e=>{const{__scopeMenu:t,forceMount:i,children:n,container:o}=e,l=Jl(Q1,t);return h.jsx(h5,{scope:t,forceMount:i,children:h.jsx(ln,{present:i||l.open,children:h.jsx(Hg,{asChild:!0,container:o,children:n})})})},"MenuPortal"),rn="MenuContent",[p5,J1]=Qn(rn),m5=w.forwardRef(at(function(t,i){const n=d5(rn,t.__scopeMenu),{forceMount:o=n.forceMount,...l}=t,u=Jl(rn,t.__scopeMenu),f=Qg(rn,t.__scopeMenu);return h.jsx(Dm.Provider,{scope:t.__scopeMenu,children:h.jsx(ln,{present:o||u.open,children:h.jsx(Dm.Slot,{scope:t.__scopeMenu,children:f.modal?h.jsx(g5,{...l,ref:i}):h.jsx(v5,{...l,ref:i})})})})},"MenuContent")),g5=w.forwardRef(at(function(t,i){const n=Jl(rn,t.__scopeMenu),o=w.useRef(null),l=gt(i,o);return w.useEffect(()=>{const u=o.current;if(u)return a1(u)},[]),h.jsx(eC,{...t,ref:l,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Oe(t.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentModal")),v5=w.forwardRef(at(function(t,i){const n=Jl(rn,t.__scopeMenu);return h.jsx(eC,{...t,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentNonModal")),_5=dr("MenuContent.ScrollLock"),eC=w.forwardRef(at(function(t,i){const{__scopeMenu:n,loop:o=!1,trapFocus:l,onOpenAutoFocus:u,onCloseAutoFocus:f,disableOutsidePointerEvents:p,onEntryFocus:d,onEscapeKeyDown:_,onPointerDownOutside:v,onFocusOutside:b,onInteractOutside:x,onDismiss:y,disableOutsideScroll:S,...E}=t,N=Jl(rn,n),T=Qg(rn,n),A=Zg(n),j=Z1(n),M=n5(n),[P,D]=w.useState(null),L=w.useRef(null),V=gt(i,L,N.onContentChange),te=w.useRef(0),U=w.useRef(""),H=w.useRef(0),B=w.useRef(null),W=w.useRef("right"),K=w.useRef(0),O=S?$g:w.Fragment,$=S?{as:_5,allowPinchZoom:!0}:void 0,F=at(G=>{var me,ce;const z=U.current+G,Q=M().filter(ke=>!ke.disabled),se=document.activeElement,le=(me=Q.find(ke=>ke.ref.current===se))==null?void 0:me.textValue,ue=Q.map(ke=>ke.textValue),de=nC(ue,z,le),we=(ce=Q.find(ke=>ke.textValue===de))==null?void 0:ce.ref.current;at((function ke(Ae){U.current=Ae,window.clearTimeout(te.current),Ae!==""&&(te.current=window.setTimeout(()=>ke(""),1e3))}),"updateSearch")(z),we&&setTimeout(()=>we.focus())},"handleTypeaheadSearch");w.useEffect(()=>()=>window.clearTimeout(te.current),[]),Mh();const ae=w.useCallback(G=>{var Q,se;return W.current===((Q=B.current)==null?void 0:Q.side)&&aC(G,(se=B.current)==null?void 0:se.area)},[]);return h.jsx(p5,{scope:n,searchRef:U,onItemEnter:w.useCallback(G=>{ae(G)&&G.preventDefault()},[ae]),onItemLeave:w.useCallback(G=>{var z;ae(G)||((z=L.current)==null||z.focus(),D(null))},[ae]),onTriggerLeave:w.useCallback(G=>{ae(G)&&G.preventDefault()},[ae]),pointerGraceTimerRef:H,onPointerGraceIntentChange:w.useCallback(G=>{B.current=G},[]),children:h.jsx(O,{...$,children:h.jsx(Yw,{asChild:!0,trapped:l,onMountAutoFocus:Oe(u,G=>{var z;G.preventDefault(),(z=L.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:f,children:h.jsx(zg,{asChild:!0,disableOutsidePointerEvents:p,onEscapeKeyDown:_,onPointerDownOutside:v,onFocusOutside:b,onInteractOutside:x,onDismiss:y,children:h.jsx(W1,{asChild:!0,...j,dir:T.dir,orientation:"vertical",loop:o,currentTabStopId:P,onCurrentTabStopIdChange:D,onEntryFocus:Oe(d,G=>{T.isUsingKeyboardRef.current||G.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(P1,{role:"menu","aria-orientation":"vertical","data-state":tC(N.open),"data-radix-menu-content":"",dir:T.dir,...A,...E,ref:V,style:{outline:"none",...E.style},onKeyDown:Oe(E.onKeyDown,G=>{const Q=G.target.closest("[data-radix-menu-content]")===G.currentTarget,se=G.ctrlKey||G.altKey||G.metaKey,le=G.key.length===1;Q&&(G.key==="Tab"&&G.preventDefault(),!se&&le&&F(G.key));const ue=L.current;if(G.target!==ue||!r5.includes(G.key))return;G.preventDefault();const we=M().filter(me=>!me.disabled).map(me=>me.ref.current);G1.includes(G.key)&&we.reverse(),iC(we)}),onBlur:Oe(t.onBlur,G=>{G.currentTarget.contains(G.target)||(window.clearTimeout(te.current),U.current="")}),onPointerMove:Oe(t.onPointerMove,mh(G=>{const z=G.target,Q=K.current!==G.clientX;if(G.currentTarget.contains(z)&&Q){const se=G.clientX>K.current?"right":"left";W.current=se,K.current=G.clientX}}))})})})})})})},"MenuContentImpl")),Tm="MenuItem",nx="menu.itemSelect",y5=w.forwardRef(at(function(t,i){const{disabled:n=!1,onSelect:o,...l}=t,u=w.useRef(null),f=Qg(Tm,t.__scopeMenu),p=J1(Tm,t.__scopeMenu),d=gt(i,u),_=w.useRef(!1),v=at(()=>{const b=u.current;if(!n&&b){const x=new CustomEvent(nx,{bubbles:!0,cancelable:!0});b.addEventListener(nx,y=>o==null?void 0:o(y),{once:!0}),Mg(b,x),x.defaultPrevented?_.current=!1:f.onClose()}},"handleSelect");return h.jsx(b5,{...l,ref:d,disabled:n,onClick:Oe(t.onClick,v),onPointerDown:b=>{var x;(x=t.onPointerDown)==null||x.call(t,b),_.current=!0},onPointerUp:Oe(t.onPointerUp,b=>{var x;_.current||(x=b.currentTarget)==null||x.click()}),onKeyDown:Oe(t.onKeyDown,b=>{n||b.target!==b.currentTarget||p.searchRef.current!==""&&b.key===" "||s5.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})},"MenuItem")),b5=w.forwardRef(at(function(t,i){const{__scopeMenu:n,disabled:o=!1,textValue:l,...u}=t,f=J1(Tm,n),p=Z1(n),d=w.useRef(null),_=gt(i,d),[v,b]=w.useState(!1),[x,y]=w.useState("");return w.useEffect(()=>{const S=d.current;S&&y((S.textContent??"").trim())},[u.children]),h.jsx(Dm.ItemSlot,{scope:n,disabled:o,textValue:l??x,children:h.jsx(K1,{asChild:!0,...p,focusable:!o,children:h.jsx(vt.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...u,ref:_,onPointerMove:Oe(t.onPointerMove,mh(S=>{o?f.onItemLeave(S):(f.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Oe(t.onPointerLeave,mh(S=>f.onItemLeave(S))),onFocus:Oe(t.onFocus,()=>b(!0)),onBlur:Oe(t.onBlur,()=>b(!1))})})})},"MenuItemImpl")),x5="MenuRadioGroup",[OU,LU]=Qn(x5,{value:void 0,onValueChange:at(()=>{},"onValueChange")}),S5="MenuItemIndicator",[zU,BU]=Qn(S5,{checked:!1}),w5=w.forwardRef(at(function(t,i){const{__scopeMenu:n,...o}=t;return h.jsx(vt.div,{role:"separator","aria-orientation":"horizontal",...o,ref:i})},"MenuSeparator")),C5="MenuSub",[PU,HU]=Qn(C5);function tC(e){return e?"open":"closed"}at(tC,"getOpenState");function sC(e){return e==="indeterminate"}at(sC,"isIndeterminate");function k5(e){return sC(e)?"indeterminate":e?"checked":"unchecked"}at(k5,"getCheckedState");function iC(e){const t=document.activeElement;for(const i of e)if(i===t||(i.focus(),document.activeElement!==t))return}at(iC,"focusFirst");function rC(e,t){return e.map((i,n)=>e[(t+n)%e.length])}at(rC,"wrapArray");function nC(e,t,i){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=i?e.indexOf(i):-1;let u=rC(e,Math.max(l,0));o.length===1&&(u=u.filter(d=>d!==i));const p=u.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return p!==i?p:void 0}at(nC,"getNextMatch");function oC(e,t){const{x:i,y:n}=e;let o=!1;for(let l=0,u=t.length-1;l<t.length;u=l++){const f=t[l],p=t[u],d=f.x,_=f.y,v=p.x,b=p.y;_>n!=b>n&&i<(v-d)*(n-_)/(b-_)+d&&(o=!o)}return o}at(oC,"isPointInPolygon");function aC(e,t){if(!t)return!1;const i={x:e.clientX,y:e.clientY};return oC(i,t)}at(aC,"isPointerInGraceArea");function mh(e){return t=>t.pointerType==="mouse"?e(t):void 0}at(mh,"whenMouse");var E5=c5,N5=u5,R5=f5,A5=m5,D5=y5,T5=w5,j5=Object.defineProperty,hr=(e,t)=>j5(e,"name",{value:t,configurable:!0}),Jg="ContextMenu",[M5,IU]=mi(Jg,[X1]),xa=X1(),[O5,lC]=M5(Jg),L5=hr(e=>{const{__scopeContextMenu:t,children:i,onOpenChange:n,open:o,dir:l,modal:u=!0}=e,f=w.useRef(!1),[p,d]=_a({prop:o,defaultProp:!1,onChange:n,caller:Jg}),_=xa(t);return h.jsx(O5,{scope:t,open:p,onOpenChange:d,modal:u,hasInteractedRef:f,children:h.jsx(E5,{..._,dir:l,open:p,onOpenChange:d,modal:u,children:i})})},"ContextMenu"),z5="ContextMenuTrigger",B5=w.forwardRef(hr(function(t,i){const{__scopeContextMenu:n,disabled:o=!1,...l}=t,u=lC(z5,n),f=xa(n),[p,d]=w.useState({x:0,y:0}),_=w.useMemo(()=>({current:{getBoundingClientRect:hr(()=>DOMRect.fromRect({width:0,height:0,...p}),"getBoundingClientRect")}}),[p]),v=w.useRef(0),b=w.useCallback(()=>window.clearTimeout(v.current),[]),x=hr(y=>{u.hasInteractedRef.current=!0,d({x:y.clientX,y:y.clientY}),u.onOpenChange(!0)},"handleOpen");return w.useEffect(()=>b,[b]),w.useEffect(()=>void(o&&b()),[o,b]),h.jsxs(h.Fragment,{children:[h.jsx(N5,{...f,virtualRef:_}),h.jsx(vt.span,{"data-state":u.open?"open":"closed","data-disabled":o?"":void 0,...l,ref:i,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:o?t.onContextMenu:Oe(t.onContextMenu,y=>{b(),x(y),y.preventDefault()}),onPointerDown:o?t.onPointerDown:Oe(t.onPointerDown,Dl(y=>{b(),u.open&&u.onOpenChange(!1),v.current=window.setTimeout(()=>x(y),700)})),onPointerMove:o?t.onPointerMove:Oe(t.onPointerMove,Dl(b)),onPointerCancel:o?t.onPointerCancel:Oe(t.onPointerCancel,Dl(b)),onPointerUp:o?t.onPointerUp:Oe(t.onPointerUp,Dl(b))})]})},"ContextMenuTrigger")),P5=hr(e=>{const{__scopeContextMenu:t,...i}=e,n=xa(t);return h.jsx(R5,{...n,...i})},"ContextMenuPortal"),H5="ContextMenuContent",I5=w.forwardRef(hr(function(t,i){const{__scopeContextMenu:n,...o}=t,l=lC(H5,n),u=xa(n),f=w.useRef(!1);return h.jsx(A5,{...u,...o,ref:i,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{var d;(d=t.onCloseAutoFocus)==null||d.call(t,p),!p.defaultPrevented&&f.current&&p.preventDefault(),f.current=!1},onInteractOutside:p=>{var d;(d=t.onInteractOutside)==null||d.call(t,p),!p.defaultPrevented&&!l.modal&&(f.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),$5=w.forwardRef(hr(function(t,i){const{__scopeContextMenu:n,...o}=t,l=xa(n);return h.jsx(D5,{...l,...o,ref:i})},"ContextMenuItem")),U5=w.forwardRef(hr(function(t,i){const{__scopeContextMenu:n,...o}=t,l=xa(n);return h.jsx(T5,{...l,...o,ref:i})},"ContextMenuSeparator"));function Dl(e){return t=>t.pointerType!=="mouse"?e(t):void 0}hr(Dl,"whenTouchOrPen");var F5=L5,V5=B5,q5=P5,Y5=I5,W5=$5,K5=U5,G5=Object.defineProperty,X5=(e,t)=>G5(e,"name",{value:t,configurable:!0}),Z5=w.forwardRef(X5(function(t,i){return h.jsx(vt.label,{...t,ref:i,onMouseDown:n=>{var l;n.target.closest("button, input, select, textarea")||((l=t.onMouseDown)==null||l.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}})},"Label")),Q5=Z5,J5=Object.defineProperty,Sa=(e,t)=>J5(e,"name",{value:t,configurable:!0}),ev="Tabs",[ej,$U]=mi(ev,[qh]),cC=qh(),[tj,tv]=ej(ev),sj=w.forwardRef(Sa(function(t,i){const{__scopeTabs:n,value:o,onValueChange:l,defaultValue:u,orientation:f="horizontal",dir:p,activationMode:d="automatic",..._}=t,v=jh(p),[b,x]=_a({prop:o,onChange:l,defaultProp:u??"",caller:ev});return h.jsx(tj,{scope:n,baseId:In(),value:b,onValueChange:x,orientation:f,dir:v,activationMode:d,children:h.jsx(vt.div,{dir:v,"data-orientation":f,..._,ref:i})})},"Tabs")),ij="TabsList",rj=w.forwardRef(Sa(function(t,i){const{__scopeTabs:n,loop:o=!0,...l}=t,u=tv(ij,n),f=cC(n);return h.jsx(W1,{asChild:!0,...f,orientation:u.orientation,dir:u.dir,loop:o,children:h.jsx(vt.div,{role:"tablist","aria-orientation":u.orientation,...l,ref:i})})},"TabsList")),nj="TabsTrigger",oj=w.forwardRef(Sa(function(t,i){const{__scopeTabs:n,value:o,disabled:l=!1,...u}=t,f=tv(nj,n),p=cC(n),d=sv(f.baseId,o),_=iv(f.baseId,o),v=o===f.value;return h.jsx(K1,{asChild:!0,...p,focusable:!l,active:v,children:h.jsx(vt.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":_,"data-state":v?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:d,...u,ref:i,onMouseDown:Oe(t.onMouseDown,b=>{!l&&b.button===0&&b.ctrlKey===!1?f.onValueChange(o):b.preventDefault()}),onKeyDown:Oe(t.onKeyDown,b=>{l||b.target!==b.currentTarget||[" ","Enter"].includes(b.key)&&f.onValueChange(o)}),onFocus:Oe(t.onFocus,()=>{const b=f.activationMode!=="manual";!v&&!l&&b&&f.onValueChange(o)})})})},"TabsTrigger")),aj="TabsContent",lj=w.forwardRef(Sa(function(t,i){const{__scopeTabs:n,value:o,forceMount:l,children:u,...f}=t,p=tv(aj,n),d=sv(p.baseId,o),_=iv(p.baseId,o),v=o===p.value,b=w.useRef(v);return w.useEffect(()=>{const x=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(x)},[]),h.jsx(ln,{present:l||v,children:({present:x})=>h.jsx(vt.div,{"data-state":v?"active":"inactive","data-orientation":p.orientation,role:"tabpanel","aria-labelledby":d,hidden:!x,id:_,tabIndex:0,...f,ref:i,style:{...t.style,animationDuration:b.current?"0s":void 0},children:x&&u})})},"TabsContent"));function sv(e,t){return`${e}-trigger-${t}`}Sa(sv,"makeTriggerId");function iv(e,t){return`${e}-content-${t}`}Sa(iv,"makeContentId");var cj=sj,uj=rj,hj=oj,dj=lj,fj=Object.defineProperty,Pt=(e,t)=>fj(e,"name",{value:t,configurable:!0}),[rv,UU]=mi("Tooltip",[Uh]),Wh=Uh(),pj="TooltipProvider",mj=700,jm="tooltip.open",[gj,nv]=rv(pj),vj=Pt(e=>{const{__scopeTooltip:t,delayDuration:i=mj,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:l}=e,u=w.useRef(!0),f=w.useRef(!1),p=w.useRef(0);return w.useEffect(()=>{const d=p.current;return()=>window.clearTimeout(d)},[]),h.jsx(gj,{scope:t,isOpenDelayedRef:u,delayDuration:i,onOpen:w.useCallback(()=>{n<=0||(window.clearTimeout(p.current),u.current=!1)},[n]),onClose:w.useCallback(()=>{n<=0||(window.clearTimeout(p.current),p.current=window.setTimeout(()=>u.current=!0,n))},[n]),isPointerInTransitRef:f,onPointerInTransitChange:w.useCallback(d=>{f.current=d},[]),disableHoverableContent:o,children:l})},"TooltipProvider"),Mm="Tooltip",[_j,ec]=rv(Mm),yj=Pt(e=>{const{__scopeTooltip:t,children:i,open:n,defaultOpen:o,onOpenChange:l,disableHoverableContent:u,delayDuration:f}=e,p=nv(Mm,e.__scopeTooltip),d=Wh(t),[_,v]=w.useState(null),[b,x]=w.useState(void 0),y=In(),S=w.useRef(0),E=u??p.disableHoverableContent,N=f??p.delayDuration,T=w.useRef(!1),[A,j]=_a({prop:n,defaultProp:o??!1,onChange:Pt(te=>{te?(p.onOpen(),document.dispatchEvent(new CustomEvent(jm))):p.onClose(),l==null||l(te)},"onChange"),caller:Mm}),M=w.useMemo(()=>A?T.current?"delayed-open":"instant-open":"closed",[A]),P=w.useCallback(()=>{window.clearTimeout(S.current),S.current=0,T.current=!1,j(!0)},[j]),D=w.useCallback(()=>{window.clearTimeout(S.current),S.current=0,j(!1)},[j]),L=w.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{T.current=!0,j(!0),S.current=0},N)},[N,j]);w.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const V=b??y;return h.jsx(z1,{...d,children:h.jsx(_j,{scope:t,contentId:V,setContentId:x,open:A,stateAttribute:M,trigger:_,onTriggerChange:v,onTriggerEnter:w.useCallback(()=>{p.isOpenDelayedRef.current?L():P()},[p.isOpenDelayedRef,L,P]),onTriggerLeave:w.useCallback(()=>{E?D():(window.clearTimeout(S.current),S.current=0)},[D,E]),onOpen:P,onClose:D,disableHoverableContent:E,children:i})})},"Tooltip"),ox="TooltipTrigger",bj=w.forwardRef(Pt(function(t,i){const{__scopeTooltip:n,...o}=t,l=ec(ox,n),u=nv(ox,n),f=Wh(n),p=w.useRef(null),d=gt(i,p,l.onTriggerChange),_=w.useRef(!1),v=w.useRef(!1),b=w.useCallback(()=>_.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),h.jsx(B1,{asChild:!0,...f,children:h.jsx(vt.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...o,ref:d,onPointerMove:Oe(t.onPointerMove,x=>{x.pointerType!=="touch"&&!v.current&&!u.isPointerInTransitRef.current&&(l.onTriggerEnter(),v.current=!0)}),onPointerLeave:Oe(t.onPointerLeave,()=>{l.onTriggerLeave(),v.current=!1}),onPointerDown:Oe(t.onPointerDown,()=>{l.open&&l.onClose(),_.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:Oe(t.onFocus,()=>{_.current||l.onOpen()}),onBlur:Oe(t.onBlur,l.onClose),onClick:Oe(t.onClick,l.onClose)})})},"TooltipTrigger")),uC="TooltipPortal",[xj,Sj]=rv(uC,{forceMount:void 0}),wj=Pt(e=>{const{__scopeTooltip:t,forceMount:i,children:n,container:o}=e,l=ec(uC,t);return h.jsx(xj,{scope:t,forceMount:i,children:h.jsx(ln,{present:i||l.open,children:h.jsx(Hg,{asChild:!0,container:o,children:n})})})},"TooltipPortal"),Vl="TooltipContent",Cj=w.forwardRef(Pt(function(t,i){const n=Sj(Vl,t.__scopeTooltip),{forceMount:o=n.forceMount,side:l="top",...u}=t,f=ec(Vl,t.__scopeTooltip);return h.jsx(ln,{present:o||f.open,children:f.disableHoverableContent?h.jsx(hC,{side:l,...u,ref:i}):h.jsx(kj,{side:l,...u,ref:i})})},"TooltipContent")),kj=w.forwardRef(Pt(function(t,i){const n=ec(Vl,t.__scopeTooltip),o=nv(Vl,t.__scopeTooltip),l=w.useRef(null),u=gt(i,l),[f,p]=w.useState(null),{trigger:d,onClose:_}=n,v=l.current,{onPointerInTransitChange:b}=o,x=w.useCallback(()=>{p(null),b(!1)},[b]),y=w.useCallback((S,E)=>{const N=S.currentTarget,T={x:S.clientX,y:S.clientY},A=dC(T,N.getBoundingClientRect()),j=fC(T,A),M=pC(E.getBoundingClientRect()),P=gC([...j,...M]);p(P),b(!0)},[b]);return w.useEffect(()=>()=>x(),[x]),w.useEffect(()=>{if(d&&v){const S=Pt(N=>y(N,v),"handleTriggerLeave"),E=Pt(N=>y(N,d),"handleContentLeave");return d.addEventListener("pointerleave",S),v.addEventListener("pointerleave",E),()=>{d.removeEventListener("pointerleave",S),v.removeEventListener("pointerleave",E)}}},[d,v,y,x]),w.useEffect(()=>{if(f){const S=Pt(E=>{const N=E.target,T={x:E.clientX,y:E.clientY},A=(d==null?void 0:d.contains(N))||(v==null?void 0:v.contains(N)),j=!mC(T,f);A?x():j&&(x(),_())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[d,v,f,_,x]),h.jsx(hC,{...t,ref:u})},"TooltipContentHoverable")),Ej=Sw("TooltipContent"),hC=w.forwardRef(Pt(function(t,i){const{__scopeTooltip:n,children:o,"aria-label":l,id:u,onEscapeKeyDown:f,onPointerDownOutside:p,...d}=t,_=ec(Vl,n),v=Wh(n),{onClose:b}=_;w.useEffect(()=>(document.addEventListener(jm,b),()=>document.removeEventListener(jm,b)),[b]),w.useEffect(()=>{if(_.trigger){const y=Pt(S=>{S.target instanceof Node&&S.target.contains(_.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",y,{capture:!0}),()=>window.removeEventListener("scroll",y,{capture:!0})}},[_.trigger,b]);const{setContentId:x}=_;return Cs(()=>(x(u),()=>{x(void 0)}),[u,x]),h.jsx(zg,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:y=>y.preventDefault(),onDismiss:b,children:h.jsxs(P1,{"data-state":_.stateAttribute,role:l?void 0:"tooltip",id:l?void 0:_.contentId,...v,...d,ref:i,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(Ej,{children:o}),l?h.jsx(xR,{id:_.contentId,role:"tooltip",children:l}):null]})})},"TooltipContentImpl")),Nj=w.forwardRef(Pt(function(t,i){const{__scopeTooltip:n,...o}=t,l=Wh(n);return h.jsx($T,{...l,...o,ref:i})},"TooltipArrow"));function dC(e,t){const i=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(i,n,o,l)){case l:return"left";case o:return"right";case i:return"top";case n:return"bottom";default:throw new Error("unreachable")}}Pt(dC,"getExitSideFromRect");function fC(e,t,i=5){const n=[];switch(t){case"top":n.push({x:e.x-i,y:e.y+i},{x:e.x+i,y:e.y+i});break;case"bottom":n.push({x:e.x-i,y:e.y-i},{x:e.x+i,y:e.y-i});break;case"left":n.push({x:e.x+i,y:e.y-i},{x:e.x+i,y:e.y+i});break;case"right":n.push({x:e.x-i,y:e.y-i},{x:e.x-i,y:e.y+i});break}return n}Pt(fC,"getPaddedExitPoints");function pC(e){const{top:t,right:i,bottom:n,left:o}=e;return[{x:o,y:t},{x:i,y:t},{x:i,y:n},{x:o,y:n}]}Pt(pC,"getPointsFromRect");function mC(e,t){const{x:i,y:n}=e;let o=!1;for(let l=0,u=t.length-1;l<t.length;u=l++){const f=t[l],p=t[u],d=f.x,_=f.y,v=p.x,b=p.y;_>n!=b>n&&i<(v-d)*(n-_)/(b-_)+d&&(o=!o)}return o}Pt(mC,"isPointInPolygon");function gC(e){const t=e.slice();return t.sort((i,n)=>i.x<n.x?-1:i.x>n.x?1:i.y<n.y?-1:i.y>n.y?1:0),vC(t)}Pt(gC,"getHull");function vC(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const l=t[t.length-1],u=t[t.length-2];if((l.x-u.x)*(o.y-u.y)>=(l.y-u.y)*(o.x-u.x))t.pop();else break}t.push(o)}t.pop();const i=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;i.length>=2;){const l=i[i.length-1],u=i[i.length-2];if((l.x-u.x)*(o.y-u.y)>=(l.y-u.y)*(o.x-u.x))i.pop();else break}i.push(o)}return i.pop(),t.length===1&&i.length===1&&t[0].x===i[0].x&&t[0].y===i[0].y?t:t.concat(i)}Pt(vC,"getHullPresorted");var Rj=vj,Aj=yj,Dj=bj,Tj=wj,jj=Cj,Mj=Nj;const Oj={name:"English",label:"Language"},Lj={browse:"Browse files",cancel:"Cancel",connect:"Connect SSH",delete:"Delete",edit:"Edit"},zj={columnModified:"Modified",columnName:"Name",columnSize:"Size",contextCompressZip:"Compress to Zip",contextCopyPath:"Copy Path",contextDelete:"Delete",contextDownload:"Download",contextExtractZip:"Extract Zip",contextGetInfo:"Get Info",contextNewFile:"New File",contextNewFolder:"New Folder",contextOpen:"Open",contextOpenTerminal:"Open Terminal",contextQuickLook:"Quick Look",contextRefresh:"Refresh",contextRename:"Rename",contextShowInFinder:"Show in Finder",contextUpload:"Upload",copyPath:"Copy path",download:"Download",emptyDirectory:"Empty directory",goUp:"Go up",hideHidden:"Hide hidden files",home:"Home (~)",modified:"Modified",name:"Name",newFolder:"New folder",openInCode:"Open in Code",openInEditor:"Open in editor",openTerminal:"Open terminal here",permissions:"Permissions",refresh:"Refresh",root:"Root (/)",setDefault:"Set as default directory",showHidden:"Show hidden files",size:"Size",statusHidden:"hidden",statusItems:"items",statusLink:"link",statusSelected:"selected",upload:"Upload"},Bj={addFirst:"Add a server",dupDialog:{description:"A {{type}} session is already open for {{name}}.",goExisting:"Go to existing",openNew:"Open new",title:"Connection already open"},emptyDescription:"Connect to your SSH servers to manage files, run commands, and access your infrastructure remotely.",emptyTitle:"Add your first server",import:"Import",noResults:"No servers match your search",status:{browserActive:"File browser active",browserAndTerminal:"File browser + SSH terminal",terminalActive:"SSH terminal active"}},Pj={language:Oj,actions:Lj,files:zj,servers:Bj},Hj={name:"Français",label:"Langue"},Ij={browse:"Parcourir les fichiers",cancel:"Annuler",connect:"Se connecter en SSH",delete:"Supprimer",edit:"Modifier"},$j={columnModified:"Modifié",columnName:"Nom",columnSize:"Taille",contextCompressZip:"Compresser en Zip",contextCopyPath:"Copier le chemin",contextDelete:"Supprimer",contextDownload:"Télécharger",contextExtractZip:"Extraire le Zip",contextGetInfo:"Lire les informations",contextNewFile:"Nouveau fichier",contextNewFolder:"Nouveau dossier",contextOpen:"Ouvrir",contextOpenTerminal:"Ouvrir le terminal",contextQuickLook:"Aperçu rapide",contextRefresh:"Actualiser",contextRename:"Renommer",contextShowInFinder:"Afficher dans le Finder",contextUpload:"Téléverser",copyPath:"Copier le chemin",download:"Télécharger",emptyDirectory:"Dossier vide",goUp:"Remonter",hideHidden:"Masquer les fichiers cachés",home:"Accueil (~)",modified:"Modifié",name:"Nom",newFolder:"Nouveau dossier",openInCode:"Ouvrir dans Code",openInEditor:"Ouvrir dans l’éditeur",openTerminal:"Ouvrir un terminal ici",permissions:"Permissions",refresh:"Actualiser",root:"Racine (/)",setDefault:"Définir comme répertoire par défaut",showHidden:"Afficher les fichiers cachés",size:"Taille",statusHidden:"masqués",statusItems:"éléments",statusLink:"lien",statusSelected:"sélectionné(s)",upload:"Téléverser"},Uj={addFirst:"Ajouter un serveur",dupDialog:{description:"Une session {{type}} est déjà ouverte pour {{name}}.",goExisting:"Aller à la connexion existante",openNew:"Ouvrir une nouvelle connexion",title:"Connexion déjà ouverte"},emptyDescription:"Connectez-vous à vos serveurs SSH pour gérer des fichiers, exécuter des commandes et accéder à votre infrastructure à distance.",emptyTitle:"Ajoutez votre premier serveur",import:"Importer",noResults:"Aucun serveur ne correspond à votre recherche",status:{browserActive:"Explorateur de fichiers actif",browserAndTerminal:"Explorateur de fichiers + terminal SSH",terminalActive:"Terminal SSH actif"}},Fj={language:Hj,actions:Ij,files:$j,servers:Uj},Vj={name:"日本語",label:"言語"},qj={browse:"ファイルを参照",cancel:"キャンセル",connect:"SSHで接続",delete:"削除",edit:"編集"},Yj={columnModified:"更新日時",columnName:"名前",columnSize:"サイズ",contextCompressZip:"Zipに圧縮",contextCopyPath:"パスをコピー",contextDelete:"削除",contextDownload:"ダウンロード",contextExtractZip:"Zipを展開",contextGetInfo:"情報を見る",contextNewFile:"新規ファイル",contextNewFolder:"新規フォルダー",contextOpen:"開く",contextOpenTerminal:"ターミナルを開く",contextQuickLook:"クイックルック",contextRefresh:"更新",contextRename:"名前を変更",contextShowInFinder:"Finderに表示",contextUpload:"アップロード",copyPath:"パスをコピー",download:"ダウンロード",emptyDirectory:"空のディレクトリ",goUp:"上の階層へ",hideHidden:"隠しファイルを非表示",home:"ホーム (~)",modified:"更新日時",name:"名前",newFolder:"新規フォルダー",openInCode:"Codeで開く",openInEditor:"エディターで開く",openTerminal:"ここでターミナルを開く",permissions:"アクセス権",refresh:"更新",root:"ルート (/)",setDefault:"既定のディレクトリに設定",showHidden:"隠しファイルを表示",size:"サイズ",statusHidden:"非表示",statusItems:"項目",statusLink:"リンク",statusSelected:"選択中",upload:"アップロード"},Wj={addFirst:"サーバーを追加",dupDialog:{description:"{{name}}の{{type}}セッションはすでに開いています。",goExisting:"既存のセッションへ",openNew:"新しく開く",title:"接続済みです"},emptyDescription:"SSHサーバーに接続して、ファイルの管理、コマンドの実行、インフラへのリモートアクセスを行えます。",emptyTitle:"最初のサーバーを追加",import:"インポート",noResults:"検索条件に一致するサーバーがありません",status:{browserActive:"ファイルブラウザー使用中",browserAndTerminal:"ファイルブラウザーとSSHターミナル使用中",terminalActive:"SSHターミナル使用中"}},Kj={language:Vj,actions:qj,files:Yj,servers:Wj},Gj="Download",Xj="Copied",Zj="Copy",Qj="Cancel",Jj="Downloading",eM="Back",tM="Next",sM="Files",iM="Name",rM="Command",nM="Description",oM="optional",aM="unchanged",lM="Directory",cM="Save",uM="Commands",hM="Servers",dM="Terminal",fM="Agents",pM="Waiting",mM="Live",gM="Activity",vM="Fleet",_M="Health",yM="Main",bM="Open",xM="Options",SM="of",wM="Order",CM="Delay",kM="Close",EM="Notes",NM="Import",RM="Dismiss",AM="Shell",DM="Restricted",TM="Unrestricted",jM="Group",MM="Host",OM="Port",LM="User",zM="Password",BM="Mode",PM="Approval",HM="Off",IM="Decisions",$M="clear",UM="Upload",FM="dismiss",VM="Uploading",qM="Summary",YM="reachable",WM="unreachable",KM="Reachable",GM="Unreachable",XM="Recheck",ZM="Memory",QM="running",JM="Light",eO="Dark",tO="Disk",sO="Appearance",iO="Vault",rO="Updates",nO="Alerts",oO="Groups",aO="Tunnels",lO="Results",cO="Filter",uO="Uncategorized",hO="Layout",dO="Cards",fO="List",pO="All",mO="Here",gO="Suggestions",vO="waiting",_O="Refuse",yO="Approve",bO="restricted",xO="unrestricted",SO="exit",wO="dynamic",CO="files",kO="shell",EO="CPU",NO="cpu",RO="memory",AO="disk",_C={"the desktop app":"the desktop app","Not found on this machine":"Not found on this machine","Start a new Claude Code session for it to take effect.":"Start a new Claude Code session for it to take effect.","Which ssh-manager your AI tools start":"Which ssh-manager your AI tools start","An AI tool starts ssh-manager itself, from the command in its settings. It can be the one installed with npm or the one inside the desktop app — the same engine either way; the app's needs no Node. Changing it rewrites that one entry and nothing else.":"An AI tool starts ssh-manager itself, from the command in its settings. It can be the one installed with npm or the one inside the desktop app — the same engine either way; the app's needs no Node. Changing it rewrites that one entry and nothing else.","Desktop app":"Desktop app","unknown version":"unknown version","Not installed here":"Not installed here","Not installed with npm":"Not installed with npm","the app":"the app","Finding the release…":"Finding the release…","Downloading…":"Downloading…","Checking the checksum and the signature…":"Checking the checksum and the signature…","Installing…":"Installing…","Opening the app…":"Opening the app…","The desktop app was not installed.":"The desktop app was not installed.","Continued in the desktop app.":"Continued in the desktop app.","You can close this tab.":"You can close this tab.","SSH Manager is also a desktop app:":"SSH Manager is also a desktop app:","menu bar, native notifications, updates itself.":"menu bar, native notifications, updates itself.","Working…":"Working…",Download:Gj,Copied:Xj,Copy:Zj,"Open the app":"Open the app","Install the app":"Install the app","Not now":"Not now","Nothing was installed.":"Nothing was installed.",Cancel:Qj,"No servers configured yet.":"No servers configured yet.","files open":"files open","shell open":"shell open","not yet":"not yet","preview build":"preview build","You are on a preview. You will be offered newer previews and the stable release when it comes out.":"You are on a preview. You will be offered newer previews and the stable release when it comes out.","You receive stable releases.":"You receive stable releases.","Checking for updates…":"Checking for updates…","Could not check for updates.":"Could not check for updates.","You are up to date.":"You are up to date.","Not checked yet.":"Not checked yet.","Check now":"Check now","Downloading does not change anything you are running; you choose when to restart.":"Downloading does not change anything you are running; you choose when to restart.",Downloading:Jj,"It installs when you restart, or by itself the next time you quit.":"It installs when you restart, or by itself the next time you quit.","Restart to update":"Restart to update","Last checked":"Last checked","Release notes":"Release notes","All releases":"All releases","The application checks when it starts and every six hours, and tells you here, in the sidebar and once per version in a notification. The npm engine, if you use one, is updated with npm and is not part of this.":"The application checks when it starts and every six hours, and tells you here, in the sidebar and once per version in a notification. The npm engine, if you use one, is updated with npm and is not part of this.","A recovery copy you can take with you":"A recovery copy you can take with you","Your vault is encrypted with a key on this machine. Keep a recovery backup somewhere safe before moving to another computer or reinstalling. You will need its passphrase to restore it.":"Your vault is encrypted with a key on this machine. Keep a recovery backup somewhere safe before moving to another computer or reinstalling. You will need its passphrase to restore it.","The vault cannot be unlocked. Restore a recovery backup to recover access.":"The vault cannot be unlocked. Restore a recovery backup to recover access.","Backups include saved servers and their credentials. Groups, preferences, host keys and original .env / TOML files need a separate backup.":"Backups include saved servers and their credentials. Groups, preferences, host keys and original .env / TOML files need a separate backup.","Recovery backup downloaded. Keep the file and its passphrase safe.":"Recovery backup downloaded. Keep the file and its passphrase safe.","Create a recovery backup":"Create a recovery backup","Backup passphrase":"Backup passphrase","At least 8 characters; a longer phrase is better":"At least 8 characters; a longer phrase is better","Confirm backup passphrase":"Confirm backup passphrase","The passphrases do not match.":"The passphrases do not match.","Download recovery backup":"Download recovery backup","Recovery complete. Your restored servers are available in Servers.":"Recovery complete. Your restored servers are available in Servers.","Restore a recovery backup":"Restore a recovery backup","Choose an encrypted SSH Manager recovery file. Review the server names before confirming any changes.":"Choose an encrypted SSH Manager recovery file. Review the server names before confirming any changes.","Recovery file":"Recovery file","Recovery passphrase":"Recovery passphrase","Recovery preview":"Recovery preview"," — replaces saved server":" — replaces saved server"," — adds server":" — adds server","The unreadable vault will be replaced by this backup.":"The unreadable vault will be replaced by this backup.","Servers missing from the backup will be removed:":"Servers missing from the backup will be removed:","Other settings and original configuration files stay unchanged.":"Other settings and original configuration files stay unchanged.","Other saved servers, settings and original configuration files stay unchanged.":"Other saved servers, settings and original configuration files stay unchanged.","Confirm restore":"Confirm restore","Preview recovery":"Preview recovery","Cancel recovery":"Cancel recovery","A place for your servers":"A place for your servers","Your servers. Your workspace.":"Your servers. Your workspace.","Open a terminal, move files and see what your agents are doing — all from one place on your machine.":"Open a terminal, move files and see what your agents are doing — all from one place on your machine.","Already using npm or the CLI? Your setup keeps working. You can explore this interface whenever you want.":"Already using npm or the CLI? Your setup keeps working. You can explore this interface whenever you want.","Start with what you have":"Start with what you have","Bring your servers along.":"Bring your servers along.","Add your first connection or import servers from an SSH config, another SSH client or a spreadsheet.":"Add your first connection or import servers from an SSH config, another SSH client or a spreadsheet.","You review the servers before importing. Your original files stay in place, so you can keep using your existing tools.":"You review the servers before importing. Your original files stay in place, so you can keep using your existing tools.","You decide how far agents go":"You decide how far agents go","Stay in control.":"Stay in control.","Choose which agent requests need your approval. See the server and the full command before you approve or refuse.":"Choose which agent requests need your approval. See the server and the full command before you approve or refuse.","Approval is off by default. Once enabled on a server, requests that need approval are refused if the control plane is unavailable.":"Approval is off by default. Once enabled on a server, requests that need approval are refused if the control plane is unavailable.","On your machine. In your hands.":"On your machine. In your hands.",Back:eM,"Import servers":"Import servers","Add a server":"Add a server",Next:tM,"I’ll explore first":"I’ll explore first",Files:sM,"Edit command":"Edit command","Save a command":"Save a command","It appears in the list next to any terminal it applies to.":"It appears in the list next to any terminal it applies to.",Name:iM,"Reload nginx":"Reload nginx",Command:rM,Description:nM,optional:oM,unchanged:aM,Directory:lM,"Where it is offered":"Where it is offered","every server":"every server","No server in the vault yet.":"No server in the vault yet.","Selecting none offers it everywhere.":"Selecting none offers it everywhere.","Limit to":"Limit to","Ask before putting it in the terminal":"Ask before putting it in the terminal","— for the ones that delete things":"— for the ones that delete things","Saving…":"Saving…",Save:cM,Commands:uM,"asks first":"asks first","Nothing saved yet. These are the ones people usually keep — pick any to add it.":"Nothing saved yet. These are the ones people usually keep — pick any to add it.","Save a new command":"Save a new command","Control plane connected":"Control plane connected","Connecting to the control plane…":"Connecting to the control plane…","Connection lost. Reconnecting — displayed activity may be out of date.":"Connection lost. Reconnecting — displayed activity may be out of date.","Connecting…":"Connecting…","Connection lost":"Connection lost","Open another session":"Open another session",Servers:hM,Terminal:dM,Agents:fM,Waiting:pM,Live:mM,Activity:gM,Fleet:vM,Health:_M,"Collapse the sidebar":"Collapse the sidebar","Expand the sidebar":"Expand the sidebar",Main:yM,Open:bM,"Downloading update":"Downloading update","Update available":"Update available",Options:xM,"New group":"New group","A group runs one command across several machines. Stored in":"A group runs one command across several machines. Stored in",of:SM,"No server in the vault yet — add one first.":"No server in the vault yet — add one first.",Order:wM,"all at once":"all at once","one after another":"one after another",Delay:CM,"ms between servers":"ms between servers","Stop at the first failure":"Stop at the first failure","— otherwise every server is attempted":"— otherwise every server is attempted","From another tool, or from a file. No password is ever read.":"From another tool, or from a file. No password is ever read.",Close:kM,"Reading…":"Reading…","Looking around…":"Looking around…","Already on this machine":"Already on this machine","From a file":"From a file","Choose a file":"Choose a file","A spreadsheet, a CSV, an OpenSSH config, or an export from FileZilla, PuTTY, Termius or MobaXterm. The format is worked out for you.":"A spreadsheet, a CSV, an OpenSSH config, or an export from FileZilla, PuTTY, Termius or MobaXterm. The format is worked out for you.","Nothing to import from that.":"Nothing to import from that.","will be replaced":"will be replaced","already configured — left alone":"already configured — left alone",Notes:EM,Import:NM,"Your existing setup keeps working":"Your existing setup keeps working","Importing…":"Importing…","Afterwards, create a recovery backup in Options → Vault. Your encryption key belongs to this machine; the backup lets you restore elsewhere.":"Afterwards, create a recovery backup in Options → Vault. Your encryption key belongs to this machine; the backup lets you restore elsewhere.",Dismiss:RM,"files and shell open":"files and shell open","Open a shell":"Open a shell",Shell:AM,"Read only":"Read only",Restricted:DM,Unrestricted:TM,"Approval off":"Approval off","Approval: every request":"Approval: every request","Approval: destructive":"Approval: destructive","Credentials stay encrypted on this machine. Leave a password or passphrase blank to keep its saved value.":"Credentials stay encrypted on this machine. Leave a password or passphrase blank to keep its saved value.",Group:jM,Host:MM,Port:OM,User:LM,Password:zM,"Private key":"Private key","Key passphrase":"Key passphrase","if your key is encrypted":"if your key is encrypted","Default directory":"Default directory","Agent permissions":"Agent permissions",Mode:BM,Approval:PM,Off:HM,"Destructive requests":"Destructive requests","Every request":"Every request","Requests needing approval wait for you. If the control plane is unavailable, they are refused.":"Requests needing approval wait for you. If the control plane is unavailable, they are refused.","Agents can work without this interface. Turn on approval when you want to review their requests.":"Agents can work without this interface. Turn on approval when you want to review their requests.","Allowed command patterns":"Allowed command patterns","One regular expression per line. With no allowed patterns, all commands are refused.":"One regular expression per line. With no allowed patterns, all commands are refused.","Denied command patterns":"Denied command patterns","Advanced connection settings":"Advanced connection settings","Jump server":"Jump server","Name of another configured server to connect through.":"Name of another configured server to connect through.","Proxy command":"Proxy command","Remote platform":"Remote platform","Forward the SSH agent":"Forward the SSH agent","Audit log path":"Audit log path","Command Palette":"Command Palette","Search for a command to run...":"Search for a command to run...","What your agents ran, and what you decided.":"What your agents ran, and what you decided.",Decisions:IM,"Clear the command history on this machine?":"Clear the command history on this machine?",clear:$M,"No command recorded yet":"No command recorded yet","Everything your agents run is written down here, on this machine — nothing to configure on the servers.":"Everything your agents run is written down here, on this machine — nothing to configure on the servers.","Output is not kept; set SSH_MANAGER_LOG_OUTPUT=1 if you want it.":"Output is not kept; set SSH_MANAGER_LOG_OUTPUT=1 if you want it.","Nothing recorded yet":"Nothing recorded yet","Every approval you granted or refused appears here. What agents ran is under Commands.":"Every approval you granted or refused appears here. What agents ran is under Commands.","The transfer failed":"The transfer failed","Directories cannot be transferred yet — select files.":"Directories cannot be transferred yet — select files.","New name":"New name","Name of the new directory":"Name of the new directory",Upload:UM,"Name for the new file":"Name for the new file",dismiss:FM,Uploading:VM,"This machine":"This machine","Probed when you ask. Nothing runs in the background.":"Probed when you ask. Nothing runs in the background.","Check every server":"Check every server",Summary:qM,reachable:YM,"over a threshold":"over a threshold",unreachable:WM,"Nothing probed yet":"Nothing probed yet","Each check opens one SSH connection and closes it. Press the button when you want to know.":"Each check opens one SSH connection and closes it. Press the button when you want to know.",Reachable:KM,Unreachable:GM,Recheck:XM,Memory:ZM,"No answer":"No answer","Recheck once the host or the network is back.":"Recheck once the host or the network is back.","What your agents are running, as it happens.":"What your agents are running, as it happens.",running:QM,"No command is running":"No command is running","When an agent runs something on one of your servers it appears here as it happens, output included. Nothing is written to disk.":"When an agent runs something on one of your servers it appears here as it happens, output included. Nothing is written to disk.","Match the desktop":"Match the desktop","follows your system setting, including when it changes":"follows your system setting, including when it changes",Light:JM,"always light, whatever the system does":"always light, whatever the system does",Dark:eO,"always dark":"always dark","Point out machines over these levels":"Point out machines over these levels","— checked when you probe, never in the background":"— checked when you probe, never in the background",Disk:tO,"Settings for this machine only.":"Settings for this machine only.",Appearance:sO,Vault:iO,"AI tools":"AI tools",Updates:rO,"update available":"update available",Alerts:nO,Groups:oO,Tunnels:aO,"Known hosts":"Known hosts","Alert thresholds":"Alert thresholds",Results:lO,"from config":"from config","The published list is stale — the MCP server that opened them is no longer running.":"The published list is stale — the MCP server that opened them is no longer running.","None open. Tunnels live inside the MCP server’s process; this screen shows what that process publishes.":"None open. Tunnels live inside the MCP server’s process; this screen shows what that process publishes.",Filter:cO,"Add as a server":"Add as a server","more — narrow the filter to see them.":"more — narrow the filter to see them.","No host matches.":"No host matches.",Uncategorized:uO,"Toggle edit mode":"Toggle edit mode","Done editing":"Done editing","Edit or remove servers":"Edit or remove servers","Search a name, host or user":"Search a name, host or user","Search servers":"Search servers",Layout:hO,"Show as a grid":"Show as a grid",Cards:dO,"Show as a list":"Show as a list",List:fO,"Filter by group":"Filter by group",All:pO,"1 command is waiting for your decision":"1 command is waiting for your decision","Review →":"Review →","a shell on this machine":"a shell on this machine","interactive shell":"interactive shell","A shell on any machine — and the commands you would rather not retype.":"A shell on any machine — and the commands you would rather not retype.","Saved commands":"Saved commands",Here:mO,"Your own shell, as you have it configured":"Your own shell, as you have it configured","Somewhere else":"Somewhere else","No servers yet":"No servers yet","Picked from a list inside any shell, instead of typed again.":"Picked from a list inside any shell, instead of typed again.","New command":"New command","Nothing saved yet":"Nothing saved yet","Save the ones you type most. They appear in every shell, on the servers you choose.":"Save the ones you type most. They appear in every shell, on the servers you choose.",Suggestions:gO,"read only":"read only","An agent paused on these commands. Nothing runs until you decide.":"An agent paused on these commands. Nothing runs until you decide.","Nothing is waiting":"Nothing is waiting","Nothing pauses here until you ask it to. Open a server, set Approval to destructive or always, and its agent will stop and wait for you before acting.":"Nothing pauses here until you ask it to. Open a server, set Approval to destructive or always, and its agent will stop and wait for you before acting.","Set it up on a server":"Set it up on a server",waiting:vO,"Destructive.":"Destructive.","This command can delete or overwrite data, and nothing on the server will undo it.":"This command can delete or overwrite data, and nothing on the server will undo it.","(no command)":"(no command)","Copy the command":"Copy the command",Refuse:_O,"Approve and run":"Approve and run",Approve:yO,"Runs the desktop app's engine{{v0}}":"Runs the desktop app's engine{{v0}}","Runs the npm engine{{v0}}":"Runs the npm engine{{v0}}","Restart {{v0}} for it to take effect.":"Restart {{v0}} for it to take effect.","{{v0}} now uses {{v1}}. {{v2}}":"{{v0}} now uses {{v1}}. {{v2}}","{{v0}}: use {{v1}}":"{{v0}}: use {{v1}}","Using {{v0}}":"Using {{v0}}","Use {{v0}}":"Use {{v0}}","Version {{v0}}":"Version {{v0}}","{{v0}}\n\n{{v1}}\n\nPut this in the terminal on {{v2}}?":`{{v0}}
|
|
89
|
+
`)},DA=0,Yo=[];function TA(e){var t=w.useRef([]),i=w.useRef([0,0]),n=w.useRef(),o=w.useState(DA++)[0],l=w.useState(s1)[0],u=w.useRef(e);w.useEffect(function(){u.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var S=QR([e.lockRef.current],(e.shards||[]).map(K0),!0).filter(Boolean);return S.forEach(function(E){return E.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),S.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var f=w.useCallback(function(S,E){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var N=ju(S),T=i.current,A="deltaX"in S?S.deltaX:T[0]-N[0],j="deltaY"in S?S.deltaY:T[1]-N[1],M,P=S.target,D=Math.abs(A)>Math.abs(j)?"h":"v";if("touches"in S&&D==="h"&&P.type==="range")return!1;var L=window.getSelection(),V=L&&L.anchorNode,te=V?V===P||V.contains(P):!1;if(te)return!1;var U=Y0(D,P);if(!U)return!0;if(U?M=D:(M=D==="v"?"h":"v",U=Y0(D,P)),!U)return!1;if(!n.current&&"changedTouches"in S&&(A||j)&&(n.current=M),!M)return!0;var H=n.current||M;return NA(H,E,S,H==="h"?A:j)},[]),p=w.useCallback(function(S){var E=S;if(!(!Yo.length||Yo[Yo.length-1]!==l)){var N="deltaY"in E?W0(E):ju(E),T=t.current.filter(function(M){return M.name===E.type&&(M.target===E.target||E.target===M.shadowParent)&&RA(M.delta,N)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var A=(u.current.shards||[]).map(K0).filter(Boolean).filter(function(M){return M.contains(E.target)}),j=A.length>0?f(E,A[0]):!u.current.noIsolation;j&&E.cancelable&&E.preventDefault()}}},[]),d=w.useCallback(function(S,E,N,T){var A={name:S,delta:E,target:N,should:T,shadowParent:jA(N)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(j){return j!==A})},1)},[]),_=w.useCallback(function(S){i.current=ju(S),n.current=void 0},[]),v=w.useCallback(function(S){d(S.type,W0(S),S.target,f(S,e.lockRef.current))},[]),b=w.useCallback(function(S){d(S.type,ju(S),S.target,f(S,e.lockRef.current))},[]);w.useEffect(function(){return Yo.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:b}),document.addEventListener("wheel",p,qo),document.addEventListener("touchmove",p,qo),document.addEventListener("touchstart",_,qo),function(){Yo=Yo.filter(function(S){return S!==l}),document.removeEventListener("wheel",p,qo),document.removeEventListener("touchmove",p,qo),document.removeEventListener("touchstart",_,qo)}},[]);var x=e.removeScrollBar,y=e.inert;return w.createElement(w.Fragment,null,y?w.createElement(l,{styles:AA(o)}):null,x?w.createElement(bA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function jA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const MA=aA(t1,TA);var $g=w.forwardRef(function(e,t){return w.createElement(Oh,Ri({},e,{ref:t,sideCar:MA}))});$g.classNames=Oh.classNames;var OA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Wo=new WeakMap,Mu=new WeakMap,Ou={},jp=0,o1=function(e){return e&&(e.host||o1(e.parentNode))},LA=function(e,t){return t.map(function(i){if(e.contains(i))return i;var n=o1(i);return n&&e.contains(n)?n:(console.error("aria-hidden",i,"in not contained inside",e,". Doing nothing"),null)}).filter(function(i){return!!i})},zA=function(e,t,i,n){var o=LA(t,Array.isArray(e)?e:[e]);Ou[i]||(Ou[i]=new WeakMap);var l=Ou[i],u=[],f=new Set,p=new Set(o),d=function(v){!v||f.has(v)||(f.add(v),d(v.parentNode))};o.forEach(d);var _=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(b){if(f.has(b))_(b);else try{var x=b.getAttribute(n),y=x!==null&&x!=="false",S=(Wo.get(b)||0)+1,E=(l.get(b)||0)+1;Wo.set(b,S),l.set(b,E),u.push(b),S===1&&y&&Mu.set(b,!0),E===1&&b.setAttribute(i,"true"),y||b.setAttribute(n,"true")}catch(N){console.error("aria-hidden: cannot operate on ",b,N)}})};return _(t),f.clear(),jp++,function(){u.forEach(function(v){var b=Wo.get(v)-1,x=l.get(v)-1;Wo.set(v,b),l.set(v,x),b||(Mu.has(v)||v.removeAttribute(n),Mu.delete(v)),x||v.removeAttribute(i)}),jp--,jp||(Wo=new WeakMap,Wo=new WeakMap,Mu=new WeakMap,Ou={})}},a1=function(e,t,i){i===void 0&&(i="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=OA(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),zA(n,o,i,"aria-hidden")):function(){return null}},BA=Object.defineProperty,$s=(e,t)=>BA(e,"name",{value:t,configurable:!0}),Ug="Dialog",[l1,c1]=mi(Ug),[PA,gi]=l1(Ug),u1=$s(e=>{const{__scopeDialog:t,children:i,open:n,defaultOpen:o,onOpenChange:l,modal:u=!0}=e,f=w.useRef(null),p=w.useRef(null),[d,_]=_a({prop:n,defaultProp:o??!1,onChange:l,caller:Ug}),[v,b]=w.useState(0),[x,y]=w.useState(0);return h.jsx(PA,{scope:t,triggerRef:f,contentRef:p,contentId:In(),titleId:In(),descriptionId:In(),titlePresent:v>0,descriptionPresent:x>0,setTitleCount:b,setDescriptionCount:y,open:d,onOpenChange:_,onOpenToggle:w.useCallback(()=>_(S=>!S),[_]),modal:u,children:i})},"Dialog"),HA="DialogTrigger",IA=w.forwardRef($s(function(t,i){const{__scopeDialog:n,...o}=t,l=gi(HA,n),u=gt(i,l.triggerRef);return h.jsx(vt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":zh(l.open),...o,ref:u,onClick:Oe(t.onClick,l.onOpenToggle)})},"DialogTrigger")),h1="DialogPortal",[$A,d1]=l1(h1,{forceMount:void 0}),f1=$s(e=>{const{__scopeDialog:t,forceMount:i,children:n,container:o}=e,l=gi(h1,t);return h.jsx($A,{scope:t,forceMount:i,children:w.Children.map(n,u=>h.jsx(ln,{present:i||l.open,children:h.jsx(Hg,{asChild:!0,container:o,children:u})}))})},"DialogPortal"),Em="DialogOverlay",p1=w.forwardRef($s(function(t,i){const n=d1(Em,t.__scopeDialog),{forceMount:o=n.forceMount,...l}=t,u=gi(Em,t.__scopeDialog);return u.modal?h.jsx(ln,{present:o||u.open,children:h.jsx(FA,{...l,ref:i})}):null},"DialogOverlay")),UA=dr("DialogOverlay.RemoveScroll"),FA=w.forwardRef($s(function(t,i){const{__scopeDialog:n,...o}=t,l=gi(Em,n),u=Fw(),f=gt(i,u);return h.jsx($g,{as:UA,allowPinchZoom:!0,shards:[l.contentRef],children:h.jsx(vt.div,{"data-state":zh(l.open),...o,ref:f,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),$l="DialogContent",m1=w.forwardRef($s(function(t,i){const n=d1($l,t.__scopeDialog),{forceMount:o=n.forceMount,...l}=t,u=gi($l,t.__scopeDialog);return h.jsx(ln,{present:o||u.open,children:u.modal?h.jsx(VA,{...l,ref:i}):h.jsx(qA,{...l,ref:i})})},"DialogContent")),VA=w.forwardRef($s(function(t,i){const n=gi($l,t.__scopeDialog),o=w.useRef(null),l=gt(i,n.contentRef,o);return w.useEffect(()=>{const u=o.current;if(u)return a1(u)},[]),h.jsx(g1,{...t,ref:l,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Oe(t.onCloseAutoFocus,u=>{var f;u.preventDefault(),(f=n.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Oe(t.onPointerDownOutside,u=>{const f=u.detail.originalEvent,p=f.button===0&&f.ctrlKey===!0;(f.button===2||p)&&u.preventDefault()}),onFocusOutside:Oe(t.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),qA=w.forwardRef($s(function(t,i){const n=gi($l,t.__scopeDialog),o=w.useRef(!1),l=w.useRef(!1);return h.jsx(g1,{...t,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var f,p;(f=t.onCloseAutoFocus)==null||f.call(t,u),u.defaultPrevented||(o.current||(p=n.triggerRef.current)==null||p.focus(),u.preventDefault()),o.current=!1,l.current=!1},onInteractOutside:u=>{var d,_;(d=t.onInteractOutside)==null||d.call(t,u),u.defaultPrevented||(o.current=!0,u.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const f=u.target;((_=n.triggerRef.current)==null?void 0:_.contains(f))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&l.current&&u.preventDefault()}})},"DialogContentNonModal")),g1=w.forwardRef($s(function(t,i){const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:u,...f}=t,p=gi($l,n);return Mh(),h.jsx(h.Fragment,{children:h.jsx(Yw,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:l,onUnmountAutoFocus:u,children:h.jsx(zg,{role:"dialog",id:p.contentId,"aria-describedby":p.descriptionPresent?p.descriptionId:void 0,"aria-labelledby":p.titlePresent?p.titleId:void 0,"data-state":zh(p.open),...f,ref:i,deferPointerDownOutside:!0,onDismiss:()=>p.onOpenChange(!1)})})})},"DialogContentImpl")),YA="DialogTitle",v1=w.forwardRef($s(function(t,i){const{__scopeDialog:n,...o}=t,l=gi(YA,n),{setTitleCount:u}=l;return Cs(()=>(u(f=>f+1),()=>u(f=>f-1)),[u]),h.jsx(vt.h2,{id:l.titleId,...o,ref:i})},"DialogTitle")),WA="DialogDescription",_1=w.forwardRef($s(function(t,i){const{__scopeDialog:n,...o}=t,l=gi(WA,n),{setDescriptionCount:u}=l;return Cs(()=>(u(f=>f+1),()=>u(f=>f-1)),[u]),h.jsx(vt.p,{id:l.descriptionId,...o,ref:i})},"DialogDescription")),KA="DialogClose",Lh=w.forwardRef($s(function(t,i){const{__scopeDialog:n,...o}=t,l=gi(KA,n);return h.jsx(vt.button,{type:"button",...o,ref:i,onClick:Oe(t.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function zh(e){return e?"open":"closed"}$s(zh,"getState");var GA=Object.defineProperty,vr=(e,t)=>GA(e,"name",{value:t,configurable:!0}),XA="AlertDialog",[ZA,OU]=mi(XA,[c1]),_r=c1(),QA=vr(e=>{const{__scopeAlertDialog:t,...i}=e,n=_r(t);return h.jsx(u1,{...n,...i,modal:!0})},"AlertDialog");w.forwardRef(vr(function(t,i){const{__scopeAlertDialog:n,...o}=t,l=_r(n);return h.jsx(IA,{...l,...o,ref:i})},"AlertDialogTrigger"));var JA=vr(e=>{const{__scopeAlertDialog:t,...i}=e,n=_r(t);return h.jsx(f1,{...n,...i})},"AlertDialogPortal"),eD=w.forwardRef(vr(function(t,i){const{__scopeAlertDialog:n,...o}=t,l=_r(n);return h.jsx(p1,{...l,...o,ref:i})},"AlertDialogOverlay")),tD="AlertDialogContent",[sD,iD]=ZA(tD),rD=w.forwardRef(vr(function(t,i){const{__scopeAlertDialog:n,children:o,...l}=t,u=_r(n),f=w.useRef(null),p=gt(i,f),d=w.useRef(null);return h.jsx(sD,{scope:n,cancelRef:d,children:h.jsx(m1,{role:"alertdialog",...u,...l,ref:p,onOpenAutoFocus:Oe(l.onOpenAutoFocus,_=>{var v;_.preventDefault(),(v=d.current)==null||v.focus({preventScroll:!0})}),onPointerDownOutside:_=>_.preventDefault(),onInteractOutside:_=>_.preventDefault(),children:o})})},"AlertDialogContent")),nD=w.forwardRef(vr(function(t,i){const{__scopeAlertDialog:n,...o}=t,l=_r(n);return h.jsx(v1,{...l,...o,ref:i})},"AlertDialogTitle")),oD=w.forwardRef(vr(function(t,i){const{__scopeAlertDialog:n,...o}=t,l=_r(n);return h.jsx(_1,{...l,...o,ref:i})},"AlertDialogDescription")),aD=w.forwardRef(vr(function(t,i){const{__scopeAlertDialog:n,...o}=t,l=_r(n);return h.jsx(Lh,{...l,...o,ref:i})},"AlertDialogAction")),lD="AlertDialogCancel",cD=w.forwardRef(vr(function(t,i){const{__scopeAlertDialog:n,...o}=t,{cancelRef:l}=iD(lD,n),u=_r(n),f=gt(i,l);return h.jsx(Lh,{...u,...o,ref:f})},"AlertDialogCancel")),uD=QA,hD=JA,dD=eD,fD=rD,pD=aD,mD=cD,gD=nD,vD=oD,_D=Object.defineProperty,yD=(e,t)=>_D(e,"name",{value:t,configurable:!0});function y1(e){const[t,i]=w.useState(void 0);return Cs(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const l=o[0];let u,f;if("borderBoxSize"in l){const p=l.borderBoxSize,d=Array.isArray(p)?p[0]:p;u=d.inlineSize,f=d.blockSize}else u=e.offsetWidth,f=e.offsetHeight;i({width:u,height:f})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else i(void 0)},[e]),t}yD(y1,"useSize");const bD=["top","right","bottom","left"],on=Math.min,lr=Math.max,hh=Math.round,Lu=Math.floor,cr=e=>({x:e,y:e}),xD={left:"right",right:"left",bottom:"top",top:"bottom"};function b1(e,t,i){return lr(e,on(t,i))}function mr(e,t){return typeof e=="function"?e(t):e}function an(e){return e.split("-")[0]}function ya(e){return e.split("-")[1]}function Fg(e){return e==="x"?"y":"x"}function Vg(e){return e==="y"?"height":"width"}function Di(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function qg(e){return Fg(Di(e))}function SD(e,t,i){i===void 0&&(i=!1);const n=ya(e),o=qg(e),l=Vg(o);let u=o==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(u=dh(u)),[u,dh(u)]}function wD(e){const t=dh(e);return[Nm(e),t,Nm(t)]}function Nm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const G0=["left","right"],X0=["right","left"],CD=["top","bottom"],kD=["bottom","top"];function ED(e,t,i){switch(e){case"top":case"bottom":return i?t?X0:G0:t?G0:X0;case"left":case"right":return t?CD:kD;default:return[]}}function ND(e,t,i,n){const o=ya(e);let l=ED(an(e),i==="start",n);return o&&(l=l.map(u=>u+"-"+o),t&&(l=l.concat(l.map(Nm)))),l}function dh(e){const t=an(e);return xD[t]+e.slice(t.length)}function RD(e){var t,i,n,o;return{top:(t=e.top)!=null?t:0,right:(i=e.right)!=null?i:0,bottom:(n=e.bottom)!=null?n:0,left:(o=e.left)!=null?o:0}}function x1(e){return typeof e!="number"?RD(e):{top:e,right:e,bottom:e,left:e}}function fh(e){const{x:t,y:i,width:n,height:o}=e;return{width:n,height:o,top:i,left:t,right:t+n,bottom:i+o,x:t,y:i}}function Z0(e,t,i){let{reference:n,floating:o}=e;const l=Di(t),u=qg(t),f=Vg(u),p=an(t),d=l==="y",_=n.x+n.width/2-o.width/2,v=n.y+n.height/2-o.height/2,b=n[f]/2-o[f]/2;let x;switch(p){case"top":x={x:_,y:n.y-o.height};break;case"bottom":x={x:_,y:n.y+n.height};break;case"right":x={x:n.x+n.width,y:v};break;case"left":x={x:n.x-o.width,y:v};break;default:x={x:n.x,y:n.y}}const y=ya(t);return y&&(x[u]+=b*(y==="end"?1:-1)*(i&&d?-1:1)),x}async function AD(e,t){var i;t===void 0&&(t={});const{x:n,y:o,platform:l,rects:u,elements:f,strategy:p}=e,{boundary:d="clippingAncestors",rootBoundary:_="viewport",elementContext:v="floating",altBoundary:b=!1,padding:x=0}=mr(t,e),y=x1(x),E=f[b?v==="floating"?"reference":"floating":v],N=fh(await l.getClippingRect({element:(i=await(l.isElement==null?void 0:l.isElement(E)))==null||i?E:E.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(f.floating)),boundary:d,rootBoundary:_,strategy:p})),T=v==="floating"?{x:n,y:o,width:u.floating.width,height:u.floating.height}:u.reference,A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f.floating)),j=await(l.isElement==null?void 0:l.isElement(A))&&await(l.getScale==null?void 0:l.getScale(A))||{x:1,y:1},M=fh(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:T,offsetParent:A,strategy:p}):T);return{top:(N.top-M.top+y.top)/j.y,bottom:(M.bottom-N.bottom+y.bottom)/j.y,left:(N.left-M.left+y.left)/j.x,right:(M.right-N.right+y.right)/j.x}}const DD=50,TD=async(e,t,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:l=[],platform:u}=i,f=u.detectOverflow?u:{...u,detectOverflow:AD},p=await(u.isRTL==null?void 0:u.isRTL(t));let d=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:_,y:v}=Z0(d,n,p),b=n,x=0;const y={};for(let S=0;S<l.length;S++){const E=l[S];if(!E)continue;const{name:N,fn:T}=E,{x:A,y:j,data:M,reset:P}=await T({x:_,y:v,initialPlacement:n,placement:b,strategy:o,middlewareData:y,rects:d,platform:f,elements:{reference:e,floating:t}});_=A??_,v=j??v,y[N]={...y[N],...M},P&&x<DD&&(x++,typeof P=="object"&&(P.placement&&(b=P.placement),P.rects&&(d=P.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:_,y:v}=Z0(d,b,p)),S=-1)}return{x:_,y:v,placement:b,strategy:o,middlewareData:y}},jD=e=>({name:"arrow",options:e,async fn(t){const{x:i,y:n,placement:o,rects:l,platform:u,elements:f,middlewareData:p}=t,{element:d,padding:_=0}=mr(e,t)||{};if(d==null)return{};const v=x1(_),b={x:i,y:n},x=qg(o),y=Vg(x),S=await u.getDimensions(d),E=x==="y",N=E?"top":"left",T=E?"bottom":"right",A=E?"clientHeight":"clientWidth",j=l.reference[y]+l.reference[x]-b[x]-l.floating[y],M=b[x]-l.reference[x],P=await(u.getOffsetParent==null?void 0:u.getOffsetParent(d));let D=P?P[A]:0;(!D||!await(u.isElement==null?void 0:u.isElement(P)))&&(D=f.floating[A]||l.floating[y]);const L=j/2-M/2,V=D/2-S[y]/2-1,te=on(v[N],V),U=on(v[T],V),H=D-S[y]-U,B=D/2-S[y]/2+L,W=b1(te,B,H),K=!p.arrow&&ya(o)!=null&&B!==W&&l.reference[y]/2-(B<te?te:U)-S[y]/2<0,O=K?B<te?B-te:B-H:0;return{[x]:b[x]+O,data:{[x]:W,centerOffset:B-W-O,...K&&{alignmentOffset:O}},reset:K}}}),MD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var i,n;const{placement:o,middlewareData:l,rects:u,initialPlacement:f,platform:p,elements:d}=t,{mainAxis:_=!0,crossAxis:v=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:S=!0,...E}=mr(e,t);if((i=l.arrow)!=null&&i.alignmentOffset)return{};const N=an(o),T=Di(f),A=an(f)===f,j=await(p.isRTL==null?void 0:p.isRTL(d.floating)),M=b||(A||!S?[dh(f)]:wD(f)),P=y!=="none";!b&&P&&M.push(...ND(f,S,y,j));const D=[f,...M],L=await p.detectOverflow(t,E),V=[];let te=((n=l.flip)==null?void 0:n.overflows)||[];if(_&&V.push(L[N]),v){const W=SD(o,u,j);V.push(L[W[0]],L[W[1]])}if(te=[...te,{placement:o,overflows:V}],!V.every(W=>W<=0)){var U,H;const W=(((U=l.flip)==null?void 0:U.index)||0)+1,K=D[W];if(K&&(!(v==="alignment"?T!==Di(K):!1)||te.every(F=>Di(F.placement)===T?F.overflows[0]>0:!0)))return{data:{index:W,overflows:te},reset:{placement:K}};let O=(H=te.filter($=>$.overflows[0]<=0).sort(($,F)=>$.overflows[1]-F.overflows[1])[0])==null?void 0:H.placement;if(!O)switch(x){case"bestFit":{var B;const $=(B=te.filter(F=>{if(P){const ae=Di(F.placement);return ae===T||ae==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(ae=>ae>0).reduce((ae,G)=>ae+G,0)]).sort((F,ae)=>F[1]-ae[1])[0])==null?void 0:B[0];$&&(O=$);break}case"initialPlacement":O=f;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function Q0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function J0(e){return bD.some(t=>e[t]>=0)}const OD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:i,platform:n}=t,{strategy:o="referenceHidden",...l}=mr(e,t);switch(o){case"referenceHidden":{const u=await n.detectOverflow(t,{...l,elementContext:"reference"}),f=Q0(u,i.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:J0(f)}}}case"escaped":{const u=await n.detectOverflow(t,{...l,altBoundary:!0}),f=Q0(u,i.floating);return{data:{escapedOffsets:f,escaped:J0(f)}}}default:return{}}}}},S1=new Set(["left","top"]);async function LD(e,t){const{placement:i,platform:n,elements:o}=e,l=await(n.isRTL==null?void 0:n.isRTL(o.floating)),u=an(i),f=ya(i),p=Di(i)==="y",d=S1.has(u)?-1:1,_=l&&p?-1:1,v=mr(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:y}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof y=="number"&&(x=f==="end"?y*-1:y),p?{x:x*_,y:b*d}:{x:b*d,y:x*_}}const zD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var i,n;const{x:o,y:l,placement:u,middlewareData:f}=t,p=await LD(t,e);return u===((i=f.offset)==null?void 0:i.placement)&&(n=f.arrow)!=null&&n.alignmentOffset?{}:{x:o+p.x,y:l+p.y,data:{...p,placement:u}}}}},BD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:o,platform:l}=t,{mainAxis:u=!0,crossAxis:f=!1,limiter:p={fn:T=>{let{x:A,y:j}=T;return{x:A,y:j}}},...d}=mr(e,t),_={x:i,y:n},v=await l.detectOverflow(t,d),b=Di(o),x=Fg(b);let y=_[x],S=_[b];const E=(T,A)=>b1(A+v[T==="y"?"top":"left"],A,A-v[T==="y"?"bottom":"right"]);u&&(y=E(x,y)),f&&(S=E(b,S));const N=p.fn({...t,[x]:y,[b]:S});return{...N,data:{x:N.x-i,y:N.y-n,enabled:{[x]:u,[b]:f}}}}}},PD=function(e){return e===void 0&&(e={}),{options:e,fn(t){var i,n;const{x:o,y:l,placement:u,rects:f,middlewareData:p}=t,{offset:d=0,mainAxis:_=!0,crossAxis:v=!0}=mr(e,t),b={x:o,y:l},x=Di(u),y=Fg(x);let S=b[y],E=b[x];const N=mr(d,t),T=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:(i=N.mainAxis)!=null?i:0,crossAxis:(n=N.crossAxis)!=null?n:0};if(_){const M=y==="y"?"height":"width",P=f.reference[y]-f.floating[M]+T.mainAxis,D=f.reference[y]+f.reference[M]-T.mainAxis;S<P?S=P:S>D&&(S=D)}if(v){var A,j;const M=y==="y"?"width":"height",P=S1.has(an(u)),D=f.reference[x]-f.floating[M]+(P&&((A=p.offset)==null?void 0:A[x])||0)+(P?0:T.crossAxis),L=f.reference[x]+f.reference[M]+(P?0:((j=p.offset)==null?void 0:j[x])||0)-(P?T.crossAxis:0);E<D?E=D:E>L&&(E=L)}return{[y]:S,[x]:E}}}},HD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:i,rects:n,platform:o,elements:l}=t,{apply:u=()=>{},...f}=mr(e,t),p=await o.detectOverflow(t,f),d=an(i),_=ya(i),v=Di(i)==="y",{width:b,height:x}=n.floating;let y,S;d==="top"||d==="bottom"?(y=d,S=_===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(S=d,y=_==="end"?"top":"bottom");const E=x-p.top-p.bottom,N=b-p.left-p.right,T=on(x-p[y],E),A=on(b-p[S],N),j=t.middlewareData.shift,M=!j;let P=T,D=A;j!=null&&j.enabled.x&&(D=N),j!=null&&j.enabled.y&&(P=E),M&&!_&&(v?D=b-2*lr(p.left,p.right):P=x-2*lr(p.top,p.bottom)),await u({...t,availableWidth:D,availableHeight:P});const L=await o.getDimensions(l.floating);return b!==L.width||x!==L.height?{reset:{rects:!0}}:{}}}};function Bh(){return typeof window<"u"}function ba(e){return w1(e)?(e.nodeName||"").toLowerCase():"#document"}function ks(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yr(e){var t;return(t=(w1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function w1(e){return Bh()?e instanceof Node||e instanceof ks(e).Node:!1}function Oi(e){return Bh()?e instanceof Element||e instanceof ks(e).Element:!1}function cn(e){return Bh()?e instanceof HTMLElement||e instanceof ks(e).HTMLElement:!1}function ex(e){return!Bh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ks(e).ShadowRoot}function Ph(e){const{overflow:t,overflowX:i,overflowY:n,display:o}=Li(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&o!=="inline"&&o!=="contents"}function ID(e){return/^(table|td|th)$/.test(ba(e))}function Hh(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const $D=/transform|translate|scale|rotate|perspective|filter/,UD=/paint|layout|strict|content/,jn=e=>!!e&&e!=="none";let Mp;function Yg(e){const t=Oi(e)?Li(e):e;return jn(t.transform)||jn(t.translate)||jn(t.scale)||jn(t.rotate)||jn(t.perspective)||!Wg()&&(jn(t.backdropFilter)||jn(t.filter))||$D.test(t.willChange||"")||UD.test(t.contain||"")}function FD(e){let t=Fn(e);for(;cn(t)&&!Ul(t);){if(Yg(t))return t;if(Hh(t))return null;t=Fn(t)}return null}function Wg(){return Mp==null&&(Mp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Mp}function Ul(e){return/^(html|body|#document)$/.test(ba(e))}function Li(e){return ks(e).getComputedStyle(e)}function Ih(e){return Oi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fn(e){if(ba(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ex(e)&&e.host||yr(e);return ex(t)?t.host:t}function C1(e){const t=Fn(e);return Ul(t)?(e.ownerDocument||e).body:cn(t)&&Ph(t)?t:C1(t)}function Fl(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const o=C1(e),l=o===((n=e.ownerDocument)==null?void 0:n.body),u=ks(o);if(l){const f=Rm(u);return t.concat(u,u.visualViewport||[],Ph(o)?o:[],f&&i?Fl(f):[])}else return t.concat(o,Fl(o,[],i))}function Rm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function k1(e){const t=Li(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=cn(e),l=o?e.offsetWidth:i,u=o?e.offsetHeight:n,f=hh(i)!==l||hh(n)!==u;return f&&(i=l,n=u),{width:i,height:n,$:f}}function Kg(e){return Oi(e)?e:e.contextElement}function ra(e){const t=Kg(e);if(!cn(t))return cr(1);const i=t.getBoundingClientRect(),{width:n,height:o,$:l}=k1(t);let u=(l?hh(i.width):i.width)/n,f=(l?hh(i.height):i.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const VD=cr(0);function E1(e){const t=ks(e);return!Wg()||!t.visualViewport?VD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qD(e,t,i){return t===void 0&&(t=!1),!!i&&t&&i===ks(e)}function Vn(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const o=e.getBoundingClientRect(),l=Kg(e);let u=cr(1);t&&(n?Oi(n)&&(u=ra(n)):u=ra(e));const f=qD(l,i,n)?E1(l):cr(0);let p=(o.left+f.x)/u.x,d=(o.top+f.y)/u.y,_=o.width/u.x,v=o.height/u.y;if(l&&n){const b=ks(l),x=Oi(n)?ks(n):n;let y=b,S=Rm(y);for(;S&&x!==y;){const E=ra(S),N=S.getBoundingClientRect(),T=Li(S),A=N.left+(S.clientLeft+parseFloat(T.paddingLeft))*E.x,j=N.top+(S.clientTop+parseFloat(T.paddingTop))*E.y;p*=E.x,d*=E.y,_*=E.x,v*=E.y,p+=A,d+=j,y=ks(S),S=Rm(y)}}return fh({width:_,height:v,x:p,y:d})}function $h(e,t){const i=Ih(e).scrollLeft;return t?t.left+i:Vn(yr(e)).left+i}function N1(e,t){const i=e.getBoundingClientRect(),n=i.left+t.scrollLeft-$h(e,i),o=i.top+t.scrollTop;return{x:n,y:o}}function YD(e){let{elements:t,rect:i,offsetParent:n,strategy:o}=e;const l=o==="fixed",u=yr(n),f=t?Hh(t.floating):!1;if(n===u||f&&l)return i;let p={scrollLeft:0,scrollTop:0},d=cr(1);const _=cr(0),v=cn(n);if((v||!l)&&((ba(n)!=="body"||Ph(u))&&(p=Ih(n)),v)){const x=Vn(n);d=ra(n),_.x=x.x+n.clientLeft,_.y=x.y+n.clientTop}const b=u&&!v&&!l?N1(u,p):cr(0);return{width:i.width*d.x,height:i.height*d.y,x:i.x*d.x-p.scrollLeft*d.x+_.x+b.x,y:i.y*d.y-p.scrollTop*d.y+_.y+b.y}}function WD(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function KD(e){const t=Ih(e),i=e.ownerDocument.body,n=lr(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=lr(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let l=-t.scrollLeft+$h(e);const u=-t.scrollTop;return Li(i).direction==="rtl"&&(l+=lr(e.clientWidth,i.clientWidth)-n),{width:n,height:o,x:l,y:u}}const GD=25;function XD(e,t,i){i===void 0&&(i="viewport");const n=i==="layoutViewport",o=ks(e),l=yr(e),u=o.visualViewport;let f=l.clientWidth,p=l.clientHeight,d=0,_=0;if(u){const b=!Wg()||t==="fixed";n?b||(d=-u.offsetLeft,_=-u.offsetTop):(f=u.width,p=u.height,b&&(d=u.offsetLeft,_=u.offsetTop))}if($h(l)<=0){const b=l.ownerDocument,x=b.body,y=getComputedStyle(x),S=b.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,E=Math.abs(l.clientWidth-x.clientWidth-S),N=getComputedStyle(l).scrollbarGutter==="stable both-edges"?E/2:E;N<=GD&&(f-=N)}return{width:f,height:p,x:d,y:_}}function ZD(e,t){const i=Vn(e,!0,t==="fixed"),n=i.top+e.clientTop,o=i.left+e.clientLeft,l=ra(e),u=e.clientWidth*l.x,f=e.clientHeight*l.y,p=o*l.x,d=n*l.y;return{width:u,height:f,x:p,y:d}}function tx(e,t,i){let n;if(t==="viewport"||t==="layoutViewport")n=XD(e,i,t);else if(t==="document")n=KD(yr(e));else if(Oi(t))n=ZD(t,i);else{const o=E1(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return fh(n)}function QD(e,t){const i=t.get(e);if(i)return i;let n=Fl(e,[],!1).filter(f=>Oi(f)&&ba(f)!=="body"),o=null;const l=Li(e).position==="fixed";let u=l?Fn(e):e;for(;Oi(u)&&!Ul(u);){const f=Li(u),p=Yg(u),d=o?o.position:l?"fixed":"";!p&&(d==="fixed"||d==="absolute"&&f.position==="static")?n=n.filter(v=>v!==u):o=f,u=Fn(u)}return t.set(e,n),n}function JD(e){let{element:t,boundary:i,rootBoundary:n,strategy:o}=e;const u=[...i==="clippingAncestors"?Hh(t)?[]:QD(t,this._c):[].concat(i),n],f=tx(t,u[0],o);let p=f.top,d=f.right,_=f.bottom,v=f.left;for(let b=1;b<u.length;b++){const x=tx(t,u[b],o);p=lr(x.top,p),d=on(x.right,d),_=on(x.bottom,_),v=lr(x.left,v)}return{width:d-v,height:_-p,x:v,y:p}}function eT(e){const{width:t,height:i}=k1(e);return{width:t,height:i}}function tT(e,t,i){const n=cn(t),o=yr(t),l=i==="fixed",u=Vn(e,!0,l,t);let f={scrollLeft:0,scrollTop:0};const p=cr(0);if((n||!l)&&((ba(t)!=="body"||Ph(o))&&(f=Ih(t)),n)){const b=Vn(t,!0,l,t);p.x=b.x+t.clientLeft,p.y=b.y+t.clientTop}!n&&o&&(p.x=$h(o));const d=o&&!n&&!l?N1(o,f):cr(0),_=u.left+f.scrollLeft-p.x-d.x,v=u.top+f.scrollTop-p.y-d.y;return{x:_,y:v,width:u.width,height:u.height}}function Op(e){return Li(e).position==="static"}function sx(e,t){if(!cn(e)||Li(e).position==="fixed")return null;if(t)return t(e);let i=e.offsetParent;return yr(e)===i&&(i=i.ownerDocument.body),i}function R1(e,t){const i=ks(e);if(Hh(e))return i;if(!cn(e)){let o=Fn(e);for(;o&&!Ul(o);){if(Oi(o)&&!Op(o))return o;o=Fn(o)}return i}let n=sx(e,t);for(;n&&ID(n)&&Op(n);)n=sx(n,t);return n&&Ul(n)&&Op(n)&&!Yg(n)?i:n||FD(e)||i}const sT=async function(e){const t=this.getOffsetParent||R1,i=this.getDimensions,n=await i(e.floating);return{reference:tT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function iT(e){return Li(e).direction==="rtl"}const rT={convertOffsetParentRelativeRectToViewportRelativeRect:YD,getDocumentElement:yr,getClippingRect:JD,getOffsetParent:R1,getElementRects:sT,getClientRects:WD,getDimensions:eT,getScale:ra,isElement:Oi,isRTL:iT};function A1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nT(e,t,i){let n=null,o;const l=yr(e);function u(){var _;clearTimeout(o),(_=n)==null||_.disconnect(),n=null}function f(_,v){_===void 0&&(_=!1),v===void 0&&(v=1),u();const b=e.getBoundingClientRect(),{left:x,top:y,width:S,height:E}=b;if(_||t(),!S||!E)return;const N=Lu(y),T=Lu(l.clientWidth-(x+S)),A=Lu(l.clientHeight-(y+E)),j=Lu(x),P={rootMargin:-N+"px "+-T+"px "+-A+"px "+-j+"px",threshold:lr(0,on(1,v))||1};let D=!0;function L(V){const te=V[0].intersectionRatio;if(!A1(b,e.getBoundingClientRect()))return f();if(te!==v){if(!D)return f();te?f(!1,te):o=setTimeout(()=>{f(!1,1e-7)},1e3)}D=!1}try{n=new IntersectionObserver(L,{...P,root:l.ownerDocument})}catch{n=new IntersectionObserver(L,P)}n.observe(e)}const p=ks(e),d=()=>f(i);return p.addEventListener("resize",d),f(!0),()=>{p.removeEventListener("resize",d),u()}}function oT(e,t,i,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:p=!1}=n,d=Kg(e),_=o||l?[...d?Fl(d):[],...t?Fl(t):[]]:[];_.forEach(N=>{o&&N.addEventListener("scroll",i),l&&N.addEventListener("resize",i)});const v=d&&f?nT(d,i,l):null;let b=-1,x=null;u&&(x=new ResizeObserver(N=>{let[T]=N;T&&T.target===d&&x&&t&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=x)==null||A.observe(t)})),i()}),d&&!p&&x.observe(d),t&&x.observe(t));let y,S=p?Vn(e):null;p&&E();function E(){const N=Vn(e);S&&!A1(S,N)&&i(),S=N,y=requestAnimationFrame(E)}return i(),()=>{var N;_.forEach(T=>{o&&T.removeEventListener("scroll",i),l&&T.removeEventListener("resize",i)}),v==null||v(),(N=x)==null||N.disconnect(),x=null,p&&cancelAnimationFrame(y)}}const aT=zD,lT=BD,cT=MD,uT=HD,hT=OD,ix=jD,dT=PD,fT=(e,t,i)=>{const n=new Map,o=i??{},l={...rT,...o.platform,_c:n};return TD(e,t,{...o,platform:l})};var pT=typeof document<"u",mT=function(){},eh=pT?w.useLayoutEffect:mT;function ph(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let i,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(i=e.length,i!==t.length)return!1;for(n=i;n--!==0;)if(!ph(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),i=o.length,i!==Object.keys(t).length)return!1;for(n=i;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=i;n--!==0;){const l=o[n];if(!(l==="_owner"&&e.$$typeof)&&!ph(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function D1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rx(e,t){const i=D1(e);return Math.round(t*i)/i}function Lp(e){const t=w.useRef(e);return eh(()=>{t.current=e}),t}function gT(e){e===void 0&&(e={});const{placement:t="bottom",strategy:i="absolute",middleware:n=[],platform:o,elements:{reference:l,floating:u}={},transform:f=!0,whileElementsMounted:p,open:d}=e,[_,v]=w.useState({x:0,y:0,strategy:i,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=w.useState(n);ph(b,n)||x(n);const[y,S]=w.useState(null),[E,N]=w.useState(null),T=w.useCallback(F=>{F!==P.current&&(P.current=F,S(F))},[]),A=w.useCallback(F=>{F!==D.current&&(D.current=F,N(F))},[]),j=l||y,M=u||E,P=w.useRef(null),D=w.useRef(null),L=w.useRef(_),V=p!=null,te=Lp(p),U=Lp(o),H=Lp(d),B=w.useCallback(()=>{if(!P.current||!D.current)return;const F={placement:t,strategy:i,middleware:b};U.current&&(F.platform=U.current),fT(P.current,D.current,F).then(ae=>{const G={...ae,isPositioned:H.current!==!1};W.current&&!ph(L.current,G)&&(L.current=G,Tg.flushSync(()=>{v(G)}))})},[b,t,i,U,H]);eh(()=>{d===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,v(F=>({...F,isPositioned:!1})))},[d]);const W=w.useRef(!1);eh(()=>(W.current=!0,()=>{W.current=!1}),[]),eh(()=>{if(j&&(P.current=j),M&&(D.current=M),j&&M){if(te.current)return te.current(j,M,B);B()}},[j,M,B,te,V]);const K=w.useMemo(()=>({reference:P,floating:D,setReference:T,setFloating:A}),[T,A]),O=w.useMemo(()=>({reference:j,floating:M}),[j,M]),$=w.useMemo(()=>{const F={position:i,left:0,top:0};if(!O.floating)return F;const ae=rx(O.floating,_.x),G=rx(O.floating,_.y);return f?{...F,transform:"translate("+ae+"px, "+G+"px)",...D1(O.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:ae,top:G}},[i,f,O.floating,_.x,_.y]);return w.useMemo(()=>({..._,update:B,refs:K,elements:O,floatingStyles:$}),[_,B,K,O,$])}const vT=e=>{function t(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){const{element:n,padding:o}=typeof e=="function"?e(i):e;return n&&t(n)?n.current!=null?ix({element:n.current,padding:o}).fn(i):{}:n?ix({element:n,padding:o}).fn(i):{}}}},_T=(e,t)=>{const i=aT(e);return{name:i.name,fn:i.fn,options:[e,t]}},yT=(e,t)=>{const i=lT(e);return{name:i.name,fn:i.fn,options:[e,t]}},bT=(e,t)=>({fn:dT(e).fn,options:[e,t]}),xT=(e,t)=>{const i=cT(e);return{name:i.name,fn:i.fn,options:[e,t]}},ST=(e,t)=>{const i=uT(e);return{name:i.name,fn:i.fn,options:[e,t]}},wT=(e,t)=>{const i=hT(e);return{name:i.name,fn:i.fn,options:[e,t]}},CT=(e,t)=>{const i=vT(e);return{name:i.name,fn:i.fn,options:[e,t]}};var kT=Object.defineProperty,ET=(e,t)=>kT(e,"name",{value:t,configurable:!0}),NT=w.forwardRef(ET(function(t,i){const{children:n,width:o=10,height:l=5,...u}=t;return h.jsx(vt.svg,{...u,ref:i,width:o,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),RT=NT,AT=Object.defineProperty,ur=(e,t)=>AT(e,"name",{value:t,configurable:!0}),T1="Popper",[j1,Uh]=mi(T1),[DT,M1]=j1(T1),TT=ur(e=>{const{__scopePopper:t,children:i}=e,[n,o]=w.useState(null),[l,u]=w.useState(void 0);return h.jsx(DT,{scope:t,anchor:n,onAnchorChange:o,placementState:l,setPlacementState:u,children:i})},"Popper"),jT="PopperAnchor",MT=w.forwardRef(ur(function(t,i){const{__scopePopper:n,virtualRef:o,...l}=t,u=M1(jT,n),f=w.useRef(null),p=u.onAnchorChange,d=w.useCallback(S=>{f.current=S,S&&p(S)},[p]),_=gt(i,d),v=w.useRef(null);w.useEffect(()=>{if(!o)return;const S=v.current;v.current=o.current,S!==v.current&&p(v.current)});const b=u.placementState&&Fh(u.placementState),x=b==null?void 0:b[0],y=b==null?void 0:b[1];return o?null:h.jsx(vt.div,{"data-radix-popper-side":x,"data-radix-popper-align":y,...l,ref:_})},"PopperAnchor")),O1="PopperContent",[OT,LT]=j1(O1),zT=w.forwardRef(ur(function(t,i){var ce,ke,Ae,rt,De,ft,wr;const{__scopePopper:n,side:o="bottom",sideOffset:l=0,align:u="center",alignOffset:f=0,arrowPadding:p=0,avoidCollisions:d=!0,collisionBoundary:_=[],collisionPadding:v=0,sticky:b="partial",hideWhenDetached:x=!1,updatePositionStrategy:y="optimized",onPlaced:S,...E}=t,N=M1(O1,n),[T,A]=w.useState(null),j=gt(i,A),[M,P]=w.useState(null),D=y1(M),L=(D==null?void 0:D.width)??0,V=(D==null?void 0:D.height)??0,te=o+(u!=="center"?"-"+u:""),U=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},H=Array.isArray(_)?_:[_],B=H.length>0,W={padding:U,boundary:H.filter(L1),altBoundary:B},{refs:K,floatingStyles:O,placement:$,isPositioned:F,middlewareData:ae}=gT({strategy:"fixed",placement:te,whileElementsMounted:ur((...Bi)=>oT(...Bi,{animationFrame:y==="always"}),"whileElementsMounted"),elements:{reference:N.anchor},middleware:[_T({mainAxis:l+V,alignmentAxis:f}),d&&yT({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?bT():void 0,...W}),d&&xT({...W}),ST({...W,apply:ur(({elements:Bi,rects:hn,availableWidth:dn,availableHeight:Cr})=>{const{width:fn,height:Pi}=hn.reference,Se=Bi.floating.style;Se.setProperty("--radix-popper-available-width",`${dn}px`),Se.setProperty("--radix-popper-available-height",`${Cr}px`),Se.setProperty("--radix-popper-anchor-width",`${fn}px`),Se.setProperty("--radix-popper-anchor-height",`${Pi}px`)},"apply")}),M&&CT({element:M,padding:p}),IT({arrowWidth:L,arrowHeight:V}),x&&wT({strategy:"referenceHidden",...W,boundary:B?W.boundary:void 0})]}),G=N.setPlacementState;Cs(()=>(G($),()=>{G(void 0)}),[$,G]);const[z,Q]=Fh($),se=pr(S);Cs(()=>{F&&(se==null||se())},[F,se]);const le=(ce=ae.arrow)==null?void 0:ce.x,ue=(ke=ae.arrow)==null?void 0:ke.y,de=((Ae=ae.arrow)==null?void 0:Ae.centerOffset)!==0,[we,me]=w.useState();return Cs(()=>{T&&me(window.getComputedStyle(T).zIndex)},[T]),h.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:F?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:we,"--radix-popper-transform-origin":[(rt=ae.transformOrigin)==null?void 0:rt.x,(De=ae.transformOrigin)==null?void 0:De.y].join(" "),...((ft=ae.hide)==null?void 0:ft.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:h.jsx(OT,{scope:n,placedSide:z,placedAlign:Q,onArrowChange:P,arrowX:le,arrowY:ue,shouldHideArrow:de,children:h.jsx(vt.div,{"data-side":z,"data-align":Q,...E,ref:j,style:{...E.style,animation:F?(wr=E.style)==null?void 0:wr.animation:"none"}})})})},"PopperContent")),BT="PopperArrow",PT={top:"bottom",right:"left",bottom:"top",left:"right"},HT=w.forwardRef(ur(function(t,i){const{__scopePopper:n,...o}=t,l=LT(BT,n),u=PT[l.placedSide];return h.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:h.jsx(RT,{...o,ref:i,style:{...o.style,display:"block"}})})},"PopperArrow"));function L1(e){return e!==null}ur(L1,"isNotNull");var IT=ur(e=>({name:"transformOrigin",options:e,fn(t){var E,N,T;const{placement:i,rects:n,middlewareData:o}=t,u=((E=o.arrow)==null?void 0:E.centerOffset)!==0,f=u?0:e.arrowWidth,p=u?0:e.arrowHeight,[d,_]=Fh(i),v={start:"0%",center:"50%",end:"100%"}[_],b=(((N=o.arrow)==null?void 0:N.x)??0)+f/2,x=(((T=o.arrow)==null?void 0:T.y)??0)+p/2;let y="",S="";return d==="bottom"?(y=u?v:`${b}px`,S=`${-p}px`):d==="top"?(y=u?v:`${b}px`,S=`${n.floating.height+p}px`):d==="right"?(y=`${-p}px`,S=u?v:`${x}px`):d==="left"&&(y=`${n.floating.width+p}px`,S=u?v:`${x}px`),{data:{x:y,y:S}}}}),"transformOrigin");function Fh(e){const[t,i="center"]=e.split("-");return[t,i]}ur(Fh,"getSideAndAlignFromPlacement");var z1=TT,B1=MT,P1=zT,$T=HT,UT=Object.defineProperty,Gg=(e,t)=>UT(e,"name",{value:t,configurable:!0}),zp=!1;function H1(){const[e,t]=w.useState(zp);return w.useEffect(()=>{zp||(zp=!0,t(!0))},[]),e}Gg(H1,"useIsHydrated");var I1=ga[" useSyncExternalStore ".trim().toString()];function $1(){return()=>{}}Gg($1,"subscribe");function U1(){return I1($1,()=>!0,()=>!1)}Gg(U1,"useIsHydratedModern");var FT=typeof I1=="function"?U1:H1,VT=Object.defineProperty,Zn=(e,t)=>VT(e,"name",{value:t,configurable:!0}),Bp="rovingFocusGroup.onEntryFocus",qT={bubbles:!1,cancelable:!0},Vh="RovingFocusGroup",[Am,F1,YT]=Og(Vh),[WT,qh]=mi(Vh,[YT]),[KT,GT]=WT(Vh),XT=w.forwardRef(Zn(function(t,i){return h.jsx(Am.Provider,{scope:t.__scopeRovingFocusGroup,children:h.jsx(Am.Slot,{scope:t.__scopeRovingFocusGroup,children:h.jsx(ZT,{...t,ref:i})})})},"RovingFocusGroup")),ZT=w.forwardRef(Zn(function(t,i){const{__scopeRovingFocusGroup:n,orientation:o,loop:l=!1,dir:u,currentTabStopId:f,defaultCurrentTabStopId:p,onCurrentTabStopIdChange:d,onEntryFocus:_,preventScrollOnEntryFocus:v=!1,...b}=t,x=w.useRef(null),y=gt(i,x),S=jh(u),[E,N]=_a({prop:f,defaultProp:p??null,onChange:d,caller:Vh}),[T,A]=w.useState(!1),j=pr(_),M=F1(n),P=w.useRef(!1),[D,L]=w.useState(0);return w.useEffect(()=>{const V=x.current;if(V)return V.addEventListener(Bp,j),()=>V.removeEventListener(Bp,j)},[j]),h.jsx(KT,{scope:n,orientation:o,dir:S,loop:l,currentTabStopId:E,onItemFocus:w.useCallback(V=>N(V),[N]),onItemShiftTab:w.useCallback(()=>A(!0),[]),onFocusableItemAdd:w.useCallback(()=>L(V=>V+1),[]),onFocusableItemRemove:w.useCallback(()=>L(V=>V-1),[]),children:h.jsx(vt.div,{tabIndex:T||D===0?-1:0,"data-orientation":o,...b,ref:y,style:{outline:"none",...t.style},onMouseDown:Oe(t.onMouseDown,()=>{P.current=!0}),onFocus:Oe(t.onFocus,V=>{const te=!P.current;if(V.target===V.currentTarget&&te&&!T){const U=new CustomEvent(Bp,qT);if(V.currentTarget.dispatchEvent(U),!U.defaultPrevented){const H=M().filter($=>$.focusable),B=H.find($=>$.active),W=H.find($=>$.id===E),O=[B,W,...H].filter(Boolean).map($=>$.ref.current);Xg(O,v)}}P.current=!1}),onBlur:Oe(t.onBlur,()=>A(!1))})})},"RovingFocusGroupImpl")),QT="RovingFocusGroupItem",JT=w.forwardRef(Zn(function(t,i){const{__scopeRovingFocusGroup:n,focusable:o=!0,active:l=!1,tabStopId:u,children:f,...p}=t,d=In(),_=u||d,v=GT(QT,n),b=v.currentTabStopId===_,x=F1(n),{onFocusableItemAdd:y,onFocusableItemRemove:S,currentTabStopId:E}=v,N=FT();return Cs(()=>{if(!(!N||!o))return y(),()=>S()},[N,o,y,S]),w.useEffect(()=>{if(!(N||!o))return y(),()=>S()},[N,o,y,S]),h.jsx(Am.ItemSlot,{scope:n,id:_,focusable:o,active:l,children:h.jsx(vt.span,{tabIndex:b?0:-1,"data-orientation":v.orientation,...p,ref:i,onMouseDown:Oe(t.onMouseDown,T=>{o?v.onItemFocus(_):T.preventDefault()}),onFocus:Oe(t.onFocus,()=>v.onItemFocus(_)),onKeyDown:Oe(t.onKeyDown,T=>{if(T.key==="Tab"&&T.shiftKey){v.onItemShiftTab();return}if(T.target!==T.currentTarget)return;const A=q1(T,v.orientation,v.dir);if(A!==void 0){if(T.metaKey||T.ctrlKey||T.altKey||T.shiftKey)return;T.preventDefault();let M=x().filter(P=>P.focusable).map(P=>P.ref.current);if(A==="last")M.reverse();else if(A==="prev"||A==="next"){A==="prev"&&M.reverse();const P=M.indexOf(T.currentTarget);M=v.loop?Y1(M,P+1):M.slice(P+1)}setTimeout(()=>Xg(M))}}),children:typeof f=="function"?f({isCurrentTabStop:b,hasTabStop:E!=null}):f})})},"RovingFocusGroupItem")),e5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function V1(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Zn(V1,"getDirectionAwareKey");function q1(e,t,i){const n=V1(e.key,i);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return e5[n]}Zn(q1,"getFocusIntent");function Xg(e,t=!1){const i=document.activeElement;for(const n of e)if(n===i||(n.focus({preventScroll:t}),document.activeElement!==i))return}Zn(Xg,"focusFirst");function Y1(e,t){return e.map((i,n)=>e[(t+n)%e.length])}Zn(Y1,"wrapArray");var W1=XT,K1=JT,t5=Object.defineProperty,at=(e,t)=>t5(e,"name",{value:t,configurable:!0}),s5=["Enter"," "],i5=["ArrowDown","PageUp","Home"],G1=["ArrowUp","PageDown","End"],r5=[...i5,...G1],Yh="Menu",[Dm,n5,o5]=Og(Yh),[Qn,X1]=mi(Yh,[o5,Uh,qh]),Zg=Uh(),Z1=qh(),[a5,Jl]=Qn(Yh),[l5,Qg]=Qn(Yh),c5=at(e=>{const{__scopeMenu:t,open:i=!1,children:n,dir:o,onOpenChange:l,modal:u=!0}=e,f=Zg(t),[p,d]=w.useState(null),_=w.useRef(!1),v=pr(l),b=jh(o);return w.useEffect(()=>{const x=at(()=>{_.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},"handleKeyDown"),y=at(()=>_.current=!1,"handlePointer");return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),w.useEffect(()=>{if(!i)return;const x=at(()=>v(!1),"handleBlur");return window.addEventListener("blur",x),()=>window.removeEventListener("blur",x)},[i,v]),h.jsx(z1,{...f,children:h.jsx(a5,{scope:t,open:i,onOpenChange:v,content:p,onContentChange:d,children:h.jsx(l5,{scope:t,onClose:w.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:_,dir:b,modal:u,children:n})})})},"Menu"),u5=w.forwardRef(at(function(t,i){const{__scopeMenu:n,...o}=t,l=Zg(n);return h.jsx(B1,{...l,...o,ref:i})},"MenuAnchor")),Q1="MenuPortal",[h5,d5]=Qn(Q1,{forceMount:void 0}),f5=at(e=>{const{__scopeMenu:t,forceMount:i,children:n,container:o}=e,l=Jl(Q1,t);return h.jsx(h5,{scope:t,forceMount:i,children:h.jsx(ln,{present:i||l.open,children:h.jsx(Hg,{asChild:!0,container:o,children:n})})})},"MenuPortal"),rn="MenuContent",[p5,J1]=Qn(rn),m5=w.forwardRef(at(function(t,i){const n=d5(rn,t.__scopeMenu),{forceMount:o=n.forceMount,...l}=t,u=Jl(rn,t.__scopeMenu),f=Qg(rn,t.__scopeMenu);return h.jsx(Dm.Provider,{scope:t.__scopeMenu,children:h.jsx(ln,{present:o||u.open,children:h.jsx(Dm.Slot,{scope:t.__scopeMenu,children:f.modal?h.jsx(g5,{...l,ref:i}):h.jsx(v5,{...l,ref:i})})})})},"MenuContent")),g5=w.forwardRef(at(function(t,i){const n=Jl(rn,t.__scopeMenu),o=w.useRef(null),l=gt(i,o);return w.useEffect(()=>{const u=o.current;if(u)return a1(u)},[]),h.jsx(eC,{...t,ref:l,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Oe(t.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentModal")),v5=w.forwardRef(at(function(t,i){const n=Jl(rn,t.__scopeMenu);return h.jsx(eC,{...t,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentNonModal")),_5=dr("MenuContent.ScrollLock"),eC=w.forwardRef(at(function(t,i){const{__scopeMenu:n,loop:o=!1,trapFocus:l,onOpenAutoFocus:u,onCloseAutoFocus:f,disableOutsidePointerEvents:p,onEntryFocus:d,onEscapeKeyDown:_,onPointerDownOutside:v,onFocusOutside:b,onInteractOutside:x,onDismiss:y,disableOutsideScroll:S,...E}=t,N=Jl(rn,n),T=Qg(rn,n),A=Zg(n),j=Z1(n),M=n5(n),[P,D]=w.useState(null),L=w.useRef(null),V=gt(i,L,N.onContentChange),te=w.useRef(0),U=w.useRef(""),H=w.useRef(0),B=w.useRef(null),W=w.useRef("right"),K=w.useRef(0),O=S?$g:w.Fragment,$=S?{as:_5,allowPinchZoom:!0}:void 0,F=at(G=>{var me,ce;const z=U.current+G,Q=M().filter(ke=>!ke.disabled),se=document.activeElement,le=(me=Q.find(ke=>ke.ref.current===se))==null?void 0:me.textValue,ue=Q.map(ke=>ke.textValue),de=nC(ue,z,le),we=(ce=Q.find(ke=>ke.textValue===de))==null?void 0:ce.ref.current;at((function ke(Ae){U.current=Ae,window.clearTimeout(te.current),Ae!==""&&(te.current=window.setTimeout(()=>ke(""),1e3))}),"updateSearch")(z),we&&setTimeout(()=>we.focus())},"handleTypeaheadSearch");w.useEffect(()=>()=>window.clearTimeout(te.current),[]),Mh();const ae=w.useCallback(G=>{var Q,se;return W.current===((Q=B.current)==null?void 0:Q.side)&&aC(G,(se=B.current)==null?void 0:se.area)},[]);return h.jsx(p5,{scope:n,searchRef:U,onItemEnter:w.useCallback(G=>{ae(G)&&G.preventDefault()},[ae]),onItemLeave:w.useCallback(G=>{var z;ae(G)||((z=L.current)==null||z.focus(),D(null))},[ae]),onTriggerLeave:w.useCallback(G=>{ae(G)&&G.preventDefault()},[ae]),pointerGraceTimerRef:H,onPointerGraceIntentChange:w.useCallback(G=>{B.current=G},[]),children:h.jsx(O,{...$,children:h.jsx(Yw,{asChild:!0,trapped:l,onMountAutoFocus:Oe(u,G=>{var z;G.preventDefault(),(z=L.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:f,children:h.jsx(zg,{asChild:!0,disableOutsidePointerEvents:p,onEscapeKeyDown:_,onPointerDownOutside:v,onFocusOutside:b,onInteractOutside:x,onDismiss:y,children:h.jsx(W1,{asChild:!0,...j,dir:T.dir,orientation:"vertical",loop:o,currentTabStopId:P,onCurrentTabStopIdChange:D,onEntryFocus:Oe(d,G=>{T.isUsingKeyboardRef.current||G.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(P1,{role:"menu","aria-orientation":"vertical","data-state":tC(N.open),"data-radix-menu-content":"",dir:T.dir,...A,...E,ref:V,style:{outline:"none",...E.style},onKeyDown:Oe(E.onKeyDown,G=>{const Q=G.target.closest("[data-radix-menu-content]")===G.currentTarget,se=G.ctrlKey||G.altKey||G.metaKey,le=G.key.length===1;Q&&(G.key==="Tab"&&G.preventDefault(),!se&&le&&F(G.key));const ue=L.current;if(G.target!==ue||!r5.includes(G.key))return;G.preventDefault();const we=M().filter(me=>!me.disabled).map(me=>me.ref.current);G1.includes(G.key)&&we.reverse(),iC(we)}),onBlur:Oe(t.onBlur,G=>{G.currentTarget.contains(G.target)||(window.clearTimeout(te.current),U.current="")}),onPointerMove:Oe(t.onPointerMove,mh(G=>{const z=G.target,Q=K.current!==G.clientX;if(G.currentTarget.contains(z)&&Q){const se=G.clientX>K.current?"right":"left";W.current=se,K.current=G.clientX}}))})})})})})})},"MenuContentImpl")),Tm="MenuItem",nx="menu.itemSelect",y5=w.forwardRef(at(function(t,i){const{disabled:n=!1,onSelect:o,...l}=t,u=w.useRef(null),f=Qg(Tm,t.__scopeMenu),p=J1(Tm,t.__scopeMenu),d=gt(i,u),_=w.useRef(!1),v=at(()=>{const b=u.current;if(!n&&b){const x=new CustomEvent(nx,{bubbles:!0,cancelable:!0});b.addEventListener(nx,y=>o==null?void 0:o(y),{once:!0}),Mg(b,x),x.defaultPrevented?_.current=!1:f.onClose()}},"handleSelect");return h.jsx(b5,{...l,ref:d,disabled:n,onClick:Oe(t.onClick,v),onPointerDown:b=>{var x;(x=t.onPointerDown)==null||x.call(t,b),_.current=!0},onPointerUp:Oe(t.onPointerUp,b=>{var x;_.current||(x=b.currentTarget)==null||x.click()}),onKeyDown:Oe(t.onKeyDown,b=>{n||b.target!==b.currentTarget||p.searchRef.current!==""&&b.key===" "||s5.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})},"MenuItem")),b5=w.forwardRef(at(function(t,i){const{__scopeMenu:n,disabled:o=!1,textValue:l,...u}=t,f=J1(Tm,n),p=Z1(n),d=w.useRef(null),_=gt(i,d),[v,b]=w.useState(!1),[x,y]=w.useState("");return w.useEffect(()=>{const S=d.current;S&&y((S.textContent??"").trim())},[u.children]),h.jsx(Dm.ItemSlot,{scope:n,disabled:o,textValue:l??x,children:h.jsx(K1,{asChild:!0,...p,focusable:!o,children:h.jsx(vt.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...u,ref:_,onPointerMove:Oe(t.onPointerMove,mh(S=>{o?f.onItemLeave(S):(f.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Oe(t.onPointerLeave,mh(S=>f.onItemLeave(S))),onFocus:Oe(t.onFocus,()=>b(!0)),onBlur:Oe(t.onBlur,()=>b(!1))})})})},"MenuItemImpl")),x5="MenuRadioGroup",[LU,zU]=Qn(x5,{value:void 0,onValueChange:at(()=>{},"onValueChange")}),S5="MenuItemIndicator",[BU,PU]=Qn(S5,{checked:!1}),w5=w.forwardRef(at(function(t,i){const{__scopeMenu:n,...o}=t;return h.jsx(vt.div,{role:"separator","aria-orientation":"horizontal",...o,ref:i})},"MenuSeparator")),C5="MenuSub",[HU,IU]=Qn(C5);function tC(e){return e?"open":"closed"}at(tC,"getOpenState");function sC(e){return e==="indeterminate"}at(sC,"isIndeterminate");function k5(e){return sC(e)?"indeterminate":e?"checked":"unchecked"}at(k5,"getCheckedState");function iC(e){const t=document.activeElement;for(const i of e)if(i===t||(i.focus(),document.activeElement!==t))return}at(iC,"focusFirst");function rC(e,t){return e.map((i,n)=>e[(t+n)%e.length])}at(rC,"wrapArray");function nC(e,t,i){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=i?e.indexOf(i):-1;let u=rC(e,Math.max(l,0));o.length===1&&(u=u.filter(d=>d!==i));const p=u.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return p!==i?p:void 0}at(nC,"getNextMatch");function oC(e,t){const{x:i,y:n}=e;let o=!1;for(let l=0,u=t.length-1;l<t.length;u=l++){const f=t[l],p=t[u],d=f.x,_=f.y,v=p.x,b=p.y;_>n!=b>n&&i<(v-d)*(n-_)/(b-_)+d&&(o=!o)}return o}at(oC,"isPointInPolygon");function aC(e,t){if(!t)return!1;const i={x:e.clientX,y:e.clientY};return oC(i,t)}at(aC,"isPointerInGraceArea");function mh(e){return t=>t.pointerType==="mouse"?e(t):void 0}at(mh,"whenMouse");var E5=c5,N5=u5,R5=f5,A5=m5,D5=y5,T5=w5,j5=Object.defineProperty,hr=(e,t)=>j5(e,"name",{value:t,configurable:!0}),Jg="ContextMenu",[M5,$U]=mi(Jg,[X1]),xa=X1(),[O5,lC]=M5(Jg),L5=hr(e=>{const{__scopeContextMenu:t,children:i,onOpenChange:n,open:o,dir:l,modal:u=!0}=e,f=w.useRef(!1),[p,d]=_a({prop:o,defaultProp:!1,onChange:n,caller:Jg}),_=xa(t);return h.jsx(O5,{scope:t,open:p,onOpenChange:d,modal:u,hasInteractedRef:f,children:h.jsx(E5,{..._,dir:l,open:p,onOpenChange:d,modal:u,children:i})})},"ContextMenu"),z5="ContextMenuTrigger",B5=w.forwardRef(hr(function(t,i){const{__scopeContextMenu:n,disabled:o=!1,...l}=t,u=lC(z5,n),f=xa(n),[p,d]=w.useState({x:0,y:0}),_=w.useMemo(()=>({current:{getBoundingClientRect:hr(()=>DOMRect.fromRect({width:0,height:0,...p}),"getBoundingClientRect")}}),[p]),v=w.useRef(0),b=w.useCallback(()=>window.clearTimeout(v.current),[]),x=hr(y=>{u.hasInteractedRef.current=!0,d({x:y.clientX,y:y.clientY}),u.onOpenChange(!0)},"handleOpen");return w.useEffect(()=>b,[b]),w.useEffect(()=>void(o&&b()),[o,b]),h.jsxs(h.Fragment,{children:[h.jsx(N5,{...f,virtualRef:_}),h.jsx(vt.span,{"data-state":u.open?"open":"closed","data-disabled":o?"":void 0,...l,ref:i,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:o?t.onContextMenu:Oe(t.onContextMenu,y=>{b(),x(y),y.preventDefault()}),onPointerDown:o?t.onPointerDown:Oe(t.onPointerDown,Dl(y=>{b(),u.open&&u.onOpenChange(!1),v.current=window.setTimeout(()=>x(y),700)})),onPointerMove:o?t.onPointerMove:Oe(t.onPointerMove,Dl(b)),onPointerCancel:o?t.onPointerCancel:Oe(t.onPointerCancel,Dl(b)),onPointerUp:o?t.onPointerUp:Oe(t.onPointerUp,Dl(b))})]})},"ContextMenuTrigger")),P5=hr(e=>{const{__scopeContextMenu:t,...i}=e,n=xa(t);return h.jsx(R5,{...n,...i})},"ContextMenuPortal"),H5="ContextMenuContent",I5=w.forwardRef(hr(function(t,i){const{__scopeContextMenu:n,...o}=t,l=lC(H5,n),u=xa(n),f=w.useRef(!1);return h.jsx(A5,{...u,...o,ref:i,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{var d;(d=t.onCloseAutoFocus)==null||d.call(t,p),!p.defaultPrevented&&f.current&&p.preventDefault(),f.current=!1},onInteractOutside:p=>{var d;(d=t.onInteractOutside)==null||d.call(t,p),!p.defaultPrevented&&!l.modal&&(f.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),$5=w.forwardRef(hr(function(t,i){const{__scopeContextMenu:n,...o}=t,l=xa(n);return h.jsx(D5,{...l,...o,ref:i})},"ContextMenuItem")),U5=w.forwardRef(hr(function(t,i){const{__scopeContextMenu:n,...o}=t,l=xa(n);return h.jsx(T5,{...l,...o,ref:i})},"ContextMenuSeparator"));function Dl(e){return t=>t.pointerType!=="mouse"?e(t):void 0}hr(Dl,"whenTouchOrPen");var F5=L5,V5=B5,q5=P5,Y5=I5,W5=$5,K5=U5,G5=Object.defineProperty,X5=(e,t)=>G5(e,"name",{value:t,configurable:!0}),Z5=w.forwardRef(X5(function(t,i){return h.jsx(vt.label,{...t,ref:i,onMouseDown:n=>{var l;n.target.closest("button, input, select, textarea")||((l=t.onMouseDown)==null||l.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}})},"Label")),Q5=Z5,J5=Object.defineProperty,Sa=(e,t)=>J5(e,"name",{value:t,configurable:!0}),ev="Tabs",[ej,UU]=mi(ev,[qh]),cC=qh(),[tj,tv]=ej(ev),sj=w.forwardRef(Sa(function(t,i){const{__scopeTabs:n,value:o,onValueChange:l,defaultValue:u,orientation:f="horizontal",dir:p,activationMode:d="automatic",..._}=t,v=jh(p),[b,x]=_a({prop:o,onChange:l,defaultProp:u??"",caller:ev});return h.jsx(tj,{scope:n,baseId:In(),value:b,onValueChange:x,orientation:f,dir:v,activationMode:d,children:h.jsx(vt.div,{dir:v,"data-orientation":f,..._,ref:i})})},"Tabs")),ij="TabsList",rj=w.forwardRef(Sa(function(t,i){const{__scopeTabs:n,loop:o=!0,...l}=t,u=tv(ij,n),f=cC(n);return h.jsx(W1,{asChild:!0,...f,orientation:u.orientation,dir:u.dir,loop:o,children:h.jsx(vt.div,{role:"tablist","aria-orientation":u.orientation,...l,ref:i})})},"TabsList")),nj="TabsTrigger",oj=w.forwardRef(Sa(function(t,i){const{__scopeTabs:n,value:o,disabled:l=!1,...u}=t,f=tv(nj,n),p=cC(n),d=sv(f.baseId,o),_=iv(f.baseId,o),v=o===f.value;return h.jsx(K1,{asChild:!0,...p,focusable:!l,active:v,children:h.jsx(vt.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":_,"data-state":v?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:d,...u,ref:i,onMouseDown:Oe(t.onMouseDown,b=>{!l&&b.button===0&&b.ctrlKey===!1?f.onValueChange(o):b.preventDefault()}),onKeyDown:Oe(t.onKeyDown,b=>{l||b.target!==b.currentTarget||[" ","Enter"].includes(b.key)&&f.onValueChange(o)}),onFocus:Oe(t.onFocus,()=>{const b=f.activationMode!=="manual";!v&&!l&&b&&f.onValueChange(o)})})})},"TabsTrigger")),aj="TabsContent",lj=w.forwardRef(Sa(function(t,i){const{__scopeTabs:n,value:o,forceMount:l,children:u,...f}=t,p=tv(aj,n),d=sv(p.baseId,o),_=iv(p.baseId,o),v=o===p.value,b=w.useRef(v);return w.useEffect(()=>{const x=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(x)},[]),h.jsx(ln,{present:l||v,children:({present:x})=>h.jsx(vt.div,{"data-state":v?"active":"inactive","data-orientation":p.orientation,role:"tabpanel","aria-labelledby":d,hidden:!x,id:_,tabIndex:0,...f,ref:i,style:{...t.style,animationDuration:b.current?"0s":void 0},children:x&&u})})},"TabsContent"));function sv(e,t){return`${e}-trigger-${t}`}Sa(sv,"makeTriggerId");function iv(e,t){return`${e}-content-${t}`}Sa(iv,"makeContentId");var cj=sj,uj=rj,hj=oj,dj=lj,fj=Object.defineProperty,Pt=(e,t)=>fj(e,"name",{value:t,configurable:!0}),[rv,FU]=mi("Tooltip",[Uh]),Wh=Uh(),pj="TooltipProvider",mj=700,jm="tooltip.open",[gj,nv]=rv(pj),vj=Pt(e=>{const{__scopeTooltip:t,delayDuration:i=mj,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:l}=e,u=w.useRef(!0),f=w.useRef(!1),p=w.useRef(0);return w.useEffect(()=>{const d=p.current;return()=>window.clearTimeout(d)},[]),h.jsx(gj,{scope:t,isOpenDelayedRef:u,delayDuration:i,onOpen:w.useCallback(()=>{n<=0||(window.clearTimeout(p.current),u.current=!1)},[n]),onClose:w.useCallback(()=>{n<=0||(window.clearTimeout(p.current),p.current=window.setTimeout(()=>u.current=!0,n))},[n]),isPointerInTransitRef:f,onPointerInTransitChange:w.useCallback(d=>{f.current=d},[]),disableHoverableContent:o,children:l})},"TooltipProvider"),Mm="Tooltip",[_j,ec]=rv(Mm),yj=Pt(e=>{const{__scopeTooltip:t,children:i,open:n,defaultOpen:o,onOpenChange:l,disableHoverableContent:u,delayDuration:f}=e,p=nv(Mm,e.__scopeTooltip),d=Wh(t),[_,v]=w.useState(null),[b,x]=w.useState(void 0),y=In(),S=w.useRef(0),E=u??p.disableHoverableContent,N=f??p.delayDuration,T=w.useRef(!1),[A,j]=_a({prop:n,defaultProp:o??!1,onChange:Pt(te=>{te?(p.onOpen(),document.dispatchEvent(new CustomEvent(jm))):p.onClose(),l==null||l(te)},"onChange"),caller:Mm}),M=w.useMemo(()=>A?T.current?"delayed-open":"instant-open":"closed",[A]),P=w.useCallback(()=>{window.clearTimeout(S.current),S.current=0,T.current=!1,j(!0)},[j]),D=w.useCallback(()=>{window.clearTimeout(S.current),S.current=0,j(!1)},[j]),L=w.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{T.current=!0,j(!0),S.current=0},N)},[N,j]);w.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const V=b??y;return h.jsx(z1,{...d,children:h.jsx(_j,{scope:t,contentId:V,setContentId:x,open:A,stateAttribute:M,trigger:_,onTriggerChange:v,onTriggerEnter:w.useCallback(()=>{p.isOpenDelayedRef.current?L():P()},[p.isOpenDelayedRef,L,P]),onTriggerLeave:w.useCallback(()=>{E?D():(window.clearTimeout(S.current),S.current=0)},[D,E]),onOpen:P,onClose:D,disableHoverableContent:E,children:i})})},"Tooltip"),ox="TooltipTrigger",bj=w.forwardRef(Pt(function(t,i){const{__scopeTooltip:n,...o}=t,l=ec(ox,n),u=nv(ox,n),f=Wh(n),p=w.useRef(null),d=gt(i,p,l.onTriggerChange),_=w.useRef(!1),v=w.useRef(!1),b=w.useCallback(()=>_.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),h.jsx(B1,{asChild:!0,...f,children:h.jsx(vt.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...o,ref:d,onPointerMove:Oe(t.onPointerMove,x=>{x.pointerType!=="touch"&&!v.current&&!u.isPointerInTransitRef.current&&(l.onTriggerEnter(),v.current=!0)}),onPointerLeave:Oe(t.onPointerLeave,()=>{l.onTriggerLeave(),v.current=!1}),onPointerDown:Oe(t.onPointerDown,()=>{l.open&&l.onClose(),_.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:Oe(t.onFocus,()=>{_.current||l.onOpen()}),onBlur:Oe(t.onBlur,l.onClose),onClick:Oe(t.onClick,l.onClose)})})},"TooltipTrigger")),uC="TooltipPortal",[xj,Sj]=rv(uC,{forceMount:void 0}),wj=Pt(e=>{const{__scopeTooltip:t,forceMount:i,children:n,container:o}=e,l=ec(uC,t);return h.jsx(xj,{scope:t,forceMount:i,children:h.jsx(ln,{present:i||l.open,children:h.jsx(Hg,{asChild:!0,container:o,children:n})})})},"TooltipPortal"),Vl="TooltipContent",Cj=w.forwardRef(Pt(function(t,i){const n=Sj(Vl,t.__scopeTooltip),{forceMount:o=n.forceMount,side:l="top",...u}=t,f=ec(Vl,t.__scopeTooltip);return h.jsx(ln,{present:o||f.open,children:f.disableHoverableContent?h.jsx(hC,{side:l,...u,ref:i}):h.jsx(kj,{side:l,...u,ref:i})})},"TooltipContent")),kj=w.forwardRef(Pt(function(t,i){const n=ec(Vl,t.__scopeTooltip),o=nv(Vl,t.__scopeTooltip),l=w.useRef(null),u=gt(i,l),[f,p]=w.useState(null),{trigger:d,onClose:_}=n,v=l.current,{onPointerInTransitChange:b}=o,x=w.useCallback(()=>{p(null),b(!1)},[b]),y=w.useCallback((S,E)=>{const N=S.currentTarget,T={x:S.clientX,y:S.clientY},A=dC(T,N.getBoundingClientRect()),j=fC(T,A),M=pC(E.getBoundingClientRect()),P=gC([...j,...M]);p(P),b(!0)},[b]);return w.useEffect(()=>()=>x(),[x]),w.useEffect(()=>{if(d&&v){const S=Pt(N=>y(N,v),"handleTriggerLeave"),E=Pt(N=>y(N,d),"handleContentLeave");return d.addEventListener("pointerleave",S),v.addEventListener("pointerleave",E),()=>{d.removeEventListener("pointerleave",S),v.removeEventListener("pointerleave",E)}}},[d,v,y,x]),w.useEffect(()=>{if(f){const S=Pt(E=>{const N=E.target,T={x:E.clientX,y:E.clientY},A=(d==null?void 0:d.contains(N))||(v==null?void 0:v.contains(N)),j=!mC(T,f);A?x():j&&(x(),_())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[d,v,f,_,x]),h.jsx(hC,{...t,ref:u})},"TooltipContentHoverable")),Ej=Sw("TooltipContent"),hC=w.forwardRef(Pt(function(t,i){const{__scopeTooltip:n,children:o,"aria-label":l,id:u,onEscapeKeyDown:f,onPointerDownOutside:p,...d}=t,_=ec(Vl,n),v=Wh(n),{onClose:b}=_;w.useEffect(()=>(document.addEventListener(jm,b),()=>document.removeEventListener(jm,b)),[b]),w.useEffect(()=>{if(_.trigger){const y=Pt(S=>{S.target instanceof Node&&S.target.contains(_.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",y,{capture:!0}),()=>window.removeEventListener("scroll",y,{capture:!0})}},[_.trigger,b]);const{setContentId:x}=_;return Cs(()=>(x(u),()=>{x(void 0)}),[u,x]),h.jsx(zg,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:y=>y.preventDefault(),onDismiss:b,children:h.jsxs(P1,{"data-state":_.stateAttribute,role:l?void 0:"tooltip",id:l?void 0:_.contentId,...v,...d,ref:i,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(Ej,{children:o}),l?h.jsx(xR,{id:_.contentId,role:"tooltip",children:l}):null]})})},"TooltipContentImpl")),Nj=w.forwardRef(Pt(function(t,i){const{__scopeTooltip:n,...o}=t,l=Wh(n);return h.jsx($T,{...l,...o,ref:i})},"TooltipArrow"));function dC(e,t){const i=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(i,n,o,l)){case l:return"left";case o:return"right";case i:return"top";case n:return"bottom";default:throw new Error("unreachable")}}Pt(dC,"getExitSideFromRect");function fC(e,t,i=5){const n=[];switch(t){case"top":n.push({x:e.x-i,y:e.y+i},{x:e.x+i,y:e.y+i});break;case"bottom":n.push({x:e.x-i,y:e.y-i},{x:e.x+i,y:e.y-i});break;case"left":n.push({x:e.x+i,y:e.y-i},{x:e.x+i,y:e.y+i});break;case"right":n.push({x:e.x-i,y:e.y-i},{x:e.x-i,y:e.y+i});break}return n}Pt(fC,"getPaddedExitPoints");function pC(e){const{top:t,right:i,bottom:n,left:o}=e;return[{x:o,y:t},{x:i,y:t},{x:i,y:n},{x:o,y:n}]}Pt(pC,"getPointsFromRect");function mC(e,t){const{x:i,y:n}=e;let o=!1;for(let l=0,u=t.length-1;l<t.length;u=l++){const f=t[l],p=t[u],d=f.x,_=f.y,v=p.x,b=p.y;_>n!=b>n&&i<(v-d)*(n-_)/(b-_)+d&&(o=!o)}return o}Pt(mC,"isPointInPolygon");function gC(e){const t=e.slice();return t.sort((i,n)=>i.x<n.x?-1:i.x>n.x?1:i.y<n.y?-1:i.y>n.y?1:0),vC(t)}Pt(gC,"getHull");function vC(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const l=t[t.length-1],u=t[t.length-2];if((l.x-u.x)*(o.y-u.y)>=(l.y-u.y)*(o.x-u.x))t.pop();else break}t.push(o)}t.pop();const i=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;i.length>=2;){const l=i[i.length-1],u=i[i.length-2];if((l.x-u.x)*(o.y-u.y)>=(l.y-u.y)*(o.x-u.x))i.pop();else break}i.push(o)}return i.pop(),t.length===1&&i.length===1&&t[0].x===i[0].x&&t[0].y===i[0].y?t:t.concat(i)}Pt(vC,"getHullPresorted");var Rj=vj,Aj=yj,Dj=bj,Tj=wj,jj=Cj,Mj=Nj;const Oj={name:"English",label:"Language"},Lj={browse:"Browse files",cancel:"Cancel",connect:"Connect SSH",delete:"Delete",edit:"Edit"},zj={columnModified:"Modified",columnName:"Name",columnSize:"Size",contextCompressZip:"Compress to Zip",contextCopyPath:"Copy Path",contextDelete:"Delete",contextDownload:"Download",contextExtractZip:"Extract Zip",contextGetInfo:"Get Info",contextNewFile:"New File",contextNewFolder:"New Folder",contextOpen:"Open",contextOpenTerminal:"Open Terminal",contextQuickLook:"Quick Look",contextRefresh:"Refresh",contextRename:"Rename",contextShowInFinder:"Show in Finder",contextUpload:"Upload",copyPath:"Copy path",download:"Download",emptyDirectory:"Empty directory",goUp:"Go up",hideHidden:"Hide hidden files",home:"Home (~)",modified:"Modified",name:"Name",newFolder:"New folder",openInCode:"Open in Code",openInEditor:"Open in editor",openTerminal:"Open terminal here",permissions:"Permissions",refresh:"Refresh",root:"Root (/)",setDefault:"Set as default directory",showHidden:"Show hidden files",size:"Size",statusHidden:"hidden",statusItems:"items",statusLink:"link",statusSelected:"selected",upload:"Upload"},Bj={addFirst:"Add a server",dupDialog:{description:"A {{type}} session is already open for {{name}}.",goExisting:"Go to existing",openNew:"Open new",title:"Connection already open"},emptyDescription:"Connect to your SSH servers to manage files, run commands, and access your infrastructure remotely.",emptyTitle:"Add your first server",import:"Import",noResults:"No servers match your search",status:{browserActive:"File browser active",browserAndTerminal:"File browser + SSH terminal",terminalActive:"SSH terminal active"}},Pj={language:Oj,actions:Lj,files:zj,servers:Bj},Hj={name:"Français",label:"Langue"},Ij={browse:"Parcourir les fichiers",cancel:"Annuler",connect:"Se connecter en SSH",delete:"Supprimer",edit:"Modifier"},$j={columnModified:"Modifié",columnName:"Nom",columnSize:"Taille",contextCompressZip:"Compresser en Zip",contextCopyPath:"Copier le chemin",contextDelete:"Supprimer",contextDownload:"Télécharger",contextExtractZip:"Extraire le Zip",contextGetInfo:"Lire les informations",contextNewFile:"Nouveau fichier",contextNewFolder:"Nouveau dossier",contextOpen:"Ouvrir",contextOpenTerminal:"Ouvrir le terminal",contextQuickLook:"Aperçu rapide",contextRefresh:"Actualiser",contextRename:"Renommer",contextShowInFinder:"Afficher dans le Finder",contextUpload:"Téléverser",copyPath:"Copier le chemin",download:"Télécharger",emptyDirectory:"Dossier vide",goUp:"Remonter",hideHidden:"Masquer les fichiers cachés",home:"Accueil (~)",modified:"Modifié",name:"Nom",newFolder:"Nouveau dossier",openInCode:"Ouvrir dans Code",openInEditor:"Ouvrir dans l’éditeur",openTerminal:"Ouvrir un terminal ici",permissions:"Permissions",refresh:"Actualiser",root:"Racine (/)",setDefault:"Définir comme répertoire par défaut",showHidden:"Afficher les fichiers cachés",size:"Taille",statusHidden:"masqués",statusItems:"éléments",statusLink:"lien",statusSelected:"sélectionné(s)",upload:"Téléverser"},Uj={addFirst:"Ajouter un serveur",dupDialog:{description:"Une session {{type}} est déjà ouverte pour {{name}}.",goExisting:"Aller à la connexion existante",openNew:"Ouvrir une nouvelle connexion",title:"Connexion déjà ouverte"},emptyDescription:"Connectez-vous à vos serveurs SSH pour gérer des fichiers, exécuter des commandes et accéder à votre infrastructure à distance.",emptyTitle:"Ajoutez votre premier serveur",import:"Importer",noResults:"Aucun serveur ne correspond à votre recherche",status:{browserActive:"Explorateur de fichiers actif",browserAndTerminal:"Explorateur de fichiers + terminal SSH",terminalActive:"Terminal SSH actif"}},Fj={language:Hj,actions:Ij,files:$j,servers:Uj},Vj={name:"日本語",label:"言語"},qj={browse:"ファイルを参照",cancel:"キャンセル",connect:"SSHで接続",delete:"削除",edit:"編集"},Yj={columnModified:"更新日時",columnName:"名前",columnSize:"サイズ",contextCompressZip:"Zipに圧縮",contextCopyPath:"パスをコピー",contextDelete:"削除",contextDownload:"ダウンロード",contextExtractZip:"Zipを展開",contextGetInfo:"情報を見る",contextNewFile:"新規ファイル",contextNewFolder:"新規フォルダー",contextOpen:"開く",contextOpenTerminal:"ターミナルを開く",contextQuickLook:"クイックルック",contextRefresh:"更新",contextRename:"名前を変更",contextShowInFinder:"Finderに表示",contextUpload:"アップロード",copyPath:"パスをコピー",download:"ダウンロード",emptyDirectory:"空のディレクトリ",goUp:"上の階層へ",hideHidden:"隠しファイルを非表示",home:"ホーム (~)",modified:"更新日時",name:"名前",newFolder:"新規フォルダー",openInCode:"Codeで開く",openInEditor:"エディターで開く",openTerminal:"ここでターミナルを開く",permissions:"アクセス権",refresh:"更新",root:"ルート (/)",setDefault:"既定のディレクトリに設定",showHidden:"隠しファイルを表示",size:"サイズ",statusHidden:"非表示",statusItems:"項目",statusLink:"リンク",statusSelected:"選択中",upload:"アップロード"},Wj={addFirst:"サーバーを追加",dupDialog:{description:"{{name}}の{{type}}セッションはすでに開いています。",goExisting:"既存のセッションへ",openNew:"新しく開く",title:"接続済みです"},emptyDescription:"SSHサーバーに接続して、ファイルの管理、コマンドの実行、インフラへのリモートアクセスを行えます。",emptyTitle:"最初のサーバーを追加",import:"インポート",noResults:"検索条件に一致するサーバーがありません",status:{browserActive:"ファイルブラウザー使用中",browserAndTerminal:"ファイルブラウザーとSSHターミナル使用中",terminalActive:"SSHターミナル使用中"}},Kj={language:Vj,actions:qj,files:Yj,servers:Wj},Gj="Download",Xj="Copied",Zj="Copy",Qj="Cancel",Jj="Downloading",eM="Back",tM="Next",sM="Files",iM="Name",rM="Command",nM="Description",oM="optional",aM="unchanged",lM="Directory",cM="Save",uM="Commands",hM="Servers",dM="Terminal",fM="Agents",pM="Waiting",mM="Live",gM="Activity",vM="Fleet",_M="Health",yM="Main",bM="Open",xM="Options",SM="of",wM="Order",CM="Delay",kM="Close",EM="Notes",NM="Import",RM="Dismiss",AM="Shell",DM="Restricted",TM="Unrestricted",jM="Group",MM="Host",OM="Port",LM="User",zM="Password",BM="Mode",PM="Approval",HM="Off",IM="Decisions",$M="clear",UM="Upload",FM="dismiss",VM="Uploading",qM="Summary",YM="reachable",WM="unreachable",KM="Reachable",GM="Unreachable",XM="Recheck",ZM="Memory",QM="running",JM="Light",eO="Dark",tO="Disk",sO="Appearance",iO="Vault",rO="Updates",nO="Alerts",oO="Groups",aO="Tunnels",lO="Results",cO="Filter",uO="Uncategorized",hO="Layout",dO="Cards",fO="List",pO="All",mO="Here",gO="Suggestions",vO="waiting",_O="Refuse",yO="Approve",bO="restricted",xO="unrestricted",SO="exit",wO="dynamic",CO="files",kO="shell",EO="CPU",NO="cpu",RO="memory",AO="disk",_C={"the desktop app":"the desktop app","Not found on this machine":"Not found on this machine","Start a new Claude Code session for it to take effect.":"Start a new Claude Code session for it to take effect.","Which ssh-manager your AI tools start":"Which ssh-manager your AI tools start","An AI tool starts ssh-manager itself, from the command in its settings. It can be the one installed with npm or the one inside the desktop app — the same engine either way; the app's needs no Node. Changing it rewrites that one entry and nothing else.":"An AI tool starts ssh-manager itself, from the command in its settings. It can be the one installed with npm or the one inside the desktop app — the same engine either way; the app's needs no Node. Changing it rewrites that one entry and nothing else.","Desktop app":"Desktop app","unknown version":"unknown version","Not installed here":"Not installed here","Not installed with npm":"Not installed with npm","the app":"the app","Finding the release…":"Finding the release…","Downloading…":"Downloading…","Checking the checksum and the signature…":"Checking the checksum and the signature…","Installing…":"Installing…","Opening the app…":"Opening the app…","The desktop app was not installed.":"The desktop app was not installed.","Continued in the desktop app.":"Continued in the desktop app.","You can close this tab.":"You can close this tab.","SSH Manager is also a desktop app:":"SSH Manager is also a desktop app:","menu bar, native notifications, updates itself.":"menu bar, native notifications, updates itself.","Working…":"Working…",Download:Gj,Copied:Xj,Copy:Zj,"Open the app":"Open the app","Install the app":"Install the app","Not now":"Not now","Nothing was installed.":"Nothing was installed.",Cancel:Qj,"No servers configured yet.":"No servers configured yet.","files open":"files open","shell open":"shell open","not yet":"not yet","preview build":"preview build","You are on a preview. You will be offered newer previews and the stable release when it comes out.":"You are on a preview. You will be offered newer previews and the stable release when it comes out.","You receive stable releases.":"You receive stable releases.","Checking for updates…":"Checking for updates…","Could not check for updates.":"Could not check for updates.","You are up to date.":"You are up to date.","Not checked yet.":"Not checked yet.","Check now":"Check now","Downloading does not change anything you are running; you choose when to restart.":"Downloading does not change anything you are running; you choose when to restart.",Downloading:Jj,"It installs when you restart, or by itself the next time you quit.":"It installs when you restart, or by itself the next time you quit.","Restart to update":"Restart to update","Last checked":"Last checked","Release notes":"Release notes","All releases":"All releases","The application checks when it starts and every six hours, and tells you here, in the sidebar and once per version in a notification. The npm engine, if you use one, is updated with npm and is not part of this.":"The application checks when it starts and every six hours, and tells you here, in the sidebar and once per version in a notification. The npm engine, if you use one, is updated with npm and is not part of this.","A recovery copy you can take with you":"A recovery copy you can take with you","Your vault is encrypted with a key on this machine. Keep a recovery backup somewhere safe before moving to another computer or reinstalling. You will need its passphrase to restore it.":"Your vault is encrypted with a key on this machine. Keep a recovery backup somewhere safe before moving to another computer or reinstalling. You will need its passphrase to restore it.","The vault cannot be unlocked. Restore a recovery backup to recover access.":"The vault cannot be unlocked. Restore a recovery backup to recover access.","Backups include saved servers and their credentials. Groups, preferences, host keys and original .env / TOML files need a separate backup.":"Backups include saved servers and their credentials. Groups, preferences, host keys and original .env / TOML files need a separate backup.","Recovery backup downloaded. Keep the file and its passphrase safe.":"Recovery backup downloaded. Keep the file and its passphrase safe.","Create a recovery backup":"Create a recovery backup","Backup passphrase":"Backup passphrase","At least 8 characters; a longer phrase is better":"At least 8 characters; a longer phrase is better","Confirm backup passphrase":"Confirm backup passphrase","The passphrases do not match.":"The passphrases do not match.","Download recovery backup":"Download recovery backup","Recovery complete. Your restored servers are available in Servers.":"Recovery complete. Your restored servers are available in Servers.","Restore a recovery backup":"Restore a recovery backup","Choose an encrypted SSH Manager recovery file. Review the server names before confirming any changes.":"Choose an encrypted SSH Manager recovery file. Review the server names before confirming any changes.","Recovery file":"Recovery file","Recovery passphrase":"Recovery passphrase","Recovery preview":"Recovery preview"," — replaces saved server":" — replaces saved server"," — adds server":" — adds server","The unreadable vault will be replaced by this backup.":"The unreadable vault will be replaced by this backup.","Servers missing from the backup will be removed:":"Servers missing from the backup will be removed:","Other settings and original configuration files stay unchanged.":"Other settings and original configuration files stay unchanged.","Other saved servers, settings and original configuration files stay unchanged.":"Other saved servers, settings and original configuration files stay unchanged.","Confirm restore":"Confirm restore","Preview recovery":"Preview recovery","Cancel recovery":"Cancel recovery","A place for your servers":"A place for your servers","Your servers. Your workspace.":"Your servers. Your workspace.","Open a terminal, move files and see what your agents are doing — all from one place on your machine.":"Open a terminal, move files and see what your agents are doing — all from one place on your machine.","Already using npm or the CLI? Your setup keeps working. You can explore this interface whenever you want.":"Already using npm or the CLI? Your setup keeps working. You can explore this interface whenever you want.","Start with what you have":"Start with what you have","Bring your servers along.":"Bring your servers along.","Add your first connection or import servers from an SSH config, another SSH client or a spreadsheet.":"Add your first connection or import servers from an SSH config, another SSH client or a spreadsheet.","You review the servers before importing. Your original files stay in place, so you can keep using your existing tools.":"You review the servers before importing. Your original files stay in place, so you can keep using your existing tools.","You decide how far agents go":"You decide how far agents go","Stay in control.":"Stay in control.","Choose which agent requests need your approval. See the server and the full command before you approve or refuse.":"Choose which agent requests need your approval. See the server and the full command before you approve or refuse.","Approval is off by default. Once enabled on a server, requests that need approval are refused if the control plane is unavailable.":"Approval is off by default. Once enabled on a server, requests that need approval are refused if the control plane is unavailable.","On your machine. In your hands.":"On your machine. In your hands.",Back:eM,"Import servers":"Import servers","Add a server":"Add a server",Next:tM,"I’ll explore first":"I’ll explore first",Files:sM,"Edit command":"Edit command","Save a command":"Save a command","It appears in the list next to any terminal it applies to.":"It appears in the list next to any terminal it applies to.",Name:iM,"Reload nginx":"Reload nginx",Command:rM,Description:nM,optional:oM,unchanged:aM,Directory:lM,"Where it is offered":"Where it is offered","every server":"every server","No server in the vault yet.":"No server in the vault yet.","Selecting none offers it everywhere.":"Selecting none offers it everywhere.","Limit to":"Limit to","Ask before putting it in the terminal":"Ask before putting it in the terminal","— for the ones that delete things":"— for the ones that delete things","Saving…":"Saving…",Save:cM,Commands:uM,"asks first":"asks first","Nothing saved yet. These are the ones people usually keep — pick any to add it.":"Nothing saved yet. These are the ones people usually keep — pick any to add it.","Save a new command":"Save a new command","Control plane connected":"Control plane connected","Connecting to the control plane…":"Connecting to the control plane…","Connection lost. Reconnecting — displayed activity may be out of date.":"Connection lost. Reconnecting — displayed activity may be out of date.","Connecting…":"Connecting…","Connection lost":"Connection lost","Open another session":"Open another session",Servers:hM,Terminal:dM,Agents:fM,Waiting:pM,Live:mM,Activity:gM,Fleet:vM,Health:_M,"Collapse the sidebar":"Collapse the sidebar","Expand the sidebar":"Expand the sidebar",Main:yM,Open:bM,"Downloading update":"Downloading update","Update available":"Update available",Options:xM,"New group":"New group","A group runs one command across several machines. Stored in":"A group runs one command across several machines. Stored in",of:SM,"No server in the vault yet — add one first.":"No server in the vault yet — add one first.",Order:wM,"all at once":"all at once","one after another":"one after another",Delay:CM,"ms between servers":"ms between servers","Stop at the first failure":"Stop at the first failure","— otherwise every server is attempted":"— otherwise every server is attempted","From another tool, or from a file. No password is ever read.":"From another tool, or from a file. No password is ever read.",Close:kM,"Reading…":"Reading…","Looking around…":"Looking around…","Already on this machine":"Already on this machine","From a file":"From a file","Choose a file":"Choose a file","A spreadsheet, a CSV, an OpenSSH config, or an export from FileZilla, PuTTY, Termius or MobaXterm. The format is worked out for you.":"A spreadsheet, a CSV, an OpenSSH config, or an export from FileZilla, PuTTY, Termius or MobaXterm. The format is worked out for you.","Nothing to import from that.":"Nothing to import from that.","will be replaced":"will be replaced","already configured — left alone":"already configured — left alone",Notes:EM,Import:NM,"Your existing setup keeps working":"Your existing setup keeps working","Importing…":"Importing…","Afterwards, create a recovery backup in Options → Vault. Your encryption key belongs to this machine; the backup lets you restore elsewhere.":"Afterwards, create a recovery backup in Options → Vault. Your encryption key belongs to this machine; the backup lets you restore elsewhere.",Dismiss:RM,"files and shell open":"files and shell open","Open a shell":"Open a shell",Shell:AM,"Read only":"Read only",Restricted:DM,Unrestricted:TM,"Approval off":"Approval off","Approval: every request":"Approval: every request","Approval: destructive":"Approval: destructive","Credentials stay encrypted on this machine. Leave a password or passphrase blank to keep its saved value.":"Credentials stay encrypted on this machine. Leave a password or passphrase blank to keep its saved value.",Group:jM,Host:MM,Port:OM,User:LM,Password:zM,"Private key":"Private key","Key passphrase":"Key passphrase","if your key is encrypted":"if your key is encrypted","Default directory":"Default directory","Agent permissions":"Agent permissions",Mode:BM,Approval:PM,Off:HM,"Destructive requests":"Destructive requests","Every request":"Every request","Requests needing approval wait for you. If the control plane is unavailable, they are refused.":"Requests needing approval wait for you. If the control plane is unavailable, they are refused.","Agents can work without this interface. Turn on approval when you want to review their requests.":"Agents can work without this interface. Turn on approval when you want to review their requests.","Allowed command patterns":"Allowed command patterns","One regular expression per line. With no allowed patterns, all commands are refused.":"One regular expression per line. With no allowed patterns, all commands are refused.","Denied command patterns":"Denied command patterns","Advanced connection settings":"Advanced connection settings","Jump server":"Jump server","Name of another configured server to connect through.":"Name of another configured server to connect through.","Proxy command":"Proxy command","Remote platform":"Remote platform","Forward the SSH agent":"Forward the SSH agent","Audit log path":"Audit log path","Command Palette":"Command Palette","Search for a command to run...":"Search for a command to run...","What your agents ran, and what you decided.":"What your agents ran, and what you decided.",Decisions:IM,"Clear the command history on this machine?":"Clear the command history on this machine?",clear:$M,"No command recorded yet":"No command recorded yet","Everything your agents run is written down here, on this machine — nothing to configure on the servers.":"Everything your agents run is written down here, on this machine — nothing to configure on the servers.","Output is not kept; set SSH_MANAGER_LOG_OUTPUT=1 if you want it.":"Output is not kept; set SSH_MANAGER_LOG_OUTPUT=1 if you want it.","Nothing recorded yet":"Nothing recorded yet","Every approval you granted or refused appears here. What agents ran is under Commands.":"Every approval you granted or refused appears here. What agents ran is under Commands.","The transfer failed":"The transfer failed","Directories cannot be transferred yet — select files.":"Directories cannot be transferred yet — select files.","New name":"New name","Name of the new directory":"Name of the new directory",Upload:UM,"Name for the new file":"Name for the new file",dismiss:FM,Uploading:VM,"This machine":"This machine","Probed when you ask. Nothing runs in the background.":"Probed when you ask. Nothing runs in the background.","Check every server":"Check every server",Summary:qM,reachable:YM,"over a threshold":"over a threshold",unreachable:WM,"Nothing probed yet":"Nothing probed yet","Each check opens one SSH connection and closes it. Press the button when you want to know.":"Each check opens one SSH connection and closes it. Press the button when you want to know.",Reachable:KM,Unreachable:GM,Recheck:XM,Memory:ZM,"No answer":"No answer","Recheck once the host or the network is back.":"Recheck once the host or the network is back.","What your agents are running, as it happens.":"What your agents are running, as it happens.",running:QM,"No command is running":"No command is running","When an agent runs something on one of your servers it appears here as it happens, output included. Nothing is written to disk.":"When an agent runs something on one of your servers it appears here as it happens, output included. Nothing is written to disk.","Match the desktop":"Match the desktop","follows your system setting, including when it changes":"follows your system setting, including when it changes",Light:JM,"always light, whatever the system does":"always light, whatever the system does",Dark:eO,"always dark":"always dark","Point out machines over these levels":"Point out machines over these levels","— checked when you probe, never in the background":"— checked when you probe, never in the background",Disk:tO,"Settings for this machine only.":"Settings for this machine only.",Appearance:sO,Vault:iO,"AI tools":"AI tools",Updates:rO,"update available":"update available",Alerts:nO,Groups:oO,Tunnels:aO,"Known hosts":"Known hosts","Alert thresholds":"Alert thresholds",Results:lO,"from config":"from config","The published list is stale — the MCP server that opened them is no longer running.":"The published list is stale — the MCP server that opened them is no longer running.","None open. Tunnels live inside the MCP server’s process; this screen shows what that process publishes.":"None open. Tunnels live inside the MCP server’s process; this screen shows what that process publishes.",Filter:cO,"Add as a server":"Add as a server","more — narrow the filter to see them.":"more — narrow the filter to see them.","No host matches.":"No host matches.",Uncategorized:uO,"Toggle edit mode":"Toggle edit mode","Done editing":"Done editing","Edit or remove servers":"Edit or remove servers","Search a name, host or user":"Search a name, host or user","Search servers":"Search servers",Layout:hO,"Show as a grid":"Show as a grid",Cards:dO,"Show as a list":"Show as a list",List:fO,"Filter by group":"Filter by group",All:pO,"1 command is waiting for your decision":"1 command is waiting for your decision","Review →":"Review →","a shell on this machine":"a shell on this machine","interactive shell":"interactive shell","A shell on any machine — and the commands you would rather not retype.":"A shell on any machine — and the commands you would rather not retype.","Saved commands":"Saved commands",Here:mO,"Your own shell, as you have it configured":"Your own shell, as you have it configured","Somewhere else":"Somewhere else","No servers yet":"No servers yet","Picked from a list inside any shell, instead of typed again.":"Picked from a list inside any shell, instead of typed again.","New command":"New command","Nothing saved yet":"Nothing saved yet","Save the ones you type most. They appear in every shell, on the servers you choose.":"Save the ones you type most. They appear in every shell, on the servers you choose.",Suggestions:gO,"read only":"read only","An agent paused on these commands. Nothing runs until you decide.":"An agent paused on these commands. Nothing runs until you decide.","Nothing is waiting":"Nothing is waiting","Nothing pauses here until you ask it to. Open a server, set Approval to destructive or always, and its agent will stop and wait for you before acting.":"Nothing pauses here until you ask it to. Open a server, set Approval to destructive or always, and its agent will stop and wait for you before acting.","Set it up on a server":"Set it up on a server",waiting:vO,"Destructive.":"Destructive.","This command can delete or overwrite data, and nothing on the server will undo it.":"This command can delete or overwrite data, and nothing on the server will undo it.","(no command)":"(no command)","Copy the command":"Copy the command",Refuse:_O,"Approve and run":"Approve and run",Approve:yO,"Runs the desktop app's engine{{v0}}":"Runs the desktop app's engine{{v0}}","Runs the npm engine{{v0}}":"Runs the npm engine{{v0}}","Restart {{v0}} for it to take effect.":"Restart {{v0}} for it to take effect.","{{v0}} now uses {{v1}}. {{v2}}":"{{v0}} now uses {{v1}}. {{v2}}","{{v0}}: use {{v1}}":"{{v0}}: use {{v1}}","Using {{v0}}":"Using {{v0}}","Use {{v0}}":"Use {{v0}}","Version {{v0}}":"Version {{v0}}","{{v0}}\n\n{{v1}}\n\nPut this in the terminal on {{v2}}?":`{{v0}}
|
|
90
90
|
|
|
91
91
|
{{v1}}
|
|
92
92
|
|
|
@@ -511,7 +511,7 @@ Put this in the terminal on {{v2}}?`,{v0:x.name,v1:x.command,v2:e}))||(t(x),o(!1
|
|
|
511
511
|
Copyright (c) 2018 Jed Watson.
|
|
512
512
|
Licensed under the MIT License (MIT), see
|
|
513
513
|
http://jedwatson.github.io/classnames
|
|
514
|
-
*/var om,FS,VS,f9=($S||($S=1,om=US,(function(){var e={}.hasOwnProperty;function t(){for(var o="",l=0;l<arguments.length;l++){var u=arguments[l];u&&(o=n(o,i(u)))}return o}function i(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return t.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var l="";for(var u in o)e.call(o,u)&&o[u]&&(l=n(l,u));return l}function n(o,l){return l?o?o+" "+l:o+l:o}om.exports?(t.default=t,om.exports=t):window.classNames=t})()),US.exports),Dg=dc(f9),qS,YS,p9=(VS||(VS=1,FS=function e(t,i){if(t===i)return!0;if(t&&i&&typeof t=="object"&&typeof i=="object"){if(t.constructor!==i.constructor)return!1;var n,o,l;if(Array.isArray(t)){if((n=t.length)!=i.length)return!1;for(o=n;o--!==0;)if(!e(t[o],i[o]))return!1;return!0}if(t instanceof Map&&i instanceof Map){if(t.size!==i.size)return!1;for(o of t.entries())if(!i.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],i.get(o[0])))return!1;return!0}if(t instanceof Set&&i instanceof Set){if(t.size!==i.size)return!1;for(o of t.entries())if(!i.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(i)){if((n=t.length)!=i.length)return!1;for(o=n;o--!==0;)if(t[o]!==i[o])return!1;return!0}if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===i.toString();if((n=(l=Object.keys(t)).length)!==Object.keys(i).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(i,l[o]))return!1;for(o=n;o--!==0;){var u=l[o];if(!e(t[u],i[u]))return!1}return!0}return t!=t&&i!=i}),FS),m9=dc(p9),WS,KS,fi=dc((function(){if(YS)return qS;YS=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,n=/^0o[0-7]+$/i,o=parseInt,l=Object.prototype.toString;function u(p){var d=typeof p;return!!p&&(d=="object"||d=="function")}function f(p){if(typeof p=="number")return p;if((function(v){return typeof v=="symbol"||(function(b){return!!b&&typeof b=="object"})(v)&&l.call(v)=="[object Symbol]"})(p))return NaN;if(u(p)){var d=typeof p.valueOf=="function"?p.valueOf():p;p=u(d)?d+"":d}if(typeof p!="string")return p===0?p:+p;p=p.replace(e,"");var _=i.test(p);return _||n.test(p)?o(p.slice(2),_?2:8):t.test(p)?NaN:+p}return qS=function(p,d,_){return _===void 0&&(_=d,d=void 0),_!==void 0&&(_=(_=f(_))==_?_:0),d!==void 0&&(d=(d=f(d))==d?d:0),(function(v,b,x){return v==v&&(x!==void 0&&(v=v<=x?v:x),b!==void 0&&(v=v>=b?v:b)),v})(f(p),d,_)}})()),g9=dc((function(){if(KS)return WS;KS=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,n=/^0o[0-7]+$/i,o=parseInt,l=typeof Wu=="object"&&Wu&&Wu.Object===Object&&Wu,u=typeof self=="object"&&self&&self.Object===Object&&self,f=l||u||Function("return this")(),p=Object.prototype.toString,d=Math.max,_=Math.min,v=function(){return f.Date.now()};function b(y){var S=typeof y;return!!y&&(S=="object"||S=="function")}function x(y){if(typeof y=="number")return y;if((function(N){return typeof N=="symbol"||(function(T){return!!T&&typeof T=="object"})(N)&&p.call(N)=="[object Symbol]"})(y))return NaN;if(b(y)){var S=typeof y.valueOf=="function"?y.valueOf():y;y=b(S)?S+"":S}if(typeof y!="string")return y===0?y:+y;y=y.replace(e,"");var E=i.test(y);return E||n.test(y)?o(y.slice(2),E?2:8):t.test(y)?NaN:+y}return WS=function(y,S,E){var N,T,A,j,M,P,D=0,L=!1,V=!1,te=!0;if(typeof y!="function")throw new TypeError("Expected a function");function U(O){var $=N,F=T;return N=T=void 0,D=O,j=y.apply(F,$)}function H(O){var $=O-P;return P===void 0||$>=S||$<0||V&&O-D>=A}function B(){var O=v();if(H(O))return W(O);M=setTimeout(B,(function($){var F=S-($-P);return V?_(F,A-($-D)):F})(O))}function W(O){return M=void 0,te&&N?U(O):(N=T=void 0,j)}function K(){var O=v(),$=H(O);if(N=arguments,T=this,P=O,$){if(M===void 0)return(function(F){return D=F,M=setTimeout(B,S),L?U(F):j})(P);if(V)return M=setTimeout(B,S),U(P)}return M===void 0&&(M=setTimeout(B,S)),j}return S=x(S)||0,b(E)&&(L=!!E.leading,A=(V="maxWait"in E)?d(x(E.maxWait)||0,S):A,te="trailing"in E?!!E.trailing:te),K.cancel=function(){M!==void 0&&clearTimeout(M),D=0,N=P=T=M=void 0},K.flush=function(){return M===void 0?j:W(v())},K}})()),GS={width:void 0,height:void 0};function v9(e){const{ref:t,box:i="content-box"}=e,[{width:n,height:o},l]=w.useState(GS),u=(function(){const d=w.useRef(!1);return w.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]),w.useCallback(()=>d.current,[])})(),f=w.useRef(ca({},GS)),p=w.useRef(void 0);return p.current=e.onResize,w.useEffect(()=>{if(!t.current||typeof window>"u"||!("ResizeObserver"in window))return;const d=new ResizeObserver(([_])=>{const v=i==="border-box"?"borderBoxSize":i==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",b=XS(_,v,"inlineSize"),x=XS(_,v,"blockSize");if(f.current.width!==b||f.current.height!==x){const y={width:b,height:x};f.current.width=b,f.current.height=x,p.current?p.current(y):u()&&l(y)}});return d.observe(t.current,{box:i}),()=>{d.disconnect()}},[i,t,u]),{width:n,height:o}}function XS(e,t,i){return e[t]?Array.isArray(e[t])?e[t][0][i]:e[t][i]:t==="contentBoxSize"?e.contentRect[i==="inlineSize"?"width":"height"]:void 0}var _9="allotment-module_splitView__L-yRc",y9="allotment-module_sashContainer__fzwJF",b9="allotment-module_splitViewContainer__rQnVa",fk="allotment-module_splitViewView__MGZ6O",x9="allotment-module_vertical__WSwwa",S9="allotment-module_horizontal__7doS8",w9="allotment-module_separatorBorder__x-rDS";let Rl,pk=!1,mk=!1;typeof navigator=="object"&&(Rl=navigator.userAgent,mk=Rl.indexOf("Macintosh")>=0,pk=(Rl.indexOf("Macintosh")>=0||Rl.indexOf("iPad")>=0||Rl.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0);const gk=pk,C9=mk,ZS=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;class k9{constructor(){this._size=void 0}getSize(){return this._size}setSize(t){this._size=t}}function Ku(e,t){const i=e.length,n=i-t.length;return n>=0&&e.slice(n,i)===t}var QS,JS={exports:{}},E9=(QS||(QS=1,(function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function o(p,d,_){this.fn=p,this.context=d,this.once=_||!1}function l(p,d,_,v,b){if(typeof _!="function")throw new TypeError("The listener must be a function");var x=new o(_,v||p,b),y=i?i+d:d;return p._events[y]?p._events[y].fn?p._events[y]=[p._events[y],x]:p._events[y].push(x):(p._events[y]=x,p._eventsCount++),p}function u(p,d){--p._eventsCount===0?p._events=new n:delete p._events[d]}function f(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(i=!1)),f.prototype.eventNames=function(){var p,d,_=[];if(this._eventsCount===0)return _;for(d in p=this._events)t.call(p,d)&&_.push(i?d.slice(1):d);return Object.getOwnPropertySymbols?_.concat(Object.getOwnPropertySymbols(p)):_},f.prototype.listeners=function(p){var d=i?i+p:p,_=this._events[d];if(!_)return[];if(_.fn)return[_.fn];for(var v=0,b=_.length,x=new Array(b);v<b;v++)x[v]=_[v].fn;return x},f.prototype.listenerCount=function(p){var d=i?i+p:p,_=this._events[d];return _?_.fn?1:_.length:0},f.prototype.emit=function(p,d,_,v,b,x){var y=i?i+p:p;if(!this._events[y])return!1;var S,E,N=this._events[y],T=arguments.length;if(N.fn){switch(N.once&&this.removeListener(p,N.fn,void 0,!0),T){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,d),!0;case 3:return N.fn.call(N.context,d,_),!0;case 4:return N.fn.call(N.context,d,_,v),!0;case 5:return N.fn.call(N.context,d,_,v,b),!0;case 6:return N.fn.call(N.context,d,_,v,b,x),!0}for(E=1,S=new Array(T-1);E<T;E++)S[E-1]=arguments[E];N.fn.apply(N.context,S)}else{var A,j=N.length;for(E=0;E<j;E++)switch(N[E].once&&this.removeListener(p,N[E].fn,void 0,!0),T){case 1:N[E].fn.call(N[E].context);break;case 2:N[E].fn.call(N[E].context,d);break;case 3:N[E].fn.call(N[E].context,d,_);break;case 4:N[E].fn.call(N[E].context,d,_,v);break;default:if(!S)for(A=1,S=new Array(T-1);A<T;A++)S[A-1]=arguments[A];N[E].fn.apply(N[E].context,S)}}return!0},f.prototype.on=function(p,d,_){return l(this,p,d,_,!1)},f.prototype.once=function(p,d,_){return l(this,p,d,_,!0)},f.prototype.removeListener=function(p,d,_,v){var b=i?i+p:p;if(!this._events[b])return this;if(!d)return u(this,b),this;var x=this._events[b];if(x.fn)x.fn!==d||v&&!x.once||_&&x.context!==_||u(this,b);else{for(var y=0,S=[],E=x.length;y<E;y++)(x[y].fn!==d||v&&!x[y].once||_&&x[y].context!==_)&&S.push(x[y]);S.length?this._events[b]=S.length===1?S[0]:S:u(this,b)}return this},f.prototype.removeAllListeners=function(p){var d;return p?(d=i?i+p:p,this._events[d]&&u(this,d)):(this._events=new n,this._eventsCount=0),this},f.prototype.off=f.prototype.removeListener,f.prototype.addListener=f.prototype.on,f.prefixed=i,f.EventEmitter=f,e.exports=f})(JS)),JS.exports),Cv=dc(E9);function ew(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.unshift(t))}function am(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))}function Js(e,t,i=1){const n=Math.max(0,Math.ceil((t-e)/i)),o=new Array(n);let l=-1;for(;++l<n;)o[l]=e+l*i;return o}var N9="sash-module_sash__K-9lB",R9="sash-module_disabled__Hm-wx",A9="sash-module_mac__Jf6OJ",tw="sash-module_vertical__pB-rs",D9="sash-module_minimum__-UKxp",T9="sash-module_maximum__TCWxD",sw="sash-module_horizontal__kFbiw",lm="sash-module_hover__80W6I",cm="sash-module_active__bJspD";let ii=(function(e){return e.Vertical="VERTICAL",e.Horizontal="HORIZONTAL",e})({}),Ps=(function(e){return e.Disabled="DISABLED",e.Minimum="MINIMUM",e.Maximum="MAXIMUM",e.Enabled="ENABLED",e})({}),vk=gk?20:8;const _k=new Cv;class iw extends Cv{get state(){return this._state}set state(t){this._state!==t&&(this.el.classList.toggle(R9,t===Ps.Disabled),this.el.classList.toggle("sash-disabled",t===Ps.Disabled),this.el.classList.toggle(D9,t===Ps.Minimum),this.el.classList.toggle("sash-minimum",t===Ps.Minimum),this.el.classList.toggle(T9,t===Ps.Maximum),this.el.classList.toggle("sash-maximum",t===Ps.Maximum),this._state=t,this.emit("enablementChange",t))}constructor(t,i,n){var o;super(),this.el=void 0,this.layoutProvider=void 0,this.orientation=void 0,this.size=void 0,this.hoverDelay=300,this.hoverDelayer=g9(l=>l.classList.add("sash-hover",lm),this.hoverDelay),this._state=Ps.Enabled,this.onPointerStart=l=>{const u=l.pageX,f=l.pageY,p={startX:u,currentX:u,startY:f,currentY:f};this.el.classList.add("sash-active",cm),this.emit("start",p),this.el.setPointerCapture(l.pointerId);const d=v=>{v.preventDefault();const b={startX:u,currentX:v.pageX,startY:f,currentY:v.pageY};this.emit("change",b)},_=v=>{v.preventDefault(),this.el.classList.remove("sash-active",cm),this.hoverDelayer.cancel(),this.emit("end"),this.el.releasePointerCapture(v.pointerId),window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",_)};window.addEventListener("pointermove",d),window.addEventListener("pointerup",_)},this.onPointerDoublePress=()=>{this.emit("reset")},this.onMouseEnter=()=>{this.el.classList.contains(cm)?(this.hoverDelayer.cancel(),this.el.classList.add("sash-hover",lm)):this.hoverDelayer(this.el)},this.onMouseLeave=()=>{this.hoverDelayer.cancel(),this.el.classList.remove("sash-hover",lm)},this.el=document.createElement("div"),this.el.classList.add("sash",N9),this.el.dataset.testid="sash",t.append(this.el),C9&&this.el.classList.add("sash-mac",A9),this.el.addEventListener("pointerdown",this.onPointerStart),this.el.addEventListener("dblclick",this.onPointerDoublePress),this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("mouseleave",this.onMouseLeave),typeof n.size=="number"?(this.size=n.size,n.orientation===ii.Vertical?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=vk,_k.on("onDidChangeGlobalSize",l=>{this.size=l,this.layout()})),this.layoutProvider=i,this.orientation=(o=n.orientation)!=null?o:ii.Vertical,this.orientation===ii.Horizontal?(this.el.classList.add("sash-horizontal",sw),this.el.classList.remove("sash-vertical",tw)):(this.el.classList.remove("sash-horizontal",sw),this.el.classList.add("sash-vertical",tw)),this.layout()}layout(){if(this.orientation===ii.Vertical){const t=this.layoutProvider;this.el.style.left=t.getVerticalSashLeft(this)-this.size/2+"px",t.getVerticalSashTop&&(this.el.style.top=t.getVerticalSashTop(this)+"px"),t.getVerticalSashHeight&&(this.el.style.height=t.getVerticalSashHeight(this)+"px")}else{const t=this.layoutProvider;this.el.style.top=t.getHorizontalSashTop(this)-this.size/2+"px",t.getHorizontalSashLeft&&(this.el.style.left=t.getHorizontalSashLeft(this)+"px"),t.getHorizontalSashWidth&&(this.el.style.width=t.getHorizontalSashWidth(this)+"px")}}dispose(){this.el.removeEventListener("pointerdown",this.onPointerStart),this.el.removeEventListener("dblclick",this.onPointerDoublePress),this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("mouseleave",()=>this.onMouseLeave),this.el.remove()}}let Ah;var um;(um=Ah||(Ah={})).Distribute={type:"distribute"},um.Split=function(e){return{type:"split",index:e}},um.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}};let ti=(function(e){return e.Normal="NORMAL",e.Low="LOW",e.High="HIGH",e})({});class yk{constructor(t,i,n){this.container=void 0,this.view=void 0,this._size=void 0,this._cachedVisibleSize=void 0,this.container=t,this.view=i,this.container.classList.add("split-view-view",fk),this.container.dataset.testid="split-view-view",typeof n=="number"?(this._size=n,this._cachedVisibleSize=void 0,t.classList.add("split-view-view-visible")):(this._size=0,this._cachedVisibleSize=n.cachedVisibleSize)}set size(t){this._size=t}get size(){return this._size}get priority(){return this.view.priority}get snap(){return!!this.view.snap}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return this._cachedVisibleSize===void 0}setVisible(t,i){t!==this.visible&&(t?(this.size=fi(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof i=="number"?i:this.size,this.size=0),this.container.classList.toggle("split-view-view-visible",t),this.view.setVisible&&this.view.setVisible(t))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}set enabled(t){this.container.style.pointerEvents=t?"":"none"}layout(t){this.layoutContainer(t),this.view.layout(this.size,t)}}class j9 extends yk{layoutContainer(t){this.container.style.left=`${t}px`,this.container.style.width=`${this.size}px`}}class M9 extends yk{layoutContainer(t){this.container.style.top=`${t}px`,this.container.style.height=`${this.size}px`}}class O9 extends Cv{get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(t){this._startSnappingEnabled!==t&&(this._startSnappingEnabled=t,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(t){this._endSnappingEnabled!==t&&(this._endSnappingEnabled=t,this.updateSashEnablement())}constructor(t,i={},n,o,l){var u,f;if(super(),this.onDidChange=void 0,this.onDidDragStart=void 0,this.onDidDragEnd=void 0,this.orientation=void 0,this.sashContainer=void 0,this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.sashDragState=void 0,this.proportionalLayout=void 0,this.getSashOrthogonalSize=void 0,this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onSashEnd=p=>{this.emit("sashchange",p),this.saveProportions();for(const d of this.viewItems)d.enabled=!0},this.orientation=(u=i.orientation)!=null?u:ii.Vertical,this.proportionalLayout=(f=i.proportionalLayout)!=null?f:!0,this.getSashOrthogonalSize=i.getSashOrthogonalSize,n&&(this.onDidChange=n),o&&(this.onDidDragStart=o),l&&(this.onDidDragEnd=l),this.sashContainer=document.createElement("div"),this.sashContainer.classList.add("sash-container",y9),t.prepend(this.sashContainer),i.descriptor){this.size=i.descriptor.size;for(const[p,d]of i.descriptor.views.entries()){const _=d.size,v=d.container,b=d.view;this.addView(v,b,_,p,!0)}this.contentSize=this.viewItems.reduce((p,d)=>p+d.size,0),this.saveProportions()}}addView(t,i,n,o=this.viewItems.length,l){let u;u=typeof n=="number"?n:n.type==="split"?this.getViewSize(n.index)/2:n.type==="invisible"?{cachedVisibleSize:n.cachedVisibleSize}:i.minimumSize;const f=this.orientation===ii.Vertical?new M9(t,i,u):new j9(t,i,u);if(this.viewItems.splice(o,0,f),this.viewItems.length>1){const p=this.orientation===ii.Vertical?new iw(this.sashContainer,{getHorizontalSashTop:v=>this.getSashPosition(v),getHorizontalSashWidth:this.getSashOrthogonalSize},{orientation:ii.Horizontal}):new iw(this.sashContainer,{getVerticalSashLeft:v=>this.getSashPosition(v),getVerticalSashHeight:this.getSashOrthogonalSize},{orientation:ii.Vertical}),d=this.orientation===ii.Vertical?v=>({sash:p,start:v.startY,current:v.currentY}):v=>({sash:p,start:v.startX,current:v.currentX});p.on("start",v=>{var b;this.emit("sashDragStart"),this.onSashStart(d(v));const x=this.viewItems.map(y=>y.size);(b=this.onDidDragStart)==null||b.call(this,x)}),p.on("change",v=>this.onSashChange(d(v))),p.on("end",()=>{var v;this.emit("sashDragEnd"),this.onSashEnd(this.sashItems.findIndex(x=>x.sash===p));const b=this.viewItems.map(x=>x.size);(v=this.onDidDragEnd)==null||v.call(this,b)}),p.on("reset",()=>{const v=this.sashItems.findIndex(E=>E.sash===p),b=Js(v,-1,-1),x=Js(v+1,this.viewItems.length),y=this.findFirstSnapIndex(b),S=this.findFirstSnapIndex(x);(typeof y!="number"||this.viewItems[y].visible)&&(typeof S!="number"||this.viewItems[S].visible)&&this.emit("sashreset",v)});const _={sash:p};this.sashItems.splice(o-1,0,_)}l||this.relayout(),l||typeof n=="number"||n.type!=="distribute"||this.distributeViewSizes()}removeView(t,i){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");const n=this.viewItems.splice(t,1)[0].view;if(this.viewItems.length>=1){const o=Math.max(t-1,0);this.sashItems.splice(o,1)[0].sash.dispose()}return this.relayout(),i&&i.type==="distribute"&&this.distributeViewSizes(),n}moveView(t,i,n){const o=this.getViewCachedVisibleSize(i),l=o===void 0?this.getViewSize(i):Ah.Invisible(o),u=this.removeView(i);this.addView(t,u,l,n)}getViewCachedVisibleSize(t){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[t].cachedVisibleSize}layout(t=this.size){const i=Math.max(this.size,this.contentSize);if(this.size=t,this.proportions)for(let n=0;n<this.viewItems.length;n++){const o=this.viewItems[n];o.size=fi(Math.round(this.proportions[n]*t),o.minimumSize,o.maximumSize)}else{const n=Js(0,this.viewItems.length),o=n.filter(u=>this.viewItems[u].priority===ti.Low),l=n.filter(u=>this.viewItems[u].priority===ti.High);this.resize(this.viewItems.length-1,t-i,void 0,o,l)}this.distributeEmptySpace(),this.layoutViews()}resizeView(t,i){if(t<0||t>=this.viewItems.length)return;const n=Js(0,this.viewItems.length).filter(f=>f!==t),o=[...n.filter(f=>this.viewItems[f].priority===ti.Low),t],l=n.filter(f=>this.viewItems[f].priority===ti.High),u=this.viewItems[t];i=Math.round(i),i=fi(i,u.minimumSize,Math.min(u.maximumSize,this.size)),u.size=i,this.relayout(o,l)}resizeViews(t){for(let i=0;i<t.length;i++){const n=this.viewItems[i];let o=t[i];o=Math.round(o),o=fi(o,n.minimumSize,Math.min(n.maximumSize,this.size)),n.size=o}this.contentSize=this.viewItems.reduce((i,n)=>i+n.size,0),this.saveProportions(),this.layout(this.size)}getViewSize(t){return t<0||t>=this.viewItems.length?-1:this.viewItems[t].size}isViewVisible(t){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[t].visible}setViewVisible(t,i){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");this.viewItems[t].setVisible(i),this.distributeEmptySpace(t),this.layoutViews(),this.saveProportions()}distributeViewSizes(){const t=[];let i=0;for(const f of this.viewItems)f.maximumSize-f.minimumSize>0&&(t.push(f),i+=f.size);const n=Math.floor(i/t.length);for(const f of t)f.size=fi(n,f.minimumSize,f.maximumSize);const o=Js(0,this.viewItems.length),l=o.filter(f=>this.viewItems[f].priority===ti.Low),u=o.filter(f=>this.viewItems[f].priority===ti.High);this.relayout(l,u)}dispose(){this.sashItems.forEach(t=>t.sash.dispose()),this.sashItems=[],this.sashContainer.remove()}relayout(t,i){const n=this.viewItems.reduce((o,l)=>o+l.size,0);this.resize(this.viewItems.length-1,this.size-n,void 0,t,i),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}onSashStart({sash:t,start:i}){const n=this.sashItems.findIndex(o=>o.sash===t);(o=>{const l=this.viewItems.map(T=>T.size);let u,f,p=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY;const _=Js(n,-1,-1),v=Js(n+1,this.viewItems.length),b=_.reduce((T,A)=>T+(this.viewItems[A].minimumSize-l[A]),0),x=_.reduce((T,A)=>T+(this.viewItems[A].viewMaximumSize-l[A]),0),y=v.length===0?Number.POSITIVE_INFINITY:v.reduce((T,A)=>T+(l[A]-this.viewItems[A].minimumSize),0),S=v.length===0?Number.NEGATIVE_INFINITY:v.reduce((T,A)=>T+(l[A]-this.viewItems[A].viewMaximumSize),0);p=Math.max(b,S),d=Math.min(y,x);const E=this.findFirstSnapIndex(_),N=this.findFirstSnapIndex(v);if(typeof E=="number"){const T=this.viewItems[E],A=Math.floor(T.viewMinimumSize/2);u={index:E,limitDelta:T.visible?p-A:p+A,size:T.size}}if(typeof N=="number"){const T=this.viewItems[N],A=Math.floor(T.viewMinimumSize/2);f={index:N,limitDelta:T.visible?d+A:d-A,size:T.size}}this.sashDragState={start:o,current:o,index:n,sizes:l,minDelta:p,maxDelta:d,snapBefore:u,snapAfter:f}})(i)}onSashChange({current:t}){const{index:i,start:n,sizes:o,minDelta:l,maxDelta:u,snapBefore:f,snapAfter:p}=this.sashDragState;this.sashDragState.current=t;const d=t-n;this.resize(i,d,o,void 0,void 0,l,u,f,p),this.distributeEmptySpace(),this.layoutViews()}getSashPosition(t){let i=0;for(let n=0;n<this.sashItems.length;n++)if(i+=this.viewItems[n].size,this.sashItems[n].sash===t)return i;return 0}resize(t,i,n=this.viewItems.map(_=>_.size),o,l,u=Number.NEGATIVE_INFINITY,f=Number.POSITIVE_INFINITY,p,d){if(t<0||t>=this.viewItems.length)return 0;const _=Js(t,-1,-1),v=Js(t+1,this.viewItems.length);if(l)for(const D of l)ew(_,D),ew(v,D);if(o)for(const D of o)am(_,D),am(v,D);const b=_.map(D=>this.viewItems[D]),x=_.map(D=>n[D]),y=v.map(D=>this.viewItems[D]),S=v.map(D=>n[D]),E=_.reduce((D,L)=>D+(this.viewItems[L].minimumSize-n[L]),0),N=_.reduce((D,L)=>D+(this.viewItems[L].maximumSize-n[L]),0),T=v.length===0?Number.POSITIVE_INFINITY:v.reduce((D,L)=>D+(n[L]-this.viewItems[L].minimumSize),0),A=v.length===0?Number.NEGATIVE_INFINITY:v.reduce((D,L)=>D+(n[L]-this.viewItems[L].maximumSize),0),j=Math.max(E,A,u),M=Math.min(T,N,f);let P=!1;if(p){const D=this.viewItems[p.index],L=i>=p.limitDelta;P=L!==D.visible,D.setVisible(L,p.size)}if(!P&&d){const D=this.viewItems[d.index],L=i<d.limitDelta;P=L!==D.visible,D.setVisible(L,d.size)}if(P)return this.resize(t,i,n,o,l,u,f);for(let D=0,L=i=fi(i,j,M);D<b.length;D++){const V=b[D],te=fi(x[D]+L,V.minimumSize,V.maximumSize);L-=te-x[D],V.size=te}for(let D=0,L=i;D<y.length;D++){const V=y[D],te=fi(S[D]-L,V.minimumSize,V.maximumSize);L+=te-S[D],V.size=te}return i}distributeEmptySpace(t){const i=this.viewItems.reduce((d,_)=>d+_.size,0);let n=this.size-i;const o=Js(0,this.viewItems.length),l=[],u=o.filter(d=>this.viewItems[d].priority===ti.Low),f=o.filter(d=>this.viewItems[d].priority===ti.Normal),p=o.filter(d=>this.viewItems[d].priority===ti.High);l.push(...p,...f,...u),typeof t=="number"&&am(l,t);for(let d=0;n!==0&&d<l.length;d++){const _=this.viewItems[l[d]],v=fi(_.size+n,_.minimumSize,_.maximumSize);n-=v-_.size,_.size=v}}layoutViews(){var t;this.contentSize=this.viewItems.reduce((n,o)=>n+o.size,0);let i=0;for(const n of this.viewItems)n.layout(i),i+=n.size;(t=this.onDidChange)!=null&&t.call(this,this.viewItems.map(n=>n.size)),this.sashItems.forEach(n=>n.sash.layout()),this.updateSashEnablement()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(t=>t.size/this.contentSize))}updateSashEnablement(){let t=!1;const i=this.viewItems.map(p=>t=p.size-p.minimumSize>0||t);t=!1;const n=this.viewItems.map(p=>t=p.maximumSize-p.size>0||t),o=[...this.viewItems].reverse();t=!1;const l=o.map(p=>t=p.size-p.minimumSize>0||t).reverse();t=!1;const u=o.map(p=>t=p.maximumSize-p.size>0||t).reverse();let f=0;for(let p=0;p<this.sashItems.length;p++){const{sash:d}=this.sashItems[p];f+=this.viewItems[p].size;const _=!(i[p]&&u[p+1]),v=!(n[p]&&l[p+1]);if(_&&v){const b=Js(p,-1,-1),x=Js(p+1,this.viewItems.length),y=this.findFirstSnapIndex(b),S=this.findFirstSnapIndex(x),E=typeof y=="number"&&!this.viewItems[y].visible,N=typeof S=="number"&&!this.viewItems[S].visible;E&&l[p]&&(f>0||this.startSnappingEnabled)?d.state=Ps.Minimum:N&&i[p]&&(f<this.contentSize||this.endSnappingEnabled)?d.state=Ps.Maximum:d.state=Ps.Disabled}else d.state=_&&!v?Ps.Minimum:!_&&v?Ps.Maximum:Ps.Enabled}}findFirstSnapIndex(t){for(const i of t){const n=this.viewItems[i];if(n.visible&&n.snap)return i}for(const i of t){const n=this.viewItems[i];if(n.visible&&n.maximumSize-n.minimumSize>0)return;if(!n.visible&&n.snap)return i}}}class Qo{constructor(t){this.size=void 0,this.size=t}getPreferredSize(){return this.size}}class rw{constructor(t,i){this.proportion=void 0,this.layoutService=void 0,this.proportion=t,this.layoutService=i}getPreferredSize(){return this.proportion*this.layoutService.getSize()}}class Gu{getPreferredSize(){}}class nw{get preferredSize(){return this.layoutStrategy.getPreferredSize()}set preferredSize(t){if(typeof t=="number")this.layoutStrategy=new Qo(t);else if(typeof t=="string"){const i=t.trim();if(Ku(i,"%")){const n=Number(i.slice(0,-1))/100;this.layoutStrategy=new rw(n,this.layoutService)}else if(Ku(i,"px")){const n=Number(i.slice(0,-2))/100;this.layoutStrategy=new Qo(n)}else if(typeof Number.parseFloat(i)=="number"){const n=Number.parseFloat(i);this.layoutStrategy=new Qo(n)}else this.layoutStrategy=new Gu}else this.layoutStrategy=new Gu}constructor(t,i){var n;if(this.minimumSize=0,this.maximumSize=Number.POSITIVE_INFINITY,this.element=void 0,this.priority=void 0,this.snap=void 0,this.layoutService=void 0,this.layoutStrategy=void 0,this.layoutService=t,this.element=i.element,this.minimumSize=typeof i.minimumSize=="number"?i.minimumSize:30,this.maximumSize=typeof i.maximumSize=="number"?i.maximumSize:Number.POSITIVE_INFINITY,typeof i.preferredSize=="number")this.layoutStrategy=new Qo(i.preferredSize);else if(typeof i.preferredSize=="string"){const o=i.preferredSize.trim();if(Ku(o,"%")){const l=Number(o.slice(0,-1))/100;this.layoutStrategy=new rw(l,this.layoutService)}else if(Ku(o,"px")){const l=Number(o.slice(0,-2));this.layoutStrategy=new Qo(l)}else if(typeof Number.parseFloat(o)=="number"){const l=Number.parseFloat(o);this.layoutStrategy=new Qo(l)}else this.layoutStrategy=new Gu}else this.layoutStrategy=new Gu;this.priority=(n=i.priority)!=null?n:ti.Normal,this.snap=typeof i.snap=="boolean"&&i.snap}layout(t){}}function ow(e){return e.minSize!==void 0||e.maxSize!==void 0||e.preferredSize!==void 0||e.priority!==void 0||e.visible!==void 0}const kv=w.forwardRef(({className:e,children:t},i)=>ds.createElement("div",{ref:i,className:Dg("split-view-view",fk,e)},t));kv.displayName="Allotment.Pane";const bk=w.forwardRef(({children:e,className:t,id:i,maxSize:n=1/0,minSize:o=30,proportionalLayout:l=!0,separator:u=!0,sizes:f,defaultSizes:p=f,snap:d=!1,vertical:_=!1,onChange:v,onReset:b,onVisibleChange:x,onDragStart:y,onDragEnd:S},E)=>{const N=w.useRef(null),T=w.useRef([]),A=w.useRef(new Map),j=w.useRef(null),M=w.useRef(new Map),P=w.useRef(new k9),D=w.useRef([]),[L,V]=w.useState(!1),te=w.useMemo(()=>ds.Children.toArray(e).filter(ds.isValidElement),[e]),U=w.useCallback(H=>{var B,W;const K=(B=D.current)==null?void 0:B[H];return typeof(K==null?void 0:K.preferredSize)=="number"&&((W=j.current)!=null&&W.resizeView(H,Math.round(K.preferredSize)),!0)},[]);return w.useImperativeHandle(E,()=>({reset:()=>{if(b)b();else{var H;(H=j.current)==null||H.distributeViewSizes();for(let B=0;B<D.current.length;B++)U(B)}},resize:H=>{var B;(B=j.current)==null||B.resizeViews(H)}})),ZS(()=>{let H=!0;p&&M.current.size!==p.length&&(H=!1,console.warn(`Expected ${p.length} children based on defaultSizes but found ${M.current.size}`)),H&&p&&(T.current=te.map(K=>K.key));const B=ca({orientation:_?ii.Vertical:ii.Horizontal,proportionalLayout:l},H&&p&&{descriptor:{size:p.reduce((K,O)=>K+O,0),views:p.map((K,O)=>{var $,F,ae,G;const z=A.current.get(T.current[O]),Q=new nw(P.current,ca({element:document.createElement("div"),minimumSize:($=z==null?void 0:z.minSize)!=null?$:o,maximumSize:(F=z==null?void 0:z.maxSize)!=null?F:n,priority:(ae=z==null?void 0:z.priority)!=null?ae:ti.Normal},(z==null?void 0:z.preferredSize)&&{preferredSize:z==null?void 0:z.preferredSize},{snap:(G=z==null?void 0:z.snap)!=null?G:d}));return D.current.push(Q),{container:[...M.current.values()][O],size:K,view:Q}})}});j.current=new O9(N.current,B,v,y,S),j.current.on("sashDragStart",()=>{var K;(K=N.current)==null||K.classList.add("split-view-sash-dragging")}),j.current.on("sashDragEnd",()=>{var K;(K=N.current)==null||K.classList.remove("split-view-sash-dragging")}),j.current.on("sashchange",K=>{if(x&&j.current){const O=te.map($=>$.key);for(let $=0;$<O.length;$++){const F=A.current.get(O[$]);(F==null?void 0:F.visible)!==void 0&&F.visible!==j.current.isViewVisible($)&&x($,j.current.isViewVisible($))}}}),j.current.on("sashreset",K=>{if(b)b();else{var O;if(U(K)||U(K+1))return;(O=j.current)==null||O.distributeViewSizes()}});const W=j.current;return()=>{W.dispose()}},[]),ZS(()=>{if(L){const se=te.map(me=>me.key),le=[...T.current],ue=se.filter(me=>!T.current.includes(me)),de=se.filter(me=>T.current.includes(me)),we=T.current.map(me=>!se.includes(me));for(let me=we.length-1;me>=0;me--){var H;we[me]&&((H=j.current)!=null&&H.removeView(me),le.splice(me,1),D.current.splice(me,1))}for(const me of ue){var B,W,K,O,$;const ce=A.current.get(me),ke=new nw(P.current,ca({element:document.createElement("div"),minimumSize:(B=ce==null?void 0:ce.minSize)!=null?B:o,maximumSize:(W=ce==null?void 0:ce.maxSize)!=null?W:n,priority:(K=ce==null?void 0:ce.priority)!=null?K:ti.Normal},(ce==null?void 0:ce.preferredSize)&&{preferredSize:ce==null?void 0:ce.preferredSize},{snap:(O=ce==null?void 0:ce.snap)!=null?O:d}));($=j.current)!=null&&$.addView(M.current.get(me),ke,Ah.Distribute,se.findIndex(Ae=>Ae===me)),le.splice(se.findIndex(Ae=>Ae===me),0,me),D.current.splice(se.findIndex(Ae=>Ae===me),0,ke)}for(;!m9(se,le);)for(const[me,ce]of se.entries()){const ke=le.findIndex(Ae=>Ae===ce);if(ke!==me){var F;(F=j.current)==null||F.moveView(M.current.get(ce),ke,me);const Ae=le[ke];le.splice(ke,1),le.splice(me,0,Ae);break}}for(const me of ue){var ae;const ce=se.findIndex(Ae=>Ae===me),ke=D.current[ce].preferredSize;ke!==void 0&&((ae=j.current)==null||ae.resizeView(ce,ke))}for(const me of[...ue,...de]){var G,z;const ce=A.current.get(me),ke=se.findIndex(Ae=>Ae===me);ce&&ow(ce)&&ce.visible!==void 0&&((G=j.current)==null?void 0:G.isViewVisible(ke))!==ce.visible&&((z=j.current)==null||z.setViewVisible(ke,ce.visible))}for(const me of de){const ce=A.current.get(me),ke=se.findIndex(Ae=>Ae===me);if(ce&&ow(ce)){var Q;ce.preferredSize!==void 0&&D.current[ke].preferredSize!==ce.preferredSize&&(D.current[ke].preferredSize=ce.preferredSize);let Ae=!1;ce.minSize!==void 0&&D.current[ke].minimumSize!==ce.minSize&&(D.current[ke].minimumSize=ce.minSize,Ae=!0),ce.maxSize!==void 0&&D.current[ke].maximumSize!==ce.maxSize&&(D.current[ke].maximumSize=ce.maxSize,Ae=!0),Ae&&((Q=j.current)==null||Q.layout())}}(ue.length>0||we.length>0)&&(T.current=se)}},[te,L,n,o,d]),w.useEffect(()=>{j.current&&(j.current.onDidChange=v)},[v]),w.useEffect(()=>{j.current&&(j.current.onDidDragStart=y)},[y]),w.useEffect(()=>{j.current&&(j.current.onDidDragEnd=S)},[S]),v9({ref:N,onResize:({width:H,height:B})=>{var W;H&&B&&((W=j.current)!=null&&W.layout(_?B:H),P.current.setSize(_?B:H),V(!0))}}),w.useEffect(()=>{gk&&L9(20)},[]),ds.createElement("div",{ref:N,className:Dg("split-view",_?"split-view-vertical":"split-view-horizontal",{"split-view-separator-border":u},_9,_?x9:S9,{[w9]:u},t),id:i},ds.createElement("div",{className:Dg("split-view-container",b9)},ds.Children.toArray(e).map(H=>{if(!ds.isValidElement(H))return null;const B=H.key;return H.type.displayName==="Allotment.Pane"?(A.current.set(B,H.props),ds.cloneElement(H,{key:B,ref:W=>{const K=H.ref;K&&(K.current=W),W?M.current.set(B,W):M.current.delete(B)}})):ds.createElement(kv,{key:B,ref:W=>{W?M.current.set(B,W):M.current.delete(B)}},H)})))});function L9(e){const t=fi(e,4,20),i=fi(e,1,8);document.documentElement.style.setProperty("--sash-size",t+"px"),document.documentElement.style.setProperty("--sash-hover-size",i+"px"),(function(n){vk=n,_k.emit("onDidChangeGlobalSize",n)})(t)}bk.displayName="Allotment";var hm=Object.assign(bk,{Pane:kv});function z9({path:e,isLocal:t,onNavigate:i}){const n=w.useRef(null);w.useEffect(()=>{n.current&&(n.current.scrollLeft=n.current.scrollWidth)},[e]);const o=e.split("/").filter(Boolean),l=e==="/";return h.jsxs("div",{ref:n,className:"flex items-center gap-0.5 overflow-x-auto scrollbar-none text-xs",children:[h.jsxs("button",{onClick:()=>i("/"),className:fe("flex shrink-0 items-center gap-1 rounded px-1.5 py-0.5 transition-colors","hover:bg-accent/30 text-muted-foreground hover:text-foreground",l&&"text-foreground font-medium"),children:[h.jsx(GC,{className:"h-3 w-3"}),t?"/":"~"]}),o.map((u,f)=>{const p="/"+o.slice(0,f+1).join("/"),d=f===o.length-1;return h.jsxs("div",{className:"flex shrink-0 items-center",children:[h.jsx(yh,{className:"h-3 w-3 text-muted-foreground/50"}),h.jsx("button",{onClick:()=>i(p),className:fe("rounded px-1.5 py-0.5 transition-colors truncate max-w-[150px]","hover:bg-accent/30",d?"text-foreground font-medium":"text-muted-foreground hover:text-foreground"),children:u})]},p)})]})}function B9({...e}){return h.jsx(F5,{"data-slot":"context-menu",...e})}function P9({...e}){return h.jsx(V5,{"data-slot":"context-menu-trigger",...e})}function H9({className:e,...t}){return h.jsx(q5,{children:h.jsx(Y5,{"data-slot":"context-menu-content",className:fe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...t})})}function is({className:e,inset:t,variant:i="default",...n}){return h.jsx(W5,{"data-slot":"context-menu-item","data-inset":t,"data-variant":i,className:fe("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}function Al({className:e,...t}){return h.jsx(K5,{"data-slot":"context-menu-separator",className:fe("bg-border -mx-1 my-1 h-px",e),...t})}function zn({className:e,...t}){return h.jsx("span",{"data-slot":"context-menu-shortcut",className:fe("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}const xk=new Set(["png","jpg","jpeg","gif","webp","svg","ico","bmp"]),Sk=new Set(["js","ts","tsx","jsx","py","rb","go","rs","java","c","cpp","h","php","swift","kt","dart","vue","svelte","html","css","scss","sh","bash","zsh","sql","graphql"]),wk=new Set(["txt","md","json","xml","yaml","yml","toml","csv","log","conf","cfg","ini","env","gitignore","dockerignore","editorconfig","htaccess","makefile"]),Ck=new Set(["md","txt","pdf","doc","docx","rtf","csv","json","xml","yaml","yml","toml"]),I9=new Set(["mp3","wav","flac","ogg","aac","m4a"]),$9=new Set(["mp4","mkv","avi","mov","webm"]),kk=new Set(["zip","tar","gz","bz2","xz","rar","7z"]);function Ev(e){var t;return((t=e.split(".").pop())==null?void 0:t.toLowerCase())||""}function U9(e){const t=Ev(e);return xk.has(t)?"image":Sk.has(t)?"code":wk.has(t)?"text":Ck.has(t)?"doc":I9.has(t)?"audio":$9.has(t)?"video":kk.has(t)?"archive":"other"}function F9(e){const t=Ev(e);return xk.has(t)||Sk.has(t)||wk.has(t)||Ck.has(t)&&(t==="pdf"||t==="md"||t==="txt"||t==="json")}function V9(e){const t=Ev(e);return kk.has(t)||e.endsWith(".tar.gz")||e.endsWith(".tgz")}function q9({selectedFiles:e,files:t,isLocal:i,rightClickedFile:n,currentPath:o,onOpen:l,onDelete:u,onRename:f,onTransfer:p,onCompress:d,onExtract:_,onPreview:v,onInspect:b,onShowInFinder:x,onCreateFolder:y,onCreateFile:S,onRefresh:E,onOpenTerminal:N,onOpenInEditor:T,onOpenInCode:A,t:j,children:M}){const P=t.filter(D=>e.has(D.path));return h.jsxs(B9,{children:[h.jsx(P9,{asChild:!0,children:M}),h.jsx(H9,{className:"min-w-[200px]",children:n?h.jsxs(h.Fragment,{children:[h.jsxs(is,{onClick:()=>l(n),children:[h.jsx(gr,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextOpen")]}),T&&(i||!n.isDirectory)&&h.jsxs(is,{onClick:()=>T(n),children:[h.jsx(qC,{className:"mr-2 h-3.5 w-3.5"}),j("files.openInEditor")]}),A&&i&&n.isDirectory&&h.jsxs(is,{onClick:()=>A(n),children:[h.jsx(Yn,{className:"mr-2 h-3.5 w-3.5"}),j("files.openInCode")]}),!n.isDirectory&&v&&F9(n.name)&&h.jsxs(is,{onClick:()=>v(n),children:[h.jsx(VC,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextQuickLook"),h.jsx(zn,{children:"Space"})]}),i&&x&&h.jsxs(is,{onClick:()=>x(n.path),children:[h.jsx(FC,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextShowInFinder")]}),h.jsxs(is,{onClick:()=>navigator.clipboard.writeText(n.path),children:[h.jsx(Fm,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextCopyPath"),h.jsx(zn,{children:"⌘C"})]}),b&&h.jsxs(is,{onClick:()=>b(n),children:[h.jsx(XC,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextGetInfo"),h.jsx(zn,{children:"⌘I"})]}),h.jsx(Al,{}),p&&h.jsxs(h.Fragment,{children:[h.jsxs(is,{onClick:()=>p(P.length>0?P:[n]),children:[i?h.jsx(ic,{className:"mr-2 h-3.5 w-3.5"}):h.jsx(to,{className:"mr-2 h-3.5 w-3.5"}),`${j(i?"files.contextUpload":"files.contextDownload")}${P.length>1?` (${P.length})`:""}`]}),h.jsx(Al,{})]}),h.jsxs(is,{onClick:()=>f(n),children:[h.jsx(da,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextRename")]}),!n.isDirectory&&d&&h.jsxs(is,{onClick:()=>d(P.length>0?P:[n]),children:[h.jsx(Vm,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextCompressZip")]}),!n.isDirectory&&V9(n.name)&&_&&h.jsxs(is,{onClick:()=>_(n),children:[h.jsx(Vm,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextExtractZip")]}),h.jsx(Al,{}),h.jsxs(is,{className:"text-destructive focus:text-destructive",onClick:()=>u(P.length>0?P:[n]),children:[h.jsx(Wn,{className:"mr-2 h-3.5 w-3.5"}),`${j("files.contextDelete")}${P.length>1?` (${P.length})`:""}`,h.jsx(zn,{children:"⌘⌫"})]})]}):h.jsxs(h.Fragment,{children:[h.jsxs(is,{onClick:y,children:[h.jsx(WC,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextNewFolder"),h.jsx(zn,{children:"⇧⌘N"})]}),S&&h.jsxs(is,{onClick:S,children:[h.jsx(YC,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextNewFile"),h.jsx(zn,{children:"⌘N"})]}),h.jsxs(is,{onClick:()=>navigator.clipboard.writeText(o),children:[h.jsx(Fm,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextCopyPath")]}),h.jsx(Al,{}),h.jsxs(is,{onClick:E,children:[h.jsx(fa,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextRefresh"),h.jsx(zn,{children:"⌘R"})]}),N&&h.jsxs(h.Fragment,{children:[h.jsx(Al,{}),h.jsxs(is,{onClick:N,children:[h.jsx(pa,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextOpenTerminal")]})]})]})})]})}function Y9(e){if(e.isDirectory)return h.jsx(gr,{className:"h-3.5 w-3.5 text-primary shrink-0"});switch(U9(e.name)){case"image":return h.jsx(OP,{className:"h-3.5 w-3.5 text-green-500 shrink-0"});case"code":return h.jsx(qC,{className:"h-3.5 w-3.5 text-blue-400 shrink-0"});case"doc":case"text":return h.jsx(wP,{className:"h-3.5 w-3.5 text-orange-400 shrink-0"});case"audio":return h.jsx(XP,{className:"h-3.5 w-3.5 text-purple-400 shrink-0"});case"video":return h.jsx(R8,{className:"h-3.5 w-3.5 text-red-400 shrink-0"});case"archive":return h.jsx(Vm,{className:"h-3.5 w-3.5 text-yellow-500 shrink-0"});default:return h.jsx(YC,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"})}}const W9=w.memo(function({file:t,isSelected:i,isDragTarget:n,onSelect:o,onOpen:l,onContextMenu:u,onDragStart:f,onDragOver:p,onDragLeave:d,onDrop:_,t:v}){const b=x=>{o(t.path,x.metaKey||x.ctrlKey,x.shiftKey)};return h.jsxs("div",{role:"row",tabIndex:0,draggable:!0,className:fe("flex items-center text-xs cursor-pointer transition-colors","border-b border-border-subtle",i?"bg-accent text-foreground":"hover:bg-accent/30",n&&"ring-2 ring-inset ring-primary bg-accent"),onClick:b,onKeyDown:x=>{x.key==="Enter"&&l(t),x.key===" "&&(x.preventDefault(),b(x))},onDoubleClick:()=>l(t),onContextMenu:()=>u(t),onDragStart:x=>f(x,t),onDragOver:x=>t.isDirectory?p(x,t.path):void 0,onDragLeave:d,onDrop:x=>t.isDirectory?_(x,t.path):void 0,children:[h.jsxs("div",{className:"flex flex-1 items-center gap-1.5 px-3 py-1 min-w-0",children:[Y9(t),h.jsx("span",{className:"truncate",children:t.name}),t.isSymlink&&h.jsx("span",{className:"text-[9px] text-muted-foreground bg-muted px-1 rounded",children:v("files.statusLink")})]}),h.jsx("div",{className:"w-20 px-3 py-1 text-right text-muted-foreground tabular-nums",children:t.isDirectory?"--":wH(t.size)}),h.jsx("div",{className:"w-36 px-3 py-1 text-muted-foreground",children:CH(t.modifyTime)})]})}),dm="application/x-transhub-files",aw=w.memo(function({title:t,isLocal:i,files:n,currentPath:o,loading:l,selectedFiles:u,onNavigate:f,onRefresh:p,onSelect:d,onOpen:_,onCreateFolder:v,onCreateFile:b,onDelete:x,onRename:y,onTransfer:S,transferLabel:E,onShowInFinder:N,onDropFiles:T,onOpenTerminal:A,onCompress:j,onExtract:M,onPreview:P,onInspect:D,onOpenInEditor:L,onOpenInCode:V,onGoHome:te,onGoRoot:U,onGoDefaultDir:H,defaultDirPath:B,onSetDefaultDir:W,onCopyPath:K,onOpenTerminalHere:O,onNativeFileDrop:$}){je();const{t:F}=Gh(),[ae,G]=w.useState(!1),[z,Q]=w.useState("name"),[se,le]=w.useState("asc"),[ue,de]=w.useState(void 0),[we,me]=w.useState(null),[ce,ke]=w.useState(!1),Ae=w.useRef(null);w.useEffect(()=>{const Se=Te=>{var Xe;if(!(!((Xe=Ae.current)!=null&&Xe.contains(document.activeElement))&&Ae.current!==document.activeElement)){if(Te.key===" "&&P&&u.size===1){Te.preventDefault();const nt=n.find(os=>u.has(os.path));nt&&!nt.isDirectory&&P(nt)}if((Te.metaKey||Te.ctrlKey)&&Te.key==="r"&&(Te.preventDefault(),p()),(Te.metaKey||Te.ctrlKey)&&Te.shiftKey&&Te.key==="N"&&(Te.preventDefault(),v()),(Te.metaKey||Te.ctrlKey)&&!Te.shiftKey&&Te.key==="n"&&b&&(Te.preventDefault(),b()),(Te.metaKey||Te.ctrlKey)&&Te.key==="i"&&D&&u.size===1){Te.preventDefault();const nt=n.find(os=>u.has(os.path));nt&&D(nt)}if((Te.metaKey||Te.ctrlKey)&&Te.key==="Backspace"&&u.size>0){Te.preventDefault();const nt=n.filter(os=>u.has(os.path));nt.length>0&&x(nt)}if((Te.metaKey||Te.ctrlKey)&&Te.key==="c"&&u.size===1){const nt=n.find(os=>u.has(os.path));nt&&navigator.clipboard.writeText(nt.path)}}};return document.addEventListener("keydown",Se),()=>document.removeEventListener("keydown",Se)},[u,n,P,p,v,b,D,x]);const rt=w.useMemo(()=>n.filter(Se=>ae||!Se.name.startsWith(".")),[n,ae]),De=w.useMemo(()=>[...rt].sort((Se,Te)=>{if(Se.isDirectory!==Te.isDirectory)return Se.isDirectory?-1:1;let Xe=0;switch(z){case"name":Xe=Se.name.localeCompare(Te.name);break;case"size":Xe=Se.size-Te.size;break;case"modified":Xe=Se.modifyTime-Te.modifyTime;break}return se==="asc"?Xe:-Xe}),[rt,z,se]),ft=Se=>{z===Se?le(Te=>Te==="asc"?"desc":"asc"):(Q(Se),le("asc"))},wr=()=>{const Se=o.split("/").slice(0,-1).join("/")||"/";f(Se)},Bi=w.useCallback((Se,Te)=>{const Xe=u.has(Te.path)?n.filter(os=>u.has(os.path)):[Te];Se.dataTransfer.setData(dm,JSON.stringify({files:Xe,source:i?"local":"remote",sourcePath:o})),Se.dataTransfer.effectAllowed="copy";const nt=document.createElement("div");nt.className="fixed bg-card border border-border rounded-lg px-3 py-1.5 text-xs shadow-lg flex items-center gap-2 pointer-events-none",nt.innerHTML=`<span>${Xe.length} item${Xe.length>1?"s":""}</span>`,nt.style.position="absolute",nt.style.top="-1000px",document.body.appendChild(nt),Se.dataTransfer.setDragImage(nt,0,0),setTimeout(()=>document.body.removeChild(nt),0)},[u,n,i,o]),hn=w.useCallback((Se,Te)=>{Se.preventDefault(),Se.stopPropagation(),(Se.dataTransfer.types.includes(dm)||Se.dataTransfer.types.includes("Files"))&&(Se.dataTransfer.dropEffect="copy",Te?me(Te):ke(!0))},[]),dn=w.useCallback(Se=>{Se.preventDefault(),me(null),ke(!1)},[]),Cr=w.useCallback((Se,Te)=>{Se.preventDefault(),Se.stopPropagation(),me(null),ke(!1);const Xe=Se.dataTransfer.getData(dm);if(Xe){try{const{files:nt,source:os}=JSON.parse(Xe);if(os===(i?"local":"remote"))return;const no=Te||o;T==null||T(nt,no)}catch{}return}if(Se.dataTransfer.files.length>0){const nt=Array.from(Se.dataTransfer.files),os=Te||o;$==null||$(nt,os)}},[i,o,T,$]),fn=w.useCallback(Se=>{u.has(Se.path)||d(Se.path,!1,!1),de(Se)},[u,d]),Pi=w.useMemo(()=>De.filter(Se=>u.has(Se.path)),[De,u]);return h.jsxs("div",{ref:Ae,tabIndex:0,className:fe("flex h-full flex-col outline-none",ce&&"ring-2 ring-inset ring-primary"),onDragOver:Se=>hn(Se),onDragLeave:dn,onDrop:Se=>Cr(Se),children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-1",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:t}),h.jsxs("div",{className:"flex items-center gap-0.5",children:[h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:()=>G(!ae),title:F(ae?"files.hideHidden":"files.showHidden"),children:ae?h.jsx(VC,{className:"h-3.5 w-3.5"}):h.jsx(pP,{className:"h-3.5 w-3.5"})}),h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:v,title:F("files.newFolder")+" (⇧⌘N)",children:h.jsx(WC,{className:"h-3.5 w-3.5"})}),S&&Pi.length>0&&h.jsxs(ve,{variant:"default",size:"sm",className:"h-6 px-2 text-[10px]",onClick:()=>S(Pi),children:[i?h.jsx(ic,{className:"h-3 w-3"}):h.jsx(to,{className:"h-3 w-3"}),E||F(i?"files.upload":"files.download")," (",Pi.length,")"]})]})]}),h.jsxs("div",{className:"flex items-center gap-0.5 border-b border-border px-3 py-1",children:[h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:wr,title:F("files.goUp"),children:h.jsx(QB,{className:"h-3.5 w-3.5"})}),te&&h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:te,title:F("files.home"),children:h.jsx(GC,{className:"h-3.5 w-3.5"})}),U&&h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:U,title:F("files.root"),children:h.jsx(RP,{className:"h-3.5 w-3.5"})}),H&&B&&h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:H,title:B,children:h.jsx(gr,{className:"h-3.5 w-3.5 text-primary"})}),h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx(z9,{path:o,isLocal:i,onNavigate:f})}),K&&h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:K,title:F("files.copyPath"),children:h.jsx(Fm,{className:"h-3.5 w-3.5"})}),O&&h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:O,title:F("files.openTerminal"),children:h.jsx(pa,{className:"h-3.5 w-3.5"})}),W&&h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:W,title:F("files.setDefault"),className:o===B?"text-red-500":"",children:h.jsx(TP,{className:fe("h-3.5 w-3.5",o===B&&"fill-current")})}),h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:p,disabled:l,title:F("files.refresh")+" (⌘R)",children:h.jsx(fa,{className:fe("h-3.5 w-3.5",l&&"animate-spin")})})]}),h.jsx(q9,{selectedFiles:u,files:De,isLocal:i,rightClickedFile:ue,currentPath:o,onOpen:_,onDelete:x,onRename:y,onTransfer:S,onCompress:j,onExtract:M,onPreview:P,onInspect:D,onShowInFinder:N,onCreateFolder:v,onCreateFile:b,onRefresh:p,onOpenTerminal:A,onOpenInEditor:L,onOpenInCode:V,t:F,children:h.jsxs("div",{className:"flex-1 overflow-auto",onContextMenu:Se=>{Se.target===Se.currentTarget&&de(void 0)},children:[h.jsxs("div",{className:"sticky top-0 z-10 flex items-center border-b border-border bg-muted text-[10px] text-muted-foreground font-medium",children:[h.jsxs("button",{className:"flex-1 px-3 py-1 text-left hover:text-foreground transition-colors",onClick:()=>ft("name"),children:[F("files.columnName")," ",z==="name"&&h.jsx("span",{className:"ml-0.5 text-[9px]",children:se==="asc"?"▲":"▼"})]}),h.jsxs("button",{className:"w-20 px-3 py-1 text-right hover:text-foreground transition-colors",onClick:()=>ft("size"),children:[F("files.columnSize")," ",z==="size"&&h.jsx("span",{className:"ml-0.5 text-[9px]",children:se==="asc"?"▲":"▼"})]}),h.jsxs("button",{className:"w-36 px-3 py-1 text-left hover:text-foreground transition-colors",onClick:()=>ft("modified"),children:[F("files.columnModified")," ",z==="modified"&&h.jsx("span",{className:"ml-0.5 text-[9px]",children:se==="asc"?"▲":"▼"})]})]}),De.map(Se=>h.jsx(W9,{file:Se,isSelected:u.has(Se.path),isDragTarget:we===Se.path&&Se.isDirectory,onSelect:d,onOpen:_,onContextMenu:fn,onDragStart:Bi,onDragOver:hn,onDragLeave:dn,onDrop:Cr,t:F},Se.path)),De.length===0&&!l&&h.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[h.jsx(gr,{className:"h-10 w-10 mb-2 opacity-20"}),h.jsx("p",{className:"text-xs",children:F("files.emptyDirectory")})]}),l&&h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(fa,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]})}),h.jsxs("div",{className:"flex items-center justify-between border-t border-border px-2 py-0.5 text-[10px] text-muted-foreground",children:[h.jsxs("span",{children:[rt.length," ",F("files.statusItems"),!ae&&n.length!==rt.length?` (${n.length-rt.length} ${F("files.statusHidden")})`:""]}),u.size>0&&h.jsxs("span",{children:[u.size," ",F("files.statusSelected")]})]})]})}),lw={path:"",files:[],loading:!0,selected:new Set};function K9({server:e}){je();const[t,i]=w.useState({local:lw,remote:lw}),[n,o]=w.useState(null),[l,u]=w.useState(null),f=w.useRef({local:null,remote:null}),p=w.useRef({local:"",remote:""}),d=(D,L)=>i(V=>({...V,[D]:{...V[D],...L}})),_=w.useCallback(async(D,L)=>{d(D,{loading:!0});try{const V=D==="local"?await Go.list(L):await Ko.list(e,L??".");p.current[D]=V.path,d(D,{path:V.path,files:V.entries,loading:!1,selected:new Set}),f.current[D]=null}catch(V){d(D,{loading:!1}),o(V.message)}},[e]);w.useEffect(()=>{_("local"),_("remote")},[_]),w.useEffect(()=>kt.subscribe(L=>{if(L.type!=="transfer")return;const V=L;if(u(V.state==="done"||V.state==="failed"?null:V),V.state==="done"){const te=V.direction==="upload"?"remote":"local";_(te,p.current[te])}V.state==="failed"&&o(V.error??k("The transfer failed"))}),[_]);const v=D=>(L,V,te)=>i(U=>{const H=U[D];let B;if(te&&f.current[D]){const W=H.files.map(ae=>ae.path),K=W.indexOf(f.current[D]),O=W.indexOf(L),[$,F]=K<O?[K,O]:[O,K];B=new Set(W.slice($,F+1))}else V?(B=new Set(H.selected),B.has(L)?B.delete(L):B.add(L),f.current[D]=L):(B=new Set([L]),f.current[D]=L);return{...U,[D]:{...H,selected:B}}}),b=D=>L=>{if(L.isDirectory)return void _(D,L.path);D==="remote"&&window.open(Ko.downloadUrl(e,L.path),"_blank")},x=(D,L)=>D.endsWith("/")?`${D}${L}`:`${D}/${L}`,y=D=>(L,V)=>{const te=V||p.current[D==="local"?"remote":"local"],U=L.filter(H=>!H.isDirectory);if(U.length===0){o(k("Directories cannot be transferred yet — select files."));return}RC.start({server:e,direction:D==="local"?"upload":"download",items:U.map(H=>D==="local"?{local:H.path,remote:x(te,H.name)}:{local:x(te,H.name),remote:H.path})}).catch(H=>o(H.message))},S=D=>async L=>{if(window.confirm(L.length===1?k("Delete {{name}}?",{name:L[0].name}):k("Delete {{n}} items?",{n:L.length})))try{for(const V of L)D==="local"?await Go.remove(V.path,V.isDirectory):await Ko.remove(e,V.path,V.isDirectory);await _(D,p.current[D])}catch(V){o(V.message)}},E=D=>async L=>{const V=window.prompt(k("New name"),L.name);if(!V||V===L.name)return;const te=L.path.slice(0,L.path.lastIndexOf("/"))||"/";try{D==="local"?await Go.rename(L.path,x(te,V)):await Ko.rename(e,L.path,x(te,V)),await _(D,p.current[D])}catch(U){o(U.message)}},N=D=>async()=>{const L=window.prompt(k("Name of the new directory"));if(!L)return;const V=p.current[D];try{D==="local"?await Go.mkdir(x(V,L)):await Ko.mkdir(e,x(V,L)),await _(D,V)}catch(te){o(te.message)}},{tabs:T,addTab:A,activateTab:j}=Ue(),M=(D,L)=>D.includes("\\")&&!D.startsWith("/")?`${D.replace(/\\$/,"")}\\${L}`:`${D.replace(/\/$/,"")}/${L}`,P=D=>({isLocal:D==="local",files:t[D].files,currentPath:t[D].path,loading:t[D].loading,selectedFiles:t[D].selected,onNavigate:L=>void _(D,L),onRefresh:()=>void _(D,p.current[D]),onSelect:v(D),onOpen:b(D),onCreateFolder:N(D),onDelete:S(D),onRename:E(D),onTransfer:y(D),transferLabel:k(D==="local"?"Upload":"Download"),onDropFiles:(L,V)=>y(D==="local"?"remote":"local")(L,V),onCopyPath:()=>{var L;return void((L=navigator.clipboard)==null?void 0:L.writeText(p.current[D]))},onCreateFile:()=>{const L=window.prompt(k("Name for the new file"));if(!(L!=null&&L.trim()))return;const V=M(p.current[D],L.trim());(async()=>{try{D==="local"?await Go.touch(V):await Ko.write(e,V,""),await _(D,p.current[D])}catch(te){o(te.message)}})()},onShowInFinder:D==="local"?L=>void Go.reveal(L).catch(V=>o(V.message)):void 0,onOpenTerminal:D==="remote"?()=>{const L=T.find(V=>V.type==="ssh-terminal"&&V.title===e);if(L)return j(L.id);A({id:`tab-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:"ssh-terminal",title:e,serverId:e})}:void 0});return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[n&&h.jsxs("div",{className:"flex items-center justify-between border-b border-destructive/30 bg-destructive-light px-4 py-2 text-sm",children:[h.jsx("span",{children:n}),h.jsx("button",{className:"text-xs underline",onClick:()=>o(null),children:k("dismiss")})]}),l&&h.jsxs("div",{className:"border-b border-border bg-muted px-4 py-1.5 text-xs text-muted-foreground",children:[l.direction==="upload"?k("Uploading"):k("Downloading")," — ",l.done," ",k("of")," ",l.total,l.file&&h.jsx("span",{className:"ml-2 font-mono",children:l.file})]}),h.jsx("div",{className:"min-h-0 flex-1",children:h.jsxs(hm,{defaultSizes:[1,1],children:[h.jsx(hm.Pane,{minSize:260,children:h.jsx(aw,{title:k("This machine"),...P("local"),onGoHome:()=>void _("local")})}),h.jsx(hm.Pane,{minSize:260,children:h.jsx(aw,{title:e,...P("remote"),onGoHome:()=>void _("remote","."),onGoRoot:()=>void _("remote","/")})})]})})]})}function Dh({command:e,size:t="default",className:i}){const[n,o]=w.useState(!1),l=t==="compact",u=async()=>{if(e)try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1500)}catch{}};return h.jsxs("div",{className:fe("flex items-start gap-2 bg-secondary",i),children:[h.jsx("pre",{className:fe("min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap break-all font-mono",l?"py-1 text-xs":"text-[14.5px] leading-relaxed"),children:e||k("(no command)")}),e&&h.jsx("button",{type:"button","aria-label":k(n?"Copied":"Copy the command"),title:k(n?"Copied":"Copy the command"),onClick:()=>void u(),className:fe("flex shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-card hover:text-foreground",l?"h-6 w-6":"h-8 w-8"),children:n?h.jsx(ua,{className:l?"h-3.5 w-3.5":"h-4 w-4"}):h.jsx(UC,{className:l?"h-3.5 w-3.5":"h-4 w-4"})})]})}function Xn({icon:e,title:t,hint:i,action:n}){return h.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center",children:[h.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-primary/10",children:h.jsx(e,{className:"h-7 w-7 text-primary"})}),h.jsx("p",{className:"text-sm font-medium",children:t}),i&&h.jsx("p",{className:"max-w-sm text-xs leading-relaxed text-muted-foreground",children:i}),n&&h.jsx("div",{className:"mt-1",children:n})]})}function G9(e){const t=Math.round(e/1e3);if(t<60)return`${t}s`;const i=Math.floor(t/60);return i<60?`${i}m ${t%60}s`:`${Math.floor(i/60)}h ${i%60}m`}const X9={readonly:"read only",restricted:"restricted",unrestricted:"unrestricted"};function Z9(){je();const e=Ue(u=>u.setView),{pending:t,drop:i}=y2(),[n,o]=w.useState(null),l=async(u,f)=>{o(u);try{await kt.decide(u,f),i(u)}finally{o(null)}};return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsx(io,{title:k("Waiting"),count:t.length,hint:k("An agent paused on these commands. Nothing runs until you decide.")}),t.length===0?h.jsx(Xn,{icon:bh,title:k("Nothing is waiting"),hint:k("Nothing pauses here until you ask it to. Open a server, set Approval to destructive or always, and its agent will stop and wait for you before acting."),action:h.jsxs(ve,{size:"sm",onClick:()=>e("servers"),children:[h.jsx(Zh,{className:"h-3.5 w-3.5"}),k("Set it up on a server")]})}):h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-8 pb-10 pt-6",children:h.jsx("div",{className:"flex max-w-5xl flex-col gap-4",children:t.map(u=>h.jsxs("article",{className:"overflow-hidden rounded-xl border border-border bg-card",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-border px-5 py-3.5",children:[h.jsx("h2",{className:"text-base font-bold",children:u.server}),h.jsxs("span",{className:"font-mono text-[12.5px] text-muted-foreground",children:[u.user,"@",u.host]}),h.jsx("span",{className:"inline-flex h-6 items-center rounded-md border border-border px-2 font-mono text-xs text-muted-foreground",children:u.tool}),u.mode!=="unrestricted"&&h.jsx("span",{className:"inline-flex h-6 items-center rounded-md bg-secondary px-2 text-xs text-secondary-foreground",children:k(X9[u.mode])}),h.jsxs("span",{className:"ml-auto inline-flex items-center gap-1.5 text-[13px] text-muted-foreground tabular-nums",children:[h.jsx(bh,{className:"h-3.5 w-3.5","aria-hidden":"true"}),k("waiting")," ",G9(u.waitingMs)]})]}),u.destructive&&h.jsxs("div",{className:"flex items-start gap-2.5 bg-destructive-light px-5 py-3 text-sm text-destructive",children:[h.jsx(xh,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),h.jsxs("p",{children:[h.jsx("b",{children:k("Destructive.")})," ",k("This command can delete or overwrite data, and nothing on the server will undo it.")]})]}),h.jsx("div",{className:"px-5 py-4",children:h.jsx(Dh,{command:u.command,className:"rounded-lg border border-border py-3 pl-4 pr-2"})}),h.jsxs("div",{className:"flex flex-wrap justify-end gap-2.5 px-5 pb-4",children:[h.jsxs(ve,{variant:"outline",className:"h-11 px-5 font-bold",disabled:n===u.id,onClick:()=>void l(u.id,!1),children:[h.jsx(br,{className:"h-4 w-4"}),k("Refuse")]}),h.jsxs(ve,{variant:u.destructive?"destructive":"default",className:fe("h-11 px-5 font-bold"),disabled:n===u.id,onClick:()=>void l(u.id,!0),children:[h.jsx(ua,{className:"h-4 w-4"}),u.destructive?k("Approve and run"):k("Approve")]})]})]},u.id))})})]})}const Zl=new Map;let ta=typeof Notification>"u"?"unsupported":Notification.permission;async function Ek(){if(new URLSearchParams(window.location.search).has("shell")||ta==="unsupported")return!1;if(ta==="granted")return!0;if(ta==="denied")return!1;try{return ta=await Notification.requestPermission(),ta==="granted"}catch{return!1}}function Q9(e,t){var o;if(ta!=="granted"||Zl.has(e.id))return;const i=((o=e.command)==null?void 0:o.trim())??"",n=i.length>140?`${i.slice(0,137)}…`:i||e.tool;try{const l=new Notification(e.destructive?`${e.server}: destructive command waiting`:`${e.server}: waiting for you`,{body:n,tag:e.id,requireInteraction:e.destructive,silent:!e.destructive});l.onclick=()=>{window.focus(),t(),l.close()},Zl.set(e.id,l)}catch{}}function Nk(e){const t=Zl.get(e);if(t){try{t.close()}catch{}Zl.delete(e)}}function J9(){for(const e of[...Zl.keys()])Nk(e)}function eU(e,t){return e>=t+10?"over":e>=t?"near":"ok"}const tU={over:"bg-destructive",near:"bg-warning",ok:"bg-meter"},sU={over:"text-destructive",near:"text-warning",ok:""};function cw(e,t){if(t==="en")return e.message;const i={value:e.value,threshold:e.threshold,mount:e.mount??"/"};return e.type==="disk"?k("Disk {{mount}}: {{value}}% used (threshold {{threshold}}%)",i):e.type==="memory"?k("Memory: {{value}}% used (threshold {{threshold}}%)",i):e.type==="cpu"?k("CPU: {{value}}% used (threshold {{threshold}}%)",i):e.message}function fm({label:e,percent:t,detail:i,threshold:n,mono:o}){if(je(),t===void 0)return null;const l=Math.max(0,Math.min(100,Math.round(t))),u=eU(l,n);return h.jsxs("div",{className:"health-gauge grid min-w-0 grid-cols-[minmax(0,1fr)] gap-1.5",children:[h.jsxs("div",{className:fe("grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-baseline gap-3 text-[13px]",sU[u]),children:[h.jsx("span",{className:fe("min-w-0 [overflow-wrap:anywhere]",o&&"font-mono",u!=="ok"&&"font-bold"),children:e}),h.jsxs("span",{className:"font-bold tabular-nums",children:[l,"%"]})]}),h.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-sunk",children:h.jsx("div",{className:fe("h-full rounded-full transition-[width]",tU[u]),style:{width:`${l}%`}})}),i&&h.jsxs("p",{className:"min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]",children:[i,u!=="ok"&&k(" · over the {{v0}}% threshold",{v0:n})]})]})}function iU(){const e=je(),[t,i]=w.useState(null),[n,o]=w.useState(!1),[l,u]=w.useState({cpu:80,memory:90,disk:85,enabled:!0});w.useEffect(()=>{Hm.get().then(v=>u(v.thresholds)).catch(()=>{})},[]);const f=async v=>{o(!0);try{const b=await EB.check(v);i(y=>v&&y?y.map(S=>b.results.find(E=>E.server===S.server)??S):b.results);const x=b.results.filter(y=>{var S;return(((S=y.alerts)==null?void 0:S.length)??0)>0});if(x.length>0&&await Ek())for(const y of x)new Notification(k("{{server}}: {{type}} over threshold",{server:y.server,type:k(y.alerts[0].type)}),{body:y.alerts.map(S=>cw(S,e)).join(`
|
|
514
|
+
*/var om,FS,VS,f9=($S||($S=1,om=US,(function(){var e={}.hasOwnProperty;function t(){for(var o="",l=0;l<arguments.length;l++){var u=arguments[l];u&&(o=n(o,i(u)))}return o}function i(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return t.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var l="";for(var u in o)e.call(o,u)&&o[u]&&(l=n(l,u));return l}function n(o,l){return l?o?o+" "+l:o+l:o}om.exports?(t.default=t,om.exports=t):window.classNames=t})()),US.exports),Dg=dc(f9),qS,YS,p9=(VS||(VS=1,FS=function e(t,i){if(t===i)return!0;if(t&&i&&typeof t=="object"&&typeof i=="object"){if(t.constructor!==i.constructor)return!1;var n,o,l;if(Array.isArray(t)){if((n=t.length)!=i.length)return!1;for(o=n;o--!==0;)if(!e(t[o],i[o]))return!1;return!0}if(t instanceof Map&&i instanceof Map){if(t.size!==i.size)return!1;for(o of t.entries())if(!i.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],i.get(o[0])))return!1;return!0}if(t instanceof Set&&i instanceof Set){if(t.size!==i.size)return!1;for(o of t.entries())if(!i.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(i)){if((n=t.length)!=i.length)return!1;for(o=n;o--!==0;)if(t[o]!==i[o])return!1;return!0}if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===i.toString();if((n=(l=Object.keys(t)).length)!==Object.keys(i).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(i,l[o]))return!1;for(o=n;o--!==0;){var u=l[o];if(!e(t[u],i[u]))return!1}return!0}return t!=t&&i!=i}),FS),m9=dc(p9),WS,KS,fi=dc((function(){if(YS)return qS;YS=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,n=/^0o[0-7]+$/i,o=parseInt,l=Object.prototype.toString;function u(p){var d=typeof p;return!!p&&(d=="object"||d=="function")}function f(p){if(typeof p=="number")return p;if((function(v){return typeof v=="symbol"||(function(b){return!!b&&typeof b=="object"})(v)&&l.call(v)=="[object Symbol]"})(p))return NaN;if(u(p)){var d=typeof p.valueOf=="function"?p.valueOf():p;p=u(d)?d+"":d}if(typeof p!="string")return p===0?p:+p;p=p.replace(e,"");var _=i.test(p);return _||n.test(p)?o(p.slice(2),_?2:8):t.test(p)?NaN:+p}return qS=function(p,d,_){return _===void 0&&(_=d,d=void 0),_!==void 0&&(_=(_=f(_))==_?_:0),d!==void 0&&(d=(d=f(d))==d?d:0),(function(v,b,x){return v==v&&(x!==void 0&&(v=v<=x?v:x),b!==void 0&&(v=v>=b?v:b)),v})(f(p),d,_)}})()),g9=dc((function(){if(KS)return WS;KS=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,n=/^0o[0-7]+$/i,o=parseInt,l=typeof Wu=="object"&&Wu&&Wu.Object===Object&&Wu,u=typeof self=="object"&&self&&self.Object===Object&&self,f=l||u||Function("return this")(),p=Object.prototype.toString,d=Math.max,_=Math.min,v=function(){return f.Date.now()};function b(y){var S=typeof y;return!!y&&(S=="object"||S=="function")}function x(y){if(typeof y=="number")return y;if((function(N){return typeof N=="symbol"||(function(T){return!!T&&typeof T=="object"})(N)&&p.call(N)=="[object Symbol]"})(y))return NaN;if(b(y)){var S=typeof y.valueOf=="function"?y.valueOf():y;y=b(S)?S+"":S}if(typeof y!="string")return y===0?y:+y;y=y.replace(e,"");var E=i.test(y);return E||n.test(y)?o(y.slice(2),E?2:8):t.test(y)?NaN:+y}return WS=function(y,S,E){var N,T,A,j,M,P,D=0,L=!1,V=!1,te=!0;if(typeof y!="function")throw new TypeError("Expected a function");function U(O){var $=N,F=T;return N=T=void 0,D=O,j=y.apply(F,$)}function H(O){var $=O-P;return P===void 0||$>=S||$<0||V&&O-D>=A}function B(){var O=v();if(H(O))return W(O);M=setTimeout(B,(function($){var F=S-($-P);return V?_(F,A-($-D)):F})(O))}function W(O){return M=void 0,te&&N?U(O):(N=T=void 0,j)}function K(){var O=v(),$=H(O);if(N=arguments,T=this,P=O,$){if(M===void 0)return(function(F){return D=F,M=setTimeout(B,S),L?U(F):j})(P);if(V)return M=setTimeout(B,S),U(P)}return M===void 0&&(M=setTimeout(B,S)),j}return S=x(S)||0,b(E)&&(L=!!E.leading,A=(V="maxWait"in E)?d(x(E.maxWait)||0,S):A,te="trailing"in E?!!E.trailing:te),K.cancel=function(){M!==void 0&&clearTimeout(M),D=0,N=P=T=M=void 0},K.flush=function(){return M===void 0?j:W(v())},K}})()),GS={width:void 0,height:void 0};function v9(e){const{ref:t,box:i="content-box"}=e,[{width:n,height:o},l]=w.useState(GS),u=(function(){const d=w.useRef(!1);return w.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]),w.useCallback(()=>d.current,[])})(),f=w.useRef(ca({},GS)),p=w.useRef(void 0);return p.current=e.onResize,w.useEffect(()=>{if(!t.current||typeof window>"u"||!("ResizeObserver"in window))return;const d=new ResizeObserver(([_])=>{const v=i==="border-box"?"borderBoxSize":i==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",b=XS(_,v,"inlineSize"),x=XS(_,v,"blockSize");if(f.current.width!==b||f.current.height!==x){const y={width:b,height:x};f.current.width=b,f.current.height=x,p.current?p.current(y):u()&&l(y)}});return d.observe(t.current,{box:i}),()=>{d.disconnect()}},[i,t,u]),{width:n,height:o}}function XS(e,t,i){return e[t]?Array.isArray(e[t])?e[t][0][i]:e[t][i]:t==="contentBoxSize"?e.contentRect[i==="inlineSize"?"width":"height"]:void 0}var _9="allotment-module_splitView__L-yRc",y9="allotment-module_sashContainer__fzwJF",b9="allotment-module_splitViewContainer__rQnVa",fk="allotment-module_splitViewView__MGZ6O",x9="allotment-module_vertical__WSwwa",S9="allotment-module_horizontal__7doS8",w9="allotment-module_separatorBorder__x-rDS";let Rl,pk=!1,mk=!1;typeof navigator=="object"&&(Rl=navigator.userAgent,mk=Rl.indexOf("Macintosh")>=0,pk=(Rl.indexOf("Macintosh")>=0||Rl.indexOf("iPad")>=0||Rl.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0);const gk=pk,C9=mk,ZS=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;class k9{constructor(){this._size=void 0}getSize(){return this._size}setSize(t){this._size=t}}function Ku(e,t){const i=e.length,n=i-t.length;return n>=0&&e.slice(n,i)===t}var QS,JS={exports:{}},E9=(QS||(QS=1,(function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function o(p,d,_){this.fn=p,this.context=d,this.once=_||!1}function l(p,d,_,v,b){if(typeof _!="function")throw new TypeError("The listener must be a function");var x=new o(_,v||p,b),y=i?i+d:d;return p._events[y]?p._events[y].fn?p._events[y]=[p._events[y],x]:p._events[y].push(x):(p._events[y]=x,p._eventsCount++),p}function u(p,d){--p._eventsCount===0?p._events=new n:delete p._events[d]}function f(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(i=!1)),f.prototype.eventNames=function(){var p,d,_=[];if(this._eventsCount===0)return _;for(d in p=this._events)t.call(p,d)&&_.push(i?d.slice(1):d);return Object.getOwnPropertySymbols?_.concat(Object.getOwnPropertySymbols(p)):_},f.prototype.listeners=function(p){var d=i?i+p:p,_=this._events[d];if(!_)return[];if(_.fn)return[_.fn];for(var v=0,b=_.length,x=new Array(b);v<b;v++)x[v]=_[v].fn;return x},f.prototype.listenerCount=function(p){var d=i?i+p:p,_=this._events[d];return _?_.fn?1:_.length:0},f.prototype.emit=function(p,d,_,v,b,x){var y=i?i+p:p;if(!this._events[y])return!1;var S,E,N=this._events[y],T=arguments.length;if(N.fn){switch(N.once&&this.removeListener(p,N.fn,void 0,!0),T){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,d),!0;case 3:return N.fn.call(N.context,d,_),!0;case 4:return N.fn.call(N.context,d,_,v),!0;case 5:return N.fn.call(N.context,d,_,v,b),!0;case 6:return N.fn.call(N.context,d,_,v,b,x),!0}for(E=1,S=new Array(T-1);E<T;E++)S[E-1]=arguments[E];N.fn.apply(N.context,S)}else{var A,j=N.length;for(E=0;E<j;E++)switch(N[E].once&&this.removeListener(p,N[E].fn,void 0,!0),T){case 1:N[E].fn.call(N[E].context);break;case 2:N[E].fn.call(N[E].context,d);break;case 3:N[E].fn.call(N[E].context,d,_);break;case 4:N[E].fn.call(N[E].context,d,_,v);break;default:if(!S)for(A=1,S=new Array(T-1);A<T;A++)S[A-1]=arguments[A];N[E].fn.apply(N[E].context,S)}}return!0},f.prototype.on=function(p,d,_){return l(this,p,d,_,!1)},f.prototype.once=function(p,d,_){return l(this,p,d,_,!0)},f.prototype.removeListener=function(p,d,_,v){var b=i?i+p:p;if(!this._events[b])return this;if(!d)return u(this,b),this;var x=this._events[b];if(x.fn)x.fn!==d||v&&!x.once||_&&x.context!==_||u(this,b);else{for(var y=0,S=[],E=x.length;y<E;y++)(x[y].fn!==d||v&&!x[y].once||_&&x[y].context!==_)&&S.push(x[y]);S.length?this._events[b]=S.length===1?S[0]:S:u(this,b)}return this},f.prototype.removeAllListeners=function(p){var d;return p?(d=i?i+p:p,this._events[d]&&u(this,d)):(this._events=new n,this._eventsCount=0),this},f.prototype.off=f.prototype.removeListener,f.prototype.addListener=f.prototype.on,f.prefixed=i,f.EventEmitter=f,e.exports=f})(JS)),JS.exports),Cv=dc(E9);function ew(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.unshift(t))}function am(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))}function Js(e,t,i=1){const n=Math.max(0,Math.ceil((t-e)/i)),o=new Array(n);let l=-1;for(;++l<n;)o[l]=e+l*i;return o}var N9="sash-module_sash__K-9lB",R9="sash-module_disabled__Hm-wx",A9="sash-module_mac__Jf6OJ",tw="sash-module_vertical__pB-rs",D9="sash-module_minimum__-UKxp",T9="sash-module_maximum__TCWxD",sw="sash-module_horizontal__kFbiw",lm="sash-module_hover__80W6I",cm="sash-module_active__bJspD";let ii=(function(e){return e.Vertical="VERTICAL",e.Horizontal="HORIZONTAL",e})({}),Ps=(function(e){return e.Disabled="DISABLED",e.Minimum="MINIMUM",e.Maximum="MAXIMUM",e.Enabled="ENABLED",e})({}),vk=gk?20:8;const _k=new Cv;class iw extends Cv{get state(){return this._state}set state(t){this._state!==t&&(this.el.classList.toggle(R9,t===Ps.Disabled),this.el.classList.toggle("sash-disabled",t===Ps.Disabled),this.el.classList.toggle(D9,t===Ps.Minimum),this.el.classList.toggle("sash-minimum",t===Ps.Minimum),this.el.classList.toggle(T9,t===Ps.Maximum),this.el.classList.toggle("sash-maximum",t===Ps.Maximum),this._state=t,this.emit("enablementChange",t))}constructor(t,i,n){var o;super(),this.el=void 0,this.layoutProvider=void 0,this.orientation=void 0,this.size=void 0,this.hoverDelay=300,this.hoverDelayer=g9(l=>l.classList.add("sash-hover",lm),this.hoverDelay),this._state=Ps.Enabled,this.onPointerStart=l=>{const u=l.pageX,f=l.pageY,p={startX:u,currentX:u,startY:f,currentY:f};this.el.classList.add("sash-active",cm),this.emit("start",p),this.el.setPointerCapture(l.pointerId);const d=v=>{v.preventDefault();const b={startX:u,currentX:v.pageX,startY:f,currentY:v.pageY};this.emit("change",b)},_=v=>{v.preventDefault(),this.el.classList.remove("sash-active",cm),this.hoverDelayer.cancel(),this.emit("end"),this.el.releasePointerCapture(v.pointerId),window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",_)};window.addEventListener("pointermove",d),window.addEventListener("pointerup",_)},this.onPointerDoublePress=()=>{this.emit("reset")},this.onMouseEnter=()=>{this.el.classList.contains(cm)?(this.hoverDelayer.cancel(),this.el.classList.add("sash-hover",lm)):this.hoverDelayer(this.el)},this.onMouseLeave=()=>{this.hoverDelayer.cancel(),this.el.classList.remove("sash-hover",lm)},this.el=document.createElement("div"),this.el.classList.add("sash",N9),this.el.dataset.testid="sash",t.append(this.el),C9&&this.el.classList.add("sash-mac",A9),this.el.addEventListener("pointerdown",this.onPointerStart),this.el.addEventListener("dblclick",this.onPointerDoublePress),this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("mouseleave",this.onMouseLeave),typeof n.size=="number"?(this.size=n.size,n.orientation===ii.Vertical?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=vk,_k.on("onDidChangeGlobalSize",l=>{this.size=l,this.layout()})),this.layoutProvider=i,this.orientation=(o=n.orientation)!=null?o:ii.Vertical,this.orientation===ii.Horizontal?(this.el.classList.add("sash-horizontal",sw),this.el.classList.remove("sash-vertical",tw)):(this.el.classList.remove("sash-horizontal",sw),this.el.classList.add("sash-vertical",tw)),this.layout()}layout(){if(this.orientation===ii.Vertical){const t=this.layoutProvider;this.el.style.left=t.getVerticalSashLeft(this)-this.size/2+"px",t.getVerticalSashTop&&(this.el.style.top=t.getVerticalSashTop(this)+"px"),t.getVerticalSashHeight&&(this.el.style.height=t.getVerticalSashHeight(this)+"px")}else{const t=this.layoutProvider;this.el.style.top=t.getHorizontalSashTop(this)-this.size/2+"px",t.getHorizontalSashLeft&&(this.el.style.left=t.getHorizontalSashLeft(this)+"px"),t.getHorizontalSashWidth&&(this.el.style.width=t.getHorizontalSashWidth(this)+"px")}}dispose(){this.el.removeEventListener("pointerdown",this.onPointerStart),this.el.removeEventListener("dblclick",this.onPointerDoublePress),this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("mouseleave",()=>this.onMouseLeave),this.el.remove()}}let Ah;var um;(um=Ah||(Ah={})).Distribute={type:"distribute"},um.Split=function(e){return{type:"split",index:e}},um.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}};let ti=(function(e){return e.Normal="NORMAL",e.Low="LOW",e.High="HIGH",e})({});class yk{constructor(t,i,n){this.container=void 0,this.view=void 0,this._size=void 0,this._cachedVisibleSize=void 0,this.container=t,this.view=i,this.container.classList.add("split-view-view",fk),this.container.dataset.testid="split-view-view",typeof n=="number"?(this._size=n,this._cachedVisibleSize=void 0,t.classList.add("split-view-view-visible")):(this._size=0,this._cachedVisibleSize=n.cachedVisibleSize)}set size(t){this._size=t}get size(){return this._size}get priority(){return this.view.priority}get snap(){return!!this.view.snap}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return this._cachedVisibleSize===void 0}setVisible(t,i){t!==this.visible&&(t?(this.size=fi(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof i=="number"?i:this.size,this.size=0),this.container.classList.toggle("split-view-view-visible",t),this.view.setVisible&&this.view.setVisible(t))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}set enabled(t){this.container.style.pointerEvents=t?"":"none"}layout(t){this.layoutContainer(t),this.view.layout(this.size,t)}}class j9 extends yk{layoutContainer(t){this.container.style.left=`${t}px`,this.container.style.width=`${this.size}px`}}class M9 extends yk{layoutContainer(t){this.container.style.top=`${t}px`,this.container.style.height=`${this.size}px`}}class O9 extends Cv{get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(t){this._startSnappingEnabled!==t&&(this._startSnappingEnabled=t,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(t){this._endSnappingEnabled!==t&&(this._endSnappingEnabled=t,this.updateSashEnablement())}constructor(t,i={},n,o,l){var u,f;if(super(),this.onDidChange=void 0,this.onDidDragStart=void 0,this.onDidDragEnd=void 0,this.orientation=void 0,this.sashContainer=void 0,this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.sashDragState=void 0,this.proportionalLayout=void 0,this.getSashOrthogonalSize=void 0,this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onSashEnd=p=>{this.emit("sashchange",p),this.saveProportions();for(const d of this.viewItems)d.enabled=!0},this.orientation=(u=i.orientation)!=null?u:ii.Vertical,this.proportionalLayout=(f=i.proportionalLayout)!=null?f:!0,this.getSashOrthogonalSize=i.getSashOrthogonalSize,n&&(this.onDidChange=n),o&&(this.onDidDragStart=o),l&&(this.onDidDragEnd=l),this.sashContainer=document.createElement("div"),this.sashContainer.classList.add("sash-container",y9),t.prepend(this.sashContainer),i.descriptor){this.size=i.descriptor.size;for(const[p,d]of i.descriptor.views.entries()){const _=d.size,v=d.container,b=d.view;this.addView(v,b,_,p,!0)}this.contentSize=this.viewItems.reduce((p,d)=>p+d.size,0),this.saveProportions()}}addView(t,i,n,o=this.viewItems.length,l){let u;u=typeof n=="number"?n:n.type==="split"?this.getViewSize(n.index)/2:n.type==="invisible"?{cachedVisibleSize:n.cachedVisibleSize}:i.minimumSize;const f=this.orientation===ii.Vertical?new M9(t,i,u):new j9(t,i,u);if(this.viewItems.splice(o,0,f),this.viewItems.length>1){const p=this.orientation===ii.Vertical?new iw(this.sashContainer,{getHorizontalSashTop:v=>this.getSashPosition(v),getHorizontalSashWidth:this.getSashOrthogonalSize},{orientation:ii.Horizontal}):new iw(this.sashContainer,{getVerticalSashLeft:v=>this.getSashPosition(v),getVerticalSashHeight:this.getSashOrthogonalSize},{orientation:ii.Vertical}),d=this.orientation===ii.Vertical?v=>({sash:p,start:v.startY,current:v.currentY}):v=>({sash:p,start:v.startX,current:v.currentX});p.on("start",v=>{var b;this.emit("sashDragStart"),this.onSashStart(d(v));const x=this.viewItems.map(y=>y.size);(b=this.onDidDragStart)==null||b.call(this,x)}),p.on("change",v=>this.onSashChange(d(v))),p.on("end",()=>{var v;this.emit("sashDragEnd"),this.onSashEnd(this.sashItems.findIndex(x=>x.sash===p));const b=this.viewItems.map(x=>x.size);(v=this.onDidDragEnd)==null||v.call(this,b)}),p.on("reset",()=>{const v=this.sashItems.findIndex(E=>E.sash===p),b=Js(v,-1,-1),x=Js(v+1,this.viewItems.length),y=this.findFirstSnapIndex(b),S=this.findFirstSnapIndex(x);(typeof y!="number"||this.viewItems[y].visible)&&(typeof S!="number"||this.viewItems[S].visible)&&this.emit("sashreset",v)});const _={sash:p};this.sashItems.splice(o-1,0,_)}l||this.relayout(),l||typeof n=="number"||n.type!=="distribute"||this.distributeViewSizes()}removeView(t,i){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");const n=this.viewItems.splice(t,1)[0].view;if(this.viewItems.length>=1){const o=Math.max(t-1,0);this.sashItems.splice(o,1)[0].sash.dispose()}return this.relayout(),i&&i.type==="distribute"&&this.distributeViewSizes(),n}moveView(t,i,n){const o=this.getViewCachedVisibleSize(i),l=o===void 0?this.getViewSize(i):Ah.Invisible(o),u=this.removeView(i);this.addView(t,u,l,n)}getViewCachedVisibleSize(t){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[t].cachedVisibleSize}layout(t=this.size){const i=Math.max(this.size,this.contentSize);if(this.size=t,this.proportions)for(let n=0;n<this.viewItems.length;n++){const o=this.viewItems[n];o.size=fi(Math.round(this.proportions[n]*t),o.minimumSize,o.maximumSize)}else{const n=Js(0,this.viewItems.length),o=n.filter(u=>this.viewItems[u].priority===ti.Low),l=n.filter(u=>this.viewItems[u].priority===ti.High);this.resize(this.viewItems.length-1,t-i,void 0,o,l)}this.distributeEmptySpace(),this.layoutViews()}resizeView(t,i){if(t<0||t>=this.viewItems.length)return;const n=Js(0,this.viewItems.length).filter(f=>f!==t),o=[...n.filter(f=>this.viewItems[f].priority===ti.Low),t],l=n.filter(f=>this.viewItems[f].priority===ti.High),u=this.viewItems[t];i=Math.round(i),i=fi(i,u.minimumSize,Math.min(u.maximumSize,this.size)),u.size=i,this.relayout(o,l)}resizeViews(t){for(let i=0;i<t.length;i++){const n=this.viewItems[i];let o=t[i];o=Math.round(o),o=fi(o,n.minimumSize,Math.min(n.maximumSize,this.size)),n.size=o}this.contentSize=this.viewItems.reduce((i,n)=>i+n.size,0),this.saveProportions(),this.layout(this.size)}getViewSize(t){return t<0||t>=this.viewItems.length?-1:this.viewItems[t].size}isViewVisible(t){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[t].visible}setViewVisible(t,i){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");this.viewItems[t].setVisible(i),this.distributeEmptySpace(t),this.layoutViews(),this.saveProportions()}distributeViewSizes(){const t=[];let i=0;for(const f of this.viewItems)f.maximumSize-f.minimumSize>0&&(t.push(f),i+=f.size);const n=Math.floor(i/t.length);for(const f of t)f.size=fi(n,f.minimumSize,f.maximumSize);const o=Js(0,this.viewItems.length),l=o.filter(f=>this.viewItems[f].priority===ti.Low),u=o.filter(f=>this.viewItems[f].priority===ti.High);this.relayout(l,u)}dispose(){this.sashItems.forEach(t=>t.sash.dispose()),this.sashItems=[],this.sashContainer.remove()}relayout(t,i){const n=this.viewItems.reduce((o,l)=>o+l.size,0);this.resize(this.viewItems.length-1,this.size-n,void 0,t,i),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}onSashStart({sash:t,start:i}){const n=this.sashItems.findIndex(o=>o.sash===t);(o=>{const l=this.viewItems.map(T=>T.size);let u,f,p=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY;const _=Js(n,-1,-1),v=Js(n+1,this.viewItems.length),b=_.reduce((T,A)=>T+(this.viewItems[A].minimumSize-l[A]),0),x=_.reduce((T,A)=>T+(this.viewItems[A].viewMaximumSize-l[A]),0),y=v.length===0?Number.POSITIVE_INFINITY:v.reduce((T,A)=>T+(l[A]-this.viewItems[A].minimumSize),0),S=v.length===0?Number.NEGATIVE_INFINITY:v.reduce((T,A)=>T+(l[A]-this.viewItems[A].viewMaximumSize),0);p=Math.max(b,S),d=Math.min(y,x);const E=this.findFirstSnapIndex(_),N=this.findFirstSnapIndex(v);if(typeof E=="number"){const T=this.viewItems[E],A=Math.floor(T.viewMinimumSize/2);u={index:E,limitDelta:T.visible?p-A:p+A,size:T.size}}if(typeof N=="number"){const T=this.viewItems[N],A=Math.floor(T.viewMinimumSize/2);f={index:N,limitDelta:T.visible?d+A:d-A,size:T.size}}this.sashDragState={start:o,current:o,index:n,sizes:l,minDelta:p,maxDelta:d,snapBefore:u,snapAfter:f}})(i)}onSashChange({current:t}){const{index:i,start:n,sizes:o,minDelta:l,maxDelta:u,snapBefore:f,snapAfter:p}=this.sashDragState;this.sashDragState.current=t;const d=t-n;this.resize(i,d,o,void 0,void 0,l,u,f,p),this.distributeEmptySpace(),this.layoutViews()}getSashPosition(t){let i=0;for(let n=0;n<this.sashItems.length;n++)if(i+=this.viewItems[n].size,this.sashItems[n].sash===t)return i;return 0}resize(t,i,n=this.viewItems.map(_=>_.size),o,l,u=Number.NEGATIVE_INFINITY,f=Number.POSITIVE_INFINITY,p,d){if(t<0||t>=this.viewItems.length)return 0;const _=Js(t,-1,-1),v=Js(t+1,this.viewItems.length);if(l)for(const D of l)ew(_,D),ew(v,D);if(o)for(const D of o)am(_,D),am(v,D);const b=_.map(D=>this.viewItems[D]),x=_.map(D=>n[D]),y=v.map(D=>this.viewItems[D]),S=v.map(D=>n[D]),E=_.reduce((D,L)=>D+(this.viewItems[L].minimumSize-n[L]),0),N=_.reduce((D,L)=>D+(this.viewItems[L].maximumSize-n[L]),0),T=v.length===0?Number.POSITIVE_INFINITY:v.reduce((D,L)=>D+(n[L]-this.viewItems[L].minimumSize),0),A=v.length===0?Number.NEGATIVE_INFINITY:v.reduce((D,L)=>D+(n[L]-this.viewItems[L].maximumSize),0),j=Math.max(E,A,u),M=Math.min(T,N,f);let P=!1;if(p){const D=this.viewItems[p.index],L=i>=p.limitDelta;P=L!==D.visible,D.setVisible(L,p.size)}if(!P&&d){const D=this.viewItems[d.index],L=i<d.limitDelta;P=L!==D.visible,D.setVisible(L,d.size)}if(P)return this.resize(t,i,n,o,l,u,f);for(let D=0,L=i=fi(i,j,M);D<b.length;D++){const V=b[D],te=fi(x[D]+L,V.minimumSize,V.maximumSize);L-=te-x[D],V.size=te}for(let D=0,L=i;D<y.length;D++){const V=y[D],te=fi(S[D]-L,V.minimumSize,V.maximumSize);L+=te-S[D],V.size=te}return i}distributeEmptySpace(t){const i=this.viewItems.reduce((d,_)=>d+_.size,0);let n=this.size-i;const o=Js(0,this.viewItems.length),l=[],u=o.filter(d=>this.viewItems[d].priority===ti.Low),f=o.filter(d=>this.viewItems[d].priority===ti.Normal),p=o.filter(d=>this.viewItems[d].priority===ti.High);l.push(...p,...f,...u),typeof t=="number"&&am(l,t);for(let d=0;n!==0&&d<l.length;d++){const _=this.viewItems[l[d]],v=fi(_.size+n,_.minimumSize,_.maximumSize);n-=v-_.size,_.size=v}}layoutViews(){var t;this.contentSize=this.viewItems.reduce((n,o)=>n+o.size,0);let i=0;for(const n of this.viewItems)n.layout(i),i+=n.size;(t=this.onDidChange)!=null&&t.call(this,this.viewItems.map(n=>n.size)),this.sashItems.forEach(n=>n.sash.layout()),this.updateSashEnablement()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(t=>t.size/this.contentSize))}updateSashEnablement(){let t=!1;const i=this.viewItems.map(p=>t=p.size-p.minimumSize>0||t);t=!1;const n=this.viewItems.map(p=>t=p.maximumSize-p.size>0||t),o=[...this.viewItems].reverse();t=!1;const l=o.map(p=>t=p.size-p.minimumSize>0||t).reverse();t=!1;const u=o.map(p=>t=p.maximumSize-p.size>0||t).reverse();let f=0;for(let p=0;p<this.sashItems.length;p++){const{sash:d}=this.sashItems[p];f+=this.viewItems[p].size;const _=!(i[p]&&u[p+1]),v=!(n[p]&&l[p+1]);if(_&&v){const b=Js(p,-1,-1),x=Js(p+1,this.viewItems.length),y=this.findFirstSnapIndex(b),S=this.findFirstSnapIndex(x),E=typeof y=="number"&&!this.viewItems[y].visible,N=typeof S=="number"&&!this.viewItems[S].visible;E&&l[p]&&(f>0||this.startSnappingEnabled)?d.state=Ps.Minimum:N&&i[p]&&(f<this.contentSize||this.endSnappingEnabled)?d.state=Ps.Maximum:d.state=Ps.Disabled}else d.state=_&&!v?Ps.Minimum:!_&&v?Ps.Maximum:Ps.Enabled}}findFirstSnapIndex(t){for(const i of t){const n=this.viewItems[i];if(n.visible&&n.snap)return i}for(const i of t){const n=this.viewItems[i];if(n.visible&&n.maximumSize-n.minimumSize>0)return;if(!n.visible&&n.snap)return i}}}class Qo{constructor(t){this.size=void 0,this.size=t}getPreferredSize(){return this.size}}class rw{constructor(t,i){this.proportion=void 0,this.layoutService=void 0,this.proportion=t,this.layoutService=i}getPreferredSize(){return this.proportion*this.layoutService.getSize()}}class Gu{getPreferredSize(){}}class nw{get preferredSize(){return this.layoutStrategy.getPreferredSize()}set preferredSize(t){if(typeof t=="number")this.layoutStrategy=new Qo(t);else if(typeof t=="string"){const i=t.trim();if(Ku(i,"%")){const n=Number(i.slice(0,-1))/100;this.layoutStrategy=new rw(n,this.layoutService)}else if(Ku(i,"px")){const n=Number(i.slice(0,-2))/100;this.layoutStrategy=new Qo(n)}else if(typeof Number.parseFloat(i)=="number"){const n=Number.parseFloat(i);this.layoutStrategy=new Qo(n)}else this.layoutStrategy=new Gu}else this.layoutStrategy=new Gu}constructor(t,i){var n;if(this.minimumSize=0,this.maximumSize=Number.POSITIVE_INFINITY,this.element=void 0,this.priority=void 0,this.snap=void 0,this.layoutService=void 0,this.layoutStrategy=void 0,this.layoutService=t,this.element=i.element,this.minimumSize=typeof i.minimumSize=="number"?i.minimumSize:30,this.maximumSize=typeof i.maximumSize=="number"?i.maximumSize:Number.POSITIVE_INFINITY,typeof i.preferredSize=="number")this.layoutStrategy=new Qo(i.preferredSize);else if(typeof i.preferredSize=="string"){const o=i.preferredSize.trim();if(Ku(o,"%")){const l=Number(o.slice(0,-1))/100;this.layoutStrategy=new rw(l,this.layoutService)}else if(Ku(o,"px")){const l=Number(o.slice(0,-2));this.layoutStrategy=new Qo(l)}else if(typeof Number.parseFloat(o)=="number"){const l=Number.parseFloat(o);this.layoutStrategy=new Qo(l)}else this.layoutStrategy=new Gu}else this.layoutStrategy=new Gu;this.priority=(n=i.priority)!=null?n:ti.Normal,this.snap=typeof i.snap=="boolean"&&i.snap}layout(t){}}function ow(e){return e.minSize!==void 0||e.maxSize!==void 0||e.preferredSize!==void 0||e.priority!==void 0||e.visible!==void 0}const kv=w.forwardRef(({className:e,children:t},i)=>ds.createElement("div",{ref:i,className:Dg("split-view-view",fk,e)},t));kv.displayName="Allotment.Pane";const bk=w.forwardRef(({children:e,className:t,id:i,maxSize:n=1/0,minSize:o=30,proportionalLayout:l=!0,separator:u=!0,sizes:f,defaultSizes:p=f,snap:d=!1,vertical:_=!1,onChange:v,onReset:b,onVisibleChange:x,onDragStart:y,onDragEnd:S},E)=>{const N=w.useRef(null),T=w.useRef([]),A=w.useRef(new Map),j=w.useRef(null),M=w.useRef(new Map),P=w.useRef(new k9),D=w.useRef([]),[L,V]=w.useState(!1),te=w.useMemo(()=>ds.Children.toArray(e).filter(ds.isValidElement),[e]),U=w.useCallback(H=>{var B,W;const K=(B=D.current)==null?void 0:B[H];return typeof(K==null?void 0:K.preferredSize)=="number"&&((W=j.current)!=null&&W.resizeView(H,Math.round(K.preferredSize)),!0)},[]);return w.useImperativeHandle(E,()=>({reset:()=>{if(b)b();else{var H;(H=j.current)==null||H.distributeViewSizes();for(let B=0;B<D.current.length;B++)U(B)}},resize:H=>{var B;(B=j.current)==null||B.resizeViews(H)}})),ZS(()=>{let H=!0;p&&M.current.size!==p.length&&(H=!1,console.warn(`Expected ${p.length} children based on defaultSizes but found ${M.current.size}`)),H&&p&&(T.current=te.map(K=>K.key));const B=ca({orientation:_?ii.Vertical:ii.Horizontal,proportionalLayout:l},H&&p&&{descriptor:{size:p.reduce((K,O)=>K+O,0),views:p.map((K,O)=>{var $,F,ae,G;const z=A.current.get(T.current[O]),Q=new nw(P.current,ca({element:document.createElement("div"),minimumSize:($=z==null?void 0:z.minSize)!=null?$:o,maximumSize:(F=z==null?void 0:z.maxSize)!=null?F:n,priority:(ae=z==null?void 0:z.priority)!=null?ae:ti.Normal},(z==null?void 0:z.preferredSize)&&{preferredSize:z==null?void 0:z.preferredSize},{snap:(G=z==null?void 0:z.snap)!=null?G:d}));return D.current.push(Q),{container:[...M.current.values()][O],size:K,view:Q}})}});j.current=new O9(N.current,B,v,y,S),j.current.on("sashDragStart",()=>{var K;(K=N.current)==null||K.classList.add("split-view-sash-dragging")}),j.current.on("sashDragEnd",()=>{var K;(K=N.current)==null||K.classList.remove("split-view-sash-dragging")}),j.current.on("sashchange",K=>{if(x&&j.current){const O=te.map($=>$.key);for(let $=0;$<O.length;$++){const F=A.current.get(O[$]);(F==null?void 0:F.visible)!==void 0&&F.visible!==j.current.isViewVisible($)&&x($,j.current.isViewVisible($))}}}),j.current.on("sashreset",K=>{if(b)b();else{var O;if(U(K)||U(K+1))return;(O=j.current)==null||O.distributeViewSizes()}});const W=j.current;return()=>{W.dispose()}},[]),ZS(()=>{if(L){const se=te.map(me=>me.key),le=[...T.current],ue=se.filter(me=>!T.current.includes(me)),de=se.filter(me=>T.current.includes(me)),we=T.current.map(me=>!se.includes(me));for(let me=we.length-1;me>=0;me--){var H;we[me]&&((H=j.current)!=null&&H.removeView(me),le.splice(me,1),D.current.splice(me,1))}for(const me of ue){var B,W,K,O,$;const ce=A.current.get(me),ke=new nw(P.current,ca({element:document.createElement("div"),minimumSize:(B=ce==null?void 0:ce.minSize)!=null?B:o,maximumSize:(W=ce==null?void 0:ce.maxSize)!=null?W:n,priority:(K=ce==null?void 0:ce.priority)!=null?K:ti.Normal},(ce==null?void 0:ce.preferredSize)&&{preferredSize:ce==null?void 0:ce.preferredSize},{snap:(O=ce==null?void 0:ce.snap)!=null?O:d}));($=j.current)!=null&&$.addView(M.current.get(me),ke,Ah.Distribute,se.findIndex(Ae=>Ae===me)),le.splice(se.findIndex(Ae=>Ae===me),0,me),D.current.splice(se.findIndex(Ae=>Ae===me),0,ke)}for(;!m9(se,le);)for(const[me,ce]of se.entries()){const ke=le.findIndex(Ae=>Ae===ce);if(ke!==me){var F;(F=j.current)==null||F.moveView(M.current.get(ce),ke,me);const Ae=le[ke];le.splice(ke,1),le.splice(me,0,Ae);break}}for(const me of ue){var ae;const ce=se.findIndex(Ae=>Ae===me),ke=D.current[ce].preferredSize;ke!==void 0&&((ae=j.current)==null||ae.resizeView(ce,ke))}for(const me of[...ue,...de]){var G,z;const ce=A.current.get(me),ke=se.findIndex(Ae=>Ae===me);ce&&ow(ce)&&ce.visible!==void 0&&((G=j.current)==null?void 0:G.isViewVisible(ke))!==ce.visible&&((z=j.current)==null||z.setViewVisible(ke,ce.visible))}for(const me of de){const ce=A.current.get(me),ke=se.findIndex(Ae=>Ae===me);if(ce&&ow(ce)){var Q;ce.preferredSize!==void 0&&D.current[ke].preferredSize!==ce.preferredSize&&(D.current[ke].preferredSize=ce.preferredSize);let Ae=!1;ce.minSize!==void 0&&D.current[ke].minimumSize!==ce.minSize&&(D.current[ke].minimumSize=ce.minSize,Ae=!0),ce.maxSize!==void 0&&D.current[ke].maximumSize!==ce.maxSize&&(D.current[ke].maximumSize=ce.maxSize,Ae=!0),Ae&&((Q=j.current)==null||Q.layout())}}(ue.length>0||we.length>0)&&(T.current=se)}},[te,L,n,o,d]),w.useEffect(()=>{j.current&&(j.current.onDidChange=v)},[v]),w.useEffect(()=>{j.current&&(j.current.onDidDragStart=y)},[y]),w.useEffect(()=>{j.current&&(j.current.onDidDragEnd=S)},[S]),v9({ref:N,onResize:({width:H,height:B})=>{var W;H&&B&&((W=j.current)!=null&&W.layout(_?B:H),P.current.setSize(_?B:H),V(!0))}}),w.useEffect(()=>{gk&&L9(20)},[]),ds.createElement("div",{ref:N,className:Dg("split-view",_?"split-view-vertical":"split-view-horizontal",{"split-view-separator-border":u},_9,_?x9:S9,{[w9]:u},t),id:i},ds.createElement("div",{className:Dg("split-view-container",b9)},ds.Children.toArray(e).map(H=>{if(!ds.isValidElement(H))return null;const B=H.key;return H.type.displayName==="Allotment.Pane"?(A.current.set(B,H.props),ds.cloneElement(H,{key:B,ref:W=>{const K=H.ref;K&&(K.current=W),W?M.current.set(B,W):M.current.delete(B)}})):ds.createElement(kv,{key:B,ref:W=>{W?M.current.set(B,W):M.current.delete(B)}},H)})))});function L9(e){const t=fi(e,4,20),i=fi(e,1,8);document.documentElement.style.setProperty("--sash-size",t+"px"),document.documentElement.style.setProperty("--sash-hover-size",i+"px"),(function(n){vk=n,_k.emit("onDidChangeGlobalSize",n)})(t)}bk.displayName="Allotment";var hm=Object.assign(bk,{Pane:kv});function z9({path:e,isLocal:t,onNavigate:i}){const n=w.useRef(null);w.useEffect(()=>{n.current&&(n.current.scrollLeft=n.current.scrollWidth)},[e]);const o=e.split("/").filter(Boolean),l=e==="/";return h.jsxs("div",{ref:n,className:"flex items-center gap-0.5 overflow-x-auto scrollbar-none text-xs",children:[h.jsxs("button",{onClick:()=>i("/"),className:fe("flex shrink-0 items-center gap-1 rounded px-1.5 py-0.5 transition-colors","hover:bg-accent/30 text-muted-foreground hover:text-foreground",l&&"text-foreground font-medium"),children:[h.jsx(GC,{className:"h-3 w-3"}),t?"/":"~"]}),o.map((u,f)=>{const p="/"+o.slice(0,f+1).join("/"),d=f===o.length-1;return h.jsxs("div",{className:"flex shrink-0 items-center",children:[h.jsx(yh,{className:"h-3 w-3 text-muted-foreground/50"}),h.jsx("button",{onClick:()=>i(p),className:fe("rounded px-1.5 py-0.5 transition-colors truncate max-w-[150px]","hover:bg-accent/30",d?"text-foreground font-medium":"text-muted-foreground hover:text-foreground"),children:u})]},p)})]})}function B9({...e}){return h.jsx(F5,{"data-slot":"context-menu",...e})}function P9({...e}){return h.jsx(V5,{"data-slot":"context-menu-trigger",...e})}function H9({className:e,...t}){return h.jsx(q5,{children:h.jsx(Y5,{"data-slot":"context-menu-content",className:fe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...t})})}function is({className:e,inset:t,variant:i="default",...n}){return h.jsx(W5,{"data-slot":"context-menu-item","data-inset":t,"data-variant":i,className:fe("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}function Al({className:e,...t}){return h.jsx(K5,{"data-slot":"context-menu-separator",className:fe("bg-border -mx-1 my-1 h-px",e),...t})}function zn({className:e,...t}){return h.jsx("span",{"data-slot":"context-menu-shortcut",className:fe("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}const xk=new Set(["png","jpg","jpeg","gif","webp","svg","ico","bmp"]),Sk=new Set(["js","ts","tsx","jsx","py","rb","go","rs","java","c","cpp","h","php","swift","kt","dart","vue","svelte","html","css","scss","sh","bash","zsh","sql","graphql"]),wk=new Set(["txt","md","json","xml","yaml","yml","toml","csv","log","conf","cfg","ini","env","gitignore","dockerignore","editorconfig","htaccess","makefile"]),Ck=new Set(["md","txt","pdf","doc","docx","rtf","csv","json","xml","yaml","yml","toml"]),I9=new Set(["mp3","wav","flac","ogg","aac","m4a"]),$9=new Set(["mp4","mkv","avi","mov","webm"]),kk=new Set(["zip","tar","gz","bz2","xz","rar","7z"]);function Ev(e){var t;return((t=e.split(".").pop())==null?void 0:t.toLowerCase())||""}function U9(e){const t=Ev(e);return xk.has(t)?"image":Sk.has(t)?"code":wk.has(t)?"text":Ck.has(t)?"doc":I9.has(t)?"audio":$9.has(t)?"video":kk.has(t)?"archive":"other"}function F9(e){const t=Ev(e);return xk.has(t)||Sk.has(t)||wk.has(t)||Ck.has(t)&&(t==="pdf"||t==="md"||t==="txt"||t==="json")}function V9(e){const t=Ev(e);return kk.has(t)||e.endsWith(".tar.gz")||e.endsWith(".tgz")}function q9({selectedFiles:e,files:t,isLocal:i,rightClickedFile:n,currentPath:o,onOpen:l,onDelete:u,onRename:f,onTransfer:p,onCompress:d,onExtract:_,onPreview:v,onInspect:b,onShowInFinder:x,onCreateFolder:y,onCreateFile:S,onRefresh:E,onOpenTerminal:N,onOpenInEditor:T,onOpenInCode:A,t:j,children:M}){const P=t.filter(D=>e.has(D.path));return h.jsxs(B9,{children:[h.jsx(P9,{asChild:!0,children:M}),h.jsx(H9,{className:"min-w-[200px]",children:n?h.jsxs(h.Fragment,{children:[h.jsxs(is,{onClick:()=>l(n),children:[h.jsx(gr,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextOpen")]}),T&&(i||!n.isDirectory)&&h.jsxs(is,{onClick:()=>T(n),children:[h.jsx(qC,{className:"mr-2 h-3.5 w-3.5"}),j("files.openInEditor")]}),A&&i&&n.isDirectory&&h.jsxs(is,{onClick:()=>A(n),children:[h.jsx(Yn,{className:"mr-2 h-3.5 w-3.5"}),j("files.openInCode")]}),!n.isDirectory&&v&&F9(n.name)&&h.jsxs(is,{onClick:()=>v(n),children:[h.jsx(VC,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextQuickLook"),h.jsx(zn,{children:"Space"})]}),i&&x&&h.jsxs(is,{onClick:()=>x(n.path),children:[h.jsx(FC,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextShowInFinder")]}),h.jsxs(is,{onClick:()=>navigator.clipboard.writeText(n.path),children:[h.jsx(Fm,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextCopyPath"),h.jsx(zn,{children:"⌘C"})]}),b&&h.jsxs(is,{onClick:()=>b(n),children:[h.jsx(XC,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextGetInfo"),h.jsx(zn,{children:"⌘I"})]}),h.jsx(Al,{}),p&&h.jsxs(h.Fragment,{children:[h.jsxs(is,{onClick:()=>p(P.length>0?P:[n]),children:[i?h.jsx(ic,{className:"mr-2 h-3.5 w-3.5"}):h.jsx(to,{className:"mr-2 h-3.5 w-3.5"}),`${j(i?"files.contextUpload":"files.contextDownload")}${P.length>1?` (${P.length})`:""}`]}),h.jsx(Al,{})]}),h.jsxs(is,{onClick:()=>f(n),children:[h.jsx(da,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextRename")]}),!n.isDirectory&&d&&h.jsxs(is,{onClick:()=>d(P.length>0?P:[n]),children:[h.jsx(Vm,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextCompressZip")]}),!n.isDirectory&&V9(n.name)&&_&&h.jsxs(is,{onClick:()=>_(n),children:[h.jsx(Vm,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextExtractZip")]}),h.jsx(Al,{}),h.jsxs(is,{className:"text-destructive focus:text-destructive",onClick:()=>u(P.length>0?P:[n]),children:[h.jsx(Wn,{className:"mr-2 h-3.5 w-3.5"}),`${j("files.contextDelete")}${P.length>1?` (${P.length})`:""}`,h.jsx(zn,{children:"⌘⌫"})]})]}):h.jsxs(h.Fragment,{children:[h.jsxs(is,{onClick:y,children:[h.jsx(WC,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextNewFolder"),h.jsx(zn,{children:"⇧⌘N"})]}),S&&h.jsxs(is,{onClick:S,children:[h.jsx(YC,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextNewFile"),h.jsx(zn,{children:"⌘N"})]}),h.jsxs(is,{onClick:()=>navigator.clipboard.writeText(o),children:[h.jsx(Fm,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextCopyPath")]}),h.jsx(Al,{}),h.jsxs(is,{onClick:E,children:[h.jsx(fa,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextRefresh"),h.jsx(zn,{children:"⌘R"})]}),N&&h.jsxs(h.Fragment,{children:[h.jsx(Al,{}),h.jsxs(is,{onClick:N,children:[h.jsx(pa,{className:"mr-2 h-3.5 w-3.5"}),j("files.contextOpenTerminal")]})]})]})})]})}function Y9(e){if(e.isDirectory)return h.jsx(gr,{className:"h-3.5 w-3.5 text-primary shrink-0"});switch(U9(e.name)){case"image":return h.jsx(OP,{className:"h-3.5 w-3.5 text-green-500 shrink-0"});case"code":return h.jsx(qC,{className:"h-3.5 w-3.5 text-blue-400 shrink-0"});case"doc":case"text":return h.jsx(wP,{className:"h-3.5 w-3.5 text-orange-400 shrink-0"});case"audio":return h.jsx(XP,{className:"h-3.5 w-3.5 text-purple-400 shrink-0"});case"video":return h.jsx(R8,{className:"h-3.5 w-3.5 text-red-400 shrink-0"});case"archive":return h.jsx(Vm,{className:"h-3.5 w-3.5 text-yellow-500 shrink-0"});default:return h.jsx(YC,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"})}}const W9=w.memo(function({file:t,isSelected:i,isDragTarget:n,onSelect:o,onOpen:l,onContextMenu:u,onDragStart:f,onDragOver:p,onDragLeave:d,onDrop:_,t:v}){const b=x=>{o(t.path,x.metaKey||x.ctrlKey,x.shiftKey)};return h.jsxs("div",{role:"row",tabIndex:0,draggable:!0,className:fe("flex items-center text-xs cursor-pointer transition-colors","border-b border-border-subtle",i?"bg-accent text-foreground":"hover:bg-accent/30",n&&"ring-2 ring-inset ring-primary bg-accent"),onClick:b,onKeyDown:x=>{x.key==="Enter"&&l(t),x.key===" "&&(x.preventDefault(),b(x))},onDoubleClick:()=>l(t),onContextMenu:()=>u(t),onDragStart:x=>f(x,t),onDragOver:x=>t.isDirectory?p(x,t.path):void 0,onDragLeave:d,onDrop:x=>t.isDirectory?_(x,t.path):void 0,children:[h.jsxs("div",{className:"flex flex-1 items-center gap-1.5 px-3 py-1 min-w-0",children:[Y9(t),h.jsx("span",{className:"truncate",children:t.name}),t.isSymlink&&h.jsx("span",{className:"text-[9px] text-muted-foreground bg-muted px-1 rounded",children:v("files.statusLink")})]}),h.jsx("div",{className:"w-20 px-3 py-1 text-right text-muted-foreground tabular-nums",children:t.isDirectory?"--":wH(t.size)}),h.jsx("div",{className:"w-36 px-3 py-1 text-muted-foreground",children:CH(t.modifyTime)})]})}),dm="application/x-transhub-files",aw=w.memo(function({title:t,isLocal:i,files:n,currentPath:o,loading:l,selectedFiles:u,onNavigate:f,onRefresh:p,onSelect:d,onOpen:_,onCreateFolder:v,onCreateFile:b,onDelete:x,onRename:y,onTransfer:S,transferLabel:E,onShowInFinder:N,onDropFiles:T,onOpenTerminal:A,onCompress:j,onExtract:M,onPreview:P,onInspect:D,onOpenInEditor:L,onOpenInCode:V,onGoHome:te,onGoRoot:U,onGoDefaultDir:H,defaultDirPath:B,onSetDefaultDir:W,onCopyPath:K,onOpenTerminalHere:O,onNativeFileDrop:$}){je();const{t:F}=Gh(),[ae,G]=w.useState(!1),[z,Q]=w.useState("name"),[se,le]=w.useState("asc"),[ue,de]=w.useState(void 0),[we,me]=w.useState(null),[ce,ke]=w.useState(!1),Ae=w.useRef(null);w.useEffect(()=>{const Se=Te=>{var Xe;if(!(!((Xe=Ae.current)!=null&&Xe.contains(document.activeElement))&&Ae.current!==document.activeElement)){if(Te.key===" "&&P&&u.size===1){Te.preventDefault();const nt=n.find(os=>u.has(os.path));nt&&!nt.isDirectory&&P(nt)}if((Te.metaKey||Te.ctrlKey)&&Te.key==="r"&&(Te.preventDefault(),p()),(Te.metaKey||Te.ctrlKey)&&Te.shiftKey&&Te.key==="N"&&(Te.preventDefault(),v()),(Te.metaKey||Te.ctrlKey)&&!Te.shiftKey&&Te.key==="n"&&b&&(Te.preventDefault(),b()),(Te.metaKey||Te.ctrlKey)&&Te.key==="i"&&D&&u.size===1){Te.preventDefault();const nt=n.find(os=>u.has(os.path));nt&&D(nt)}if((Te.metaKey||Te.ctrlKey)&&Te.key==="Backspace"&&u.size>0){Te.preventDefault();const nt=n.filter(os=>u.has(os.path));nt.length>0&&x(nt)}if((Te.metaKey||Te.ctrlKey)&&Te.key==="c"&&u.size===1){const nt=n.find(os=>u.has(os.path));nt&&navigator.clipboard.writeText(nt.path)}}};return document.addEventListener("keydown",Se),()=>document.removeEventListener("keydown",Se)},[u,n,P,p,v,b,D,x]);const rt=w.useMemo(()=>n.filter(Se=>ae||!Se.name.startsWith(".")),[n,ae]),De=w.useMemo(()=>[...rt].sort((Se,Te)=>{if(Se.isDirectory!==Te.isDirectory)return Se.isDirectory?-1:1;let Xe=0;switch(z){case"name":Xe=Se.name.localeCompare(Te.name);break;case"size":Xe=Se.size-Te.size;break;case"modified":Xe=Se.modifyTime-Te.modifyTime;break}return se==="asc"?Xe:-Xe}),[rt,z,se]),ft=Se=>{z===Se?le(Te=>Te==="asc"?"desc":"asc"):(Q(Se),le("asc"))},wr=()=>{const Se=o.split("/").slice(0,-1).join("/")||"/";f(Se)},Bi=w.useCallback((Se,Te)=>{const Xe=u.has(Te.path)?n.filter(os=>u.has(os.path)):[Te];Se.dataTransfer.setData(dm,JSON.stringify({files:Xe,source:i?"local":"remote",sourcePath:o})),Se.dataTransfer.effectAllowed="copy";const nt=document.createElement("div");nt.className="fixed bg-card border border-border rounded-lg px-3 py-1.5 text-xs shadow-lg flex items-center gap-2 pointer-events-none",nt.innerHTML=`<span>${Xe.length} item${Xe.length>1?"s":""}</span>`,nt.style.position="absolute",nt.style.top="-1000px",document.body.appendChild(nt),Se.dataTransfer.setDragImage(nt,0,0),setTimeout(()=>document.body.removeChild(nt),0)},[u,n,i,o]),hn=w.useCallback((Se,Te)=>{Se.preventDefault(),Se.stopPropagation(),(Se.dataTransfer.types.includes(dm)||Se.dataTransfer.types.includes("Files"))&&(Se.dataTransfer.dropEffect="copy",Te?me(Te):ke(!0))},[]),dn=w.useCallback(Se=>{Se.preventDefault(),me(null),ke(!1)},[]),Cr=w.useCallback((Se,Te)=>{Se.preventDefault(),Se.stopPropagation(),me(null),ke(!1);const Xe=Se.dataTransfer.getData(dm);if(Xe){try{const{files:nt,source:os}=JSON.parse(Xe);if(os===(i?"local":"remote"))return;const no=Te||o;T==null||T(nt,no)}catch{}return}if(Se.dataTransfer.files.length>0){const nt=Array.from(Se.dataTransfer.files),os=Te||o;$==null||$(nt,os)}},[i,o,T,$]),fn=w.useCallback(Se=>{u.has(Se.path)||d(Se.path,!1,!1),de(Se)},[u,d]),Pi=w.useMemo(()=>De.filter(Se=>u.has(Se.path)),[De,u]);return h.jsxs("div",{ref:Ae,tabIndex:0,className:fe("flex h-full flex-col outline-none",ce&&"ring-2 ring-inset ring-primary"),onDragOver:Se=>hn(Se),onDragLeave:dn,onDrop:Se=>Cr(Se),children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-1",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:t}),h.jsxs("div",{className:"flex items-center gap-0.5",children:[h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:()=>G(!ae),title:F(ae?"files.hideHidden":"files.showHidden"),children:ae?h.jsx(VC,{className:"h-3.5 w-3.5"}):h.jsx(pP,{className:"h-3.5 w-3.5"})}),h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:v,title:F("files.newFolder")+" (⇧⌘N)",children:h.jsx(WC,{className:"h-3.5 w-3.5"})}),S&&Pi.length>0&&h.jsxs(ve,{variant:"default",size:"sm",className:"h-6 px-2 text-[10px]",onClick:()=>S(Pi),children:[i?h.jsx(ic,{className:"h-3 w-3"}):h.jsx(to,{className:"h-3 w-3"}),E||F(i?"files.upload":"files.download")," (",Pi.length,")"]})]})]}),h.jsxs("div",{className:"flex items-center gap-0.5 border-b border-border px-3 py-1",children:[h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:wr,title:F("files.goUp"),children:h.jsx(QB,{className:"h-3.5 w-3.5"})}),te&&h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:te,title:F("files.home"),children:h.jsx(GC,{className:"h-3.5 w-3.5"})}),U&&h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:U,title:F("files.root"),children:h.jsx(RP,{className:"h-3.5 w-3.5"})}),H&&B&&h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:H,title:B,children:h.jsx(gr,{className:"h-3.5 w-3.5 text-primary"})}),h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx(z9,{path:o,isLocal:i,onNavigate:f})}),K&&h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:K,title:F("files.copyPath"),children:h.jsx(Fm,{className:"h-3.5 w-3.5"})}),O&&h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:O,title:F("files.openTerminal"),children:h.jsx(pa,{className:"h-3.5 w-3.5"})}),W&&h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:W,title:F("files.setDefault"),className:o===B?"text-red-500":"",children:h.jsx(TP,{className:fe("h-3.5 w-3.5",o===B&&"fill-current")})}),h.jsx(ve,{variant:"ghost",size:"icon-sm",onClick:p,disabled:l,title:F("files.refresh")+" (⌘R)",children:h.jsx(fa,{className:fe("h-3.5 w-3.5",l&&"animate-spin")})})]}),h.jsx(q9,{selectedFiles:u,files:De,isLocal:i,rightClickedFile:ue,currentPath:o,onOpen:_,onDelete:x,onRename:y,onTransfer:S,onCompress:j,onExtract:M,onPreview:P,onInspect:D,onShowInFinder:N,onCreateFolder:v,onCreateFile:b,onRefresh:p,onOpenTerminal:A,onOpenInEditor:L,onOpenInCode:V,t:F,children:h.jsxs("div",{className:"flex-1 overflow-auto",onContextMenu:Se=>{Se.target===Se.currentTarget&&de(void 0)},children:[h.jsxs("div",{className:"sticky top-0 z-10 flex items-center border-b border-border bg-muted text-[10px] text-muted-foreground font-medium",children:[h.jsxs("button",{className:"flex-1 px-3 py-1 text-left hover:text-foreground transition-colors",onClick:()=>ft("name"),children:[F("files.columnName")," ",z==="name"&&h.jsx("span",{className:"ml-0.5 text-[9px]",children:se==="asc"?"▲":"▼"})]}),h.jsxs("button",{className:"w-20 px-3 py-1 text-right hover:text-foreground transition-colors",onClick:()=>ft("size"),children:[F("files.columnSize")," ",z==="size"&&h.jsx("span",{className:"ml-0.5 text-[9px]",children:se==="asc"?"▲":"▼"})]}),h.jsxs("button",{className:"w-36 px-3 py-1 text-left hover:text-foreground transition-colors",onClick:()=>ft("modified"),children:[F("files.columnModified")," ",z==="modified"&&h.jsx("span",{className:"ml-0.5 text-[9px]",children:se==="asc"?"▲":"▼"})]})]}),De.map(Se=>h.jsx(W9,{file:Se,isSelected:u.has(Se.path),isDragTarget:we===Se.path&&Se.isDirectory,onSelect:d,onOpen:_,onContextMenu:fn,onDragStart:Bi,onDragOver:hn,onDragLeave:dn,onDrop:Cr,t:F},Se.path)),De.length===0&&!l&&h.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[h.jsx(gr,{className:"h-10 w-10 mb-2 opacity-20"}),h.jsx("p",{className:"text-xs",children:F("files.emptyDirectory")})]}),l&&h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(fa,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]})}),h.jsxs("div",{className:"flex items-center justify-between border-t border-border px-2 py-0.5 text-[10px] text-muted-foreground",children:[h.jsxs("span",{children:[rt.length," ",F("files.statusItems"),!ae&&n.length!==rt.length?` (${n.length-rt.length} ${F("files.statusHidden")})`:""]}),u.size>0&&h.jsxs("span",{children:[u.size," ",F("files.statusSelected")]})]})]})}),lw={path:"",files:[],loading:!0,selected:new Set};function K9({server:e}){je();const[t,i]=w.useState({local:lw,remote:lw}),[n,o]=w.useState(null),[l,u]=w.useState(null),f=w.useRef({local:null,remote:null}),p=w.useRef({local:"",remote:""}),d=(D,L)=>i(V=>({...V,[D]:{...V[D],...L}})),_=w.useCallback(async(D,L)=>{d(D,{loading:!0});try{const V=D==="local"?await Go.list(L):await Ko.list(e,L??".");p.current[D]=V.path,d(D,{path:V.path,files:V.entries,loading:!1,selected:new Set}),f.current[D]=null}catch(V){d(D,{loading:!1}),o(V.message)}},[e]);w.useEffect(()=>{_("local"),_("remote")},[_]),w.useEffect(()=>kt.subscribe(L=>{if(L.type!=="transfer")return;const V=L;if(u(V.state==="done"||V.state==="failed"?null:V),V.state==="done"){const te=V.direction==="upload"?"remote":"local";_(te,p.current[te])}V.state==="failed"&&o(V.error??k("The transfer failed"))}),[_]);const v=D=>(L,V,te)=>i(U=>{const H=U[D];let B;if(te&&f.current[D]){const W=H.files.map(ae=>ae.path),K=W.indexOf(f.current[D]),O=W.indexOf(L),[$,F]=K<O?[K,O]:[O,K];B=new Set(W.slice($,F+1))}else V?(B=new Set(H.selected),B.has(L)?B.delete(L):B.add(L),f.current[D]=L):(B=new Set([L]),f.current[D]=L);return{...U,[D]:{...H,selected:B}}}),b=D=>L=>{if(L.isDirectory)return void _(D,L.path);D==="remote"&&window.open(Ko.downloadUrl(e,L.path),"_blank")},x=(D,L)=>D.endsWith("/")?`${D}${L}`:`${D}/${L}`,y=D=>(L,V)=>{const te=V||p.current[D==="local"?"remote":"local"],U=L.filter(H=>!H.isDirectory);if(U.length===0){o(k("Directories cannot be transferred yet — select files."));return}RC.start({server:e,direction:D==="local"?"upload":"download",items:U.map(H=>D==="local"?{local:H.path,remote:x(te,H.name)}:{local:x(te,H.name),remote:H.path})}).catch(H=>o(H.message))},S=D=>async L=>{if(window.confirm(L.length===1?k("Delete {{name}}?",{name:L[0].name}):k("Delete {{n}} items?",{n:L.length})))try{for(const V of L)D==="local"?await Go.remove(V.path,V.isDirectory):await Ko.remove(e,V.path,V.isDirectory);await _(D,p.current[D])}catch(V){o(V.message)}},E=D=>async L=>{const V=window.prompt(k("New name"),L.name);if(!V||V===L.name)return;const te=L.path.slice(0,L.path.lastIndexOf("/"))||"/";try{D==="local"?await Go.rename(L.path,x(te,V)):await Ko.rename(e,L.path,x(te,V)),await _(D,p.current[D])}catch(U){o(U.message)}},N=D=>async()=>{const L=window.prompt(k("Name of the new directory"));if(!L)return;const V=p.current[D];try{D==="local"?await Go.mkdir(x(V,L)):await Ko.mkdir(e,x(V,L)),await _(D,V)}catch(te){o(te.message)}},{tabs:T,addTab:A,activateTab:j}=Ue(),M=(D,L)=>D.includes("\\")&&!D.startsWith("/")?`${D.replace(/\\$/,"")}\\${L}`:`${D.replace(/\/$/,"")}/${L}`,P=D=>({isLocal:D==="local",files:t[D].files,currentPath:t[D].path,loading:t[D].loading,selectedFiles:t[D].selected,onNavigate:L=>void _(D,L),onRefresh:()=>void _(D,p.current[D]),onSelect:v(D),onOpen:b(D),onCreateFolder:N(D),onDelete:S(D),onRename:E(D),onTransfer:y(D),transferLabel:k(D==="local"?"Upload":"Download"),onDropFiles:(L,V)=>y(D==="local"?"remote":"local")(L,V),onCopyPath:()=>{var L;return void((L=navigator.clipboard)==null?void 0:L.writeText(p.current[D]))},onCreateFile:()=>{const L=window.prompt(k("Name for the new file"));if(!(L!=null&&L.trim()))return;const V=M(p.current[D],L.trim());(async()=>{try{D==="local"?await Go.touch(V):await Ko.write(e,V,""),await _(D,p.current[D])}catch(te){o(te.message)}})()},onShowInFinder:D==="local"?L=>void Go.reveal(L).catch(V=>o(V.message)):void 0,onOpenTerminal:D==="remote"?()=>{const L=T.find(V=>V.type==="ssh-terminal"&&V.title===e);if(L)return j(L.id);A({id:`tab-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:"ssh-terminal",title:e,serverId:e})}:void 0});return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[n&&h.jsxs("div",{className:"flex items-center justify-between border-b border-destructive/30 bg-destructive-light px-4 py-2 text-sm",children:[h.jsx("span",{children:n}),h.jsx("button",{className:"text-xs underline",onClick:()=>o(null),children:k("dismiss")})]}),l&&h.jsxs("div",{className:"border-b border-border bg-muted px-4 py-1.5 text-xs text-muted-foreground",children:[l.direction==="upload"?k("Uploading"):k("Downloading")," — ",l.done," ",k("of")," ",l.total,l.file&&h.jsx("span",{className:"ml-2 font-mono",children:l.file})]}),h.jsx("div",{className:"min-h-0 flex-1",children:h.jsxs(hm,{defaultSizes:[1,1],children:[h.jsx(hm.Pane,{minSize:260,children:h.jsx(aw,{title:k("This machine"),...P("local"),onGoHome:()=>void _("local")})}),h.jsx(hm.Pane,{minSize:260,children:h.jsx(aw,{title:e,...P("remote"),onGoHome:()=>void _("remote","."),onGoRoot:()=>void _("remote","/")})})]})})]})}function Dh({command:e,size:t="default",className:i}){const[n,o]=w.useState(!1),l=t==="compact",u=async()=>{if(e)try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1500)}catch{}};return h.jsxs("div",{className:fe("flex items-start gap-2 bg-secondary",i),children:[h.jsx("pre",{className:fe("min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap break-all font-mono",l?"py-1 text-xs":"text-[14.5px] leading-relaxed"),children:e||k("(no command)")}),e&&h.jsx("button",{type:"button","aria-label":k(n?"Copied":"Copy the command"),title:k(n?"Copied":"Copy the command"),onClick:()=>void u(),className:fe("flex shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-card hover:text-foreground",l?"h-6 w-6":"h-8 w-8"),children:n?h.jsx(ua,{className:l?"h-3.5 w-3.5":"h-4 w-4"}):h.jsx(UC,{className:l?"h-3.5 w-3.5":"h-4 w-4"})})]})}function Xn({icon:e,title:t,hint:i,action:n}){return h.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center",children:[h.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-primary/10",children:h.jsx(e,{className:"h-7 w-7 text-primary"})}),h.jsx("p",{className:"text-sm font-medium",children:t}),i&&h.jsx("p",{className:"max-w-sm text-xs leading-relaxed text-muted-foreground",children:i}),n&&h.jsx("div",{className:"mt-1",children:n})]})}function G9(e){const t=Math.round(e/1e3);if(t<60)return`${t}s`;const i=Math.floor(t/60);return i<60?`${i}m ${t%60}s`:`${Math.floor(i/60)}h ${i%60}m`}const X9={readonly:"read only",restricted:"restricted",unrestricted:"unrestricted"};function Z9(e){if(!e||typeof e!="object")return;const{server:t,...i}=e;return Object.keys(i).length?JSON.stringify(i,null,2):void 0}function Q9(){je();const e=Ue(u=>u.setView),{pending:t,drop:i}=y2(),[n,o]=w.useState(null),l=async(u,f)=>{o(u);try{await kt.decide(u,f),i(u)}finally{o(null)}};return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsx(io,{title:k("Waiting"),count:t.length,hint:k("An agent paused on these commands. Nothing runs until you decide.")}),t.length===0?h.jsx(Xn,{icon:bh,title:k("Nothing is waiting"),hint:k("Nothing pauses here until you ask it to. Open a server, set Approval to destructive or always, and its agent will stop and wait for you before acting."),action:h.jsxs(ve,{size:"sm",onClick:()=>e("servers"),children:[h.jsx(Zh,{className:"h-3.5 w-3.5"}),k("Set it up on a server")]})}):h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-8 pb-10 pt-6",children:h.jsx("div",{className:"flex max-w-5xl flex-col gap-4",children:t.map(u=>h.jsxs("article",{className:"overflow-hidden rounded-xl border border-border bg-card",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-border px-5 py-3.5",children:[h.jsx("h2",{className:"text-base font-bold",children:u.server}),h.jsxs("span",{className:"font-mono text-[12.5px] text-muted-foreground",children:[u.user,"@",u.host]}),h.jsx("span",{className:"inline-flex h-6 items-center rounded-md border border-border px-2 font-mono text-xs text-muted-foreground",children:u.tool}),u.mode!=="unrestricted"&&h.jsx("span",{className:"inline-flex h-6 items-center rounded-md bg-secondary px-2 text-xs text-secondary-foreground",children:k(X9[u.mode])}),h.jsxs("span",{className:"ml-auto inline-flex items-center gap-1.5 text-[13px] text-muted-foreground tabular-nums",children:[h.jsx(bh,{className:"h-3.5 w-3.5","aria-hidden":"true"}),k("waiting")," ",G9(u.waitingMs)]})]}),u.destructive&&h.jsxs("div",{className:"flex items-start gap-2.5 bg-destructive-light px-5 py-3 text-sm text-destructive",children:[h.jsx(xh,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),h.jsxs("p",{children:[h.jsx("b",{children:k("Destructive.")})," ",k("This command can delete or overwrite data, and nothing on the server will undo it.")]})]}),h.jsx("div",{className:"px-5 py-4",children:h.jsx(Dh,{command:u.command||Z9(u.args),className:"rounded-lg border border-border py-3 pl-4 pr-2"})}),h.jsxs("div",{className:"flex flex-wrap justify-end gap-2.5 px-5 pb-4",children:[h.jsxs(ve,{variant:"outline",className:"h-11 px-5 font-bold",disabled:n===u.id,onClick:()=>void l(u.id,!1),children:[h.jsx(br,{className:"h-4 w-4"}),k("Refuse")]}),h.jsxs(ve,{variant:u.destructive?"destructive":"default",className:fe("h-11 px-5 font-bold"),disabled:n===u.id,onClick:()=>void l(u.id,!0),children:[h.jsx(ua,{className:"h-4 w-4"}),u.destructive?k("Approve and run"):k("Approve")]})]})]},u.id))})})]})}const Zl=new Map;let ta=typeof Notification>"u"?"unsupported":Notification.permission;async function Ek(){if(new URLSearchParams(window.location.search).has("shell")||ta==="unsupported")return!1;if(ta==="granted")return!0;if(ta==="denied")return!1;try{return ta=await Notification.requestPermission(),ta==="granted"}catch{return!1}}function J9(e,t){var o;if(ta!=="granted"||Zl.has(e.id))return;const i=((o=e.command)==null?void 0:o.trim())??"",n=i.length>140?`${i.slice(0,137)}…`:i||e.tool;try{const l=new Notification(e.destructive?`${e.server}: destructive command waiting`:`${e.server}: waiting for you`,{body:n,tag:e.id,requireInteraction:e.destructive,silent:!e.destructive});l.onclick=()=>{window.focus(),t(),l.close()},Zl.set(e.id,l)}catch{}}function Nk(e){const t=Zl.get(e);if(t){try{t.close()}catch{}Zl.delete(e)}}function eU(){for(const e of[...Zl.keys()])Nk(e)}function tU(e,t){return e>=t+10?"over":e>=t?"near":"ok"}const sU={over:"bg-destructive",near:"bg-warning",ok:"bg-meter"},iU={over:"text-destructive",near:"text-warning",ok:""};function cw(e,t){if(t==="en")return e.message;const i={value:e.value,threshold:e.threshold,mount:e.mount??"/"};return e.type==="disk"?k("Disk {{mount}}: {{value}}% used (threshold {{threshold}}%)",i):e.type==="memory"?k("Memory: {{value}}% used (threshold {{threshold}}%)",i):e.type==="cpu"?k("CPU: {{value}}% used (threshold {{threshold}}%)",i):e.message}function fm({label:e,percent:t,detail:i,threshold:n,mono:o}){if(je(),t===void 0)return null;const l=Math.max(0,Math.min(100,Math.round(t))),u=tU(l,n);return h.jsxs("div",{className:"health-gauge grid min-w-0 grid-cols-[minmax(0,1fr)] gap-1.5",children:[h.jsxs("div",{className:fe("grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-baseline gap-3 text-[13px]",iU[u]),children:[h.jsx("span",{className:fe("min-w-0 [overflow-wrap:anywhere]",o&&"font-mono",u!=="ok"&&"font-bold"),children:e}),h.jsxs("span",{className:"font-bold tabular-nums",children:[l,"%"]})]}),h.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-sunk",children:h.jsx("div",{className:fe("h-full rounded-full transition-[width]",sU[u]),style:{width:`${l}%`}})}),i&&h.jsxs("p",{className:"min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]",children:[i,u!=="ok"&&k(" · over the {{v0}}% threshold",{v0:n})]})]})}function rU(){const e=je(),[t,i]=w.useState(null),[n,o]=w.useState(!1),[l,u]=w.useState({cpu:80,memory:90,disk:85,enabled:!0});w.useEffect(()=>{Hm.get().then(v=>u(v.thresholds)).catch(()=>{})},[]);const f=async v=>{o(!0);try{const b=await EB.check(v);i(y=>v&&y?y.map(S=>b.results.find(E=>E.server===S.server)??S):b.results);const x=b.results.filter(y=>{var S;return(((S=y.alerts)==null?void 0:S.length)??0)>0});if(x.length>0&&await Ek())for(const y of x)new Notification(k("{{server}}: {{type}} over threshold",{server:y.server,type:k(y.alerts[0].type)}),{body:y.alerts.map(S=>cw(S,e)).join(`
|
|
515
515
|
`),tag:`health:${y.server}`})}finally{o(!1)}},p=(t==null?void 0:t.filter(v=>v.reachable).length)??0,d=(t==null?void 0:t.filter(v=>{var b;return v.reachable&&(((b=v.alerts)==null?void 0:b.length)??0)>0}).length)??0,_=((t==null?void 0:t.length)??0)-p;return h.jsxs("div",{className:"flex h-full min-h-0 min-w-0 flex-col",children:[h.jsx(io,{title:k("Health"),count:t==null?void 0:t.length,hint:k("Probed when you ask. Nothing runs in the background."),actions:h.jsxs(ve,{className:"font-bold",disabled:n,onClick:()=>void f(),children:[n?h.jsx(oi,{className:"h-4 w-4 animate-spin"}):h.jsx(fa,{className:"h-4 w-4"}),k("Check every server")]})}),h.jsxs("div",{className:"health-scroll flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto px-4 pb-10 pt-5 sm:px-8",children:[t!==null&&t.length>0&&h.jsxs("div",{className:"mb-5 flex flex-wrap gap-2","aria-label":k("Summary"),children:[h.jsxs("span",{className:"inline-flex h-8 items-center gap-2 rounded-full bg-success-light px-3 text-[13px] font-bold text-success",children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-success","aria-hidden":"true"}),p," ",k("reachable")]}),d>0&&h.jsxs("span",{className:"inline-flex h-8 items-center gap-2 rounded-full bg-warning-light px-3 text-[13px] font-bold text-warning",children:[h.jsx(xh,{className:"h-3.5 w-3.5","aria-hidden":"true"}),d," ",k("over a threshold")]}),_>0&&h.jsxs("span",{className:"inline-flex h-8 items-center gap-2 rounded-full bg-destructive-light px-3 text-[13px] font-bold text-destructive",children:[h.jsx(D8,{className:"h-3.5 w-3.5","aria-hidden":"true"}),_," ",k("unreachable")]})]}),t===null?h.jsx(Xn,{icon:KC,title:k("Nothing probed yet"),hint:k("Each check opens one SSH connection and closes it. Press the button when you want to know.")}):h.jsx("div",{className:"health-grid grid min-w-0 grid-cols-[repeat(auto-fill,minmax(min(100%,300px),1fr))] items-start gap-4",children:t.map(v=>{var b,x,y,S,E;return h.jsxs("article",{className:"health-card flex min-w-0 flex-col overflow-hidden rounded-xl border border-border bg-card",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2.5 px-4 pb-3 pt-3.5",children:[h.jsx("h2",{className:"min-w-0 truncate text-base font-bold",children:v.server}),h.jsx("span",{className:fe("inline-flex h-6 shrink-0 items-center rounded-md px-2 text-xs font-bold",v.reachable?"bg-success-light text-success":"bg-destructive-light text-destructive"),children:v.reachable?k("Reachable"):k("Unreachable")}),h.jsx("button",{type:"button","aria-label":k("Recheck {{server}}",{server:v.server}),title:k("Recheck"),disabled:n,className:"ml-auto flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground disabled:opacity-50",onClick:()=>void f(v.server),children:h.jsx(fa,{className:"h-4 w-4"})})]}),v.reachable?h.jsxs("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)] gap-3.5 px-4 pb-4",children:[(((b=v.alerts)==null?void 0:b.length)??0)>0&&h.jsx("div",{className:"min-w-0 rounded-lg bg-warning-light px-3 py-2 text-warning",children:v.alerts.map(N=>h.jsxs("p",{className:"flex min-w-0 items-start gap-1.5 text-xs font-medium",children:[h.jsx(xh,{className:"mt-0.5 h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),h.jsx("span",{className:"min-w-0 [overflow-wrap:anywhere]",children:cw(N,e)})]},`${N.type}:${N.mount??""}`))}),h.jsx(fm,{label:"CPU",percent:(x=v.cpu)==null?void 0:x.percent,threshold:l.cpu,detail:v.load_average?k("load {{value}}",{value:v.load_average}):void 0}),h.jsx(fm,{label:k("Memory"),percent:(y=v.memory)==null?void 0:y.percent,threshold:l.memory,detail:((S=v.memory)==null?void 0:S.used_mb)!==void 0&&v.memory.total_mb!==void 0?k("{{used}} of {{total}} GB",{used:Math.round(v.memory.used_mb/1024),total:Math.round(v.memory.total_mb/1024)}):void 0}),(E=v.disks)==null?void 0:E.map(N=>h.jsx(fm,{label:N.mount,mono:!0,percent:N.percent,threshold:l.disk,detail:k("{{used}} of {{total}}, {{avail}} free",{used:N.used,total:N.size,avail:N.avail})},N.mount))]}):h.jsx("div",{className:"px-4 pb-4",children:h.jsxs("div",{className:"rounded-lg border border-border bg-secondary px-3.5 py-3",children:[h.jsx("p",{className:"text-sm font-bold [overflow-wrap:anywhere]",children:v.error??k("No answer")}),h.jsx("p",{className:"mt-1 font-mono text-xs text-muted-foreground [overflow-wrap:anywhere]",children:k("{{host}} · gave up after {{ms}} ms",{host:v.host,ms:v.tookMs})})]})}),h.jsx("p",{className:"mt-auto border-t border-border px-4 py-2.5 text-xs text-muted-foreground [overflow-wrap:anywhere]",children:v.reachable?h.jsxs(h.Fragment,{children:[v.uptime,k(" · answered in {{v0}} ms",{v0:v.tookMs})]}):k("Recheck once the host or the network is back.")})]},v.server)})})]})]})}function Rk({content:e,rows:t}){const i=Math.min(24,Math.max(3,e.split(`
|
|
516
|
-
`).length)),n=w.useRef(null),o=w.useRef(null),l=w.useRef(""),u=Xh(f=>f.resolved);return w.useEffect(()=>{if(!n.current)return;const f=new uk({fontFamily:"'JetBrains Mono', 'SF Mono', monospace",fontSize:12,theme:la[u],disableStdin:!0,cursorStyle:"bar",cursorInactiveStyle:"none",rows:t??3,scrollback:5e3,convertEol:!0}),p=new hk;f.loadAddon(p),f.open(n.current),p.fit(),o.current={term:f,fit:p},l.current="";const d=new ResizeObserver(()=>{var _;((_=n.current)==null?void 0:_.offsetParent)!==null&&p.fit()});return d.observe(n.current),()=>{d.disconnect(),f.dispose(),o.current=null}},[t]),w.useEffect(()=>{var p;const f=(p=o.current)==null?void 0:p.term;!f||t||f.rows!==i&&f.resize(f.cols,i)},[i,t]),w.useEffect(()=>{o.current&&(o.current.term.options.theme=la[u])},[u]),w.useEffect(()=>{var p;const f=(p=o.current)==null?void 0:p.term;f&&(e.startsWith(l.current)?f.write(e.slice(l.current.length)):(f.reset(),f.write(e)),l.current=e)},[e]),h.jsx("div",{ref:n,className:"px-2 py-1",style:{background:la[u].background}})}function
|
|
517
|
-
`})]})]},f.id)})})]})}function uw(e,t){const i=new Map,n=new Array(e.length);for(let o=e.length-1;o>=0;o--){const{ts:l,server:u="",command:f=""}=e[o],p=`${t}|${l}|${u}|${f}`,d=i.get(p)??0;i.set(p,d+1),n[o]=d?`${p}|${d}`:p}return n}function nU(){je();const[e,t]=w.useState("commands"),[i,n]=w.useState([]),[o,l]=w.useState([]),[u,f]=w.useState(!1),[p,d]=w.useState(new Set),_=y=>d(S=>{const E=new Set(S);return E.delete(y)||E.add(y),E}),v=w.useMemo(()=>uw(o,"command"),[o]),b=w.useMemo(()=>uw(i,"decision"),[i]);w.useEffect(()=>{const y=()=>Cx.get().then(S=>{l(S.entries),f(S.recordsOutput)}).catch(()=>{});return y(),kt.subscribe(S=>{S.type==="stream"&&y()})},[]),w.useEffect(()=>(kt.get().then(y=>n(y.timeline)).catch(()=>{}),kt.subscribe(y=>{y.type==="timeline"&&y.entry&&n(S=>[y.entry,...S].slice(0,500))})),[]);const x=h.jsxs(io,{title:k("Activity"),hint:k("What your agents ran, and what you decided."),children:[[["commands",k("Commands"),o.length],["decisions",k("Decisions"),i.length]].map(([y,S,E],N)=>h.jsxs("button",{onClick:()=>t(y),style:N>0?{marginLeft:"0.25rem"}:void 0,className:fe("rounded-md px-2 py-1 text-xs transition-colors",e===y?"bg-accent text-primary":"text-muted-foreground hover:text-foreground"),children:[S,E>0&&h.jsx("span",{className:"ml-1 text-[10px] text-muted-foreground",children:E})]},y)),e==="commands"&&o.length>0&&h.jsx("button",{className:"ml-auto text-[10px] text-muted-foreground hover:text-foreground",onClick:async()=>{window.confirm(k("Clear the command history on this machine?"))&&(await Cx.clear(),l([]))},children:k("clear")})]});return e==="commands"?h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[x,o.length===0?h.jsx(Xn,{icon:pa,title:k("No command recorded yet"),hint:k("Everything your agents run is written down here, on this machine — nothing to configure on the servers.")+(u?"":" "+k("Output is not kept; set SSH_MANAGER_LOG_OUTPUT=1 if you want it."))}):h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:h.jsx("ol",{children:o.map((y,S)=>{const E=v[S],N=p.has(E);return h.jsxs("li",{className:"border-b border-border-subtle",children:[h.jsxs("button",{onClick:()=>_(E),"aria-expanded":N,className:"flex w-full items-start gap-2 px-6 py-2.5 text-left hover:bg-card-hover",children:[N?h.jsx(ha,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}):h.jsx(yh,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx("span",{className:"text-xs font-medium",children:y.server}),h.jsxs(ai,{variant:y.code===0?"outline":"destructive",children:[k("exit")," ",y.code??"—"]}),y.durationMs!==void 0&&h.jsx("span",{className:"text-[10px] text-muted-foreground tabular-nums",children:y.durationMs<1e3?`${y.durationMs} ms`:`${(y.durationMs/1e3).toFixed(1)} s`})]}),h.jsx("code",{title:y.command,className:"mt-0.5 block truncate font-mono text-xs text-muted-foreground",children:y.command})]}),h.jsx("time",{className:"shrink-0 text-[10px] text-muted-foreground tabular-nums",dateTime:y.ts,children:new Date(y.ts).toLocaleString()})]}),N&&h.jsxs(h.Fragment,{children:[h.jsx(Dh,{command:y.command,size:"compact",className:"border-t border-border-subtle py-1 pl-6 pr-4"}),y.output&&h.jsx(Rk,{content:y.output,rows:12})]})]},E)})})})]}):i.length===0?h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[x,h.jsx(Xn,{icon:IC,title:k("Nothing recorded yet"),hint:k("Every approval you granted or refused appears here. What agents ran is under Commands.")})]}):h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[x,h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:h.jsx("ol",{children:i.map((y,S)=>{const E=y.allowed!==void 0,N=E?y.allowed?ua:br:XC,T=b[S],A=p.has(T),j="flex w-full gap-3 px-6 py-2.5 text-left hover:bg-card-hover",M=h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"mt-0.5 flex shrink-0 items-center gap-1.5",children:[y.command?A?h.jsx(ha,{className:"h-3.5 w-3.5"}):h.jsx(yh,{className:"h-3.5 w-3.5"}):h.jsx("span",{className:"w-3.5"}),h.jsx(N,{className:fe("h-3.5 w-3.5",E?y.allowed?"text-success":"text-destructive":"text-muted-foreground")})]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx("span",{className:"text-xs font-medium",children:y.server??"—"}),y.tool&&h.jsx(ai,{variant:"outline",children:y.tool}),E&&h.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[y.allowed?"approved":"refused",y.source&&` · ${y.source}`]})]}),y.command&&h.jsx("code",{title:y.command,className:"mt-0.5 block truncate font-mono text-xs text-muted-foreground",children:y.command}),y.reason&&!/^approval (allow|deny)$/.test(y.reason)&&h.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:y.reason})]}),h.jsx("time",{className:"shrink-0 text-[10px] text-muted-foreground tabular-nums",dateTime:y.ts,children:new Date(y.ts).toLocaleTimeString()})]});return h.jsxs("li",{className:"border-b border-border-subtle",children:[y.command?h.jsx("button",{onClick:()=>_(T),"aria-expanded":A,className:j,children:M}):h.jsx("div",{className:j,children:M}),A&&y.command&&h.jsx(Dh,{command:y.command,size:"compact",className:"border-t border-border-subtle py-1 pl-6 pr-4"})]},T)})})})]})}function oU({group:e,onClose:t,onSaved:i}){je();const n=Bt(M=>M.servers),[o,l]=w.useState((e==null?void 0:e.name)??""),[u,f]=w.useState((e==null?void 0:e.description)??""),[p,d]=w.useState(new Set((e==null?void 0:e.servers)??[])),[_,v]=w.useState((e==null?void 0:e.strategy)??"parallel"),[b,x]=w.useState(String((e==null?void 0:e.delay)??0)),[y,S]=w.useState(!!(e!=null&&e.stopOnError)),[E,N]=w.useState(!1),[T,A]=w.useState(null),j=M=>d(P=>{const D=new Set(P);return D.has(M)?D.delete(M):D.add(M),D});return h.jsx(rc,{open:!0,onOpenChange:M=>!M&&t(),children:h.jsxs(nc,{className:"sm:max-w-lg",children:[h.jsxs(dv,{children:[h.jsx(oc,{children:e?k("Edit {{v0}}",{v0:e.name}):k("New group")}),h.jsxs(ac,{children:[k("A group runs one command across several machines. Stored in")," ",h.jsx("code",{className:"font-mono text-xs",children:".server-groups.json"}),"."]})]}),h.jsxs("div",{className:"grid gap-3",children:[h.jsxs("div",{className:"grid gap-1.5",children:[h.jsx(Ai,{children:k("Name")}),h.jsx(ot,{value:o,disabled:!!e,placeholder:"web-tier",onChange:M=>l(M.target.value.replace(/[^a-zA-Z0-9_-]/g,""))})]}),h.jsxs("div",{className:"grid gap-1.5",children:[h.jsxs(Ai,{children:[k("Description")," ",h.jsx("span",{className:"font-normal text-muted-foreground",children:k("optional")})]}),h.jsx(ot,{value:u,onChange:M=>f(M.target.value)})]}),h.jsxs("div",{className:"grid gap-1.5",children:[h.jsxs(Ai,{children:[k("Servers"),h.jsxs("span",{className:"ml-1.5 font-normal text-muted-foreground",children:[p.size," ",k("of")," ",n.length]})]}),n.length===0?h.jsx("p",{className:"text-xs text-muted-foreground",children:k("No server in the vault yet — add one first.")}):h.jsx("div",{className:"flex flex-wrap gap-1.5 rounded-md border border-border p-2",children:n.map(M=>h.jsx("button",{onClick:()=>j(M.name),className:fe("rounded-md border px-2 py-1 text-xs transition-colors",p.has(M.name)?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:bg-accent/30"),children:M.name},M.name))})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h.jsxs("div",{className:"grid gap-1.5",children:[h.jsx(Ai,{children:k("Order")}),h.jsxs("select",{value:_,onChange:M=>v(M.target.value),className:"h-9 rounded-md border border-input bg-transparent px-3 text-sm focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none",children:[h.jsx("option",{value:"parallel",children:k("all at once")}),h.jsx("option",{value:"sequential",children:k("one after another")})]})]}),h.jsxs("div",{className:"grid gap-1.5",children:[h.jsxs(Ai,{children:[k("Delay"),h.jsx("span",{className:"ml-1.5 font-normal text-muted-foreground",children:k("ms between servers")})]}),h.jsx(ot,{type:"number",value:b,disabled:_==="parallel",onChange:M=>x(M.target.value)})]})]}),h.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[h.jsx("input",{type:"checkbox",checked:y,onChange:M=>S(M.target.checked),className:"h-3.5 w-3.5"}),k("Stop at the first failure"),h.jsx("span",{className:"text-xs text-muted-foreground",children:k("— otherwise every server is attempted")})]}),T&&h.jsx("p",{className:"text-sm text-destructive",children:T})]}),h.jsxs(fv,{children:[h.jsx(ve,{variant:"ghost",onClick:t,children:k("Cancel")}),h.jsx(ve,{disabled:E||!o||p.size===0,onClick:async()=>{N(!0),A(null);try{await Im.save({name:o,description:u,servers:[...p],strategy:_,delay:Number(b)||0,stopOnError:y}),i()}catch(M){A(M.message)}finally{N(!1)}},children:k(E?"Saving…":"Save")})]})]})})}function Ak({className:e,orientation:t="horizontal",...i}){return h.jsx(cj,{"data-slot":"tabs","data-orientation":t,orientation:t,className:fe("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...i})}const aU=hv("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Dk({className:e,variant:t="default",...i}){return h.jsx(uj,{"data-slot":"tabs-list","data-variant":t,className:fe(aU({variant:t}),e),...i})}function Ei({className:e,...t}){return h.jsx(hj,{"data-slot":"tabs-trigger",className:fe("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function Ni({className:e,...t}){return h.jsx(dj,{"data-slot":"tabs-content",className:fe("flex-1 outline-none",e),...t})}function lU(){je();const[e,t]=w.useState(null),[i,n]=w.useState(""),[o,l]=w.useState(""),[u,f]=w.useState(""),[p,d]=w.useState(""),[_,v]=w.useState(null),[b,x]=w.useState(!1),[y,S]=w.useState(null),[E,N]=w.useState(""),[T,A]=w.useState(0),j=()=>bl.status().then(t);w.useEffect(()=>{let D=!1;const L=()=>{bl.status().then(te=>{D||t(te)}).catch(te=>{D||S(te.message)})};L();const V=kt.subscribe(te=>{(te.type==="servers"||te.type==="connection"&&te.status==="connected")&&L()});return()=>{D=!0,V()}},[]);const M=async D=>{x(!0),S(null),N("");try{await D()}catch(L){S(L.message)}finally{x(!1)}},P=()=>{v(null),d(""),f(""),A(D=>D+1)};return h.jsxs("div",{className:"max-w-3xl space-y-5",children:[h.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border bg-card p-4",children:[h.jsx(Zh,{"aria-hidden":"true",className:"mt-0.5 h-5 w-5 shrink-0 text-primary"}),h.jsxs("div",{children:[h.jsx("h2",{className:"text-sm font-medium",children:k("A recovery copy you can take with you")}),h.jsx("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:k("Your vault is encrypted with a key on this machine. Keep a recovery backup somewhere safe before moving to another computer or reinstalling. You will need its passphrase to restore it.")}),e&&h.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:e.readable?`${ni(e.servers,"{{n}} saved server","{{n}} saved servers")} · ${ni(e.secrets,"{{n}} encrypted secret","{{n}} encrypted secrets")}`:k("The vault cannot be unlocked. Restore a recovery backup to recover access.")}),h.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:k("Backups include saved servers and their credentials. Groups, preferences, host keys and original .env / TOML files need a separate backup.")})]})]}),h.jsxs("form",{className:"grid gap-3 rounded-lg border border-border bg-card p-4",onSubmit:D=>{D.preventDefault(),M(async()=>{const L=await bl.backup(i),V=URL.createObjectURL(new Blob([L.content],{type:"application/json"})),te=document.createElement("a");te.href=V,te.download=L.filename,document.body.appendChild(te),te.click(),te.remove(),setTimeout(()=>URL.revokeObjectURL(V),1e4),n(""),l(""),N(k("Recovery backup downloaded. Keep the file and its passphrase safe."))})},children:[h.jsxs("h3",{className:"flex items-center gap-2 text-sm font-medium",children:[h.jsx(av,{"aria-hidden":"true",className:"h-4 w-4"})," ",k("Create a recovery backup")]}),h.jsx("label",{htmlFor:"backup-passphrase",className:"text-xs font-medium",children:k("Backup passphrase")}),h.jsx(ot,{id:"backup-passphrase",type:"password",minLength:8,autoComplete:"new-password",required:!0,value:i,onChange:D=>n(D.target.value),placeholder:k("At least 8 characters; a longer phrase is better")}),h.jsx("label",{htmlFor:"backup-confirmation",className:"text-xs font-medium",children:k("Confirm backup passphrase")}),h.jsx(ot,{id:"backup-confirmation",type:"password",minLength:8,autoComplete:"new-password",required:!0,value:o,onChange:D=>l(D.target.value)}),o&&o!==i&&h.jsx("p",{className:"text-xs text-destructive",children:k("The passphrases do not match.")}),h.jsxs(ve,{type:"submit",className:"w-fit",disabled:b||!(e!=null&&e.readable)||e.servers===0||i.length<8||o!==i,children:[h.jsx(to,{className:"h-4 w-4"})," ",k("Download recovery backup")]})]}),h.jsxs("form",{className:"grid gap-3 rounded-lg border border-border bg-card p-4",onSubmit:D=>{D.preventDefault(),M(async()=>{if(!_){v(await bl.preview(p,u));return}const L=_;v(null),await bl.restore(p,u,L.revision),P(),await j(),N(k("Recovery complete. Your restored servers are available in Servers."))})},children:[h.jsxs("h3",{className:"flex items-center gap-2 text-sm font-medium",children:[h.jsx(WB,{"aria-hidden":"true",className:"h-4 w-4"})," ",k("Restore a recovery backup")]}),h.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:k("Choose an encrypted SSH Manager recovery file. Review the server names before confirming any changes.")}),h.jsx("label",{htmlFor:"recovery-file",className:"text-xs font-medium",children:k("Recovery file")}),h.jsx(ot,{id:"recovery-file",type:"file",accept:".json,application/json",disabled:b||!!_,onChange:D=>{var V;const L=(V=D.target.files)==null?void 0:V[0];v(null),d(""),L&&M(async()=>{if(L.size>16*1024*1024)throw new Error(k("Recovery files must be at most 16 MB. Use ssh-manager vault restore for larger files."));d(await L.text())})}},T),h.jsx("label",{htmlFor:"restore-passphrase",className:"text-xs font-medium",children:k("Recovery passphrase")}),h.jsx(ot,{id:"restore-passphrase",type:"password",autoComplete:"off",disabled:b||!!_,required:!0,value:u,onChange:D=>{f(D.target.value),v(null)}}),_&&h.jsxs("div",{className:"space-y-2 rounded-lg border border-primary/30 bg-primary/5 p-3","aria-label":k("Recovery preview"),children:[h.jsx("h4",{className:"text-sm font-medium",children:ni(_.servers.length,"Ready to restore {{n}} server","Ready to restore {{n}} servers")}),h.jsx("ul",{className:"max-h-40 overflow-y-auto text-sm",children:_.servers.map(D=>h.jsxs("li",{children:[D,_.conflicts.includes(D)?k(" — replaces saved server"):k(" — adds server")]},D))}),_.replacesUnreadable&&h.jsx("p",{className:"text-sm text-destructive",children:k("The unreadable vault will be replaced by this backup.")}),_.removed.length>0&&h.jsxs("p",{className:"text-sm text-destructive",children:[k("Servers missing from the backup will be removed:")," ",_.removed.join(", "),"."]}),h.jsx("p",{className:"text-xs text-muted-foreground",children:_.replacesUnreadable?k("Other settings and original configuration files stay unchanged."):k("Other saved servers, settings and original configuration files stay unchanged.")})]}),h.jsxs("div",{className:"flex flex-wrap gap-2",children:[h.jsx(ve,{type:"submit",disabled:b||!p||!u,children:k(b?"Working…":_?"Confirm restore":"Preview recovery")}),(p||u||_)&&h.jsx(ve,{type:"button",variant:"ghost",disabled:b,onClick:()=>{P(),S(null)},children:k("Cancel recovery")})]})]}),y&&h.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y}),E&&h.jsx("p",{role:"status",className:"text-sm text-primary",children:E})]})}const hw={app:"the desktop app",npm:"npm"};function cU(e){if(!e.installed)return k("Not found on this machine");const t=e.version?` ${e.version}`:"";return e.engine==="app"?k("Runs the desktop app's engine{{v0}}",{v0:t}):e.engine==="npm"?k("Runs the npm engine{{v0}}",{v0:t}):e.engine==="other"?"Runs another ssh-manager (a checkout or a custom command)":"No ssh-manager entry yet"}function uU(e){return e.id==="claude-code"?k("Start a new Claude Code session for it to take effect."):k("Restart {{v0}} for it to take effect.",{v0:e.name})}function hU(){je();const[e,t]=w.useState(null),[i,n]=w.useState(null),[o,l]=w.useState(null),[u,f]=w.useState(null);if(w.useEffect(()=>{let _=!1;const v=()=>{Ex.status().then(x=>{_||(t(x),n(null))}).catch(x=>{_||n(x.message)})};v();const b=kt.subscribe(x=>{x.type==="agents"&&v()});return()=>{_=!0,b()}},[]),!e)return i?h.jsx("p",{className:"text-sm text-destructive",children:i}):h.jsx(oi,{className:"h-5 w-5 animate-spin text-muted-foreground"});const p=async(_,v)=>{l(`${_.id}:${v}`),n(null),f(null);try{const{client:b}=await Ex.use(_.id,v);t(x=>x&&{...x,clients:x.clients.map(y=>y.id===b.id?b:y)}),f({id:_.id,message:k("{{v0}} now uses {{v1}}. {{v2}}",{v0:_.name,v1:k(hw[v]),v2:uU(_)})})}catch(b){n(`${_.name}: ${b.message}`)}finally{l(null)}},d=[e.engines.app,e.engines.npm];return h.jsxs("div",{className:"max-w-3xl space-y-4",children:[h.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[h.jsxs("h2",{className:"flex items-center gap-2 text-sm font-medium",children:[h.jsx(eP,{"aria-hidden":"true",className:"h-4 w-4 text-primary"}),k("Which ssh-manager your AI tools start")]}),h.jsx("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:k("An AI tool starts ssh-manager itself, from the command in its settings. It can be the one installed with npm or the one inside the desktop app — the same engine either way; the app's needs no Node. Changing it rewrites that one entry and nothing else.")}),h.jsx("dl",{className:"mt-3 grid gap-2 text-xs sm:grid-cols-2",children:["app","npm"].map((_,v)=>{const b=d[v];return h.jsxs("div",{className:"rounded-md border border-border-subtle px-3 py-2",children:[h.jsx("dt",{className:"font-medium",children:_==="app"?k("Desktop app"):"npm"}),h.jsx("dd",{className:"mt-0.5 text-muted-foreground",children:b?`${b.version??k("unknown version")}`:k(_==="app"?"Not installed here":"Not installed with npm")}),b&&h.jsx("dd",{className:"mt-0.5 truncate font-mono text-[10px] text-muted-foreground",title:b.args[0],children:b.args[0]})]},_)})})]}),i&&h.jsx("p",{role:"alert",className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:i}),h.jsx("ul",{className:"overflow-hidden rounded-lg border border-border","aria-label":k("AI tools"),children:e.clients.map(_=>h.jsxs("li",{className:"border-b border-border-subtle px-4 py-3 last:border-b-0",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"text-sm font-medium",children:_.name}),h.jsx("p",{className:"text-xs text-muted-foreground",children:cU(_)}),_.installed&&h.jsx("p",{className:"mt-0.5 truncate font-mono text-[10px] text-muted-foreground",title:_.configPath,children:_.configPath})]}),_.installed&&["app","npm"].map(v=>{if(!(v==="app"?e.engines.app:e.engines.npm))return null;const x=_.engine===v,y=o===`${_.id}:${v}`;return h.jsxs(ve,{size:"sm",variant:x?"secondary":"outline",disabled:x||o!==null,"aria-label":k("{{v0}}: use {{v1}}",{v0:_.name,v1:k(hw[v])}),onClick:()=>void p(_,v),children:[y&&h.jsx(oi,{className:"h-3.5 w-3.5 animate-spin"}),x?k("Using {{v0}}",{v0:v==="app"?k("the app"):"npm"}):k("Use {{v0}}",{v0:v==="app"?k("the app"):"npm"})]},v)})]}),(u==null?void 0:u.id)===_.id&&h.jsx("p",{role:"status",className:"mt-2 text-xs text-primary",children:u.message})]},_.id))})]})}const dU="https://github.com/bvisible/mcp-ssh-manager/releases";function fU(e){if(!e)return k("not yet");const t=new Date(e);return Number.isNaN(t.getTime())?k("not yet"):t.toLocaleString()}function pU(){je();const{info:e,busy:t,error:i,check:n,download:o,install:l}=aa(),u=Ue(d=>d.pendingCount);if(!e)return null;const f=e.channel==="preview",p=e.status;return h.jsxs("div",{className:"max-w-3xl space-y-4",children:[h.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[h.jsxs("h2",{className:"text-sm font-medium",children:["SSH Manager ",e.currentVersion]}),f&&h.jsx(ai,{variant:"secondary",children:k("preview build")})]}),h.jsx("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:k(f?"You are on a preview. You will be offered newer previews and the stable release when it comes out.":"You receive stable releases.")})]}),h.jsxs("div",{className:"rounded-lg border border-border bg-card p-4","aria-live":"polite",children:[p==="checking"&&h.jsxs("p",{className:"flex items-center gap-2 text-sm",children:[h.jsx(oi,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),k("Checking for updates…")]}),(p==="idle"||p==="error")&&h.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[h.jsxs("p",{className:"flex min-w-0 flex-1 items-center gap-2 text-sm",children:[h.jsx(aP,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),e.error?k("Could not check for updates."):e.checkedAt?k("You are up to date."):k("Not checked yet.")]}),h.jsxs(ve,{size:"sm",variant:"outline",disabled:t,onClick:()=>void n(),children:[h.jsx(fa,{className:"h-3.5 w-3.5"}),k("Check now")]})]}),p==="available"&&h.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"text-sm font-medium",children:k("Version {{version}} is available",{version:e.version})}),h.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:k("Downloading does not change anything you are running; you choose when to restart.")})]}),h.jsxs(ve,{size:"sm",disabled:t,onClick:()=>void o(),children:[h.jsx(to,{className:"h-3.5 w-3.5"}),k("Download")," ",e.version]})]}),p==="downloading"&&h.jsxs("div",{children:[h.jsxs("p",{className:"text-sm font-medium",children:[k("Downloading")," ",e.version,"… ",e.percent??0,"%"]}),h.jsx("div",{role:"progressbar","aria-label":k("Download"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":e.percent??0,className:"mt-2 h-1.5 overflow-hidden rounded-full bg-muted",children:h.jsx("div",{className:"h-full bg-primary transition-[width]",style:{width:`${e.percent??0}%`}})})]}),p==="ready"&&h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"text-sm font-medium",children:k("Version {{version}} is ready to install",{version:e.version})}),h.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:k("It installs when you restart, or by itself the next time you quit.")})]}),h.jsxs(ve,{size:"sm",disabled:t,onClick:()=>void l(),children:[h.jsx(h8,{className:"h-3.5 w-3.5"}),k("Restart to update")]})]}),u>0&&h.jsx("p",{role:"alert",className:"rounded-md border border-border bg-muted px-3 py-2 text-xs",children:ni(u,"{{n}} command is waiting for your decision. Restarting drops it: the agent will be told no.","{{n}} commands are waiting for your decision. Restarting drops them: the agents will be told no.")})]}),h.jsxs("dl",{className:"mt-3 grid gap-x-6 gap-y-1 border-t border-border-subtle pt-3 text-xs text-muted-foreground sm:grid-cols-2",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx("dt",{children:k("Last checked")}),h.jsx("dd",{className:"text-foreground",children:fU(e.checkedAt)})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("dt",{children:k("Release notes")}),h.jsx("dd",{children:h.jsxs("a",{className:"inline-flex items-center gap-1 text-foreground underline underline-offset-2",href:`${dU}${e.version?`/tag/v${e.version}`:""}`,target:"_blank",rel:"noreferrer",children:[e.version?k("Version {{v0}}",{v0:e.version}):k("All releases"),h.jsx(FC,{className:"h-3 w-3","aria-hidden":"true"})]})})]})]}),(i||e.error)&&h.jsx("p",{role:"alert",className:"mt-3 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:i??e.error})]}),h.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:k("The application checks when it starts and every six hours, and tells you here, in the sidebar and once per version in a notification. The npm engine, if you use one, is updated with npm and is not part of this.")})]})}const en="h-7 flex-none",mU=[{id:"system",label:"Match the desktop",hint:"follows your system setting, including when it changes",icon:sc},{id:"light",label:"Light",hint:"always light, whatever the system does",icon:b8},{id:"dark",label:"Dark",hint:"always dark",icon:KP}];function gU(){je();const{mode:e,resolved:t,setMode:i}=Xh();return h.jsx("div",{className:"grid gap-2 sm:grid-cols-3",children:mU.map(n=>{const o=n.icon,l=e===n.id;return h.jsxs("button",{onClick:()=>i(n.id),"aria-pressed":l,className:fe("rounded-lg border p-3 text-left transition-colors",l?"border-primary bg-primary/5":"border-border bg-card hover:bg-card-hover"),children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(o,{className:fe("h-4 w-4",l?"text-primary":"text-muted-foreground")}),h.jsx("span",{className:"text-sm font-medium",children:k(n.label)}),n.id==="system"&&h.jsx("span",{className:"ml-auto shrink-0 whitespace-nowrap text-[10px] text-muted-foreground",children:k(t==="dark"?"currently dark":"currently light")})]}),h.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:k(n.hint)})]},n.id)})})}function vU(){je();const[e,t]=w.useState(null),[i,n]=w.useState(!1);if(w.useEffect(()=>{Hm.get().then(l=>t(l.thresholds)).catch(()=>{})},[]),!e)return null;const o=l=>{const u={...e,...l};t(u),n(!0),Hm.save(u).finally(()=>n(!1))};return h.jsxs("div",{className:"rounded-lg border border-border bg-card p-3",children:[h.jsxs("label",{className:"mb-3 flex items-center gap-2 text-sm",children:[h.jsx("input",{type:"checkbox",checked:e.enabled,onChange:l=>o({enabled:l.target.checked}),className:"h-3.5 w-3.5"}),k("Point out machines over these levels"),h.jsx("span",{className:"text-xs text-muted-foreground",children:k("— checked when you probe, never in the background")}),i&&h.jsx(oi,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),h.jsx("div",{className:"grid grid-cols-3 gap-3",children:[["cpu","CPU"],["memory","Memory"],["disk","Disk"]].map(([l,u])=>h.jsxs("div",{className:"grid gap-1",children:[h.jsx("span",{className:"text-xs text-muted-foreground",children:k(u)}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(ot,{type:"number",min:1,max:100,value:e[l],disabled:!e.enabled,onChange:f=>o({[l]:Number(f.target.value)||e[l]}),className:"h-8"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"%"})]})]},l))})]})}const _U=new Set(["All configured servers","Production servers","Staging/test servers","Development servers"]),yU=/^Servers configured with group = "(.*)"$/;function bU(e){const t=yU.exec(e);return t?k('Servers configured with group = "{{name}}"',{name:t[1]}):_U.has(e)?k(e):e}function xU(){const e=je(),[t,i]=w.useState(null),[n,o]=w.useState(""),[l,u]=w.useState(null),[f,p]=w.useState(null),[d,_]=w.useState(!1),[v,b]=w.useState(null),[x,y]=w.useState([]),S=Bt(U=>U.load),E=Bt(U=>U.servers),N=Ue(U=>U.setView),T=Ue(U=>U.setServerDraft),A=Ue(U=>U.optionsTab),j=Ue(U=>U.setOptionsTab),M=aa(U=>U.info),P=A==="updates"&&!M?"appearance":A,D=M!==null&&["available","downloading","ready"].includes(M.status),L=()=>kt.options().then(i).catch(()=>{});if(w.useEffect(()=>(L(),S(),kt.subscribe(U=>{if(U.type==="options"&&L(),U.type!=="group-run")return;const H=U;b(H.state==="done"||H.state==="failed"?null:H),H.state==="progress"&&y(B=>[...B,H]),H.state==="started"&&y([])})),[S]),!t)return h.jsx("div",{className:"flex flex-1 items-center justify-center",children:h.jsx(oi,{className:"h-5 w-5 animate-spin text-muted-foreground"})});const V=t.hostKeys.filter(U=>U.host.toLowerCase().includes(n.trim().toLowerCase())),te=new Set(E.map(U=>{var H;return(H=U.host)==null?void 0:H.toLowerCase()}).filter(Boolean));return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsx(io,{title:k("Options"),hint:k("Settings for this machine only.")}),h.jsxs(Ak,{value:P,onValueChange:j,className:"flex min-h-0 flex-1 flex-col",children:[h.jsxs(Dk,{className:"mx-6 mt-4 w-fit max-w-[calc(100%-3rem)] shrink-0 flex-wrap justify-start group-data-[orientation=horizontal]/tabs:h-auto",children:[h.jsx(Ei,{value:"appearance",className:en,children:k("Appearance")}),h.jsx(Ei,{value:"vault",className:en,children:k("Vault")}),h.jsx(Ei,{value:"agents",className:en,children:k("AI tools")}),M&&h.jsxs(Ei,{value:"updates",className:en,children:[k("Updates"),D&&h.jsx("span",{role:"img","aria-label":k("update available"),className:"h-1.5 w-1.5 rounded-full bg-primary"})]}),h.jsx(Ei,{value:"alerts",className:en,children:k("Alerts")}),h.jsx(Ei,{value:"groups",className:en,children:k("Groups")}),h.jsx(Ei,{value:"tunnels",className:en,children:k("Tunnels")}),h.jsx(Ei,{value:"hosts",className:en,children:k("Known hosts")})]}),h.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:[h.jsxs(Ni,{value:"appearance",className:"mt-0 space-y-4",children:[h.jsxs("h2",{className:"mb-2 flex items-center gap-2 text-xs font-medium tracking-wider uppercase",children:[h.jsx(e8,{className:"h-3.5 w-3.5"}),k("Appearance")]}),h.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[h.jsx("label",{htmlFor:"interface-language",className:"mb-2 block text-sm font-medium",children:Um.map(U=>U.label).join(" / ")}),h.jsx("select",{id:"interface-language",value:e,onChange:U=>void jB(U.target.value),className:"w-full max-w-xs rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:outline-2 focus-visible:outline-ring",children:Um.map(U=>h.jsx("option",{value:U.code,children:U.name},U.code))})]}),h.jsx(gU,{})]}),h.jsx(Ni,{value:"vault",className:"mt-0",children:h.jsx(lU,{})}),h.jsx(Ni,{value:"agents",className:"mt-0",children:h.jsx(hU,{})}),h.jsx(Ni,{value:"updates",className:"mt-0",children:h.jsx(pU,{})}),h.jsxs(Ni,{value:"alerts",className:"mt-0 space-y-4",children:[h.jsxs("h2",{className:"mb-2 flex items-center gap-2 text-xs font-medium tracking-wider uppercase",children:[h.jsx(xh,{className:"h-3.5 w-3.5"}),k("Alert thresholds")]}),h.jsx(vU,{})]}),h.jsxs(Ni,{value:"groups",className:"mt-0 space-y-4",children:[h.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[h.jsxs("h2",{className:"flex items-center gap-2 text-xs font-medium tracking-wider uppercase",children:[h.jsx(HP,{className:"h-3.5 w-3.5"}),k("Groups"),h.jsxs("span",{className:"text-muted-foreground",children:["(",t.groups.length,")"]})]}),h.jsxs(ve,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>_(!0),children:[h.jsx(Hs,{className:"h-3.5 w-3.5"}),k("New group")]})]}),v&&h.jsxs("div",{className:"mb-2 rounded-md border border-border bg-muted px-3 py-1.5 text-xs",children:[k("Running on {{group}} — {{done}} of {{total}}",{group:v.group,done:v.done??0,total:v.total??0}),v.server&&h.jsx("span",{className:"ml-2 font-mono",children:v.server})]}),x.length>0&&h.jsxs("div",{className:"mb-3 overflow-hidden rounded-md border border-border",children:[h.jsxs("div",{className:"flex items-center gap-2 border-b border-border bg-muted px-3 py-1.5",children:[h.jsx("span",{className:"text-xs font-medium",children:k("Results")}),h.jsx("span",{className:"text-[10px] text-muted-foreground",children:k("{{ok}} of {{total}} succeeded",{ok:x.filter(U=>U.code===0).length,total:x.length})}),h.jsx("button",{className:"ml-auto text-[10px] text-muted-foreground hover:text-foreground",onClick:()=>y([]),children:k("clear")})]}),h.jsx("div",{className:"max-h-64 overflow-auto",children:x.map((U,H)=>h.jsxs("div",{className:"border-b border-border-subtle p-2 last:border-b-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs font-medium",children:U.server}),h.jsx(ai,{variant:U.code===0?"outline":"destructive",children:k("exit {{code}}",{code:U.code})})]}),(U.stdout||U.stderr)&&h.jsxs("pre",{className:"mt-1 max-h-32 overflow-auto font-mono text-[11px] whitespace-pre-wrap text-muted-foreground",children:[U.stdout,U.stderr]})]},H))})]}),h.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-2",children:t.groups.map(U=>h.jsxs("div",{className:"group/card rounded-lg border border-border bg-card p-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-sm font-medium",children:U.name}),U.dynamic&&h.jsx(ai,{variant:"secondary",children:k("dynamic")}),U.fromConfig&&h.jsx(ai,{variant:"outline",children:k("from config")}),h.jsxs("div",{className:"ml-auto flex items-center gap-0.5 opacity-0 transition-opacity group-hover/card:opacity-100",children:[h.jsx(ve,{variant:"ghost",size:"icon","aria-label":k("Run a command on {{v0}}",{v0:U.name}),disabled:U.serverCount===0||!!v,onClick:()=>{const H=window.prompt(k('Run on {{v0}} server(s) in "{{v1}}"',{v0:U.serverCount,v1:U.name}));H!=null&&H.trim()&&Im.run(U.name,H)},children:h.jsx(ZC,{className:"h-3.5 w-3.5"})}),!U.dynamic&&h.jsxs(h.Fragment,{children:[h.jsx(ve,{variant:"ghost",size:"icon","aria-label":k("Edit {{v0}}",{v0:U.name}),onClick:()=>p(U),children:h.jsx(da,{className:"h-3.5 w-3.5"})}),h.jsx(ve,{variant:"ghost",size:"icon","aria-label":k("Delete {{name}}",{name:U.name}),onClick:async()=>{if(window.confirm(k('Delete the group "{{v0}}"? The servers are untouched.',{v0:U.name})))try{await Im.remove(U.name),L()}catch(H){window.alert(H.message)}},children:h.jsx(Wn,{className:"h-3.5 w-3.5"})})]})]}),h.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:U.serverCount})]}),U.description&&h.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:bU(U.description)}),U.servers.length>0&&h.jsx("p",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:U.servers.join(", ")})]},U.name))})]}),h.jsxs(Ni,{value:"tunnels",className:"mt-0 space-y-4",children:[h.jsxs("h2",{className:"mb-2 flex items-center gap-2 text-xs font-medium tracking-wider uppercase",children:[h.jsx(QP,{className:"h-3.5 w-3.5"}),k("Tunnels")]}),t.tunnels.length===0?h.jsx("p",{className:"text-xs text-muted-foreground",children:t.tunnelsStale?k("The published list is stale — the MCP server that opened them is no longer running."):k("None open. Tunnels live inside the MCP server’s process; this screen shows what that process publishes.")}):h.jsx("ul",{className:"space-y-1",children:t.tunnels.map(U=>h.jsx("li",{className:"rounded-md border border-border bg-card px-3 py-2 font-mono text-xs",children:U.description??U.id},U.id))})]}),h.jsxs(Ni,{value:"hosts",className:"mt-0 space-y-4",children:[h.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[h.jsxs("h2",{className:"flex items-center gap-2 text-xs font-medium tracking-wider uppercase",children:[h.jsx(BP,{className:"h-3.5 w-3.5"}),k("Known hosts"),h.jsxs("span",{className:"text-muted-foreground",children:["(",t.hostKeys.length,")"]})]}),h.jsx("input",{value:n,onChange:U=>o(U.target.value),placeholder:k("Filter"),className:"ml-auto h-7 w-48 rounded-md border border-input bg-transparent px-2 text-xs focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none"})]}),h.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[V.slice(0,200).map(U=>{const H=`${U.host}:${U.port}`;return h.jsxs("div",{className:"group flex items-center gap-3 border-b border-border-subtle px-3 py-1.5 last:border-b-0 hover:bg-card-hover",children:[h.jsx("span",{className:"w-56 shrink-0 truncate font-mono text-xs",children:U.host}),U.port!==22&&h.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[":",U.port]}),h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[10px] text-muted-foreground",children:U.keys.map(B=>B.type).join(", ")}),!te.has(U.host.toLowerCase())&&h.jsxs(ve,{variant:"ghost",size:"sm",className:"h-7 shrink-0 px-2 text-xs opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>{T({host:U.host,port:U.port}),N("servers")},children:[h.jsx(Hs,{className:"h-3.5 w-3.5"}),k("Add as a server")]}),h.jsx(ve,{variant:"ghost",size:"icon","aria-label":k("Forget {{v0}}",{v0:U.host}),className:"opacity-0 group-hover:opacity-100",disabled:l===H,onClick:async()=>{if(window.confirm(k("Forget the host key for {{v0}}?",{v0:U.host}))){u(H);try{await NB.forget(U.host,U.port),await L()}finally{u(null)}}},children:h.jsx(Wn,{className:"h-3.5 w-3.5"})})]},H)}),V.length>200&&h.jsxs("p",{className:"px-3 py-2 text-[10px] text-muted-foreground",children:[V.length-200," ",k("more — narrow the filter to see them.")]}),V.length===0&&h.jsx("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:k("No host matches.")})]})]})]})]}),(d||f)&&h.jsx(oU,{group:f,onClose:()=>{_(!1),p(null)},onSaved:()=>{_(!1),p(null),L()}})]})}const dw=()=>`tab-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;function SU(){je();const{servers:e,load:t}=Bt(),{tabs:i,addTab:n,activateTab:o}=Ue(),[l,u]=w.useState([]),[f,p]=w.useState([]),[d,_]=w.useState(null),[v,b]=w.useState(!1),[x,y]=w.useState(!1);w.useEffect(()=>{t()},[t]),w.useEffect(()=>{kt.options().then(A=>y(A.localShell)).catch(()=>{})},[]);const S=async()=>{try{const A=await $n.list();u(A.commands),p(A.suggestions)}catch{}};w.useEffect(()=>{S()},[]);const E=A=>{const j=i.filter(M=>M.title===A||M.title.startsWith(`${A} `)).length;return j===0?A:`${A} ${j+1}`},N=(A,j,M=!1)=>{const P=i.find(D=>D.type==="ssh-terminal"&&D.serverId===A);if(P&&!M)return o(P.id);n({id:dw(),type:"ssh-terminal",title:E(j),serverId:A})},T=()=>n({id:dw(),type:"local-terminal",title:E(k("This machine"))});return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsx(io,{title:k("Terminal"),count:e.length,hint:k("A shell on any machine — and the commands you would rather not retype.")}),h.jsxs(Ak,{defaultValue:"open",className:"flex min-h-0 flex-1 flex-col",children:[h.jsxs(Dk,{className:"mx-6 mt-4 w-fit shrink-0",children:[h.jsx(Ei,{value:"open",children:k("Open a shell")}),h.jsx(Ei,{value:"commands",children:k("Saved commands")})]}),h.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:[h.jsxs(Ni,{value:"open",className:"mt-0 space-y-6",children:[x&&h.jsxs("section",{children:[h.jsx("h2",{className:"mb-2 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:k("Here")}),h.jsxs("button",{onClick:T,className:"flex w-full items-center gap-3 rounded-lg border border-border bg-card p-3 text-left transition-colors hover:bg-card-hover sm:w-1/2 lg:w-1/3",children:[h.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-primary/10",children:h.jsx(sc,{className:"h-4.5 w-4.5 text-primary"})}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-sm font-medium",children:k("This machine")}),h.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:k("Your own shell, as you have it configured")})]}),h.jsx(Hs,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})]}),h.jsxs("section",{children:[x&&h.jsx("h2",{className:"mb-2 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:k("Somewhere else")}),e.length===0?h.jsx(Xn,{icon:Yn,title:k("No servers yet"),hint:k("Add one under Servers, or import what you already have with `ssh-manager import`.")}):h.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:e.map(A=>{const j=i.filter(M=>M.type==="ssh-terminal"&&M.serverId===A.id).length;return h.jsxs("div",{className:"group flex items-center gap-3 rounded-lg border border-border bg-card p-3 text-left transition-colors hover:bg-card-hover",children:[h.jsxs("button",{onClick:()=>N(A.id,A.name),className:"flex min-w-0 flex-1 items-center gap-3 text-left",children:[h.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-primary/10",children:h.jsx(Yn,{className:"h-4.5 w-4.5 text-primary"})}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-sm font-medium",children:A.name}),h.jsxs("span",{className:"block truncate font-mono text-xs text-muted-foreground",children:[A.username?`${A.username}@`:"",A.host]})]})]}),j>0&&h.jsx(ai,{variant:"secondary",className:"shrink-0",children:j>1?`${j} open`:"open"}),h.jsx(ve,{variant:"ghost",size:"icon","aria-label":k("Another shell on {{v0}}",{v0:A.name}),title:k("Another shell on {{v0}}",{v0:A.name}),className:"shrink-0 opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100",onClick:()=>N(A.id,A.name,!0),children:h.jsx(Hs,{className:"h-3.5 w-3.5"})})]},A.id)})})]})]}),h.jsxs(Ni,{value:"commands",className:"mt-0 space-y-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("p",{className:"text-xs text-muted-foreground",children:k("Picked from a list inside any shell, instead of typed again.")}),h.jsxs(ve,{size:"sm",className:"ml-auto",onClick:()=>b(!0),children:[h.jsx(Hs,{className:"h-3.5 w-3.5"}),k("New command")]})]}),l.length===0?h.jsx(Xn,{icon:ZC,title:k("Nothing saved yet"),hint:k("Save the ones you type most. They appear in every shell, on the servers you choose."),action:h.jsxs(ve,{size:"sm",onClick:()=>b(!0),children:[h.jsx(Hs,{className:"h-3.5 w-3.5"}),k("Save a command")]})}):h.jsx("div",{className:"overflow-hidden rounded-lg border border-border",children:l.map(A=>{var j;return h.jsxs("div",{className:"group flex items-center gap-3 border-b border-border-subtle px-3 py-2 last:border-b-0 hover:bg-card-hover",children:[h.jsx("span",{className:"w-40 shrink-0 truncate text-sm",children:A.name}),h.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:A.command}),A.confirmBeforeRun&&h.jsx(ai,{variant:"outline",className:"shrink-0",children:k("asks first")}),h.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:(j=A.serverNames)!=null&&j.length?A.serverNames.join(", "):k("every server")}),h.jsxs("span",{className:"flex shrink-0 gap-0.5 opacity-0 transition-opacity group-hover:opacity-100",children:[h.jsx(ve,{variant:"ghost",size:"icon","aria-label":k("Edit {{v0}}",{v0:A.name}),onClick:()=>_(A),children:h.jsx(da,{className:"h-3.5 w-3.5"})}),h.jsx(ve,{variant:"ghost",size:"icon","aria-label":k("Delete {{name}}",{name:A.name}),onClick:async()=>{window.confirm(k("Delete “{{name}}”?",{name:A.name}))&&(await $n.remove(A.id),S())},children:h.jsx(Wn,{className:"h-3.5 w-3.5"})})]})]},A.id)})}),f.length>0&&h.jsxs("div",{children:[h.jsx("h2",{className:"mb-2 text-xs font-medium tracking-wider uppercase text-muted-foreground",children:k("Suggestions")}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:f.map(A=>h.jsxs(ve,{variant:"outline",size:"sm",onClick:async()=>{await $n.save(A),S()},children:[h.jsx(Hs,{className:"h-3 w-3"}),A.name]},A.name))})]})]})]})]}),(v||d)&&h.jsx(dk,{existing:d??void 0,onClose:()=>{b(!1),_(null)},onSaved:()=>{b(!1),_(null),S()}})]})}const pm=e=>e.split(/[\\/]/).pop()||e;function wU({paths:e,onClose:t}){je();const{servers:i,load:n}=Bt(),{tabs:o,addTab:l,activateTab:u}=Ue(),[f,p]=w.useState(null),[d,_]=w.useState(null);w.useEffect(()=>{n()},[n]),w.useEffect(()=>{const S=E=>{E.key==="Escape"&&t()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[t]);const v=new Set(o.filter(S=>S.type==="dual-browser").map(S=>S.serverId)),b=new Set(o.filter(S=>S.type==="ssh-terminal").map(S=>S.serverId)),x=[...i].sort((S,E)=>{const N=T=>v.has(T.id)?0:b.has(T.id)?1:2;return N(S)-N(E)||S.name.localeCompare(E.name)}),y=async S=>{p(S.id),_(null);try{const E=S.defaultDirectory||".";await RC.start({server:S.name,direction:"upload",items:e.map(T=>({local:T,remote:`${E.replace(/\/$/,"")}/${pm(T)}`}))});const N=o.find(T=>T.type==="dual-browser"&&T.serverId===S.id);N?u(N.id):l({id:`tab-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:"dual-browser",title:S.name,serverId:S.id}),t()}catch(E){_(E.message),p(null)}};return h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-6",children:h.jsxs("div",{className:"w-full max-w-lg overflow-hidden rounded-xl border border-border bg-card shadow-lg",children:[h.jsxs("div",{className:"flex items-start gap-3 border-b border-border px-5 py-4",children:[h.jsx("span",{className:"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-primary/10",children:h.jsx(ic,{className:"h-4.5 w-4.5 text-primary"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h2",{className:"text-sm font-medium",children:e.length===1?k("Send {{name}} where?",{name:pm(e[0])}):k("Send {{n}} files where?",{n:e.length})}),e.length>1&&h.jsx("p",{className:"mt-0.5 truncate font-mono text-xs text-muted-foreground",children:e.map(pm).join(", ")})]}),h.jsx(ve,{variant:"ghost",size:"icon","aria-label":k("Cancel"),onClick:t,children:h.jsx(br,{className:"h-4 w-4"})})]}),d&&h.jsx("p",{className:"border-b border-destructive/30 bg-destructive-light px-5 py-2 text-xs",children:d}),h.jsxs("div",{className:"max-h-80 overflow-y-auto p-2",children:[x.length===0&&h.jsx("p",{className:"p-4 text-center text-xs text-muted-foreground",children:k("No servers configured yet.")}),x.map(S=>{const E=v.has(S.id),N=b.has(S.id),T=E?gr:N?Yn:JC;return h.jsxs("button",{disabled:f!==null,onClick:()=>void y(S),className:"flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left transition-colors hover:bg-card-hover disabled:opacity-50",children:[h.jsx(T,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-sm",children:S.name}),h.jsx("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:S.defaultDirectory||"~"})]}),h.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:E?k("files open"):N?k("shell open"):""})]},S.id)})]})]})})}const fw="ssh-manager.desktop-offer-dismissed",CU={manifest:"Finding the release…",download:"Downloading…",verify:"Checking the checksum and the signature…",install:"Installing…",open:"Opening the app…"};function kU(){je();const[e,t]=w.useState(null),[i,n]=w.useState(()=>Jn(fw)==="true"),[o,l]=w.useState(null),[u,f]=w.useState(null),[p,d]=w.useState(null),[_,v]=w.useState(!1),b=Ue(T=>T.handedOver),x=Ue(T=>T.setHandedOver);if(w.useEffect(()=>{if(Bx||i)return;let T=!1;return qp.status().then(A=>{T||!A||(t(A),A.handingOver?x(!0):A.installing&&l(A.phase??"manifest"))}).catch(()=>{}),()=>{T=!0}},[i,x]),w.useEffect(()=>kt.subscribe(T=>{if(T.type!=="desktop")return;if(T.phase==="handover"){x(!0);return}if(T.phase==="error"){d(typeof T.error=="string"?T.error:k("The desktop app was not installed.")),l(null);return}typeof T.phase=="string"&&l(T.phase);const A=Number(T.received),j=Number(T.total);f(j>0&&Number.isFinite(A)?Math.min(1,A/j):null)}),[x]),b)return h.jsxs("div",{role:"status",className:"flex shrink-0 items-center gap-3 border-b border-border bg-success-light px-8 py-3 text-sm text-success",children:[h.jsx(ua,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),h.jsxs("span",{children:[h.jsx("b",{children:k("Continued in the desktop app.")})," ",k("You can close this tab.")]})]});if(Bx||i||!e||!e.supported&&!e.installed)return null;const y=o!==null,S=()=>{eo(fw,"true"),n(!0)},E=async()=>{d(null),l(e.installed?"open":"manifest");try{e.installed?await qp.open():await qp.install()}catch(T){d(T.message),l(null)}},N=async()=>{try{await navigator.clipboard.writeText("ssh-manager app"),v(!0),setTimeout(()=>v(!1),1500)}catch{}};return h.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-x-4 gap-y-2 border-b border-border bg-card px-8 py-3 text-sm",children:[h.jsx(qB,{className:"h-5 w-5 shrink-0 text-primary","aria-hidden":"true"}),h.jsxs("p",{className:"min-w-0 flex-[1_1_320px]",children:[h.jsx("b",{children:k("SSH Manager is also a desktop app:")})," ",k("menu bar, native notifications, updates itself."),e.installed&&e.version&&h.jsxs("span",{className:"text-muted-foreground",children:[" ",k("Version {{version}} is installed.",{version:e.version})]})]}),y&&h.jsxs("div",{className:"ml-auto flex min-w-[220px] items-center gap-3",role:"status","aria-live":"polite",children:[h.jsx(oi,{className:"h-4 w-4 animate-spin text-muted-foreground motion-reduce:animate-none","aria-hidden":"true"}),h.jsx("span",{className:"text-muted-foreground",children:k(CU[o??""]??"Working…")}),o==="download"&&u!==null&&h.jsx("div",{className:"h-1.5 w-28 overflow-hidden rounded-full bg-sunk",role:"progressbar","aria-label":k("Download"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(u*100),children:h.jsx("div",{className:"h-full rounded-full bg-primary transition-[width]",style:{width:`${Math.round(u*100)}%`}})})]}),!y&&h.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.method==="terminal"&&!e.installed?h.jsxs(h.Fragment,{children:[h.jsx("code",{className:"rounded-md border border-border bg-secondary px-2.5 py-1.5 font-mono text-[13px]",children:"ssh-manager app"}),h.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>void N(),children:[_?h.jsx(ua,{className:"h-3.5 w-3.5"}):h.jsx(UC,{className:"h-3.5 w-3.5"}),k(_?"Copied":"Copy")]})]}):h.jsx(ve,{size:"sm",className:"font-bold",onClick:()=>void E(),children:e.installed?k("Open the app"):k("Install the app")}),h.jsxs(ve,{variant:"ghost",size:"sm",onClick:S,children:[h.jsx(br,{className:"h-3.5 w-3.5"}),k("Not now")]})]}),p&&h.jsxs("p",{className:"w-full text-destructive",role:"alert",children:[p," ",k("Nothing was installed.")]})]})}const Tk="ssh-manager.wizard-seen",pw=()=>Jn(Tk)==="true",Xu=[{eyebrow:"A place for your servers",title:"Your servers. Your workspace.",body:"Open a terminal, move files and see what your agents are doing — all from one place on your machine.",detail:"Already using npm or the CLI? Your setup keeps working. You can explore this interface whenever you want."},{eyebrow:"Start with what you have",title:"Bring your servers along.",body:"Add your first connection or import servers from an SSH config, another SSH client or a spreadsheet.",detail:"You review the servers before importing. Your original files stay in place, so you can keep using your existing tools."},{eyebrow:"You decide how far agents go",title:"Stay in control.",body:"Choose which agent requests need your approval. See the server and the full command before you approve or refuse.",detail:"Approval is off by default. Once enabled on a server, requests that need approval are refused if the control plane is unavailable."}];function EU({step:e}){return je(),h.jsxs("svg",{viewBox:"0 0 360 260",fill:"none","aria-hidden":"true",className:"w-full max-w-sm welcome-illustration",children:[h.jsx("circle",{cx:"180",cy:"130",r:"105",className:"fill-primary/5"}),h.jsx("circle",{cx:"180",cy:"130",r:"84",className:"stroke-primary/15",strokeDasharray:"3 8"}),e===0?h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"43",y:"48",width:"250",height:"167",rx:"14",className:"fill-card stroke-border"}),h.jsx("path",{d:"M43 81h250",className:"stroke-border"}),[60,73,86].map(t=>h.jsx("circle",{cx:t,cy:"65",r:"3",className:"fill-primary/50"},t)),h.jsx("rect",{x:"59",y:"98",width:"95",height:"100",rx:"8",className:"fill-muted"}),[119,147,175].map(t=>h.jsxs("g",{children:[h.jsx("rect",{x:"72",y:t-8,width:"16",height:"13",rx:"3",className:"stroke-muted-foreground"}),h.jsx("path",{d:`M98 ${t-4}h39m-39 8h25`,className:"stroke-muted-foreground/45",strokeLinecap:"round"})]},t)),h.jsx("path",{d:"m173 112 7 6-7 6m17 0h12",className:"stroke-primary",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M173 141h87m-87 12h65m-65 12h77",className:"stroke-muted-foreground/30",strokeWidth:"4",strokeLinecap:"round"}),h.jsx("rect",{x:"230",y:"174",width:"87",height:"42",rx:"10",className:"fill-card stroke-primary/40"}),h.jsx("path",{d:"m246 195 5 5 10-12",className:"stroke-success",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M271 191h30m-30 8h21",className:"stroke-muted-foreground/45",strokeWidth:"3",strokeLinecap:"round"})]}):e===1?h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"39",y:"82",width:"111",height:"129",rx:"12",transform:"rotate(-7 39 82)",className:"fill-card stroke-border"}),h.jsx("path",{d:"M62 111h49m-46 17h63m-60 17h53m-51 17h35",className:"stroke-muted-foreground/40",strokeWidth:"4",strokeLinecap:"round"}),h.jsx("path",{d:"M149 140h54m-9-9 11 9-11 9",className:"stroke-primary",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("rect",{x:"217",y:"56",width:"99",height:"154",rx:"13",className:"fill-card stroke-border"}),[78,116,154].map(t=>h.jsxs("g",{children:[h.jsx("rect",{x:"230",y:t,width:"73",height:"28",rx:"6",className:"fill-muted stroke-border"}),h.jsx("circle",{cx:"245",cy:t+14,r:"3",className:"fill-success"}),h.jsx("path",{d:`M257 ${t+14}h31`,className:"stroke-muted-foreground/40",strokeWidth:"3",strokeLinecap:"round"})]},t)),h.jsx("circle",{cx:"117",cy:"208",r:"21",className:"fill-card stroke-primary/40"}),h.jsx("path",{d:"m109 208 5 5 11-12",className:"stroke-primary",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}):h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"40",y:"62",width:"248",height:"140",rx:"14",className:"fill-card stroke-border"}),h.jsx("path",{d:"M40 95h248",className:"stroke-border"}),h.jsx("circle",{cx:"58",cy:"79",r:"4",className:"fill-primary"}),h.jsx("path",{d:"M73 79h78",className:"stroke-muted-foreground/45",strokeWidth:"4",strokeLinecap:"round"}),h.jsx("path",{d:"m59 118 7 6-7 6m17 0h12",className:"stroke-primary",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M100 122h109m-150 28h149",className:"stroke-muted-foreground/35",strokeWidth:"4",strokeLinecap:"round"}),h.jsx("rect",{x:"58",y:"166",width:"59",height:"20",rx:"6",className:"fill-muted"}),h.jsx("rect",{x:"126",y:"166",width:"73",height:"20",rx:"6",className:"fill-primary/25"}),h.jsx("path",{d:"m268 118 40 15v34c0 27-40 48-40 48s-40-21-40-48v-34l40-15Z",className:"fill-card stroke-primary",strokeWidth:"2"}),h.jsx("path",{d:"m252 165 11 11 22-26",className:"stroke-primary",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})]})}function NU({onClose:e}){je();const[t,i]=w.useState(0),n=Ue(d=>d.setView),o=Ue(d=>d.setWantsImport),l=Ue(d=>d.setWantsAdd),u=Xu[t],f=t===Xu.length-1,p=()=>{eo(Tk,"true"),e()};return h.jsx(rc,{open:!0,onOpenChange:d=>!d&&p(),children:h.jsx(nc,{className:"welcome-dialog gap-0 overflow-hidden p-0 sm:max-w-3xl",onCloseAutoFocus:d=>d.preventDefault(),children:h.jsxs("div",{className:"grid sm:grid-cols-[0.9fr_1.1fr]",children:[h.jsxs("div",{className:"flex flex-col justify-between border-b border-border bg-sidebar px-6 py-5 sm:border-r sm:border-b-0",children:[h.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium",children:[h.jsx(sc,{className:"h-4 w-4 text-primary"})," SSH Manager"]}),h.jsx("div",{className:"mx-auto w-full max-w-[200px] sm:max-w-none",children:h.jsx(EU,{step:t})},t),h.jsxs("p",{className:"hidden items-center gap-2 text-xs text-muted-foreground sm:flex",children:[h.jsx(av,{className:"h-3.5 w-3.5"})," ",k("On your machine. In your hands.")]})]}),h.jsxs("div",{className:"flex flex-col px-7 py-7 sm:py-10",children:[h.jsx("p",{className:"mb-3 text-xs font-medium uppercase tracking-widest text-muted-foreground",children:k(u.eyebrow)}),h.jsxs("div",{className:"welcome-copy",children:[h.jsx(oc,{className:"max-w-xs font-display text-3xl leading-tight font-normal",children:k(u.title)}),h.jsx(ac,{className:"mt-4 text-sm leading-relaxed",children:k(u.body)}),h.jsx("p",{className:"mt-4 text-xs leading-relaxed text-muted-foreground",children:k(u.detail)})]},t),h.jsxs("div",{className:"mt-7 flex flex-wrap items-center gap-2",children:[t>0&&h.jsxs(ve,{variant:"ghost",size:"sm",onClick:()=>i(t-1),children:[h.jsx(GB,{className:"h-3.5 w-3.5"})," ",k("Back")]}),t===1&&h.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>{n("servers"),o(!0),p()},children:[h.jsx(to,{className:"h-3.5 w-3.5"})," ",k("Import servers")]}),f?h.jsxs(ve,{size:"sm",onClick:()=>{n("servers"),l(!0),p()},children:[h.jsx(Hs,{className:"h-3.5 w-3.5"})," ",k("Add a server")]}):h.jsxs(ve,{size:"sm",onClick:()=>i(t+1),children:[k("Next")," ",h.jsx($C,{className:"h-3.5 w-3.5"})]})]}),h.jsxs("div",{className:"mt-auto flex items-center justify-between gap-3 pt-6",children:[h.jsx("span",{"aria-label":k("Step {{step}} of {{total}}",{step:t+1,total:Xu.length}),className:"flex items-center gap-1.5",children:Xu.map((d,_)=>h.jsx("span",{className:`flex h-5 w-5 items-center justify-center rounded-full text-[10px] ${_<=t?"bg-primary/15 text-foreground":"bg-muted text-muted-foreground"}`,children:_<t?h.jsx(ua,{className:"h-3 w-3"}):_+1},_))}),h.jsx("button",{className:"rounded text-xs text-muted-foreground underline-offset-4 hover:text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-ring",onClick:p,children:k("I’ll explore first")})]})]})]})})})}const RU={"dual-browser":gr,"ssh-terminal":Yn,"local-terminal":sc};function AU(){je();const{tabs:e,activeTabId:t,activateTab:i,removeTab:n,setView:o}=Ue();return e.length===0?null:h.jsxs("div",{className:fe("titlebar-safe flex shrink-0 items-stretch border-b border-border bg-sidebar",v2&&"drag-region h-12"),children:[h.jsx("div",{className:"flex min-w-0 flex-1 items-stretch overflow-x-auto scrollbar-none",children:e.map(l=>h.jsx(DU,{tab:l,active:t===l.id,onActivate:()=>i(l.id),onClose:()=>n(l.id)},l.id))}),h.jsxs(Qh,{children:[h.jsx(Jh,{asChild:!0,children:h.jsx("button",{"aria-label":k("Open another session"),onClick:()=>o("terminal"),className:"flex w-9 shrink-0 items-center justify-center border-l border-border text-muted-foreground transition-colors hover:bg-accent/30 hover:text-foreground",children:h.jsx(Hs,{className:"h-4 w-4"})})}),h.jsx(ed,{side:"bottom",children:k("Open another session")})]})]})}function DU({tab:e,active:t,onActivate:i,onClose:n}){je();const o=RU[e.type];return h.jsxs("div",{className:fe("group relative flex min-w-0 max-w-52 shrink-0 items-center gap-2 border-r border-border pl-3 pr-1.5 text-xs transition-colors",t?"bg-background text-foreground":"text-muted-foreground hover:bg-accent/20 hover:text-foreground"),children:[t&&h.jsx("span",{className:"absolute inset-x-0 top-0 h-0.5 bg-primary"}),h.jsxs("button",{onClick:i,className:"flex min-w-0 items-center gap-2 py-2",children:[h.jsx(o,{className:"h-3.5 w-3.5 shrink-0"}),h.jsx("span",{className:"truncate",children:e.title})]}),h.jsx("button",{"aria-label":k("Close {{v0}}",{v0:e.title}),onClick:n,className:"flex h-5 w-5 shrink-0 items-center justify-center rounded opacity-0 transition-opacity hover:bg-accent/40 group-hover:opacity-100 focus-visible:opacity-100",children:h.jsx(br,{className:"h-3 w-3"})})]})}function TU(){je();const{view:e,tabs:t,activeTabId:i,setPendingCount:n}=Ue(),o=Bt(y=>y.servers),l=Bt(y=>y.load),u=Bt(y=>y.loading),f=Bt(y=>y.error);w.useEffect(()=>{l()},[l]),w.useEffect(()=>{kH()},[]);const p=Ue(y=>y.setView);w.useEffect(()=>{let y=!1;const S=new Set,E=async()=>{try{const T=await kt.get();if(y)return;n(T.pending.length);const A=new Set(T.pending.map(j=>j.id));for(const j of[...S])A.has(j)||(Nk(j),S.delete(j));for(const j of T.pending)S.has(j.id)||(S.add(j.id),await Ek()&&Q9(j,()=>p("waiting")))}catch{}};E();const N=kt.subscribe(T=>{(AC.includes(T.type)||T.type==="connection"&&T.status==="connected")&&E(),T.type==="servers"&&l()});return()=>{y=!0,N(),J9()}},[n,p,l]);const[d,_]=w.useState(!1);w.useEffect(()=>{if(pw()||u||f||o.length>0)return;let y=!1;return Pm.state().then(S=>{!y&&S.pending.length===0&&!pw()&&_(!0)}).catch(()=>{}),()=>{y=!0}},[o.length,u,f]);const[v,b]=w.useState(null);w.useEffect(()=>kt.subscribe(y=>{y.type==="dropped-files"&&Array.isArray(y.paths)&&y.paths.length&&b(y.paths)}),[]);const x=y=>{var S;return((S=o.find(E=>E.id===y))==null?void 0:S.name)??y??""};return h.jsxs("div",{className:"flex h-screen w-screen flex-col overflow-hidden bg-background text-foreground",children:[h.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[h.jsx(TH,{}),h.jsxs("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[h.jsx(NH,{}),h.jsx(kU,{}),h.jsx(AU,{}),h.jsxs("div",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col",children:[t.map(y=>h.jsx("div",{className:"absolute inset-0 flex flex-col",style:{display:i===y.id?"flex":"none"},inert:i!==y.id,children:y.type==="local-terminal"?h.jsx(IS,{server:y.title,local:!0,hidden:i!==y.id}):y.type==="ssh-terminal"?h.jsx(IS,{server:x(y.serverId),hidden:i!==y.id}):h.jsx(K9,{server:x(y.serverId)})},y.id)),i===null&&h.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[e==="servers"&&h.jsx(e7,{}),e==="waiting"&&h.jsx(Z9,{}),e==="health"&&h.jsx(iU,{}),e==="live"&&h.jsx(rU,{}),e==="activity"&&h.jsx(nU,{}),e==="terminal"&&h.jsx(SU,{}),e==="options"&&h.jsx(xU,{})]})]})]})]}),d&&!v&&h.jsx(NU,{onClose:()=>_(!1)}),v&&h.jsx(wU,{paths:v,onClose:()=>b(null)})]})}RB().then(async()=>{await MB(),BB(),PB(),HB(),Bt.setState({viewMode:Wl.getState().serverViewMode}),aR.createRoot(document.getElementById("root")).render(h.jsx(w.StrictMode,{children:h.jsx(Rj,{delayDuration:300,children:h.jsx(TU,{})})}))});
|
|
516
|
+
`).length)),n=w.useRef(null),o=w.useRef(null),l=w.useRef(""),u=Xh(f=>f.resolved);return w.useEffect(()=>{if(!n.current)return;const f=new uk({fontFamily:"'JetBrains Mono', 'SF Mono', monospace",fontSize:12,theme:la[u],disableStdin:!0,cursorStyle:"bar",cursorInactiveStyle:"none",rows:t??3,scrollback:5e3,convertEol:!0}),p=new hk;f.loadAddon(p),f.open(n.current),p.fit(),o.current={term:f,fit:p},l.current="";const d=new ResizeObserver(()=>{var _;((_=n.current)==null?void 0:_.offsetParent)!==null&&p.fit()});return d.observe(n.current),()=>{d.disconnect(),f.dispose(),o.current=null}},[t]),w.useEffect(()=>{var p;const f=(p=o.current)==null?void 0:p.term;!f||t||f.rows!==i&&f.resize(f.cols,i)},[i,t]),w.useEffect(()=>{o.current&&(o.current.term.options.theme=la[u])},[u]),w.useEffect(()=>{var p;const f=(p=o.current)==null?void 0:p.term;f&&(e.startsWith(l.current)?f.write(e.slice(l.current.length)):(f.reset(),f.write(e)),l.current=e)},[e]),h.jsx("div",{ref:n,className:"px-2 py-1",style:{background:la[u].background}})}function nU(){je();const[e,t]=w.useState([]),[i,n]=w.useState(new Set);w.useEffect(()=>{const f=()=>kt.streams().then(p=>t(p.streams)).catch(()=>{});return f(),kt.subscribe(p=>{p.type==="stream"&&f()})},[]);const{running:o,finished:l}=w.useMemo(()=>({running:e.filter(f=>f.code===null),finished:e.filter(f=>f.code!==null)}),[e]),u=f=>n(p=>{const d=new Set(p);return d.has(f)?d.delete(f):d.add(f),d});return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsx(io,{title:k("Live"),count:e.length,hint:k("What your agents are running, as it happens."),children:o.length>0&&h.jsxs("span",{className:"flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground",children:[h.jsxs("span",{className:"relative flex h-2 w-2",children:[h.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-success opacity-60"}),h.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-success"})]}),o.length," ",k("running")]})}),e.length===0?h.jsx(Xn,{icon:QC,title:k("No command is running"),hint:k("When an agent runs something on one of your servers it appears here as it happens, output included. Nothing is written to disk.")}):h.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-6",children:[...o,...l].map(f=>{const p=i.has(f.id);return h.jsxs("article",{className:"overflow-hidden rounded-lg border border-border bg-card",children:[h.jsxs("button",{onClick:()=>u(f.id),className:"flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-card-hover",children:[p?h.jsx(ha,{className:"h-3.5 w-3.5 shrink-0"}):h.jsx(yh,{className:"h-3.5 w-3.5 shrink-0"}),h.jsx("span",{className:"shrink-0 text-xs font-medium",children:f.server}),h.jsx("code",{title:f.command,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:f.command}),f.code===null?h.jsx(ai,{variant:"secondary",children:k("running")}):h.jsxs(ai,{variant:f.code===0?"outline":"destructive",children:[k("exit")," ",f.code]})]}),p&&h.jsxs("div",{className:"border-t border-border-subtle",children:[h.jsx(Dh,{command:f.command,size:"compact",className:"border-b border-border-subtle py-1 pl-3 pr-2"}),h.jsx(Rk,{content:f.scrollback||`(no output yet)\r
|
|
517
|
+
`})]})]},f.id)})})]})}function uw(e,t){const i=new Map,n=new Array(e.length);for(let o=e.length-1;o>=0;o--){const{ts:l,server:u="",command:f=""}=e[o],p=`${t}|${l}|${u}|${f}`,d=i.get(p)??0;i.set(p,d+1),n[o]=d?`${p}|${d}`:p}return n}function oU(){je();const[e,t]=w.useState("commands"),[i,n]=w.useState([]),[o,l]=w.useState([]),[u,f]=w.useState(!1),[p,d]=w.useState(new Set),_=y=>d(S=>{const E=new Set(S);return E.delete(y)||E.add(y),E}),v=w.useMemo(()=>uw(o,"command"),[o]),b=w.useMemo(()=>uw(i,"decision"),[i]);w.useEffect(()=>{const y=()=>Cx.get().then(S=>{l(S.entries),f(S.recordsOutput)}).catch(()=>{});return y(),kt.subscribe(S=>{S.type==="stream"&&y()})},[]),w.useEffect(()=>(kt.get().then(y=>n(y.timeline)).catch(()=>{}),kt.subscribe(y=>{y.type==="timeline"&&y.entry&&n(S=>[y.entry,...S].slice(0,500))})),[]);const x=h.jsxs(io,{title:k("Activity"),hint:k("What your agents ran, and what you decided."),children:[[["commands",k("Commands"),o.length],["decisions",k("Decisions"),i.length]].map(([y,S,E],N)=>h.jsxs("button",{onClick:()=>t(y),style:N>0?{marginLeft:"0.25rem"}:void 0,className:fe("rounded-md px-2 py-1 text-xs transition-colors",e===y?"bg-accent text-primary":"text-muted-foreground hover:text-foreground"),children:[S,E>0&&h.jsx("span",{className:"ml-1 text-[10px] text-muted-foreground",children:E})]},y)),e==="commands"&&o.length>0&&h.jsx("button",{className:"ml-auto text-[10px] text-muted-foreground hover:text-foreground",onClick:async()=>{window.confirm(k("Clear the command history on this machine?"))&&(await Cx.clear(),l([]))},children:k("clear")})]});return e==="commands"?h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[x,o.length===0?h.jsx(Xn,{icon:pa,title:k("No command recorded yet"),hint:k("Everything your agents run is written down here, on this machine — nothing to configure on the servers.")+(u?"":" "+k("Output is not kept; set SSH_MANAGER_LOG_OUTPUT=1 if you want it."))}):h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:h.jsx("ol",{children:o.map((y,S)=>{const E=v[S],N=p.has(E);return h.jsxs("li",{className:"border-b border-border-subtle",children:[h.jsxs("button",{onClick:()=>_(E),"aria-expanded":N,className:"flex w-full items-start gap-2 px-6 py-2.5 text-left hover:bg-card-hover",children:[N?h.jsx(ha,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}):h.jsx(yh,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx("span",{className:"text-xs font-medium",children:y.server}),h.jsxs(ai,{variant:y.code===0?"outline":"destructive",children:[k("exit")," ",y.code??"—"]}),y.durationMs!==void 0&&h.jsx("span",{className:"text-[10px] text-muted-foreground tabular-nums",children:y.durationMs<1e3?`${y.durationMs} ms`:`${(y.durationMs/1e3).toFixed(1)} s`})]}),h.jsx("code",{title:y.command,className:"mt-0.5 block truncate font-mono text-xs text-muted-foreground",children:y.command})]}),h.jsx("time",{className:"shrink-0 text-[10px] text-muted-foreground tabular-nums",dateTime:y.ts,children:new Date(y.ts).toLocaleString()})]}),N&&h.jsxs(h.Fragment,{children:[h.jsx(Dh,{command:y.command,size:"compact",className:"border-t border-border-subtle py-1 pl-6 pr-4"}),y.output&&h.jsx(Rk,{content:y.output,rows:12})]})]},E)})})})]}):i.length===0?h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[x,h.jsx(Xn,{icon:IC,title:k("Nothing recorded yet"),hint:k("Every approval you granted or refused appears here. What agents ran is under Commands.")})]}):h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[x,h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:h.jsx("ol",{children:i.map((y,S)=>{const E=y.allowed!==void 0,N=E?y.allowed?ua:br:XC,T=b[S],A=p.has(T),j="flex w-full gap-3 px-6 py-2.5 text-left hover:bg-card-hover",M=h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"mt-0.5 flex shrink-0 items-center gap-1.5",children:[y.command?A?h.jsx(ha,{className:"h-3.5 w-3.5"}):h.jsx(yh,{className:"h-3.5 w-3.5"}):h.jsx("span",{className:"w-3.5"}),h.jsx(N,{className:fe("h-3.5 w-3.5",E?y.allowed?"text-success":"text-destructive":"text-muted-foreground")})]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx("span",{className:"text-xs font-medium",children:y.server??"—"}),y.tool&&h.jsx(ai,{variant:"outline",children:y.tool}),E&&h.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[y.allowed?"approved":"refused",y.source&&` · ${y.source}`]})]}),y.command&&h.jsx("code",{title:y.command,className:"mt-0.5 block truncate font-mono text-xs text-muted-foreground",children:y.command}),y.reason&&!/^approval (allow|deny)$/.test(y.reason)&&h.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:y.reason})]}),h.jsx("time",{className:"shrink-0 text-[10px] text-muted-foreground tabular-nums",dateTime:y.ts,children:new Date(y.ts).toLocaleTimeString()})]});return h.jsxs("li",{className:"border-b border-border-subtle",children:[y.command?h.jsx("button",{onClick:()=>_(T),"aria-expanded":A,className:j,children:M}):h.jsx("div",{className:j,children:M}),A&&y.command&&h.jsx(Dh,{command:y.command,size:"compact",className:"border-t border-border-subtle py-1 pl-6 pr-4"})]},T)})})})]})}function aU({group:e,onClose:t,onSaved:i}){je();const n=Bt(M=>M.servers),[o,l]=w.useState((e==null?void 0:e.name)??""),[u,f]=w.useState((e==null?void 0:e.description)??""),[p,d]=w.useState(new Set((e==null?void 0:e.servers)??[])),[_,v]=w.useState((e==null?void 0:e.strategy)??"parallel"),[b,x]=w.useState(String((e==null?void 0:e.delay)??0)),[y,S]=w.useState(!!(e!=null&&e.stopOnError)),[E,N]=w.useState(!1),[T,A]=w.useState(null),j=M=>d(P=>{const D=new Set(P);return D.has(M)?D.delete(M):D.add(M),D});return h.jsx(rc,{open:!0,onOpenChange:M=>!M&&t(),children:h.jsxs(nc,{className:"sm:max-w-lg",children:[h.jsxs(dv,{children:[h.jsx(oc,{children:e?k("Edit {{v0}}",{v0:e.name}):k("New group")}),h.jsxs(ac,{children:[k("A group runs one command across several machines. Stored in")," ",h.jsx("code",{className:"font-mono text-xs",children:".server-groups.json"}),"."]})]}),h.jsxs("div",{className:"grid gap-3",children:[h.jsxs("div",{className:"grid gap-1.5",children:[h.jsx(Ai,{children:k("Name")}),h.jsx(ot,{value:o,disabled:!!e,placeholder:"web-tier",onChange:M=>l(M.target.value.replace(/[^a-zA-Z0-9_-]/g,""))})]}),h.jsxs("div",{className:"grid gap-1.5",children:[h.jsxs(Ai,{children:[k("Description")," ",h.jsx("span",{className:"font-normal text-muted-foreground",children:k("optional")})]}),h.jsx(ot,{value:u,onChange:M=>f(M.target.value)})]}),h.jsxs("div",{className:"grid gap-1.5",children:[h.jsxs(Ai,{children:[k("Servers"),h.jsxs("span",{className:"ml-1.5 font-normal text-muted-foreground",children:[p.size," ",k("of")," ",n.length]})]}),n.length===0?h.jsx("p",{className:"text-xs text-muted-foreground",children:k("No server in the vault yet — add one first.")}):h.jsx("div",{className:"flex flex-wrap gap-1.5 rounded-md border border-border p-2",children:n.map(M=>h.jsx("button",{onClick:()=>j(M.name),className:fe("rounded-md border px-2 py-1 text-xs transition-colors",p.has(M.name)?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:bg-accent/30"),children:M.name},M.name))})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h.jsxs("div",{className:"grid gap-1.5",children:[h.jsx(Ai,{children:k("Order")}),h.jsxs("select",{value:_,onChange:M=>v(M.target.value),className:"h-9 rounded-md border border-input bg-transparent px-3 text-sm focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none",children:[h.jsx("option",{value:"parallel",children:k("all at once")}),h.jsx("option",{value:"sequential",children:k("one after another")})]})]}),h.jsxs("div",{className:"grid gap-1.5",children:[h.jsxs(Ai,{children:[k("Delay"),h.jsx("span",{className:"ml-1.5 font-normal text-muted-foreground",children:k("ms between servers")})]}),h.jsx(ot,{type:"number",value:b,disabled:_==="parallel",onChange:M=>x(M.target.value)})]})]}),h.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[h.jsx("input",{type:"checkbox",checked:y,onChange:M=>S(M.target.checked),className:"h-3.5 w-3.5"}),k("Stop at the first failure"),h.jsx("span",{className:"text-xs text-muted-foreground",children:k("— otherwise every server is attempted")})]}),T&&h.jsx("p",{className:"text-sm text-destructive",children:T})]}),h.jsxs(fv,{children:[h.jsx(ve,{variant:"ghost",onClick:t,children:k("Cancel")}),h.jsx(ve,{disabled:E||!o||p.size===0,onClick:async()=>{N(!0),A(null);try{await Im.save({name:o,description:u,servers:[...p],strategy:_,delay:Number(b)||0,stopOnError:y}),i()}catch(M){A(M.message)}finally{N(!1)}},children:k(E?"Saving…":"Save")})]})]})})}function Ak({className:e,orientation:t="horizontal",...i}){return h.jsx(cj,{"data-slot":"tabs","data-orientation":t,orientation:t,className:fe("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...i})}const lU=hv("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Dk({className:e,variant:t="default",...i}){return h.jsx(uj,{"data-slot":"tabs-list","data-variant":t,className:fe(lU({variant:t}),e),...i})}function Ei({className:e,...t}){return h.jsx(hj,{"data-slot":"tabs-trigger",className:fe("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function Ni({className:e,...t}){return h.jsx(dj,{"data-slot":"tabs-content",className:fe("flex-1 outline-none",e),...t})}function cU(){je();const[e,t]=w.useState(null),[i,n]=w.useState(""),[o,l]=w.useState(""),[u,f]=w.useState(""),[p,d]=w.useState(""),[_,v]=w.useState(null),[b,x]=w.useState(!1),[y,S]=w.useState(null),[E,N]=w.useState(""),[T,A]=w.useState(0),j=()=>bl.status().then(t);w.useEffect(()=>{let D=!1;const L=()=>{bl.status().then(te=>{D||t(te)}).catch(te=>{D||S(te.message)})};L();const V=kt.subscribe(te=>{(te.type==="servers"||te.type==="connection"&&te.status==="connected")&&L()});return()=>{D=!0,V()}},[]);const M=async D=>{x(!0),S(null),N("");try{await D()}catch(L){S(L.message)}finally{x(!1)}},P=()=>{v(null),d(""),f(""),A(D=>D+1)};return h.jsxs("div",{className:"max-w-3xl space-y-5",children:[h.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border bg-card p-4",children:[h.jsx(Zh,{"aria-hidden":"true",className:"mt-0.5 h-5 w-5 shrink-0 text-primary"}),h.jsxs("div",{children:[h.jsx("h2",{className:"text-sm font-medium",children:k("A recovery copy you can take with you")}),h.jsx("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:k("Your vault is encrypted with a key on this machine. Keep a recovery backup somewhere safe before moving to another computer or reinstalling. You will need its passphrase to restore it.")}),e&&h.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:e.readable?`${ni(e.servers,"{{n}} saved server","{{n}} saved servers")} · ${ni(e.secrets,"{{n}} encrypted secret","{{n}} encrypted secrets")}`:k("The vault cannot be unlocked. Restore a recovery backup to recover access.")}),h.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:k("Backups include saved servers and their credentials. Groups, preferences, host keys and original .env / TOML files need a separate backup.")})]})]}),h.jsxs("form",{className:"grid gap-3 rounded-lg border border-border bg-card p-4",onSubmit:D=>{D.preventDefault(),M(async()=>{const L=await bl.backup(i),V=URL.createObjectURL(new Blob([L.content],{type:"application/json"})),te=document.createElement("a");te.href=V,te.download=L.filename,document.body.appendChild(te),te.click(),te.remove(),setTimeout(()=>URL.revokeObjectURL(V),1e4),n(""),l(""),N(k("Recovery backup downloaded. Keep the file and its passphrase safe."))})},children:[h.jsxs("h3",{className:"flex items-center gap-2 text-sm font-medium",children:[h.jsx(av,{"aria-hidden":"true",className:"h-4 w-4"})," ",k("Create a recovery backup")]}),h.jsx("label",{htmlFor:"backup-passphrase",className:"text-xs font-medium",children:k("Backup passphrase")}),h.jsx(ot,{id:"backup-passphrase",type:"password",minLength:8,autoComplete:"new-password",required:!0,value:i,onChange:D=>n(D.target.value),placeholder:k("At least 8 characters; a longer phrase is better")}),h.jsx("label",{htmlFor:"backup-confirmation",className:"text-xs font-medium",children:k("Confirm backup passphrase")}),h.jsx(ot,{id:"backup-confirmation",type:"password",minLength:8,autoComplete:"new-password",required:!0,value:o,onChange:D=>l(D.target.value)}),o&&o!==i&&h.jsx("p",{className:"text-xs text-destructive",children:k("The passphrases do not match.")}),h.jsxs(ve,{type:"submit",className:"w-fit",disabled:b||!(e!=null&&e.readable)||e.servers===0||i.length<8||o!==i,children:[h.jsx(to,{className:"h-4 w-4"})," ",k("Download recovery backup")]})]}),h.jsxs("form",{className:"grid gap-3 rounded-lg border border-border bg-card p-4",onSubmit:D=>{D.preventDefault(),M(async()=>{if(!_){v(await bl.preview(p,u));return}const L=_;v(null),await bl.restore(p,u,L.revision),P(),await j(),N(k("Recovery complete. Your restored servers are available in Servers."))})},children:[h.jsxs("h3",{className:"flex items-center gap-2 text-sm font-medium",children:[h.jsx(WB,{"aria-hidden":"true",className:"h-4 w-4"})," ",k("Restore a recovery backup")]}),h.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:k("Choose an encrypted SSH Manager recovery file. Review the server names before confirming any changes.")}),h.jsx("label",{htmlFor:"recovery-file",className:"text-xs font-medium",children:k("Recovery file")}),h.jsx(ot,{id:"recovery-file",type:"file",accept:".json,application/json",disabled:b||!!_,onChange:D=>{var V;const L=(V=D.target.files)==null?void 0:V[0];v(null),d(""),L&&M(async()=>{if(L.size>16*1024*1024)throw new Error(k("Recovery files must be at most 16 MB. Use ssh-manager vault restore for larger files."));d(await L.text())})}},T),h.jsx("label",{htmlFor:"restore-passphrase",className:"text-xs font-medium",children:k("Recovery passphrase")}),h.jsx(ot,{id:"restore-passphrase",type:"password",autoComplete:"off",disabled:b||!!_,required:!0,value:u,onChange:D=>{f(D.target.value),v(null)}}),_&&h.jsxs("div",{className:"space-y-2 rounded-lg border border-primary/30 bg-primary/5 p-3","aria-label":k("Recovery preview"),children:[h.jsx("h4",{className:"text-sm font-medium",children:ni(_.servers.length,"Ready to restore {{n}} server","Ready to restore {{n}} servers")}),h.jsx("ul",{className:"max-h-40 overflow-y-auto text-sm",children:_.servers.map(D=>h.jsxs("li",{children:[D,_.conflicts.includes(D)?k(" — replaces saved server"):k(" — adds server")]},D))}),_.replacesUnreadable&&h.jsx("p",{className:"text-sm text-destructive",children:k("The unreadable vault will be replaced by this backup.")}),_.removed.length>0&&h.jsxs("p",{className:"text-sm text-destructive",children:[k("Servers missing from the backup will be removed:")," ",_.removed.join(", "),"."]}),h.jsx("p",{className:"text-xs text-muted-foreground",children:_.replacesUnreadable?k("Other settings and original configuration files stay unchanged."):k("Other saved servers, settings and original configuration files stay unchanged.")})]}),h.jsxs("div",{className:"flex flex-wrap gap-2",children:[h.jsx(ve,{type:"submit",disabled:b||!p||!u,children:k(b?"Working…":_?"Confirm restore":"Preview recovery")}),(p||u||_)&&h.jsx(ve,{type:"button",variant:"ghost",disabled:b,onClick:()=>{P(),S(null)},children:k("Cancel recovery")})]})]}),y&&h.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y}),E&&h.jsx("p",{role:"status",className:"text-sm text-primary",children:E})]})}const hw={app:"the desktop app",npm:"npm"};function uU(e){if(!e.installed)return k("Not found on this machine");const t=e.version?` ${e.version}`:"";return e.engine==="app"?k("Runs the desktop app's engine{{v0}}",{v0:t}):e.engine==="npm"?k("Runs the npm engine{{v0}}",{v0:t}):e.engine==="other"?"Runs another ssh-manager (a checkout or a custom command)":"No ssh-manager entry yet"}function hU(e){return e.id==="claude-code"?k("Start a new Claude Code session for it to take effect."):k("Restart {{v0}} for it to take effect.",{v0:e.name})}function dU(){je();const[e,t]=w.useState(null),[i,n]=w.useState(null),[o,l]=w.useState(null),[u,f]=w.useState(null);if(w.useEffect(()=>{let _=!1;const v=()=>{Ex.status().then(x=>{_||(t(x),n(null))}).catch(x=>{_||n(x.message)})};v();const b=kt.subscribe(x=>{x.type==="agents"&&v()});return()=>{_=!0,b()}},[]),!e)return i?h.jsx("p",{className:"text-sm text-destructive",children:i}):h.jsx(oi,{className:"h-5 w-5 animate-spin text-muted-foreground"});const p=async(_,v)=>{l(`${_.id}:${v}`),n(null),f(null);try{const{client:b}=await Ex.use(_.id,v);t(x=>x&&{...x,clients:x.clients.map(y=>y.id===b.id?b:y)}),f({id:_.id,message:k("{{v0}} now uses {{v1}}. {{v2}}",{v0:_.name,v1:k(hw[v]),v2:hU(_)})})}catch(b){n(`${_.name}: ${b.message}`)}finally{l(null)}},d=[e.engines.app,e.engines.npm];return h.jsxs("div",{className:"max-w-3xl space-y-4",children:[h.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[h.jsxs("h2",{className:"flex items-center gap-2 text-sm font-medium",children:[h.jsx(eP,{"aria-hidden":"true",className:"h-4 w-4 text-primary"}),k("Which ssh-manager your AI tools start")]}),h.jsx("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:k("An AI tool starts ssh-manager itself, from the command in its settings. It can be the one installed with npm or the one inside the desktop app — the same engine either way; the app's needs no Node. Changing it rewrites that one entry and nothing else.")}),h.jsx("dl",{className:"mt-3 grid gap-2 text-xs sm:grid-cols-2",children:["app","npm"].map((_,v)=>{const b=d[v];return h.jsxs("div",{className:"rounded-md border border-border-subtle px-3 py-2",children:[h.jsx("dt",{className:"font-medium",children:_==="app"?k("Desktop app"):"npm"}),h.jsx("dd",{className:"mt-0.5 text-muted-foreground",children:b?`${b.version??k("unknown version")}`:k(_==="app"?"Not installed here":"Not installed with npm")}),b&&h.jsx("dd",{className:"mt-0.5 truncate font-mono text-[10px] text-muted-foreground",title:b.args[0],children:b.args[0]})]},_)})})]}),i&&h.jsx("p",{role:"alert",className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:i}),h.jsx("ul",{className:"overflow-hidden rounded-lg border border-border","aria-label":k("AI tools"),children:e.clients.map(_=>h.jsxs("li",{className:"border-b border-border-subtle px-4 py-3 last:border-b-0",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"text-sm font-medium",children:_.name}),h.jsx("p",{className:"text-xs text-muted-foreground",children:uU(_)}),_.installed&&h.jsx("p",{className:"mt-0.5 truncate font-mono text-[10px] text-muted-foreground",title:_.configPath,children:_.configPath})]}),_.installed&&["app","npm"].map(v=>{if(!(v==="app"?e.engines.app:e.engines.npm))return null;const x=_.engine===v,y=o===`${_.id}:${v}`;return h.jsxs(ve,{size:"sm",variant:x?"secondary":"outline",disabled:x||o!==null,"aria-label":k("{{v0}}: use {{v1}}",{v0:_.name,v1:k(hw[v])}),onClick:()=>void p(_,v),children:[y&&h.jsx(oi,{className:"h-3.5 w-3.5 animate-spin"}),x?k("Using {{v0}}",{v0:v==="app"?k("the app"):"npm"}):k("Use {{v0}}",{v0:v==="app"?k("the app"):"npm"})]},v)})]}),(u==null?void 0:u.id)===_.id&&h.jsx("p",{role:"status",className:"mt-2 text-xs text-primary",children:u.message})]},_.id))})]})}const fU="https://github.com/bvisible/mcp-ssh-manager/releases";function pU(e){if(!e)return k("not yet");const t=new Date(e);return Number.isNaN(t.getTime())?k("not yet"):t.toLocaleString()}function mU(){je();const{info:e,busy:t,error:i,check:n,download:o,install:l}=aa(),u=Ue(d=>d.pendingCount);if(!e)return null;const f=e.channel==="preview",p=e.status;return h.jsxs("div",{className:"max-w-3xl space-y-4",children:[h.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[h.jsxs("h2",{className:"text-sm font-medium",children:["SSH Manager ",e.currentVersion]}),f&&h.jsx(ai,{variant:"secondary",children:k("preview build")})]}),h.jsx("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:k(f?"You are on a preview. You will be offered newer previews and the stable release when it comes out.":"You receive stable releases.")})]}),h.jsxs("div",{className:"rounded-lg border border-border bg-card p-4","aria-live":"polite",children:[p==="checking"&&h.jsxs("p",{className:"flex items-center gap-2 text-sm",children:[h.jsx(oi,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),k("Checking for updates…")]}),(p==="idle"||p==="error")&&h.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[h.jsxs("p",{className:"flex min-w-0 flex-1 items-center gap-2 text-sm",children:[h.jsx(aP,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),e.error?k("Could not check for updates."):e.checkedAt?k("You are up to date."):k("Not checked yet.")]}),h.jsxs(ve,{size:"sm",variant:"outline",disabled:t,onClick:()=>void n(),children:[h.jsx(fa,{className:"h-3.5 w-3.5"}),k("Check now")]})]}),p==="available"&&h.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"text-sm font-medium",children:k("Version {{version}} is available",{version:e.version})}),h.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:k("Downloading does not change anything you are running; you choose when to restart.")})]}),h.jsxs(ve,{size:"sm",disabled:t,onClick:()=>void o(),children:[h.jsx(to,{className:"h-3.5 w-3.5"}),k("Download")," ",e.version]})]}),p==="downloading"&&h.jsxs("div",{children:[h.jsxs("p",{className:"text-sm font-medium",children:[k("Downloading")," ",e.version,"… ",e.percent??0,"%"]}),h.jsx("div",{role:"progressbar","aria-label":k("Download"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":e.percent??0,className:"mt-2 h-1.5 overflow-hidden rounded-full bg-muted",children:h.jsx("div",{className:"h-full bg-primary transition-[width]",style:{width:`${e.percent??0}%`}})})]}),p==="ready"&&h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"text-sm font-medium",children:k("Version {{version}} is ready to install",{version:e.version})}),h.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:k("It installs when you restart, or by itself the next time you quit.")})]}),h.jsxs(ve,{size:"sm",disabled:t,onClick:()=>void l(),children:[h.jsx(h8,{className:"h-3.5 w-3.5"}),k("Restart to update")]})]}),u>0&&h.jsx("p",{role:"alert",className:"rounded-md border border-border bg-muted px-3 py-2 text-xs",children:ni(u,"{{n}} command is waiting for your decision. Restarting drops it: the agent will be told no.","{{n}} commands are waiting for your decision. Restarting drops them: the agents will be told no.")})]}),h.jsxs("dl",{className:"mt-3 grid gap-x-6 gap-y-1 border-t border-border-subtle pt-3 text-xs text-muted-foreground sm:grid-cols-2",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx("dt",{children:k("Last checked")}),h.jsx("dd",{className:"text-foreground",children:pU(e.checkedAt)})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("dt",{children:k("Release notes")}),h.jsx("dd",{children:h.jsxs("a",{className:"inline-flex items-center gap-1 text-foreground underline underline-offset-2",href:`${fU}${e.version?`/tag/v${e.version}`:""}`,target:"_blank",rel:"noreferrer",children:[e.version?k("Version {{v0}}",{v0:e.version}):k("All releases"),h.jsx(FC,{className:"h-3 w-3","aria-hidden":"true"})]})})]})]}),(i||e.error)&&h.jsx("p",{role:"alert",className:"mt-3 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:i??e.error})]}),h.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:k("The application checks when it starts and every six hours, and tells you here, in the sidebar and once per version in a notification. The npm engine, if you use one, is updated with npm and is not part of this.")})]})}const en="h-7 flex-none",gU=[{id:"system",label:"Match the desktop",hint:"follows your system setting, including when it changes",icon:sc},{id:"light",label:"Light",hint:"always light, whatever the system does",icon:b8},{id:"dark",label:"Dark",hint:"always dark",icon:KP}];function vU(){je();const{mode:e,resolved:t,setMode:i}=Xh();return h.jsx("div",{className:"grid gap-2 sm:grid-cols-3",children:gU.map(n=>{const o=n.icon,l=e===n.id;return h.jsxs("button",{onClick:()=>i(n.id),"aria-pressed":l,className:fe("rounded-lg border p-3 text-left transition-colors",l?"border-primary bg-primary/5":"border-border bg-card hover:bg-card-hover"),children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(o,{className:fe("h-4 w-4",l?"text-primary":"text-muted-foreground")}),h.jsx("span",{className:"text-sm font-medium",children:k(n.label)}),n.id==="system"&&h.jsx("span",{className:"ml-auto shrink-0 whitespace-nowrap text-[10px] text-muted-foreground",children:k(t==="dark"?"currently dark":"currently light")})]}),h.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:k(n.hint)})]},n.id)})})}function _U(){je();const[e,t]=w.useState(null),[i,n]=w.useState(!1);if(w.useEffect(()=>{Hm.get().then(l=>t(l.thresholds)).catch(()=>{})},[]),!e)return null;const o=l=>{const u={...e,...l};t(u),n(!0),Hm.save(u).finally(()=>n(!1))};return h.jsxs("div",{className:"rounded-lg border border-border bg-card p-3",children:[h.jsxs("label",{className:"mb-3 flex items-center gap-2 text-sm",children:[h.jsx("input",{type:"checkbox",checked:e.enabled,onChange:l=>o({enabled:l.target.checked}),className:"h-3.5 w-3.5"}),k("Point out machines over these levels"),h.jsx("span",{className:"text-xs text-muted-foreground",children:k("— checked when you probe, never in the background")}),i&&h.jsx(oi,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),h.jsx("div",{className:"grid grid-cols-3 gap-3",children:[["cpu","CPU"],["memory","Memory"],["disk","Disk"]].map(([l,u])=>h.jsxs("div",{className:"grid gap-1",children:[h.jsx("span",{className:"text-xs text-muted-foreground",children:k(u)}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(ot,{type:"number",min:1,max:100,value:e[l],disabled:!e.enabled,onChange:f=>o({[l]:Number(f.target.value)||e[l]}),className:"h-8"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"%"})]})]},l))})]})}const yU=new Set(["All configured servers","Production servers","Staging/test servers","Development servers"]),bU=/^Servers configured with group = "(.*)"$/;function xU(e){const t=bU.exec(e);return t?k('Servers configured with group = "{{name}}"',{name:t[1]}):yU.has(e)?k(e):e}function SU(){const e=je(),[t,i]=w.useState(null),[n,o]=w.useState(""),[l,u]=w.useState(null),[f,p]=w.useState(null),[d,_]=w.useState(!1),[v,b]=w.useState(null),[x,y]=w.useState([]),S=Bt(U=>U.load),E=Bt(U=>U.servers),N=Ue(U=>U.setView),T=Ue(U=>U.setServerDraft),A=Ue(U=>U.optionsTab),j=Ue(U=>U.setOptionsTab),M=aa(U=>U.info),P=A==="updates"&&!M?"appearance":A,D=M!==null&&["available","downloading","ready"].includes(M.status),L=()=>kt.options().then(i).catch(()=>{});if(w.useEffect(()=>(L(),S(),kt.subscribe(U=>{if(U.type==="options"&&L(),U.type!=="group-run")return;const H=U;b(H.state==="done"||H.state==="failed"?null:H),H.state==="progress"&&y(B=>[...B,H]),H.state==="started"&&y([])})),[S]),!t)return h.jsx("div",{className:"flex flex-1 items-center justify-center",children:h.jsx(oi,{className:"h-5 w-5 animate-spin text-muted-foreground"})});const V=t.hostKeys.filter(U=>U.host.toLowerCase().includes(n.trim().toLowerCase())),te=new Set(E.map(U=>{var H;return(H=U.host)==null?void 0:H.toLowerCase()}).filter(Boolean));return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsx(io,{title:k("Options"),hint:k("Settings for this machine only.")}),h.jsxs(Ak,{value:P,onValueChange:j,className:"flex min-h-0 flex-1 flex-col",children:[h.jsxs(Dk,{className:"mx-6 mt-4 w-fit max-w-[calc(100%-3rem)] shrink-0 flex-wrap justify-start group-data-[orientation=horizontal]/tabs:h-auto",children:[h.jsx(Ei,{value:"appearance",className:en,children:k("Appearance")}),h.jsx(Ei,{value:"vault",className:en,children:k("Vault")}),h.jsx(Ei,{value:"agents",className:en,children:k("AI tools")}),M&&h.jsxs(Ei,{value:"updates",className:en,children:[k("Updates"),D&&h.jsx("span",{role:"img","aria-label":k("update available"),className:"h-1.5 w-1.5 rounded-full bg-primary"})]}),h.jsx(Ei,{value:"alerts",className:en,children:k("Alerts")}),h.jsx(Ei,{value:"groups",className:en,children:k("Groups")}),h.jsx(Ei,{value:"tunnels",className:en,children:k("Tunnels")}),h.jsx(Ei,{value:"hosts",className:en,children:k("Known hosts")})]}),h.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:[h.jsxs(Ni,{value:"appearance",className:"mt-0 space-y-4",children:[h.jsxs("h2",{className:"mb-2 flex items-center gap-2 text-xs font-medium tracking-wider uppercase",children:[h.jsx(e8,{className:"h-3.5 w-3.5"}),k("Appearance")]}),h.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[h.jsx("label",{htmlFor:"interface-language",className:"mb-2 block text-sm font-medium",children:Um.map(U=>U.label).join(" / ")}),h.jsx("select",{id:"interface-language",value:e,onChange:U=>void jB(U.target.value),className:"w-full max-w-xs rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:outline-2 focus-visible:outline-ring",children:Um.map(U=>h.jsx("option",{value:U.code,children:U.name},U.code))})]}),h.jsx(vU,{})]}),h.jsx(Ni,{value:"vault",className:"mt-0",children:h.jsx(cU,{})}),h.jsx(Ni,{value:"agents",className:"mt-0",children:h.jsx(dU,{})}),h.jsx(Ni,{value:"updates",className:"mt-0",children:h.jsx(mU,{})}),h.jsxs(Ni,{value:"alerts",className:"mt-0 space-y-4",children:[h.jsxs("h2",{className:"mb-2 flex items-center gap-2 text-xs font-medium tracking-wider uppercase",children:[h.jsx(xh,{className:"h-3.5 w-3.5"}),k("Alert thresholds")]}),h.jsx(_U,{})]}),h.jsxs(Ni,{value:"groups",className:"mt-0 space-y-4",children:[h.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[h.jsxs("h2",{className:"flex items-center gap-2 text-xs font-medium tracking-wider uppercase",children:[h.jsx(HP,{className:"h-3.5 w-3.5"}),k("Groups"),h.jsxs("span",{className:"text-muted-foreground",children:["(",t.groups.length,")"]})]}),h.jsxs(ve,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>_(!0),children:[h.jsx(Hs,{className:"h-3.5 w-3.5"}),k("New group")]})]}),v&&h.jsxs("div",{className:"mb-2 rounded-md border border-border bg-muted px-3 py-1.5 text-xs",children:[k("Running on {{group}} — {{done}} of {{total}}",{group:v.group,done:v.done??0,total:v.total??0}),v.server&&h.jsx("span",{className:"ml-2 font-mono",children:v.server})]}),x.length>0&&h.jsxs("div",{className:"mb-3 overflow-hidden rounded-md border border-border",children:[h.jsxs("div",{className:"flex items-center gap-2 border-b border-border bg-muted px-3 py-1.5",children:[h.jsx("span",{className:"text-xs font-medium",children:k("Results")}),h.jsx("span",{className:"text-[10px] text-muted-foreground",children:k("{{ok}} of {{total}} succeeded",{ok:x.filter(U=>U.code===0).length,total:x.length})}),h.jsx("button",{className:"ml-auto text-[10px] text-muted-foreground hover:text-foreground",onClick:()=>y([]),children:k("clear")})]}),h.jsx("div",{className:"max-h-64 overflow-auto",children:x.map((U,H)=>h.jsxs("div",{className:"border-b border-border-subtle p-2 last:border-b-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs font-medium",children:U.server}),h.jsx(ai,{variant:U.code===0?"outline":"destructive",children:k("exit {{code}}",{code:U.code})})]}),(U.stdout||U.stderr)&&h.jsxs("pre",{className:"mt-1 max-h-32 overflow-auto font-mono text-[11px] whitespace-pre-wrap text-muted-foreground",children:[U.stdout,U.stderr]})]},H))})]}),h.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-2",children:t.groups.map(U=>h.jsxs("div",{className:"group/card rounded-lg border border-border bg-card p-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-sm font-medium",children:U.name}),U.dynamic&&h.jsx(ai,{variant:"secondary",children:k("dynamic")}),U.fromConfig&&h.jsx(ai,{variant:"outline",children:k("from config")}),h.jsxs("div",{className:"ml-auto flex items-center gap-0.5 opacity-0 transition-opacity group-hover/card:opacity-100",children:[h.jsx(ve,{variant:"ghost",size:"icon","aria-label":k("Run a command on {{v0}}",{v0:U.name}),disabled:U.serverCount===0||!!v,onClick:()=>{const H=window.prompt(k('Run on {{v0}} server(s) in "{{v1}}"',{v0:U.serverCount,v1:U.name}));H!=null&&H.trim()&&Im.run(U.name,H)},children:h.jsx(ZC,{className:"h-3.5 w-3.5"})}),!U.dynamic&&h.jsxs(h.Fragment,{children:[h.jsx(ve,{variant:"ghost",size:"icon","aria-label":k("Edit {{v0}}",{v0:U.name}),onClick:()=>p(U),children:h.jsx(da,{className:"h-3.5 w-3.5"})}),h.jsx(ve,{variant:"ghost",size:"icon","aria-label":k("Delete {{name}}",{name:U.name}),onClick:async()=>{if(window.confirm(k('Delete the group "{{v0}}"? The servers are untouched.',{v0:U.name})))try{await Im.remove(U.name),L()}catch(H){window.alert(H.message)}},children:h.jsx(Wn,{className:"h-3.5 w-3.5"})})]})]}),h.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:U.serverCount})]}),U.description&&h.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:xU(U.description)}),U.servers.length>0&&h.jsx("p",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:U.servers.join(", ")})]},U.name))})]}),h.jsxs(Ni,{value:"tunnels",className:"mt-0 space-y-4",children:[h.jsxs("h2",{className:"mb-2 flex items-center gap-2 text-xs font-medium tracking-wider uppercase",children:[h.jsx(QP,{className:"h-3.5 w-3.5"}),k("Tunnels")]}),t.tunnels.length===0?h.jsx("p",{className:"text-xs text-muted-foreground",children:t.tunnelsStale?k("The published list is stale — the MCP server that opened them is no longer running."):k("None open. Tunnels live inside the MCP server’s process; this screen shows what that process publishes.")}):h.jsx("ul",{className:"space-y-1",children:t.tunnels.map(U=>h.jsx("li",{className:"rounded-md border border-border bg-card px-3 py-2 font-mono text-xs",children:U.description??U.id},U.id))})]}),h.jsxs(Ni,{value:"hosts",className:"mt-0 space-y-4",children:[h.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[h.jsxs("h2",{className:"flex items-center gap-2 text-xs font-medium tracking-wider uppercase",children:[h.jsx(BP,{className:"h-3.5 w-3.5"}),k("Known hosts"),h.jsxs("span",{className:"text-muted-foreground",children:["(",t.hostKeys.length,")"]})]}),h.jsx("input",{value:n,onChange:U=>o(U.target.value),placeholder:k("Filter"),className:"ml-auto h-7 w-48 rounded-md border border-input bg-transparent px-2 text-xs focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none"})]}),h.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[V.slice(0,200).map(U=>{const H=`${U.host}:${U.port}`;return h.jsxs("div",{className:"group flex items-center gap-3 border-b border-border-subtle px-3 py-1.5 last:border-b-0 hover:bg-card-hover",children:[h.jsx("span",{className:"w-56 shrink-0 truncate font-mono text-xs",children:U.host}),U.port!==22&&h.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[":",U.port]}),h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[10px] text-muted-foreground",children:U.keys.map(B=>B.type).join(", ")}),!te.has(U.host.toLowerCase())&&h.jsxs(ve,{variant:"ghost",size:"sm",className:"h-7 shrink-0 px-2 text-xs opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>{T({host:U.host,port:U.port}),N("servers")},children:[h.jsx(Hs,{className:"h-3.5 w-3.5"}),k("Add as a server")]}),h.jsx(ve,{variant:"ghost",size:"icon","aria-label":k("Forget {{v0}}",{v0:U.host}),className:"opacity-0 group-hover:opacity-100",disabled:l===H,onClick:async()=>{if(window.confirm(k("Forget the host key for {{v0}}?",{v0:U.host}))){u(H);try{await NB.forget(U.host,U.port),await L()}finally{u(null)}}},children:h.jsx(Wn,{className:"h-3.5 w-3.5"})})]},H)}),V.length>200&&h.jsxs("p",{className:"px-3 py-2 text-[10px] text-muted-foreground",children:[V.length-200," ",k("more — narrow the filter to see them.")]}),V.length===0&&h.jsx("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:k("No host matches.")})]})]})]})]}),(d||f)&&h.jsx(aU,{group:f,onClose:()=>{_(!1),p(null)},onSaved:()=>{_(!1),p(null),L()}})]})}const dw=()=>`tab-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;function wU(){je();const{servers:e,load:t}=Bt(),{tabs:i,addTab:n,activateTab:o}=Ue(),[l,u]=w.useState([]),[f,p]=w.useState([]),[d,_]=w.useState(null),[v,b]=w.useState(!1),[x,y]=w.useState(!1);w.useEffect(()=>{t()},[t]),w.useEffect(()=>{kt.options().then(A=>y(A.localShell)).catch(()=>{})},[]);const S=async()=>{try{const A=await $n.list();u(A.commands),p(A.suggestions)}catch{}};w.useEffect(()=>{S()},[]);const E=A=>{const j=i.filter(M=>M.title===A||M.title.startsWith(`${A} `)).length;return j===0?A:`${A} ${j+1}`},N=(A,j,M=!1)=>{const P=i.find(D=>D.type==="ssh-terminal"&&D.serverId===A);if(P&&!M)return o(P.id);n({id:dw(),type:"ssh-terminal",title:E(j),serverId:A})},T=()=>n({id:dw(),type:"local-terminal",title:E(k("This machine"))});return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsx(io,{title:k("Terminal"),count:e.length,hint:k("A shell on any machine — and the commands you would rather not retype.")}),h.jsxs(Ak,{defaultValue:"open",className:"flex min-h-0 flex-1 flex-col",children:[h.jsxs(Dk,{className:"mx-6 mt-4 w-fit shrink-0",children:[h.jsx(Ei,{value:"open",children:k("Open a shell")}),h.jsx(Ei,{value:"commands",children:k("Saved commands")})]}),h.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:[h.jsxs(Ni,{value:"open",className:"mt-0 space-y-6",children:[x&&h.jsxs("section",{children:[h.jsx("h2",{className:"mb-2 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:k("Here")}),h.jsxs("button",{onClick:T,className:"flex w-full items-center gap-3 rounded-lg border border-border bg-card p-3 text-left transition-colors hover:bg-card-hover sm:w-1/2 lg:w-1/3",children:[h.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-primary/10",children:h.jsx(sc,{className:"h-4.5 w-4.5 text-primary"})}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-sm font-medium",children:k("This machine")}),h.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:k("Your own shell, as you have it configured")})]}),h.jsx(Hs,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})]}),h.jsxs("section",{children:[x&&h.jsx("h2",{className:"mb-2 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:k("Somewhere else")}),e.length===0?h.jsx(Xn,{icon:Yn,title:k("No servers yet"),hint:k("Add one under Servers, or import what you already have with `ssh-manager import`.")}):h.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:e.map(A=>{const j=i.filter(M=>M.type==="ssh-terminal"&&M.serverId===A.id).length;return h.jsxs("div",{className:"group flex items-center gap-3 rounded-lg border border-border bg-card p-3 text-left transition-colors hover:bg-card-hover",children:[h.jsxs("button",{onClick:()=>N(A.id,A.name),className:"flex min-w-0 flex-1 items-center gap-3 text-left",children:[h.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-primary/10",children:h.jsx(Yn,{className:"h-4.5 w-4.5 text-primary"})}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-sm font-medium",children:A.name}),h.jsxs("span",{className:"block truncate font-mono text-xs text-muted-foreground",children:[A.username?`${A.username}@`:"",A.host]})]})]}),j>0&&h.jsx(ai,{variant:"secondary",className:"shrink-0",children:j>1?`${j} open`:"open"}),h.jsx(ve,{variant:"ghost",size:"icon","aria-label":k("Another shell on {{v0}}",{v0:A.name}),title:k("Another shell on {{v0}}",{v0:A.name}),className:"shrink-0 opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100",onClick:()=>N(A.id,A.name,!0),children:h.jsx(Hs,{className:"h-3.5 w-3.5"})})]},A.id)})})]})]}),h.jsxs(Ni,{value:"commands",className:"mt-0 space-y-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("p",{className:"text-xs text-muted-foreground",children:k("Picked from a list inside any shell, instead of typed again.")}),h.jsxs(ve,{size:"sm",className:"ml-auto",onClick:()=>b(!0),children:[h.jsx(Hs,{className:"h-3.5 w-3.5"}),k("New command")]})]}),l.length===0?h.jsx(Xn,{icon:ZC,title:k("Nothing saved yet"),hint:k("Save the ones you type most. They appear in every shell, on the servers you choose."),action:h.jsxs(ve,{size:"sm",onClick:()=>b(!0),children:[h.jsx(Hs,{className:"h-3.5 w-3.5"}),k("Save a command")]})}):h.jsx("div",{className:"overflow-hidden rounded-lg border border-border",children:l.map(A=>{var j;return h.jsxs("div",{className:"group flex items-center gap-3 border-b border-border-subtle px-3 py-2 last:border-b-0 hover:bg-card-hover",children:[h.jsx("span",{className:"w-40 shrink-0 truncate text-sm",children:A.name}),h.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:A.command}),A.confirmBeforeRun&&h.jsx(ai,{variant:"outline",className:"shrink-0",children:k("asks first")}),h.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:(j=A.serverNames)!=null&&j.length?A.serverNames.join(", "):k("every server")}),h.jsxs("span",{className:"flex shrink-0 gap-0.5 opacity-0 transition-opacity group-hover:opacity-100",children:[h.jsx(ve,{variant:"ghost",size:"icon","aria-label":k("Edit {{v0}}",{v0:A.name}),onClick:()=>_(A),children:h.jsx(da,{className:"h-3.5 w-3.5"})}),h.jsx(ve,{variant:"ghost",size:"icon","aria-label":k("Delete {{name}}",{name:A.name}),onClick:async()=>{window.confirm(k("Delete “{{name}}”?",{name:A.name}))&&(await $n.remove(A.id),S())},children:h.jsx(Wn,{className:"h-3.5 w-3.5"})})]})]},A.id)})}),f.length>0&&h.jsxs("div",{children:[h.jsx("h2",{className:"mb-2 text-xs font-medium tracking-wider uppercase text-muted-foreground",children:k("Suggestions")}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:f.map(A=>h.jsxs(ve,{variant:"outline",size:"sm",onClick:async()=>{await $n.save(A),S()},children:[h.jsx(Hs,{className:"h-3 w-3"}),A.name]},A.name))})]})]})]})]}),(v||d)&&h.jsx(dk,{existing:d??void 0,onClose:()=>{b(!1),_(null)},onSaved:()=>{b(!1),_(null),S()}})]})}const pm=e=>e.split(/[\\/]/).pop()||e;function CU({paths:e,onClose:t}){je();const{servers:i,load:n}=Bt(),{tabs:o,addTab:l,activateTab:u}=Ue(),[f,p]=w.useState(null),[d,_]=w.useState(null);w.useEffect(()=>{n()},[n]),w.useEffect(()=>{const S=E=>{E.key==="Escape"&&t()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[t]);const v=new Set(o.filter(S=>S.type==="dual-browser").map(S=>S.serverId)),b=new Set(o.filter(S=>S.type==="ssh-terminal").map(S=>S.serverId)),x=[...i].sort((S,E)=>{const N=T=>v.has(T.id)?0:b.has(T.id)?1:2;return N(S)-N(E)||S.name.localeCompare(E.name)}),y=async S=>{p(S.id),_(null);try{const E=S.defaultDirectory||".";await RC.start({server:S.name,direction:"upload",items:e.map(T=>({local:T,remote:`${E.replace(/\/$/,"")}/${pm(T)}`}))});const N=o.find(T=>T.type==="dual-browser"&&T.serverId===S.id);N?u(N.id):l({id:`tab-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:"dual-browser",title:S.name,serverId:S.id}),t()}catch(E){_(E.message),p(null)}};return h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-6",children:h.jsxs("div",{className:"w-full max-w-lg overflow-hidden rounded-xl border border-border bg-card shadow-lg",children:[h.jsxs("div",{className:"flex items-start gap-3 border-b border-border px-5 py-4",children:[h.jsx("span",{className:"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-primary/10",children:h.jsx(ic,{className:"h-4.5 w-4.5 text-primary"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h2",{className:"text-sm font-medium",children:e.length===1?k("Send {{name}} where?",{name:pm(e[0])}):k("Send {{n}} files where?",{n:e.length})}),e.length>1&&h.jsx("p",{className:"mt-0.5 truncate font-mono text-xs text-muted-foreground",children:e.map(pm).join(", ")})]}),h.jsx(ve,{variant:"ghost",size:"icon","aria-label":k("Cancel"),onClick:t,children:h.jsx(br,{className:"h-4 w-4"})})]}),d&&h.jsx("p",{className:"border-b border-destructive/30 bg-destructive-light px-5 py-2 text-xs",children:d}),h.jsxs("div",{className:"max-h-80 overflow-y-auto p-2",children:[x.length===0&&h.jsx("p",{className:"p-4 text-center text-xs text-muted-foreground",children:k("No servers configured yet.")}),x.map(S=>{const E=v.has(S.id),N=b.has(S.id),T=E?gr:N?Yn:JC;return h.jsxs("button",{disabled:f!==null,onClick:()=>void y(S),className:"flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left transition-colors hover:bg-card-hover disabled:opacity-50",children:[h.jsx(T,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-sm",children:S.name}),h.jsx("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:S.defaultDirectory||"~"})]}),h.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:E?k("files open"):N?k("shell open"):""})]},S.id)})]})]})})}const fw="ssh-manager.desktop-offer-dismissed",kU={manifest:"Finding the release…",download:"Downloading…",verify:"Checking the checksum and the signature…",install:"Installing…",open:"Opening the app…"};function EU(){je();const[e,t]=w.useState(null),[i,n]=w.useState(()=>Jn(fw)==="true"),[o,l]=w.useState(null),[u,f]=w.useState(null),[p,d]=w.useState(null),[_,v]=w.useState(!1),b=Ue(T=>T.handedOver),x=Ue(T=>T.setHandedOver);if(w.useEffect(()=>{if(Bx||i)return;let T=!1;return qp.status().then(A=>{T||!A||(t(A),A.handingOver?x(!0):A.installing&&l(A.phase??"manifest"))}).catch(()=>{}),()=>{T=!0}},[i,x]),w.useEffect(()=>kt.subscribe(T=>{if(T.type!=="desktop")return;if(T.phase==="handover"){x(!0);return}if(T.phase==="error"){d(typeof T.error=="string"?T.error:k("The desktop app was not installed.")),l(null);return}typeof T.phase=="string"&&l(T.phase);const A=Number(T.received),j=Number(T.total);f(j>0&&Number.isFinite(A)?Math.min(1,A/j):null)}),[x]),b)return h.jsxs("div",{role:"status",className:"flex shrink-0 items-center gap-3 border-b border-border bg-success-light px-8 py-3 text-sm text-success",children:[h.jsx(ua,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),h.jsxs("span",{children:[h.jsx("b",{children:k("Continued in the desktop app.")})," ",k("You can close this tab.")]})]});if(Bx||i||!e||!e.supported&&!e.installed)return null;const y=o!==null,S=()=>{eo(fw,"true"),n(!0)},E=async()=>{d(null),l(e.installed?"open":"manifest");try{e.installed?await qp.open():await qp.install()}catch(T){d(T.message),l(null)}},N=async()=>{try{await navigator.clipboard.writeText("ssh-manager app"),v(!0),setTimeout(()=>v(!1),1500)}catch{}};return h.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-x-4 gap-y-2 border-b border-border bg-card px-8 py-3 text-sm",children:[h.jsx(qB,{className:"h-5 w-5 shrink-0 text-primary","aria-hidden":"true"}),h.jsxs("p",{className:"min-w-0 flex-[1_1_320px]",children:[h.jsx("b",{children:k("SSH Manager is also a desktop app:")})," ",k("menu bar, native notifications, updates itself."),e.installed&&e.version&&h.jsxs("span",{className:"text-muted-foreground",children:[" ",k("Version {{version}} is installed.",{version:e.version})]})]}),y&&h.jsxs("div",{className:"ml-auto flex min-w-[220px] items-center gap-3",role:"status","aria-live":"polite",children:[h.jsx(oi,{className:"h-4 w-4 animate-spin text-muted-foreground motion-reduce:animate-none","aria-hidden":"true"}),h.jsx("span",{className:"text-muted-foreground",children:k(kU[o??""]??"Working…")}),o==="download"&&u!==null&&h.jsx("div",{className:"h-1.5 w-28 overflow-hidden rounded-full bg-sunk",role:"progressbar","aria-label":k("Download"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(u*100),children:h.jsx("div",{className:"h-full rounded-full bg-primary transition-[width]",style:{width:`${Math.round(u*100)}%`}})})]}),!y&&h.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.method==="terminal"&&!e.installed?h.jsxs(h.Fragment,{children:[h.jsx("code",{className:"rounded-md border border-border bg-secondary px-2.5 py-1.5 font-mono text-[13px]",children:"ssh-manager app"}),h.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>void N(),children:[_?h.jsx(ua,{className:"h-3.5 w-3.5"}):h.jsx(UC,{className:"h-3.5 w-3.5"}),k(_?"Copied":"Copy")]})]}):h.jsx(ve,{size:"sm",className:"font-bold",onClick:()=>void E(),children:e.installed?k("Open the app"):k("Install the app")}),h.jsxs(ve,{variant:"ghost",size:"sm",onClick:S,children:[h.jsx(br,{className:"h-3.5 w-3.5"}),k("Not now")]})]}),p&&h.jsxs("p",{className:"w-full text-destructive",role:"alert",children:[p," ",k("Nothing was installed.")]})]})}const Tk="ssh-manager.wizard-seen",pw=()=>Jn(Tk)==="true",Xu=[{eyebrow:"A place for your servers",title:"Your servers. Your workspace.",body:"Open a terminal, move files and see what your agents are doing — all from one place on your machine.",detail:"Already using npm or the CLI? Your setup keeps working. You can explore this interface whenever you want."},{eyebrow:"Start with what you have",title:"Bring your servers along.",body:"Add your first connection or import servers from an SSH config, another SSH client or a spreadsheet.",detail:"You review the servers before importing. Your original files stay in place, so you can keep using your existing tools."},{eyebrow:"You decide how far agents go",title:"Stay in control.",body:"Choose which agent requests need your approval. See the server and the full command before you approve or refuse.",detail:"Approval is off by default. Once enabled on a server, requests that need approval are refused if the control plane is unavailable."}];function NU({step:e}){return je(),h.jsxs("svg",{viewBox:"0 0 360 260",fill:"none","aria-hidden":"true",className:"w-full max-w-sm welcome-illustration",children:[h.jsx("circle",{cx:"180",cy:"130",r:"105",className:"fill-primary/5"}),h.jsx("circle",{cx:"180",cy:"130",r:"84",className:"stroke-primary/15",strokeDasharray:"3 8"}),e===0?h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"43",y:"48",width:"250",height:"167",rx:"14",className:"fill-card stroke-border"}),h.jsx("path",{d:"M43 81h250",className:"stroke-border"}),[60,73,86].map(t=>h.jsx("circle",{cx:t,cy:"65",r:"3",className:"fill-primary/50"},t)),h.jsx("rect",{x:"59",y:"98",width:"95",height:"100",rx:"8",className:"fill-muted"}),[119,147,175].map(t=>h.jsxs("g",{children:[h.jsx("rect",{x:"72",y:t-8,width:"16",height:"13",rx:"3",className:"stroke-muted-foreground"}),h.jsx("path",{d:`M98 ${t-4}h39m-39 8h25`,className:"stroke-muted-foreground/45",strokeLinecap:"round"})]},t)),h.jsx("path",{d:"m173 112 7 6-7 6m17 0h12",className:"stroke-primary",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M173 141h87m-87 12h65m-65 12h77",className:"stroke-muted-foreground/30",strokeWidth:"4",strokeLinecap:"round"}),h.jsx("rect",{x:"230",y:"174",width:"87",height:"42",rx:"10",className:"fill-card stroke-primary/40"}),h.jsx("path",{d:"m246 195 5 5 10-12",className:"stroke-success",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M271 191h30m-30 8h21",className:"stroke-muted-foreground/45",strokeWidth:"3",strokeLinecap:"round"})]}):e===1?h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"39",y:"82",width:"111",height:"129",rx:"12",transform:"rotate(-7 39 82)",className:"fill-card stroke-border"}),h.jsx("path",{d:"M62 111h49m-46 17h63m-60 17h53m-51 17h35",className:"stroke-muted-foreground/40",strokeWidth:"4",strokeLinecap:"round"}),h.jsx("path",{d:"M149 140h54m-9-9 11 9-11 9",className:"stroke-primary",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("rect",{x:"217",y:"56",width:"99",height:"154",rx:"13",className:"fill-card stroke-border"}),[78,116,154].map(t=>h.jsxs("g",{children:[h.jsx("rect",{x:"230",y:t,width:"73",height:"28",rx:"6",className:"fill-muted stroke-border"}),h.jsx("circle",{cx:"245",cy:t+14,r:"3",className:"fill-success"}),h.jsx("path",{d:`M257 ${t+14}h31`,className:"stroke-muted-foreground/40",strokeWidth:"3",strokeLinecap:"round"})]},t)),h.jsx("circle",{cx:"117",cy:"208",r:"21",className:"fill-card stroke-primary/40"}),h.jsx("path",{d:"m109 208 5 5 11-12",className:"stroke-primary",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}):h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"40",y:"62",width:"248",height:"140",rx:"14",className:"fill-card stroke-border"}),h.jsx("path",{d:"M40 95h248",className:"stroke-border"}),h.jsx("circle",{cx:"58",cy:"79",r:"4",className:"fill-primary"}),h.jsx("path",{d:"M73 79h78",className:"stroke-muted-foreground/45",strokeWidth:"4",strokeLinecap:"round"}),h.jsx("path",{d:"m59 118 7 6-7 6m17 0h12",className:"stroke-primary",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M100 122h109m-150 28h149",className:"stroke-muted-foreground/35",strokeWidth:"4",strokeLinecap:"round"}),h.jsx("rect",{x:"58",y:"166",width:"59",height:"20",rx:"6",className:"fill-muted"}),h.jsx("rect",{x:"126",y:"166",width:"73",height:"20",rx:"6",className:"fill-primary/25"}),h.jsx("path",{d:"m268 118 40 15v34c0 27-40 48-40 48s-40-21-40-48v-34l40-15Z",className:"fill-card stroke-primary",strokeWidth:"2"}),h.jsx("path",{d:"m252 165 11 11 22-26",className:"stroke-primary",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})]})}function RU({onClose:e}){je();const[t,i]=w.useState(0),n=Ue(d=>d.setView),o=Ue(d=>d.setWantsImport),l=Ue(d=>d.setWantsAdd),u=Xu[t],f=t===Xu.length-1,p=()=>{eo(Tk,"true"),e()};return h.jsx(rc,{open:!0,onOpenChange:d=>!d&&p(),children:h.jsx(nc,{className:"welcome-dialog gap-0 overflow-hidden p-0 sm:max-w-3xl",onCloseAutoFocus:d=>d.preventDefault(),children:h.jsxs("div",{className:"grid sm:grid-cols-[0.9fr_1.1fr]",children:[h.jsxs("div",{className:"flex flex-col justify-between border-b border-border bg-sidebar px-6 py-5 sm:border-r sm:border-b-0",children:[h.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium",children:[h.jsx(sc,{className:"h-4 w-4 text-primary"})," SSH Manager"]}),h.jsx("div",{className:"mx-auto w-full max-w-[200px] sm:max-w-none",children:h.jsx(NU,{step:t})},t),h.jsxs("p",{className:"hidden items-center gap-2 text-xs text-muted-foreground sm:flex",children:[h.jsx(av,{className:"h-3.5 w-3.5"})," ",k("On your machine. In your hands.")]})]}),h.jsxs("div",{className:"flex flex-col px-7 py-7 sm:py-10",children:[h.jsx("p",{className:"mb-3 text-xs font-medium uppercase tracking-widest text-muted-foreground",children:k(u.eyebrow)}),h.jsxs("div",{className:"welcome-copy",children:[h.jsx(oc,{className:"max-w-xs font-display text-3xl leading-tight font-normal",children:k(u.title)}),h.jsx(ac,{className:"mt-4 text-sm leading-relaxed",children:k(u.body)}),h.jsx("p",{className:"mt-4 text-xs leading-relaxed text-muted-foreground",children:k(u.detail)})]},t),h.jsxs("div",{className:"mt-7 flex flex-wrap items-center gap-2",children:[t>0&&h.jsxs(ve,{variant:"ghost",size:"sm",onClick:()=>i(t-1),children:[h.jsx(GB,{className:"h-3.5 w-3.5"})," ",k("Back")]}),t===1&&h.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>{n("servers"),o(!0),p()},children:[h.jsx(to,{className:"h-3.5 w-3.5"})," ",k("Import servers")]}),f?h.jsxs(ve,{size:"sm",onClick:()=>{n("servers"),l(!0),p()},children:[h.jsx(Hs,{className:"h-3.5 w-3.5"})," ",k("Add a server")]}):h.jsxs(ve,{size:"sm",onClick:()=>i(t+1),children:[k("Next")," ",h.jsx($C,{className:"h-3.5 w-3.5"})]})]}),h.jsxs("div",{className:"mt-auto flex items-center justify-between gap-3 pt-6",children:[h.jsx("span",{"aria-label":k("Step {{step}} of {{total}}",{step:t+1,total:Xu.length}),className:"flex items-center gap-1.5",children:Xu.map((d,_)=>h.jsx("span",{className:`flex h-5 w-5 items-center justify-center rounded-full text-[10px] ${_<=t?"bg-primary/15 text-foreground":"bg-muted text-muted-foreground"}`,children:_<t?h.jsx(ua,{className:"h-3 w-3"}):_+1},_))}),h.jsx("button",{className:"rounded text-xs text-muted-foreground underline-offset-4 hover:text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-ring",onClick:p,children:k("I’ll explore first")})]})]})]})})})}const AU={"dual-browser":gr,"ssh-terminal":Yn,"local-terminal":sc};function DU(){je();const{tabs:e,activeTabId:t,activateTab:i,removeTab:n,setView:o}=Ue();return e.length===0?null:h.jsxs("div",{className:fe("titlebar-safe flex shrink-0 items-stretch border-b border-border bg-sidebar",v2&&"drag-region h-12"),children:[h.jsx("div",{className:"flex min-w-0 flex-1 items-stretch overflow-x-auto scrollbar-none",children:e.map(l=>h.jsx(TU,{tab:l,active:t===l.id,onActivate:()=>i(l.id),onClose:()=>n(l.id)},l.id))}),h.jsxs(Qh,{children:[h.jsx(Jh,{asChild:!0,children:h.jsx("button",{"aria-label":k("Open another session"),onClick:()=>o("terminal"),className:"flex w-9 shrink-0 items-center justify-center border-l border-border text-muted-foreground transition-colors hover:bg-accent/30 hover:text-foreground",children:h.jsx(Hs,{className:"h-4 w-4"})})}),h.jsx(ed,{side:"bottom",children:k("Open another session")})]})]})}function TU({tab:e,active:t,onActivate:i,onClose:n}){je();const o=AU[e.type];return h.jsxs("div",{className:fe("group relative flex min-w-0 max-w-52 shrink-0 items-center gap-2 border-r border-border pl-3 pr-1.5 text-xs transition-colors",t?"bg-background text-foreground":"text-muted-foreground hover:bg-accent/20 hover:text-foreground"),children:[t&&h.jsx("span",{className:"absolute inset-x-0 top-0 h-0.5 bg-primary"}),h.jsxs("button",{onClick:i,className:"flex min-w-0 items-center gap-2 py-2",children:[h.jsx(o,{className:"h-3.5 w-3.5 shrink-0"}),h.jsx("span",{className:"truncate",children:e.title})]}),h.jsx("button",{"aria-label":k("Close {{v0}}",{v0:e.title}),onClick:n,className:"flex h-5 w-5 shrink-0 items-center justify-center rounded opacity-0 transition-opacity hover:bg-accent/40 group-hover:opacity-100 focus-visible:opacity-100",children:h.jsx(br,{className:"h-3 w-3"})})]})}function jU(){je();const{view:e,tabs:t,activeTabId:i,setPendingCount:n}=Ue(),o=Bt(y=>y.servers),l=Bt(y=>y.load),u=Bt(y=>y.loading),f=Bt(y=>y.error);w.useEffect(()=>{l()},[l]),w.useEffect(()=>{kH()},[]);const p=Ue(y=>y.setView);w.useEffect(()=>{let y=!1;const S=new Set,E=async()=>{try{const T=await kt.get();if(y)return;n(T.pending.length);const A=new Set(T.pending.map(j=>j.id));for(const j of[...S])A.has(j)||(Nk(j),S.delete(j));for(const j of T.pending)S.has(j.id)||(S.add(j.id),await Ek()&&J9(j,()=>p("waiting")))}catch{}};E();const N=kt.subscribe(T=>{(AC.includes(T.type)||T.type==="connection"&&T.status==="connected")&&E(),T.type==="servers"&&l()});return()=>{y=!0,N(),eU()}},[n,p,l]);const[d,_]=w.useState(!1);w.useEffect(()=>{if(pw()||u||f||o.length>0)return;let y=!1;return Pm.state().then(S=>{!y&&S.pending.length===0&&!pw()&&_(!0)}).catch(()=>{}),()=>{y=!0}},[o.length,u,f]);const[v,b]=w.useState(null);w.useEffect(()=>kt.subscribe(y=>{y.type==="dropped-files"&&Array.isArray(y.paths)&&y.paths.length&&b(y.paths)}),[]);const x=y=>{var S;return((S=o.find(E=>E.id===y))==null?void 0:S.name)??y??""};return h.jsxs("div",{className:"flex h-screen w-screen flex-col overflow-hidden bg-background text-foreground",children:[h.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[h.jsx(TH,{}),h.jsxs("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[h.jsx(NH,{}),h.jsx(EU,{}),h.jsx(DU,{}),h.jsxs("div",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col",children:[t.map(y=>h.jsx("div",{className:"absolute inset-0 flex flex-col",style:{display:i===y.id?"flex":"none"},inert:i!==y.id,children:y.type==="local-terminal"?h.jsx(IS,{server:y.title,local:!0,hidden:i!==y.id}):y.type==="ssh-terminal"?h.jsx(IS,{server:x(y.serverId),hidden:i!==y.id}):h.jsx(K9,{server:x(y.serverId)})},y.id)),i===null&&h.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[e==="servers"&&h.jsx(e7,{}),e==="waiting"&&h.jsx(Q9,{}),e==="health"&&h.jsx(rU,{}),e==="live"&&h.jsx(nU,{}),e==="activity"&&h.jsx(oU,{}),e==="terminal"&&h.jsx(wU,{}),e==="options"&&h.jsx(SU,{})]})]})]})]}),d&&!v&&h.jsx(RU,{onClose:()=>_(!1)}),v&&h.jsx(CU,{paths:v,onClose:()=>b(null)})]})}RB().then(async()=>{await MB(),BB(),PB(),HB(),Bt.setState({viewMode:Wl.getState().serverViewMode}),aR.createRoot(document.getElementById("root")).render(h.jsx(w.StrictMode,{children:h.jsx(Rj,{delayDuration:300,children:h.jsx(jU,{})})}))});
|