@decocms/mesh 1.4.4 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-B6rEUVLf.js → AlertCircle-BIlMffS8.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DC_Ebc-m.js → ArrowLeft-CJ-eKoid.js} +1 -1
- package/dist/client/assets/{ChevronDown-rNVX3ifZ.js → ChevronDown-atiP0m-F.js} +1 -1
- package/dist/client/assets/{Clock-DS2iGkSJ.js → Clock-BD2gknBV.js} +1 -1
- package/dist/client/assets/{Code01-CoFYqM8q.js → Code01-BEefaaXC.js} +1 -1
- package/dist/client/assets/{Copy01-CCVZH6f1.js → Copy01-DhXqtugg.js} +1 -1
- package/dist/client/assets/{CpuChip02-DwHhz9CA.js → CpuChip02-BtgBI59l.js} +1 -1
- package/dist/client/assets/{DotsVertical-8kkJJG9R.js → DotsVertical-roys0n6e.js} +1 -1
- package/dist/client/assets/{File06-DxUGl7Wc.js → File06-MlW8n69V.js} +1 -1
- package/dist/client/assets/{FlipBackward-D9qJVjU9.js → FlipBackward-BSnTMMYy.js} +1 -1
- package/dist/client/assets/{GitBranch01-DLNdjhEu.js → GitBranch01-CEvRlFly.js} +1 -1
- package/dist/client/assets/{Grid01-BTunGha4.js → Grid01-CkwdbRed.js} +1 -1
- package/dist/client/assets/{Inbox01-BoV8p7IN.js → Inbox01-D66dNA_K.js} +1 -1
- package/dist/client/assets/{Key01-Bqzm5f6K.js → Key01-BXlD7hmS.js} +1 -1
- package/dist/client/assets/{LinkExternal01-WcFL8RpQ.js → LinkExternal01-O4xnNCff.js} +1 -1
- package/dist/client/assets/{Loading01-B0vdyVbH.js → Loading01-EiDV-2FW.js} +1 -1
- package/dist/client/assets/{Lock01-B0PVK-yI.js → Lock01-DpRDCI3P.js} +1 -1
- package/dist/client/assets/{Play-KfJ8X6ky.js → Play-FKw7EqPO.js} +1 -1
- package/dist/client/assets/{Plus-nu8-Nz8b.js → Plus-CwB-Rc8B.js} +1 -1
- package/dist/client/assets/{SearchMd-BFumDfkS.js → SearchMd-C6P9P1wF.js} +1 -1
- package/dist/client/assets/{Terminal-CDIp_seB.js → Terminal-Dv6w41J8.js} +1 -1
- package/dist/client/assets/{Trash01-1tKgR7uh.js → Trash01-Ctk7srex.js} +1 -1
- package/dist/client/assets/{X-hEo9Za23.js → X-Da4xsL05.js} +1 -1
- package/dist/client/assets/{XClose-BIthQxae.js → XClose-OUZ04LEo.js} +1 -1
- package/dist/client/assets/{alert-dialog-_VCwcCen.js → alert-dialog-D6UjYOUP.js} +1 -1
- package/dist/client/assets/{auth-BpfHzPVh.js → auth-CZR9mNdb.js} +1 -1
- package/dist/client/assets/{auth-catchall-D-D94naG.js → auth-catchall-BZWl_BRK.js} +1 -1
- package/dist/client/assets/{avatar-DHKqC-IM.js → avatar-BHE7lL4M.js} +1 -1
- package/dist/client/assets/{badge-Dkhmn9Qj.js → badge-B-u7R38I.js} +1 -1
- package/dist/client/assets/{button-BSXU4L7C.js → button-B13xcF6W.js} +1 -1
- package/dist/client/assets/{card-CXFRieEW.js → card-7VW-xSd-.js} +1 -1
- package/dist/client/assets/{checkbox-C-t_-9ku.js → checkbox-BMd2Z-WT.js} +1 -1
- package/dist/client/assets/{collection-detail-P20CfY5q.js → collection-detail-7eGCexqR.js} +3 -3
- package/dist/client/assets/{collection-display-button-BAoFTB4b.js → collection-display-button-D4VM0KQx.js} +1 -1
- package/dist/client/assets/{collection-header-B--7sWbR.js → collection-header-od14k6u3.js} +1 -1
- package/dist/client/assets/{collection-page-B71dz4fa.js → collection-page-BNuNM--s.js} +1 -1
- package/dist/client/assets/{collection-search-CrC01K4Z.js → collection-search-LnYLnFH8.js} +1 -1
- package/dist/client/assets/{collection-tab-dwp9LGxi.js → collection-tab-bg_gmLyh.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CFoaxah9.js → collection-table-wrapper-B0AFEn1d.js} +1 -1
- package/dist/client/assets/{connection-card-eAyda1Mu.js → connection-card-r2tH19aR.js} +1 -1
- package/dist/client/assets/{connection-detail-Bn-jl6HG.js → connection-detail-Dm1s8Dj2.js} +1 -1
- package/dist/client/assets/connections-CWHukeOK.js +1 -0
- package/dist/client/assets/constants-CN4QOiqe.js +1 -0
- package/dist/client/assets/{core-C9AbX0ks.js → core-BqWxized.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DhHOFwW5.js → create-organization-dialog-CjneLhKn.js} +1 -1
- package/dist/client/assets/{dialog-Cj2udzC-.js → dialog-DoN4ORnY.js} +1 -1
- package/dist/client/assets/{dropdown-menu-ClBJUvd8.js → dropdown-menu-uXj8nKiT.js} +1 -1
- package/dist/client/assets/{empty-state-CYnIzDhF.js → empty-state-N07FE0YG.js} +1 -1
- package/dist/client/assets/{env-vars-editor-nU4IPD2j.js → env-vars-editor-B7JL_p-V.js} +1 -1
- package/dist/client/assets/{error-boundary-D5hb-PLt.js → error-boundary-Ce0_dLsG.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BWB54H7f.js → extract-connection-data-CeT4F9gU.js} +1 -1
- package/dist/client/assets/{form-Dn7fy5O5.js → form-BQIYj24w.js} +1 -1
- package/dist/client/assets/{formatDistanceToNow-km7E2wF1.js → formatDistanceToNow-CArtWgcP.js} +1 -1
- package/dist/client/assets/gateway-detail-VCb3jL84.js +1 -0
- package/dist/client/assets/gateways-9p2LLkTK.js +1 -0
- package/dist/client/assets/{home-dep1g9Zf.js → home-DgfprghT.js} +1 -1
- package/dist/client/assets/{index-gqIvEQSH.js → index-CVgkE3Gv.js} +2 -2
- package/dist/client/assets/{index-tz4gB72W.js → index-DEMNtulg.js} +2 -2
- package/dist/client/assets/{index-DX5d9vx1.js → index-DcMa5gDs.js} +1 -1
- package/dist/client/assets/{index-CcNvI65p.js → index-DcvTq0xJ.js} +1 -1
- package/dist/client/assets/{input-Cb7MaM0d.js → input-YdP8mwrf.js} +1 -1
- package/dist/client/assets/json-Bz08jZIq.js +1 -0
- package/dist/client/assets/{json-syntax-highlighter-CCgbux_M.js → json-syntax-highlighter-Bif-CDya.js} +2 -2
- package/dist/client/assets/{layout-DtfNegCp.js → layout-BNxxrCBw.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-CaGtIE-R.js → lazy-highlighter-C0vzyJy5.js} +1 -1
- package/dist/client/assets/{localstorage-keys-DIkWdWYS.js → localstorage-keys-DwKN3_Ky.js} +1 -1
- package/dist/client/assets/{login-DSSk45pi.js → login-UWyl_cxx.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BOAcAnr_.js → mcp-oauth-Dqr97r2H.js} +1 -1
- package/dist/client/assets/{members-D4I8qlnr.js → members-C3UV37Kw.js} +1 -1
- package/dist/client/assets/{monitoring-CvcerPLg.js → monitoring-Ds52TSSS.js} +2 -2
- package/dist/client/assets/{oauth-callback-CY5bCrs6.js → oauth-callback-D4M9mHyH.js} +1 -1
- package/dist/client/assets/{page-Du4118GJ.js → page-B7ia0_lh.js} +2 -2
- package/dist/client/assets/{pin-to-sidebar-button-CwlJToUG.js → pin-to-sidebar-button-BKotT_Nc.js} +1 -1
- package/dist/client/assets/{popover-BPqLZ76M.js → popover-7jr0PuXV.js} +1 -1
- package/dist/client/assets/prism-light-CHE2alug.js +1 -0
- package/dist/client/assets/resizable-qkPSJ31g.js +1 -0
- package/dist/client/assets/{resource-tabs-CmUpRVKA.js → resource-tabs-qR3NhTLd.js} +1 -1
- package/dist/client/assets/{responsive-select-DwsIwS1V.js → responsive-select-CJQwNPPj.js} +1 -1
- package/dist/client/assets/{select-HGITgxwS.js → select-L_OjJ9sW.js} +1 -1
- package/dist/client/assets/{settings-sSoOIGWg.js → settings-BapAo6i2.js} +1 -1
- package/dist/client/assets/shell-layout-DqUuQ9gz.js +19 -0
- package/dist/client/assets/{spinner-BUVePO6d.js → spinner-CAJeeq5B.js} +1 -1
- package/dist/client/assets/{store-H6vucsd1.js → store-DTMoxgob.js} +1 -1
- package/dist/client/assets/{store-app-detail-aULJzMOJ.js → store-app-detail-CbGg2GlI.js} +1 -1
- package/dist/client/assets/{switch-BwTlw9qL.js → switch-DlwEQXd2.js} +1 -1
- package/dist/client/assets/{textarea-BAs6HmBZ.js → textarea-IOVeLZOt.js} +1 -1
- package/dist/client/assets/{thread-history-popover-DbEl1KJu.js → thread-history-popover-COjpShBU.js} +3 -3
- package/dist/client/assets/{tools-list-thZyoBrU.js → tools-list-l6xtSgWR.js} +1 -1
- package/dist/client/assets/{tooltip-Bzy1O5cq.js → tooltip-C7B84lYF.js} +1 -1
- package/dist/client/assets/{types-BVTsq_OW.js → types-BmKCUQAI.js} +1 -1
- package/dist/client/assets/{use-binding-jUI3xZmp.js → use-binding-Ce8NG0MO.js} +1 -1
- package/dist/client/assets/{use-connection-DRZbGk_A.js → use-connection-D-LWel3A.js} +1 -1
- package/dist/client/assets/{use-connection-resources-B3tDNT6E.js → use-connection-resources-CJzk5_Wj.js} +1 -1
- package/dist/client/assets/{use-gateway-CUxuCVmJ.js → use-gateway-eXp_1iQc.js} +1 -1
- package/dist/client/assets/{use-list-state-CkGBL95Z.js → use-list-state-CmxR0QRn.js} +1 -1
- package/dist/client/assets/{use-mcp-CMt9Wy3X.js → use-mcp-Cmlg9h6L.js} +1 -1
- package/dist/client/assets/{use-members-cyA2aC2q.js → use-members-Drex2zGi.js} +1 -1
- package/dist/client/assets/{use-mobile-B8xlavN6.js → use-mobile-B-R7B7Hp.js} +1 -1
- package/dist/client/assets/{use-organization-settings-C7IdFOTo.js → use-organization-settings-B_G_DBCR.js} +1 -1
- package/dist/client/assets/{use-tool-call-CsOSZ1pI.js → use-tool-call-BN3WED_Z.js} +1 -1
- package/dist/client/assets/useQuery-DLJrS2VC.js +1 -0
- package/dist/client/assets/{useSuspenseInfiniteQuery-DqCwXIKB.js → useSuspenseInfiniteQuery-DFaXtjFO.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-COcukfhX.js → view-mode-toggle-BpRlpgBn.js} +1 -1
- package/dist/client/assets/workflow-CBeu3WB4.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/migrate.js +2 -2
- package/dist/server/server.js +3 -3
- package/package.json +1 -1
- package/dist/client/assets/connections-CDl5cKXc.js +0 -1
- package/dist/client/assets/constants-C-5m3xCJ.js +0 -1
- package/dist/client/assets/gateway-detail-BEimKnAa.js +0 -1
- package/dist/client/assets/gateways-1GR6BIbg.js +0 -1
- package/dist/client/assets/json-CevIphLA.js +0 -1
- package/dist/client/assets/prism-light-bnbWF_0X.js +0 -1
- package/dist/client/assets/resizable-Ck5ltOjh.js +0 -1
- package/dist/client/assets/shell-layout-BCUXUEeW.js +0 -19
- package/dist/client/assets/useQuery-Bl78N6vT.js +0 -1
- package/dist/client/assets/workflow-CaCjE8aO.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as J,j as e,r as M,f as Q,b as Y,a as Z,u as ee,y as ne,x as te,v as X,W as se,w as x,_ as oe}from"./index-tz4gB72W.js";import{C as re}from"./collection-header-B--7sWbR.js";import{C as ie}from"./collection-page-B71dz4fa.js";import{C as ae}from"./collection-search-CrC01K4Z.js";import{C as ce}from"./collection-table-wrapper-CFoaxah9.js";import{C as le}from"./connection-card-eAyda1Mu.js";import{E as P}from"./SearchMd-BFumDfkS.js";import{E as de}from"./error-boundary-D5hb-PLt.js";import{a as me,u as pe,n as T,I as ue}from"./use-connection-DRZbGk_A.js";import{u as xe,s as F}from"./use-list-state-CkGBL95Z.js";import{u as he}from"./tooltip-Bzy1O5cq.js";import{f as ge,a as je,b as fe,c as ve,d as _e,e as Ce,A as ye,g as Se}from"./alert-dialog-_VCwcCen.js";import{B as we}from"./badge-Dkhmn9Qj.js";import{B as g}from"./button-BSXU4L7C.js";import{d as ke,c as Ne,D as De,a as be,b as Pe,f as Te}from"./dialog-Cj2udzC-.js";import{b as z,D as V,a as R,c as N}from"./dropdown-menu-ClBJUvd8.js";import{a as Ie,F as l,b as d,c as m,d as p,f as u}from"./form-Dn7fy5O5.js";import{i as B}from"./DotsVertical-8kkJJG9R.js";import{i as Me,r as $e,s as I,E as Ae,e as W}from"./env-vars-editor-nU4IPD2j.js";import{i as Ee}from"./Loading01-B0vdyVbH.js";import{i as Oe}from"./Terminal-CDIp_seB.js";import{s as H}from"./Trash01-1tKgR7uh.js";import{I as f}from"./input-Cb7MaM0d.js";import{S as Fe,a as ze,b as Ve,c as Re,d as w}from"./select-HGITgxwS.js";import{T as Be}from"./textarea-BAs6HmBZ.js";import{g as He}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-BAoFTB4b.js";import"./Grid01-BTunGha4.js";import"./view-mode-toggle-COcukfhX.js";import"./card-CXFRieEW.js";import"./use-mobile-B8xlavN6.js";import"./X-hEo9Za23.js";import"./Plus-nu8-Nz8b.js";import"./ChevronDown-rNVX3ifZ.js";const Xe=X({key:x(),value:x()}),We=X({title:x().min(1,"Name is required"),description:x().nullable().optional(),ui_type:oe(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:x().optional(),connection_token:x().nullable().optional(),npx_package:x().optional(),stdio_command:x().optional(),stdio_args:x().optional(),stdio_cwd:x().optional(),env_vars:se(Xe).optional()}).refine(t=>t.ui_type==="NPX"?!!t.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(t=>t.ui_type==="STDIO"?!!t.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(t=>t.ui_type==="HTTP"||t.ui_type==="SSE"||t.ui_type==="Websocket"?!!t.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Le(t,o){const j={command:"npx",args:["-y",t]},v=W(o);return Object.keys(v).length>0&&(j.envVars=v),j}function Ue(t,o,j,v){const _={command:t};o.trim()&&(_.args=o.trim().split(/\s+/)),j?.trim()&&(_.cwd=j.trim());const i=W(v);return Object.keys(i).length>0&&(_.envVars=i),_}function Ke(t){return t.command==="npx"}function qe(t){return t.args?.find(o=>!o.startsWith("-"))??""}function Ge(t){return{command:t.command,args:t.args?.join(" ")??"",cwd:t.cwd??""}}function Je(t,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"close":return{mode:"idle"}}}function Qe(){const{org:t}=he(),o=Q(),j=Y({strict:!1}),{data:v}=Z.useSession(),{stdioEnabled:_}=ee(),i=xe({namespace:t.slug,resource:"connections"}),D=me(),b=pe(i),[h,C]=M.useReducer(Je,{mode:"idle"}),$=j.action==="create",L=()=>{o({to:"/$org/mcps",params:{org:t.slug},search:{action:"create"}})},A=()=>{o({to:"/$org/mcps",params:{org:t.slug},search:{}})},r=ne({resolver:te(We),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),y=r.watch("ui_type"),a=h.mode==="editing"?h.connection:null;M.useEffect(()=>{if(a){const n=Me(a.connection_headers)?a.connection_headers:null;if(n&&a.connection_type==="STDIO"){const s=$e(n.envVars);if(Ke(n)){const c=qe(n);r.reset({title:a.title,description:a.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:s})}else{const c=Ge(n);r.reset({title:a.title,description:a.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:s})}}else r.reset({title:a.title,description:a.description,ui_type:a.connection_type,connection_url:a.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[a,r]);const U=async()=>{if(h.mode!=="deleting")return;const n=h.connection.id;C({type:"close"});try{await D.delete.mutateAsync(n)}catch{}},K=async n=>{let s,c=null,k=null,S=null;if(n.ui_type==="NPX"?(s="STDIO",c="",S=Le(n.npx_package||"",n.env_vars||[])):n.ui_type==="STDIO"?(s="STDIO",c="",S=Ue(n.stdio_command||"",n.stdio_args||"",n.stdio_cwd,n.env_vars||[])):(s=n.ui_type,c=n.connection_url||"",k=n.connection_token||null),a){await D.update.mutateAsync({id:a.id,data:{title:n.title,description:n.description||null,connection_type:s,connection_url:c,...k&&{connection_token:k},...S&&{connection_headers:S}}}),C({type:"close"}),r.reset();return}const O=He("conn");await D.create.mutateAsync({id:O,title:n.title,description:n.description||null,connection_type:s,connection_url:c,connection_token:k,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:v?.user?.id||"system",organization_id:t.id,icon:null,app_name:null,app_id:null,connection_headers:S,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),A(),r.reset(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:O}})},E=n=>{n||($?A():C({type:"close"}),r.reset())},q=[{id:"icon",header:"",render:n=>e.jsx(ue,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(T,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:n=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:n.title,children:n.title}),cellClassName:"w-48 max-w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:n=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:n.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:n=>e.jsx("span",{className:"text-sm font-medium",children:n.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:n=>{const s=n.connection_url??"",c=s.length>40?`${s.slice(0,40)}...`:s;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:n=>e.jsx(we,{variant:n.status==="active"?"success":"outline",children:n.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:n=>e.jsxs(z,{children:[e.jsx(V,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(B,{size:20})})}),e.jsxs(R,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(N,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}})},children:[e.jsx(F,{size:16}),"Inspect"]}),e.jsxs(N,{variant:"destructive",onClick:s=>{s.stopPropagation(),C({type:"delete",connection:n})},children:[e.jsx(H,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],G=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(g,{onClick:L,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Connect MCP Server"})]});return e.jsxs(ie,{children:[e.jsx(ke,{open:$||h.mode==="editing",onOpenChange:E,children:e.jsxs(Ne,{className:"sm:max-w-[525px]",children:[e.jsxs(De,{children:[e.jsx(be,{children:a?"Edit Connection":"Create New Connection"}),e.jsx(Pe,{children:a?"Update the connection details below.":"Add a new connection to your organization. Fill in the details below."})]}),e.jsx(Ie,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(K),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(l,{control:r.control,name:"title",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Name *"}),e.jsx(p,{children:e.jsx(f,{placeholder:"My Connection",...n})}),e.jsx(u,{})]})}),e.jsx(l,{control:r.control,name:"description",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Description"}),e.jsx(p,{children:e.jsx(Be,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:r.control,name:"ui_type",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Type *"}),e.jsxs(Fe,{value:n.value,onValueChange:n.onChange,children:[e.jsx(p,{children:e.jsx(ze,{children:e.jsx(Ve,{})})}),e.jsxs(Re,{children:[e.jsx(w,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(w,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(w,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4"}),"Websocket"]})}),_&&e.jsxs(e.Fragment,{children:[e.jsx(w,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(T,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(w,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Oe,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(u,{})]})}),y==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(l,{control:r.control,name:"npx_package",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"NPM Package *"}),e.jsx(p,{children:e.jsx(f,{placeholder:"@perplexity-ai/mcp-server",...n,value:n.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(u,{})]})})}),y==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(l,{control:r.control,name:"stdio_command",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Command *"}),e.jsx(p,{children:e.jsx(f,{placeholder:"node, bun, python...",...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:r.control,name:"stdio_args",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Arguments"}),e.jsx(p,{children:e.jsx(f,{placeholder:"arg1 arg2 --flag value",...n,value:n.value??""})}),e.jsx(u,{})]})})]}),e.jsx(l,{control:r.control,name:"stdio_cwd",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Working Directory"}),e.jsx(p,{children:e.jsx(f,{placeholder:"/path/to/project (optional)",...n,value:n.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(u,{})]})})]}),(y==="NPX"||y==="STDIO")&&e.jsx(l,{control:r.control,name:"env_vars",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Environment Variables"}),e.jsx(p,{children:e.jsx(Ae,{value:n.value??[],onChange:n.onChange})}),e.jsx(u,{})]})}),y!=="NPX"&&y!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(l,{control:r.control,name:"connection_url",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"URL *"}),e.jsx(p,{children:e.jsx(f,{placeholder:"https://example.com/mcp",...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:r.control,name:"connection_token",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Token (optional)"}),e.jsx(p,{children:e.jsx(f,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),e.jsx(u,{})]})})]})]}),e.jsxs(Te,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>E(!1),children:"Cancel"}),e.jsx(g,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":a?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(ge,{open:h.mode==="deleting",onOpenChange:n=>!n&&C({type:"close"}),children:e.jsxs(je,{children:[e.jsxs(fe,{children:[e.jsx(ve,{children:"Delete Connection?"}),e.jsxs(_e,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:h.mode==="deleting"&&h.connection.title}),"."]})]}),e.jsxs(Ce,{children:[e.jsx(ye,{children:"Cancel"}),e.jsx(Se,{onClick:U,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(re,{title:"MCP Servers",viewMode:i.viewMode,onViewModeChange:i.setViewMode,sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],ctaButton:G}),e.jsx(ae,{value:i.search,onChange:i.setSearch,placeholder:"Search for an MCP Server...",onKeyDown:n=>{n.key==="Escape"&&(i.setSearch(""),n.target.blur())}}),i.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:b.length===0?e.jsx(P,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(i.search,"No MCP Servers found"),description:i.search?`No MCP Servers match "${i.search}"`:"Create a connection to get started.",actions:!i.search&&e.jsx(g,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:b.map(n=>e.jsx(le,{connection:n,fallbackIcon:e.jsx(T,{}),onClick:()=>o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}}),headerActions:e.jsxs(z,{children:[e.jsx(V,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(B,{size:20})})}),e.jsxs(R,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(N,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}})},children:[e.jsx(F,{size:16}),"Inspect"]}),e.jsxs(N,{variant:"destructive",onClick:s=>{s.stopPropagation(),C({type:"delete",connection:n})},children:[e.jsx(H,{size:16}),"Delete"]})]})]})},n.id))})}):e.jsx(ce,{columns:q,data:b,isLoading:!1,sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,onRowClick:n=>o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}}),emptyState:i.search?e.jsx(P,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No MCP Servers found",description:`No MCP Servers match "${i.search}"`}):e.jsx(P,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No MCP Servers found",description:"Create a connection to get started.",actions:e.jsx(g,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),children:"Browse Store"})})})]})}function $n(){const t=J.c(1);let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(de,{children:e.jsx(M.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(Ee,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Qe,{})})}),t[0]=o):o=t[0],o}export{$n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{B as o}from"./use-binding-jUI3xZmp.js";import{aN as a}from"./index-tz4gB72W.js";const e="mcp.mesh",m="mcp.mesh/publisher-provided",c=a(o,{target:"draft-07"});export{c as B,m as M,e as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as $,c as Z,j as t,f as Ye,d as pt,b as gt,v as jt,_ as qe,w as et,g as bt,af as vt,x as yt,y as St,a as Ct,t as Je}from"./index-tz4gB72W.js";import{E as wt}from"./SearchMd-BFumDfkS.js";import{E as Ke}from"./error-boundary-D5hb-PLt.js";import{I as Fe,u as Qe}from"./use-connection-DRZbGk_A.js";import{T as Nt,S as _t}from"./switch-BwTlw9qL.js";import{C as st}from"./checkbox-C-t_-9ku.js";import{c as xe,B as te}from"./button-BSXU4L7C.js";import{i as It}from"./ArrowLeft-DC_Ebc-m.js";import{C as Tt}from"./collection-search-CrC01K4Z.js";import{I as Ze}from"./input-Cb7MaM0d.js";import{s as nt}from"./Plus-nu8-Nz8b.js";import{i as kt}from"./X-hEo9Za23.js";import{b as $t,a as Pt}from"./use-gateway-CUxuCVmJ.js";import{u as Mt,a as zt}from"./use-connection-resources-B3tDNT6E.js";import{u as Et}from"./use-binding-jUI3xZmp.js";import{a as Rt,e as ot,T as At,C as Y,b as Ft,c as Dt,d as Gt,u as Vt,N as Bt,G as Ot,U as Lt,M as Ut}from"./thread-history-popover-DbEl1KJu.js";import{u as lt,a as pe,c as ge,b as je,T as be,i as tt}from"./tooltip-Bzy1O5cq.js";import{a as Ht}from"./Copy01-CCVZH6f1.js";import{i as Xe}from"./CpuChip02-DwHhz9CA.js";import{i as Wt}from"./FlipBackward-D9qJVjU9.js";import{i as it}from"./LinkExternal01-WcFL8RpQ.js";import{i as Le}from"./Loading01-B0vdyVbH.js";import{F as Re,a as qt,b as De,d as Ge,f as Ve,c as rt}from"./form-Dn7fy5O5.js";import{S as at,a as ct,b as dt,c as mt,d as Ae}from"./select-HGITgxwS.js";import{R as Jt}from"./resource-tabs-CmUpRVKA.js";import{s as Yt}from"./slugify-CEUa2lfQ.js";import{P as Kt}from"./pin-to-sidebar-button-CwlJToUG.js";import{a as Qt,V as Zt,b as Xt}from"./layout-DtfNegCp.js";import{u as es,L as ut}from"./localstorage-keys-DIkWdWYS.js";import{f as ts}from"./formatDistanceToNow-km7E2wF1.js";import"./auth-BpfHzPVh.js";import"./AlertCircle-B6rEUVLf.js";import"./Grid01-BTunGha4.js";import"./responsive-select-DwsIwS1V.js";import"./use-mobile-B8xlavN6.js";import"./textarea-BAs6HmBZ.js";import"./Terminal-CDIp_seB.js";import"./connection-card-eAyda1Mu.js";import"./card-CXFRieEW.js";import"./json-syntax-highlighter-CCgbux_M.js";import"./alert-dialog-_VCwcCen.js";import"./File06-DxUGl7Wc.js";import"./well-known-mcp-VNRT0JrW.js";import"./generate-id-Dyweu44Y.js";import"./popover-BPqLZ76M.js";import"./Clock-DS2iGkSJ.js";import"./Trash01-1tKgR7uh.js";import"./ChevronDown-rNVX3ifZ.js";import"./badge-Dkhmn9Qj.js";import"./use-organization-settings-C7IdFOTo.js";import"./useQuery-Bl78N6vT.js";const ft=({size:n=24,color:e="currentColor",...s})=>$.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},$.createElement("path",{d:"M12 20h9M3 20h1.675c.489 0 .733 0 .964-.055.204-.05.399-.13.578-.24.201-.123.374-.296.72-.642L19.5 6.5a2.121 2.121 0 0 0-3-3L3.937 16.063c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.578c-.055.23-.055.475-.055.965V20Z"}));ft.displayName="Edit03";const ht=({size:n=24,color:e="currentColor",...s})=>$.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},$.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 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 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));ht.displayName="Save01";const ss=$.memo(function(e){const s=Z.c(20),{connection:o,isSelected:f,hasItemsEnabled:r,activeItemsCount:m,totalItemsCount:g,onSelect:c,onToggle:l}=e,d=f?"bg-accent/50":"hover:bg-muted/50";let h;s[0]!==d?(h=xe("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),s[0]=d,s[1]=h):h=s[1];let p;s[2]!==o.icon||s[3]!==o.title?(p=t.jsx(Fe,{icon:o.icon,name:o.title,size:"xs"}),s[2]=o.icon,s[3]=o.title,s[4]=p):p=s[4];let b;s[5]!==o.title?(b=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),s[5]=o.title,s[6]=b):b=s[6];let u;s[7]!==c||s[8]!==p||s[9]!==b?(u=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:c,children:[p,b]}),s[7]=c,s[8]=p,s[9]=b,s[10]=u):u=s[10];let x;s[11]!==m||s[12]!==r||s[13]!==l||s[14]!==g?(x=g>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[m,"/",g]}),t.jsx(st,{checked:r,onCheckedChange:l,onClick:os})]}),s[11]=m,s[12]=r,s[13]=l,s[14]=g,s[15]=x):x=s[15];let v;return s[16]!==h||s[17]!==u||s[18]!==x?(v=t.jsxs("div",{className:h,children:[u,x]}),s[16]=h,s[17]=u,s[18]=x,s[19]=v):v=s[19],v}),ns=$.memo(function(e){const s=Z.c(18),{connectionId:o,item:f,isSelected:r,onToggle:m}=e,g=`item-${o}-${f.id}`,c=r?"text-foreground":"text-muted-foreground";let l;s[0]!==c?(l=xe("text-sm font-medium",c),s[0]=c,s[1]=l):l=s[1];let d;s[2]!==f.name||s[3]!==l?(d=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:l,children:f.name})}),s[2]=f.name,s[3]=l,s[4]=d):d=s[4];let h;s[5]!==f.description?(h=f.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:f.description}),s[5]=f.description,s[6]=h):h=s[6];let p;s[7]!==d||s[8]!==h?(p=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,h]}),s[7]=d,s[8]=h,s[9]=p):p=s[9];const b=`item-${o}-${f.id}`;let u;s[10]!==r||s[11]!==m||s[12]!==b?(u=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(st,{id:b,checked:r,onCheckedChange:m,onClick:ls})}),s[10]=r,s[11]=m,s[12]=b,s[13]=u):u=s[13];let x;return s[14]!==g||s[15]!==p||s[16]!==u?(x=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:g,children:[p,u]}),s[14]=g,s[15]=p,s[16]=u,s[17]=x):x=s[17],x});function xt({itemSet:n,onItemSetChange:e,getItems:s,itemLabel:o,emptyItemsMessage:f,extraContent:r}){const[m,g]=$.useState(""),c=$.useDeferredValue(m),[l,d]=$.useState("all"),[h,p]=$.useState(!1),b=$.useRef(new Set(Object.keys(n))),u=Qe({searchTerm:c.trim()||void 0}),x=b.current,v=[...x.values()].map(i=>u.find(w=>w.id===i)).filter(i=>i!==void 0),N=u.filter(i=>!x.has(i.id)),I=[...v,...N],j=i=>{const w=n[i];return w!==void 0&&w.length>0},y=I.filter(i=>{if(l==="all")return!0;const w=j(i.id);return l==="selected"?w:l==="unselected"?!w:!0}),[S,a]=$.useState(I[0]?.id??null),C=S?I.find(i=>i.id===S)??null:null,_=C?s(C):[],E=(i,w)=>n[i]?.includes(w)??!1,R=(i,w)=>{const A=n[i]??[],F=A.includes(w),P={...n};if(F){const V=A.filter(z=>z!==w);V.length===0?delete P[i]:P[i]=V}else P[i]=[...A,w];e(P)},q=i=>{const w=I.find(k=>k.id===i);if(!w)return;const A=s(w);if(A.length===0)return;const F=n[i]??[],P=A.map(k=>k.id),V=F.length>0&&P.every(k=>F.includes(k)),z={...n};V?delete z[i]:(z[i]=P,a(i)),e(z)},U=i=>{a(i),p(!0)},T=()=>{p(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:xe("w-full md:w-80 border-r border-border flex flex-col",h&&"hidden md:flex"),children:[t.jsx(Tt,{value:m,onChange:g,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>d("all"),className:xe("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",l==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>d("selected"),className:xe("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",l==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>d("unselected"),className:xe("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",l==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:y.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:m?"No connections found":l==="selected"?"No servers selected":l==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:y.map(i=>{const A=s(i).length,F=n[i.id]?.length??0;return t.jsx(ss,{connection:i,isSelected:S===i.id,hasItemsEnabled:j(i.id),activeItemsCount:F,totalItemsCount:A,onSelect:()=>U(i.id),onToggle:()=>q(i.id)},i.id)})})})]}),t.jsx("div",{className:xe("flex-1 flex-col",h?"flex":"hidden md:flex"),children:C?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(te,{variant:"ghost",size:"sm",onClick:T,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(It,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(Fe,{icon:C.icon,name:C.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:C.title}),C.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:C.description})]})]})]}),r,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:_.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:f||`This connection has no ${o} available`}):t.jsx("div",{className:"space-y-2",children:_.map(i=>t.jsx(ns,{connectionId:C.id,item:i,isSelected:E(C.id,i.id),onToggle:()=>R(C.id,i.id)},i.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",o]})})})]})}function os(n){return n.stopPropagation()}function ls(n){return n.stopPropagation()}function is(n){const e=Z.c(6),{promptSet:s,onPromptSetChange:o,connectionPrompts:f}=n;let r;e[0]!==f?(r=c=>(f.get(c.id)??[]).map(rs),e[0]=f,e[1]=r):r=e[1];const m=r;let g;return e[2]!==m||e[3]!==o||e[4]!==s?(g=t.jsx(xt,{itemSet:s,onItemSetChange:o,getItems:m,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=m,e[3]=o,e[4]=s,e[5]=g):g=e[5],g}function rs(n){return{id:n.name,name:n.name,description:n.description}}function as(n){return n.includes("*")}function cs(n){const e=Z.c(27),{patterns:s,onAddPattern:o,onRemovePattern:f}=n,[r,m]=$.useState("");let g;e[0]!==r||e[1]!==o||e[2]!==s?(g=()=>{const p=r.trim();p&&!s.includes(p)&&(o(p),m(""))},e[0]=r,e[1]=o,e[2]=s,e[3]=g):g=e[3];const c=g;let l;e[4]!==c?(l=p=>{p.key==="Enter"&&(p.preventDefault(),c())},e[4]=c,e[5]=l):l=e[5];const d=l;let h;if(e[6]!==c||e[7]!==d||e[8]!==r||e[9]!==f||e[10]!==s){const p=s.filter(as);let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("code",{children:"*"}),e[12]=b):b=e[12];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",b," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=u):u=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=a=>m(a.target.value),e[14]=x):x=e[14];let v;e[15]!==d||e[16]!==r?(v=t.jsx(Ze,{value:r,onChange:x,onKeyDown:d,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=d,e[16]=r,e[17]=v):v=e[17];let N;e[18]!==r?(N=r.trim(),e[18]=r,e[19]=N):N=e[19];const I=!N;let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(nt,{size:16}),e[20]=j):j=e[20];let y;e[21]!==c||e[22]!==I?(y=t.jsx(te,{type:"button",variant:"outline",size:"sm",onClick:c,disabled:I,children:j}),e[21]=c,e[22]=I,e[23]=y):y=e[23];let S;e[24]!==y||e[25]!==v?(S=t.jsxs("div",{className:"flex gap-2",children:[v,y]}),e[24]=y,e[25]=v,e[26]=S):S=e[26],h=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[u,S,p.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:p.map(a=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:a}),t.jsx("button",{type:"button",onClick:()=>f(a),className:"text-muted-foreground hover:text-foreground",children:t.jsx(kt,{size:12})})]},a))})]}),e[6]=c,e[7]=d,e[8]=r,e[9]=f,e[10]=s,e[11]=h}else h=e[11];return h}function ds(n){const e=Z.c(23),{resourceSet:s,onResourceSetChange:o,connectionResources:f}=n,[r]=$.useState(null);let m;e[0]!==f?(m=j=>(f.get(j.id)??[]).map(ms),e[0]=f,e[1]=m):m=e[1];const g=m;let c;e[2]!==o||e[3]!==s?(c=(j,y)=>{const S=s[j]??[];S.includes(y)||o({...s,[j]:[...S,y]})},e[2]=o,e[3]=s,e[4]=c):c=e[4];const l=c;let d;e[5]!==o||e[6]!==s?(d=(j,y)=>{const a=(s[j]??[]).filter(C=>C!==y);if(a.length===0){const C={...s};delete C[j],o(C)}else o({...s,[j]:a})},e[5]=o,e[6]=s,e[7]=d):d=e[7];const h=d;let p;e[8]!==o?(p=j=>{o(j)},e[8]=o,e[9]=p):p=e[9];const b=p;let u;e[10]!==s||e[11]!==r?(u=r?s[r]??[]:[],e[10]=s,e[11]=r,e[12]=u):u=e[12];const x=u;let v;e[13]!==l||e[14]!==h||e[15]!==r||e[16]!==x?(v=r?t.jsx(cs,{patterns:x,onAddPattern:j=>l(r,j),onRemovePattern:j=>h(r,j)}):null,e[13]=l,e[14]=h,e[15]=r,e[16]=x,e[17]=v):v=e[17];const N=v;let I;return e[18]!==N||e[19]!==g||e[20]!==b||e[21]!==s?(I=t.jsx("div",{className:"h-full",children:t.jsx(xt,{itemSet:s,onItemSetChange:b,getItems:g,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:N})}),e[18]=N,e[19]=g,e[20]=b,e[21]=s,e[22]=I):I=e[22],I}function ms(n){return{id:n.uri,name:n.name||n.uri,description:n.description||n.uri}}const us="You are a helpful assistant. Please try answering the user's questions using your available tools.";function fs(n){const s=new TextEncoder().encode(n),o=Array.from(s,f=>String.fromCharCode(f)).join("");return btoa(o)}function hs(n){const e=Z.c(52),{serverName:s,gatewayUrl:o}=n,[f,r]=$.useState(!1),[m,g]=$.useState(null),c=Yt(s);let l,d,h,p;if(e[0]!==o||e[1]!==c){const L={type:"http",url:o},se={[c]:L};l=JSON.stringify(se,null,2);const J=K=>JSON.stringify({...L,headers:{"x-mesh-client":K}},null,2),ae=fs(J("Cursor"));d=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(c)}&config=${encodeURIComponent(ae)}`;const ne=J("Claude Code");h=c;let ce;e[6]===Symbol.for("react.memo_cache_sentinel")?(ce=/'/g,e[6]=ce):ce=e[6],p=ne.replace(ce,"'\\''"),e[0]=o,e[1]=c,e[2]=l,e[3]=d,e[4]=h,e[5]=p}else l=e[2],d=e[3],h=e[4],p=e[5];const b=`claude mcp add "${h}" --config '${p}'`;let u;e[7]!==l?(u=async()=>{await navigator.clipboard.writeText(l),r(!0),Je.success("Configuration copied to clipboard"),setTimeout(()=>r(!1),2e3)},e[7]=l,e[8]=u):u=e[8];const x=u;let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=async(L,se)=>{await navigator.clipboard.writeText(L),g(se),Je.success(`${se} command copied`),setTimeout(()=>g(null),2e3)},e[9]=v):v=e[9];const N=v,I=xs;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=j):j=e[10];let y;e[11]!==f?(y=f?t.jsx(tt,{size:14}):t.jsx(Ht,{size:14}),e[11]=f,e[12]=y):y=e[12];let S;e[13]!==x||e[14]!==y?(S=t.jsx(je,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:x,children:y})}),e[13]=x,e[14]=y,e[15]=S):S=e[15];let a;e[16]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(be,{children:"Copy configuration"}),e[16]=a):a=e[16];let C;e[17]!==S?(C=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(pe,{children:t.jsxs(ge,{children:[S,a]})})}),e[17]=S,e[18]=C):C=e[18];let _;e[19]!==l||e[20]!==x?(_=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:x,children:l}),e[19]=l,e[20]=x,e[21]=_):_=e[21];let E;e[22]!==_||e[23]!==C?(E=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[C,_]}),e[22]=_,e[23]=C,e[24]=E):E=e[24];let R;e[25]!==d?(R=()=>I(d),e[25]=d,e[26]=R):R=e[26];let q,U;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),U=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=q,e[28]=U):(q=e[27],U=e[28]);let T;e[29]!==R?(T=t.jsx(je,{asChild:!0,children:t.jsxs(te,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:R,children:[q,U]})}),e[29]=R,e[30]=T):T=e[30];let i;e[31]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(be,{children:"Add to Cursor"}),e[31]=i):i=e[31];let w;e[32]!==T?(w=t.jsx(pe,{children:t.jsxs(ge,{children:[T,i]})}),e[32]=T,e[33]=w):w=e[33];let A;e[34]!==b?(A=()=>N(b,"Claude"),e[34]=b,e[35]=A):A=e[35];let F,P;e[36]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),P=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=F,e[37]=P):(F=e[36],P=e[37]);let V;e[38]!==m?(V=m==="Claude"&&t.jsx(tt,{size:14,className:"ml-2 text-green-500"}),e[38]=m,e[39]=V):V=e[39];let z;e[40]!==A||e[41]!==V?(z=t.jsx(je,{asChild:!0,children:t.jsxs(te,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:A,children:[F,P,V]})}),e[40]=A,e[41]=V,e[42]=z):z=e[42];let k;e[43]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(be,{children:"Add to Claude Code"}),e[43]=k):k=e[43];let X;e[44]!==z?(X=t.jsx(pe,{children:t.jsxs(ge,{children:[z,k]})}),e[44]=z,e[45]=X):X=e[45];let H;e[46]!==w||e[47]!==X?(H=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[w,X]}),e[46]=w,e[47]=X,e[48]=H):H=e[48];let O;return e[49]!==E||e[50]!==H?(O=t.jsxs("div",{className:"flex flex-col gap-4",children:[j,E,H]}),e[49]=E,e[50]=H,e[51]=O):O=e[51],O}function xs(n){window.open(n,"_blank")}const ps=jt({title:et().min(1,"Name is required").max(255),description:et().nullable(),status:qe(["active","inactive"]),tool_selection_mode:qe(["inclusion","exclusion"]),tool_selection_strategy:qe(["passthrough","smart_tool_selection","code_execution"])});function gs(n,e){const s={};for(const o of n.connections)if(o.selected_tools===null){const f=e.get(o.connection_id)??[];f.length>0&&(s[o.connection_id]=f)}else o.selected_tools.length>0&&(s[o.connection_id]=o.selected_tools);return s}function js(n){const e={};for(const s of n.connections)s.selected_resources!==null&&s.selected_resources!==void 0&&s.selected_resources.length>0&&(e[s.connection_id]=s.selected_resources);return e}function bs(n){const e={};for(const s of n.connections)s.selected_prompts!==null&&s.selected_prompts!==void 0&&s.selected_prompts.length>0&&(e[s.connection_id]=s.selected_prompts);return e}function vs(n,e,s,o){const f=new Set([...Object.keys(n),...Object.keys(e),...Object.keys(s)]);return Array.from(f).map(r=>{const m=n[r]??[],g=o.get(r)??[],c=g.length>0&&g.every(l=>m.includes(l));return{connection_id:r,selected_tools:m.length===0||c?null:m,selected_resources:e[r]??null,selected_prompts:s[r]??null}})}function ys(n){const e=Z.c(110),{gateway:s,activeThreadId:o,setActiveThreadId:f}=n,{data:r}=Ct.useSession(),m=r?.user,g=Ft();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];const l=Qe(c);let d;e[1]!==l?(d={connections:l,binding:"LLMS"},e[1]=l,e[2]=d):d=e[2];const[h]=Et(d),p=!!h,{locator:b,org:u}=lt(),x=Ye();let v;e[3]!==b?(v=ut.chatSelectedModel(b),e[3]=b,e[4]=v):v=e[4];const[N,I]=Dt(v,g,Ss),j=ot();let y;e[5]!==s||e[6]!==j?(y=D=>{const B={id:D.id,title:D.title,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),hidden:!1,gatewayId:s.id};j.insert.mutate(B)},e[5]=s,e[6]=j,e[7]=y):y=e[7];let S;e[8]!==o||e[9]!==y?(S={threadId:o,systemPrompt:us,onCreateThread:y},e[8]=o,e[9]=y,e[10]=S):S=e[10];const a=Gt(S),{inputValue:C,setInputValue:_,branchContext:E,clearBranch:R}=Vt(),{isEmpty:q}=a,U=!!N;let T;e[11]!==o||e[12]!==a||e[13]!==R||e[14]!==s||e[15]!==U||e[16]!==N||e[17]!==_||e[18]!==m?.image||e[19]!==m?.name?(T=async D=>{if(!U||!N){Je.error("No model configured");return}_(""),R();const B={created_at:new Date().toISOString(),thread_id:o,model:{id:N.id,connectionId:N.connectionId,provider:N.provider??void 0,limits:N.limits??void 0},gateway:{id:s.id},user:{avatar:m?.image??void 0,name:m?.name??"you"}};await a.sendMessage(D,B)},e[11]=o,e[12]=a,e[13]=R,e[14]=s,e[15]=U,e[16]=N,e[17]=_,e[18]=m?.image,e[19]=m?.name,e[20]=T):T=e[20];const i=T;let w;e[21]!==I?(w=D=>{I(D)},e[21]=I,e[22]=w):w=e[22];const A=w;let F;e[23]!==E||e[24]!==R||e[25]!==f||e[26]!==_?(F=()=>{E&&(f(E.originalThreadId),R(),_(""))},e[23]=E,e[24]=R,e[25]=f,e[26]=_,e[27]=F):F=e[27];const P=F;if(!p){const D=m?.id??"";let B;e[28]!==x||e[29]!==u.slug?(B=()=>x({to:"/$org/mcps",params:{org:u.slug},search:{action:"create"}}),e[28]=x,e[29]=u.slug,e[30]=B):B=e[30];let he;e[31]!==l||e[32]!==u.id||e[33]!==u.slug||e[34]!==B||e[35]!==D?(he=t.jsx(Y.Main,{className:"h-full relative overflow-hidden",children:t.jsx(Y.EmptyState,{children:t.jsx(Bt,{description:"Connect to a model provider to unlock AI-powered features in this gateway.",orgSlug:u.slug,orgId:u.id,userId:D,allConnections:l,onInstallMcpServer:B})})}),e[31]=l,e[32]=u.id,e[33]=u.slug,e[34]=B,e[35]=D,e[36]=he):he=e[36];let ie;e[37]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(Y.Footer,{}),e[37]=ie):ie=e[37];let re;return e[38]!==he?(re=t.jsxs(Y,{children:[he,ie]}),e[38]=he,e[39]=re):re=e[39],re}const V=s.title||"Gateway";let z;e[40]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(Xe,{size:32}),e[40]=z):z=e[40];let k;e[41]!==s.icon||e[42]!==V?(k=t.jsx(Fe,{icon:s.icon,name:V,size:"lg",fallbackIcon:z,className:"size-[60px]! rounded-[18px]!"}),e[41]=s.icon,e[42]=V,e[43]=k):k=e[43];const X=s.title||"Gateway Chat";let H;e[44]!==X?(H=t.jsx("h3",{className:"text-xl font-medium text-foreground",children:X}),e[44]=X,e[45]=H):H=e[45];let O;e[46]!==s.description?(O=s.description?t.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:s.description}):null,e[46]=s.description,e[47]=O):O=e[47];let L;e[48]!==k||e[49]!==H||e[50]!==O?(L=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[k,H,O]}),e[48]=k,e[49]=H,e[50]=O,e[51]=L):L=e[51];let se;e[52]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx("div",{className:"flex justify-center mt-6",children:t.jsx(Le,{size:20,className:"animate-spin text-muted-foreground"})}),e[52]=se):se=e[52];let J;e[53]!==i?(J=D=>{i(D.description??D.name)},e[53]=i,e[54]=J):J=e[54];let ae;e[55]!==s.id||e[56]!==J?(ae=t.jsx(Ke,{fallback:null,children:t.jsx($.Suspense,{fallback:se,children:t.jsx(Ot,{gatewayId:s.id,onSelect:J})})}),e[55]=s.id,e[56]=J,e[57]=ae):ae=e[57];let ne;e[58]!==L||e[59]!==ae?(ne=t.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-4 text-center",children:[L,ae]}),e[58]=L,e[59]=ae,e[60]=ne):ne=e[60];const ce=ne;let K;e[61]!==a.messages||e[62]!==a.status||e[63]!==ce||e[64]!==q?(K=t.jsx(Y.Main,{className:"h-full relative overflow-hidden",children:q?t.jsx(Y.EmptyState,{children:ce}):t.jsx(Y.Messages,{messages:a.messages,status:a.status,minHeightOffset:240})}),e[61]=a.messages,e[62]=a.status,e[63]=ce,e[64]=q,e[65]=K):K=e[65];let de;e[66]!==a.error||e[67]!==i?(de=()=>{a.error&&i(`I encountered this error: ${a.error.message}. Can you help me fix it?`)},e[66]=a.error,e[67]=i,e[68]=de):de=e[68];let me;e[69]!==a.clearError||e[70]!==a.error||e[71]!==de?(me=t.jsx(Y.ErrorBanner,{error:a.error,onFixInChat:de,onDismiss:a.clearError}),e[69]=a.clearError,e[70]=a.error,e[71]=de,e[72]=me):me=e[72];let oe;e[73]!==i?(oe=()=>{i("Please continue.")},e[73]=i,e[74]=oe):oe=e[74];let W;e[75]!==a.clearFinishReason||e[76]!==a.finishReason||e[77]!==oe?(W=t.jsx(Y.FinishReasonWarning,{finishReason:a.finishReason,onContinue:oe,onDismiss:a.clearFinishReason}),e[75]=a.clearFinishReason,e[76]=a.finishReason,e[77]=oe,e[78]=W):W=e[78];let Se;e[79]!==E||e[80]!==R||e[81]!==P||e[82]!==_?(Se=t.jsx(Y.BranchPreview,{branchContext:E,clearBranchContext:R,onGoToOriginalMessage:P,setInputValue:_}),e[79]=E,e[80]=R,e[81]=P,e[82]=_,e[83]=Se):Se=e[83];let ue;e[84]!==i||e[85]!==C?(ue=async()=>{C.trim()&&await i(C.trim())},e[84]=i,e[85]=C,e[86]=ue):ue=e[86];const ve=!U,Ce=a.status==="submitted"||a.status==="streaming",ye=N?"Ask anything or @ for context":"Select a model to start chatting",we=N??void 0;let G;e[87]!==A||e[88]!==we?(G=t.jsx(Ut,{selectedModel:we,onModelChange:A,placeholder:"Model",variant:"borderless"}),e[87]=A,e[88]=we,e[89]=G):G=e[89];let le;e[90]!==a.messages?(le=t.jsx(Lt,{messages:a.messages}),e[90]=a.messages,e[91]=le):le=e[91];let fe;e[92]!==a.stop||e[93]!==C||e[94]!==_||e[95]!==ue||e[96]!==ve||e[97]!==Ce||e[98]!==ye||e[99]!==G||e[100]!==le?(fe=t.jsxs(Y.Input,{value:C,onChange:_,onSubmit:ue,onStop:a.stop,disabled:ve,isStreaming:Ce,placeholder:ye,children:[G,le]}),e[92]=a.stop,e[93]=C,e[94]=_,e[95]=ue,e[96]=ve,e[97]=Ce,e[98]=ye,e[99]=G,e[100]=le,e[101]=fe):fe=e[101];let ee;e[102]!==me||e[103]!==W||e[104]!==Se||e[105]!==fe?(ee=t.jsx(Y.Footer,{children:t.jsxs("div",{className:"max-w-2xl mx-auto w-full min-w-0 flex flex-col gap-2",children:[me,W,Se,fe]})}),e[102]=me,e[103]=W,e[104]=Se,e[105]=fe,e[106]=ee):ee=e[106];let Q;return e[107]!==K||e[108]!==ee?(Q=t.jsxs(Y,{children:[K,ee]}),e[107]=K,e[108]=ee,e[109]=Q):Q=e[109],Q}function Ss(n,e){return n.id===e.id&&n.connectionId===e.connectionId}function Cs(n){const e=Z.c(2);let s;return e[0]!==n?(s=t.jsx(Y.Provider,{children:t.jsx(ys,{...n})}),e[0]=n,e[1]=s):s=e[1],s}function ws(n){const e=Z.c(41),{form:s,gateway:o,icon:f}=n;let r;e[0]!==s?(r=s.watch("title")||"Gateway",e[0]=s,e[1]=r):r=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Xe,{}),e[2]=m):m=e[2];let g;e[3]!==f||e[4]!==r?(g=t.jsx(Fe,{icon:f,name:r,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=f,e[4]=r,e[5]=g):g=e[5];let c;e[6]!==s.control?(c=t.jsx(Re,{control:s.control,name:"status",render:ks}),e[6]=s.control,e[7]=c):c=e[7];let l;e[8]!==g||e[9]!==c?(l=t.jsxs("div",{className:"flex items-start justify-between",children:[g,c]}),e[8]=g,e[9]=c,e[10]=l):l=e[10];let d;e[11]!==s.control?(d=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(Re,{control:s.control,name:"title",render:Ts}),t.jsx(Re,{control:s.control,name:"description",render:Is})]}),e[11]=s.control,e[12]=d):d=e[12];let h;e[13]!==l||e[14]!==d?(h=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[l,d]}),e[13]=l,e[14]=d,e[15]=h):h=e[15];let p;e[16]!==s.control?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[t.jsx(Re,{control:s.control,name:"tool_selection_mode",render:_s}),t.jsx(Re,{control:s.control,name:"tool_selection_strategy",render:Ns})]}),e[16]=s.control,e[17]=p):p=e[17];let b;e[18]!==h||e[19]!==p?(b=t.jsxs("div",{className:"flex flex-col",children:[h,p]}),e[18]=h,e[19]=p,e[20]=b):b=e[20];let u;e[21]!==s||e[22]!==b?(u=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(qt,{...s,children:b})}),e[21]=s,e[22]=b,e[23]=u):u=e[23];let x;e[24]!==o.id||e[25]!==o.title?(x=o.title||`gateway-${o.id.slice(0,8)}`,e[24]=o.id,e[25]=o.title,e[26]=x):x=e[26];const v=`${window.location.origin}/mcp/gateway/${o.id}`;let N;e[27]!==x||e[28]!==v?(N=t.jsx("div",{className:"p-5",children:t.jsx(hs,{serverName:x,gatewayUrl:v})}),e[27]=x,e[28]=v,e[29]=N):N=e[29];let I;e[30]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[30]=I):I=e[30];let j;e[31]!==o.updated_at?(j=o.updated_at?ts(new Date(o.updated_at),{addSuffix:!1}):"Unknown",e[31]=o.updated_at,e[32]=j):j=e[32];let y;e[33]!==j?(y=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[I,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:j})]}),e[33]=j,e[34]=y):y=e[34];let S;e[35]!==N||e[36]!==y?(S=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[N,y]}),e[35]=N,e[36]=y,e[37]=S):S=e[37];let a;return e[38]!==u||e[39]!==S?(a=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[u,S]}),e[38]=u,e[39]=S,e[40]=a):a=e[40],a}function Ns(n){const{field:e}=n;return t.jsxs(De,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(rt,{className:"mb-0",children:"Gateway Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(pe,{children:t.jsxs(ge,{children:[t.jsx(je,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Gateway strategy help",children:t.jsx(it,{size:14,className:"text-muted-foreground"})})}),t.jsx(be,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," ","Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})}),t.jsxs(at,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Ge,{children:t.jsx(ct,{className:"w-[180px]",children:t.jsx(dt,{})})}),t.jsxs(mt,{children:[t.jsx(Ae,{value:"passthrough",children:"Passthrough"}),t.jsx(Ae,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(Ae,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(Ve,{})]})}function _s(n){const{field:e}=n;return t.jsxs(De,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(rt,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(pe,{children:t.jsxs(ge,{children:[t.jsx(je,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(it,{size:14,className:"text-muted-foreground"})})}),t.jsx(be,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected items are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All items except selected ones are exposed."]})]})})]})}),t.jsxs(at,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Ge,{children:t.jsx(ct,{className:"w-[180px]",children:t.jsx(dt,{})})}),t.jsxs(mt,{children:[t.jsx(Ae,{value:"inclusion",children:"Include Selected"}),t.jsx(Ae,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(Ve,{})]})}function Is(n){const{field:e}=n;return t.jsxs(De,{className:"w-full space-y-0",children:[t.jsx(Ge,{children:t.jsx(Ze,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Ve,{})]})}function Ts(n){const{field:e}=n;return t.jsxs(De,{className:"w-full space-y-0",children:[t.jsx(Ge,{children:t.jsx(Ze,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Gateway Name"})}),t.jsx(Ve,{})]})}function ks(n){const{field:e}=n;return t.jsxs(De,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),t.jsx(Ge,{children:t.jsx(_t,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(Ve,{})]})}function $s(n){const e=Z.c(104),{gateway:s,gatewayId:o,requestedTabId:f}=n,m=bt().location.href,g=vt();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/$org/gateways/$gatewayId"},e[0]=c):c=e[0];const l=Ye(c),d=Pt(),{locator:h}=lt(),[p,b]=$.useState("chat");let u;e[1]!==o||e[2]!==h?(u=ut.gatewayChatActiveThread(h,o),e[1]=o,e[2]=h,e[3]=u):u=e[3];const[x,v]=es(u,zs);let N;e[4]!==o?(N={gatewayId:o},e[4]=o,e[5]=N):N=e[5];const{threads:I,refetch:j}=Rt(N),y=ot();let S;e[6]!==y.update?(S=async M=>{await y.update.mutateAsync({id:M,updates:{hidden:!0}})},e[6]=y.update,e[7]=S):S=e[7];const a=S;let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C={},e[8]=C):C=e[8];const _=Qe(C);let E;e[9]!==_?(E=_.map(Ms),e[9]=_,e[10]=E):E=e[10];const R=E,{promptsMap:q}=Mt(R),{resourcesMap:U}=zt(R);let T;if(e[11]!==_){T=new Map;for(const M of _)M.tools&&M.tools.length>0&&T.set(M.id,M.tools.map(Ps));e[11]=_,e[12]=T}else T=e[12];let i;e[13]!==T||e[14]!==s?(i=()=>gs(s,T),e[13]=T,e[14]=s,e[15]=i):i=e[15];const[w,A]=$.useState(i);let F;e[16]!==s?(F=()=>js(s),e[16]=s,e[17]=F):F=e[17];const[P,V]=$.useState(F);let z;e[18]!==s?(z=()=>bs(s),e[18]=s,e[19]=z):z=e[19];const[k,X]=$.useState(z),[H,O]=$.useState(!1);let L;e[20]===Symbol.for("react.memo_cache_sentinel")?(L=M=>{A(M),O(!0)},e[20]=L):L=e[20];const se=L;let J;e[21]===Symbol.for("react.memo_cache_sentinel")?(J=M=>{V(M),O(!0)},e[21]=J):J=e[21];const ae=J;let ne;e[22]===Symbol.for("react.memo_cache_sentinel")?(ne=M=>{X(M),O(!0)},e[22]=ne):ne=e[22];const ce=ne;let K;e[23]===Symbol.for("react.memo_cache_sentinel")?(K=yt(ps),e[23]=K):K=e[23];const de=s.tool_selection_mode??"inclusion",me=s.tool_selection_strategy??"passthrough";let oe;e[24]!==s.description||e[25]!==s.status||e[26]!==s.title||e[27]!==de||e[28]!==me?(oe={resolver:K,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:de,tool_selection_strategy:me}},e[24]=s.description,e[25]=s.status,e[26]=s.title,e[27]=de,e[28]=me,e[29]=oe):oe=e[29];const W=St(oe),ue=W.formState.isDirty||H;let ve;e[30]!==d.update||e[31]!==T||e[32]!==W||e[33]!==o||e[34]!==k||e[35]!==P||e[36]!==w?(ve=async()=>{const M=W.getValues(),We=vs(w,P,k,T);await d.update.mutateAsync({id:o,data:{title:M.title,description:M.description,status:M.status,tool_selection_mode:M.tool_selection_mode,tool_selection_strategy:M.tool_selection_strategy,connections:We}}),W.reset(M),O(!1),b("chat")},e[30]=d.update,e[31]=T,e[32]=W,e[33]=o,e[34]=k,e[35]=P,e[36]=w,e[37]=ve):ve=e[37];const Ce=ve;let ye;e[38]===Symbol.for("react.memo_cache_sentinel")?(ye=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[38]=ye):ye=e[38];const we=ye,G=we.some(M=>M.id===f)?f:"settings";let le;e[39]!==l?(le=M=>{l({search:We=>({...We,tab:M}),replace:!0})},e[39]=l,e[40]=le):le=e[40];const fe=le,ee=d.update.isPending,Q=p==="edit";let D;e[41]!==g.history?(D=()=>g.history.back(),e[41]=g.history,e[42]=D):D=e[42];let B;e[43]!==G||e[44]!==s.description||e[45]!==s.icon||e[46]!==s.title||e[47]!==fe||e[48]!==Q?(B=t.jsx(Qt,{children:Q?t.jsx(Jt,{tabs:we,activeTab:G,onTabChange:fe}):t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx(Fe,{icon:s.icon,name:s.title||"Gateway",size:"xs",fallbackIcon:t.jsx(Xe,{size:12})}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.title}),s.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:s.description})]}):null]})]})}),e[43]=G,e[44]=s.description,e[45]=s.icon,e[46]=s.title,e[47]=fe,e[48]=Q,e[49]=B):B=e[49];const he=s.icon??"cpu_chip";let ie;e[50]!==s.title||e[51]!==he||e[52]!==m?(ie=t.jsx(Kt,{title:s.title,url:m,icon:he}),e[50]=s.title,e[51]=he,e[52]=m,e[53]=ie):ie=e[53];let re;e[54]!==x||e[55]!==a||e[56]!==Ce||e[57]!==ue||e[58]!==Q||e[59]!==ee||e[60]!==j||e[61]!==v||e[62]!==I?(re=Q?t.jsxs(t.Fragment,{children:[t.jsx(pe,{children:t.jsxs(ge,{delayDuration:0,children:[t.jsx(je,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(te,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ee,onClick:()=>b("chat"),"aria-label":"Cancel",children:t.jsx(Wt,{size:14})})})}),t.jsx(be,{side:"bottom",children:"Cancel"})]})}),ue&&t.jsx(pe,{children:t.jsxs(ge,{delayDuration:0,children:[t.jsx(je,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(te,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ee,onClick:Ce,"aria-label":"Save",children:ee?t.jsx(Le,{size:14,className:"animate-spin"}):t.jsx(ht,{size:14})})})}),t.jsx(be,{side:"bottom",children:"Save"})]})})]}):t.jsxs(t.Fragment,{children:[t.jsx(pe,{children:t.jsxs(ge,{children:[t.jsx(je,{asChild:!0,children:t.jsx(te,{type:"button",onClick:()=>v(crypto.randomUUID()),"aria-label":"New thread",variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(nt,{size:16})})}),t.jsx(be,{children:"New thread"})]})}),t.jsx(At,{threads:I,activeThreadId:x,onSelectThread:v,onRemoveThread:a,onOpen:()=>j(),variant:"outline"}),t.jsx(pe,{children:t.jsxs(ge,{children:[t.jsx(je,{asChild:!0,children:t.jsx(te,{type:"button",onClick:()=>b("edit"),"aria-label":"Edit",variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(ft,{size:16})})}),t.jsx(be,{children:"Edit Settings"})]})})]}),e[54]=x,e[55]=a,e[56]=Ce,e[57]=ue,e[58]=Q,e[59]=ee,e[60]=j,e[61]=v,e[62]=I,e[63]=re):re=e[63];let Ne;e[64]!==ie||e[65]!==re?(Ne=t.jsxs(Zt,{children:[ie,re]}),e[64]=ie,e[65]=re,e[66]=Ne):Ne=e[66];const Ue=Q?"opacity-0 pointer-events-none hidden":"opacity-100";let _e;e[67]!==Ue?(_e=xe("h-full transition-opacity duration-200 ease-out",Ue),e[67]=Ue,e[68]=_e):_e=e[68];let Ie;e[69]!==x||e[70]!==s||e[71]!==v?(Ie=t.jsx(Cs,{gateway:s,activeThreadId:x,setActiveThreadId:v}),e[69]=x,e[70]=s,e[71]=v,e[72]=Ie):Ie=e[72];let Te;e[73]!==_e||e[74]!==Ie?(Te=t.jsx("div",{className:_e,children:Ie}),e[73]=_e,e[74]=Ie,e[75]=Te):Te=e[75];const He=Q?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none hidden";let ke;e[76]!==He?(ke=xe("h-full overflow-auto transition-opacity duration-200 ease-out",He),e[76]=He,e[77]=ke):ke=e[77];let Be;e[78]===Symbol.for("react.memo_cache_sentinel")?(Be=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Le,{size:32,className:"animate-spin text-muted-foreground"})}),e[78]=Be):Be=e[78];let $e;e[79]!==G||e[80]!==q||e[81]!==U||e[82]!==W||e[83]!==s||e[84]!==k||e[85]!==P||e[86]!==w?($e=G==="settings"?t.jsx(ws,{form:W,gateway:s,icon:s.icon}):G==="tools"?t.jsx(Nt,{toolSet:w,onToolSetChange:se}):G==="resources"?t.jsx(ds,{resourceSet:P,onResourceSetChange:ae,connectionResources:U}):G==="prompts"?t.jsx(is,{promptSet:k,onPromptSetChange:ce,connectionPrompts:q}):null,e[79]=G,e[80]=q,e[81]=U,e[82]=W,e[83]=s,e[84]=k,e[85]=P,e[86]=w,e[87]=$e):$e=e[87];let Pe;e[88]!==$e?(Pe=t.jsx($.Suspense,{fallback:Be,children:$e}),e[88]=$e,e[89]=Pe):Pe=e[89];let Me;e[90]!==G||e[91]!==Pe?(Me=t.jsx(Ke,{children:Pe},G),e[90]=G,e[91]=Pe,e[92]=Me):Me=e[92];let ze;e[93]!==ke||e[94]!==Me?(ze=t.jsx("div",{className:ke,children:Me}),e[93]=ke,e[94]=Me,e[95]=ze):ze=e[95];let Ee;e[96]!==Te||e[97]!==ze?(Ee=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[Te,ze]})}),e[96]=Te,e[97]=ze,e[98]=Ee):Ee=e[98];let Oe;return e[99]!==D||e[100]!==B||e[101]!==Ne||e[102]!==Ee?(Oe=t.jsxs(Xt,{onBack:D,children:[B,Ne,Ee]}),e[99]=D,e[100]=B,e[101]=Ne,e[102]=Ee,e[103]=Oe):Oe=e[103],Oe}function Ps(n){return n.name}function Ms(n){return n.id}function zs(n){return n||crypto.randomUUID()}function Es(){const n=Z.c(10);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},n[0]=e):e=n[0];const s=Ye(e);let o;n[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/gateways/$gatewayId"},n[1]=o):o=n[1];const{gatewayId:f,org:r}=pt(o);let m;n[2]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/shell/$org/gateways/$gatewayId"},n[2]=m):m=n[2];const c=gt(m).tab||"settings",l=$t(f);if(!l){let h;return n[3]!==s||n[4]!==r?(h=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(wt,{title:"Gateway not found",description:"This gateway may have been deleted or you may not have access.",actions:t.jsx(te,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:r}}),children:"Back to gateways"})})}),n[3]=s,n[4]=r,n[5]=h):h=n[5],h}let d;return n[6]!==l||n[7]!==f||n[8]!==c?(d=t.jsx($s,{gateway:l,gatewayId:f,requestedTabId:c}),n[6]=l,n[7]=f,n[8]=c,n[9]=d):d=n[9],d}function Rs(){const n=Z.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ke,{children:t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Es,{})})}),n[0]=e):e=n[0],e}function En(){const n=Z.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Rs,{}),n[0]=e):e=n[0],e}export{En as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as te,j as t,r as se,f as ae,t as re}from"./index-tz4gB72W.js";import{C as ie}from"./collection-header-B--7sWbR.js";import{C as ne}from"./collection-page-B71dz4fa.js";import{C as le}from"./collection-search-CrC01K4Z.js";import{C as ce}from"./collection-table-wrapper-CFoaxah9.js";import{C as de}from"./connection-card-eAyda1Mu.js";import{E as q}from"./SearchMd-BFumDfkS.js";import{E as me}from"./error-boundary-D5hb-PLt.js";import{u as ue,I as ge}from"./use-connection-DRZbGk_A.js";import{a as pe,u as he}from"./use-gateway-CUxuCVmJ.js";import{u as fe,s as Q}from"./use-list-state-CkGBL95Z.js";import{u as xe}from"./tooltip-Bzy1O5cq.js";import{c as ye,b as we,d as je,A as Ce,e as Ne,g as De,a as Se,f as ve}from"./alert-dialog-_VCwcCen.js";import{B as oe}from"./badge-Dkhmn9Qj.js";import{B as J}from"./button-BSXU4L7C.js";import{b as U,D as X,a as Y,c as B}from"./dropdown-menu-ClBJUvd8.js";import{i as y}from"./CpuChip02-DwHhz9CA.js";import{i as Z}from"./DotsVertical-8kkJJG9R.js";import{i as be}from"./Loading01-B0vdyVbH.js";import{s as ee}from"./Trash01-1tKgR7uh.js";import"./collection-display-button-BAoFTB4b.js";import"./Grid01-BTunGha4.js";import"./view-mode-toggle-COcukfhX.js";import"./input-Cb7MaM0d.js";import"./card-CXFRieEW.js";import"./use-mobile-B8xlavN6.js";function ke(e,a){switch(a.type){case"delete":return{mode:"deleting",gateway:a.gateway};case"close":return{mode:"idle"}}}function _e(){const e=te.c(68),{org:a}=xe(),r=ae();let w;e[0]!==a.slug?(w={namespace:a.slug,resource:"gateways"},e[0]=a.slug,e[1]=w):w=e[1];const s=fe(w),i=pe(),x=he(s);let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j={},e[2]=j):j=e[2];const R=ue(j);let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={mode:"idle"},e[3]=C):C=e[3];const[n,N]=se.useReducer(ke,C);let D;e[4]!==i.create||e[5]!==R.length||e[6]!==r||e[7]!==a.slug?(D=async()=>{if(R.length===0){re.error("Create at least one MCP connection first");return}const o=await i.create.mutateAsync({title:"New Gateway",description:"Gateways let you securely expose integrated tools to the outside world.",status:"active",tool_selection_strategy:"passthrough",tool_selection_mode:"inclusion",connections:[]});r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},e[4]=i.create,e[5]=R.length,e[6]=r,e[7]=a.slug,e[8]=D):D=e[8];const T=D;let S;e[9]!==i.delete||e[10]!==n.gateway||e[11]!==n.mode?(S=async()=>{if(n.mode!=="deleting")return;const o=n.gateway.id;N({type:"close"});try{await i.delete.mutateAsync(o)}catch{}},e[9]=i.delete,e[10]=n.gateway,e[11]=n.mode,e[12]=S):S=e[12];const O=S;let v,b,k,_,M,I;e[13]===Symbol.for("react.memo_cache_sentinel")?(b={id:"icon",header:"",render:Be,cellClassName:"w-16 shrink-0",wrap:!0},k={id:"title",header:"Name",render:Ke,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},_={id:"description",header:"Description",render:Ge,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},M={id:"mode",header:"Mode",accessor:Ee,cellClassName:"w-[100px]"},I={id:"connections",header:"Connections",render:Ae,cellClassName:"w-24 shrink-0"},v={id:"status",header:"Status",render:ze,cellClassName:"w-24 shrink-0",sortable:!0},e[13]=v,e[14]=b,e[15]=k,e[16]=_,e[17]=M,e[18]=I):(v=e[13],b=e[14],k=e[15],_=e[16],M=e[17],I=e[18]);let P;e[19]!==r||e[20]!==a.slug?(P=[b,k,_,M,I,v,{id:"actions",header:"",render:o=>t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:$e,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Pe,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[19]=r,e[20]=a.slug,e[21]=P):P=e[21];const V=P,H=i.create.isPending?"Creating...":"Create MCP Gateway";let $;e[22]!==i.create.isPending||e[23]!==T||e[24]!==H?($=t.jsx(J,{onClick:T,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i.create.isPending,children:H}),e[22]=i.create.isPending,e[23]=T,e[24]=H,e[25]=$):$=e[25];const L=$,F=n.mode==="deleting";let z;e[26]===Symbol.for("react.memo_cache_sentinel")?(z=o=>!o&&N({type:"close"}),e[26]=z):z=e[26];let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ye,{children:"Delete Gateway?"}),e[27]=A):A=e[27];const W=n.mode==="deleting"&&n.gateway.title;let c;e[28]!==W?(c=t.jsxs(we,{children:[A,t.jsxs(je,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[28]=W,e[29]=c):c=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Ce,{children:"Cancel"}),e[30]=E):E=e[30];let d;e[31]!==O?(d=t.jsxs(Ne,{children:[E,t.jsx(De,{onClick:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[31]=O,e[32]=d):d=e[32];let m;e[33]!==c||e[34]!==d?(m=t.jsxs(Se,{children:[c,d]}),e[33]=c,e[34]=d,e[35]=m):m=e[35];let u;e[36]!==F||e[37]!==m?(u=t.jsx(ve,{open:F,onOpenChange:z,children:m}),e[36]=F,e[37]=m,e[38]=u):u=e[38];let G;e[39]===Symbol.for("react.memo_cache_sentinel")?(G=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[39]=G):G=e[39];let g;e[40]!==L||e[41]!==s.handleSort||e[42]!==s.setViewMode||e[43]!==s.sortDirection||e[44]!==s.sortKey||e[45]!==s.viewMode?(g=t.jsx(ie,{title:"MCP Gateways",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:G,ctaButton:L}),e[40]=L,e[41]=s.handleSort,e[42]=s.setViewMode,e[43]=s.sortDirection,e[44]=s.sortKey,e[45]=s.viewMode,e[46]=g):g=e[46];let p;e[47]!==s?(p=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[47]=s,e[48]=p):p=e[48];let h;e[49]!==s.search||e[50]!==s.setSearch||e[51]!==p?(h=t.jsx(le,{value:s.search,onChange:s.setSearch,placeholder:"Search for a gateway...",onKeyDown:p}),e[49]=s.search,e[50]=s.setSearch,e[51]=p,e[52]=h):h=e[52];let f;e[53]!==V||e[54]!==x||e[55]!==s.handleSort||e[56]!==s.search||e[57]!==s.sortDirection||e[58]!==s.sortKey||e[59]!==s.viewMode||e[60]!==r||e[61]!==a.slug?(f=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:x.length===0?t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:s.search?"No gateways found":"No gateways yet",description:s.search?`No gateways match "${s.search}"`:"Create a gateway to aggregate tools from multiple MCP connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:x.map(o=>t.jsx(de,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(y,{}),onClick:()=>r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ie,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Me,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ce,{columns:V,data:x,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:"No gateways found",description:`No gateways match "${s.search}"`}):t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:"No gateways yet",description:"Create a gateway to aggregate tools from multiple MCP connections."})}),e[53]=V,e[54]=x,e[55]=s.handleSort,e[56]=s.search,e[57]=s.sortDirection,e[58]=s.sortKey,e[59]=s.viewMode,e[60]=r,e[61]=a.slug,e[62]=f):f=e[62];let K;return e[63]!==u||e[64]!==g||e[65]!==h||e[66]!==f?(K=t.jsxs(ne,{children:[u,g,h,f]}),e[63]=u,e[64]=g,e[65]=h,e[66]=f,e[67]=K):K=e[67],K}function Me(e){return e.stopPropagation()}function Ie(e){return e.stopPropagation()}function Pe(e){return e.stopPropagation()}function $e(e){return e.stopPropagation()}function ze(e){return t.jsx(oe,{variant:e.status==="active"?"default":"outline",children:e.status})}function Ae(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function Ee(e){return t.jsx(oe,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Ge(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Ke(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Be(e){return t.jsx(ge,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(y,{size:16})})}function mt(){const e=te.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(me,{children:t.jsx(se.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(be,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(_e,{})})}),e[0]=a):a=e[0],a}export{mt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a3 as o}from"./index-tz4gB72W.js";import{r}from"./json-BESjz4hO.js";var s=r();const e=o(s);export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,h as i}from"./core-C9AbX0ks.js";import{a3 as s}from"./index-tz4gB72W.js";var g=o();const t=s(g);var e=i(t,{});e.registerLanguage=function(a,r){return t.register(r)};e.alias=function(a,r){return t.alias(a,r)};export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d,c as oe,j as E,a6 as Pt}from"./index-tz4gB72W.js";import{i as Ct}from"./tooltip-Bzy1O5cq.js";import{i as je}from"./CpuChip02-DwHhz9CA.js";import{i as It}from"./SearchMd-BFumDfkS.js";import{I as Qe}from"./use-connection-DRZbGk_A.js";import{R as Et,e as Rt,f as kt,g as Nt}from"./responsive-select-DwsIwS1V.js";import{c as Ie}from"./button-BSXU4L7C.js";import{u as Lt}from"./use-gateway-CUxuCVmJ.js";const et=({size:t=24,color:e="currentColor",...n})=>d.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},d.createElement("path",{d:"M12 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7-14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));et.displayName="DotsGrid";function At(){const t=oe.c(4),e=Lt();let n;t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1];let r;return t[2]!==n?(r=n.map($t),t[2]=n,t[3]=r):r=t[3],r}function $t(t){return{id:t.id,title:t.title,description:t.description??null,icon:t.icon??null,fallbackIcon:E.jsx(je,{})}}function Dt(t){const e=oe.c(24),{gateway:n,isSelected:r}=t,i=r&&"bg-accent";let o;e[0]!==i?(o=Ie("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-lg",i),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==n.fallbackIcon?(l=n.fallbackIcon??E.jsx(je,{}),e[2]=n.fallbackIcon,e[3]=l):l=e[3];let s;e[4]!==n.icon||e[5]!==n.title||e[6]!==l?(s=E.jsx(Qe,{icon:n.icon,name:n.title,size:"sm",fallbackIcon:l,className:"size-10"}),e[4]=n.icon,e[5]=n.title,e[6]=l,e[7]=s):s=e[7];let a;e[8]!==n.title?(a=E.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=a):a=e[9];let m;e[10]!==r?(m=r&&E.jsx(Ct,{size:16,className:"text-foreground shrink-0"}),e[10]=r,e[11]=m):m=e[11];let v;e[12]!==a||e[13]!==m?(v=E.jsxs("div",{className:"flex items-center justify-between",children:[a,m]}),e[12]=a,e[13]=m,e[14]=v):v=e[14];let u;e[15]!==n.description?(u=n.description&&E.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:n.description}),e[15]=n.description,e[16]=u):u=e[16];let c;e[17]!==v||e[18]!==u?(c=E.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[v,u]}),e[17]=v,e[18]=u,e[19]=c):c=e[19];let g;return e[20]!==o||e[21]!==s||e[22]!==c?(g=E.jsxs("div",{className:o,children:[s,c]}),e[20]=o,e[21]=s,e[22]=c,e[23]=g):g=e[23],g}function Mt(t){const e=oe.c(12),{gateway:n}=t;if(!n){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=E.jsx("span",{className:"text-sm text-muted-foreground",children:"Select gateway"}),e[0]=s):s=e[0],s}let r;e[1]!==n.fallbackIcon?(r=n.fallbackIcon??E.jsx(je,{}),e[1]=n.fallbackIcon,e[2]=r):r=e[2];let i;e[3]!==n.icon||e[4]!==n.title||e[5]!==r?(i=E.jsx(Qe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:r,className:"w-5! h-5! min-w-5! shrink-0 rounded-sm"}),e[3]=n.icon,e[4]=n.title,e[5]=r,e[6]=i):i=e[6];let o;e[7]!==n.title?(o=E.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors truncate min-w-0 max-w-[200px] hidden sm:inline-block",children:n.title}),e[7]=n.title,e[8]=o):o=e[8];let l;return e[9]!==i||e[10]!==o?(l=E.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-w-full",children:[i,o]}),e[9]=i,e[10]=o,e[11]=l):l=e[11],l}function yn(t){const e=oe.c(37),{selectedGatewayId:n,onGatewayChange:r,variant:i,className:o,placeholder:l}=t,s=i===void 0?"bordered":i,a=l===void 0?"Select gateway":l,[m,v]=d.useState(!1),u=At();let c;if(e[0]!==u||e[1]!==n){let A;e[3]!==n?(A=N=>N.id===n,e[3]=n,e[4]=A):A=e[4],c=u.find(A),e[0]=u,e[1]=n,e[2]=c}else c=e[2];const g=c;let x;e[5]!==r?(x=A=>{r(A),v(!1)},e[5]=r,e[6]=x):x=e[6];const C=x,I=n||"",b=s==="borderless"&&"border-0 md:border-none";let R;e[7]!==o||e[8]!==b?(R=Ie("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 max-w-full",b,o),e[7]=o,e[8]=b,e[9]=R):R=e[9];let L;e[10]!==g?(L=E.jsx(Mt,{gateway:g}),e[10]=g,e[11]=L):L=e[11];let D;e[12]!==a||e[13]!==L?(D=E.jsx(Et,{placeholder:a,className:"min-w-0 max-w-full",children:L}),e[12]=a,e[13]=L,e[14]=D):D=e[14];let T;e[15]!==R||e[16]!==D?(T=E.jsx(Rt,{size:"sm",className:R,children:D}),e[15]=R,e[16]=D,e[17]=T):T=e[17];let k;e[18]===Symbol.for("react.memo_cache_sentinel")?(k=E.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:E.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[E.jsx(It,{size:16}),E.jsx("span",{className:"text-sm",children:"Search for a gateway..."})]})}),e[18]=k):k=e[18];let y;if(e[19]!==u||e[20]!==C||e[21]!==n){let A;e[23]!==C||e[24]!==n?(A=N=>E.jsx("div",{onClick:()=>C(N.id),className:"outline-none",children:E.jsx(Dt,{gateway:N,isSelected:N.id===n})},N.id),e[23]=C,e[24]=n,e[25]=A):A=e[25],y=u.map(A),e[19]=u,e[20]=C,e[21]=n,e[22]=y}else y=e[22];let j;e[26]!==y?(j=E.jsxs("div",{className:"flex flex-col max-h-[400px]",children:[k,E.jsx("div",{className:"overflow-y-auto p-2 flex flex-col gap-1",children:y})]}),e[26]=y,e[27]=j):j=e[27];let V;e[28]!==a||e[29]!==j?(V=E.jsx(kt,{title:a,className:"w-full md:w-[400px] p-0",children:j}),e[28]=a,e[29]=j,e[30]=V):V=e[30];let G;return e[31]!==C||e[32]!==m||e[33]!==T||e[34]!==V||e[35]!==I?(G=E.jsxs(Nt,{open:m,onOpenChange:v,value:I,onValueChange:C,children:[T,V]}),e[31]=C,e[32]=m,e[33]=T,e[34]=V,e[35]=I,e[36]=G):G=e[36],G}const Ee=d.createContext(null);Ee.displayName="PanelGroupContext";const H={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Ge=10,ne=d.useLayoutEffect,Ke=Pt.useId,Ht=typeof Ke=="function"?Ke:()=>null;let _t=0;function Be(t=null){const e=Ht(),n=d.useRef(t||e||null);return n.current===null&&(n.current=""+_t++),t??n.current}function tt({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:l,maxSize:s,minSize:a,onCollapse:m,onExpand:v,onResize:u,order:c,style:g,tagName:x="div",...C}){const I=d.useContext(Ee);if(I===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:b,expandPanel:R,getPanelSize:L,getPanelStyle:D,groupId:T,isPanelCollapsed:k,reevaluatePanelConstraints:y,registerPanel:j,resizePanel:V,unregisterPanel:G}=I,A=Be(l),N=d.useRef({callbacks:{onCollapse:m,onExpand:v,onResize:u},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:s,minSize:a},id:A,idIsFromProps:l!==void 0,order:c});d.useRef({didLogMissingDefaultSizeWarning:!1}),ne(()=>{const{callbacks:W,constraints:B}=N.current,F={...B};N.current.id=A,N.current.idIsFromProps=l!==void 0,N.current.order=c,W.onCollapse=m,W.onExpand=v,W.onResize=u,B.collapsedSize=n,B.collapsible=r,B.defaultSize=i,B.maxSize=s,B.minSize=a,(F.collapsedSize!==B.collapsedSize||F.collapsible!==B.collapsible||F.maxSize!==B.maxSize||F.minSize!==B.minSize)&&y(N.current,F)}),ne(()=>{const W=N.current;return j(W),()=>{G(W)}},[c,A,j,G]),d.useImperativeHandle(o,()=>({collapse:()=>{b(N.current)},expand:W=>{R(N.current,W)},getId(){return A},getSize(){return L(N.current)},isCollapsed(){return k(N.current)},isExpanded(){return!k(N.current)},resize:W=>{V(N.current,W)}}),[b,R,L,k,A,V]);const Q=D(N.current,i);return d.createElement(x,{...C,children:t,className:e,id:A,style:{...Q,...g},[H.groupId]:T,[H.panel]:"",[H.panelCollapsible]:r||void 0,[H.panelId]:A,[H.panelSize]:parseFloat(""+Q.flexGrow).toFixed(1)})}const nt=d.forwardRef((t,e)=>d.createElement(tt,{...t,forwardedRef:e}));tt.displayName="Panel";nt.displayName="forwardRef(Panel)";let _e=null,we=-1,Y=null;function jt(t,e){if(e){const n=(e&st)!==0,r=(e&at)!==0,i=(e&ct)!==0,o=(e&ut)!==0;if(n)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Gt(){Y!==null&&(document.head.removeChild(Y),_e=null,Y=null,we=-1)}function Ae(t,e){var n,r;const i=jt(t,e);if(_e!==i){if(_e=i,Y===null&&(Y=document.createElement("style"),document.head.appendChild(Y)),we>=0){var o;(o=Y.sheet)===null||o===void 0||o.removeRule(we)}we=(n=(r=Y.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&n!==void 0?n:-1}}function rt(t){return t.type==="keydown"}function ot(t){return t.type.startsWith("pointer")}function it(t){return t.type.startsWith("mouse")}function Re(t){if(ot(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(it(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function Bt(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Tt(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function Vt(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:Ze(t),b:Ze(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;w(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:Oe(Ue(n.a)),b:Oe(Ue(n.b))};if(i.a===i.b){const o=r.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let s=o.length;for(;s--;){const a=o[s];if(a===l.a)return 1;if(a===l.b)return-1}}return Math.sign(i.a-i.b)}const Wt=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Ft(t){var e;const n=getComputedStyle((e=lt(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function Kt(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Ft(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||Wt.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Ue(t){let e=t.length;for(;e--;){const n=t[e];if(w(n,"Missing node"),Kt(n))return n}return null}function Oe(t){return t&&Number(getComputedStyle(t).zIndex)||0}function Ze(t){const e=[];for(;t;)e.push(t),t=lt(t);return e}function lt(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const st=1,at=2,ct=4,ut=8,Ut=Bt()==="coarse";let Z=[],ce=!1,te=new Map,ke=new Map;const ye=new Set;function Ot(t,e,n,r,i){var o;const{ownerDocument:l}=e,s={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:i},a=(o=te.get(l))!==null&&o!==void 0?o:0;return te.set(l,a+1),ye.add(s),Pe(),function(){var v;ke.delete(t),ye.delete(s);const u=(v=te.get(l))!==null&&v!==void 0?v:1;if(te.set(l,u-1),Pe(),u===1&&te.delete(l),Z.includes(s)){const c=Z.indexOf(s);c>=0&&Z.splice(c,1),Ve(),i("up",!0,null)}}}function Zt(t){const{target:e}=t,{x:n,y:r}=Re(t);ce=!0,Te({target:e,x:n,y:r}),Pe(),Z.length>0&&(Ce("down",t),t.preventDefault(),ft(e)||t.stopImmediatePropagation())}function $e(t){const{x:e,y:n}=Re(t);if(ce&&t.buttons===0&&(ce=!1,Ce("up",t)),!ce){const{target:r}=t;Te({target:r,x:e,y:n})}Ce("move",t),Ve(),Z.length>0&&t.preventDefault()}function De(t){const{target:e}=t,{x:n,y:r}=Re(t);ke.clear(),ce=!1,Z.length>0&&(t.preventDefault(),ft(e)||t.stopImmediatePropagation()),Ce("up",t),Te({target:e,x:n,y:r}),Ve(),Pe()}function ft(t){let e=t;for(;e;){if(e.hasAttribute(H.resizeHandle))return!0;e=e.parentElement}return!1}function Te({target:t,x:e,y:n}){Z.splice(0);let r=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(r=t),ye.forEach(i=>{const{element:o,hitAreaMargins:l}=i,s=o.getBoundingClientRect(),{bottom:a,left:m,right:v,top:u}=s,c=Ut?l.coarse:l.fine;if(e>=m-c&&e<=v+c&&n>=u-c&&n<=a+c){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&Vt(r,o)>0){let x=r,C=!1;for(;x&&!x.contains(o);){if(Tt(x.getBoundingClientRect(),s)){C=!0;break}x=x.parentElement}if(C)return}Z.push(i)}})}function Me(t,e){ke.set(t,e)}function Ve(){let t=!1,e=!1;Z.forEach(r=>{const{direction:i}=r;i==="horizontal"?t=!0:e=!0});let n=0;ke.forEach(r=>{n|=r}),t&&e?Ae("intersection",n):t?Ae("horizontal",n):e?Ae("vertical",n):Gt()}let He=new AbortController;function Pe(){He.abort(),He=new AbortController;const t={capture:!0,signal:He.signal};ye.size&&(ce?(Z.length>0&&te.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("contextmenu",De,t),r.addEventListener("pointerleave",$e,t),r.addEventListener("pointermove",$e,t))}),window.addEventListener("pointerup",De,t),window.addEventListener("pointercancel",De,t)):te.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("pointerdown",Zt,t),r.addEventListener("pointermove",$e,t))}))}function Ce(t,e){ye.forEach(n=>{const{setResizeHandlerState:r}=n,i=Z.includes(n);r(t,i,e)})}function qt(){const[t,e]=d.useState(0);return d.useCallback(()=>e(n=>n+1),[])}function w(t,e){if(!t)throw console.error(e),Error(e)}function re(t,e,n=Ge){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function J(t,e,n=Ge){return re(t,e,n)===0}function U(t,e,n){return re(t,e,n)===0}function Xt(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++){const i=t[r],o=e[r];if(!U(i,o,n))return!1}return!0}function ae({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];w(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:o,maxSize:l=100,minSize:s=0}=r;if(re(n,s)<0)if(o){const a=(i+s)/2;re(n,a)<0?n=i:n=s}else n=s;return n=Math.min(l,n),n=parseFloat(n.toFixed(Ge)),n}function xe({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:o}){if(U(t,0))return e;const l=[...e],[s,a]=r;w(s!=null,"Invalid first pivot index"),w(a!=null,"Invalid second pivot index");let m=0;if(o==="keyboard"){{const u=t<0?a:s,c=n[u];w(c,`Panel constraints not found for index ${u}`);const{collapsedSize:g=0,collapsible:x,minSize:C=0}=c;if(x){const I=e[u];if(w(I!=null,`Previous layout not found for panel index ${u}`),U(I,g)){const b=C-I;re(b,Math.abs(t))>0&&(t=t<0?0-b:b)}}}{const u=t<0?s:a,c=n[u];w(c,`No panel constraints found for index ${u}`);const{collapsedSize:g=0,collapsible:x,minSize:C=0}=c;if(x){const I=e[u];if(w(I!=null,`Previous layout not found for panel index ${u}`),U(I,C)){const b=I-g;re(b,Math.abs(t))>0&&(t=t<0?0-b:b)}}}}{const u=t<0?1:-1;let c=t<0?a:s,g=0;for(;;){const C=e[c];w(C!=null,`Previous layout not found for panel index ${c}`);const b=ae({panelConstraints:n,panelIndex:c,size:100})-C;if(g+=b,c+=u,c<0||c>=n.length)break}const x=Math.min(Math.abs(t),Math.abs(g));t=t<0?0-x:x}{let c=t<0?s:a;for(;c>=0&&c<n.length;){const g=Math.abs(t)-Math.abs(m),x=e[c];w(x!=null,`Previous layout not found for panel index ${c}`);const C=x-g,I=ae({panelConstraints:n,panelIndex:c,size:C});if(!U(x,I)&&(m+=x-I,l[c]=I,m.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?c--:c++}}if(Xt(i,l))return i;{const u=t<0?a:s,c=e[u];w(c!=null,`Previous layout not found for panel index ${u}`);const g=c+m,x=ae({panelConstraints:n,panelIndex:u,size:g});if(l[u]=x,!U(x,g)){let C=g-x,b=t<0?a:s;for(;b>=0&&b<n.length;){const R=l[b];w(R!=null,`Previous layout not found for panel index ${b}`);const L=R+C,D=ae({panelConstraints:n,panelIndex:b,size:L});if(U(R,D)||(C-=D-R,l[b]=D),U(C,0))break;t>0?b--:b++}}}const v=l.reduce((u,c)=>c+u,0);return U(v,100)?l:i}function Jt({layout:t,panelsArray:e,pivotIndices:n}){let r=0,i=100,o=0,l=0;const s=n[0];w(s!=null,"No pivot index found"),e.forEach((u,c)=>{const{constraints:g}=u,{maxSize:x=100,minSize:C=0}=g;c===s?(r=C,i=x):(o+=C,l+=x)});const a=Math.min(i,100-o),m=Math.max(r,100-l),v=t[s];return{valueMax:a,valueMin:m,valueNow:v}}function ze(t,e=document){return Array.from(e.querySelectorAll(`[${H.resizeHandleId}][data-panel-group-id="${t}"]`))}function dt(t,e,n=document){const i=ze(t,n).findIndex(o=>o.getAttribute(H.resizeHandleId)===e);return i??null}function pt(t,e,n){const r=dt(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function mt(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return r||null}function Ne(t,e=document){const n=e.querySelector(`[${H.resizeHandleId}="${t}"]`);return n||null}function Yt(t,e,n,r=document){var i,o,l,s;const a=Ne(e,r),m=ze(t,r),v=a?m.indexOf(a):-1,u=(i=(o=n[v])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,c=(l=(s=n[v+1])===null||s===void 0?void 0:s.id)!==null&&l!==void 0?l:null;return[u,c]}function Qt({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:l}){d.useRef({didWarnAboutMissingResizeHandle:!1}),ne(()=>{if(!o)return;const s=ze(n,o);for(let a=0;a<i.length-1;a++){const{valueMax:m,valueMin:v,valueNow:u}=Jt({layout:r,panelsArray:i,pivotIndices:[a,a+1]}),c=s[a];if(c!=null){const g=i[a];w(g,`No panel data found for index "${a}"`),c.setAttribute("aria-controls",g.id),c.setAttribute("aria-valuemax",""+Math.round(m)),c.setAttribute("aria-valuemin",""+Math.round(v)),c.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{s.forEach((a,m)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,i,o]),d.useEffect(()=>{if(!o)return;const s=e.current;w(s,"Eager values not found");const{panelDataArray:a}=s,m=mt(n,o);w(m!=null,`No group found for id "${n}"`);const v=ze(n,o);w(v,`No resize handles found for group id "${n}"`);const u=v.map(c=>{const g=c.getAttribute(H.resizeHandleId);w(g,"Resize handle element has no handle id attribute");const[x,C]=Yt(n,g,a,o);if(x==null||C==null)return()=>{};const I=b=>{if(!b.defaultPrevented)switch(b.key){case"Enter":{b.preventDefault();const R=a.findIndex(L=>L.id===x);if(R>=0){const L=a[R];w(L,`No panel data found for index ${R}`);const D=r[R],{collapsedSize:T=0,collapsible:k,minSize:y=0}=L.constraints;if(D!=null&&k){const j=xe({delta:U(D,T)?y-T:T-D,initialLayout:r,panelConstraints:a.map(V=>V.constraints),pivotIndices:pt(n,g,o),prevLayout:r,trigger:"keyboard"});r!==j&&l(j)}}break}}};return c.addEventListener("keydown",I),()=>{c.removeEventListener("keydown",I)}});return()=>{u.forEach(c=>c())}},[o,t,e,n,r,i,l])}function qe(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function gt(t,e){const n=t==="horizontal",{x:r,y:i}=Re(e);return n?r:i}function en(t,e,n,r,i){const o=n==="horizontal",l=Ne(e,i);w(l,`No resize handle element found for id "${e}"`);const s=l.getAttribute(H.groupId);w(s,"Resize handle element has no group id attribute");let{initialCursorPosition:a}=r;const m=gt(n,t),v=mt(s,i);w(v,`No group element found for id "${s}"`);const u=v.getBoundingClientRect(),c=o?u.width:u.height;return(m-a)/c*100}function tn(t,e,n,r,i,o){if(rt(t)){const l=n==="horizontal";let s=0;t.shiftKey?s=100:i!=null?s=i:s=10;let a=0;switch(t.key){case"ArrowDown":a=l?0:s;break;case"ArrowLeft":a=l?-s:0;break;case"ArrowRight":a=l?s:0;break;case"ArrowUp":a=l?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:en(t,e,n,r,o)}function nn({panelDataArray:t}){const e=Array(t.length),n=t.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<t.length;o++){const l=n[o];w(l,`Panel constraints not found for index ${o}`);const{defaultSize:s}=l;s!=null&&(r++,e[o]=s,i-=s)}for(let o=0;o<t.length;o++){const l=n[o];w(l,`Panel constraints not found for index ${o}`);const{defaultSize:s}=l;if(s!=null)continue;const a=t.length-r,m=i/a;r++,e[o]=m,i-=m}return e}function le(t,e,n){e.forEach((r,i)=>{const o=t[i];w(o,`Panel data not found for index ${i}`);const{callbacks:l,constraints:s,id:a}=o,{collapsedSize:m=0,collapsible:v}=s,u=n[a];if(u==null||r!==u){n[a]=r;const{onCollapse:c,onExpand:g,onResize:x}=l;x&&x(r,u),v&&(c||g)&&(g&&(u==null||J(u,m))&&!J(r,m)&&g(),c&&(u==null||!J(u,m))&&J(r,m)&&c())}})}function Se(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function rn({defaultSize:t,dragState:e,layout:n,panelData:r,panelIndex:i,precision:o=3}){const l=n[i];let s;return l==null?s=t!=null?t.toPrecision(o):"1":r.length===1?s="1":s=l.toPrecision(o),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function on(t,e=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...i)},e)}}function Xe(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function xt(t){return`react-resizable-panels:${t}`}function ht(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:i,order:o}=e;return i?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function yt(t,e){try{const n=xt(t),r=e.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function ln(t,e,n){var r,i;const o=(r=yt(t,n))!==null&&r!==void 0?r:{},l=ht(e);return(i=o[l])!==null&&i!==void 0?i:null}function sn(t,e,n,r,i){var o;const l=xt(t),s=ht(e),a=(o=yt(t,i))!==null&&o!==void 0?o:{};a[s]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(l,JSON.stringify(a))}catch(m){console.error(m)}}function Je({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((o,l)=>o+l,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!U(r,100)&&n.length>0)for(let o=0;o<e.length;o++){const l=n[o];w(l!=null,`No layout data found for index ${o}`);const s=100/r*l;n[o]=s}let i=0;for(let o=0;o<e.length;o++){const l=n[o];w(l!=null,`No layout data found for index ${o}`);const s=ae({panelConstraints:e,panelIndex:o,size:l});l!=s&&(i+=l-s,n[o]=s)}if(!U(i,0))for(let o=0;o<e.length;o++){const l=n[o];w(l!=null,`No layout data found for index ${o}`);const s=l+i,a=ae({panelConstraints:e,panelIndex:o,size:s});if(l!==a&&(i-=a-l,n[o]=a,U(i,0)))break}return n}const an=100,he={getItem:t=>(Xe(he),he.getItem(t)),setItem:(t,e)=>{Xe(he),he.setItem(t,e)}},Ye={};function zt({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:l=null,keyboardResizeBy:s=null,storage:a=he,style:m,tagName:v="div",...u}){const c=Be(o),g=d.useRef(null),[x,C]=d.useState(null),[I,b]=d.useState([]),R=qt(),L=d.useRef({}),D=d.useRef(new Map),T=d.useRef(0),k=d.useRef({autoSaveId:t,direction:r,dragState:x,id:c,keyboardResizeBy:s,onLayout:l,storage:a}),y=d.useRef({layout:I,panelDataArray:[],panelDataArrayChanged:!1});d.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),d.useImperativeHandle(i,()=>({getId:()=>k.current.id,getLayout:()=>{const{layout:f}=y.current;return f},setLayout:f=>{const{onLayout:z}=k.current,{layout:P,panelDataArray:h}=y.current,p=Je({layout:f,panelConstraints:h.map(S=>S.constraints)});qe(P,p)||(b(p),y.current.layout=p,z&&z(p),le(h,p,L.current))}}),[]),ne(()=>{k.current.autoSaveId=t,k.current.direction=r,k.current.dragState=x,k.current.id=c,k.current.onLayout=l,k.current.storage=a}),Qt({committedValuesRef:k,eagerValuesRef:y,groupId:c,layout:I,panelDataArray:y.current.panelDataArray,setLayout:b,panelGroupElement:g.current}),d.useEffect(()=>{const{panelDataArray:f}=y.current;if(t){if(I.length===0||I.length!==f.length)return;let z=Ye[t];z==null&&(z=on(sn,an),Ye[t]=z);const P=[...f],h=new Map(D.current);z(t,P,h,I,a)}},[t,I,a]),d.useEffect(()=>{});const j=d.useCallback(f=>{const{onLayout:z}=k.current,{layout:P,panelDataArray:h}=y.current;if(f.constraints.collapsible){const p=h.map(q=>q.constraints),{collapsedSize:S=0,panelSize:$,pivotIndices:_}=ee(h,f,P);if(w($!=null,`Panel size not found for panel "${f.id}"`),!J($,S)){D.current.set(f.id,$);const X=se(h,f)===h.length-1?$-S:S-$,M=xe({delta:X,initialLayout:P,panelConstraints:p,pivotIndices:_,prevLayout:P,trigger:"imperative-api"});Se(P,M)||(b(M),y.current.layout=M,z&&z(M),le(h,M,L.current))}}},[]),V=d.useCallback((f,z)=>{const{onLayout:P}=k.current,{layout:h,panelDataArray:p}=y.current;if(f.constraints.collapsible){const S=p.map(O=>O.constraints),{collapsedSize:$=0,panelSize:_=0,minSize:q=0,pivotIndices:X}=ee(p,f,h),M=z??q;if(J(_,$)){const O=D.current.get(f.id),me=O!=null&&O>=M?O:M,Le=se(p,f)===p.length-1?_-me:me-_,K=xe({delta:Le,initialLayout:h,panelConstraints:S,pivotIndices:X,prevLayout:h,trigger:"imperative-api"});Se(h,K)||(b(K),y.current.layout=K,P&&P(K),le(p,K,L.current))}}},[]),G=d.useCallback(f=>{const{layout:z,panelDataArray:P}=y.current,{panelSize:h}=ee(P,f,z);return w(h!=null,`Panel size not found for panel "${f.id}"`),h},[]),A=d.useCallback((f,z)=>{const{panelDataArray:P}=y.current,h=se(P,f);return rn({defaultSize:z,dragState:x,layout:I,panelData:P,panelIndex:h})},[x,I]),N=d.useCallback(f=>{const{layout:z,panelDataArray:P}=y.current,{collapsedSize:h=0,collapsible:p,panelSize:S}=ee(P,f,z);return w(S!=null,`Panel size not found for panel "${f.id}"`),p===!0&&J(S,h)},[]),Q=d.useCallback(f=>{const{layout:z,panelDataArray:P}=y.current,{collapsedSize:h=0,collapsible:p,panelSize:S}=ee(P,f,z);return w(S!=null,`Panel size not found for panel "${f.id}"`),!p||re(S,h)>0},[]),W=d.useCallback(f=>{const{panelDataArray:z}=y.current;z.push(f),z.sort((P,h)=>{const p=P.order,S=h.order;return p==null&&S==null?0:p==null?-1:S==null?1:p-S}),y.current.panelDataArrayChanged=!0,R()},[R]);ne(()=>{if(y.current.panelDataArrayChanged){y.current.panelDataArrayChanged=!1;const{autoSaveId:f,onLayout:z,storage:P}=k.current,{layout:h,panelDataArray:p}=y.current;let S=null;if(f){const _=ln(f,p,P);_&&(D.current=new Map(Object.entries(_.expandToSizes)),S=_.layout)}S==null&&(S=nn({panelDataArray:p}));const $=Je({layout:S,panelConstraints:p.map(_=>_.constraints)});qe(h,$)||(b($),y.current.layout=$,z&&z($),le(p,$,L.current))}}),ne(()=>{const f=y.current;return()=>{f.layout=[]}},[]);const B=d.useCallback(f=>{let z=!1;const P=g.current;return P&&window.getComputedStyle(P,null).getPropertyValue("direction")==="rtl"&&(z=!0),function(p){p.preventDefault();const S=g.current;if(!S)return()=>null;const{direction:$,dragState:_,id:q,keyboardResizeBy:X,onLayout:M}=k.current,{layout:O,panelDataArray:me}=y.current,{initialLayout:be}=_??{},Le=pt(q,f,S);let K=tn(p,f,$,_,X,S);const We=$==="horizontal";We&&z&&(K=-K);const St=me.map(wt=>wt.constraints),ge=xe({delta:K,initialLayout:be??O,panelConstraints:St,pivotIndices:Le,prevLayout:O,trigger:rt(p)?"keyboard":"mouse-or-touch"}),Fe=!Se(O,ge);(ot(p)||it(p))&&T.current!=K&&(T.current=K,!Fe&&K!==0?We?Me(f,K<0?st:at):Me(f,K<0?ct:ut):Me(f,0)),Fe&&(b(ge),y.current.layout=ge,M&&M(ge),le(me,ge,L.current))}},[]),F=d.useCallback((f,z)=>{const{onLayout:P}=k.current,{layout:h,panelDataArray:p}=y.current,S=p.map(O=>O.constraints),{panelSize:$,pivotIndices:_}=ee(p,f,h);w($!=null,`Panel size not found for panel "${f.id}"`);const X=se(p,f)===p.length-1?$-z:z-$,M=xe({delta:X,initialLayout:h,panelConstraints:S,pivotIndices:_,prevLayout:h,trigger:"imperative-api"});Se(h,M)||(b(M),y.current.layout=M,P&&P(M),le(p,M,L.current))},[]),ue=d.useCallback((f,z)=>{const{layout:P,panelDataArray:h}=y.current,{collapsedSize:p=0,collapsible:S}=z,{collapsedSize:$=0,collapsible:_,maxSize:q=100,minSize:X=0}=f.constraints,{panelSize:M}=ee(h,f,P);M!=null&&(S&&_&&J(M,p)?J(p,$)||F(f,$):M<X?F(f,X):M>q&&F(f,q))},[F]),fe=d.useCallback((f,z)=>{const{direction:P}=k.current,{layout:h}=y.current;if(!g.current)return;const p=Ne(f,g.current);w(p,`Drag handle element not found for id "${f}"`);const S=gt(P,z);C({dragHandleId:f,dragHandleRect:p.getBoundingClientRect(),initialCursorPosition:S,initialLayout:h})},[]),de=d.useCallback(()=>{C(null)},[]),ve=d.useCallback(f=>{const{panelDataArray:z}=y.current,P=se(z,f);P>=0&&(z.splice(P,1),delete L.current[f.id],y.current.panelDataArrayChanged=!0,R())},[R]),ie=d.useMemo(()=>({collapsePanel:j,direction:r,dragState:x,expandPanel:V,getPanelSize:G,getPanelStyle:A,groupId:c,isPanelCollapsed:N,isPanelExpanded:Q,reevaluatePanelConstraints:ue,registerPanel:W,registerResizeHandle:B,resizePanel:F,startDragging:fe,stopDragging:de,unregisterPanel:ve,panelGroupElement:g.current}),[j,x,r,V,G,A,c,N,Q,ue,W,B,F,fe,de,ve]),pe={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return d.createElement(Ee.Provider,{value:ie},d.createElement(v,{...u,children:e,className:n,id:o,ref:g,style:{...pe,...m},[H.group]:"",[H.groupDirection]:r,[H.groupId]:c}))}const vt=d.forwardRef((t,e)=>d.createElement(zt,{...t,forwardedRef:e}));zt.displayName="PanelGroup";vt.displayName="forwardRef(PanelGroup)";function se(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function ee(t,e,n){const r=se(t,e),o=r===t.length-1?[r-1,r]:[r,r+1],l=n[r];return{...e.constraints,panelSize:l,pivotIndices:o}}function cn({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){d.useEffect(()=>{if(t||n==null||r==null)return;const i=Ne(e,r);if(i==null)return;const o=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),n(l);break}case"F6":{l.preventDefault();const s=i.getAttribute(H.groupId);w(s,`No group element found for id "${s}"`);const a=ze(s,r),m=dt(s,e,r);w(m!==null,`No resize element found for id "${e}"`);const v=l.shiftKey?m>0?m-1:a.length-1:m+1<a.length?m+1:0;a[v].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,t,e,n])}function bt({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:i,onBlur:o,onClick:l,onDragging:s,onFocus:a,onPointerDown:m,onPointerUp:v,style:u={},tabIndex:c=0,tagName:g="div",...x}){var C,I;const b=d.useRef(null),R=d.useRef({onClick:l,onDragging:s,onPointerDown:m,onPointerUp:v});d.useEffect(()=>{R.current.onClick=l,R.current.onDragging=s,R.current.onPointerDown=m,R.current.onPointerUp=v});const L=d.useContext(Ee);if(L===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:D,groupId:T,registerResizeHandle:k,startDragging:y,stopDragging:j,panelGroupElement:V}=L,G=Be(i),[A,N]=d.useState("inactive"),[Q,W]=d.useState(!1),[B,F]=d.useState(null),ue=d.useRef({state:A});ne(()=>{ue.current.state=A}),d.useEffect(()=>{if(n)F(null);else{const ie=k(G);F(()=>ie)}},[n,G,k]);const fe=(C=r?.coarse)!==null&&C!==void 0?C:15,de=(I=r?.fine)!==null&&I!==void 0?I:5;d.useEffect(()=>{if(n||B==null)return;const ie=b.current;w(ie,"Element ref not attached");let pe=!1;return Ot(G,ie,D,{coarse:fe,fine:de},(z,P,h)=>{if(!P){N("inactive");return}switch(z){case"down":{N("drag"),pe=!1,w(h,'Expected event to be defined for "down" action'),y(G,h);const{onDragging:p,onPointerDown:S}=R.current;p?.(!0),S?.();break}case"move":{const{state:p}=ue.current;pe=!0,p!=="drag"&&N("hover"),w(h,'Expected event to be defined for "move" action'),B(h);break}case"up":{N("hover"),j();const{onClick:p,onDragging:S,onPointerUp:$}=R.current;S?.(!1),$?.(),pe||p?.();break}}})},[fe,D,n,de,k,G,B,y,j]),cn({disabled:n,handleId:G,resizeHandler:B,panelGroupElement:V});const ve={touchAction:"none",userSelect:"none"};return d.createElement(g,{...x,children:t,className:e,id:i,onBlur:()=>{W(!1),o?.()},onFocus:()=>{W(!0),a?.()},ref:b,role:"separator",style:{...ve,...u},tabIndex:c,[H.groupDirection]:D,[H.groupId]:T,[H.resizeHandle]:"",[H.resizeHandleActive]:A==="drag"?"pointer":Q?"keyboard":void 0,[H.resizeHandleEnabled]:!n,[H.resizeHandleId]:G,[H.resizeHandleState]:A})}bt.displayName="PanelResizeHandle";function zn(t){const e=oe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ie("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==r||e[6]!==i?(o=E.jsx(vt,{"data-slot":"resizable-panel-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=o):o=e[7],o}function vn(t){const e=oe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=E.jsx(nt,{"data-slot":"resizable-panel",...n}),e[2]=n,e[3]=r):r=e[3],r}function bn(t){const e=oe.c(12);let n,r,i;e[0]!==t?({withHandle:i,className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let o;e[4]!==n?(o=Ie("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",n),e[4]=n,e[5]=o):o=e[5];let l;e[6]!==i?(l=i&&E.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:E.jsx(et,{className:"size-2.5"})}),e[6]=i,e[7]=l):l=e[7];let s;return e[8]!==r||e[9]!==o||e[10]!==l?(s=E.jsx(bt,{"data-slot":"resizable-handle",className:o,...r,children:l}),e[8]=r,e[9]=o,e[10]=l,e[11]=s):s=e[11],s}export{yn as G,vn as R,bn as a,zn as b,At as u};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import{r as S,c as p,e as Kt,d as st,K as pt,t as Je,j as a,f as Be,a as Ce,g as Zt,R as Yt,T as qt,D as Qt,C as Xt,P as Jt,h as es,O as ts,i as ss,k as ns,l as as,m as ls,G as os,U as is,n as rs,S as xt,o as cs,p as ds,N as ms,q as fs,s as gt}from"./index-tz4gB72W.js";import{E as us}from"./SearchMd-BFumDfkS.js";import{u as hs,I as it,n as ps}from"./use-connection-DRZbGk_A.js";import{u as nt,L as He}from"./localstorage-keys-DIkWdWYS.js";import{u as ye,T as xs,a as gs,b as bs,c as vs,L as rt,i as js,P as ws,O as Ss}from"./tooltip-Bzy1O5cq.js";import{B as Y,c as M}from"./button-BSXU4L7C.js";import{i as et}from"./CpuChip02-DwHhz9CA.js";import{i as Ns}from"./Loading01-B0vdyVbH.js";import{s as Cs}from"./Plus-nu8-Nz8b.js";import{i as Re}from"./X-hEo9Za23.js";import{u as ys}from"./use-binding-jUI3xZmp.js";import{C as E,u as ct,a as _s,b as ks,c as dt,d as Is,N as $s,G as Ms,U as zs,T as Ts,M as Os}from"./thread-history-popover-DbEl1KJu.js";import{E as at}from"./error-boundary-D5hb-PLt.js";import{u as Es,G as As,R as bt,a as Ps,b as Ds}from"./resizable-Ck5ltOjh.js";import{i as Ls}from"./File06-DxUGl7Wc.js";import{u as _e}from"./use-mobile-B8xlavN6.js";import{u as vt,a as Rs}from"./use-organization-settings-C7IdFOTo.js";import{C as Bs}from"./create-organization-dialog-DhHOFwW5.js";import{I as Hs}from"./input-Cb7MaM0d.js";import{P as Us,a as Gs,b as Ws}from"./popover-BPqLZ76M.js";import{A as Ne}from"./avatar-DHKqC-IM.js";import{c as Vs}from"./Grid01-BTunGha4.js";import{D as Fs,a as Ks,b as Zs,c as Ys,u as qs,d as Qs}from"./responsive-select-DwsIwS1V.js";import{D as Xs,a as Js,b as en,c as tn,d as mt}from"./dropdown-menu-ClBJUvd8.js";import{a as sn}from"./Copy01-CCVZH6f1.js";import{n as ft}from"./LinkExternal01-WcFL8RpQ.js";import{D as jt,a as wt,b as St,c as Nt,d as Ct}from"./dialog-Cj2udzC-.js";import"./useQuery-Bl78N6vT.js";import"./auth-BpfHzPVh.js";import"./AlertCircle-B6rEUVLf.js";import"./textarea-BAs6HmBZ.js";import"./Terminal-CDIp_seB.js";import"./connection-card-eAyda1Mu.js";import"./card-CXFRieEW.js";import"./json-syntax-highlighter-CCgbux_M.js";import"./alert-dialog-_VCwcCen.js";import"./well-known-mcp-VNRT0JrW.js";import"./generate-id-Dyweu44Y.js";import"./Clock-DS2iGkSJ.js";import"./Trash01-1tKgR7uh.js";import"./use-gateway-CUxuCVmJ.js";import"./form-Dn7fy5O5.js";import"./spinner-BUVePO6d.js";import"./select-HGITgxwS.js";import"./ChevronDown-rNVX3ifZ.js";const yt=({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"}));yt.displayName="BarChart10";const _t=({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"}));_t.displayName="Building02";const kt=({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:"m7 15 5 5 5-5M7 9l5-5 5 5"}));kt.displayName="ChevronSelectorVertical";const It=({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"}));It.displayName="Globe01";const $t=({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 21v-7.4c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 12 10.04 12 10.6 12h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 12.76 15 13.04 15 13.6V21M11.018 2.764 4.235 8.039c-.453.353-.68.53-.843.75a2 2 0 0 0-.318.65C3 9.704 3 9.991 3 10.565V17.8c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8v-7.235c0-.574 0-.861-.074-1.126a2.002 2.002 0 0 0-.318-.65c-.163-.22-.39-.397-.843-.75l-6.783-5.275c-.351-.273-.527-.41-.72-.462a1 1 0 0 0-.523 0c-.194.052-.37.189-.721.462Z"}));$t.displayName="Home02";const Mt=({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"}));Mt.displayName="LayoutRight";const zt=({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"}));zt.displayName="LogOut01";const Tt=({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"}));Tt.displayName="Mail01";const Ot=({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"}));Ot.displayName="Settings01";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:"M5.316 19.438A4.001 4.001 0 0 1 9 17h6a4.001 4.001 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Et.displayName="UserCircle";const At=({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"}));At.displayName="Users01";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:"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"}));Pt.displayName="Zap";function lt(){const t=p.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=He.decoChatOpen(),t[0]=e):e=t[0];const[s,l]=nt(e,nn);let n;return t[1]!==s||t[2]!==l?(n=[s,l],t[1]=s,t[2]=l,t[3]=n):n=t[3],n}function nn(t){return!!(t??!1)}function an(){const t=p.c(5),e=Kt(),{org:s}=ye();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const n=st(l);let o;return t[1]!==s||t[2]!==n||t[3]!==e?(o=i=>{const r=i.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!r||!r[1])return;const d=r[1],m=n.connectionId;if(!m)return;e.invalidateQueries({queryKey:pt.collection(s.slug,m,d)});const f=d.toLowerCase().replace(/_/g," ");Je.success(`${f} updated`)},t[1]=s,t[2]=n,t[3]=e,t[4]=o):o=t[4],o}const ln="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function on(t){const e=/\/[^/]+\/mcps\/([^/]+)\/([^/]+)\/([^/]+)/,s=t.match(e);return s&&s[1]&&s[2]&&s[3]?{connectionId:decodeURIComponent(s[1]),collectionName:decodeURIComponent(s[2]),itemId:decodeURIComponent(s[3])}:{connectionId:null,collectionName:null,itemId:null}}function rn(t){const e=p.c(2),s=Zt();let l;e[0]!==s.location.pathname?(l=on(s.location.pathname),e[0]=s.location.pathname,e[1]=l):l=e[1];const{connectionId:n,collectionName:o,itemId:i}=l;return`You are an AI assistant running in an MCP Mesh environment.
|
|
2
|
-
|
|
3
|
-
## About MCP Mesh
|
|
4
|
-
The Model Context Protocol (MCP) Mesh allows users to connect external MCP servers and expose their capabilities through gateways. Each gateway provides access to a curated set of tools from connected MCP servers.
|
|
5
|
-
|
|
6
|
-
## Important Notes
|
|
7
|
-
- All tool calls are logged and audited for security and compliance
|
|
8
|
-
- You have access to the tools exposed through the selected gateway
|
|
9
|
-
- MCPs may expose resources that users can browse and edit
|
|
10
|
-
- You have context to the current gateway and its tools, resources, and prompts
|
|
11
|
-
|
|
12
|
-
## Current Editing Context
|
|
13
|
-
${n?`- Connection ID: ${n}`:""}
|
|
14
|
-
${o?`- Collection Name: ${o}`:""}
|
|
15
|
-
${i?`- Item ID: ${i}`:""}
|
|
16
|
-
${t?`- Gateway ID: ${t}`:""}
|
|
17
|
-
|
|
18
|
-
Help the user understand and work with this resource.
|
|
19
|
-
`}function cn(){const t=p.c(137),{org:e,locator:s}=ye(),{slug:l,id:n}=e,[,o]=lt(),i=Be(),{data:c}=Ce.useSession(),r=c?.user,{createThread:d,activeThreadId:m,setActiveThreadId:f,hideThread:u}=ct(),{threads:x,refetch:h}=_s(),j=Es(),g=ks(),b=hs();let v;t[0]!==b?(v={connections:b,binding:"LLMS"},t[0]=b,t[1]=v):v=t[1];const[y]=ys(v),w=!!y,C=j.length>0,N=w&&C;let k;t[2]!==s?(k=He.chatSelectedModel(s),t[2]=s,t[3]=k):k=t[3];const[z,$]=dt(k,g,mn),[_,A]=dt(`${s}:selected-gateway`,j,dn),P=rn(_?.id),B=an();let V;t[4]!==d||t[5]!==_?.id?(V=O=>d({id:O.id,title:O.title,gatewayId:_?.id}),t[4]=d,t[5]=_?.id,t[6]=V):V=t[6];let q;t[7]!==m||t[8]!==B||t[9]!==P||t[10]!==V?(q={threadId:m,systemPrompt:P,onToolCall:B,onCreateThread:V},t[7]=m,t[8]=B,t[9]=P,t[10]=V,t[11]=q):q=t[11];const I=Is(q),{inputValue:W,setInputValue:T,branchContext:D,clearBranch:L}=ct(),{isEmpty:H}=I;let U;t[12]!==D||t[13]!==L||t[14]!==f||t[15]!==T?(U=()=>{D&&(f(D.originalThreadId),L(),T(""))},t[12]=D,t[13]=L,t[14]=f,t[15]=T,t[16]=U):U=t[16];const K=U;let ke;t[17]!==m||t[18]!==I||t[19]!==L||t[20]!==_||t[21]!==z||t[22]!==T||t[23]!==r?.image||t[24]!==r?.name?(ke=async O=>{if(!z){Je.error("No model configured");return}if(!_?.id){Je.error("No gateway configured");return}T(""),L();const F={created_at:new Date().toISOString(),thread_id:m,model:{id:z.id,connectionId:z.connectionId,provider:z.provider??void 0,limits:z.limits??void 0},gateway:{id:_.id},user:{avatar:r?.image??void 0,name:r?.name??"you"}};await I.sendMessage(O,F)},t[17]=m,t[18]=I,t[19]=L,t[20]=_,t[21]=z,t[22]=T,t[23]=r?.image,t[24]=r?.name,t[25]=ke):ke=t[25];const G=ke;let Ie;t[26]!==$?(Ie=O=>{$(O)},t[26]=$,t[27]=Ie):Ie=t[27];const Ge=Ie;let $e;t[28]!==A?($e=O=>{A({gatewayId:O})},t[28]=A,t[29]=$e):$e=t[29];const We=$e;if(!N){let O,F;!w&&!C?(O="Connect your providers",F="Connect an LLM provider and create a gateway to unlock AI-powered features."):w?(O="No gateways configured",F="Create a gateway to expose your MCP tools to the chat."):(O="No model provider connected",F="Connect to a model provider to unlock AI-powered features.");let Ee;t[30]===Symbol.for("react.memo_cache_sentinel")?(Ee=a.jsxs(E.Header.Left,{children:[a.jsx("img",{src:ln,alt:"deco chat",className:"size-5 rounded"}),a.jsx("span",{className:"text-sm font-medium",children:"deco chat"})]}),t[30]=Ee):Ee=t[30];let je;t[31]!==o?(je=()=>o(!1),t[31]=o,t[32]=je):je=t[32];let Ae;t[33]===Symbol.for("react.memo_cache_sentinel")?(Ae=a.jsx(Re,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[33]=Ae):Ae=t[33];let we;t[34]!==je?(we=a.jsxs(E.Header,{children:[Ee,a.jsx(E.Header.Right,{children:a.jsx("button",{type:"button",onClick:je,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:Ae})})]}),t[34]=je,t[35]=we):we=t[35];let Se;t[36]!==b||t[37]!==F||t[38]!==w||t[39]!==i||t[40]!==n||t[41]!==l||t[42]!==O||t[43]!==r?.id?(Se=a.jsx(E.Main,{className:"flex flex-col items-center",children:a.jsx(E.EmptyState,{children:w?a.jsx(us,{title:O,description:F,actions:a.jsx(Y,{variant:"outline",onClick:()=>i({to:"/$org/mcps",params:{org:l},search:{action:"create"}}),children:"Install MCP Server"})}):a.jsx($s,{title:O,description:F,orgSlug:l,orgId:n,userId:r?.id??"",allConnections:b,onInstallMcpServer:()=>i({to:"/$org/mcps",params:{org:l},search:{action:"create"}})})})}),t[36]=b,t[37]=F,t[38]=w,t[39]=i,t[40]=n,t[41]=l,t[42]=O,t[43]=r?.id,t[44]=Se):Se=t[44];let Pe;return t[45]!==we||t[46]!==Se?(Pe=a.jsxs(E,{children:[we,Se]}),t[45]=we,t[46]=Se,t[47]=Pe):Pe=t[47],Pe}const Ve=_?.icon,Fe=_?.title||"deco chat";let Me;t[48]===Symbol.for("react.memo_cache_sentinel")?(Me=a.jsx(et,{size:12}),t[48]=Me):Me=t[48];let Q;t[49]!==Fe||t[50]!==Ve?(Q=a.jsx(it,{icon:Ve,name:Fe,size:"xs",fallbackIcon:Me}),t[49]=Fe,t[50]=Ve,t[51]=Q):Q=t[51];const Ke=_?.title||"deco chat";let X;t[52]!==Ke?(X=a.jsx("span",{className:"text-sm font-medium",children:Ke}),t[52]=Ke,t[53]=X):X=t[53];let J;t[54]!==Q||t[55]!==X?(J=a.jsxs(E.Header.Left,{children:[Q,X]}),t[54]=Q,t[55]=X,t[56]=J):J=t[56];let ee;t[57]!==d?(ee=()=>d(),t[57]=d,t[58]=ee):ee=t[58];let ze;t[59]===Symbol.for("react.memo_cache_sentinel")?(ze=a.jsx(Cs,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[59]=ze):ze=t[59];let te;t[60]!==ee?(te=a.jsx("button",{type:"button",onClick:ee,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"New chat",children:ze}),t[60]=ee,t[61]=te):te=t[61];let se;t[62]!==h?(se=()=>h(),t[62]=h,t[63]=se):se=t[63];let ne;t[64]!==m||t[65]!==u||t[66]!==f||t[67]!==se||t[68]!==x?(ne=a.jsx(Ts,{threads:x,activeThreadId:m,onSelectThread:f,onRemoveThread:u,onOpen:se}),t[64]=m,t[65]=u,t[66]=f,t[67]=se,t[68]=x,t[69]=ne):ne=t[69];let ae;t[70]!==o?(ae=()=>o(!1),t[70]=o,t[71]=ae):ae=t[71];let Te;t[72]===Symbol.for("react.memo_cache_sentinel")?(Te=a.jsx(Re,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[72]=Te):Te=t[72];let le;t[73]!==ae?(le=a.jsx("button",{type:"button",onClick:ae,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:Te}),t[73]=ae,t[74]=le):le=t[74];let oe;t[75]!==te||t[76]!==ne||t[77]!==le?(oe=a.jsxs(E.Header.Right,{children:[te,ne,le]}),t[75]=te,t[76]=ne,t[77]=le,t[78]=oe):oe=t[78];let ie;t[79]!==J||t[80]!==oe?(ie=a.jsxs(E.Header,{children:[J,oe]}),t[79]=J,t[80]=oe,t[81]=ie):ie=t[81];let re;t[82]!==I.messages||t[83]!==I.status||t[84]!==G||t[85]!==H||t[86]!==_?(re=a.jsx(E.Main,{children:H?a.jsx(E.EmptyState,{children:a.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[a.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-0 text-center",children:[a.jsx(it,{icon:_?.icon,name:_?.title||"deco chat",size:"lg",fallbackIcon:a.jsx(et,{size:32}),className:"size-[60px]! rounded-[18px]!"}),a.jsx("h3",{className:"text-xl font-medium text-foreground",children:_?.title||"Ask deco chat"}),a.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."})]}),_?.id&&a.jsx(at,{fallback:null,children:a.jsx(S.Suspense,{fallback:a.jsx("div",{className:"flex justify-center",children:a.jsx(Ns,{size:20,className:"animate-spin text-muted-foreground"})}),children:a.jsx(Ms,{gatewayId:_.id,onSelect:O=>{G(O.description??O.name)}})})},_.id)]})}):a.jsx(E.Messages,{messages:I.messages,status:I.status,minHeightOffset:240})}),t[82]=I.messages,t[83]=I.status,t[84]=G,t[85]=H,t[86]=_,t[87]=re):re=t[87];let ce;t[88]!==I.error||t[89]!==G?(ce=()=>{I.error&&G(`I encountered this error: ${I.error.message}. Can you help me fix it?`)},t[88]=I.error,t[89]=G,t[90]=ce):ce=t[90];let de;t[91]!==I.clearError||t[92]!==I.error||t[93]!==ce?(de=a.jsx(E.ErrorBanner,{error:I.error,onFixInChat:ce,onDismiss:I.clearError}),t[91]=I.clearError,t[92]=I.error,t[93]=ce,t[94]=de):de=t[94];let me;t[95]!==G?(me=()=>{G("Please continue.")},t[95]=G,t[96]=me):me=t[96];let fe;t[97]!==I.clearFinishReason||t[98]!==I.finishReason||t[99]!==me?(fe=a.jsx(E.FinishReasonWarning,{finishReason:I.finishReason,onContinue:me,onDismiss:I.clearFinishReason}),t[97]=I.clearFinishReason,t[98]=I.finishReason,t[99]=me,t[100]=fe):fe=t[100];let ue;t[101]!==D||t[102]!==L||t[103]!==K||t[104]!==T?(ue=a.jsx(E.BranchPreview,{branchContext:D,clearBranchContext:L,onGoToOriginalMessage:K,setInputValue:T}),t[101]=D,t[102]=L,t[103]=K,t[104]=T,t[105]=ue):ue=t[105];let he;t[106]!==G||t[107]!==W?(he=async()=>{W.trim()&&await G(W.trim())},t[106]=G,t[107]=W,t[108]=he):he=t[108];const Ze=!z||!_?.id,Ye=I.status==="submitted"||I.status==="streaming",qe=z?"Ask anything or @ for context":"Select a model to start chatting",Qe=_?.id;let pe;t[109]!==We||t[110]!==Qe?(pe=a.jsx(As,{selectedGatewayId:Qe,onGatewayChange:We,placeholder:"Gateway",variant:"borderless"}),t[109]=We,t[110]=Qe,t[111]=pe):pe=t[111];const Xe=z??void 0;let xe;t[112]!==Ge||t[113]!==Xe?(xe=a.jsx(Os,{selectedModel:Xe,onModelChange:Ge,placeholder:"Model",variant:"borderless"}),t[112]=Ge,t[113]=Xe,t[114]=xe):xe=t[114];let ge;t[115]!==I.messages?(ge=a.jsx(zs,{messages:I.messages}),t[115]=I.messages,t[116]=ge):ge=t[116];let be;t[117]!==I.stop||t[118]!==W||t[119]!==T||t[120]!==he||t[121]!==Ze||t[122]!==Ye||t[123]!==qe||t[124]!==pe||t[125]!==xe||t[126]!==ge?(be=a.jsxs(E.Input,{value:W,onChange:T,onSubmit:he,onStop:I.stop,disabled:Ze,isStreaming:Ye,placeholder:qe,children:[pe,xe,ge]}),t[117]=I.stop,t[118]=W,t[119]=T,t[120]=he,t[121]=Ze,t[122]=Ye,t[123]=qe,t[124]=pe,t[125]=xe,t[126]=ge,t[127]=be):be=t[127];let ve;t[128]!==de||t[129]!==fe||t[130]!==ue||t[131]!==be?(ve=a.jsx(E.Footer,{children:a.jsxs("div",{className:"flex flex-col gap-2",children:[de,fe,ue,be]})}),t[128]=de,t[129]=fe,t[130]=ue,t[131]=be,t[132]=ve):ve=t[132];let Oe;return t[133]!==ie||t[134]!==re||t[135]!==ve?(Oe=a.jsxs(E,{children:[ie,re,ve]}),t[133]=ie,t[134]=re,t[135]=ve,t[136]=Oe):Oe=t[136],Oe}function dn(t,e){return t.id===e.gatewayId}function mn(t,e){return t.id===e.id&&t.connectionId===e.connectionId}function fn(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(E.Provider,{children:a.jsx(cn,{})}),t[0]=e):e=t[0],e}function un(t){const e=p.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let l;return e[2]!==s?(l=a.jsx(Yt,{"data-slot":"sheet",...s}),e[2]=s,e[3]=l):l=e[3],l}function hn(t){const e=p.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let l;return e[2]!==s?(l=a.jsx(Jt,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=l):l=e[3],l}function pn(t){const e=p.c(8);let s,l;e[0]!==t?({className:s,...l}=t,e[0]=t,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let n;e[3]!==s?(n=M("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]=n):n=e[4];let o;return e[5]!==l||e[6]!==n?(o=a.jsx(ts,{"data-slot":"sheet-overlay",className:n,...l}),e[5]=l,e[6]=n,e[7]=o):o=e[7],o}function xn(t){const e=p.c(17);let s,l,n,o;e[0]!==t?({className:l,children:s,side:o,...n}=t,e[0]=t,e[1]=s,e[2]=l,e[3]=n,e[4]=o):(s=e[1],l=e[2],n=e[3],o=e[4]);const i=o===void 0?"right":o;let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(pn,{}),e[5]=c):c=e[5];const r=i==="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=i==="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=i==="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=i==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let u;e[6]!==l||e[7]!==r||e[8]!==d||e[9]!==m||e[10]!==f?(u=M("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",r,d,m,f,l),e[6]=l,e[7]=r,e[8]=d,e[9]=m,e[10]=f,e[11]=u):u=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsxs(es,{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:[a.jsx(Re,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=x):x=e[12];let h;return e[13]!==s||e[14]!==n||e[15]!==u?(h=a.jsxs(hn,{children:[c,a.jsxs(Xt,{"data-slot":"sheet-content",className:u,...n,children:[s,x]})]}),e[13]=s,e[14]=n,e[15]=u,e[16]=h):h=e[16],h}function gn(t){const e=p.c(8);let s,l;e[0]!==t?({className:s,...l}=t,e[0]=t,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let n;e[3]!==s?(n=M("flex flex-col gap-1.5 p-4",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==l||e[6]!==n?(o=a.jsx("div",{"data-slot":"sheet-header",className:n,...l}),e[5]=l,e[6]=n,e[7]=o):o=e[7],o}function bn(t){const e=p.c(8);let s,l;e[0]!==t?({className:s,...l}=t,e[0]=t,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let n;e[3]!==s?(n=M("text-foreground font-semibold",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==l||e[6]!==n?(o=a.jsx(qt,{"data-slot":"sheet-title",className:n,...l}),e[5]=l,e[6]=n,e[7]=o):o=e[7],o}function vn(t){const e=p.c(8);let s,l;e[0]!==t?({className:s,...l}=t,e[0]=t,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let n;e[3]!==s?(n=M("text-muted-foreground text-sm",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==l||e[6]!==n?(o=a.jsx(Qt,{"data-slot":"sheet-description",className:n,...l}),e[5]=l,e[6]=n,e[7]=o):o=e[7],o}function Dt(t){const e=p.c(8);let s,l;e[0]!==t?({className:s,...l}=t,e[0]=t,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let n;e[3]!==s?(n=M("bg-accent animate-pulse rounded-md",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==l||e[6]!==n?(o=a.jsx("div",{"data-slot":"skeleton",className:n,...l}),e[5]=l,e[6]=n,e[7]=o):o=e[7],o}const jn="sidebar_state",wn=3600*24*7,Sn="16rem",Nn="18rem",Cn="3rem",yn="b",Lt=S.createContext(null);function ot(){const t=S.useContext(Lt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function _n(t){const e=p.c(21),{defaultOpen:s,open:l,onOpenChange:n,children:o}=t,i=s===void 0?!0:s,c=_e(),[r,d]=S.useState(!1),[m,f]=S.useState(i),u=l??m;let x;e[0]!==u||e[1]!==n?(x=z=>{const $=typeof z=="function"?z(u):z;n?n($):f($),document.cookie=`${jn}=${$}; path=/; max-age=${wn}`},e[0]=u,e[1]=n,e[2]=x):x=e[2];const h=x;let j;e[3]!==c||e[4]!==h?(j=()=>c?d(In):h(kn),e[3]=c,e[4]=h,e[5]=j):j=e[5];const g=j;let b,v;e[6]!==g?(b=()=>{const z=$=>{if($.key===yn&&($.metaKey||$.ctrlKey)){const _=$.target;if(_.tagName==="INPUT"||_.tagName==="TEXTAREA"||_.isContentEditable)return;$.preventDefault(),g()}};return globalThis.addEventListener("keydown",z),()=>globalThis.removeEventListener("keydown",z)},v=[g],e[6]=g,e[7]=b,e[8]=v):(b=e[7],v=e[8]),S.useEffect(b,v);const y=u?"expanded":"collapsed";let w;e[9]!==c||e[10]!==u||e[11]!==r||e[12]!==h||e[13]!==y||e[14]!==g?(w={state:y,open:u,setOpen:h,isMobile:c,openMobile:r,setOpenMobile:d,toggleSidebar:g},e[9]=c,e[10]=u,e[11]=r,e[12]=h,e[13]=y,e[14]=g,e[15]=w):w=e[15];const C=w;let N;e[16]!==o?(N=a.jsx(gs,{delayDuration:0,children:o}),e[16]=o,e[17]=N):N=e[17];let k;return e[18]!==C||e[19]!==N?(k=a.jsx(Lt.Provider,{value:C,children:N}),e[18]=C,e[19]=N,e[20]=k):k=e[20],k}function kn(t){return!t}function In(t){return!t}function $n(t){const e=p.c(14);let s,l,n,o;e[0]!==t?({className:l,style:o,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=l,e[3]=n,e[4]=o):(s=e[1],l=e[2],n=e[3],o=e[4]);let i;e[5]!==o?(i={"--sidebar-width":Sn,"--sidebar-width-icon":Cn,...o},e[5]=o,e[6]=i):i=e[6];const c=i;let r;e[7]!==l?(r=M("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",l),e[7]=l,e[8]=r):r=e[8];let d;return e[9]!==s||e[10]!==n||e[11]!==c||e[12]!==r?(d=a.jsx("div",{"data-slot":"sidebar-wrapper",style:c,className:r,...n,children:s}),e[9]=s,e[10]=n,e[11]=c,e[12]=r,e[13]=d):d=e[13],d}function Mn(t){const e=p.c(46);let s,l,n,o,i,c;e[0]!==t?({side:o,variant:i,collapsible:c,className:l,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=l,e[3]=n,e[4]=o,e[5]=i,e[6]=c):(s=e[1],l=e[2],n=e[3],o=e[4],i=e[5],c=e[6]);const r=o===void 0?"left":o,d=i===void 0?"sidebar":i,m=c===void 0?"offcanvas":c,{isMobile:f,state:u,openMobile:x,setOpenMobile:h}=ot();if(m==="none"){let $;e[7]!==l?($=M("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",l),e[7]=l,e[8]=$):$=e[8];let _;return e[9]!==s||e[10]!==n||e[11]!==$?(_=a.jsx("div",{"data-slot":"sidebar",className:$,...n,children:s}),e[9]=s,e[10]=n,e[11]=$,e[12]=_):_=e[12],_}if(f){let $;e[13]===Symbol.for("react.memo_cache_sentinel")?($={"--sidebar-width":Nn},e[13]=$):$=e[13];let _;e[14]===Symbol.for("react.memo_cache_sentinel")?(_=a.jsxs(gn,{className:"sr-only",children:[a.jsx(bn,{children:"Sidebar"}),a.jsx(vn,{children:"Displays the mobile sidebar."})]}),e[14]=_):_=e[14];let A;e[15]!==s?(A=a.jsx("div",{className:"flex h-full w-full flex-col",children:s}),e[15]=s,e[16]=A):A=e[16];let P;e[17]!==r||e[18]!==A?(P=a.jsxs(xn,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:$,side:r,children:[_,A]}),e[17]=r,e[18]=A,e[19]=P):P=e[19];let B;return e[20]!==x||e[21]!==n||e[22]!==h||e[23]!==P?(B=a.jsx(un,{open:x,onOpenChange:h,...n,children:P}),e[20]=x,e[21]=n,e[22]=h,e[23]=P,e[24]=B):B=e[24],B}const j=u==="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 b;e[25]!==g?(b=M("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]=b):b=e[26];let v;e[27]!==b?(v=a.jsx("div",{"data-slot":"sidebar-gap",className:b}),e[27]=b,e[28]=v):v=e[28];const y=r==="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)]",w=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]!==l||e[30]!==y||e[31]!==w?(C=M("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",y,w,l),e[29]=l,e[30]=y,e[31]=w,e[32]=C):C=e[32];let N;e[33]!==s?(N=a.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]=N):N=e[34];let k;e[35]!==n||e[36]!==C||e[37]!==N?(k=a.jsx("div",{"data-slot":"sidebar-container",className:C,...n,children:N}),e[35]=n,e[36]=C,e[37]=N,e[38]=k):k=e[38];let z;return e[39]!==r||e[40]!==u||e[41]!==k||e[42]!==j||e[43]!==v||e[44]!==d?(z=a.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":u,"data-collapsible":j,"data-variant":d,"data-side":r,"data-slot":"sidebar",children:[v,k]}),e[39]=r,e[40]=u,e[41]=k,e[42]=j,e[43]=v,e[44]=d,e[45]=z):z=e[45],z}function zn(t){const e=p.c(8);let s,l;e[0]!==t?({className:s,...l}=t,e[0]=t,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let n;e[3]!==s?(n=M("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]=n):n=e[4];let o;return e[5]!==l||e[6]!==n?(o=a.jsx("main",{"data-slot":"sidebar-inset",className:n,...l}),e[5]=l,e[6]=n,e[7]=o):o=e[7],o}function Tn(t){const e=p.c(8);let s,l;e[0]!==t?({className:s,...l}=t,e[0]=t,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let n;e[3]!==s?(n=M("h-4 m-0! w-full",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==l||e[6]!==n?(o=a.jsx("div",{"data-sidebar":"separator",className:n,...l}),e[5]=l,e[6]=n,e[7]=o):o=e[7],o}function On(t){const e=p.c(8);let s,l;e[0]!==t?({className:s,...l}=t,e[0]=t,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let n;e[3]!==s?(n=M("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==l||e[6]!==n?(o=a.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:n,...l}),e[5]=l,e[6]=n,e[7]=o):o=e[7],o}function En(t){const e=p.c(8);let s,l;e[0]!==t?({className:s,...l}=t,e[0]=t,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let n;e[3]!==s?(n=M("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==l||e[6]!==n?(o=a.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:n,...l}),e[5]=l,e[6]=n,e[7]=o):o=e[7],o}function An(t){const e=p.c(8);let s,l;e[0]!==t?({className:s,...l}=t,e[0]=t,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let n;e[3]!==s?(n=M("w-full text-sm",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==l||e[6]!==n?(o=a.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:n,...l}),e[5]=l,e[6]=n,e[7]=o):o=e[7],o}function Pn(t){const e=p.c(8);let s,l;e[0]!==t?({className:s,...l}=t,e[0]=t,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let n;e[3]!==s?(n=M("flex w-full min-w-0 flex-col gap-1",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==l||e[6]!==n?(o=a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:n,...l}),e[5]=l,e[6]=n,e[7]=o):o=e[7],o}function Ue(t){const e=p.c(8);let s,l;e[0]!==t?({className:s,...l}=t,e[0]=t,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let n;e[3]!==s?(n=M("group/menu-item relative",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==l||e[6]!==n?(o=a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:n,...l}),e[5]=l,e[6]=n,e[7]=o):o=e[7],o}const Dn=ss("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 Rt(t){const e=p.c(28);let s,l,n,o,i,c,r;e[0]!==t?({asChild:n,isActive:o,variant:i,size:c,tooltip:r,className:s,...l}=t,e[0]=t,e[1]=s,e[2]=l,e[3]=n,e[4]=o,e[5]=i,e[6]=c,e[7]=r):(s=e[1],l=e[2],n=e[3],o=e[4],i=e[5],c=e[6],r=e[7]);const d=n===void 0?!1:n,m=o===void 0?!1:o,f=i===void 0?"default":i,u=c===void 0?"default":c,x=d?ns:"button",{isMobile:h,state:j}=ot();let g;e[8]!==s||e[9]!==u||e[10]!==f?(g=M(Dn({variant:f,size:u}),s),e[8]=s,e[9]=u,e[10]=f,e[11]=g):g=e[11];let b;e[12]!==x||e[13]!==m||e[14]!==l||e[15]!==u||e[16]!==g?(b=a.jsx(x,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":u,"data-active":m,className:g,...l}),e[12]=x,e[13]=m,e[14]=l,e[15]=u,e[16]=g,e[17]=b):b=e[17];const v=b;if(!r)return v;if(typeof r=="string"){let k;e[18]!==r?(k={children:r},e[18]=r,e[19]=k):k=e[19],r=k}let y;e[20]!==v?(y=a.jsx(bs,{asChild:!0,children:v}),e[20]=v,e[21]=y):y=e[21];const w=j!=="collapsed"||h;let C;e[22]!==w||e[23]!==r?(C=a.jsx(xs,{side:"right",align:"center",hidden:w,...r}),e[22]=w,e[23]=r,e[24]=C):C=e[24];let N;return e[25]!==y||e[26]!==C?(N=a.jsxs(vs,{children:[y,C]}),e[25]=y,e[26]=C,e[27]=N):N=e[27],N}function Ln(t){const e=p.c(26),{item:s}=t,l=Be(),{org:n}=ye(),o=vt(n.id),i=Rs(n.id);let c;e[0]!==i.update||e[1]!==s.url||e[2]!==o?.sidebar_items?(c=async()=>{const w=(o?.sidebar_items||[]).filter(C=>C.url!==s.url);await i.update.mutateAsync({sidebar_items:w})},e[0]=i.update,e[1]=s.url,e[2]=o?.sidebar_items,e[3]=c):c=e[3];const r=c;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 u;e[7]!==s.url||e[8]!==l?(u=()=>{l({to:s.url})},e[7]=s.url,e[8]=l,e[9]=u):u=e[9];const x=s.title;let h;e[10]!==f||e[11]!==s.icon||e[12]!==s.title?(h=a.jsx("div",{className:"flex items-center justify-center shrink-0",children:f?a.jsx("img",{src:s.icon,alt:s.title,className:"h-4 w-4 rounded object-cover"}):a.jsx(Ls,{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]=h):h=e[13];let j;e[14]!==s.title?(j=s.title.toLocaleLowerCase(),e[14]=s.title,e[15]=j):j=e[15];let g;e[16]!==j?(g=a.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:a.jsx("span",{className:"truncate text-sm w-full capitalize",children:j})}),e[16]=j,e[17]=g):g=e[17];let b;e[18]!==r?(b=a.jsx(Re,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:y=>{y.preventDefault(),y.stopPropagation(),r()}}),e[18]=r,e[19]=b):b=e[19];let v;return e[20]!==s.title||e[21]!==u||e[22]!==h||e[23]!==g||e[24]!==b?(v=a.jsx(Ue,{children:a.jsxs(Rt,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:u,tooltip:x,children:[h,g,b]})}),e[20]=s.title,e[21]=u,e[22]=h,e[23]=g,e[24]=b,e[25]=v):v=e[25],v}function Rn(){const t=p.c(4),{org:e}=ye(),l=vt(e.id)?.sidebar_items;if(!l?.length)return null;let n;t[0]!==l?(n=l.map(Bn),t[0]=l,t[1]=n):n=t[1];let o;return t[2]!==n?(o=a.jsx(Bt,{children:n}),t[2]=n,t[3]=o):o=t[3],o}function Bn(t){return a.jsx(Ln,{item:t},t.url)}function ut(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(Ue,{children:a.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:a.jsx(Dt,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function Bt(t){const e=p.c(4),{children:s}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx(Tn,{className:"my-2 -ml-1"}),e[0]=l):l=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=a.jsx(Ue,{children:a.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:a.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=n):n=e[1];let o;return e[2]!==s?(o=a.jsxs(a.Fragment,{children:[l,n,s]}),e[2]=s,e[3]=o):o=e[3],o}function Hn(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(S.Suspense,{fallback:a.jsxs(Bt,{children:[a.jsx(ut,{}),a.jsx(ut,{})]}),children:a.jsx(Rn,{})}),t[0]=e):e=t[0],e}function Un(){const t=p.c(48),{locator:e}=ye(),s=Be();let l;t[0]!==e?(l=rt.parse(e),t[0]=e,t[1]=l):l=t[1];const{org:n}=l;let o;t[2]!==e?(o=rt.isOrgAdminProject(e),t[2]=e,t[3]=o):o=t[3];const i=o;let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx($t,{}),t[4]=c):c=t[4];let r;t[5]!==s||t[6]!==n?(r={key:"home",label:"Home",icon:c,onClick:()=>s({to:"/$org",params:{org:n}})},t[5]=s,t[6]=n,t[7]=r):r=t[7];let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(_t,{}),t[8]=d):d=t[8];let m;t[9]!==s||t[10]!==n?(m={key:"store",label:"Store",icon:d,onClick:()=>s({to:"/$org/store",params:{org:n}})},t[9]=s,t[10]=n,t[11]=m):m=t[11];let f;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(ps,{}),t[12]=f):f=t[12];let u;t[13]!==s||t[14]!==n?(u={key:"mcps",label:"MCP Servers",icon:f,onClick:()=>s({to:"/$org/mcps",params:{org:n}})},t[13]=s,t[14]=n,t[15]=u):u=t[15];let x;t[16]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(et,{}),t[16]=x):x=t[16];let h;t[17]!==s||t[18]!==n?(h={key:"gateways",label:"MCP Gateways",icon:x,onClick:()=>s({to:"/$org/gateways",params:{org:n}})},t[17]=s,t[18]=n,t[19]=h):h=t[19];let j;t[20]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx(Pt,{}),t[20]=j):j=t[20];let g;t[21]!==s||t[22]!==n?(g={key:"workflow",label:"Workflows",icon:j,onClick:()=>s({to:"/$org/workflow",params:{org:n}})},t[21]=s,t[22]=n,t[23]=g):g=t[23];let b;t[24]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx(yt,{}),t[24]=b):b=t[24];let v;t[25]!==s||t[26]!==n?(v={key:"monitoring",label:"Monitoring",icon:b,onClick:()=>s({to:"/$org/monitoring",params:{org:n}})},t[25]=s,t[26]=n,t[27]=v):v=t[27];let y;t[28]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(At,{}),t[28]=y):y=t[28];let w;t[29]!==s||t[30]!==n?(w={key:"members",label:"Members",icon:y,onClick:()=>s({to:"/$org/members",params:{org:n}})},t[29]=s,t[30]=n,t[31]=w):w=t[31];let C;t[32]===Symbol.for("react.memo_cache_sentinel")?(C=a.jsx(Ot,{}),t[32]=C):C=t[32];let N;t[33]!==s||t[34]!==n?(N={key:"settings",label:"Settings",icon:C,onClick:()=>s({to:"/$org/settings",params:{org:n}})},t[33]=s,t[34]=n,t[35]=N):N=t[35];let k;t[36]!==g||t[37]!==v||t[38]!==w||t[39]!==N||t[40]!==r||t[41]!==m||t[42]!==u||t[43]!==h?(k=[r,m,u,h,g,v,w,N],t[36]=g,t[37]=v,t[38]=w,t[39]=N,t[40]=r,t[41]=m,t[42]=u,t[43]=h,t[44]=k):k=t[44];const z=k;let $;return t[45]!==z||t[46]!==i?($=i?z:[],t[45]=z,t[46]=i,t[47]=$):$=t[47],$}function Ht(t){const e=p.c(10),{navigationItems:s,footer:l,additionalContent:n,variant:o,collapsible:i}=t,c=o===void 0?"sidebar":o,r=i===void 0?"icon":i;let d;e[0]!==s?(d=s.map(Gn),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==n||e[3]!==d?(m=a.jsx(On,{className:"flex-1 overflow-x-hidden",children:a.jsx(En,{className:"font-medium",children:a.jsx(An,{children:a.jsxs(Pn,{className:"gap-0.5",children:[d,n]})})})}),e[2]=n,e[3]=d,e[4]=m):m=e[4];let f;return e[5]!==r||e[6]!==l||e[7]!==m||e[8]!==c?(f=a.jsxs(Mn,{variant:c,collapsible:r,children:[m,l]}),e[5]=r,e[6]=l,e[7]=m,e[8]=c,e[9]=f):f=e[9],f}function Gn(t){return a.jsx(Ue,{children:a.jsxs(Rt,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground",onClick:t.onClick,isActive:t.isActive,tooltip:t.label,children:[a.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:t.icon}),a.jsx("span",{className:"truncate",children:t.label})]})},t.key)}Ht.Skeleton=function(){return a.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>a.jsx("div",{className:"w-full h-8",children:a.jsx(Dt,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function Wn(){const t=p.c(3),e=Un();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=a.jsx(a.Fragment,{children:a.jsx(at,{children:a.jsx(S.Suspense,{fallback:null,children:a.jsx(Hn,{})})})}),t[0]=s):s=t[0];let l;return t[1]!==e?(l=a.jsx(Ht,{navigationItems:e,additionalContent:s}),t[1]=e,t[2]=l):l=t[2],l}function Vn(t){const e=p.c(12);let s,l,n,o;e[0]!==t?({className:s,orientation:n,decorative:o,...l}=t,e[0]=t,e[1]=s,e[2]=l,e[3]=n,e[4]=o):(s=e[1],l=e[2],n=e[3],o=e[4]);const i=n===void 0?"horizontal":n,c=o===void 0?!0:o;let r;e[5]!==s?(r=M("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]=r):r=e[6];let d;return e[7]!==c||e[8]!==i||e[9]!==l||e[10]!==r?(d=a.jsx(as,{"data-slot":"separator-root",decorative:c,orientation:i,className:r,...l}),e[7]=c,e[8]=i,e[9]=l,e[10]=r,e[11]=d):d=e[11],d}const Ut=S.createContext(null);function Fn(){const t=S.useContext(Ut);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function Kn(t){const e=p.c(10),{children:s,onItemHover:l}=t,[n,o]=S.useState(null);let i;e[0]!==l?(i=f=>{o(f),l?.(f)},e[0]=l,e[1]=i):i=e[1];const c=i;let r;e[2]!==n||e[3]!==c?(r={hoveredItem:n,setHoveredItem:c},e[2]=n,e[3]=c,e[4]=r):r=e[4];let d;e[5]!==s?(d=a.jsx(Us,{children:s}),e[5]=s,e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==d?(m=a.jsx(Ut.Provider,{value:r,children:d}),e[7]=r,e[8]=d,e[9]=m):m=e[9],m}function Zn(t){const e=p.c(6),{children:s,onClick:l}=t;let n;e[0]!==s||e[1]!==l?(n=a.jsx(Y,{variant:"link",className:"p-0.5 h-auto",onClick:l,type:"button",children:s}),e[0]=s,e[1]=l,e[2]=n):n=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(Gs,{asChild:!0,children:a.jsx(Y,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:a.jsx(kt,{size:16,className:"opacity-50"})})}),e[3]=o):o=e[3];let i;return e[4]!==n?(i=a.jsxs("div",{className:"flex items-center gap-1",children:[n,o]}),e[4]=n,e[5]=i):i=e[5],i}function Yn(t){const e=p.c(8),{item:s,fallback:l}=t,n=l===void 0?"":l,o=s?.avatarUrl??"",i=s?.name??n;let c;e[0]!==o||e[1]!==i?(c=a.jsx(Ne,{url:o,fallback:i,size:"xs",objectFit:"contain"}),e[0]=o,e[1]=i,e[2]=c):c=e[2];const r=s?.name??n;let d;e[3]!==r?(d=a.jsx("span",{children:r}),e[3]=r,e[4]=d):d=e[4];let m;return e[5]!==c||e[6]!==d?(m=a.jsxs("div",{className:"flex items-center gap-2",children:[c,d]}),e[5]=c,e[6]=d,e[7]=m):m=e[7],m}function qn(t){const e=p.c(6),{children:s,align:l}=t,n=l===void 0?"start":l,i=S.Children.toArray(s).filter(Qn).length===1?"280px":"480px";let c;e[0]!==i?(c={width:i},e[0]=i,e[1]=c):c=e[1];let r;return e[2]!==n||e[3]!==s||e[4]!==c?(r=a.jsx(Ws,{align:n,className:"p-0 flex items-start",style:c,children:s}),e[2]=n,e[3]=s,e[4]=c,e[5]=r):r=e[5],r}function Qn(t){return S.isValidElement(t)&&(t.type===Wt||t.type===Gt)}function Gt(t){const e=p.c(5),{children:s,className:l}=t;let n;e[0]!==l?(n=M("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",l),e[0]=l,e[1]=n):n=e[1];let o;return e[2]!==s||e[3]!==n?(o=a.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=o):o=e[4],o}const Wt=Gt;function Xn(t){const e=p.c(6),{placeholder:s,value:l,onChange:n}=t,o=s===void 0?"Search...":s;let i;e[0]!==n?(i=r=>n(r.target.value),e[0]=n,e[1]=i):i=e[1];let c;return e[2]!==o||e[3]!==i||e[4]!==l?(c=a.jsx(Hs,{placeholder:o,value:l,onChange:i,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=o,e[3]=i,e[4]=l,e[5]=c):c=e[5],c}function Jn(t){const e=p.c(6),{children:s,emptyMessage:l}=t,n=l===void 0?"No items found.":l,o=S.Children.count(s)>0;let i;e[0]!==n||e[1]!==o?(i=!o&&a.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:n}),e[0]=n,e[1]=o,e[2]=i):i=e[2];let c;return e[3]!==s||e[4]!==i?(c=a.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[i,s]}),e[3]=s,e[4]=i,e[5]=c):c=e[5],c}function ea(t){const e=p.c(15),{item:s,onClick:l,onHover:n,children:o}=t,i=Fn();let c;e[0]!==i||e[1]!==s||e[2]!==n?(c=()=>{i.setHoveredItem(s.slug),n?.(s)},e[0]=i,e[1]=s,e[2]=n,e[3]=c):c=e[3];const r=c;let d;e[4]!==s||e[5]!==l?(d=()=>l(s),e[4]=s,e[5]=l,e[6]=d):d=e[6];let m;e[7]!==o||e[8]!==s.avatarUrl||e[9]!==s.name?(m=o||a.jsxs(a.Fragment,{children:[a.jsx(Ne,{url:s.avatarUrl??"",fallback:s.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),a.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.name})]}),e[7]=o,e[8]=s.avatarUrl,e[9]=s.name,e[10]=m):m=e[10];let f;return e[11]!==r||e[12]!==d||e[13]!==m?(f=a.jsx(Y,{onClick:d,onMouseEnter:r,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:m}),e[11]=r,e[12]=d,e[13]=m,e[14]=f):f=e[14],f}function ta(t){const e=p.c(2),{children:s}=t;let l;return e[0]!==s?(l=a.jsx("div",{className:"px-1 pb-1 pt-0.5",children:s}),e[0]=s,e[1]=l):l=e[1],l}function sa(t){const e=p.c(11),{onClick:s,icon:l,children:n,variant:o}=t,c=(o===void 0?"default":o)==="muted"&&"text-muted-foreground";let r;e[0]!==c?(r=M("w-full justify-start font-normal",c),e[0]=c,e[1]=r):r=e[1];let d;e[2]!==l?(d=l&&a.jsx("span",{className:"[&>svg]:size-4",children:l}),e[2]=l,e[3]=d):d=e[3];let m;e[4]!==n?(m=a.jsx("span",{children:n}),e[4]=n,e[5]=m):m=e[5];let f;return e[6]!==s||e[7]!==r||e[8]!==d||e[9]!==m?(f=a.jsxs(Y,{variant:"ghost",size:"sm",className:r,onClick:s,children:[d,m]}),e[6]=s,e[7]=r,e[8]=d,e[9]=m,e[10]=f):f=e[10],f}function na(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(Vn,{}),t[0]=e):e=t[0],e}function aa(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const R=Object.assign(Kn,{Trigger:Zn,CurrentItem:Yn,Content:qn,Panel:Wt,Search:Xn,Items:Jn,Item:ea,Actions:ta,Action:sa,Separator:na,Skeleton:aa});function tt(){const t=p.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=st(e),{data:l}=Ce.useListOrganizations(),n=Be();let o;t[1]!==s||t[2]!==l?(o=l?.find(V=>V.slug===s),t[1]=s,t[2]=l,t[3]=o):o=t[3];const i=o,[c,r]=S.useState(""),[d,m]=S.useState(!1);let f,u,x,h,j,g,b,v;if(t[4]!==i||t[5]!==n||t[6]!==s||t[7]!==c||t[8]!==l){const q=(l?(()=>{const H=l.filter(U=>U.name.toLowerCase().includes(c.toLowerCase()));if(s){const U=H.findIndex(K=>K.slug===s);if(U>0){const K=H[U];K&&(H.splice(U,1),H.unshift(K))}}return H})():[]).map(la);let I;t[17]!==i?(I=i?{slug:i.slug,name:i.name,avatarUrl:i.logo}:void 0,t[17]=i,t[18]=I):I=t[18];const W=I;h=R;let T;t[19]!==n||t[20]!==s?(T=()=>n({to:"/$org",params:{org:s??""}}),t[19]=n,t[20]=s,t[21]=T):T=t[21];let D;t[22]!==W?(D=a.jsx(R.CurrentItem,{item:W}),t[22]=W,t[23]=D):D=t[23],t[24]!==T||t[25]!==D?(v=a.jsx(R.Trigger,{onClick:T,children:D}),t[24]=T,t[25]=D,t[26]=v):v=t[26],x=R.Content,u=R.Panel,t[27]!==c?(b=a.jsx(R.Search,{placeholder:"Search organizations...",value:c,onChange:r}),t[27]=c,t[28]=b):b=t[28],f=R.Items,j="No organizations found.";let L;t[29]!==n?(L=H=>a.jsx(R.Item,{item:H,onClick:U=>n({to:"/$org",params:{org:U.slug}})},H.slug),t[29]=n,t[30]=L):L=t[30],g=q.map(L),t[4]=i,t[5]=n,t[6]=s,t[7]=c,t[8]=l,t[9]=f,t[10]=u,t[11]=x,t[12]=h,t[13]=j,t[14]=g,t[15]=b,t[16]=v}else f=t[9],u=t[10],x=t[11],h=t[12],j=t[13],g=t[14],b=t[15],v=t[16];let y;t[31]!==f||t[32]!==j||t[33]!==g?(y=a.jsx(f,{emptyMessage:j,children:g}),t[31]=f,t[32]=j,t[33]=g,t[34]=y):y=t[34];let w,C;t[35]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(R.Actions,{children:a.jsx(R.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),C=a.jsx(R.Separator,{}),t[35]=w,t[36]=C):(w=t[35],C=t[36]);let N;t[37]!==n?(N=()=>n({to:"/"}),t[37]=n,t[38]=N):N=t[38];let k;t[39]===Symbol.for("react.memo_cache_sentinel")?(k=a.jsx(Vs,{}),t[39]=k):k=t[39];let z;t[40]!==N?(z=a.jsx(R.Actions,{children:a.jsx(R.Action,{onClick:N,icon:k,children:"See all organizations"})}),t[40]=N,t[41]=z):z=t[41];let $;t[42]!==u||t[43]!==z||t[44]!==b||t[45]!==y?($=a.jsxs(u,{children:[b,y,w,C,z]}),t[42]=u,t[43]=z,t[44]=b,t[45]=y,t[46]=$):$=t[46];let _;t[47]!==x||t[48]!==$?(_=a.jsx(x,{children:$}),t[47]=x,t[48]=$,t[49]=_):_=t[49];let A;t[50]!==h||t[51]!==_||t[52]!==v?(A=a.jsxs(h,{children:[v,_]}),t[50]=h,t[51]=_,t[52]=v,t[53]=A):A=t[53];let P;t[54]!==d?(P=a.jsx(Bs,{open:d,onOpenChange:m}),t[54]=d,t[55]=P):P=t[55];let B;return t[56]!==A||t[57]!==P?(B=a.jsxs(a.Fragment,{children:[A,P]}),t[56]=A,t[57]=P,t[58]=B):B=t[58],B}function la(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}tt.Skeleton=R.Skeleton;const Vt=S.createContext({setOpen:()=>{}}),oa=()=>S.useContext(Vt),ia=t=>{const e=p.c(25);let s,l,n,o,i;e[0]!==t?({children:s,defaultOpen:l,open:o,onOpenChange:n,...i}=t,e[0]=t,e[1]=s,e[2]=l,e[3]=n,e[4]=o,e[5]=i):(s=e[1],l=e[2],n=e[3],o=e[4],i=e[5]);const c=l??!1;let r;e[6]!==n||e[7]!==o||e[8]!==c?(r={prop:o,defaultProp:c,onChange:n},e[6]=n,e[7]=o,e[8]=c,e[9]=r):r=e[9];const[d,m]=qs(r);let f;e[10]!==m?(f={setOpen:m},e[10]=m,e[11]=f):f=e[11];let u;e[12]!==s||e[13]!==d||e[14]!==i||e[15]!==m?(u=a.jsx(Qs,{open:d,onOpenChange:m,...i,children:s}),e[12]=s,e[13]=d,e[14]=i,e[15]=m,e[16]=u):u=e[16];let x;e[17]!==d||e[18]!==i||e[19]!==m||e[20]!==u?(x=a.jsx(en,{open:d,onOpenChange:m,...i,children:u}),e[17]=d,e[18]=i,e[19]=m,e[20]=u,e[21]=x):x=e[21];let h;return e[22]!==f||e[23]!==x?(h=a.jsx(Vt.Provider,{value:f,children:x}),e[22]=f,e[23]=x,e[24]=h):h=e[24],h},ra=t=>{const{children:e,title:s,...l}=t,n=_e(),{className:o,...i}=l;return n?a.jsxs(Ks,{...i,children:[a.jsx(Zs,{className:"hidden",children:a.jsx(Ys,{children:s})}),a.jsx("div",{className:M("flex flex-col gap-2 p-2 py-4",o),children:e})]}):a.jsx(Js,{...l,children:e})},ca=t=>{const{children:e,...s}=t,{setOpen:l}=oa(),n=_e(),{className:o,...i}=s;return n?a.jsx("div",{...i,onClick:c=>{l(!1);const{onClick:r}=i;r?.(c)},className:M("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",o),children:e}):a.jsx(tn,{...s,children:e})},da=t=>{const e=p.c(7);let s,l;e[0]!==t?({children:s,...l}=t,e[0]=t,e[1]=s,e[2]=l):(s=e[1],l=e[2]);const n=_e();let o;return e[3]!==s||e[4]!==n||e[5]!==l?(o=n?a.jsx(Fs,{asChild:!0,children:s}):a.jsx(Xs,{...l,children:s}),e[3]=s,e[4]=n,e[5]=l,e[6]=o):o=e[6],o},ma=t=>{const e=p.c(7);let s,l;e[0]!==t?({className:s,...l}=t,e[0]=t,e[1]=s,e[2]=l):(s=e[1],l=e[2]);const n=_e();let o;return e[3]!==s||e[4]!==n||e[5]!==l?(o=n?a.jsx(mt,{className:M(s),...l}):a.jsx(mt,{className:M(s),...l}),e[3]=s,e[4]=n,e[5]=l,e[6]=o):o=e[6],o};function fa(t){const e=p.c(11),{user:s,trigger:l,align:n,children:o}=t,i=n===void 0?"start":n;let c;e[0]!==l||e[1]!==s?(c=l(s),e[0]=l,e[1]=s,e[2]=c):c=e[2];let r;e[3]!==c?(r=a.jsx(da,{asChild:!0,children:a.jsx("div",{children:c})}),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==i||e[6]!==o?(d=a.jsx(ra,{side:"top",align:i,className:"md:w-[240px]",children:o}),e[5]=i,e[6]=o,e[7]=d):d=e[7];let m;return e[8]!==r||e[9]!==d?(m=a.jsxs(ia,{children:[r,d]}),e[8]=r,e[9]=d,e[10]=m):m=e[10],m}function ua(t){const e=p.c(8),{children:s,onClick:l,className:n,asChild:o}=t;let i;e[0]!==o||e[1]!==s||e[2]!==l?(i=o?s:a.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:l,children:s}),e[0]=o,e[1]=s,e[2]=l,e[3]=i):i=e[3];let c;return e[4]!==o||e[5]!==n||e[6]!==i?(c=a.jsx(ca,{asChild:o,className:n,children:i}),e[4]=o,e[5]=n,e[6]=i,e[7]=c):c=e[7],c}function ha(t){const e=p.c(2),{className:s}=t;let l;return e[0]!==s?(l=a.jsx(ma,{className:s}),e[0]=s,e[1]=l):l=e[1],l}function pa(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const Z=Object.assign(fa,{Item:ua,Separator:ha,Skeleton:pa});function xa(t){const e=p.c(32),{open:s,onOpenChange:l,user:n,userImage:o}=t,[i,c]=S.useState(!1);let r;e[0]!==n.id?(r=()=>{navigator.clipboard.writeText(n.id),c(!0),setTimeout(()=>c(!1),2e3)},e[0]=n.id,e[1]=r):r=e[1];const d=r;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsxs(jt,{children:[a.jsx(wt,{children:"Profile"}),a.jsx(St,{children:"Your account information"})]}),e[2]=m):m=e[2];const f=n.name||n.email||"U";let u;e[3]!==f||e[4]!==o?(u=a.jsx(Ne,{url:o,fallback:f,shape:"circle",size:"2xl"}),e[3]=f,e[4]=o,e[5]=u):u=e[5];const x=n.name||n.email;let h;e[6]!==x?(h=a.jsx("div",{className:"text-lg font-semibold text-center",children:x}),e[6]=x,e[7]=h):h=e[7];let j;e[8]!==n.email?(j=a.jsx("div",{className:"text-sm text-muted-foreground text-center",children:n.email}),e[8]=n.email,e[9]=j):j=e[9];let g;e[10]!==h||e[11]!==j?(g=a.jsxs("div",{className:"flex flex-col items-center gap-2 w-full",children:[h,j]}),e[10]=h,e[11]=j,e[12]=g):g=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"User ID"}),e[13]=b):b=e[13];let v;e[14]!==n.id?(v=a.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[b,a.jsx("span",{className:"text-sm font-mono truncate",children:n.id})]}),e[14]=n.id,e[15]=v):v=e[15];let y;e[16]!==i?(y=i?a.jsx(js,{size:16,className:"text-green-600"}):a.jsx(sn,{size:16,className:"text-muted-foreground"}),e[16]=i,e[17]=y):y=e[17];let w;e[18]!==d||e[19]!==y?(w=a.jsx("button",{type:"button",onClick:d,className:"flex-shrink-0 p-2 hover:bg-background rounded-md transition-colors","aria-label":"Copy user ID",children:y}),e[18]=d,e[19]=y,e[20]=w):w=e[20];let C;e[21]!==v||e[22]!==w?(C=a.jsxs("div",{className:"flex items-center justify-between gap-3 w-full px-4 py-3 rounded-lg bg-muted/50 border border-border",children:[v,w]}),e[21]=v,e[22]=w,e[23]=C):C=e[23];let N;e[24]!==C||e[25]!==u||e[26]!==g?(N=a.jsxs(Nt,{className:"sm:max-w-md",children:[m,a.jsxs("div",{className:"flex flex-col items-center gap-6 py-4",children:[u,g,C]})]}),e[24]=C,e[25]=u,e[26]=g,e[27]=N):N=e[27];let k;return e[28]!==l||e[29]!==s||e[30]!==N?(k=a.jsx(Ct,{open:s,onOpenChange:l,children:N}),e[28]=l,e[29]=s,e[30]=N,e[31]=k):k=e[31],k}function ga(t){const e=p.c(5),{open:s,onOpenChange:l}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=a.jsxs(jt,{children:[a.jsx(wt,{children:"Invitations"}),a.jsx(St,{children:"Your pending organization invitations"})]}),e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsxs(Nt,{className:"sm:max-w-lg",children:[n,a.jsx("div",{className:"max-h-[420px] overflow-auto pr-1",children:a.jsx(is,{})})]}),e[1]=o):o=e[1];let i;return e[2]!==l||e[3]!==s?(i=a.jsx(Ct,{open:s,onOpenChange:l,children:o}),e[2]=l,e[3]=s,e[4]=i):i=e[4],i}function ba(t){const e=p.c(31),{user:s,userImage:l,hasInvites:n,showInvitesItem:o}=t,[i,c]=S.useState(!1),[r,d]=S.useState(!1);let m;e[0]!==n||e[1]!==s.email||e[2]!==s.name||e[3]!==l?(m=()=>a.jsxs("div",{className:"relative",children:[a.jsx(Ne,{url:l,fallback:s.name||s.email||"U",shape:"circle",size:"sm",className:"cursor-pointer hover:ring-2 ring-muted-foreground transition-all"}),n&&a.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2.5 w-2.5 rounded-full bg-destructive ring-2 ring-background"})]}),e[0]=n,e[1]=s.email,e[2]=s.name,e[3]=l,e[4]=m):m=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsxs(Z.Item,{onClick:()=>c(!0),children:[a.jsx(Et,{className:"text-muted-foreground",size:18}),"Profile"]}),e[5]=f):f=e[5];let u;e[6]!==n||e[7]!==o?(u=o&&a.jsxs(Z.Item,{onClick:()=>d(!0),children:[a.jsx(Tt,{className:"text-muted-foreground",size:18}),"Invitations",n&&a.jsx("span",{className:"ml-auto h-2 w-2 rounded-full bg-destructive"})]}),e[6]=n,e[7]=o,e[8]=u):u=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(Z.Separator,{}),e[9]=x):x=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=a.jsx(os,{className:"w-4 h-4 text-muted-foreground"}),e[10]=h):h=e[10];let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx(Z.Item,{asChild:!0,children:a.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:[h,"decocms/admin",a.jsx(ft,{size:18,className:"text-muted-foreground ml-auto"})]})}),e[11]=j):j=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=a.jsx(It,{className:"text-muted-foreground",size:18}),e[12]=g):g=e[12];let b,v;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx(Z.Item,{asChild:!0,children:a.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[g,"Homepage",a.jsx(ft,{size:18,className:"ml-auto text-muted-foreground"})]})}),v=a.jsx(Z.Separator,{}),e[13]=b,e[14]=v):(b=e[13],v=e[14]);let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsxs(Z.Item,{onClick:va,children:[a.jsx(zt,{size:18,className:"text-muted-foreground"}),"Log out"]}),e[15]=y):y=e[15];let w;e[16]!==m||e[17]!==u||e[18]!==s?(w=a.jsxs(Z,{user:s,trigger:m,align:"end",children:[f,u,x,j,b,v,y]}),e[16]=m,e[17]=u,e[18]=s,e[19]=w):w=e[19];let C;e[20]!==i||e[21]!==s||e[22]!==l?(C=i&&a.jsx(xa,{open:i,onOpenChange:c,user:s,userImage:l}),e[20]=i,e[21]=s,e[22]=l,e[23]=C):C=e[23];let N;e[24]!==r||e[25]!==o?(N=o&&r&&a.jsx(ga,{open:r,onOpenChange:d}),e[24]=r,e[25]=o,e[26]=N):N=e[26];let k;return e[27]!==w||e[28]!==C||e[29]!==N?(k=a.jsxs(a.Fragment,{children:[w,C,N]}),e[27]=w,e[28]=C,e[29]=N,e[30]=k):k=e[30],k}function va(){return Ce.signOut()}function ja(){const{data:t}=Ce.useSession(),e=S.useContext(ls),{data:s}=e.hooks.useListUserInvitations(),n=(s??[]).length>0;if(!t?.user)return a.jsx(Ne,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer",muted:!0});const o=t.user,i={...o,name:o.name??void 0},c=o.image;return a.jsx(ba,{user:i,userImage:c,hasInvites:n,showInvitesItem:!0})}function wa(t){const e=p.c(6),{children:s}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx(rs,{children:a.jsx(xt,{})}),e[0]=l):l=e[0];let n;e[1]!==s?(n=a.jsx(cs,{children:s}),e[1]=s,e[2]=n):n=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(ds,{children:a.jsx(ms,{to:"/login",replace:!0})}),e[3]=o):o=e[3];let i;return e[4]!==n?(i=a.jsxs(a.Fragment,{children:[l,n,o]}),e[4]=n,e[5]=i):i=e[5],i}function Sa(t){const e=p.c(5),{children:s,className:l}=t;let n;e[0]!==l?(n=M("fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",l),e[0]=l,e[1]=n):n=e[1];let o;return e[2]!==s||e[3]!==n?(o=a.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=o):o=e[4],o}function Na(t){const e=p.c(5),{children:s,className:l}=t;let n;e[0]!==l?(n=M("flex items-center justify-center px-2 h-full border-r border-border",l),e[0]=l,e[1]=n):n=e[1];let o;return e[2]!==s||e[3]!==n?(o=a.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=o):o=e[4],o}function Ca(t){const e=p.c(5),{children:s,className:l}=t;let n;e[0]!==l?(n=M("flex items-center gap-2 px-2 h-full",l),e[0]=l,e[1]=n):n=e[1];let o;return e[2]!==s||e[3]!==n?(o=a.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=o):o=e[4],o}function ya(t){const e=p.c(5),{children:s,className:l}=t;let n;e[0]!==l?(n=M("flex items-center gap-2 px-2 h-full flex-1",l),e[0]=l,e[1]=n):n=e[1];let o;return e[2]!==s||e[3]!==n?(o=a.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=o):o=e[4],o}function _a(t){const e=p.c(5),{children:s,className:l}=t;let n;e[0]!==l?(n=M("flex items-center gap-2 px-2 h-full ml-auto",l),e[0]=l,e[1]=n):n=e[1];let o;return e[2]!==s||e[3]!==n?(o=a.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=o):o=e[4],o}function ka(){const t=p.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx("div",{className:"flex items-center justify-center px-2 h-full border-r border-border",children:a.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=a.jsx("div",{className:"flex items-center gap-2 px-2 h-full",children:a.jsx("div",{className:"w-32 h-6 bg-muted rounded-md animate-pulse"})}),t[1]=s):s=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=a.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,a.jsx("div",{className:"flex items-center gap-2 px-2 h-full ml-auto",children:a.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"})})]}),t[2]=l):l=t[2],l}const De=Object.assign(Sa,{Sidebar:Na,Left:Ca,Center:ya,Right:_a,Skeleton:ka});function Ia(){const t=p.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=a.jsxs("div",{className:"flex items-center gap-3",children:[e,a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),a.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=s):s=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:a.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[s,a.jsxs("div",{className:"flex items-end gap-2",children:[a.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),a.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=l):l=t[2];let n;t[3]===Symbol.for("react.memo_cache_sentinel")?(n=a.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:a.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[a.jsx(Le,{align:"right",width:"w-3/4"}),a.jsx(Le,{align:"left",width:"w-full",lines:3}),a.jsx(Le,{align:"right",width:"w-2/3"}),a.jsx(Le,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=n):n=t[3];let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:a.jsx("div",{className:"relative flex-1",children:a.jsxs("div",{className:"space-y-2 p-2",children:[a.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),a.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx("div",{className:"flex items-center gap-1",children:a.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=i):i=t[5];let c;return t[6]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[l,n,a.jsx("div",{className:"px-4 py-4",children:a.jsx("div",{className:"mx-auto w-full max-w-2xl",children:a.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[o,a.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[i,a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),a.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=c):c=t[6],c}function Le(t){const e=p.c(22),{align:s,width:l,lines:n}=t,o=l===void 0?"w-full":l,i=n===void 0?1:n,c=s==="right"?"flex-row-reverse":"flex-row";let r;e[0]!==c?(r=M("flex w-full gap-4 px-4 py-2",c),e[0]=c,e[1]=r):r=e[1];const d=s==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let m;e[2]!==d?(m=M("flex min-w-0 flex-col gap-2",d),e[2]=d,e[3]=m):m=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=f):f=e[4];const u=s==="right"?"bg-muted":"bg-transparent border border-border/40";let x;e[5]!==u||e[6]!==o?(x=M("min-w-0 rounded-2xl p-4",u,o),e[5]=u,e[6]=o,e[7]=x):x=e[7];let h;e[8]!==i?(h=Array.from({length:i}),e[8]=i,e[9]=h):h=e[9];let j;e[10]!==i||e[11]!==h?(j=a.jsx("div",{className:"space-y-2",children:h.map((y,w)=>a.jsx("div",{className:M("h-3 rounded bg-muted-foreground/20 animate-pulse",w===i-1?"w-3/4":"w-full"),style:{animationDelay:`${w*.1}s`}},w))}),e[10]=i,e[11]=h,e[12]=j):j=e[12];let g;e[13]!==j||e[14]!==x?(g=a.jsx("div",{className:x,children:j}),e[13]=j,e[14]=x,e[15]=g):g=e[15];let b;e[16]!==g||e[17]!==m?(b=a.jsxs("div",{className:m,children:[f,g]}),e[16]=g,e[17]=m,e[18]=b):b=e[18];let v;return e[19]!==b||e[20]!==r?(v=a.jsx("div",{className:r,children:b}),e[19]=b,e[20]=r,e[21]=v):v=e[21],v}function Ft(){const t=p.c(3),{toggleSidebar:e}=ot();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=a.jsx(Mt,{className:"text-muted-foreground/85 group-hover:text-foreground transition-colors",size:20}),t[0]=s):s=t[0];let l;return t[1]!==e?(l=a.jsx(a.Fragment,{children:a.jsx(Y,{onClick:e,size:"icon",variant:"ghost",className:"w-8 h-8 rounded-md",children:s})}),t[1]=e,t[2]=l):l=t[2],l}Ft.Skeleton=function(){return a.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})};const $a="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function ht(t){const e=p.c(18),{showSidebarToggle:s,showOrgSwitcher:l,showDecoChat:n}=t,o=s===void 0?!1:s,i=l===void 0?!1:l,c=n===void 0?!1:n,[,r]=lt();let d;e[0]!==r?(d=()=>r(Ma),e[0]=r,e[1]=d):d=e[1];const m=d;let f;e[2]!==o?(f=o&&a.jsx(De.Sidebar,{children:a.jsx(Ft,{})}),e[2]=o,e[3]=f):f=e[3];let u;e[4]!==i?(u=i&&a.jsx(S.Suspense,{fallback:a.jsx(tt.Skeleton,{}),children:a.jsx(tt,{})}),e[4]=i,e[5]=u):u=e[5];let x;e[6]!==u?(x=a.jsx(De.Left,{children:u}),e[6]=u,e[7]=x):x=e[7];let h;e[8]!==c||e[9]!==m?(h=c&&a.jsxs(Y,{size:"sm",variant:"default",onClick:m,children:[a.jsx(Ne,{url:$a,fallback:"DC",size:"2xs",className:"rounded-sm"}),"deco chat"]}),e[8]=c,e[9]=m,e[10]=h):h=e[10];let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx(ja,{}),e[11]=j):j=e[11];let g;e[12]!==h?(g=a.jsxs(De.Right,{className:"gap-2",children:[h,j]}),e[12]=h,e[13]=g):g=e[13];let b;return e[14]!==g||e[15]!==f||e[16]!==x?(b=a.jsxs(De,{children:[f,x,g]}),e[14]=g,e[15]=f,e[16]=x,e[17]=b):b=e[17],b}function Ma(t){return!t}function za(t){const e=p.c(10),{children:s,className:l}=t,[,n]=S.useTransition();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=He.decoChatPanelWidth(),e[0]=o):o=e[0];const[i,c]=nt(o,30);let r;e[1]!==c?(r=u=>n(()=>c(u)),e[1]=c,e[2]=r):r=e[2];const d=r;let m;e[3]!==l?(m=M("min-w-0",l),e[3]=l,e[4]=m):m=e[4];let f;return e[5]!==i||e[6]!==s||e[7]!==d||e[8]!==m?(f=a.jsx(bt,{defaultSize:i,minSize:20,className:m,onResize:d,children:s}),e[5]=i,e[6]=s,e[7]=d,e[8]=m,e[9]=f):f=e[9],f}function Ta(t){const e=p.c(5),{children:s}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=He.sidebarOpen(),e[0]=l):l=e[0];const[n,o]=nt(l,!0);let i;return e[1]!==s||e[2]!==o||e[3]!==n?(i=a.jsx(_n,{open:n,onOpenChange:o,children:s}),e[1]=s,e[2]=o,e[3]=n,e[4]=i):i=e[4],i}function Oa(){const t=p.c(9),[e]=lt();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=a.jsx(bt,{className:"bg-background",children:a.jsx(gt,{})}),t[0]=s):s=t[0];let l;t[1]!==e?(l=a.jsx(Ps,{withHandle:e}),t[1]=e,t[2]=l):l=t[2];const n=e?"max-w-none":"max-w-0";let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(at,{children:a.jsx(S.Suspense,{fallback:a.jsx(Ia,{}),children:a.jsx(fn,{})})}),t[3]=o):o=t[3];let i;t[4]!==n?(i=a.jsx(za,{className:n,children:o}),t[4]=n,t[5]=i):i=t[5];let c;return t[6]!==l||t[7]!==i?(c=a.jsxs(Ds,{direction:"horizontal",children:[s,l,i]}),t[6]=l,t[7]=i,t[8]=c):c=t[8],c}function Ea(){const t=p.c(16);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=st(e);let l;t[1]!==s?(l=pt.activeOrganization(s),t[1]=s,t[2]=l):l=t[2];let n;t[3]!==s?(n=async()=>{if(!s)return null;const{data:u}=await Ce.organization.setActive({organizationSlug:s});return{org:u,project:{slug:Ss}}},t[3]=s,t[4]=n):n=t[4];let o;t[5]!==l||t[6]!==n?(o={queryKey:l,queryFn:n,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=l,t[6]=n,t[7]=o):o=t[7];const{data:i}=fs(o);if(!i){let u;t[8]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx(ht,{}),t[8]=u):u=t[8];let x;return t[9]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsxs("div",{className:"min-h-screen bg-background",children:[u,a.jsx("div",{className:"pt-12",children:a.jsx(gt,{})})]}),t[9]=x):x=t[9],x}let c;t[10]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(ht,{showSidebarToggle:!0,showOrgSwitcher:!0,showDecoChat:!0}),t[10]=c):c=t[10];let r;t[11]===Symbol.for("react.memo_cache_sentinel")?(r={"--sidebar-width":"13rem","--sidebar-width-mobile":"11rem"},t[11]=r):r=t[11];let d;t[12]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(Wn,{}),t[12]=d):d=t[12];let m;t[13]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(Ta,{children:a.jsxs("div",{className:"flex flex-col h-screen",children:[c,a.jsxs($n,{className:"flex-1 bg-sidebar",style:r,children:[d,a.jsx(zn,{className:"pt-12",children:a.jsx(Oa,{})})]})]})}),t[13]=m):m=t[13];let f;return t[14]!==i?(f=a.jsx(ws,{...i,children:m}),t[14]=i,t[15]=f):f=t[15],f}function _l(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(wa,{children:a.jsx(S.Suspense,{fallback:a.jsx(xt,{}),children:a.jsx(Ea,{})})}),t[0]=e):e=t[0],e}export{_l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ad as u,a9 as s}from"./index-tz4gB72W.js";function o(e,r){return u(e,s,r)}export{o as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as L,f as P,r as N,j as e,c as k}from"./index-tz4gB72W.js";import{b as _}from"./well-known-mcp-VNRT0JrW.js";import{C as M}from"./collection-tab-dwp9LGxi.js";import{a as R,u as z}from"./use-connection-DRZbGk_A.js";import{u as B}from"./tooltip-Bzy1O5cq.js";import{B as y}from"./button-BSXU4L7C.js";import{E as A}from"./SearchMd-BFumDfkS.js";import{C as F}from"./collection-header-B--7sWbR.js";import{u as O,b as H}from"./use-binding-jUI3xZmp.js";import{i as T}from"./Loading01-B0vdyVbH.js";import"./generate-id-Dyweu44Y.js";import"./collection-display-button-BAoFTB4b.js";import"./dropdown-menu-ClBJUvd8.js";import"./Grid01-BTunGha4.js";import"./view-mode-toggle-COcukfhX.js";import"./collection-search-CrC01K4Z.js";import"./input-Cb7MaM0d.js";import"./card-CXFRieEW.js";import"./Copy01-CCVZH6f1.js";import"./DotsVertical-8kkJJG9R.js";import"./use-list-state-CkGBL95Z.js";import"./use-mobile-B8xlavN6.js";import"./Trash01-1tKgR7uh.js";import"./collection-table-wrapper-CFoaxah9.js";import"./empty-state-CYnIzDhF.js";import"./Inbox01-BoV8p7IN.js";import"./avatar-DHKqC-IM.js";import"./useQuery-Bl78N6vT.js";import"./pin-to-sidebar-button-CwlJToUG.js";import"./use-organization-settings-C7IdFOTo.js";import"./constants-C-5m3xCJ.js";import"./alert-dialog-_VCwcCen.js";import"./Plus-nu8-Nz8b.js";import"./layout-DtfNegCp.js";import"./ArrowLeft-DC_Ebc-m.js";import"./auth-BpfHzPVh.js";function V({title:i,description:t,wellKnownMcp:o,imageSrc:n,onConnected:s}){const r=R(),{org:{slug:m}}=B(),{data:h}=L.useSession(),d=P(),[a,v]=N.useState(!1),l=async()=>{if(!(!o||!h?.user?.id)){v(!0);try{const c=await r.create.mutateAsync(o);s?.(c.id),d({to:"/$org/mcps/$connectionId",params:{org:m,connectionId:c.id}})}finally{v(!1)}}},j=()=>{d({to:"/$org/mcps",params:{org:m},search:{action:"create"}})};return e.jsx(A,{image:n?e.jsx("img",{src:n,alt:i,width:336,height:320,className:"max-w-full h-auto"}):null,title:i,description:t,actions:e.jsxs(e.Fragment,{children:[e.jsxs(y,{variant:"outline",onClick:l,disabled:a||!o,children:[o?.icon&&e.jsx("img",{src:o.icon,alt:"",className:"size-4"}),a?"Installing...":`Install ${o?.title||"MCP"}`]}),e.jsx(y,{variant:"outline",onClick:j,children:"Install MCP Server"})]})})}function q(i){const t=k.c(28),{bindingName:o,collectionName:n,title:s,emptyState:r,wellKnownMcp:m}=i,{org:h}=B(),d=z();let a;t[0]!==d||t[1]!==o?(a={connections:d,binding:o},t[0]=d,t[1]=o,t[2]=a):a=t[2];const l=O(a)[0],j=H(l);let c;if(t[3]!==n||t[4]!==j){let C;t[6]!==n?(C=$=>$.name.toLowerCase()===n.toLowerCase(),t[6]=n,t[7]=C):C=t[7],c=j.find(C),t[3]=n,t[4]=j,t[5]=c}else c=t[5];const S=c,[E,W]=N.useState(null),w=l&&S&&(l.id||E);let f;t[8]!==s?(f=e.jsx(F,{title:s}),t[8]=s,t[9]=f):f=t[9];let I;t[10]===Symbol.for("react.memo_cache_sentinel")?(I=e.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t[10]=I):I=t[10];let p;t[11]!==s?(p=s.toLowerCase(),t[11]=s,t[12]=p):p=t[12];let u;t[13]!==p?(u=e.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[I,e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading ",p,"..."]})]}),t[13]=p,t[14]=u):u=t[14];let g;t[15]!==S||t[16]!==l||t[17]!==r||t[18]!==h||t[19]!==w||t[20]!==m?(g=w?e.jsx(M,{connectionId:l.id,org:h.slug,activeCollection:S}):e.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:e.jsx(V,{title:r.title,description:r.description,wellKnownMcp:m,imageSrc:r.imageSrc,onConnected:C=>{W(C)}})}),t[15]=S,t[16]=l,t[17]=r,t[18]=h,t[19]=w,t[20]=m,t[21]=g):g=t[21];let x;t[22]!==u||t[23]!==g?(x=e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx(N.Suspense,{fallback:u,children:g})}),t[22]=u,t[23]=g,t[24]=x):x=t[24];let b;return t[25]!==f||t[26]!==x?(b=e.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[f,x]}),t[25]=f,t[26]=x,t[27]=b):b=t[27],b}function kt(){const i=k.c(1);let t;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(q,{bindingName:"WORKFLOW",collectionName:"workflow",title:"Workflows",emptyState:{title:"Create Workflows",description:"Install MCP Studio to create and manage automated workflows with multiple steps and integrations."},wellKnownMcp:_()}),i[0]=t):t=i[0],t}export{kt as default};
|