@jean2/client 0.6.0 → 0.6.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.
|
@@ -483,7 +483,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
|
|
|
483
483
|
- less than the value passed to \`max\` (or ${Tv} if no \`max\` prop is set)
|
|
484
484
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
485
485
|
|
|
486
|
-
Defaulting to \`null\`.`}var xN=Y2,SN=Z2;function wN(t,e){return D.useReducer((n,i)=>{const o=e[n][i];return o!=null?o:n},t)}var Rv="ScrollArea",[J2]=yr(Rv),[CN,Hr]=J2(Rv),ew=D.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:i="hover",dir:o,scrollHideDelay:l=600,...d}=t,[a,u]=D.useState(null),[f,p]=D.useState(null),[h,y]=D.useState(null),[S,C]=D.useState(null),[w,_]=D.useState(null),[v,b]=D.useState(0),[x,E]=D.useState(0),[N,A]=D.useState(!1),[M,T]=D.useState(!1),j=_t(e,F=>u(F)),O=Ou(o);return g.jsx(CN,{scope:n,type:i,dir:O,scrollHideDelay:l,scrollArea:a,viewport:f,onViewportChange:p,content:h,onContentChange:y,scrollbarX:S,onScrollbarXChange:C,scrollbarXEnabled:N,onScrollbarXEnabledChange:A,scrollbarY:w,onScrollbarYChange:_,scrollbarYEnabled:M,onScrollbarYEnabledChange:T,onCornerWidthChange:b,onCornerHeightChange:E,children:g.jsx(qe.div,{dir:O,...d,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":x+"px",...t.style}})})});ew.displayName=Rv;var tw="ScrollAreaViewport",nw=D.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:i,nonce:o,...l}=t,d=Hr(tw,n),a=D.useRef(null),u=_t(e,a,d.onViewportChange);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),g.jsx(qe.div,{"data-radix-scroll-area-viewport":"",...l,ref:u,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...t.style},children:g.jsx("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});nw.displayName=tw;var Mi="ScrollAreaScrollbar",rw=D.forwardRef((t,e)=>{const{forceMount:n,...i}=t,o=Hr(Mi,t.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:d}=o,a=t.orientation==="horizontal";return D.useEffect(()=>(a?l(!0):d(!0),()=>{a?l(!1):d(!1)}),[a,l,d]),o.type==="hover"?g.jsx(kN,{...i,ref:e,forceMount:n}):o.type==="scroll"?g.jsx(EN,{...i,ref:e,forceMount:n}):o.type==="auto"?g.jsx(iw,{...i,ref:e,forceMount:n}):o.type==="always"?g.jsx(Nv,{...i,ref:e}):null});rw.displayName=Mi;var kN=D.forwardRef((t,e)=>{const{forceMount:n,...i}=t,o=Hr(Mi,t.__scopeScrollArea),[l,d]=D.useState(!1);return D.useEffect(()=>{const a=o.scrollArea;let u=0;if(a){const f=()=>{window.clearTimeout(u),d(!0)},p=()=>{u=window.setTimeout(()=>d(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",f),a.addEventListener("pointerleave",p),()=>{window.clearTimeout(u),a.removeEventListener("pointerenter",f),a.removeEventListener("pointerleave",p)}}},[o.scrollArea,o.scrollHideDelay]),g.jsx(Cn,{present:n||l,children:g.jsx(iw,{"data-state":l?"visible":"hidden",...i,ref:e})})}),EN=D.forwardRef((t,e)=>{const{forceMount:n,...i}=t,o=Hr(Mi,t.__scopeScrollArea),l=t.orientation==="horizontal",d=hh(()=>u("SCROLL_END"),100),[a,u]=wN("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return D.useEffect(()=>{if(a==="idle"){const f=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(f)}},[a,o.scrollHideDelay,u]),D.useEffect(()=>{const f=o.viewport,p=l?"scrollLeft":"scrollTop";if(f){let h=f[p];const y=()=>{const S=f[p];h!==S&&(u("SCROLL"),d()),h=S};return f.addEventListener("scroll",y),()=>f.removeEventListener("scroll",y)}},[o.viewport,l,u,d]),g.jsx(Cn,{present:n||a!=="hidden",children:g.jsx(Nv,{"data-state":a==="hidden"?"hidden":"visible",...i,ref:e,onPointerEnter:je(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:je(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),iw=D.forwardRef((t,e)=>{const n=Hr(Mi,t.__scopeScrollArea),{forceMount:i,...o}=t,[l,d]=D.useState(!1),a=t.orientation==="horizontal",u=hh(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,p=n.viewport.offsetHeight<n.viewport.scrollHeight;d(a?f:p)}},10);return Il(n.viewport,u),Il(n.content,u),g.jsx(Cn,{present:i||l,children:g.jsx(Nv,{"data-state":l?"visible":"hidden",...o,ref:e})})}),Nv=D.forwardRef((t,e)=>{const{orientation:n="vertical",...i}=t,o=Hr(Mi,t.__scopeScrollArea),l=D.useRef(null),d=D.useRef(0),[a,u]=D.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=cw(a.viewport,a.content),p={...i,sizes:a,onSizesChange:u,hasThumb:f>0&&f<1,onThumbChange:y=>l.current=y,onThumbPointerUp:()=>d.current=0,onThumbPointerDown:y=>d.current=y};function h(y,S){return MN(y,d.current,a,S)}return n==="horizontal"?g.jsx(AN,{...p,ref:e,onThumbPositionChange:()=>{if(o.viewport&&l.current){const y=o.viewport.scrollLeft,S=db(y,a,o.dir);l.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollLeft=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollLeft=h(y,o.dir))}}):n==="vertical"?g.jsx(TN,{...p,ref:e,onThumbPositionChange:()=>{if(o.viewport&&l.current){const y=o.viewport.scrollTop,S=db(y,a);l.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollTop=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollTop=h(y))}}):null}),AN=D.forwardRef((t,e)=>{const{sizes:n,onSizesChange:i,...o}=t,l=Hr(Mi,t.__scopeScrollArea),[d,a]=D.useState(),u=D.useRef(null),f=_t(e,u,l.onScrollbarXChange);return D.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),g.jsx(ow,{"data-orientation":"horizontal",...o,ref:f,sizes:n,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":fh(n)+"px",...t.style},onThumbPointerDown:p=>t.onThumbPointerDown(p.x),onDragScroll:p=>t.onDragScroll(p.x),onWheelScroll:(p,h)=>{if(l.viewport){const y=l.viewport.scrollLeft+p.deltaX;t.onWheelScroll(y),dw(y,h)&&p.preventDefault()}},onResize:()=>{u.current&&l.viewport&&d&&i({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:jf(d.paddingLeft),paddingEnd:jf(d.paddingRight)}})}})}),TN=D.forwardRef((t,e)=>{const{sizes:n,onSizesChange:i,...o}=t,l=Hr(Mi,t.__scopeScrollArea),[d,a]=D.useState(),u=D.useRef(null),f=_t(e,u,l.onScrollbarYChange);return D.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),g.jsx(ow,{"data-orientation":"vertical",...o,ref:f,sizes:n,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":fh(n)+"px",...t.style},onThumbPointerDown:p=>t.onThumbPointerDown(p.y),onDragScroll:p=>t.onDragScroll(p.y),onWheelScroll:(p,h)=>{if(l.viewport){const y=l.viewport.scrollTop+p.deltaY;t.onWheelScroll(y),dw(y,h)&&p.preventDefault()}},onResize:()=>{u.current&&l.viewport&&d&&i({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:jf(d.paddingTop),paddingEnd:jf(d.paddingBottom)}})}})}),[RN,sw]=J2(Mi),ow=D.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:i,hasThumb:o,onThumbChange:l,onThumbPointerUp:d,onThumbPointerDown:a,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:p,onResize:h,...y}=t,S=Hr(Mi,n),[C,w]=D.useState(null),_=_t(e,j=>w(j)),v=D.useRef(null),b=D.useRef(""),x=S.viewport,E=i.content-i.viewport,N=Mn(p),A=Mn(u),M=hh(h,10);function T(j){if(v.current){const O=j.clientX-v.current.left,F=j.clientY-v.current.top;f({x:O,y:F})}}return D.useEffect(()=>{const j=O=>{const F=O.target;(C==null?void 0:C.contains(F))&&N(O,E)};return document.addEventListener("wheel",j,{passive:!1}),()=>document.removeEventListener("wheel",j,{passive:!1})},[x,C,E,N]),D.useEffect(A,[i,A]),Il(C,M),Il(S.content,M),g.jsx(RN,{scope:n,scrollbar:C,hasThumb:o,onThumbChange:Mn(l),onThumbPointerUp:Mn(d),onThumbPositionChange:A,onThumbPointerDown:Mn(a),children:g.jsx(qe.div,{...y,ref:_,style:{position:"absolute",...y.style},onPointerDown:je(t.onPointerDown,j=>{j.button===0&&(j.target.setPointerCapture(j.pointerId),v.current=C.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),T(j))}),onPointerMove:je(t.onPointerMove,T),onPointerUp:je(t.onPointerUp,j=>{const O=j.target;O.hasPointerCapture(j.pointerId)&&O.releasePointerCapture(j.pointerId),document.body.style.webkitUserSelect=b.current,S.viewport&&(S.viewport.style.scrollBehavior=""),v.current=null})})})}),Mf="ScrollAreaThumb",aw=D.forwardRef((t,e)=>{const{forceMount:n,...i}=t,o=sw(Mf,t.__scopeScrollArea);return g.jsx(Cn,{present:n||o.hasThumb,children:g.jsx(NN,{ref:e,...i})})}),NN=D.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:i,...o}=t,l=Hr(Mf,n),d=sw(Mf,n),{onThumbPositionChange:a}=d,u=_t(e,h=>d.onThumbChange(h)),f=D.useRef(void 0),p=hh(()=>{f.current&&(f.current(),f.current=void 0)},100);return D.useEffect(()=>{const h=l.viewport;if(h){const y=()=>{if(p(),!f.current){const S=jN(h,a);f.current=S,a()}};return a(),h.addEventListener("scroll",y),()=>h.removeEventListener("scroll",y)}},[l.viewport,p,a]),g.jsx(qe.div,{"data-state":d.hasThumb?"visible":"hidden",...o,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:je(t.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),C=h.clientX-S.left,w=h.clientY-S.top;d.onThumbPointerDown({x:C,y:w})}),onPointerUp:je(t.onPointerUp,d.onThumbPointerUp)})});aw.displayName=Mf;var Dv="ScrollAreaCorner",lw=D.forwardRef((t,e)=>{const n=Hr(Dv,t.__scopeScrollArea),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&i?g.jsx(DN,{...t,ref:e}):null});lw.displayName=Dv;var DN=D.forwardRef((t,e)=>{const{__scopeScrollArea:n,...i}=t,o=Hr(Dv,n),[l,d]=D.useState(0),[a,u]=D.useState(0),f=!!(l&&a);return Il(o.scrollbarX,()=>{var h;const p=((h=o.scrollbarX)==null?void 0:h.offsetHeight)||0;o.onCornerHeightChange(p),u(p)}),Il(o.scrollbarY,()=>{var h;const p=((h=o.scrollbarY)==null?void 0:h.offsetWidth)||0;o.onCornerWidthChange(p),d(p)}),f?g.jsx(qe.div,{...i,ref:e,style:{width:l,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function jf(t){return t?parseInt(t,10):0}function cw(t,e){const n=t/e;return isNaN(n)?0:n}function fh(t){const e=cw(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=(t.scrollbar.size-n)*e;return Math.max(i,18)}function MN(t,e,n,i="ltr"){const o=fh(n),l=o/2,d=e||l,a=o-d,u=n.scrollbar.paddingStart+d,f=n.scrollbar.size-n.scrollbar.paddingEnd-a,p=n.content-n.viewport,h=i==="ltr"?[0,p]:[p*-1,0];return uw([u,f],h)(t)}function db(t,e,n="ltr"){const i=fh(e),o=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,l=e.scrollbar.size-o,d=e.content-e.viewport,a=l-i,u=n==="ltr"?[0,d]:[d*-1,0],f=Ag(t,u);return uw([0,d],[0,a])(f)}function uw(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(t[1]-t[0]);return e[0]+i*(n-t[0])}}function dw(t,e){return t>0&&t<e}var jN=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},i=0;return(function o(){const l={left:t.scrollLeft,top:t.scrollTop},d=n.left!==l.left,a=n.top!==l.top;(d||a)&&e(),n=l,i=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(i)};function hh(t,e){const n=Mn(t),i=D.useRef(0);return D.useEffect(()=>()=>window.clearTimeout(i.current),[]),D.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(n,e)},[n,e])}function Il(t,e){const n=Mn(e);wn(()=>{let i=0;if(t){const o=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(n)});return o.observe(t),()=>{window.cancelAnimationFrame(i),o.unobserve(t)}}},[t,n])}var ON=ew,LN=nw,IN=lw,BN=[" ","Enter","ArrowUp","ArrowDown"],zN=[" ","Enter"],ma="Select",[ph,mh,PN]=ev(ma),[Zl]=yr(ma,[PN,ko]),gh=ko(),[FN,Ao]=Zl(ma),[HN,UN]=Zl(ma),fw=t=>{const{__scopeSelect:e,children:n,open:i,defaultOpen:o,onOpenChange:l,value:d,defaultValue:a,onValueChange:u,dir:f,name:p,autoComplete:h,disabled:y,required:S,form:C}=t,w=gh(e),[_,v]=D.useState(null),[b,x]=D.useState(null),[E,N]=D.useState(!1),A=Ou(f),[M,T]=ws({prop:i,defaultProp:o!=null?o:!1,onChange:l,caller:ma}),[j,O]=ws({prop:d,defaultProp:a,onChange:u,caller:ma}),F=D.useRef(null),U=_?C||!!_.closest("form"):!0,[$,G]=D.useState(new Set),K=Array.from($).map(V=>V.props.value).join(";");return g.jsx(ih,{...w,children:g.jsxs(FN,{required:S,scope:e,trigger:_,onTriggerChange:v,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:E,onValueNodeHasChildrenChange:N,contentId:gn(),value:j,onValueChange:O,open:M,onOpenChange:T,dir:A,triggerPointerDownPosRef:F,disabled:y,children:[g.jsx(ph.Provider,{scope:e,children:g.jsx(HN,{scope:t.__scopeSelect,onNativeOptionAdd:D.useCallback(V=>{G(X=>new Set(X).add(V))},[]),onNativeOptionRemove:D.useCallback(V=>{G(X=>{const Z=new Set(X);return Z.delete(V),Z})},[]),children:n})}),U?g.jsxs(Iw,{"aria-hidden":!0,required:S,tabIndex:-1,name:p,autoComplete:h,value:j,onChange:V=>O(V.target.value),disabled:y,form:C,children:[j===void 0?g.jsx("option",{value:""}):null,Array.from($)]},K):null]})})};fw.displayName=ma;var hw="SelectTrigger",pw=D.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:i=!1,...o}=t,l=gh(n),d=Ao(hw,n),a=d.disabled||i,u=_t(e,d.onTriggerChange),f=mh(n),p=D.useRef("touch"),[h,y,S]=zw(w=>{const _=f().filter(x=>!x.disabled),v=_.find(x=>x.value===d.value),b=Pw(_,w,v);b!==void 0&&d.onValueChange(b.value)}),C=w=>{a||(d.onOpenChange(!0),S()),w&&(d.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return g.jsx(zu,{asChild:!0,...l,children:g.jsx(qe.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Bw(d.value)?"":void 0,...o,ref:u,onClick:je(o.onClick,w=>{w.currentTarget.focus(),p.current!=="mouse"&&C(w)}),onPointerDown:je(o.onPointerDown,w=>{p.current=w.pointerType;const _=w.target;_.hasPointerCapture(w.pointerId)&&_.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(C(w),w.preventDefault())}),onKeyDown:je(o.onKeyDown,w=>{const _=h.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&y(w.key),!(_&&w.key===" ")&&BN.includes(w.key)&&(C(),w.preventDefault())})})})});pw.displayName=hw;var mw="SelectValue",gw=D.forwardRef((t,e)=>{const{__scopeSelect:n,className:i,style:o,children:l,placeholder:d="",...a}=t,u=Ao(mw,n),{onValueNodeHasChildrenChange:f}=u,p=l!==void 0,h=_t(e,u.onValueNodeChange);return wn(()=>{f(p)},[f,p]),g.jsx(qe.span,{...a,ref:h,style:{pointerEvents:"none"},children:Bw(u.value)?g.jsx(g.Fragment,{children:d}):l})});gw.displayName=mw;var $N="SelectIcon",vw=D.forwardRef((t,e)=>{const{__scopeSelect:n,children:i,...o}=t;return g.jsx(qe.span,{"aria-hidden":!0,...o,ref:e,children:i||"▼"})});vw.displayName=$N;var qN="SelectPortal",_w=t=>g.jsx(Kl,{asChild:!0,...t});_w.displayName=qN;var ga="SelectContent",yw=D.forwardRef((t,e)=>{const n=Ao(ga,t.__scopeSelect),[i,o]=D.useState();if(wn(()=>{o(new DocumentFragment)},[]),!n.open){const l=i;return l?Mu.createPortal(g.jsx(bw,{scope:t.__scopeSelect,children:g.jsx(ph.Slot,{scope:t.__scopeSelect,children:g.jsx("div",{children:t.children})})}),l):null}return g.jsx(xw,{...t,ref:e})});yw.displayName=ga;var ri=10,[bw,To]=Zl(ga),VN="SelectContentImpl",GN=_o("SelectContent.RemoveScroll"),xw=D.forwardRef((t,e)=>{const{__scopeSelect:n,position:i="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:d,side:a,sideOffset:u,align:f,alignOffset:p,arrowPadding:h,collisionBoundary:y,collisionPadding:S,sticky:C,hideWhenDetached:w,avoidCollisions:_,...v}=t,b=Ao(ga,n),[x,E]=D.useState(null),[N,A]=D.useState(null),M=_t(e,W=>E(W)),[T,j]=D.useState(null),[O,F]=D.useState(null),U=mh(n),[$,G]=D.useState(!1),K=D.useRef(!1);D.useEffect(()=>{if(x)return Zf(x)},[x]),Yf();const V=D.useCallback(W=>{const[q,...J]=U().map(ae=>ae.ref.current),[ie]=J.slice(-1),ce=document.activeElement;for(const ae of W)if(ae===ce||(ae==null||ae.scrollIntoView({block:"nearest"}),ae===q&&N&&(N.scrollTop=0),ae===ie&&N&&(N.scrollTop=N.scrollHeight),ae==null||ae.focus(),document.activeElement!==ce))return},[U,N]),X=D.useCallback(()=>V([T,x]),[V,T,x]);D.useEffect(()=>{$&&X()},[$,X]);const{onOpenChange:Z,triggerPointerDownPosRef:I}=b;D.useEffect(()=>{if(x){let W={x:0,y:0};const q=ie=>{var ce,ae,_e,Ee;W={x:Math.abs(Math.round(ie.pageX)-((ae=(ce=I.current)==null?void 0:ce.x)!=null?ae:0)),y:Math.abs(Math.round(ie.pageY)-((Ee=(_e=I.current)==null?void 0:_e.y)!=null?Ee:0))}},J=ie=>{W.x<=10&&W.y<=10?ie.preventDefault():x.contains(ie.target)||Z(!1),document.removeEventListener("pointermove",q),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",J,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",J,{capture:!0})}}},[x,Z,I]),D.useEffect(()=>{const W=()=>Z(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[Z]);const[L,B]=zw(W=>{const q=U().filter(ce=>!ce.disabled),J=q.find(ce=>ce.ref.current===document.activeElement),ie=Pw(q,W,J);ie&&setTimeout(()=>ie.ref.current.focus())}),H=D.useCallback((W,q,J)=>{const ie=!K.current&&!J;(b.value!==void 0&&b.value===q||ie)&&(j(W),ie&&(K.current=!0))},[b.value]),P=D.useCallback(()=>x==null?void 0:x.focus(),[x]),ee=D.useCallback((W,q,J)=>{const ie=!K.current&&!J;(b.value!==void 0&&b.value===q||ie)&&F(W)},[b.value]),ne=i==="popper"?Tg:Sw,Q=ne===Tg?{side:a,sideOffset:u,align:f,alignOffset:p,arrowPadding:h,collisionBoundary:y,collisionPadding:S,sticky:C,hideWhenDetached:w,avoidCollisions:_}:{};return g.jsx(bw,{scope:n,content:x,viewport:N,onViewportChange:A,itemRefCallback:H,selectedItem:T,onItemLeave:P,itemTextRefCallback:ee,focusSelectedItem:X,selectedItemText:O,position:i,isPositioned:$,searchRef:L,children:g.jsx(Iu,{as:GN,allowPinchZoom:!0,children:g.jsx(Lu,{asChild:!0,trapped:b.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:je(o,W=>{var q;(q=b.trigger)==null||q.focus({preventScroll:!0}),W.preventDefault()}),children:g.jsx(Wl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:g.jsx(ne,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:W=>W.preventDefault(),...v,...Q,onPlaced:()=>G(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:je(v.onKeyDown,W=>{const q=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!q&&W.key.length===1&&B(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let ie=U().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);if(["ArrowUp","End"].includes(W.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const ce=W.target,ae=ie.indexOf(ce);ie=ie.slice(ae+1)}setTimeout(()=>V(ie)),W.preventDefault()}})})})})})})});xw.displayName=VN;var WN="SelectItemAlignedPosition",Sw=D.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:i,...o}=t,l=Ao(ga,n),d=To(ga,n),[a,u]=D.useState(null),[f,p]=D.useState(null),h=_t(e,M=>p(M)),y=mh(n),S=D.useRef(!1),C=D.useRef(!0),{viewport:w,selectedItem:_,selectedItemText:v,focusSelectedItem:b}=d,x=D.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&f&&w&&_&&v){const M=l.trigger.getBoundingClientRect(),T=f.getBoundingClientRect(),j=l.valueNode.getBoundingClientRect(),O=v.getBoundingClientRect();if(l.dir!=="rtl"){const ce=O.left-T.left,ae=j.left-ce,_e=M.left-ae,Ee=M.width+_e,Te=Math.max(Ee,T.width),Be=window.innerWidth-ri,se=Ag(ae,[ri,Math.max(ri,Be-Te)]);a.style.minWidth=Ee+"px",a.style.left=se+"px"}else{const ce=T.right-O.right,ae=window.innerWidth-j.right-ce,_e=window.innerWidth-M.right-ae,Ee=M.width+_e,Te=Math.max(Ee,T.width),Be=window.innerWidth-ri,se=Ag(ae,[ri,Math.max(ri,Be-Te)]);a.style.minWidth=Ee+"px",a.style.right=se+"px"}const F=y(),U=window.innerHeight-ri*2,$=w.scrollHeight,G=window.getComputedStyle(f),K=parseInt(G.borderTopWidth,10),V=parseInt(G.paddingTop,10),X=parseInt(G.borderBottomWidth,10),Z=parseInt(G.paddingBottom,10),I=K+V+$+Z+X,L=Math.min(_.offsetHeight*5,I),B=window.getComputedStyle(w),H=parseInt(B.paddingTop,10),P=parseInt(B.paddingBottom,10),ee=M.top+M.height/2-ri,ne=U-ee,Q=_.offsetHeight/2,W=_.offsetTop+Q,q=K+V+W,J=I-q;if(q<=ee){const ce=F.length>0&&_===F[F.length-1].ref.current;a.style.bottom="0px";const ae=f.clientHeight-w.offsetTop-w.offsetHeight,_e=Math.max(ne,Q+(ce?P:0)+ae+X),Ee=q+_e;a.style.height=Ee+"px"}else{const ce=F.length>0&&_===F[0].ref.current;a.style.top="0px";const _e=Math.max(ee,K+w.offsetTop+(ce?H:0)+Q)+J;a.style.height=_e+"px",w.scrollTop=q-ee+w.offsetTop}a.style.margin=`${ri}px 0`,a.style.minHeight=L+"px",a.style.maxHeight=U+"px",i==null||i(),requestAnimationFrame(()=>S.current=!0)}},[y,l.trigger,l.valueNode,a,f,w,_,v,l.dir,i]);wn(()=>x(),[x]);const[E,N]=D.useState();wn(()=>{f&&N(window.getComputedStyle(f).zIndex)},[f]);const A=D.useCallback(M=>{M&&C.current===!0&&(x(),b==null||b(),C.current=!1)},[x,b]);return g.jsx(YN,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:S,onScrollButtonChange:A,children:g.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:g.jsx(qe.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Sw.displayName=WN;var KN="SelectPopperPosition",Tg=D.forwardRef((t,e)=>{const{__scopeSelect:n,align:i="start",collisionPadding:o=ri,...l}=t,d=gh(n);return g.jsx(sh,{...d,...l,ref:e,align:i,collisionPadding:o,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Tg.displayName=KN;var[YN,Mv]=Zl(ga,{}),Rg="SelectViewport",ww=D.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:i,...o}=t,l=To(Rg,n),d=Mv(Rg,n),a=_t(e,l.onViewportChange),u=D.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),g.jsx(ph.Slot,{scope:n,children:g.jsx(qe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:je(o.onScroll,f=>{const p=f.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:y}=d;if(y!=null&&y.current&&h){const S=Math.abs(u.current-p.scrollTop);if(S>0){const C=window.innerHeight-ri*2,w=parseFloat(h.style.minHeight),_=parseFloat(h.style.height),v=Math.max(w,_);if(v<C){const b=v+S,x=Math.min(C,b),E=b-x;h.style.height=x+"px",h.style.bottom==="0px"&&(p.scrollTop=E>0?E:0,h.style.justifyContent="flex-end")}}}u.current=p.scrollTop})})})]})});ww.displayName=Rg;var Cw="SelectGroup",[XN,ZN]=Zl(Cw),kw=D.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t,o=gn();return g.jsx(XN,{scope:n,id:o,children:g.jsx(qe.div,{role:"group","aria-labelledby":o,...i,ref:e})})});kw.displayName=Cw;var Ew="SelectLabel",Aw=D.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t,o=ZN(Ew,n);return g.jsx(qe.div,{id:o.id,...i,ref:e})});Aw.displayName=Ew;var Of="SelectItem",[QN,Tw]=Zl(Of),Rw=D.forwardRef((t,e)=>{const{__scopeSelect:n,value:i,disabled:o=!1,textValue:l,...d}=t,a=Ao(Of,n),u=To(Of,n),f=a.value===i,[p,h]=D.useState(l!=null?l:""),[y,S]=D.useState(!1),C=_t(e,b=>{var x;return(x=u.itemRefCallback)==null?void 0:x.call(u,b,i,o)}),w=gn(),_=D.useRef("touch"),v=()=>{o||(a.onValueChange(i),a.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(QN,{scope:n,value:i,disabled:o,textId:w,isSelected:f,onItemTextChange:D.useCallback(b=>{h(x=>{var E;return x||((E=b==null?void 0:b.textContent)!=null?E:"").trim()})},[]),children:g.jsx(ph.ItemSlot,{scope:n,value:i,disabled:o,textValue:p,children:g.jsx(qe.div,{role:"option","aria-labelledby":w,"data-highlighted":y?"":void 0,"aria-selected":f&&y,"data-state":f?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...d,ref:C,onFocus:je(d.onFocus,()=>S(!0)),onBlur:je(d.onBlur,()=>S(!1)),onClick:je(d.onClick,()=>{_.current!=="mouse"&&v()}),onPointerUp:je(d.onPointerUp,()=>{_.current==="mouse"&&v()}),onPointerDown:je(d.onPointerDown,b=>{_.current=b.pointerType}),onPointerMove:je(d.onPointerMove,b=>{var x;_.current=b.pointerType,o?(x=u.onItemLeave)==null||x.call(u):_.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(d.onPointerLeave,b=>{var x;b.currentTarget===document.activeElement&&((x=u.onItemLeave)==null||x.call(u))}),onKeyDown:je(d.onKeyDown,b=>{var E;((E=u.searchRef)==null?void 0:E.current)!==""&&b.key===" "||(zN.includes(b.key)&&v(),b.key===" "&&b.preventDefault())})})})})});Rw.displayName=Of;var pu="SelectItemText",Nw=D.forwardRef((t,e)=>{const{__scopeSelect:n,className:i,style:o,...l}=t,d=Ao(pu,n),a=To(pu,n),u=Tw(pu,n),f=UN(pu,n),[p,h]=D.useState(null),y=_t(e,v=>h(v),u.onItemTextChange,v=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,v,u.value,u.disabled)}),S=p==null?void 0:p.textContent,C=D.useMemo(()=>g.jsx("option",{value:u.value,disabled:u.disabled,children:S},u.value),[u.disabled,u.value,S]),{onNativeOptionAdd:w,onNativeOptionRemove:_}=f;return wn(()=>(w(C),()=>_(C)),[w,_,C]),g.jsxs(g.Fragment,{children:[g.jsx(qe.span,{id:u.textId,...l,ref:y}),u.isSelected&&d.valueNode&&!d.valueNodeHasChildren?Mu.createPortal(l.children,d.valueNode):null]})});Nw.displayName=pu;var Dw="SelectItemIndicator",Mw=D.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t;return Tw(Dw,n).isSelected?g.jsx(qe.span,{"aria-hidden":!0,...i,ref:e}):null});Mw.displayName=Dw;var Ng="SelectScrollUpButton",jw=D.forwardRef((t,e)=>{const n=To(Ng,t.__scopeSelect),i=Mv(Ng,t.__scopeSelect),[o,l]=D.useState(!1),d=_t(e,i.onScrollButtonChange);return wn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const f=u.scrollTop>0;l(f)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?g.jsx(Lw,{...t,ref:d,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop-u.offsetHeight)}}):null});jw.displayName=Ng;var Dg="SelectScrollDownButton",Ow=D.forwardRef((t,e)=>{const n=To(Dg,t.__scopeSelect),i=Mv(Dg,t.__scopeSelect),[o,l]=D.useState(!1),d=_t(e,i.onScrollButtonChange);return wn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const f=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)<f;l(p)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?g.jsx(Lw,{...t,ref:d,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop+u.offsetHeight)}}):null});Ow.displayName=Dg;var Lw=D.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:i,...o}=t,l=To("SelectScrollButton",n),d=D.useRef(null),a=mh(n),u=D.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return D.useEffect(()=>()=>u(),[u]),wn(()=>{var p;const f=a().find(h=>h.ref.current===document.activeElement);(p=f==null?void 0:f.ref.current)==null||p.scrollIntoView({block:"nearest"})},[a]),g.jsx(qe.div,{"aria-hidden":!0,...o,ref:e,style:{flexShrink:0,...o.style},onPointerDown:je(o.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(i,50))}),onPointerMove:je(o.onPointerMove,()=>{var f;(f=l.onItemLeave)==null||f.call(l),d.current===null&&(d.current=window.setInterval(i,50))}),onPointerLeave:je(o.onPointerLeave,()=>{u()})})}),JN="SelectSeparator",eD=D.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t;return g.jsx(qe.div,{"aria-hidden":!0,...i,ref:e})});eD.displayName=JN;var Mg="SelectArrow",tD=D.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t,o=gh(n),l=Ao(Mg,n),d=To(Mg,n);return l.open&&d.position==="popper"?g.jsx(oh,{...o,...i,ref:e}):null});tD.displayName=Mg;var nD="SelectBubbleInput",Iw=D.forwardRef(({__scopeSelect:t,value:e,...n},i)=>{const o=D.useRef(null),l=_t(i,o),d=dT(e);return D.useEffect(()=>{const a=o.current;if(!a)return;const u=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(d!==e&&p){const h=new Event("change",{bubbles:!0});p.call(a,e),a.dispatchEvent(h)}},[d,e]),g.jsx(qe.select,{...n,style:{...Zx,...n.style},ref:l,defaultValue:e})});Iw.displayName=nD;function Bw(t){return t===""||t===void 0}function zw(t){const e=Mn(t),n=D.useRef(""),i=D.useRef(0),o=D.useCallback(d=>{const a=n.current+d;e(a),(function u(f){n.current=f,window.clearTimeout(i.current),f!==""&&(i.current=window.setTimeout(()=>u(""),1e3))})(a)},[e]),l=D.useCallback(()=>{n.current="",window.clearTimeout(i.current)},[]);return D.useEffect(()=>()=>window.clearTimeout(i.current),[]),[n,o,l]}function Pw(t,e,n){const o=e.length>1&&Array.from(e).every(f=>f===e[0])?e[0]:e,l=n?t.indexOf(n):-1;let d=rD(t,Math.max(l,0));o.length===1&&(d=d.filter(f=>f!==n));const u=d.find(f=>f.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function rD(t,e){return t.map((n,i)=>t[(e+i)%t.length])}var iD=fw,sD=pw,oD=gw,aD=vw,lD=_w,cD=yw,uD=ww,dD=kw,fD=Aw,hD=Rw,pD=Nw,mD=Mw,gD=jw,vD=Ow,_D="Separator",fb="horizontal",yD=["horizontal","vertical"],Fw=D.forwardRef((t,e)=>{const{decorative:n,orientation:i=fb,...o}=t,l=bD(i)?i:fb,a=n?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return g.jsx(qe.div,{"data-orientation":l,...a,...o,ref:e})});Fw.displayName=_D;function bD(t){return yD.includes(t)}var xD=Fw,vh="Tabs",[SD]=yr(vh,[ah]),Hw=ah(),[wD,jv]=SD(vh),Uw=D.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,onValueChange:o,defaultValue:l,orientation:d="horizontal",dir:a,activationMode:u="automatic",...f}=t,p=Ou(a),[h,y]=ws({prop:i,onChange:o,defaultProp:l!=null?l:"",caller:vh});return g.jsx(wD,{scope:n,baseId:gn(),value:h,onValueChange:y,orientation:d,dir:p,activationMode:u,children:g.jsx(qe.div,{dir:p,"data-orientation":d,...f,ref:e})})});Uw.displayName=vh;var $w="TabsList",qw=D.forwardRef((t,e)=>{const{__scopeTabs:n,loop:i=!0,...o}=t,l=jv($w,n),d=Hw(n);return g.jsx(i2,{asChild:!0,...d,orientation:l.orientation,dir:l.dir,loop:i,children:g.jsx(qe.div,{role:"tablist","aria-orientation":l.orientation,...o,ref:e})})});qw.displayName=$w;var Vw="TabsTrigger",Gw=D.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,disabled:o=!1,...l}=t,d=jv(Vw,n),a=Hw(n),u=Yw(d.baseId,i),f=Xw(d.baseId,i),p=i===d.value;return g.jsx(s2,{asChild:!0,...a,focusable:!o,active:p,children:g.jsx(qe.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...l,ref:e,onMouseDown:je(t.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?d.onValueChange(i):h.preventDefault()}),onKeyDown:je(t.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&d.onValueChange(i)}),onFocus:je(t.onFocus,()=>{const h=d.activationMode!=="manual";!p&&!o&&h&&d.onValueChange(i)})})})});Gw.displayName=Vw;var Ww="TabsContent",Kw=D.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,forceMount:o,children:l,...d}=t,a=jv(Ww,n),u=Yw(a.baseId,i),f=Xw(a.baseId,i),p=i===a.value,h=D.useRef(p);return D.useEffect(()=>{const y=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(y)},[]),g.jsx(Cn,{present:o||p,children:({present:y})=>g.jsx(qe.div,{"data-state":p?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!y,id:f,tabIndex:0,...d,ref:e,style:{...t.style,animationDuration:h.current?"0s":void 0},children:y&&l})})});Kw.displayName=Ww;function Yw(t,e){return`${t}-trigger-${e}`}function Xw(t,e){return`${t}-content-${e}`}var CD=Uw,kD=qw,ED=Gw,AD=Kw,[_h]=yr("Tooltip",[ko]),yh=ko(),Zw="TooltipProvider",TD=700,jg="tooltip.open",[RD,Ov]=_h(Zw),Qw=t=>{const{__scopeTooltip:e,delayDuration:n=TD,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:l}=t,d=D.useRef(!0),a=D.useRef(!1),u=D.useRef(0);return D.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),g.jsx(RD,{scope:e,isOpenDelayedRef:d,delayDuration:n,onOpen:D.useCallback(()=>{window.clearTimeout(u.current),d.current=!1},[]),onClose:D.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>d.current=!0,i)},[i]),isPointerInTransitRef:a,onPointerInTransitChange:D.useCallback(f=>{a.current=f},[]),disableHoverableContent:o,children:l})};Qw.displayName=Zw;var Cu="Tooltip",[ND,$u]=_h(Cu),Jw=t=>{const{__scopeTooltip:e,children:n,open:i,defaultOpen:o,onOpenChange:l,disableHoverableContent:d,delayDuration:a}=t,u=Ov(Cu,t.__scopeTooltip),f=yh(e),[p,h]=D.useState(null),y=gn(),S=D.useRef(0),C=d!=null?d:u.disableHoverableContent,w=a!=null?a:u.delayDuration,_=D.useRef(!1),[v,b]=ws({prop:i,defaultProp:o!=null?o:!1,onChange:M=>{M?(u.onOpen(),document.dispatchEvent(new CustomEvent(jg))):u.onClose(),l==null||l(M)},caller:Cu}),x=D.useMemo(()=>v?_.current?"delayed-open":"instant-open":"closed",[v]),E=D.useCallback(()=>{window.clearTimeout(S.current),S.current=0,_.current=!1,b(!0)},[b]),N=D.useCallback(()=>{window.clearTimeout(S.current),S.current=0,b(!1)},[b]),A=D.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{_.current=!0,b(!0),S.current=0},w)},[w,b]);return D.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]),g.jsx(ih,{...f,children:g.jsx(ND,{scope:e,contentId:y,open:v,stateAttribute:x,trigger:p,onTriggerChange:h,onTriggerEnter:D.useCallback(()=>{u.isOpenDelayedRef.current?A():E()},[u.isOpenDelayedRef,A,E]),onTriggerLeave:D.useCallback(()=>{C?N():(window.clearTimeout(S.current),S.current=0)},[N,C]),onOpen:E,onClose:N,disableHoverableContent:C,children:n})})};Jw.displayName=Cu;var Og="TooltipTrigger",eC=D.forwardRef((t,e)=>{const{__scopeTooltip:n,...i}=t,o=$u(Og,n),l=Ov(Og,n),d=yh(n),a=D.useRef(null),u=_t(e,a,o.onTriggerChange),f=D.useRef(!1),p=D.useRef(!1),h=D.useCallback(()=>f.current=!1,[]);return D.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),g.jsx(zu,{asChild:!0,...d,children:g.jsx(qe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:u,onPointerMove:je(t.onPointerMove,y=>{y.pointerType!=="touch"&&!p.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:je(t.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:je(t.onPointerDown,()=>{o.open&&o.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:je(t.onFocus,()=>{f.current||o.onOpen()}),onBlur:je(t.onBlur,o.onClose),onClick:je(t.onClick,o.onClose)})})});eC.displayName=Og;var Lv="TooltipPortal",[DD,MD]=_h(Lv,{forceMount:void 0}),tC=t=>{const{__scopeTooltip:e,forceMount:n,children:i,container:o}=t,l=$u(Lv,e);return g.jsx(DD,{scope:e,forceMount:n,children:g.jsx(Cn,{present:n||l.open,children:g.jsx(Kl,{asChild:!0,container:o,children:i})})})};tC.displayName=Lv;var Bl="TooltipContent",nC=D.forwardRef((t,e)=>{const n=MD(Bl,t.__scopeTooltip),{forceMount:i=n.forceMount,side:o="top",...l}=t,d=$u(Bl,t.__scopeTooltip);return g.jsx(Cn,{present:i||d.open,children:d.disableHoverableContent?g.jsx(rC,{side:o,...l,ref:e}):g.jsx(jD,{side:o,...l,ref:e})})}),jD=D.forwardRef((t,e)=>{const n=$u(Bl,t.__scopeTooltip),i=Ov(Bl,t.__scopeTooltip),o=D.useRef(null),l=_t(e,o),[d,a]=D.useState(null),{trigger:u,onClose:f}=n,p=o.current,{onPointerInTransitChange:h}=i,y=D.useCallback(()=>{a(null),h(!1)},[h]),S=D.useCallback((C,w)=>{const _=C.currentTarget,v={x:C.clientX,y:C.clientY},b=BD(v,_.getBoundingClientRect()),x=zD(v,b),E=PD(w.getBoundingClientRect()),N=HD([...x,...E]);a(N),h(!0)},[h]);return D.useEffect(()=>()=>y(),[y]),D.useEffect(()=>{if(u&&p){const C=_=>S(_,p),w=_=>S(_,u);return u.addEventListener("pointerleave",C),p.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",C),p.removeEventListener("pointerleave",w)}}},[u,p,S,y]),D.useEffect(()=>{if(d){const C=w=>{const _=w.target,v={x:w.clientX,y:w.clientY},b=(u==null?void 0:u.contains(_))||(p==null?void 0:p.contains(_)),x=!FD(v,d);b?y():x&&(y(),f())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[u,p,d,f,y]),g.jsx(rC,{...t,ref:l})}),[OD,LD]=_h(Cu,{isInside:!1}),ID=M5("TooltipContent"),rC=D.forwardRef((t,e)=>{const{__scopeTooltip:n,children:i,"aria-label":o,onEscapeKeyDown:l,onPointerDownOutside:d,...a}=t,u=$u(Bl,n),f=yh(n),{onClose:p}=u;return D.useEffect(()=>(document.addEventListener(jg,p),()=>document.removeEventListener(jg,p)),[p]),D.useEffect(()=>{if(u.trigger){const h=y=>{const S=y.target;S!=null&&S.contains(u.trigger)&&p()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[u.trigger,p]),g.jsx(Wl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:h=>h.preventDefault(),onDismiss:p,children:g.jsxs(sh,{"data-state":u.stateAttribute,...f,...a,ref:e,style:{...a.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:[g.jsx(ID,{children:i}),g.jsx(OD,{scope:n,isInside:!0,children:g.jsx(z5,{id:u.contentId,role:"tooltip",children:o||i})})]})})});nC.displayName=Bl;var iC="TooltipArrow",sC=D.forwardRef((t,e)=>{const{__scopeTooltip:n,...i}=t,o=yh(n);return LD(iC,n).isInside?null:g.jsx(oh,{...o,...i,ref:e})});sC.displayName=iC;function BD(t,e){const n=Math.abs(e.top-t.y),i=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),l=Math.abs(e.left-t.x);switch(Math.min(n,i,o,l)){case l:return"left";case o:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function zD(t,e,n=5){const i=[];switch(e){case"top":i.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":i.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":i.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":i.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return i}function PD(t){const{top:e,right:n,bottom:i,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:i},{x:o,y:i}]}function FD(t,e){const{x:n,y:i}=t;let o=!1;for(let l=0,d=e.length-1;l<e.length;d=l++){const a=e[l],u=e[d],f=a.x,p=a.y,h=u.x,y=u.y;p>i!=y>i&&n<(h-f)*(i-p)/(y-p)+f&&(o=!o)}return o}function HD(t){const e=t.slice();return e.sort((n,i)=>n.x<i.x?-1:n.x>i.x?1:n.y<i.y?-1:n.y>i.y?1:0),UD(e)}function UD(t){if(t.length<=1)return t.slice();const e=[];for(let i=0;i<t.length;i++){const o=t[i];for(;e.length>=2;){const l=e[e.length-1],d=e[e.length-2];if((l.x-d.x)*(o.y-d.y)>=(l.y-d.y)*(o.x-d.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let i=t.length-1;i>=0;i--){const o=t[i];for(;n.length>=2;){const l=n[n.length-1],d=n[n.length-2];if((l.x-d.x)*(o.y-d.y)>=(l.y-d.y)*(o.x-d.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var $D=Qw,qD=Jw,VD=eC,GD=tC,WD=nC,KD=sC;const YD=(t,e)=>{const n=new Array(t.length+e.length);for(let i=0;i<t.length;i++)n[i]=t[i];for(let i=0;i<e.length;i++)n[t.length+i]=e[i];return n},XD=(t,e)=>({classGroupId:t,validator:e}),oC=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Lf="-",hb=[],ZD="arbitrary..",QD=t=>{const e=eM(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=t;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return JD(d);const a=d.split(Lf),u=a[0]===""&&a.length>1?1:0;return aC(a,u,e)},getConflictingClassGroupIds:(d,a)=>{if(a){const u=i[d],f=n[d];return u?f?YD(f,u):u:f||hb}return n[d]||hb}}},aC=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const o=t[e],l=n.nextPart.get(o);if(l){const f=aC(t,e+1,l);if(f)return f}const d=n.validators;if(d===null)return;const a=e===0?t.join(Lf):t.slice(e).join(Lf),u=d.length;for(let f=0;f<u;f++){const p=d[f];if(p.validator(a))return p.classGroupId}},JD=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),i=e.slice(0,n);return i?ZD+i:void 0})(),eM=t=>{const{theme:e,classGroups:n}=t;return tM(n,e)},tM=(t,e)=>{const n=oC();for(const i in t){const o=t[i];Iv(o,n,i,e)}return n},Iv=(t,e,n,i)=>{const o=t.length;for(let l=0;l<o;l++){const d=t[l];nM(d,e,n,i)}},nM=(t,e,n,i)=>{if(typeof t=="string"){rM(t,e,n);return}if(typeof t=="function"){iM(t,e,n,i);return}sM(t,e,n,i)},rM=(t,e,n)=>{const i=t===""?e:lC(e,t);i.classGroupId=n},iM=(t,e,n,i)=>{if(oM(t)){Iv(t(i),e,n,i);return}e.validators===null&&(e.validators=[]),e.validators.push(XD(n,t))},sM=(t,e,n,i)=>{const o=Object.entries(t),l=o.length;for(let d=0;d<l;d++){const[a,u]=o[d];Iv(u,lC(e,a),n,i)}},lC=(t,e)=>{let n=t;const i=e.split(Lf),o=i.length;for(let l=0;l<o;l++){const d=i[l];let a=n.nextPart.get(d);a||(a=oC(),n.nextPart.set(d,a)),n=a}return n},oM=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,aM=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),i=Object.create(null);const o=(l,d)=>{n[l]=d,e++,e>t&&(e=0,i=n,n=Object.create(null))};return{get(l){let d=n[l];if(d!==void 0)return d;if((d=i[l])!==void 0)return o(l,d),d},set(l,d){l in n?n[l]=d:o(l,d)}}},Lg="!",pb=":",lM=[],mb=(t,e,n,i,o)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:i,isExternal:o}),cM=t=>{const{prefix:e,experimentalParseClassName:n}=t;let i=o=>{const l=[];let d=0,a=0,u=0,f;const p=o.length;for(let w=0;w<p;w++){const _=o[w];if(d===0&&a===0){if(_===pb){l.push(o.slice(u,w)),u=w+1;continue}if(_==="/"){f=w;continue}}_==="["?d++:_==="]"?d--:_==="("?a++:_===")"&&a--}const h=l.length===0?o:o.slice(u);let y=h,S=!1;h.endsWith(Lg)?(y=h.slice(0,-1),S=!0):h.startsWith(Lg)&&(y=h.slice(1),S=!0);const C=f&&f>u?f-u:void 0;return mb(l,S,y,C)};if(e){const o=e+pb,l=i;i=d=>d.startsWith(o)?l(d.slice(o.length)):mb(lM,!1,d,void 0,!0)}if(n){const o=i;i=l=>n({className:l,parseClassName:o})}return i},uM=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,i)=>{e.set(n,1e6+i)}),n=>{const i=[];let o=[];for(let l=0;l<n.length;l++){const d=n[l],a=d[0]==="[",u=e.has(d);a||u?(o.length>0&&(o.sort(),i.push(...o),o=[]),i.push(d)):o.push(d)}return o.length>0&&(o.sort(),i.push(...o)),i}},dM=t=>({cache:aM(t.cacheSize),parseClassName:cM(t),sortModifiers:uM(t),...QD(t)}),fM=/\s+/,hM=(t,e)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:l}=e,d=[],a=t.trim().split(fM);let u="";for(let f=a.length-1;f>=0;f-=1){const p=a[f],{isExternal:h,modifiers:y,hasImportantModifier:S,baseClassName:C,maybePostfixModifierPosition:w}=n(p);if(h){u=p+(u.length>0?" "+u:u);continue}let _=!!w,v=i(_?C.substring(0,w):C);if(!v){if(!_){u=p+(u.length>0?" "+u:u);continue}if(v=i(C),!v){u=p+(u.length>0?" "+u:u);continue}_=!1}const b=y.length===0?"":y.length===1?y[0]:l(y).join(":"),x=S?b+Lg:b,E=x+v;if(d.indexOf(E)>-1)continue;d.push(E);const N=o(v,_);for(let A=0;A<N.length;++A){const M=N[A];d.push(x+M)}u=p+(u.length>0?" "+u:u)}return u},pM=(...t)=>{let e=0,n,i,o="";for(;e<t.length;)(n=t[e++])&&(i=cC(n))&&(o&&(o+=" "),o+=i);return o},cC=t=>{if(typeof t=="string")return t;let e,n="";for(let i=0;i<t.length;i++)t[i]&&(e=cC(t[i]))&&(n&&(n+=" "),n+=e);return n},mM=(t,...e)=>{let n,i,o,l;const d=u=>{const f=e.reduce((p,h)=>h(p),t());return n=dM(f),i=n.cache.get,o=n.cache.set,l=a,a(u)},a=u=>{const f=i(u);if(f)return f;const p=hM(u,n);return o(u,p),p};return l=d,(...u)=>l(pM(...u))},gM=[],mn=t=>{const e=n=>n[t]||gM;return e.isThemeGetter=!0,e},uC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,vM=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,_M=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yM=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,bM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,xM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,SM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fo=t=>vM.test(t),vt=t=>!!t&&!Number.isNaN(Number(t)),ho=t=>!!t&&Number.isInteger(Number(t)),$m=t=>t.endsWith("%")&&vt(t.slice(0,-1)),vs=t=>_M.test(t),fC=()=>!0,wM=t=>yM.test(t)&&!bM.test(t),Bv=()=>!1,CM=t=>xM.test(t),kM=t=>SM.test(t),EM=t=>!He(t)&&!Ue(t),AM=t=>Ro(t,mC,Bv),He=t=>uC.test(t),la=t=>Ro(t,gC,wM),gb=t=>Ro(t,LM,vt),TM=t=>Ro(t,_C,fC),RM=t=>Ro(t,vC,Bv),vb=t=>Ro(t,hC,Bv),NM=t=>Ro(t,pC,kM),cf=t=>Ro(t,yC,CM),Ue=t=>dC.test(t),iu=t=>xa(t,gC),DM=t=>xa(t,vC),_b=t=>xa(t,hC),MM=t=>xa(t,mC),jM=t=>xa(t,pC),uf=t=>xa(t,yC,!0),OM=t=>xa(t,_C,!0),Ro=(t,e,n)=>{const i=uC.exec(t);return i?i[1]?e(i[1]):n(i[2]):!1},xa=(t,e,n=!1)=>{const i=dC.exec(t);return i?i[1]?e(i[1]):n:!1},hC=t=>t==="position"||t==="percentage",pC=t=>t==="image"||t==="url",mC=t=>t==="length"||t==="size"||t==="bg-size",gC=t=>t==="length",LM=t=>t==="number",vC=t=>t==="family-name",_C=t=>t==="number"||t==="weight",yC=t=>t==="shadow",IM=()=>{const t=mn("color"),e=mn("font"),n=mn("text"),i=mn("font-weight"),o=mn("tracking"),l=mn("leading"),d=mn("breakpoint"),a=mn("container"),u=mn("spacing"),f=mn("radius"),p=mn("shadow"),h=mn("inset-shadow"),y=mn("text-shadow"),S=mn("drop-shadow"),C=mn("blur"),w=mn("perspective"),_=mn("aspect"),v=mn("ease"),b=mn("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...E(),Ue,He],A=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],T=()=>[Ue,He,u],j=()=>[fo,"full","auto",...T()],O=()=>[ho,"none","subgrid",Ue,He],F=()=>["auto",{span:["full",ho,Ue,He]},ho,Ue,He],U=()=>[ho,"auto",Ue,He],$=()=>["auto","min","max","fr",Ue,He],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...T()],X=()=>[fo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],Z=()=>[fo,"screen","full","dvw","lvw","svw","min","max","fit",...T()],I=()=>[fo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],L=()=>[t,Ue,He],B=()=>[...E(),_b,vb,{position:[Ue,He]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",MM,AM,{size:[Ue,He]}],ee=()=>[$m,iu,la],ne=()=>["","none","full",f,Ue,He],Q=()=>["",vt,iu,la],W=()=>["solid","dashed","dotted","double"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[vt,$m,_b,vb],ie=()=>["","none",C,Ue,He],ce=()=>["none",vt,Ue,He],ae=()=>["none",vt,Ue,He],_e=()=>[vt,Ue,He],Ee=()=>[fo,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[vs],breakpoint:[vs],color:[fC],container:[vs],"drop-shadow":[vs],ease:["in","out","in-out"],font:[EM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[vs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[vs],shadow:[vs],spacing:["px",vt],text:[vs],"text-shadow":[vs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fo,He,Ue,_]}],container:["container"],columns:[{columns:[vt,He,Ue,a]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:j()}],"inset-x":[{"inset-x":j()}],"inset-y":[{"inset-y":j()}],start:[{"inset-s":j(),start:j()}],end:[{"inset-e":j(),end:j()}],"inset-bs":[{"inset-bs":j()}],"inset-be":[{"inset-be":j()}],top:[{top:j()}],right:[{right:j()}],bottom:[{bottom:j()}],left:[{left:j()}],visibility:["visible","invisible","collapse"],z:[{z:[ho,"auto",Ue,He]}],basis:[{basis:[fo,"full","auto",a,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[vt,fo,"auto","initial","none",He]}],grow:[{grow:["",vt,Ue,He]}],shrink:[{shrink:["",vt,Ue,He]}],order:[{order:[ho,"first","last","none",Ue,He]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[a,"screen",...X()]}],"min-w":[{"min-w":[a,"screen","none",...X()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[d]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,iu,la]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,OM,TM]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$m,He]}],"font-family":[{font:[DM,RM,e]}],"font-features":[{"font-features":[He]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Ue,He]}],"line-clamp":[{"line-clamp":[vt,"none",Ue,gb]}],leading:[{leading:[l,...T()]}],"list-image":[{"list-image":["none",Ue,He]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ue,He]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:[vt,"from-font","auto",Ue,la]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[vt,"auto",Ue,He]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ue,He]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ue,He]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ho,Ue,He],radial:["",Ue,He],conic:[ho,Ue,He]},jM,NM]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-bs":[{"border-bs":Q()}],"border-w-be":[{"border-be":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...W(),"hidden","none"]}],"divide-style":[{divide:[...W(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...W(),"none","hidden"]}],"outline-offset":[{"outline-offset":[vt,Ue,He]}],"outline-w":[{outline:["",vt,iu,la]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",p,uf,cf]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",h,uf,cf]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[vt,la]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",y,uf,cf]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[vt,Ue,He]}],"mix-blend":[{"mix-blend":[...q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":q()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[vt]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[Ue,He]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[vt]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ue,He]}],filter:[{filter:["","none",Ue,He]}],blur:[{blur:ie()}],brightness:[{brightness:[vt,Ue,He]}],contrast:[{contrast:[vt,Ue,He]}],"drop-shadow":[{"drop-shadow":["","none",S,uf,cf]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",vt,Ue,He]}],"hue-rotate":[{"hue-rotate":[vt,Ue,He]}],invert:[{invert:["",vt,Ue,He]}],saturate:[{saturate:[vt,Ue,He]}],sepia:[{sepia:["",vt,Ue,He]}],"backdrop-filter":[{"backdrop-filter":["","none",Ue,He]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[vt,Ue,He]}],"backdrop-contrast":[{"backdrop-contrast":[vt,Ue,He]}],"backdrop-grayscale":[{"backdrop-grayscale":["",vt,Ue,He]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[vt,Ue,He]}],"backdrop-invert":[{"backdrop-invert":["",vt,Ue,He]}],"backdrop-opacity":[{"backdrop-opacity":[vt,Ue,He]}],"backdrop-saturate":[{"backdrop-saturate":[vt,Ue,He]}],"backdrop-sepia":[{"backdrop-sepia":["",vt,Ue,He]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ue,He]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[vt,"initial",Ue,He]}],ease:[{ease:["linear","initial",v,Ue,He]}],delay:[{delay:[vt,Ue,He]}],animate:[{animate:["none",b,Ue,He]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ue,He]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[Ue,He,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ue,He]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ue,He]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[vt,iu,la,gb]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},BM=mM(IM);function ke(...t){return BM(Wf(t))}const zM=Gl("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Pe(t){const e=me.c(16);let n,i,o,l,d;e[0]!==t?({className:n,variant:o,size:l,asChild:d,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l,e[5]=d):(n=e[1],i=e[2],o=e[3],l=e[4],d=e[5]);const a=o===void 0?"default":o,u=l===void 0?"default":l,p=(d===void 0?!1:d)?ju:"button";let h;e[6]!==n||e[7]!==u||e[8]!==a?(h=ke(zM({variant:a,size:u,className:n})),e[6]=n,e[7]=u,e[8]=a,e[9]=h):h=e[9];let y;return e[10]!==p||e[11]!==i||e[12]!==u||e[13]!==h||e[14]!==a?(y=g.jsx(p,{"data-slot":"button","data-variant":a,"data-size":u,className:h,...i}),e[10]=p,e[11]=i,e[12]=u,e[13]=h,e[14]=a,e[15]=y):y=e[15],y}function qu(){const t=me.c(1),e=PM;let n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n={fetchWithAuth:e},t[0]=n):n=t[0],n}async function PM(t,e,n){const i=e===void 0?{}:e,{serverUrl:o,token:l}=n||{};let d=t;t.startsWith("/")&&o&&(d=`http://${o}${t}`);const a=new Headers(i.headers||{});return l&&a.set("Authorization",`Bearer ${l}`),fetch(d,{...i,headers:a})}function Ql(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(av,{"data-slot":"dialog",...n}),e[2]=n,e[3]=i):i=e[3],i}function FM(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(lv,{"data-slot":"dialog-portal",...n}),e[2]=n,e[3]=i):i=e[3],i}function HM(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(Jf,{"data-slot":"dialog-close",...n}),e[2]=n,e[3]=i):i=e[3],i}function UM(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(cv,{"data-slot":"dialog-overlay",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Jl(t){const e=me.c(15);let n,i,o,l;e[0]!==t?({className:i,children:n,showCloseButton:l,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=l===void 0?!0:l;let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=g.jsx(UM,{}),e[5]=a):a=e[5];let u;e[6]!==i?(u=ke("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",i),e[6]=i,e[7]=u):u=e[7];let f;e[8]!==d?(f=d&&g.jsx(Jf,{"data-slot":"dialog-close",asChild:!0,children:g.jsxs(Pe,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[g.jsx(bs,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})}),e[8]=d,e[9]=f):f=e[9];let p;return e[10]!==n||e[11]!==o||e[12]!==u||e[13]!==f?(p=g.jsxs(FM,{children:[a,g.jsxs(uv,{"data-slot":"dialog-content",className:u,...o,children:[n,f]})]}),e[10]=n,e[11]=o,e[12]=u,e[13]=f,e[14]=p):p=e[14],p}function ec(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("flex flex-col gap-2",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("div",{"data-slot":"dialog-header",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function bh(t){const e=me.c(14);let n,i,o,l;e[0]!==t?({className:i,showCloseButton:l,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=l===void 0?!1:l;let a;e[5]!==i?(a=ke("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",i),e[5]=i,e[6]=a):a=e[6];let u;e[7]!==d?(u=d&&g.jsx(Jf,{asChild:!0,children:g.jsx(Pe,{variant:"outline",children:"Close"})}),e[7]=d,e[8]=u):u=e[8];let f;return e[9]!==n||e[10]!==o||e[11]!==a||e[12]!==u?(f=g.jsxs("div",{"data-slot":"dialog-footer",className:a,...o,children:[n,u]}),e[9]=n,e[10]=o,e[11]=a,e[12]=u,e[13]=f):f=e[13],f}function tc(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("text-base leading-none font-medium",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(NS,{"data-slot":"dialog-title",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Vu(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(DS,{"data-slot":"dialog-description",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function yf(t){const e=me.c(10);let n,i,o;e[0]!==t?({className:n,type:o,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o):(n=e[1],i=e[2],o=e[3]);let l;e[4]!==n?(l=ke("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",n),e[4]=n,e[5]=l):l=e[5];let d;return e[6]!==i||e[7]!==l||e[8]!==o?(d=g.jsx("input",{type:o,"data-slot":"input",className:l,...i}),e[6]=i,e[7]=l,e[8]=o,e[9]=d):d=e[9],d}const nc=D.forwardRef((t,e)=>{const n=me.c(16);let i,o,l;n[0]!==t?({className:o,children:i,...l}=t,n[0]=t,n[1]=i,n[2]=o,n[3]=l):(i=n[1],o=n[2],l=n[3]);let d;n[4]!==o?(d=ke("relative overflow-hidden",o),n[4]=o,n[5]=d):d=n[5];let a;n[6]===Symbol.for("react.memo_cache_sentinel")?(a={WebkitOverflowScrolling:"touch"},n[6]=a):a=n[6];let u;n[7]!==i||n[8]!==e?(u=g.jsx(LN,{ref:e,"data-slot":"scroll-area-viewport",className:"size-full min-w-0 rounded-[inherit] outline-none",style:a,children:i}),n[7]=i,n[8]=e,n[9]=u):u=n[9];let f,p;n[10]===Symbol.for("react.memo_cache_sentinel")?(f=g.jsx($M,{}),p=g.jsx(IN,{}),n[10]=f,n[11]=p):(f=n[10],p=n[11]);let h;return n[12]!==l||n[13]!==d||n[14]!==u?(h=g.jsxs(ON,{"data-slot":"scroll-area",className:d,...l,children:[u,f,p]}),n[12]=l,n[13]=d,n[14]=u,n[15]=h):h=n[15],h});nc.displayName="ScrollArea";function $M(t){const e=me.c(11);let n,i,o;e[0]!==t?({className:n,orientation:o,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o):(n=e[1],i=e[2],o=e[3]);const l=o===void 0?"vertical":o;let d;e[4]!==n?(d=ke("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",n),e[4]=n,e[5]=d):d=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=g.jsx(aw,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[6]=a):a=e[6];let u;return e[7]!==l||e[8]!==i||e[9]!==d?(u=g.jsx(rw,{"data-slot":"scroll-area-scrollbar","data-orientation":l,orientation:l,className:d,...i,children:a}),e[7]=l,e[8]=i,e[9]=d,e[10]=u):u=e[10],u}function qM(t){const n=t.replace(/\\/g,"/").split("/");return n.pop(),n.join("/")||"/"}function VM({open:t,onOpenChange:e,onSelect:n,initialPath:i,title:o="Select Folder"}){const[l,d]=D.useState(i||""),[a,u]=D.useState([]),[f,p]=D.useState(!1),[h,y]=D.useState(0),[S,C]=D.useState(null),[w,_]=D.useState(""),v=D.useRef(null),b=D.useRef(null),{fetchWithAuth:x}=qu(),{activeServer:E}=Vl(),N=D.useCallback(async U=>{p(!0),C(null),y(0),_("");try{const $=await x(`/api/fs/browse?path=${encodeURIComponent(U)}`,{},{serverUrl:E==null?void 0:E.url,token:E==null?void 0:E.token}),G=await $.json();if(!$.ok)throw new Error(G.message||"Failed to browse directory");const K=G.files.filter(V=>V.type==="directory");u(K),d(G.currentPath)}catch($){C($ instanceof Error?$.message:"Failed to load directory"),u([])}finally{p(!1)}},[x,E]);D.useEffect(()=>{t&&N(i||"")},[t,i,N]),D.useEffect(()=>{y(0)},[w]);const A=a.filter(U=>U.name.toLowerCase().includes(w.toLowerCase())),M=()=>{const U=qM(l);U!==l&&N(U)},T=()=>{l&&(n(l),e(!1))},j=U=>{const $=l?`${l}/${U.name}`:U.name;N($)},O=U=>{if(A.length!==0)switch(U.key){case"ArrowDown":U.preventDefault(),y($=>Math.min($+1,A.length-1));break;case"ArrowUp":U.preventDefault(),y($=>Math.max($-1,0));break;case"Enter":U.preventDefault(),A[h]&&j(A[h]);break;case"Escape":w&&(U.preventDefault(),_(""));break}};D.useEffect(()=>{if(b.current&&A.length>0){const U=b.current.children[h];U&&U.scrollIntoView({block:"nearest"})}},[h,A.length]),D.useEffect(()=>{t&&setTimeout(()=>{var U;return(U=v.current)==null?void 0:U.focus()},100)},[t]);const F=(U,$=50)=>{if(U.length<=$)return U;const G=U.split("/");return G.length<=2?U:".../"+G.slice(-2).join("/")};return g.jsx(Ql,{open:t,onOpenChange:e,children:g.jsxs(Jl,{className:"sm:max-w-lg",onKeyDown:O,children:[g.jsx(ec,{children:g.jsx(tc,{children:o})}),g.jsxs("div",{className:"space-y-3",children:[g.jsxs("div",{className:"flex items-center gap-2 p-2 bg-muted rounded-md",children:[g.jsx(Pe,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-shrink-0",onClick:M,disabled:f||!l,children:g.jsx(PE,{className:"w-4 h-4"})}),g.jsx("span",{className:"flex-1 text-sm font-mono truncate",title:l,children:F(l)||"Home"})]}),g.jsxs("div",{className:"relative",children:[g.jsx(Qg,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),g.jsx(yf,{ref:v,placeholder:"Filter folders...",value:w,onChange:U=>_(U.target.value),className:"pl-8"})]}),g.jsx(nc,{className:"h-64 border rounded-md",children:f?g.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[g.jsx(gr,{className:"w-4 h-4 animate-spin mr-2"}),"Loading..."]}):S?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[g.jsx("span",{className:"text-destructive",children:S}),g.jsx(Pe,{variant:"ghost",size:"sm",onClick:()=>N(l),className:"mt-2",children:"Retry"})]}):A.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground text-sm",children:[g.jsx(vo,{className:"w-8 h-8 mb-2 opacity-50"}),w?"No matching folders":"No folders in this directory"]}):g.jsx("div",{className:"p-1",ref:b,children:A.map((U,$)=>g.jsxs("button",{onClick:()=>{y($)},onDoubleClick:()=>j(U),className:ke("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",$===h&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[g.jsx(vo,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}),g.jsx("span",{className:"truncate flex-1",children:U.name}),$===h&&g.jsx(xs,{className:"w-4 h-4 text-primary"})]},U.path))})}),S&&g.jsx("p",{className:"text-xs text-destructive",children:S})]}),g.jsxs(bh,{children:[g.jsx(Pe,{variant:"outline",onClick:()=>e(!1),children:"Cancel"}),g.jsx(Pe,{onClick:T,disabled:!l||f,children:"Use This Folder"})]})]})})}var yb=1,GM=.9,WM=.8,KM=.17,qm=.1,Vm=.999,YM=.9999,XM=.99,ZM=/[\\\/_+.#"@\[\(\{&]/,QM=/[\\\/_+.#"@\[\(\{&]/g,JM=/[\s-]/,bC=/[\s-]/g;function Ig(t,e,n,i,o,l,d){if(l===e.length)return o===t.length?yb:XM;var a=`${o},${l}`;if(d[a]!==void 0)return d[a];for(var u=i.charAt(l),f=n.indexOf(u,o),p=0,h,y,S,C;f>=0;)h=Ig(t,e,n,i,f+1,l+1,d),h>p&&(f===o?h*=yb:ZM.test(t.charAt(f-1))?(h*=WM,S=t.slice(o,f-1).match(QM),S&&o>0&&(h*=Math.pow(Vm,S.length))):JM.test(t.charAt(f-1))?(h*=GM,C=t.slice(o,f-1).match(bC),C&&o>0&&(h*=Math.pow(Vm,C.length))):(h*=KM,o>0&&(h*=Math.pow(Vm,f-o))),t.charAt(f)!==e.charAt(l)&&(h*=YM)),(h<qm&&n.charAt(f-1)===i.charAt(l+1)||i.charAt(l+1)===i.charAt(l)&&n.charAt(f-1)!==i.charAt(l))&&(y=Ig(t,e,n,i,f+1,l+2,d),y*qm>h&&(h=y*qm)),h>p&&(p=h),f=n.indexOf(u,f+1);return d[a]=p,p}function bb(t){return t.toLowerCase().replace(bC," ")}function ej(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,Ig(t,e,bb(t),bb(e),0,0,{})}var su='[cmdk-group=""]',Gm='[cmdk-group-items=""]',tj='[cmdk-group-heading=""]',xC='[cmdk-item=""]',xb=`${xC}:not([aria-disabled="true"])`,Bg="cmdk-item-select",Cl="data-value",nj=(t,e,n)=>ej(t,e,n),SC=D.createContext(void 0),Gu=()=>D.useContext(SC),wC=D.createContext(void 0),zv=()=>D.useContext(wC),CC=D.createContext(void 0),kC=D.forwardRef((t,e)=>{let n=kl(()=>{var H,P;return{search:"",value:(P=(H=t.value)!=null?H:t.defaultValue)!=null?P:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=kl(()=>new Set),o=kl(()=>new Map),l=kl(()=>new Map),d=kl(()=>new Set),a=EC(t),{label:u,children:f,value:p,onValueChange:h,filter:y,shouldFilter:S,loop:C,disablePointerSelection:w=!1,vimBindings:_=!0,...v}=t,b=gn(),x=gn(),E=gn(),N=D.useRef(null),A=hj();va(()=>{if(p!==void 0){let H=p.trim();n.current.value=H,M.emit()}},[p]),va(()=>{A(6,$)},[]);let M=D.useMemo(()=>({subscribe:H=>(d.current.add(H),()=>d.current.delete(H)),snapshot:()=>n.current,setState:(H,P,ee)=>{var ne,Q,W,q;if(!Object.is(n.current[H],P)){if(n.current[H]=P,H==="search")U(),O(),A(1,F);else if(H==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let J=document.getElementById(E);J?J.focus():(ne=document.getElementById(b))==null||ne.focus()}if(A(7,()=>{var J;n.current.selectedItemId=(J=G())==null?void 0:J.id,M.emit()}),ee||A(5,$),((Q=a.current)==null?void 0:Q.value)!==void 0){let J=P!=null?P:"";(q=(W=a.current).onValueChange)==null||q.call(W,J);return}}M.emit()}},emit:()=>{d.current.forEach(H=>H())}}),[]),T=D.useMemo(()=>({value:(H,P,ee)=>{var ne;P!==((ne=l.current.get(H))==null?void 0:ne.value)&&(l.current.set(H,{value:P,keywords:ee}),n.current.filtered.items.set(H,j(P,ee)),A(2,()=>{O(),M.emit()}))},item:(H,P)=>(i.current.add(H),P&&(o.current.has(P)?o.current.get(P).add(H):o.current.set(P,new Set([H]))),A(3,()=>{U(),O(),n.current.value||F(),M.emit()}),()=>{l.current.delete(H),i.current.delete(H),n.current.filtered.items.delete(H);let ee=G();A(4,()=>{U(),(ee==null?void 0:ee.getAttribute("id"))===H&&F(),M.emit()})}),group:H=>(o.current.has(H)||o.current.set(H,new Set),()=>{l.current.delete(H),o.current.delete(H)}),filter:()=>a.current.shouldFilter,label:u||t["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:b,inputId:E,labelId:x,listInnerRef:N}),[]);function j(H,P){var ee,ne;let Q=(ne=(ee=a.current)==null?void 0:ee.filter)!=null?ne:nj;return H?Q(H,n.current.search,P):0}function O(){if(!n.current.search||a.current.shouldFilter===!1)return;let H=n.current.filtered.items,P=[];n.current.filtered.groups.forEach(ne=>{let Q=o.current.get(ne),W=0;Q.forEach(q=>{let J=H.get(q);W=Math.max(J,W)}),P.push([ne,W])});let ee=N.current;K().sort((ne,Q)=>{var W,q;let J=ne.getAttribute("id"),ie=Q.getAttribute("id");return((W=H.get(ie))!=null?W:0)-((q=H.get(J))!=null?q:0)}).forEach(ne=>{let Q=ne.closest(Gm);Q?Q.appendChild(ne.parentElement===Q?ne:ne.closest(`${Gm} > *`)):ee.appendChild(ne.parentElement===ee?ne:ne.closest(`${Gm} > *`))}),P.sort((ne,Q)=>Q[1]-ne[1]).forEach(ne=>{var Q;let W=(Q=N.current)==null?void 0:Q.querySelector(`${su}[${Cl}="${encodeURIComponent(ne[0])}"]`);W==null||W.parentElement.appendChild(W)})}function F(){let H=K().find(ee=>ee.getAttribute("aria-disabled")!=="true"),P=H==null?void 0:H.getAttribute(Cl);M.setState("value",P||void 0)}function U(){var H,P,ee,ne;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=i.current.size;return}n.current.filtered.groups=new Set;let Q=0;for(let W of i.current){let q=(P=(H=l.current.get(W))==null?void 0:H.value)!=null?P:"",J=(ne=(ee=l.current.get(W))==null?void 0:ee.keywords)!=null?ne:[],ie=j(q,J);n.current.filtered.items.set(W,ie),ie>0&&Q++}for(let[W,q]of o.current)for(let J of q)if(n.current.filtered.items.get(J)>0){n.current.filtered.groups.add(W);break}n.current.filtered.count=Q}function $(){var H,P,ee;let ne=G();ne&&(((H=ne.parentElement)==null?void 0:H.firstChild)===ne&&((ee=(P=ne.closest(su))==null?void 0:P.querySelector(tj))==null||ee.scrollIntoView({block:"nearest"})),ne.scrollIntoView({block:"nearest"}))}function G(){var H;return(H=N.current)==null?void 0:H.querySelector(`${xC}[aria-selected="true"]`)}function K(){var H;return Array.from(((H=N.current)==null?void 0:H.querySelectorAll(xb))||[])}function V(H){let P=K()[H];P&&M.setState("value",P.getAttribute(Cl))}function X(H){var P;let ee=G(),ne=K(),Q=ne.findIndex(q=>q===ee),W=ne[Q+H];(P=a.current)!=null&&P.loop&&(W=Q+H<0?ne[ne.length-1]:Q+H===ne.length?ne[0]:ne[Q+H]),W&&M.setState("value",W.getAttribute(Cl))}function Z(H){let P=G(),ee=P==null?void 0:P.closest(su),ne;for(;ee&&!ne;)ee=H>0?dj(ee,su):fj(ee,su),ne=ee==null?void 0:ee.querySelector(xb);ne?M.setState("value",ne.getAttribute(Cl)):X(H)}let I=()=>V(K().length-1),L=H=>{H.preventDefault(),H.metaKey?I():H.altKey?Z(1):X(1)},B=H=>{H.preventDefault(),H.metaKey?V(0):H.altKey?Z(-1):X(-1)};return D.createElement(qe.div,{ref:e,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:H=>{var P;(P=v.onKeyDown)==null||P.call(v,H);let ee=H.nativeEvent.isComposing||H.keyCode===229;if(!(H.defaultPrevented||ee))switch(H.key){case"n":case"j":{_&&H.ctrlKey&&L(H);break}case"ArrowDown":{L(H);break}case"p":case"k":{_&&H.ctrlKey&&B(H);break}case"ArrowUp":{B(H);break}case"Home":{H.preventDefault(),V(0);break}case"End":{H.preventDefault(),I();break}case"Enter":{H.preventDefault();let ne=G();if(ne){let Q=new Event(Bg);ne.dispatchEvent(Q)}}}}},D.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:mj},u),xh(t,H=>D.createElement(wC.Provider,{value:M},D.createElement(SC.Provider,{value:T},H))))}),rj=D.forwardRef((t,e)=>{var n,i;let o=gn(),l=D.useRef(null),d=D.useContext(CC),a=Gu(),u=EC(t),f=(i=(n=u.current)==null?void 0:n.forceMount)!=null?i:d==null?void 0:d.forceMount;va(()=>{if(!f)return a.item(o,d==null?void 0:d.id)},[f]);let p=AC(o,l,[t.value,t.children,l],t.keywords),h=zv(),y=xo(A=>A.value&&A.value===p.current),S=xo(A=>f||a.filter()===!1?!0:A.search?A.filtered.items.get(o)>0:!0);D.useEffect(()=>{let A=l.current;if(!(!A||t.disabled))return A.addEventListener(Bg,C),()=>A.removeEventListener(Bg,C)},[S,t.onSelect,t.disabled]);function C(){var A,M;w(),(M=(A=u.current).onSelect)==null||M.call(A,p.current)}function w(){h.setState("value",p.current,!0)}if(!S)return null;let{disabled:_,value:v,onSelect:b,forceMount:x,keywords:E,...N}=t;return D.createElement(qe.div,{ref:Ss(l,e),...N,id:o,"cmdk-item":"",role:"option","aria-disabled":!!_,"aria-selected":!!y,"data-disabled":!!_,"data-selected":!!y,onPointerMove:_||a.getDisablePointerSelection()?void 0:w,onClick:_?void 0:C},t.children)}),ij=D.forwardRef((t,e)=>{let{heading:n,children:i,forceMount:o,...l}=t,d=gn(),a=D.useRef(null),u=D.useRef(null),f=gn(),p=Gu(),h=xo(S=>o||p.filter()===!1?!0:S.search?S.filtered.groups.has(d):!0);va(()=>p.group(d),[]),AC(d,a,[t.value,t.heading,u]);let y=D.useMemo(()=>({id:d,forceMount:o}),[o]);return D.createElement(qe.div,{ref:Ss(a,e),...l,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},n&&D.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),xh(t,S=>D.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},D.createElement(CC.Provider,{value:y},S))))}),sj=D.forwardRef((t,e)=>{let{alwaysRender:n,...i}=t,o=D.useRef(null),l=xo(d=>!d.search);return!n&&!l?null:D.createElement(qe.div,{ref:Ss(o,e),...i,"cmdk-separator":"",role:"separator"})}),oj=D.forwardRef((t,e)=>{let{onValueChange:n,...i}=t,o=t.value!=null,l=zv(),d=xo(f=>f.search),a=xo(f=>f.selectedItemId),u=Gu();return D.useEffect(()=>{t.value!=null&&l.setState("search",t.value)},[t.value]),D.createElement(qe.input,{ref:e,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":a,id:u.inputId,type:"text",value:o?t.value:d,onChange:f=>{o||l.setState("search",f.target.value),n==null||n(f.target.value)}})}),aj=D.forwardRef((t,e)=>{let{children:n,label:i="Suggestions",...o}=t,l=D.useRef(null),d=D.useRef(null),a=xo(f=>f.selectedItemId),u=Gu();return D.useEffect(()=>{if(d.current&&l.current){let f=d.current,p=l.current,h,y=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let S=f.offsetHeight;p.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return y.observe(f),()=>{cancelAnimationFrame(h),y.unobserve(f)}}},[]),D.createElement(qe.div,{ref:Ss(l,e),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":i,id:u.listId},xh(t,f=>D.createElement("div",{ref:Ss(d,u.listInnerRef),"cmdk-list-sizer":""},f)))}),lj=D.forwardRef((t,e)=>{let{open:n,onOpenChange:i,overlayClassName:o,contentClassName:l,container:d,...a}=t;return D.createElement(av,{open:n,onOpenChange:i},D.createElement(lv,{container:d},D.createElement(cv,{"cmdk-overlay":"",className:o}),D.createElement(uv,{"aria-label":t.label,"cmdk-dialog":"",className:l},D.createElement(kC,{ref:e,...a}))))}),cj=D.forwardRef((t,e)=>xo(n=>n.filtered.count===0)?D.createElement(qe.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),uj=D.forwardRef((t,e)=>{let{progress:n,children:i,label:o="Loading...",...l}=t;return D.createElement(qe.div,{ref:e,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},xh(t,d=>D.createElement("div",{"aria-hidden":!0},d)))}),Sa=Object.assign(kC,{List:aj,Item:rj,Input:oj,Group:ij,Separator:sj,Dialog:lj,Empty:cj,Loading:uj});function dj(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function fj(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function EC(t){let e=D.useRef(t);return va(()=>{e.current=t}),e}var va=typeof window>"u"?D.useEffect:D.useLayoutEffect;function kl(t){let e=D.useRef();return e.current===void 0&&(e.current=t()),e}function xo(t){let e=zv(),n=()=>t(e.snapshot());return D.useSyncExternalStore(e.subscribe,n,n)}function AC(t,e,n,i=[]){let o=D.useRef(),l=Gu();return va(()=>{var d;let a=(()=>{var f;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(f=p.current.textContent)==null?void 0:f.trim():o.current}})(),u=i.map(f=>f.trim());l.value(t,a,u),(d=e.current)==null||d.setAttribute(Cl,a),o.current=a}),o}var hj=()=>{let[t,e]=D.useState(),n=kl(()=>new Map);return va(()=>{n.current.forEach(i=>i()),n.current=new Map},[t]),(i,o)=>{n.current.set(i,o),e({})}};function pj(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function xh({asChild:t,children:e},n){return t&&D.isValidElement(e)?D.cloneElement(pj(e),{ref:e.ref},n(e.props.children)):n(e)}var mj={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function gj(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("textarea",{"data-slot":"textarea",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function vj(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("div",{"data-slot":"input-group",role:"group",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}const _j=Gl("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function yj(t){const e=me.c(11);let n,i,o;e[0]!==t?({className:n,align:o,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o):(n=e[1],i=e[2],o=e[3]);const l=o===void 0?"inline-start":o;let d;e[4]!==l||e[5]!==n?(d=ke(_j({align:l}),n),e[4]=l,e[5]=n,e[6]=d):d=e[6];let a;return e[7]!==l||e[8]!==i||e[9]!==d?(a=g.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":l,className:d,onClick:bj,...i}),e[7]=l,e[8]=i,e[9]=d,e[10]=a):a=e[10],a}function bj(t){var e,n;t.target.closest("button")||(n=(e=t.currentTarget.parentElement)==null?void 0:e.querySelector("input"))==null||n.focus()}function Pv(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(Sa,{"data-slot":"command",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function TC(t){const e=me.c(11);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",n),e[3]=n,e[4]=o):o=e[4];let l;e[5]!==i||e[6]!==o?(l=g.jsx(Sa.Input,{"data-slot":"command-input",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=g.jsx(yj,{children:g.jsx(Qg,{className:"size-4 shrink-0 opacity-50"})}),e[8]=d):d=e[8];let a;return e[9]!==l?(a=g.jsx("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:g.jsxs(vj,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[l,d]})}),e[9]=l,e[10]=a):a=e[10],a}function Fv(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(Sa.List,{"data-slot":"command-list",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Hv(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("py-6 text-center text-sm",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(Sa.Empty,{"data-slot":"command-empty",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function ku(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(Sa.Group,{"data-slot":"command-group",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function RC(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("-mx-1 h-px bg-border",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(Sa.Separator,{"data-slot":"command-separator",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Dl(t){const e=me.c(11);let n,i,o;e[0]!==t?({className:i,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o):(n=e[1],i=e[2],o=e[3]);let l;e[4]!==i?(l=ke("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",i),e[4]=i,e[5]=l):l=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=g.jsx(xs,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"}),e[6]=d):d=e[6];let a;return e[7]!==n||e[8]!==o||e[9]!==l?(a=g.jsxs(Sa.Item,{"data-slot":"command-item",className:l,...o,children:[n,d]}),e[7]=n,e[8]=o,e[9]=l,e[10]=a):a=e[10],a}function Sh(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(uN,{"data-slot":"popover",...n}),e[2]=n,e[3]=i):i=e[3],i}function Uv(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(fN,{"data-slot":"popover-trigger",...n}),e[2]=n,e[3]=i):i=e[3],i}function wh(t){const e=me.c(12);let n,i,o,l;e[0]!==t?({className:n,align:o,sideOffset:l,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=o===void 0?"center":o,a=l===void 0?4:l;let u;e[5]!==n?(u=ke("z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",n),e[5]=n,e[6]=u):u=e[6];let f;return e[7]!==d||e[8]!==i||e[9]!==a||e[10]!==u?(f=g.jsx(hN,{children:g.jsx(pN,{"data-slot":"popover-content",align:d,sideOffset:a,className:u,...i})}),e[7]=d,e[8]=i,e[9]=a,e[10]=u,e[11]=f):f=e[11],f}function xj(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(dN,{"data-slot":"popover-anchor",...n}),e[2]=n,e[3]=i):i=e[3],i}function Sj(t){const e=me.c(50),{workspaces:n,activeWorkspace:i,onSelectWorkspace:o,onCreateVirtualWorkspace:l,onCreatePhysicalWorkspace:d,isWorkspaceFavorited:a,onToggleFavorite:u}=t,[f,p]=D.useState(!1),[h,y]=D.useState(!1);let S;e[0]!==(i==null?void 0:i.isVirtual)?(S=i!=null&&i.isVirtual?g.jsx(vg,{className:"size-4 flex-shrink-0 text-muted-foreground"}):g.jsx(vo,{className:"size-4 flex-shrink-0 text-muted-foreground"}),e[0]=i==null?void 0:i.isVirtual,e[1]=S):S=e[1];const C=(i==null?void 0:i.name)||"Select workspace";let w;e[2]!==C?(w=g.jsx("span",{className:"truncate",children:C}),e[2]=C,e[3]=w):w=e[3];let _;e[4]!==S||e[5]!==w?(_=g.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[S,w]}),e[4]=S,e[5]=w,e[6]=_):_=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=g.jsx(Lx,{className:"ml-auto size-4 shrink-0 opacity-50"}),e[7]=v):v=e[7];let b;e[8]!==f||e[9]!==_?(b=g.jsx(Uv,{asChild:!0,children:g.jsxs(Pe,{variant:"outline",role:"combobox","aria-expanded":f,"aria-label":"Select workspace",className:"w-full justify-between h-9",children:[_,v]})}),e[8]=f,e[9]=_,e[10]=b):b=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=g.jsx(TC,{placeholder:"Search workspace..."}),e[11]=x):x=e[11];let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=g.jsx(Hv,{children:"No workspace found."}),e[12]=E):E=e[12];let N;if(e[13]!==(i==null?void 0:i.id)||e[14]!==a||e[15]!==o||e[16]!==u||e[17]!==n){let Z;e[19]!==(i==null?void 0:i.id)||e[20]!==a||e[21]!==o||e[22]!==u?(Z=I=>g.jsxs(Dl,{onSelect:()=>{o(I),p(!1)},className:"justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[I.isVirtual?g.jsx(vg,{className:"size-4 text-muted-foreground"}):g.jsx(vo,{className:"size-4 text-muted-foreground"}),g.jsx("span",{children:I.name})]}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("button",{className:"p-1 rounded hover:bg-secondary transition-colors",onClick:L=>{L.stopPropagation(),u(I.id,I.name)},title:a(I.id)?"Remove from favorites":"Add to favorites",children:a(I.id)?g.jsx(D0,{className:"size-4 fill-primary text-primary"}):g.jsx(D0,{className:"size-4 text-muted-foreground"})}),g.jsx(xs,{className:ke("size-4",(i==null?void 0:i.id)===I.id?"opacity-100":"opacity-0")})]})]},I.id),e[19]=i==null?void 0:i.id,e[20]=a,e[21]=o,e[22]=u,e[23]=Z):Z=e[23],N=n.map(Z),e[13]=i==null?void 0:i.id,e[14]=a,e[15]=o,e[16]=u,e[17]=n,e[18]=N}else N=e[18];let A;e[24]!==N?(A=g.jsx(ku,{heading:"Workspaces",children:N}),e[24]=N,e[25]=A):A=e[25];let M;e[26]===Symbol.for("react.memo_cache_sentinel")?(M=g.jsx(RC,{}),e[26]=M):M=e[26];let T;e[27]!==l?(T=()=>{l(),p(!1)},e[27]=l,e[28]=T):T=e[28];let j;e[29]===Symbol.for("react.memo_cache_sentinel")?(j=g.jsx(ql,{className:"size-4","data-icon":"inline-start"}),e[29]=j):j=e[29];let O;e[30]!==T?(O=g.jsxs(Dl,{onSelect:T,children:[j,"Create virtual workspace"]}),e[30]=T,e[31]=O):O=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=g.jsxs(Dl,{onSelect:()=>{p(!1),y(!0)},children:[g.jsx(vo,{className:"size-4","data-icon":"inline-start"}),"Add existing folder"]}),e[32]=F):F=e[32];let U;e[33]!==O?(U=g.jsxs(ku,{children:[O,F]}),e[33]=O,e[34]=U):U=e[34];let $;e[35]!==A||e[36]!==U?($=g.jsx(wh,{className:"w-[240px] p-0 max-h-[80vh]",children:g.jsxs(Pv,{children:[x,g.jsxs(Fv,{className:"max-h-[50vh] overflow-y-auto",children:[E,A,M,U]})]})}),e[35]=A,e[36]=U,e[37]=$):$=e[37];let G;e[38]!==f||e[39]!==$||e[40]!==b?(G=g.jsxs(Sh,{open:f,onOpenChange:p,children:[b,$]}),e[38]=f,e[39]=$,e[40]=b,e[41]=G):G=e[41];let K;e[42]!==d?(K=Z=>{d(Z),y(!1)},e[42]=d,e[43]=K):K=e[43];let V;e[44]!==h||e[45]!==K?(V=g.jsx(VM,{open:h,onOpenChange:y,onSelect:K,title:"Select Workspace Folder"}),e[44]=h,e[45]=K,e[46]=V):V=e[46];let X;return e[47]!==G||e[48]!==V?(X=g.jsxs(g.Fragment,{children:[G,V]}),e[47]=G,e[48]=V,e[49]=X):X=e[49],X}function wj(t){const e=me.c(33),{onOpenAddServer:n,onServerSwitch:i}=t,[o,l]=D.useState(!1),{servers:d,activeServer:a,switchServer:u}=Vl();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=g.jsx(fa,{className:"size-4 flex-shrink-0 text-muted-foreground"}),e[0]=f):f=e[0];const p=(a==null?void 0:a.name)||"Select server";let h;e[1]!==p?(h=g.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[f,g.jsx("span",{className:"truncate",children:p})]}),e[1]=p,e[2]=h):h=e[2];let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=g.jsx(Lx,{className:"ml-auto size-4 shrink-0 opacity-50"}),e[3]=y):y=e[3];let S;e[4]!==o||e[5]!==h?(S=g.jsx(Uv,{asChild:!0,children:g.jsxs(Pe,{variant:"outline",role:"combobox","aria-expanded":o,"aria-label":"Select server",className:"w-full justify-between h-9",children:[h,y]})}),e[4]=o,e[5]=h,e[6]=S):S=e[6];let C;e[7]===Symbol.for("react.memo_cache_sentinel")?(C=g.jsx(TC,{placeholder:"Search server..."}),e[7]=C):C=e[7];let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w=g.jsx(Hv,{children:"No server found."}),e[8]=w):w=e[8];let _;if(e[9]!==(a==null?void 0:a.id)||e[10]!==i||e[11]!==d||e[12]!==u){let T;e[14]!==(a==null?void 0:a.id)||e[15]!==i||e[16]!==u?(T=j=>g.jsxs(Dl,{onSelect:()=>{u(j.id),i==null||i(),l(!1)},className:"justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(fa,{className:"size-4 text-muted-foreground"}),g.jsx("span",{children:j.name})]}),g.jsx(xs,{className:ke("size-4",(a==null?void 0:a.id)===j.id?"opacity-100":"opacity-0")})]},j.id),e[14]=a==null?void 0:a.id,e[15]=i,e[16]=u,e[17]=T):T=e[17],_=d.map(T),e[9]=a==null?void 0:a.id,e[10]=i,e[11]=d,e[12]=u,e[13]=_}else _=e[13];let v;e[18]!==_?(v=g.jsx(ku,{heading:"Servers",children:_}),e[18]=_,e[19]=v):v=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=g.jsx(RC,{}),e[20]=b):b=e[20];let x;e[21]!==n?(x=()=>{n(),l(!1)},e[21]=n,e[22]=x):x=e[22];let E;e[23]===Symbol.for("react.memo_cache_sentinel")?(E=g.jsx(ql,{className:"size-4","data-icon":"inline-start"}),e[23]=E):E=e[23];let N;e[24]!==x?(N=g.jsx(ku,{children:g.jsxs(Dl,{onSelect:x,children:[E,"Add Server..."]})}),e[24]=x,e[25]=N):N=e[25];let A;e[26]!==N||e[27]!==v?(A=g.jsx(wh,{className:"w-[240px] p-0 max-h-[80vh]",children:g.jsxs(Pv,{children:[C,g.jsxs(Fv,{className:"max-h-[50vh] overflow-y-auto",children:[w,v,b,N]})]})}),e[26]=N,e[27]=v,e[28]=A):A=e[28];let M;return e[29]!==o||e[30]!==A||e[31]!==S?(M=g.jsxs(Sh,{open:o,onOpenChange:l,children:[S,A]}),e[29]=o,e[30]=A,e[31]=S,e[32]=M):M=e[32],M}const Wm=640;function Wu(){const t=me.c(2),[e,n]=D.useState(void 0);let i,o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{const l=window.matchMedia(`(max-width: ${Wm-1}px)`),d=()=>{n(window.innerWidth<Wm)};return l.addEventListener("change",d),n(window.innerWidth<Wm),()=>l.removeEventListener("change",d)},o=[],t[0]=i,t[1]=o):(i=t[0],o=t[1]),D.useEffect(i,o),!!e}function ua(t){const e=me.c(12);let n,i,o,l;e[0]!==t?({className:n,orientation:o,decorative:l,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=o===void 0?"horizontal":o,a=l===void 0?!0:l;let u;e[5]!==n?(u=ke("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",n),e[5]=n,e[6]=u):u=e[6];let f;return e[7]!==a||e[8]!==d||e[9]!==i||e[10]!==u?(f=g.jsx(xD,{"data-slot":"separator",decorative:a,orientation:d,className:u,...i}),e[7]=a,e[8]=d,e[9]=i,e[10]=u,e[11]=f):f=e[11],f}function Ch(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(av,{"data-slot":"sheet",...n}),e[2]=n,e[3]=i):i=e[3],i}function Cj(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(uT,{"data-slot":"sheet-trigger",...n}),e[2]=n,e[3]=i):i=e[3],i}function kj(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(lv,{"data-slot":"sheet-portal",...n}),e[2]=n,e[3]=i):i=e[3],i}function Ej(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(cv,{"data-slot":"sheet-overlay",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function kh(t){const e=me.c(24);let n,i,o,l,d,a;e[0]!==t?({className:i,children:n,side:d,showCloseButton:a,style:l,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l,e[5]=d,e[6]=a):(n=e[1],i=e[2],o=e[3],l=e[4],d=e[5],a=e[6]);const u=d===void 0?"right":d,f=a===void 0?!0:a;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=g.jsx(Ej,{}),e[7]=p):p=e[7];let h;e[8]!==i?(h=ke("fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10",i),e[8]=i,e[9]=h):h=e[9];let y;e[10]!==u?(y=u==="left"||u==="right"?{top:"env(safe-area-inset-top, 0px)",bottom:"env(safe-area-inset-bottom, 0px)",height:"calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))"}:u==="top"?{top:"env(safe-area-inset-top, 0px)"}:u==="bottom"?{bottom:"env(safe-area-inset-bottom, 0px)"}:void 0,e[10]=u,e[11]=y):y=e[11];const S=y;let C;e[12]!==S||e[13]!==l?(C=S?{...S,...l}:l,e[12]=S,e[13]=l,e[14]=C):C=e[14];const w=C;let _;e[15]!==f?(_=f&&g.jsx(Jf,{"data-slot":"sheet-close",asChild:!0,children:g.jsxs(Pe,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm",children:[g.jsx(bs,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})}),e[15]=f,e[16]=_):_=e[16];let v;return e[17]!==n||e[18]!==o||e[19]!==u||e[20]!==h||e[21]!==w||e[22]!==_?(v=g.jsxs(kj,{children:[p,g.jsxs(uv,{"data-slot":"sheet-content","data-side":u,className:h,style:w,...o,children:[n,_]})]}),e[17]=n,e[18]=o,e[19]=u,e[20]=h,e[21]=w,e[22]=_,e[23]=v):v=e[23],v}function Eh(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("flex flex-col gap-0.5 p-4",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("div",{"data-slot":"sheet-header",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Ah(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("text-base font-medium text-foreground",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(NS,{"data-slot":"sheet-title",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Aj(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("text-sm text-muted-foreground",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(DS,{"data-slot":"sheet-description",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Eu(t){const e=me.c(6);let n,i;e[0]!==t?({delayDuration:i,...n}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);const o=i===void 0?0:i;let l;return e[3]!==o||e[4]!==n?(l=g.jsx($D,{"data-slot":"tooltip-provider",delayDuration:o,...n}),e[3]=o,e[4]=n,e[5]=l):l=e[5],l}function zl(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(qD,{"data-slot":"tooltip",...n}),e[2]=n,e[3]=i):i=e[3],i}function Pl(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(VD,{"data-slot":"tooltip-trigger",...n}),e[2]=n,e[3]=i):i=e[3],i}function Fl(t){const e=me.c(13);let n,i,o,l;e[0]!==t?({className:i,sideOffset:l,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=l===void 0?0:l;let a;e[5]!==i?(a=ke("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",i),e[5]=i,e[6]=a):a=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=g.jsx(KD,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"}),e[7]=u):u=e[7];let f;return e[8]!==n||e[9]!==o||e[10]!==d||e[11]!==a?(f=g.jsx(GD,{children:g.jsxs(WD,{"data-slot":"tooltip-content",sideOffset:d,className:a,...o,children:[n,u]})}),e[8]=n,e[9]=o,e[10]=d,e[11]=a,e[12]=f):f=e[12],f}const Tj="sidebar_state",Rj=3600*24*7,Nj="16rem",Dj="18rem",Mj="3rem",NC=D.createContext(null);function Ku(){const t=D.useContext(NC);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function jj(t){const e=me.c(33);let n,i,o,l,d,a,u;e[0]!==t?({defaultOpen:u,open:o,onOpenChange:d,className:i,style:a,children:n,...l}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l,e[5]=d,e[6]=a,e[7]=u):(n=e[1],i=e[2],o=e[3],l=e[4],d=e[5],a=e[6],u=e[7]);const f=u===void 0?!0:u,p=Wu(),[h,y]=D.useState(!1),[S,C]=D.useState(f),w=o!=null?o:S;let _;e[8]!==w||e[9]!==d?(_=U=>{const $=typeof U=="function"?U(w):U;d?d($):C($),document.cookie=`${Tj}=${$}; path=/; max-age=${Rj}`},e[8]=w,e[9]=d,e[10]=_):_=e[10];const v=_;let b;e[11]!==p||e[12]!==v?(b=()=>p?y(Lj):v(Oj),e[11]=p,e[12]=v,e[13]=b):b=e[13];const x=b,E=w?"expanded":"collapsed";let N;e[14]!==p||e[15]!==w||e[16]!==h||e[17]!==v||e[18]!==E||e[19]!==x?(N={state:E,open:w,setOpen:v,isMobile:p,openMobile:h,setOpenMobile:y,toggleSidebar:x},e[14]=p,e[15]=w,e[16]=h,e[17]=v,e[18]=E,e[19]=x,e[20]=N):N=e[20];const A=N;let M;e[21]!==a?(M={"--sidebar-width":Nj,"--sidebar-width-icon":Mj,...a},e[21]=a,e[22]=M):M=e[22];const T=M;let j;e[23]!==i?(j=ke("overflow-hidden group/sidebar-wrapper flex h-full w-full has-data-[variant=inset]:bg-sidebar",i),e[23]=i,e[24]=j):j=e[24];let O;e[25]!==n||e[26]!==l||e[27]!==T||e[28]!==j?(O=g.jsx("div",{"data-slot":"sidebar-wrapper",style:T,className:j,...l,children:n}),e[25]=n,e[26]=l,e[27]=T,e[28]=j,e[29]=O):O=e[29];let F;return e[30]!==A||e[31]!==O?(F=g.jsx(NC.Provider,{value:A,children:O}),e[30]=A,e[31]=O,e[32]=F):F=e[32],F}function Oj(t){return!t}function Lj(t){return!t}function Ij(t){const e=me.c(49);let n,i,o,l,d,a,u;e[0]!==t?({side:d,variant:a,collapsible:u,className:i,children:n,dir:o,...l}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l,e[5]=d,e[6]=a,e[7]=u):(n=e[1],i=e[2],o=e[3],l=e[4],d=e[5],a=e[6],u=e[7]);const f=d===void 0?"left":d,p=a===void 0?"sidebar":a,h=u===void 0?"offcanvas":u,{isMobile:y,state:S,openMobile:C,setOpenMobile:w}=Ku();if(h==="none"){let O;e[8]!==i?(O=ke("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",i),e[8]=i,e[9]=O):O=e[9];let F;return e[10]!==n||e[11]!==l||e[12]!==O?(F=g.jsx("div",{"data-slot":"sidebar",className:O,...l,children:n}),e[10]=n,e[11]=l,e[12]=O,e[13]=F):F=e[13],F}if(y){let O;e[14]===Symbol.for("react.memo_cache_sentinel")?(O={"--sidebar-width":Dj},e[14]=O):O=e[14];let F;e[15]===Symbol.for("react.memo_cache_sentinel")?(F=g.jsxs(Eh,{className:"sr-only",children:[g.jsx(Ah,{children:"Sidebar"}),g.jsx(Aj,{children:"Displays the mobile sidebar."})]}),e[15]=F):F=e[15];let U;e[16]!==n?(U=g.jsx("div",{className:"flex h-full w-full flex-col",children:n}),e[16]=n,e[17]=U):U=e[17];let $;e[18]!==o||e[19]!==f||e[20]!==U?($=g.jsxs(kh,{dir:o,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:O,side:f,children:[F,U]}),e[18]=o,e[19]=f,e[20]=U,e[21]=$):$=e[21];let G;return e[22]!==C||e[23]!==l||e[24]!==w||e[25]!==$?(G=g.jsx(Ch,{open:C,onOpenChange:w,...l,children:$}),e[22]=C,e[23]=l,e[24]=w,e[25]=$,e[26]=G):G=e[26],G}const _=S==="collapsed"?h:"",v=p==="floating"||p==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let b;e[27]!==v?(b=ke("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",v),e[27]=v,e[28]=b):b=e[28];let x;e[29]!==b?(x=g.jsx("div",{"data-slot":"sidebar-gap",className:b}),e[29]=b,e[30]=x):x=e[30];const E=p==="floating"||p==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l";let N;e[31]!==i||e[32]!==E?(N=ke("fixed z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",E,i),e[31]=i,e[32]=E,e[33]=N):N=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A={top:"env(safe-area-inset-top, 0)",bottom:"env(safe-area-inset-bottom, 0)",height:"calc(100vh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0))"},e[34]=A):A=e[34];let M;e[35]!==n?(M=g.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:n}),e[35]=n,e[36]=M):M=e[36];let T;e[37]!==l||e[38]!==f||e[39]!==M||e[40]!==N?(T=g.jsx("div",{"data-slot":"sidebar-container","data-side":f,className:N,style:A,...l,children:M}),e[37]=l,e[38]=f,e[39]=M,e[40]=N,e[41]=T):T=e[41];let j;return e[42]!==f||e[43]!==S||e[44]!==T||e[45]!==_||e[46]!==x||e[47]!==p?(j=g.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":S,"data-collapsible":_,"data-variant":p,"data-side":f,"data-slot":"sidebar",children:[x,T]}),e[42]=f,e[43]=S,e[44]=T,e[45]=_,e[46]=x,e[47]=p,e[48]=j):j=e[48],j}function Sb(t){const e=me.c(15);let n,i,o;e[0]!==t?({className:n,onClick:i,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o):(n=e[1],i=e[2],o=e[3]);const{toggleSidebar:l}=Ku();let d;e[4]!==n?(d=ke(n),e[4]=n,e[5]=d):d=e[5];let a;e[6]!==i||e[7]!==l?(a=h=>{i==null||i(h),l()},e[6]=i,e[7]=l,e[8]=a):a=e[8];let u,f;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=g.jsx(z4,{}),f=g.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=u,e[10]=f):(u=e[9],f=e[10]);let p;return e[11]!==o||e[12]!==d||e[13]!==a?(p=g.jsxs(Pe,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:d,onClick:a,...o,children:[u,f]}),e[11]=o,e[12]=d,e[13]=a,e[14]=p):p=e[14],p}function Bj(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("flex flex-col gap-2 p-2",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function zj(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("flex flex-col gap-2 p-2",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Pj(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("mx-2 w-auto bg-sidebar-border",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(ua,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}const Fj=D.forwardRef((t,e)=>{const n=me.c(9);let i,o;n[0]!==t?({className:i,...o}=t,n[0]=t,n[1]=i,n[2]=o):(i=n[1],o=n[2]);let l;n[3]!==i?(l=ke("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",i),n[3]=i,n[4]=l):l=n[4];let d;return n[5]!==o||n[6]!==e||n[7]!==l?(d=g.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l,ref:e,...o}),n[5]=o,n[6]=e,n[7]=l,n[8]=d):d=n[8],d});function If(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("relative flex w-full min-w-0 flex-col p-2",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Bf(t){const e=me.c(10);let n,i,o;e[0]!==t?({className:n,asChild:o,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o):(n=e[1],i=e[2],o=e[3]);const d=(o===void 0?!1:o)?ju:"div";let a;e[4]!==n?(a=ke("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",n),e[4]=n,e[5]=a):a=e[5];let u;return e[6]!==d||e[7]!==i||e[8]!==a?(u=g.jsx(d,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:a,...i}),e[6]=d,e[7]=i,e[8]=a,e[9]=u):u=e[9],u}function zf(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("w-full text-sm",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Al(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("flex w-full min-w-0 flex-col gap-0",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function da(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("group/menu-item relative",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}const Hj=Gl("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Ml(t){const e=me.c(28);let n,i,o,l,d,a,u;e[0]!==t?({asChild:o,isActive:l,variant:d,size:a,tooltip:u,className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l,e[5]=d,e[6]=a,e[7]=u):(n=e[1],i=e[2],o=e[3],l=e[4],d=e[5],a=e[6],u=e[7]);const f=o===void 0?!1:o,p=l===void 0?!1:l,h=d===void 0?"default":d,y=a===void 0?"default":a,S=f?ju:"button",{isMobile:C,state:w}=Ku();let _;e[8]!==n||e[9]!==y||e[10]!==h?(_=ke(Hj({variant:h,size:y}),n),e[8]=n,e[9]=y,e[10]=h,e[11]=_):_=e[11];let v;e[12]!==S||e[13]!==p||e[14]!==i||e[15]!==y||e[16]!==_?(v=g.jsx(S,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":y,"data-active":p,className:_,...i}),e[12]=S,e[13]=p,e[14]=i,e[15]=y,e[16]=_,e[17]=v):v=e[17];const b=v;if(!u)return b;if(typeof u=="string"){let M;e[18]!==u?(M={children:u},e[18]=u,e[19]=M):M=e[19],u=M}let x;e[20]!==b?(x=g.jsx(Pl,{asChild:!0,children:b}),e[20]=b,e[21]=x):x=e[21];const E=w!=="collapsed"||C;let N;e[22]!==E||e[23]!==u?(N=g.jsx(Fl,{side:"right",align:"center",hidden:E,...u}),e[22]=E,e[23]=u,e[24]=N):N=e[24];let A;return e[25]!==x||e[26]!==N?(A=g.jsxs(zl,{children:[x,N]}),e[25]=x,e[26]=N,e[27]=A):A=e[27],A}function Uj(t){const e=me.c(12);let n,i,o,l;e[0]!==t?({className:n,asChild:o,showOnHover:l,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=o===void 0?!1:o,a=l===void 0?!1:l,u=d?ju:"button",f=a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0";let p;e[5]!==n||e[6]!==f?(p=ke("absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",f,n),e[5]=n,e[6]=f,e[7]=p):p=e[7];let h;return e[8]!==u||e[9]!==i||e[10]!==p?(h=g.jsx(u,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:p,...i}),e[8]=u,e[9]=i,e[10]=p,e[11]=h):h=e[11],h}function $j(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("ml-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border pl-2.5 py-0.5 group-data-[collapsible=icon]:hidden",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function So(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(Q5,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=i):i=e[3],i}function wo(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(tS,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=i):i=e[3],i}function Co(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(nS,{"data-slot":"collapsible-content",...n}),e[2]=n,e[3]=i):i=e[3],i}function qj(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(K6,{"data-slot":"dropdown-menu",...n}),e[2]=n,e[3]=i):i=e[3],i}function Vj(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(Y6,{"data-slot":"dropdown-menu-trigger",...n}),e[2]=n,e[3]=i):i=e[3],i}function Gj(t){const e=me.c(12);let n,i,o,l;e[0]!==t?({className:n,align:o,sideOffset:l,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=o===void 0?"start":o,a=l===void 0?4:l;let u;e[5]!==n?(u=ke("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 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 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",n),e[5]=n,e[6]=u):u=e[6];let f;return e[7]!==d||e[8]!==i||e[9]!==a||e[10]!==u?(f=g.jsx(X6,{children:g.jsx(Z6,{"data-slot":"dropdown-menu-content",sideOffset:a,align:d,className:u,...i})}),e[7]=d,e[8]=i,e[9]=a,e[10]=u,e[11]=f):f=e[11],f}function Km(t){const e=me.c(12);let n,i,o,l;e[0]!==t?({className:n,inset:i,variant:l,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=l===void 0?"default":l;let a;e[5]!==n?(a=ke("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",n),e[5]=n,e[6]=a):a=e[6];let u;return e[7]!==i||e[8]!==o||e[9]!==a||e[10]!==d?(u=g.jsx(Q6,{"data-slot":"dropdown-menu-item","data-inset":i,"data-variant":d,className:a,...o}),e[7]=i,e[8]=o,e[9]=a,e[10]=d,e[11]=u):u=e[11],u}function Wj(t,e){const n=me.c(6),[i,o]=D.useState(null),l=D.useRef(!1),d=D.useRef(null);let a,u;n[0]!==e||n[1]!==t?(a=()=>(l.current&&!e&&t&&(o(t),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{o(null),d.current=null},5e3)),l.current=e,()=>{d.current&&clearTimeout(d.current)}),u=[e,t],n[0]=e,n[1]=t,n[2]=a,n[3]=u):(a=n[2],u=n[3]),D.useEffect(a,u);const f=t!==null&&i===t;let p;return n[4]!==f?(p={isFlashing:f},n[4]=f,n[5]=p):p=n[5],p}const wb=Br.memo(function(e){const n=me.c(6),{isClosed:i,onReopen:o,onClose:l,onDelete:d}=e;let a;n[0]===Symbol.for("react.memo_cache_sentinel")?(a=g.jsx(Vj,{asChild:!0,children:g.jsxs(Uj,{showOnHover:!0,children:[g.jsx(n4,{className:"size-4"}),g.jsx("span",{className:"sr-only",children:"Session actions"})]})}),n[0]=a):a=n[0];let u;return n[1]!==i||n[2]!==l||n[3]!==d||n[4]!==o?(u=g.jsxs(qj,{children:[a,g.jsx(Gj,{align:"end",children:i?g.jsxs(g.Fragment,{children:[g.jsxs(Km,{onClick:o,children:[g.jsx(Px,{className:"size-4"}),"Restore"]}),g.jsxs(Km,{onClick:d,className:"text-destructive focus:text-destructive",children:[g.jsx(Du,{className:"size-4"}),"Delete permanently"]})]}):g.jsxs(Km,{onClick:l,children:[g.jsx(bs,{className:"size-4"}),"Archive"]})})]}),n[1]=i,n[2]=l,n[3]=d,n[4]=o,n[5]=u):u=n[5],u}),Cb=Br.memo(function(e){const n=me.c(4),{status:i,isStreaming:o,runningAt:l}=e;if(o||i==="running"||!!l){let u;return n[0]===Symbol.for("react.memo_cache_sentinel")?(u=g.jsx(gr,{className:"size-3.5 animate-spin shrink-0"}),n[0]=u):u=n[0],u}if(i==="error"){let u;return n[1]===Symbol.for("react.memo_cache_sentinel")?(u=g.jsx(Gf,{className:"size-3.5 shrink-0"}),n[1]=u):u=n[1],u}if(i==="interrupted"){let u;return n[2]===Symbol.for("react.memo_cache_sentinel")?(u=g.jsx(zx,{className:"size-3.5 shrink-0"}),n[2]=u):u=n[2],u}let a;return n[3]===Symbol.for("react.memo_cache_sentinel")?(a=g.jsx(Nu,{className:"size-3.5 shrink-0"}),n[3]=a):a=n[3],a}),zg=Br.memo(function t({session:e,allSessions:n,isActive:i,currentSessionId:o,streamingSessionId:l,pendingPermissions:d,onResumeSession:a,onCloseSession:u,onReopenSession:f,onDeleteSession:p}){const h=D.useMemo(()=>n.filter(x=>x.parentId===e.id),[n,e.id]),y=h.length>0,S=e.status==="closed",C=D.useMemo(()=>h.some(x=>x.id===o),[h,o]),w=e.id===l,_=d.some(x=>x.sessionId===e.id),v=w||e.subagentStatus==="running"||!!e.runningAt,{isFlashing:b}=Wj(e.id,v);return y?g.jsx(Eu,{delayDuration:300,children:g.jsx(So,{defaultOpen:i||C,className:"group/collapsible",children:g.jsxs(da,{children:[g.jsxs("div",{className:"flex items-center w-full",children:[g.jsx(wo,{asChild:!0,children:g.jsx("button",{className:"flex items-center justify-center rounded-md hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shrink-0 size-7 p-1","aria-label":"Toggle child sessions",children:g.jsx(si,{className:"size-4 transition-transform duration-200 [[data-state=open]>&]:rotate-90"})})}),g.jsx(Ml,{"data-session-id":e.id,isActive:i,onClick:()=>a(e.id),className:ke("flex-1 min-w-0",b&&"animate-completion-flash rounded-md"),children:g.jsxs(zl,{children:[g.jsx(Pl,{asChild:!0,children:g.jsxs("span",{className:"truncate flex items-center gap-2",children:[g.jsx(Cb,{status:e.subagentStatus,isStreaming:w,runningAt:e.runningAt}),_&&g.jsx(bu,{className:"size-3 text-warning shrink-0 animate-pulse"}),e.title||"Untitled"]})}),g.jsx(Fl,{side:"right",className:"max-w-xs",children:e.title||"Untitled"})]})}),g.jsx(wb,{isClosed:S,onReopen:()=>f(e.id),onClose:()=>u(e.id),onDelete:()=>p(e.id)})]}),g.jsx(Co,{children:g.jsx($j,{children:h.map(x=>g.jsx(t,{session:x,allSessions:n,isActive:o===x.id,currentSessionId:o,streamingSessionId:l,pendingPermissions:d,onResumeSession:a,onCloseSession:u,onReopenSession:f,onDeleteSession:p},x.id))})})]})})}):g.jsx(Eu,{delayDuration:300,children:g.jsx(da,{children:g.jsxs("div",{className:"flex items-center w-full",children:[g.jsx("div",{className:"shrink-0 size-7 p-1"}),g.jsx(Ml,{"data-session-id":e.id,isActive:i,onClick:()=>a(e.id),className:ke("flex-1 min-w-0",b&&"animate-completion-flash rounded-md"),children:g.jsxs(zl,{children:[g.jsx(Pl,{asChild:!0,children:g.jsxs("span",{className:"truncate flex items-center gap-2",children:[g.jsx(Cb,{status:e.subagentStatus,isStreaming:w,runningAt:e.runningAt}),_&&g.jsx(bu,{className:"size-3 text-warning shrink-0 animate-pulse"}),e.title||"Untitled"]})}),g.jsx(Fl,{side:"right",className:"max-w-xs",children:e.title||"Untitled"})]})}),g.jsx(wb,{isClosed:S,onReopen:()=>f(e.id),onClose:()=>u(e.id),onDelete:()=>p(e.id)})]})})})}),Kj=Gl("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Bn(t){const e=me.c(13);let n,i,o,l;e[0]!==t?({className:n,variant:o,asChild:l,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=o===void 0?"default":o,u=(l===void 0?!1:l)?ju:"span";let f;e[5]!==n||e[6]!==d?(f=ke(Kj({variant:d}),n),e[5]=n,e[6]=d,e[7]=f):f=e[7];let p;return e[8]!==u||e[9]!==i||e[10]!==f||e[11]!==d?(p=g.jsx(u,{"data-slot":"badge","data-variant":d,className:f,...i}),e[8]=u,e[9]=i,e[10]=f,e[11]=d,e[12]=p):p=e[12],p}const Yj=Br.memo(function(e){const n=me.c(43),{allSessions:i,currentSession:o,currentSessionId:l,streamingSessionId:d,pendingPermissions:a,favoritedWorkspaceIds:u,workspaces:f,activeWorkspace:p,onSelectWorkspace:h,onResumeSession:y,onCloseSession:S,onReopenSession:C,onDeleteSession:w,onCreateSessionInWorkspace:_,connected:v}=e;let b;if(n[0]!==u||n[1]!==f){const T=new Map(f.map(Xj));b=u.map(j=>T.get(j)).filter(Zj),n[0]=u,n[1]=f,n[2]=b}else b=n[2];const x=b;let E;if(n[3]!==i||n[4]!==x){E=new Map;for(const T of x){const j=i.filter(O=>O.workspaceId===T.id&&O.status==="active"&&O.parentId===null).sort(Qj);E.set(T.id,j)}n[3]=i,n[4]=x,n[5]=E}else E=n[5];const N=E;if(x.length===0){let T;n[6]===Symbol.for("react.memo_cache_sentinel")?(T=g.jsx(Bf,{children:"Overview"}),n[6]=T):T=n[6];let j;return n[7]===Symbol.for("react.memo_cache_sentinel")?(j=g.jsxs(If,{children:[T,g.jsx(zf,{children:g.jsx("div",{className:"px-2 py-8 text-center text-sm text-muted-foreground",children:"Star a workspace to see it here"})})]}),n[7]=j):j=n[7],j}let A;if(n[8]!==(p==null?void 0:p.id)||n[9]!==i||n[10]!==v||n[11]!==(o==null?void 0:o.id)||n[12]!==(o==null?void 0:o.workspaceId)||n[13]!==l||n[14]!==x||n[15]!==S||n[16]!==_||n[17]!==w||n[18]!==C||n[19]!==y||n[20]!==h||n[21]!==a||n[22]!==d||n[23]!==N){let T;n[25]!==(p==null?void 0:p.id)||n[26]!==i||n[27]!==v||n[28]!==(o==null?void 0:o.id)||n[29]!==(o==null?void 0:o.workspaceId)||n[30]!==l||n[31]!==S||n[32]!==_||n[33]!==w||n[34]!==C||n[35]!==y||n[36]!==h||n[37]!==a||n[38]!==d||n[39]!==N?(T=j=>{const O=j.id===(p==null?void 0:p.id),F=(o==null?void 0:o.workspaceId)===j.id,U=N.get(j.id)||[];return g.jsx(So,{defaultOpen:O,className:"group/collapsible",children:g.jsxs(If,{children:[g.jsx(Bf,{asChild:!0,children:g.jsxs(wo,{className:"flex items-center justify-between w-full",onClick:()=>h(j),children:[g.jsxs("span",{className:"flex items-center gap-2",children:[g.jsx(si,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),j.isVirtual?g.jsx(vg,{className:"size-3.5"}):g.jsx(vo,{className:"size-3.5"}),g.jsx("span",{className:F?"truncate text-sidebar-foreground font-medium":"truncate",children:j.name})]}),g.jsx(Bn,{variant:"secondary",children:U.length})]})}),g.jsx(Co,{children:g.jsxs(zf,{children:[g.jsx(Al,{children:g.jsx(da,{children:g.jsxs(Ml,{onClick:()=>_(j.id),disabled:!v,className:"w-full",children:[g.jsx(ql,{className:"size-4","data-icon":"inline-start"}),g.jsx("span",{children:"New Chat"})]})})}),g.jsx(Pj,{}),g.jsx(Al,{children:U.length===0?g.jsx("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"(no active sessions)"}):U.map($=>g.jsx(zg,{session:$,allSessions:i,isActive:(o==null?void 0:o.id)===$.id,currentSessionId:l,streamingSessionId:d,pendingPermissions:a,onResumeSession:y,onCloseSession:S,onReopenSession:C,onDeleteSession:w},$.id))})]})})]})},j.id)},n[25]=p==null?void 0:p.id,n[26]=i,n[27]=v,n[28]=o==null?void 0:o.id,n[29]=o==null?void 0:o.workspaceId,n[30]=l,n[31]=S,n[32]=_,n[33]=w,n[34]=C,n[35]=y,n[36]=h,n[37]=a,n[38]=d,n[39]=N,n[40]=T):T=n[40],A=x.map(T),n[8]=p==null?void 0:p.id,n[9]=i,n[10]=v,n[11]=o==null?void 0:o.id,n[12]=o==null?void 0:o.workspaceId,n[13]=l,n[14]=x,n[15]=S,n[16]=_,n[17]=w,n[18]=C,n[19]=y,n[20]=h,n[21]=a,n[22]=d,n[23]=N,n[24]=A}else A=n[24];let M;return n[41]!==A?(M=g.jsx(g.Fragment,{children:A}),n[41]=A,n[42]=M):M=n[42],M});function Xj(t){return[t.id,t]}function Zj(t){return t!==void 0}function Qj(t,e){return new Date(e.updatedAt).getTime()-new Date(t.updatedAt).getTime()}const Jj=D.forwardRef((t,e)=>{const n=me.c(90),{sessions:i,currentSession:o,currentSessionId:l,streamingSessionId:d,pendingPermissions:a,connected:u,workspaces:f,activeWorkspace:p,allSessions:h,viewMode:y,favoritedWorkspaceIds:S,onCreateSession:C,onResumeSession:w,onCloseSession:_,onReopenSession:v,onDeleteSession:b,onSelectWorkspace:x,onCreateVirtualWorkspace:E,onCreatePhysicalWorkspace:N,onCreateSessionInWorkspace:A,onOpenSettings:M,onOpenMCP:T,onOpenAddServer:j,onServerSwitch:O,onEscape:F}=t,{quickConnections:U,addToQuickConnections:$,removeFromQuickConnections:G,activeServer:K}=Vl();Ku();const V=D.useRef(null),X=D.useRef(null);let Z,I;n[0]!==l?(Z=()=>{X.current=l},I=[l],n[0]=l,n[1]=Z,n[2]=I):(Z=n[1],I=n[2]),D.useEffect(Z,I);let L;n[3]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{var Ve;const Ie=V.current;if(!Ie)return;const ot=Array.from(Ie.querySelectorAll('[data-sidebar="menu-button"]'));if(ot.length===0){Ie.focus();return}const Ce=ot.find(lt=>lt.getAttribute("data-session-id")===X.current);Ce?Ce.focus():(Ve=ot[0])==null||Ve.focus()},n[3]=L):L=n[3];const B=L;let H,P;n[4]===Symbol.for("react.memo_cache_sentinel")?(H=()=>({focusSessionPanel:B}),P=[B],n[4]=H,n[5]=P):(H=n[4],P=n[5]),D.useImperativeHandle(e,H,P);let ee;n[6]!==F?(ee=Ie=>{var lt,Dt,Xt,Ot,Jt;const ot=V.current;if(!ot)return;const Ce=Array.from(ot.querySelectorAll('[data-sidebar="menu-button"]')),Ve=Ce.indexOf(document.activeElement);e:switch(Ie.key){case"ArrowDown":{Ie.preventDefault();const Et=Ve<Ce.length-1?Ve+1:0;(lt=Ce[Et])==null||lt.focus();break e}case"ArrowUp":{Ie.preventDefault();const Et=Ve>0?Ve-1:Ce.length-1;(Dt=Ce[Et])==null||Dt.focus();break e}case"ArrowRight":{const Et=(Xt=document.activeElement)==null?void 0:Xt.parentElement;if(!Et)break e;const vn=Et.querySelector('button[aria-label="Toggle child sessions"]');if(!vn)break e;const Vt=Et.closest("[data-state]");(Vt==null?void 0:Vt.dataset.state)==="closed"&&(Ie.preventDefault(),vn.click());break e}case"ArrowLeft":{const Et=(Ot=document.activeElement)==null?void 0:Ot.parentElement;if(!Et)break e;const vn=Et.querySelector('button[aria-label="Toggle child sessions"]');if(!vn)break e;const Vt=Et.closest("[data-state]");(Vt==null?void 0:Vt.dataset.state)==="open"&&(Ie.preventDefault(),vn.click());break e}case"Enter":{document.activeElement instanceof HTMLButtonElement&&document.activeElement.click();break e}case"Escape":Ie.preventDefault(),(Jt=document.activeElement)==null||Jt.blur(),F==null||F()}},n[6]=F,n[7]=ee):ee=n[7];const ne=ee;let Q,W;if(n[8]!==i){const Ie=i.filter(e8);Q=Ie.filter(t8),W=Ie.filter(n8),n[8]=i,n[9]=Q,n[10]=W}else Q=n[9],W=n[10];let q;n[11]!==Q||n[12]!==W?(q={activeSessions:Q,archivedSessions:W},n[11]=Q,n[12]=W,n[13]=q):q=n[13];const{activeSessions:J,archivedSessions:ie}=q;let ce;n[14]!==(K==null?void 0:K.id)||n[15]!==U?(ce=Ie=>U.some(ot=>ot.workspaceId===Ie&&ot.serverId===(K==null?void 0:K.id)),n[14]=K==null?void 0:K.id,n[15]=U,n[16]=ce):ce=n[16];const ae=ce;let _e;n[17]!==K||n[18]!==$||n[19]!==U||n[20]!==G?(_e=(Ie,ot)=>{if(!K)return;const Ce=U.find(Ve=>Ve.workspaceId===Ie&&Ve.serverId===K.id);Ce?G(Ce.id):$(K.id,K.name,Ie,ot)},n[17]=K,n[18]=$,n[19]=U,n[20]=G,n[21]=_e):_e=n[21];const Ee=_e;let Te;n[22]!==j||n[23]!==O?(Te=g.jsx(wj,{onOpenAddServer:j,onServerSwitch:O}),n[22]=j,n[23]=O,n[24]=Te):Te=n[24];let Be;n[25]!==p||n[26]!==Ee||n[27]!==ae||n[28]!==N||n[29]!==E||n[30]!==x||n[31]!==y||n[32]!==f?(Be=y!=="overview"&&g.jsx(Sj,{workspaces:f,activeWorkspace:p,onSelectWorkspace:x,onCreateVirtualWorkspace:E,onCreatePhysicalWorkspace:N,isWorkspaceFavorited:ae,onToggleFavorite:Ee}),n[25]=p,n[26]=Ee,n[27]=ae,n[28]=N,n[29]=E,n[30]=x,n[31]=y,n[32]=f,n[33]=Be):Be=n[33];let se;n[34]!==Te||n[35]!==Be?(se=g.jsxs("div",{className:"p-2 space-y-2",children:[Te,Be]}),n[34]=Te,n[35]=Be,n[36]=se):se=n[36];let Ye;n[37]!==u||n[38]!==C||n[39]!==y?(Ye=y!=="overview"&&g.jsx(Al,{children:g.jsx(da,{children:g.jsxs(Ml,{onClick:C,disabled:!u,className:"w-full",children:[g.jsx(ql,{className:"size-4","data-icon":"inline-start"}),g.jsx("span",{children:"New Chat"})]})})}),n[37]=u,n[38]=C,n[39]=y,n[40]=Ye):Ye=n[40];let rt;n[41]!==se||n[42]!==Ye?(rt=g.jsxs(Bj,{children:[se,Ye]}),n[41]=se,n[42]=Ye,n[43]=rt):rt=n[43];let nt;n[44]!==J||n[45]!==p||n[46]!==h||n[47]!==ie||n[48]!==u||n[49]!==o||n[50]!==l||n[51]!==S||n[52]!==_||n[53]!==A||n[54]!==b||n[55]!==v||n[56]!==w||n[57]!==x||n[58]!==a||n[59]!==i||n[60]!==d||n[61]!==y||n[62]!==f?(nt=y==="overview"?g.jsx(Yj,{allSessions:h,currentSession:o,currentSessionId:l,streamingSessionId:d,favoritedWorkspaceIds:S,workspaces:f,activeWorkspace:p,onSelectWorkspace:x,onResumeSession:w,onCloseSession:_,onReopenSession:v,onDeleteSession:b,onCreateSessionInWorkspace:A,connected:u,pendingPermissions:a}):g.jsxs(g.Fragment,{children:[J.length>0&&g.jsx(So,{defaultOpen:!0,className:"group/collapsible",children:g.jsxs(If,{children:[g.jsx(Bf,{asChild:!0,children:g.jsxs(wo,{className:"flex items-center justify-between w-full",children:[g.jsxs("span",{className:"flex items-center gap-2",children:[g.jsx(si,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Active"]}),g.jsx(Bn,{variant:"secondary",children:J.length})]})}),g.jsx(Co,{children:g.jsx(zf,{children:g.jsx(Al,{children:J.map(Ie=>g.jsx(zg,{session:Ie,allSessions:i,isActive:(o==null?void 0:o.id)===Ie.id,currentSessionId:l,streamingSessionId:d,pendingPermissions:a,onResumeSession:w,onCloseSession:_,onReopenSession:v,onDeleteSession:b},Ie.id))})})})]})}),ie.length>0&&g.jsx(So,{defaultOpen:!0,className:"group/collapsible",children:g.jsxs(If,{children:[g.jsx(Bf,{asChild:!0,children:g.jsxs(wo,{className:"flex items-center justify-between w-full",children:[g.jsxs("span",{className:"flex items-center gap-2",children:[g.jsx(si,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Archived"]}),g.jsx(Bn,{variant:"secondary",children:ie.length})]})}),g.jsx(Co,{children:g.jsx(zf,{children:g.jsx(Al,{children:ie.map(Ie=>g.jsx(zg,{session:Ie,allSessions:i,isActive:(o==null?void 0:o.id)===Ie.id,currentSessionId:l,streamingSessionId:d,pendingPermissions:a,onResumeSession:w,onCloseSession:_,onReopenSession:v,onDeleteSession:b},Ie.id))})})})]})}),J.length===0&&ie.length===0&&g.jsxs("div",{className:"p-4 text-center text-sm text-muted-foreground",children:["No sessions yet.",g.jsx("br",{}),"Start a new chat to begin."]})]}),n[44]=J,n[45]=p,n[46]=h,n[47]=ie,n[48]=u,n[49]=o,n[50]=l,n[51]=S,n[52]=_,n[53]=A,n[54]=b,n[55]=v,n[56]=w,n[57]=x,n[58]=a,n[59]=i,n[60]=d,n[61]=y,n[62]=f,n[63]=nt):nt=n[63];let Ge;n[64]!==ne||n[65]!==nt?(Ge=g.jsx(Fj,{ref:V,tabIndex:-1,onKeyDown:ne,className:"outline-none",children:nt}),n[64]=ne,n[65]=nt,n[66]=Ge):Ge=n[66];let gt;n[67]!==u?(gt=u?g.jsx(p5,{className:"size-3.5 text-success"}):g.jsx(qx,{className:"size-3.5 text-destructive"}),n[67]=u,n[68]=gt):gt=n[68];const it=u?"Connected":"Disconnected";let Je;n[69]!==it?(Je=g.jsx("span",{className:"text-xs text-muted-foreground",children:it}),n[69]=it,n[70]=Je):Je=n[70];let at;n[71]!==gt||n[72]!==Je?(at=g.jsx(da,{children:g.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[gt,Je]})}),n[71]=gt,n[72]=Je,n[73]=at):at=n[73];let fe,ge;n[74]===Symbol.for("react.memo_cache_sentinel")?(fe=g.jsx(fa,{className:"size-4","data-icon":"inline-start"}),ge=g.jsx("span",{children:"MCP Servers"}),n[74]=fe,n[75]=ge):(fe=n[74],ge=n[75]);let Ae;n[76]!==T?(Ae=g.jsx(da,{children:g.jsxs(Ml,{onClick:T,children:[fe,ge]})}),n[76]=T,n[77]=Ae):Ae=n[77];let Me,Le;n[78]===Symbol.for("react.memo_cache_sentinel")?(Me=g.jsx(Fx,{className:"size-4","data-icon":"inline-start"}),Le=g.jsx("span",{children:"Settings"}),n[78]=Me,n[79]=Le):(Me=n[78],Le=n[79]);let st;n[80]!==M?(st=g.jsx(da,{children:g.jsx("div",{className:"flex items-center gap-1",children:g.jsxs(Ml,{onClick:M,children:[Me,Le]})})}),n[80]=M,n[81]=st):st=n[81];let Se;n[82]!==at||n[83]!==Ae||n[84]!==st?(Se=g.jsx(zj,{className:"pb-4",children:g.jsxs(Al,{children:[at,Ae,st]})}),n[82]=at,n[83]=Ae,n[84]=st,n[85]=Se):Se=n[85];let Ze;return n[86]!==rt||n[87]!==Ge||n[88]!==Se?(Ze=g.jsxs(Ij,{collapsible:"offcanvas",children:[rt,Ge,Se]}),n[86]=rt,n[87]=Ge,n[88]=Se,n[89]=Ze):Ze=n[89],Ze});function e8(t){return!t.parentId}function t8(t){return t.status==="active"}function n8(t){return t.status==="closed"}const r8={".ts":{icon:Ci,color:"text-blue-500"},".tsx":{icon:Ci,color:"text-blue-500"},".js":{icon:Ci,color:"text-yellow-500"},".jsx":{icon:Ci,color:"text-yellow-500"},".json":{icon:Ci,color:"text-yellow-600"},".md":{icon:Ci,color:"text-gray-500"},".css":{icon:Ci,color:"text-purple-500"},".html":{icon:Ci,color:"text-orange-500"}};function DC({entry:t,workspaceId:e,parentPath:n,depth:i,onFileSelect:o,showHidden:l=!0,serverUrl:d,apiToken:a}){const{fetchWithAuth:u}=qu(),[f,p]=D.useState(!1),[h,y]=D.useState([]),[S,C]=D.useState(!1),[w,_]=D.useState(!1),v=n?`${n}/${t.path}`:t.path,b=t.type==="directory",x=async()=>{if(!(w||S)){C(!0);try{const O=await(await u(`/api/workspaces/${e}/files?path=${encodeURIComponent(v)}&showHidden=${l}`,{},{serverUrl:d,token:a})).json();y(O.files||[]),_(!0)}catch(j){console.error("Failed to load children:",j)}finally{C(!1)}}},E=j=>{p(j),j&&b&&x()},N=()=>{!b&&o&&o({...t,path:v})},A=t.extension?r8[t.extension]:null,M=b?f?yg:vo:(A==null?void 0:A.icon)||Ci,T=b?"text-amber-500":(A==null?void 0:A.color)||"text-muted-foreground";return b?g.jsxs(So,{open:f,onOpenChange:E,children:[g.jsx(wo,{asChild:!0,children:g.jsxs("button",{className:ke("flex items-center gap-1.5 w-full min-w-0 overflow-x-hidden px-1.5 py-0.5 rounded text-sm","hover:bg-accent hover:text-accent-foreground","transition-colors text-left"),style:{paddingLeft:`${i*12+6}px`},children:[S?g.jsx(gr,{className:"w-3 h-3 animate-spin shrink-0"}):g.jsx(si,{className:ke("w-3 h-3 shrink-0 transition-transform",f&&"rotate-90")}),g.jsx(M,{className:ke("w-4 h-4 shrink-0",T)}),g.jsx("span",{className:"truncate min-w-0 flex-1",children:t.name})]})}),g.jsx(Co,{children:h.map(j=>g.jsx(DC,{entry:j,workspaceId:e,parentPath:v,depth:i+1,onFileSelect:o,showHidden:l,serverUrl:d,apiToken:a},`${v}/${j.path}`))})]}):g.jsxs("button",{onClick:N,className:ke("flex items-center gap-1.5 w-full min-w-0 overflow-x-hidden px-1.5 py-0.5 rounded text-sm","hover:bg-accent hover:text-accent-foreground","transition-colors text-left"),style:{paddingLeft:`${i*12+6}px`},children:[g.jsx(M,{className:ke("w-4 h-4 shrink-0",T)}),g.jsx("span",{className:"truncate min-w-0 flex-1",children:t.name})]})}function kb({workspaceId:t,serverUrl:e,apiToken:n,onFileSelect:i,showHidden:o=!0}){const[l,d]=D.useState([]),[a,u]=D.useState(""),[f,p]=D.useState(!0),[h,y]=D.useState(null),{fetchWithAuth:S}=qu(),C=D.useCallback(async()=>{p(!0),y(null);try{const w=await S(`/api/workspaces/${t}/files?showHidden=${o}`,{},{serverUrl:e,token:n}),_=await w.json();if(!w.ok)throw new Error(_.message||"Failed to load files");d(_.files),u(_.currentPath)}catch(w){y(w instanceof Error?w.message:"Failed to load files")}finally{p(!1)}},[t,o,S,e,n]);return D.useEffect(()=>{C()},[C]),f?g.jsxs("div",{className:"flex items-center justify-center h-32 text-muted-foreground",children:[g.jsx(gr,{className:"w-4 h-4 animate-spin mr-2"}),"Loading files..."]}):h?g.jsxs("div",{className:"p-4 text-sm text-destructive",children:[h,g.jsx(Pe,{variant:"ghost",size:"sm",onClick:C,className:"ml-2",children:g.jsx(Tl,{className:"w-3 h-3"})})]}):l.length===0?g.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["Empty workspace",g.jsx(Pe,{variant:"ghost",size:"sm",onClick:C,className:"ml-2",children:g.jsx(Tl,{className:"w-3 h-3"})})]}):g.jsxs("div",{className:"flex flex-col h-full min-w-0 overflow-hidden",children:[g.jsxs("div",{className:"flex items-center justify-between min-w-0 overflow-hidden px-3 py-2",children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide truncate min-w-0",children:"Files"}),g.jsx(Pe,{variant:"ghost",size:"icon",className:"h-5 w-5 shrink-0",onClick:C,children:g.jsx(Tl,{className:"w-3 h-3"})})]}),g.jsx(nc,{className:"flex-1 min-h-0 min-w-0",children:g.jsx("div",{className:"px-2 pb-2 min-w-0 overflow-hidden",children:g.jsx("div",{className:"space-y-0.5",children:l.map(w=>g.jsx(DC,{entry:w,workspaceId:t,parentPath:a,depth:0,onFileSelect:i,showHidden:o,serverUrl:e,apiToken:n},w.path))})})})]})}function i8(t){const e=me.c(33),{workspaceId:n,searchQuery:i,selectedIndex:o,onSelect:l,onFilesChange:d,showHidden:a,serverUrl:u,apiToken:f}=t,p=a===void 0?!0:a;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[0]=h):h=e[0];const[y,S]=D.useState(h),[C,w]=D.useState(!1),[_,v]=D.useState(i),{fetchWithAuth:b}=qu();let x,E;e[1]!==i?(x=()=>{const G=setTimeout(()=>{v(i)},150);return()=>clearTimeout(G)},E=[i],e[1]=i,e[2]=x,e[3]=E):(x=e[2],E=e[3]),D.useEffect(x,E);let N,A;if(e[4]!==f||e[5]!==_||e[6]!==b||e[7]!==d||e[8]!==u||e[9]!==p||e[10]!==n?(N=()=>{if(!_||_.length<2){S([]),d([]);return}w(!0);const G=new AbortController;return b(`/api/workspaces/${n}/files?search=${encodeURIComponent(_)}&showHidden=${p}`,{signal:G.signal},{serverUrl:u,token:f}).then(o8).then(K=>{const V=K.files||[];S(V),d(V)}).catch(s8).finally(()=>w(!1)),()=>G.abort()},A=[n,_,d,p,b,u,f],e[4]=f,e[5]=_,e[6]=b,e[7]=d,e[8]=u,e[9]=p,e[10]=n,e[11]=N,e[12]=A):(N=e[11],A=e[12]),D.useEffect(N,A),!i||i.length<2){let G;return e[13]===Symbol.for("react.memo_cache_sentinel")?(G=g.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:"Type at least 2 characters to search files..."}),e[13]=G):G=e[13],G}if(C){let G;return e[14]===Symbol.for("react.memo_cache_sentinel")?(G=g.jsxs("div",{className:"flex items-center justify-center p-4 text-muted-foreground",children:[g.jsx(gr,{className:"w-4 h-4 animate-spin mr-2"}),"Searching..."]}),e[14]=G):G=e[14],G}if(y.length===0){let G;return e[15]!==i?(G=g.jsxs("div",{className:"p-2 text-xs text-muted-foreground",children:['No files found matching "',i,'"']}),e[15]=i,e[16]=G):G=e[16],G}let M;if(e[17]!==y||e[18]!==l||e[19]!==o){let G;e[21]!==l||e[22]!==o?(G=(K,V)=>g.jsxs("button",{onClick:()=>l(K),className:ke("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",V===o&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[K.type==="directory"?g.jsx(vo,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}):g.jsx(Ci,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),g.jsx("span",{className:"truncate flex-1",children:K.path}),K.extension&&g.jsx("span",{className:"text-xs text-muted-foreground",children:K.extension})]},K.path),e[21]=l,e[22]=o,e[23]=G):G=e[23],M=y.map(G),e[17]=y,e[18]=l,e[19]=o,e[20]=M}else M=e[20];const T=y.length!==1?"s":"";let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=g.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↑↓"}),e[24]=j):j=e[24];let O;e[25]===Symbol.for("react.memo_cache_sentinel")?(O=g.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↵"}),e[25]=O):O=e[25];let F;e[26]===Symbol.for("react.memo_cache_sentinel")?(F=g.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"esc"}),e[26]=F):F=e[26];let U;e[27]!==y.length||e[28]!==T?(U=g.jsxs("div",{className:"mt-1 pt-1 border-t text-xs text-muted-foreground px-2",children:[y.length," result",T," •",j," navigate",O," select",F," close"]}),e[27]=y.length,e[28]=T,e[29]=U):U=e[29];let $;return e[30]!==U||e[31]!==M?($=g.jsxs("div",{className:"p-1",children:[M,U]}),e[30]=U,e[31]=M,e[32]=$):$=e[32],$}function s8(t){t.name!=="AbortError"&&console.error("File search failed:",t)}function o8(t){return t.json()}function a8(t){const e=me.c(40),{workspaceId:n,serverUrl:i,apiToken:o,isOpen:l,onClose:d}=t,a=Wu();if(!n)return null;if(a){let E;e[0]!==d?(E=U=>!U&&d(),e[0]=d,e[1]=E):E=e[1];let N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=g.jsx(Eh,{className:"sr-only",children:g.jsx(Ah,{children:"Files"})}),e[2]=N):N=e[2];let A;e[3]===Symbol.for("react.memo_cache_sentinel")?(A=g.jsx("span",{className:"font-semibold text-sm",children:"Files"}),e[3]=A):A=e[3];let M;e[4]===Symbol.for("react.memo_cache_sentinel")?(M=g.jsx(bs,{className:"w-4 h-4"}),e[4]=M):M=e[4];let T;e[5]!==d?(T=g.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[A,g.jsx(Pe,{variant:"ghost",size:"icon-sm",onClick:d,children:M})]}),e[5]=d,e[6]=T):T=e[6];let j;e[7]!==o||e[8]!==i||e[9]!==n?(j=g.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",children:g.jsx(kb,{workspaceId:n,serverUrl:i,apiToken:o,showHidden:!0},n)}),e[7]=o,e[8]=i,e[9]=n,e[10]=j):j=e[10];let O;e[11]!==T||e[12]!==j?(O=g.jsxs(kh,{side:"right",className:"w-72 p-0 bg-sidebar [&>button]:hidden",children:[N,T,j]}),e[11]=T,e[12]=j,e[13]=O):O=e[13];let F;return e[14]!==l||e[15]!==E||e[16]!==O?(F=g.jsx(Ch,{open:l,onOpenChange:E,children:O}),e[14]=l,e[15]=E,e[16]=O,e[17]=F):F=e[17],F}const u=!l&&"w-0";let f;e[18]!==u?(f=ke("relative w-64 bg-transparent transition-[width] duration-200 ease-linear",u),e[18]=u,e[19]=f):f=e[19];let p;e[20]!==f?(p=g.jsx("div",{className:f}),e[20]=f,e[21]=p):p=e[21];const h=!l&&"translate-x-full";let y;e[22]!==h?(y=ke("fixed right-0 z-10 w-64 bg-sidebar border-l border-border flex flex-col overflow-hidden","transform transition-transform duration-200 ease-linear",h),e[22]=h,e[23]=y):y=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S={top:"env(safe-area-inset-top, 0)",bottom:"env(safe-area-inset-bottom, 0)",height:"calc(100vh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0))"},e[24]=S):S=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=g.jsx("span",{className:"font-semibold text-sm",children:"Files"}),e[25]=C):C=e[25];let w;e[26]===Symbol.for("react.memo_cache_sentinel")?(w=g.jsx(bs,{className:"w-4 h-4"}),e[26]=w):w=e[26];let _;e[27]!==d?(_=g.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[C,g.jsx(Pe,{variant:"ghost",size:"icon-sm",onClick:d,children:w})]}),e[27]=d,e[28]=_):_=e[28];let v;e[29]!==o||e[30]!==i||e[31]!==n?(v=g.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",children:g.jsx(kb,{workspaceId:n,serverUrl:i,apiToken:o,showHidden:!0},n)}),e[29]=o,e[30]=i,e[31]=n,e[32]=v):v=e[32];let b;e[33]!==v||e[34]!==y||e[35]!==_?(b=g.jsxs("div",{className:y,style:S,children:[_,v]}),e[33]=v,e[34]=y,e[35]=_,e[36]=b):b=e[36];let x;return e[37]!==b||e[38]!==p?(x=g.jsxs(g.Fragment,{children:[p,b]}),e[37]=b,e[38]=p,e[39]=x):x=e[39],x}var Ym={exports:{}},Eb;function l8(){return Eb||(Eb=1,(function(t,e){(function(n,i){t.exports=i()})(globalThis,(()=>(()=>{var n={4567:function(d,a,u){var f=this&&this.__decorate||function(b,x,E,N){var A,M=arguments.length,T=M<3?x:N===null?N=Object.getOwnPropertyDescriptor(x,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,x,E,N);else for(var j=b.length-1;j>=0;j--)(A=b[j])&&(T=(M<3?A(T):M>3?A(x,E,T):A(x,E))||T);return M>3&&T&&Object.defineProperty(x,E,T),T},p=this&&this.__param||function(b,x){return function(E,N){x(E,N,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const h=u(9042),y=u(9924),S=u(844),C=u(4725),w=u(2585),_=u(3656);let v=a.AccessibilityManager=class extends S.Disposable{constructor(b,x,E,N){super(),this._terminal=b,this._coreBrowserService=E,this._renderService=N,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let A=0;A<this._terminal.rows;A++)this._rowElements[A]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[A]);if(this._topBoundaryFocusListener=A=>this._handleBoundaryFocus(A,0),this._bottomBoundaryFocusListener=A=>this._handleBoundaryFocus(A,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new y.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((A=>this._handleResize(A.rows)))),this.register(this._terminal.onRender((A=>this._refreshRows(A.start,A.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((A=>this._handleChar(A)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
486
|
+
Defaulting to \`null\`.`}var xN=Y2,SN=Z2;function wN(t,e){return D.useReducer((n,i)=>{const o=e[n][i];return o!=null?o:n},t)}var Rv="ScrollArea",[J2]=yr(Rv),[CN,Hr]=J2(Rv),ew=D.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:i="hover",dir:o,scrollHideDelay:l=600,...d}=t,[a,u]=D.useState(null),[f,p]=D.useState(null),[h,y]=D.useState(null),[S,C]=D.useState(null),[w,_]=D.useState(null),[v,b]=D.useState(0),[x,E]=D.useState(0),[N,A]=D.useState(!1),[M,T]=D.useState(!1),j=_t(e,F=>u(F)),O=Ou(o);return g.jsx(CN,{scope:n,type:i,dir:O,scrollHideDelay:l,scrollArea:a,viewport:f,onViewportChange:p,content:h,onContentChange:y,scrollbarX:S,onScrollbarXChange:C,scrollbarXEnabled:N,onScrollbarXEnabledChange:A,scrollbarY:w,onScrollbarYChange:_,scrollbarYEnabled:M,onScrollbarYEnabledChange:T,onCornerWidthChange:b,onCornerHeightChange:E,children:g.jsx(qe.div,{dir:O,...d,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":x+"px",...t.style}})})});ew.displayName=Rv;var tw="ScrollAreaViewport",nw=D.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:i,nonce:o,...l}=t,d=Hr(tw,n),a=D.useRef(null),u=_t(e,a,d.onViewportChange);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),g.jsx(qe.div,{"data-radix-scroll-area-viewport":"",...l,ref:u,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...t.style},children:g.jsx("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});nw.displayName=tw;var Mi="ScrollAreaScrollbar",rw=D.forwardRef((t,e)=>{const{forceMount:n,...i}=t,o=Hr(Mi,t.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:d}=o,a=t.orientation==="horizontal";return D.useEffect(()=>(a?l(!0):d(!0),()=>{a?l(!1):d(!1)}),[a,l,d]),o.type==="hover"?g.jsx(kN,{...i,ref:e,forceMount:n}):o.type==="scroll"?g.jsx(EN,{...i,ref:e,forceMount:n}):o.type==="auto"?g.jsx(iw,{...i,ref:e,forceMount:n}):o.type==="always"?g.jsx(Nv,{...i,ref:e}):null});rw.displayName=Mi;var kN=D.forwardRef((t,e)=>{const{forceMount:n,...i}=t,o=Hr(Mi,t.__scopeScrollArea),[l,d]=D.useState(!1);return D.useEffect(()=>{const a=o.scrollArea;let u=0;if(a){const f=()=>{window.clearTimeout(u),d(!0)},p=()=>{u=window.setTimeout(()=>d(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",f),a.addEventListener("pointerleave",p),()=>{window.clearTimeout(u),a.removeEventListener("pointerenter",f),a.removeEventListener("pointerleave",p)}}},[o.scrollArea,o.scrollHideDelay]),g.jsx(Cn,{present:n||l,children:g.jsx(iw,{"data-state":l?"visible":"hidden",...i,ref:e})})}),EN=D.forwardRef((t,e)=>{const{forceMount:n,...i}=t,o=Hr(Mi,t.__scopeScrollArea),l=t.orientation==="horizontal",d=hh(()=>u("SCROLL_END"),100),[a,u]=wN("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return D.useEffect(()=>{if(a==="idle"){const f=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(f)}},[a,o.scrollHideDelay,u]),D.useEffect(()=>{const f=o.viewport,p=l?"scrollLeft":"scrollTop";if(f){let h=f[p];const y=()=>{const S=f[p];h!==S&&(u("SCROLL"),d()),h=S};return f.addEventListener("scroll",y),()=>f.removeEventListener("scroll",y)}},[o.viewport,l,u,d]),g.jsx(Cn,{present:n||a!=="hidden",children:g.jsx(Nv,{"data-state":a==="hidden"?"hidden":"visible",...i,ref:e,onPointerEnter:je(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:je(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),iw=D.forwardRef((t,e)=>{const n=Hr(Mi,t.__scopeScrollArea),{forceMount:i,...o}=t,[l,d]=D.useState(!1),a=t.orientation==="horizontal",u=hh(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,p=n.viewport.offsetHeight<n.viewport.scrollHeight;d(a?f:p)}},10);return Il(n.viewport,u),Il(n.content,u),g.jsx(Cn,{present:i||l,children:g.jsx(Nv,{"data-state":l?"visible":"hidden",...o,ref:e})})}),Nv=D.forwardRef((t,e)=>{const{orientation:n="vertical",...i}=t,o=Hr(Mi,t.__scopeScrollArea),l=D.useRef(null),d=D.useRef(0),[a,u]=D.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=cw(a.viewport,a.content),p={...i,sizes:a,onSizesChange:u,hasThumb:f>0&&f<1,onThumbChange:y=>l.current=y,onThumbPointerUp:()=>d.current=0,onThumbPointerDown:y=>d.current=y};function h(y,S){return MN(y,d.current,a,S)}return n==="horizontal"?g.jsx(AN,{...p,ref:e,onThumbPositionChange:()=>{if(o.viewport&&l.current){const y=o.viewport.scrollLeft,S=db(y,a,o.dir);l.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollLeft=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollLeft=h(y,o.dir))}}):n==="vertical"?g.jsx(TN,{...p,ref:e,onThumbPositionChange:()=>{if(o.viewport&&l.current){const y=o.viewport.scrollTop,S=db(y,a);l.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollTop=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollTop=h(y))}}):null}),AN=D.forwardRef((t,e)=>{const{sizes:n,onSizesChange:i,...o}=t,l=Hr(Mi,t.__scopeScrollArea),[d,a]=D.useState(),u=D.useRef(null),f=_t(e,u,l.onScrollbarXChange);return D.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),g.jsx(ow,{"data-orientation":"horizontal",...o,ref:f,sizes:n,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":fh(n)+"px",...t.style},onThumbPointerDown:p=>t.onThumbPointerDown(p.x),onDragScroll:p=>t.onDragScroll(p.x),onWheelScroll:(p,h)=>{if(l.viewport){const y=l.viewport.scrollLeft+p.deltaX;t.onWheelScroll(y),dw(y,h)&&p.preventDefault()}},onResize:()=>{u.current&&l.viewport&&d&&i({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:jf(d.paddingLeft),paddingEnd:jf(d.paddingRight)}})}})}),TN=D.forwardRef((t,e)=>{const{sizes:n,onSizesChange:i,...o}=t,l=Hr(Mi,t.__scopeScrollArea),[d,a]=D.useState(),u=D.useRef(null),f=_t(e,u,l.onScrollbarYChange);return D.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),g.jsx(ow,{"data-orientation":"vertical",...o,ref:f,sizes:n,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":fh(n)+"px",...t.style},onThumbPointerDown:p=>t.onThumbPointerDown(p.y),onDragScroll:p=>t.onDragScroll(p.y),onWheelScroll:(p,h)=>{if(l.viewport){const y=l.viewport.scrollTop+p.deltaY;t.onWheelScroll(y),dw(y,h)&&p.preventDefault()}},onResize:()=>{u.current&&l.viewport&&d&&i({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:jf(d.paddingTop),paddingEnd:jf(d.paddingBottom)}})}})}),[RN,sw]=J2(Mi),ow=D.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:i,hasThumb:o,onThumbChange:l,onThumbPointerUp:d,onThumbPointerDown:a,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:p,onResize:h,...y}=t,S=Hr(Mi,n),[C,w]=D.useState(null),_=_t(e,j=>w(j)),v=D.useRef(null),b=D.useRef(""),x=S.viewport,E=i.content-i.viewport,N=Mn(p),A=Mn(u),M=hh(h,10);function T(j){if(v.current){const O=j.clientX-v.current.left,F=j.clientY-v.current.top;f({x:O,y:F})}}return D.useEffect(()=>{const j=O=>{const F=O.target;(C==null?void 0:C.contains(F))&&N(O,E)};return document.addEventListener("wheel",j,{passive:!1}),()=>document.removeEventListener("wheel",j,{passive:!1})},[x,C,E,N]),D.useEffect(A,[i,A]),Il(C,M),Il(S.content,M),g.jsx(RN,{scope:n,scrollbar:C,hasThumb:o,onThumbChange:Mn(l),onThumbPointerUp:Mn(d),onThumbPositionChange:A,onThumbPointerDown:Mn(a),children:g.jsx(qe.div,{...y,ref:_,style:{position:"absolute",...y.style},onPointerDown:je(t.onPointerDown,j=>{j.button===0&&(j.target.setPointerCapture(j.pointerId),v.current=C.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),T(j))}),onPointerMove:je(t.onPointerMove,T),onPointerUp:je(t.onPointerUp,j=>{const O=j.target;O.hasPointerCapture(j.pointerId)&&O.releasePointerCapture(j.pointerId),document.body.style.webkitUserSelect=b.current,S.viewport&&(S.viewport.style.scrollBehavior=""),v.current=null})})})}),Mf="ScrollAreaThumb",aw=D.forwardRef((t,e)=>{const{forceMount:n,...i}=t,o=sw(Mf,t.__scopeScrollArea);return g.jsx(Cn,{present:n||o.hasThumb,children:g.jsx(NN,{ref:e,...i})})}),NN=D.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:i,...o}=t,l=Hr(Mf,n),d=sw(Mf,n),{onThumbPositionChange:a}=d,u=_t(e,h=>d.onThumbChange(h)),f=D.useRef(void 0),p=hh(()=>{f.current&&(f.current(),f.current=void 0)},100);return D.useEffect(()=>{const h=l.viewport;if(h){const y=()=>{if(p(),!f.current){const S=jN(h,a);f.current=S,a()}};return a(),h.addEventListener("scroll",y),()=>h.removeEventListener("scroll",y)}},[l.viewport,p,a]),g.jsx(qe.div,{"data-state":d.hasThumb?"visible":"hidden",...o,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:je(t.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),C=h.clientX-S.left,w=h.clientY-S.top;d.onThumbPointerDown({x:C,y:w})}),onPointerUp:je(t.onPointerUp,d.onThumbPointerUp)})});aw.displayName=Mf;var Dv="ScrollAreaCorner",lw=D.forwardRef((t,e)=>{const n=Hr(Dv,t.__scopeScrollArea),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&i?g.jsx(DN,{...t,ref:e}):null});lw.displayName=Dv;var DN=D.forwardRef((t,e)=>{const{__scopeScrollArea:n,...i}=t,o=Hr(Dv,n),[l,d]=D.useState(0),[a,u]=D.useState(0),f=!!(l&&a);return Il(o.scrollbarX,()=>{var h;const p=((h=o.scrollbarX)==null?void 0:h.offsetHeight)||0;o.onCornerHeightChange(p),u(p)}),Il(o.scrollbarY,()=>{var h;const p=((h=o.scrollbarY)==null?void 0:h.offsetWidth)||0;o.onCornerWidthChange(p),d(p)}),f?g.jsx(qe.div,{...i,ref:e,style:{width:l,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function jf(t){return t?parseInt(t,10):0}function cw(t,e){const n=t/e;return isNaN(n)?0:n}function fh(t){const e=cw(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=(t.scrollbar.size-n)*e;return Math.max(i,18)}function MN(t,e,n,i="ltr"){const o=fh(n),l=o/2,d=e||l,a=o-d,u=n.scrollbar.paddingStart+d,f=n.scrollbar.size-n.scrollbar.paddingEnd-a,p=n.content-n.viewport,h=i==="ltr"?[0,p]:[p*-1,0];return uw([u,f],h)(t)}function db(t,e,n="ltr"){const i=fh(e),o=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,l=e.scrollbar.size-o,d=e.content-e.viewport,a=l-i,u=n==="ltr"?[0,d]:[d*-1,0],f=Ag(t,u);return uw([0,d],[0,a])(f)}function uw(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(t[1]-t[0]);return e[0]+i*(n-t[0])}}function dw(t,e){return t>0&&t<e}var jN=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},i=0;return(function o(){const l={left:t.scrollLeft,top:t.scrollTop},d=n.left!==l.left,a=n.top!==l.top;(d||a)&&e(),n=l,i=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(i)};function hh(t,e){const n=Mn(t),i=D.useRef(0);return D.useEffect(()=>()=>window.clearTimeout(i.current),[]),D.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(n,e)},[n,e])}function Il(t,e){const n=Mn(e);wn(()=>{let i=0;if(t){const o=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(n)});return o.observe(t),()=>{window.cancelAnimationFrame(i),o.unobserve(t)}}},[t,n])}var ON=ew,LN=nw,IN=lw,BN=[" ","Enter","ArrowUp","ArrowDown"],zN=[" ","Enter"],ma="Select",[ph,mh,PN]=ev(ma),[Zl]=yr(ma,[PN,ko]),gh=ko(),[FN,Ao]=Zl(ma),[HN,UN]=Zl(ma),fw=t=>{const{__scopeSelect:e,children:n,open:i,defaultOpen:o,onOpenChange:l,value:d,defaultValue:a,onValueChange:u,dir:f,name:p,autoComplete:h,disabled:y,required:S,form:C}=t,w=gh(e),[_,v]=D.useState(null),[b,x]=D.useState(null),[E,N]=D.useState(!1),A=Ou(f),[M,T]=ws({prop:i,defaultProp:o!=null?o:!1,onChange:l,caller:ma}),[j,O]=ws({prop:d,defaultProp:a,onChange:u,caller:ma}),F=D.useRef(null),U=_?C||!!_.closest("form"):!0,[$,G]=D.useState(new Set),K=Array.from($).map(V=>V.props.value).join(";");return g.jsx(ih,{...w,children:g.jsxs(FN,{required:S,scope:e,trigger:_,onTriggerChange:v,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:E,onValueNodeHasChildrenChange:N,contentId:gn(),value:j,onValueChange:O,open:M,onOpenChange:T,dir:A,triggerPointerDownPosRef:F,disabled:y,children:[g.jsx(ph.Provider,{scope:e,children:g.jsx(HN,{scope:t.__scopeSelect,onNativeOptionAdd:D.useCallback(V=>{G(X=>new Set(X).add(V))},[]),onNativeOptionRemove:D.useCallback(V=>{G(X=>{const Z=new Set(X);return Z.delete(V),Z})},[]),children:n})}),U?g.jsxs(Iw,{"aria-hidden":!0,required:S,tabIndex:-1,name:p,autoComplete:h,value:j,onChange:V=>O(V.target.value),disabled:y,form:C,children:[j===void 0?g.jsx("option",{value:""}):null,Array.from($)]},K):null]})})};fw.displayName=ma;var hw="SelectTrigger",pw=D.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:i=!1,...o}=t,l=gh(n),d=Ao(hw,n),a=d.disabled||i,u=_t(e,d.onTriggerChange),f=mh(n),p=D.useRef("touch"),[h,y,S]=zw(w=>{const _=f().filter(x=>!x.disabled),v=_.find(x=>x.value===d.value),b=Pw(_,w,v);b!==void 0&&d.onValueChange(b.value)}),C=w=>{a||(d.onOpenChange(!0),S()),w&&(d.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return g.jsx(zu,{asChild:!0,...l,children:g.jsx(qe.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Bw(d.value)?"":void 0,...o,ref:u,onClick:je(o.onClick,w=>{w.currentTarget.focus(),p.current!=="mouse"&&C(w)}),onPointerDown:je(o.onPointerDown,w=>{p.current=w.pointerType;const _=w.target;_.hasPointerCapture(w.pointerId)&&_.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(C(w),w.preventDefault())}),onKeyDown:je(o.onKeyDown,w=>{const _=h.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&y(w.key),!(_&&w.key===" ")&&BN.includes(w.key)&&(C(),w.preventDefault())})})})});pw.displayName=hw;var mw="SelectValue",gw=D.forwardRef((t,e)=>{const{__scopeSelect:n,className:i,style:o,children:l,placeholder:d="",...a}=t,u=Ao(mw,n),{onValueNodeHasChildrenChange:f}=u,p=l!==void 0,h=_t(e,u.onValueNodeChange);return wn(()=>{f(p)},[f,p]),g.jsx(qe.span,{...a,ref:h,style:{pointerEvents:"none"},children:Bw(u.value)?g.jsx(g.Fragment,{children:d}):l})});gw.displayName=mw;var $N="SelectIcon",vw=D.forwardRef((t,e)=>{const{__scopeSelect:n,children:i,...o}=t;return g.jsx(qe.span,{"aria-hidden":!0,...o,ref:e,children:i||"▼"})});vw.displayName=$N;var qN="SelectPortal",_w=t=>g.jsx(Kl,{asChild:!0,...t});_w.displayName=qN;var ga="SelectContent",yw=D.forwardRef((t,e)=>{const n=Ao(ga,t.__scopeSelect),[i,o]=D.useState();if(wn(()=>{o(new DocumentFragment)},[]),!n.open){const l=i;return l?Mu.createPortal(g.jsx(bw,{scope:t.__scopeSelect,children:g.jsx(ph.Slot,{scope:t.__scopeSelect,children:g.jsx("div",{children:t.children})})}),l):null}return g.jsx(xw,{...t,ref:e})});yw.displayName=ga;var ri=10,[bw,To]=Zl(ga),VN="SelectContentImpl",GN=_o("SelectContent.RemoveScroll"),xw=D.forwardRef((t,e)=>{const{__scopeSelect:n,position:i="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:d,side:a,sideOffset:u,align:f,alignOffset:p,arrowPadding:h,collisionBoundary:y,collisionPadding:S,sticky:C,hideWhenDetached:w,avoidCollisions:_,...v}=t,b=Ao(ga,n),[x,E]=D.useState(null),[N,A]=D.useState(null),M=_t(e,W=>E(W)),[T,j]=D.useState(null),[O,F]=D.useState(null),U=mh(n),[$,G]=D.useState(!1),K=D.useRef(!1);D.useEffect(()=>{if(x)return Zf(x)},[x]),Yf();const V=D.useCallback(W=>{const[q,...J]=U().map(ae=>ae.ref.current),[ie]=J.slice(-1),ce=document.activeElement;for(const ae of W)if(ae===ce||(ae==null||ae.scrollIntoView({block:"nearest"}),ae===q&&N&&(N.scrollTop=0),ae===ie&&N&&(N.scrollTop=N.scrollHeight),ae==null||ae.focus(),document.activeElement!==ce))return},[U,N]),X=D.useCallback(()=>V([T,x]),[V,T,x]);D.useEffect(()=>{$&&X()},[$,X]);const{onOpenChange:Z,triggerPointerDownPosRef:I}=b;D.useEffect(()=>{if(x){let W={x:0,y:0};const q=ie=>{var ce,ae,_e,Ee;W={x:Math.abs(Math.round(ie.pageX)-((ae=(ce=I.current)==null?void 0:ce.x)!=null?ae:0)),y:Math.abs(Math.round(ie.pageY)-((Ee=(_e=I.current)==null?void 0:_e.y)!=null?Ee:0))}},J=ie=>{W.x<=10&&W.y<=10?ie.preventDefault():x.contains(ie.target)||Z(!1),document.removeEventListener("pointermove",q),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",J,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",J,{capture:!0})}}},[x,Z,I]),D.useEffect(()=>{const W=()=>Z(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[Z]);const[L,B]=zw(W=>{const q=U().filter(ce=>!ce.disabled),J=q.find(ce=>ce.ref.current===document.activeElement),ie=Pw(q,W,J);ie&&setTimeout(()=>ie.ref.current.focus())}),H=D.useCallback((W,q,J)=>{const ie=!K.current&&!J;(b.value!==void 0&&b.value===q||ie)&&(j(W),ie&&(K.current=!0))},[b.value]),P=D.useCallback(()=>x==null?void 0:x.focus(),[x]),ee=D.useCallback((W,q,J)=>{const ie=!K.current&&!J;(b.value!==void 0&&b.value===q||ie)&&F(W)},[b.value]),ne=i==="popper"?Tg:Sw,Q=ne===Tg?{side:a,sideOffset:u,align:f,alignOffset:p,arrowPadding:h,collisionBoundary:y,collisionPadding:S,sticky:C,hideWhenDetached:w,avoidCollisions:_}:{};return g.jsx(bw,{scope:n,content:x,viewport:N,onViewportChange:A,itemRefCallback:H,selectedItem:T,onItemLeave:P,itemTextRefCallback:ee,focusSelectedItem:X,selectedItemText:O,position:i,isPositioned:$,searchRef:L,children:g.jsx(Iu,{as:GN,allowPinchZoom:!0,children:g.jsx(Lu,{asChild:!0,trapped:b.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:je(o,W=>{var q;(q=b.trigger)==null||q.focus({preventScroll:!0}),W.preventDefault()}),children:g.jsx(Wl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:g.jsx(ne,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:W=>W.preventDefault(),...v,...Q,onPlaced:()=>G(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:je(v.onKeyDown,W=>{const q=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!q&&W.key.length===1&&B(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let ie=U().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);if(["ArrowUp","End"].includes(W.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const ce=W.target,ae=ie.indexOf(ce);ie=ie.slice(ae+1)}setTimeout(()=>V(ie)),W.preventDefault()}})})})})})})});xw.displayName=VN;var WN="SelectItemAlignedPosition",Sw=D.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:i,...o}=t,l=Ao(ga,n),d=To(ga,n),[a,u]=D.useState(null),[f,p]=D.useState(null),h=_t(e,M=>p(M)),y=mh(n),S=D.useRef(!1),C=D.useRef(!0),{viewport:w,selectedItem:_,selectedItemText:v,focusSelectedItem:b}=d,x=D.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&f&&w&&_&&v){const M=l.trigger.getBoundingClientRect(),T=f.getBoundingClientRect(),j=l.valueNode.getBoundingClientRect(),O=v.getBoundingClientRect();if(l.dir!=="rtl"){const ce=O.left-T.left,ae=j.left-ce,_e=M.left-ae,Ee=M.width+_e,Te=Math.max(Ee,T.width),Be=window.innerWidth-ri,se=Ag(ae,[ri,Math.max(ri,Be-Te)]);a.style.minWidth=Ee+"px",a.style.left=se+"px"}else{const ce=T.right-O.right,ae=window.innerWidth-j.right-ce,_e=window.innerWidth-M.right-ae,Ee=M.width+_e,Te=Math.max(Ee,T.width),Be=window.innerWidth-ri,se=Ag(ae,[ri,Math.max(ri,Be-Te)]);a.style.minWidth=Ee+"px",a.style.right=se+"px"}const F=y(),U=window.innerHeight-ri*2,$=w.scrollHeight,G=window.getComputedStyle(f),K=parseInt(G.borderTopWidth,10),V=parseInt(G.paddingTop,10),X=parseInt(G.borderBottomWidth,10),Z=parseInt(G.paddingBottom,10),I=K+V+$+Z+X,L=Math.min(_.offsetHeight*5,I),B=window.getComputedStyle(w),H=parseInt(B.paddingTop,10),P=parseInt(B.paddingBottom,10),ee=M.top+M.height/2-ri,ne=U-ee,Q=_.offsetHeight/2,W=_.offsetTop+Q,q=K+V+W,J=I-q;if(q<=ee){const ce=F.length>0&&_===F[F.length-1].ref.current;a.style.bottom="0px";const ae=f.clientHeight-w.offsetTop-w.offsetHeight,_e=Math.max(ne,Q+(ce?P:0)+ae+X),Ee=q+_e;a.style.height=Ee+"px"}else{const ce=F.length>0&&_===F[0].ref.current;a.style.top="0px";const _e=Math.max(ee,K+w.offsetTop+(ce?H:0)+Q)+J;a.style.height=_e+"px",w.scrollTop=q-ee+w.offsetTop}a.style.margin=`${ri}px 0`,a.style.minHeight=L+"px",a.style.maxHeight=U+"px",i==null||i(),requestAnimationFrame(()=>S.current=!0)}},[y,l.trigger,l.valueNode,a,f,w,_,v,l.dir,i]);wn(()=>x(),[x]);const[E,N]=D.useState();wn(()=>{f&&N(window.getComputedStyle(f).zIndex)},[f]);const A=D.useCallback(M=>{M&&C.current===!0&&(x(),b==null||b(),C.current=!1)},[x,b]);return g.jsx(YN,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:S,onScrollButtonChange:A,children:g.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:g.jsx(qe.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Sw.displayName=WN;var KN="SelectPopperPosition",Tg=D.forwardRef((t,e)=>{const{__scopeSelect:n,align:i="start",collisionPadding:o=ri,...l}=t,d=gh(n);return g.jsx(sh,{...d,...l,ref:e,align:i,collisionPadding:o,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Tg.displayName=KN;var[YN,Mv]=Zl(ga,{}),Rg="SelectViewport",ww=D.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:i,...o}=t,l=To(Rg,n),d=Mv(Rg,n),a=_t(e,l.onViewportChange),u=D.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),g.jsx(ph.Slot,{scope:n,children:g.jsx(qe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:je(o.onScroll,f=>{const p=f.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:y}=d;if(y!=null&&y.current&&h){const S=Math.abs(u.current-p.scrollTop);if(S>0){const C=window.innerHeight-ri*2,w=parseFloat(h.style.minHeight),_=parseFloat(h.style.height),v=Math.max(w,_);if(v<C){const b=v+S,x=Math.min(C,b),E=b-x;h.style.height=x+"px",h.style.bottom==="0px"&&(p.scrollTop=E>0?E:0,h.style.justifyContent="flex-end")}}}u.current=p.scrollTop})})})]})});ww.displayName=Rg;var Cw="SelectGroup",[XN,ZN]=Zl(Cw),kw=D.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t,o=gn();return g.jsx(XN,{scope:n,id:o,children:g.jsx(qe.div,{role:"group","aria-labelledby":o,...i,ref:e})})});kw.displayName=Cw;var Ew="SelectLabel",Aw=D.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t,o=ZN(Ew,n);return g.jsx(qe.div,{id:o.id,...i,ref:e})});Aw.displayName=Ew;var Of="SelectItem",[QN,Tw]=Zl(Of),Rw=D.forwardRef((t,e)=>{const{__scopeSelect:n,value:i,disabled:o=!1,textValue:l,...d}=t,a=Ao(Of,n),u=To(Of,n),f=a.value===i,[p,h]=D.useState(l!=null?l:""),[y,S]=D.useState(!1),C=_t(e,b=>{var x;return(x=u.itemRefCallback)==null?void 0:x.call(u,b,i,o)}),w=gn(),_=D.useRef("touch"),v=()=>{o||(a.onValueChange(i),a.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(QN,{scope:n,value:i,disabled:o,textId:w,isSelected:f,onItemTextChange:D.useCallback(b=>{h(x=>{var E;return x||((E=b==null?void 0:b.textContent)!=null?E:"").trim()})},[]),children:g.jsx(ph.ItemSlot,{scope:n,value:i,disabled:o,textValue:p,children:g.jsx(qe.div,{role:"option","aria-labelledby":w,"data-highlighted":y?"":void 0,"aria-selected":f&&y,"data-state":f?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...d,ref:C,onFocus:je(d.onFocus,()=>S(!0)),onBlur:je(d.onBlur,()=>S(!1)),onClick:je(d.onClick,()=>{_.current!=="mouse"&&v()}),onPointerUp:je(d.onPointerUp,()=>{_.current==="mouse"&&v()}),onPointerDown:je(d.onPointerDown,b=>{_.current=b.pointerType}),onPointerMove:je(d.onPointerMove,b=>{var x;_.current=b.pointerType,o?(x=u.onItemLeave)==null||x.call(u):_.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(d.onPointerLeave,b=>{var x;b.currentTarget===document.activeElement&&((x=u.onItemLeave)==null||x.call(u))}),onKeyDown:je(d.onKeyDown,b=>{var E;((E=u.searchRef)==null?void 0:E.current)!==""&&b.key===" "||(zN.includes(b.key)&&v(),b.key===" "&&b.preventDefault())})})})})});Rw.displayName=Of;var pu="SelectItemText",Nw=D.forwardRef((t,e)=>{const{__scopeSelect:n,className:i,style:o,...l}=t,d=Ao(pu,n),a=To(pu,n),u=Tw(pu,n),f=UN(pu,n),[p,h]=D.useState(null),y=_t(e,v=>h(v),u.onItemTextChange,v=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,v,u.value,u.disabled)}),S=p==null?void 0:p.textContent,C=D.useMemo(()=>g.jsx("option",{value:u.value,disabled:u.disabled,children:S},u.value),[u.disabled,u.value,S]),{onNativeOptionAdd:w,onNativeOptionRemove:_}=f;return wn(()=>(w(C),()=>_(C)),[w,_,C]),g.jsxs(g.Fragment,{children:[g.jsx(qe.span,{id:u.textId,...l,ref:y}),u.isSelected&&d.valueNode&&!d.valueNodeHasChildren?Mu.createPortal(l.children,d.valueNode):null]})});Nw.displayName=pu;var Dw="SelectItemIndicator",Mw=D.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t;return Tw(Dw,n).isSelected?g.jsx(qe.span,{"aria-hidden":!0,...i,ref:e}):null});Mw.displayName=Dw;var Ng="SelectScrollUpButton",jw=D.forwardRef((t,e)=>{const n=To(Ng,t.__scopeSelect),i=Mv(Ng,t.__scopeSelect),[o,l]=D.useState(!1),d=_t(e,i.onScrollButtonChange);return wn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const f=u.scrollTop>0;l(f)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?g.jsx(Lw,{...t,ref:d,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop-u.offsetHeight)}}):null});jw.displayName=Ng;var Dg="SelectScrollDownButton",Ow=D.forwardRef((t,e)=>{const n=To(Dg,t.__scopeSelect),i=Mv(Dg,t.__scopeSelect),[o,l]=D.useState(!1),d=_t(e,i.onScrollButtonChange);return wn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const f=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)<f;l(p)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?g.jsx(Lw,{...t,ref:d,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop+u.offsetHeight)}}):null});Ow.displayName=Dg;var Lw=D.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:i,...o}=t,l=To("SelectScrollButton",n),d=D.useRef(null),a=mh(n),u=D.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return D.useEffect(()=>()=>u(),[u]),wn(()=>{var p;const f=a().find(h=>h.ref.current===document.activeElement);(p=f==null?void 0:f.ref.current)==null||p.scrollIntoView({block:"nearest"})},[a]),g.jsx(qe.div,{"aria-hidden":!0,...o,ref:e,style:{flexShrink:0,...o.style},onPointerDown:je(o.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(i,50))}),onPointerMove:je(o.onPointerMove,()=>{var f;(f=l.onItemLeave)==null||f.call(l),d.current===null&&(d.current=window.setInterval(i,50))}),onPointerLeave:je(o.onPointerLeave,()=>{u()})})}),JN="SelectSeparator",eD=D.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t;return g.jsx(qe.div,{"aria-hidden":!0,...i,ref:e})});eD.displayName=JN;var Mg="SelectArrow",tD=D.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t,o=gh(n),l=Ao(Mg,n),d=To(Mg,n);return l.open&&d.position==="popper"?g.jsx(oh,{...o,...i,ref:e}):null});tD.displayName=Mg;var nD="SelectBubbleInput",Iw=D.forwardRef(({__scopeSelect:t,value:e,...n},i)=>{const o=D.useRef(null),l=_t(i,o),d=dT(e);return D.useEffect(()=>{const a=o.current;if(!a)return;const u=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(d!==e&&p){const h=new Event("change",{bubbles:!0});p.call(a,e),a.dispatchEvent(h)}},[d,e]),g.jsx(qe.select,{...n,style:{...Zx,...n.style},ref:l,defaultValue:e})});Iw.displayName=nD;function Bw(t){return t===""||t===void 0}function zw(t){const e=Mn(t),n=D.useRef(""),i=D.useRef(0),o=D.useCallback(d=>{const a=n.current+d;e(a),(function u(f){n.current=f,window.clearTimeout(i.current),f!==""&&(i.current=window.setTimeout(()=>u(""),1e3))})(a)},[e]),l=D.useCallback(()=>{n.current="",window.clearTimeout(i.current)},[]);return D.useEffect(()=>()=>window.clearTimeout(i.current),[]),[n,o,l]}function Pw(t,e,n){const o=e.length>1&&Array.from(e).every(f=>f===e[0])?e[0]:e,l=n?t.indexOf(n):-1;let d=rD(t,Math.max(l,0));o.length===1&&(d=d.filter(f=>f!==n));const u=d.find(f=>f.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function rD(t,e){return t.map((n,i)=>t[(e+i)%t.length])}var iD=fw,sD=pw,oD=gw,aD=vw,lD=_w,cD=yw,uD=ww,dD=kw,fD=Aw,hD=Rw,pD=Nw,mD=Mw,gD=jw,vD=Ow,_D="Separator",fb="horizontal",yD=["horizontal","vertical"],Fw=D.forwardRef((t,e)=>{const{decorative:n,orientation:i=fb,...o}=t,l=bD(i)?i:fb,a=n?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return g.jsx(qe.div,{"data-orientation":l,...a,...o,ref:e})});Fw.displayName=_D;function bD(t){return yD.includes(t)}var xD=Fw,vh="Tabs",[SD]=yr(vh,[ah]),Hw=ah(),[wD,jv]=SD(vh),Uw=D.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,onValueChange:o,defaultValue:l,orientation:d="horizontal",dir:a,activationMode:u="automatic",...f}=t,p=Ou(a),[h,y]=ws({prop:i,onChange:o,defaultProp:l!=null?l:"",caller:vh});return g.jsx(wD,{scope:n,baseId:gn(),value:h,onValueChange:y,orientation:d,dir:p,activationMode:u,children:g.jsx(qe.div,{dir:p,"data-orientation":d,...f,ref:e})})});Uw.displayName=vh;var $w="TabsList",qw=D.forwardRef((t,e)=>{const{__scopeTabs:n,loop:i=!0,...o}=t,l=jv($w,n),d=Hw(n);return g.jsx(i2,{asChild:!0,...d,orientation:l.orientation,dir:l.dir,loop:i,children:g.jsx(qe.div,{role:"tablist","aria-orientation":l.orientation,...o,ref:e})})});qw.displayName=$w;var Vw="TabsTrigger",Gw=D.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,disabled:o=!1,...l}=t,d=jv(Vw,n),a=Hw(n),u=Yw(d.baseId,i),f=Xw(d.baseId,i),p=i===d.value;return g.jsx(s2,{asChild:!0,...a,focusable:!o,active:p,children:g.jsx(qe.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...l,ref:e,onMouseDown:je(t.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?d.onValueChange(i):h.preventDefault()}),onKeyDown:je(t.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&d.onValueChange(i)}),onFocus:je(t.onFocus,()=>{const h=d.activationMode!=="manual";!p&&!o&&h&&d.onValueChange(i)})})})});Gw.displayName=Vw;var Ww="TabsContent",Kw=D.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,forceMount:o,children:l,...d}=t,a=jv(Ww,n),u=Yw(a.baseId,i),f=Xw(a.baseId,i),p=i===a.value,h=D.useRef(p);return D.useEffect(()=>{const y=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(y)},[]),g.jsx(Cn,{present:o||p,children:({present:y})=>g.jsx(qe.div,{"data-state":p?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!y,id:f,tabIndex:0,...d,ref:e,style:{...t.style,animationDuration:h.current?"0s":void 0},children:y&&l})})});Kw.displayName=Ww;function Yw(t,e){return`${t}-trigger-${e}`}function Xw(t,e){return`${t}-content-${e}`}var CD=Uw,kD=qw,ED=Gw,AD=Kw,[_h]=yr("Tooltip",[ko]),yh=ko(),Zw="TooltipProvider",TD=700,jg="tooltip.open",[RD,Ov]=_h(Zw),Qw=t=>{const{__scopeTooltip:e,delayDuration:n=TD,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:l}=t,d=D.useRef(!0),a=D.useRef(!1),u=D.useRef(0);return D.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),g.jsx(RD,{scope:e,isOpenDelayedRef:d,delayDuration:n,onOpen:D.useCallback(()=>{window.clearTimeout(u.current),d.current=!1},[]),onClose:D.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>d.current=!0,i)},[i]),isPointerInTransitRef:a,onPointerInTransitChange:D.useCallback(f=>{a.current=f},[]),disableHoverableContent:o,children:l})};Qw.displayName=Zw;var Cu="Tooltip",[ND,$u]=_h(Cu),Jw=t=>{const{__scopeTooltip:e,children:n,open:i,defaultOpen:o,onOpenChange:l,disableHoverableContent:d,delayDuration:a}=t,u=Ov(Cu,t.__scopeTooltip),f=yh(e),[p,h]=D.useState(null),y=gn(),S=D.useRef(0),C=d!=null?d:u.disableHoverableContent,w=a!=null?a:u.delayDuration,_=D.useRef(!1),[v,b]=ws({prop:i,defaultProp:o!=null?o:!1,onChange:M=>{M?(u.onOpen(),document.dispatchEvent(new CustomEvent(jg))):u.onClose(),l==null||l(M)},caller:Cu}),x=D.useMemo(()=>v?_.current?"delayed-open":"instant-open":"closed",[v]),E=D.useCallback(()=>{window.clearTimeout(S.current),S.current=0,_.current=!1,b(!0)},[b]),N=D.useCallback(()=>{window.clearTimeout(S.current),S.current=0,b(!1)},[b]),A=D.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{_.current=!0,b(!0),S.current=0},w)},[w,b]);return D.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]),g.jsx(ih,{...f,children:g.jsx(ND,{scope:e,contentId:y,open:v,stateAttribute:x,trigger:p,onTriggerChange:h,onTriggerEnter:D.useCallback(()=>{u.isOpenDelayedRef.current?A():E()},[u.isOpenDelayedRef,A,E]),onTriggerLeave:D.useCallback(()=>{C?N():(window.clearTimeout(S.current),S.current=0)},[N,C]),onOpen:E,onClose:N,disableHoverableContent:C,children:n})})};Jw.displayName=Cu;var Og="TooltipTrigger",eC=D.forwardRef((t,e)=>{const{__scopeTooltip:n,...i}=t,o=$u(Og,n),l=Ov(Og,n),d=yh(n),a=D.useRef(null),u=_t(e,a,o.onTriggerChange),f=D.useRef(!1),p=D.useRef(!1),h=D.useCallback(()=>f.current=!1,[]);return D.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),g.jsx(zu,{asChild:!0,...d,children:g.jsx(qe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:u,onPointerMove:je(t.onPointerMove,y=>{y.pointerType!=="touch"&&!p.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:je(t.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:je(t.onPointerDown,()=>{o.open&&o.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:je(t.onFocus,()=>{f.current||o.onOpen()}),onBlur:je(t.onBlur,o.onClose),onClick:je(t.onClick,o.onClose)})})});eC.displayName=Og;var Lv="TooltipPortal",[DD,MD]=_h(Lv,{forceMount:void 0}),tC=t=>{const{__scopeTooltip:e,forceMount:n,children:i,container:o}=t,l=$u(Lv,e);return g.jsx(DD,{scope:e,forceMount:n,children:g.jsx(Cn,{present:n||l.open,children:g.jsx(Kl,{asChild:!0,container:o,children:i})})})};tC.displayName=Lv;var Bl="TooltipContent",nC=D.forwardRef((t,e)=>{const n=MD(Bl,t.__scopeTooltip),{forceMount:i=n.forceMount,side:o="top",...l}=t,d=$u(Bl,t.__scopeTooltip);return g.jsx(Cn,{present:i||d.open,children:d.disableHoverableContent?g.jsx(rC,{side:o,...l,ref:e}):g.jsx(jD,{side:o,...l,ref:e})})}),jD=D.forwardRef((t,e)=>{const n=$u(Bl,t.__scopeTooltip),i=Ov(Bl,t.__scopeTooltip),o=D.useRef(null),l=_t(e,o),[d,a]=D.useState(null),{trigger:u,onClose:f}=n,p=o.current,{onPointerInTransitChange:h}=i,y=D.useCallback(()=>{a(null),h(!1)},[h]),S=D.useCallback((C,w)=>{const _=C.currentTarget,v={x:C.clientX,y:C.clientY},b=BD(v,_.getBoundingClientRect()),x=zD(v,b),E=PD(w.getBoundingClientRect()),N=HD([...x,...E]);a(N),h(!0)},[h]);return D.useEffect(()=>()=>y(),[y]),D.useEffect(()=>{if(u&&p){const C=_=>S(_,p),w=_=>S(_,u);return u.addEventListener("pointerleave",C),p.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",C),p.removeEventListener("pointerleave",w)}}},[u,p,S,y]),D.useEffect(()=>{if(d){const C=w=>{const _=w.target,v={x:w.clientX,y:w.clientY},b=(u==null?void 0:u.contains(_))||(p==null?void 0:p.contains(_)),x=!FD(v,d);b?y():x&&(y(),f())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[u,p,d,f,y]),g.jsx(rC,{...t,ref:l})}),[OD,LD]=_h(Cu,{isInside:!1}),ID=M5("TooltipContent"),rC=D.forwardRef((t,e)=>{const{__scopeTooltip:n,children:i,"aria-label":o,onEscapeKeyDown:l,onPointerDownOutside:d,...a}=t,u=$u(Bl,n),f=yh(n),{onClose:p}=u;return D.useEffect(()=>(document.addEventListener(jg,p),()=>document.removeEventListener(jg,p)),[p]),D.useEffect(()=>{if(u.trigger){const h=y=>{const S=y.target;S!=null&&S.contains(u.trigger)&&p()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[u.trigger,p]),g.jsx(Wl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:h=>h.preventDefault(),onDismiss:p,children:g.jsxs(sh,{"data-state":u.stateAttribute,...f,...a,ref:e,style:{...a.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:[g.jsx(ID,{children:i}),g.jsx(OD,{scope:n,isInside:!0,children:g.jsx(z5,{id:u.contentId,role:"tooltip",children:o||i})})]})})});nC.displayName=Bl;var iC="TooltipArrow",sC=D.forwardRef((t,e)=>{const{__scopeTooltip:n,...i}=t,o=yh(n);return LD(iC,n).isInside?null:g.jsx(oh,{...o,...i,ref:e})});sC.displayName=iC;function BD(t,e){const n=Math.abs(e.top-t.y),i=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),l=Math.abs(e.left-t.x);switch(Math.min(n,i,o,l)){case l:return"left";case o:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function zD(t,e,n=5){const i=[];switch(e){case"top":i.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":i.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":i.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":i.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return i}function PD(t){const{top:e,right:n,bottom:i,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:i},{x:o,y:i}]}function FD(t,e){const{x:n,y:i}=t;let o=!1;for(let l=0,d=e.length-1;l<e.length;d=l++){const a=e[l],u=e[d],f=a.x,p=a.y,h=u.x,y=u.y;p>i!=y>i&&n<(h-f)*(i-p)/(y-p)+f&&(o=!o)}return o}function HD(t){const e=t.slice();return e.sort((n,i)=>n.x<i.x?-1:n.x>i.x?1:n.y<i.y?-1:n.y>i.y?1:0),UD(e)}function UD(t){if(t.length<=1)return t.slice();const e=[];for(let i=0;i<t.length;i++){const o=t[i];for(;e.length>=2;){const l=e[e.length-1],d=e[e.length-2];if((l.x-d.x)*(o.y-d.y)>=(l.y-d.y)*(o.x-d.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let i=t.length-1;i>=0;i--){const o=t[i];for(;n.length>=2;){const l=n[n.length-1],d=n[n.length-2];if((l.x-d.x)*(o.y-d.y)>=(l.y-d.y)*(o.x-d.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var $D=Qw,qD=Jw,VD=eC,GD=tC,WD=nC,KD=sC;const YD=(t,e)=>{const n=new Array(t.length+e.length);for(let i=0;i<t.length;i++)n[i]=t[i];for(let i=0;i<e.length;i++)n[t.length+i]=e[i];return n},XD=(t,e)=>({classGroupId:t,validator:e}),oC=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Lf="-",hb=[],ZD="arbitrary..",QD=t=>{const e=eM(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=t;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return JD(d);const a=d.split(Lf),u=a[0]===""&&a.length>1?1:0;return aC(a,u,e)},getConflictingClassGroupIds:(d,a)=>{if(a){const u=i[d],f=n[d];return u?f?YD(f,u):u:f||hb}return n[d]||hb}}},aC=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const o=t[e],l=n.nextPart.get(o);if(l){const f=aC(t,e+1,l);if(f)return f}const d=n.validators;if(d===null)return;const a=e===0?t.join(Lf):t.slice(e).join(Lf),u=d.length;for(let f=0;f<u;f++){const p=d[f];if(p.validator(a))return p.classGroupId}},JD=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),i=e.slice(0,n);return i?ZD+i:void 0})(),eM=t=>{const{theme:e,classGroups:n}=t;return tM(n,e)},tM=(t,e)=>{const n=oC();for(const i in t){const o=t[i];Iv(o,n,i,e)}return n},Iv=(t,e,n,i)=>{const o=t.length;for(let l=0;l<o;l++){const d=t[l];nM(d,e,n,i)}},nM=(t,e,n,i)=>{if(typeof t=="string"){rM(t,e,n);return}if(typeof t=="function"){iM(t,e,n,i);return}sM(t,e,n,i)},rM=(t,e,n)=>{const i=t===""?e:lC(e,t);i.classGroupId=n},iM=(t,e,n,i)=>{if(oM(t)){Iv(t(i),e,n,i);return}e.validators===null&&(e.validators=[]),e.validators.push(XD(n,t))},sM=(t,e,n,i)=>{const o=Object.entries(t),l=o.length;for(let d=0;d<l;d++){const[a,u]=o[d];Iv(u,lC(e,a),n,i)}},lC=(t,e)=>{let n=t;const i=e.split(Lf),o=i.length;for(let l=0;l<o;l++){const d=i[l];let a=n.nextPart.get(d);a||(a=oC(),n.nextPart.set(d,a)),n=a}return n},oM=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,aM=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),i=Object.create(null);const o=(l,d)=>{n[l]=d,e++,e>t&&(e=0,i=n,n=Object.create(null))};return{get(l){let d=n[l];if(d!==void 0)return d;if((d=i[l])!==void 0)return o(l,d),d},set(l,d){l in n?n[l]=d:o(l,d)}}},Lg="!",pb=":",lM=[],mb=(t,e,n,i,o)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:i,isExternal:o}),cM=t=>{const{prefix:e,experimentalParseClassName:n}=t;let i=o=>{const l=[];let d=0,a=0,u=0,f;const p=o.length;for(let w=0;w<p;w++){const _=o[w];if(d===0&&a===0){if(_===pb){l.push(o.slice(u,w)),u=w+1;continue}if(_==="/"){f=w;continue}}_==="["?d++:_==="]"?d--:_==="("?a++:_===")"&&a--}const h=l.length===0?o:o.slice(u);let y=h,S=!1;h.endsWith(Lg)?(y=h.slice(0,-1),S=!0):h.startsWith(Lg)&&(y=h.slice(1),S=!0);const C=f&&f>u?f-u:void 0;return mb(l,S,y,C)};if(e){const o=e+pb,l=i;i=d=>d.startsWith(o)?l(d.slice(o.length)):mb(lM,!1,d,void 0,!0)}if(n){const o=i;i=l=>n({className:l,parseClassName:o})}return i},uM=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,i)=>{e.set(n,1e6+i)}),n=>{const i=[];let o=[];for(let l=0;l<n.length;l++){const d=n[l],a=d[0]==="[",u=e.has(d);a||u?(o.length>0&&(o.sort(),i.push(...o),o=[]),i.push(d)):o.push(d)}return o.length>0&&(o.sort(),i.push(...o)),i}},dM=t=>({cache:aM(t.cacheSize),parseClassName:cM(t),sortModifiers:uM(t),...QD(t)}),fM=/\s+/,hM=(t,e)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:l}=e,d=[],a=t.trim().split(fM);let u="";for(let f=a.length-1;f>=0;f-=1){const p=a[f],{isExternal:h,modifiers:y,hasImportantModifier:S,baseClassName:C,maybePostfixModifierPosition:w}=n(p);if(h){u=p+(u.length>0?" "+u:u);continue}let _=!!w,v=i(_?C.substring(0,w):C);if(!v){if(!_){u=p+(u.length>0?" "+u:u);continue}if(v=i(C),!v){u=p+(u.length>0?" "+u:u);continue}_=!1}const b=y.length===0?"":y.length===1?y[0]:l(y).join(":"),x=S?b+Lg:b,E=x+v;if(d.indexOf(E)>-1)continue;d.push(E);const N=o(v,_);for(let A=0;A<N.length;++A){const M=N[A];d.push(x+M)}u=p+(u.length>0?" "+u:u)}return u},pM=(...t)=>{let e=0,n,i,o="";for(;e<t.length;)(n=t[e++])&&(i=cC(n))&&(o&&(o+=" "),o+=i);return o},cC=t=>{if(typeof t=="string")return t;let e,n="";for(let i=0;i<t.length;i++)t[i]&&(e=cC(t[i]))&&(n&&(n+=" "),n+=e);return n},mM=(t,...e)=>{let n,i,o,l;const d=u=>{const f=e.reduce((p,h)=>h(p),t());return n=dM(f),i=n.cache.get,o=n.cache.set,l=a,a(u)},a=u=>{const f=i(u);if(f)return f;const p=hM(u,n);return o(u,p),p};return l=d,(...u)=>l(pM(...u))},gM=[],mn=t=>{const e=n=>n[t]||gM;return e.isThemeGetter=!0,e},uC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,vM=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,_M=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yM=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,bM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,xM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,SM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fo=t=>vM.test(t),vt=t=>!!t&&!Number.isNaN(Number(t)),ho=t=>!!t&&Number.isInteger(Number(t)),$m=t=>t.endsWith("%")&&vt(t.slice(0,-1)),vs=t=>_M.test(t),fC=()=>!0,wM=t=>yM.test(t)&&!bM.test(t),Bv=()=>!1,CM=t=>xM.test(t),kM=t=>SM.test(t),EM=t=>!He(t)&&!Ue(t),AM=t=>Ro(t,mC,Bv),He=t=>uC.test(t),la=t=>Ro(t,gC,wM),gb=t=>Ro(t,LM,vt),TM=t=>Ro(t,_C,fC),RM=t=>Ro(t,vC,Bv),vb=t=>Ro(t,hC,Bv),NM=t=>Ro(t,pC,kM),cf=t=>Ro(t,yC,CM),Ue=t=>dC.test(t),iu=t=>xa(t,gC),DM=t=>xa(t,vC),_b=t=>xa(t,hC),MM=t=>xa(t,mC),jM=t=>xa(t,pC),uf=t=>xa(t,yC,!0),OM=t=>xa(t,_C,!0),Ro=(t,e,n)=>{const i=uC.exec(t);return i?i[1]?e(i[1]):n(i[2]):!1},xa=(t,e,n=!1)=>{const i=dC.exec(t);return i?i[1]?e(i[1]):n:!1},hC=t=>t==="position"||t==="percentage",pC=t=>t==="image"||t==="url",mC=t=>t==="length"||t==="size"||t==="bg-size",gC=t=>t==="length",LM=t=>t==="number",vC=t=>t==="family-name",_C=t=>t==="number"||t==="weight",yC=t=>t==="shadow",IM=()=>{const t=mn("color"),e=mn("font"),n=mn("text"),i=mn("font-weight"),o=mn("tracking"),l=mn("leading"),d=mn("breakpoint"),a=mn("container"),u=mn("spacing"),f=mn("radius"),p=mn("shadow"),h=mn("inset-shadow"),y=mn("text-shadow"),S=mn("drop-shadow"),C=mn("blur"),w=mn("perspective"),_=mn("aspect"),v=mn("ease"),b=mn("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...E(),Ue,He],A=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],T=()=>[Ue,He,u],j=()=>[fo,"full","auto",...T()],O=()=>[ho,"none","subgrid",Ue,He],F=()=>["auto",{span:["full",ho,Ue,He]},ho,Ue,He],U=()=>[ho,"auto",Ue,He],$=()=>["auto","min","max","fr",Ue,He],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...T()],X=()=>[fo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],Z=()=>[fo,"screen","full","dvw","lvw","svw","min","max","fit",...T()],I=()=>[fo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],L=()=>[t,Ue,He],B=()=>[...E(),_b,vb,{position:[Ue,He]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",MM,AM,{size:[Ue,He]}],ee=()=>[$m,iu,la],ne=()=>["","none","full",f,Ue,He],Q=()=>["",vt,iu,la],W=()=>["solid","dashed","dotted","double"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[vt,$m,_b,vb],ie=()=>["","none",C,Ue,He],ce=()=>["none",vt,Ue,He],ae=()=>["none",vt,Ue,He],_e=()=>[vt,Ue,He],Ee=()=>[fo,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[vs],breakpoint:[vs],color:[fC],container:[vs],"drop-shadow":[vs],ease:["in","out","in-out"],font:[EM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[vs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[vs],shadow:[vs],spacing:["px",vt],text:[vs],"text-shadow":[vs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fo,He,Ue,_]}],container:["container"],columns:[{columns:[vt,He,Ue,a]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:j()}],"inset-x":[{"inset-x":j()}],"inset-y":[{"inset-y":j()}],start:[{"inset-s":j(),start:j()}],end:[{"inset-e":j(),end:j()}],"inset-bs":[{"inset-bs":j()}],"inset-be":[{"inset-be":j()}],top:[{top:j()}],right:[{right:j()}],bottom:[{bottom:j()}],left:[{left:j()}],visibility:["visible","invisible","collapse"],z:[{z:[ho,"auto",Ue,He]}],basis:[{basis:[fo,"full","auto",a,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[vt,fo,"auto","initial","none",He]}],grow:[{grow:["",vt,Ue,He]}],shrink:[{shrink:["",vt,Ue,He]}],order:[{order:[ho,"first","last","none",Ue,He]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[a,"screen",...X()]}],"min-w":[{"min-w":[a,"screen","none",...X()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[d]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,iu,la]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,OM,TM]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$m,He]}],"font-family":[{font:[DM,RM,e]}],"font-features":[{"font-features":[He]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Ue,He]}],"line-clamp":[{"line-clamp":[vt,"none",Ue,gb]}],leading:[{leading:[l,...T()]}],"list-image":[{"list-image":["none",Ue,He]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ue,He]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:[vt,"from-font","auto",Ue,la]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[vt,"auto",Ue,He]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ue,He]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ue,He]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ho,Ue,He],radial:["",Ue,He],conic:[ho,Ue,He]},jM,NM]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-bs":[{"border-bs":Q()}],"border-w-be":[{"border-be":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...W(),"hidden","none"]}],"divide-style":[{divide:[...W(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...W(),"none","hidden"]}],"outline-offset":[{"outline-offset":[vt,Ue,He]}],"outline-w":[{outline:["",vt,iu,la]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",p,uf,cf]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",h,uf,cf]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[vt,la]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",y,uf,cf]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[vt,Ue,He]}],"mix-blend":[{"mix-blend":[...q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":q()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[vt]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[Ue,He]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[vt]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ue,He]}],filter:[{filter:["","none",Ue,He]}],blur:[{blur:ie()}],brightness:[{brightness:[vt,Ue,He]}],contrast:[{contrast:[vt,Ue,He]}],"drop-shadow":[{"drop-shadow":["","none",S,uf,cf]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",vt,Ue,He]}],"hue-rotate":[{"hue-rotate":[vt,Ue,He]}],invert:[{invert:["",vt,Ue,He]}],saturate:[{saturate:[vt,Ue,He]}],sepia:[{sepia:["",vt,Ue,He]}],"backdrop-filter":[{"backdrop-filter":["","none",Ue,He]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[vt,Ue,He]}],"backdrop-contrast":[{"backdrop-contrast":[vt,Ue,He]}],"backdrop-grayscale":[{"backdrop-grayscale":["",vt,Ue,He]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[vt,Ue,He]}],"backdrop-invert":[{"backdrop-invert":["",vt,Ue,He]}],"backdrop-opacity":[{"backdrop-opacity":[vt,Ue,He]}],"backdrop-saturate":[{"backdrop-saturate":[vt,Ue,He]}],"backdrop-sepia":[{"backdrop-sepia":["",vt,Ue,He]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ue,He]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[vt,"initial",Ue,He]}],ease:[{ease:["linear","initial",v,Ue,He]}],delay:[{delay:[vt,Ue,He]}],animate:[{animate:["none",b,Ue,He]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ue,He]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[Ue,He,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ue,He]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ue,He]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[vt,iu,la,gb]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},BM=mM(IM);function ke(...t){return BM(Wf(t))}const zM=Gl("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Pe(t){const e=me.c(16);let n,i,o,l,d;e[0]!==t?({className:n,variant:o,size:l,asChild:d,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l,e[5]=d):(n=e[1],i=e[2],o=e[3],l=e[4],d=e[5]);const a=o===void 0?"default":o,u=l===void 0?"default":l,p=(d===void 0?!1:d)?ju:"button";let h;e[6]!==n||e[7]!==u||e[8]!==a?(h=ke(zM({variant:a,size:u,className:n})),e[6]=n,e[7]=u,e[8]=a,e[9]=h):h=e[9];let y;return e[10]!==p||e[11]!==i||e[12]!==u||e[13]!==h||e[14]!==a?(y=g.jsx(p,{"data-slot":"button","data-variant":a,"data-size":u,className:h,...i}),e[10]=p,e[11]=i,e[12]=u,e[13]=h,e[14]=a,e[15]=y):y=e[15],y}function qu(){const t=me.c(1),e=PM;let n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n={fetchWithAuth:e},t[0]=n):n=t[0],n}async function PM(t,e,n){const i=e===void 0?{}:e,{serverUrl:o,token:l}=n||{};let d=t;t.startsWith("/")&&o&&(d=`http://${o}${t}`);const a=new Headers(i.headers||{});return l&&a.set("Authorization",`Bearer ${l}`),fetch(d,{...i,headers:a})}function Ql(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(av,{"data-slot":"dialog",...n}),e[2]=n,e[3]=i):i=e[3],i}function FM(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(lv,{"data-slot":"dialog-portal",...n}),e[2]=n,e[3]=i):i=e[3],i}function HM(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(Jf,{"data-slot":"dialog-close",...n}),e[2]=n,e[3]=i):i=e[3],i}function UM(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(cv,{"data-slot":"dialog-overlay",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Jl(t){const e=me.c(15);let n,i,o,l;e[0]!==t?({className:i,children:n,showCloseButton:l,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=l===void 0?!0:l;let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=g.jsx(UM,{}),e[5]=a):a=e[5];let u;e[6]!==i?(u=ke("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",i),e[6]=i,e[7]=u):u=e[7];let f;e[8]!==d?(f=d&&g.jsx(Jf,{"data-slot":"dialog-close",asChild:!0,children:g.jsxs(Pe,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[g.jsx(bs,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})}),e[8]=d,e[9]=f):f=e[9];let p;return e[10]!==n||e[11]!==o||e[12]!==u||e[13]!==f?(p=g.jsxs(FM,{children:[a,g.jsxs(uv,{"data-slot":"dialog-content",className:u,...o,children:[n,f]})]}),e[10]=n,e[11]=o,e[12]=u,e[13]=f,e[14]=p):p=e[14],p}function ec(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("flex flex-col gap-2",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("div",{"data-slot":"dialog-header",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function bh(t){const e=me.c(14);let n,i,o,l;e[0]!==t?({className:i,showCloseButton:l,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=l===void 0?!1:l;let a;e[5]!==i?(a=ke("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",i),e[5]=i,e[6]=a):a=e[6];let u;e[7]!==d?(u=d&&g.jsx(Jf,{asChild:!0,children:g.jsx(Pe,{variant:"outline",children:"Close"})}),e[7]=d,e[8]=u):u=e[8];let f;return e[9]!==n||e[10]!==o||e[11]!==a||e[12]!==u?(f=g.jsxs("div",{"data-slot":"dialog-footer",className:a,...o,children:[n,u]}),e[9]=n,e[10]=o,e[11]=a,e[12]=u,e[13]=f):f=e[13],f}function tc(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("text-base leading-none font-medium",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(NS,{"data-slot":"dialog-title",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Vu(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(DS,{"data-slot":"dialog-description",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function yf(t){const e=me.c(10);let n,i,o;e[0]!==t?({className:n,type:o,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o):(n=e[1],i=e[2],o=e[3]);let l;e[4]!==n?(l=ke("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",n),e[4]=n,e[5]=l):l=e[5];let d;return e[6]!==i||e[7]!==l||e[8]!==o?(d=g.jsx("input",{type:o,"data-slot":"input",className:l,...i}),e[6]=i,e[7]=l,e[8]=o,e[9]=d):d=e[9],d}const nc=D.forwardRef((t,e)=>{const n=me.c(16);let i,o,l;n[0]!==t?({className:o,children:i,...l}=t,n[0]=t,n[1]=i,n[2]=o,n[3]=l):(i=n[1],o=n[2],l=n[3]);let d;n[4]!==o?(d=ke("relative overflow-hidden",o),n[4]=o,n[5]=d):d=n[5];let a;n[6]===Symbol.for("react.memo_cache_sentinel")?(a={WebkitOverflowScrolling:"touch"},n[6]=a):a=n[6];let u;n[7]!==i||n[8]!==e?(u=g.jsx(LN,{ref:e,"data-slot":"scroll-area-viewport",className:"size-full min-w-0 rounded-[inherit] outline-none",style:a,children:i}),n[7]=i,n[8]=e,n[9]=u):u=n[9];let f,p;n[10]===Symbol.for("react.memo_cache_sentinel")?(f=g.jsx($M,{}),p=g.jsx(IN,{}),n[10]=f,n[11]=p):(f=n[10],p=n[11]);let h;return n[12]!==l||n[13]!==d||n[14]!==u?(h=g.jsxs(ON,{"data-slot":"scroll-area",className:d,...l,children:[u,f,p]}),n[12]=l,n[13]=d,n[14]=u,n[15]=h):h=n[15],h});nc.displayName="ScrollArea";function $M(t){const e=me.c(11);let n,i,o;e[0]!==t?({className:n,orientation:o,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o):(n=e[1],i=e[2],o=e[3]);const l=o===void 0?"vertical":o;let d;e[4]!==n?(d=ke("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",n),e[4]=n,e[5]=d):d=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=g.jsx(aw,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[6]=a):a=e[6];let u;return e[7]!==l||e[8]!==i||e[9]!==d?(u=g.jsx(rw,{"data-slot":"scroll-area-scrollbar","data-orientation":l,orientation:l,className:d,...i,children:a}),e[7]=l,e[8]=i,e[9]=d,e[10]=u):u=e[10],u}function qM(t){const n=t.replace(/\\/g,"/").split("/");return n.pop(),n.join("/")||"/"}function VM({open:t,onOpenChange:e,onSelect:n,initialPath:i,title:o="Select Folder"}){const[l,d]=D.useState(i||""),[a,u]=D.useState([]),[f,p]=D.useState(!1),[h,y]=D.useState(0),[S,C]=D.useState(null),[w,_]=D.useState(""),v=D.useRef(null),b=D.useRef(null),{fetchWithAuth:x}=qu(),{activeServer:E}=Vl(),N=D.useCallback(async U=>{p(!0),C(null),y(0),_("");try{const $=await x(`/api/fs/browse?path=${encodeURIComponent(U)}`,{},{serverUrl:E==null?void 0:E.url,token:E==null?void 0:E.token}),G=await $.json();if(!$.ok)throw new Error(G.message||"Failed to browse directory");const K=G.files.filter(V=>V.type==="directory");u(K),d(G.currentPath)}catch($){C($ instanceof Error?$.message:"Failed to load directory"),u([])}finally{p(!1)}},[x,E]);D.useEffect(()=>{t&&N(i||"")},[t,i,N]),D.useEffect(()=>{y(0)},[w]);const A=a.filter(U=>U.name.toLowerCase().includes(w.toLowerCase())),M=()=>{const U=qM(l);U!==l&&N(U)},T=()=>{l&&(n(l),e(!1))},j=U=>{const $=l?`${l}/${U.name}`:U.name;N($)},O=U=>{if(A.length!==0)switch(U.key){case"ArrowDown":U.preventDefault(),y($=>Math.min($+1,A.length-1));break;case"ArrowUp":U.preventDefault(),y($=>Math.max($-1,0));break;case"Enter":U.preventDefault(),A[h]&&j(A[h]);break;case"Escape":w&&(U.preventDefault(),_(""));break}};D.useEffect(()=>{if(b.current&&A.length>0){const U=b.current.children[h];U&&U.scrollIntoView({block:"nearest"})}},[h,A.length]),D.useEffect(()=>{t&&setTimeout(()=>{var U;return(U=v.current)==null?void 0:U.focus()},100)},[t]);const F=(U,$=50)=>{if(U.length<=$)return U;const G=U.split("/");return G.length<=2?U:".../"+G.slice(-2).join("/")};return g.jsx(Ql,{open:t,onOpenChange:e,children:g.jsxs(Jl,{className:"sm:max-w-lg",onKeyDown:O,children:[g.jsx(ec,{children:g.jsx(tc,{children:o})}),g.jsxs("div",{className:"space-y-3",children:[g.jsxs("div",{className:"flex items-center gap-2 p-2 bg-muted rounded-md",children:[g.jsx(Pe,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-shrink-0",onClick:M,disabled:f||!l,children:g.jsx(PE,{className:"w-4 h-4"})}),g.jsx("span",{className:"flex-1 text-sm font-mono truncate",title:l,children:F(l)||"Home"})]}),g.jsxs("div",{className:"relative",children:[g.jsx(Qg,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),g.jsx(yf,{ref:v,placeholder:"Filter folders...",value:w,onChange:U=>_(U.target.value),className:"pl-8"})]}),g.jsx(nc,{className:"h-64 border rounded-md",children:f?g.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[g.jsx(gr,{className:"w-4 h-4 animate-spin mr-2"}),"Loading..."]}):S?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[g.jsx("span",{className:"text-destructive",children:S}),g.jsx(Pe,{variant:"ghost",size:"sm",onClick:()=>N(l),className:"mt-2",children:"Retry"})]}):A.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground text-sm",children:[g.jsx(vo,{className:"w-8 h-8 mb-2 opacity-50"}),w?"No matching folders":"No folders in this directory"]}):g.jsx("div",{className:"p-1",ref:b,children:A.map((U,$)=>g.jsxs("button",{onClick:()=>{y($)},onDoubleClick:()=>j(U),className:ke("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",$===h&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[g.jsx(vo,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}),g.jsx("span",{className:"truncate flex-1",children:U.name}),$===h&&g.jsx(xs,{className:"w-4 h-4 text-primary"})]},U.path))})}),S&&g.jsx("p",{className:"text-xs text-destructive",children:S})]}),g.jsxs(bh,{children:[g.jsx(Pe,{variant:"outline",onClick:()=>e(!1),children:"Cancel"}),g.jsx(Pe,{onClick:T,disabled:!l||f,children:"Use This Folder"})]})]})})}var yb=1,GM=.9,WM=.8,KM=.17,qm=.1,Vm=.999,YM=.9999,XM=.99,ZM=/[\\\/_+.#"@\[\(\{&]/,QM=/[\\\/_+.#"@\[\(\{&]/g,JM=/[\s-]/,bC=/[\s-]/g;function Ig(t,e,n,i,o,l,d){if(l===e.length)return o===t.length?yb:XM;var a=`${o},${l}`;if(d[a]!==void 0)return d[a];for(var u=i.charAt(l),f=n.indexOf(u,o),p=0,h,y,S,C;f>=0;)h=Ig(t,e,n,i,f+1,l+1,d),h>p&&(f===o?h*=yb:ZM.test(t.charAt(f-1))?(h*=WM,S=t.slice(o,f-1).match(QM),S&&o>0&&(h*=Math.pow(Vm,S.length))):JM.test(t.charAt(f-1))?(h*=GM,C=t.slice(o,f-1).match(bC),C&&o>0&&(h*=Math.pow(Vm,C.length))):(h*=KM,o>0&&(h*=Math.pow(Vm,f-o))),t.charAt(f)!==e.charAt(l)&&(h*=YM)),(h<qm&&n.charAt(f-1)===i.charAt(l+1)||i.charAt(l+1)===i.charAt(l)&&n.charAt(f-1)!==i.charAt(l))&&(y=Ig(t,e,n,i,f+1,l+2,d),y*qm>h&&(h=y*qm)),h>p&&(p=h),f=n.indexOf(u,f+1);return d[a]=p,p}function bb(t){return t.toLowerCase().replace(bC," ")}function ej(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,Ig(t,e,bb(t),bb(e),0,0,{})}var su='[cmdk-group=""]',Gm='[cmdk-group-items=""]',tj='[cmdk-group-heading=""]',xC='[cmdk-item=""]',xb=`${xC}:not([aria-disabled="true"])`,Bg="cmdk-item-select",Cl="data-value",nj=(t,e,n)=>ej(t,e,n),SC=D.createContext(void 0),Gu=()=>D.useContext(SC),wC=D.createContext(void 0),zv=()=>D.useContext(wC),CC=D.createContext(void 0),kC=D.forwardRef((t,e)=>{let n=kl(()=>{var H,P;return{search:"",value:(P=(H=t.value)!=null?H:t.defaultValue)!=null?P:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=kl(()=>new Set),o=kl(()=>new Map),l=kl(()=>new Map),d=kl(()=>new Set),a=EC(t),{label:u,children:f,value:p,onValueChange:h,filter:y,shouldFilter:S,loop:C,disablePointerSelection:w=!1,vimBindings:_=!0,...v}=t,b=gn(),x=gn(),E=gn(),N=D.useRef(null),A=hj();va(()=>{if(p!==void 0){let H=p.trim();n.current.value=H,M.emit()}},[p]),va(()=>{A(6,$)},[]);let M=D.useMemo(()=>({subscribe:H=>(d.current.add(H),()=>d.current.delete(H)),snapshot:()=>n.current,setState:(H,P,ee)=>{var ne,Q,W,q;if(!Object.is(n.current[H],P)){if(n.current[H]=P,H==="search")U(),O(),A(1,F);else if(H==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let J=document.getElementById(E);J?J.focus():(ne=document.getElementById(b))==null||ne.focus()}if(A(7,()=>{var J;n.current.selectedItemId=(J=G())==null?void 0:J.id,M.emit()}),ee||A(5,$),((Q=a.current)==null?void 0:Q.value)!==void 0){let J=P!=null?P:"";(q=(W=a.current).onValueChange)==null||q.call(W,J);return}}M.emit()}},emit:()=>{d.current.forEach(H=>H())}}),[]),T=D.useMemo(()=>({value:(H,P,ee)=>{var ne;P!==((ne=l.current.get(H))==null?void 0:ne.value)&&(l.current.set(H,{value:P,keywords:ee}),n.current.filtered.items.set(H,j(P,ee)),A(2,()=>{O(),M.emit()}))},item:(H,P)=>(i.current.add(H),P&&(o.current.has(P)?o.current.get(P).add(H):o.current.set(P,new Set([H]))),A(3,()=>{U(),O(),n.current.value||F(),M.emit()}),()=>{l.current.delete(H),i.current.delete(H),n.current.filtered.items.delete(H);let ee=G();A(4,()=>{U(),(ee==null?void 0:ee.getAttribute("id"))===H&&F(),M.emit()})}),group:H=>(o.current.has(H)||o.current.set(H,new Set),()=>{l.current.delete(H),o.current.delete(H)}),filter:()=>a.current.shouldFilter,label:u||t["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:b,inputId:E,labelId:x,listInnerRef:N}),[]);function j(H,P){var ee,ne;let Q=(ne=(ee=a.current)==null?void 0:ee.filter)!=null?ne:nj;return H?Q(H,n.current.search,P):0}function O(){if(!n.current.search||a.current.shouldFilter===!1)return;let H=n.current.filtered.items,P=[];n.current.filtered.groups.forEach(ne=>{let Q=o.current.get(ne),W=0;Q.forEach(q=>{let J=H.get(q);W=Math.max(J,W)}),P.push([ne,W])});let ee=N.current;K().sort((ne,Q)=>{var W,q;let J=ne.getAttribute("id"),ie=Q.getAttribute("id");return((W=H.get(ie))!=null?W:0)-((q=H.get(J))!=null?q:0)}).forEach(ne=>{let Q=ne.closest(Gm);Q?Q.appendChild(ne.parentElement===Q?ne:ne.closest(`${Gm} > *`)):ee.appendChild(ne.parentElement===ee?ne:ne.closest(`${Gm} > *`))}),P.sort((ne,Q)=>Q[1]-ne[1]).forEach(ne=>{var Q;let W=(Q=N.current)==null?void 0:Q.querySelector(`${su}[${Cl}="${encodeURIComponent(ne[0])}"]`);W==null||W.parentElement.appendChild(W)})}function F(){let H=K().find(ee=>ee.getAttribute("aria-disabled")!=="true"),P=H==null?void 0:H.getAttribute(Cl);M.setState("value",P||void 0)}function U(){var H,P,ee,ne;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=i.current.size;return}n.current.filtered.groups=new Set;let Q=0;for(let W of i.current){let q=(P=(H=l.current.get(W))==null?void 0:H.value)!=null?P:"",J=(ne=(ee=l.current.get(W))==null?void 0:ee.keywords)!=null?ne:[],ie=j(q,J);n.current.filtered.items.set(W,ie),ie>0&&Q++}for(let[W,q]of o.current)for(let J of q)if(n.current.filtered.items.get(J)>0){n.current.filtered.groups.add(W);break}n.current.filtered.count=Q}function $(){var H,P,ee;let ne=G();ne&&(((H=ne.parentElement)==null?void 0:H.firstChild)===ne&&((ee=(P=ne.closest(su))==null?void 0:P.querySelector(tj))==null||ee.scrollIntoView({block:"nearest"})),ne.scrollIntoView({block:"nearest"}))}function G(){var H;return(H=N.current)==null?void 0:H.querySelector(`${xC}[aria-selected="true"]`)}function K(){var H;return Array.from(((H=N.current)==null?void 0:H.querySelectorAll(xb))||[])}function V(H){let P=K()[H];P&&M.setState("value",P.getAttribute(Cl))}function X(H){var P;let ee=G(),ne=K(),Q=ne.findIndex(q=>q===ee),W=ne[Q+H];(P=a.current)!=null&&P.loop&&(W=Q+H<0?ne[ne.length-1]:Q+H===ne.length?ne[0]:ne[Q+H]),W&&M.setState("value",W.getAttribute(Cl))}function Z(H){let P=G(),ee=P==null?void 0:P.closest(su),ne;for(;ee&&!ne;)ee=H>0?dj(ee,su):fj(ee,su),ne=ee==null?void 0:ee.querySelector(xb);ne?M.setState("value",ne.getAttribute(Cl)):X(H)}let I=()=>V(K().length-1),L=H=>{H.preventDefault(),H.metaKey?I():H.altKey?Z(1):X(1)},B=H=>{H.preventDefault(),H.metaKey?V(0):H.altKey?Z(-1):X(-1)};return D.createElement(qe.div,{ref:e,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:H=>{var P;(P=v.onKeyDown)==null||P.call(v,H);let ee=H.nativeEvent.isComposing||H.keyCode===229;if(!(H.defaultPrevented||ee))switch(H.key){case"n":case"j":{_&&H.ctrlKey&&L(H);break}case"ArrowDown":{L(H);break}case"p":case"k":{_&&H.ctrlKey&&B(H);break}case"ArrowUp":{B(H);break}case"Home":{H.preventDefault(),V(0);break}case"End":{H.preventDefault(),I();break}case"Enter":{H.preventDefault();let ne=G();if(ne){let Q=new Event(Bg);ne.dispatchEvent(Q)}}}}},D.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:mj},u),xh(t,H=>D.createElement(wC.Provider,{value:M},D.createElement(SC.Provider,{value:T},H))))}),rj=D.forwardRef((t,e)=>{var n,i;let o=gn(),l=D.useRef(null),d=D.useContext(CC),a=Gu(),u=EC(t),f=(i=(n=u.current)==null?void 0:n.forceMount)!=null?i:d==null?void 0:d.forceMount;va(()=>{if(!f)return a.item(o,d==null?void 0:d.id)},[f]);let p=AC(o,l,[t.value,t.children,l],t.keywords),h=zv(),y=xo(A=>A.value&&A.value===p.current),S=xo(A=>f||a.filter()===!1?!0:A.search?A.filtered.items.get(o)>0:!0);D.useEffect(()=>{let A=l.current;if(!(!A||t.disabled))return A.addEventListener(Bg,C),()=>A.removeEventListener(Bg,C)},[S,t.onSelect,t.disabled]);function C(){var A,M;w(),(M=(A=u.current).onSelect)==null||M.call(A,p.current)}function w(){h.setState("value",p.current,!0)}if(!S)return null;let{disabled:_,value:v,onSelect:b,forceMount:x,keywords:E,...N}=t;return D.createElement(qe.div,{ref:Ss(l,e),...N,id:o,"cmdk-item":"",role:"option","aria-disabled":!!_,"aria-selected":!!y,"data-disabled":!!_,"data-selected":!!y,onPointerMove:_||a.getDisablePointerSelection()?void 0:w,onClick:_?void 0:C},t.children)}),ij=D.forwardRef((t,e)=>{let{heading:n,children:i,forceMount:o,...l}=t,d=gn(),a=D.useRef(null),u=D.useRef(null),f=gn(),p=Gu(),h=xo(S=>o||p.filter()===!1?!0:S.search?S.filtered.groups.has(d):!0);va(()=>p.group(d),[]),AC(d,a,[t.value,t.heading,u]);let y=D.useMemo(()=>({id:d,forceMount:o}),[o]);return D.createElement(qe.div,{ref:Ss(a,e),...l,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},n&&D.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),xh(t,S=>D.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},D.createElement(CC.Provider,{value:y},S))))}),sj=D.forwardRef((t,e)=>{let{alwaysRender:n,...i}=t,o=D.useRef(null),l=xo(d=>!d.search);return!n&&!l?null:D.createElement(qe.div,{ref:Ss(o,e),...i,"cmdk-separator":"",role:"separator"})}),oj=D.forwardRef((t,e)=>{let{onValueChange:n,...i}=t,o=t.value!=null,l=zv(),d=xo(f=>f.search),a=xo(f=>f.selectedItemId),u=Gu();return D.useEffect(()=>{t.value!=null&&l.setState("search",t.value)},[t.value]),D.createElement(qe.input,{ref:e,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":a,id:u.inputId,type:"text",value:o?t.value:d,onChange:f=>{o||l.setState("search",f.target.value),n==null||n(f.target.value)}})}),aj=D.forwardRef((t,e)=>{let{children:n,label:i="Suggestions",...o}=t,l=D.useRef(null),d=D.useRef(null),a=xo(f=>f.selectedItemId),u=Gu();return D.useEffect(()=>{if(d.current&&l.current){let f=d.current,p=l.current,h,y=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let S=f.offsetHeight;p.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return y.observe(f),()=>{cancelAnimationFrame(h),y.unobserve(f)}}},[]),D.createElement(qe.div,{ref:Ss(l,e),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":i,id:u.listId},xh(t,f=>D.createElement("div",{ref:Ss(d,u.listInnerRef),"cmdk-list-sizer":""},f)))}),lj=D.forwardRef((t,e)=>{let{open:n,onOpenChange:i,overlayClassName:o,contentClassName:l,container:d,...a}=t;return D.createElement(av,{open:n,onOpenChange:i},D.createElement(lv,{container:d},D.createElement(cv,{"cmdk-overlay":"",className:o}),D.createElement(uv,{"aria-label":t.label,"cmdk-dialog":"",className:l},D.createElement(kC,{ref:e,...a}))))}),cj=D.forwardRef((t,e)=>xo(n=>n.filtered.count===0)?D.createElement(qe.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),uj=D.forwardRef((t,e)=>{let{progress:n,children:i,label:o="Loading...",...l}=t;return D.createElement(qe.div,{ref:e,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},xh(t,d=>D.createElement("div",{"aria-hidden":!0},d)))}),Sa=Object.assign(kC,{List:aj,Item:rj,Input:oj,Group:ij,Separator:sj,Dialog:lj,Empty:cj,Loading:uj});function dj(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function fj(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function EC(t){let e=D.useRef(t);return va(()=>{e.current=t}),e}var va=typeof window>"u"?D.useEffect:D.useLayoutEffect;function kl(t){let e=D.useRef();return e.current===void 0&&(e.current=t()),e}function xo(t){let e=zv(),n=()=>t(e.snapshot());return D.useSyncExternalStore(e.subscribe,n,n)}function AC(t,e,n,i=[]){let o=D.useRef(),l=Gu();return va(()=>{var d;let a=(()=>{var f;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(f=p.current.textContent)==null?void 0:f.trim():o.current}})(),u=i.map(f=>f.trim());l.value(t,a,u),(d=e.current)==null||d.setAttribute(Cl,a),o.current=a}),o}var hj=()=>{let[t,e]=D.useState(),n=kl(()=>new Map);return va(()=>{n.current.forEach(i=>i()),n.current=new Map},[t]),(i,o)=>{n.current.set(i,o),e({})}};function pj(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function xh({asChild:t,children:e},n){return t&&D.isValidElement(e)?D.cloneElement(pj(e),{ref:e.ref},n(e.props.children)):n(e)}var mj={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function gj(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("textarea",{"data-slot":"textarea",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function vj(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("div",{"data-slot":"input-group",role:"group",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}const _j=Gl("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function yj(t){const e=me.c(11);let n,i,o;e[0]!==t?({className:n,align:o,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o):(n=e[1],i=e[2],o=e[3]);const l=o===void 0?"inline-start":o;let d;e[4]!==l||e[5]!==n?(d=ke(_j({align:l}),n),e[4]=l,e[5]=n,e[6]=d):d=e[6];let a;return e[7]!==l||e[8]!==i||e[9]!==d?(a=g.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":l,className:d,onClick:bj,...i}),e[7]=l,e[8]=i,e[9]=d,e[10]=a):a=e[10],a}function bj(t){var e,n;t.target.closest("button")||(n=(e=t.currentTarget.parentElement)==null?void 0:e.querySelector("input"))==null||n.focus()}function Pv(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(Sa,{"data-slot":"command",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function TC(t){const e=me.c(11);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",n),e[3]=n,e[4]=o):o=e[4];let l;e[5]!==i||e[6]!==o?(l=g.jsx(Sa.Input,{"data-slot":"command-input",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=g.jsx(yj,{children:g.jsx(Qg,{className:"size-4 shrink-0 opacity-50"})}),e[8]=d):d=e[8];let a;return e[9]!==l?(a=g.jsx("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:g.jsxs(vj,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[l,d]})}),e[9]=l,e[10]=a):a=e[10],a}function Fv(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(Sa.List,{"data-slot":"command-list",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Hv(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("py-6 text-center text-sm",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(Sa.Empty,{"data-slot":"command-empty",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function ku(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(Sa.Group,{"data-slot":"command-group",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function RC(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("-mx-1 h-px bg-border",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(Sa.Separator,{"data-slot":"command-separator",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Dl(t){const e=me.c(11);let n,i,o;e[0]!==t?({className:i,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o):(n=e[1],i=e[2],o=e[3]);let l;e[4]!==i?(l=ke("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",i),e[4]=i,e[5]=l):l=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=g.jsx(xs,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"}),e[6]=d):d=e[6];let a;return e[7]!==n||e[8]!==o||e[9]!==l?(a=g.jsxs(Sa.Item,{"data-slot":"command-item",className:l,...o,children:[n,d]}),e[7]=n,e[8]=o,e[9]=l,e[10]=a):a=e[10],a}function Sh(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(uN,{"data-slot":"popover",...n}),e[2]=n,e[3]=i):i=e[3],i}function Uv(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(fN,{"data-slot":"popover-trigger",...n}),e[2]=n,e[3]=i):i=e[3],i}function wh(t){const e=me.c(12);let n,i,o,l;e[0]!==t?({className:n,align:o,sideOffset:l,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=o===void 0?"center":o,a=l===void 0?4:l;let u;e[5]!==n?(u=ke("z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",n),e[5]=n,e[6]=u):u=e[6];let f;return e[7]!==d||e[8]!==i||e[9]!==a||e[10]!==u?(f=g.jsx(hN,{children:g.jsx(pN,{"data-slot":"popover-content",align:d,sideOffset:a,className:u,...i})}),e[7]=d,e[8]=i,e[9]=a,e[10]=u,e[11]=f):f=e[11],f}function xj(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(dN,{"data-slot":"popover-anchor",...n}),e[2]=n,e[3]=i):i=e[3],i}function Sj(t){const e=me.c(50),{workspaces:n,activeWorkspace:i,onSelectWorkspace:o,onCreateVirtualWorkspace:l,onCreatePhysicalWorkspace:d,isWorkspaceFavorited:a,onToggleFavorite:u}=t,[f,p]=D.useState(!1),[h,y]=D.useState(!1);let S;e[0]!==(i==null?void 0:i.isVirtual)?(S=i!=null&&i.isVirtual?g.jsx(vg,{className:"size-4 flex-shrink-0 text-muted-foreground"}):g.jsx(vo,{className:"size-4 flex-shrink-0 text-muted-foreground"}),e[0]=i==null?void 0:i.isVirtual,e[1]=S):S=e[1];const C=(i==null?void 0:i.name)||"Select workspace";let w;e[2]!==C?(w=g.jsx("span",{className:"truncate",children:C}),e[2]=C,e[3]=w):w=e[3];let _;e[4]!==S||e[5]!==w?(_=g.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[S,w]}),e[4]=S,e[5]=w,e[6]=_):_=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=g.jsx(Lx,{className:"ml-auto size-4 shrink-0 opacity-50"}),e[7]=v):v=e[7];let b;e[8]!==f||e[9]!==_?(b=g.jsx(Uv,{asChild:!0,children:g.jsxs(Pe,{variant:"outline",role:"combobox","aria-expanded":f,"aria-label":"Select workspace",className:"w-full justify-between h-9",children:[_,v]})}),e[8]=f,e[9]=_,e[10]=b):b=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=g.jsx(TC,{placeholder:"Search workspace..."}),e[11]=x):x=e[11];let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=g.jsx(Hv,{children:"No workspace found."}),e[12]=E):E=e[12];let N;if(e[13]!==(i==null?void 0:i.id)||e[14]!==a||e[15]!==o||e[16]!==u||e[17]!==n){let Z;e[19]!==(i==null?void 0:i.id)||e[20]!==a||e[21]!==o||e[22]!==u?(Z=I=>g.jsxs(Dl,{onSelect:()=>{o(I),p(!1)},className:"justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[I.isVirtual?g.jsx(vg,{className:"size-4 text-muted-foreground"}):g.jsx(vo,{className:"size-4 text-muted-foreground"}),g.jsx("span",{children:I.name})]}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("button",{className:"p-1 rounded hover:bg-secondary transition-colors",onClick:L=>{L.stopPropagation(),u(I.id,I.name)},title:a(I.id)?"Remove from favorites":"Add to favorites",children:a(I.id)?g.jsx(D0,{className:"size-4 fill-primary text-primary"}):g.jsx(D0,{className:"size-4 text-muted-foreground"})}),g.jsx(xs,{className:ke("size-4",(i==null?void 0:i.id)===I.id?"opacity-100":"opacity-0")})]})]},I.id),e[19]=i==null?void 0:i.id,e[20]=a,e[21]=o,e[22]=u,e[23]=Z):Z=e[23],N=n.map(Z),e[13]=i==null?void 0:i.id,e[14]=a,e[15]=o,e[16]=u,e[17]=n,e[18]=N}else N=e[18];let A;e[24]!==N?(A=g.jsx(ku,{heading:"Workspaces",children:N}),e[24]=N,e[25]=A):A=e[25];let M;e[26]===Symbol.for("react.memo_cache_sentinel")?(M=g.jsx(RC,{}),e[26]=M):M=e[26];let T;e[27]!==l?(T=()=>{l(),p(!1)},e[27]=l,e[28]=T):T=e[28];let j;e[29]===Symbol.for("react.memo_cache_sentinel")?(j=g.jsx(ql,{className:"size-4","data-icon":"inline-start"}),e[29]=j):j=e[29];let O;e[30]!==T?(O=g.jsxs(Dl,{onSelect:T,children:[j,"Create virtual workspace"]}),e[30]=T,e[31]=O):O=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=g.jsxs(Dl,{onSelect:()=>{p(!1),y(!0)},children:[g.jsx(vo,{className:"size-4","data-icon":"inline-start"}),"Add existing folder"]}),e[32]=F):F=e[32];let U;e[33]!==O?(U=g.jsxs(ku,{children:[O,F]}),e[33]=O,e[34]=U):U=e[34];let $;e[35]!==A||e[36]!==U?($=g.jsx(wh,{className:"w-[240px] p-0 max-h-[80vh]",children:g.jsxs(Pv,{children:[x,g.jsxs(Fv,{className:"max-h-[50vh] overflow-y-auto",children:[E,A,M,U]})]})}),e[35]=A,e[36]=U,e[37]=$):$=e[37];let G;e[38]!==f||e[39]!==$||e[40]!==b?(G=g.jsxs(Sh,{open:f,onOpenChange:p,children:[b,$]}),e[38]=f,e[39]=$,e[40]=b,e[41]=G):G=e[41];let K;e[42]!==d?(K=Z=>{d(Z),y(!1)},e[42]=d,e[43]=K):K=e[43];let V;e[44]!==h||e[45]!==K?(V=g.jsx(VM,{open:h,onOpenChange:y,onSelect:K,title:"Select Workspace Folder"}),e[44]=h,e[45]=K,e[46]=V):V=e[46];let X;return e[47]!==G||e[48]!==V?(X=g.jsxs(g.Fragment,{children:[G,V]}),e[47]=G,e[48]=V,e[49]=X):X=e[49],X}function wj(t){const e=me.c(33),{onOpenAddServer:n,onServerSwitch:i}=t,[o,l]=D.useState(!1),{servers:d,activeServer:a,switchServer:u}=Vl();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=g.jsx(fa,{className:"size-4 flex-shrink-0 text-muted-foreground"}),e[0]=f):f=e[0];const p=(a==null?void 0:a.name)||"Select server";let h;e[1]!==p?(h=g.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[f,g.jsx("span",{className:"truncate",children:p})]}),e[1]=p,e[2]=h):h=e[2];let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=g.jsx(Lx,{className:"ml-auto size-4 shrink-0 opacity-50"}),e[3]=y):y=e[3];let S;e[4]!==o||e[5]!==h?(S=g.jsx(Uv,{asChild:!0,children:g.jsxs(Pe,{variant:"outline",role:"combobox","aria-expanded":o,"aria-label":"Select server",className:"w-full justify-between h-9",children:[h,y]})}),e[4]=o,e[5]=h,e[6]=S):S=e[6];let C;e[7]===Symbol.for("react.memo_cache_sentinel")?(C=g.jsx(TC,{placeholder:"Search server..."}),e[7]=C):C=e[7];let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w=g.jsx(Hv,{children:"No server found."}),e[8]=w):w=e[8];let _;if(e[9]!==(a==null?void 0:a.id)||e[10]!==i||e[11]!==d||e[12]!==u){let T;e[14]!==(a==null?void 0:a.id)||e[15]!==i||e[16]!==u?(T=j=>g.jsxs(Dl,{onSelect:()=>{u(j.id),i==null||i(),l(!1)},className:"justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(fa,{className:"size-4 text-muted-foreground"}),g.jsx("span",{children:j.name})]}),g.jsx(xs,{className:ke("size-4",(a==null?void 0:a.id)===j.id?"opacity-100":"opacity-0")})]},j.id),e[14]=a==null?void 0:a.id,e[15]=i,e[16]=u,e[17]=T):T=e[17],_=d.map(T),e[9]=a==null?void 0:a.id,e[10]=i,e[11]=d,e[12]=u,e[13]=_}else _=e[13];let v;e[18]!==_?(v=g.jsx(ku,{heading:"Servers",children:_}),e[18]=_,e[19]=v):v=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=g.jsx(RC,{}),e[20]=b):b=e[20];let x;e[21]!==n?(x=()=>{n(),l(!1)},e[21]=n,e[22]=x):x=e[22];let E;e[23]===Symbol.for("react.memo_cache_sentinel")?(E=g.jsx(ql,{className:"size-4","data-icon":"inline-start"}),e[23]=E):E=e[23];let N;e[24]!==x?(N=g.jsx(ku,{children:g.jsxs(Dl,{onSelect:x,children:[E,"Add Server..."]})}),e[24]=x,e[25]=N):N=e[25];let A;e[26]!==N||e[27]!==v?(A=g.jsx(wh,{className:"w-[240px] p-0 max-h-[80vh]",children:g.jsxs(Pv,{children:[C,g.jsxs(Fv,{className:"max-h-[50vh] overflow-y-auto",children:[w,v,b,N]})]})}),e[26]=N,e[27]=v,e[28]=A):A=e[28];let M;return e[29]!==o||e[30]!==A||e[31]!==S?(M=g.jsxs(Sh,{open:o,onOpenChange:l,children:[S,A]}),e[29]=o,e[30]=A,e[31]=S,e[32]=M):M=e[32],M}const Wm=640;function Wu(){const t=me.c(2),[e,n]=D.useState(void 0);let i,o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{const l=window.matchMedia(`(max-width: ${Wm-1}px)`),d=()=>{n(window.innerWidth<Wm)};return l.addEventListener("change",d),n(window.innerWidth<Wm),()=>l.removeEventListener("change",d)},o=[],t[0]=i,t[1]=o):(i=t[0],o=t[1]),D.useEffect(i,o),!!e}function ua(t){const e=me.c(12);let n,i,o,l;e[0]!==t?({className:n,orientation:o,decorative:l,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=o===void 0?"horizontal":o,a=l===void 0?!0:l;let u;e[5]!==n?(u=ke("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",n),e[5]=n,e[6]=u):u=e[6];let f;return e[7]!==a||e[8]!==d||e[9]!==i||e[10]!==u?(f=g.jsx(xD,{"data-slot":"separator",decorative:a,orientation:d,className:u,...i}),e[7]=a,e[8]=d,e[9]=i,e[10]=u,e[11]=f):f=e[11],f}function Ch(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(av,{"data-slot":"sheet",...n}),e[2]=n,e[3]=i):i=e[3],i}function Cj(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(uT,{"data-slot":"sheet-trigger",...n}),e[2]=n,e[3]=i):i=e[3],i}function kj(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(lv,{"data-slot":"sheet-portal",...n}),e[2]=n,e[3]=i):i=e[3],i}function Ej(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(cv,{"data-slot":"sheet-overlay",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function kh(t){const e=me.c(24);let n,i,o,l,d,a;e[0]!==t?({className:i,children:n,side:d,showCloseButton:a,style:l,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l,e[5]=d,e[6]=a):(n=e[1],i=e[2],o=e[3],l=e[4],d=e[5],a=e[6]);const u=d===void 0?"right":d,f=a===void 0?!0:a;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=g.jsx(Ej,{}),e[7]=p):p=e[7];let h;e[8]!==i?(h=ke("fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10",i),e[8]=i,e[9]=h):h=e[9];let y;e[10]!==u?(y=u==="left"||u==="right"?{top:"env(safe-area-inset-top, 0px)",bottom:"env(safe-area-inset-bottom, 0px)",height:"calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))"}:u==="top"?{top:"env(safe-area-inset-top, 0px)"}:u==="bottom"?{bottom:"env(safe-area-inset-bottom, 0px)"}:void 0,e[10]=u,e[11]=y):y=e[11];const S=y;let C;e[12]!==S||e[13]!==l?(C=S?{...S,...l}:l,e[12]=S,e[13]=l,e[14]=C):C=e[14];const w=C;let _;e[15]!==f?(_=f&&g.jsx(Jf,{"data-slot":"sheet-close",asChild:!0,children:g.jsxs(Pe,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm",children:[g.jsx(bs,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})}),e[15]=f,e[16]=_):_=e[16];let v;return e[17]!==n||e[18]!==o||e[19]!==u||e[20]!==h||e[21]!==w||e[22]!==_?(v=g.jsxs(kj,{children:[p,g.jsxs(uv,{"data-slot":"sheet-content","data-side":u,className:h,style:w,...o,children:[n,_]})]}),e[17]=n,e[18]=o,e[19]=u,e[20]=h,e[21]=w,e[22]=_,e[23]=v):v=e[23],v}function Eh(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("flex flex-col gap-0.5 p-4",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("div",{"data-slot":"sheet-header",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Ah(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("text-base font-medium text-foreground",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(NS,{"data-slot":"sheet-title",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Aj(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("text-sm text-muted-foreground",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(DS,{"data-slot":"sheet-description",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Eu(t){const e=me.c(6);let n,i;e[0]!==t?({delayDuration:i,...n}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);const o=i===void 0?0:i;let l;return e[3]!==o||e[4]!==n?(l=g.jsx($D,{"data-slot":"tooltip-provider",delayDuration:o,...n}),e[3]=o,e[4]=n,e[5]=l):l=e[5],l}function zl(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(qD,{"data-slot":"tooltip",...n}),e[2]=n,e[3]=i):i=e[3],i}function Pl(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(VD,{"data-slot":"tooltip-trigger",...n}),e[2]=n,e[3]=i):i=e[3],i}function Fl(t){const e=me.c(13);let n,i,o,l;e[0]!==t?({className:i,sideOffset:l,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=l===void 0?0:l;let a;e[5]!==i?(a=ke("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",i),e[5]=i,e[6]=a):a=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=g.jsx(KD,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"}),e[7]=u):u=e[7];let f;return e[8]!==n||e[9]!==o||e[10]!==d||e[11]!==a?(f=g.jsx(GD,{children:g.jsxs(WD,{"data-slot":"tooltip-content",sideOffset:d,className:a,...o,children:[n,u]})}),e[8]=n,e[9]=o,e[10]=d,e[11]=a,e[12]=f):f=e[12],f}const Tj="sidebar_state",Rj=3600*24*7,Nj="16rem",Dj="18rem",Mj="3rem",NC=D.createContext(null);function Ku(){const t=D.useContext(NC);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function jj(t){const e=me.c(33);let n,i,o,l,d,a,u;e[0]!==t?({defaultOpen:u,open:o,onOpenChange:d,className:i,style:a,children:n,...l}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l,e[5]=d,e[6]=a,e[7]=u):(n=e[1],i=e[2],o=e[3],l=e[4],d=e[5],a=e[6],u=e[7]);const f=u===void 0?!0:u,p=Wu(),[h,y]=D.useState(!1),[S,C]=D.useState(f),w=o!=null?o:S;let _;e[8]!==w||e[9]!==d?(_=U=>{const $=typeof U=="function"?U(w):U;d?d($):C($),document.cookie=`${Tj}=${$}; path=/; max-age=${Rj}`},e[8]=w,e[9]=d,e[10]=_):_=e[10];const v=_;let b;e[11]!==p||e[12]!==v?(b=()=>p?y(Lj):v(Oj),e[11]=p,e[12]=v,e[13]=b):b=e[13];const x=b,E=w?"expanded":"collapsed";let N;e[14]!==p||e[15]!==w||e[16]!==h||e[17]!==v||e[18]!==E||e[19]!==x?(N={state:E,open:w,setOpen:v,isMobile:p,openMobile:h,setOpenMobile:y,toggleSidebar:x},e[14]=p,e[15]=w,e[16]=h,e[17]=v,e[18]=E,e[19]=x,e[20]=N):N=e[20];const A=N;let M;e[21]!==a?(M={"--sidebar-width":Nj,"--sidebar-width-icon":Mj,...a},e[21]=a,e[22]=M):M=e[22];const T=M;let j;e[23]!==i?(j=ke("overflow-hidden group/sidebar-wrapper flex h-full w-full has-data-[variant=inset]:bg-sidebar",i),e[23]=i,e[24]=j):j=e[24];let O;e[25]!==n||e[26]!==l||e[27]!==T||e[28]!==j?(O=g.jsx("div",{"data-slot":"sidebar-wrapper",style:T,className:j,...l,children:n}),e[25]=n,e[26]=l,e[27]=T,e[28]=j,e[29]=O):O=e[29];let F;return e[30]!==A||e[31]!==O?(F=g.jsx(NC.Provider,{value:A,children:O}),e[30]=A,e[31]=O,e[32]=F):F=e[32],F}function Oj(t){return!t}function Lj(t){return!t}function Ij(t){const e=me.c(49);let n,i,o,l,d,a,u;e[0]!==t?({side:d,variant:a,collapsible:u,className:i,children:n,dir:o,...l}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l,e[5]=d,e[6]=a,e[7]=u):(n=e[1],i=e[2],o=e[3],l=e[4],d=e[5],a=e[6],u=e[7]);const f=d===void 0?"left":d,p=a===void 0?"sidebar":a,h=u===void 0?"offcanvas":u,{isMobile:y,state:S,openMobile:C,setOpenMobile:w}=Ku();if(h==="none"){let O;e[8]!==i?(O=ke("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",i),e[8]=i,e[9]=O):O=e[9];let F;return e[10]!==n||e[11]!==l||e[12]!==O?(F=g.jsx("div",{"data-slot":"sidebar",className:O,...l,children:n}),e[10]=n,e[11]=l,e[12]=O,e[13]=F):F=e[13],F}if(y){let O;e[14]===Symbol.for("react.memo_cache_sentinel")?(O={"--sidebar-width":Dj},e[14]=O):O=e[14];let F;e[15]===Symbol.for("react.memo_cache_sentinel")?(F=g.jsxs(Eh,{className:"sr-only",children:[g.jsx(Ah,{children:"Sidebar"}),g.jsx(Aj,{children:"Displays the mobile sidebar."})]}),e[15]=F):F=e[15];let U;e[16]!==n?(U=g.jsx("div",{className:"flex h-full w-full flex-col",children:n}),e[16]=n,e[17]=U):U=e[17];let $;e[18]!==o||e[19]!==f||e[20]!==U?($=g.jsxs(kh,{dir:o,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:O,side:f,children:[F,U]}),e[18]=o,e[19]=f,e[20]=U,e[21]=$):$=e[21];let G;return e[22]!==C||e[23]!==l||e[24]!==w||e[25]!==$?(G=g.jsx(Ch,{open:C,onOpenChange:w,...l,children:$}),e[22]=C,e[23]=l,e[24]=w,e[25]=$,e[26]=G):G=e[26],G}const _=S==="collapsed"?h:"",v=p==="floating"||p==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let b;e[27]!==v?(b=ke("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",v),e[27]=v,e[28]=b):b=e[28];let x;e[29]!==b?(x=g.jsx("div",{"data-slot":"sidebar-gap",className:b}),e[29]=b,e[30]=x):x=e[30];const E=p==="floating"||p==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l";let N;e[31]!==i||e[32]!==E?(N=ke("fixed z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",E,i),e[31]=i,e[32]=E,e[33]=N):N=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A={top:"env(safe-area-inset-top, 0)",bottom:"env(safe-area-inset-bottom, 0)",height:"calc(100vh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0))"},e[34]=A):A=e[34];let M;e[35]!==n?(M=g.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:n}),e[35]=n,e[36]=M):M=e[36];let T;e[37]!==l||e[38]!==f||e[39]!==M||e[40]!==N?(T=g.jsx("div",{"data-slot":"sidebar-container","data-side":f,className:N,style:A,...l,children:M}),e[37]=l,e[38]=f,e[39]=M,e[40]=N,e[41]=T):T=e[41];let j;return e[42]!==f||e[43]!==S||e[44]!==T||e[45]!==_||e[46]!==x||e[47]!==p?(j=g.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":S,"data-collapsible":_,"data-variant":p,"data-side":f,"data-slot":"sidebar",children:[x,T]}),e[42]=f,e[43]=S,e[44]=T,e[45]=_,e[46]=x,e[47]=p,e[48]=j):j=e[48],j}function Sb(t){const e=me.c(15);let n,i,o;e[0]!==t?({className:n,onClick:i,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o):(n=e[1],i=e[2],o=e[3]);const{toggleSidebar:l}=Ku();let d;e[4]!==n?(d=ke(n),e[4]=n,e[5]=d):d=e[5];let a;e[6]!==i||e[7]!==l?(a=h=>{i==null||i(h),l()},e[6]=i,e[7]=l,e[8]=a):a=e[8];let u,f;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=g.jsx(z4,{}),f=g.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=u,e[10]=f):(u=e[9],f=e[10]);let p;return e[11]!==o||e[12]!==d||e[13]!==a?(p=g.jsxs(Pe,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:d,onClick:a,...o,children:[u,f]}),e[11]=o,e[12]=d,e[13]=a,e[14]=p):p=e[14],p}function Bj(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("flex flex-col gap-2 p-2",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function zj(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("flex flex-col gap-2 p-2",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Pj(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("mx-2 w-auto bg-sidebar-border",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx(ua,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}const Fj=D.forwardRef((t,e)=>{const n=me.c(9);let i,o;n[0]!==t?({className:i,...o}=t,n[0]=t,n[1]=i,n[2]=o):(i=n[1],o=n[2]);let l;n[3]!==i?(l=ke("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",i),n[3]=i,n[4]=l):l=n[4];let d;return n[5]!==o||n[6]!==e||n[7]!==l?(d=g.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l,ref:e,...o}),n[5]=o,n[6]=e,n[7]=l,n[8]=d):d=n[8],d});function If(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("relative flex w-full min-w-0 flex-col p-2",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Bf(t){const e=me.c(10);let n,i,o;e[0]!==t?({className:n,asChild:o,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o):(n=e[1],i=e[2],o=e[3]);const d=(o===void 0?!1:o)?ju:"div";let a;e[4]!==n?(a=ke("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",n),e[4]=n,e[5]=a):a=e[5];let u;return e[6]!==d||e[7]!==i||e[8]!==a?(u=g.jsx(d,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:a,...i}),e[6]=d,e[7]=i,e[8]=a,e[9]=u):u=e[9],u}function zf(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("w-full text-sm",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function Al(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("flex w-full min-w-0 flex-col gap-0",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function da(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("group/menu-item relative",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}const Hj=Gl("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Ml(t){const e=me.c(28);let n,i,o,l,d,a,u;e[0]!==t?({asChild:o,isActive:l,variant:d,size:a,tooltip:u,className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l,e[5]=d,e[6]=a,e[7]=u):(n=e[1],i=e[2],o=e[3],l=e[4],d=e[5],a=e[6],u=e[7]);const f=o===void 0?!1:o,p=l===void 0?!1:l,h=d===void 0?"default":d,y=a===void 0?"default":a,S=f?ju:"button",{isMobile:C,state:w}=Ku();let _;e[8]!==n||e[9]!==y||e[10]!==h?(_=ke(Hj({variant:h,size:y}),n),e[8]=n,e[9]=y,e[10]=h,e[11]=_):_=e[11];let v;e[12]!==S||e[13]!==p||e[14]!==i||e[15]!==y||e[16]!==_?(v=g.jsx(S,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":y,"data-active":p,className:_,...i}),e[12]=S,e[13]=p,e[14]=i,e[15]=y,e[16]=_,e[17]=v):v=e[17];const b=v;if(!u)return b;if(typeof u=="string"){let M;e[18]!==u?(M={children:u},e[18]=u,e[19]=M):M=e[19],u=M}let x;e[20]!==b?(x=g.jsx(Pl,{asChild:!0,children:b}),e[20]=b,e[21]=x):x=e[21];const E=w!=="collapsed"||C;let N;e[22]!==E||e[23]!==u?(N=g.jsx(Fl,{side:"right",align:"center",hidden:E,...u}),e[22]=E,e[23]=u,e[24]=N):N=e[24];let A;return e[25]!==x||e[26]!==N?(A=g.jsxs(zl,{children:[x,N]}),e[25]=x,e[26]=N,e[27]=A):A=e[27],A}function Uj(t){const e=me.c(12);let n,i,o,l;e[0]!==t?({className:n,asChild:o,showOnHover:l,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=o===void 0?!1:o,a=l===void 0?!1:l,u=d?ju:"button",f=a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0";let p;e[5]!==n||e[6]!==f?(p=ke("absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",f,n),e[5]=n,e[6]=f,e[7]=p):p=e[7];let h;return e[8]!==u||e[9]!==i||e[10]!==p?(h=g.jsx(u,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:p,...i}),e[8]=u,e[9]=i,e[10]=p,e[11]=h):h=e[11],h}function $j(t){const e=me.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]!==n?(o=ke("ml-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border pl-2.5 py-0.5 group-data-[collapsible=icon]:hidden",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==i||e[6]!==o?(l=g.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:o,...i}),e[5]=i,e[6]=o,e[7]=l):l=e[7],l}function So(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(Q5,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=i):i=e[3],i}function wo(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(tS,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=i):i=e[3],i}function Co(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(nS,{"data-slot":"collapsible-content",...n}),e[2]=n,e[3]=i):i=e[3],i}function qj(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(K6,{"data-slot":"dropdown-menu",...n}),e[2]=n,e[3]=i):i=e[3],i}function Vj(t){const e=me.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=g.jsx(Y6,{"data-slot":"dropdown-menu-trigger",...n}),e[2]=n,e[3]=i):i=e[3],i}function Gj(t){const e=me.c(12);let n,i,o,l;e[0]!==t?({className:n,align:o,sideOffset:l,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=o===void 0?"start":o,a=l===void 0?4:l;let u;e[5]!==n?(u=ke("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 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 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",n),e[5]=n,e[6]=u):u=e[6];let f;return e[7]!==d||e[8]!==i||e[9]!==a||e[10]!==u?(f=g.jsx(X6,{children:g.jsx(Z6,{"data-slot":"dropdown-menu-content",sideOffset:a,align:d,className:u,...i})}),e[7]=d,e[8]=i,e[9]=a,e[10]=u,e[11]=f):f=e[11],f}function Km(t){const e=me.c(12);let n,i,o,l;e[0]!==t?({className:n,inset:i,variant:l,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=l===void 0?"default":l;let a;e[5]!==n?(a=ke("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",n),e[5]=n,e[6]=a):a=e[6];let u;return e[7]!==i||e[8]!==o||e[9]!==a||e[10]!==d?(u=g.jsx(Q6,{"data-slot":"dropdown-menu-item","data-inset":i,"data-variant":d,className:a,...o}),e[7]=i,e[8]=o,e[9]=a,e[10]=d,e[11]=u):u=e[11],u}function Wj(t,e){const n=me.c(6),[i,o]=D.useState(null),l=D.useRef(!1),d=D.useRef(null);let a,u;n[0]!==e||n[1]!==t?(a=()=>(l.current&&!e&&t&&(o(t),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{o(null),d.current=null},5e3)),l.current=e,()=>{d.current&&clearTimeout(d.current)}),u=[e,t],n[0]=e,n[1]=t,n[2]=a,n[3]=u):(a=n[2],u=n[3]),D.useEffect(a,u);const f=t!==null&&i===t;let p;return n[4]!==f?(p={isFlashing:f},n[4]=f,n[5]=p):p=n[5],p}const wb=Br.memo(function(e){const n=me.c(6),{isClosed:i,onReopen:o,onClose:l,onDelete:d}=e;let a;n[0]===Symbol.for("react.memo_cache_sentinel")?(a=g.jsx(Vj,{asChild:!0,children:g.jsxs(Uj,{showOnHover:!0,children:[g.jsx(n4,{className:"size-4"}),g.jsx("span",{className:"sr-only",children:"Session actions"})]})}),n[0]=a):a=n[0];let u;return n[1]!==i||n[2]!==l||n[3]!==d||n[4]!==o?(u=g.jsxs(qj,{children:[a,g.jsx(Gj,{align:"end",children:i?g.jsxs(g.Fragment,{children:[g.jsxs(Km,{onClick:o,children:[g.jsx(Px,{className:"size-4"}),"Restore"]}),g.jsxs(Km,{onClick:d,className:"text-destructive focus:text-destructive",children:[g.jsx(Du,{className:"size-4"}),"Delete permanently"]})]}):g.jsxs(Km,{onClick:l,children:[g.jsx(bs,{className:"size-4"}),"Archive"]})})]}),n[1]=i,n[2]=l,n[3]=d,n[4]=o,n[5]=u):u=n[5],u}),Cb=Br.memo(function(e){const n=me.c(4),{status:i,isStreaming:o,runningAt:l}=e;if(o||i==="running"||!!l){let u;return n[0]===Symbol.for("react.memo_cache_sentinel")?(u=g.jsx(gr,{className:"size-3.5 animate-spin shrink-0"}),n[0]=u):u=n[0],u}if(i==="error"){let u;return n[1]===Symbol.for("react.memo_cache_sentinel")?(u=g.jsx(Gf,{className:"size-3.5 shrink-0"}),n[1]=u):u=n[1],u}if(i==="interrupted"){let u;return n[2]===Symbol.for("react.memo_cache_sentinel")?(u=g.jsx(zx,{className:"size-3.5 shrink-0"}),n[2]=u):u=n[2],u}let a;return n[3]===Symbol.for("react.memo_cache_sentinel")?(a=g.jsx(Nu,{className:"size-3.5 shrink-0"}),n[3]=a):a=n[3],a}),zg=Br.memo(function t({session:e,allSessions:n,isActive:i,currentSessionId:o,streamingSessionId:l,pendingPermissions:d,onResumeSession:a,onCloseSession:u,onReopenSession:f,onDeleteSession:p}){const h=D.useMemo(()=>n.filter(x=>x.parentId===e.id),[n,e.id]),y=h.length>0,S=e.status==="closed",C=D.useMemo(()=>h.some(x=>x.id===o),[h,o]),w=e.id===l,_=d.some(x=>x.sessionId===e.id),v=w||e.subagentStatus==="running"||!!e.runningAt,{isFlashing:b}=Wj(e.id,v);return y?g.jsx(Eu,{delayDuration:300,children:g.jsx(So,{defaultOpen:i||C,className:"group/collapsible",children:g.jsxs(da,{children:[g.jsxs("div",{className:"flex items-center w-full",children:[g.jsx(wo,{asChild:!0,children:g.jsx("button",{className:"flex items-center justify-center rounded-md hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shrink-0 size-7 p-1","aria-label":"Toggle child sessions",children:g.jsx(si,{className:"size-4 transition-transform duration-200 [[data-state=open]>&]:rotate-90"})})}),g.jsx(Ml,{"data-session-id":e.id,isActive:i,onClick:()=>a(e.id),className:ke("flex-1 min-w-0",b&&"animate-completion-flash rounded-md"),children:g.jsxs(zl,{children:[g.jsx(Pl,{asChild:!0,children:g.jsxs("span",{className:"truncate flex items-center gap-2",children:[g.jsx(Cb,{status:e.subagentStatus,isStreaming:w,runningAt:e.runningAt}),_&&g.jsx(bu,{className:"size-3 text-warning shrink-0 animate-pulse"}),e.title||"Untitled"]})}),g.jsx(Fl,{side:"right",className:"max-w-xs",children:e.title||"Untitled"})]})}),g.jsx(wb,{isClosed:S,onReopen:()=>f(e.id),onClose:()=>u(e.id),onDelete:()=>p(e.id)})]}),g.jsx(Co,{children:g.jsx($j,{children:h.map(x=>g.jsx(t,{session:x,allSessions:n,isActive:o===x.id,currentSessionId:o,streamingSessionId:l,pendingPermissions:d,onResumeSession:a,onCloseSession:u,onReopenSession:f,onDeleteSession:p},x.id))})})]})})}):g.jsx(Eu,{delayDuration:300,children:g.jsx(da,{children:g.jsxs("div",{className:"flex items-center w-full",children:[g.jsx("div",{className:"shrink-0 size-7 p-1"}),g.jsx(Ml,{"data-session-id":e.id,isActive:i,onClick:()=>a(e.id),className:ke("flex-1 min-w-0",b&&"animate-completion-flash rounded-md"),children:g.jsxs(zl,{children:[g.jsx(Pl,{asChild:!0,children:g.jsxs("span",{className:"truncate flex items-center gap-2",children:[g.jsx(Cb,{status:e.subagentStatus,isStreaming:w,runningAt:e.runningAt}),_&&g.jsx(bu,{className:"size-3 text-warning shrink-0 animate-pulse"}),e.title||"Untitled"]})}),g.jsx(Fl,{side:"right",className:"max-w-xs",children:e.title||"Untitled"})]})}),g.jsx(wb,{isClosed:S,onReopen:()=>f(e.id),onClose:()=>u(e.id),onDelete:()=>p(e.id)})]})})})}),Kj=Gl("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Bn(t){const e=me.c(13);let n,i,o,l;e[0]!==t?({className:n,variant:o,asChild:l,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=l):(n=e[1],i=e[2],o=e[3],l=e[4]);const d=o===void 0?"default":o,u=(l===void 0?!1:l)?ju:"span";let f;e[5]!==n||e[6]!==d?(f=ke(Kj({variant:d}),n),e[5]=n,e[6]=d,e[7]=f):f=e[7];let p;return e[8]!==u||e[9]!==i||e[10]!==f||e[11]!==d?(p=g.jsx(u,{"data-slot":"badge","data-variant":d,className:f,...i}),e[8]=u,e[9]=i,e[10]=f,e[11]=d,e[12]=p):p=e[12],p}const Yj=Br.memo(function(e){const n=me.c(43),{allSessions:i,currentSession:o,currentSessionId:l,streamingSessionId:d,pendingPermissions:a,favoritedWorkspaceIds:u,workspaces:f,activeWorkspace:p,onSelectWorkspace:h,onResumeSession:y,onCloseSession:S,onReopenSession:C,onDeleteSession:w,onCreateSessionInWorkspace:_,connected:v}=e;let b;if(n[0]!==u||n[1]!==f){const T=new Map(f.map(Xj));b=u.map(j=>T.get(j)).filter(Zj),n[0]=u,n[1]=f,n[2]=b}else b=n[2];const x=b;let E;if(n[3]!==i||n[4]!==x){E=new Map;for(const T of x){const j=i.filter(O=>O.workspaceId===T.id&&O.status==="active"&&O.parentId===null).sort(Qj);E.set(T.id,j)}n[3]=i,n[4]=x,n[5]=E}else E=n[5];const N=E;if(x.length===0){let T;n[6]===Symbol.for("react.memo_cache_sentinel")?(T=g.jsx(Bf,{children:"Overview"}),n[6]=T):T=n[6];let j;return n[7]===Symbol.for("react.memo_cache_sentinel")?(j=g.jsxs(If,{children:[T,g.jsx(zf,{children:g.jsx("div",{className:"px-2 py-8 text-center text-sm text-muted-foreground",children:"Star a workspace to see it here"})})]}),n[7]=j):j=n[7],j}let A;if(n[8]!==(p==null?void 0:p.id)||n[9]!==i||n[10]!==v||n[11]!==(o==null?void 0:o.id)||n[12]!==(o==null?void 0:o.workspaceId)||n[13]!==l||n[14]!==x||n[15]!==S||n[16]!==_||n[17]!==w||n[18]!==C||n[19]!==y||n[20]!==h||n[21]!==a||n[22]!==d||n[23]!==N){let T;n[25]!==(p==null?void 0:p.id)||n[26]!==i||n[27]!==v||n[28]!==(o==null?void 0:o.id)||n[29]!==(o==null?void 0:o.workspaceId)||n[30]!==l||n[31]!==S||n[32]!==_||n[33]!==w||n[34]!==C||n[35]!==y||n[36]!==h||n[37]!==a||n[38]!==d||n[39]!==N?(T=j=>{const O=j.id===(p==null?void 0:p.id),F=(o==null?void 0:o.workspaceId)===j.id,U=N.get(j.id)||[];return g.jsx(So,{defaultOpen:O,className:"group/collapsible",children:g.jsxs(If,{children:[g.jsx(Bf,{asChild:!0,children:g.jsxs(wo,{className:"flex items-center justify-between w-full",onClick:()=>h(j),children:[g.jsxs("span",{className:"flex items-center gap-2",children:[g.jsx(si,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),j.isVirtual?g.jsx(vg,{className:"size-3.5"}):g.jsx(vo,{className:"size-3.5"}),g.jsx("span",{className:F?"truncate text-sidebar-foreground font-medium":"truncate",children:j.name})]}),g.jsx(Bn,{variant:"secondary",children:U.length})]})}),g.jsx(Co,{children:g.jsxs(zf,{children:[g.jsx(Al,{children:g.jsx(da,{children:g.jsxs(Ml,{onClick:()=>_(j.id),disabled:!v,className:"w-full",children:[g.jsx(ql,{className:"size-4","data-icon":"inline-start"}),g.jsx("span",{children:"New Chat"})]})})}),g.jsx(Pj,{}),g.jsx(Al,{children:U.length===0?g.jsx("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"(no active sessions)"}):U.map($=>g.jsx(zg,{session:$,allSessions:i,isActive:(o==null?void 0:o.id)===$.id,currentSessionId:l,streamingSessionId:d,pendingPermissions:a,onResumeSession:y,onCloseSession:S,onReopenSession:C,onDeleteSession:w},$.id))})]})})]})},j.id)},n[25]=p==null?void 0:p.id,n[26]=i,n[27]=v,n[28]=o==null?void 0:o.id,n[29]=o==null?void 0:o.workspaceId,n[30]=l,n[31]=S,n[32]=_,n[33]=w,n[34]=C,n[35]=y,n[36]=h,n[37]=a,n[38]=d,n[39]=N,n[40]=T):T=n[40],A=x.map(T),n[8]=p==null?void 0:p.id,n[9]=i,n[10]=v,n[11]=o==null?void 0:o.id,n[12]=o==null?void 0:o.workspaceId,n[13]=l,n[14]=x,n[15]=S,n[16]=_,n[17]=w,n[18]=C,n[19]=y,n[20]=h,n[21]=a,n[22]=d,n[23]=N,n[24]=A}else A=n[24];let M;return n[41]!==A?(M=g.jsx(g.Fragment,{children:A}),n[41]=A,n[42]=M):M=n[42],M});function Xj(t){return[t.id,t]}function Zj(t){return t!==void 0}function Qj(t,e){return new Date(e.updatedAt).getTime()-new Date(t.updatedAt).getTime()}const Jj=D.forwardRef((t,e)=>{const n=me.c(90),{sessions:i,currentSession:o,currentSessionId:l,streamingSessionId:d,pendingPermissions:a,connected:u,workspaces:f,activeWorkspace:p,allSessions:h,viewMode:y,favoritedWorkspaceIds:S,onCreateSession:C,onResumeSession:w,onCloseSession:_,onReopenSession:v,onDeleteSession:b,onSelectWorkspace:x,onCreateVirtualWorkspace:E,onCreatePhysicalWorkspace:N,onCreateSessionInWorkspace:A,onOpenSettings:M,onOpenMCP:T,onOpenAddServer:j,onServerSwitch:O,onEscape:F}=t,{quickConnections:U,addToQuickConnections:$,removeFromQuickConnections:G,activeServer:K}=Vl();Ku();const V=D.useRef(null),X=D.useRef(null);let Z,I;n[0]!==l?(Z=()=>{X.current=l},I=[l],n[0]=l,n[1]=Z,n[2]=I):(Z=n[1],I=n[2]),D.useEffect(Z,I);let L;n[3]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{var Ve;const Ie=V.current;if(!Ie)return;const ot=Array.from(Ie.querySelectorAll('[data-sidebar="menu-button"]'));if(ot.length===0){Ie.focus();return}const Ce=ot.find(lt=>lt.getAttribute("data-session-id")===X.current);Ce?Ce.focus():(Ve=ot[0])==null||Ve.focus()},n[3]=L):L=n[3];const B=L;let H,P;n[4]===Symbol.for("react.memo_cache_sentinel")?(H=()=>({focusSessionPanel:B}),P=[B],n[4]=H,n[5]=P):(H=n[4],P=n[5]),D.useImperativeHandle(e,H,P);let ee;n[6]!==F?(ee=Ie=>{var lt,Dt,Xt,Ot,Jt;const ot=V.current;if(!ot)return;const Ce=Array.from(ot.querySelectorAll('[data-sidebar="menu-button"]')),Ve=Ce.indexOf(document.activeElement);e:switch(Ie.key){case"ArrowDown":{Ie.preventDefault();const Et=Ve<Ce.length-1?Ve+1:0;(lt=Ce[Et])==null||lt.focus();break e}case"ArrowUp":{Ie.preventDefault();const Et=Ve>0?Ve-1:Ce.length-1;(Dt=Ce[Et])==null||Dt.focus();break e}case"ArrowRight":{const Et=(Xt=document.activeElement)==null?void 0:Xt.parentElement;if(!Et)break e;const vn=Et.querySelector('button[aria-label="Toggle child sessions"]');if(!vn)break e;const Vt=Et.closest("[data-state]");(Vt==null?void 0:Vt.dataset.state)==="closed"&&(Ie.preventDefault(),vn.click());break e}case"ArrowLeft":{const Et=(Ot=document.activeElement)==null?void 0:Ot.parentElement;if(!Et)break e;const vn=Et.querySelector('button[aria-label="Toggle child sessions"]');if(!vn)break e;const Vt=Et.closest("[data-state]");(Vt==null?void 0:Vt.dataset.state)==="open"&&(Ie.preventDefault(),vn.click());break e}case"Enter":{document.activeElement instanceof HTMLButtonElement&&document.activeElement.click();break e}case"Escape":Ie.preventDefault(),(Jt=document.activeElement)==null||Jt.blur(),F==null||F()}},n[6]=F,n[7]=ee):ee=n[7];const ne=ee;let Q,W;if(n[8]!==i){const Ie=i.filter(e8);Q=Ie.filter(t8),W=Ie.filter(n8),n[8]=i,n[9]=Q,n[10]=W}else Q=n[9],W=n[10];let q;n[11]!==Q||n[12]!==W?(q={activeSessions:Q,archivedSessions:W},n[11]=Q,n[12]=W,n[13]=q):q=n[13];const{activeSessions:J,archivedSessions:ie}=q;let ce;n[14]!==(K==null?void 0:K.id)||n[15]!==U?(ce=Ie=>U.some(ot=>ot.workspaceId===Ie&&ot.serverId===(K==null?void 0:K.id)),n[14]=K==null?void 0:K.id,n[15]=U,n[16]=ce):ce=n[16];const ae=ce;let _e;n[17]!==K||n[18]!==$||n[19]!==U||n[20]!==G?(_e=(Ie,ot)=>{if(!K)return;const Ce=U.find(Ve=>Ve.workspaceId===Ie&&Ve.serverId===K.id);Ce?G(Ce.id):$(K.id,K.name,Ie,ot)},n[17]=K,n[18]=$,n[19]=U,n[20]=G,n[21]=_e):_e=n[21];const Ee=_e;let Te;n[22]!==j||n[23]!==O?(Te=g.jsx(wj,{onOpenAddServer:j,onServerSwitch:O}),n[22]=j,n[23]=O,n[24]=Te):Te=n[24];let Be;n[25]!==p||n[26]!==Ee||n[27]!==ae||n[28]!==N||n[29]!==E||n[30]!==x||n[31]!==y||n[32]!==f?(Be=y!=="overview"&&g.jsx(Sj,{workspaces:f,activeWorkspace:p,onSelectWorkspace:x,onCreateVirtualWorkspace:E,onCreatePhysicalWorkspace:N,isWorkspaceFavorited:ae,onToggleFavorite:Ee}),n[25]=p,n[26]=Ee,n[27]=ae,n[28]=N,n[29]=E,n[30]=x,n[31]=y,n[32]=f,n[33]=Be):Be=n[33];let se;n[34]!==Te||n[35]!==Be?(se=g.jsxs("div",{className:"p-2 space-y-2",children:[Te,Be]}),n[34]=Te,n[35]=Be,n[36]=se):se=n[36];let Ye;n[37]!==u||n[38]!==C||n[39]!==y?(Ye=y!=="overview"&&g.jsx(Al,{children:g.jsx(da,{children:g.jsxs(Ml,{onClick:C,disabled:!u,className:"w-full",children:[g.jsx(ql,{className:"size-4","data-icon":"inline-start"}),g.jsx("span",{children:"New Chat"})]})})}),n[37]=u,n[38]=C,n[39]=y,n[40]=Ye):Ye=n[40];let rt;n[41]!==se||n[42]!==Ye?(rt=g.jsxs(Bj,{children:[se,Ye]}),n[41]=se,n[42]=Ye,n[43]=rt):rt=n[43];let nt;n[44]!==J||n[45]!==p||n[46]!==h||n[47]!==ie||n[48]!==u||n[49]!==o||n[50]!==l||n[51]!==S||n[52]!==_||n[53]!==A||n[54]!==b||n[55]!==v||n[56]!==w||n[57]!==x||n[58]!==a||n[59]!==i||n[60]!==d||n[61]!==y||n[62]!==f?(nt=y==="overview"?g.jsx(Yj,{allSessions:h,currentSession:o,currentSessionId:l,streamingSessionId:d,favoritedWorkspaceIds:S,workspaces:f,activeWorkspace:p,onSelectWorkspace:x,onResumeSession:w,onCloseSession:_,onReopenSession:v,onDeleteSession:b,onCreateSessionInWorkspace:A,connected:u,pendingPermissions:a}):g.jsxs(g.Fragment,{children:[J.length>0&&g.jsx(So,{defaultOpen:!0,className:"group/collapsible",children:g.jsxs(If,{children:[g.jsx(Bf,{asChild:!0,children:g.jsxs(wo,{className:"flex items-center justify-between w-full",children:[g.jsxs("span",{className:"flex items-center gap-2",children:[g.jsx(si,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Active"]}),g.jsx(Bn,{variant:"secondary",children:J.length})]})}),g.jsx(Co,{children:g.jsx(zf,{children:g.jsx(Al,{children:J.map(Ie=>g.jsx(zg,{session:Ie,allSessions:i,isActive:(o==null?void 0:o.id)===Ie.id,currentSessionId:l,streamingSessionId:d,pendingPermissions:a,onResumeSession:w,onCloseSession:_,onReopenSession:v,onDeleteSession:b},Ie.id))})})})]})}),ie.length>0&&g.jsx(So,{defaultOpen:!0,className:"group/collapsible",children:g.jsxs(If,{children:[g.jsx(Bf,{asChild:!0,children:g.jsxs(wo,{className:"flex items-center justify-between w-full",children:[g.jsxs("span",{className:"flex items-center gap-2",children:[g.jsx(si,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Archived"]}),g.jsx(Bn,{variant:"secondary",children:ie.length})]})}),g.jsx(Co,{children:g.jsx(zf,{children:g.jsx(Al,{children:ie.map(Ie=>g.jsx(zg,{session:Ie,allSessions:i,isActive:(o==null?void 0:o.id)===Ie.id,currentSessionId:l,streamingSessionId:d,pendingPermissions:a,onResumeSession:w,onCloseSession:_,onReopenSession:v,onDeleteSession:b},Ie.id))})})})]})}),J.length===0&&ie.length===0&&g.jsxs("div",{className:"p-4 text-center text-sm text-muted-foreground",children:["No sessions yet.",g.jsx("br",{}),"Start a new chat to begin."]})]}),n[44]=J,n[45]=p,n[46]=h,n[47]=ie,n[48]=u,n[49]=o,n[50]=l,n[51]=S,n[52]=_,n[53]=A,n[54]=b,n[55]=v,n[56]=w,n[57]=x,n[58]=a,n[59]=i,n[60]=d,n[61]=y,n[62]=f,n[63]=nt):nt=n[63];let Ge;n[64]!==ne||n[65]!==nt?(Ge=g.jsx(Fj,{ref:V,tabIndex:-1,onKeyDown:ne,className:"outline-none",children:nt}),n[64]=ne,n[65]=nt,n[66]=Ge):Ge=n[66];let gt;n[67]!==u?(gt=u?g.jsx(p5,{className:"size-3.5 text-success"}):g.jsx(qx,{className:"size-3.5 text-destructive"}),n[67]=u,n[68]=gt):gt=n[68];const it=u?"Connected":"Disconnected";let Je;n[69]!==it?(Je=g.jsx("span",{className:"text-xs text-muted-foreground",children:it}),n[69]=it,n[70]=Je):Je=n[70];let at;n[71]!==gt||n[72]!==Je?(at=g.jsx(da,{children:g.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[gt,Je]})}),n[71]=gt,n[72]=Je,n[73]=at):at=n[73];let fe,ge;n[74]===Symbol.for("react.memo_cache_sentinel")?(fe=g.jsx(fa,{className:"size-4","data-icon":"inline-start"}),ge=g.jsx("span",{children:"MCP Servers"}),n[74]=fe,n[75]=ge):(fe=n[74],ge=n[75]);let Ae;n[76]!==T?(Ae=g.jsx(da,{children:g.jsxs(Ml,{onClick:T,children:[fe,ge]})}),n[76]=T,n[77]=Ae):Ae=n[77];let Me,Le;n[78]===Symbol.for("react.memo_cache_sentinel")?(Me=g.jsx(Fx,{className:"size-4","data-icon":"inline-start"}),Le=g.jsx("span",{children:"Settings"}),n[78]=Me,n[79]=Le):(Me=n[78],Le=n[79]);let st;n[80]!==M?(st=g.jsx(da,{children:g.jsx("div",{className:"flex items-center gap-1",children:g.jsxs(Ml,{onClick:M,children:[Me,Le]})})}),n[80]=M,n[81]=st):st=n[81];let Se;n[82]!==at||n[83]!==Ae||n[84]!==st?(Se=g.jsx(zj,{className:"pb-4",children:g.jsxs(Al,{children:[at,Ae,st]})}),n[82]=at,n[83]=Ae,n[84]=st,n[85]=Se):Se=n[85];let Ze;return n[86]!==rt||n[87]!==Ge||n[88]!==Se?(Ze=g.jsxs(Ij,{collapsible:"offcanvas",children:[rt,Ge,Se]}),n[86]=rt,n[87]=Ge,n[88]=Se,n[89]=Ze):Ze=n[89],Ze});function e8(t){return!t.parentId}function t8(t){return t.status==="active"}function n8(t){return t.status==="closed"}const r8={".ts":{icon:Ci,color:"text-blue-500"},".tsx":{icon:Ci,color:"text-blue-500"},".js":{icon:Ci,color:"text-yellow-500"},".jsx":{icon:Ci,color:"text-yellow-500"},".json":{icon:Ci,color:"text-yellow-600"},".md":{icon:Ci,color:"text-gray-500"},".css":{icon:Ci,color:"text-purple-500"},".html":{icon:Ci,color:"text-orange-500"}};function DC({entry:t,workspaceId:e,parentPath:n,depth:i,onFileSelect:o,showHidden:l=!0,serverUrl:d,apiToken:a}){const{fetchWithAuth:u}=qu(),[f,p]=D.useState(!1),[h,y]=D.useState([]),[S,C]=D.useState(!1),[w,_]=D.useState(!1),v=n?`${n}/${t.path}`:t.path,b=t.type==="directory",x=async()=>{if(!(w||S)){C(!0);try{const O=await(await u(`/api/workspaces/${e}/files?path=${encodeURIComponent(v)}&showHidden=${l}`,{},{serverUrl:d,token:a})).json();y(O.files||[]),_(!0)}catch(j){console.error("Failed to load children:",j)}finally{C(!1)}}},E=j=>{p(j),j&&b&&x()},N=()=>{!b&&o&&o({...t,path:v})},A=t.extension?r8[t.extension]:null,M=b?f?yg:vo:(A==null?void 0:A.icon)||Ci,T=b?"text-amber-500":(A==null?void 0:A.color)||"text-muted-foreground";return b?g.jsxs(So,{open:f,onOpenChange:E,children:[g.jsx(wo,{asChild:!0,children:g.jsxs("button",{className:ke("flex items-center gap-1.5 w-full min-w-0 overflow-x-hidden px-1.5 py-0.5 rounded text-sm","hover:bg-accent hover:text-accent-foreground","transition-colors text-left"),style:{paddingLeft:`${i*12+6}px`},children:[S?g.jsx(gr,{className:"w-3 h-3 animate-spin shrink-0"}):g.jsx(si,{className:ke("w-3 h-3 shrink-0 transition-transform",f&&"rotate-90")}),g.jsx(M,{className:ke("w-4 h-4 shrink-0",T)}),g.jsx("span",{className:"truncate min-w-0 flex-1",children:t.name})]})}),g.jsx(Co,{children:h.map(j=>g.jsx(DC,{entry:j,workspaceId:e,parentPath:v,depth:i+1,onFileSelect:o,showHidden:l,serverUrl:d,apiToken:a},`${v}/${j.path}`))})]}):g.jsxs("button",{onClick:N,className:ke("flex items-center gap-1.5 w-full min-w-0 overflow-x-hidden px-1.5 py-0.5 rounded text-sm","hover:bg-accent hover:text-accent-foreground","transition-colors text-left"),style:{paddingLeft:`${i*12+6}px`},children:[g.jsx(M,{className:ke("w-4 h-4 shrink-0",T)}),g.jsx("span",{className:"truncate min-w-0 flex-1",children:t.name})]})}function kb({workspaceId:t,serverUrl:e,apiToken:n,onFileSelect:i,showHidden:o=!0}){const[l,d]=D.useState([]),[a,u]=D.useState(""),[f,p]=D.useState(!0),[h,y]=D.useState(null),{fetchWithAuth:S}=qu(),C=D.useCallback(async()=>{p(!0),y(null);try{const w=await S(`/api/workspaces/${t}/files?showHidden=${o}`,{},{serverUrl:e,token:n}),_=await w.json();if(!w.ok)throw new Error(_.message||"Failed to load files");d(_.files),u(_.currentPath)}catch(w){y(w instanceof Error?w.message:"Failed to load files")}finally{p(!1)}},[t,o,S,e,n]);return D.useEffect(()=>{C()},[C]),f?g.jsxs("div",{className:"flex items-center justify-center h-32 text-muted-foreground",children:[g.jsx(gr,{className:"w-4 h-4 animate-spin mr-2"}),"Loading files..."]}):h?g.jsxs("div",{className:"p-4 text-sm text-destructive",children:[h,g.jsx(Pe,{variant:"ghost",size:"sm",onClick:C,className:"ml-2",children:g.jsx(Tl,{className:"w-3 h-3"})})]}):l.length===0?g.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["Empty workspace",g.jsx(Pe,{variant:"ghost",size:"sm",onClick:C,className:"ml-2",children:g.jsx(Tl,{className:"w-3 h-3"})})]}):g.jsxs("div",{className:"flex flex-col h-full min-w-0 overflow-hidden",children:[g.jsxs("div",{className:"flex items-center justify-between min-w-0 overflow-hidden px-3 py-2",children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide truncate min-w-0",children:"Files"}),g.jsx(Pe,{variant:"ghost",size:"icon",className:"h-5 w-5 shrink-0",onClick:C,children:g.jsx(Tl,{className:"w-3 h-3"})})]}),g.jsx(nc,{className:"flex-1 min-h-0 min-w-0",children:g.jsx("div",{className:"px-2 pb-2 min-w-0 overflow-hidden",children:g.jsx("div",{className:"space-y-0.5",children:l.map(w=>g.jsx(DC,{entry:w,workspaceId:t,parentPath:a,depth:0,onFileSelect:i,showHidden:o,serverUrl:e,apiToken:n},w.path))})})})]})}function i8(t){const e=me.c(33),{workspaceId:n,searchQuery:i,selectedIndex:o,onSelect:l,onFilesChange:d,showHidden:a,serverUrl:u,apiToken:f}=t,p=a===void 0?!0:a;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[0]=h):h=e[0];const[y,S]=D.useState(h),[C,w]=D.useState(!1),[_,v]=D.useState(i),{fetchWithAuth:b}=qu(),x=D.useRef(0);let E,N;e[1]!==i?(E=()=>{const K=setTimeout(()=>{v(i)},300);return()=>clearTimeout(K)},N=[i],e[1]=i,e[2]=E,e[3]=N):(E=e[2],N=e[3]),D.useEffect(E,N);let A,M;if(e[4]!==f||e[5]!==_||e[6]!==b||e[7]!==d||e[8]!==u||e[9]!==p||e[10]!==n?(A=()=>{if(!_||_.length<2){S([]),d([]);return}const K=x.current=x.current+1;w(!0);const V=new AbortController;return b(`/api/workspaces/${n}/files?search=${encodeURIComponent(_)}&showHidden=${p}`,{signal:V.signal},{serverUrl:u,token:f}).then(o8).then(X=>{if(K!==x.current)return;const Z=X.files||[];S(Z),d(Z)}).catch(s8).finally(()=>{K===x.current&&w(!1)}),()=>V.abort()},M=[n,_,d,p,b,u,f],e[4]=f,e[5]=_,e[6]=b,e[7]=d,e[8]=u,e[9]=p,e[10]=n,e[11]=A,e[12]=M):(A=e[11],M=e[12]),D.useEffect(A,M),!i||i.length<2){let K;return e[13]===Symbol.for("react.memo_cache_sentinel")?(K=g.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:"Type at least 2 characters to search files..."}),e[13]=K):K=e[13],K}if(C){let K;return e[14]===Symbol.for("react.memo_cache_sentinel")?(K=g.jsxs("div",{className:"flex items-center justify-center p-4 text-muted-foreground",children:[g.jsx(gr,{className:"w-4 h-4 animate-spin mr-2"}),"Searching..."]}),e[14]=K):K=e[14],K}if(y.length===0){let K;return e[15]!==i?(K=g.jsxs("div",{className:"p-2 text-xs text-muted-foreground",children:['No files found matching "',i,'"']}),e[15]=i,e[16]=K):K=e[16],K}let T;if(e[17]!==y||e[18]!==l||e[19]!==o){let K;e[21]!==l||e[22]!==o?(K=(V,X)=>g.jsxs("button",{onClick:()=>l(V),className:ke("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",X===o&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[V.type==="directory"?g.jsx(vo,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}):g.jsx(Ci,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),g.jsx("span",{className:"truncate flex-1",children:V.path}),V.extension&&g.jsx("span",{className:"text-xs text-muted-foreground",children:V.extension})]},V.path),e[21]=l,e[22]=o,e[23]=K):K=e[23],T=y.map(K),e[17]=y,e[18]=l,e[19]=o,e[20]=T}else T=e[20];const j=y.length!==1?"s":"";let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=g.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↑↓"}),e[24]=O):O=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=g.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↵"}),e[25]=F):F=e[25];let U;e[26]===Symbol.for("react.memo_cache_sentinel")?(U=g.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"esc"}),e[26]=U):U=e[26];let $;e[27]!==y.length||e[28]!==j?($=g.jsxs("div",{className:"mt-1 pt-1 border-t text-xs text-muted-foreground px-2",children:[y.length," result",j," •",O," navigate",F," select",U," close"]}),e[27]=y.length,e[28]=j,e[29]=$):$=e[29];let G;return e[30]!==$||e[31]!==T?(G=g.jsxs("div",{className:"p-1",children:[T,$]}),e[30]=$,e[31]=T,e[32]=G):G=e[32],G}function s8(t){t.name!=="AbortError"&&console.error("File search failed:",t)}function o8(t){return t.json()}function a8(t){const e=me.c(40),{workspaceId:n,serverUrl:i,apiToken:o,isOpen:l,onClose:d}=t,a=Wu();if(!n)return null;if(a){let E;e[0]!==d?(E=U=>!U&&d(),e[0]=d,e[1]=E):E=e[1];let N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=g.jsx(Eh,{className:"sr-only",children:g.jsx(Ah,{children:"Files"})}),e[2]=N):N=e[2];let A;e[3]===Symbol.for("react.memo_cache_sentinel")?(A=g.jsx("span",{className:"font-semibold text-sm",children:"Files"}),e[3]=A):A=e[3];let M;e[4]===Symbol.for("react.memo_cache_sentinel")?(M=g.jsx(bs,{className:"w-4 h-4"}),e[4]=M):M=e[4];let T;e[5]!==d?(T=g.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[A,g.jsx(Pe,{variant:"ghost",size:"icon-sm",onClick:d,children:M})]}),e[5]=d,e[6]=T):T=e[6];let j;e[7]!==o||e[8]!==i||e[9]!==n?(j=g.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",children:g.jsx(kb,{workspaceId:n,serverUrl:i,apiToken:o,showHidden:!0},n)}),e[7]=o,e[8]=i,e[9]=n,e[10]=j):j=e[10];let O;e[11]!==T||e[12]!==j?(O=g.jsxs(kh,{side:"right",className:"w-72 p-0 bg-sidebar [&>button]:hidden",children:[N,T,j]}),e[11]=T,e[12]=j,e[13]=O):O=e[13];let F;return e[14]!==l||e[15]!==E||e[16]!==O?(F=g.jsx(Ch,{open:l,onOpenChange:E,children:O}),e[14]=l,e[15]=E,e[16]=O,e[17]=F):F=e[17],F}const u=!l&&"w-0";let f;e[18]!==u?(f=ke("relative w-64 bg-transparent transition-[width] duration-200 ease-linear",u),e[18]=u,e[19]=f):f=e[19];let p;e[20]!==f?(p=g.jsx("div",{className:f}),e[20]=f,e[21]=p):p=e[21];const h=!l&&"translate-x-full";let y;e[22]!==h?(y=ke("fixed right-0 z-10 w-64 bg-sidebar border-l border-border flex flex-col overflow-hidden","transform transition-transform duration-200 ease-linear",h),e[22]=h,e[23]=y):y=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S={top:"env(safe-area-inset-top, 0)",bottom:"env(safe-area-inset-bottom, 0)",height:"calc(100vh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0))"},e[24]=S):S=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=g.jsx("span",{className:"font-semibold text-sm",children:"Files"}),e[25]=C):C=e[25];let w;e[26]===Symbol.for("react.memo_cache_sentinel")?(w=g.jsx(bs,{className:"w-4 h-4"}),e[26]=w):w=e[26];let _;e[27]!==d?(_=g.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[C,g.jsx(Pe,{variant:"ghost",size:"icon-sm",onClick:d,children:w})]}),e[27]=d,e[28]=_):_=e[28];let v;e[29]!==o||e[30]!==i||e[31]!==n?(v=g.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",children:g.jsx(kb,{workspaceId:n,serverUrl:i,apiToken:o,showHidden:!0},n)}),e[29]=o,e[30]=i,e[31]=n,e[32]=v):v=e[32];let b;e[33]!==v||e[34]!==y||e[35]!==_?(b=g.jsxs("div",{className:y,style:S,children:[_,v]}),e[33]=v,e[34]=y,e[35]=_,e[36]=b):b=e[36];let x;return e[37]!==b||e[38]!==p?(x=g.jsxs(g.Fragment,{children:[p,b]}),e[37]=b,e[38]=p,e[39]=x):x=e[39],x}var Ym={exports:{}},Eb;function l8(){return Eb||(Eb=1,(function(t,e){(function(n,i){t.exports=i()})(globalThis,(()=>(()=>{var n={4567:function(d,a,u){var f=this&&this.__decorate||function(b,x,E,N){var A,M=arguments.length,T=M<3?x:N===null?N=Object.getOwnPropertyDescriptor(x,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,x,E,N);else for(var j=b.length-1;j>=0;j--)(A=b[j])&&(T=(M<3?A(T):M>3?A(x,E,T):A(x,E))||T);return M>3&&T&&Object.defineProperty(x,E,T),T},p=this&&this.__param||function(b,x){return function(E,N){x(E,N,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const h=u(9042),y=u(9924),S=u(844),C=u(4725),w=u(2585),_=u(3656);let v=a.AccessibilityManager=class extends S.Disposable{constructor(b,x,E,N){super(),this._terminal=b,this._coreBrowserService=E,this._renderService=N,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let A=0;A<this._terminal.rows;A++)this._rowElements[A]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[A]);if(this._topBoundaryFocusListener=A=>this._handleBoundaryFocus(A,0),this._bottomBoundaryFocusListener=A=>this._handleBoundaryFocus(A,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new y.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((A=>this._handleResize(A.rows)))),this.register(this._terminal.onRender((A=>this._refreshRows(A.start,A.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((A=>this._handleChar(A)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
487
487
|
`)))),this.register(this._terminal.onA11yTab((A=>this._handleTab(A)))),this.register(this._terminal.onKey((A=>this._handleKey(A.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,_.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,S.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(b){for(let x=0;x<b;x++)this._handleChar(" ")}_handleChar(b){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==b&&(this._charsToAnnounce+=b):this._charsToAnnounce+=b,b===`
|
|
488
488
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(b){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(b)||this._charsToConsume.push(b)}_refreshRows(b,x){this._liveRegionDebouncer.refresh(b,x,this._terminal.rows)}_renderRows(b,x){const E=this._terminal.buffer,N=E.lines.length.toString();for(let A=b;A<=x;A++){const M=E.lines.get(E.ydisp+A),T=[],j=(M==null?void 0:M.translateToString(!0,void 0,void 0,T))||"",O=(E.ydisp+A+1).toString(),F=this._rowElements[A];F&&(j.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=j,this._rowColumns.set(F,T)),F.setAttribute("aria-posinset",O),F.setAttribute("aria-setsize",N))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(b,x){const E=b.target,N=this._rowElements[x===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(x===0?"1":`${this._terminal.buffer.lines.length}`)||b.relatedTarget!==N)return;let A,M;if(x===0?(A=E,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(A=this._rowElements.shift(),M=E,this._rowContainer.removeChild(A)),A.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),x===0){const T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else{const T=this._createAccessibilityTreeNode();this._rowElements.push(T),this._rowContainer.appendChild(T)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(x===0?-1:1),this._rowElements[x===0?1:this._rowElements.length-2].focus(),b.preventDefault(),b.stopImmediatePropagation()}_handleSelectionChange(){var j,O;if(this._rowElements.length===0)return;const b=document.getSelection();if(!b)return;if(b.isCollapsed)return void(this._rowContainer.contains(b.anchorNode)&&this._terminal.clearSelection());if(!b.anchorNode||!b.focusNode)return void console.error("anchorNode and/or focusNode are null");let x={node:b.anchorNode,offset:b.anchorOffset},E={node:b.focusNode,offset:b.focusOffset};if((x.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||x.node===E.node&&x.offset>E.offset)&&([x,E]=[E,x]),x.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(x={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(x.node))return;const N=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(N)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:N,offset:(O=(j=N.textContent)==null?void 0:j.length)!=null?O:0}),!this._rowContainer.contains(E.node))return;const A=({node:F,offset:U})=>{const $=F instanceof Text?F.parentNode:F;let G=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(G))return console.warn("row is invalid. Race condition?"),null;const K=this._rowColumns.get($);if(!K)return console.warn("columns is null. Race condition?"),null;let V=U<K.length?K[U]:K.slice(-1)[0]+1;return V>=this._terminal.cols&&(++G,V=0),{row:G,column:V}},M=A(x),T=A(E);if(M&&T){if(M.row>T.row||M.row===T.row&&M.column>=T.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(T.row-M.row)*this._terminal.cols-M.column+T.column)}}_handleResize(b){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let x=this._rowContainer.children.length;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);for(;this._rowElements.length>b;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const b=this._coreBrowserService.mainDocument.createElement("div");return b.setAttribute("role","listitem"),b.tabIndex=-1,this._refreshRowDimensions(b),b}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let b=0;b<this._terminal.rows;b++)this._refreshRowDimensions(this._rowElements[b])}}_refreshRowDimensions(b){b.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=v=f([p(1,w.IInstantiationService),p(2,C.ICoreBrowserService),p(3,C.IRenderService)],v)},3614:(d,a)=>{function u(y){return y.replace(/\r?\n/g,"\r")}function f(y,S){return S?"\x1B[200~"+y+"\x1B[201~":y}function p(y,S,C,w){y=f(y=u(y),C.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(y,!0),S.value=""}function h(y,S,C){const w=C.getBoundingClientRect(),_=y.clientX-w.left-10,v=y.clientY-w.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${_}px`,S.style.top=`${v}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=u,a.bracketTextForPaste=f,a.copyHandler=function(y,S){y.clipboardData&&y.clipboardData.setData("text/plain",S.selectionText),y.preventDefault()},a.handlePasteEvent=function(y,S,C,w){y.stopPropagation(),y.clipboardData&&p(y.clipboardData.getData("text/plain"),S,C,w)},a.paste=p,a.moveTextAreaUnderMouseCursor=h,a.rightClickHandler=function(y,S,C,w,_){h(y,S,C),_&&w.rightClickSelect(y),S.value=w.selectionText,S.select()}},7239:(d,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const f=u(1505);a.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(p,h,y){this._css.set(p,h,y)}getCss(p,h){return this._css.get(p,h)}setColor(p,h,y){this._color.set(p,h,y)}getColor(p,h){return this._color.get(p,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(u,f,p,h){u.addEventListener(f,p,h);let y=!1;return{dispose:()=>{y||(y=!0,u.removeEventListener(f,p,h))}}}},3551:function(d,a,u){var f=this&&this.__decorate||function(v,b,x,E){var N,A=arguments.length,M=A<3?b:E===null?E=Object.getOwnPropertyDescriptor(b,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,b,x,E);else for(var T=v.length-1;T>=0;T--)(N=v[T])&&(M=(A<3?N(M):A>3?N(b,x,M):N(b,x))||M);return A>3&&M&&Object.defineProperty(b,x,M),M},p=this&&this.__param||function(v,b){return function(x,E){b(x,E,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const h=u(3656),y=u(8460),S=u(844),C=u(2585),w=u(4725);let _=a.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(v,b,x,E,N){super(),this._element=v,this._mouseService=b,this._renderService=x,this._bufferService=E,this._linkProviderService=N,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new y.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new y.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)((()=>{var A;this._lastMouseEvent=void 0,(A=this._activeProviderReplies)==null||A.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(v){this._lastMouseEvent=v;const b=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!b)return;this._isMouseOut=!1;const x=v.composedPath();for(let E=0;E<x.length;E++){const N=x[E];if(N.classList.contains("xterm"))break;if(N.classList.contains("xterm-hover"))return}this._lastBufferCell&&b.x===this._lastBufferCell.x&&b.y===this._lastBufferCell.y||(this._handleHover(b),this._lastBufferCell=b)}_handleHover(v){if(this._activeLine!==v.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(v,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,v)||(this._clearCurrentLink(),this._askForLink(v,!0))}_askForLink(v,b){var E,N;this._activeProviderReplies&&b||((E=this._activeProviderReplies)==null||E.forEach((A=>{A==null||A.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let x=!1;for(const[A,M]of this._linkProviderService.linkProviders.entries())b?(N=this._activeProviderReplies)!=null&&N.get(A)&&(x=this._checkLinkProviderResult(A,v,x)):M.provideLinks(v.y,(T=>{var O,F;if(this._isMouseOut)return;const j=T==null?void 0:T.map((U=>({link:U})));(O=this._activeProviderReplies)==null||O.set(A,j),x=this._checkLinkProviderResult(A,v,x),((F=this._activeProviderReplies)==null?void 0:F.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,b){const x=new Set;for(let E=0;E<b.size;E++){const N=b.get(E);if(N)for(let A=0;A<N.length;A++){const M=N[A],T=M.link.range.start.y<v?0:M.link.range.start.x,j=M.link.range.end.y>v?this._bufferService.cols:M.link.range.end.x;for(let O=T;O<=j;O++){if(x.has(O)){N.splice(A--,1);break}x.add(O)}}}}_checkLinkProviderResult(v,b,x){var A;if(!this._activeProviderReplies)return x;const E=this._activeProviderReplies.get(v);let N=!1;for(let M=0;M<v;M++)this._activeProviderReplies.has(M)&&!this._activeProviderReplies.get(M)||(N=!0);if(!N&&E){const M=E.find((T=>this._linkAtPosition(T.link,b)));M&&(x=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!x)for(let M=0;M<this._activeProviderReplies.size;M++){const T=(A=this._activeProviderReplies.get(M))==null?void 0:A.find((j=>this._linkAtPosition(j.link,b)));if(T){x=!0,this._handleNewLink(T);break}}return x}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const b=this._positionFromMouseEvent(v,this._element,this._mouseService);b&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,b)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,b){this._currentLink&&this._lastMouseEvent&&(!v||!b||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=b)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const b=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);b&&this._linkAtPosition(v.link,b)&&(this._currentLink=v,this._currentLink.state={decorations:{underline:v.link.decorations===void 0||v.link.decorations.underline,pointerCursor:v.link.decorations===void 0||v.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,v.link,this._lastMouseEvent),v.link.decorations={},Object.defineProperties(v.link.decorations,{pointerCursor:{get:()=>{var x,E;return(E=(x=this._currentLink)==null?void 0:x.state)==null?void 0:E.decorations.pointerCursor},set:x=>{var E;(E=this._currentLink)!=null&&E.state&&this._currentLink.state.decorations.pointerCursor!==x&&(this._currentLink.state.decorations.pointerCursor=x,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",x))}},underline:{get:()=>{var x,E;return(E=(x=this._currentLink)==null?void 0:x.state)==null?void 0:E.decorations.underline},set:x=>{var E,N,A;(E=this._currentLink)!=null&&E.state&&((A=(N=this._currentLink)==null?void 0:N.state)==null?void 0:A.decorations.underline)!==x&&(this._currentLink.state.decorations.underline=x,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.link,x))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((x=>{if(!this._currentLink)return;const E=x.start===0?0:x.start+1+this._bufferService.buffer.ydisp,N=this._bufferService.buffer.ydisp+1+x.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=N&&(this._clearCurrentLink(E,N),this._lastMouseEvent)){const A=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);A&&this._askForLink(A,!1)}}))))}_linkHover(v,b,x){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(b,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),b.hover&&b.hover(x,b.text)}_fireUnderlineEvent(v,b){const x=v.range,E=this._bufferService.buffer.ydisp,N=this._createLinkUnderlineEvent(x.start.x-1,x.start.y-E-1,x.end.x,x.end.y-E-1,void 0);(b?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(N)}_linkLeave(v,b,x){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(b,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),b.leave&&b.leave(x,b.text)}_linkAtPosition(v,b){const x=v.range.start.y*this._bufferService.cols+v.range.start.x,E=v.range.end.y*this._bufferService.cols+v.range.end.x,N=b.y*this._bufferService.cols+b.x;return x<=N&&N<=E}_positionFromMouseEvent(v,b,x){const E=x.getCoords(v,b,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,b,x,E,N){return{x1:v,y1:b,x2:x,y2:E,cols:this._bufferService.cols,fg:N}}};a.Linkifier=_=f([p(1,w.IMouseService),p(2,w.IRenderService),p(3,C.IBufferService),p(4,w.ILinkProviderService)],_)},9042:(d,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(d,a,u){var f=this&&this.__decorate||function(w,_,v,b){var x,E=arguments.length,N=E<3?_:b===null?b=Object.getOwnPropertyDescriptor(_,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(w,_,v,b);else for(var A=w.length-1;A>=0;A--)(x=w[A])&&(N=(E<3?x(N):E>3?x(_,v,N):x(_,v))||N);return E>3&&N&&Object.defineProperty(_,v,N),N},p=this&&this.__param||function(w,_){return function(v,b){_(v,b,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const h=u(511),y=u(2585);let S=a.OscLinkProvider=class{constructor(w,_,v){this._bufferService=w,this._optionsService=_,this._oscLinkService=v}provideLinks(w,_){var j;const v=this._bufferService.buffer.lines.get(w-1);if(!v)return void _(void 0);const b=[],x=this._optionsService.rawOptions.linkHandler,E=new h.CellData,N=v.getTrimmedLength();let A=-1,M=-1,T=!1;for(let O=0;O<N;O++)if(M!==-1||v.hasContent(O)){if(v.loadCell(O,E),E.hasExtendedAttrs()&&E.extended.urlId){if(M===-1){M=O,A=E.extended.urlId;continue}T=E.extended.urlId!==A}else M!==-1&&(T=!0);if(T||M!==-1&&O===N-1){const F=(j=this._oscLinkService.getLinkData(A))==null?void 0:j.uri;if(F){const U={start:{x:M+1,y:w},end:{x:O+(T||O!==N-1?0:1),y:w}};let $=!1;if(!(x!=null&&x.allowNonHttpProtocols))try{const G=new URL(F);["http:","https:"].includes(G.protocol)||($=!0)}catch{$=!0}$||b.push({text:F,range:U,activate:(G,K)=>x?x.activate(G,K,U):C(0,K),hover:(G,K)=>{var V;return(V=x==null?void 0:x.hover)==null?void 0:V.call(x,G,K,U)},leave:(G,K)=>{var V;return(V=x==null?void 0:x.leave)==null?void 0:V.call(x,G,K,U)}})}T=!1,E.hasExtendedAttrs()&&E.extended.urlId?(M=O,A=E.extended.urlId):(M=-1,A=-1)}}_(b)}};function C(w,_){if(confirm(`Do you want to navigate to ${_}?
|
|
489
489
|
|
package/dist/index.html
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
root.classList.add(mode, scheme);
|
|
39
39
|
})();
|
|
40
40
|
</script>
|
|
41
|
-
<script type="module" crossorigin src="/assets/index-
|
|
41
|
+
<script type="module" crossorigin src="/assets/index-D3Kd9Idv.js"></script>
|
|
42
42
|
<link rel="stylesheet" crossorigin href="/assets/index-Cph2m0Qs.css">
|
|
43
43
|
</head>
|
|
44
44
|
<body>
|