@decocms/mesh 1.0.0 → 1.0.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Cu9USDUK.js → AlertCircle-CctpU08Y.js} +1 -1
- package/dist/client/assets/{ArrowLeft-nKBVB_NL.js → ArrowLeft-DMs-Q5a_.js} +1 -1
- package/dist/client/assets/{CheckCircle-BogvGi-0.js → CheckCircle-gjG4WSw6.js} +1 -1
- package/dist/client/assets/{ChevronDown-B5vWNgW1.js → ChevronDown-o688tr0R.js} +1 -1
- package/dist/client/assets/{Clock-Ck2lYkyl.js → Clock-9q1_LHWv.js} +1 -1
- package/dist/client/assets/{Copy01-BeUF9LPk.js → Copy01-Bos_ARNX.js} +1 -1
- package/dist/client/assets/{CpuChip02-8BkRby_U.js → CpuChip02-DMtVpA_p.js} +1 -1
- package/dist/client/assets/{DotsVertical-CmKPHj4W.js → DotsVertical-DjWbU1pT.js} +1 -1
- package/dist/client/assets/{File06-Cn7JLPIx.js → File06-Bt03vXoe.js} +1 -1
- package/dist/client/assets/{Grid01-4uSGUJjV.js → Grid01-DKsOPPqt.js} +1 -1
- package/dist/client/assets/{Inbox01-C8nofD1D.js → Inbox01-7EuLNj_o.js} +1 -1
- package/dist/client/assets/{InfoCircle-C21KXVBJ.js → InfoCircle-D52jwcjZ.js} +1 -1
- package/dist/client/assets/{Key01-CzDrcb2u.js → Key01-DIAppwaZ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DhNFEAza.js → LinkExternal01-OAVXSkWT.js} +1 -1
- package/dist/client/assets/{Loading01-BUZAT-Ht.js → Loading01-DhMR9Rl3.js} +1 -1
- package/dist/client/assets/{Plus-DTWKiMkv.js → Plus-BoTbvZ3o.js} +1 -1
- package/dist/client/assets/{SearchMd-BXC4Yoz_.js → SearchMd-Cle1NAvW.js} +1 -1
- package/dist/client/assets/{Trash01-KhsmIXrl.js → Trash01-CObqwAuB.js} +1 -1
- package/dist/client/assets/{Upload01-Dm3ykMHj.js → Upload01-BIarHoYq.js} +1 -1
- package/dist/client/assets/{X-BFstV52u.js → X-BS6wMyAf.js} +1 -1
- package/dist/client/assets/{XClose-OisY7Sog.js → XClose-CanbUWiZ.js} +1 -1
- package/dist/client/assets/{alert-dialog-Ck-TQRXx.js → alert-dialog-BZCR78KJ.js} +1 -1
- package/dist/client/assets/{auth-catchall-DDvXFYk4.js → auth-catchall-B7-v9vo-.js} +1 -1
- package/dist/client/assets/{auth-DB_JGgAS.js → auth-l7FoQBwy.js} +1 -1
- package/dist/client/assets/{avatar-CqnXtnOZ.js → avatar-tMh-ed4_.js} +1 -1
- package/dist/client/assets/{badge-RGvdF-cd.js → badge-ZGSDRM2V.js} +1 -1
- package/dist/client/assets/{button-Chm7HSn5.js → button-DRbSSzMo.js} +1 -1
- package/dist/client/assets/{card-BVamKRXq.js → card-yDshgaNk.js} +1 -1
- package/dist/client/assets/{checkbox-BMbqVqRo.js → checkbox-CVaEe_Kv.js} +1 -1
- package/dist/client/assets/collection-detail-DipzpGBX.js +1 -0
- package/dist/client/assets/{collection-display-button-DDw_0fW6.js → collection-display-button-CxHAeMlJ.js} +1 -1
- package/dist/client/assets/{collection-header-BVYMmoel.js → collection-header-Bbr_EelX.js} +1 -1
- package/dist/client/assets/{collection-page-BoS9hpji.js → collection-page-BB_fkZHl.js} +1 -1
- package/dist/client/assets/{collection-search-CBHWh6W9.js → collection-search-CAT-KwFV.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CGsO_-78.js → collection-table-wrapper-CpATqDDy.js} +1 -1
- package/dist/client/assets/{connection-card-D6fhK6Cn.js → connection-card-BHTh8x40.js} +1 -1
- package/dist/client/assets/{connection-detail-ClFH3Tdf.js → connection-detail-D__R0L9n.js} +1 -1
- package/dist/client/assets/{connections-BtC-4KRY.js → connections-BbW7JMdD.js} +1 -1
- package/dist/client/assets/{core-BiybLldu.js → core-LRyg4NIV.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-D3ZZuPXS.js → create-organization-dialog-Tqv9FyFB.js} +1 -1
- package/dist/client/assets/{deco-chat-skeleton-DHRag8GN.js → deco-chat-skeleton-BWkV1MzQ.js} +9 -9
- package/dist/client/assets/{dialog-kXtxooG_.js → dialog-BBqtAKNq.js} +1 -1
- package/dist/client/assets/{dropdown-menu-MeaPHHuN.js → dropdown-menu-ZynV4CKZ.js} +1 -1
- package/dist/client/assets/{error-boundary-m5kquR9K.js → error-boundary-77v8_xoc.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BSn-ydRW.js → extract-connection-data-Cqx4p3NY.js} +1 -1
- package/dist/client/assets/{form-BBS_Tp5l.js → form-CKfv-8nJ.js} +1 -1
- package/dist/client/assets/{formatDistanceToNow-Dkl3nWpl.js → formatDistanceToNow-D6EC-Mne.js} +1 -1
- package/dist/client/assets/{gateway-detail-B6IgcRfH.js → gateway-detail-C3YoTd2-.js} +1 -1
- package/dist/client/assets/{gateways-Bu8MP7ql.js → gateways-DD9oFefb.js} +1 -1
- package/dist/client/assets/{home-BYCoW2D_.js → home-RnslI0RJ.js} +1 -1
- package/dist/client/assets/{index-BZz7aGs7.js → index-BpYm0xnO.js} +1 -1
- package/dist/client/assets/{index-hySmljwG.js → index-BwdoZ6Iz.js} +1 -1
- package/dist/client/assets/index-CL5fDzg4.css +1 -0
- package/dist/client/assets/{index-C4a1DvcM.js → index-DPFREQMN.js} +2 -2
- package/dist/client/assets/{index-RS2MPOun.js → index-aOeElpLt.js} +1 -1
- package/dist/client/assets/{input-DCV4VviT.js → input-jqtlIgj3.js} +1 -1
- package/dist/client/assets/json-CAM1x_8F.js +1 -0
- package/dist/client/assets/{json-syntax-highlighter-VMspUwuH.js → json-syntax-highlighter-BDiX9ikS.js} +2 -2
- package/dist/client/assets/{layout-BkDVhV_I.js → layout-CkdsMZBx.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-Bx9tA9px.js → lazy-highlighter-CqCOmbZ8.js} +1 -1
- package/dist/client/assets/{localstorage-keys-G21128-2.js → localstorage-keys-Ffqwn37f.js} +1 -1
- package/dist/client/assets/{login-DEwqVT25.js → login-B57O8j1V.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Cm2UNUay.js → mcp-oauth-DxMvAHRa.js} +1 -1
- package/dist/client/assets/{members-BpGlve-L.js → members-BWnzV6ih.js} +1 -1
- package/dist/client/assets/{monitoring-DHEto-A6.js → monitoring-DIiGLrrO.js} +1 -1
- package/dist/client/assets/{oauth-callback-DchNKQy2.js → oauth-callback-CwLtKUf9.js} +1 -1
- package/dist/client/assets/{page-DGoTXd70.js → page-TnUbYFnb.js} +1 -1
- package/dist/client/assets/{popover-Cx3pFfUQ.js → popover-aib-y-v5.js} +1 -1
- package/dist/client/assets/prism-light-6y0IYHxK.js +1 -0
- package/dist/client/assets/{resource-tabs-n23Yoxcd.js → resource-tabs-BA7yau3f.js} +1 -1
- package/dist/client/assets/{schema-DIY49r7a.js → schema-BnBjhQOg.js} +1 -1
- package/dist/client/assets/{select-BXHiOY7b.js → select-CQ6166et.js} +1 -1
- package/dist/client/assets/{settings-BwVTvZ32.js → settings-B4dEHs8J.js} +1 -1
- package/dist/client/assets/shell-layout-B00KNNmL.js +17 -0
- package/dist/client/assets/{spinner-zi1IadXF.js → spinner-CfV2XsUQ.js} +1 -1
- package/dist/client/assets/{store-app-detail-BswrVEFL.js → store-app-detail-ClCjW4tC.js} +1 -1
- package/dist/client/assets/{store-Bu-y0GHn.js → store-j9hTSK4h.js} +1 -1
- package/dist/client/assets/{switch-C8nDXRDi.js → switch-DfV4Hg4D.js} +1 -1
- package/dist/client/assets/{textarea-BA6caASm.js → textarea-rD1H1oiO.js} +1 -1
- package/dist/client/assets/{tools-list-Cw4QW2l7.js → tools-list-BtqQwWMd.js} +1 -1
- package/dist/client/assets/{tooltip-DZ8PMo3S.js → tooltip-T6rRsM2k.js} +1 -1
- package/dist/client/assets/{types-DsEr-_hk.js → types-D-N921FV.js} +1 -1
- package/dist/client/assets/{use-binding-C1zXgwae.js → use-binding-CWUVDcMm.js} +1 -1
- package/dist/client/assets/{use-connection-8aFd9ZgQ.js → use-connection-BObBSW3a.js} +1 -1
- package/dist/client/assets/{use-connection-resources-BaWWtVSI.js → use-connection-resources-BN_6g4of.js} +1 -1
- package/dist/client/assets/{use-gateway-BGsZlt6a.js → use-gateway-BnSOdKih.js} +1 -1
- package/dist/client/assets/{use-list-state-DhJWwg48.js → use-list-state-BXrmE2tY.js} +1 -1
- package/dist/client/assets/{use-mcp-BJzX7M7c.js → use-mcp-feMLqae5.js} +1 -1
- package/dist/client/assets/{use-members-BNSWYzmJ.js → use-members-pxuBBuU5.js} +1 -1
- package/dist/client/assets/{use-mobile-BQAr1bEF.js → use-mobile-BWmDV7SV.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CAOHB7nk.js → use-organization-settings-B_v59XiE.js} +1 -1
- package/dist/client/assets/{use-tool-call-Dxebi6Uq.js → use-tool-call-DJqpt8-4.js} +1 -1
- package/dist/client/assets/useQuery-BDJatAa4.js +1 -0
- package/dist/client/assets/utils-BDWLM78M.js +1 -0
- package/dist/client/assets/{well-known-mcp-DizRQm94.js → well-known-mcp-r4sGkJCM.js} +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/collection-detail-UyMhNT0c.js +0 -1
- package/dist/client/assets/index-MyldRbGR.css +0 -1
- package/dist/client/assets/json-CtxcuNHM.js +0 -1
- package/dist/client/assets/prism-light-DhG4KyCm.js +0 -1
- package/dist/client/assets/shell-layout-BqZsnuW0.js +0 -17
- package/dist/client/assets/useQuery-39cprZL6.js +0 -1
- package/dist/client/assets/utils-BXNVuJET.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,a6 as Pe,L as rt,z as _e,j as d,a7 as st,H as lt,a8 as Ie,bl as at,a2 as k,a9 as it,B as j,E as N,a5 as $,aa as ct,am as Ee,bj as dt,a4 as ut,ab as pt,ae as ft,ac as mt,ad as ht,af as vt,ag as gt,ah as xt,ai as St,c as ee}from"./index-C4a1DvcM.js";import{V as wt,i as yt}from"./tooltip-DZ8PMo3S.js";import{t as Re}from"./ChevronDown-B5vWNgW1.js";import{c as oe}from"./utils-BXNVuJET.js";function Ne(n,[e,t]){return Math.min(t,Math.max(e,n))}var Ct=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],J="Select",[de,ue,It]=at(J),[ne]=lt(J,[It,Pe]),pe=Pe(),[Tt,G]=ne(J),[_t,Nt]=ne(J),je=n=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:r,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:w,required:y,form:S}=n,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[U,M]=c.useState(!1),re=rt(u),[P,O]=_e({prop:o,defaultProp:r??!1,onChange:i,caller:J}),[F,q]=_e({prop:s,defaultProp:l,onChange:a,caller:J}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(st,{...p,children:d.jsxs(Tt,{required:y,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:Ie(),value:F,onValueChange:q,open:P,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(_t,{scope:n.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:w,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=c.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:o=!1,...r}=n,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[g,w,y]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),y()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(it,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...r,ref:a,onClick:N(r.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(r.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(r.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(v&&p.key===" ")&&Ct.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,children:i,placeholder:s="",...l}=n,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var Pt="SelectIcon",ke=c.forwardRef((n,e)=>{const{__scopeSelect:t,children:o,...r}=n;return d.jsx(j.span,{"aria-hidden":!0,...r,ref:e,children:o||"▼"})});ke.displayName=Pt;var Et="SelectPortal",Le=n=>d.jsx(ct,{asChild:!0,...n});Le.displayName=Et;var Q="SelectContent",Be=c.forwardRef((n,e)=>{const t=G(Q,n.__scopeSelect),[o,r]=c.useState();if($(()=>{r(new DocumentFragment)},[]),!t.open){const i=o;return i?Ee.createPortal(d.jsx(Ve,{scope:n.__scopeSelect,children:d.jsx(de.Slot,{scope:n.__scopeSelect,children:d.jsx("div",{children:n.children})})}),i):null}return d.jsx(He,{...n,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=ht("SelectContent.RemoveScroll"),He=c.forwardRef((n,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=n,m=G(Q,t),[x,U]=c.useState(null),[M,re]=c.useState(null),P=k(e,f=>U(f)),[O,F]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return pt(x)},[x]),ft();const E=c.useCallback(f=>{const[T,...R]=B().map(_=>_.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const _ of f)if(_===I||(_?.scrollIntoView({block:"nearest"}),_===T&&M&&(M.scrollTop=0),_===b&&M&&(M.scrollTop=M.scrollHeight),_?.focus(),document.activeElement!==I))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=ot(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const b=!H.current&&!R;(m.value!==void 0&&m.value===T||b)&&(F(f),b&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const b=!H.current&&!R;(m.value!==void 0&&m.value===T||b)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(mt,{as:jt,allowPinchZoom:!0,children:d.jsx(vt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:N(r,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(gt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:N(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,_=b.indexOf(I);b=b.slice(_+1)}setTimeout(()=>E(b)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:o,...r}=n,i=G(Q,t),s=Y(Q,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,P=>h(P)),w=ue(t),y=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const P=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,_=F.left-I,X=P.left-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,_=window.innerWidth-F.right-I,X=window.innerWidth-P.right-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const _=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+_+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>y.current=!0)}},[w,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[U,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(P=>{P&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...r,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((n,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:r=A,...i}=n,s=pe(t);return d.jsx(xt,{...s,...i,ref:e,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.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)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Ue=c.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:o,...r}=n,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.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:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:N(r.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=s;if(w?.current&&g){const y=Math.abs(a.current-h.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+y,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=Ie();return d.jsx(Dt,{scope:t,id:r,children:d.jsx(j.div,{role:"group","aria-labelledby":r,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=kt(We,t);return d.jsx(j.div,{id:r.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((n,e)=>{const{__scopeSelect:t,value:o,disabled:r=!1,textValue:i,...s}=n,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[w,y]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,r)),p=Ie(),v=c.useRef("touch"),C=()=>{r||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")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 d.jsx(Vt,{scope:t,value:o,disabled:r,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:r,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>y(!0)),onBlur:N(s.onBlur,()=>y(!1)),onClick:N(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{v.current=m.pointerType,r?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(bt.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,...i}=n,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Nt(le,t),[h,g]=c.useState(null),w=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),y=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:y},a.value),[a.disabled,a.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:w}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var ye="SelectScrollUpButton",Xe=c.forwardRef((n,e)=>{const t=Y(ye,n.__scopeSelect),o=Te(ye,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=ye;var Ce="SelectScrollDownButton",Ze=c.forwardRef((n,e)=>{const t=Y(Ce,n.__scopeSelect),o=Te(Ce,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=Ce;var Je=c.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:o,...r}=n,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...r,ref:e,style:{flexShrink:0,...r.style},onPointerDown:N(r.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(r.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(r.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var be="SelectArrow",Ut=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=pe(t),i=G(be,t),s=Y(be,t);return i.open&&s.position==="popper"?d.jsx(St,{...r,...o,ref:e}):null});Ut.displayName=be;var Ft="SelectBubbleInput",Qe=c.forwardRef(({__scopeSelect:n,value:e,...t},o)=>{const r=c.useRef(null),i=k(o,r),s=dt(e);return c.useEffect(()=>{const l=r.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...wt,...t.style},ref:i,defaultValue:e})});Qe.displayName=Ft;function et(n){return n===""||n===void 0}function tt(n){const e=ut(n),t=c.useRef(""),o=c.useRef(0),r=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,r,i]}function ot(n,e,t){const r=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?n.indexOf(t):-1;let s=Wt(n,Math.max(i,0));r.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return a!==t?a:void 0}function Wt(n,e){return n.map((t,o)=>n[(e+o)%n.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;const nt=({size:n=24,color:e="currentColor",...t})=>c.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},c.createElement("path",{d:"m18 15-6-6-6 6"}));nt.displayName="ChevronUp";function co(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(n){const e=ee.c(13);let t,o,r,i;e[0]!==n?({className:o,size:i,children:t,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-10 data-[size=sm]:h-8 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...r,children:[t,a]}),e[8]=t,e[9]=r,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(n){const e=ee.c(20);let t,o,r,i;e[0]!==n?({className:o,children:t,position:i,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?"popper":i,l=s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let a;e[5]!==o||e[6]!==l?(a=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl border shadow-md",l,o),e[5]=o,e[6]=l,e[7]=a):a=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=d.jsx(no,{}),e[8]=u):u=e[8];const h=s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let g;e[9]!==h?(g=oe("p-1",h),e[9]=h,e[10]=g):g=e[10];let w;e[11]!==t||e[12]!==g?(w=d.jsx(Zt,{className:g,children:t}),e[11]=t,e[12]=g,e[13]=w):w=e[13];let y;e[14]===Symbol.for("react.memo_cache_sentinel")?(y=d.jsx(ro,{}),e[14]=y):y=e[14];let S;return e[15]!==s||e[16]!==r||e[17]!==a||e[18]!==w?(S=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:a,position:s,...r,children:[u,w,y]})}),e[15]=s,e[16]=r,e[17]=a,e[18]=w,e[19]=S):S=e[19],S}function mo(n){const e=ee.c(16);let t,o,r,i;e[0]!==n?({className:o,children:t,hideCheck:i,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-xl py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(yt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==r||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...r,children:[a,u]}),e[11]=r,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(nt,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}function ro(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}export{co as S,po as a,uo as b,fo as c,mo as d,Ne as e,nt as n};
|
|
1
|
+
import{r as c,a6 as Pe,L as rt,z as _e,j as d,a7 as st,H as lt,a8 as Ie,bl as at,a2 as k,a9 as it,B as j,E as N,a5 as $,aa as ct,am as Ee,bj as dt,a4 as ut,ab as pt,ae as ft,ac as mt,ad as ht,af as vt,ag as gt,ah as xt,ai as St,c as ee}from"./index-DPFREQMN.js";import{V as wt,i as yt}from"./tooltip-T6rRsM2k.js";import{t as Re}from"./ChevronDown-o688tr0R.js";import{c as oe}from"./utils-BDWLM78M.js";function Ne(n,[e,t]){return Math.min(t,Math.max(e,n))}var Ct=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],J="Select",[de,ue,It]=at(J),[ne]=lt(J,[It,Pe]),pe=Pe(),[Tt,G]=ne(J),[_t,Nt]=ne(J),je=n=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:r,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:w,required:y,form:S}=n,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[U,M]=c.useState(!1),re=rt(u),[P,O]=_e({prop:o,defaultProp:r??!1,onChange:i,caller:J}),[F,q]=_e({prop:s,defaultProp:l,onChange:a,caller:J}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(st,{...p,children:d.jsxs(Tt,{required:y,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:Ie(),value:F,onValueChange:q,open:P,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(_t,{scope:n.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:w,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=c.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:o=!1,...r}=n,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[g,w,y]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),y()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(it,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...r,ref:a,onClick:N(r.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(r.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(r.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(v&&p.key===" ")&&Ct.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,children:i,placeholder:s="",...l}=n,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var Pt="SelectIcon",ke=c.forwardRef((n,e)=>{const{__scopeSelect:t,children:o,...r}=n;return d.jsx(j.span,{"aria-hidden":!0,...r,ref:e,children:o||"▼"})});ke.displayName=Pt;var Et="SelectPortal",Le=n=>d.jsx(ct,{asChild:!0,...n});Le.displayName=Et;var Q="SelectContent",Be=c.forwardRef((n,e)=>{const t=G(Q,n.__scopeSelect),[o,r]=c.useState();if($(()=>{r(new DocumentFragment)},[]),!t.open){const i=o;return i?Ee.createPortal(d.jsx(Ve,{scope:n.__scopeSelect,children:d.jsx(de.Slot,{scope:n.__scopeSelect,children:d.jsx("div",{children:n.children})})}),i):null}return d.jsx(He,{...n,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=ht("SelectContent.RemoveScroll"),He=c.forwardRef((n,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=n,m=G(Q,t),[x,U]=c.useState(null),[M,re]=c.useState(null),P=k(e,f=>U(f)),[O,F]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return pt(x)},[x]),ft();const E=c.useCallback(f=>{const[T,...R]=B().map(_=>_.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const _ of f)if(_===I||(_?.scrollIntoView({block:"nearest"}),_===T&&M&&(M.scrollTop=0),_===b&&M&&(M.scrollTop=M.scrollHeight),_?.focus(),document.activeElement!==I))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=ot(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const b=!H.current&&!R;(m.value!==void 0&&m.value===T||b)&&(F(f),b&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const b=!H.current&&!R;(m.value!==void 0&&m.value===T||b)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(mt,{as:jt,allowPinchZoom:!0,children:d.jsx(vt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:N(r,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(gt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:N(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,_=b.indexOf(I);b=b.slice(_+1)}setTimeout(()=>E(b)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:o,...r}=n,i=G(Q,t),s=Y(Q,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,P=>h(P)),w=ue(t),y=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const P=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,_=F.left-I,X=P.left-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,_=window.innerWidth-F.right-I,X=window.innerWidth-P.right-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const _=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+_+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>y.current=!0)}},[w,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[U,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(P=>{P&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...r,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((n,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:r=A,...i}=n,s=pe(t);return d.jsx(xt,{...s,...i,ref:e,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.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)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Ue=c.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:o,...r}=n,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.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:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:N(r.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=s;if(w?.current&&g){const y=Math.abs(a.current-h.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+y,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=Ie();return d.jsx(Dt,{scope:t,id:r,children:d.jsx(j.div,{role:"group","aria-labelledby":r,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=kt(We,t);return d.jsx(j.div,{id:r.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((n,e)=>{const{__scopeSelect:t,value:o,disabled:r=!1,textValue:i,...s}=n,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[w,y]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,r)),p=Ie(),v=c.useRef("touch"),C=()=>{r||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")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 d.jsx(Vt,{scope:t,value:o,disabled:r,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:r,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>y(!0)),onBlur:N(s.onBlur,()=>y(!1)),onClick:N(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{v.current=m.pointerType,r?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(bt.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,...i}=n,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Nt(le,t),[h,g]=c.useState(null),w=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),y=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:y},a.value),[a.disabled,a.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:w}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var ye="SelectScrollUpButton",Xe=c.forwardRef((n,e)=>{const t=Y(ye,n.__scopeSelect),o=Te(ye,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=ye;var Ce="SelectScrollDownButton",Ze=c.forwardRef((n,e)=>{const t=Y(Ce,n.__scopeSelect),o=Te(Ce,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=Ce;var Je=c.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:o,...r}=n,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...r,ref:e,style:{flexShrink:0,...r.style},onPointerDown:N(r.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(r.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(r.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var be="SelectArrow",Ut=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=pe(t),i=G(be,t),s=Y(be,t);return i.open&&s.position==="popper"?d.jsx(St,{...r,...o,ref:e}):null});Ut.displayName=be;var Ft="SelectBubbleInput",Qe=c.forwardRef(({__scopeSelect:n,value:e,...t},o)=>{const r=c.useRef(null),i=k(o,r),s=dt(e);return c.useEffect(()=>{const l=r.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...wt,...t.style},ref:i,defaultValue:e})});Qe.displayName=Ft;function et(n){return n===""||n===void 0}function tt(n){const e=ut(n),t=c.useRef(""),o=c.useRef(0),r=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,r,i]}function ot(n,e,t){const r=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?n.indexOf(t):-1;let s=Wt(n,Math.max(i,0));r.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return a!==t?a:void 0}function Wt(n,e){return n.map((t,o)=>n[(e+o)%n.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;const nt=({size:n=24,color:e="currentColor",...t})=>c.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},c.createElement("path",{d:"m18 15-6-6-6 6"}));nt.displayName="ChevronUp";function co(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(n){const e=ee.c(13);let t,o,r,i;e[0]!==n?({className:o,size:i,children:t,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-10 data-[size=sm]:h-8 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...r,children:[t,a]}),e[8]=t,e[9]=r,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(n){const e=ee.c(20);let t,o,r,i;e[0]!==n?({className:o,children:t,position:i,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?"popper":i,l=s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let a;e[5]!==o||e[6]!==l?(a=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl border shadow-md",l,o),e[5]=o,e[6]=l,e[7]=a):a=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=d.jsx(no,{}),e[8]=u):u=e[8];const h=s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let g;e[9]!==h?(g=oe("p-1",h),e[9]=h,e[10]=g):g=e[10];let w;e[11]!==t||e[12]!==g?(w=d.jsx(Zt,{className:g,children:t}),e[11]=t,e[12]=g,e[13]=w):w=e[13];let y;e[14]===Symbol.for("react.memo_cache_sentinel")?(y=d.jsx(ro,{}),e[14]=y):y=e[14];let S;return e[15]!==s||e[16]!==r||e[17]!==a||e[18]!==w?(S=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:a,position:s,...r,children:[u,w,y]})}),e[15]=s,e[16]=r,e[17]=a,e[18]=w,e[19]=S):S=e[19],S}function mo(n){const e=ee.c(16);let t,o,r,i;e[0]!==n?({className:o,children:t,hideCheck:i,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-xl py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(yt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==r||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...r,children:[a,u]}),e[11]=r,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(nt,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}function ro(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}export{co as S,po as a,uo as b,fo as c,mo as d,Ne as e,nt as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as q,Z as D,r as U,y as B,x as K,j as s,v as P,c as $,t as y,K as I,a as Q,w as F}from"./index-
|
|
1
|
+
import{f as q,Z as D,r as U,y as B,x as K,j as s,v as P,c as $,t as y,K as I,a as Q,w as F}from"./index-DPFREQMN.js";import{C as T}from"./collection-header-Bbr_EelX.js";import{C as A}from"./collection-page-BB_fkZHl.js";import{u as H}from"./tooltip-T6rRsM2k.js";import{u as Y,B as N}from"./button-DRbSSzMo.js";import{a as Z,F as R,b as O,c as E,d as L,f as k,e as G}from"./form-CKfv-8nJ.js";import{I as M}from"./input-jqtlIgj3.js";import{i as J}from"./Upload01-BIarHoYq.js";import{i as V}from"./X-BS6wMyAf.js";import"./collection-display-button-CxHAeMlJ.js";import"./dropdown-menu-ZynV4CKZ.js";import"./Grid01-DKsOPPqt.js";import"./utils-BDWLM78M.js";const W=P({name:F().min(1,"Name is required").max(255,"Name is too long"),slug:F().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:F().optional()});function X(C){const e=$.c(24),{value:n,onChange:o,name:d}=C,a=U.useRef(null);let m;e[0]!==o?(m=w=>{const z=w.target.files?.[0];if(z){if(z.size>2097152){y.error("Image must be smaller than 2MB");return}const c=new FileReader;c.onerror=()=>{const b=c.error;console.error("FileReader error:",b),y.error(b?.message||"Failed to read image file. Please try again."),a.current&&(a.current.value="")},c.onloadend=()=>{if(c.readyState===FileReader.DONE&&c.result){const b=c.result;o(b)}},c.readAsDataURL(z)}},e[0]=o,e[1]=m):m=e[1];const p=m;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{a.current?.click()},e[2]=i):i=e[2];const t=i;let l;e[3]!==o?(l=w=>{w.stopPropagation(),o("")},e[3]=o,e[4]=l):l=e[4];const r=l;let u;e[5]!==p?(u=s.jsx("input",{type:"file",ref:a,className:"hidden",accept:"image/*",onChange:p}),e[5]=p,e[6]=u):u=e[6];let g;e[7]!==r||e[8]!==d||e[9]!==n?(g=n?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:n,alt:d||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:r,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(V,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:t,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(J,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=r,e[8]=d,e[9]=n,e[10]=g):g=e[10];const S=n?"Change Logo":"Upload Logo";let x;e[11]!==S?(x=s.jsx(N,{type:"button",variant:"outline",size:"sm",onClick:t,className:"mb-2",children:S}),e[11]=S,e[12]=x):x=e[12];let h;e[13]!==r||e[14]!==n?(h=n&&s.jsx(N,{type:"button",variant:"ghost",size:"sm",onClick:r,className:"ml-2",children:"Remove"}),e[13]=r,e[14]=n,e[15]=h):h=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=j):j=e[16];let f;e[17]!==x||e[18]!==h?(f=s.jsxs("div",{className:"flex-1",children:[x,h,j]}),e[17]=x,e[18]=h,e[19]=f):f=e[19];let v;return e[20]!==f||e[21]!==u||e[22]!==g?(v=s.jsxs("div",{className:"flex items-start gap-4",children:[u,g,f]}),e[20]=f,e[21]=u,e[22]=g,e[23]=v):v=e[23],v}function ue(){const C=q(),{org:e}=H(),n=D(),[o,d]=U.useState(!1),a=B({resolver:K(W),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),m=Y({mutationFn:async t=>{const l={name:t.name,slug:t.slug};t.logo!==void 0&&(l.logo=t.logo||null);const r=await Q.organization.update({organizationId:e.id,data:l});if(r?.error)throw new Error(r.error.message||"Failed to update organization");return r},onSuccess:t=>{n.invalidateQueries({queryKey:I.organizations()}),n.invalidateQueries({queryKey:I.activeOrganization(e.slug)}),y.success("Organization settings updated successfully"),t?.data?.slug&&t.data.slug!==e.slug&&C({to:"/$org/settings",params:{org:t.data.slug}})},onError:t=>{y.error(t instanceof Error?t.message:"Failed to update organization")},onSettled:()=>{d(!1)}}),p=t=>{d(!0),m.mutate(t)},i=a.formState.isDirty;return s.jsxs(A,{children:[s.jsx(T,{title:"Settings"}),s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-5 max-w-2xl",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),s.jsx(Z,{...a,children:s.jsxs("form",{onSubmit:a.handleSubmit(p),className:"space-y-6",children:[s.jsx(R,{control:a.control,name:"name",render:({field:t})=>s.jsxs(O,{children:[s.jsx(E,{children:"Organization Name"}),s.jsx(L,{children:s.jsx(M,{placeholder:"My Organization",...t,disabled:o})}),s.jsx(k,{})]})}),s.jsx(R,{control:a.control,name:"slug",render:({field:t})=>s.jsxs(O,{children:[s.jsx(E,{children:"Organization Slug"}),s.jsx(L,{children:s.jsx(M,{placeholder:"my-organization",...t,disabled:o,onChange:l=>{const r=l.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");t.onChange(r)}})}),s.jsx(G,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(k,{})]})}),s.jsx(R,{control:a.control,name:"logo",render:({field:t})=>s.jsxs(O,{children:[s.jsx(E,{children:"Logo"}),s.jsx(L,{children:s.jsx(X,{value:t.value,onChange:t.onChange,name:a.watch("name")})}),s.jsx(k,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(N,{type:"submit",disabled:!i||o,className:"min-w-24",children:o?"Saving...":"Save Changes"}),i&&s.jsx(N,{type:"button",variant:"outline",onClick:()=>a.reset(),disabled:o,children:"Cancel"})]})]})})]})})})})})]})}export{ue as default};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{r as x,c as N,j as r,e as es,f as ct,a as qe,t as ts,R as ns,T as ss,D as os,C as as,P as rs,g as ls,O as is,h as cs,i as ds,k as us,d as qt,l as fs,G as ms,U as ps,m as hs,S as Yt,n as xs,o as gs,N as bs,p as vs,q as ys,K as Ss,s as Xt}from"./index-DPFREQMN.js";import{i as js,E as ws}from"./SearchMd-Cle1NAvW.js";import{u as Cs,I as At,n as Ns}from"./use-connection-BObBSW3a.js";import{u as Ge,L as Ye}from"./localstorage-keys-Ffqwn37f.js";import{u as Xe,T as zs,a as Is,b as _s,c as ks,L as Dt,i as Ps,P as $s,O as Ms}from"./tooltip-T6rRsM2k.js";import{B as we}from"./button-DRbSSzMo.js";import{c as B}from"./utils-BDWLM78M.js";import{i as Nt}from"./CpuChip02-DMtVpA_p.js";import{i as Es}from"./Loading01-DhMR9Rl3.js";import{s as Rs}from"./Plus-BoTbvZ3o.js";import{i as rt}from"./X-BS6wMyAf.js";import{u as As,a as Ds,b as Ts,c as Ls,d as Os,C as te,e as Hs,I as Bs,D as Us,f as Gs,g as Ws,h as Vs,i as Fs,j as Ks,k as Zs}from"./deco-chat-skeleton-BWkV1MzQ.js";import{P as Jt,a as Qt,b as en}from"./popover-aib-y-v5.js";import{s as qs}from"./Clock-9q1_LHWv.js";import{s as Ys}from"./Trash01-CObqwAuB.js";import{u as Xs}from"./use-binding-CWUVDcMm.js";import{E as _t}from"./error-boundary-77v8_xoc.js";import{i as Js}from"./File06-Bt03vXoe.js";import{u as Je}from"./use-mobile-BWmDV7SV.js";import{u as tn,a as Qs}from"./use-organization-settings-B_v59XiE.js";import{C as eo}from"./create-organization-dialog-Tqv9FyFB.js";import{I as to}from"./input-jqtlIgj3.js";import{A as We}from"./avatar-tMh-ed4_.js";import{c as no}from"./Grid01-DKsOPPqt.js";import{D as so,a as oo,b as ao,c as ro,d as Tt}from"./dropdown-menu-ZynV4CKZ.js";import{a as lo}from"./Copy01-Bos_ARNX.js";import{n as Lt}from"./LinkExternal01-OAVXSkWT.js";import{D as nn,a as sn,b as on,c as an,d as rn}from"./dialog-BBqtAKNq.js";import"./useQuery-BDJatAa4.js";import"./textarea-rD1H1oiO.js";import"./select-CQ6166et.js";import"./ChevronDown-o688tr0R.js";import"./use-gateway-BnSOdKih.js";import"./AlertCircle-CctpU08Y.js";import"./connection-card-BHTh8x40.js";import"./card-yDshgaNk.js";import"./spinner-CfV2XsUQ.js";import"./InfoCircle-D52jwcjZ.js";import"./auth-l7FoQBwy.js";import"./alert-dialog-BZCR78KJ.js";import"./form-CKfv-8nJ.js";const ln=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));ln.displayName="BarChart10";const cn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M15 21v-5.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 14 13.96 14 13.4 14h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 14.76 9 15.04 9 15.6V21M3 7a3 3 0 0 0 6 0 3 3 0 1 0 6 0 3 3 0 1 0 6 0M6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3H6.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21Z"}));cn.displayName="Building02";const dn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));dn.displayName="ChevronSelectorVertical";const un=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M12 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7-14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));un.displayName="DotsGrid";const fn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M2 12h20M2 12c0 5.523 4.477 10 10 10M2 12C2 6.477 6.477 2 12 2m10 10c0 5.523-4.477 10-10 10m10-10c0-5.523-4.477-10-10-10m0 0a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10"}));fn.displayName="Globe01";const mn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M9 21v-7.4c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 12 10.04 12 10.6 12h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 12.76 15 13.04 15 13.6V21M11.018 2.764 4.235 8.039c-.453.353-.68.53-.843.75a2 2 0 0 0-.318.65C3 9.704 3 9.991 3 10.565V17.8c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8v-7.235c0-.574 0-.861-.074-1.126a2.002 2.002 0 0 0-.318-.65c-.163-.22-.39-.397-.843-.75l-6.783-5.275c-.351-.273-.527-.41-.72-.462a1 1 0 0 0-.523 0c-.194.052-.37.189-.721.462Z"}));mn.displayName="Home02";const pn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));pn.displayName="LayoutRight";const hn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));hn.displayName="LogOut01";const xn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));xn.displayName="Mail01";const gn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),x.createElement("path",{d:"M18.727 14.727a1.5 1.5 0 0 0 .3 1.655l.055.054a1.816 1.816 0 0 1 0 2.573 1.818 1.818 0 0 1-2.573 0l-.055-.055a1.5 1.5 0 0 0-1.654-.3 1.5 1.5 0 0 0-.91 1.373v.155a1.818 1.818 0 1 1-3.636 0V20.1a1.5 1.5 0 0 0-.981-1.373 1.5 1.5 0 0 0-1.655.3l-.054.055a1.818 1.818 0 0 1-3.106-1.287 1.818 1.818 0 0 1 .533-1.286l.054-.055a1.5 1.5 0 0 0 .3-1.654 1.5 1.5 0 0 0-1.372-.91h-.155a1.818 1.818 0 1 1 0-3.636H3.9a1.5 1.5 0 0 0 1.373-.981 1.5 1.5 0 0 0-.3-1.655l-.055-.054A1.818 1.818 0 1 1 7.491 4.99l.054.054a1.5 1.5 0 0 0 1.655.3h.073a1.5 1.5 0 0 0 .909-1.372v-.155a1.818 1.818 0 0 1 3.636 0V3.9a1.499 1.499 0 0 0 .91 1.373 1.5 1.5 0 0 0 1.654-.3l.054-.055a1.817 1.817 0 0 1 2.573 0 1.819 1.819 0 0 1 0 2.573l-.055.054a1.5 1.5 0 0 0-.3 1.655v.073a1.5 1.5 0 0 0 1.373.909h.155a1.818 1.818 0 0 1 0 3.636H20.1a1.499 1.499 0 0 0-1.373.91Z"}));gn.displayName="Settings01";const bn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M5.316 19.438A4.001 4.001 0 0 1 9 17h6a4.001 4.001 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));bn.displayName="UserCircle";const vn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));vn.displayName="Users01";function kt(){const t=N.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=Ye.decoChatOpen(),t[0]=e):e=t[0];const[n,s]=Ge(e,io);let o;return t[1]!==n||t[2]!==s?(o=[n,s],t[1]=n,t[2]=s,t[3]=o):o=t[3],o}function io(t){return!!(t??!1)}function co(t){const e=N.c(14),{title:n,description:s,avatar:o,avatarNode:a,className:l}=t,i=n===void 0?"Start a conversation":n;let c;e[0]!==l?(c=B("flex flex-col items-center justify-center gap-4 p-0 text-center",l),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==o||e[3]!==a?(d=a||o&&r.jsx("img",{src:o,alt:"Chat avatar",className:"size-[60px] rounded-[18px] border-[1.875px] border-border/10"}),e[2]=o,e[3]=a,e[4]=d):d=e[4];let m;e[5]!==i?(m=i&&r.jsx("h3",{className:"text-xl font-medium text-foreground",children:i}),e[5]=i,e[6]=m):m=e[6];let f;e[7]!==s?(f=s&&r.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:s}),e[7]=s,e[8]=f):f=e[8];let u;return e[9]!==c||e[10]!==d||e[11]!==m||e[12]!==f?(u=r.jsxs("div",{className:c,children:[d,m,f]}),e[9]=c,e[10]=d,e[11]=m,e[12]=f,e[13]=u):u=e[13],u}const yn=()=>crypto.randomUUID(),Sn=x.createContext(null);function uo(t){const e=N.c(15),{children:n}=t,{locator:s}=Xe(),o=As(),[a,l]=Ge(Ye.threadManagerState(s)+":active-id",fo);let i;e[0]!==l||e[1]!==o?(i=p=>{const v=p?.id||crypto.randomUUID(),b=new Date().toISOString(),g={id:v,title:p?.title||"",created_at:p?.created_at||b,updated_at:p?.updated_at||b,hidden:p?.hidden??!1};return o.insert.mutate(g),l(v),g},e[0]=l,e[1]=o,e[2]=i):i=e[2];const c=i;let d;e[3]!==a||e[4]!==l||e[5]!==o?(d=p=>{o.update.mutate({id:p,updates:{hidden:!0,updated_at:new Date().toISOString()}}),a===p&&l(yn())},e[3]=a,e[4]=l,e[5]=o,e[6]=d):d=e[6];const m=d;let f;e[7]!==a||e[8]!==c||e[9]!==m||e[10]!==l?(f={activeThreadId:a,createThread:c,setActiveThreadId:l,hideThread:m},e[7]=a,e[8]=c,e[9]=m,e[10]=l,e[11]=f):f=e[11];const u=f;let h;return e[12]!==n||e[13]!==u?(h=r.jsx(Sn.Provider,{value:u,children:n}),e[12]=n,e[13]=u,e[14]=h):h=e[14],h}function fo(t){return t||yn()}function mo(){const t=x.useContext(Sn);if(!t)throw new Error("useChat must be used within a ChatProvider");return t}function po(t){const e=new Date(t),s=new Date().getTime()-e.getTime(),o=Math.floor(s/6e4),a=Math.floor(s/36e5);return o<1?"now":o<60?`${o}m`:`${a}h`}function ho(t){const e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate()),s=new Date(n.getTime()-864e5),o=new Date(n.getTime()-7*864e5),a=new Date(n.getTime()-30*864e5),l=[],i=[],c=[],d=[],m=[];for(const u of t){const h=new Date(u.updated_at);h>=n?l.push(u):h>=s?i.push(u):h>=o?c.push(u):h>=a?d.push(u):m.push(u)}const f=[];return l.length>0&&f.push({label:"Today",threads:l,showRelativeTime:!0}),i.length>0&&f.push({label:"Yesterday",threads:i,showRelativeTime:!1}),c.length>0&&f.push({label:"7 days ago",threads:c,showRelativeTime:!1}),d.length>0&&f.push({label:"30 days ago",threads:d,showRelativeTime:!1}),m.length>0&&f.push({label:"Older",threads:m,showRelativeTime:!1}),f}function xo(t){const e=N.c(36),{threads:n,activeThreadId:s,onSelectThread:o,onRemoveThread:a,onOpen:l}=t,[i,c]=x.useState("");let d,m,f,u,h,p,v,b,g;if(e[0]!==s||e[1]!==l||e[2]!==a||e[3]!==o||e[4]!==i||e[5]!==n){const I=i.trim()?n.filter($=>($.title||"New chat").toLowerCase().includes(i.toLowerCase())):n,C=ho(I);let j;e[15]!==l?(j=$=>{$?l?.():c("")},e[15]=l,e[16]=j):j=e[16];const O=j;m=Jt,b=O,e[17]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx(Qt,{asChild:!0,children:r.jsx("button",{type:"button",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"Chat history",children:r.jsx(qs,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})}),e[17]=g):g=e[17],d=en,h="end",p="w-80 p-0";let E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E=r.jsx(js,{size:16,className:"text-muted-foreground shrink-0"}),e[18]=E):E=e[18];let A;e[19]===Symbol.for("react.memo_cache_sentinel")?(A=$=>c($.target.value),e[19]=A):A=e[19],e[20]!==i?(v=r.jsx("div",{className:"border-b",children:r.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[E,r.jsx("input",{type:"text",placeholder:"Search chats...",value:i,onChange:A,className:"flex-1 border-0 shadow-none focus:outline-none px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[20]=i,e[21]=v):v=e[21],f="max-h-[300px] overflow-y-auto",u=I.length===0?r.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:i.trim()?"No chats found":"No chats yet"}):C.map(($,D)=>r.jsxs("div",{children:[D>0&&r.jsx("div",{className:"border-t mx-3"}),r.jsx("div",{className:"px-3 py-1",children:r.jsx("span",{className:"text-xs font-medium text-muted-foreground tracking-wide",children:$.label})}),$.threads.map(L=>{const K=L.id===s;return r.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 hover:bg-accent cursor-pointer group ${K?"bg-accent/50":""}`,onClick:()=>o(L.id),children:[r.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[r.jsx("span",{className:"text-sm truncate",children:L.title||"New chat"}),r.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:K?"current":$.showRelativeTime?po(L.updated_at):null})]}),r.jsx("button",{type:"button",onClick:H=>{H.stopPropagation(),a(L.id)},className:"opacity-0 cursor-pointer group/trash group-hover:opacity-100 p-1 hover:bg-destructive/10 rounded transition-opacity",title:"Remove chat",children:r.jsx(Ys,{size:14,className:"text-muted-foreground group-hover/trash:text-destructive"})})]},L.id)})]},$.label)),e[0]=s,e[1]=l,e[2]=a,e[3]=o,e[4]=i,e[5]=n,e[6]=d,e[7]=m,e[8]=f,e[9]=u,e[10]=h,e[11]=p,e[12]=v,e[13]=b,e[14]=g}else d=e[6],m=e[7],f=e[8],u=e[9],h=e[10],p=e[11],v=e[12],b=e[13],g=e[14];let S;e[22]!==f||e[23]!==u?(S=r.jsx("div",{className:f,children:u}),e[22]=f,e[23]=u,e[24]=S):S=e[24];let w;e[25]!==d||e[26]!==h||e[27]!==p||e[28]!==v||e[29]!==S?(w=r.jsxs(d,{align:h,className:p,children:[v,S]}),e[25]=d,e[26]=h,e[27]=p,e[28]=v,e[29]=S,e[30]=w):w=e[30];let z;return e[31]!==m||e[32]!==b||e[33]!==g||e[34]!==w?(z=r.jsxs(m,{onOpenChange:b,children:[g,w]}),e[31]=m,e[32]=b,e[33]=g,e[34]=w,e[35]=z):z=e[35],z}function go(t){const e=/\/[^/]+\/mcps\/([^/]+)\/([^/]+)\/([^/]+)/,n=t.match(e);return n&&n[1]&&n[2]&&n[3]?{connectionId:decodeURIComponent(n[1]),collectionName:decodeURIComponent(n[2]),itemId:decodeURIComponent(n[3])}:{connectionId:null,collectionName:null,itemId:null}}function bo(){const t=N.c(2),e=es();let n;t[0]!==e.location.pathname?(n=go(e.location.pathname),t[0]=e.location.pathname,t[1]=n):n=t[1];const{connectionId:s,collectionName:o,itemId:a}=n;return`You are an AI assistant running in an MCP Mesh environment.
|
|
2
|
+
|
|
3
|
+
## About MCP Mesh
|
|
4
|
+
The Model Context Protocol (MCP) Mesh allows users to connect external MCP servers and expose their capabilities through gateways. Each gateway provides access to a curated set of tools from connected MCP servers.
|
|
5
|
+
|
|
6
|
+
## Important Notes
|
|
7
|
+
- All tool calls are logged and audited for security and compliance
|
|
8
|
+
- You have access to the tools exposed through the selected gateway
|
|
9
|
+
- MCPs may expose resources that users can browse and edit
|
|
10
|
+
|
|
11
|
+
## Current Editing Context
|
|
12
|
+
${s?`- Connection ID: ${s}`:""}
|
|
13
|
+
${o?`- Collection Name: ${o}`:""}
|
|
14
|
+
${a?`- Item ID: ${a}`:""}
|
|
15
|
+
|
|
16
|
+
Help the user understand and work with this resource.
|
|
17
|
+
`}const vo="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function yo(t){const e=N.c(3),{gatewayId:n,onSelect:s}=t,{data:o}=Hs(n);if(o.length===0)return null;let a;return e[0]!==s||e[1]!==o?(a=r.jsx(Bs,{prompts:o,onSelect:s,className:"mt-6"}),e[0]=s,e[1]=o,e[2]=a):a=e[2],a}function So(){const t=N.c(120),{org:e,locator:n}=Xe(),{slug:s}=e,[,o]=kt(),a=ct(),{data:l}=qe.useSession(),i=l?.user,{createThread:c,activeThreadId:d,setActiveThreadId:m,hideThread:f}=mo(),{threads:u,refetch:h}=Ds(),p=Ts(),v=Ls(),b=Cs();let g;t[0]!==b?(g={connections:b,binding:"LLMS"},t[0]=b,t[1]=g):g=t[1];const[S]=Xs(g),w=!!S,z=p.length>0,I=w&&z;let C;t[2]!==n?(C=Ye.chatSelectedModel(n),t[2]=n,t[3]=C):C=t[3];const[j,O]=Ge(C,Co),[E,A]=Ge(`${n}:selected-gateway`,wo),$=v[0];let D;t[4]!==$||t[5]!==j?(D=j??($?{id:$.id,connectionId:$.connectionId}:null),t[4]=$,t[5]=j,t[6]=D):D=t[6];const L=D,K=p[0]?.id,H=E?.gatewayId??K;let F;if(t[7]!==H||t[8]!==p){let G;t[10]!==H?(G=le=>le.id===H,t[10]=H,t[11]=G):G=t[11],F=p.find(G),t[7]=H,t[8]=p,t[9]=F}else F=t[9];const V=F;let ee;if(t[12]!==L?.connectionId||t[13]!==L?.id||t[14]!==v){let G;t[16]!==L?.connectionId||t[17]!==L?.id?(G=le=>le.id===L?.id&&le.connectionId===L?.connectionId,t[16]=L?.connectionId,t[17]=L?.id,t[18]=G):G=t[18],ee=v.find(G),t[12]=L?.connectionId,t[13]=L?.id,t[14]=v,t[15]=ee}else ee=t[15];const X=ee,re=bo();let q;t[19]!==c?(q=G=>c({id:G.id,title:G.title}),t[19]=c,t[20]=q):q=t[20];let Q;t[21]!==d||t[22]!==re||t[23]!==q?(Q={threadId:d,systemPrompt:re,onCreateThread:q},t[21]=d,t[22]=re,t[23]=q,t[24]=Q):Q=t[24];const y=Os(Q);let P;t[25]!==d||t[26]!==y||t[27]!==V||t[28]!==X||t[29]!==i?.image||t[30]!==i?.name?(P=async G=>{if(!X){ts.error("No model configured");return}const le={created_at:new Date().toISOString(),thread_id:d,model:{id:X.id,connectionId:X.connectionId,provider:X.provider??void 0},gateway:V?{id:V.id}:void 0,user:{avatar:i?.image??void 0,name:i?.name??"you"}};await y.sendMessage(G,le)},t[25]=d,t[26]=y,t[27]=V,t[28]=X,t[29]=i?.image,t[30]=i?.name,t[31]=P):P=t[31];const M=P;let k;t[32]!==O?(k=G=>{O({id:G.id,connectionId:G.connectionId})},t[32]=O,t[33]=k):k=t[33];const _=k;if(!I){let G,le;!w&&!z?(G="Connect your providers",le="Connect an LLM provider and create a gateway to unlock AI-powered features."):w?(G="No gateways configured",le="Create a gateway to expose your MCP tools to the chat."):(G="No model provider connected",le="Connect to a model provider to unlock AI-powered features.");let et;t[34]===Symbol.for("react.memo_cache_sentinel")?(et=r.jsxs(te.Header.Left,{children:[r.jsx("img",{src:vo,alt:"deco chat",className:"size-5 rounded"}),r.jsx("span",{className:"text-sm font-medium",children:"deco chat"})]}),t[34]=et):et=t[34];let Re;t[35]!==o?(Re=()=>o(!1),t[35]=o,t[36]=Re):Re=t[36];let tt;t[37]===Symbol.for("react.memo_cache_sentinel")?(tt=r.jsx(rt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[37]=tt):tt=t[37];let Ae;t[38]!==Re?(Ae=r.jsxs(te.Header,{children:[et,r.jsx(te.Header.Right,{children:r.jsx("button",{type:"button",onClick:Re,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:tt})})]}),t[38]=Re,t[39]=Ae):Ae=t[39];let De;t[40]!==w||t[41]!==a||t[42]!==s?(De=()=>a({to:w?"/$org/gateways":"/$org/mcps",params:{org:s},search:w?void 0:{action:"create"}}),t[40]=w,t[41]=a,t[42]=s,t[43]=De):De=t[43];const vt=w?"Create gateway":"Add connection";let Te;t[44]!==De||t[45]!==vt?(Te=r.jsx(we,{variant:"outline",onClick:De,children:vt}),t[44]=De,t[45]=vt,t[46]=Te):Te=t[46];let Le;t[47]!==le||t[48]!==Te||t[49]!==G?(Le=r.jsx(te.Main,{className:"flex flex-col items-center",children:r.jsx(te.EmptyState,{children:r.jsx(ws,{title:G,description:le,actions:Te})})}),t[47]=le,t[48]=Te,t[49]=G,t[50]=Le):Le=t[50];let nt;return t[51]!==Ae||t[52]!==Le?(nt=r.jsxs(te,{children:[Ae,Le]}),t[51]=Ae,t[52]=Le,t[53]=nt):nt=t[53],nt}let R;t[54]!==y.messages?(R=y.messages.filter(jo),t[54]=y.messages,t[55]=R):R=t[55];const U=R,Z=V?.icon,oe=V?.title||"deco chat";let ne;t[56]===Symbol.for("react.memo_cache_sentinel")?(ne=r.jsx(Nt,{size:12}),t[56]=ne):ne=t[56];let W;t[57]!==Z||t[58]!==oe?(W=r.jsx(At,{icon:Z,name:oe,size:"xs",fallbackIcon:ne}),t[57]=Z,t[58]=oe,t[59]=W):W=t[59];const se=V?.title||"deco chat";let ce;t[60]!==se?(ce=r.jsx("span",{className:"text-sm font-medium",children:se}),t[60]=se,t[61]=ce):ce=t[61];let ue;t[62]!==W||t[63]!==ce?(ue=r.jsxs(te.Header.Left,{children:[W,ce]}),t[62]=W,t[63]=ce,t[64]=ue):ue=t[64];let me;t[65]!==c?(me=()=>c(),t[65]=c,t[66]=me):me=t[66];let J;t[67]===Symbol.for("react.memo_cache_sentinel")?(J=r.jsx(Rs,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[67]=J):J=t[67];let pe;t[68]!==me?(pe=r.jsx("button",{type:"button",onClick:me,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"New chat",children:J}),t[68]=me,t[69]=pe):pe=t[69];let ge;t[70]!==h?(ge=()=>h(),t[70]=h,t[71]=ge):ge=t[71];let de;t[72]!==d||t[73]!==f||t[74]!==m||t[75]!==ge||t[76]!==u?(de=r.jsx(xo,{threads:u,activeThreadId:d,onSelectThread:m,onRemoveThread:f,onOpen:ge}),t[72]=d,t[73]=f,t[74]=m,t[75]=ge,t[76]=u,t[77]=de):de=t[77];let he;t[78]!==o?(he=()=>o(!1),t[78]=o,t[79]=he):he=t[79];let Ne;t[80]===Symbol.for("react.memo_cache_sentinel")?(Ne=r.jsx(rt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[80]=Ne):Ne=t[80];let ze;t[81]!==he?(ze=r.jsx("button",{type:"button",onClick:he,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:Ne}),t[81]=he,t[82]=ze):ze=t[82];let Ie;t[83]!==pe||t[84]!==de||t[85]!==ze?(Ie=r.jsxs(te.Header.Right,{children:[pe,de,ze]}),t[83]=pe,t[84]=de,t[85]=ze,t[86]=Ie):Ie=t[86];let _e;t[87]!==ue||t[88]!==Ie?(_e=r.jsxs(te.Header,{children:[ue,Ie]}),t[87]=ue,t[88]=Ie,t[89]=_e):_e=t[89];let ke;t[90]!==y.messages||t[91]!==y.status||t[92]!==H||t[93]!==M||t[94]!==U.length||t[95]!==V?.description||t[96]!==V?.icon||t[97]!==V?.title?(ke=r.jsx(te.Main,{children:U.length===0?r.jsx(te.EmptyState,{children:r.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[r.jsx(co,{title:V?.title||"Ask deco chat",description:V?.description??"Ask anything about configuring model providers or using MCP Mesh.",avatarNode:r.jsx(At,{icon:V?.icon,name:V?.title||"deco chat",size:"lg",fallbackIcon:r.jsx(Nt,{size:32}),className:"size-[60px]! rounded-[18px]!"})}),H&&r.jsx(_t,{fallback:null,children:r.jsx(x.Suspense,{fallback:r.jsx("div",{className:"flex justify-center",children:r.jsx(Es,{size:20,className:"animate-spin text-muted-foreground"})}),children:r.jsx(yo,{gatewayId:H,onSelect:G=>{M(G.description??G.name)}})})},H)]})}):r.jsx(te.Messages,{messages:y.messages,status:y.status,minHeightOffset:240})}),t[90]=y.messages,t[91]=y.status,t[92]=H,t[93]=M,t[94]=U.length,t[95]=V?.description,t[96]=V?.icon,t[97]=V?.title,t[98]=ke):ke=t[98];const ht=v.length===0||!L,xt=y.status==="submitted"||y.status==="streaming",gt=v.length===0?"Add an LLM binding connection to start chatting":"Ask anything or @ for context";let Pe;t[99]!==A?(Pe=G=>{G&&A({gatewayId:G})},t[99]=A,t[100]=Pe):Pe=t[100];let $e;t[101]!==H||t[102]!==Pe?($e=r.jsx(te.Input.GatewaySelector,{disabled:!1,selectedGatewayId:H,onGatewayChange:Pe}),t[101]=H,t[102]=Pe,t[103]=$e):$e=t[103];const bt=L??void 0;let Me;t[104]!==_||t[105]!==bt?(Me=r.jsx(te.Input.ModelSelector,{disabled:!1,selectedModel:bt,onModelChange:_}),t[104]=_,t[105]=bt,t[106]=Me):Me=t[106];let Ee;t[107]!==y.messages||t[108]!==y.stop||t[109]!==M||t[110]!==ht||t[111]!==xt||t[112]!==gt||t[113]!==$e||t[114]!==Me?(Ee=r.jsx(te.Footer,{children:r.jsx("div",{children:r.jsxs(te.Input,{onSubmit:M,onStop:y.stop,disabled:ht,isStreaming:xt,placeholder:gt,usageMessages:y.messages,children:[$e,Me]})})}),t[107]=y.messages,t[108]=y.stop,t[109]=M,t[110]=ht,t[111]=xt,t[112]=gt,t[113]=$e,t[114]=Me,t[115]=Ee):Ee=t[115];let Qe;return t[116]!==_e||t[117]!==ke||t[118]!==Ee?(Qe=r.jsxs(te,{children:[_e,ke,Ee]}),t[116]=_e,t[117]=ke,t[118]=Ee,t[119]=Qe):Qe=t[119],Qe}function jo(t){return t.role!=="system"}function wo(){return null}function Co(t){return t??null}function No(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=r.jsx(ns,{"data-slot":"sheet",...n}),e[2]=n,e[3]=s):s=e[3],s}function zo(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=r.jsx(rs,{"data-slot":"sheet-portal",...n}),e[2]=n,e[3]=s):s=e[3],s}function Io(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=B("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx(is,{"data-slot":"sheet-overlay",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function _o(t){const e=N.c(17);let n,s,o,a;e[0]!==t?({className:s,children:n,side:a,...o}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=o,e[4]=a):(n=e[1],s=e[2],o=e[3],a=e[4]);const l=a===void 0?"right":a;let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(Io,{}),e[5]=i):i=e[5];const c=l==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",d=l==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",m=l==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",f=l==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let u;e[6]!==s||e[7]!==c||e[8]!==d||e[9]!==m||e[10]!==f?(u=B("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",c,d,m,f,s),e[6]=s,e[7]=c,e[8]=d,e[9]=m,e[10]=f,e[11]=u):u=e[11];let h;e[12]===Symbol.for("react.memo_cache_sentinel")?(h=r.jsxs(ls,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[r.jsx(rt,{className:"size-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=h):h=e[12];let p;return e[13]!==n||e[14]!==o||e[15]!==u?(p=r.jsxs(zo,{children:[i,r.jsxs(as,{"data-slot":"sheet-content",className:u,...o,children:[n,h]})]}),e[13]=n,e[14]=o,e[15]=u,e[16]=p):p=e[16],p}function ko(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=B("flex flex-col gap-1.5 p-4",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("div",{"data-slot":"sheet-header",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function Po(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=B("text-foreground font-semibold",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx(ss,{"data-slot":"sheet-title",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function $o(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=B("text-muted-foreground text-sm",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx(os,{"data-slot":"sheet-description",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function jn(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=B("bg-accent animate-pulse rounded-md",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("div",{"data-slot":"skeleton",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}const Mo="sidebar_state",Eo=3600*24*7,Ro="16rem",Ao="18rem",Do="3rem",To="b",wn=x.createContext(null);function Pt(){const t=x.useContext(wn);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Lo(t){const e=N.c(21),{defaultOpen:n,open:s,onOpenChange:o,children:a}=t,l=n===void 0?!0:n,i=Je(),[c,d]=x.useState(!1),[m,f]=x.useState(l),u=s??m;let h;e[0]!==u||e[1]!==o?(h=O=>{const E=typeof O=="function"?O(u):O;o?o(E):f(E),document.cookie=`${Mo}=${E}; path=/; max-age=${Eo}`},e[0]=u,e[1]=o,e[2]=h):h=e[2];const p=h;let v;e[3]!==i||e[4]!==p?(v=()=>i?d(Ho):p(Oo),e[3]=i,e[4]=p,e[5]=v):v=e[5];const b=v;let g,S;e[6]!==b?(g=()=>{const O=E=>{if(E.key===To&&(E.metaKey||E.ctrlKey)){const A=E.target;if(A.tagName==="INPUT"||A.tagName==="TEXTAREA"||A.isContentEditable)return;E.preventDefault(),b()}};return globalThis.addEventListener("keydown",O),()=>globalThis.removeEventListener("keydown",O)},S=[b],e[6]=b,e[7]=g,e[8]=S):(g=e[7],S=e[8]),x.useEffect(g,S);const w=u?"expanded":"collapsed";let z;e[9]!==i||e[10]!==u||e[11]!==c||e[12]!==p||e[13]!==w||e[14]!==b?(z={state:w,open:u,setOpen:p,isMobile:i,openMobile:c,setOpenMobile:d,toggleSidebar:b},e[9]=i,e[10]=u,e[11]=c,e[12]=p,e[13]=w,e[14]=b,e[15]=z):z=e[15];const I=z;let C;e[16]!==a?(C=r.jsx(Is,{delayDuration:0,children:a}),e[16]=a,e[17]=C):C=e[17];let j;return e[18]!==I||e[19]!==C?(j=r.jsx(wn.Provider,{value:I,children:C}),e[18]=I,e[19]=C,e[20]=j):j=e[20],j}function Oo(t){return!t}function Ho(t){return!t}function Bo(t){const e=N.c(14);let n,s,o,a;e[0]!==t?({className:s,style:a,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=o,e[4]=a):(n=e[1],s=e[2],o=e[3],a=e[4]);let l;e[5]!==a?(l={"--sidebar-width":Ro,"--sidebar-width-icon":Do,...a},e[5]=a,e[6]=l):l=e[6];const i=l;let c;e[7]!==s?(c=B("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",s),e[7]=s,e[8]=c):c=e[8];let d;return e[9]!==n||e[10]!==o||e[11]!==i||e[12]!==c?(d=r.jsx("div",{"data-slot":"sidebar-wrapper",style:i,className:c,...o,children:n}),e[9]=n,e[10]=o,e[11]=i,e[12]=c,e[13]=d):d=e[13],d}function Uo(t){const e=N.c(46);let n,s,o,a,l,i;e[0]!==t?({side:a,variant:l,collapsible:i,className:s,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=l,e[6]=i):(n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],i=e[6]);const c=a===void 0?"left":a,d=l===void 0?"sidebar":l,m=i===void 0?"offcanvas":i,{isMobile:f,state:u,openMobile:h,setOpenMobile:p}=Pt();if(m==="none"){let E;e[7]!==s?(E=B("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),e[7]=s,e[8]=E):E=e[8];let A;return e[9]!==n||e[10]!==o||e[11]!==E?(A=r.jsx("div",{"data-slot":"sidebar",className:E,...o,children:n}),e[9]=n,e[10]=o,e[11]=E,e[12]=A):A=e[12],A}if(f){let E;e[13]===Symbol.for("react.memo_cache_sentinel")?(E={"--sidebar-width":Ao},e[13]=E):E=e[13];let A;e[14]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsxs(ko,{className:"sr-only",children:[r.jsx(Po,{children:"Sidebar"}),r.jsx($o,{children:"Displays the mobile sidebar."})]}),e[14]=A):A=e[14];let $;e[15]!==n?($=r.jsx("div",{className:"flex h-full w-full flex-col",children:n}),e[15]=n,e[16]=$):$=e[16];let D;e[17]!==c||e[18]!==$?(D=r.jsxs(_o,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:E,side:c,children:[A,$]}),e[17]=c,e[18]=$,e[19]=D):D=e[19];let L;return e[20]!==h||e[21]!==o||e[22]!==p||e[23]!==D?(L=r.jsx(No,{open:h,onOpenChange:p,...o,children:D}),e[20]=h,e[21]=o,e[22]=p,e[23]=D,e[24]=L):L=e[24],L}const v=u==="collapsed"?m:"",b=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let g;e[25]!==b?(g=B("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",b),e[25]=b,e[26]=g):g=e[26];let S;e[27]!==g?(S=r.jsx("div",{"data-slot":"sidebar-gap",className:g}),e[27]=g,e[28]=S):S=e[28];const w=c==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",z=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let I;e[29]!==s||e[30]!==w||e[31]!==z?(I=B("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",w,z,s),e[29]=s,e[30]=w,e[31]=z,e[32]=I):I=e[32];let C;e[33]!==n?(C=r.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border py-2 flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:n}),e[33]=n,e[34]=C):C=e[34];let j;e[35]!==o||e[36]!==I||e[37]!==C?(j=r.jsx("div",{"data-slot":"sidebar-container",className:I,...o,children:C}),e[35]=o,e[36]=I,e[37]=C,e[38]=j):j=e[38];let O;return e[39]!==c||e[40]!==u||e[41]!==j||e[42]!==v||e[43]!==S||e[44]!==d?(O=r.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":u,"data-collapsible":v,"data-variant":d,"data-side":c,"data-slot":"sidebar",children:[S,j]}),e[39]=c,e[40]=u,e[41]=j,e[42]=v,e[43]=S,e[44]=d,e[45]=O):O=e[45],O}function Go(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=B("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("main",{"data-slot":"sidebar-inset",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function Wo(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=B("h-4 m-0! w-full",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("div",{"data-sidebar":"separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function Vo(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=B("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function Fo(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=B("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function Ko(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=B("w-full text-sm",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function Zo(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=B("flex w-full min-w-0 flex-col gap-1",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function dt(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=B("group/menu-item relative",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}const qo=cs("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg px-2 py-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,colors] transition-colors duration-150 ease-out hover:transition-none focus-visible:ring-2 active:bg-sidebar-accent/75 disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent/75 [&>span:last-child]:truncate [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-muted-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent text-sidebar-foreground/80 active:text-sidebar-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-7 text-sm font-[450]",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Cn(t){const e=N.c(28);let n,s,o,a,l,i,c;e[0]!==t?({asChild:o,isActive:a,variant:l,size:i,tooltip:c,className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=l,e[6]=i,e[7]=c):(n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],i=e[6],c=e[7]);const d=o===void 0?!1:o,m=a===void 0?!1:a,f=l===void 0?"default":l,u=i===void 0?"default":i,h=d?ds:"button",{isMobile:p,state:v}=Pt();let b;e[8]!==n||e[9]!==u||e[10]!==f?(b=B(qo({variant:f,size:u}),n),e[8]=n,e[9]=u,e[10]=f,e[11]=b):b=e[11];let g;e[12]!==h||e[13]!==m||e[14]!==s||e[15]!==u||e[16]!==b?(g=r.jsx(h,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":u,"data-active":m,className:b,...s}),e[12]=h,e[13]=m,e[14]=s,e[15]=u,e[16]=b,e[17]=g):g=e[17];const S=g;if(!c)return S;if(typeof c=="string"){let j;e[18]!==c?(j={children:c},e[18]=c,e[19]=j):j=e[19],c=j}let w;e[20]!==S?(w=r.jsx(_s,{asChild:!0,children:S}),e[20]=S,e[21]=w):w=e[21];const z=v!=="collapsed"||p;let I;e[22]!==z||e[23]!==c?(I=r.jsx(zs,{side:"right",align:"center",hidden:z,...c}),e[22]=z,e[23]=c,e[24]=I):I=e[24];let C;return e[25]!==w||e[26]!==I?(C=r.jsxs(ks,{children:[w,I]}),e[25]=w,e[26]=I,e[27]=C):C=e[27],C}function Yo(t){const e=N.c(26),{item:n}=t,s=ct(),{org:o}=Xe(),a=tn(o.id),l=Qs(o.id);let i;e[0]!==l.update||e[1]!==n.url||e[2]!==a?.sidebar_items?(i=async()=>{const z=(a?.sidebar_items||[]).filter(I=>I.url!==n.url);await l.update.mutateAsync({sidebar_items:z})},e[0]=l.update,e[1]=n.url,e[2]=a?.sidebar_items,e[3]=i):i=e[3];const c=i;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=/^https?:\/\/.+/,e[4]=d):d=e[4];let m;e[5]!==n.icon?(m=d.test(n.icon),e[5]=n.icon,e[6]=m):m=e[6];const f=m;let u;e[7]!==n.url||e[8]!==s?(u=()=>{s({to:n.url})},e[7]=n.url,e[8]=s,e[9]=u):u=e[9];const h=n.title;let p;e[10]!==f||e[11]!==n.icon||e[12]!==n.title?(p=r.jsx("div",{className:"flex items-center justify-center shrink-0",children:f?r.jsx("img",{src:n.icon,alt:n.title,className:"h-4 w-4 rounded object-cover"}):r.jsx(Js,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=f,e[11]=n.icon,e[12]=n.title,e[13]=p):p=e[13];let v;e[14]!==n.title?(v=n.title.toLocaleLowerCase(),e[14]=n.title,e[15]=v):v=e[15];let b;e[16]!==v?(b=r.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:r.jsx("span",{className:"truncate text-sm w-full capitalize",children:v})}),e[16]=v,e[17]=b):b=e[17];let g;e[18]!==c?(g=r.jsx(rt,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:w=>{w.preventDefault(),w.stopPropagation(),c()}}),e[18]=c,e[19]=g):g=e[19];let S;return e[20]!==n.title||e[21]!==u||e[22]!==p||e[23]!==b||e[24]!==g?(S=r.jsx(dt,{children:r.jsxs(Cn,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:u,tooltip:h,children:[p,b,g]})}),e[20]=n.title,e[21]=u,e[22]=p,e[23]=b,e[24]=g,e[25]=S):S=e[25],S}function Xo(){const t=N.c(4),{org:e}=Xe(),s=tn(e.id)?.sidebar_items;if(!s?.length)return null;let o;t[0]!==s?(o=s.map(Jo),t[0]=s,t[1]=o):o=t[1];let a;return t[2]!==o?(a=r.jsx(Nn,{children:o}),t[2]=o,t[3]=a):a=t[3],a}function Jo(t){return r.jsx(Yo,{item:t},t.url)}function Ot(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(dt,{children:r.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:r.jsx(jn,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function Nn(t){const e=N.c(4),{children:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx(Wo,{className:"my-2 -ml-1"}),e[0]=s):s=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(dt,{children:r.jsx("div",{className:"group-data-[collapsible=icon]:hidden px-2 py-0 text-xs font-medium h-6 text-muted-foreground flex items-center justify-between",children:r.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=o):o=e[1];let a;return e[2]!==n?(a=r.jsxs(r.Fragment,{children:[s,o,n]}),e[2]=n,e[3]=a):a=e[3],a}function Qo(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(x.Suspense,{fallback:r.jsxs(Nn,{children:[r.jsx(Ot,{}),r.jsx(Ot,{})]}),children:r.jsx(Xo,{})}),t[0]=e):e=t[0],e}function ea(){const t=N.c(43),{locator:e}=Xe(),n=ct();let s;t[0]!==e?(s=Dt.parse(e),t[0]=e,t[1]=s):s=t[1];const{org:o}=s;let a;t[2]!==e?(a=Dt.isOrgAdminProject(e),t[2]=e,t[3]=a):a=t[3];const l=a;let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(mn,{}),t[4]=i):i=t[4];let c;t[5]!==n||t[6]!==o?(c={key:"home",label:"Home",icon:i,onClick:()=>n({to:"/$org",params:{org:o}})},t[5]=n,t[6]=o,t[7]=c):c=t[7];let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=r.jsx(cn,{}),t[8]=d):d=t[8];let m;t[9]!==n||t[10]!==o?(m={key:"store",label:"Store",icon:d,onClick:()=>n({to:"/$org/store",params:{org:o}})},t[9]=n,t[10]=o,t[11]=m):m=t[11];let f;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=r.jsx(Ns,{}),t[12]=f):f=t[12];let u;t[13]!==n||t[14]!==o?(u={key:"mcps",label:"MCP Servers",icon:f,onClick:()=>n({to:"/$org/mcps",params:{org:o}})},t[13]=n,t[14]=o,t[15]=u):u=t[15];let h;t[16]===Symbol.for("react.memo_cache_sentinel")?(h=r.jsx(Nt,{}),t[16]=h):h=t[16];let p;t[17]!==n||t[18]!==o?(p={key:"gateways",label:"MCP Gateways",icon:h,onClick:()=>n({to:"/$org/gateways",params:{org:o}})},t[17]=n,t[18]=o,t[19]=p):p=t[19];let v;t[20]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx(ln,{}),t[20]=v):v=t[20];let b;t[21]!==n||t[22]!==o?(b={key:"monitoring",label:"Monitoring",icon:v,onClick:()=>n({to:"/$org/monitoring",params:{org:o}})},t[21]=n,t[22]=o,t[23]=b):b=t[23];let g;t[24]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx(vn,{}),t[24]=g):g=t[24];let S;t[25]!==n||t[26]!==o?(S={key:"members",label:"Members",icon:g,onClick:()=>n({to:"/$org/members",params:{org:o}})},t[25]=n,t[26]=o,t[27]=S):S=t[27];let w;t[28]===Symbol.for("react.memo_cache_sentinel")?(w=r.jsx(gn,{}),t[28]=w):w=t[28];let z;t[29]!==n||t[30]!==o?(z={key:"settings",label:"Settings",icon:w,onClick:()=>n({to:"/$org/settings",params:{org:o}})},t[29]=n,t[30]=o,t[31]=z):z=t[31];let I;t[32]!==b||t[33]!==S||t[34]!==z||t[35]!==c||t[36]!==m||t[37]!==u||t[38]!==p?(I=[c,m,u,p,b,S,z],t[32]=b,t[33]=S,t[34]=z,t[35]=c,t[36]=m,t[37]=u,t[38]=p,t[39]=I):I=t[39];const C=I;let j;return t[40]!==C||t[41]!==l?(j=l?C:[],t[40]=C,t[41]=l,t[42]=j):j=t[42],j}function zn(t){const e=N.c(10),{navigationItems:n,footer:s,additionalContent:o,variant:a,collapsible:l}=t,i=a===void 0?"sidebar":a,c=l===void 0?"icon":l;let d;e[0]!==n?(d=n.map(ta),e[0]=n,e[1]=d):d=e[1];let m;e[2]!==o||e[3]!==d?(m=r.jsx(Vo,{className:"flex-1 overflow-x-hidden",children:r.jsx(Fo,{className:"font-medium",children:r.jsx(Ko,{children:r.jsxs(Zo,{className:"gap-0.5",children:[d,o]})})})}),e[2]=o,e[3]=d,e[4]=m):m=e[4];let f;return e[5]!==c||e[6]!==s||e[7]!==m||e[8]!==i?(f=r.jsxs(Uo,{variant:i,collapsible:c,children:[m,s]}),e[5]=c,e[6]=s,e[7]=m,e[8]=i,e[9]=f):f=e[9],f}function ta(t){return r.jsx(dt,{children:r.jsxs(Cn,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground",onClick:t.onClick,isActive:t.isActive,tooltip:t.label,children:[r.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:t.icon}),r.jsx("span",{className:"truncate",children:t.label})]})},t.key)}zn.Skeleton=function(){return r.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>r.jsx("div",{className:"w-full h-8",children:r.jsx(jn,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function na(){const t=N.c(3),e=ea();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsx(r.Fragment,{children:r.jsx(_t,{children:r.jsx(x.Suspense,{fallback:null,children:r.jsx(Qo,{})})})}),t[0]=n):n=t[0];let s;return t[1]!==e?(s=r.jsx(zn,{navigationItems:e,additionalContent:n}),t[1]=e,t[2]=s):s=t[2],s}function sa(t){const e=N.c(12);let n,s,o,a;e[0]!==t?({className:n,orientation:o,decorative:a,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=o,e[4]=a):(n=e[1],s=e[2],o=e[3],a=e[4]);const l=o===void 0?"horizontal":o,i=a===void 0?!0:a;let c;e[5]!==n?(c=B("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==i||e[8]!==l||e[9]!==s||e[10]!==c?(d=r.jsx(us,{"data-slot":"separator-root",decorative:i,orientation:l,className:c,...s}),e[7]=i,e[8]=l,e[9]=s,e[10]=c,e[11]=d):d=e[11],d}const In=x.createContext(null);function oa(){const t=x.useContext(In);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function aa(t){const e=N.c(10),{children:n,onItemHover:s}=t,[o,a]=x.useState(null);let l;e[0]!==s?(l=f=>{a(f),s?.(f)},e[0]=s,e[1]=l):l=e[1];const i=l;let c;e[2]!==o||e[3]!==i?(c={hoveredItem:o,setHoveredItem:i},e[2]=o,e[3]=i,e[4]=c):c=e[4];let d;e[5]!==n?(d=r.jsx(Jt,{children:n}),e[5]=n,e[6]=d):d=e[6];let m;return e[7]!==c||e[8]!==d?(m=r.jsx(In.Provider,{value:c,children:d}),e[7]=c,e[8]=d,e[9]=m):m=e[9],m}function ra(t){const e=N.c(6),{children:n,onClick:s}=t;let o;e[0]!==n||e[1]!==s?(o=r.jsx(we,{variant:"link",className:"p-0.5 h-auto",onClick:s,type:"button",children:n}),e[0]=n,e[1]=s,e[2]=o):o=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx(Qt,{asChild:!0,children:r.jsx(we,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:r.jsx(dn,{size:16,className:"opacity-50"})})}),e[3]=a):a=e[3];let l;return e[4]!==o?(l=r.jsxs("div",{className:"flex items-center gap-1",children:[o,a]}),e[4]=o,e[5]=l):l=e[5],l}function la(t){const e=N.c(8),{item:n,fallback:s}=t,o=s===void 0?"":s,a=n?.avatarUrl??"",l=n?.name??o;let i;e[0]!==a||e[1]!==l?(i=r.jsx(We,{url:a,fallback:l,size:"xs",objectFit:"contain"}),e[0]=a,e[1]=l,e[2]=i):i=e[2];const c=n?.name??o;let d;e[3]!==c?(d=r.jsx("span",{children:c}),e[3]=c,e[4]=d):d=e[4];let m;return e[5]!==i||e[6]!==d?(m=r.jsxs("div",{className:"flex items-center gap-2",children:[i,d]}),e[5]=i,e[6]=d,e[7]=m):m=e[7],m}function ia(t){const e=N.c(6),{children:n,align:s}=t,o=s===void 0?"start":s,l=x.Children.toArray(n).filter(ca).length===1?"280px":"480px";let i;e[0]!==l?(i={width:l},e[0]=l,e[1]=i):i=e[1];let c;return e[2]!==o||e[3]!==n||e[4]!==i?(c=r.jsx(en,{align:o,className:"p-0 flex items-start",style:i,children:n}),e[2]=o,e[3]=n,e[4]=i,e[5]=c):c=e[5],c}function ca(t){return x.isValidElement(t)&&(t.type===kn||t.type===_n)}function _n(t){const e=N.c(5),{children:n,className:s}=t;let o;e[0]!==s?(o=B("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",s),e[0]=s,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==o?(a=r.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=a):a=e[4],a}const kn=_n;function da(t){const e=N.c(6),{placeholder:n,value:s,onChange:o}=t,a=n===void 0?"Search...":n;let l;e[0]!==o?(l=c=>o(c.target.value),e[0]=o,e[1]=l):l=e[1];let i;return e[2]!==a||e[3]!==l||e[4]!==s?(i=r.jsx(to,{placeholder:a,value:s,onChange:l,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=a,e[3]=l,e[4]=s,e[5]=i):i=e[5],i}function ua(t){const e=N.c(6),{children:n,emptyMessage:s}=t,o=s===void 0?"No items found.":s,a=x.Children.count(n)>0;let l;e[0]!==o||e[1]!==a?(l=!a&&r.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:o}),e[0]=o,e[1]=a,e[2]=l):l=e[2];let i;return e[3]!==n||e[4]!==l?(i=r.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[l,n]}),e[3]=n,e[4]=l,e[5]=i):i=e[5],i}function fa(t){const e=N.c(15),{item:n,onClick:s,onHover:o,children:a}=t,l=oa();let i;e[0]!==l||e[1]!==n||e[2]!==o?(i=()=>{l.setHoveredItem(n.slug),o?.(n)},e[0]=l,e[1]=n,e[2]=o,e[3]=i):i=e[3];const c=i;let d;e[4]!==n||e[5]!==s?(d=()=>s(n),e[4]=n,e[5]=s,e[6]=d):d=e[6];let m;e[7]!==a||e[8]!==n.avatarUrl||e[9]!==n.name?(m=a||r.jsxs(r.Fragment,{children:[r.jsx(We,{url:n.avatarUrl??"",fallback:n.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),r.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:n.name})]}),e[7]=a,e[8]=n.avatarUrl,e[9]=n.name,e[10]=m):m=e[10];let f;return e[11]!==c||e[12]!==d||e[13]!==m?(f=r.jsx(we,{onClick:d,onMouseEnter:c,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:m}),e[11]=c,e[12]=d,e[13]=m,e[14]=f):f=e[14],f}function ma(t){const e=N.c(2),{children:n}=t;let s;return e[0]!==n?(s=r.jsx("div",{className:"px-1 pb-1 pt-0.5",children:n}),e[0]=n,e[1]=s):s=e[1],s}function pa(t){const e=N.c(11),{onClick:n,icon:s,children:o,variant:a}=t,i=(a===void 0?"default":a)==="muted"&&"text-muted-foreground";let c;e[0]!==i?(c=B("w-full justify-start font-normal",i),e[0]=i,e[1]=c):c=e[1];let d;e[2]!==s?(d=s&&r.jsx("span",{className:"[&>svg]:size-4",children:s}),e[2]=s,e[3]=d):d=e[3];let m;e[4]!==o?(m=r.jsx("span",{children:o}),e[4]=o,e[5]=m):m=e[5];let f;return e[6]!==n||e[7]!==c||e[8]!==d||e[9]!==m?(f=r.jsxs(we,{variant:"ghost",size:"sm",className:c,onClick:n,children:[d,m]}),e[6]=n,e[7]=c,e[8]=d,e[9]=m,e[10]=f):f=e[10],f}function ha(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(sa,{}),t[0]=e):e=t[0],e}function xa(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const ae=Object.assign(aa,{Trigger:ra,CurrentItem:la,Content:ia,Panel:kn,Search:da,Items:ua,Item:fa,Actions:ma,Action:pa,Separator:ha,Skeleton:xa});function zt(){const t=N.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:n}=qt(e),{data:s}=qe.useListOrganizations(),o=ct();let a;t[1]!==n||t[2]!==s?(a=s?.find(K=>K.slug===n),t[1]=n,t[2]=s,t[3]=a):a=t[3];const l=a,[i,c]=x.useState(""),[d,m]=x.useState(!1);let f,u,h,p,v,b,g,S;if(t[4]!==l||t[5]!==o||t[6]!==n||t[7]!==i||t[8]!==s){const H=(s?(()=>{const q=s.filter(Q=>Q.name.toLowerCase().includes(i.toLowerCase()));if(n){const Q=q.findIndex(y=>y.slug===n);if(Q>0){const y=q[Q];y&&(q.splice(Q,1),q.unshift(y))}}return q})():[]).map(ga);let F;t[17]!==l?(F=l?{slug:l.slug,name:l.name,avatarUrl:l.logo}:void 0,t[17]=l,t[18]=F):F=t[18];const V=F;p=ae;let ee;t[19]!==o||t[20]!==n?(ee=()=>o({to:"/$org",params:{org:n??""}}),t[19]=o,t[20]=n,t[21]=ee):ee=t[21];let X;t[22]!==V?(X=r.jsx(ae.CurrentItem,{item:V}),t[22]=V,t[23]=X):X=t[23],t[24]!==ee||t[25]!==X?(S=r.jsx(ae.Trigger,{onClick:ee,children:X}),t[24]=ee,t[25]=X,t[26]=S):S=t[26],h=ae.Content,u=ae.Panel,t[27]!==i?(g=r.jsx(ae.Search,{placeholder:"Search organizations...",value:i,onChange:c}),t[27]=i,t[28]=g):g=t[28],f=ae.Items,v="No organizations found.";let re;t[29]!==o?(re=q=>r.jsx(ae.Item,{item:q,onClick:Q=>o({to:"/$org",params:{org:Q.slug}})},q.slug),t[29]=o,t[30]=re):re=t[30],b=H.map(re),t[4]=l,t[5]=o,t[6]=n,t[7]=i,t[8]=s,t[9]=f,t[10]=u,t[11]=h,t[12]=p,t[13]=v,t[14]=b,t[15]=g,t[16]=S}else f=t[9],u=t[10],h=t[11],p=t[12],v=t[13],b=t[14],g=t[15],S=t[16];let w;t[31]!==f||t[32]!==v||t[33]!==b?(w=r.jsx(f,{emptyMessage:v,children:b}),t[31]=f,t[32]=v,t[33]=b,t[34]=w):w=t[34];let z,I;t[35]===Symbol.for("react.memo_cache_sentinel")?(z=r.jsx(ae.Actions,{children:r.jsx(ae.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),I=r.jsx(ae.Separator,{}),t[35]=z,t[36]=I):(z=t[35],I=t[36]);let C;t[37]!==o?(C=()=>o({to:"/"}),t[37]=o,t[38]=C):C=t[38];let j;t[39]===Symbol.for("react.memo_cache_sentinel")?(j=r.jsx(no,{}),t[39]=j):j=t[39];let O;t[40]!==C?(O=r.jsx(ae.Actions,{children:r.jsx(ae.Action,{onClick:C,icon:j,children:"See all organizations"})}),t[40]=C,t[41]=O):O=t[41];let E;t[42]!==u||t[43]!==O||t[44]!==g||t[45]!==w?(E=r.jsxs(u,{children:[g,w,z,I,O]}),t[42]=u,t[43]=O,t[44]=g,t[45]=w,t[46]=E):E=t[46];let A;t[47]!==h||t[48]!==E?(A=r.jsx(h,{children:E}),t[47]=h,t[48]=E,t[49]=A):A=t[49];let $;t[50]!==p||t[51]!==A||t[52]!==S?($=r.jsxs(p,{children:[S,A]}),t[50]=p,t[51]=A,t[52]=S,t[53]=$):$=t[53];let D;t[54]!==d?(D=r.jsx(eo,{open:d,onOpenChange:m}),t[54]=d,t[55]=D):D=t[55];let L;return t[56]!==$||t[57]!==D?(L=r.jsxs(r.Fragment,{children:[$,D]}),t[56]=$,t[57]=D,t[58]=L):L=t[58],L}function ga(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}zt.Skeleton=ae.Skeleton;const Pn=x.createContext({setOpen:()=>{}}),ba=()=>x.useContext(Pn),va=t=>{const e=N.c(25);let n,s,o,a,l;e[0]!==t?({children:n,defaultOpen:s,open:a,onOpenChange:o,...l}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=l):(n=e[1],s=e[2],o=e[3],a=e[4],l=e[5]);const i=s??!1;let c;e[6]!==o||e[7]!==a||e[8]!==i?(c={prop:a,defaultProp:i,onChange:o},e[6]=o,e[7]=a,e[8]=i,e[9]=c):c=e[9];const[d,m]=Fs(c);let f;e[10]!==m?(f={setOpen:m},e[10]=m,e[11]=f):f=e[11];let u;e[12]!==n||e[13]!==d||e[14]!==l||e[15]!==m?(u=r.jsx(Ks,{open:d,onOpenChange:m,...l,children:n}),e[12]=n,e[13]=d,e[14]=l,e[15]=m,e[16]=u):u=e[16];let h;e[17]!==d||e[18]!==l||e[19]!==m||e[20]!==u?(h=r.jsx(ao,{open:d,onOpenChange:m,...l,children:u}),e[17]=d,e[18]=l,e[19]=m,e[20]=u,e[21]=h):h=e[21];let p;return e[22]!==f||e[23]!==h?(p=r.jsx(Pn.Provider,{value:f,children:h}),e[22]=f,e[23]=h,e[24]=p):p=e[24],p},ya=t=>{const{children:e,title:n,...s}=t,o=Je(),{className:a,...l}=s;return o?r.jsxs(Gs,{...l,children:[r.jsx(Ws,{className:"hidden",children:r.jsx(Vs,{children:n})}),r.jsx("div",{className:B("flex flex-col gap-2 p-2 py-4",a),children:e})]}):r.jsx(oo,{...s,children:e})},Sa=t=>{const{children:e,...n}=t,{setOpen:s}=ba(),o=Je(),{className:a,...l}=n;return o?r.jsx("div",{...l,onClick:i=>{s(!1);const{onClick:c}=l;c?.(i)},className:B("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a),children:e}):r.jsx(ro,{...n,children:e})},ja=t=>{const e=N.c(7);let n,s;e[0]!==t?({children:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);const o=Je();let a;return e[3]!==n||e[4]!==o||e[5]!==s?(a=o?r.jsx(Us,{asChild:!0,children:n}):r.jsx(so,{...s,children:n}),e[3]=n,e[4]=o,e[5]=s,e[6]=a):a=e[6],a},wa=t=>{const e=N.c(7);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);const o=Je();let a;return e[3]!==n||e[4]!==o||e[5]!==s?(a=o?r.jsx(Tt,{className:B(n),...s}):r.jsx(Tt,{className:B(n),...s}),e[3]=n,e[4]=o,e[5]=s,e[6]=a):a=e[6],a};function Ca(t){const e=N.c(11),{user:n,trigger:s,align:o,children:a}=t,l=o===void 0?"start":o;let i;e[0]!==s||e[1]!==n?(i=s(n),e[0]=s,e[1]=n,e[2]=i):i=e[2];let c;e[3]!==i?(c=r.jsx(ja,{asChild:!0,children:r.jsx("div",{children:i})}),e[3]=i,e[4]=c):c=e[4];let d;e[5]!==l||e[6]!==a?(d=r.jsx(ya,{side:"top",align:l,className:"md:w-[240px]",children:a}),e[5]=l,e[6]=a,e[7]=d):d=e[7];let m;return e[8]!==c||e[9]!==d?(m=r.jsxs(va,{children:[c,d]}),e[8]=c,e[9]=d,e[10]=m):m=e[10],m}function Na(t){const e=N.c(8),{children:n,onClick:s,className:o,asChild:a}=t;let l;e[0]!==a||e[1]!==n||e[2]!==s?(l=a?n:r.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:s,children:n}),e[0]=a,e[1]=n,e[2]=s,e[3]=l):l=e[3];let i;return e[4]!==a||e[5]!==o||e[6]!==l?(i=r.jsx(Sa,{asChild:a,className:o,children:l}),e[4]=a,e[5]=o,e[6]=l,e[7]=i):i=e[7],i}function za(t){const e=N.c(2),{className:n}=t;let s;return e[0]!==n?(s=r.jsx(wa,{className:n}),e[0]=n,e[1]=s):s=e[1],s}function Ia(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const be=Object.assign(Ca,{Item:Na,Separator:za,Skeleton:Ia});function _a(t){const e=N.c(32),{open:n,onOpenChange:s,user:o,userImage:a}=t,[l,i]=x.useState(!1);let c;e[0]!==o.id?(c=()=>{navigator.clipboard.writeText(o.id),i(!0),setTimeout(()=>i(!1),2e3)},e[0]=o.id,e[1]=c):c=e[1];const d=c;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsxs(nn,{children:[r.jsx(sn,{children:"Profile"}),r.jsx(on,{children:"Your account information"})]}),e[2]=m):m=e[2];const f=o.name||o.email||"U";let u;e[3]!==f||e[4]!==a?(u=r.jsx(We,{url:a,fallback:f,shape:"circle",size:"2xl"}),e[3]=f,e[4]=a,e[5]=u):u=e[5];const h=o.name||o.email;let p;e[6]!==h?(p=r.jsx("div",{className:"text-lg font-semibold text-center",children:h}),e[6]=h,e[7]=p):p=e[7];let v;e[8]!==o.email?(v=r.jsx("div",{className:"text-sm text-muted-foreground text-center",children:o.email}),e[8]=o.email,e[9]=v):v=e[9];let b;e[10]!==p||e[11]!==v?(b=r.jsxs("div",{className:"flex flex-col items-center gap-2 w-full",children:[p,v]}),e[10]=p,e[11]=v,e[12]=b):b=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"User ID"}),e[13]=g):g=e[13];let S;e[14]!==o.id?(S=r.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[g,r.jsx("span",{className:"text-sm font-mono truncate",children:o.id})]}),e[14]=o.id,e[15]=S):S=e[15];let w;e[16]!==l?(w=l?r.jsx(Ps,{size:16,className:"text-green-600"}):r.jsx(lo,{size:16,className:"text-muted-foreground"}),e[16]=l,e[17]=w):w=e[17];let z;e[18]!==d||e[19]!==w?(z=r.jsx("button",{type:"button",onClick:d,className:"flex-shrink-0 p-2 hover:bg-background rounded-md transition-colors","aria-label":"Copy user ID",children:w}),e[18]=d,e[19]=w,e[20]=z):z=e[20];let I;e[21]!==S||e[22]!==z?(I=r.jsxs("div",{className:"flex items-center justify-between gap-3 w-full px-4 py-3 rounded-lg bg-muted/50 border border-border",children:[S,z]}),e[21]=S,e[22]=z,e[23]=I):I=e[23];let C;e[24]!==I||e[25]!==u||e[26]!==b?(C=r.jsxs(an,{className:"sm:max-w-md",children:[m,r.jsxs("div",{className:"flex flex-col items-center gap-6 py-4",children:[u,b,I]})]}),e[24]=I,e[25]=u,e[26]=b,e[27]=C):C=e[27];let j;return e[28]!==s||e[29]!==n||e[30]!==C?(j=r.jsx(rn,{open:n,onOpenChange:s,children:C}),e[28]=s,e[29]=n,e[30]=C,e[31]=j):j=e[31],j}function ka(t){const e=N.c(5),{open:n,onOpenChange:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsxs(nn,{children:[r.jsx(sn,{children:"Invitations"}),r.jsx(on,{children:"Your pending organization invitations"})]}),e[0]=o):o=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsxs(an,{className:"sm:max-w-lg",children:[o,r.jsx("div",{className:"max-h-[420px] overflow-auto pr-1",children:r.jsx(ps,{})})]}),e[1]=a):a=e[1];let l;return e[2]!==s||e[3]!==n?(l=r.jsx(rn,{open:n,onOpenChange:s,children:a}),e[2]=s,e[3]=n,e[4]=l):l=e[4],l}function Pa(t){const e=N.c(31),{user:n,userImage:s,hasInvites:o,showInvitesItem:a}=t,[l,i]=x.useState(!1),[c,d]=x.useState(!1);let m;e[0]!==o||e[1]!==n.email||e[2]!==n.name||e[3]!==s?(m=()=>r.jsxs("div",{className:"relative",children:[r.jsx(We,{url:s,fallback:n.name||n.email||"U",shape:"circle",size:"sm",className:"cursor-pointer hover:ring-2 ring-muted-foreground transition-all"}),o&&r.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2.5 w-2.5 rounded-full bg-destructive ring-2 ring-background"})]}),e[0]=o,e[1]=n.email,e[2]=n.name,e[3]=s,e[4]=m):m=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=r.jsxs(be.Item,{onClick:()=>i(!0),children:[r.jsx(bn,{className:"text-muted-foreground",size:18}),"Profile"]}),e[5]=f):f=e[5];let u;e[6]!==o||e[7]!==a?(u=a&&r.jsxs(be.Item,{onClick:()=>d(!0),children:[r.jsx(xn,{className:"text-muted-foreground",size:18}),"Invitations",o&&r.jsx("span",{className:"ml-auto h-2 w-2 rounded-full bg-destructive"})]}),e[6]=o,e[7]=a,e[8]=u):u=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=r.jsx(be.Separator,{}),e[9]=h):h=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx(ms,{className:"w-4 h-4 text-muted-foreground"}),e[10]=p):p=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx(be.Item,{asChild:!0,children:r.jsxs("a",{href:"https://github.com/decocms/admin",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[p,"decocms/admin",r.jsx(Lt,{size:18,className:"text-muted-foreground ml-auto"})]})}),e[11]=v):v=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(fn,{className:"text-muted-foreground",size:18}),e[12]=b):b=e[12];let g,S;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx(be.Item,{asChild:!0,children:r.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[b,"Homepage",r.jsx(Lt,{size:18,className:"ml-auto text-muted-foreground"})]})}),S=r.jsx(be.Separator,{}),e[13]=g,e[14]=S):(g=e[13],S=e[14]);let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=r.jsxs(be.Item,{onClick:$a,children:[r.jsx(hn,{size:18,className:"text-muted-foreground"}),"Log out"]}),e[15]=w):w=e[15];let z;e[16]!==m||e[17]!==u||e[18]!==n?(z=r.jsxs(be,{user:n,trigger:m,align:"end",children:[f,u,h,v,g,S,w]}),e[16]=m,e[17]=u,e[18]=n,e[19]=z):z=e[19];let I;e[20]!==l||e[21]!==n||e[22]!==s?(I=l&&r.jsx(_a,{open:l,onOpenChange:i,user:n,userImage:s}),e[20]=l,e[21]=n,e[22]=s,e[23]=I):I=e[23];let C;e[24]!==c||e[25]!==a?(C=a&&c&&r.jsx(ka,{open:c,onOpenChange:d}),e[24]=c,e[25]=a,e[26]=C):C=e[26];let j;return e[27]!==z||e[28]!==I||e[29]!==C?(j=r.jsxs(r.Fragment,{children:[z,I,C]}),e[27]=z,e[28]=I,e[29]=C,e[30]=j):j=e[30],j}function $a(){return qe.signOut()}function Ma(){const{data:t}=qe.useSession(),e=x.useContext(fs),{data:n}=e.hooks.useListUserInvitations(),o=(n??[]).length>0;if(!t?.user)return r.jsx(We,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer",muted:!0});const a=t.user,l={...a,name:a.name??void 0},i=a.image;return r.jsx(Pa,{user:l,userImage:i,hasInvites:o,showInvitesItem:!0})}function Ea(t){const e=N.c(6),{children:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx(hs,{children:r.jsx(Yt,{})}),e[0]=s):s=e[0];let o;e[1]!==n?(o=r.jsx(xs,{children:n}),e[1]=n,e[2]=o):o=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx(gs,{children:r.jsx(bs,{to:"/login",replace:!0})}),e[3]=a):a=e[3];let l;return e[4]!==o?(l=r.jsxs(r.Fragment,{children:[s,o,a]}),e[4]=o,e[5]=l):l=e[5],l}function Ra(t){const e=N.c(5),{children:n,className:s}=t;let o;e[0]!==s?(o=B("fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",s),e[0]=s,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==o?(a=r.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=a):a=e[4],a}function Aa(t){const e=N.c(5),{children:n,className:s}=t;let o;e[0]!==s?(o=B("flex items-center justify-center px-2 h-full border-r border-border",s),e[0]=s,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==o?(a=r.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=a):a=e[4],a}function Da(t){const e=N.c(5),{children:n,className:s}=t;let o;e[0]!==s?(o=B("flex items-center gap-2 px-2 h-full",s),e[0]=s,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==o?(a=r.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=a):a=e[4],a}function Ta(t){const e=N.c(5),{children:n,className:s}=t;let o;e[0]!==s?(o=B("flex items-center gap-2 px-2 h-full flex-1",s),e[0]=s,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==o?(a=r.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=a):a=e[4],a}function La(t){const e=N.c(5),{children:n,className:s}=t;let o;e[0]!==s?(o=B("flex items-center gap-2 px-2 h-full ml-auto",s),e[0]=s,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==o?(a=r.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=a):a=e[4],a}function Oa(){const t=N.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx("div",{className:"flex items-center justify-center px-2 h-full border-r border-border",children:r.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsx("div",{className:"flex items-center gap-2 px-2 h-full",children:r.jsx("div",{className:"w-32 h-6 bg-muted rounded-md animate-pulse"})}),t[1]=n):n=t[1];let s;return t[2]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsxs("div",{className:"fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",children:[e,n,r.jsx("div",{className:"flex items-center gap-2 px-2 h-full ml-auto",children:r.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"})})]}),t[2]=s):s=t[2],s}const st=Object.assign(Ra,{Sidebar:Aa,Left:Da,Center:Ta,Right:La,Skeleton:Oa}),ut=x.createContext(null);ut.displayName="PanelGroupContext";const Y={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},$t=10,je=x.useLayoutEffect,Ht=vs.useId,Ha=typeof Ht=="function"?Ht:()=>null;let Ba=0;function Mt(t=null){const e=Ha(),n=x.useRef(t||e||null);return n.current===null&&(n.current=""+Ba++),t??n.current}function $n({children:t,className:e="",collapsedSize:n,collapsible:s,defaultSize:o,forwardedRef:a,id:l,maxSize:i,minSize:c,onCollapse:d,onExpand:m,onResize:f,order:u,style:h,tagName:p="div",...v}){const b=x.useContext(ut);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:g,expandPanel:S,getPanelSize:w,getPanelStyle:z,groupId:I,isPanelCollapsed:C,reevaluatePanelConstraints:j,registerPanel:O,resizePanel:E,unregisterPanel:A}=b,$=Mt(l),D=x.useRef({callbacks:{onCollapse:d,onExpand:m,onResize:f},constraints:{collapsedSize:n,collapsible:s,defaultSize:o,maxSize:i,minSize:c},id:$,idIsFromProps:l!==void 0,order:u});x.useRef({didLogMissingDefaultSizeWarning:!1}),je(()=>{const{callbacks:K,constraints:H}=D.current,F={...H};D.current.id=$,D.current.idIsFromProps=l!==void 0,D.current.order=u,K.onCollapse=d,K.onExpand=m,K.onResize=f,H.collapsedSize=n,H.collapsible=s,H.defaultSize=o,H.maxSize=i,H.minSize=c,(F.collapsedSize!==H.collapsedSize||F.collapsible!==H.collapsible||F.maxSize!==H.maxSize||F.minSize!==H.minSize)&&j(D.current,F)}),je(()=>{const K=D.current;return O(K),()=>{A(K)}},[u,$,O,A]),x.useImperativeHandle(a,()=>({collapse:()=>{g(D.current)},expand:K=>{S(D.current,K)},getId(){return $},getSize(){return w(D.current)},isCollapsed(){return C(D.current)},isExpanded(){return!C(D.current)},resize:K=>{E(D.current,K)}}),[g,S,w,C,$,E]);const L=z(D.current,o);return x.createElement(p,{...v,children:t,className:e,id:$,style:{...L,...h},[Y.groupId]:I,[Y.panel]:"",[Y.panelCollapsible]:s||void 0,[Y.panelId]:$,[Y.panelSize]:parseFloat(""+L.flexGrow).toFixed(1)})}const Mn=x.forwardRef((t,e)=>x.createElement($n,{...t,forwardedRef:e}));$n.displayName="Panel";Mn.displayName="forwardRef(Panel)";let It=null,at=-1,ve=null;function Ua(t,e){if(e){const n=(e&Tn)!==0,s=(e&Ln)!==0,o=(e&On)!==0,a=(e&Hn)!==0;if(n)return o?"se-resize":a?"ne-resize":"e-resize";if(s)return o?"sw-resize":a?"nw-resize":"w-resize";if(o)return"s-resize";if(a)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Ga(){ve!==null&&(document.head.removeChild(ve),It=null,ve=null,at=-1)}function yt(t,e){var n,s;const o=Ua(t,e);if(It!==o){if(It=o,ve===null&&(ve=document.createElement("style"),document.head.appendChild(ve)),at>=0){var a;(a=ve.sheet)===null||a===void 0||a.removeRule(at)}at=(n=(s=ve.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${o} !important;}`))!==null&&n!==void 0?n:-1}}function En(t){return t.type==="keydown"}function Rn(t){return t.type.startsWith("pointer")}function An(t){return t.type.startsWith("mouse")}function ft(t){if(Rn(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(An(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function Wa(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Va(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function Fa(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:Gt(t),b:Gt(e)};let s;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),s=t;T(s,"Stacking order can only be calculated for elements with a common ancestor");const o={a:Ut(Bt(n.a)),b:Ut(Bt(n.b))};if(o.a===o.b){const a=s.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let i=a.length;for(;i--;){const c=a[i];if(c===l.a)return 1;if(c===l.b)return-1}}return Math.sign(o.a-o.b)}const Ka=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Za(t){var e;const n=getComputedStyle((e=Dn(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function qa(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Za(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||Ka.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Bt(t){let e=t.length;for(;e--;){const n=t[e];if(T(n,"Missing node"),qa(n))return n}return null}function Ut(t){return t&&Number(getComputedStyle(t).zIndex)||0}function Gt(t){const e=[];for(;t;)e.push(t),t=Dn(t);return e}function Dn(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const Tn=1,Ln=2,On=4,Hn=8,Ya=Wa()==="coarse";let fe=[],Ue=!1,Se=new Map,mt=new Map;const Ke=new Set;function Xa(t,e,n,s,o){var a;const{ownerDocument:l}=e,i={direction:n,element:e,hitAreaMargins:s,setResizeHandlerState:o},c=(a=Se.get(l))!==null&&a!==void 0?a:0;return Se.set(l,c+1),Ke.add(i),lt(),function(){var m;mt.delete(t),Ke.delete(i);const f=(m=Se.get(l))!==null&&m!==void 0?m:1;if(Se.set(l,f-1),lt(),f===1&&Se.delete(l),fe.includes(i)){const u=fe.indexOf(i);u>=0&&fe.splice(u,1),Rt(),o("up",!0,null)}}}function Ja(t){const{target:e}=t,{x:n,y:s}=ft(t);Ue=!0,Et({target:e,x:n,y:s}),lt(),fe.length>0&&(it("down",t),t.preventDefault(),Bn(e)||t.stopImmediatePropagation())}function St(t){const{x:e,y:n}=ft(t);if(Ue&&t.buttons===0&&(Ue=!1,it("up",t)),!Ue){const{target:s}=t;Et({target:s,x:e,y:n})}it("move",t),Rt(),fe.length>0&&t.preventDefault()}function jt(t){const{target:e}=t,{x:n,y:s}=ft(t);mt.clear(),Ue=!1,fe.length>0&&(t.preventDefault(),Bn(e)||t.stopImmediatePropagation()),it("up",t),Et({target:e,x:n,y:s}),Rt(),lt()}function Bn(t){let e=t;for(;e;){if(e.hasAttribute(Y.resizeHandle))return!0;e=e.parentElement}return!1}function Et({target:t,x:e,y:n}){fe.splice(0);let s=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(s=t),Ke.forEach(o=>{const{element:a,hitAreaMargins:l}=o,i=a.getBoundingClientRect(),{bottom:c,left:d,right:m,top:f}=i,u=Ya?l.coarse:l.fine;if(e>=d-u&&e<=m+u&&n>=f-u&&n<=c+u){if(s!==null&&document.contains(s)&&a!==s&&!a.contains(s)&&!s.contains(a)&&Fa(s,a)>0){let p=s,v=!1;for(;p&&!p.contains(a);){if(Va(p.getBoundingClientRect(),i)){v=!0;break}p=p.parentElement}if(v)return}fe.push(o)}})}function wt(t,e){mt.set(t,e)}function Rt(){let t=!1,e=!1;fe.forEach(s=>{const{direction:o}=s;o==="horizontal"?t=!0:e=!0});let n=0;mt.forEach(s=>{n|=s}),t&&e?yt("intersection",n):t?yt("horizontal",n):e?yt("vertical",n):Ga()}let Ct=new AbortController;function lt(){Ct.abort(),Ct=new AbortController;const t={capture:!0,signal:Ct.signal};Ke.size&&(Ue?(fe.length>0&&Se.forEach((e,n)=>{const{body:s}=n;e>0&&(s.addEventListener("contextmenu",jt,t),s.addEventListener("pointerleave",St,t),s.addEventListener("pointermove",St,t))}),window.addEventListener("pointerup",jt,t),window.addEventListener("pointercancel",jt,t)):Se.forEach((e,n)=>{const{body:s}=n;e>0&&(s.addEventListener("pointerdown",Ja,t),s.addEventListener("pointermove",St,t))}))}function it(t,e){Ke.forEach(n=>{const{setResizeHandlerState:s}=n,o=fe.includes(n);s(t,o,e)})}function Qa(){const[t,e]=x.useState(0);return x.useCallback(()=>e(n=>n+1),[])}function T(t,e){if(!t)throw console.error(e),Error(e)}function Ce(t,e,n=$t){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function xe(t,e,n=$t){return Ce(t,e,n)===0}function ie(t,e,n){return Ce(t,e,n)===0}function er(t,e,n){if(t.length!==e.length)return!1;for(let s=0;s<t.length;s++){const o=t[s],a=e[s];if(!ie(o,a,n))return!1}return!0}function Be({panelConstraints:t,panelIndex:e,size:n}){const s=t[e];T(s!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:o=0,collapsible:a,maxSize:l=100,minSize:i=0}=s;if(Ce(n,i)<0)if(a){const c=(o+i)/2;Ce(n,c)<0?n=o:n=i}else n=i;return n=Math.min(l,n),n=parseFloat(n.toFixed($t)),n}function Ve({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:s,prevLayout:o,trigger:a}){if(ie(t,0))return e;const l=[...e],[i,c]=s;T(i!=null,"Invalid first pivot index"),T(c!=null,"Invalid second pivot index");let d=0;if(a==="keyboard"){{const f=t<0?c:i,u=n[f];T(u,`Panel constraints not found for index ${f}`);const{collapsedSize:h=0,collapsible:p,minSize:v=0}=u;if(p){const b=e[f];if(T(b!=null,`Previous layout not found for panel index ${f}`),ie(b,h)){const g=v-b;Ce(g,Math.abs(t))>0&&(t=t<0?0-g:g)}}}{const f=t<0?i:c,u=n[f];T(u,`No panel constraints found for index ${f}`);const{collapsedSize:h=0,collapsible:p,minSize:v=0}=u;if(p){const b=e[f];if(T(b!=null,`Previous layout not found for panel index ${f}`),ie(b,v)){const g=b-h;Ce(g,Math.abs(t))>0&&(t=t<0?0-g:g)}}}}{const f=t<0?1:-1;let u=t<0?c:i,h=0;for(;;){const v=e[u];T(v!=null,`Previous layout not found for panel index ${u}`);const g=Be({panelConstraints:n,panelIndex:u,size:100})-v;if(h+=g,u+=f,u<0||u>=n.length)break}const p=Math.min(Math.abs(t),Math.abs(h));t=t<0?0-p:p}{let u=t<0?i:c;for(;u>=0&&u<n.length;){const h=Math.abs(t)-Math.abs(d),p=e[u];T(p!=null,`Previous layout not found for panel index ${u}`);const v=p-h,b=Be({panelConstraints:n,panelIndex:u,size:v});if(!ie(p,b)&&(d+=p-b,l[u]=b,d.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?u--:u++}}if(er(o,l))return o;{const f=t<0?c:i,u=e[f];T(u!=null,`Previous layout not found for panel index ${f}`);const h=u+d,p=Be({panelConstraints:n,panelIndex:f,size:h});if(l[f]=p,!ie(p,h)){let v=h-p,g=t<0?c:i;for(;g>=0&&g<n.length;){const S=l[g];T(S!=null,`Previous layout not found for panel index ${g}`);const w=S+v,z=Be({panelConstraints:n,panelIndex:g,size:w});if(ie(S,z)||(v-=z-S,l[g]=z),ie(v,0))break;t>0?g--:g++}}}const m=l.reduce((f,u)=>u+f,0);return ie(m,100)?l:o}function tr({layout:t,panelsArray:e,pivotIndices:n}){let s=0,o=100,a=0,l=0;const i=n[0];T(i!=null,"No pivot index found"),e.forEach((f,u)=>{const{constraints:h}=f,{maxSize:p=100,minSize:v=0}=h;u===i?(s=v,o=p):(a+=v,l+=p)});const c=Math.min(o,100-a),d=Math.max(s,100-l),m=t[i];return{valueMax:c,valueMin:d,valueNow:m}}function Ze(t,e=document){return Array.from(e.querySelectorAll(`[${Y.resizeHandleId}][data-panel-group-id="${t}"]`))}function Un(t,e,n=document){const o=Ze(t,n).findIndex(a=>a.getAttribute(Y.resizeHandleId)===e);return o??null}function Gn(t,e,n){const s=Un(t,e,n);return s!=null?[s,s+1]:[-1,-1]}function Wn(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const s=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return s||null}function pt(t,e=document){const n=e.querySelector(`[${Y.resizeHandleId}="${t}"]`);return n||null}function nr(t,e,n,s=document){var o,a,l,i;const c=pt(e,s),d=Ze(t,s),m=c?d.indexOf(c):-1,f=(o=(a=n[m])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null,u=(l=(i=n[m+1])===null||i===void 0?void 0:i.id)!==null&&l!==void 0?l:null;return[f,u]}function sr({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:s,panelDataArray:o,panelGroupElement:a,setLayout:l}){x.useRef({didWarnAboutMissingResizeHandle:!1}),je(()=>{if(!a)return;const i=Ze(n,a);for(let c=0;c<o.length-1;c++){const{valueMax:d,valueMin:m,valueNow:f}=tr({layout:s,panelsArray:o,pivotIndices:[c,c+1]}),u=i[c];if(u!=null){const h=o[c];T(h,`No panel data found for index "${c}"`),u.setAttribute("aria-controls",h.id),u.setAttribute("aria-valuemax",""+Math.round(d)),u.setAttribute("aria-valuemin",""+Math.round(m)),u.setAttribute("aria-valuenow",f!=null?""+Math.round(f):"")}}return()=>{i.forEach((c,d)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,s,o,a]),x.useEffect(()=>{if(!a)return;const i=e.current;T(i,"Eager values not found");const{panelDataArray:c}=i,d=Wn(n,a);T(d!=null,`No group found for id "${n}"`);const m=Ze(n,a);T(m,`No resize handles found for group id "${n}"`);const f=m.map(u=>{const h=u.getAttribute(Y.resizeHandleId);T(h,"Resize handle element has no handle id attribute");const[p,v]=nr(n,h,c,a);if(p==null||v==null)return()=>{};const b=g=>{if(!g.defaultPrevented)switch(g.key){case"Enter":{g.preventDefault();const S=c.findIndex(w=>w.id===p);if(S>=0){const w=c[S];T(w,`No panel data found for index ${S}`);const z=s[S],{collapsedSize:I=0,collapsible:C,minSize:j=0}=w.constraints;if(z!=null&&C){const O=Ve({delta:ie(z,I)?j-I:I-z,initialLayout:s,panelConstraints:c.map(E=>E.constraints),pivotIndices:Gn(n,h,a),prevLayout:s,trigger:"keyboard"});s!==O&&l(O)}}break}}};return u.addEventListener("keydown",b),()=>{u.removeEventListener("keydown",b)}});return()=>{f.forEach(u=>u())}},[a,t,e,n,s,o,l])}function Wt(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Vn(t,e){const n=t==="horizontal",{x:s,y:o}=ft(e);return n?s:o}function or(t,e,n,s,o){const a=n==="horizontal",l=pt(e,o);T(l,`No resize handle element found for id "${e}"`);const i=l.getAttribute(Y.groupId);T(i,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=s;const d=Vn(n,t),m=Wn(i,o);T(m,`No group element found for id "${i}"`);const f=m.getBoundingClientRect(),u=a?f.width:f.height;return(d-c)/u*100}function ar(t,e,n,s,o,a){if(En(t)){const l=n==="horizontal";let i=0;t.shiftKey?i=100:o!=null?i=o:i=10;let c=0;switch(t.key){case"ArrowDown":c=l?0:i;break;case"ArrowLeft":c=l?-i:0;break;case"ArrowRight":c=l?i:0;break;case"ArrowUp":c=l?0:-i;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return s==null?0:or(t,e,n,s,a)}function rr({panelDataArray:t}){const e=Array(t.length),n=t.map(a=>a.constraints);let s=0,o=100;for(let a=0;a<t.length;a++){const l=n[a];T(l,`Panel constraints not found for index ${a}`);const{defaultSize:i}=l;i!=null&&(s++,e[a]=i,o-=i)}for(let a=0;a<t.length;a++){const l=n[a];T(l,`Panel constraints not found for index ${a}`);const{defaultSize:i}=l;if(i!=null)continue;const c=t.length-s,d=o/c;s++,e[a]=d,o-=d}return e}function Oe(t,e,n){e.forEach((s,o)=>{const a=t[o];T(a,`Panel data not found for index ${o}`);const{callbacks:l,constraints:i,id:c}=a,{collapsedSize:d=0,collapsible:m}=i,f=n[c];if(f==null||s!==f){n[c]=s;const{onCollapse:u,onExpand:h,onResize:p}=l;p&&p(s,f),m&&(u||h)&&(h&&(f==null||xe(f,d))&&!xe(s,d)&&h(),u&&(f==null||!xe(f,d))&&xe(s,d)&&u())}})}function ot(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function lr({defaultSize:t,dragState:e,layout:n,panelData:s,panelIndex:o,precision:a=3}){const l=n[o];let i;return l==null?i=t!=null?t.toPrecision(a):"1":s.length===1?i="1":i=l.toPrecision(a),{flexBasis:0,flexGrow:i,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function ir(t,e=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...o)},e)}}function Vt(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function Fn(t){return`react-resizable-panels:${t}`}function Kn(t){return t.map(e=>{const{constraints:n,id:s,idIsFromProps:o,order:a}=e;return o?s:a?`${a}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function Zn(t,e){try{const n=Fn(t),s=e.getItem(n);if(s){const o=JSON.parse(s);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function cr(t,e,n){var s,o;const a=(s=Zn(t,n))!==null&&s!==void 0?s:{},l=Kn(e);return(o=a[l])!==null&&o!==void 0?o:null}function dr(t,e,n,s,o){var a;const l=Fn(t),i=Kn(e),c=(a=Zn(t,o))!==null&&a!==void 0?a:{};c[i]={expandToSizes:Object.fromEntries(n.entries()),layout:s};try{o.setItem(l,JSON.stringify(c))}catch(d){console.error(d)}}function Ft({layout:t,panelConstraints:e}){const n=[...t],s=n.reduce((a,l)=>a+l,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(a=>`${a}%`).join(", ")}`);if(!ie(s,100)&&n.length>0)for(let a=0;a<e.length;a++){const l=n[a];T(l!=null,`No layout data found for index ${a}`);const i=100/s*l;n[a]=i}let o=0;for(let a=0;a<e.length;a++){const l=n[a];T(l!=null,`No layout data found for index ${a}`);const i=Be({panelConstraints:e,panelIndex:a,size:l});l!=i&&(o+=l-i,n[a]=i)}if(!ie(o,0))for(let a=0;a<e.length;a++){const l=n[a];T(l!=null,`No layout data found for index ${a}`);const i=l+o,c=Be({panelConstraints:e,panelIndex:a,size:i});if(l!==c&&(o-=c-l,n[a]=c,ie(o,0)))break}return n}const ur=100,Fe={getItem:t=>(Vt(Fe),Fe.getItem(t)),setItem:(t,e)=>{Vt(Fe),Fe.setItem(t,e)}},Kt={};function qn({autoSaveId:t=null,children:e,className:n="",direction:s,forwardedRef:o,id:a=null,onLayout:l=null,keyboardResizeBy:i=null,storage:c=Fe,style:d,tagName:m="div",...f}){const u=Mt(a),h=x.useRef(null),[p,v]=x.useState(null),[b,g]=x.useState([]),S=Qa(),w=x.useRef({}),z=x.useRef(new Map),I=x.useRef(0),C=x.useRef({autoSaveId:t,direction:s,dragState:p,id:u,keyboardResizeBy:i,onLayout:l,storage:c}),j=x.useRef({layout:b,panelDataArray:[],panelDataArrayChanged:!1});x.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),x.useImperativeHandle(o,()=>({getId:()=>C.current.id,getLayout:()=>{const{layout:y}=j.current;return y},setLayout:y=>{const{onLayout:P}=C.current,{layout:M,panelDataArray:k}=j.current,_=Ft({layout:y,panelConstraints:k.map(R=>R.constraints)});Wt(M,_)||(g(_),j.current.layout=_,P&&P(_),Oe(k,_,w.current))}}),[]),je(()=>{C.current.autoSaveId=t,C.current.direction=s,C.current.dragState=p,C.current.id=u,C.current.onLayout=l,C.current.storage=c}),sr({committedValuesRef:C,eagerValuesRef:j,groupId:u,layout:b,panelDataArray:j.current.panelDataArray,setLayout:g,panelGroupElement:h.current}),x.useEffect(()=>{const{panelDataArray:y}=j.current;if(t){if(b.length===0||b.length!==y.length)return;let P=Kt[t];P==null&&(P=ir(dr,ur),Kt[t]=P);const M=[...y],k=new Map(z.current);P(t,M,k,b,c)}},[t,b,c]),x.useEffect(()=>{});const O=x.useCallback(y=>{const{onLayout:P}=C.current,{layout:M,panelDataArray:k}=j.current;if(y.constraints.collapsible){const _=k.map(oe=>oe.constraints),{collapsedSize:R=0,panelSize:U,pivotIndices:Z}=ye(k,y,M);if(T(U!=null,`Panel size not found for panel "${y.id}"`),!xe(U,R)){z.current.set(y.id,U);const ne=He(k,y)===k.length-1?U-R:R-U,W=Ve({delta:ne,initialLayout:M,panelConstraints:_,pivotIndices:Z,prevLayout:M,trigger:"imperative-api"});ot(M,W)||(g(W),j.current.layout=W,P&&P(W),Oe(k,W,w.current))}}},[]),E=x.useCallback((y,P)=>{const{onLayout:M}=C.current,{layout:k,panelDataArray:_}=j.current;if(y.constraints.collapsible){const R=_.map(se=>se.constraints),{collapsedSize:U=0,panelSize:Z=0,minSize:oe=0,pivotIndices:ne}=ye(_,y,k),W=P??oe;if(xe(Z,U)){const se=z.current.get(y.id),ce=se!=null&&se>=W?se:W,me=He(_,y)===_.length-1?Z-ce:ce-Z,J=Ve({delta:me,initialLayout:k,panelConstraints:R,pivotIndices:ne,prevLayout:k,trigger:"imperative-api"});ot(k,J)||(g(J),j.current.layout=J,M&&M(J),Oe(_,J,w.current))}}},[]),A=x.useCallback(y=>{const{layout:P,panelDataArray:M}=j.current,{panelSize:k}=ye(M,y,P);return T(k!=null,`Panel size not found for panel "${y.id}"`),k},[]),$=x.useCallback((y,P)=>{const{panelDataArray:M}=j.current,k=He(M,y);return lr({defaultSize:P,dragState:p,layout:b,panelData:M,panelIndex:k})},[p,b]),D=x.useCallback(y=>{const{layout:P,panelDataArray:M}=j.current,{collapsedSize:k=0,collapsible:_,panelSize:R}=ye(M,y,P);return T(R!=null,`Panel size not found for panel "${y.id}"`),_===!0&&xe(R,k)},[]),L=x.useCallback(y=>{const{layout:P,panelDataArray:M}=j.current,{collapsedSize:k=0,collapsible:_,panelSize:R}=ye(M,y,P);return T(R!=null,`Panel size not found for panel "${y.id}"`),!_||Ce(R,k)>0},[]),K=x.useCallback(y=>{const{panelDataArray:P}=j.current;P.push(y),P.sort((M,k)=>{const _=M.order,R=k.order;return _==null&&R==null?0:_==null?-1:R==null?1:_-R}),j.current.panelDataArrayChanged=!0,S()},[S]);je(()=>{if(j.current.panelDataArrayChanged){j.current.panelDataArrayChanged=!1;const{autoSaveId:y,onLayout:P,storage:M}=C.current,{layout:k,panelDataArray:_}=j.current;let R=null;if(y){const Z=cr(y,_,M);Z&&(z.current=new Map(Object.entries(Z.expandToSizes)),R=Z.layout)}R==null&&(R=rr({panelDataArray:_}));const U=Ft({layout:R,panelConstraints:_.map(Z=>Z.constraints)});Wt(k,U)||(g(U),j.current.layout=U,P&&P(U),Oe(_,U,w.current))}}),je(()=>{const y=j.current;return()=>{y.layout=[]}},[]);const H=x.useCallback(y=>{let P=!1;const M=h.current;return M&&window.getComputedStyle(M,null).getPropertyValue("direction")==="rtl"&&(P=!0),function(_){_.preventDefault();const R=h.current;if(!R)return()=>null;const{direction:U,dragState:Z,id:oe,keyboardResizeBy:ne,onLayout:W}=C.current,{layout:se,panelDataArray:ce}=j.current,{initialLayout:ue}=Z??{},me=Gn(oe,y,R);let J=ar(_,y,U,Z,ne,R);const pe=U==="horizontal";pe&&P&&(J=-J);const ge=ce.map(Ne=>Ne.constraints),de=Ve({delta:J,initialLayout:ue??se,panelConstraints:ge,pivotIndices:me,prevLayout:se,trigger:En(_)?"keyboard":"mouse-or-touch"}),he=!ot(se,de);(Rn(_)||An(_))&&I.current!=J&&(I.current=J,!he&&J!==0?pe?wt(y,J<0?Tn:Ln):wt(y,J<0?On:Hn):wt(y,0)),he&&(g(de),j.current.layout=de,W&&W(de),Oe(ce,de,w.current))}},[]),F=x.useCallback((y,P)=>{const{onLayout:M}=C.current,{layout:k,panelDataArray:_}=j.current,R=_.map(se=>se.constraints),{panelSize:U,pivotIndices:Z}=ye(_,y,k);T(U!=null,`Panel size not found for panel "${y.id}"`);const ne=He(_,y)===_.length-1?U-P:P-U,W=Ve({delta:ne,initialLayout:k,panelConstraints:R,pivotIndices:Z,prevLayout:k,trigger:"imperative-api"});ot(k,W)||(g(W),j.current.layout=W,M&&M(W),Oe(_,W,w.current))},[]),V=x.useCallback((y,P)=>{const{layout:M,panelDataArray:k}=j.current,{collapsedSize:_=0,collapsible:R}=P,{collapsedSize:U=0,collapsible:Z,maxSize:oe=100,minSize:ne=0}=y.constraints,{panelSize:W}=ye(k,y,M);W!=null&&(R&&Z&&xe(W,_)?xe(_,U)||F(y,U):W<ne?F(y,ne):W>oe&&F(y,oe))},[F]),ee=x.useCallback((y,P)=>{const{direction:M}=C.current,{layout:k}=j.current;if(!h.current)return;const _=pt(y,h.current);T(_,`Drag handle element not found for id "${y}"`);const R=Vn(M,P);v({dragHandleId:y,dragHandleRect:_.getBoundingClientRect(),initialCursorPosition:R,initialLayout:k})},[]),X=x.useCallback(()=>{v(null)},[]),re=x.useCallback(y=>{const{panelDataArray:P}=j.current,M=He(P,y);M>=0&&(P.splice(M,1),delete w.current[y.id],j.current.panelDataArrayChanged=!0,S())},[S]),q=x.useMemo(()=>({collapsePanel:O,direction:s,dragState:p,expandPanel:E,getPanelSize:A,getPanelStyle:$,groupId:u,isPanelCollapsed:D,isPanelExpanded:L,reevaluatePanelConstraints:V,registerPanel:K,registerResizeHandle:H,resizePanel:F,startDragging:ee,stopDragging:X,unregisterPanel:re,panelGroupElement:h.current}),[O,p,s,E,A,$,u,D,L,V,K,H,F,ee,X,re]),Q={display:"flex",flexDirection:s==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return x.createElement(ut.Provider,{value:q},x.createElement(m,{...f,children:e,className:n,id:a,ref:h,style:{...Q,...d},[Y.group]:"",[Y.groupDirection]:s,[Y.groupId]:u}))}const Yn=x.forwardRef((t,e)=>x.createElement(qn,{...t,forwardedRef:e}));qn.displayName="PanelGroup";Yn.displayName="forwardRef(PanelGroup)";function He(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function ye(t,e,n){const s=He(t,e),a=s===t.length-1?[s-1,s]:[s,s+1],l=n[s];return{...e.constraints,panelSize:l,pivotIndices:a}}function fr({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:s}){x.useEffect(()=>{if(t||n==null||s==null)return;const o=pt(e,s);if(o==null)return;const a=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),n(l);break}case"F6":{l.preventDefault();const i=o.getAttribute(Y.groupId);T(i,`No group element found for id "${i}"`);const c=Ze(i,s),d=Un(i,e,s);T(d!==null,`No resize element found for id "${e}"`);const m=l.shiftKey?d>0?d-1:c.length-1:d+1<c.length?d+1:0;c[m].focus();break}}};return o.addEventListener("keydown",a),()=>{o.removeEventListener("keydown",a)}},[s,t,e,n])}function Xn({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:s,id:o,onBlur:a,onClick:l,onDragging:i,onFocus:c,onPointerDown:d,onPointerUp:m,style:f={},tabIndex:u=0,tagName:h="div",...p}){var v,b;const g=x.useRef(null),S=x.useRef({onClick:l,onDragging:i,onPointerDown:d,onPointerUp:m});x.useEffect(()=>{S.current.onClick=l,S.current.onDragging=i,S.current.onPointerDown=d,S.current.onPointerUp=m});const w=x.useContext(ut);if(w===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:z,groupId:I,registerResizeHandle:C,startDragging:j,stopDragging:O,panelGroupElement:E}=w,A=Mt(o),[$,D]=x.useState("inactive"),[L,K]=x.useState(!1),[H,F]=x.useState(null),V=x.useRef({state:$});je(()=>{V.current.state=$}),x.useEffect(()=>{if(n)F(null);else{const q=C(A);F(()=>q)}},[n,A,C]);const ee=(v=s?.coarse)!==null&&v!==void 0?v:15,X=(b=s?.fine)!==null&&b!==void 0?b:5;x.useEffect(()=>{if(n||H==null)return;const q=g.current;T(q,"Element ref not attached");let Q=!1;return Xa(A,q,z,{coarse:ee,fine:X},(P,M,k)=>{if(!M){D("inactive");return}switch(P){case"down":{D("drag"),Q=!1,T(k,'Expected event to be defined for "down" action'),j(A,k);const{onDragging:_,onPointerDown:R}=S.current;_?.(!0),R?.();break}case"move":{const{state:_}=V.current;Q=!0,_!=="drag"&&D("hover"),T(k,'Expected event to be defined for "move" action'),H(k);break}case"up":{D("hover"),O();const{onClick:_,onDragging:R,onPointerUp:U}=S.current;R?.(!1),U?.(),Q||_?.();break}}})},[ee,z,n,X,C,A,H,j,O]),fr({disabled:n,handleId:A,resizeHandler:H,panelGroupElement:E});const re={touchAction:"none",userSelect:"none"};return x.createElement(h,{...p,children:t,className:e,id:o,onBlur:()=>{K(!1),a?.()},onFocus:()=>{K(!0),c?.()},ref:g,role:"separator",style:{...re,...f},tabIndex:u,[Y.groupDirection]:z,[Y.groupId]:I,[Y.resizeHandle]:"",[Y.resizeHandleActive]:$==="drag"?"pointer":L?"keyboard":void 0,[Y.resizeHandleEnabled]:!n,[Y.resizeHandleId]:A,[Y.resizeHandleState]:$})}Xn.displayName="PanelResizeHandle";function mr(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=B("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx(Yn,{"data-slot":"resizable-panel-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function Jn(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=r.jsx(Mn,{"data-slot":"resizable-panel",...n}),e[2]=n,e[3]=s):s=e[3],s}function pr(t){const e=N.c(12);let n,s,o;e[0]!==t?({withHandle:o,className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=o):(n=e[1],s=e[2],o=e[3]);let a;e[4]!==n?(a=B("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",n),e[4]=n,e[5]=a):a=e[5];let l;e[6]!==o?(l=o&&r.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:r.jsx(un,{className:"size-2.5"})}),e[6]=o,e[7]=l):l=e[7];let i;return e[8]!==s||e[9]!==a||e[10]!==l?(i=r.jsx(Xn,{"data-slot":"resizable-handle",className:a,...s,children:l}),e[8]=s,e[9]=a,e[10]=l,e[11]=i):i=e[11],i}function Qn(){const t=N.c(3),{toggleSidebar:e}=Pt();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsx(pn,{className:"text-muted-foreground/85 group-hover:text-foreground transition-colors",size:20}),t[0]=n):n=t[0];let s;return t[1]!==e?(s=r.jsx(r.Fragment,{children:r.jsx(we,{onClick:e,size:"icon",variant:"ghost",className:"w-8 h-8 rounded-md",children:n})}),t[1]=e,t[2]=s):s=t[2],s}Qn.Skeleton=function(){return r.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})};const hr="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function Zt(t){const e=N.c(18),{showSidebarToggle:n,showOrgSwitcher:s,showDecoChat:o}=t,a=n===void 0?!1:n,l=s===void 0?!1:s,i=o===void 0?!1:o,[,c]=kt();let d;e[0]!==c?(d=()=>c(xr),e[0]=c,e[1]=d):d=e[1];const m=d;let f;e[2]!==a?(f=a&&r.jsx(st.Sidebar,{children:r.jsx(Qn,{})}),e[2]=a,e[3]=f):f=e[3];let u;e[4]!==l?(u=l&&r.jsx(x.Suspense,{fallback:r.jsx(zt.Skeleton,{}),children:r.jsx(zt,{})}),e[4]=l,e[5]=u):u=e[5];let h;e[6]!==u?(h=r.jsx(st.Left,{children:u}),e[6]=u,e[7]=h):h=e[7];let p;e[8]!==i||e[9]!==m?(p=i&&r.jsxs(we,{size:"sm",variant:"default",onClick:m,children:[r.jsx(We,{url:hr,fallback:"DC",size:"2xs",className:"rounded-sm"}),"deco chat"]}),e[8]=i,e[9]=m,e[10]=p):p=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx(Ma,{}),e[11]=v):v=e[11];let b;e[12]!==p?(b=r.jsxs(st.Right,{className:"gap-2",children:[p,v]}),e[12]=p,e[13]=b):b=e[13];let g;return e[14]!==b||e[15]!==f||e[16]!==h?(g=r.jsxs(st,{children:[f,h,b]}),e[14]=b,e[15]=f,e[16]=h,e[17]=g):g=e[17],g}function xr(t){return!t}function gr(t){const e=N.c(10),{children:n,className:s}=t,[,o]=x.useTransition();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Ye.decoChatPanelWidth(),e[0]=a):a=e[0];const[l,i]=Ge(a,30);let c;e[1]!==i?(c=u=>o(()=>i(u)),e[1]=i,e[2]=c):c=e[2];const d=c;let m;e[3]!==s?(m=B("min-w-0",s),e[3]=s,e[4]=m):m=e[4];let f;return e[5]!==l||e[6]!==n||e[7]!==d||e[8]!==m?(f=r.jsx(Jn,{defaultSize:l,minSize:20,className:m,onResize:d,children:n}),e[5]=l,e[6]=n,e[7]=d,e[8]=m,e[9]=f):f=e[9],f}function br(t){const e=N.c(5),{children:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Ye.sidebarOpen(),e[0]=s):s=e[0];const[o,a]=Ge(s,!0);let l;return e[1]!==n||e[2]!==a||e[3]!==o?(l=r.jsx(Lo,{open:o,onOpenChange:a,children:n}),e[1]=n,e[2]=a,e[3]=o,e[4]=l):l=e[4],l}function vr(){const t=N.c(9),[e]=kt();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsx(Jn,{className:"bg-background",children:r.jsx(Xt,{})}),t[0]=n):n=t[0];let s;t[1]!==e?(s=r.jsx(pr,{withHandle:e}),t[1]=e,t[2]=s):s=t[2];const o=e?"max-w-none":"max-w-0";let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx(_t,{children:r.jsx(x.Suspense,{fallback:r.jsx(Zs,{}),children:r.jsx(So,{})})}),t[3]=a):a=t[3];let l;t[4]!==o?(l=r.jsx(gr,{className:o,children:a}),t[4]=o,t[5]=l):l=t[5];let i;return t[6]!==s||t[7]!==l?(i=r.jsxs(mr,{direction:"horizontal",children:[n,s,l]}),t[6]=s,t[7]=l,t[8]=i):i=t[8],i}function yr(){const t=N.c(19);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:n}=qt(e);let s;t[1]!==n?(s=Ss.activeOrganization(n),t[1]=n,t[2]=s):s=t[2];let o;t[3]!==n?(o=async()=>{if(!n)return null;const{data:h}=await qe.organization.setActive({organizationSlug:n});return{org:h,project:{slug:Ms}}},t[3]=n,t[4]=o):o=t[4];let a;t[5]!==s||t[6]!==o?(a={queryKey:s,queryFn:o,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=s,t[6]=o,t[7]=a):a=t[7];const{data:l}=ys(a);if(!l){let h;t[8]===Symbol.for("react.memo_cache_sentinel")?(h=r.jsx(Zt,{}),t[8]=h):h=t[8];let p;return t[9]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsxs("div",{className:"min-h-screen bg-background",children:[h,r.jsx("div",{className:"pt-12",children:r.jsx(Xt,{})})]}),t[9]=p):p=t[9],p}let i;t[10]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(Zt,{showSidebarToggle:!0,showOrgSwitcher:!0,showDecoChat:!0}),t[10]=i):i=t[10];let c;t[11]===Symbol.for("react.memo_cache_sentinel")?(c={"--sidebar-width":"13rem","--sidebar-width-mobile":"11rem"},t[11]=c):c=t[11];let d;t[12]===Symbol.for("react.memo_cache_sentinel")?(d=r.jsx(na,{}),t[12]=d):d=t[12];let m;t[13]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(br,{children:r.jsxs("div",{className:"flex flex-col h-screen",children:[i,r.jsxs(Bo,{className:"flex-1 bg-sidebar",style:c,children:[d,r.jsx(Go,{className:"pt-12",children:r.jsx(vr,{})})]})]})}),t[13]=m):m=t[13];let f;t[14]!==l.org.slug?(f=r.jsx(uo,{children:m},l.org.slug),t[14]=l.org.slug,t[15]=f):f=t[15];let u;return t[16]!==l||t[17]!==f?(u=r.jsx($s,{...l,children:f}),t[16]=l,t[17]=f,t[18]=u):u=t[18],u}function il(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(Ea,{children:r.jsx(x.Suspense,{fallback:r.jsx(Yt,{}),children:r.jsx(yr,{})})}),t[0]=e):e=t[0],e}export{il as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as C,h as d,j as a}from"./index-
|
|
1
|
+
import{c as C,h as d,j as a}from"./index-DPFREQMN.js";import{c as m}from"./utils-BDWLM78M.js";const u=d("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",special:"fill-special text-backround"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function p(f){const e=C.c(10),{variant:c,size:o}=f;let t;e[0]!==o||e[1]!==c?(t=m(u({variant:c,size:o})),e[0]=o,e[1]=c,e[2]=t):t=e[2];let l,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i=a.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=l,e[4]=i):(l=e[3],i=e[4]);let s;e[5]!==t?(s=a.jsxs("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l,i]}),e[5]=t,e[6]=s):s=e[6];let r;e[7]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=r):r=e[7];let n;return e[8]!==s?(n=a.jsxs("div",{role:"status",children:[s,r]}),e[8]=s,e[9]=n):n=e[9],n}export{p as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as q,c as _,j as s,f as ve,d as ke,b as Se,a as Ie,t as he}from"./index-C4a1DvcM.js";import{i as _e}from"./AlertCircle-Cu9USDUK.js";import{i as je}from"./Loading01-BUZAT-Ht.js";import{B as ie}from"./button-Chm7HSn5.js";import{i as Le}from"./ArrowLeft-nKBVB_NL.js";import{I as ye,a as Ae,u as De,b as Ee,c as Me}from"./use-connection-8aFd9ZgQ.js";import{i as Ue}from"./CheckCircle-BogvGi-0.js";import{t as Ve}from"./ChevronDown-B5vWNgW1.js";import{s as ge}from"./Plus-DTWKiMkv.js";import{b as $e,D as Re,a as Pe,c as ze}from"./dropdown-menu-MeaPHHuN.js";import{n as be}from"./LinkExternal01-DhNFEAza.js";import{E as Be}from"./SearchMd-BXC4Yoz_.js";import{T as Ge,R as Fe}from"./tools-list-Cw4QW2l7.js";import{R as Oe}from"./resource-tabs-n23Yoxcd.js";import{a as He}from"./use-binding-C1zXgwae.js";import{u as We}from"./use-tool-call-Dxebi6Uq.js";import{u as Ke}from"./use-mcp-BJzX7M7c.js";import{u as Ne}from"./tooltip-DZ8PMo3S.js";import{e as Ze}from"./extract-connection-data-BSn-ydRW.js";import{s as qe}from"./slugify-CEUa2lfQ.js";import{f as Je,e as Qe,b as Xe,c as Ye,g as et}from"./registry-utils-ulDDT0d8.js";import{e as tt}from"./app-name-gTETL9So.js";import{i as st}from"./InfoCircle-C21KXVBJ.js";import"./utils-BXNVuJET.js";import"./Grid01-4uSGUJjV.js";import"./useQuery-39cprZL6.js";import"./File06-Cn7JLPIx.js";import"./collection-display-button-DDw_0fW6.js";import"./collection-search-CBHWh6W9.js";import"./input-DCV4VviT.js";import"./collection-table-wrapper-CGsO_-78.js";import"./card-BVamKRXq.js";import"./layout-BkDVhV_I.js";import"./badge-RGvdF-cd.js";import"./auth-DB_JGgAS.js";import"./generate-id-Dyweu44Y.js";const we=({size:t=24,color:e="currentColor",...o})=>q.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},q.createElement("path",{d:"m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"}));we.displayName="SearchLg";function ot(t){const e=_.c(3),{message:o}=t,n=o===void 0?"Loading app details...":o;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(je,{size:48,className:"animate-spin mb-4"}),e[0]=r):r=e[0];let i;return e[1]!==n?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,s.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),e[1]=n,e[2]=i):i=e[2],i}function rt(t){const e=_.c(9),{error:o,onBack:n}=t,r=o instanceof Error?o.message:o;let i,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(_e,{size:48,className:"text-destructive mb-4"}),d=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading app"}),e[0]=i,e[1]=d):(i=e[0],d=e[1]);let a;e[2]!==r?(a=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:r}),e[2]=r,e[3]=a):a=e[3];let l;e[4]!==n?(l=s.jsx("button",{onClick:n,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=n,e[5]=l):l=e[5];let m;return e[6]!==a||e[7]!==l?(m=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,d,a,l]}),e[6]=a,e[7]=l,e[8]=m):m=e[8],m}function nt(t){const e=_.c(5),{onBack:o}=t;let n,r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(we,{size:48,className:"text-muted-foreground mb-4"}),r=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"App not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The app you're looking for doesn't exist in this store."}),e[0]=n,e[1]=r,e[2]=i):(n=e[0],r=e[1],i=e[2]);let d;return e[3]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,r,i,s.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=o,e[4]=d):d=e[4],d}function it(t){const e=_.c(3),{onBack:o}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Le,{}),e[0]=n):n=e[0];let r;return e[1]!==o?(r=s.jsx("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:s.jsx("div",{className:"flex h-full px-2 border-r items-center",children:s.jsx(ie,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:n})})}),e[1]=o,e[2]=r):r=e[2],r}function lt(t){const e=_.c(25),{data:o,itemVersions:n,onInstall:r,canInstall:i,isInstalling:d}=t,a=i===void 0?!0:i,l=d===void 0?!1:d,[m,p]=q.useState(0);let x;e[0]!==r?(x=S=>{p(S),r(S)},e[0]=r,e[1]=x):x=e[1];const f=x;let h;e[2]!==o.icon||e[3]!==o.name?(h=s.jsx(ye,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[2]=o.icon,e[3]=o.name,e[4]=h):h=e[4];let g;e[5]!==o.name?(g=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[5]=o.name,e[6]=g):g=e[6];let b;e[7]!==o.verified?(b=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[7]=o.verified,e[8]=b):b=e[8];let y;e[9]!==g||e[10]!==b?(y=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[g,b]})}),e[9]=g,e[10]=b,e[11]=y):y=e[11];let N;e[12]!==a||e[13]!==f||e[14]!==l||e[15]!==n||e[16]!==r||e[17]!==m?(N=a?s.jsx("div",{className:"shrink-0",children:n.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ie,{variant:"brand",onClick:()=>f(0),disabled:l,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(ge,{size:20}),l?"Connecting...":"Connect MCP Server"]}),s.jsxs($e,{children:[s.jsx(Re,{asChild:!0,children:s.jsx(ie,{variant:"brand",disabled:l,className:"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer",children:s.jsx(Ve,{size:20})})}),s.jsx(Pe,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:n.map((S,C)=>{const I=S._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(ze,{onClick:()=>f(C),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",S.server?.version||"unknown"]}),I?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),C===m&&s.jsx(Ue,{size:16,className:"text-muted-foreground shrink-0"})]})},C)})})]})]}):s.jsxs(ie,{variant:"brand",onClick:()=>r(),disabled:n.length===0||l,className:"shrink-0",children:[s.jsx(ge,{size:20}),l?"Connecting...":"Connect MCP Server"]})}):s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[12]=a,e[13]=f,e[14]=l,e[15]=n,e[16]=r,e[17]=m,e[18]=N):N=e[18];let w;e[19]!==y||e[20]!==N?(w=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[y,N]}),e[19]=y,e[20]=N,e[21]=w):w=e[21];let k;return e[22]!==h||e[23]!==w?(k=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[h,w]}),e[22]=h,e[23]=w,e[24]=k):k=e[24],k}function at(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function ct(t){const e=_.c(45),{data:o,publisherInfo:n,selectedItem:r}=t;let i;e[0]!==o.description?(i=o.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:o.description})]}),e[0]=o.description,e[1]=i):i=e[1];const d=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let a;e[2]!==n.logo||e[3]!==d?(a=s.jsx(ye,{icon:n.logo,name:d,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=n.logo,e[3]=d,e[4]=a):a=e[4];let l;e[5]!==o.publisher?(l=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher.charAt(0).toUpperCase()+o.publisher.slice(1),e[5]=o.publisher,e[6]=l):l=e[6];let m;e[7]!==l?(m=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=m):m=e[8];let p;e[9]!==n.count?(p=n.count>0?s.jsxs(s.Fragment,{children:[s.jsx("img",{src:"/globe.svg",alt:"globe",className:"w-3 h-3"}),s.jsxs("span",{children:[n.count," ",n.count===1?"published app":"published apps"]})]}):"Publisher",e[9]=n.count,e[10]=p):p=e[10];let x;e[11]!==p?(x=s.jsx("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:p}),e[11]=p,e[12]=x):x=e[12];let f;e[13]!==m||e[14]!==x?(f=s.jsxs("div",{children:[m,x]}),e[13]=m,e[14]=x,e[15]=f):f=e[15];let h;e[16]!==a||e[17]!==f?(h=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[a,f]})}),e[16]=a,e[17]=f,e[18]=h):h=e[18];let g;e[19]!==o.version?(g=o.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Version"}),s.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",o.version]})]}),e[19]=o.version,e[20]=g):g=e[20];let b;e[21]!==o.connectionType?(b=o.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:o.connectionType})]}),e[21]=o.connectionType,e[22]=b):b=e[22];let y;e[23]!==o.schemaVersion?(y=o.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:o.schemaVersion})]}),e[23]=o.schemaVersion,e[24]=y):y=e[24];let N;e[25]!==o.websiteUrl?(N=o.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Website"}),s.jsxs("a",{href:o.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"Visit"}),s.jsx(be,{size:14})]})]}),e[25]=o.websiteUrl,e[26]=N):N=e[26];let w;e[27]!==o.repository?(w=o.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Source"}),s.jsxs("a",{href:o.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"GitHub"}),s.jsx(be,{size:14})]})]}),e[27]=o.repository,e[28]=w):w=e[28];let k;e[29]!==g||e[30]!==b||e[31]!==y||e[32]!==N||e[33]!==w?(k=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[g,b,y,N,w]}),e[29]=g,e[30]=b,e[31]=y,e[32]=N,e[33]=w,e[34]=k):k=e[34];let S;e[35]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[35]=S):S=e[35];let C;e[36]!==r.updated_at?(C=at(r.updated_at),e[36]=r.updated_at,e[37]=C):C=e[37];let I;e[38]!==C?(I=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[S,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:C})]}),e[38]=C,e[39]=I):I=e[39];let u;return e[40]!==i||e[41]!==k||e[42]!==I||e[43]!==h?(u=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,h,k,I]}),e[40]=i,e[41]=k,e[42]=I,e[43]=h,e[44]=u):u=e[44],u}function dt(t){const e=_.c(18),{data:o,availableTabs:n,effectiveActiveTabId:r,effectiveTools:i,isLoadingTools:d,onTabChange:a}=t,l=d===void 0?!1:d;let m;e[0]!==i?(m=i.map(mt),e[0]=i,e[1]=m):m=e[1];const p=m;let x;e[2]!==n||e[3]!==r||e[4]!==a?(x=n.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(Oe,{tabs:n,activeTab:r,onTabChange:a})}),e[2]=n,e[3]=r,e[4]=a,e[5]=x):x=e[5];let f;e[6]!==r||e[7]!==i.length||e[8]!==l||e[9]!==p?(f=r==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:l?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(je,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Ge,{tools:p,showToolbar:!1,emptyMessage:"This app doesn't have any tools."}):s.jsx(Be,{image:null,title:"No tools available",description:"This app doesn't have any tools."})}),e[6]=r,e[7]=i.length,e[8]=l,e[9]=p,e[10]=f):f=e[10];let h;e[11]!==o?.repository||e[12]!==r?(h=r==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Fe,{repository:o?.repository})}),e[11]=o?.repository,e[12]=r,e[13]=h):h=e[13];let g;return e[14]!==x||e[15]!==f||e[16]!==h?(g=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[x,f,h]}),e[14]=x,e[15]=f,e[16]=h,e[17]=g):g=e[17],g}function mt(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function ft(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(n=>n.app_name?.toLowerCase()===o||n.app_id?.toLowerCase()===o||n.title.toLowerCase()===o)||t.find(n=>n.title.toLowerCase().includes(o))}function ut(t,e,o,n,r){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:n?.icon||void 0,count:r??t.length};const i=e.toLowerCase(),d=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:o?.icon||d[0]?.publisher_logo||d[0]?.icon||void 0,count:d.length}}function pt(t){const e=t.server._meta?.["mcp.mesh/publisher-provided"],o=t._meta?.["mcp.mesh"],n=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,i=Xe(r.remotes?.[0]?.type),d=Ye(r.$schema),a=n?"io.modelcontextprotocol.registry/official":t.publisher||o?.scopeName||"Unknown",l=et(r.repository),m=t.icon||t.image||t.logo||r.icons?.[0]?.src||l||null,p=t.name||t.title||t.server?.title||"Unnamed Item";return{name:tt(p),description:t.description||t.summary||t.server?.description||"",icon:m,verified:t.verified||o?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:d??null,connectionType:i,connectionUrl:null,remoteUrl:null,tools:t.tools||r.tools||e?.tools||[],models:t.models||r.models||e?.models||[],emails:t.emails||r.emails||e?.emails||[],analytics:t.analytics||r.analytics||e?.analytics,cdn:t.cdn||r.cdn||e?.cdn}}class xt extends q.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store app detail error:",e,o)}render(){return this.state.hasError?s.jsx(rt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ht(){const t=_.c(70),{org:e}=Ne(),o=ve();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{appName:r}=ke(n);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:d,serverName:a}=Se(i),[l,m]=q.useState("readme"),p=Ae(),x=De(),{data:f}=Ie.useSession(),h=He(x),g=d||h[0]?.id||"",b=Ee(g),y=Je(b?.tools),N=b?.tools&&b.tools.find(yt)?.name||"",w=b?.tools&&b.tools.find(jt)?.name||"",k=Me(g),S=!!a;let C,I;S?(C=N||w,I={name:a}):(C=y,I={});const{data:u}=We({toolCaller:k,toolName:C,toolInputParams:I,scope:g});let E=[],L=[],pe=null;if(u){if(Array.isArray(u))E=u;else if(typeof u=="object"&&u!==null)if("totalCount"in u&&typeof u.totalCount=="number"&&(pe=u.totalCount),"item"in u&&u.item){const c=u.item,T=c.id||"",M=c.server,U=c._meta;let D;t[2]!==c.title||t[3]!==T||t[4]!==M||t[5]!==U?(D=[{id:T,title:c.title,server:M,_meta:U}],t[2]=c.title,t[3]=T,t[4]=M,t[5]=U,t[6]=D):D=t[6],E=D}else{let c;"versions"in u&&Array.isArray(u.versions)?c="versions":"servers"in u&&Array.isArray(u.servers)?c="servers":c=Object.keys(u).find(T=>Array.isArray(u[T])),c&&(E=u[c],(c==="versions"||C?.includes("VERSIONS"))&&(L=E))}}let X;t[7]!==r?(X=c=>{const T=c.name||c.title||c.server.title||"";return qe(T)===r},t[7]=r,t[8]=X):X=t[8];let j=E.find(X);if(!j&&a){let c;t[9]!==a?(c=T=>T.server.name===a||T.name===a||T.title===a,t[9]=a,t[10]=c):c=t[10],j=E.find(c)}const v=j?pt(j):null,le=(v?.tools?.length||0)>0,ae=j?.server?.remotes?.[0]?.url||null,J=!le&&!!ae,Q=Ke({url:J?ae:""}),Y=J&&Q.state==="connecting";let ee;t[11]!==Q||t[12]!==J?(ee=J&&Q.state==="ready"?(Q.tools||[]).map(vt):[],t[11]=Q,t[12]=J,t[13]=ee):ee=t[13];const xe=ee,V=le?v?.tools||[]:xe,Ce=ft(x,v?.publisher),ce=v?ut(E,v.publisher,Ce,b??null,pe):{count:0},Te=v?.repository?Qe(v.repository):null,de=!!v?.repository&&!!Te;let $;t[14]!==de?($={id:"readme",label:"README",visible:de},t[14]=de,t[15]=$):$=t[15];const me=le||xe.length>0||Y&&!!ae;let R;t[16]!==V.length||t[17]!==me?(R={id:"tools",label:"Tools",count:V.length,visible:me},t[16]=V.length,t[17]=me,t[18]=R):R=t[18];let te;t[19]!==$||t[20]!==R?(te=[$,R].filter(bt),t[19]=$,t[20]=R,t[21]=te):te=t[21];const A=te;let se;t[22]!==l||t[23]!==A?(se=A.find(c=>c.id===l)?l:A.find(gt)?.id||A[0]?.id||"overview",t[22]=l,t[23]=A,t[24]=se):se=t[24];const fe=se;let oe;t[25]!==p||t[26]!==L||t[27]!==o||t[28]!==e||t[29]!==j||t[30]!==f?(oe=async c=>{const T=L[c??0]||j;if(!T||!e||!f?.user?.id)return;const M=Ze(T,e.id,f.user.id);if(!M.connection_url){he.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:U}=await p.create.mutateAsync(M);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:U}})}catch(U){const D=U;he.error(`Failed to connect MCP Server: ${D instanceof Error?D.message:String(D)}`)}},t[25]=p,t[26]=L,t[27]=o,t[28]=e,t[29]=j,t[30]=f,t[31]=oe):oe=t[31];const ue=oe;let re;t[32]!==o||t[33]!==e.slug?(re=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[32]=o,t[33]=e.slug,t[34]=re):re=t[34];const P=re;if(!j){let c;return t[35]!==P?(c=s.jsx(nt,{onBack:P}),t[35]=P,t[36]=c):c=t[36],c}if(!v)return null;const z=(j?.server?.remotes?.length??0)>0;let B;t[37]!==P?(B=s.jsx(it,{onBack:P}),t[37]=P,t[38]=B):B=t[38];let G;t[39]!==z?(G=!z&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(st,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=z,t[40]=G):G=t[40];let F;t[41]!==L||t[42]!==j?(F=L.length>0?L:[j],t[41]=L,t[42]=j,t[43]=F):F=t[43];let O;t[44]!==p.create.isPending||t[45]!==z||t[46]!==v||t[47]!==ue||t[48]!==F?(O=s.jsx(lt,{data:v,itemVersions:F,onInstall:ue,canInstall:z,isInstalling:p.create.isPending}),t[44]=p.create.isPending,t[45]=z,t[46]=v,t[47]=ue,t[48]=F,t[49]=O):O=t[49];let H;t[50]!==v||t[51]!==ce||t[52]!==j?(H=s.jsx(ct,{data:v,publisherInfo:ce,selectedItem:j}),t[50]=v,t[51]=ce,t[52]=j,t[53]=H):H=t[53];let W;t[54]!==A||t[55]!==v||t[56]!==fe||t[57]!==V||t[58]!==Y?(W=s.jsx(dt,{data:v,availableTabs:A,effectiveActiveTabId:fe,effectiveTools:V,isLoadingTools:Y,onTabChange:m}),t[54]=A,t[55]=v,t[56]=fe,t[57]=V,t[58]=Y,t[59]=W):W=t[59];let K;t[60]!==H||t[61]!==W?(K=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[H,W]}),t[60]=H,t[61]=W,t[62]=K):K=t[62];let Z;t[63]!==G||t[64]!==O||t[65]!==K?(Z=s.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"h-full",children:[G,O,K]})})}),t[63]=G,t[64]=O,t[65]=K,t[66]=Z):Z=t[66];let ne;return t[67]!==B||t[68]!==Z?(ne=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[B,Z]}),t[67]=B,t[68]=Z,t[69]=ne):ne=t[69],ne}function gt(t){return t.id==="readme"}function bt(t){return t.visible}function vt(t){return{name:t.name,description:t.description}}function jt(t){return t.name.endsWith("_GET")}function yt(t){return t.name.endsWith("_VERSIONS")}function rs(){const t=_.c(6),{org:e}=Ne(),o=ve();let n;t[0]!==o||t[1]!==e.slug?(n=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=n):n=t[2];const r=n;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(q.Suspense,{fallback:s.jsx(ot,{}),children:s.jsx(ht,{})}),t[3]=i):i=t[3];let d;return t[4]!==r?(d=s.jsx(xt,{onBack:r,children:i}),t[4]=r,t[5]=d):d=t[5],d}export{rs as default};
|
|
1
|
+
import{r as q,c as _,j as s,f as ve,d as ke,b as Se,a as Ie,t as he}from"./index-DPFREQMN.js";import{i as _e}from"./AlertCircle-CctpU08Y.js";import{i as je}from"./Loading01-DhMR9Rl3.js";import{B as ie}from"./button-DRbSSzMo.js";import{i as Le}from"./ArrowLeft-DMs-Q5a_.js";import{I as ye,a as Ae,u as De,b as Ee,c as Me}from"./use-connection-BObBSW3a.js";import{i as Ue}from"./CheckCircle-gjG4WSw6.js";import{t as Ve}from"./ChevronDown-o688tr0R.js";import{s as ge}from"./Plus-BoTbvZ3o.js";import{b as $e,D as Re,a as Pe,c as ze}from"./dropdown-menu-ZynV4CKZ.js";import{n as be}from"./LinkExternal01-OAVXSkWT.js";import{E as Be}from"./SearchMd-Cle1NAvW.js";import{T as Ge,R as Fe}from"./tools-list-BtqQwWMd.js";import{R as Oe}from"./resource-tabs-BA7yau3f.js";import{a as He}from"./use-binding-CWUVDcMm.js";import{u as We}from"./use-tool-call-DJqpt8-4.js";import{u as Ke}from"./use-mcp-feMLqae5.js";import{u as Ne}from"./tooltip-T6rRsM2k.js";import{e as Ze}from"./extract-connection-data-Cqx4p3NY.js";import{s as qe}from"./slugify-CEUa2lfQ.js";import{f as Je,e as Qe,b as Xe,c as Ye,g as et}from"./registry-utils-ulDDT0d8.js";import{e as tt}from"./app-name-gTETL9So.js";import{i as st}from"./InfoCircle-D52jwcjZ.js";import"./utils-BDWLM78M.js";import"./Grid01-DKsOPPqt.js";import"./useQuery-BDJatAa4.js";import"./File06-Bt03vXoe.js";import"./collection-display-button-CxHAeMlJ.js";import"./collection-search-CAT-KwFV.js";import"./input-jqtlIgj3.js";import"./collection-table-wrapper-CpATqDDy.js";import"./card-yDshgaNk.js";import"./layout-CkdsMZBx.js";import"./badge-ZGSDRM2V.js";import"./auth-l7FoQBwy.js";import"./generate-id-Dyweu44Y.js";const we=({size:t=24,color:e="currentColor",...o})=>q.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},q.createElement("path",{d:"m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"}));we.displayName="SearchLg";function ot(t){const e=_.c(3),{message:o}=t,n=o===void 0?"Loading app details...":o;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(je,{size:48,className:"animate-spin mb-4"}),e[0]=r):r=e[0];let i;return e[1]!==n?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,s.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),e[1]=n,e[2]=i):i=e[2],i}function rt(t){const e=_.c(9),{error:o,onBack:n}=t,r=o instanceof Error?o.message:o;let i,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(_e,{size:48,className:"text-destructive mb-4"}),d=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading app"}),e[0]=i,e[1]=d):(i=e[0],d=e[1]);let a;e[2]!==r?(a=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:r}),e[2]=r,e[3]=a):a=e[3];let l;e[4]!==n?(l=s.jsx("button",{onClick:n,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=n,e[5]=l):l=e[5];let m;return e[6]!==a||e[7]!==l?(m=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,d,a,l]}),e[6]=a,e[7]=l,e[8]=m):m=e[8],m}function nt(t){const e=_.c(5),{onBack:o}=t;let n,r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(we,{size:48,className:"text-muted-foreground mb-4"}),r=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"App not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The app you're looking for doesn't exist in this store."}),e[0]=n,e[1]=r,e[2]=i):(n=e[0],r=e[1],i=e[2]);let d;return e[3]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,r,i,s.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=o,e[4]=d):d=e[4],d}function it(t){const e=_.c(3),{onBack:o}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Le,{}),e[0]=n):n=e[0];let r;return e[1]!==o?(r=s.jsx("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:s.jsx("div",{className:"flex h-full px-2 border-r items-center",children:s.jsx(ie,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:n})})}),e[1]=o,e[2]=r):r=e[2],r}function lt(t){const e=_.c(25),{data:o,itemVersions:n,onInstall:r,canInstall:i,isInstalling:d}=t,a=i===void 0?!0:i,l=d===void 0?!1:d,[m,p]=q.useState(0);let x;e[0]!==r?(x=S=>{p(S),r(S)},e[0]=r,e[1]=x):x=e[1];const f=x;let h;e[2]!==o.icon||e[3]!==o.name?(h=s.jsx(ye,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[2]=o.icon,e[3]=o.name,e[4]=h):h=e[4];let g;e[5]!==o.name?(g=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[5]=o.name,e[6]=g):g=e[6];let b;e[7]!==o.verified?(b=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[7]=o.verified,e[8]=b):b=e[8];let y;e[9]!==g||e[10]!==b?(y=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[g,b]})}),e[9]=g,e[10]=b,e[11]=y):y=e[11];let N;e[12]!==a||e[13]!==f||e[14]!==l||e[15]!==n||e[16]!==r||e[17]!==m?(N=a?s.jsx("div",{className:"shrink-0",children:n.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ie,{variant:"brand",onClick:()=>f(0),disabled:l,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(ge,{size:20}),l?"Connecting...":"Connect MCP Server"]}),s.jsxs($e,{children:[s.jsx(Re,{asChild:!0,children:s.jsx(ie,{variant:"brand",disabled:l,className:"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer",children:s.jsx(Ve,{size:20})})}),s.jsx(Pe,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:n.map((S,C)=>{const I=S._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(ze,{onClick:()=>f(C),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",S.server?.version||"unknown"]}),I?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),C===m&&s.jsx(Ue,{size:16,className:"text-muted-foreground shrink-0"})]})},C)})})]})]}):s.jsxs(ie,{variant:"brand",onClick:()=>r(),disabled:n.length===0||l,className:"shrink-0",children:[s.jsx(ge,{size:20}),l?"Connecting...":"Connect MCP Server"]})}):s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[12]=a,e[13]=f,e[14]=l,e[15]=n,e[16]=r,e[17]=m,e[18]=N):N=e[18];let w;e[19]!==y||e[20]!==N?(w=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[y,N]}),e[19]=y,e[20]=N,e[21]=w):w=e[21];let k;return e[22]!==h||e[23]!==w?(k=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[h,w]}),e[22]=h,e[23]=w,e[24]=k):k=e[24],k}function at(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function ct(t){const e=_.c(45),{data:o,publisherInfo:n,selectedItem:r}=t;let i;e[0]!==o.description?(i=o.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:o.description})]}),e[0]=o.description,e[1]=i):i=e[1];const d=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let a;e[2]!==n.logo||e[3]!==d?(a=s.jsx(ye,{icon:n.logo,name:d,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=n.logo,e[3]=d,e[4]=a):a=e[4];let l;e[5]!==o.publisher?(l=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher.charAt(0).toUpperCase()+o.publisher.slice(1),e[5]=o.publisher,e[6]=l):l=e[6];let m;e[7]!==l?(m=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=m):m=e[8];let p;e[9]!==n.count?(p=n.count>0?s.jsxs(s.Fragment,{children:[s.jsx("img",{src:"/globe.svg",alt:"globe",className:"w-3 h-3"}),s.jsxs("span",{children:[n.count," ",n.count===1?"published app":"published apps"]})]}):"Publisher",e[9]=n.count,e[10]=p):p=e[10];let x;e[11]!==p?(x=s.jsx("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:p}),e[11]=p,e[12]=x):x=e[12];let f;e[13]!==m||e[14]!==x?(f=s.jsxs("div",{children:[m,x]}),e[13]=m,e[14]=x,e[15]=f):f=e[15];let h;e[16]!==a||e[17]!==f?(h=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[a,f]})}),e[16]=a,e[17]=f,e[18]=h):h=e[18];let g;e[19]!==o.version?(g=o.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Version"}),s.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",o.version]})]}),e[19]=o.version,e[20]=g):g=e[20];let b;e[21]!==o.connectionType?(b=o.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:o.connectionType})]}),e[21]=o.connectionType,e[22]=b):b=e[22];let y;e[23]!==o.schemaVersion?(y=o.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:o.schemaVersion})]}),e[23]=o.schemaVersion,e[24]=y):y=e[24];let N;e[25]!==o.websiteUrl?(N=o.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Website"}),s.jsxs("a",{href:o.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"Visit"}),s.jsx(be,{size:14})]})]}),e[25]=o.websiteUrl,e[26]=N):N=e[26];let w;e[27]!==o.repository?(w=o.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Source"}),s.jsxs("a",{href:o.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"GitHub"}),s.jsx(be,{size:14})]})]}),e[27]=o.repository,e[28]=w):w=e[28];let k;e[29]!==g||e[30]!==b||e[31]!==y||e[32]!==N||e[33]!==w?(k=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[g,b,y,N,w]}),e[29]=g,e[30]=b,e[31]=y,e[32]=N,e[33]=w,e[34]=k):k=e[34];let S;e[35]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[35]=S):S=e[35];let C;e[36]!==r.updated_at?(C=at(r.updated_at),e[36]=r.updated_at,e[37]=C):C=e[37];let I;e[38]!==C?(I=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[S,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:C})]}),e[38]=C,e[39]=I):I=e[39];let u;return e[40]!==i||e[41]!==k||e[42]!==I||e[43]!==h?(u=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,h,k,I]}),e[40]=i,e[41]=k,e[42]=I,e[43]=h,e[44]=u):u=e[44],u}function dt(t){const e=_.c(18),{data:o,availableTabs:n,effectiveActiveTabId:r,effectiveTools:i,isLoadingTools:d,onTabChange:a}=t,l=d===void 0?!1:d;let m;e[0]!==i?(m=i.map(mt),e[0]=i,e[1]=m):m=e[1];const p=m;let x;e[2]!==n||e[3]!==r||e[4]!==a?(x=n.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(Oe,{tabs:n,activeTab:r,onTabChange:a})}),e[2]=n,e[3]=r,e[4]=a,e[5]=x):x=e[5];let f;e[6]!==r||e[7]!==i.length||e[8]!==l||e[9]!==p?(f=r==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:l?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(je,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Ge,{tools:p,showToolbar:!1,emptyMessage:"This app doesn't have any tools."}):s.jsx(Be,{image:null,title:"No tools available",description:"This app doesn't have any tools."})}),e[6]=r,e[7]=i.length,e[8]=l,e[9]=p,e[10]=f):f=e[10];let h;e[11]!==o?.repository||e[12]!==r?(h=r==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Fe,{repository:o?.repository})}),e[11]=o?.repository,e[12]=r,e[13]=h):h=e[13];let g;return e[14]!==x||e[15]!==f||e[16]!==h?(g=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[x,f,h]}),e[14]=x,e[15]=f,e[16]=h,e[17]=g):g=e[17],g}function mt(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function ft(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(n=>n.app_name?.toLowerCase()===o||n.app_id?.toLowerCase()===o||n.title.toLowerCase()===o)||t.find(n=>n.title.toLowerCase().includes(o))}function ut(t,e,o,n,r){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:n?.icon||void 0,count:r??t.length};const i=e.toLowerCase(),d=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:o?.icon||d[0]?.publisher_logo||d[0]?.icon||void 0,count:d.length}}function pt(t){const e=t.server._meta?.["mcp.mesh/publisher-provided"],o=t._meta?.["mcp.mesh"],n=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,i=Xe(r.remotes?.[0]?.type),d=Ye(r.$schema),a=n?"io.modelcontextprotocol.registry/official":t.publisher||o?.scopeName||"Unknown",l=et(r.repository),m=t.icon||t.image||t.logo||r.icons?.[0]?.src||l||null,p=t.name||t.title||t.server?.title||"Unnamed Item";return{name:tt(p),description:t.description||t.summary||t.server?.description||"",icon:m,verified:t.verified||o?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:d??null,connectionType:i,connectionUrl:null,remoteUrl:null,tools:t.tools||r.tools||e?.tools||[],models:t.models||r.models||e?.models||[],emails:t.emails||r.emails||e?.emails||[],analytics:t.analytics||r.analytics||e?.analytics,cdn:t.cdn||r.cdn||e?.cdn}}class xt extends q.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store app detail error:",e,o)}render(){return this.state.hasError?s.jsx(rt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ht(){const t=_.c(70),{org:e}=Ne(),o=ve();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{appName:r}=ke(n);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:d,serverName:a}=Se(i),[l,m]=q.useState("readme"),p=Ae(),x=De(),{data:f}=Ie.useSession(),h=He(x),g=d||h[0]?.id||"",b=Ee(g),y=Je(b?.tools),N=b?.tools&&b.tools.find(yt)?.name||"",w=b?.tools&&b.tools.find(jt)?.name||"",k=Me(g),S=!!a;let C,I;S?(C=N||w,I={name:a}):(C=y,I={});const{data:u}=We({toolCaller:k,toolName:C,toolInputParams:I,scope:g});let E=[],L=[],pe=null;if(u){if(Array.isArray(u))E=u;else if(typeof u=="object"&&u!==null)if("totalCount"in u&&typeof u.totalCount=="number"&&(pe=u.totalCount),"item"in u&&u.item){const c=u.item,T=c.id||"",M=c.server,U=c._meta;let D;t[2]!==c.title||t[3]!==T||t[4]!==M||t[5]!==U?(D=[{id:T,title:c.title,server:M,_meta:U}],t[2]=c.title,t[3]=T,t[4]=M,t[5]=U,t[6]=D):D=t[6],E=D}else{let c;"versions"in u&&Array.isArray(u.versions)?c="versions":"servers"in u&&Array.isArray(u.servers)?c="servers":c=Object.keys(u).find(T=>Array.isArray(u[T])),c&&(E=u[c],(c==="versions"||C?.includes("VERSIONS"))&&(L=E))}}let X;t[7]!==r?(X=c=>{const T=c.name||c.title||c.server.title||"";return qe(T)===r},t[7]=r,t[8]=X):X=t[8];let j=E.find(X);if(!j&&a){let c;t[9]!==a?(c=T=>T.server.name===a||T.name===a||T.title===a,t[9]=a,t[10]=c):c=t[10],j=E.find(c)}const v=j?pt(j):null,le=(v?.tools?.length||0)>0,ae=j?.server?.remotes?.[0]?.url||null,J=!le&&!!ae,Q=Ke({url:J?ae:""}),Y=J&&Q.state==="connecting";let ee;t[11]!==Q||t[12]!==J?(ee=J&&Q.state==="ready"?(Q.tools||[]).map(vt):[],t[11]=Q,t[12]=J,t[13]=ee):ee=t[13];const xe=ee,V=le?v?.tools||[]:xe,Ce=ft(x,v?.publisher),ce=v?ut(E,v.publisher,Ce,b??null,pe):{count:0},Te=v?.repository?Qe(v.repository):null,de=!!v?.repository&&!!Te;let $;t[14]!==de?($={id:"readme",label:"README",visible:de},t[14]=de,t[15]=$):$=t[15];const me=le||xe.length>0||Y&&!!ae;let R;t[16]!==V.length||t[17]!==me?(R={id:"tools",label:"Tools",count:V.length,visible:me},t[16]=V.length,t[17]=me,t[18]=R):R=t[18];let te;t[19]!==$||t[20]!==R?(te=[$,R].filter(bt),t[19]=$,t[20]=R,t[21]=te):te=t[21];const A=te;let se;t[22]!==l||t[23]!==A?(se=A.find(c=>c.id===l)?l:A.find(gt)?.id||A[0]?.id||"overview",t[22]=l,t[23]=A,t[24]=se):se=t[24];const fe=se;let oe;t[25]!==p||t[26]!==L||t[27]!==o||t[28]!==e||t[29]!==j||t[30]!==f?(oe=async c=>{const T=L[c??0]||j;if(!T||!e||!f?.user?.id)return;const M=Ze(T,e.id,f.user.id);if(!M.connection_url){he.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:U}=await p.create.mutateAsync(M);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:U}})}catch(U){const D=U;he.error(`Failed to connect MCP Server: ${D instanceof Error?D.message:String(D)}`)}},t[25]=p,t[26]=L,t[27]=o,t[28]=e,t[29]=j,t[30]=f,t[31]=oe):oe=t[31];const ue=oe;let re;t[32]!==o||t[33]!==e.slug?(re=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[32]=o,t[33]=e.slug,t[34]=re):re=t[34];const P=re;if(!j){let c;return t[35]!==P?(c=s.jsx(nt,{onBack:P}),t[35]=P,t[36]=c):c=t[36],c}if(!v)return null;const z=(j?.server?.remotes?.length??0)>0;let B;t[37]!==P?(B=s.jsx(it,{onBack:P}),t[37]=P,t[38]=B):B=t[38];let G;t[39]!==z?(G=!z&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(st,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=z,t[40]=G):G=t[40];let F;t[41]!==L||t[42]!==j?(F=L.length>0?L:[j],t[41]=L,t[42]=j,t[43]=F):F=t[43];let O;t[44]!==p.create.isPending||t[45]!==z||t[46]!==v||t[47]!==ue||t[48]!==F?(O=s.jsx(lt,{data:v,itemVersions:F,onInstall:ue,canInstall:z,isInstalling:p.create.isPending}),t[44]=p.create.isPending,t[45]=z,t[46]=v,t[47]=ue,t[48]=F,t[49]=O):O=t[49];let H;t[50]!==v||t[51]!==ce||t[52]!==j?(H=s.jsx(ct,{data:v,publisherInfo:ce,selectedItem:j}),t[50]=v,t[51]=ce,t[52]=j,t[53]=H):H=t[53];let W;t[54]!==A||t[55]!==v||t[56]!==fe||t[57]!==V||t[58]!==Y?(W=s.jsx(dt,{data:v,availableTabs:A,effectiveActiveTabId:fe,effectiveTools:V,isLoadingTools:Y,onTabChange:m}),t[54]=A,t[55]=v,t[56]=fe,t[57]=V,t[58]=Y,t[59]=W):W=t[59];let K;t[60]!==H||t[61]!==W?(K=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[H,W]}),t[60]=H,t[61]=W,t[62]=K):K=t[62];let Z;t[63]!==G||t[64]!==O||t[65]!==K?(Z=s.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"h-full",children:[G,O,K]})})}),t[63]=G,t[64]=O,t[65]=K,t[66]=Z):Z=t[66];let ne;return t[67]!==B||t[68]!==Z?(ne=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[B,Z]}),t[67]=B,t[68]=Z,t[69]=ne):ne=t[69],ne}function gt(t){return t.id==="readme"}function bt(t){return t.visible}function vt(t){return{name:t.name,description:t.description}}function jt(t){return t.name.endsWith("_GET")}function yt(t){return t.name.endsWith("_VERSIONS")}function rs(){const t=_.c(6),{org:e}=Ne(),o=ve();let n;t[0]!==o||t[1]!==e.slug?(n=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=n):n=t[2];const r=n;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(q.Suspense,{fallback:s.jsx(ot,{}),children:s.jsx(ht,{})}),t[3]=i):i=t[3];let d;return t[4]!==r?(d=s.jsx(xt,{onBack:r,children:i}),t[4]=r,t[5]=d):d=t[5],d}export{rs as default};
|