@decocms/mesh 2.15.0 → 2.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CIFhWg2i.js → AlertCircle-DlBo4Xw9.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D0vIuW0V.js → ArrowLeft-CCqPW2JN.js} +1 -1
- package/dist/client/assets/{ArrowUp-MjJJcV-O.js → ArrowUp-KvHCnFh3.js} +1 -1
- package/dist/client/assets/{Check-LvJ1lSFr.js → Check-D4dBNJmC.js} +1 -1
- package/dist/client/assets/{ChevronDown-QF_Tgl2v.js → ChevronDown-CJaS1NVA.js} +1 -1
- package/dist/client/assets/{Clock-CiIkKpUg.js → Clock-ljBuaWDA.js} +1 -1
- package/dist/client/assets/{Code01-Du8Lx-Uw.js → Code01-CMazpegY.js} +1 -1
- package/dist/client/assets/{Copy01-CunLN8rc.js → Copy01-Rf_P7R5F.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-WE50knOB.js → DotsHorizontal-Nj82ZW12.js} +1 -1
- package/dist/client/assets/{DotsVertical-CuQjcY-h.js → DotsVertical-f9rnazjX.js} +1 -1
- package/dist/client/assets/{Download01-syi4c4iH.js → Download01-Cnas0PSW.js} +1 -1
- package/dist/client/assets/{Edit01-DVUwOcf8.js → Edit01-MWKLkbpZ.js} +1 -1
- package/dist/client/assets/{File06-BM3BX-NC.js → File06-Dir7h2_j.js} +1 -1
- package/dist/client/assets/{FilterLines-DS1pmySA.js → FilterLines-BgxUhbig.js} +1 -1
- package/dist/client/assets/{FlipBackward-BKppcJN9.js → FlipBackward-B1KVh_65.js} +1 -1
- package/dist/client/assets/{GitBranch01-C3ShOPmQ.js → GitBranch01-CA4KhZZx.js} +1 -1
- package/dist/client/assets/{Grid01-DwtrqYPx.js → Grid01-BgBQwtBY.js} +1 -1
- package/dist/client/assets/{Home02-DlsAgg82.js → Home02-CR-W2ctm.js} +1 -1
- package/dist/client/assets/{Image01-Bw2o5F05.js → Image01-B8cj-qoF.js} +1 -1
- package/dist/client/assets/{Inbox01-CSDhYGLL.js → Inbox01-Bh5pMKE1.js} +1 -1
- package/dist/client/assets/{InfoCircle-xFKFZGrj.js → InfoCircle-CVdyaBb8.js} +1 -1
- package/dist/client/assets/{Key01-S9eZFu7R.js → Key01-BcxLAym0.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Dbxh7ZV2.js → LinkExternal01-D41WE0Cl.js} +1 -1
- package/dist/client/assets/{List-D2PJPXod.js → List-hTdqyLGB.js} +1 -1
- package/dist/client/assets/{Loading01-BhuF3K1g.js → Loading01-Bq_7Os6T.js} +1 -1
- package/dist/client/assets/{Lock01-jUZQmYfl.js → Lock01-DOJDUqUZ.js} +1 -1
- package/dist/client/assets/{Play-BxDRmyN-.js → Play-CoxjBx7-.js} +1 -1
- package/dist/client/assets/{Plus-DCVckKM0.js → Plus-C4F6mby2.js} +1 -1
- package/dist/client/assets/{SearchMd-tLR3QB8E.js → SearchMd-B_A85eif.js} +1 -1
- package/dist/client/assets/{Terminal-DwE3k3eb.js → Terminal-BWurH474.js} +1 -1
- package/dist/client/assets/{Trash01-Dg5Q9OUO.js → Trash01-GrzirNvV.js} +1 -1
- package/dist/client/assets/{Upload01-BJUxi5ck.js → Upload01-Ba_zCXbQ.js} +1 -1
- package/dist/client/assets/{X-DKF1oh5v.js → X-D09jV0HO.js} +1 -1
- package/dist/client/assets/{XClose-BACMQGhN.js → XClose-D9UXYoHK.js} +1 -1
- package/dist/client/assets/{alert-dialog-BryTAX-J.js → alert-dialog-Df8ZsItX.js} +1 -1
- package/dist/client/assets/{auth-catchall-B3H5JOvc.js → auth-catchall-Bu_AmzqF.js} +1 -1
- package/dist/client/assets/{avatar-BtMYdv0U.js → avatar-CrVRRbJ7.js} +1 -1
- package/dist/client/assets/{badge-Do7WFlPI.js → badge-BPKvq16e.js} +1 -1
- package/dist/client/assets/{binder-B3GXUIAu.js → binder-BtPpbY4I.js} +1 -1
- package/dist/client/assets/{button-ClkQLR3o.js → button-Co_HOc3E.js} +1 -1
- package/dist/client/assets/{card-CwMKn79y.js → card-Rz2C5-Lx.js} +1 -1
- package/dist/client/assets/{checkbox-C6hBycBx.js → checkbox-DGIT6WZ3.js} +1 -1
- package/dist/client/assets/{collection-detail-C-m2H10s.js → collection-detail-CIorpvYQ.js} +1 -1
- package/dist/client/assets/{collection-display-button-CdHXoeVD.js → collection-display-button-C_GfVLwh.js} +1 -1
- package/dist/client/assets/{collection-header-CeBQhXWy.js → collection-header-Dl8Ii13M.js} +1 -1
- package/dist/client/assets/{collection-page-pMUw63Yr.js → collection-page-C75JriCh.js} +1 -1
- package/dist/client/assets/{collection-search-CF1o4yO7.js → collection-search-D67e9ppe.js} +1 -1
- package/dist/client/assets/{collection-tab-ChPNT80-.js → collection-tab-DVmiR956.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-jfSAC6dF.js → collection-table-wrapper-DDHrDWif.js} +1 -1
- package/dist/client/assets/{connection-BcYehfdK.js → connection-CmMMEDBY.js} +1 -1
- package/dist/client/assets/{connection-card-DO3ahSdV.js → connection-card-BuCHeT4K.js} +1 -1
- package/dist/client/assets/{connection-detail-i_lj-oMr.js → connection-detail-BsC5t8hY.js} +1 -1
- package/dist/client/assets/{connections-CMzrwOZS.js → connections-B3RW87mz.js} +1 -1
- package/dist/client/assets/constants-B5NZDm4s.js +1 -0
- package/dist/client/assets/{create-organization-dialog-BydMMM5g.js → create-organization-dialog-DQ5uy2r0.js} +1 -1
- package/dist/client/assets/{dialog-Y0g8yyzz.js → dialog-bW33A1d_.js} +1 -1
- package/dist/client/assets/{dropdown-menu-C4Ypstre.js → dropdown-menu-dsr_wyw0.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-Cds2rM_Z.js → dynamic-plugin-layout-IH0Gl52A.js} +1 -1
- package/dist/client/assets/{empty-state-C0gi-aAx.js → empty-state-B1DU5702.js} +1 -1
- package/dist/client/assets/{empty-state-Dx0NLAxy.js → empty-state-By_kA__m.js} +1 -1
- package/dist/client/assets/{env-vars-editor-GTn7Eu5T.js → env-vars-editor-BjH5KdVc.js} +1 -1
- package/dist/client/assets/{error-boundary-D2ZJQHnD.js → error-boundary-BOBkDZ1Y.js} +1 -1
- package/dist/client/assets/{extract-connection-data-nsOyk4eb.js → extract-connection-data-CNcw3HV2.js} +1 -1
- package/dist/client/assets/{file-browser-s8pLbWaW.js → file-browser-BDyBPrc6.js} +2 -2
- package/dist/client/assets/{form-DDdl0439.js → form-ChO7tWCF.js} +1 -1
- package/dist/client/assets/{gateway-detail-NHGkjgTy.js → gateway-detail-CzuSbsFr.js} +1 -1
- package/dist/client/assets/{gateways-Bv1uyRdE.js → gateways-ckyn_Uas.js} +1 -1
- package/dist/client/assets/{grid-view-DNPq1Y__.js → grid-view-CTAOtRDs.js} +1 -1
- package/dist/client/assets/{home-9eTtEa0h.js → home-CpIhQ8D8.js} +1 -1
- package/dist/client/assets/{index-D6aVJNvm.js → index-BUdiVz6f.js} +1 -1
- package/dist/client/assets/{index-hEHbC4y4.js → index-Bc30BcYv.js} +3 -3
- package/dist/client/assets/{index-DqVdeyIE.js → index-CH2G6_zW.js} +1 -1
- package/dist/client/assets/{index-Cbsnfme0.js → index-ChF3uWl9.js} +1 -1
- package/dist/client/assets/{index-C5FDJtAp.js → index-ZiFjEqyT.js} +2 -2
- package/dist/client/assets/{infiniteQueryObserver-BnxPLCEe.js → infiniteQueryObserver-DEh2zauU.js} +1 -1
- package/dist/client/assets/{input-BbWUShhD.js → input-DEsmZ6es.js} +1 -1
- package/dist/client/assets/{layout-BnqnCJOk.js → layout-tF7tb_Qc.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-BHJogLPz.js → lazy-highlighter-B2TKQCpQ.js} +1 -1
- package/dist/client/assets/{localstorage-keys-BZEjwsD0.js → localstorage-keys-DhdYpXZj.js} +1 -1
- package/dist/client/assets/{login-DGLLQl3L.js → login-DtC787Hg.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CkuEWYY4.js → mcp-oauth-D8a9d38x.js} +1 -1
- package/dist/client/assets/{mcp-server-card-D4bCdTAY.js → mcp-server-card-DSQZ-b3I.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-Cy2l0hPz.js → mcp-server-detail-rW4PqaOO.js} +1 -1
- package/dist/client/assets/members-C4HTAJHG.js +3 -0
- package/dist/client/assets/{monaco-editor-BnXEGbzY.js → monaco-editor-BYgR7J38.js} +1 -1
- package/dist/client/assets/{monitoring-vPlAvNfN.js → monitoring-BGY0w02b.js} +1 -1
- package/dist/client/assets/{oauth-callback-I_aRwsB5.js → oauth-callback-BSZdPTYI.js} +1 -1
- package/dist/client/assets/{page-fWJ76jbj.js → page-DcQoSvJk.js} +1 -1
- package/dist/client/assets/{page-DPsdZaOi.js → page-DxMYdFSw.js} +1 -1
- package/dist/client/assets/{pin-to-sidebar-button-DTR_Oj1s.js → pin-to-sidebar-button-BahvsjHH.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-RYQHQ0B6.js → plugin-empty-state-CIiB0IAw.js} +1 -1
- package/dist/client/assets/{plugin-header-BPW1tb_d.js → plugin-header-CvDO4WmD.js} +1 -1
- package/dist/client/assets/{plugins-DN4-aMVD.js → plugins-CyUBsABC.js} +1 -1
- package/dist/client/assets/{popover-DLFe45bO.js → popover-DW05feED.js} +1 -1
- package/dist/client/assets/{project-context-provider-DH0iqA5D.js → project-context-provider-BPo-49FO.js} +1 -1
- package/dist/client/assets/{registry-utils-BPPApxjf.js → registry-utils-DzI73csj.js} +1 -1
- package/dist/client/assets/{resizable-C6uSLZAk.js → resizable-BAPLF4RD.js} +1 -1
- package/dist/client/assets/{resource-tabs-CKatVKnl.js → resource-tabs-CC5dHHUl.js} +1 -1
- package/dist/client/assets/{select-CSzUpxmC.js → select-CVEPeRAQ.js} +1 -1
- package/dist/client/assets/{settings-Dk6-Mm8r.js → settings-BfbdOKrl.js} +1 -1
- package/dist/client/assets/{shell-layout-P7XxC3ZF.js → shell-layout-DJjajsTY.js} +1 -1
- package/dist/client/assets/{spinner-CUAQv_4V.js → spinner-DqooIng7.js} +1 -1
- package/dist/client/assets/{switch-ZAqg3LbP.js → switch-dZML6kqo.js} +1 -1
- package/dist/client/assets/{textarea-BDJhX5-9.js → textarea-DFRypKCQ.js} +1 -1
- package/dist/client/assets/{tool-set-selector-D26m7PpE.js → tool-set-selector-DRx4AOzy.js} +1 -1
- package/dist/client/assets/{tools-list-pl3Bsjpf.js → tools-list-C8nSsOKD.js} +1 -1
- package/dist/client/assets/{tooltip-DXYcokUT.js → tooltip-BJO9sFhZ.js} +1 -1
- package/dist/client/assets/{use-binding-Cmi2FEqF.js → use-binding-C8KxuIY6.js} +1 -1
- package/dist/client/assets/{use-collections-DxMxR_jZ.js → use-collections-g067BPxP.js} +1 -1
- package/dist/client/assets/{use-connection-ClVfoZWG.js → use-connection-BskZam-G.js} +1 -1
- package/dist/client/assets/{use-connection-resources-nXRlJNhx.js → use-connection-resources-YXIBGXnm.js} +1 -1
- package/dist/client/assets/{use-create-gateway-UkmAQbcu.js → use-create-gateway-CCmt4GT8.js} +1 -1
- package/dist/client/assets/{use-gateway-system-prompt-CYi0Zo4K.js → use-gateway-system-prompt-DoCpWoeh.js} +1 -1
- package/dist/client/assets/{use-gateway-D_zdUoI4.js → use-gateway-v7etejE8.js} +1 -1
- package/dist/client/assets/{use-list-state-G6sniPDx.js → use-list-state-C5pgFF_z.js} +1 -1
- package/dist/client/assets/{use-mcp-hlkUt7pz.js → use-mcp-ZNQ-iMEF.js} +1 -1
- package/dist/client/assets/{use-members-3RqzErHO.js → use-members-dVasH0ez.js} +1 -1
- package/dist/client/assets/{use-mobile-DT1cwytU.js → use-mobile-Co7MtEW-.js} +1 -1
- package/dist/client/assets/{use-model-state-Bc4MpPVu.js → use-model-state-B8hL-q1r.js} +2 -2
- package/dist/client/assets/{use-organization-settings-D46q7SyU.js → use-organization-settings-K7SU43aD.js} +1 -1
- package/dist/client/assets/{use-tool-call-BH-yOcTy.js → use-tool-call-BbfSyOCz.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Dbq7IS1q.js +1 -0
- package/dist/client/assets/{useMutation-DEocBykZ.js → useMutation-4fnzP4bc.js} +1 -1
- package/dist/client/assets/useQuery-Bn2Wcch_.js +1 -0
- package/dist/client/assets/{value-C9Bb1t7X.js → value-zEqR5KPg.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-C5hz9T3M.js → view-mode-toggle-tlrhMsiy.js} +1 -1
- package/dist/client/assets/{workflow-BJoyVBBY.js → workflow-B8_jtBci.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +216 -216
- package/dist/server/migrate.js +154 -144
- package/dist/server/server.js +212 -212
- package/package.json +1 -1
- package/dist/client/assets/constants-BIwbIZhE.js +0 -1
- package/dist/client/assets/members-CXuNIHGD.js +0 -3
- package/dist/client/assets/useInfiniteQuery-Dl93eV8h.js +0 -1
- package/dist/client/assets/useQuery-Dakt0IBq.js +0 -1
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/LICENSE +0 -47
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/README.md +0 -82
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.d.ts +0 -11
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs +0 -43
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cjs +0 -45
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.cjs +0 -46
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.d.ts +0 -11
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.d.ts +0 -11
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.mjs +0 -46
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.wasm +0 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.mts +0 -83
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.ts +0 -83
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js +0 -2
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js.map +0 -1
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs +0 -2
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs.map +0 -1
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.mts +0 -20
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.ts +0 -20
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js +0 -2
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js.map +0 -1
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs +0 -2
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs.map +0 -1
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/package.json +0 -61
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as N,f as B,x as $,E as D,B as P,t as C,K as I,a as K,j as s,a5 as Q,y as A,c as H,z as L}from"./index-
|
|
1
|
+
import{r as N,f as B,x as $,E as D,B as P,t as C,K as I,a as K,j as s,a5 as Q,y as A,c as H,z as L}from"./index-ZiFjEqyT.js";import{C as T}from"./collection-header-Dl8Ii13M.js";import{C as W}from"./collection-page-C75JriCh.js";import{u as Y}from"./project-context-provider-BPo-49FO.js";import{B as w}from"./button-Co_HOc3E.js";import{a as Z,F as k,b as E,c as R,d as O,f as M,e as G}from"./form-ChO7tWCF.js";import{I as U}from"./input-DEsmZ6es.js";import{u as J}from"./useMutation-4fnzP4bc.js";import{i as V}from"./Grid01-BgBQwtBY.js";import{i as X}from"./Upload01-Ba_zCXbQ.js";import{i as _}from"./X-D09jV0HO.js";import"./collection-display-button-C_GfVLwh.js";import"./dropdown-menu-dsr_wyw0.js";import"./ArrowUp-KvHCnFh3.js";import"./Check-D4dBNJmC.js";import"./List-hTdqyLGB.js";import"./tooltip-BJO9sFhZ.js";import"./view-mode-toggle-tlrhMsiy.js";const q=({size:d=24,color:e="currentColor",...r})=>N.createElement("svg",{viewBox:"0 0 24 24",width:d,height:d,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},N.createElement("path",{d:"m2 14.5 9.642 4.821c.131.066.197.099.266.111.06.012.123.012.184 0 .069-.012.135-.045.266-.11L22 14.5m-20-5 9.642-4.821c.131-.066.197-.098.266-.111a.5.5 0 0 1 .184 0c.069.013.135.045.266.111L22 9.5l-9.642 4.821a1.028 1.028 0 0 1-.266.111.501.501 0 0 1-.184 0c-.069-.012-.135-.045-.266-.11L2 9.5Z"}));q.displayName="LayersTwo01";const ee=A({name:L().min(1,"Name is required").max(255,"Name is too long"),slug:L().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:L().optional()});function se(d){const e=H.c(24),{value:r,onChange:a,name:m}=d,o=N.useRef(null);let u;e[0]!==a?(u=S=>{const F=S.target.files?.[0];if(F){if(F.size>2097152){C.error("Image must be smaller than 2MB");return}const c=new FileReader;c.onerror=()=>{const y=c.error;console.error("FileReader error:",y),C.error(y?.message||"Failed to read image file. Please try again."),o.current&&(o.current.value="")},c.onloadend=()=>{if(c.readyState===FileReader.DONE&&c.result){const y=c.result;a(y)}},c.readAsDataURL(F)}},e[0]=a,e[1]=u):u=e[1];const j=u;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{o.current?.click()},e[2]=l):l=e[2];const t=l;let i;e[3]!==a?(i=S=>{S.stopPropagation(),a("")},e[3]=a,e[4]=i):i=e[4];const n=i;let g;e[5]!==j?(g=s.jsx("input",{type:"file",ref:o,className:"hidden",accept:"image/*",onChange:j}),e[5]=j,e[6]=g):g=e[6];let x;e[7]!==n||e[8]!==m||e[9]!==r?(x=r?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:r,alt:m||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:n,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(_,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:t,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(X,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=n,e[8]=m,e[9]=r,e[10]=x):x=e[10];const z=r?"Change Logo":"Upload Logo";let h;e[11]!==z?(h=s.jsx(w,{type:"button",variant:"outline",size:"sm",onClick:t,className:"mb-2",children:z}),e[11]=z,e[12]=h):h=e[12];let f;e[13]!==n||e[14]!==r?(f=r&&s.jsx(w,{type:"button",variant:"ghost",size:"sm",onClick:n,className:"ml-2",children:"Remove"}),e[13]=n,e[14]=r,e[15]=f):f=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=v):v=e[16];let p;e[17]!==h||e[18]!==f?(p=s.jsxs("div",{className:"flex-1",children:[h,f,v]}),e[17]=h,e[18]=f,e[19]=p):p=e[19];let b;return e[20]!==p||e[21]!==g||e[22]!==x?(b=s.jsxs("div",{className:"flex items-start gap-4",children:[g,x,p]}),e[20]=p,e[21]=g,e[22]=x,e[23]=b):b=e[23],b}function be(){const d=B(),{org:e}=Y(),r=$(),[a,m]=N.useState(!1),o=D({resolver:P(ee),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),u=J({mutationFn:async t=>{const i={name:t.name,slug:t.slug};t.logo&&(i.logo=t.logo);const n=await K.organization.update({organizationId:e.id,data:i});if(n?.error)throw new Error(n.error.message||"Failed to update organization");return n},onSuccess:t=>{r.invalidateQueries({queryKey:I.organizations()}),r.invalidateQueries({queryKey:I.activeOrganization(e.slug)}),C.success("Organization settings updated successfully"),t?.data?.slug&&t.data.slug!==e.slug&&d({to:"/$org/settings",params:{org:t.data.slug}})},onError:t=>{C.error(t instanceof Error?t.message:"Failed to update organization")},onSettled:()=>{m(!1)}}),j=t=>{m(!0),u.mutate(t)},l=o.formState.isDirty;return s.jsxs(W,{children:[s.jsx(T,{title:"Settings"}),s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-5 max-w-2xl",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),s.jsx(Z,{...o,children:s.jsxs("form",{onSubmit:o.handleSubmit(j),className:"space-y-6",children:[s.jsx(k,{control:o.control,name:"name",render:({field:t})=>s.jsxs(E,{children:[s.jsx(R,{children:"Organization Name"}),s.jsx(O,{children:s.jsx(U,{placeholder:"My Organization",...t,disabled:a})}),s.jsx(M,{})]})}),s.jsx(k,{control:o.control,name:"slug",render:({field:t})=>s.jsxs(E,{children:[s.jsx(R,{children:"Organization Slug"}),s.jsx(O,{children:s.jsx(U,{placeholder:"my-organization",...t,disabled:a,onChange:i=>{const n=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");t.onChange(n)}})}),s.jsx(G,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(M,{})]})}),s.jsx(k,{control:o.control,name:"logo",render:({field:t})=>s.jsxs(E,{children:[s.jsx(R,{children:"Logo"}),s.jsx(O,{children:s.jsx(se,{value:t.value,onChange:t.onChange,name:o.watch("name")})}),s.jsx(M,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(w,{type:"submit",disabled:!l||a,className:"min-w-24",children:a?"Saving...":"Save Changes"}),l&&s.jsx(w,{type:"button",variant:"outline",onClick:()=>o.reset(),disabled:a,children:"Cancel"})]})]})}),s.jsxs("div",{className:"border-t border-border pt-6 mt-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"More Settings"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Additional configuration options for your organization."})]}),s.jsx("div",{className:"mt-4",children:s.jsxs(Q,{to:"/$org/settings/plugins",params:{org:e.slug},className:"flex items-center justify-between p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors group",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(q,{className:"h-5 w-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-foreground",children:"Plugins"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for your organization"})]})]}),s.jsx(V,{className:"h-5 w-5 text-muted-foreground group-hover:text-foreground transition-colors"})]})})]})]})})})})})]})}export{be as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as S,e as Xt,a as q,j as n,f as Oe,t as Y,c as h,R as Qt,T as es,D as ts,C as ss,P as as,g as ns,O as os,h as ls,i as rs,k as vt,p as is,l as cs,d as wt,m as St,n as $e,G as ds,o as ms,S as Nt,q as fs,s as us,N as ps,v as hs,K as xs,w as yt}from"./index-C5FDJtAp.js";import{E as nt}from"./error-boundary-D2ZJQHnD.js";import{B as J,c as O}from"./button-ClkQLR3o.js";import{P as Ct,a as _t,b as kt}from"./popover-DLFe45bO.js";import{B as dt}from"./badge-Do7WFlPI.js";import{i as Ue}from"./Check-LvJ1lSFr.js";import{n as mt}from"./Inbox01-CSDhYGLL.js";import{s as ft}from"./XClose-BACMQGhN.js";import{i as gs}from"./File06-BM3BX-NC.js";import{i as ze}from"./X-DKF1oh5v.js";import{u as Te}from"./use-mobile-DT1cwytU.js";import{T as It,a as $t,b as zt,c as Ot}from"./tooltip-DXYcokUT.js";import{S as Tt,i as bs,u as js,C as E,a as ut,b as vs,c as ws,d as Ss,U as Ns,G as ys,M as Cs}from"./index-hEHbC4y4.js";import{u as ot,a as _s}from"./use-organization-settings-D46q7SyU.js";import{u as Ge,L as pt,P as ks,O as Is}from"./project-context-provider-DH0iqA5D.js";import{n as $s,I as ht}from"./empty-state-C0gi-aAx.js";import{i as st}from"./use-gateway-D_zdUoI4.js";import{a as zs}from"./Home02-DlsAgg82.js";import{C as Os}from"./create-organization-dialog-BydMMM5g.js";import{I as Ts}from"./input-BbWUShhD.js";import{A as ee}from"./avatar-BtMYdv0U.js";import{c as Ms}from"./Grid01-DwtrqYPx.js";import{D as As,a as Rs,b as Ps,c as Es,d as xt}from"./dropdown-menu-C4Ypstre.js";import{a as Mt}from"./Copy01-CunLN8rc.js";import{n as gt}from"./LinkExternal01-Dbxh7ZV2.js";import{D as Ds,a as Ls,b as Bs,c as Hs,d as Us}from"./dialog-Y0g8yyzz.js";import{L as Gs}from"./form-DDdl0439.js";import{S as Fs}from"./switch-ZAqg3LbP.js";import{i as Ws}from"./Code01-Du8Lx-Uw.js";import{u as Fe,L as lt}from"./localstorage-keys-BZEjwsD0.js";import{u as Vs,a as Ks,b as Zs,c as Ys,N as qs,G as tt,T as Js,d as Xs,D as Qs}from"./use-model-state-Bc4MpPVu.js";import{R as At,a as ea,b as ta}from"./resizable-C6uSLZAk.js";import{s as sa}from"./Plus-DCVckKM0.js";import{u as aa}from"./use-connection-ClVfoZWG.js";import"./SearchMd-tLR3QB8E.js";import"./use-create-gateway-UkmAQbcu.js";import"./AlertCircle-CIFhWg2i.js";import"./ArrowUp-MjJJcV-O.js";import"./textarea-BDJhX5-9.js";import"./useMutation-DEocBykZ.js";import"./Terminal-DwE3k3eb.js";import"./monaco-editor-BnXEGbzY.js";import"./spinner-CUAQv_4V.js";import"./alert-dialog-BryTAX-J.js";import"./connection-BcYehfdK.js";import"./select-CSzUpxmC.js";import"./ChevronDown-QF_Tgl2v.js";import"./Image01-Bw2o5F05.js";import"./use-collections-DxMxR_jZ.js";import"./use-binding-Cmi2FEqF.js";import"./binder-B3GXUIAu.js";import"./useQuery-Dakt0IBq.js";import"./use-gateway-system-prompt-CYi0Zo4K.js";import"./Edit01-DVUwOcf8.js";import"./well-known-mcp-D13f-8h2.js";import"./generate-id-Dyweu44Y.js";import"./Clock-CiIkKpUg.js";import"./Trash01-Dg5Q9OUO.js";const Rt=({size:t=24,color:e="currentColor",...s})=>S.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},S.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"}));Rt.displayName="BarChart10";const Pt=({size:t=24,color:e="currentColor",...s})=>S.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},S.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"}));Pt.displayName="Building02";const Et=({size:t=24,color:e="currentColor",...s})=>S.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},S.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"}));Et.displayName="Globe01";const Dt=({size:t=24,color:e="currentColor",...s})=>S.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},S.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"}));Dt.displayName="LayoutRight";const Lt=({size:t=24,color:e="currentColor",...s})=>S.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},S.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"}));Lt.displayName="LogOut01";const Bt=({size:t=24,color:e="currentColor",...s})=>S.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},S.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"}));Bt.displayName="Mail01";const rt=({size:t=24,color:e="currentColor",...s})=>S.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},S.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),S.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"}));rt.displayName="Settings01";const Ht=({size:t=24,color:e="currentColor",...s})=>S.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},S.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));Ht.displayName="Users01";const Ut=({size:t=24,color:e="currentColor",...s})=>S.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},S.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"}));Ut.displayName="Zap";function na({invitation:t,onStatusChange:e}){const[s,a]=S.useState(!1),[o,l]=S.useState(!1),r=Oe(),i=async()=>{a(!0);try{const u=await q.organization.acceptInvitation({invitationId:t.id});if(u.error)Y.error(u.error.message),a(!1);else{e(t.id,"accepted");const x=await q.organization.setActive({organizationId:t.organizationId});x?.data?.slug?(Y.success("Invitation accepted!"),r({to:"/$org",params:{org:x.data.slug}})):(Y.success("Invitation accepted! Redirecting..."),r({to:"/"}))}}catch{Y.error("Failed to accept invitation"),a(!1)}},c=async()=>{l(!0);try{const u=await q.organization.rejectInvitation({invitationId:t.id});u.error?(Y.error(u.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.inviter?.name||t.inviter?.email||t.email||"Someone",f=t.status==="pending",p=t.status==="accepted",b=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 ${f?"":"opacity-50"}`,children:[n.jsx("div",{className:"shrink-0 size-5 flex items-center justify-center",children:n.jsx(Bt,{size:16,className:"text-muted-foreground"})}),n.jsxs("p",{className:"flex-1 text-sm text-foreground min-w-0 whitespace-nowrap overflow-hidden",children:[n.jsx("span",{className:"font-semibold inline-block max-w-[120px] truncate align-bottom",children:m})," invited you to join ",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:f?n.jsxs(n.Fragment,{children:[n.jsx(J,{variant:"ghost",size:"icon",onClick:c,disabled:s||o,className:"h-8 w-8",children:n.jsx(ft,{size:14})}),n.jsx(J,{variant:"outline",size:"icon",onClick:i,disabled:s||o,className:"h-8 w-8",children:n.jsx(Ue,{size:14})})]}):p?n.jsxs(dt,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(Ue,{size:12}),"Accepted"]}):b?n.jsxs(dt,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(ft,{size:12}),"Declined"]}):null})]})}function oa(){const[t,e]=S.useState(!1),s=S.useContext(Xt),{data:a}=s.hooks.useListUserInvitations(),{data:o}=q.useListOrganizations(),[l,r]=S.useState({}),d=(a??[]).map(u=>{const x=(o??[]).find(g=>g.id===u.organizationId);return{...u,organizationSlug:x?.slug||u.organizationSlug,organizationName:x?.name||u.organizationName}}).map(u=>({...u,status:l[u.id]||u.status})),m=[...d].sort((u,x)=>{const g={pending:0,accepted:1,rejected:2};return(g[u.status]??999)-(g[x.status]??999)}),p=d.filter(u=>u.status==="pending").length>0,b=(u,x)=>{r(g=>({...g,[u]:x}))};return n.jsxs(Ct,{open:t,onOpenChange:e,children:[n.jsx(_t,{asChild:!0,children:n.jsxs(J,{variant:"ghost",size:"sm",className:"relative h-7 w-7 p-0","aria-label":"Inbox",children:[n.jsx(mt,{size:18,className:"text-muted-foreground"}),p&&n.jsx("span",{className:"absolute bottom-1 right-0.5 h-2 w-2 rounded-full bg-destructive ring-2 ring-background"})]})}),n.jsxs(kt,{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:m.length>0?m.map(u=>n.jsx(na,{invitation:u,onStatusChange:b},u.id)):n.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[n.jsx(mt,{size:32,className:"text-muted-foreground/40 mb-2"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"No invitations at the moment"})]})})]})]})}function la(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(Qt,{"data-slot":"sheet",...s}),e[2]=s,e[3]=a):a=e[3],a}function ra(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(as,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function ia(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 o;e[3]!==s?(o=O("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]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx(os,{"data-slot":"sheet-overlay",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function ca(t){const e=h.c(17);let s,a,o,l;e[0]!==t?({className:a,children:s,side:l,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l):(s=e[1],a=e[2],o=e[3],l=e[4]);const r=l===void 0?"right":l;let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ia,{}),e[5]=i):i=e[5];const c=r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",d=r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",m=r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",f=r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let p;e[6]!==a||e[7]!==c||e[8]!==d||e[9]!==m||e[10]!==f?(p=O("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",c,d,m,f,a),e[6]=a,e[7]=c,e[8]=d,e[9]=m,e[10]=f,e[11]=p):p=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs(ns,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[n.jsx(ze,{className:"size-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=b):b=e[12];let u;return e[13]!==s||e[14]!==o||e[15]!==p?(u=n.jsxs(ra,{children:[i,n.jsxs(ss,{"data-slot":"sheet-content",className:p,...o,children:[s,b]})]}),e[13]=s,e[14]=o,e[15]=p,e[16]=u):u=e[16],u}function da(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 o;e[3]!==s?(o=O("flex flex-col gap-1.5 p-4",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-slot":"sheet-header",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function ma(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 o;e[3]!==s?(o=O("text-foreground font-semibold",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx(es,{"data-slot":"sheet-title",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function fa(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 o;e[3]!==s?(o=O("text-muted-foreground text-sm",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx(ts,{"data-slot":"sheet-description",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}const ua="sidebar_state",pa=3600*24*7,ha="16rem",xa="18rem",ga="3rem",ba="b",Gt=S.createContext(null);function it(){const t=S.useContext(Gt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function ja(t){const e=h.c(21),{defaultOpen:s,open:a,onOpenChange:o,children:l}=t,r=s===void 0?!0:s,i=Te(),[c,d]=S.useState(!1),[m,f]=S.useState(r),p=a??m;let b;e[0]!==p||e[1]!==o?(b=_=>{const v=typeof _=="function"?_(p):_;o?o(v):f(v),document.cookie=`${ua}=${v}; path=/; max-age=${pa}`},e[0]=p,e[1]=o,e[2]=b):b=e[2];const u=b;let x;e[3]!==i||e[4]!==u?(x=()=>i?d(wa):u(va),e[3]=i,e[4]=u,e[5]=x):x=e[5];const g=x;let w,N;e[6]!==g?(w=()=>{const _=v=>{if(v.key===ba&&(v.metaKey||v.ctrlKey)){const z=v.target;if(z.tagName==="INPUT"||z.tagName==="TEXTAREA"||z.isContentEditable)return;v.preventDefault(),g()}};return globalThis.addEventListener("keydown",_),()=>globalThis.removeEventListener("keydown",_)},N=[g],e[6]=g,e[7]=w,e[8]=N):(w=e[7],N=e[8]),S.useEffect(w,N);const j=p?"expanded":"collapsed";let $;e[9]!==i||e[10]!==p||e[11]!==c||e[12]!==u||e[13]!==j||e[14]!==g?($={state:j,open:p,setOpen:u,isMobile:i,openMobile:c,setOpenMobile:d,toggleSidebar:g},e[9]=i,e[10]=p,e[11]=c,e[12]=u,e[13]=j,e[14]=g,e[15]=$):$=e[15];const C=$;let I;e[16]!==l?(I=n.jsx($t,{delayDuration:0,children:l}),e[16]=l,e[17]=I):I=e[17];let k;return e[18]!==C||e[19]!==I?(k=n.jsx(Gt.Provider,{value:C,children:I}),e[18]=C,e[19]=I,e[20]=k):k=e[20],k}function va(t){return!t}function wa(t){return!t}function Sa(t){const e=h.c(14);let s,a,o,l;e[0]!==t?({className:a,style:l,children:s,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l):(s=e[1],a=e[2],o=e[3],l=e[4]);let r;e[5]!==l?(r={"--sidebar-width":ha,"--sidebar-width-icon":ga,...l},e[5]=l,e[6]=r):r=e[6];const i=r;let c;e[7]!==a?(c=O("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]!==o||e[11]!==i||e[12]!==c?(d=n.jsx("div",{"data-slot":"sidebar-wrapper",style:i,className:c,...o,children:s}),e[9]=s,e[10]=o,e[11]=i,e[12]=c,e[13]=d):d=e[13],d}function Na(t){const e=h.c(46);let s,a,o,l,r,i;e[0]!==t?({side:l,variant:r,collapsible:i,className:a,children:s,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l,e[5]=r,e[6]=i):(s=e[1],a=e[2],o=e[3],l=e[4],r=e[5],i=e[6]);const c=l===void 0?"left":l,d=r===void 0?"sidebar":r,m=i===void 0?"offcanvas":i,{isMobile:f,state:p,openMobile:b,setOpenMobile:u}=it();if(m==="none"){let v;e[7]!==a?(v=O("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),e[7]=a,e[8]=v):v=e[8];let z;return e[9]!==s||e[10]!==o||e[11]!==v?(z=n.jsx("div",{"data-slot":"sidebar",className:v,...o,children:s}),e[9]=s,e[10]=o,e[11]=v,e[12]=z):z=e[12],z}if(f){let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v={"--sidebar-width":xa},e[13]=v):v=e[13];let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsxs(da,{className:"sr-only",children:[n.jsx(ma,{children:"Sidebar"}),n.jsx(fa,{children:"Displays the mobile sidebar."})]}),e[14]=z):z=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 M;e[17]!==c||e[18]!==T?(M=n.jsxs(ca,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:v,side:c,children:[z,T]}),e[17]=c,e[18]=T,e[19]=M):M=e[19];let A;return e[20]!==b||e[21]!==o||e[22]!==u||e[23]!==M?(A=n.jsx(la,{open:b,onOpenChange:u,...o,children:M}),e[20]=b,e[21]=o,e[22]=u,e[23]=M,e[24]=A):A=e[24],A}const x=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 w;e[25]!==g?(w=O("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]=w):w=e[26];let N;e[27]!==w?(N=n.jsx("div",{"data-slot":"sidebar-gap",className:w}),e[27]=w,e[28]=N):N=e[28];const j=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 C;e[29]!==a||e[30]!==j||e[31]!==$?(C=O("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",j,$,a),e[29]=a,e[30]=j,e[31]=$,e[32]=C):C=e[32];let I;e[33]!==s?(I=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]=I):I=e[34];let k;e[35]!==o||e[36]!==C||e[37]!==I?(k=n.jsx("div",{"data-slot":"sidebar-container",className:C,...o,children:I}),e[35]=o,e[36]=C,e[37]=I,e[38]=k):k=e[38];let _;return e[39]!==c||e[40]!==p||e[41]!==k||e[42]!==x||e[43]!==N||e[44]!==d?(_=n.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":p,"data-collapsible":x,"data-variant":d,"data-side":c,"data-slot":"sidebar",children:[N,k]}),e[39]=c,e[40]=p,e[41]=k,e[42]=x,e[43]=N,e[44]=d,e[45]=_):_=e[45],_}function ya(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 o;e[3]!==s?(o=O("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]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("main",{"data-slot":"sidebar-inset",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function Ca(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 o;e[3]!==s?(o=O("h-4 m-0! w-full",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-sidebar":"separator",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function _a(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 o;e[3]!==s?(o=O("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function ka(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 o;e[3]!==s?(o=O("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function Ia(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 o;e[3]!==s?(o=O("w-full text-sm",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function $a(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 o;e[3]!==s?(o=O("flex w-full min-w-0 flex-col gap-1",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function We(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 o;e[3]!==s?(o=O("group/menu-item relative",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}const za=ls("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 Ft(t){const e=h.c(28);let s,a,o,l,r,i,c;e[0]!==t?({asChild:o,isActive:l,variant:r,size:i,tooltip:c,className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l,e[5]=r,e[6]=i,e[7]=c):(s=e[1],a=e[2],o=e[3],l=e[4],r=e[5],i=e[6],c=e[7]);const d=o===void 0?!1:o,m=l===void 0?!1:l,f=r===void 0?"default":r,p=i===void 0?"default":i,b=d?rs:"button",{isMobile:u,state:x}=it();let g;e[8]!==s||e[9]!==p||e[10]!==f?(g=O(za({variant:f,size:p}),s),e[8]=s,e[9]=p,e[10]=f,e[11]=g):g=e[11];let w;e[12]!==b||e[13]!==m||e[14]!==a||e[15]!==p||e[16]!==g?(w=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]=w):w=e[17];const N=w;if(!c)return N;if(typeof c=="string"){let k;e[18]!==c?(k={children:c},e[18]=c,e[19]=k):k=e[19],c=k}let j;e[20]!==N?(j=n.jsx(zt,{asChild:!0,children:N}),e[20]=N,e[21]=j):j=e[21];const $=x!=="collapsed"||u;let C;e[22]!==$||e[23]!==c?(C=n.jsx(It,{side:"right",align:"center",hidden:$,...c}),e[22]=$,e[23]=c,e[24]=C):C=e[24];let I;return e[25]!==j||e[26]!==C?(I=n.jsxs(Ot,{children:[j,C]}),e[25]=j,e[26]=C,e[27]=I):I=e[27],I}function Oa(t){const e=h.c(26),{item:s}=t,a=Oe(),{org:o}=Ge(),l=ot(o.id),r=_s(o.id);let i;e[0]!==r.update||e[1]!==s.url||e[2]!==l?.sidebar_items?(i=async()=>{const $=(l?.sidebar_items||[]).filter(C=>C.url!==s.url);await r.update.mutateAsync({sidebar_items:$})},e[0]=r.update,e[1]=s.url,e[2]=l?.sidebar_items,e[3]=i):i=e[3];const c=i;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=/^https?:\/\/.+/,e[4]=d):d=e[4];let m;e[5]!==s.icon?(m=d.test(s.icon),e[5]=s.icon,e[6]=m):m=e[6];const f=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 u;e[10]!==f||e[11]!==s.icon||e[12]!==s.title?(u=n.jsx("div",{className:"flex items-center justify-center shrink-0",children:f?n.jsx("img",{src:s.icon,alt:s.title,className:"h-4 w-4 rounded object-cover"}):n.jsx(gs,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=f,e[11]=s.icon,e[12]=s.title,e[13]=u):u=e[13];let x;e[14]!==s.title?(x=s.title.toLocaleLowerCase(),e[14]=s.title,e[15]=x):x=e[15];let g;e[16]!==x?(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:x})}),e[16]=x,e[17]=g):g=e[17];let w;e[18]!==c?(w=n.jsx(ze,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:j=>{j.preventDefault(),j.stopPropagation(),c()}}),e[18]=c,e[19]=w):w=e[19];let N;return e[20]!==s.title||e[21]!==p||e[22]!==u||e[23]!==g||e[24]!==w?(N=n.jsx(We,{children:n.jsxs(Ft,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:p,tooltip:b,children:[u,g,w]})}),e[20]=s.title,e[21]=p,e[22]=u,e[23]=g,e[24]=w,e[25]=N):N=e[25],N}function Ta(){const t=h.c(4),{org:e}=Ge(),a=ot(e.id)?.sidebar_items;if(!a?.length)return null;let o;t[0]!==a?(o=a.map(Ma),t[0]=a,t[1]=o):o=t[1];let l;return t[2]!==o?(l=n.jsx(Wt,{children:o}),t[2]=o,t[3]=l):l=t[3],l}function Ma(t){return n.jsx(Oa,{item:t},t.url)}function bt(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(We,{children:n.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:n.jsx(Tt,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function Wt(t){const e=h.c(4),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ca,{className:"my-2 -ml-1"}),e[0]=a):a=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(We,{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]=o):o=e[1];let l;return e[2]!==s?(l=n.jsxs(n.Fragment,{children:[a,o,s]}),e[2]=s,e[3]=l):l=e[3],l}function Aa(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(S.Suspense,{fallback:n.jsxs(Wt,{children:[n.jsx(bt,{}),n.jsx(bt,{})]}),children:n.jsx(Ta,{})}),t[0]=e):e=t[0],e}function Ra(){const t=h.c(14),{locator:e,org:s}=Ge(),a=Oe(),o=vt(),{org:l}=pt.parse(e);let r;t[0]!==e?(r=pt.isOrgAdminProject(e),t[0]=e,t[1]=r):r=t[1];const i=r,c=ot(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 f;t[4]!==m?(f=k=>m.includes(k.pluginId),t[4]=m,t[5]=f):f=t[5];const p=is.filter(f),b=o.location.pathname===`/${l}`||o.location.pathname===`/${l}/`;let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(zs,{}),t[6]=u):u=t[6];let x;t[7]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Pt,{}),t[7]=x):x=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx($s,{}),t[8]=g):g=t[8];let w;t[9]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(st,{}),t[9]=w):w=t[9];let N;t[10]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Ut,{}),t[10]=N):N=t[10];let j;t[11]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Rt,{}),t[11]=j):j=t[11];let $;t[12]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(Ht,{}),t[12]=$):$=t[12];let C;t[13]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(rt,{}),t[13]=C):C=t[13];const I=[{key:"home",label:"Home",icon:u,onClick:()=>{b?window.dispatchEvent(new CustomEvent("reset-home-view")):a({to:"/$org",params:{org:l}})}},{key:"store",label:"Store",icon:x,onClick:()=>a({to:"/$org/store",params:{org:l}})},...p.map(k=>({key:k.pluginId,label:k.label,icon:k.icon,onClick:()=>a({to:"/$org/$pluginId",params:{org:l,pluginId:k.pluginId}})})),{key:"mcps",label:"Connections",icon:g,onClick:()=>a({to:"/$org/mcps",params:{org:l}})},{key:"gateways",label:"Agents",icon:w,onClick:()=>a({to:"/$org/gateways",params:{org:l}})},{key:"workflow",label:"Workflows",icon:N,onClick:()=>a({to:"/$org/workflows",params:{org:l}})},{key:"monitoring",label:"Monitoring",icon:j,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:C,onClick:()=>a({to:"/$org/settings",params:{org:l}})}];return i?I:[]}function Vt(t){const e=h.c(10),{navigationItems:s,footer:a,additionalContent:o,variant:l,collapsible:r}=t,i=l===void 0?"sidebar":l,c=r===void 0?"icon":r;let d;e[0]!==s?(d=s.map(Pa),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==o||e[3]!==d?(m=n.jsx(_a,{className:"flex-1 overflow-x-hidden",children:n.jsx(ka,{className:"font-medium",children:n.jsx(Ia,{children:n.jsxs($a,{className:"gap-0.5",children:[d,o]})})})}),e[2]=o,e[3]=d,e[4]=m):m=e[4];let f;return e[5]!==c||e[6]!==a||e[7]!==m||e[8]!==i?(f=n.jsxs(Na,{variant:i,collapsible:c,children:[m,a]}),e[5]=c,e[6]=a,e[7]=m,e[8]=i,e[9]=f):f=e[9],f}function Pa(t){return n.jsx(We,{children:n.jsxs(Ft,{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)}Vt.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(Tt,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function Ea(){const t=h.c(3),e=Ra();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(n.Fragment,{children:n.jsx(nt,{children:n.jsx(S.Suspense,{fallback:null,children:n.jsx(Aa,{})})})}),t[0]=s):s=t[0];let a;return t[1]!==e?(a=n.jsx(Vt,{navigationItems:e,additionalContent:s}),t[1]=e,t[2]=a):a=t[2],a}function Da(t){const e=h.c(12);let s,a,o,l;e[0]!==t?({className:s,orientation:o,decorative:l,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l):(s=e[1],a=e[2],o=e[3],l=e[4]);const r=o===void 0?"horizontal":o,i=l===void 0?!0:l;let c;e[5]!==s?(c=O("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]!==i||e[8]!==r||e[9]!==a||e[10]!==c?(d=n.jsx(cs,{"data-slot":"separator-root",decorative:i,orientation:r,className:c,...a}),e[7]=i,e[8]=r,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}const Kt=S.createContext(null);function La(){const t=S.useContext(Kt);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function Ba(t){const e=h.c(10),{children:s,onItemHover:a}=t,[o,l]=S.useState(null);let r;e[0]!==a?(r=f=>{l(f),a?.(f)},e[0]=a,e[1]=r):r=e[1];const i=r;let c;e[2]!==o||e[3]!==i?(c={hoveredItem:o,setHoveredItem:i},e[2]=o,e[3]=i,e[4]=c):c=e[4];let d;e[5]!==s?(d=n.jsx(Ct,{children:s}),e[5]=s,e[6]=d):d=e[6];let m;return e[7]!==c||e[8]!==d?(m=n.jsx(Kt.Provider,{value:c,children:d}),e[7]=c,e[8]=d,e[9]=m):m=e[9],m}function Ha(t){const e=h.c(6),{children:s,onClick:a}=t;let o;e[0]!==s||e[1]!==a?(o=n.jsx(J,{variant:"link",className:"p-0.5 h-auto",onClick:a,type:"button",children:s}),e[0]=s,e[1]=a,e[2]=o):o=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(_t,{asChild:!0,children:n.jsx(J,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:n.jsx(bs,{size:16,className:"opacity-50"})})}),e[3]=l):l=e[3];let r;return e[4]!==o?(r=n.jsxs("div",{className:"flex items-center gap-1",children:[o,l]}),e[4]=o,e[5]=r):r=e[5],r}function Ua(t){const e=h.c(8),{item:s,fallback:a}=t,o=a===void 0?"":a,l=s?.avatarUrl??"",r=s?.name??o;let i;e[0]!==l||e[1]!==r?(i=n.jsx(ee,{url:l,fallback:r,size:"xs",objectFit:"contain"}),e[0]=l,e[1]=r,e[2]=i):i=e[2];const c=s?.name??o;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]!==i||e[6]!==d?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[i,d]}),e[5]=i,e[6]=d,e[7]=m):m=e[7],m}function Ga(t){const e=h.c(6),{children:s,align:a}=t,o=a===void 0?"start":a,r=S.Children.toArray(s).filter(Fa).length===1?"280px":"480px";let i;e[0]!==r?(i={width:r},e[0]=r,e[1]=i):i=e[1];let c;return e[2]!==o||e[3]!==s||e[4]!==i?(c=n.jsx(kt,{align:o,className:"p-0 flex items-start",style:i,children:s}),e[2]=o,e[3]=s,e[4]=i,e[5]=c):c=e[5],c}function Fa(t){return S.isValidElement(t)&&(t.type===Yt||t.type===Zt)}function Zt(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=O("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",a),e[0]=a,e[1]=o):o=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}const Yt=Zt;function Wa(t){const e=h.c(6),{placeholder:s,value:a,onChange:o}=t,l=s===void 0?"Search...":s;let r;e[0]!==o?(r=c=>o(c.target.value),e[0]=o,e[1]=r):r=e[1];let i;return e[2]!==l||e[3]!==r||e[4]!==a?(i=n.jsx(Ts,{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]=i):i=e[5],i}function Va(t){const e=h.c(6),{children:s,emptyMessage:a}=t,o=a===void 0?"No items found.":a,l=S.Children.count(s)>0;let r;e[0]!==o||e[1]!==l?(r=!l&&n.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:o}),e[0]=o,e[1]=l,e[2]=r):r=e[2];let i;return e[3]!==s||e[4]!==r?(i=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]=i):i=e[5],i}function Ka(t){const e=h.c(15),{item:s,onClick:a,onHover:o,children:l}=t,r=La();let i;e[0]!==r||e[1]!==s||e[2]!==o?(i=()=>{r.setHoveredItem(s.slug),o?.(s)},e[0]=r,e[1]=s,e[2]=o,e[3]=i):i=e[3];const c=i;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(ee,{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 f;return e[11]!==c||e[12]!==d||e[13]!==m?(f=n.jsx(J,{onClick:d,onMouseEnter:c,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:m}),e[11]=c,e[12]=d,e[13]=m,e[14]=f):f=e[14],f}function Za(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 Ya(t){const e=h.c(11),{onClick:s,icon:a,children:o,variant:l}=t,i=(l===void 0?"default":l)==="muted"&&"text-muted-foreground";let c;e[0]!==i?(c=O("w-full justify-start font-normal",i),e[0]=i,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]!==o?(m=n.jsx("span",{children:o}),e[4]=o,e[5]=m):m=e[5];let f;return e[6]!==s||e[7]!==c||e[8]!==d||e[9]!==m?(f=n.jsxs(J,{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]=f):f=e[10],f}function qa(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Da,{}),t[0]=e):e=t[0],e}function Ja(){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 B=Object.assign(Ba,{Trigger:Ha,CurrentItem:Ua,Content:Ga,Panel:Yt,Search:Wa,Items:Va,Item:Ka,Actions:Za,Action:Ya,Separator:qa,Skeleton:Ja});function at(){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}=wt(e),{data:a}=q.useListOrganizations(),o=Oe();let l;t[1]!==s||t[2]!==a?(l=a?.find(y=>y.slug===s),t[1]=s,t[2]=a,t[3]=l):l=t[3];const r=l,[i,c]=S.useState(""),[d,m]=S.useState(!1);let f,p,b,u,x,g,w,N;if(t[4]!==r||t[5]!==o||t[6]!==s||t[7]!==i||t[8]!==a){const P=(a?(()=>{const H=a.filter(F=>F.name.toLowerCase().includes(i.toLowerCase()));if(s){const F=H.findIndex(V=>V.slug===s);if(F>0){const V=H[F];V&&(H.splice(F,1),H.unshift(V))}}return H})():[]).map(Xa);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 G=R;u=B;let D;t[19]!==o||t[20]!==s?(D=()=>o({to:"/$org",params:{org:s??""}}),t[19]=o,t[20]=s,t[21]=D):D=t[21];let W;t[22]!==G?(W=n.jsx(B.CurrentItem,{item:G}),t[22]=G,t[23]=W):W=t[23],t[24]!==D||t[25]!==W?(N=n.jsx(B.Trigger,{onClick:D,children:W}),t[24]=D,t[25]=W,t[26]=N):N=t[26],b=B.Content,p=B.Panel,t[27]!==i?(w=n.jsx(B.Search,{placeholder:"Search organizations...",value:i,onChange:c}),t[27]=i,t[28]=w):w=t[28],f=B.Items,x="No organizations found.";let X;t[29]!==o?(X=H=>n.jsx(B.Item,{item:H,onClick:F=>o({to:"/$org",params:{org:F.slug}})},H.slug),t[29]=o,t[30]=X):X=t[30],g=P.map(X),t[4]=r,t[5]=o,t[6]=s,t[7]=i,t[8]=a,t[9]=f,t[10]=p,t[11]=b,t[12]=u,t[13]=x,t[14]=g,t[15]=w,t[16]=N}else f=t[9],p=t[10],b=t[11],u=t[12],x=t[13],g=t[14],w=t[15],N=t[16];let j;t[31]!==f||t[32]!==x||t[33]!==g?(j=n.jsx(f,{emptyMessage:x,children:g}),t[31]=f,t[32]=x,t[33]=g,t[34]=j):j=t[34];let $,C;t[35]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(B.Actions,{children:n.jsx(B.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),C=n.jsx(B.Separator,{}),t[35]=$,t[36]=C):($=t[35],C=t[36]);let I;t[37]!==o?(I=()=>o({to:"/"}),t[37]=o,t[38]=I):I=t[38];let k;t[39]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(Ms,{}),t[39]=k):k=t[39];let _;t[40]!==I?(_=n.jsx(B.Actions,{children:n.jsx(B.Action,{onClick:I,icon:k,children:"See all organizations"})}),t[40]=I,t[41]=_):_=t[41];let v;t[42]!==p||t[43]!==_||t[44]!==w||t[45]!==j?(v=n.jsxs(p,{children:[w,j,$,C,_]}),t[42]=p,t[43]=_,t[44]=w,t[45]=j,t[46]=v):v=t[46];let z;t[47]!==b||t[48]!==v?(z=n.jsx(b,{children:v}),t[47]=b,t[48]=v,t[49]=z):z=t[49];let T;t[50]!==u||t[51]!==z||t[52]!==N?(T=n.jsxs(u,{children:[N,z]}),t[50]=u,t[51]=z,t[52]=N,t[53]=T):T=t[53];let M;t[54]!==d?(M=n.jsx(Os,{open:d,onOpenChange:m}),t[54]=d,t[55]=M):M=t[55];let A;return t[56]!==T||t[57]!==M?(A=n.jsxs(n.Fragment,{children:[T,M]}),t[56]=T,t[57]=M,t[58]=A):A=t[58],A}function Xa(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}at.Skeleton=B.Skeleton;function Qa({prop:t,defaultProp:e,onChange:s=()=>{}}){const[a,o]=en({defaultProp:e,onChange:s}),l=t!==void 0,r=l?t:a,i=St(s),c=S.useCallback(d=>{if(l){const f=typeof d=="function"?d(t):d;f!==t&&i(f)}else o(d)},[l,t,o,i]);return[r,c]}function en({defaultProp:t,onChange:e}){const s=S.useState(t),[a]=s,o=S.useRef(a),l=St(e);return S.useEffect(()=>{o.current!==a&&(l(a),o.current=a)},[a,o,l]),s}function tn(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($e.Root,{"data-slot":"drawer",...s}),e[2]=s,e[3]=a):a=e[3],a}function sn(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($e.Trigger,{"data-slot":"drawer-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function an(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($e.Portal,{"data-slot":"drawer-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function nn(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 o;e[3]!==s?(o=O("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]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx($e.Overlay,{"data-slot":"drawer-overlay",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function on(t){const e=h.c(12);let s,a,o;e[0]!==t?({className:a,children:s,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o):(s=e[1],a=e[2],o=e[3]);let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(nn,{}),e[4]=l):l=e[4];let r;e[5]!==a?(r=O("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 i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=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]=i):i=e[7];let c;return e[8]!==s||e[9]!==o||e[10]!==r?(c=n.jsxs(an,{"data-slot":"drawer-portal",children:[l,n.jsxs($e.Content,{"data-slot":"drawer-content",className:r,...o,children:[i,s]})]}),e[8]=s,e[9]=o,e[10]=r,e[11]=c):c=e[11],c}function ln(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 o;e[3]!==s?(o=O("flex flex-col gap-1.5 px-4 py-2",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-slot":"drawer-header",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function rn(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 o;e[3]!==s?(o=O("text-foreground font-semibold",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx($e.Title,{"data-slot":"drawer-title",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}const qt=S.createContext({setOpen:()=>{}}),cn=()=>S.useContext(qt),dn=t=>{const e=h.c(25);let s,a,o,l,r;e[0]!==t?({children:s,defaultOpen:a,open:l,onOpenChange:o,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l,e[5]=r):(s=e[1],a=e[2],o=e[3],l=e[4],r=e[5]);const i=a??!1;let c;e[6]!==o||e[7]!==l||e[8]!==i?(c={prop:l,defaultProp:i,onChange:o},e[6]=o,e[7]=l,e[8]=i,e[9]=c):c=e[9];const[d,m]=Qa(c);let f;e[10]!==m?(f={setOpen:m},e[10]=m,e[11]=f):f=e[11];let p;e[12]!==s||e[13]!==d||e[14]!==r||e[15]!==m?(p=n.jsx(tn,{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(Ps,{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 u;return e[22]!==f||e[23]!==b?(u=n.jsx(qt.Provider,{value:f,children:b}),e[22]=f,e[23]=b,e[24]=u):u=e[24],u},mn=t=>{const{children:e,title:s,...a}=t,o=Te(),{className:l,...r}=a;return o?n.jsxs(on,{...r,children:[n.jsx(ln,{className:"hidden",children:n.jsx(rn,{children:s})}),n.jsx("div",{className:O("flex flex-col gap-2 p-2 py-4",l),children:e})]}):n.jsx(Rs,{...a,children:e})},fn=t=>{const{children:e,...s}=t,{setOpen:a}=cn(),o=Te(),{className:l,...r}=s;return o?n.jsx("div",{...r,onClick:i=>{a(!1);const{onClick:c}=r;c?.(i)},className:O("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(Es,{...s,children:e})},un=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 o=Te();let l;return e[3]!==s||e[4]!==o||e[5]!==a?(l=o?n.jsx(sn,{asChild:!0,children:s}):n.jsx(As,{...a,children:s}),e[3]=s,e[4]=o,e[5]=a,e[6]=l):l=e[6],l},pn=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 o=Te();let l;return e[3]!==s||e[4]!==o||e[5]!==a?(l=o?n.jsx(xt,{className:O(s),...a}):n.jsx(xt,{className:O(s),...a}),e[3]=s,e[4]=o,e[5]=a,e[6]=l):l=e[6],l};function hn(t){const e=h.c(11),{user:s,trigger:a,align:o,children:l}=t,r=o===void 0?"start":o;let i;e[0]!==a||e[1]!==s?(i=a(s),e[0]=a,e[1]=s,e[2]=i):i=e[2];let c;e[3]!==i?(c=n.jsx(un,{asChild:!0,children:n.jsx("div",{children:i})}),e[3]=i,e[4]=c):c=e[4];let d;e[5]!==r||e[6]!==l?(d=n.jsx(mn,{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(dn,{children:[c,d]}),e[8]=c,e[9]=d,e[10]=m):m=e[10],m}function xn(t){const e=h.c(8),{children:s,onClick:a,className:o,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 i;return e[4]!==l||e[5]!==o||e[6]!==r?(i=n.jsx(fn,{asChild:l,className:o,children:r}),e[4]=l,e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function gn(t){const e=h.c(2),{className:s}=t;let a;return e[0]!==s?(a=n.jsx(pn,{className:s}),e[0]=s,e[1]=a):a=e[1],a}function bn(){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 Z=Object.assign(hn,{Item:xn,Separator:gn,Skeleton:bn});function jn(t){const e=h.c(48),{open:s,onOpenChange:a,user:o,userImage:l}=t,[r,i]=js(),[c,d]=S.useState(!1);let m;e[0]!==o.id?(m=()=>{navigator.clipboard.writeText(o.id),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=o.id,e[1]=m):m=e[1];const f=m;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Ds,{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(Ls,{className:"px-6 pt-6 pb-4 border-b border-border shrink-0 relative",children:[p,n.jsxs(Bs,{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(ze,{size:16}),n.jsx("span",{className:"sr-only",children:"Close"})]})]}),e[3]=b):b=e[3];const u=o.name||"U";let x;e[4]!==u||e[5]!==l?(x=n.jsx(ee,{url:l,fallback:u,shape:"circle",size:"xl",className:"h-16 w-16"}),e[4]=u,e[5]=l,e[6]=x):x=e[6];const g=o.name||"User";let w;e[7]!==g?(w=n.jsx("span",{className:"text-base font-medium text-foreground",children:g}),e[7]=g,e[8]=w):w=e[8];let N;e[9]!==o.email?(N=n.jsx("span",{className:"text-sm text-muted-foreground",children:o.email}),e[9]=o.email,e[10]=N):N=e[10];let j;e[11]!==w||e[12]!==N?(j=n.jsxs("div",{className:"flex flex-col gap-1",children:[w,N]}),e[11]=w,e[12]=N,e[13]=j):j=e[13];let $;e[14]!==x||e[15]!==j?($=n.jsxs("div",{className:"flex items-center gap-4",children:[x,j]}),e[14]=x,e[15]=j,e[16]=$):$=e[16];let C;e[17]!==r||e[18]!==i?(C=()=>i(!r),e[17]=r,e[18]=i,e[19]=C):C=e[19];let I;e[20]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[n.jsxs(Gs,{className:"text-sm font-medium text-foreground flex items-center gap-2 pointer-events-none",children:[n.jsx(Ws,{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]=I):I=e[20];let k;e[21]!==r||e[22]!==i?(k=n.jsx("div",{onClick:vn,children:n.jsx(Fs,{checked:r,onCheckedChange:i})}),e[21]=r,e[22]=i,e[23]=k):k=e[23];let _;e[24]!==C||e[25]!==k?(_=n.jsxs("button",{type:"button",onClick:C,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:[I,k]}),e[24]=C,e[25]=k,e[26]=_):_=e[26];let v;e[27]!==$||e[28]!==_?(v=n.jsxs("div",{className:"p-5 space-y-6 min-h-[225px]",children:[$,_]}),e[27]=$,e[28]=_,e[29]=v):v=e[29];let z;e[30]!==o.id?(z=n.jsx("span",{className:"font-mono text-xs",children:o.id}),e[30]=o.id,e[31]=z):z=e[31];let T;e[32]!==c?(T=c?n.jsx(Ue,{size:14,className:"text-green-600"}):n.jsx(Mt,{size:14,className:"opacity-0 group-hover:opacity-100 transition-opacity"}),e[32]=c,e[33]=T):T=e[33];let M;e[34]!==f||e[35]!==z||e[36]!==T?(M=n.jsx(zt,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:f,className:"group flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[z,T]})}),e[34]=f,e[35]=z,e[36]=T,e[37]=M):M=e[37];let A;e[38]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(It,{side:"top",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[38]=A):A=e[38];let y;e[39]!==M?(y=n.jsx("div",{className:"border-t border-border px-5 py-4 flex items-center shrink-0",children:n.jsx($t,{children:n.jsxs(Ot,{children:[M,A]})})}),e[39]=M,e[40]=y):y=e[40];let P;e[41]!==v||e[42]!==y?(P=n.jsxs(Hs,{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:[v,y]})]}),e[41]=v,e[42]=y,e[43]=P):P=e[43];let R;return e[44]!==a||e[45]!==s||e[46]!==P?(R=n.jsx(Us,{open:s,onOpenChange:a,children:P}),e[44]=a,e[45]=s,e[46]=P,e[47]=R):R=e[47],R}function vn(t){return t.stopPropagation()}function wn(t){const e=h.c(47),{user:s,userImage:a}=t,[o,l]=S.useState(!1),[r,i]=S.useState(!1);let c;e[0]!==s.email||e[1]!==s.id||e[2]!==s.name?(c=()=>{const R=`ID: ${s.id}
|
|
1
|
+
import{r as S,e as Xt,a as q,j as n,f as Oe,t as Y,c as h,R as Qt,T as es,D as ts,C as ss,P as as,g as ns,O as os,h as ls,i as rs,k as vt,p as is,l as cs,d as wt,m as St,n as $e,G as ds,o as ms,S as Nt,q as fs,s as us,N as ps,v as hs,K as xs,w as yt}from"./index-ZiFjEqyT.js";import{E as nt}from"./error-boundary-BOBkDZ1Y.js";import{B as J,c as O}from"./button-Co_HOc3E.js";import{P as Ct,a as _t,b as kt}from"./popover-DW05feED.js";import{B as dt}from"./badge-BPKvq16e.js";import{i as Ue}from"./Check-D4dBNJmC.js";import{n as mt}from"./Inbox01-Bh5pMKE1.js";import{s as ft}from"./XClose-D9UXYoHK.js";import{i as gs}from"./File06-Dir7h2_j.js";import{i as ze}from"./X-D09jV0HO.js";import{u as Te}from"./use-mobile-Co7MtEW-.js";import{T as It,a as $t,b as zt,c as Ot}from"./tooltip-BJO9sFhZ.js";import{S as Tt,i as bs,u as js,C as E,a as ut,b as vs,c as ws,d as Ss,U as Ns,G as ys,M as Cs}from"./index-Bc30BcYv.js";import{u as ot,a as _s}from"./use-organization-settings-K7SU43aD.js";import{u as Ge,L as pt,P as ks,O as Is}from"./project-context-provider-BPo-49FO.js";import{n as $s,I as ht}from"./empty-state-B1DU5702.js";import{i as st}from"./use-gateway-v7etejE8.js";import{a as zs}from"./Home02-CR-W2ctm.js";import{C as Os}from"./create-organization-dialog-DQ5uy2r0.js";import{I as Ts}from"./input-DEsmZ6es.js";import{A as ee}from"./avatar-CrVRRbJ7.js";import{c as Ms}from"./Grid01-BgBQwtBY.js";import{D as As,a as Rs,b as Ps,c as Es,d as xt}from"./dropdown-menu-dsr_wyw0.js";import{a as Mt}from"./Copy01-Rf_P7R5F.js";import{n as gt}from"./LinkExternal01-D41WE0Cl.js";import{D as Ds,a as Ls,b as Bs,c as Hs,d as Us}from"./dialog-bW33A1d_.js";import{L as Gs}from"./form-ChO7tWCF.js";import{S as Fs}from"./switch-dZML6kqo.js";import{i as Ws}from"./Code01-CMazpegY.js";import{u as Fe,L as lt}from"./localstorage-keys-DhdYpXZj.js";import{u as Vs,a as Ks,b as Zs,c as Ys,N as qs,G as tt,T as Js,d as Xs,D as Qs}from"./use-model-state-B8hL-q1r.js";import{R as At,a as ea,b as ta}from"./resizable-BAPLF4RD.js";import{s as sa}from"./Plus-C4F6mby2.js";import{u as aa}from"./use-connection-BskZam-G.js";import"./SearchMd-B_A85eif.js";import"./use-create-gateway-CCmt4GT8.js";import"./AlertCircle-DlBo4Xw9.js";import"./ArrowUp-KvHCnFh3.js";import"./textarea-DFRypKCQ.js";import"./useMutation-4fnzP4bc.js";import"./Terminal-BWurH474.js";import"./monaco-editor-BYgR7J38.js";import"./spinner-DqooIng7.js";import"./alert-dialog-Df8ZsItX.js";import"./connection-CmMMEDBY.js";import"./select-CVEPeRAQ.js";import"./ChevronDown-CJaS1NVA.js";import"./Image01-B8cj-qoF.js";import"./use-collections-g067BPxP.js";import"./use-binding-C8KxuIY6.js";import"./binder-BtPpbY4I.js";import"./useQuery-Bn2Wcch_.js";import"./use-gateway-system-prompt-DoCpWoeh.js";import"./Edit01-MWKLkbpZ.js";import"./well-known-mcp-D13f-8h2.js";import"./generate-id-Dyweu44Y.js";import"./Clock-ljBuaWDA.js";import"./Trash01-GrzirNvV.js";const Rt=({size:t=24,color:e="currentColor",...s})=>S.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},S.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"}));Rt.displayName="BarChart10";const Pt=({size:t=24,color:e="currentColor",...s})=>S.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},S.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"}));Pt.displayName="Building02";const Et=({size:t=24,color:e="currentColor",...s})=>S.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},S.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"}));Et.displayName="Globe01";const Dt=({size:t=24,color:e="currentColor",...s})=>S.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},S.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"}));Dt.displayName="LayoutRight";const Lt=({size:t=24,color:e="currentColor",...s})=>S.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},S.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"}));Lt.displayName="LogOut01";const Bt=({size:t=24,color:e="currentColor",...s})=>S.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},S.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"}));Bt.displayName="Mail01";const rt=({size:t=24,color:e="currentColor",...s})=>S.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},S.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),S.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"}));rt.displayName="Settings01";const Ht=({size:t=24,color:e="currentColor",...s})=>S.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},S.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));Ht.displayName="Users01";const Ut=({size:t=24,color:e="currentColor",...s})=>S.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},S.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"}));Ut.displayName="Zap";function na({invitation:t,onStatusChange:e}){const[s,a]=S.useState(!1),[o,l]=S.useState(!1),r=Oe(),i=async()=>{a(!0);try{const u=await q.organization.acceptInvitation({invitationId:t.id});if(u.error)Y.error(u.error.message),a(!1);else{e(t.id,"accepted");const x=await q.organization.setActive({organizationId:t.organizationId});x?.data?.slug?(Y.success("Invitation accepted!"),r({to:"/$org",params:{org:x.data.slug}})):(Y.success("Invitation accepted! Redirecting..."),r({to:"/"}))}}catch{Y.error("Failed to accept invitation"),a(!1)}},c=async()=>{l(!0);try{const u=await q.organization.rejectInvitation({invitationId:t.id});u.error?(Y.error(u.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.inviter?.name||t.inviter?.email||t.email||"Someone",f=t.status==="pending",p=t.status==="accepted",b=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 ${f?"":"opacity-50"}`,children:[n.jsx("div",{className:"shrink-0 size-5 flex items-center justify-center",children:n.jsx(Bt,{size:16,className:"text-muted-foreground"})}),n.jsxs("p",{className:"flex-1 text-sm text-foreground min-w-0 whitespace-nowrap overflow-hidden",children:[n.jsx("span",{className:"font-semibold inline-block max-w-[120px] truncate align-bottom",children:m})," invited you to join ",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:f?n.jsxs(n.Fragment,{children:[n.jsx(J,{variant:"ghost",size:"icon",onClick:c,disabled:s||o,className:"h-8 w-8",children:n.jsx(ft,{size:14})}),n.jsx(J,{variant:"outline",size:"icon",onClick:i,disabled:s||o,className:"h-8 w-8",children:n.jsx(Ue,{size:14})})]}):p?n.jsxs(dt,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(Ue,{size:12}),"Accepted"]}):b?n.jsxs(dt,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(ft,{size:12}),"Declined"]}):null})]})}function oa(){const[t,e]=S.useState(!1),s=S.useContext(Xt),{data:a}=s.hooks.useListUserInvitations(),{data:o}=q.useListOrganizations(),[l,r]=S.useState({}),d=(a??[]).map(u=>{const x=(o??[]).find(g=>g.id===u.organizationId);return{...u,organizationSlug:x?.slug||u.organizationSlug,organizationName:x?.name||u.organizationName}}).map(u=>({...u,status:l[u.id]||u.status})),m=[...d].sort((u,x)=>{const g={pending:0,accepted:1,rejected:2};return(g[u.status]??999)-(g[x.status]??999)}),p=d.filter(u=>u.status==="pending").length>0,b=(u,x)=>{r(g=>({...g,[u]:x}))};return n.jsxs(Ct,{open:t,onOpenChange:e,children:[n.jsx(_t,{asChild:!0,children:n.jsxs(J,{variant:"ghost",size:"sm",className:"relative h-7 w-7 p-0","aria-label":"Inbox",children:[n.jsx(mt,{size:18,className:"text-muted-foreground"}),p&&n.jsx("span",{className:"absolute bottom-1 right-0.5 h-2 w-2 rounded-full bg-destructive ring-2 ring-background"})]})}),n.jsxs(kt,{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:m.length>0?m.map(u=>n.jsx(na,{invitation:u,onStatusChange:b},u.id)):n.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[n.jsx(mt,{size:32,className:"text-muted-foreground/40 mb-2"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"No invitations at the moment"})]})})]})]})}function la(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(Qt,{"data-slot":"sheet",...s}),e[2]=s,e[3]=a):a=e[3],a}function ra(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(as,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function ia(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 o;e[3]!==s?(o=O("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]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx(os,{"data-slot":"sheet-overlay",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function ca(t){const e=h.c(17);let s,a,o,l;e[0]!==t?({className:a,children:s,side:l,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l):(s=e[1],a=e[2],o=e[3],l=e[4]);const r=l===void 0?"right":l;let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ia,{}),e[5]=i):i=e[5];const c=r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",d=r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",m=r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",f=r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let p;e[6]!==a||e[7]!==c||e[8]!==d||e[9]!==m||e[10]!==f?(p=O("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",c,d,m,f,a),e[6]=a,e[7]=c,e[8]=d,e[9]=m,e[10]=f,e[11]=p):p=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs(ns,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[n.jsx(ze,{className:"size-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=b):b=e[12];let u;return e[13]!==s||e[14]!==o||e[15]!==p?(u=n.jsxs(ra,{children:[i,n.jsxs(ss,{"data-slot":"sheet-content",className:p,...o,children:[s,b]})]}),e[13]=s,e[14]=o,e[15]=p,e[16]=u):u=e[16],u}function da(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 o;e[3]!==s?(o=O("flex flex-col gap-1.5 p-4",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-slot":"sheet-header",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function ma(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 o;e[3]!==s?(o=O("text-foreground font-semibold",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx(es,{"data-slot":"sheet-title",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function fa(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 o;e[3]!==s?(o=O("text-muted-foreground text-sm",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx(ts,{"data-slot":"sheet-description",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}const ua="sidebar_state",pa=3600*24*7,ha="16rem",xa="18rem",ga="3rem",ba="b",Gt=S.createContext(null);function it(){const t=S.useContext(Gt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function ja(t){const e=h.c(21),{defaultOpen:s,open:a,onOpenChange:o,children:l}=t,r=s===void 0?!0:s,i=Te(),[c,d]=S.useState(!1),[m,f]=S.useState(r),p=a??m;let b;e[0]!==p||e[1]!==o?(b=_=>{const v=typeof _=="function"?_(p):_;o?o(v):f(v),document.cookie=`${ua}=${v}; path=/; max-age=${pa}`},e[0]=p,e[1]=o,e[2]=b):b=e[2];const u=b;let x;e[3]!==i||e[4]!==u?(x=()=>i?d(wa):u(va),e[3]=i,e[4]=u,e[5]=x):x=e[5];const g=x;let w,N;e[6]!==g?(w=()=>{const _=v=>{if(v.key===ba&&(v.metaKey||v.ctrlKey)){const z=v.target;if(z.tagName==="INPUT"||z.tagName==="TEXTAREA"||z.isContentEditable)return;v.preventDefault(),g()}};return globalThis.addEventListener("keydown",_),()=>globalThis.removeEventListener("keydown",_)},N=[g],e[6]=g,e[7]=w,e[8]=N):(w=e[7],N=e[8]),S.useEffect(w,N);const j=p?"expanded":"collapsed";let $;e[9]!==i||e[10]!==p||e[11]!==c||e[12]!==u||e[13]!==j||e[14]!==g?($={state:j,open:p,setOpen:u,isMobile:i,openMobile:c,setOpenMobile:d,toggleSidebar:g},e[9]=i,e[10]=p,e[11]=c,e[12]=u,e[13]=j,e[14]=g,e[15]=$):$=e[15];const C=$;let I;e[16]!==l?(I=n.jsx($t,{delayDuration:0,children:l}),e[16]=l,e[17]=I):I=e[17];let k;return e[18]!==C||e[19]!==I?(k=n.jsx(Gt.Provider,{value:C,children:I}),e[18]=C,e[19]=I,e[20]=k):k=e[20],k}function va(t){return!t}function wa(t){return!t}function Sa(t){const e=h.c(14);let s,a,o,l;e[0]!==t?({className:a,style:l,children:s,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l):(s=e[1],a=e[2],o=e[3],l=e[4]);let r;e[5]!==l?(r={"--sidebar-width":ha,"--sidebar-width-icon":ga,...l},e[5]=l,e[6]=r):r=e[6];const i=r;let c;e[7]!==a?(c=O("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]!==o||e[11]!==i||e[12]!==c?(d=n.jsx("div",{"data-slot":"sidebar-wrapper",style:i,className:c,...o,children:s}),e[9]=s,e[10]=o,e[11]=i,e[12]=c,e[13]=d):d=e[13],d}function Na(t){const e=h.c(46);let s,a,o,l,r,i;e[0]!==t?({side:l,variant:r,collapsible:i,className:a,children:s,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l,e[5]=r,e[6]=i):(s=e[1],a=e[2],o=e[3],l=e[4],r=e[5],i=e[6]);const c=l===void 0?"left":l,d=r===void 0?"sidebar":r,m=i===void 0?"offcanvas":i,{isMobile:f,state:p,openMobile:b,setOpenMobile:u}=it();if(m==="none"){let v;e[7]!==a?(v=O("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),e[7]=a,e[8]=v):v=e[8];let z;return e[9]!==s||e[10]!==o||e[11]!==v?(z=n.jsx("div",{"data-slot":"sidebar",className:v,...o,children:s}),e[9]=s,e[10]=o,e[11]=v,e[12]=z):z=e[12],z}if(f){let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v={"--sidebar-width":xa},e[13]=v):v=e[13];let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsxs(da,{className:"sr-only",children:[n.jsx(ma,{children:"Sidebar"}),n.jsx(fa,{children:"Displays the mobile sidebar."})]}),e[14]=z):z=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 M;e[17]!==c||e[18]!==T?(M=n.jsxs(ca,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:v,side:c,children:[z,T]}),e[17]=c,e[18]=T,e[19]=M):M=e[19];let A;return e[20]!==b||e[21]!==o||e[22]!==u||e[23]!==M?(A=n.jsx(la,{open:b,onOpenChange:u,...o,children:M}),e[20]=b,e[21]=o,e[22]=u,e[23]=M,e[24]=A):A=e[24],A}const x=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 w;e[25]!==g?(w=O("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]=w):w=e[26];let N;e[27]!==w?(N=n.jsx("div",{"data-slot":"sidebar-gap",className:w}),e[27]=w,e[28]=N):N=e[28];const j=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 C;e[29]!==a||e[30]!==j||e[31]!==$?(C=O("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",j,$,a),e[29]=a,e[30]=j,e[31]=$,e[32]=C):C=e[32];let I;e[33]!==s?(I=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]=I):I=e[34];let k;e[35]!==o||e[36]!==C||e[37]!==I?(k=n.jsx("div",{"data-slot":"sidebar-container",className:C,...o,children:I}),e[35]=o,e[36]=C,e[37]=I,e[38]=k):k=e[38];let _;return e[39]!==c||e[40]!==p||e[41]!==k||e[42]!==x||e[43]!==N||e[44]!==d?(_=n.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":p,"data-collapsible":x,"data-variant":d,"data-side":c,"data-slot":"sidebar",children:[N,k]}),e[39]=c,e[40]=p,e[41]=k,e[42]=x,e[43]=N,e[44]=d,e[45]=_):_=e[45],_}function ya(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 o;e[3]!==s?(o=O("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]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("main",{"data-slot":"sidebar-inset",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function Ca(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 o;e[3]!==s?(o=O("h-4 m-0! w-full",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-sidebar":"separator",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function _a(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 o;e[3]!==s?(o=O("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function ka(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 o;e[3]!==s?(o=O("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function Ia(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 o;e[3]!==s?(o=O("w-full text-sm",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function $a(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 o;e[3]!==s?(o=O("flex w-full min-w-0 flex-col gap-1",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function We(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 o;e[3]!==s?(o=O("group/menu-item relative",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}const za=ls("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 Ft(t){const e=h.c(28);let s,a,o,l,r,i,c;e[0]!==t?({asChild:o,isActive:l,variant:r,size:i,tooltip:c,className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l,e[5]=r,e[6]=i,e[7]=c):(s=e[1],a=e[2],o=e[3],l=e[4],r=e[5],i=e[6],c=e[7]);const d=o===void 0?!1:o,m=l===void 0?!1:l,f=r===void 0?"default":r,p=i===void 0?"default":i,b=d?rs:"button",{isMobile:u,state:x}=it();let g;e[8]!==s||e[9]!==p||e[10]!==f?(g=O(za({variant:f,size:p}),s),e[8]=s,e[9]=p,e[10]=f,e[11]=g):g=e[11];let w;e[12]!==b||e[13]!==m||e[14]!==a||e[15]!==p||e[16]!==g?(w=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]=w):w=e[17];const N=w;if(!c)return N;if(typeof c=="string"){let k;e[18]!==c?(k={children:c},e[18]=c,e[19]=k):k=e[19],c=k}let j;e[20]!==N?(j=n.jsx(zt,{asChild:!0,children:N}),e[20]=N,e[21]=j):j=e[21];const $=x!=="collapsed"||u;let C;e[22]!==$||e[23]!==c?(C=n.jsx(It,{side:"right",align:"center",hidden:$,...c}),e[22]=$,e[23]=c,e[24]=C):C=e[24];let I;return e[25]!==j||e[26]!==C?(I=n.jsxs(Ot,{children:[j,C]}),e[25]=j,e[26]=C,e[27]=I):I=e[27],I}function Oa(t){const e=h.c(26),{item:s}=t,a=Oe(),{org:o}=Ge(),l=ot(o.id),r=_s(o.id);let i;e[0]!==r.update||e[1]!==s.url||e[2]!==l?.sidebar_items?(i=async()=>{const $=(l?.sidebar_items||[]).filter(C=>C.url!==s.url);await r.update.mutateAsync({sidebar_items:$})},e[0]=r.update,e[1]=s.url,e[2]=l?.sidebar_items,e[3]=i):i=e[3];const c=i;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=/^https?:\/\/.+/,e[4]=d):d=e[4];let m;e[5]!==s.icon?(m=d.test(s.icon),e[5]=s.icon,e[6]=m):m=e[6];const f=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 u;e[10]!==f||e[11]!==s.icon||e[12]!==s.title?(u=n.jsx("div",{className:"flex items-center justify-center shrink-0",children:f?n.jsx("img",{src:s.icon,alt:s.title,className:"h-4 w-4 rounded object-cover"}):n.jsx(gs,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=f,e[11]=s.icon,e[12]=s.title,e[13]=u):u=e[13];let x;e[14]!==s.title?(x=s.title.toLocaleLowerCase(),e[14]=s.title,e[15]=x):x=e[15];let g;e[16]!==x?(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:x})}),e[16]=x,e[17]=g):g=e[17];let w;e[18]!==c?(w=n.jsx(ze,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:j=>{j.preventDefault(),j.stopPropagation(),c()}}),e[18]=c,e[19]=w):w=e[19];let N;return e[20]!==s.title||e[21]!==p||e[22]!==u||e[23]!==g||e[24]!==w?(N=n.jsx(We,{children:n.jsxs(Ft,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:p,tooltip:b,children:[u,g,w]})}),e[20]=s.title,e[21]=p,e[22]=u,e[23]=g,e[24]=w,e[25]=N):N=e[25],N}function Ta(){const t=h.c(4),{org:e}=Ge(),a=ot(e.id)?.sidebar_items;if(!a?.length)return null;let o;t[0]!==a?(o=a.map(Ma),t[0]=a,t[1]=o):o=t[1];let l;return t[2]!==o?(l=n.jsx(Wt,{children:o}),t[2]=o,t[3]=l):l=t[3],l}function Ma(t){return n.jsx(Oa,{item:t},t.url)}function bt(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(We,{children:n.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:n.jsx(Tt,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function Wt(t){const e=h.c(4),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ca,{className:"my-2 -ml-1"}),e[0]=a):a=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(We,{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]=o):o=e[1];let l;return e[2]!==s?(l=n.jsxs(n.Fragment,{children:[a,o,s]}),e[2]=s,e[3]=l):l=e[3],l}function Aa(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(S.Suspense,{fallback:n.jsxs(Wt,{children:[n.jsx(bt,{}),n.jsx(bt,{})]}),children:n.jsx(Ta,{})}),t[0]=e):e=t[0],e}function Ra(){const t=h.c(14),{locator:e,org:s}=Ge(),a=Oe(),o=vt(),{org:l}=pt.parse(e);let r;t[0]!==e?(r=pt.isOrgAdminProject(e),t[0]=e,t[1]=r):r=t[1];const i=r,c=ot(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 f;t[4]!==m?(f=k=>m.includes(k.pluginId),t[4]=m,t[5]=f):f=t[5];const p=is.filter(f),b=o.location.pathname===`/${l}`||o.location.pathname===`/${l}/`;let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(zs,{}),t[6]=u):u=t[6];let x;t[7]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Pt,{}),t[7]=x):x=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx($s,{}),t[8]=g):g=t[8];let w;t[9]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(st,{}),t[9]=w):w=t[9];let N;t[10]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Ut,{}),t[10]=N):N=t[10];let j;t[11]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Rt,{}),t[11]=j):j=t[11];let $;t[12]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(Ht,{}),t[12]=$):$=t[12];let C;t[13]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(rt,{}),t[13]=C):C=t[13];const I=[{key:"home",label:"Home",icon:u,onClick:()=>{b?window.dispatchEvent(new CustomEvent("reset-home-view")):a({to:"/$org",params:{org:l}})}},{key:"store",label:"Store",icon:x,onClick:()=>a({to:"/$org/store",params:{org:l}})},...p.map(k=>({key:k.pluginId,label:k.label,icon:k.icon,onClick:()=>a({to:"/$org/$pluginId",params:{org:l,pluginId:k.pluginId}})})),{key:"mcps",label:"Connections",icon:g,onClick:()=>a({to:"/$org/mcps",params:{org:l}})},{key:"gateways",label:"Agents",icon:w,onClick:()=>a({to:"/$org/gateways",params:{org:l}})},{key:"workflow",label:"Workflows",icon:N,onClick:()=>a({to:"/$org/workflows",params:{org:l}})},{key:"monitoring",label:"Monitoring",icon:j,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:C,onClick:()=>a({to:"/$org/settings",params:{org:l}})}];return i?I:[]}function Vt(t){const e=h.c(10),{navigationItems:s,footer:a,additionalContent:o,variant:l,collapsible:r}=t,i=l===void 0?"sidebar":l,c=r===void 0?"icon":r;let d;e[0]!==s?(d=s.map(Pa),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==o||e[3]!==d?(m=n.jsx(_a,{className:"flex-1 overflow-x-hidden",children:n.jsx(ka,{className:"font-medium",children:n.jsx(Ia,{children:n.jsxs($a,{className:"gap-0.5",children:[d,o]})})})}),e[2]=o,e[3]=d,e[4]=m):m=e[4];let f;return e[5]!==c||e[6]!==a||e[7]!==m||e[8]!==i?(f=n.jsxs(Na,{variant:i,collapsible:c,children:[m,a]}),e[5]=c,e[6]=a,e[7]=m,e[8]=i,e[9]=f):f=e[9],f}function Pa(t){return n.jsx(We,{children:n.jsxs(Ft,{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)}Vt.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(Tt,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function Ea(){const t=h.c(3),e=Ra();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(n.Fragment,{children:n.jsx(nt,{children:n.jsx(S.Suspense,{fallback:null,children:n.jsx(Aa,{})})})}),t[0]=s):s=t[0];let a;return t[1]!==e?(a=n.jsx(Vt,{navigationItems:e,additionalContent:s}),t[1]=e,t[2]=a):a=t[2],a}function Da(t){const e=h.c(12);let s,a,o,l;e[0]!==t?({className:s,orientation:o,decorative:l,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l):(s=e[1],a=e[2],o=e[3],l=e[4]);const r=o===void 0?"horizontal":o,i=l===void 0?!0:l;let c;e[5]!==s?(c=O("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]!==i||e[8]!==r||e[9]!==a||e[10]!==c?(d=n.jsx(cs,{"data-slot":"separator-root",decorative:i,orientation:r,className:c,...a}),e[7]=i,e[8]=r,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}const Kt=S.createContext(null);function La(){const t=S.useContext(Kt);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function Ba(t){const e=h.c(10),{children:s,onItemHover:a}=t,[o,l]=S.useState(null);let r;e[0]!==a?(r=f=>{l(f),a?.(f)},e[0]=a,e[1]=r):r=e[1];const i=r;let c;e[2]!==o||e[3]!==i?(c={hoveredItem:o,setHoveredItem:i},e[2]=o,e[3]=i,e[4]=c):c=e[4];let d;e[5]!==s?(d=n.jsx(Ct,{children:s}),e[5]=s,e[6]=d):d=e[6];let m;return e[7]!==c||e[8]!==d?(m=n.jsx(Kt.Provider,{value:c,children:d}),e[7]=c,e[8]=d,e[9]=m):m=e[9],m}function Ha(t){const e=h.c(6),{children:s,onClick:a}=t;let o;e[0]!==s||e[1]!==a?(o=n.jsx(J,{variant:"link",className:"p-0.5 h-auto",onClick:a,type:"button",children:s}),e[0]=s,e[1]=a,e[2]=o):o=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(_t,{asChild:!0,children:n.jsx(J,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:n.jsx(bs,{size:16,className:"opacity-50"})})}),e[3]=l):l=e[3];let r;return e[4]!==o?(r=n.jsxs("div",{className:"flex items-center gap-1",children:[o,l]}),e[4]=o,e[5]=r):r=e[5],r}function Ua(t){const e=h.c(8),{item:s,fallback:a}=t,o=a===void 0?"":a,l=s?.avatarUrl??"",r=s?.name??o;let i;e[0]!==l||e[1]!==r?(i=n.jsx(ee,{url:l,fallback:r,size:"xs",objectFit:"contain"}),e[0]=l,e[1]=r,e[2]=i):i=e[2];const c=s?.name??o;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]!==i||e[6]!==d?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[i,d]}),e[5]=i,e[6]=d,e[7]=m):m=e[7],m}function Ga(t){const e=h.c(6),{children:s,align:a}=t,o=a===void 0?"start":a,r=S.Children.toArray(s).filter(Fa).length===1?"280px":"480px";let i;e[0]!==r?(i={width:r},e[0]=r,e[1]=i):i=e[1];let c;return e[2]!==o||e[3]!==s||e[4]!==i?(c=n.jsx(kt,{align:o,className:"p-0 flex items-start",style:i,children:s}),e[2]=o,e[3]=s,e[4]=i,e[5]=c):c=e[5],c}function Fa(t){return S.isValidElement(t)&&(t.type===Yt||t.type===Zt)}function Zt(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=O("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",a),e[0]=a,e[1]=o):o=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}const Yt=Zt;function Wa(t){const e=h.c(6),{placeholder:s,value:a,onChange:o}=t,l=s===void 0?"Search...":s;let r;e[0]!==o?(r=c=>o(c.target.value),e[0]=o,e[1]=r):r=e[1];let i;return e[2]!==l||e[3]!==r||e[4]!==a?(i=n.jsx(Ts,{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]=i):i=e[5],i}function Va(t){const e=h.c(6),{children:s,emptyMessage:a}=t,o=a===void 0?"No items found.":a,l=S.Children.count(s)>0;let r;e[0]!==o||e[1]!==l?(r=!l&&n.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:o}),e[0]=o,e[1]=l,e[2]=r):r=e[2];let i;return e[3]!==s||e[4]!==r?(i=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]=i):i=e[5],i}function Ka(t){const e=h.c(15),{item:s,onClick:a,onHover:o,children:l}=t,r=La();let i;e[0]!==r||e[1]!==s||e[2]!==o?(i=()=>{r.setHoveredItem(s.slug),o?.(s)},e[0]=r,e[1]=s,e[2]=o,e[3]=i):i=e[3];const c=i;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(ee,{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 f;return e[11]!==c||e[12]!==d||e[13]!==m?(f=n.jsx(J,{onClick:d,onMouseEnter:c,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:m}),e[11]=c,e[12]=d,e[13]=m,e[14]=f):f=e[14],f}function Za(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 Ya(t){const e=h.c(11),{onClick:s,icon:a,children:o,variant:l}=t,i=(l===void 0?"default":l)==="muted"&&"text-muted-foreground";let c;e[0]!==i?(c=O("w-full justify-start font-normal",i),e[0]=i,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]!==o?(m=n.jsx("span",{children:o}),e[4]=o,e[5]=m):m=e[5];let f;return e[6]!==s||e[7]!==c||e[8]!==d||e[9]!==m?(f=n.jsxs(J,{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]=f):f=e[10],f}function qa(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Da,{}),t[0]=e):e=t[0],e}function Ja(){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 B=Object.assign(Ba,{Trigger:Ha,CurrentItem:Ua,Content:Ga,Panel:Yt,Search:Wa,Items:Va,Item:Ka,Actions:Za,Action:Ya,Separator:qa,Skeleton:Ja});function at(){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}=wt(e),{data:a}=q.useListOrganizations(),o=Oe();let l;t[1]!==s||t[2]!==a?(l=a?.find(y=>y.slug===s),t[1]=s,t[2]=a,t[3]=l):l=t[3];const r=l,[i,c]=S.useState(""),[d,m]=S.useState(!1);let f,p,b,u,x,g,w,N;if(t[4]!==r||t[5]!==o||t[6]!==s||t[7]!==i||t[8]!==a){const P=(a?(()=>{const H=a.filter(F=>F.name.toLowerCase().includes(i.toLowerCase()));if(s){const F=H.findIndex(V=>V.slug===s);if(F>0){const V=H[F];V&&(H.splice(F,1),H.unshift(V))}}return H})():[]).map(Xa);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 G=R;u=B;let D;t[19]!==o||t[20]!==s?(D=()=>o({to:"/$org",params:{org:s??""}}),t[19]=o,t[20]=s,t[21]=D):D=t[21];let W;t[22]!==G?(W=n.jsx(B.CurrentItem,{item:G}),t[22]=G,t[23]=W):W=t[23],t[24]!==D||t[25]!==W?(N=n.jsx(B.Trigger,{onClick:D,children:W}),t[24]=D,t[25]=W,t[26]=N):N=t[26],b=B.Content,p=B.Panel,t[27]!==i?(w=n.jsx(B.Search,{placeholder:"Search organizations...",value:i,onChange:c}),t[27]=i,t[28]=w):w=t[28],f=B.Items,x="No organizations found.";let X;t[29]!==o?(X=H=>n.jsx(B.Item,{item:H,onClick:F=>o({to:"/$org",params:{org:F.slug}})},H.slug),t[29]=o,t[30]=X):X=t[30],g=P.map(X),t[4]=r,t[5]=o,t[6]=s,t[7]=i,t[8]=a,t[9]=f,t[10]=p,t[11]=b,t[12]=u,t[13]=x,t[14]=g,t[15]=w,t[16]=N}else f=t[9],p=t[10],b=t[11],u=t[12],x=t[13],g=t[14],w=t[15],N=t[16];let j;t[31]!==f||t[32]!==x||t[33]!==g?(j=n.jsx(f,{emptyMessage:x,children:g}),t[31]=f,t[32]=x,t[33]=g,t[34]=j):j=t[34];let $,C;t[35]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(B.Actions,{children:n.jsx(B.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),C=n.jsx(B.Separator,{}),t[35]=$,t[36]=C):($=t[35],C=t[36]);let I;t[37]!==o?(I=()=>o({to:"/"}),t[37]=o,t[38]=I):I=t[38];let k;t[39]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(Ms,{}),t[39]=k):k=t[39];let _;t[40]!==I?(_=n.jsx(B.Actions,{children:n.jsx(B.Action,{onClick:I,icon:k,children:"See all organizations"})}),t[40]=I,t[41]=_):_=t[41];let v;t[42]!==p||t[43]!==_||t[44]!==w||t[45]!==j?(v=n.jsxs(p,{children:[w,j,$,C,_]}),t[42]=p,t[43]=_,t[44]=w,t[45]=j,t[46]=v):v=t[46];let z;t[47]!==b||t[48]!==v?(z=n.jsx(b,{children:v}),t[47]=b,t[48]=v,t[49]=z):z=t[49];let T;t[50]!==u||t[51]!==z||t[52]!==N?(T=n.jsxs(u,{children:[N,z]}),t[50]=u,t[51]=z,t[52]=N,t[53]=T):T=t[53];let M;t[54]!==d?(M=n.jsx(Os,{open:d,onOpenChange:m}),t[54]=d,t[55]=M):M=t[55];let A;return t[56]!==T||t[57]!==M?(A=n.jsxs(n.Fragment,{children:[T,M]}),t[56]=T,t[57]=M,t[58]=A):A=t[58],A}function Xa(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}at.Skeleton=B.Skeleton;function Qa({prop:t,defaultProp:e,onChange:s=()=>{}}){const[a,o]=en({defaultProp:e,onChange:s}),l=t!==void 0,r=l?t:a,i=St(s),c=S.useCallback(d=>{if(l){const f=typeof d=="function"?d(t):d;f!==t&&i(f)}else o(d)},[l,t,o,i]);return[r,c]}function en({defaultProp:t,onChange:e}){const s=S.useState(t),[a]=s,o=S.useRef(a),l=St(e);return S.useEffect(()=>{o.current!==a&&(l(a),o.current=a)},[a,o,l]),s}function tn(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($e.Root,{"data-slot":"drawer",...s}),e[2]=s,e[3]=a):a=e[3],a}function sn(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($e.Trigger,{"data-slot":"drawer-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function an(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($e.Portal,{"data-slot":"drawer-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function nn(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 o;e[3]!==s?(o=O("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]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx($e.Overlay,{"data-slot":"drawer-overlay",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function on(t){const e=h.c(12);let s,a,o;e[0]!==t?({className:a,children:s,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o):(s=e[1],a=e[2],o=e[3]);let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(nn,{}),e[4]=l):l=e[4];let r;e[5]!==a?(r=O("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 i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=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]=i):i=e[7];let c;return e[8]!==s||e[9]!==o||e[10]!==r?(c=n.jsxs(an,{"data-slot":"drawer-portal",children:[l,n.jsxs($e.Content,{"data-slot":"drawer-content",className:r,...o,children:[i,s]})]}),e[8]=s,e[9]=o,e[10]=r,e[11]=c):c=e[11],c}function ln(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 o;e[3]!==s?(o=O("flex flex-col gap-1.5 px-4 py-2",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-slot":"drawer-header",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function rn(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 o;e[3]!==s?(o=O("text-foreground font-semibold",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx($e.Title,{"data-slot":"drawer-title",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}const qt=S.createContext({setOpen:()=>{}}),cn=()=>S.useContext(qt),dn=t=>{const e=h.c(25);let s,a,o,l,r;e[0]!==t?({children:s,defaultOpen:a,open:l,onOpenChange:o,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l,e[5]=r):(s=e[1],a=e[2],o=e[3],l=e[4],r=e[5]);const i=a??!1;let c;e[6]!==o||e[7]!==l||e[8]!==i?(c={prop:l,defaultProp:i,onChange:o},e[6]=o,e[7]=l,e[8]=i,e[9]=c):c=e[9];const[d,m]=Qa(c);let f;e[10]!==m?(f={setOpen:m},e[10]=m,e[11]=f):f=e[11];let p;e[12]!==s||e[13]!==d||e[14]!==r||e[15]!==m?(p=n.jsx(tn,{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(Ps,{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 u;return e[22]!==f||e[23]!==b?(u=n.jsx(qt.Provider,{value:f,children:b}),e[22]=f,e[23]=b,e[24]=u):u=e[24],u},mn=t=>{const{children:e,title:s,...a}=t,o=Te(),{className:l,...r}=a;return o?n.jsxs(on,{...r,children:[n.jsx(ln,{className:"hidden",children:n.jsx(rn,{children:s})}),n.jsx("div",{className:O("flex flex-col gap-2 p-2 py-4",l),children:e})]}):n.jsx(Rs,{...a,children:e})},fn=t=>{const{children:e,...s}=t,{setOpen:a}=cn(),o=Te(),{className:l,...r}=s;return o?n.jsx("div",{...r,onClick:i=>{a(!1);const{onClick:c}=r;c?.(i)},className:O("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(Es,{...s,children:e})},un=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 o=Te();let l;return e[3]!==s||e[4]!==o||e[5]!==a?(l=o?n.jsx(sn,{asChild:!0,children:s}):n.jsx(As,{...a,children:s}),e[3]=s,e[4]=o,e[5]=a,e[6]=l):l=e[6],l},pn=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 o=Te();let l;return e[3]!==s||e[4]!==o||e[5]!==a?(l=o?n.jsx(xt,{className:O(s),...a}):n.jsx(xt,{className:O(s),...a}),e[3]=s,e[4]=o,e[5]=a,e[6]=l):l=e[6],l};function hn(t){const e=h.c(11),{user:s,trigger:a,align:o,children:l}=t,r=o===void 0?"start":o;let i;e[0]!==a||e[1]!==s?(i=a(s),e[0]=a,e[1]=s,e[2]=i):i=e[2];let c;e[3]!==i?(c=n.jsx(un,{asChild:!0,children:n.jsx("div",{children:i})}),e[3]=i,e[4]=c):c=e[4];let d;e[5]!==r||e[6]!==l?(d=n.jsx(mn,{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(dn,{children:[c,d]}),e[8]=c,e[9]=d,e[10]=m):m=e[10],m}function xn(t){const e=h.c(8),{children:s,onClick:a,className:o,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 i;return e[4]!==l||e[5]!==o||e[6]!==r?(i=n.jsx(fn,{asChild:l,className:o,children:r}),e[4]=l,e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function gn(t){const e=h.c(2),{className:s}=t;let a;return e[0]!==s?(a=n.jsx(pn,{className:s}),e[0]=s,e[1]=a):a=e[1],a}function bn(){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 Z=Object.assign(hn,{Item:xn,Separator:gn,Skeleton:bn});function jn(t){const e=h.c(48),{open:s,onOpenChange:a,user:o,userImage:l}=t,[r,i]=js(),[c,d]=S.useState(!1);let m;e[0]!==o.id?(m=()=>{navigator.clipboard.writeText(o.id),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=o.id,e[1]=m):m=e[1];const f=m;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Ds,{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(Ls,{className:"px-6 pt-6 pb-4 border-b border-border shrink-0 relative",children:[p,n.jsxs(Bs,{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(ze,{size:16}),n.jsx("span",{className:"sr-only",children:"Close"})]})]}),e[3]=b):b=e[3];const u=o.name||"U";let x;e[4]!==u||e[5]!==l?(x=n.jsx(ee,{url:l,fallback:u,shape:"circle",size:"xl",className:"h-16 w-16"}),e[4]=u,e[5]=l,e[6]=x):x=e[6];const g=o.name||"User";let w;e[7]!==g?(w=n.jsx("span",{className:"text-base font-medium text-foreground",children:g}),e[7]=g,e[8]=w):w=e[8];let N;e[9]!==o.email?(N=n.jsx("span",{className:"text-sm text-muted-foreground",children:o.email}),e[9]=o.email,e[10]=N):N=e[10];let j;e[11]!==w||e[12]!==N?(j=n.jsxs("div",{className:"flex flex-col gap-1",children:[w,N]}),e[11]=w,e[12]=N,e[13]=j):j=e[13];let $;e[14]!==x||e[15]!==j?($=n.jsxs("div",{className:"flex items-center gap-4",children:[x,j]}),e[14]=x,e[15]=j,e[16]=$):$=e[16];let C;e[17]!==r||e[18]!==i?(C=()=>i(!r),e[17]=r,e[18]=i,e[19]=C):C=e[19];let I;e[20]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[n.jsxs(Gs,{className:"text-sm font-medium text-foreground flex items-center gap-2 pointer-events-none",children:[n.jsx(Ws,{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]=I):I=e[20];let k;e[21]!==r||e[22]!==i?(k=n.jsx("div",{onClick:vn,children:n.jsx(Fs,{checked:r,onCheckedChange:i})}),e[21]=r,e[22]=i,e[23]=k):k=e[23];let _;e[24]!==C||e[25]!==k?(_=n.jsxs("button",{type:"button",onClick:C,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:[I,k]}),e[24]=C,e[25]=k,e[26]=_):_=e[26];let v;e[27]!==$||e[28]!==_?(v=n.jsxs("div",{className:"p-5 space-y-6 min-h-[225px]",children:[$,_]}),e[27]=$,e[28]=_,e[29]=v):v=e[29];let z;e[30]!==o.id?(z=n.jsx("span",{className:"font-mono text-xs",children:o.id}),e[30]=o.id,e[31]=z):z=e[31];let T;e[32]!==c?(T=c?n.jsx(Ue,{size:14,className:"text-green-600"}):n.jsx(Mt,{size:14,className:"opacity-0 group-hover:opacity-100 transition-opacity"}),e[32]=c,e[33]=T):T=e[33];let M;e[34]!==f||e[35]!==z||e[36]!==T?(M=n.jsx(zt,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:f,className:"group flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[z,T]})}),e[34]=f,e[35]=z,e[36]=T,e[37]=M):M=e[37];let A;e[38]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(It,{side:"top",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[38]=A):A=e[38];let y;e[39]!==M?(y=n.jsx("div",{className:"border-t border-border px-5 py-4 flex items-center shrink-0",children:n.jsx($t,{children:n.jsxs(Ot,{children:[M,A]})})}),e[39]=M,e[40]=y):y=e[40];let P;e[41]!==v||e[42]!==y?(P=n.jsxs(Hs,{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:[v,y]})]}),e[41]=v,e[42]=y,e[43]=P):P=e[43];let R;return e[44]!==a||e[45]!==s||e[46]!==P?(R=n.jsx(Us,{open:s,onOpenChange:a,children:P}),e[44]=a,e[45]=s,e[46]=P,e[47]=R):R=e[47],R}function vn(t){return t.stopPropagation()}function wn(t){const e=h.c(47),{user:s,userImage:a}=t,[o,l]=S.useState(!1),[r,i]=S.useState(!1);let c;e[0]!==s.email||e[1]!==s.id||e[2]!==s.name?(c=()=>{const R=`ID: ${s.id}
|
|
2
2
|
Name: ${s.name||"N/A"}
|
|
3
3
|
Email: ${s.email}`;navigator.clipboard.writeText(R),i(!0),Y.success("User info copied to clipboard"),setTimeout(()=>i(!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(ee,{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 f=s.name||s.email||"U";let p;e[8]!==f||e[9]!==a?(p=n.jsx(ee,{url:a,fallback:f,shape:"circle",size:"sm"}),e[8]=f,e[9]=a,e[10]=p):p=e[10];const b=s.name||"User";let u;e[11]!==b?(u=n.jsx("div",{className:"text-sm font-medium truncate",children:b}),e[11]=b,e[12]=u):u=e[12];let x;e[13]!==s.email?(x=n.jsx("div",{className:"text-xs text-muted-foreground truncate",children:s.email}),e[13]=s.email,e[14]=x):x=e[14];let g;e[15]!==u||e[16]!==x?(g=n.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[u,x]}),e[15]=u,e[16]=x,e[17]=g):g=e[17];let w;e[18]!==r?(w=n.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:r?n.jsx(Ue,{size:16,className:"text-green-600"}):n.jsx(Mt,{size:16,className:"text-muted-foreground"})}),e[18]=r,e[19]=w):w=e[19];let N;e[20]!==p||e[21]!==g||e[22]!==w?(N=n.jsxs("div",{className:"group flex items-center gap-3 w-full py-1",children:[p,g,w]}),e[20]=p,e[21]=g,e[22]=w,e[23]=N):N=e[23];let j;e[24]!==d||e[25]!==N?(j=n.jsx(Z.Item,{onClick:d,children:N}),e[24]=d,e[25]=N,e[26]=j):j=e[26];let $;e[27]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(Z.Separator,{}),e[27]=$):$=e[27];let C,I;e[28]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsxs(Z.Item,{onClick:()=>l(!0),children:[n.jsx(rt,{className:"text-muted-foreground",size:18}),"Profile Settings"]}),I=n.jsx(Z.Separator,{}),e[28]=C,e[29]=I):(C=e[28],I=e[29]);let k;e[30]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(ds,{className:"w-4 h-4 text-muted-foreground"}),e[30]=k):k=e[30];let _;e[31]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(Z.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:[k,"decocms/admin",n.jsx(gt,{size:18,className:"text-muted-foreground ml-auto"})]})}),e[31]=_):_=e[31];let v;e[32]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Et,{className:"text-muted-foreground",size:18}),e[32]=v):v=e[32];let z,T;e[33]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(Z.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:[v,"Homepage",n.jsx(gt,{size:18,className:"ml-auto text-muted-foreground"})]})}),T=n.jsx(Z.Separator,{}),e[33]=z,e[34]=T):(z=e[33],T=e[34]);let M;e[35]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsxs(Z.Item,{onClick:Sn,children:[n.jsx(Lt,{size:18,className:"text-muted-foreground"}),"Log out"]}),e[35]=M):M=e[35];let A;e[36]!==j||e[37]!==m||e[38]!==s?(A=n.jsxs(Z,{user:s,trigger:m,align:"end",children:[j,$,C,I,_,z,T,M]}),e[36]=j,e[37]=m,e[38]=s,e[39]=A):A=e[39];let y;e[40]!==o||e[41]!==s||e[42]!==a?(y=o&&n.jsx(jn,{open:o,onOpenChange:l,user:s,userImage:a}),e[40]=o,e[41]=s,e[42]=a,e[43]=y):y=e[43];let P;return e[44]!==A||e[45]!==y?(P=n.jsxs(n.Fragment,{children:[A,y]}),e[44]=A,e[45]=y,e[46]=P):P=e[46],P}function Sn(){return q.signOut()}function Nn(){const t=h.c(7),{data:e}=q.useSession();if(!e?.user){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ee,{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 o;t[1]!==a||t[2]!==s?(o={...s,name:a},t[1]=a,t[2]=s,t[3]=o):o=t[3];const l=o,r=s.image;let i;return t[4]!==r||t[5]!==l?(i=n.jsx(wn,{user:l,userImage:r}),t[4]=r,t[5]=l,t[6]=i):i=t[6],i}function ct(){const t=h.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=lt.decoChatOpen(),t[0]=e):e=t[0];const[s,a]=Fe(e,yn);let o;return t[1]!==s||t[2]!==a?(o=[s,a],t[1]=s,t[2]=a,t[3]=o):o=t[3],o}function yn(t){return!!(t??!1)}function Cn(t){const e=h.c(6),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(ms,{children:n.jsx(Nt,{})}),e[0]=a):a=e[0];let o;e[1]!==s?(o=n.jsx(fs,{children:s}),e[1]=s,e[2]=o):o=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(us,{children:n.jsx(ps,{to:"/login",replace:!0})}),e[3]=l):l=e[3];let r;return e[4]!==o?(r=n.jsxs(n.Fragment,{children:[a,o,l]}),e[4]=o,e[5]=r):r=e[5],r}function _n(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=O("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]=o):o=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}function kn(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=O("flex items-center justify-center px-2.5 h-full border-r border-border",a),e[0]=a,e[1]=o):o=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}function In(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=O("flex items-center gap-2 px-2 h-full",a),e[0]=a,e[1]=o):o=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}function $n(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=O("flex items-center gap-2 px-2 h-full flex-1",a),e[0]=a,e[1]=o):o=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}function zn(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=O("flex items-center gap-2 px-2 h-full ml-auto",a),e[0]=a,e[1]=o):o=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}function On(){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 He=Object.assign(_n,{Sidebar:kn,Left:In,Center:$n,Right:zn,Skeleton:On});function Jt(){const t=h.c(3),{toggleSidebar:e}=it();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Dt,{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(J,{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}Jt.Skeleton=function(){return n.jsx("div",{className:"w-7 h-7 bg-muted rounded-md animate-pulse"})};const Tn="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function Mn(){const t=h.c(143),{org:e,locator:s}=Ge(),{slug:a,id:o}=e,[,l]=ct(),r=Oe(),{data:i}=q.useSession(),c=i?.user,{createThread:d,activeThreadId:m,setActiveThreadId:f,hideThread:p}=ut(),{threads:b,refetch:u}=vs(),x=ws(),g=aa(),w=Ss(),N=w.length>0,[j,$]=Vs(s,w),[C,I]=Fe(`${s}:selected-gateway-id`,null);let k;t[0]!==x||t[1]!==C?(k=C?x.find(L=>L.id===C)??null:null,t[0]=x,t[1]=C,t[2]=k):k=t[2];const _=k,v=_?.id??null,z=Ks(v),T=Zs(),M=v??void 0;let A;t[3]!==m||t[4]!==z||t[5]!==T||t[6]!==M?(A={threadId:m,systemPrompt:z,onToolCall:T,gatewayId:M},t[3]=m,t[4]=z,t[5]=T,t[6]=M,t[7]=A):A=t[7];const y=Ys(A),{inputValue:P,setInputValue:R,branchContext:G,clearBranch:D}=ut(),{isEmpty:W}=y,X=!v;let H;t[8]!==G||t[9]!==D||t[10]!==f||t[11]!==R?(H=()=>{G&&(f(G.originalThreadId),D(),R(""))},t[8]=G,t[9]=D,t[10]=f,t[11]=R,t[12]=H):H=t[12];const F=H;let V;t[13]!==m||t[14]!==y||t[15]!==D||t[16]!==v||t[17]!==j||t[18]!==R||t[19]!==c?.image||t[20]!==c?.name?(V=async L=>{if(!j){Y.error("No model configured");return}R(""),D();const Q={created_at:new Date().toISOString(),thread_id:m,model:{id:j.id,connectionId:j.connectionId,provider:j.provider??void 0,limits:j.limits??void 0},gateway:{id:v},user:{avatar:c?.image??void 0,name:c?.name??"you"}};await y.sendMessage(L,Q)},t[13]=m,t[14]=y,t[15]=D,t[16]=v,t[17]=j,t[18]=R,t[19]=c?.image,t[20]=c?.name,t[21]=V):V=t[21];const U=V;let Me;t[22]!==$?(Me=L=>{$(L)},t[22]=$,t[23]=Me):Me=t[23];const Ve=Me;let Ae;t[24]!==I?(Ae=L=>{I(L)},t[24]=I,t[25]=Ae):Ae=t[25];const te=Ae,K=y.status==="submitted"||y.status==="streaming";if(!N){let L;t[26]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsxs(E.Header.Left,{children:[n.jsx("img",{src:Tn,alt:"deco chat",className:"size-5 rounded"}),n.jsx("span",{className:"text-sm font-medium",children:"deco chat"})]}),t[26]=L):L=t[26];let Q;t[27]!==l?(Q=()=>l(!1),t[27]=l,t[28]=Q):Q=t[28];let Le;t[29]===Symbol.for("react.memo_cache_sentinel")?(Le=n.jsx(ze,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[29]=Le):Le=t[29];let _e;t[30]!==Q?(_e=n.jsxs(E.Header,{children:[L,n.jsx(E.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[30]=Q,t[31]=_e):_e=t[31];const et=c?.id??"";let ke;t[32]!==r||t[33]!==a?(ke=()=>r({to:"/$org/mcps",params:{org:a},search:{action:"create"}}),t[32]=r,t[33]=a,t[34]=ke):ke=t[34];let Ie;t[35]!==g||t[36]!==o||t[37]!==a||t[38]!==et||t[39]!==ke?(Ie=n.jsx(E.Main,{className:"flex flex-col items-center",children:n.jsx(E.EmptyState,{children:n.jsx(qs,{title:"No model provider connected",description:"Connect to a model provider to unlock AI-powered features.",orgSlug:a,orgId:o,userId:et,allConnections:g,onInstallMcpServer:ke})})}),t[35]=g,t[36]=o,t[37]=a,t[38]=et,t[39]=ke,t[40]=Ie):Ie=t[40];let Be;return t[41]!==_e||t[42]!==Ie?(Be=n.jsxs(E,{children:[_e,Ie]}),t[41]=_e,t[42]=Ie,t[43]=Be):Be=t[43],Be}const Ke=_?.icon??"/favicon.svg",Ze=_?.title??"deco chat";let Re;t[44]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(st,{size:12}),t[44]=Re):Re=t[44];let se;t[45]!==Ke||t[46]!==Ze?(se=n.jsx(ht,{icon:Ke,name:Ze,size:"xs",fallbackIcon:Re}),t[45]=Ke,t[46]=Ze,t[47]=se):se=t[47];const Ye=_?.title||"deco chat";let ae;t[48]!==Ye?(ae=n.jsx("span",{className:"text-sm font-medium",children:Ye}),t[48]=Ye,t[49]=ae):ae=t[49];let ne;t[50]!==se||t[51]!==ae?(ne=n.jsxs(E.Header.Left,{children:[se,ae]}),t[50]=se,t[51]=ae,t[52]=ne):ne=t[52];let oe;t[53]!==d?(oe=()=>d(),t[53]=d,t[54]=oe):oe=t[54];let Pe;t[55]===Symbol.for("react.memo_cache_sentinel")?(Pe=n.jsx(sa,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[55]=Pe):Pe=t[55];let le;t[56]!==oe?(le=n.jsx("button",{type:"button",onClick:oe,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"New chat",children:Pe}),t[56]=oe,t[57]=le):le=t[57];let re;t[58]!==u?(re=()=>u(),t[58]=u,t[59]=re):re=t[59];let ie;t[60]!==m||t[61]!==p||t[62]!==f||t[63]!==re||t[64]!==b?(ie=n.jsx(Js,{threads:b,activeThreadId:m,onSelectThread:f,onRemoveThread:p,onOpen:re}),t[60]=m,t[61]=p,t[62]=f,t[63]=re,t[64]=b,t[65]=ie):ie=t[65];let ce;t[66]!==l?(ce=()=>l(!1),t[66]=l,t[67]=ce):ce=t[67];let Ee;t[68]===Symbol.for("react.memo_cache_sentinel")?(Ee=n.jsx(ze,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[68]=Ee):Ee=t[68];let de;t[69]!==ce?(de=n.jsx("button",{type:"button",onClick:ce,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:Ee}),t[69]=ce,t[70]=de):de=t[70];let me;t[71]!==le||t[72]!==ie||t[73]!==de?(me=n.jsxs(E.Header.Right,{children:[le,ie,de]}),t[71]=le,t[72]=ie,t[73]=de,t[74]=me):me=t[74];let fe;t[75]!==ne||t[76]!==me?(fe=n.jsxs(E.Header,{children:[ne,me]}),t[75]=ne,t[76]=me,t[77]=fe):fe=t[77];let ue;t[78]!==y.messages||t[79]!==y.status||t[80]!==U||t[81]!==W||t[82]!==_?.description||t[83]!==_?.icon||t[84]!==_?.title||t[85]!==v?(ue=n.jsx(E.Main,{children:W?n.jsx(E.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(ht,{icon:_?.icon??"/favicon.svg",name:_?.title||"deco chat",size:"lg",fallbackIcon:n.jsx(st,{size:32}),className:"size-[60px]! rounded-[18px]!"}),n.jsx("h3",{className:"text-xl font-medium text-foreground",children:_?.title||"Ask deco chat"}),n.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:_?.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),n.jsx(tt.Container,{children:v&&n.jsx(nt,{fallback:null,children:n.jsx(S.Suspense,{fallback:n.jsx(tt.Fallback,{}),children:n.jsx(tt,{gatewayId:v,onSelect:L=>{U(L.description??L.name)}})})},v)})]})}):n.jsx(E.Messages,{messages:y.messages,status:y.status,minHeightOffset:280})}),t[78]=y.messages,t[79]=y.status,t[80]=U,t[81]=W,t[82]=_?.description,t[83]=_?.icon,t[84]=_?.title,t[85]=v,t[86]=ue):ue=t[86];let pe;t[87]!==y.error||t[88]!==U?(pe=()=>{y.error&&U(`I encountered this error: ${y.error.message}. Can you help me fix it?`)},t[87]=y.error,t[88]=U,t[89]=pe):pe=t[89];let he;t[90]!==y.clearError||t[91]!==y.error||t[92]!==pe?(he=n.jsx(E.ErrorBanner,{error:y.error,onFixInChat:pe,onDismiss:y.clearError}),t[90]=y.clearError,t[91]=y.error,t[92]=pe,t[93]=he):he=t[93];let xe;t[94]!==U?(xe=()=>{U("Please continue.")},t[94]=U,t[95]=xe):xe=t[95];let ge;t[96]!==y.clearFinishReason||t[97]!==y.finishReason||t[98]!==xe?(ge=n.jsx(E.FinishReasonWarning,{finishReason:y.finishReason,onContinue:xe,onDismiss:y.clearFinishReason}),t[96]=y.clearFinishReason,t[97]=y.finishReason,t[98]=xe,t[99]=ge):ge=t[99];let be;t[100]!==G||t[101]!==D||t[102]!==F||t[103]!==R?(be=n.jsx(E.BranchPreview,{branchContext:G,clearBranchContext:D,onGoToOriginalMessage:F,setInputValue:R}),t[100]=G,t[101]=D,t[102]=F,t[103]=R,t[104]=be):be=t[104];const qe=_??void 0;let je;t[105]!==U||t[106]!==P?(je=async()=>{P.trim()&&await U(P.trim())},t[105]=U,t[106]=P,t[107]=je):je=t[107];const Je=!j,Xe=j?"Ask anything or @ for context":"Select a model to start chatting";let ve;t[108]!==te||t[109]!==K||t[110]!==v||t[111]!==X?(ve=X&&n.jsx(ys,{selectedGatewayId:v,onGatewayChange:te,placeholder:"Agent",disabled:K}),t[108]=te,t[109]=K,t[110]=v,t[111]=X,t[112]=ve):ve=t[112];const Qe=j??void 0;let we;t[113]!==Ve||t[114]!==Qe?(we=n.jsx(Cs,{selectedModel:Qe,onModelChange:Ve,placeholder:"Model",variant:"borderless"}),t[113]=Ve,t[114]=Qe,t[115]=we):we=t[115];let Se;t[116]!==y.messages?(Se=n.jsx(Ns,{messages:y.messages}),t[116]=y.messages,t[117]=Se):Se=t[117];let Ne;t[118]!==y.stop||t[119]!==P||t[120]!==K||t[121]!==R||t[122]!==je||t[123]!==Je||t[124]!==Xe||t[125]!==ve||t[126]!==we||t[127]!==Se?(Ne=n.jsxs(E.Input,{value:P,onChange:R,onSubmit:je,onStop:y.stop,disabled:Je,isStreaming:K,placeholder:Xe,children:[ve,we,Se]}),t[118]=y.stop,t[119]=P,t[120]=K,t[121]=R,t[122]=je,t[123]=Je,t[124]=Xe,t[125]=ve,t[126]=we,t[127]=Se,t[128]=Ne):Ne=t[128];let ye;t[129]!==te||t[130]!==K||t[131]!==qe||t[132]!==Ne?(ye=n.jsx(Xs,{gateway:qe,onGatewayChange:te,disabled:K,children:Ne}),t[129]=te,t[130]=K,t[131]=qe,t[132]=Ne,t[133]=ye):ye=t[133];let Ce;t[134]!==he||t[135]!==ge||t[136]!==be||t[137]!==ye?(Ce=n.jsx(E.Footer,{children:n.jsxs("div",{className:"flex flex-col gap-2",children:[he,ge,be,ye]})}),t[134]=he,t[135]=ge,t[136]=be,t[137]=ye,t[138]=Ce):Ce=t[138];let De;return t[139]!==fe||t[140]!==ue||t[141]!==Ce?(De=n.jsxs(E,{children:[fe,ue,Ce]}),t[139]=fe,t[140]=ue,t[141]=Ce,t[142]=De):De=t[142],De}function An(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(E.Provider,{children:n.jsx(Mn,{})}),t[0]=e):e=t[0],e}const Rn="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function jt({showSidebarToggle:t=!1,showOrgSwitcher:e=!1,showDecoChat:s=!1,disableDecoChat:a=!1}){const[o,l]=ct(),r=S.useRef(a);a&&o&&r.current!==a&&l(!1),r.current=a;const i=()=>{a||l(c=>!c)};return n.jsxs(He,{children:[t&&n.jsx(He.Sidebar,{children:n.jsx(Jt,{})}),n.jsx(He.Left,{children:e&&n.jsx(S.Suspense,{fallback:n.jsx(at.Skeleton,{}),children:n.jsx(at,{})})}),n.jsxs(He.Right,{className:"gap-2",children:[n.jsx(oa,{}),s&&!a&&n.jsxs(J,{size:"sm",variant:"default",onClick:i,className:"h-7",children:[n.jsx(ee,{url:Rn,fallback:"DC",size:"2xs",className:"rounded-sm"}),"deco chat"]}),n.jsx(Nn,{})]})]})}function Pn(t){const e=h.c(10),{children:s,className:a}=t,[,o]=S.useTransition();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=lt.decoChatPanelWidth(),e[0]=l):l=e[0];const[r,i]=Fe(l,30);let c;e[1]!==i?(c=p=>o(()=>i(p)),e[1]=i,e[2]=c):c=e[2];const d=c;let m;e[3]!==a?(m=O("min-w-0",a),e[3]=a,e[4]=m):m=e[4];let f;return e[5]!==r||e[6]!==s||e[7]!==d||e[8]!==m?(f=n.jsx(At,{defaultSize:r,minSize:20,className:m,onResize:d,children:s}),e[5]=r,e[6]=s,e[7]=d,e[8]=m,e[9]=f):f=e[9],f}function En(t){const e=h.c(5),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=lt.sidebarOpen(),e[0]=a):a=e[0];const[o,l]=Fe(a,!0);let r;return e[1]!==s||e[2]!==l||e[3]!==o?(r=n.jsx(ja,{open:o,onOpenChange:l,children:s}),e[1]=s,e[2]=l,e[3]=o,e[4]=r):r=e[4],r}function Dn(t){const e=h.c(10),{disableChat:s}=t,a=s===void 0?!1:s,[o]=ct(),l=o&&!a;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(At,{className:"bg-background",children:n.jsx(yt,{})}),e[0]=r):r=e[0];let i;e[1]!==a||e[2]!==l?(i=!a&&n.jsx(ea,{withHandle:l}),e[1]=a,e[2]=l,e[3]=i):i=e[3];const c=l?"max-w-none":"max-w-0";let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(nt,{children:n.jsx(S.Suspense,{fallback:n.jsx(Qs,{}),children:n.jsx(An,{})})}),e[4]=d):d=e[4];let m;e[5]!==c?(m=n.jsx(Pn,{className:c,children:d}),e[5]=c,e[6]=m):m=e[6];let f;return e[7]!==i||e[8]!==m?(f=n.jsxs(ta,{direction:"horizontal",children:[r,i,m]}),e[7]=i,e[8]=m,e[9]=f):f=e[9],f}function Ln(){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}=wt(e),a=vt(),o=a.location.pathname===`/${s}`||a.location.pathname===`/${s}/`;let l;t[1]!==s?(l=xs.activeOrganization(s),t[1]=s,t[2]=l):l=t[2];let r;t[3]!==s?(r=async()=>{if(!s)return null;const{data:x}=await q.organization.setActive({organizationSlug:s});return{org:x,project:{slug:Is}}},t[3]=s,t[4]=r):r=t[4];let i;t[5]!==l||t[6]!==r?(i={queryKey:l,queryFn:r,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=l,t[6]=r,t[7]=i):i=t[7];const{data:c}=hs(i);if(!c){let x;t[8]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(jt,{}),t[8]=x):x=t[8];let g;return t[9]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"min-h-screen bg-background",children:[x,n.jsx("div",{className:"pt-12",children:n.jsx(yt,{})})]}),t[9]=g):g=t[9],g}let d;t[10]!==o?(d=n.jsx(jt,{showSidebarToggle:!0,showOrgSwitcher:!0,showDecoChat:!0,disableDecoChat:o}),t[10]=o,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 f;t[13]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Ea,{}),t[13]=f):f=t[13];let p;t[14]!==o?(p=n.jsxs(Sa,{className:"flex-1 bg-sidebar",style:m,children:[f,n.jsx(ya,{className:"pt-12",children:n.jsx(Dn,{disableChat:o})})]}),t[14]=o,t[15]=p):p=t[15];let b;t[16]!==d||t[17]!==p?(b=n.jsx(En,{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 u;return t[19]!==c||t[20]!==b?(u=n.jsx(ks,{...c,children:b}),t[19]=c,t[20]=b,t[21]=u):u=t[21],u}function Wo(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Cn,{children:n.jsx(S.Suspense,{fallback:n.jsx(Nt,{}),children:n.jsx(Ln,{})})}),t[0]=e):e=t[0],e}export{Wo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as C,h as d,j as a}from"./index-
|
|
1
|
+
import{c as C,h as d,j as a}from"./index-ZiFjEqyT.js";import{c as m}from"./button-Co_HOc3E.js";const u=d("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",special:"fill-special text-backround"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function p(f){const e=C.c(10),{variant:c,size:o}=f;let t;e[0]!==o||e[1]!==c?(t=m(u({variant:c,size:o})),e[0]=o,e[1]=c,e[2]=t):t=e[2];let l,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i=a.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=l,e[4]=i):(l=e[3],i=e[4]);let s;e[5]!==t?(s=a.jsxs("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l,i]}),e[5]=t,e[6]=s):s=e[6];let r;e[7]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=r):r=e[7];let n;return e[8]!==s?(n=a.jsxs("div",{role:"status",children:[s,r]}),e[8]=s,e[9]=n):n=e[9],n}export{p as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,ai as T,j as i,aj as C,ag as y,an as I,al as M,aS as H,aR as z,c as A}from"./index-
|
|
1
|
+
import{r as c,ai as T,j as i,aj as C,ag as y,an as I,al as M,aS as H,aR as z,c as A}from"./index-ZiFjEqyT.js";import{c as g}from"./button-Co_HOc3E.js";var b="Switch",[U]=T(b),[q,L]=U(b),E=c.forwardRef((s,e)=>{const{__scopeSwitch:t,name:r,checked:a,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=s,[p,h]=c.useState(null),v=y(e,m=>h(m)),S=c.useRef(!1),x=p?l||!!p.closest("form"):!0,[f,N]=I({prop:a,defaultProp:n??!1,onChange:k,caller:b});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:M(s.onClick,m=>{N(B=>!B),x&&(S.current=m.isPropagationStopped(),S.current||m.stopPropagation())})}),x&&i.jsx(_,{control:p,bubbles:!S.current,name:r,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=b;var P="SwitchThumb",R=c.forwardRef((s,e)=>{const{__scopeSwitch:t,...r}=s,a=L(P,t);return i.jsx(C.span,{"data-state":j(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:e})});R.displayName=P;var O="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:s,control:e,checked:t,bubbles:r=!0,...a},n)=>{const o=c.useRef(null),d=y(o,n),u=H(t),k=z(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:r});h.call(l,t),l.dispatchEvent(v)}},[u,t,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...a,tabIndex:-1,ref:d,style:{...a.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=O;function j(s){return s?"checked":"unchecked"}var $=E,D=R;function X(s){const e=A.c(9);let t,r;e[0]!==s?({className:t,...r}=s,e[0]=s,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let a;e[3]!==t?(a=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(D,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==a?(o=i.jsx($,{"data-slot":"switch",className:a,...r,children:n}),e[6]=r,e[7]=a,e[8]=o):o=e[8],o}export{X as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,j as n}from"./index-
|
|
1
|
+
import{c as o,j as n}from"./index-ZiFjEqyT.js";import{c as l}from"./button-Co_HOc3E.js";function u(s){const e=o.c(8);let r,i;e[0]!==s?({className:r,...i}=s,e[0]=s,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let t;e[3]!==r?(t=l("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-xl border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),e[3]=r,e[4]=t):t=e[4];let a;return e[5]!==i||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...i}),e[5]=i,e[6]=t,e[7]=a):a=e[7],a}export{u as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as v,c as z,j as t}from"./index-
|
|
1
|
+
import{r as v,c as z,j as t}from"./index-ZiFjEqyT.js";import{I as F}from"./empty-state-B1DU5702.js";import{C as I}from"./checkbox-DGIT6WZ3.js";import{c as T,B as R}from"./button-Co_HOc3E.js";import{i as A}from"./ArrowLeft-CCqPW2JN.js";import{u as U}from"./use-connection-BskZam-G.js";import{C as V}from"./collection-search-D67e9ppe.js";const q=v.memo(function(S){const e=z.c(21),{connection:o,isSelected:m,hasToolsEnabled:r,activeToolsCount:h,totalToolsCount:p,onSelect:g,onToggle:x}=S,u=m?"bg-accent/50":"hover:bg-muted/50";let i;e[0]!==u?(i=T("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",u),e[0]=u,e[1]=i):i=e[1];let c;e[2]!==o.icon||e[3]!==o.title?(c=t.jsx(F,{icon:o.icon,name:o.title,size:"xs"}),e[2]=o.icon,e[3]=o.title,e[4]=c):c=e[4];let f;e[5]!==o.title?(f=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),e[5]=o.title,e[6]=f):f=e[6];let n;e[7]!==g||e[8]!==c||e[9]!==f?(n=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:g,children:[c,f]}),e[7]=g,e[8]=c,e[9]=f,e[10]=n):n=e[10];let a;e[11]!==h||e[12]!==o.tools||e[13]!==r||e[14]!==x||e[15]!==p?(a=o.tools&&o.tools.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[h,"/",p]}),t.jsx(I,{checked:r,onCheckedChange:x,onClick:H})]}),e[11]=h,e[12]=o.tools,e[13]=r,e[14]=x,e[15]=p,e[16]=a):a=e[16];let N;return e[17]!==i||e[18]!==n||e[19]!==a?(N=t.jsxs("div",{className:i,children:[n,a]}),e[17]=i,e[18]=n,e[19]=a,e[20]=N):N=e[20],N}),G=v.memo(function(S){const e=z.c(18),{connectionId:o,tool:m,isSelected:r,onToggle:h}=S,p=`tool-${o}-${m.name}`,g=r?"text-foreground":"text-muted-foreground";let x;e[0]!==g?(x=T("text-sm font-medium",g),e[0]=g,e[1]=x):x=e[1];let u;e[2]!==x||e[3]!==m.name?(u=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:x,children:m.name})}),e[2]=x,e[3]=m.name,e[4]=u):u=e[4];let i;e[5]!==m.description?(i=m.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:m.description}),e[5]=m.description,e[6]=i):i=e[6];let c;e[7]!==u||e[8]!==i?(c=t.jsxs("div",{className:"flex-1 min-w-0",children:[u,i]}),e[7]=u,e[8]=i,e[9]=c):c=e[9];const f=`tool-${o}-${m.name}`;let n;e[10]!==r||e[11]!==h||e[12]!==f?(n=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(I,{id:f,checked:r,onCheckedChange:h,onClick:J})}),e[10]=r,e[11]=h,e[12]=f,e[13]=n):n=e[13];let a;return e[14]!==p||e[15]!==c||e[16]!==n?(a=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:p,children:[c,n]}),e[14]=p,e[15]=c,e[16]=n,e[17]=a):a=e[17],a});function ee({toolSet:d,onToolSetChange:S}){const[e,o]=v.useState(""),m=v.useDeferredValue(e),[r,h]=v.useState("all"),[p,g]=v.useState(!1),x=v.useRef(new Set(Object.keys(d))),u=U({searchTerm:m.trim()||void 0}),i=x.current,c=[...i.values()].map(s=>u.find(l=>l.id===s)).filter(s=>s!==void 0),f=u.filter(s=>!i.has(s.id)),n=[...c,...f],a=s=>{const l=d[s];return l!==void 0&&l.length>0},N=n.filter(s=>{if(r==="all")return!0;const l=a(s.id);return r==="selected"?l:r==="unselected"?!l:!0}),[M,$]=v.useState(n[0]?.id??null),b=M?n.find(s=>s.id===M)??null:null,E=b?.tools??[],B=(s,l)=>d[s]?.includes(l)??!1,D=(s,l)=>{const j=d[s]??[],k=j.includes(l),w={...d};if(k){const y=j.filter(C=>C!==l);y.length===0?delete w[s]:w[s]=y}else w[s]=[...j,l];S(w)},O=s=>{const l=n.find(C=>C.id===s);if(!l?.tools)return;const j=d[s]??[],k=l.tools.map(C=>C.name),w=j.length>0&&k.every(C=>j.includes(C)),y={...d};w?delete y[s]:(y[s]=k,$(s)),S(y)},P=s=>{$(s),g(!0)},Q=()=>{g(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:T("w-full md:w-80 border-r border-border flex flex-col",p&&"hidden md:flex"),children:[t.jsx(V,{value:e,onChange:o,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>h("all"),className:T("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>h("selected"),className:T("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>h("unselected"),className:T("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:N.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:e?"No connections found":r==="selected"?"No servers selected":r==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:N.map(s=>{const l=s.tools?.length??0,j=d[s.id]?.length??0;return t.jsx(q,{connection:s,isSelected:M===s.id,hasToolsEnabled:a(s.id),activeToolsCount:j,totalToolsCount:l,onSelect:()=>P(s.id),onToggle:()=>O(s.id)},s.id)})})})]}),t.jsx("div",{className:T("flex-1 flex-col",p?"flex":"hidden md:flex"),children:b?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(R,{variant:"ghost",size:"sm",onClick:Q,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(A,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(F,{icon:b.icon,name:b.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.title}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:b.description})]})]})]}),t.jsx("div",{className:"flex-1 overflow-auto p-4",children:E.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):t.jsx("div",{className:"space-y-2",children:E.map(s=>t.jsx(G,{connectionId:b.id,tool:s,isSelected:B(b.id,s.name),onToggle:()=>D(b.id,s.name)},s.name))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}function H(d){return d.stopPropagation()}function J(d){return d.stopPropagation()}export{ee as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{K as B,j as t,c as O,f as Q,r as k}from"./index-
|
|
1
|
+
import{K as B,j as t,c as O,f as Q,r as k}from"./index-ZiFjEqyT.js";import{u as U}from"./useQuery-Bn2Wcch_.js";import{i as W}from"./File06-Dir7h2_j.js";import{i as Y}from"./Loading01-Bq_7Os6T.js";import{e as J}from"./github-icon-Dp3wHhYE.js";import{C as P}from"./collection-display-button-C_GfVLwh.js";import{C as X}from"./collection-search-D67e9ppe.js";import{C as Z}from"./collection-table-wrapper-DDHrDWif.js";import{E as z,I as ee}from"./empty-state-B1DU5702.js";import{C as te}from"./card-Rz2C5-Lx.js";import{V as se}from"./layout-tF7tb_Qc.js";function oe(s){return s.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function re(s){return s.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,i)=>i.includes("target=")?e.replace(/target="[^"]*"/gi,'target="_blank"'):`<a ${i} target="_blank" rel="noopener noreferrer">`)}function ne(s){let e=oe(s);return e=re(e),e}function we({repository:s}){const e=s?J(s):null,{data:i,isLoading:c}=U({queryKey:B.githubReadme(e?.owner,e?.repo),queryFn:async()=>{if(!e)return null;try{const l=await fetch(`https://api.github.com/repos/${e.owner}/${e.repo}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!l.ok){if(l.status===404)return null;throw new Error(`Failed to fetch README: ${l.statusText}`)}const m=await l.text();return ne(m)}catch(l){return console.error("Error fetching README:",l),null}},enabled:!!e&&!!s,staleTime:3600*1e3,gcTime:1440*60*1e3});return c?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}):i?t.jsx("div",{className:"p-5 markdown-body",style:{backgroundColor:"transparent"},dangerouslySetInnerHTML:{__html:i}}):t.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[t.jsx(W,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),t.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]})}function ve(s){const e=O.c(39),{tools:i,connectionId:c,org:l,onToolClick:m,showToolbar:L,emptyMessage:M}=s,D=L===void 0?!0:L,j=M===void 0?"This connection doesn't have any tools yet.":M,I=Q(),[n,$]=k.useState(""),[d,H]=k.useState("table"),[r,A]=k.useState("name"),[a,_]=k.useState("asc");let y;e[0]!==a||e[1]!==r?(y=o=>{r===o?(_(me),a==="desc"&&A(void 0)):(A(o),_("asc"))},e[0]=a,e[1]=r,e[2]=y):y=e[2];const u=y;let N;e[3]!==c||e[4]!==I||e[5]!==m||e[6]!==l?(N=o=>{m?m(o):c&&l&&I({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:c,collectionName:"tools",itemId:encodeURIComponent(o.name)}})},e[3]=c,e[4]=I,e[5]=m,e[6]=l,e[7]=N):N=e[7];const w=N;let v;if(e[8]!==n||e[9]!==a||e[10]!==r||e[11]!==i){const o=!i||i.length===0?[]:n.trim()?(()=>{const R=n.toLowerCase();return i.filter(b=>b.name.toLowerCase().includes(R)||b.description&&b.description.toLowerCase().includes(R))})():i;v=!r||!a?o:[...o].sort((R,b)=>{const q=R[r]||"",G=b[r]||"",K=String(q).localeCompare(String(G));return a==="asc"?K:-K}),e[8]=n,e[9]=a,e[10]=r,e[11]=i,e[12]=v}else v=e[12];const g=v;let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=[{id:"name",header:"Name",render:ce,sortable:!0},{id:"description",header:"Description",render:le,cellClassName:"flex-1",sortable:!0}],e[13]=C):C=e[13];const V=C;let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=V.filter(ie).map(ae),e[14]=S):S=e[14];const F=S;let f;e[15]!==u||e[16]!==D||e[17]!==a||e[18]!==r||e[19]!==d?(f=D&&t.jsx(se,{children:t.jsx(P,{viewMode:d,onViewModeChange:H,sortKey:r,sortDirection:a,onSort:u,sortOptions:F})}),e[15]=u,e[16]=D,e[17]=a,e[18]=r,e[19]=d,e[20]=f):f=e[20];let E;e[21]===Symbol.for("react.memo_cache_sentinel")?(E=o=>{o.key==="Escape"&&($(""),o.target.blur())},e[21]=E):E=e[21];let p;e[22]!==n?(p=t.jsx(X,{value:n,onChange:$,placeholder:"Search tools...",onKeyDown:E}),e[22]=n,e[23]=p):p=e[23];let h;e[24]!==j||e[25]!==u||e[26]!==w||e[27]!==n||e[28]!==a||e[29]!==r||e[30]!==g||e[31]!==d?(h=d==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:g.length===0?t.jsx(z,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":j}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:g.map(o=>t.jsx(te,{className:"cursor-pointer transition-colors",onClick:()=>w(o),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(ee,{icon:null,name:o.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:o.description||"No description"})]})]})},o.name))})}):t.jsx(Z,{columns:V,data:g,isLoading:!1,sortKey:r,sortDirection:a,onSort:u,onRowClick:o=>w(o),emptyState:t.jsx(z,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":j})}),e[24]=j,e[25]=u,e[26]=w,e[27]=n,e[28]=a,e[29]=r,e[30]=g,e[31]=d,e[32]=h):h=e[32];let x;e[33]!==p||e[34]!==h?(x=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p,h]}),e[33]=p,e[34]=h,e[35]=x):x=e[35];let T;return e[36]!==x||e[37]!==f?(T=t.jsxs(t.Fragment,{children:[f,x]}),e[36]=x,e[37]=f,e[38]=T):T=e[38],T}function ae(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function ie(s){return s.sortable}function le(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function ce(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function me(s){return s==="asc"?"desc":s==="desc"?null:"asc"}export{we as R,ve as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as c,aj as S,ai as J,ak as H,ay as Q,aw as $,aA as Z,aB as ee,
|
|
1
|
+
import{r as a,j as c,aj as S,ai as J,ak as H,ay as Q,aw as $,aA as Z,aB as ee,bu as te,ag as G,ax as oe,al as C,aF as re,an as ne,az as se,aC as ae,c as j}from"./index-ZiFjEqyT.js";import{c as ie}from"./button-Co_HOc3E.js";var le=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ce="VisuallyHidden",z=a.forwardRef((o,e)=>c.jsx(S.span,{...o,ref:e,style:{...le,...o.style}}));z.displayName=ce;var ue=z,[O]=J("Tooltip",[$]),D=$(),F="TooltipProvider",de=700,A="tooltip.open",[pe,k]=O(F),V=o=>{const{__scopeTooltip:e,delayDuration:t=de,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,l=a.useRef(!0),d=a.useRef(!1),i=a.useRef(0);return a.useEffect(()=>{const p=i.current;return()=>window.clearTimeout(p)},[]),c.jsx(pe,{scope:e,isOpenDelayedRef:l,delayDuration:t,onOpen:a.useCallback(()=>{window.clearTimeout(i.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:a.useCallback(p=>{d.current=p},[]),disableHoverableContent:n,children:s})};V.displayName=F;var R="Tooltip",[fe,_]=O(R),B=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:d}=o,i=k(R,o.__scopeTooltip),p=D(e),[u,v]=a.useState(null),x=re(),f=a.useRef(0),h=l??i.disableHoverableContent,m=d??i.delayDuration,g=a.useRef(!1),[y,T]=ne({prop:r,defaultProp:n??!1,onChange:M=>{M?(i.onOpen(),document.dispatchEvent(new CustomEvent(A))):i.onClose(),s?.(M)},caller:R}),w=a.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,T(!0)},[T]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,T(!1)},[T]),I=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,T(!0),f.current=0},m)},[m,T]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),c.jsx(se,{...p,children:c.jsx(fe,{scope:e,contentId:x,open:y,stateAttribute:w,trigger:u,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?I():E()},[i.isOpenDelayedRef,I,E]),onTriggerLeave:a.useCallback(()=>{h?P():(window.clearTimeout(f.current),f.current=0)},[P,h]),onOpen:E,onClose:P,disableHoverableContent:h,children:t})})};B.displayName=R;var L="TooltipTrigger",Y=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=_(L,t),s=k(L,t),l=D(t),d=a.useRef(null),i=G(e,d,n.onTriggerChange),p=a.useRef(!1),u=a.useRef(!1),v=a.useCallback(()=>p.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),c.jsx(oe,{asChild:!0,...l,children:c.jsx(S.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:C(o.onPointerMove,x=>{x.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),u.current=!0)}),onPointerLeave:C(o.onPointerLeave,()=>{n.onTriggerLeave(),u.current=!1}),onPointerDown:C(o.onPointerDown,()=>{n.open&&n.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:C(o.onFocus,()=>{p.current||n.onOpen()}),onBlur:C(o.onBlur,n.onClose),onClick:C(o.onClick,n.onClose)})})});Y.displayName=L;var N="TooltipPortal",[ve,xe]=O(N,{forceMount:void 0}),U=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=_(N,e);return c.jsx(ve,{scope:e,forceMount:t,children:c.jsx(H,{present:t||s.open,children:c.jsx(Q,{asChild:!0,container:n,children:r})})})};U.displayName=N;var b="TooltipContent",q=a.forwardRef((o,e)=>{const t=xe(b,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,l=_(b,o.__scopeTooltip);return c.jsx(H,{present:r||l.open,children:l.disableHoverableContent?c.jsx(W,{side:n,...s,ref:e}):c.jsx(he,{side:n,...s,ref:e})})}),he=a.forwardRef((o,e)=>{const t=_(b,o.__scopeTooltip),r=k(b,o.__scopeTooltip),n=a.useRef(null),s=G(e,n),[l,d]=a.useState(null),{trigger:i,onClose:p}=t,u=n.current,{onPointerInTransitChange:v}=r,x=a.useCallback(()=>{d(null),v(!1)},[v]),f=a.useCallback((h,m)=>{const g=h.currentTarget,y={x:h.clientX,y:h.clientY},T=ye(y,g.getBoundingClientRect()),w=Ce(y,T),E=be(m.getBoundingClientRect()),P=Ee([...w,...E]);d(P),v(!0)},[v]);return a.useEffect(()=>()=>x(),[x]),a.useEffect(()=>{if(i&&u){const h=g=>f(g,u),m=g=>f(g,i);return i.addEventListener("pointerleave",h),u.addEventListener("pointerleave",m),()=>{i.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",m)}}},[i,u,f,x]),a.useEffect(()=>{if(l){const h=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},T=i?.contains(g)||u?.contains(g),w=!we(y,l);T?x():w&&(x(),p())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[i,u,l,p,x]),c.jsx(W,{...o,ref:s})}),[ge,me]=O(R,{isInside:!1}),Te=te("TooltipContent"),W=a.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...d}=o,i=_(b,t),p=D(t),{onClose:u}=i;return a.useEffect(()=>(document.addEventListener(A,u),()=>document.removeEventListener(A,u)),[u]),a.useEffect(()=>{if(i.trigger){const v=x=>{x.target?.contains(i.trigger)&&u()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,u]),c.jsx(Z,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:u,children:c.jsxs(ee,{"data-state":i.stateAttribute,...p,...d,ref:e,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(Te,{children:r}),c.jsx(ge,{scope:t,isInside:!0,children:c.jsx(ue,{id:i.contentId,role:"tooltip",children:n||r})})]})})});q.displayName=b;var X="TooltipArrow",K=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=D(t);return me(X,t).isInside?null:c.jsx(ae,{...n,...r,ref:e})});K.displayName=X;function ye(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ce(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function be(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function we(o,e){const{x:t,y:r}=o;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const d=e[s],i=e[l],p=d.x,u=d.y,v=i.x,x=i.y;u>r!=x>r&&t<(v-p)*(r-u)/(x-u)+p&&(n=!n)}return n}function Ee(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),Pe(e)}function Pe(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var Re=V,_e=B,je=Y,Oe=U,De=q,Ae=K;function Le(o){const e=j.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=c.jsx(Re,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function Ie(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(Le,{children:c.jsx(_e,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function Me(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(je,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function Se(o){const e=j.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let d;e[5]!==r?(d=ie("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=d):d=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(Ae,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=i):i=e[7];let p;return e[8]!==t||e[9]!==n||e[10]!==l||e[11]!==d?(p=c.jsx(Oe,{children:c.jsxs(De,{"data-slot":"tooltip-content",sideOffset:l,className:d,...n,children:[t,i]})}),e[8]=t,e[9]=n,e[10]=l,e[11]=d,e[12]=p):p=e[12],p}export{Se as T,le as V,Le as a,Me as b,Ie as c};
|