@decocms/mesh 2.53.0 → 2.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CUosFGNd.js → AlertCircle-DnrpASG2.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CW6UTxaz.js → ArrowLeft-CkGaUN6o.js} +1 -1
- package/dist/client/assets/{ArrowUp-DQViolGS.js → ArrowUp-Cc09RZY4.js} +1 -1
- package/dist/client/assets/{Check-D2dSwOsr.js → Check-BYHlfTQr.js} +1 -1
- package/dist/client/assets/{ChevronDown-BQcg3GVd.js → ChevronDown-Cyh9WMp0.js} +1 -1
- package/dist/client/assets/{Code01-BE_3ESgc.js → Code01-B62YyryF.js} +1 -1
- package/dist/client/assets/{Copy01-DXECPSKT.js → Copy01-GHFquEvX.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-C-G5ckUS.js → DotsHorizontal-C6El5T66.js} +1 -1
- package/dist/client/assets/{DotsVertical-BKPYeNIt.js → DotsVertical-DtC1yLil.js} +1 -1
- package/dist/client/assets/{Download01-DfSyYiGh.js → Download01-C5tBRZHe.js} +1 -1
- package/dist/client/assets/{Edit01-B1Z5KLbC.js → Edit01-CCTivbEj.js} +1 -1
- package/dist/client/assets/{File06-2DGjt4hs.js → File06-CDFdF5Nr.js} +1 -1
- package/dist/client/assets/{FilterLines-BnzY_lhi.js → FilterLines-4yPP_gAU.js} +1 -1
- package/dist/client/assets/{FlipBackward-D4CXw7be.js → FlipBackward-Bb3ib1Bh.js} +1 -1
- package/dist/client/assets/{Grid01-BjSv11LN.js → Grid01-C4O4Aknh.js} +1 -1
- package/dist/client/assets/{Home02-BZwvtXxZ.js → Home02-D2riSlnv.js} +1 -1
- package/dist/client/assets/{Image01-BphOjsIM.js → Image01-CYRE6pGN.js} +1 -1
- package/dist/client/assets/{Inbox01-DY3Scgnu.js → Inbox01-CV_5S91p.js} +1 -1
- package/dist/client/assets/{InfoCircle-D9eFDDch.js → InfoCircle-DnMMetUy.js} +1 -1
- package/dist/client/assets/{Key01-6wOTm5ju.js → Key01-CLADbyO4.js} +1 -1
- package/dist/client/assets/{LinkExternal01-OR0e2Yfm.js → LinkExternal01-DgcGDmdL.js} +1 -1
- package/dist/client/assets/{List-COpk5CVa.js → List-Cai2-K9Z.js} +1 -1
- package/dist/client/assets/{Loading01-BwwKYDtF.js → Loading01-B-TyaLAR.js} +1 -1
- package/dist/client/assets/{Lock01-CbN_GdeR.js → Lock01-Blk8_ONM.js} +1 -1
- package/dist/client/assets/{Pin01-BizQ6g3R.js → Pin01-GbJJn2vw.js} +1 -1
- package/dist/client/assets/{Play-BaS-lFep.js → Play-Bw-s0SW4.js} +1 -1
- package/dist/client/assets/{Plus-DFo2GFot.js → Plus-Cxc7BtkQ.js} +1 -1
- package/dist/client/assets/{SearchMd-Bh0QJjEM.js → SearchMd-CpKLo2Zn.js} +1 -1
- package/dist/client/assets/{Share07-BYXU7wNl.js → Share07-BB-7HQgT.js} +1 -1
- package/dist/client/assets/{Terminal-Fv-TNTFR.js → Terminal-DF70HZ2S.js} +1 -1
- package/dist/client/assets/{Trash01-CccVd7Bh.js → Trash01-BvwhK6Vg.js} +1 -1
- package/dist/client/assets/{Upload01-C2bCUV2p.js → Upload01-B6Wi4Y6P.js} +1 -1
- package/dist/client/assets/{Users03-CDcB69PL.js → Users03-Ba_1xVKB.js} +1 -1
- package/dist/client/assets/{X-DJomJuB1.js → X-CODbfs2H.js} +1 -1
- package/dist/client/assets/{XClose-DZXz07Zp.js → XClose-BaVIBBzB.js} +1 -1
- package/dist/client/assets/{agent-detail-tCJwYCyF.js → agent-detail-BwU_iOlG.js} +1 -1
- package/dist/client/assets/{agents-BwpkbOHR.js → agents-BIH6gREs.js} +1 -1
- package/dist/client/assets/{alert-dialog-BRa6_KDy.js → alert-dialog-C_OXD-MA.js} +2 -2
- package/dist/client/assets/{auth-catchall-N0na9_20.js → auth-catchall-BCQx1ruw.js} +1 -1
- package/dist/client/assets/{avatar-Ck8-q6HY.js → avatar-D8AIxV6P.js} +1 -1
- package/dist/client/assets/{badge-CZbH2WMS.js → badge-CpVCYFMG.js} +1 -1
- package/dist/client/assets/{binder-CQcXwjVp.js → binder-BEyDSNRs.js} +1 -1
- package/dist/client/assets/{button-B00_ydX0.js → button-B2KLvXEr.js} +1 -1
- package/dist/client/assets/{card-BMvxppEq.js → card-DlXZ7U9Z.js} +1 -1
- package/dist/client/assets/{checkbox-ImunmI7r.js → checkbox-DaoCFuj8.js} +1 -1
- package/dist/client/assets/{circle-alert-CpXy4Hr8.js → circle-alert-Bm5Q_veV.js} +1 -1
- package/dist/client/assets/{collection-detail-CYuIcnnl.js → collection-detail-C1oHfNP9.js} +1 -1
- package/dist/client/assets/{collection-display-button-BPtWZQEo.js → collection-display-button-BTGoT8ci.js} +1 -1
- package/dist/client/assets/{collection-header-BNcRdMLH.js → collection-header-Be7RY6CQ.js} +1 -1
- package/dist/client/assets/{collection-page-B7oO2n23.js → collection-page-RrsDnv83.js} +1 -1
- package/dist/client/assets/{collection-search-Dckk_Ikz.js → collection-search-DD9gszSV.js} +1 -1
- package/dist/client/assets/{collection-tab-DVvZlyTy.js → collection-tab-3ZZSVcZ8.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BF9XEwHD.js → collection-table-wrapper-BSy03JYc.js} +1 -1
- package/dist/client/assets/connect-BXWPEVv8.js +1 -0
- package/dist/client/assets/{connection-card-CgRN8Ayh.js → connection-card-BJ8nkB6q.js} +1 -1
- package/dist/client/assets/{connection-detail-uKqWBtPH.js → connection-detail-DVHoUY1Q.js} +1 -1
- package/dist/client/assets/{connections-y7jRQMEz.js → connections-B5_ch0b8.js} +1 -1
- package/dist/client/assets/{constants-WkW0waEP.js → constants-BecaK2Q7.js} +1 -1
- package/dist/client/assets/constants-lBJFsDYc.js +1 -0
- package/dist/client/assets/create-organization-dialog-kmOZjs4K.js +1 -0
- package/dist/client/assets/{dialog-qhbGhbZx.js → dialog-cWpa0tjW.js} +1 -1
- package/dist/client/assets/{dropdown-menu-42ftE2oK.js → dropdown-menu-DDACOXnG.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DKOCLn6K.js → dynamic-plugin-layout-nceYO9tV.js} +1 -1
- package/dist/client/assets/{empty-state-CS9-P6od.js → empty-state-BRRevprM.js} +1 -1
- package/dist/client/assets/{empty-state-BUcEAoKI.js → empty-state-CysqrplM.js} +1 -1
- package/dist/client/assets/env-vars-editor-CyAPCgjC.js +1 -0
- package/dist/client/assets/{error-boundary-B15bMSig.js → error-boundary-D2FqiSoM.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BDL-TEv2.js → extract-connection-data-DG_diqa3.js} +1 -1
- package/dist/client/assets/{file-browser-B7pbZypi.js → file-browser-BbtVlE62.js} +2 -2
- package/dist/client/assets/{form-BtpD-Mg0.js → form-ChHRavtv.js} +1 -1
- package/dist/client/assets/{grid-view-DvOSXag8.js → grid-view-BPn6qgmX.js} +1 -1
- package/dist/client/assets/{home-C_lsZqgH.js → home-hstgKRny.js} +1 -1
- package/dist/client/assets/index-B5YD-rJR.js +1 -0
- package/dist/client/assets/{index-DirwRnbJ.js → index-CKyh6XBg.js} +1 -1
- package/dist/client/assets/{index-AUAYH-kQ.js → index-DIxYn0kb.js} +64 -64
- package/dist/client/assets/{index-DL0E9kqQ.js → index-DhY2K4tp.js} +12 -12
- package/dist/client/assets/index-mQwl56Q0.js +1 -0
- package/dist/client/assets/{index-Czllqz-2.js → index-rms_W4V6.js} +33 -33
- package/dist/client/assets/infiniteQueryObserver-C_cEPa52.js +1 -0
- package/dist/client/assets/{input-CCqm-6CK.js → input-BkeUe06e.js} +1 -1
- package/dist/client/assets/{layout-BFy9cXIQ.js → layout-CdihDKq7.js} +1 -1
- package/dist/client/assets/{localstorage-keys-KyET-T_h.js → localstorage-keys-BkUFqNvo.js} +1 -1
- package/dist/client/assets/login-B4do1VXN.js +1 -0
- package/dist/client/assets/mcp-oauth-Z4D16Uoq.js +1 -0
- package/dist/client/assets/{mcp-server-card-m9JuE0nb.js → mcp-server-card-ZLodfuxh.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-BsBLG9_9.js → mcp-server-detail-ChazypwB.js} +2 -2
- package/dist/client/assets/{members-xwUNGYDi.js → members-DIUQDq49.js} +1 -1
- package/dist/client/assets/{monaco-editor-Q_er1L0I.js → monaco-editor-CF8xOd0f.js} +4 -4
- package/dist/client/assets/{monitoring-_VT5f5Bq.js → monitoring-BXGU01Kc.js} +3 -3
- package/dist/client/assets/{oauth-callback-DWkO610z.js → oauth-callback-CqnMpdvf.js} +1 -1
- package/dist/client/assets/{page-DFJw1vc5.js → page-CLam7tfm.js} +1 -1
- package/dist/client/assets/{page-0dLxS1h-.js → page-DcHPZKZc.js} +1 -1
- package/dist/client/assets/{pin-to-sidebar-button-FlRaE5CN.js → pin-to-sidebar-button-xde8P8_T.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-rUw49Sla.js → plugin-empty-state-DBQd886H.js} +1 -1
- package/dist/client/assets/{plugin-header-DBOF23Sq.js → plugin-header-BzN93bFk.js} +1 -1
- package/dist/client/assets/{plugins-BN-3RFdx.js → plugins-DTGBld4c.js} +1 -1
- package/dist/client/assets/{popover-DB55iMbc.js → popover-BQ4fAaba.js} +1 -1
- package/dist/client/assets/{registry-utils-C6h9Gx0x.js → registry-utils-CubAr1ep.js} +1 -1
- package/dist/client/assets/{resizable-CJYOs9td.js → resizable-CBbQ2mtO.js} +1 -1
- package/dist/client/assets/{resource-tabs-CwoGib18.js → resource-tabs-PgIUUqJg.js} +1 -1
- package/dist/client/assets/{select-BQyV0pOn.js → select-DtbOgYEp.js} +1 -1
- package/dist/client/assets/{settings-DJgCVswE.js → settings-Bpg3bFrL.js} +1 -1
- package/dist/client/assets/shell-layout-OPZoFrI9.js +3 -0
- package/dist/client/assets/spinner-BtXJc_eZ.js +1 -0
- package/dist/client/assets/store-invite-BEl6VykZ.js +1 -0
- package/dist/client/assets/{switch-RY18eFtF.js → switch-DsnDxQXG.js} +1 -1
- package/dist/client/assets/{textarea-CMLduiYq.js → textarea-BANZCPie.js} +1 -1
- package/dist/client/assets/{tool-set-selector-pswCeL17.js → tool-set-selector-CqX9WN4g.js} +1 -1
- package/dist/client/assets/{tools-list-CaIW22pA.js → tools-list-BRzmSp1i.js} +1 -1
- package/dist/client/assets/{tooltip-Dpvr0rXq.js → tooltip-Dwcc1k71.js} +1 -1
- package/dist/client/assets/{typewriter-title-DonUWsRZ.js → typewriter-title-Bay0uuB9.js} +2 -2
- package/dist/client/assets/{use-binding-DETlsMC2.js → use-binding--VZ7Y5Ef.js} +1 -1
- package/dist/client/assets/{use-collections-DGIB8J28.js → use-collections-8Kj36wYP.js} +1 -1
- package/dist/client/assets/{use-connection-B5trZtD3.js → use-connection-DfqjO6nz.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-C1gVg8Cb.js → use-create-virtual-mcp-lWx9_XWS.js} +1 -1
- package/dist/client/assets/{use-list-state-DmUxkG5Z.js → use-list-state-vBhSzyur.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Dj17zuNr.js → use-mcp-prompts-DioGpWDr.js} +1 -1
- package/dist/client/assets/use-members-E4uqx9v1.js +1 -0
- package/dist/client/assets/{use-mobile-8fEdz_YY.js → use-mobile-C29nHXu6.js} +1 -1
- package/dist/client/assets/{use-organization-settings-U0agG2h9.js → use-organization-settings-BSUJceGn.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Bi5F5F6f.js → use-virtual-mcp-BsVUpxvH.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BTaBTa8y.js +1 -0
- package/dist/client/assets/{useMutation-C9EFCZz_.js → useMutation-5hMjZ_Ks.js} +1 -1
- package/dist/client/assets/useQuery-D0z2lKje.js +1 -0
- package/dist/client/assets/{view-mode-toggle-KIDFLeEj.js → view-mode-toggle-CLtTg2VY.js} +1 -1
- package/dist/client/assets/{workflow-daJYPL0_.js → workflow-Iz076qQ_.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +112 -112
- package/dist/server/migrate.js +5 -5
- package/dist/server/server.js +109 -109
- package/package.json +1 -1
- package/dist/client/assets/connect-DJyguwtd.js +0 -1
- package/dist/client/assets/constants-CApA9LvW.js +0 -1
- package/dist/client/assets/create-organization-dialog-Dt_N2MMJ.js +0 -1
- package/dist/client/assets/env-vars-editor-B9AW86vg.js +0 -1
- package/dist/client/assets/index-3bBDO_0b.js +0 -1
- package/dist/client/assets/index-CxWk7Fwg.js +0 -1
- package/dist/client/assets/infiniteQueryObserver-cVAe_2FL.js +0 -1
- package/dist/client/assets/login-YfQaRXOk.js +0 -1
- package/dist/client/assets/mcp-oauth-A6Csj-pc.js +0 -1
- package/dist/client/assets/shell-layout-BafaBoHC.js +0 -3
- package/dist/client/assets/spinner-BndxvZpI.js +0 -1
- package/dist/client/assets/use-members-D9yKU0hW.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Cl5a5iyP.js +0 -1
- package/dist/client/assets/useQuery-Gixvofai.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as T,bu as M,j as e,bv as P,N as q,r as R,a8 as h,a as O}from"./index-Czllqz-2.js";import{u as A}from"./useQuery-Gixvofai.js";import{u as _}from"./useMutation-C9EFCZz_.js";import{B as y}from"./button-B00_ydX0.js";import{C as N,a as v}from"./card-BMvxppEq.js";import{i as L,a as U}from"./mcp-oauth-A6Csj-pc.js";import{c as C,C as K,a as k}from"./circle-alert-CpXy4Hr8.js";const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],D=C("external-link",Q);const H=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],w=C("loader-circle",H);const J=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],B=C("refresh-cw",J),Y=t=>{const n=T.c(6);let i;n[0]!==t?({...i}=t,n[0]=t,n[1]=i):i=n[1];const{theme:a}=M(),d=a===void 0?"system":a;let r;n[2]===Symbol.for("react.memo_cache_sentinel")?(r={"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},n[2]=r):r=n[2];let m;return n[3]!==i||n[4]!==d?(m=e.jsx(P,{theme:d,className:"toaster group",style:r,...i}),n[3]=i,n[4]=d,n[5]=m):m=n[5],m},b={session:t=>["user-sandbox-session",t]};function V({sessionId:t,onComplete:n,onError:i}){const a=q(),[p,d]=R.useState(null),{data:r,isLoading:m,error:j}=A({queryKey:b.session(t),queryFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}`);if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to load session")}return s.json()}}),F=_({mutationFn:async({appName:s,connectionId:o})=>{const l=await fetch(`/api/user-sandbox/sessions/${t}/configure`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s,connection_id:o})});if(!l.ok){const u=await l.json();throw new Error(u.error||"Configuration failed")}return l.json()},onSuccess:()=>{a.invalidateQueries({queryKey:b.session(t)})}}),x=_({mutationFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to complete")}return s.json()},onSuccess:s=>{s.redirectUrl?window.location.href=s.redirectUrl:(h.success("Setup complete!"),a.invalidateQueries({queryKey:b.session(t)}),n?.({agentId:s.agentId,redirectUrl:s.redirectUrl}))},onError:s=>{const o=s instanceof Error?s:new Error("Failed to complete");h.error(o.message),i?.(o)}}),S=async s=>{d(s.app_name);try{const o=await fetch(`/api/user-sandbox/sessions/${t}/provision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s.app_name})});if(!o.ok){const g=await o.json();throw new Error(g.error||"Failed to provision connection")}const u=(await o.json()).connection_id;if(s.connection_type==="HTTP"||s.connection_type==="SSE"||s.connection_type==="Websocket"){const g=`/mcp/${u}`,z=await L({url:g,token:null});if(!z.isAuthenticated&&z.supportsOAuth){h.info("Opening authentication window...");const c=await U({connectionId:u,clientName:s.title,timeout:3e5});if(c.error)throw new Error(c.error);if(c.tokenInfo){const E=await fetch(`/api/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:c.tokenInfo.accessToken,refreshToken:c.tokenInfo.refreshToken,expiresIn:c.tokenInfo.expiresIn,scope:c.tokenInfo.scope,clientId:c.tokenInfo.clientId,clientSecret:c.tokenInfo.clientSecret,tokenEndpoint:c.tokenInfo.tokenEndpoint})});if(!E.ok){const $=await E.json().catch(()=>({}));throw new Error($.error||"Failed to save authentication tokens. Please try again.")}}}}await F.mutateAsync({appName:s.app_name,connectionId:u}),h.success(`${s.title} connected successfully`)}catch(o){console.error("Connection error:",o);const l=o instanceof Error?o:new Error("Failed to connect");h.error(l.message),i?.(l)}finally{d(null)}},I=r?.apps.every(s=>s.status.configured),f=r?.session.status==="completed";return m?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(w,{className:"size-8 animate-spin text-muted-foreground"})}):j?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(N,{className:"max-w-md w-full",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("div",{className:"size-12 rounded-full bg-destructive/10 flex items-center justify-center",children:e.jsx(K,{className:"size-6 text-destructive"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Session Error"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:j instanceof Error?j.message:"Failed to load"})]})]})})})}):r?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Y,{}),e.jsxs("div",{className:"max-w-lg mx-auto px-4 py-12",children:[e.jsxs("div",{className:"text-center mb-8",children:[r.template.icon&&e.jsx("div",{className:"size-16 mx-auto mb-4 rounded-xl bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:r.template.icon,alt:"",className:"size-10 object-contain"})}),e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:r.template.title}),r.template.description&&e.jsx("p",{className:"text-muted-foreground mt-2",children:r.template.description})]}),f&&e.jsx(N,{className:"mb-6 border-green-500/20 bg-green-500/5",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"size-10 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-5 text-green-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Setup Complete"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your integrations are ready to use."})]})]})})}),e.jsx("div",{className:"space-y-3",children:r.apps.map(s=>e.jsx(N,{children:e.jsx(v,{className:"py-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"size-10 rounded-lg bg-muted flex items-center justify-center shrink-0 overflow-hidden",children:s.icon?e.jsx("img",{src:s.icon,alt:"",className:"size-6 object-contain"}):e.jsx("span",{className:"text-lg",children:"📦"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.status.configured?e.jsxs("span",{className:"text-green-600 dark:text-green-400 flex items-center gap-1",children:[e.jsx(k,{className:"size-3"})," Connected"]}):s.requires_oauth?"Requires authentication":"Ready to connect"})]}),!s.status.configured&&!f&&e.jsx(y,{size:"sm",onClick:()=>S(s),disabled:p!==null||x.isPending,children:p===s.app_name?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Connecting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"size-4 mr-2"}),"Connect"]})}),s.status.configured&&!f&&e.jsxs(y,{size:"sm",variant:"outline",onClick:()=>S(s),disabled:p!==null||x.isPending,children:[e.jsx(B,{className:"size-4 mr-2"}),"Reconnect"]}),f&&e.jsx("div",{className:"size-8 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-4 text-green-500"})})]})})},s.app_name))}),I&&!f&&e.jsx("div",{className:"mt-6",children:e.jsx(y,{className:"w-full",size:"lg",onClick:()=>x.mutate(),disabled:x.isPending,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Completing..."]}):"Complete Setup"})}),e.jsx("div",{className:"mt-8 pt-6 border-t text-center",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Session expires:"," ",new Date(r.session.expires_at).toLocaleString()]})})]})]}):null}function oe(){const t=T.c(3);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/connect/$sessionId"},t[0]=n):n=t[0];const{sessionId:i}=O(n);let a;return t[1]!==i?(a=e.jsx(V,{sessionId:i}),t[1]=i,t[2]=a):a=t[2],a}export{oe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{x as t,B as a}from"./index-Czllqz-2.js";const e=t(a,{target:"draft-7"});export{e as B};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as A,s as D,c as O,b as v,d as E,j as r,e as N}from"./index-Czllqz-2.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as B}from"./alert-dialog-BRa6_KDy.js";import{B as V}from"./button-B00_ydX0.js";import{F as k,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-BtpD-Mg0.js";import{I as P}from"./input-CCqm-6CK.js";import{S as Q}from"./spinner-BndxvZpI.js";import{u as W}from"./useMutation-C9EFCZz_.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function ne(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=W(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let x;e[6]!==i?(x=b=>i.mutateAsync(b),e[6]=i,e[7]=x):x=e[7],n=t.handleSubmit(x),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=x=>{const{field:b}=x;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(k,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(V,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let p;e[34]!==t||e[35]!==h?(p=r.jsxs(M,{children:[F,r.jsx(q,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=p):p=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==p?(C=r.jsx(B,{open:a,onOpenChange:s,children:p}),e[37]=s,e[38]=a,e[39]=p,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await N.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{ne as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as f,_ as V,k,s as t,aa as j,ab as d,ac as x,ad as R,c as W,j as c}from"./index-Czllqz-2.js";import{B as H}from"./button-B00_ydX0.js";import{I as N}from"./input-CCqm-6CK.js";import{s as O}from"./Plus-DFo2GFot.js";import{s as U}from"./Trash01-CccVd7Bh.js";const L=f({authorizationEndpoint:t().url(),tokenEndpoint:t().url(),introspectionEndpoint:t().url().optional(),clientId:t(),clientSecret:t().optional(),scopes:k(t()),grantType:V(["authorization_code","client_credentials"])}),B=f({title:t().optional(),readOnlyHint:j().optional(),destructiveHint:j().optional(),idempotentHint:j().optional(),openWorldHint:j().optional()}),K=f({name:t(),description:t().optional(),inputSchema:d(t(),x()),outputSchema:d(t(),x()).optional(),annotations:B.optional(),_meta:d(t(),x()).optional()}),$=f({headers:d(t(),t()).optional()}),q=f({command:t().describe("Command to run (e.g., 'npx', 'node')"),args:k(t()).optional().describe("Command arguments"),cwd:t().optional().describe("Working directory"),envVars:d(t(),t()).optional().describe("Environment variables (encrypted in storage)")}),z=f({id:t().describe("Unique identifier for the connection"),title:t().describe("Human-readable name for the connection"),created_at:t().describe("When the connection was created"),updated_at:t().describe("When the connection was last updated"),created_by:t().describe("User ID who created the connection"),updated_by:t().optional().describe("User ID who last updated the connection"),organization_id:t().describe("Organization ID this connection belongs to"),description:t().nullable().describe("Description of the connection"),icon:t().nullable().describe("Icon URL for the connection"),app_name:t().nullable().describe("Associated app name"),app_id:t().nullable().describe("Associated app ID"),connection_type:V(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:t().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:t().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:R([q,$]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:L.nullable().describe("OAuth configuration"),configuration_state:d(t(),x()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:k(t()).nullable().optional().describe("Configuration scopes"),metadata:d(t(),x()).nullable().describe("Additional metadata (includes repository info)"),tools:k(K).nullable().describe("Discovered tools from MCP"),bindings:k(t()).nullable().describe("Detected bindings"),status:V(["active","inactive","error"]).describe("Current status")});z.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});z.partial();function Y(o){return o!=null&&"command"in o}function Z(o){return!o||!o.startsWith("virtual://")?null:o.replace("virtual://","")}function M(o){const e=o.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function ee(o){const e=W.c(34),{value:n,onChange:i,keyPlaceholder:A,valuePlaceholder:l,className:I}=o,_=A===void 0?"VARIABLE_NAME":A,b=l===void 0?"value...":l;let w;e[0]!==i||e[1]!==n?(w=()=>{i([...n,{key:"",value:""}])},e[0]=i,e[1]=n,e[2]=w):w=e[2];const D=w;let S;e[3]!==i||e[4]!==n?(S=r=>{i(n.filter((u,a)=>a!==r))},e[3]=i,e[4]=n,e[5]=S):S=e[5];const g=S;let C;e[6]!==i||e[7]!==n?(C=(r,u)=>{const a=[...n],s=a[r];s&&(a[r]={key:u,value:s.value},i(a))},e[6]=i,e[7]=n,e[8]=C):C=e[8];const v=C;let T;e[9]!==i||e[10]!==n?(T=(r,u)=>{const a=[...n],s=a[r];s&&(a[r]={key:s.key,value:u},i(a))},e[9]=i,e[10]=n,e[11]=T):T=e[11];const y=T;let p;if(e[12]!==v||e[13]!==g||e[14]!==y||e[15]!==_||e[16]!==n||e[17]!==b){let r;e[19]!==v||e[20]!==g||e[21]!==y||e[22]!==_||e[23]!==b?(r=(u,a)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(N,{placeholder:_,value:u.key,onChange:s=>v(a,s.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),c.jsx(N,{type:M(u.key)?"password":"text",placeholder:b,value:u.value,onChange:s=>y(a,s.target.value),className:"h-10 rounded-lg flex-1"}),c.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(a),children:c.jsx(U,{size:16})})]},a),e[19]=v,e[20]=g,e[21]=y,e[22]=_,e[23]=b,e[24]=r):r=e[24],p=n.map(r),e[12]=v,e[13]=g,e[14]=y,e[15]=_,e[16]=n,e[17]=b,e[18]=p}else p=e[18];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(O,{size:16,className:"mr-1"}),e[25]=E):E=e[25];let m;e[26]!==D?(m=c.jsxs(H,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:D,children:[E,"Add Environment Variable"]}),e[26]=D,e[27]=m):m=e[27];let h;e[28]!==p||e[29]!==m?(h=c.jsxs("div",{className:"flex flex-col gap-2",children:[p,m]}),e[28]=p,e[29]=m,e[30]=h):h=e[30];let P;return e[31]!==I||e[32]!==h?(P=c.jsx("div",{className:I,children:h}),e[31]=I,e[32]=h,e[33]=P):P=e[33],P}function te(o){const e={};for(const{key:n,value:i}of o)n.trim()&&(e[n.trim()]=i);return e}function ne(o){return o?Object.entries(o).map(([e,n])=>({key:e,value:n})):[]}export{ee as E,te as e,Y as i,Z as p,ne as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as r,L as i,O as l,P as u,V as C,i as c,p as P,u as m}from"./index-Czllqz-2.js";import{u as M,a as g,b as f,c as x,d as L,e as S,f as d}from"./use-collections-DGIB8J28.js";import{u as A,a as K,b as R}from"./use-connection-B5trZtD3.js";import{S as s}from"./constants-WkW0waEP.js";import{K as b,a as h,W,c as w,g as O,b as V,d as _,e as E,f as I,u as Q}from"./constants-WkW0waEP.js";import{g as j,l as G,a as U,r as k,u as v,b as F,c as H}from"./use-mcp-prompts-Dj17zuNr.js";import{u as N,a as Y,b as q}from"./use-virtual-mcp-Bi5F5F6f.js";import{a as B,h as X,i as Z}from"./mcp-oauth-A6Csj-pc.js";import"./useMutation-C9EFCZz_.js";import"./useQuery-Gixvofai.js";export{r as ConnectionEntitySchema,b as KEYS,i as Locator,l as ORG_ADMIN_PROJECT_SLUG,u as ProjectContextProvider,h as SELF_MCP_ALIAS_ID,s as StreamableHTTPClientTransport,C as VirtualMCPEntitySchema,W as WellKnownOrgMCPId,B as authenticateMcp,w as createMCPClient,j as getPrompt,O as getWellKnownCommunityRegistryConnection,V as getWellKnownDecopilotAgent,_ as getWellKnownMcpStudioConnection,E as getWellKnownOpenRouterConnection,I as getWellKnownRegistryConnection,X as handleOAuthCallback,Z as isConnectionAuthenticated,c as isStdioParameters,G as listPrompts,U as listResources,P as parseVirtualUrl,k as readResource,M as useCollectionActions,g as useCollectionItem,f as useCollectionList,A as useConnection,K as useConnectionActions,R as useConnections,Q as useMCPClient,v as useMCPPromptsList,F as useMCPPromptsListQuery,H as useMCPResourcesListQuery,x as useMCPToolCall,L as useMCPToolCallMutation,S as useMCPToolCallQuery,d as useMCPToolsListQuery,m as useProjectContext,N as useVirtualMCP,Y as useVirtualMCPActions,q as useVirtualMCPs};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aP as K,aT as C,aQ as V,aY as z,X as _,N as W,aZ as X,a_ as Y,r as h,a$ as Z,b0 as $,b1 as J,aU as ee,b2 as k,b3 as P,b4 as se,b5 as te,b6 as re,ae as oe,j as m,b7 as ne,ai as g,ah as O,b8 as ae,aj as w,b9 as A,al as ie,aq as Q,ax as ue,ay as ce}from"./index-Czllqz-2.js";function I(r,s){const t=new Set(s);return r.filter(o=>!t.has(o))}function de(r,s,t){const o=r.slice(0);return o[s]=t,o}var le=class extends K{#r;#e;#o;#n;#s;#t;#a;#i;#u=[];constructor(r,s,t){super(),this.#r=r,this.#n=t,this.#o=[],this.#s=[],this.#e=[],this.setQueries(s)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(r=>{r.subscribe(s=>{this.#h(r,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(r=>{r.destroy()})}setQueries(r,s){this.#o=r,this.#n=s,C.batch(()=>{const t=this.#s,o=this.#l(this.#o);this.#u=o,o.forEach(i=>i.observer.setOptions(i.defaultedQueryOptions));const e=o.map(i=>i.observer),n=e.map(i=>i.getCurrentResult()),a=t.length!==e.length,c=e.some((i,d)=>i!==t[d]),l=a||c,v=l?!0:n.some((i,d)=>{const b=this.#e[d];return!b||!V(i,b)});!l&&!v||(l&&(this.#s=e),this.#e=n,this.hasListeners()&&(l&&(I(t,e).forEach(i=>{i.destroy()}),I(e,t).forEach(i=>{i.subscribe(d=>{this.#h(i,d)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,s){const t=this.#l(r),o=t.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions));return[o,e=>this.#d(e??o,s),()=>this.#c(o,t)]}#c(r,s){return s.map((t,o)=>{const e=r[o];return t.defaultedQueryOptions.notifyOnChangeProps?e:t.observer.trackResult(e,n=>{s.forEach(a=>{a.observer.trackProp(n)})})})}#d(r,s){return s?((!this.#t||this.#e!==this.#i||s!==this.#a)&&(this.#a=s,this.#i=this.#e,this.#t=z(this.#t,s(r))),this.#t):r}#l(r){const s=new Map;this.#s.forEach(o=>{const e=o.options.queryHash;if(!e)return;const n=s.get(e);n?n.push(o):s.set(e,[o])});const t=[];return r.forEach(o=>{const e=this.#r.defaultQueryOptions(o),a=s.get(e.queryHash)?.shift()??new _(this.#r,e);t.push({defaultedQueryOptions:e,observer:a})}),t}#h(r,s){const t=this.#s.indexOf(r);t!==-1&&(this.#e=de(this.#e,t,s),this.#p())}#p(){if(this.hasListeners()){const r=this.#t,s=this.#c(this.#e,this.#u),t=this.#d(s,this.#n?.combine);r!==t&&C.batch(()=>{this.listeners.forEach(o=>{o(this.#e)})})}}};function Ce({queries:r,...s},t){const o=W(t),e=X(),n=Y(),a=h.useMemo(()=>r.map(u=>{const f=o.defaultQueryOptions(u);return f._optimisticResults=e?"isRestoring":"optimistic",f}),[r,o,e]);a.forEach(u=>{Z(u),$(u,n)}),J(n);const[c]=h.useState(()=>new le(o,a,s)),[l,v,i]=c.getOptimisticResult(a,s.combine),d=!e&&s.subscribed!==!1;h.useSyncExternalStore(h.useCallback(u=>d?c.subscribe(C.batchCalls(u)):ee,[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),h.useEffect(()=>{c.setQueries(a,s)},[a,s,c]);const p=l.some((u,f)=>k(a[f],u))?l.flatMap((u,f)=>{const y=a[f];if(y){const x=new _(o,y);if(k(y,u))return P(y,x,n);se(u,e)&&P(y,x,n)}return[]}):[];if(p.length>0)throw Promise.all(p);const R=l.find((u,f)=>{const y=a[f];return y&&te({result:u,errorResetBoundary:n,throwOnError:y.throwOnError,query:o.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(R?.error)throw R.error;return v(i())}var S="Radio",[he,j]=Q(S),[pe,fe]=he(S),G=h.forwardRef((r,s)=>{const{__scopeRadio:t,name:o,checked:e=!1,required:n,disabled:a,value:c="on",onCheck:l,form:v,...i}=r,[d,b]=h.useState(null),p=O(s,f=>b(f)),R=h.useRef(!1),u=d?v||!!d.closest("form"):!0;return m.jsxs(pe,{scope:t,checked:e,disabled:a,children:[m.jsx(g.button,{type:"button",role:"radio","aria-checked":e,"data-state":D(e),"data-disabled":a?"":void 0,disabled:a,value:c,...i,ref:p,onClick:w(r.onClick,f=>{e||l?.(),u&&(R.current=f.isPropagationStopped(),R.current||f.stopPropagation())})}),u&&m.jsx(q,{control:d,bubbles:!R.current,name:o,value:c,checked:e,required:n,disabled:a,form:v,style:{transform:"translateX(-100%)"}})]})});G.displayName=S;var M="RadioIndicator",N=h.forwardRef((r,s)=>{const{__scopeRadio:t,forceMount:o,...e}=r,n=fe(M,t);return m.jsx(ie,{present:o||n.checked,children:m.jsx(g.span,{"data-state":D(n.checked),"data-disabled":n.disabled?"":void 0,...e,ref:s})})});N.displayName=M;var Re="RadioBubbleInput",q=h.forwardRef(({__scopeRadio:r,control:s,checked:t,bubbles:o=!0,...e},n)=>{const a=h.useRef(null),c=O(a,n),l=ue(t),v=ce(s);return h.useEffect(()=>{const i=a.current;if(!i)return;const d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==t&&p){const R=new Event("click",{bubbles:o});p.call(i,t),i.dispatchEvent(R)}},[l,t,o]),m.jsx(g.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...e,tabIndex:-1,ref:c,style:{...e.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});q.displayName=Re;function D(r){return r?"checked":"unchecked"}var ve=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],E="RadioGroup",[be]=Q(E,[A,j]),L=A(),B=j(),[me,ye]=be(E),T=h.forwardRef((r,s)=>{const{__scopeRadioGroup:t,name:o,defaultValue:e,value:n,required:a=!1,disabled:c=!1,orientation:l,dir:v,loop:i=!0,onValueChange:d,...b}=r,p=L(t),R=re(v),[u,f]=oe({prop:n,defaultProp:e??null,onChange:d,caller:E});return m.jsx(me,{scope:t,name:o,required:a,disabled:c,value:u,onValueChange:f,children:m.jsx(ne,{asChild:!0,...p,orientation:l,dir:R,loop:i,children:m.jsx(g.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":c?"":void 0,dir:R,...b,ref:s})})})});T.displayName=E;var F="RadioGroupItem",U=h.forwardRef((r,s)=>{const{__scopeRadioGroup:t,disabled:o,...e}=r,n=ye(F,t),a=n.disabled||o,c=L(t),l=B(t),v=h.useRef(null),i=O(s,v),d=n.value===e.value,b=h.useRef(!1);return h.useEffect(()=>{const p=u=>{ve.includes(u.key)&&(b.current=!0)},R=()=>b.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",R),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",R)}},[]),m.jsx(ae,{asChild:!0,...c,focusable:!a,active:d,children:m.jsx(G,{disabled:a,required:n.required,checked:d,...l,...e,name:n.name,ref:i,onCheck:()=>n.onValueChange(e.value),onKeyDown:w(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:w(e.onFocus,()=>{b.current&&v.current?.click()})})})});U.displayName=F;var ge="RadioGroupIndicator",H=h.forwardRef((r,s)=>{const{__scopeRadioGroup:t,...o}=r,e=B(t);return m.jsx(N,{...e,...o,ref:s})});H.displayName=ge;var we=T,Oe=U,Se=H;export{Oe as I,we as R,Se as a,Ce as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{X as d,Y as f,Z as v,$ as b}from"./index-Czllqz-2.js";var N=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:f()})}getOptimisticResult(e){return e.behavior=f(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:P,isError:c,isRefetchError:g}=i,r=s.fetchMeta?.fetchMore?.direction,h=c&&r==="forward",o=a&&r==="forward",n=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:v(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:u,isRefetchError:g&&!h&&!n,isRefetching:P&&!o&&!u}}};export{N as I};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as k,r as p,e as j,j as e,g as z,a6 as L,a7 as R,c as U}from"./index-Czllqz-2.js";import{u as T}from"./useMutation-C9EFCZz_.js";import{c as b,B as P}from"./button-B00_ydX0.js";import{I as E}from"./input-CCqm-6CK.js";function B({redirectUrl:r}){const{emailAndPassword:t}=k(),[s,d]=p.useState(""),[o,u]=p.useState(""),[l,v]=p.useState(""),[i,N]=p.useState(()=>globalThis.localStorage?.getItem("hasLoggedIn")!=="true"),[m,h]=p.useState(""),g=T({mutationFn:async({email:a,password:n,name:C})=>{try{if(i){const c=await j.signUp.email({email:a,password:n,name:C||""});if(c.error)throw new Error(c.error.message||"Sign up failed");return c}else{const c=await j.signIn.email({email:a,password:n});if(c.error)throw new Error(c.error.message||"Sign in failed");return c}}catch(c){throw c instanceof Error?c:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),r&&(window.location.href=r)}}),y=a=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),x=()=>{s.trim()&&!y(s)&&h("Invalid email address")},S=a=>{if(a.preventDefault(),!y(s)){h("Invalid email address");return}g.mutate({email:s,password:o,name:l})},_=a=>n=>{a(n.target.value),I&&g.reset(),a===d&&m&&h("")},f=g.isPending,I=g.error,w=i?s.trim()&&o.trim()&&l.trim():s.trim()&&o.trim(),A=a=>{if(!a)return null;const n=a.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?"Invalid email or password. Please try again.":n.includes("already exists")||n.includes("409")?"An account with this email already exists. Try signing in instead.":n.includes("network")||n.includes("fetch")?"Network error. Please check your connection and try again.":n.includes("rate limit")||n.includes("429")?"Too many attempts. Please wait a moment and try again.":a.message||"An error occurred. Please try again."};return e.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e.jsx("div",{className:"text-center space-y-1",children:e.jsx("p",{className:"text-sm text-foreground/70",children:i?"Create your account":"Login or signup below"})}),I&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:A(I)}),t.enabled&&e.jsxs("form",{onSubmit:S,className:"grid gap-4",children:[e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",i?"max-h-[200px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsxs("div",{className:b("p-1",!i&&"pointer-events-none"),children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(E,{type:"text",placeholder:"Your name",value:l,onChange:_(v),required:!0,disabled:f||!i,"aria-hidden":!i})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(E,{type:"email",placeholder:"you@example.com",value:s,onChange:_(d),onBlur:x,required:!0,disabled:f,"aria-invalid":!!m}),m&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:m})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Password"}),e.jsx(E,{type:"password",placeholder:"••••••••",value:o,onChange:_(u),required:!0,disabled:f})]}),e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",w?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:b("p-1",!w&&"pointer-events-none"),children:e.jsx(P,{type:"submit",disabled:f||!w,className:b("w-full font-semibold"),size:"lg","aria-hidden":!w,children:f?i?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-center",children:e.jsx(P,{type:"button",variant:"link",onClick:()=>{N(!i),v(""),h(""),g.reset()},disabled:f,className:"text-sm text-muted-foreground hover:text-foreground",children:i?"Already have an account? Sign in":"Don't have an account? Sign up"})}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground pt-4",children:[e.jsx("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Terms of Service"}),e.jsx("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})]})]})}function M(r){if(!r.client_id||r.response_type!=="code")return null;const t=new URLSearchParams;return r.client_id&&t.set("client_id",r.client_id),r.redirect_uri&&t.set("redirect_uri",r.redirect_uri),r.response_type&&t.set("response_type",r.response_type),r.state&&t.set("state",r.state),r.scope&&t.set("scope",r.scope),r.code_challenge&&t.set("code_challenge",r.code_challenge),r.code_challenge_method&&t.set("code_challenge_method",r.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function q(r){const t=U.c(5),{callbackURL:s,providerId:d}=r;let o,u;t[0]!==s||t[1]!==d?(o=()=>{(async()=>await j.signIn.sso({providerId:d,callbackURL:s}))()},u=[d,s],t[0]=s,t[1]=d,t[2]=o,t[3]=u):(o=t[2],u=t[3]),p.useEffect(o,u);let l;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=e.jsx(L,{}),t[4]=l):l=t[4],l}function Y(){const r=j.useSession(),t=z({from:"/login"}),{next:s="/",client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}=t,{sso:m,emailAndPassword:h,magicLink:g,socialProviders:y}=k(),x=M({client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}),S=x||s;return r.data?x?(window.location.href=x,e.jsx(L,{})):e.jsx(R,{to:s}):m.enabled?e.jsx(q,{callbackURL:S,providerId:m.providerId}):h.enabled||g.enabled||y.enabled?e.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx(B,{redirectUrl:x})]})]}):e.jsx("div",{children:"No login options available"})}export{Y as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a2 as R,a3 as P,a4 as $,a5 as V}from"./index-Czllqz-2.js";function b(n){let e=0;for(let t=0;t<n.length;t++){const r=n.charCodeAt(t);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(16)}const I=new Map,O="mcp:oauth:callback:";class x{serverUrl;_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${window.location.origin}/oauth/callback`,this._windowMode=e.windowMode??"popup";const t=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...t&&{scope:t}},I.set(b(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){if(this._windowMode==="tab")window.open(e.toString(),"_blank")||(window.location.href=e.toString());else{const o=window.screenX+(window.outerWidth-600)/2,a=window.screenY+(window.outerHeight-700)/2;if(!window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${o},top=${a},popup=yes`))throw new Error("OAuth popup was blocked. Please allow popups for this site and try again.")}}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){I.delete(b(this.serverUrl))}}async function D(n){const e=n.meshUrl??window.location.origin,t=new URL(`/mcp/${n.connectionId}`,e),r=new x({serverUrl:t.href,clientName:n.clientName,clientUri:n.clientUri,callbackUrl:n.callbackUrl,scope:n.scope,windowMode:n.windowMode});try{const o=new Promise((s,u)=>{const _=n.timeout||12e4;let h,w=!1;const M=r.state(),m=`${O}${M}`,d=()=>{window.removeEventListener("message",S),window.removeEventListener("storage",y),clearTimeout(h);try{localStorage.removeItem(m)}catch{}},g=async l=>{if(w)return;if(w=!0,!l.success){d(),u(new Error(l.error||"OAuth authentication failed"));return}const{code:p,state:E}=l;if(!p){d(),u(new Error("Missing authorization code"));return}if(r.getStoredState()!==E){d(),u(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const v=(await R(t))?.authorization_servers?.[0]||t,U=await P(v),f=r.clientInformation();if(!f){d(),u(new Error("Client information not found"));return}const C=r.codeVerifier(),L=await $(v,{metadata:U,clientInformation:f,authorizationCode:p,codeVerifier:C,redirectUri:r.redirectUrl,resource:new URL(t)});d(),s({tokens:L,clientId:f.client_id??null,clientSecret:"client_secret"in f?f.client_secret:null,tokenEndpoint:U?.token_endpoint??null})}catch(A){d(),u(A)}},S=async l=>{l.origin===window.location.origin&&l.data?.type==="mcp:oauth:callback"&&await g(l.data)},y=async l=>{if(!(l.key!==m||!l.newValue))try{const p=JSON.parse(l.newValue);await g(p)}catch{}};window.addEventListener("message",S),window.addEventListener("storage",y),h=setTimeout(()=>{w||(w=!0,d(),u(new Error("OAuth authentication timeout")))},_)});if(await V(r,{serverUrl:t})==="REDIRECT"){const s=await o;return{token:s.tokens.access_token,tokenInfo:{accessToken:s.tokens.access_token,refreshToken:s.tokens.refresh_token??null,expiresIn:s.tokens.expires_in??null,scope:s.tokens.scope??null,clientId:s.clientId,clientSecret:s.clientSecret,tokenEndpoint:s.tokenEndpoint},error:null}}const c=r.tokens(),i=r.clientInformation();return{token:c?.access_token||null,tokenInfo:c?{accessToken:c.access_token,refreshToken:c.refresh_token??null,expiresIn:c.expires_in??null,scope:c.scope??null,clientId:i?.client_id??null,clientSecret:i&&"client_secret"in i?i.client_secret:null,tokenEndpoint:null}:null,error:null}}catch(o){return{token:null,tokenInfo:null,error:o instanceof Error?o.message:String(o)}}finally{r.cleanup()}}function k(n,e){if(window.opener&&!window.opener.closed)return window.opener.postMessage(n,window.location.origin),!0;if(e)try{const t=`${O}${e}`;return localStorage.setItem(t,JSON.stringify(n)),!0}catch{}return!1}async function J(){const n=new URLSearchParams(window.location.search),e=n.get("code");let t=n.get("state");const r=n.get("error"),o=n.get("error_description");let a=t;if(t)try{const i=atob(t),s=JSON.parse(i);s.clientState&&(a=s.clientState)}catch{}if(r){const i=o||r;return k({type:"mcp:oauth:callback",success:!1,error:i},a),{success:!1,error:i}}if(!e||!t){const i="Missing code or state parameter";return k({type:"mcp:oauth:callback",success:!1,error:i},a),{success:!1,error:i}}return t=a||t,k({type:"mcp:oauth:callback",success:!0,code:e,state:t},t)?{success:!0}:{success:!1,error:"Parent window not available"}}function T(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function N(n){try{const e=T();return(e?new URL(n,e):new URL(n)).pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}async function z(n,e){try{const t=`/api/connections/${n}/oauth-token/status`,r=e?new URL(t,e).href:t,o=await fetch(r,{credentials:e?"omit":"include"});return o.ok?{hasToken:(await o.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function K({url:n,token:e,meshUrl:t}){try{const r=new Headers;r.set("Content-Type","application/json"),r.set("Accept","application/json, text/event-stream");const o=await fetch(n,{method:"POST",headers:r,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),a=N(n),c=T(),i=t??(c?new URL(n,c).origin:new URL(n).origin);if(o.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(a?await z(a,i):{hasToken:!1}).hasToken};let s;try{const h=await o.json();s=h.error||h.message}catch{}return o.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:s||`HTTP ${o.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!o.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:s||`HTTP ${o.status}`}}catch(r){return console.error("[isConnectionAuthenticated] Error:",r),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:r.message}}}export{D as a,J as h,K as i};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as w,ba as dt,e as J,j as n,f as me,a8 as Y,c as h,S as mt,m as ft,u as fe,bg as $e,L as Se,aW as ut,bC as pt,a as Oe,bd as Te,bD as ae,bE as ht,bF as xt,a6 as Me,bG as gt,bH as bt,a7 as jt,l as vt,P as wt,K as St,O as Nt,aL as Ae}from"./index-Czllqz-2.js";import{B as Z,c as $}from"./button-B00_ydX0.js";import{b as Ee,P as De,a as Re}from"./popover-DB55iMbc.js";import{B as Ne}from"./badge-CZbH2WMS.js";import{i as ce}from"./Check-D2dSwOsr.js";import{n as ye}from"./Inbox01-DY3Scgnu.js";import{s as Ce}from"./XClose-DZXz07Zp.js";import{E as Pe}from"./error-boundary-B15bMSig.js";import{i as yt}from"./File06-2DGjt4hs.js";import{i as de}from"./X-DJomJuB1.js";import{u as ie}from"./use-mobile-8fEdz_YY.js";import{S as Ct,b as _t,c as kt,d as It,e as zt,T as $t,i as Ot,f as Tt,t as Mt}from"./typewriter-title-DonUWsRZ.js";import{a as Le,b as He,T as Ue,c as Be}from"./tooltip-Dpvr0rXq.js";import{S as We,i as At,a as Et,C as D,u as Dt}from"./index-AUAYH-kQ.js";import{u as xe,a as Rt}from"./use-organization-settings-U0agG2h9.js";import{n as Pt,I as pe}from"./empty-state-BUcEAoKI.js";import{a as Lt}from"./Home02-BZwvtXxZ.js";import{t as Fe}from"./Users03-CDcB69PL.js";import{C as Ht}from"./create-organization-dialog-Dt_N2MMJ.js";import{I as Ut}from"./input-CCqm-6CK.js";import{A as ne}from"./avatar-Ck8-q6HY.js";import{c as Bt}from"./Grid01-BjSv11LN.js";import{a as Wt,b as Ft,D as Vt,c as Kt,g as _e}from"./dropdown-menu-42ftE2oK.js";import{a as Ve}from"./Copy01-DXECPSKT.js";import{n as ke}from"./LinkExternal01-OR0e2Yfm.js";import{c as Gt,b as Zt,g as qt,a as Yt,D as Jt}from"./dialog-qhbGhbZx.js";import{L as Xt}from"./form-BtpD-Mg0.js";import{S as Qt}from"./switch-RY18eFtF.js";import{i as es}from"./Code01-BE_3ESgc.js";import{u as ge,L as be}from"./localstorage-keys-KyET-T_h.js";import{R as Ke,a as ts,b as ss}from"./resizable-CJYOs9td.js";import{b as ns}from"./constants-WkW0waEP.js";import{s as as}from"./Plus-DFo2GFot.js";import"./SearchMd-Bh0QJjEM.js";import"./use-virtual-mcp-Bi5F5F6f.js";import"./use-collections-DGIB8J28.js";import"./useMutation-C9EFCZz_.js";import"./useQuery-Gixvofai.js";import"./use-connection-B5trZtD3.js";import"./use-binding-DETlsMC2.js";import"./binder-CQcXwjVp.js";import"./monaco-editor-Q_er1L0I.js";import"./infiniteQueryObserver-cVAe_2FL.js";import"./spinner-BndxvZpI.js";import"./select-BQyV0pOn.js";import"./ChevronDown-BQcg3GVd.js";import"./Image01-BphOjsIM.js";import"./use-mcp-prompts-Dj17zuNr.js";import"./AlertCircle-CUosFGNd.js";import"./ArrowUp-DQViolGS.js";import"./Edit01-B1Z5KLbC.js";import"./Terminal-Fv-TNTFR.js";import"./generate-id-Dyweu44Y.js";import"./Trash01-CccVd7Bh.js";import"./use-create-virtual-mcp-C1gVg8Cb.js";import"./alert-dialog-BRa6_KDy.js";const Ge=({size:t=24,color:e="currentColor",...s})=>w.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},w.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"}));Ge.displayName="BarChart10";const Ze=({size:t=24,color:e="currentColor",...s})=>w.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},w.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"}));Ze.displayName="Building02";const qe=({size:t=24,color:e="currentColor",...s})=>w.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},w.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"}));qe.displayName="Globe01";const Ye=({size:t=24,color:e="currentColor",...s})=>w.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},w.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"}));Ye.displayName="LayoutRight";const Je=({size:t=24,color:e="currentColor",...s})=>w.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},w.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"}));Je.displayName="LogOut01";const Xe=({size:t=24,color:e="currentColor",...s})=>w.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},w.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"}));Xe.displayName="Mail01";const je=({size:t=24,color:e="currentColor",...s})=>w.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},w.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),w.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"}));je.displayName="Settings01";const Qe=({size:t=24,color:e="currentColor",...s})=>w.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},w.createElement("path",{d:"M4 21.817C4.603 22 5.416 22 6.8 22h10.4c1.384 0 2.197 0 2.8-.183m-16 0a2.18 2.18 0 0 1-.362-.144 3 3 0 0 1-1.311-1.311C2 19.72 2 18.88 2 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 2 5.12 2 6.8 2h10.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 4.28 22 5.12 22 6.8v10.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311 2.18 2.18 0 0 1-.362.144m-16 0c0-.809.005-1.237.077-1.597a4 4 0 0 1 3.143-3.143C7.606 17 8.07 17 9 17h6c.93 0 1.394 0 1.78.077a4 4 0 0 1 3.143 3.143c.072.36.077.788.077 1.597M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));Qe.displayName="UserSquare";const et=({size:t=24,color:e="currentColor",...s})=>w.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},w.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));et.displayName="Zap";function is({invitation:t,onStatusChange:e}){const[s,a]=w.useState(!1),[i,l]=w.useState(!1),r=me(),o=async()=>{a(!0);try{const b=await J.organization.acceptInvitation({invitationId:t.id});if(b.error)Y.error(b.error.message),a(!1);else{e(t.id,"accepted");const j=await J.organization.setActive({organizationId:t.organizationId});j?.data?.slug?(Y.success("Invitation accepted!"),r({to:"/$org",params:{org:j.data.slug}})):(Y.success("Invitation accepted! Redirecting..."),r({to:"/"}))}}catch{Y.error("Failed to accept invitation"),a(!1)}},c=async()=>{l(!0);try{const b=await J.organization.rejectInvitation({invitationId:t.id});b.error?(Y.error(b.error.message),l(!1)):(Y.success("Invitation rejected"),e(t.id,"rejected"),l(!1))}catch{Y.error("Failed to reject invitation"),l(!1)}},d=t.organizationName||t.organizationId,m=t.status==="pending",u=t.status==="accepted",p=t.status==="rejected";return n.jsxs("div",{className:$("flex items-center gap-3 px-3 py-2 h-12 border-b border-border/50 last:border-b-0",!m&&"opacity-50"),children:[n.jsx("div",{className:"shrink-0 size-5 flex items-center justify-center",children:n.jsx(Xe,{size:16,className:"text-muted-foreground"})}),n.jsxs("p",{className:"flex-1 text-sm text-foreground min-w-0 whitespace-nowrap overflow-hidden",children:["You have been invited to ",n.jsx("span",{className:"font-semibold inline-block max-w-[200px] truncate align-bottom",children:d})]}),n.jsx("div",{className:"flex items-center gap-1 shrink-0",children:m?n.jsxs(n.Fragment,{children:[n.jsx(Z,{variant:"ghost",size:"icon",onClick:c,disabled:s||i,className:"h-8 w-8",children:n.jsx(Ce,{size:14})}),n.jsx(Z,{variant:"outline",size:"icon",onClick:o,disabled:s||i,className:"h-8 w-8",children:n.jsx(ce,{size:14})})]}):u?n.jsxs(Ne,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(ce,{size:12}),"Accepted"]}):p?n.jsxs(Ne,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(Ce,{size:12}),"Declined"]}):null})]})}function ls(){const[t,e]=w.useState(!1),s=w.useContext(dt),{data:a}=s.hooks.useListUserInvitations(),{data:i}=J.useListOrganizations(),[l,r]=w.useState({}),m=(a??[]).filter(f=>new Date(f.expiresAt)>new Date).map(f=>{const g=(i??[]).find(x=>x.id===f.organizationId);return{...f,organizationSlug:g?.slug||f.organizationSlug,organizationName:g?.name||f.organizationName}}).map(f=>({...f,status:l[f.id]||f.status})),u=[...m].sort((f,g)=>{const x={pending:0,accepted:1,rejected:2};return(x[f.status]??999)-(x[g.status]??999)}),b=m.filter(f=>f.status==="pending").length>0,j=(f,g)=>{r(x=>({...x,[f]:g}))};return n.jsxs(Ee,{open:t,onOpenChange:e,children:[n.jsx(De,{asChild:!0,children:n.jsxs(Z,{variant:"ghost",size:"sm",className:"relative h-7 w-7 p-0","aria-label":"Inbox",children:[n.jsx(ye,{size:18,className:"text-muted-foreground"}),b&&n.jsx("span",{className:"absolute bottom-1 right-0.5 h-2 w-2 rounded-full bg-destructive ring-2 ring-background"})]})}),n.jsxs(Re,{align:"end",className:"w-[480px] p-0 overflow-hidden",children:[n.jsx("div",{className:"px-4 py-3 border-b border-border",children:n.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Inbox"})}),n.jsx("div",{className:"max-h-96 overflow-auto",children:u.length>0?u.map(f=>n.jsx(is,{invitation:f,onStatusChange:j},f.id)):n.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[n.jsx(ye,{size:32,className:"text-muted-foreground/40 mb-2"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"No invitations at the moment"})]})})]})]})}const rs="sidebar_state",os=3600*24*7,cs="16rem",ds="18rem",ms="3rem",fs="b",tt=w.createContext(null);function ve(){const t=w.useContext(tt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function us(t){const e=h.c(21),{defaultOpen:s,open:a,onOpenChange:i,children:l}=t,r=s===void 0?!0:s,o=ie(),[c,d]=w.useState(!1),[m,u]=w.useState(r),p=a??m;let b;e[0]!==p||e[1]!==i?(b=z=>{const C=typeof z=="function"?z(p):z;i?i(C):u(C),document.cookie=`${rs}=${C}; path=/; max-age=${os}`},e[0]=p,e[1]=i,e[2]=b):b=e[2];const j=b;let f;e[3]!==o||e[4]!==j?(f=()=>o?d(hs):j(ps),e[3]=o,e[4]=j,e[5]=f):f=e[5];const g=f;let x,v;e[6]!==g?(x=()=>{const z=C=>{if(C.key===fs&&(C.metaKey||C.ctrlKey)){const I=C.target;if(I.tagName==="INPUT"||I.tagName==="TEXTAREA"||I.isContentEditable)return;C.preventDefault(),g()}};return globalThis.addEventListener("keydown",z),()=>globalThis.removeEventListener("keydown",z)},v=[g],e[6]=g,e[7]=x,e[8]=v):(x=e[7],v=e[8]),w.useEffect(x,v);const S=p?"expanded":"collapsed";let _;e[9]!==o||e[10]!==p||e[11]!==c||e[12]!==j||e[13]!==S||e[14]!==g?(_={state:S,open:p,setOpen:j,isMobile:o,openMobile:c,setOpenMobile:d,toggleSidebar:g},e[9]=o,e[10]=p,e[11]=c,e[12]=j,e[13]=S,e[14]=g,e[15]=_):_=e[15];const N=_;let k;e[16]!==l?(k=n.jsx(He,{delayDuration:0,children:l}),e[16]=l,e[17]=k):k=e[17];let y;return e[18]!==N||e[19]!==k?(y=n.jsx(tt.Provider,{value:N,children:k}),e[18]=N,e[19]=k,e[20]=y):y=e[20],y}function ps(t){return!t}function hs(t){return!t}function xs(t){const e=h.c(14);let s,a,i,l;e[0]!==t?({className:a,style:l,children:s,...i}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=i,e[4]=l):(s=e[1],a=e[2],i=e[3],l=e[4]);let r;e[5]!==l?(r={"--sidebar-width":cs,"--sidebar-width-icon":ms,...l},e[5]=l,e[6]=r):r=e[6];const o=r;let c;e[7]!==a?(c=$("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",a),e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==s||e[10]!==i||e[11]!==o||e[12]!==c?(d=n.jsx("div",{"data-slot":"sidebar-wrapper",style:o,className:c,...i,children:s}),e[9]=s,e[10]=i,e[11]=o,e[12]=c,e[13]=d):d=e[13],d}function gs(t){const e=h.c(46);let s,a,i,l,r,o;e[0]!==t?({side:l,variant:r,collapsible:o,className:a,children:s,...i}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=i,e[4]=l,e[5]=r,e[6]=o):(s=e[1],a=e[2],i=e[3],l=e[4],r=e[5],o=e[6]);const c=l===void 0?"left":l,d=r===void 0?"sidebar":r,m=o===void 0?"offcanvas":o,{isMobile:u,state:p,openMobile:b,setOpenMobile:j}=ve();if(m==="none"){let C;e[7]!==a?(C=$("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),e[7]=a,e[8]=C):C=e[8];let I;return e[9]!==s||e[10]!==i||e[11]!==C?(I=n.jsx("div",{"data-slot":"sidebar",className:C,...i,children:s}),e[9]=s,e[10]=i,e[11]=C,e[12]=I):I=e[12],I}if(u){let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C={"--sidebar-width":ds},e[13]=C):C=e[13];let I;e[14]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsxs(_t,{className:"sr-only",children:[n.jsx(kt,{children:"Sidebar"}),n.jsx(It,{children:"Displays the mobile sidebar."})]}),e[14]=I):I=e[14];let T;e[15]!==s?(T=n.jsx("div",{className:"flex h-full w-full flex-col",children:s}),e[15]=s,e[16]=T):T=e[16];let O;e[17]!==c||e[18]!==T?(O=n.jsxs(zt,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:C,side:c,children:[I,T]}),e[17]=c,e[18]=T,e[19]=O):O=e[19];let M;return e[20]!==b||e[21]!==i||e[22]!==j||e[23]!==O?(M=n.jsx(Ct,{open:b,onOpenChange:j,...i,children:O}),e[20]=b,e[21]=i,e[22]=j,e[23]=O,e[24]=M):M=e[24],M}const f=p==="collapsed"?m:"",g=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 x;e[25]!==g?(x=$("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",g),e[25]=g,e[26]=x):x=e[26];let v;e[27]!==x?(v=n.jsx("div",{"data-slot":"sidebar-gap",className:x}),e[27]=x,e[28]=v):v=e[28];const S=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)]",_=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 N;e[29]!==a||e[30]!==S||e[31]!==_?(N=$("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",S,_,a),e[29]=a,e[30]=S,e[31]=_,e[32]=N):N=e[32];let k;e[33]!==s?(k=n.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:s}),e[33]=s,e[34]=k):k=e[34];let y;e[35]!==i||e[36]!==N||e[37]!==k?(y=n.jsx("div",{"data-slot":"sidebar-container",className:N,...i,children:k}),e[35]=i,e[36]=N,e[37]=k,e[38]=y):y=e[38];let z;return e[39]!==c||e[40]!==p||e[41]!==y||e[42]!==f||e[43]!==v||e[44]!==d?(z=n.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":p,"data-collapsible":f,"data-variant":d,"data-side":c,"data-slot":"sidebar",children:[v,y]}),e[39]=c,e[40]=p,e[41]=y,e[42]=f,e[43]=v,e[44]=d,e[45]=z):z=e[45],z}function bs(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let i;e[3]!==s?(i=$("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",s),e[3]=s,e[4]=i):i=e[4];let l;return e[5]!==a||e[6]!==i?(l=n.jsx("main",{"data-slot":"sidebar-inset",className:i,...a}),e[5]=a,e[6]=i,e[7]=l):l=e[7],l}function js(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let i;e[3]!==s?(i=$("h-4 m-0! w-full",s),e[3]=s,e[4]=i):i=e[4];let l;return e[5]!==a||e[6]!==i?(l=n.jsx("div",{"data-sidebar":"separator",className:i,...a}),e[5]=a,e[6]=i,e[7]=l):l=e[7],l}function vs(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let i;e[3]!==s?(i=$("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),e[3]=s,e[4]=i):i=e[4];let l;return e[5]!==a||e[6]!==i?(l=n.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:i,...a}),e[5]=a,e[6]=i,e[7]=l):l=e[7],l}function ws(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let i;e[3]!==s?(i=$("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",s),e[3]=s,e[4]=i):i=e[4];let l;return e[5]!==a||e[6]!==i?(l=n.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:i,...a}),e[5]=a,e[6]=i,e[7]=l):l=e[7],l}function Ss(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let i;e[3]!==s?(i=$("w-full text-sm",s),e[3]=s,e[4]=i):i=e[4];let l;return e[5]!==a||e[6]!==i?(l=n.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:i,...a}),e[5]=a,e[6]=i,e[7]=l):l=e[7],l}function Ns(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let i;e[3]!==s?(i=$("flex w-full min-w-0 flex-col gap-1",s),e[3]=s,e[4]=i):i=e[4];let l;return e[5]!==a||e[6]!==i?(l=n.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i,...a}),e[5]=a,e[6]=i,e[7]=l):l=e[7],l}function ue(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let i;e[3]!==s?(i=$("group/menu-item relative",s),e[3]=s,e[4]=i):i=e[4];let l;return e[5]!==a||e[6]!==i?(l=n.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i,...a}),e[5]=a,e[6]=i,e[7]=l):l=e[7],l}const ys=ft("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 st(t){const e=h.c(28);let s,a,i,l,r,o,c;e[0]!==t?({asChild:i,isActive:l,variant:r,size:o,tooltip:c,className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=i,e[4]=l,e[5]=r,e[6]=o,e[7]=c):(s=e[1],a=e[2],i=e[3],l=e[4],r=e[5],o=e[6],c=e[7]);const d=i===void 0?!1:i,m=l===void 0?!1:l,u=r===void 0?"default":r,p=o===void 0?"default":o,b=d?mt:"button",{isMobile:j,state:f}=ve();let g;e[8]!==s||e[9]!==p||e[10]!==u?(g=$(ys({variant:u,size:p}),s),e[8]=s,e[9]=p,e[10]=u,e[11]=g):g=e[11];let x;e[12]!==b||e[13]!==m||e[14]!==a||e[15]!==p||e[16]!==g?(x=n.jsx(b,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":p,"data-active":m,className:g,...a}),e[12]=b,e[13]=m,e[14]=a,e[15]=p,e[16]=g,e[17]=x):x=e[17];const v=x;if(!c)return v;if(typeof c=="string"){let y;e[18]!==c?(y={children:c},e[18]=c,e[19]=y):y=e[19],c=y}let S;e[20]!==v?(S=n.jsx(Ue,{asChild:!0,children:v}),e[20]=v,e[21]=S):S=e[21];const _=f!=="collapsed"||j;let N;e[22]!==_||e[23]!==c?(N=n.jsx(Le,{side:"right",align:"center",hidden:_,...c}),e[22]=_,e[23]=c,e[24]=N):N=e[24];let k;return e[25]!==S||e[26]!==N?(k=n.jsxs(Be,{children:[S,N]}),e[25]=S,e[26]=N,e[27]=k):k=e[27],k}function Cs(t){const e=h.c(26),{item:s}=t,a=me(),{org:i}=fe(),l=xe(i.id),r=Rt(i.id);let o;e[0]!==r.update||e[1]!==s.url||e[2]!==l?.sidebar_items?(o=async()=>{const _=(l?.sidebar_items||[]).filter(N=>N.url!==s.url);await r.update.mutateAsync({sidebar_items:_})},e[0]=r.update,e[1]=s.url,e[2]=l?.sidebar_items,e[3]=o):o=e[3];const c=o;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=/^https?:\/\/.+/,e[4]=d):d=e[4];let m;e[5]!==s.icon?(m=d.test(s.icon),e[5]=s.icon,e[6]=m):m=e[6];const u=m;let p;e[7]!==s.url||e[8]!==a?(p=()=>{a({to:s.url})},e[7]=s.url,e[8]=a,e[9]=p):p=e[9];const b=s.title;let j;e[10]!==u||e[11]!==s.icon||e[12]!==s.title?(j=n.jsx("div",{className:"flex items-center justify-center shrink-0",children:u?n.jsx("img",{src:s.icon,alt:s.title,className:"h-4 w-4 rounded object-cover"}):n.jsx(yt,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=u,e[11]=s.icon,e[12]=s.title,e[13]=j):j=e[13];let f;e[14]!==s.title?(f=s.title.toLocaleLowerCase(),e[14]=s.title,e[15]=f):f=e[15];let g;e[16]!==f?(g=n.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:n.jsx("span",{className:"truncate text-sm w-full capitalize",children:f})}),e[16]=f,e[17]=g):g=e[17];let x;e[18]!==c?(x=n.jsx(de,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:S=>{S.preventDefault(),S.stopPropagation(),c()}}),e[18]=c,e[19]=x):x=e[19];let v;return e[20]!==s.title||e[21]!==p||e[22]!==j||e[23]!==g||e[24]!==x?(v=n.jsx(ue,{children:n.jsxs(st,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:p,tooltip:b,children:[j,g,x]})}),e[20]=s.title,e[21]=p,e[22]=j,e[23]=g,e[24]=x,e[25]=v):v=e[25],v}function _s(){const t=h.c(4),{org:e}=fe(),a=xe(e.id)?.sidebar_items;if(!a?.length)return null;let i;t[0]!==a?(i=a.map(ks),t[0]=a,t[1]=i):i=t[1];let l;return t[2]!==i?(l=n.jsx(nt,{children:i}),t[2]=i,t[3]=l):l=t[3],l}function ks(t){return n.jsx(Cs,{item:t},t.url)}function Ie(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ue,{children:n.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:n.jsx(We,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function nt(t){const e=h.c(4),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(js,{className:"my-2 -ml-1"}),e[0]=a):a=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ue,{children:n.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:n.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=i):i=e[1];let l;return e[2]!==s?(l=n.jsxs(n.Fragment,{children:[a,i,s]}),e[2]=s,e[3]=l):l=e[3],l}function Is(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(w.Suspense,{fallback:n.jsxs(nt,{children:[n.jsx(Ie,{}),n.jsx(Ie,{})]}),children:n.jsx(_s,{})}),t[0]=e):e=t[0],e}function zs(){const t=h.c(14),{locator:e,org:s}=fe(),a=me(),i=$e(),{org:l}=Se.parse(e);let r;t[0]!==e?(r=Se.isOrgAdminProject(e),t[0]=e,t[1]=r):r=t[1];const o=r,c=xe(s.id);let d;t[2]!==c?.enabled_plugins?(d=c?.enabled_plugins??[],t[2]=c?.enabled_plugins,t[3]=d):d=t[3];const m=d;let u;t[4]!==m?(u=y=>m.includes(y.pluginId),t[4]=m,t[5]=u):u=t[5];const p=ut.filter(u),b=i.location.pathname===`/${l}`||i.location.pathname===`/${l}/`;let j;t[6]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Lt,{}),t[6]=j):j=t[6];let f;t[7]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Ze,{}),t[7]=f):f=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Pt,{}),t[8]=g):g=t[8];let x;t[9]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Fe,{}),t[9]=x):x=t[9];let v;t[10]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(et,{}),t[10]=v):v=t[10];let S;t[11]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(Ge,{}),t[11]=S):S=t[11];let _;t[12]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(Qe,{}),t[12]=_):_=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(je,{}),t[13]=N):N=t[13];const k=[{key:"home",label:"Home",icon:j,onClick:()=>{b?window.dispatchEvent(new CustomEvent("reset-home-view")):a({to:"/$org",params:{org:l}})}},{key:"store",label:"Store",icon:f,onClick:()=>a({to:"/$org/store",params:{org:l}})},...p.map(y=>({key:y.pluginId,label:y.label,icon:y.icon,onClick:()=>a({to:"/$org/$pluginId",params:{org:l,pluginId:y.pluginId}})})),{key:"mcps",label:"Connections",icon:g,onClick:()=>a({to:"/$org/mcps",params:{org:l}})},{key:"agents",label:"Agents",icon:x,onClick:()=>a({to:"/$org/agents",params:{org:l}})},{key:"workflow",label:"Workflows",icon:v,onClick:()=>a({to:"/$org/workflows",params:{org:l}})},{key:"monitoring",label:"Monitoring",icon:S,onClick:()=>a({to:"/$org/monitoring",params:{org:l}})},{key:"members",label:"Members",icon:_,onClick:()=>a({to:"/$org/members",params:{org:l}})},{key:"settings",label:"Settings",icon:N,onClick:()=>a({to:"/$org/settings",params:{org:l}})}];return o?k:[]}function at(t){const e=h.c(10),{navigationItems:s,footer:a,additionalContent:i,variant:l,collapsible:r}=t,o=l===void 0?"sidebar":l,c=r===void 0?"icon":r;let d;e[0]!==s?(d=s.map($s),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==i||e[3]!==d?(m=n.jsx(vs,{className:"flex-1 overflow-x-hidden",children:n.jsx(ws,{className:"font-medium",children:n.jsx(Ss,{children:n.jsxs(Ns,{className:"gap-0.5",children:[d,i]})})})}),e[2]=i,e[3]=d,e[4]=m):m=e[4];let u;return e[5]!==c||e[6]!==a||e[7]!==m||e[8]!==o?(u=n.jsxs(gs,{variant:o,collapsible:c,children:[m,a]}),e[5]=c,e[6]=a,e[7]=m,e[8]=o,e[9]=u):u=e[9],u}function $s(t){return n.jsx(ue,{children:n.jsxs(st,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground",onClick:t.onClick,isActive:t.isActive,tooltip:t.label,children:[n.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:t.icon}),n.jsx("span",{className:"truncate",children:t.label})]})},t.key)}at.Skeleton=function(){return n.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>n.jsx("div",{className:"w-full h-8",children:n.jsx(We,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function Os(){const t=h.c(3),e=zs();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Pe,{children:n.jsx(w.Suspense,{fallback:null,children:n.jsx(Is,{})})}),t[0]=s):s=t[0];let a;return t[1]!==e?(a=n.jsx(at,{navigationItems:e,additionalContent:s}),t[1]=e,t[2]=a):a=t[2],a}function Ts(t){const e=h.c(12);let s,a,i,l;e[0]!==t?({className:s,orientation:i,decorative:l,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=i,e[4]=l):(s=e[1],a=e[2],i=e[3],l=e[4]);const r=i===void 0?"horizontal":i,o=l===void 0?!0:l;let c;e[5]!==s?(c=$("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",s),e[5]=s,e[6]=c):c=e[6];let d;return e[7]!==o||e[8]!==r||e[9]!==a||e[10]!==c?(d=n.jsx(pt,{"data-slot":"separator-root",decorative:o,orientation:r,className:c,...a}),e[7]=o,e[8]=r,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}const it=w.createContext(null);function Ms(){const t=w.useContext(it);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function As(t){const e=h.c(10),{children:s,onItemHover:a}=t,[i,l]=w.useState(null);let r;e[0]!==a?(r=u=>{l(u),a?.(u)},e[0]=a,e[1]=r):r=e[1];const o=r;let c;e[2]!==i||e[3]!==o?(c={hoveredItem:i,setHoveredItem:o},e[2]=i,e[3]=o,e[4]=c):c=e[4];let d;e[5]!==s?(d=n.jsx(Ee,{children:s}),e[5]=s,e[6]=d):d=e[6];let m;return e[7]!==c||e[8]!==d?(m=n.jsx(it.Provider,{value:c,children:d}),e[7]=c,e[8]=d,e[9]=m):m=e[9],m}function Es(t){const e=h.c(6),{children:s,onClick:a}=t;let i;e[0]!==s||e[1]!==a?(i=n.jsx(Z,{variant:"link",className:"p-0.5 h-auto",onClick:a,type:"button",children:s}),e[0]=s,e[1]=a,e[2]=i):i=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(De,{asChild:!0,children:n.jsx(Z,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:n.jsx(At,{size:16,className:"opacity-50"})})}),e[3]=l):l=e[3];let r;return e[4]!==i?(r=n.jsxs("div",{className:"flex items-center gap-1",children:[i,l]}),e[4]=i,e[5]=r):r=e[5],r}function Ds(t){const e=h.c(8),{item:s,fallback:a}=t,i=a===void 0?"":a,l=s?.avatarUrl??"",r=s?.name??i;let o;e[0]!==l||e[1]!==r?(o=n.jsx(ne,{url:l,fallback:r,size:"xs",objectFit:"contain"}),e[0]=l,e[1]=r,e[2]=o):o=e[2];const c=s?.name??i;let d;e[3]!==c?(d=n.jsx("span",{children:c}),e[3]=c,e[4]=d):d=e[4];let m;return e[5]!==o||e[6]!==d?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[o,d]}),e[5]=o,e[6]=d,e[7]=m):m=e[7],m}function Rs(t){const e=h.c(6),{children:s,align:a}=t,i=a===void 0?"start":a,r=w.Children.toArray(s).filter(Ps).length===1?"280px":"480px";let o;e[0]!==r?(o={width:r},e[0]=r,e[1]=o):o=e[1];let c;return e[2]!==i||e[3]!==s||e[4]!==o?(c=n.jsx(Re,{align:i,className:"p-0 flex items-start",style:o,children:s}),e[2]=i,e[3]=s,e[4]=o,e[5]=c):c=e[5],c}function Ps(t){return w.isValidElement(t)&&(t.type===rt||t.type===lt)}function lt(t){const e=h.c(5),{children:s,className:a}=t;let i;e[0]!==a?(i=$("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",a),e[0]=a,e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==i?(l=n.jsx("div",{className:i,children:s}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}const rt=lt;function Ls(t){const e=h.c(6),{placeholder:s,value:a,onChange:i}=t,l=s===void 0?"Search...":s;let r;e[0]!==i?(r=c=>i(c.target.value),e[0]=i,e[1]=r):r=e[1];let o;return e[2]!==l||e[3]!==r||e[4]!==a?(o=n.jsx(Ut,{placeholder:l,value:a,onChange:r,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=l,e[3]=r,e[4]=a,e[5]=o):o=e[5],o}function Hs(t){const e=h.c(6),{children:s,emptyMessage:a}=t,i=a===void 0?"No items found.":a,l=w.Children.count(s)>0;let r;e[0]!==i||e[1]!==l?(r=!l&&n.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:i}),e[0]=i,e[1]=l,e[2]=r):r=e[2];let o;return e[3]!==s||e[4]!==r?(o=n.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[r,s]}),e[3]=s,e[4]=r,e[5]=o):o=e[5],o}function Us(t){const e=h.c(15),{item:s,onClick:a,onHover:i,children:l}=t,r=Ms();let o;e[0]!==r||e[1]!==s||e[2]!==i?(o=()=>{r.setHoveredItem(s.slug),i?.(s)},e[0]=r,e[1]=s,e[2]=i,e[3]=o):o=e[3];const c=o;let d;e[4]!==s||e[5]!==a?(d=()=>a(s),e[4]=s,e[5]=a,e[6]=d):d=e[6];let m;e[7]!==l||e[8]!==s.avatarUrl||e[9]!==s.name?(m=l||n.jsxs(n.Fragment,{children:[n.jsx(ne,{url:s.avatarUrl??"",fallback:s.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),n.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.name})]}),e[7]=l,e[8]=s.avatarUrl,e[9]=s.name,e[10]=m):m=e[10];let u;return e[11]!==c||e[12]!==d||e[13]!==m?(u=n.jsx(Z,{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]=u):u=e[14],u}function Bs(t){const e=h.c(2),{children:s}=t;let a;return e[0]!==s?(a=n.jsx("div",{className:"px-1 pb-1 pt-0.5",children:s}),e[0]=s,e[1]=a):a=e[1],a}function Ws(t){const e=h.c(11),{onClick:s,icon:a,children:i,variant:l}=t,o=(l===void 0?"default":l)==="muted"&&"text-muted-foreground";let c;e[0]!==o?(c=$("w-full justify-start font-normal",o),e[0]=o,e[1]=c):c=e[1];let d;e[2]!==a?(d=a&&n.jsx("span",{className:"[&>svg]:size-4",children:a}),e[2]=a,e[3]=d):d=e[3];let m;e[4]!==i?(m=n.jsx("span",{children:i}),e[4]=i,e[5]=m):m=e[5];let u;return e[6]!==s||e[7]!==c||e[8]!==d||e[9]!==m?(u=n.jsxs(Z,{variant:"ghost",size:"sm",className:c,onClick:s,children:[d,m]}),e[6]=s,e[7]=c,e[8]=d,e[9]=m,e[10]=u):u=e[10],u}function Fs(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Ts,{}),t[0]=e):e=t[0],e}function Vs(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const H=Object.assign(As,{Trigger:Es,CurrentItem:Ds,Content:Rs,Panel:rt,Search:Ls,Items:Hs,Item:Us,Actions:Bs,Action:Ws,Separator:Fs,Skeleton:Vs});function he(){const t=h.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=Oe(e),{data:a}=J.useListOrganizations(),i=me();let l;t[1]!==s||t[2]!==a?(l=a?.find(A=>A.slug===s),t[1]=s,t[2]=a,t[3]=l):l=t[3];const r=l,[o,c]=w.useState(""),[d,m]=w.useState(!1);let u,p,b,j,f,g,x,v;if(t[4]!==r||t[5]!==i||t[6]!==s||t[7]!==o||t[8]!==a){const E=(a?(()=>{const P=a.filter(L=>L.name.toLowerCase().includes(o.toLowerCase()));if(s){const L=P.findIndex(K=>K.slug===s);if(L>0){const K=P[L];K&&(P.splice(L,1),P.unshift(K))}}return P})():[]).map(Ks);let R;t[17]!==r?(R=r?{slug:r.slug,name:r.name,avatarUrl:r.logo}:void 0,t[17]=r,t[18]=R):R=t[18];const W=R;j=H;let F;t[19]!==i||t[20]!==s?(F=()=>i({to:"/$org",params:{org:s??""}}),t[19]=i,t[20]=s,t[21]=F):F=t[21];let U;t[22]!==W?(U=n.jsx(H.CurrentItem,{item:W}),t[22]=W,t[23]=U):U=t[23],t[24]!==F||t[25]!==U?(v=n.jsx(H.Trigger,{onClick:F,children:U}),t[24]=F,t[25]=U,t[26]=v):v=t[26],b=H.Content,p=H.Panel,t[27]!==o?(x=n.jsx(H.Search,{placeholder:"Search organizations...",value:o,onChange:c}),t[27]=o,t[28]=x):x=t[28],u=H.Items,f="No organizations found.";let V;t[29]!==i?(V=P=>n.jsx(H.Item,{item:P,onClick:L=>i({to:"/$org",params:{org:L.slug}})},P.slug),t[29]=i,t[30]=V):V=t[30],g=E.map(V),t[4]=r,t[5]=i,t[6]=s,t[7]=o,t[8]=a,t[9]=u,t[10]=p,t[11]=b,t[12]=j,t[13]=f,t[14]=g,t[15]=x,t[16]=v}else u=t[9],p=t[10],b=t[11],j=t[12],f=t[13],g=t[14],x=t[15],v=t[16];let S;t[31]!==u||t[32]!==f||t[33]!==g?(S=n.jsx(u,{emptyMessage:f,children:g}),t[31]=u,t[32]=f,t[33]=g,t[34]=S):S=t[34];let _,N;t[35]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(H.Actions,{children:n.jsx(H.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),N=n.jsx(H.Separator,{}),t[35]=_,t[36]=N):(_=t[35],N=t[36]);let k;t[37]!==i?(k=()=>i({to:"/"}),t[37]=i,t[38]=k):k=t[38];let y;t[39]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Bt,{}),t[39]=y):y=t[39];let z;t[40]!==k?(z=n.jsx(H.Actions,{children:n.jsx(H.Action,{onClick:k,icon:y,children:"See all organizations"})}),t[40]=k,t[41]=z):z=t[41];let C;t[42]!==p||t[43]!==z||t[44]!==x||t[45]!==S?(C=n.jsxs(p,{children:[x,S,_,N,z]}),t[42]=p,t[43]=z,t[44]=x,t[45]=S,t[46]=C):C=t[46];let I;t[47]!==b||t[48]!==C?(I=n.jsx(b,{children:C}),t[47]=b,t[48]=C,t[49]=I):I=t[49];let T;t[50]!==j||t[51]!==I||t[52]!==v?(T=n.jsxs(j,{children:[v,I]}),t[50]=j,t[51]=I,t[52]=v,t[53]=T):T=t[53];let O;t[54]!==d?(O=n.jsx(Ht,{open:d,onOpenChange:m}),t[54]=d,t[55]=O):O=t[55];let M;return t[56]!==T||t[57]!==O?(M=n.jsxs(n.Fragment,{children:[T,O]}),t[56]=T,t[57]=O,t[58]=M):M=t[58],M}function Ks(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}he.Skeleton=H.Skeleton;function Gs({prop:t,defaultProp:e,onChange:s=()=>{}}){const[a,i]=Zs({defaultProp:e,onChange:s}),l=t!==void 0,r=l?t:a,o=Te(s),c=w.useCallback(d=>{if(l){const u=typeof d=="function"?d(t):d;u!==t&&o(u)}else i(d)},[l,t,i,o]);return[r,c]}function Zs({defaultProp:t,onChange:e}){const s=w.useState(t),[a]=s,i=w.useRef(a),l=Te(e);return w.useEffect(()=>{i.current!==a&&(l(a),i.current=a)},[a,i,l]),s}function qs(t){const e=h.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(ae.Root,{"data-slot":"drawer",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ys(t){const e=h.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(ae.Trigger,{"data-slot":"drawer-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function Js(t){const e=h.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(ae.Portal,{"data-slot":"drawer-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function Xs(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let i;e[3]!==s?(i=$("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",s),e[3]=s,e[4]=i):i=e[4];let l;return e[5]!==a||e[6]!==i?(l=n.jsx(ae.Overlay,{"data-slot":"drawer-overlay",className:i,...a}),e[5]=a,e[6]=i,e[7]=l):l=e[7],l}function Qs(t){const e=h.c(12);let s,a,i;e[0]!==t?({className:a,children:s,...i}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=i):(s=e[1],a=e[2],i=e[3]);let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Xs,{}),e[4]=l):l=e[4];let r;e[5]!==a?(r=$("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=r):r=e[6];let o;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=o):o=e[7];let c;return e[8]!==s||e[9]!==i||e[10]!==r?(c=n.jsxs(Js,{"data-slot":"drawer-portal",children:[l,n.jsxs(ae.Content,{"data-slot":"drawer-content",className:r,...i,children:[o,s]})]}),e[8]=s,e[9]=i,e[10]=r,e[11]=c):c=e[11],c}function en(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let i;e[3]!==s?(i=$("flex flex-col gap-1.5 px-4 py-2",s),e[3]=s,e[4]=i):i=e[4];let l;return e[5]!==a||e[6]!==i?(l=n.jsx("div",{"data-slot":"drawer-header",className:i,...a}),e[5]=a,e[6]=i,e[7]=l):l=e[7],l}function tn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let i;e[3]!==s?(i=$("text-foreground font-semibold",s),e[3]=s,e[4]=i):i=e[4];let l;return e[5]!==a||e[6]!==i?(l=n.jsx(ae.Title,{"data-slot":"drawer-title",className:i,...a}),e[5]=a,e[6]=i,e[7]=l):l=e[7],l}const ot=w.createContext({setOpen:()=>{}}),sn=()=>w.useContext(ot),nn=t=>{const e=h.c(25);let s,a,i,l,r;e[0]!==t?({children:s,defaultOpen:a,open:l,onOpenChange:i,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=i,e[4]=l,e[5]=r):(s=e[1],a=e[2],i=e[3],l=e[4],r=e[5]);const o=a??!1;let c;e[6]!==i||e[7]!==l||e[8]!==o?(c={prop:l,defaultProp:o,onChange:i},e[6]=i,e[7]=l,e[8]=o,e[9]=c):c=e[9];const[d,m]=Gs(c);let u;e[10]!==m?(u={setOpen:m},e[10]=m,e[11]=u):u=e[11];let p;e[12]!==s||e[13]!==d||e[14]!==r||e[15]!==m?(p=n.jsx(qs,{open:d,onOpenChange:m,...r,children:s}),e[12]=s,e[13]=d,e[14]=r,e[15]=m,e[16]=p):p=e[16];let b;e[17]!==d||e[18]!==r||e[19]!==m||e[20]!==p?(b=n.jsx(Vt,{open:d,onOpenChange:m,...r,children:p}),e[17]=d,e[18]=r,e[19]=m,e[20]=p,e[21]=b):b=e[21];let j;return e[22]!==u||e[23]!==b?(j=n.jsx(ot.Provider,{value:u,children:b}),e[22]=u,e[23]=b,e[24]=j):j=e[24],j},an=t=>{const{children:e,title:s,...a}=t,i=ie(),{className:l,...r}=a;return i?n.jsxs(Qs,{...r,children:[n.jsx(en,{className:"hidden",children:n.jsx(tn,{children:s})}),n.jsx("div",{className:$("flex flex-col gap-2 p-2 py-4",l),children:e})]}):n.jsx(Ft,{...a,children:e})},ln=t=>{const{children:e,...s}=t,{setOpen:a}=sn(),i=ie(),{className:l,...r}=s;return i?n.jsx("div",{...r,onClick:o=>{a(!1);const{onClick:c}=r;c?.(o)},className:$("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-lg 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",l),children:e}):n.jsx(Kt,{...s,children:e})},rn=t=>{const e=h.c(7);let s,a;e[0]!==t?({children:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);const i=ie();let l;return e[3]!==s||e[4]!==i||e[5]!==a?(l=i?n.jsx(Ys,{asChild:!0,children:s}):n.jsx(Wt,{...a,children:s}),e[3]=s,e[4]=i,e[5]=a,e[6]=l):l=e[6],l},on=t=>{const e=h.c(7);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);const i=ie();let l;return e[3]!==s||e[4]!==i||e[5]!==a?(l=i?n.jsx(_e,{className:$(s),...a}):n.jsx(_e,{className:$(s),...a}),e[3]=s,e[4]=i,e[5]=a,e[6]=l):l=e[6],l};function cn(t){const e=h.c(11),{user:s,trigger:a,align:i,children:l}=t,r=i===void 0?"start":i;let o;e[0]!==a||e[1]!==s?(o=a(s),e[0]=a,e[1]=s,e[2]=o):o=e[2];let c;e[3]!==o?(c=n.jsx(rn,{asChild:!0,children:n.jsx("div",{children:o})}),e[3]=o,e[4]=c):c=e[4];let d;e[5]!==r||e[6]!==l?(d=n.jsx(an,{side:"top",align:r,className:"md:w-[240px]",children:l}),e[5]=r,e[6]=l,e[7]=d):d=e[7];let m;return e[8]!==c||e[9]!==d?(m=n.jsxs(nn,{children:[c,d]}),e[8]=c,e[9]=d,e[10]=m):m=e[10],m}function dn(t){const e=h.c(8),{children:s,onClick:a,className:i,asChild:l}=t;let r;e[0]!==l||e[1]!==s||e[2]!==a?(r=l?s:n.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:a,children:s}),e[0]=l,e[1]=s,e[2]=a,e[3]=r):r=e[3];let o;return e[4]!==l||e[5]!==i||e[6]!==r?(o=n.jsx(ln,{asChild:l,className:i,children:r}),e[4]=l,e[5]=i,e[6]=r,e[7]=o):o=e[7],o}function mn(t){const e=h.c(2),{className:s}=t;let a;return e[0]!==s?(a=n.jsx(on,{className:s}),e[0]=s,e[1]=a):a=e[1],a}function fn(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const G=Object.assign(cn,{Item:dn,Separator:mn,Skeleton:fn});function un(t){const e=h.c(48),{open:s,onOpenChange:a,user:i,userImage:l}=t,[r,o]=Et(),[c,d]=w.useState(!1);let m;e[0]!==i.id?(m=()=>{navigator.clipboard.writeText(i.id),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=i.id,e[1]=m):m=e[1];const u=m;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Gt,{className:"text-base",children:"Profile Settings"}),e[2]=p):p=e[2];let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs(Zt,{className:"px-6 pt-6 pb-4 border-b border-border shrink-0 relative",children:[p,n.jsxs(qt,{className:"absolute top-1/2 right-4 -translate-y-1/2 cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[n.jsx(de,{size:16}),n.jsx("span",{className:"sr-only",children:"Close"})]})]}),e[3]=b):b=e[3];const j=i.name||"U";let f;e[4]!==j||e[5]!==l?(f=n.jsx(ne,{url:l,fallback:j,shape:"circle",size:"xl",className:"h-16 w-16"}),e[4]=j,e[5]=l,e[6]=f):f=e[6];const g=i.name||"User";let x;e[7]!==g?(x=n.jsx("span",{className:"text-base font-medium text-foreground",children:g}),e[7]=g,e[8]=x):x=e[8];let v;e[9]!==i.email?(v=n.jsx("span",{className:"text-sm text-muted-foreground",children:i.email}),e[9]=i.email,e[10]=v):v=e[10];let S;e[11]!==x||e[12]!==v?(S=n.jsxs("div",{className:"flex flex-col gap-1",children:[x,v]}),e[11]=x,e[12]=v,e[13]=S):S=e[13];let _;e[14]!==f||e[15]!==S?(_=n.jsxs("div",{className:"flex items-center gap-4",children:[f,S]}),e[14]=f,e[15]=S,e[16]=_):_=e[16];let N;e[17]!==r||e[18]!==o?(N=()=>o(!r),e[17]=r,e[18]=o,e[19]=N):N=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[n.jsxs(Xt,{className:"text-sm font-medium text-foreground flex items-center gap-2 pointer-events-none",children:[n.jsx(es,{size:16,className:"text-muted-foreground"}),"Developer Mode"]}),n.jsx("p",{className:"text-xs text-muted-foreground pointer-events-none",children:"Show technical details like JSON input/output for tool calls"})]}),e[20]=k):k=e[20];let y;e[21]!==r||e[22]!==o?(y=n.jsx("div",{onClick:pn,children:n.jsx(Qt,{checked:r,onCheckedChange:o})}),e[21]=r,e[22]=o,e[23]=y):y=e[23];let z;e[24]!==N||e[25]!==y?(z=n.jsxs("button",{type:"button",onClick:N,className:"flex items-center justify-between gap-4 p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors text-left w-full cursor-pointer",children:[k,y]}),e[24]=N,e[25]=y,e[26]=z):z=e[26];let C;e[27]!==_||e[28]!==z?(C=n.jsxs("div",{className:"p-5 space-y-6 min-h-[225px]",children:[_,z]}),e[27]=_,e[28]=z,e[29]=C):C=e[29];let I;e[30]!==i.id?(I=n.jsx("span",{className:"font-mono text-xs",children:i.id}),e[30]=i.id,e[31]=I):I=e[31];let T;e[32]!==c?(T=c?n.jsx(ce,{size:14,className:"text-green-600"}):n.jsx(Ve,{size:14,className:"opacity-0 group-hover:opacity-100 transition-opacity"}),e[32]=c,e[33]=T):T=e[33];let O;e[34]!==u||e[35]!==I||e[36]!==T?(O=n.jsx(Ue,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:u,className:"group flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[I,T]})}),e[34]=u,e[35]=I,e[36]=T,e[37]=O):O=e[37];let M;e[38]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsx(Le,{side:"top",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[38]=M):M=e[38];let A;e[39]!==O?(A=n.jsx("div",{className:"border-t border-border px-5 py-4 flex items-center shrink-0",children:n.jsx(He,{children:n.jsxs(Be,{children:[O,M]})})}),e[39]=O,e[40]=A):A=e[40];let E;e[41]!==C||e[42]!==A?(E=n.jsxs(Yt,{className:"sm:max-w-lg sm:max-h-[85vh] p-0 flex flex-col",closeButtonClassName:"hidden",children:[b,n.jsxs("div",{className:"flex flex-col",children:[C,A]})]}),e[41]=C,e[42]=A,e[43]=E):E=e[43];let R;return e[44]!==a||e[45]!==s||e[46]!==E?(R=n.jsx(Jt,{open:s,onOpenChange:a,children:E}),e[44]=a,e[45]=s,e[46]=E,e[47]=R):R=e[47],R}function pn(t){return t.stopPropagation()}function hn(t){const e=h.c(47),{user:s,userImage:a}=t,[i,l]=w.useState(!1),[r,o]=w.useState(!1);let c;e[0]!==s.email||e[1]!==s.id||e[2]!==s.name?(c=()=>{const R=`ID: ${s.id}
|
|
2
|
-
Name: ${s.name||"N/A"}
|
|
3
|
-
Email: ${s.email}`;navigator.clipboard.writeText(R),o(!0),Y.success("User info copied to clipboard"),setTimeout(()=>o(!1),2e3)},e[0]=s.email,e[1]=s.id,e[2]=s.name,e[3]=c):c=e[3];const d=c;let m;e[4]!==s.email||e[5]!==s.name||e[6]!==a?(m=()=>n.jsx(ne,{url:a,fallback:s.name||s.email||"U",shape:"circle",size:"sm",className:"cursor-pointer hover:ring-2 ring-muted-foreground transition-all h-7 w-7"}),e[4]=s.email,e[5]=s.name,e[6]=a,e[7]=m):m=e[7];const u=s.name||s.email||"U";let p;e[8]!==u||e[9]!==a?(p=n.jsx(ne,{url:a,fallback:u,shape:"circle",size:"sm"}),e[8]=u,e[9]=a,e[10]=p):p=e[10];const b=s.name||"User";let j;e[11]!==b?(j=n.jsx("div",{className:"text-sm font-medium truncate",children:b}),e[11]=b,e[12]=j):j=e[12];let f;e[13]!==s.email?(f=n.jsx("div",{className:"text-xs text-muted-foreground truncate",children:s.email}),e[13]=s.email,e[14]=f):f=e[14];let g;e[15]!==j||e[16]!==f?(g=n.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[j,f]}),e[15]=j,e[16]=f,e[17]=g):g=e[17];let x;e[18]!==r?(x=n.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:r?n.jsx(ce,{size:16,className:"text-green-600"}):n.jsx(Ve,{size:16,className:"text-muted-foreground"})}),e[18]=r,e[19]=x):x=e[19];let v;e[20]!==p||e[21]!==g||e[22]!==x?(v=n.jsxs("div",{className:"group flex items-center gap-3 w-full py-1",children:[p,g,x]}),e[20]=p,e[21]=g,e[22]=x,e[23]=v):v=e[23];let S;e[24]!==d||e[25]!==v?(S=n.jsx(G.Item,{onClick:d,children:v}),e[24]=d,e[25]=v,e[26]=S):S=e[26];let _;e[27]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(G.Separator,{}),e[27]=_):_=e[27];let N,k;e[28]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsxs(G.Item,{onClick:()=>l(!0),children:[n.jsx(je,{className:"text-muted-foreground",size:18}),"Profile Settings"]}),k=n.jsx(G.Separator,{}),e[28]=N,e[29]=k):(N=e[28],k=e[29]);let y;e[30]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ht,{className:"w-4 h-4 text-muted-foreground"}),e[30]=y):y=e[30];let z;e[31]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(G.Item,{asChild:!0,children:n.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:[y,"decocms/admin",n.jsx(ke,{size:18,className:"text-muted-foreground ml-auto"})]})}),e[31]=z):z=e[31];let C;e[32]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(qe,{className:"text-muted-foreground",size:18}),e[32]=C):C=e[32];let I,T;e[33]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsx(G.Item,{asChild:!0,children:n.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[C,"Homepage",n.jsx(ke,{size:18,className:"ml-auto text-muted-foreground"})]})}),T=n.jsx(G.Separator,{}),e[33]=I,e[34]=T):(I=e[33],T=e[34]);let O;e[35]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsxs(G.Item,{onClick:xn,children:[n.jsx(Je,{size:18,className:"text-muted-foreground"}),"Log out"]}),e[35]=O):O=e[35];let M;e[36]!==S||e[37]!==m||e[38]!==s?(M=n.jsxs(G,{user:s,trigger:m,align:"end",children:[S,_,N,k,z,I,T,O]}),e[36]=S,e[37]=m,e[38]=s,e[39]=M):M=e[39];let A;e[40]!==i||e[41]!==s||e[42]!==a?(A=i&&n.jsx(un,{open:i,onOpenChange:l,user:s,userImage:a}),e[40]=i,e[41]=s,e[42]=a,e[43]=A):A=e[43];let E;return e[44]!==M||e[45]!==A?(E=n.jsxs(n.Fragment,{children:[M,A]}),e[44]=M,e[45]=A,e[46]=E):E=e[46],E}function xn(){return J.signOut()}function gn(){const t=h.c(7),{data:e}=J.useSession();if(!e?.user){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ne,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer h-7 w-7",muted:!0}),t[0]=c):c=t[0],c}const s=e.user,a=s.name??void 0;let i;t[1]!==a||t[2]!==s?(i={...s,name:a},t[1]=a,t[2]=s,t[3]=i):i=t[3];const l=i,r=s.image;let o;return t[4]!==r||t[5]!==l?(o=n.jsx(hn,{user:l,userImage:r}),t[4]=r,t[5]=l,t[6]=o):o=t[6],o}function we(){const t=h.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=be.decoChatOpen(),t[0]=e):e=t[0];const[s,a]=ge(e,bn);let i;return t[1]!==s||t[2]!==a?(i=[s,a],t[1]=s,t[2]=a,t[3]=i):i=t[3],i}function bn(t){return!!(t??!1)}function jn(t){const e=h.c(6),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(xt,{children:n.jsx(Me,{})}),e[0]=a):a=e[0];let i;e[1]!==s?(i=n.jsx(gt,{children:s}),e[1]=s,e[2]=i):i=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(bt,{children:n.jsx(jt,{to:"/login",replace:!0})}),e[3]=l):l=e[3];let r;return e[4]!==i?(r=n.jsxs(n.Fragment,{children:[a,i,l]}),e[4]=i,e[5]=r):r=e[5],r}function vn(t){const e=h.c(5),{children:s,className:a}=t;let i;e[0]!==a?(i=$("fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",a),e[0]=a,e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==i?(l=n.jsx("div",{className:i,children:s}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}function wn(t){const e=h.c(5),{children:s,className:a}=t;let i;e[0]!==a?(i=$("flex items-center justify-center px-2.5 h-full border-r border-border",a),e[0]=a,e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==i?(l=n.jsx("div",{className:i,children:s}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}function Sn(t){const e=h.c(5),{children:s,className:a}=t;let i;e[0]!==a?(i=$("flex items-center gap-2 px-2 h-full",a),e[0]=a,e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==i?(l=n.jsx("div",{className:i,children:s}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}function Nn(t){const e=h.c(5),{children:s,className:a}=t;let i;e[0]!==a?(i=$("flex items-center gap-2 px-2 h-full flex-1",a),e[0]=a,e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==i?(l=n.jsx("div",{className:i,children:s}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}function yn(t){const e=h.c(5),{children:s,className:a}=t;let i;e[0]!==a?(i=$("flex items-center gap-2 px-2 h-full ml-auto",a),e[0]=a,e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==i?(l=n.jsx("div",{className:i,children:s}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}function Cn(){const t=h.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center justify-center px-2 h-full border-r border-border",children:n.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex items-center gap-2 px-2 h-full",children:n.jsx("div",{className:"w-32 h-6 bg-muted rounded-md animate-pulse"})}),t[1]=s):s=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.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,s,n.jsx("div",{className:"flex items-center gap-2 px-2 h-full ml-auto",children:n.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"})})]}),t[2]=a):a=t[2],a}const oe=Object.assign(vn,{Sidebar:wn,Left:Sn,Center:Nn,Right:yn,Skeleton:Cn});function ct(){const t=h.c(3),{toggleSidebar:e}=ve();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Ye,{className:"text-muted-foreground/85 group-hover:text-foreground transition-colors",size:18}),t[0]=s):s=t[0];let a;return t[1]!==e?(a=n.jsx(n.Fragment,{children:n.jsx(Z,{onClick:e,size:"icon",variant:"ghost",className:"w-7 h-7 rounded-md",children:s})}),t[1]=e,t[2]=a):a=t[2],a}ct.Skeleton=function(){return n.jsx("div",{className:"w-7 h-7 bg-muted rounded-md animate-pulse"})};function _n(){const t=h.c(81),{org:e}=fe(),[,s]=we(),{selectedVirtualMcp:a,modelsConnections:i,isChatEmpty:l,activeThreadId:r,setActiveThreadId:o,threads:c}=Dt();let d;if(t[0]!==r||t[1]!==c){let B;t[3]!==r?(B=q=>q.id===r,t[3]=r,t[4]=B):B=t[4],d=c.find(B),t[0]=r,t[1]=c,t[2]=d}else d=t[2];const m=d,[u,p]=w.useState(!1);let b;t[5]!==e.id?(b=ns(e.id),t[5]=e.id,t[6]=b):b=t[6];const f=a??b;if(i.length===0){let B;t[7]!==f.icon||t[8]!==f.title?(B=n.jsx(pe,{icon:f.icon,name:f.title,size:"xs",className:"size-5 rounded-md aspect-square shrink-0"}),t[7]=f.icon,t[8]=f.title,t[9]=B):B=t[9];let q;t[10]!==f.title?(q=n.jsx("span",{className:"text-sm font-medium",children:f.title}),t[10]=f.title,t[11]=q):q=t[11];let X;t[12]!==B||t[13]!==q?(X=n.jsxs(D.Header.Left,{children:[B,q]}),t[12]=B,t[13]=q,t[14]=X):X=t[14];let Q;t[15]!==s?(Q=()=>s(!1),t[15]=s,t[16]=Q):Q=t[16];let le;t[17]===Symbol.for("react.memo_cache_sentinel")?(le=n.jsx(de,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[17]=le):le=t[17];let ee;t[18]!==Q?(ee=n.jsx(D.Header.Right,{children:n.jsx("button",{type:"button",onClick:Q,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:le})}),t[18]=Q,t[19]=ee):ee=t[19];let te;t[20]!==X||t[21]!==ee?(te=n.jsxs(D.Header,{children:[X,ee]}),t[20]=X,t[21]=ee,t[22]=te):te=t[22];let se;t[23]!==e?(se=n.jsx(D.Main,{className:"flex flex-col items-center",children:n.jsx(D.EmptyState,{children:n.jsx(D.NoLlmBindingEmptyState,{title:"No model provider connected",description:"Connect to a model provider to unlock AI-powered features.",org:e})})}),t[23]=e,t[24]=se):se=t[24];let re;return t[25]!==te||t[26]!==se?(re=n.jsxs(D,{children:[te,se]}),t[25]=te,t[26]=se,t[27]=re):re=t[27],re}const g=u?"opacity-0 -translate-x-4 pointer-events-none":"opacity-100 translate-x-0";let x;t[28]!==g?(x=$("absolute inset-0 flex flex-col transition-all duration-300 ease-in-out",g),t[28]=g,t[29]=x):x=t[29];let v;t[30]!==f.icon||t[31]!==f.title?(v=n.jsx(pe,{icon:f.icon,name:f.title,size:"xs",className:"size-5 rounded-md aspect-square shrink-0"}),t[30]=f.icon,t[31]=f.title,t[32]=v):v=t[32];let S;t[33]!==m||t[34]!==f.title||t[35]!==l?(S=!l&&m?.title?n.jsx($t,{text:m.title,className:"text-sm font-medium text-foreground"}):n.jsx("span",{className:"text-sm font-medium text-foreground",children:f.title}),t[33]=m,t[34]=f.title,t[35]=l,t[36]=S):S=t[36];let _;t[37]!==v||t[38]!==S?(_=n.jsxs(D.Header.Left,{children:[v,S]}),t[37]=v,t[38]=S,t[39]=_):_=t[39];let N;t[40]!==o?(N=()=>o(crypto.randomUUID()),t[40]=o,t[41]=N):N=t[41];let k;t[42]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(as,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[42]=k):k=t[42];let y;t[43]!==N?(y=n.jsx("button",{type:"button",onClick:N,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"New chat",children:k}),t[43]=N,t[44]=y):y=t[44];let z;t[45]===Symbol.for("react.memo_cache_sentinel")?(z=()=>p(!0),t[45]=z):z=t[45];let C;t[46]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("button",{type:"button",onClick:z,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"Chat history",children:n.jsx(Ot,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),t[46]=C):C=t[46];let I;t[47]!==s?(I=()=>s(!1),t[47]=s,t[48]=I):I=t[48];let T;t[49]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(de,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[49]=T):T=t[49];let O;t[50]!==I?(O=n.jsx("button",{type:"button",onClick:I,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:T}),t[50]=I,t[51]=O):O=t[51];let M;t[52]!==O||t[53]!==y?(M=n.jsxs(D.Header.Right,{children:[y,C,O]}),t[52]=O,t[53]=y,t[54]=M):M=t[54];let A;t[55]!==M||t[56]!==_?(A=n.jsxs(D.Header,{children:[_,M]}),t[55]=M,t[56]=_,t[57]=A):A=t[57];let E;t[58]!==f.description||t[59]!==f.icon||t[60]!==f.title||t[61]!==l?(E=n.jsx(D.Main,{children:l?n.jsx(D.EmptyState,{children:n.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[n.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-0 text-center",children:[n.jsx(pe,{icon:f.icon,name:f.title,size:"lg",fallbackIcon:n.jsx(Fe,{size:32}),className:"size-[60px]! rounded-[18px]!"}),n.jsx("h3",{className:"text-xl font-medium text-foreground",children:f.title}),n.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:f.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),n.jsx(D.IceBreakers,{})]})}):n.jsx(D.Messages,{minHeightOffset:280})}),t[58]=f.description,t[59]=f.icon,t[60]=f.title,t[61]=l,t[62]=E):E=t[62];let R;t[63]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx(D.Footer,{children:n.jsx(D.Input,{})}),t[63]=R):R=t[63];let W;t[64]!==A||t[65]!==E||t[66]!==x?(W=n.jsxs("div",{className:x,children:[A,E,R]}),t[64]=A,t[65]=E,t[66]=x,t[67]=W):W=t[67];const F=u?"opacity-100 translate-x-0":"opacity-0 translate-x-4 pointer-events-none";let U;t[68]!==F?(U=$("absolute inset-0 flex flex-col transition-all duration-300 ease-in-out",F),t[68]=F,t[69]=U):U=t[69];let V;t[70]===Symbol.for("react.memo_cache_sentinel")?(V=()=>p(!1),t[70]=V):V=t[70];let P;t[71]!==r||t[72]!==o||t[73]!==c?(P=n.jsx(Tt,{threads:c,activeThreadId:r,onThreadSelect:o,onClose:V}),t[71]=r,t[72]=o,t[73]=c,t[74]=P):P=t[74];let L;t[75]!==U||t[76]!==P?(L=n.jsx("div",{className:U,children:P}),t[75]=U,t[76]=P,t[77]=L):L=t[77];let K;return t[78]!==W||t[79]!==L?(K=n.jsxs(D,{className:"relative overflow-hidden",children:[W,L]}),t[78]=W,t[79]=L,t[80]=K):K=t[80],K}function kn(){const t=h.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(D.Skeleton,{}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(D.Skeleton,{}),t[1]=s):s=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Pe,{fallback:e,children:n.jsx(w.Suspense,{fallback:s,children:n.jsx(D.Provider,{children:n.jsx(_n,{})})})}),t[2]=a):a=t[2],a}function ze({showSidebarToggle:t=!1,showOrgSwitcher:e=!1,showDecoChat:s=!1,disableDecoChat:a=!1}){const[i,l]=we(),r=w.useRef(a);a&&i&&r.current!==a&&l(!1),r.current=a;const o=()=>{a||l(c=>!c)};return n.jsxs(oe,{children:[t&&n.jsx(oe.Sidebar,{children:n.jsx(ct,{})}),n.jsx(oe.Left,{children:e&&n.jsx(w.Suspense,{fallback:n.jsx(he.Skeleton,{}),children:n.jsx(he,{})})}),n.jsxs(oe.Right,{className:"gap-2",children:[n.jsx(ls,{}),s&&!a&&n.jsxs(Z,{size:"sm",variant:"default",onClick:o,className:"h-7 gap-2",children:[n.jsx(Mt,{size:16}),"Chat"]}),n.jsx(gn,{})]})]})}function In(t){const e=h.c(10),{children:s,className:a}=t,[,i]=w.useTransition();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=be.decoChatPanelWidth(),e[0]=l):l=e[0];const[r,o]=ge(l,30);let c;e[1]!==o?(c=p=>i(()=>o(p)),e[1]=o,e[2]=c):c=e[2];const d=c;let m;e[3]!==a?(m=$("min-w-0",a),e[3]=a,e[4]=m):m=e[4];let u;return e[5]!==r||e[6]!==s||e[7]!==d||e[8]!==m?(u=n.jsx(Ke,{defaultSize:r,minSize:20,className:m,onResize:d,children:s}),e[5]=r,e[6]=s,e[7]=d,e[8]=m,e[9]=u):u=e[9],u}function zn(t){const e=h.c(5),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=be.sidebarOpen(),e[0]=a):a=e[0];const[i,l]=ge(a,!0);let r;return e[1]!==s||e[2]!==l||e[3]!==i?(r=n.jsx(us,{open:i,onOpenChange:l,children:s}),e[1]=s,e[2]=l,e[3]=i,e[4]=r):r=e[4],r}function $n(t){const e=h.c(12),{disableChat:s}=t,a=s===void 0?!1:s,[i]=we(),l=i&&!a;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ke,{className:"bg-background",children:n.jsx(Ae,{})}),e[0]=r):r=e[0];let o;e[1]!==a||e[2]!==l?(o=!a&&n.jsx(ts,{withHandle:l}),e[1]=a,e[2]=l,e[3]=o):o=e[3];const c=l?"max-w-none":"max-w-0";let d;e[4]!==c?(d=$(c),e[4]=c,e[5]=d):d=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(kn,{}),e[6]=m):m=e[6];let u;e[7]!==d?(u=n.jsx(In,{className:d,children:m}),e[7]=d,e[8]=u):u=e[8];let p;return e[9]!==o||e[10]!==u?(p=n.jsxs(ss,{direction:"horizontal",children:[r,o,u]}),e[9]=o,e[10]=u,e[11]=p):p=e[11],p}function On(){const t=h.c(22);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=Oe(e),a=$e(),i=a.location.pathname===`/${s}`||a.location.pathname===`/${s}/`;let l;t[1]!==s?(l=St.activeOrganization(s),t[1]=s,t[2]=l):l=t[2];let r;t[3]!==s?(r=async()=>{if(!s)return null;const{data:f}=await J.organization.setActive({organizationSlug:s});return{org:f,project:{slug:Nt}}},t[3]=s,t[4]=r):r=t[4];let o;t[5]!==l||t[6]!==r?(o={queryKey:l,queryFn:r,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=l,t[6]=r,t[7]=o):o=t[7];const{data:c}=vt(o);if(!c){let f;t[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(ze,{}),t[8]=f):f=t[8];let g;return t[9]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"min-h-screen bg-background",children:[f,n.jsx("div",{className:"pt-12",children:n.jsx(Ae,{})})]}),t[9]=g):g=t[9],g}let d;t[10]!==i?(d=n.jsx(ze,{showSidebarToggle:!0,showOrgSwitcher:!0,showDecoChat:!0,disableDecoChat:i}),t[10]=i,t[11]=d):d=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m={"--sidebar-width":"13rem","--sidebar-width-mobile":"11rem"},t[12]=m):m=t[12];let u;t[13]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Os,{}),t[13]=u):u=t[13];let p;t[14]!==i?(p=n.jsxs(xs,{className:"flex-1 bg-sidebar",style:m,children:[u,n.jsx(bs,{className:"pt-12",children:n.jsx($n,{disableChat:i})})]}),t[14]=i,t[15]=p):p=t[15];let b;t[16]!==d||t[17]!==p?(b=n.jsx(zn,{children:n.jsxs("div",{className:"flex flex-col h-screen",children:[d,p]})}),t[16]=d,t[17]=p,t[18]=b):b=t[18];let j;return t[19]!==c||t[20]!==b?(j=n.jsx(wt,{...c,children:b}),t[19]=c,t[20]=b,t[21]=j):j=t[21],j}function Aa(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(jn,{children:n.jsx(w.Suspense,{fallback:n.jsx(Me,{}),children:n.jsx(On,{})})}),t[0]=e):e=t[0],e}export{Aa as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as C,m,j as a}from"./index-Czllqz-2.js";import{c as d}from"./button-B00_ydX0.js";const u=m("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 h(f){const e=C.c(10),{variant:c,size:o}=f;let t;e[0]!==o||e[1]!==c?(t=d(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{h as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as n,u as o,l as u,K as i,e as a}from"./index-Czllqz-2.js";function m(){const e=n.c(4),{locator:r}=o();let t;e[0]!==r?(t=i.members(r),e[0]=r,e[1]=t):t=e[1];let s;return e[2]!==t?(s={queryKey:t,queryFn:c},e[2]=t,e[3]=s):s=e[3],u(s)}function c(){return a.organization.listMembers()}export{m as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as u}from"./infiniteQueryObserver-cVAe_2FL.js";import{W as i}from"./index-Czllqz-2.js";function t(e,r){return i(e,u,r)}export{t as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{W as u,X as s}from"./index-Czllqz-2.js";function o(e,r){return u(e,s,r)}export{o as u};
|