@decocms/mesh 2.1.2 → 2.2.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-DiqlNboz.js → AlertCircle-laxSE0PX.js} +1 -1
- package/dist/client/assets/{ArrowLeft-C4VtVMs2.js → ArrowLeft-Dd7BK5dX.js} +1 -1
- package/dist/client/assets/{ChevronDown-CcUg3X_Y.js → ChevronDown-CvWv-usR.js} +1 -1
- package/dist/client/assets/{ChevronRight-DoX6pxYj.js → ChevronRight-Fe_n2oGa.js} +1 -1
- package/dist/client/assets/{Copy01-BJql3T8w.js → Copy01-C6NIIZuG.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-wWvFFsxa.js → DotsHorizontal-Cw17Pnyf.js} +1 -1
- package/dist/client/assets/{DotsVertical-C_psDJy3.js → DotsVertical-CH2fNSbY.js} +1 -1
- package/dist/client/assets/{File06-CfmzgkCD.js → File06-BFg45elm.js} +1 -1
- package/dist/client/assets/{FilterLines-MNaVyood.js → FilterLines-BjvAuET2.js} +1 -1
- package/dist/client/assets/{FlipBackward-qa1GrgeQ.js → FlipBackward-BCF9hA9D.js} +1 -1
- package/dist/client/assets/{GitBranch01-Cy-aTD__.js → GitBranch01-5UP5g_4t.js} +1 -1
- package/dist/client/assets/{Grid01-400pwqps.js → Grid01-Soc1w0HN.js} +1 -1
- package/dist/client/assets/{Inbox01-DQ40if0u.js → Inbox01-D8CnGo7i.js} +1 -1
- package/dist/client/assets/{InfoCircle-DbgHopMm.js → InfoCircle-CJE1rYNL.js} +1 -1
- package/dist/client/assets/{Key01-CXPRpQE9.js → Key01-D6Y52TVu.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BJZvPGF2.js → LinkExternal01-DbeN7vxS.js} +1 -1
- package/dist/client/assets/{Loading01-DSWhKp36.js → Loading01-B8IKnW3x.js} +1 -1
- package/dist/client/assets/{Lock01-Cw5Gl3NV.js → Lock01-DGGIBBCl.js} +1 -1
- package/dist/client/assets/{Play-18tBEZWZ.js → Play-D2jnwQAI.js} +1 -1
- package/dist/client/assets/{Plus-SMn8MQ-H.js → Plus-3Cnjm1UT.js} +1 -1
- package/dist/client/assets/{Terminal-yR92omIF.js → Terminal-vZCLGbvo.js} +1 -1
- package/dist/client/assets/{Trash01-DaFJSHZu.js → Trash01-D0jDlYQJ.js} +1 -1
- package/dist/client/assets/{X-q_t7ZUi-.js → X-CrCcl1sv.js} +1 -1
- package/dist/client/assets/{XClose-2lFeEEkz.js → XClose-DZ7ckVTf.js} +1 -1
- package/dist/client/assets/{alert-dialog-BOjS3GrS.js → alert-dialog-BHM4cw4Q.js} +2 -2
- package/dist/client/assets/{auth-BvEfLR40.js → auth-BfhoYwZo.js} +1 -1
- package/dist/client/assets/{auth-catchall-qnrnPCT6.js → auth-catchall-BQuGaWdj.js} +1 -1
- package/dist/client/assets/{avatar-D8KYLrun.js → avatar-CBETgvTo.js} +1 -1
- package/dist/client/assets/{badge-DHFuTJNA.js → badge-BoEIasGQ.js} +1 -1
- package/dist/client/assets/{card-CSWNwOPv.js → card-TBEiO_pf.js} +1 -1
- package/dist/client/assets/{checkbox-D6eJScSi.js → checkbox-CFS6LZcp.js} +1 -1
- package/dist/client/assets/{collection-detail-cLR1iiCF.js → collection-detail-BnDPq9AR.js} +18 -18
- package/dist/client/assets/{collection-display-button-DWBgVnY5.js → collection-display-button-KvR7sWeM.js} +1 -1
- package/dist/client/assets/{collection-header-BYkZ9Trb.js → collection-header-f1ffdO7f.js} +1 -1
- package/dist/client/assets/{collection-page-BjyL0NfT.js → collection-page-WZgTp5Lv.js} +1 -1
- package/dist/client/assets/{collection-search-BhTsTIQF.js → collection-search-3XPe6V_T.js} +1 -1
- package/dist/client/assets/{collection-tab-ByD_c7B5.js → collection-tab-CNcWbqd2.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-G4nlfvjF.js → collection-table-wrapper-B34CJdmN.js} +1 -1
- package/dist/client/assets/{connection-card-BRub-GLZ.js → connection-card-AILFqLN1.js} +1 -1
- package/dist/client/assets/connection-detail-Dkmb8FZw.js +1 -0
- package/dist/client/assets/{connections-BEv7u43V.js → connections-Ce1zfRUl.js} +1 -1
- package/dist/client/assets/constants-D2EL4NMa.js +1 -0
- package/dist/client/assets/{create-organization-dialog-CahJq4TL.js → create-organization-dialog-6aGfA3nN.js} +1 -1
- package/dist/client/assets/{dialog-Ay6PD9W0.js → dialog-By5cpA-o.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CX0_ej-t.js → dropdown-menu-CxU4B3XS.js} +1 -1
- package/dist/client/assets/{empty-state-DOXYCllo.js → empty-state-DDZV3qxG.js} +1 -1
- package/dist/client/assets/{env-vars-editor-DB_yBian.js → env-vars-editor-CLtT_Pn2.js} +1 -1
- package/dist/client/assets/{error-boundary-BITgBYMF.js → error-boundary-DFjr3eHD.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CaZ0wil0.js → extract-connection-data-CNLQVqLl.js} +1 -1
- package/dist/client/assets/{form-CTm5F5lc.js → form-BAnmUhVa.js} +1 -1
- package/dist/client/assets/gateway-detail-CD1SXTO4.js +1 -0
- package/dist/client/assets/gateway-selector-BC3bwpkS.js +1 -0
- package/dist/client/assets/gateways-BPDYdmPL.js +1 -0
- package/dist/client/assets/{home-BCE1FamF.js → home-CxQ-oPDQ.js} +1 -1
- package/dist/client/assets/index-BQaN6CW7.js +25 -0
- package/dist/client/assets/{index-DU53zBhA.css → index-BV_tzcZC.css} +1 -1
- package/dist/client/assets/{index-Tg8Sdg8t.js → index-CIDbVI0o.js} +2 -2
- package/dist/client/assets/{index-DskbBe5h.js → index-DxSQLqqY.js} +1 -1
- package/dist/client/assets/{input-DZxsngZP.js → input-BYLamBFT.js} +1 -1
- package/dist/client/assets/{layout-Brqmaefj.js → layout-CPjqBR8a.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-CiDPKksG.js → lazy-highlighter-L5Lo_GWJ.js} +1 -1
- package/dist/client/assets/localstorage-keys-BcKYfcRC.js +1 -0
- package/dist/client/assets/{login-DTvg0d0e.js → login-CWasMrLi.js} +1 -1
- package/dist/client/assets/{mcp-oauth-SMi_MNm0.js → mcp-oauth-BbYG4wEg.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-Dp4c82jn.js → mcp-server-detail-DL1XSpPt.js} +1 -1
- package/dist/client/assets/{members-Antj9sp8.js → members-Cm7y0IGn.js} +1 -1
- package/dist/client/assets/{monaco-editor-DzF_l7qF.js → monaco-editor-BANuhZc7.js} +1 -1
- package/dist/client/assets/{monitoring-CFWL1rLz.js → monitoring-CypFTCwZ.js} +3 -3
- package/dist/client/assets/{oauth-callback-CG8hLD-b.js → oauth-callback-BljFGwn2.js} +1 -1
- package/dist/client/assets/page-B3Vk0n7G.js +35 -0
- package/dist/client/assets/{page-BvT1wvbD.js → page-DPBKFn7H.js} +1 -1
- package/dist/client/assets/{pin-to-sidebar-button-fGogNndB.js → pin-to-sidebar-button-GermWsTp.js} +1 -1
- package/dist/client/assets/{popover-D8pPVQL_.js → popover-BXzChz3h.js} +1 -1
- package/dist/client/assets/{project-context-provider-DzGl09z5.js → project-context-provider-rr2ZgefD.js} +1 -1
- package/dist/client/assets/{resizable-RYzDqksM.js → resizable-DKOKD5be.js} +1 -1
- package/dist/client/assets/{resource-tabs-Dx00akPb.js → resource-tabs-UF1uUrPS.js} +1 -1
- package/dist/client/assets/{select-DXarH3zI.js → select-8RE8G2EV.js} +1 -1
- package/dist/client/assets/{settings-CppuOJKP.js → settings-WmaC0ugB.js} +1 -1
- package/dist/client/assets/shell-layout-DLeQwwOP.js +1 -0
- package/dist/client/assets/{spinner-BlgPNYJ_.js → spinner-CeWqo2ib.js} +1 -1
- package/dist/client/assets/{switch-D8JX4qkY.js → switch-CxhRshQs.js} +1 -1
- package/dist/client/assets/{textarea-B4gwvsMJ.js → textarea-DbQy5F3n.js} +1 -1
- package/dist/client/assets/{thread-history-popover-BGdJj9Uf.js → thread-history-popover-Dh1623de.js} +82 -45
- package/dist/client/assets/{tools-list-PNSOJy0p.js → tools-list-Bf2FOeAk.js} +1 -1
- package/dist/client/assets/{use-binding-BrFwEM85.js → use-binding-B-kSZTGy.js} +1 -1
- package/dist/client/assets/{use-connection-C0rtvbAv.js → use-connection-DFkAC4Is.js} +1 -1
- package/dist/client/assets/use-connection-resources-BYLrv2O6.js +1 -0
- package/dist/client/assets/{use-gateway-XK2Ec2c7.js → use-gateway-QZNjV_Br.js} +1 -1
- package/dist/client/assets/use-gateway-system-prompt-DowqNUnD.js +1 -0
- package/dist/client/assets/{use-list-state-CaOiitHv.js → use-list-state-oVkbwyL1.js} +1 -1
- package/dist/client/assets/{use-mcp-DP2e7Pak.js → use-mcp-B38V1Eo_.js} +1 -1
- package/dist/client/assets/{use-members-BZIlp51_.js → use-members-B5ZPlWxC.js} +1 -1
- package/dist/client/assets/{use-mobile-C9ZrGbF1.js → use-mobile-DKb1FXwT.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CpuYghUf.js → use-organization-settings-DDkza1UL.js} +1 -1
- package/dist/client/assets/{use-tool-call-BLCuCQA5.js → use-tool-call-CkogDXv4.js} +1 -1
- package/dist/client/assets/useQueries-D02scwU5.js +1 -0
- package/dist/client/assets/useQuery-Cu8VEtZR.js +1 -0
- package/dist/client/assets/{value-C6pOmVvH.js → value-0Lc1LEd3.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BegVAMeC.js → view-mode-toggle-C8FGoH5Z.js} +1 -1
- package/dist/client/assets/{workflow-ChKb4zdL.js → workflow-C4jHNR-h.js} +1 -1
- package/dist/client/index.html +2 -2
- 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/connection-detail-DgCsw2FN.js +0 -1
- package/dist/client/assets/constants-CxNag89_.js +0 -1
- package/dist/client/assets/formatDistanceToNow-Da1WFNC1.js +0 -1
- package/dist/client/assets/gateway-detail-ZvOmrysO.js +0 -1
- package/dist/client/assets/gateway-selector-zAzGBjF_.js +0 -1
- package/dist/client/assets/gateways-JihiLKrE.js +0 -1
- package/dist/client/assets/index-DOV_cVSz.js +0 -25
- package/dist/client/assets/localstorage-keys-Bmzia9Ql.js +0 -1
- package/dist/client/assets/page-CBEZJuHw.js +0 -35
- package/dist/client/assets/shell-layout-9hZXlinq.js +0 -19
- package/dist/client/assets/use-connection-resources-85AsmF-4.js +0 -1
- package/dist/client/assets/useQuery-CDC7rIFj.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as I,a0 as ye,s as fe,W as F,v as S,Q as Ue,c as W,j as t,h as Be,d as nt,b as it,i as rt,aG as at,w as ct,x as dt,t as Ae}from"./index-CIDbVI0o.js";import{I as Me,u as qe,E as mt}from"./use-connection-DFkAC4Is.js";import{E as He}from"./error-boundary-DFjr3eHD.js";import{C as Je}from"./checkbox-CFS6LZcp.js";import{c as te,B as L,I as $e}from"./input-BYLamBFT.js";import{i as ut}from"./ArrowLeft-Dd7BK5dX.js";import{C as ft}from"./collection-search-3XPe6V_T.js";import{s as ht}from"./Plus-3Cnjm1UT.js";import{i as xt}from"./X-CrCcl1sv.js";import{P as pt}from"./pin-to-sidebar-button-GermWsTp.js";import{T as gt,S as bt}from"./switch-CxhRshQs.js";import{b as jt,a as yt,i as vt}from"./use-gateway-QZNjV_Br.js";import{u as _t,a as St}from"./use-connection-resources-BYLrv2O6.js";import{u as Ct}from"./use-gateway-system-prompt-DowqNUnD.js";import{s as wt}from"./slugify-CEUa2lfQ.js";import{D as Nt,a as It,c as kt,d as Tt}from"./dialog-By5cpA-o.js";import{F as be,a as $t,b as ve,d as _e,f as Se,c as Qe}from"./form-BAnmUhVa.js";import{R as zt}from"./resource-tabs-UF1uUrPS.js";import{S as Ze,a as Ke,b as Xe,c as Ye,d as je}from"./select-8RE8G2EV.js";import{T as Pt}from"./textarea-DbQy5F3n.js";import{a as K,c as X,b as Y,T as ee,i as De}from"./project-context-provider-rr2ZgefD.js";import{a as et}from"./Copy01-C6NIIZuG.js";import{i as Rt}from"./FlipBackward-BCF9hA9D.js";import{i as tt}from"./InfoCircle-CJE1rYNL.js";import{i as Ee}from"./Loading01-B8IKnW3x.js";import{a as At,V as Dt,b as Et}from"./layout-CPjqBR8a.js";import"./use-organization-settings-DDkza1UL.js";import"./useQueries-D02scwU5.js";import"./localstorage-keys-BcKYfcRC.js";import"./useQuery-Cu8VEtZR.js";import"./badge-BoEIasGQ.js";import"./ChevronDown-CvWv-usR.js";const st=({size:o=24,color:e="currentColor",...s})=>I.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},I.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"}));st.displayName="Save01";const ot=({size:o=24,color:e="currentColor",...s})=>I.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},I.createElement("path",{d:"m8.59 13.51 6.83 3.98m-.01-10.98-6.82 3.98M21 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm12 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));ot.displayName="Share07";const Oe=ye(["inclusion","exclusion"]).describe("Tool selection mode: 'inclusion' = include selected (default), 'exclusion' = exclude selected"),Ve=ye(["passthrough","smart_tool_selection","code_execution"]).describe("Gateway tool selection strategy: 'passthrough' (default), 'smart_tool_selection', or 'code_execution'"),Ut=fe({connection_id:S().describe("Connection ID"),selected_tools:F(S()).nullable().describe("Selected tool names. With 'inclusion' mode: null = all tools included. With 'exclusion' mode: null = entire connection excluded"),selected_resources:F(S()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. With 'inclusion' mode: null = all resources included."),selected_prompts:F(S()).nullable().describe("Selected prompt names. With 'inclusion' mode: null = all prompts included. With 'exclusion' mode: null = entire connection excluded.")}),Mt=fe({id:S().describe("Unique identifier for the gateway"),title:S().describe("Human-readable name for the gateway"),description:S().nullable().describe("Description of the gateway"),icon:S().nullable().optional().describe("Icon URL for the gateway"),created_at:S().describe("When the gateway was created"),updated_at:S().describe("When the gateway was last updated"),created_by:S().describe("User ID who created the gateway"),updated_by:S().optional().describe("User ID who last updated the gateway"),organization_id:S().describe("Organization ID this gateway belongs to"),tool_selection_strategy:Ve.describe("Gateway behavior strategy (metadata for now): 'passthrough', 'smart_tool_selection', or 'code_execution'"),tool_selection_mode:Oe.describe("Tool selection mode: 'inclusion' = include selected, 'exclusion' = exclude selected"),status:ye(["active","inactive"]).describe("Current status"),is_default:Ue().describe("Whether this is the Organization Agent for the organization"),connections:F(Ut).describe("Connections with their selected tools (behavior depends on tool_selection_mode)")});fe({title:S().min(1).max(255).describe("Name for the gateway"),description:S().nullable().optional().describe("Optional description"),tool_selection_strategy:Ve.optional().default("passthrough").describe("Gateway behavior strategy (defaults to 'passthrough')"),tool_selection_mode:Oe.optional().default("inclusion").describe("Tool selection mode (defaults to 'inclusion')"),icon:S().nullable().optional().describe("Optional icon URL"),status:ye(["active","inactive"]).optional().default("active").describe("Initial status"),is_default:Ue().optional().default(!1).describe("Whether this is the Organization Agent for the organization"),connections:F(fe({connection_id:S().describe("Connection ID"),selected_tools:F(S()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:F(S()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:F(S()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).describe("Connections to include/exclude (can be empty for exclusion mode)")});fe({title:S().min(1).max(255).optional().describe("New name"),description:S().nullable().optional().describe("New description (null to clear)"),tool_selection_strategy:Ve.optional().describe("New gateway behavior strategy"),tool_selection_mode:Oe.optional().describe("New tool selection mode"),icon:S().nullable().optional().describe("New icon URL (null to clear)"),status:ye(["active","inactive"]).optional().describe("New status"),is_default:Ue().optional().describe("Set as Organization Agent for the organization"),connections:F(fe({connection_id:S().describe("Connection ID"),selected_tools:F(S()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:F(S()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:F(S()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).optional().describe("New connections (replaces existing)")});const Ot=I.memo(function(e){const s=W.c(20),{connection:l,isSelected:a,hasItemsEnabled:i,activeItemsCount:x,totalItemsCount:d,onSelect:m,onToggle:n}=e,c=a?"bg-accent/50":"hover:bg-muted/50";let u;s[0]!==c?(u=te("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",c),s[0]=c,s[1]=u):u=s[1];let r;s[2]!==l.icon||s[3]!==l.title?(r=t.jsx(Me,{icon:l.icon,name:l.title,size:"xs"}),s[2]=l.icon,s[3]=l.title,s[4]=r):r=s[4];let g;s[5]!==l.title?(g=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),s[5]=l.title,s[6]=g):g=s[6];let f;s[7]!==m||s[8]!==r||s[9]!==g?(f=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:m,children:[r,g]}),s[7]=m,s[8]=r,s[9]=g,s[10]=f):f=s[10];let p;s[11]!==x||s[12]!==i||s[13]!==n||s[14]!==d?(p=d>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[x,"/",d]}),t.jsx(Je,{checked:i,onCheckedChange:n,onClick:Gt})]}),s[11]=x,s[12]=i,s[13]=n,s[14]=d,s[15]=p):p=s[15];let j;return s[16]!==u||s[17]!==f||s[18]!==p?(j=t.jsxs("div",{className:u,children:[f,p]}),s[16]=u,s[17]=f,s[18]=p,s[19]=j):j=s[19],j}),Vt=I.memo(function(e){const s=W.c(18),{connectionId:l,item:a,isSelected:i,onToggle:x}=e,d=`item-${l}-${a.id}`,m=i?"text-foreground":"text-muted-foreground";let n;s[0]!==m?(n=te("text-sm font-medium",m),s[0]=m,s[1]=n):n=s[1];let c;s[2]!==a.name||s[3]!==n?(c=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:n,children:a.name})}),s[2]=a.name,s[3]=n,s[4]=c):c=s[4];let u;s[5]!==a.description?(u=a.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:a.description}),s[5]=a.description,s[6]=u):u=s[6];let r;s[7]!==c||s[8]!==u?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,u]}),s[7]=c,s[8]=u,s[9]=r):r=s[9];const g=`item-${l}-${a.id}`;let f;s[10]!==i||s[11]!==x||s[12]!==g?(f=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Je,{id:g,checked:i,onCheckedChange:x,onClick:Ft})}),s[10]=i,s[11]=x,s[12]=g,s[13]=f):f=s[13];let p;return s[14]!==d||s[15]!==r||s[16]!==f?(p=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:d,children:[r,f]}),s[14]=d,s[15]=r,s[16]=f,s[17]=p):p=s[17],p});function lt({itemSet:o,onItemSetChange:e,getItems:s,itemLabel:l,emptyItemsMessage:a,extraContent:i}){const[x,d]=I.useState(""),m=I.useDeferredValue(x),[n,c]=I.useState("all"),[u,r]=I.useState(!1),g=I.useRef(new Set(Object.keys(o))),f=qe({searchTerm:m.trim()||void 0}),p=g.current,j=[...p.values()].map(h=>f.find(_=>_.id===h)).filter(h=>h!==void 0),y=f.filter(h=>!p.has(h.id)),v=[...j,...y],b=h=>{const _=o[h];return _!==void 0&&_.length>0},C=v.filter(h=>{if(n==="all")return!0;const _=b(h.id);return n==="selected"?_:n==="unselected"?!_:!0}),[N,k]=I.useState(v[0]?.id??null),w=N?v.find(h=>h.id===N)??null:null,E=w?s(w):[],A=(h,_)=>o[h]?.includes(_)??!1,B=(h,_)=>{const $=o[h]??[],z=$.includes(_),U={...o};if(z){const P=$.filter(M=>M!==_);P.length===0?delete U[h]:U[h]=P}else U[h]=[...$,_];e(U)},Z=h=>{const _=v.find(D=>D.id===h);if(!_)return;const $=s(_);if($.length===0)return;const z=o[h]??[],U=$.map(D=>D.id),P=z.length>0&&U.every(D=>z.includes(D)),M={...o};P?delete M[h]:(M[h]=U,k(h)),e(M)},O=h=>{k(h),r(!0)},V=()=>{r(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:te("w-full md:w-80 border-r border-border flex flex-col",u&&"hidden md:flex"),children:[t.jsx(ft,{value:x,onChange:d,placeholder:"Search Connections..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>c("all"),className:te("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",n==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>c("selected"),className:te("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",n==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>c("unselected"),className:te("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",n==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:C.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:x?"No connections found":n==="selected"?"No servers selected":n==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:C.map(h=>{const $=s(h).length,z=o[h.id]?.length??0;return t.jsx(Ot,{connection:h,isSelected:N===h.id,hasItemsEnabled:b(h.id),activeItemsCount:z,totalItemsCount:$,onSelect:()=>O(h.id),onToggle:()=>Z(h.id)},h.id)})})})]}),t.jsx("div",{className:te("flex-1 flex-col",u?"flex":"hidden md:flex"),children:w?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(L,{variant:"ghost",size:"sm",onClick:V,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(ut,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(Me,{icon:w.icon,name:w.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:w.title}),w.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:w.description})]})]})]}),i,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:E.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:a||`This connection has no ${l} available`}):t.jsx("div",{className:"space-y-2",children:E.map(h=>t.jsx(Vt,{connectionId:w.id,item:h,isSelected:A(w.id,h.id),onToggle:()=>B(w.id,h.id)},h.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 ",l]})})})]})}function Gt(o){return o.stopPropagation()}function Ft(o){return o.stopPropagation()}function Lt(o){const e=W.c(6),{promptSet:s,onPromptSetChange:l,connectionPrompts:a}=o;let i;e[0]!==a?(i=m=>(a.get(m.id)??[]).map(Wt),e[0]=a,e[1]=i):i=e[1];const x=i;let d;return e[2]!==x||e[3]!==l||e[4]!==s?(d=t.jsx(lt,{itemSet:s,onItemSetChange:l,getItems:x,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=x,e[3]=l,e[4]=s,e[5]=d):d=e[5],d}function Wt(o){return{id:o.name,name:o.name,description:o.description}}function Bt(o){return o.includes("*")}function qt(o){const e=W.c(27),{patterns:s,onAddPattern:l,onRemovePattern:a}=o,[i,x]=I.useState("");let d;e[0]!==i||e[1]!==l||e[2]!==s?(d=()=>{const r=i.trim();r&&!s.includes(r)&&(l(r),x(""))},e[0]=i,e[1]=l,e[2]=s,e[3]=d):d=e[3];const m=d;let n;e[4]!==m?(n=r=>{r.key==="Enter"&&(r.preventDefault(),m())},e[4]=m,e[5]=n):n=e[5];const c=n;let u;if(e[6]!==m||e[7]!==c||e[8]!==i||e[9]!==a||e[10]!==s){const r=s.filter(Bt);let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("code",{children:"*"}),e[12]=g):g=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",g," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=f):f=e[13];let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p=k=>x(k.target.value),e[14]=p):p=e[14];let j;e[15]!==c||e[16]!==i?(j=t.jsx($e,{value:i,onChange:p,onKeyDown:c,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=c,e[16]=i,e[17]=j):j=e[17];let y;e[18]!==i?(y=i.trim(),e[18]=i,e[19]=y):y=e[19];const v=!y;let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(ht,{size:16}),e[20]=b):b=e[20];let C;e[21]!==m||e[22]!==v?(C=t.jsx(L,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:v,children:b}),e[21]=m,e[22]=v,e[23]=C):C=e[23];let N;e[24]!==C||e[25]!==j?(N=t.jsxs("div",{className:"flex gap-2",children:[j,C]}),e[24]=C,e[25]=j,e[26]=N):N=e[26],u=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[f,N,r.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:r.map(k=>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:k}),t.jsx("button",{type:"button",onClick:()=>a(k),className:"text-muted-foreground hover:text-foreground",children:t.jsx(xt,{size:12})})]},k))})]}),e[6]=m,e[7]=c,e[8]=i,e[9]=a,e[10]=s,e[11]=u}else u=e[11];return u}function Ht(o){const e=W.c(23),{resourceSet:s,onResourceSetChange:l,connectionResources:a}=o,[i]=I.useState(null);let x;e[0]!==a?(x=b=>(a.get(b.id)??[]).map(Jt),e[0]=a,e[1]=x):x=e[1];const d=x;let m;e[2]!==l||e[3]!==s?(m=(b,C)=>{const N=s[b]??[];N.includes(C)||l({...s,[b]:[...N,C]})},e[2]=l,e[3]=s,e[4]=m):m=e[4];const n=m;let c;e[5]!==l||e[6]!==s?(c=(b,C)=>{const k=(s[b]??[]).filter(w=>w!==C);if(k.length===0){const w={...s};delete w[b],l(w)}else l({...s,[b]:k})},e[5]=l,e[6]=s,e[7]=c):c=e[7];const u=c;let r;e[8]!==l?(r=b=>{l(b)},e[8]=l,e[9]=r):r=e[9];const g=r;let f;e[10]!==s||e[11]!==i?(f=i?s[i]??[]:[],e[10]=s,e[11]=i,e[12]=f):f=e[12];const p=f;let j;e[13]!==n||e[14]!==u||e[15]!==i||e[16]!==p?(j=i?t.jsx(qt,{patterns:p,onAddPattern:b=>n(i,b),onRemovePattern:b=>u(i,b)}):null,e[13]=n,e[14]=u,e[15]=i,e[16]=p,e[17]=j):j=e[17];const y=j;let v;return e[18]!==y||e[19]!==d||e[20]!==g||e[21]!==s?(v=t.jsx("div",{className:"h-full",children:t.jsx(lt,{itemSet:s,onItemSetChange:g,getItems:d,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:y})}),e[18]=y,e[19]=d,e[20]=g,e[21]=s,e[22]=v):v=e[22],v}function Jt(o){return{id:o.uri,name:o.name||o.uri,description:o.description||o.uri}}function Qt(o){const s=new TextEncoder().encode(o),l=Array.from(s,a=>String.fromCharCode(a)).join("");return btoa(l)}function Zt(o){const e=W.c(52),{serverName:s,gatewayUrl:l}=o,[a,i]=I.useState(!1),[x,d]=I.useState(null),m=wt(s);let n,c,u,r;if(e[0]!==l||e[1]!==m){const R={type:"http",url:l},he={[m]:R};n=JSON.stringify(he,null,2);const se=pe=>JSON.stringify({...R,headers:{"x-mesh-client":pe}},null,2),oe=Qt(se("Cursor"));c=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(m)}&config=${encodeURIComponent(oe)}`;const xe=se("Claude Code");u=m;let Q;e[6]===Symbol.for("react.memo_cache_sentinel")?(Q=/'/g,e[6]=Q):Q=e[6],r=xe.replace(Q,"'\\''"),e[0]=l,e[1]=m,e[2]=n,e[3]=c,e[4]=u,e[5]=r}else n=e[2],c=e[3],u=e[4],r=e[5];const g=`claude mcp add "${u}" --config '${r}'`;let f;e[7]!==n?(f=async()=>{await navigator.clipboard.writeText(n),i(!0),Ae.success("Configuration copied to clipboard"),setTimeout(()=>i(!1),2e3)},e[7]=n,e[8]=f):f=e[8];const p=f;let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=async(R,he)=>{await navigator.clipboard.writeText(R),d(he),Ae.success(`${he} command copied`),setTimeout(()=>d(null),2e3)},e[9]=j):j=e[9];const y=j,v=Kt;let b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=b):b=e[10];let C;e[11]!==a?(C=a?t.jsx(De,{size:14}):t.jsx(et,{size:14}),e[11]=a,e[12]=C):C=e[12];let N;e[13]!==p||e[14]!==C?(N=t.jsx(Y,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:p,children:C})}),e[13]=p,e[14]=C,e[15]=N):N=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ee,{children:"Copy configuration"}),e[16]=k):k=e[16];let w;e[17]!==N?(w=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(K,{children:t.jsxs(X,{children:[N,k]})})}),e[17]=N,e[18]=w):w=e[18];let E;e[19]!==n||e[20]!==p?(E=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:p,children:n}),e[19]=n,e[20]=p,e[21]=E):E=e[21];let A;e[22]!==E||e[23]!==w?(A=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[w,E]}),e[22]=E,e[23]=w,e[24]=A):A=e[24];let B;e[25]!==c?(B=()=>v(c),e[25]=c,e[26]=B):B=e[26];let Z,O;e[27]===Symbol.for("react.memo_cache_sentinel")?(Z=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%)"}}),O=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=Z,e[28]=O):(Z=e[27],O=e[28]);let V;e[29]!==B?(V=t.jsx(Y,{asChild:!0,children:t.jsxs(L,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:B,children:[Z,O]})}),e[29]=B,e[30]=V):V=e[30];let h;e[31]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(ee,{children:"Add to Cursor"}),e[31]=h):h=e[31];let _;e[32]!==V?(_=t.jsx(K,{children:t.jsxs(X,{children:[V,h]})}),e[32]=V,e[33]=_):_=e[33];let $;e[34]!==g?($=()=>y(g,"Claude"),e[34]=g,e[35]=$):$=e[35];let z,U;e[36]===Symbol.for("react.memo_cache_sentinel")?(z=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%)"}}),U=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=z,e[37]=U):(z=e[36],U=e[37]);let P;e[38]!==x?(P=x==="Claude"&&t.jsx(De,{size:14,className:"ml-2 text-green-500"}),e[38]=x,e[39]=P):P=e[39];let M;e[40]!==$||e[41]!==P?(M=t.jsx(Y,{asChild:!0,children:t.jsxs(L,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:$,children:[z,U,P]})}),e[40]=$,e[41]=P,e[42]=M):M=e[42];let D;e[43]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(ee,{children:"Add to Claude Code"}),e[43]=D):D=e[43];let q;e[44]!==M?(q=t.jsx(K,{children:t.jsxs(X,{children:[M,D]})}),e[44]=M,e[45]=q):q=e[45];let H;e[46]!==_||e[47]!==q?(H=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[_,q]}),e[46]=_,e[47]=q,e[48]=H):H=e[48];let J;return e[49]!==A||e[50]!==H?(J=t.jsxs("div",{className:"flex flex-col gap-4",children:[b,A,H]}),e[49]=A,e[50]=H,e[51]=J):J=e[51],J}function Kt(o){window.open(o,"_blank")}const Xt=Mt.pick({title:!0,description:!0,status:!0,tool_selection_mode:!0,tool_selection_strategy:!0}).extend({title:S().min(1,"Name is required").max(255)});function Fe(o,e){const s={};for(const l of o.connections)if(l.selected_tools===null){const a=e.get(l.connection_id)??[];a.length>0&&(s[l.connection_id]=a)}else l.selected_tools.length>0&&(s[l.connection_id]=l.selected_tools);return s}function Le(o){const e={};for(const s of o.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 We(o){const e={};for(const s of o.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 Yt(o,e,s,l){const a=new Set([...Object.keys(o),...Object.keys(e),...Object.keys(s)]);return Array.from(a).map(i=>{const x=o[i]??[],d=l.get(i)??[],m=d.length>0&&d.every(n=>x.includes(n));return{connection_id:i,selected_tools:x.length===0||m?null:x,selected_resources:e[i]??null,selected_prompts:s[i]??null}})}function es(o){const e=W.c(27),{open:s,onOpenChange:l,gateway:a}=o,[i,x]=I.useState(!1),d=`${window.location.origin}/mcp/gateway/${a.id}`;let m;e[0]!==d?(m=async()=>{await navigator.clipboard.writeText(d),x(!0),Ae.success("Agent URL copied to clipboard"),setTimeout(()=>x(!1),2e3)},e[0]=d,e[1]=m):m=e[1];const n=m;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Nt,{children:t.jsx(It,{children:"Share Agent"})}),e[2]=c):c=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Agent URL"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Share this URL to connect to the agent"})]}),e[3]=u):u=e[3];let r;e[4]!==d?(r=t.jsx($e,{value:d,readOnly:!0,className:"font-mono text-xs"}),e[4]=d,e[5]=r):r=e[5];let g;e[6]!==i?(g=i?t.jsx(De,{size:16}):t.jsx(et,{size:16}),e[6]=i,e[7]=g):g=e[7];let f;e[8]!==n||e[9]!==g?(f=t.jsx(L,{type:"button",variant:"outline",size:"icon",onClick:n,className:"shrink-0",children:g}),e[8]=n,e[9]=g,e[10]=f):f=e[10];let p;e[11]!==r||e[12]!==f?(p=t.jsxs("div",{className:"flex flex-col gap-3",children:[u,t.jsxs("div",{className:"flex gap-2",children:[r,f]})]}),e[11]=r,e[12]=f,e[13]=p):p=e[13];let j;e[14]!==a.id||e[15]!==a.title?(j=a.title||`agent-${a.id.slice(0,8)}`,e[14]=a.id,e[15]=a.title,e[16]=j):j=e[16];let y;e[17]!==d||e[18]!==j?(y=t.jsx("div",{className:"border-t border-border pt-6",children:t.jsx(Zt,{serverName:j,gatewayUrl:d})}),e[17]=d,e[18]=j,e[19]=y):y=e[19];let v;e[20]!==p||e[21]!==y?(v=t.jsxs(kt,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[c,t.jsxs("div",{className:"flex flex-col gap-6",children:[p,y]})]}),e[20]=p,e[21]=y,e[22]=v):v=e[22];let b;return e[23]!==l||e[24]!==s||e[25]!==v?(b=t.jsx(Tt,{open:s,onOpenChange:l,children:v}),e[23]=l,e[24]=s,e[25]=v,e[26]=b):b=e[26],b}function ts(o){const e=W.c(31),{form:s,icon:l,gatewayId:a}=o,[i,x]=Ct(a);let d;e[0]!==s?(d=s.watch("title")||"Agent",e[0]=s,e[1]=d):d=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(vt,{}),e[2]=m):m=e[2];let n;e[3]!==l||e[4]!==d?(n=t.jsx(Me,{icon:l,name:d,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=l,e[4]=d,e[5]=n):n=e[5];let c;e[6]!==s.control?(c=t.jsx(be,{control:s.control,name:"status",render:is}),e[6]=s.control,e[7]=c):c=e[7];let u;e[8]!==n||e[9]!==c?(u=t.jsxs("div",{className:"flex items-start justify-between",children:[n,c]}),e[8]=n,e[9]=c,e[10]=u):u=e[10];let r;e[11]!==s.control?(r=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(be,{control:s.control,name:"title",render:ns}),t.jsx(be,{control:s.control,name:"description",render:ls})]}),e[11]=s.control,e[12]=r):r=e[12];let g;e[13]!==u||e[14]!==r?(g=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[u,r]}),e[13]=u,e[14]=r,e[15]=g):g=e[15];let f;e[16]!==s.control?(f=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(be,{control:s.control,name:"tool_selection_mode",render:os}),t.jsx(be,{control:s.control,name:"tool_selection_strategy",render:ss})]}),e[16]=s.control,e[17]=f):f=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"System Prompt"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored locally for now"})]}),e[18]=p):p=e[18];let j;e[19]!==x?(j=C=>x(C.target.value),e[19]=x,e[20]=j):j=e[20];let y;e[21]!==i||e[22]!==j?(y=t.jsxs("div",{className:"flex flex-col gap-3 p-5",children:[p,t.jsx(Pt,{value:i,onChange:j,placeholder:"Enter system prompt instructions...",className:"min-h-[240px] resize-none text-sm leading-relaxed"})]}),e[21]=i,e[22]=j,e[23]=y):y=e[23];let v;e[24]!==y||e[25]!==g||e[26]!==f?(v=t.jsxs("div",{className:"flex flex-col",children:[g,f,y]}),e[24]=y,e[25]=g,e[26]=f,e[27]=v):v=e[27];let b;return e[28]!==s||e[29]!==v?(b=t.jsx("div",{className:"flex flex-col h-full overflow-auto",children:t.jsx($t,{...s,children:v})}),e[28]=s,e[29]=v,e[30]=b):b=e[30],b}function ss(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Qe,{className:"mb-0",children:"Agent Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(K,{children:t.jsxs(X,{children:[t.jsx(Y,{asChild:!0,children:t.jsx(L,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Agent strategy help",children:t.jsx(tt,{size:14,className:"text-muted-foreground"})})}),t.jsx(ee,{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(Ze,{value:e.value,onValueChange:e.onChange,children:[t.jsx(_e,{children:t.jsx(Ke,{className:"w-[180px]",children:t.jsx(Xe,{})})}),t.jsxs(Ye,{children:[t.jsx(je,{value:"passthrough",children:"Passthrough"}),t.jsx(je,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(je,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(Se,{})]})}function os(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Qe,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(K,{children:t.jsxs(X,{children:[t.jsx(Y,{asChild:!0,children:t.jsx(L,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(tt,{size:14,className:"text-muted-foreground"})})}),t.jsx(ee,{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(Ze,{value:e.value,onValueChange:e.onChange,children:[t.jsx(_e,{children:t.jsx(Ke,{className:"w-[180px]",children:t.jsx(Xe,{})})}),t.jsxs(Ye,{children:[t.jsx(je,{value:"inclusion",children:"Include Selected"}),t.jsx(je,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(Se,{})]})}function ls(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(_e,{children:t.jsx($e,{...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(Se,{})]})}function ns(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(_e,{children:t.jsx($e,{...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:"Agent Name"})}),t.jsx(Se,{})]})}function is(o){const{field:e}=o;return t.jsxs(ve,{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(_e,{children:t.jsx(bt,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(Se,{})]})}function rs(o){const e=W.c(82),{gateway:s,gatewayId:l,requestedTabId:a}=o,x=rt().location.href,d=at();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/$org/gateways/$gatewayId"},e[0]=m):m=e[0];const n=Be(m),c=yt();let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u={},e[1]=u):u=e[1];const r=qe(u);let g;e[2]!==r?(g=r.map(cs),e[2]=r,e[3]=g):g=e[3];const f=g,{promptsMap:p}=_t(f),{resourcesMap:j}=St(f);let y;if(e[4]!==r){y=new Map;for(const T of r)T.tools&&T.tools.length>0&&y.set(T.id,T.tools.map(as));e[4]=r,e[5]=y}else y=e[5];let v;e[6]!==y||e[7]!==s?(v=()=>Fe(s,y),e[6]=y,e[7]=s,e[8]=v):v=e[8];const[b,C]=I.useState(v);let N;e[9]!==s?(N=()=>Le(s),e[9]=s,e[10]=N):N=e[10];const[k,w]=I.useState(N);let E;e[11]!==s?(E=()=>We(s),e[11]=s,e[12]=E):E=e[12];const[A,B]=I.useState(E),[Z,O]=I.useState(!1),[V,h]=I.useState(!1);let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_=T=>{C(T),O(!0)},e[13]=_):_=e[13];const $=_;let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=T=>{w(T),O(!0)},e[14]=z):z=e[14];const U=z;let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=T=>{B(T),O(!0)},e[15]=P):P=e[15];const M=P;let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=ct(Xt),e[16]=D):D=e[16];const q=s.tool_selection_mode??"inclusion",H=s.tool_selection_strategy??"passthrough";let J;e[17]!==s.description||e[18]!==s.status||e[19]!==s.title||e[20]!==q||e[21]!==H?(J={resolver:D,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:q,tool_selection_strategy:H}},e[17]=s.description,e[18]=s.status,e[19]=s.title,e[20]=q,e[21]=H,e[22]=J):J=e[22];const R=dt(J),se=R.formState.isDirty||Z;let oe;e[23]!==c.update||e[24]!==y||e[25]!==R||e[26]!==l||e[27]!==A||e[28]!==k||e[29]!==b?(oe=async()=>{const T=R.getValues(),Re=Yt(b,k,A,y);await c.update.mutateAsync({id:l,data:{title:T.title,description:T.description,status:T.status,tool_selection_mode:T.tool_selection_mode,tool_selection_strategy:T.tool_selection_strategy,connections:Re}}),R.reset(T),O(!1)},e[23]=c.update,e[24]=y,e[25]=R,e[26]=l,e[27]=A,e[28]=k,e[29]=b,e[30]=oe):oe=e[30];const xe=oe;let Q;e[31]!==y||e[32]!==R||e[33]!==s?(Q=()=>{R.reset({title:s.title,description:s.description,status:s.status,tool_selection_mode:s.tool_selection_mode??"inclusion",tool_selection_strategy:s.tool_selection_strategy??"passthrough"}),C(Fe(s,y)),w(Le(s)),B(We(s)),O(!1)},e[31]=y,e[32]=R,e[33]=s,e[34]=Q):Q=e[34];const pe=Q;let Ce;e[35]===Symbol.for("react.memo_cache_sentinel")?(Ce=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[35]=Ce):Ce=e[35];const Ge=Ce,G=Ge.some(T=>T.id===a)?a:"settings";let we;e[36]!==n?(we=T=>{n({search:Re=>({...Re,tab:T}),replace:!0})},e[36]=n,e[37]=we):we=e[37];const ze=we,ge=c.update.isPending;let le;e[38]!==d.history?(le=()=>d.history.back(),e[38]=d.history,e[39]=le):le=e[39];let ne;e[40]!==G||e[41]!==ze?(ne=t.jsx(At,{children:t.jsx(zt,{tabs:Ge,activeTab:G,onTabChange:ze})}),e[40]=G,e[41]=ze,e[42]=ne):ne=e[42];let ie;e[43]!==pe||e[44]!==xe||e[45]!==se||e[46]!==ge?(ie=se&&t.jsxs(t.Fragment,{children:[t.jsx(K,{children:t.jsxs(X,{delayDuration:0,children:[t.jsx(Y,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(L,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ge,onClick:pe,"aria-label":"Cancel",children:t.jsx(Rt,{size:14})})})}),t.jsx(ee,{side:"bottom",children:"Cancel"})]})}),t.jsx(K,{children:t.jsxs(X,{delayDuration:0,children:[t.jsx(Y,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(L,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ge,onClick:xe,"aria-label":"Save",children:ge?t.jsx(Ee,{size:14,className:"animate-spin"}):t.jsx(st,{size:14})})})}),t.jsx(ee,{side:"bottom",children:"Save"})]})})]}),e[43]=pe,e[44]=xe,e[45]=se,e[46]=ge,e[47]=ie):ie=e[47];let Ne;e[48]===Symbol.for("react.memo_cache_sentinel")?(Ne=()=>h(!0),e[48]=Ne):Ne=e[48];let Ie;e[49]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx(K,{children:t.jsxs(X,{delayDuration:0,children:[t.jsx(Y,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(L,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ne,"aria-label":"Share",children:t.jsx(ot,{size:14})})})}),t.jsx(ee,{side:"bottom",children:"Share"})]})}),e[49]=Ie):Ie=e[49];const Pe=s.icon??"cpu_chip";let re;e[50]!==s.title||e[51]!==Pe||e[52]!==x?(re=t.jsx(pt,{title:s.title,url:x,icon:Pe}),e[50]=s.title,e[51]=Pe,e[52]=x,e[53]=re):re=e[53];let ae;e[54]!==ie||e[55]!==re?(ae=t.jsxs(Dt,{children:[ie,Ie,re]}),e[54]=ie,e[55]=re,e[56]=ae):ae=e[56];let ke;e[57]===Symbol.for("react.memo_cache_sentinel")?(ke=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Ee,{size:32,className:"animate-spin text-muted-foreground"})}),e[57]=ke):ke=e[57];let ce;e[58]!==G||e[59]!==p||e[60]!==j||e[61]!==R||e[62]!==s.icon||e[63]!==l||e[64]!==A||e[65]!==k||e[66]!==b?(ce=G==="settings"?t.jsx(ts,{form:R,icon:s.icon,gatewayId:l}):G==="tools"?t.jsx(gt,{toolSet:b,onToolSetChange:$}):G==="resources"?t.jsx(Ht,{resourceSet:k,onResourceSetChange:U,connectionResources:j}):G==="prompts"?t.jsx(Lt,{promptSet:A,onPromptSetChange:M,connectionPrompts:p}):null,e[58]=G,e[59]=p,e[60]=j,e[61]=R,e[62]=s.icon,e[63]=l,e[64]=A,e[65]=k,e[66]=b,e[67]=ce):ce=e[67];let de;e[68]!==ce?(de=t.jsx(I.Suspense,{fallback:ke,children:ce}),e[68]=ce,e[69]=de):de=e[69];let me;e[70]!==G||e[71]!==de?(me=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:t.jsx("div",{className:"h-full overflow-auto",children:t.jsx(He,{children:de},G)})})}),e[70]=G,e[71]=de,e[72]=me):me=e[72];let ue;e[73]!==s||e[74]!==V?(ue=t.jsx(es,{open:V,onOpenChange:h,gateway:s}),e[73]=s,e[74]=V,e[75]=ue):ue=e[75];let Te;return e[76]!==le||e[77]!==ne||e[78]!==ae||e[79]!==me||e[80]!==ue?(Te=t.jsxs(Et,{onBack:le,children:[ne,ae,me,ue]}),e[76]=le,e[77]=ne,e[78]=ae,e[79]=me,e[80]=ue,e[81]=Te):Te=e[81],Te}function as(o){return o.name}function cs(o){return o.id}function ds(){const o=W.c(10);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},o[0]=e):e=o[0];const s=Be(e);let l;o[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/gateways/$gatewayId"},o[1]=l):l=o[1];const{gatewayId:a,org:i}=nt(l);let x;o[2]===Symbol.for("react.memo_cache_sentinel")?(x={from:"/shell/$org/gateways/$gatewayId"},o[2]=x):x=o[2];const m=it(x).tab||"settings",n=jt(a);if(!n){let u;return o[3]!==s||o[4]!==i?(u=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(mt,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(L,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:i}}),children:"Back to agents"})})}),o[3]=s,o[4]=i,o[5]=u):u=o[5],u}let c;return o[6]!==n||o[7]!==a||o[8]!==m?(c=t.jsx(rs,{gateway:n,gatewayId:a,requestedTabId:m}),o[6]=n,o[7]=a,o[8]=m,o[9]=c):c=o[9],c}function ms(){const o=W.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(He,{children:t.jsx(I.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ee,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ds,{})})}),o[0]=e):e=o[0],e}function Ws(){const o=W.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ms,{}),o[0]=e):e=o[0],e}export{Ws as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as v,ai as K,c as w,j as n,aO as E}from"./index-CIDbVI0o.js";import{i as Y}from"./project-context-provider-rr2ZgefD.js";import{u as ee,i as Z}from"./use-gateway-QZNjV_Br.js";import{I as Q,i as te}from"./use-connection-DFkAC4Is.js";import{b as se,a as le,c as ae,S as re}from"./select-8RE8G2EV.js";import{c as I,B as ne,I as oe}from"./input-BYLamBFT.js";import{u as ie}from"./use-mobile-DKb1FXwT.js";const ce=({size:l=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.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.8Z"}));ce.displayName="Stop";function J({prop:l,defaultProp:e,onChange:t=()=>{}}){const[s,a]=de({defaultProp:e,onChange:t}),r=l!==void 0,o=r?l:s,i=K(t),c=v.useCallback(d=>{if(r){const f=typeof d=="function"?d(l):d;f!==l&&i(f)}else a(d)},[r,l,a,i]);return[o,c]}function de({defaultProp:l,onChange:e}){const t=v.useState(l),[s]=t,a=v.useRef(s),r=K(e);return v.useEffect(()=>{a.current!==s&&(r(s),a.current=s)},[s,a,r]),t}function fe(l){const e=w.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(E.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=s):s=e[3],s}function ue(l){const e=w.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(E.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function me(l){const e=w.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(E.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function pe(l){const e=w.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=I("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r=n.jsx(E.Overlay,{"data-slot":"drawer-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=r):r=e[7],r}function xe(l){const e=w.c(12);let t,s,a;e[0]!==l?({className:s,children:t,...a}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(pe,{}),e[4]=r):r=e[4];let o;e[5]!==s?(o=I("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",s),e[5]=s,e[6]=o):o=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=i):i=e[7];let c;return e[8]!==t||e[9]!==a||e[10]!==o?(c=n.jsxs(me,{"data-slot":"drawer-portal",children:[r,n.jsxs(E.Content,{"data-slot":"drawer-content",className:o,...a,children:[i,t]})]}),e[8]=t,e[9]=a,e[10]=o,e[11]=c):c=e[11],c}function he(l){const e=w.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=I("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r=n.jsx("div",{"data-slot":"drawer-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=r):r=e[7],r}function we(l){const e=w.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=I("text-foreground font-semibold",t),e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r=n.jsx(E.Title,{"data-slot":"drawer-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=r):r=e[7],r}const X=v.createContext({isMobile:!1,setValue:()=>{}}),q=()=>v.useContext(X),ge=l=>{const e=w.c(37);let t,s,a,r,o,i,c,d;e[0]!==l?({children:t,defaultOpen:s,open:i,onOpenChange:r,defaultValue:a,value:d,onValueChange:o,...c}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=r,e[5]=o,e[6]=i,e[7]=c,e[8]=d):(t=e[1],s=e[2],a=e[3],r=e[4],o=e[5],i=e[6],c=e[7],d=e[8]);const p=ie(),f=s??!1;let m;e[9]!==r||e[10]!==i||e[11]!==f?(m={prop:i,defaultProp:f,onChange:r},e[9]=r,e[10]=i,e[11]=f,e[12]=m):m=e[12];const[x,h]=J(m);let C;e[13]!==a||e[14]!==o||e[15]!==d?(C={prop:d,defaultProp:a,onChange:o},e[13]=a,e[14]=o,e[15]=d,e[16]=C):C=e[16];const[S,k]=J(C);let $;e[17]!==k?($=M=>{M&&k(M)},e[17]=k,e[18]=$):$=e[18];const y=$;let b;e[19]!==p||e[20]!==y?(b={isMobile:p,setValue:y},e[19]=p,e[20]=y,e[21]=b):b=e[21];let j;e[22]!==t||e[23]!==x||e[24]!==c||e[25]!==h?(j=n.jsx(fe,{open:x,onOpenChange:h,...c,children:t}),e[22]=t,e[23]=x,e[24]=c,e[25]=h,e[26]=j):j=e[26];let g;e[27]!==x||e[28]!==c||e[29]!==h||e[30]!==y||e[31]!==j||e[32]!==S?(g=n.jsx(re,{open:x,onOpenChange:h,value:S,onValueChange:y,...c,children:j}),e[27]=x,e[28]=c,e[29]=h,e[30]=y,e[31]=j,e[32]=S,e[33]=g):g=e[33];let N;return e[34]!==b||e[35]!==g?(N=n.jsx(X.Provider,{value:b,children:g}),e[34]=b,e[35]=g,e[36]=N):N=e[36],N},ve=l=>{const{children:e,title:t,headerActions:s,...a}=l,{isMobile:r}=q(),{className:o,...i}=a;return r?n.jsxs(xe,{...i,children:[n.jsxs(he,{className:I(s?"flex flex-row items-center justify-between":"hidden"),children:[n.jsx(we,{children:t}),s]}),n.jsx("div",{className:I("flex flex-col gap-2 p-2 py-4",o),children:e})]}):n.jsx(ae,{...a,children:e})},be=l=>{const e=w.c(7);let t,s;e[0]!==l?({children:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);const{isMobile:a}=q();let r;return e[3]!==t||e[4]!==a||e[5]!==s?(r=a?n.jsx(ue,{asChild:!0,children:n.jsx(ne,{variant:"outline",...s,children:t})}):n.jsx(le,{...s,children:t}),e[3]=t,e[4]=a,e[5]=s,e[6]=r):r=e[6],r},je=l=>{const e=w.c(7);let t,s;e[0]!==l?({children:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);const{isMobile:a}=q();let r;return e[3]!==t||e[4]!==a||e[5]!==s?(r=a?n.jsx("span",{...s,children:t}):n.jsx(se,{...s,children:t}),e[3]=t,e[4]=a,e[5]=s,e[6]=r):r=e[6],r};function ye(){const l=w.c(4),e=ee();let t;l[0]!==e?(t=e??[],l[0]=e,l[1]=t):t=l[1];let s;return l[2]!==t?(s=t.map(Ce),l[2]=t,l[3]=s):s=l[3],s}function Ce(l){return{id:l.id,title:l.title,description:l.description??null,icon:l.icon??null,fallbackIcon:n.jsx(Z,{})}}function Ne(l){const e=w.c(24),{gateway:t,isSelected:s}=l,a=s&&"bg-accent";let r;e[0]!==a?(r=I("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-lg",a),e[0]=a,e[1]=r):r=e[1];let o;e[2]!==t.fallbackIcon?(o=t.fallbackIcon??n.jsx(Z,{}),e[2]=t.fallbackIcon,e[3]=o):o=e[3];let i;e[4]!==t.icon||e[5]!==t.title||e[6]!==o?(i=n.jsx(Q,{icon:t.icon,name:t.title,size:"sm",fallbackIcon:o,className:"size-10"}),e[4]=t.icon,e[5]=t.title,e[6]=o,e[7]=i):i=e[7];let c;e[8]!==t.title?(c=n.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[8]=t.title,e[9]=c):c=e[9];let d;e[10]!==s?(d=s&&n.jsx(Y,{size:16,className:"text-foreground shrink-0"}),e[10]=s,e[11]=d):d=e[11];let p;e[12]!==c||e[13]!==d?(p=n.jsxs("div",{className:"flex items-center justify-between",children:[c,d]}),e[12]=c,e[13]=d,e[14]=p):p=e[14];let f;e[15]!==t.description?(f=t.description&&n.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:t.description}),e[15]=t.description,e[16]=f):f=e[16];let m;e[17]!==p||e[18]!==f?(m=n.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[p,f]}),e[17]=p,e[18]=f,e[19]=m):m=e[19];let x;return e[20]!==r||e[21]!==i||e[22]!==m?(x=n.jsxs("div",{className:r,children:[i,m]}),e[20]=r,e[21]=i,e[22]=m,e[23]=x):x=e[23],x}function Se(l){const e=w.c(12),{gateway:t}=l;if(!t){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("span",{className:"text-sm text-muted-foreground",children:"Select agent"}),e[0]=i):i=e[0],i}let s;e[1]!==t.fallbackIcon?(s=t.fallbackIcon??n.jsx(Z,{}),e[1]=t.fallbackIcon,e[2]=s):s=e[2];let a;e[3]!==t.icon||e[4]!==t.title||e[5]!==s?(a=n.jsx(Q,{icon:t.icon,name:t.title,size:"xs",fallbackIcon:s,className:"w-5! h-5! min-w-5! shrink-0 rounded-sm"}),e[3]=t.icon,e[4]=t.title,e[5]=s,e[6]=a):a=e[6];let r;e[7]!==t.title?(r=n.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:t.title}),e[7]=t.title,e[8]=r):r=e[8];let o;return e[9]!==a||e[10]!==r?(o=n.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-w-full",children:[a,r]}),e[9]=a,e[10]=r,e[11]=o):o=e[11],o}function ze(l){const e=w.c(47),{selectedGatewayId:t,onGatewayChange:s,variant:a,className:r,placeholder:o}=l,i=a===void 0?"bordered":a,c=o===void 0?"Select Agent":o,[d,p]=v.useState(!1),[f,m]=v.useState(""),x=v.useRef(null),h=ye();let C,S;e[0]!==d?(C=()=>{d&&setTimeout(()=>{x.current?.focus()},0)},S=[d],e[0]=d,e[1]=C,e[2]=S):(C=e[1],S=e[2]),v.useEffect(C,S);let k;if(e[3]!==h||e[4]!==t){let u;e[6]!==t?(u=H=>H.id===t,e[6]=t,e[7]=u):u=e[7],k=h.find(u),e[3]=h,e[4]=t,e[5]=k}else k=e[5];const $=k;let y;e:{if(!f.trim()){y=h;break e}let u;if(e[8]!==h||e[9]!==f){const H=f.toLowerCase();u=h.filter(F=>F.title.toLowerCase().includes(H)||F.description?.toLowerCase().includes(H)),e[8]=h,e[9]=f,e[10]=u}else u=e[10];y=u}const b=y;let j;e[11]!==s?(j=u=>{s(u),m(""),p(!1)},e[11]=s,e[12]=j):j=e[12];const g=j;let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=u=>{p(u),u||m("")},e[13]=N):N=e[13];const M=N,U=t||"",W=i==="borderless"&&"border-0 md:border-none";let R;e[14]!==r||e[15]!==W?(R=I("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",W,r),e[14]=r,e[15]=W,e[16]=R):R=e[16];let D;e[17]!==$?(D=n.jsx(Se,{gateway:$}),e[17]=$,e[18]=D):D=e[18];let G;e[19]!==c||e[20]!==D?(G=n.jsx(je,{placeholder:c,className:"min-w-0 max-w-full",children:D}),e[19]=c,e[20]=D,e[21]=G):G=e[21];let _;e[22]!==R||e[23]!==G?(_=n.jsx(be,{size:"sm",className:R,children:G}),e[22]=R,e[23]=G,e[24]=_):_=e[24];let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(te,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[25]=L):L=e[25];let B;e[26]===Symbol.for("react.memo_cache_sentinel")?(B=u=>m(u.target.value),e[26]=B):B=e[26];let z;e[27]!==f?(z=n.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:n.jsxs("div",{className:"relative",children:[L,n.jsx(oe,{ref:x,type:"text",placeholder:"Search for an agent...",value:f,onChange:B,className:"pl-9 h-9 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none"})]})}),e[27]=f,e[28]=z):z=e[28];let O;e[29]!==b||e[30]!==g||e[31]!==t?(O=b.length>0?b.map(u=>n.jsx("div",{onClick:()=>g(u.id),className:"outline-none",children:n.jsx(Ne,{gateway:u,isSelected:u.id===t})},u.id)):n.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No agents found"}),e[29]=b,e[30]=g,e[31]=t,e[32]=O):O=e[32];let P;e[33]!==O?(P=n.jsx("div",{className:"overflow-y-auto p-2 flex flex-col gap-1",children:O}),e[33]=O,e[34]=P):P=e[34];let T;e[35]!==z||e[36]!==P?(T=n.jsxs("div",{className:"flex flex-col max-h-[300px]",children:[z,P]}),e[35]=z,e[36]=P,e[37]=T):T=e[37];let V;e[38]!==c||e[39]!==T?(V=n.jsx(ve,{title:c,className:"w-full md:w-[400px] p-0",side:"bottom",children:T}),e[38]=c,e[39]=T,e[40]=V):V=e[40];let A;return e[41]!==g||e[42]!==d||e[43]!==_||e[44]!==V||e[45]!==U?(A=n.jsxs(ge,{open:d,onOpenChange:M,value:U,onValueChange:g,children:[_,V]}),e[41]=g,e[42]=d,e[43]=_,e[44]=V,e[45]=U,e[46]=A):A=e[46],A}export{ue as D,ze as G,je as R,xe as a,he as b,we as c,fe as d,ye as e,be as f,ve as g,ge as h,ce as i,J as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as te,j as t,r as se,h as ne,t as re}from"./index-CIDbVI0o.js";import{C as ie}from"./collection-header-f1ffdO7f.js";import{C as ae}from"./collection-page-WZgTp5Lv.js";import{C as le}from"./collection-search-3XPe6V_T.js";import{C as ce}from"./collection-table-wrapper-B34CJdmN.js";import{C as de}from"./connection-card-AILFqLN1.js";import{u as me,E as q,I as ue}from"./use-connection-DFkAC4Is.js";import{E as ge}from"./error-boundary-DFjr3eHD.js";import{a as pe,u as he,i as j}from"./use-gateway-QZNjV_Br.js";import{u as fe,s as Q}from"./use-list-state-oVkbwyL1.js";import{u as xe}from"./project-context-provider-rr2ZgefD.js";import{c as je,b as ye,d as we,A as Ce,e as Ne,g as De,a as Se,f as ve}from"./alert-dialog-BHM4cw4Q.js";import{B as oe}from"./badge-BoEIasGQ.js";import{B as J}from"./input-BYLamBFT.js";import{b as U,D as X,a as Y,c as G}from"./dropdown-menu-CxU4B3XS.js";import{i as Z}from"./DotsVertical-CH2fNSbY.js";import{i as be}from"./Loading01-B8IKnW3x.js";import{s as ee}from"./Trash01-D0jDlYQJ.js";import"./collection-display-button-KvR7sWeM.js";import"./Grid01-Soc1w0HN.js";import"./view-mode-toggle-C8FGoH5Z.js";import"./card-TBEiO_pf.js";import"./use-mobile-DKb1FXwT.js";import"./ChevronRight-Fe_n2oGa.js";function ke(e,n){switch(n.type){case"delete":return{mode:"deleting",gateway:n.gateway};case"close":return{mode:"idle"}}}function _e(){const e=te.c(68),{org:n}=xe(),r=ne();let y;e[0]!==n.slug?(y={namespace:n.slug,resource:"gateways"},e[0]=n.slug,e[1]=y):y=e[1];const s=fe(y),i=pe(),x=he(s);let w;e[2]===Symbol.for("react.memo_cache_sentinel")?(w={},e[2]=w):w=e[2];const R=me(w);let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={mode:"idle"},e[3]=C):C=e[3];const[a,N]=se.useReducer(ke,C);let D;e[4]!==i.create||e[5]!==R.length||e[6]!==r||e[7]!==n.slug?(D=async()=>{if(R.length===0){re.error("Create at least one Connection first");return}const o=await i.create.mutateAsync({title:"New Agent",description:"Agents 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:n.slug,gatewayId:o.id}})},e[4]=i.create,e[5]=R.length,e[6]=r,e[7]=n.slug,e[8]=D):D=e[8];const T=D;let S;e[9]!==i.delete||e[10]!==a.gateway||e[11]!==a.mode?(S=async()=>{if(a.mode!=="deleting")return;const o=a.gateway.id;N({type:"close"});try{await i.delete.mutateAsync(o)}catch{}},e[9]=i.delete,e[10]=a.gateway,e[11]=a.mode,e[12]=S):S=e[12];const O=S;let v,b,k,_,I,A;e[13]===Symbol.for("react.memo_cache_sentinel")?(b={id:"icon",header:"",render:Ge,cellClassName:"w-16 shrink-0",wrap:!0},k={id:"title",header:"Name",render:Be,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},_={id:"description",header:"Description",render:Ke,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},I={id:"mode",header:"Mode",accessor:Ee,cellClassName:"w-[100px]"},A={id:"connections",header:"Connections",render:Pe,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]=I,e[18]=A):(v=e[13],b=e[14],k=e[15],_=e[16],I=e[17],A=e[18]);let $;e[19]!==r||e[20]!==n.slug?($=[b,k,_,I,A,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:Me,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:$e,children:[t.jsxs(G,{onClick:l=>{l.stopPropagation(),r({to:"/$org/gateways/$gatewayId",params:{org:n.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(G,{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]=n.slug,e[21]=$):$=e[21];const V=$,H=i.create.isPending?"Creating...":"Create Agent";let M;e[22]!==i.create.isPending||e[23]!==T||e[24]!==H?(M=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]=M):M=e[25];const L=M,F=a.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 P;e[27]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(je,{children:"Delete Agent?"}),e[27]=P):P=e[27];const W=a.mode==="deleting"&&a.gateway.title;let c;e[28]!==W?(c=t.jsxs(ye,{children:[P,t.jsxs(we,{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 K;e[39]===Symbol.for("react.memo_cache_sentinel")?(K=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[39]=K):K=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:"Agents",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:K,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 an agent...",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]!==n.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(j,{size:36,className:"text-muted-foreground"}),title:s.search?"No agents found":"No agents yet",description:s.search?`No agents match "${s.search}"`:"Create an agent to aggregate tools from multiple 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(j,{}),onClick:()=>r({to:"/$org/gateways/$gatewayId",params:{org:n.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:Ae,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Ie,children:[t.jsxs(G,{onClick:l=>{l.stopPropagation(),r({to:"/$org/gateways/$gatewayId",params:{org:n.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(G,{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:n.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(q,{image:t.jsx(j,{size:36,className:"text-muted-foreground"}),title:"No agents found",description:`No agents match "${s.search}"`}):t.jsx(q,{image:t.jsx(j,{size:36,className:"text-muted-foreground"}),title:"No agents yet",description:"Create an agent to aggregate tools from multiple 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]=n.slug,e[62]=f):f=e[62];let B;return e[63]!==u||e[64]!==g||e[65]!==h||e[66]!==f?(B=t.jsxs(ae,{children:[u,g,h,f]}),e[63]=u,e[64]=g,e[65]=h,e[66]=f,e[67]=B):B=e[67],B}function Ie(e){return e.stopPropagation()}function Ae(e){return e.stopPropagation()}function $e(e){return e.stopPropagation()}function Me(e){return e.stopPropagation()}function ze(e){return t.jsx(oe,{variant:e.status==="active"?"default":"outline",children:e.status})}function Pe(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 Ke(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Be(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Ge(e){return t.jsx(ue,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(j,{size:16})})}function ct(){const e=te.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ge,{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]=n):n=e[0],n}export{ct as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,j as i,a as w,r as C,h as E}from"./index-Tg8Sdg8t.js";import{C as _}from"./card-CSWNwOPv.js";import{c as v,I as $,B as k}from"./input-DZxsngZP.js";import{A}from"./avatar-D8KYLrun.js";import{i as O}from"./AlertCircle-DiqlNboz.js";import{s as L}from"./Plus-SMn8MQ-H.js";import{C as D}from"./create-organization-dialog-CahJq4TL.js";import"./alert-dialog-BOjS3GrS.js";import"./form-CTm5F5lc.js";import"./spinner-BlgPNYJ_.js";function F(t){const e=u.c(10),{children:n,className:l,onNavigate:s,showHoverRing:r}=t,x=r===void 0?!1:r;let o;e[0]!==s?(o=p=>{s&&s(p)},e[0]=s,e[1]=o):o=e[1];const m=o,d=s&&"cursor-pointer",c=x&&"hover:ring-2 hover:ring-primary";let a;e[2]!==l||e[3]!==d||e[4]!==c?(a=v("group transition-all flex flex-col gap-0",d,c,l),e[2]=l,e[3]=d,e[4]=c,e[5]=a):a=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==a?(g=i.jsx(_,{className:a,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=a,e[9]=g):g=e[9],g}function H(t){const e=u.c(7),{url:n,fallback:l,shape:s,size:r,objectFit:x,className:o}=t,m=s===void 0?"square":s,d=r===void 0?"lg":r,c=x===void 0?"contain":x;let a;return e[0]!==o||e[1]!==l||e[2]!==c||e[3]!==m||e[4]!==d||e[5]!==n?(a=i.jsx(A,{url:n,fallback:l,shape:m,size:d,objectFit:c,className:o}),e[0]=o,e[1]=l,e[2]=c,e[3]=m,e[4]=d,e[5]=n,e[6]=a):a=e[6],a}function R(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function B(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("font-medium truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("p",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function G(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("h3",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex flex-col gap-[2px]",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function I(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex justify-between items-start",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function M(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function Q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function T(){const t=u.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex justify-between items-start",children:i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,i.jsxs("div",{className:"flex flex-col gap-[2px]",children:[i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),i.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsxs(_,{className:"group transition-colors flex flex-col",children:[n,i.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const b=Object.assign(F,{Avatar:H,AvatarSection:I,Header:R,Title:B,Subtitle:G,Content:q,Footer:M,Badge:Q,Skeleton:T}),P={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},V={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},X={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},J={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},K={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},U={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function z(t){const e=u.c(13),{children:n,columns:l,gap:s,className:r}=t;let x;e[0]!==l?(x=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=x):x=e[1];const o=x,d=P[s===void 0?4:s],c=o.sm&&V[o.sm],a=o.md&&X[o.md],g=o.lg&&J[o.lg],p=o.xl&&K[o.xl],j=o["2xl"]&&U[o["2xl"]];let h;e[2]!==r||e[3]!==d||e[4]!==c||e[5]!==a||e[6]!==g||e[7]!==p||e[8]!==j?(h=v("w-full grid",d,c,a,g,p,j,r),e[2]=r,e[3]=d,e[4]=c,e[5]=a,e[6]=g,e[7]=p,e[8]=j,e[9]=h):h=e[9];const N=h;let f;return e[10]!==n||e[11]!==N?(f=i.jsx("div",{className:N,children:n}),e[10]=n,e[11]=N,e[12]=f):f=e[12],f}function W(t){const e=u.c(9),{count:n,columns:l,gap:s,className:r}=t,x=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,d=s===void 0?4:s;let c;e[2]!==x?(c=Array.from({length:x}).map(Y),e[2]=x,e[3]=c):c=e[3];let a;return e[4]!==r||e[5]!==m||e[6]!==d||e[7]!==c?(a=i.jsx(z,{columns:m,gap:d,className:r,children:c}),e[4]=r,e[5]=m,e[6]=d,e[7]=c,e[8]=a):a=e[8],a}function Y(t,e){return i.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),i.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const S=Object.assign(z,{Skeleton:W});function Z(t){const e=u.c(14),{query:n}=t,{data:l}=w.useListOrganizations(),s=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const c=n.toLowerCase();return l.filter(a=>a.name.toLowerCase().includes(c)||a.slug.toLowerCase().includes(c))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const x=r;if(!l||l.length===0){let c;return e[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=c):c=e[3],c}if(x.length===0){let c;return e[4]!==n?(c=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=c):c=e[5],c}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==x||e[8]!==s){let c;e[10]!==s?(c=a=>i.jsxs(b,{onNavigate:()=>s({to:"/$org",params:{org:a.slug}}),children:[i.jsxs(b.Header,{children:[i.jsx(b.AvatarSection,{children:i.jsx(b.Avatar,{url:a.logo||"",fallback:a.name,size:"lg",objectFit:"contain"})}),i.jsxs(b.Content,{children:[i.jsxs(b.Subtitle,{children:["@",a.slug]}),i.jsx(b.Title,{children:a.name})]})]}),i.jsx(b.Footer,{children:i.jsxs("div",{className:"text-xs text-muted-foreground",children:["Created:"," ",new Date(a.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},a.id),e[10]=s,e[11]=c):c=e[11],m=x.map(c),e[7]=x,e[8]=s,e[9]=m}else m=e[9];let d;return e[12]!==m?(d=i.jsx(S,{columns:o,children:m}),e[12]=m,e[13]=d):d=e[13],d}function ee(t){const e=u.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(O,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let s;return e[1]!==n.message?(s=i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:[l,i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=s):s=e[2],s}function te(){const t=u.c(20),{error:e,isPending:n}=w.useListOrganizations(),[l,s]=C.useState(""),[r,x]=C.useState(!1),o=C.useDeferredValue(l);if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx("div",{className:"flex items-center justify-between mb-8",children:i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"})}),t[0]=f):f=t[0];let y;return t[1]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[f,i.jsx("div",{className:"@container",children:i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})]}),t[1]=y):y=t[1],y}if(e){let f;return t[2]!==e?(f=i.jsx(ee,{error:e}),t[2]=e,t[3]=f):f=t[3],f}let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"}),t[4]=m):m=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=f=>s(f.target.value),t[5]=d):d=t[5];let c;t[6]!==l?(c=i.jsx($,{className:"max-w-xs",placeholder:"Search",value:l,onChange:d}),t[6]=l,t[7]=c):c=t[7];let a;t[8]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsxs(k,{variant:"default",onClick:()=>x(!0),children:[i.jsx(L,{size:16}),i.jsx("span",{children:"New organization"})]}),t[8]=a):a=t[8];let g;t[9]!==c?(g=i.jsxs("div",{className:"flex items-center justify-between mb-8",children:[m,i.jsxs("div",{className:"flex items-center gap-2",children:[c,a]})]}),t[9]=c,t[10]=g):g=t[10];let p;t[11]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[11]=p):p=t[11];let j;t[12]!==o?(j=i.jsx("div",{className:"@container",children:i.jsx(C.Suspense,{fallback:p,children:i.jsx(Z,{query:o})})}),t[12]=o,t[13]=j):j=t[13];let h;t[14]!==r?(h=i.jsx(D,{open:r,onOpenChange:x}),t[14]=r,t[15]=h):h=t[15];let N;return t[16]!==g||t[17]!==j||t[18]!==h?(N=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[g,j,h]}),t[16]=g,t[17]=j,t[18]=h,t[19]=N):N=t[19],N}function xe(){const t=u.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"min-h-full",children:i.jsx(te,{})}),t[0]=e):e=t[0],e}export{xe as default};
|
|
1
|
+
import{c as u,j as i,a as w,r as C,h as E}from"./index-CIDbVI0o.js";import{C as _}from"./card-TBEiO_pf.js";import{c as v,I as $,B as k}from"./input-BYLamBFT.js";import{A}from"./avatar-CBETgvTo.js";import{i as O}from"./AlertCircle-laxSE0PX.js";import{s as L}from"./Plus-3Cnjm1UT.js";import{C as D}from"./create-organization-dialog-6aGfA3nN.js";import"./alert-dialog-BHM4cw4Q.js";import"./form-BAnmUhVa.js";import"./spinner-CeWqo2ib.js";function F(t){const e=u.c(10),{children:n,className:l,onNavigate:s,showHoverRing:r}=t,x=r===void 0?!1:r;let o;e[0]!==s?(o=p=>{s&&s(p)},e[0]=s,e[1]=o):o=e[1];const m=o,d=s&&"cursor-pointer",c=x&&"hover:ring-2 hover:ring-primary";let a;e[2]!==l||e[3]!==d||e[4]!==c?(a=v("group transition-all flex flex-col gap-0",d,c,l),e[2]=l,e[3]=d,e[4]=c,e[5]=a):a=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==a?(g=i.jsx(_,{className:a,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=a,e[9]=g):g=e[9],g}function H(t){const e=u.c(7),{url:n,fallback:l,shape:s,size:r,objectFit:x,className:o}=t,m=s===void 0?"square":s,d=r===void 0?"lg":r,c=x===void 0?"contain":x;let a;return e[0]!==o||e[1]!==l||e[2]!==c||e[3]!==m||e[4]!==d||e[5]!==n?(a=i.jsx(A,{url:n,fallback:l,shape:m,size:d,objectFit:c,className:o}),e[0]=o,e[1]=l,e[2]=c,e[3]=m,e[4]=d,e[5]=n,e[6]=a):a=e[6],a}function R(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function B(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("font-medium truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("p",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function G(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("h3",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex flex-col gap-[2px]",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function I(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex justify-between items-start",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function M(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function Q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function T(){const t=u.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex justify-between items-start",children:i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,i.jsxs("div",{className:"flex flex-col gap-[2px]",children:[i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),i.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsxs(_,{className:"group transition-colors flex flex-col",children:[n,i.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const b=Object.assign(F,{Avatar:H,AvatarSection:I,Header:R,Title:B,Subtitle:G,Content:q,Footer:M,Badge:Q,Skeleton:T}),P={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},V={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},X={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},J={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},K={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},U={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function z(t){const e=u.c(13),{children:n,columns:l,gap:s,className:r}=t;let x;e[0]!==l?(x=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=x):x=e[1];const o=x,d=P[s===void 0?4:s],c=o.sm&&V[o.sm],a=o.md&&X[o.md],g=o.lg&&J[o.lg],p=o.xl&&K[o.xl],j=o["2xl"]&&U[o["2xl"]];let h;e[2]!==r||e[3]!==d||e[4]!==c||e[5]!==a||e[6]!==g||e[7]!==p||e[8]!==j?(h=v("w-full grid",d,c,a,g,p,j,r),e[2]=r,e[3]=d,e[4]=c,e[5]=a,e[6]=g,e[7]=p,e[8]=j,e[9]=h):h=e[9];const N=h;let f;return e[10]!==n||e[11]!==N?(f=i.jsx("div",{className:N,children:n}),e[10]=n,e[11]=N,e[12]=f):f=e[12],f}function W(t){const e=u.c(9),{count:n,columns:l,gap:s,className:r}=t,x=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,d=s===void 0?4:s;let c;e[2]!==x?(c=Array.from({length:x}).map(Y),e[2]=x,e[3]=c):c=e[3];let a;return e[4]!==r||e[5]!==m||e[6]!==d||e[7]!==c?(a=i.jsx(z,{columns:m,gap:d,className:r,children:c}),e[4]=r,e[5]=m,e[6]=d,e[7]=c,e[8]=a):a=e[8],a}function Y(t,e){return i.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),i.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const S=Object.assign(z,{Skeleton:W});function Z(t){const e=u.c(14),{query:n}=t,{data:l}=w.useListOrganizations(),s=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const c=n.toLowerCase();return l.filter(a=>a.name.toLowerCase().includes(c)||a.slug.toLowerCase().includes(c))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const x=r;if(!l||l.length===0){let c;return e[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=c):c=e[3],c}if(x.length===0){let c;return e[4]!==n?(c=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=c):c=e[5],c}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==x||e[8]!==s){let c;e[10]!==s?(c=a=>i.jsxs(b,{onNavigate:()=>s({to:"/$org",params:{org:a.slug}}),children:[i.jsxs(b.Header,{children:[i.jsx(b.AvatarSection,{children:i.jsx(b.Avatar,{url:a.logo||"",fallback:a.name,size:"lg",objectFit:"contain"})}),i.jsxs(b.Content,{children:[i.jsxs(b.Subtitle,{children:["@",a.slug]}),i.jsx(b.Title,{children:a.name})]})]}),i.jsx(b.Footer,{children:i.jsxs("div",{className:"text-xs text-muted-foreground",children:["Created:"," ",new Date(a.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},a.id),e[10]=s,e[11]=c):c=e[11],m=x.map(c),e[7]=x,e[8]=s,e[9]=m}else m=e[9];let d;return e[12]!==m?(d=i.jsx(S,{columns:o,children:m}),e[12]=m,e[13]=d):d=e[13],d}function ee(t){const e=u.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(O,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let s;return e[1]!==n.message?(s=i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:[l,i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=s):s=e[2],s}function te(){const t=u.c(20),{error:e,isPending:n}=w.useListOrganizations(),[l,s]=C.useState(""),[r,x]=C.useState(!1),o=C.useDeferredValue(l);if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx("div",{className:"flex items-center justify-between mb-8",children:i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"})}),t[0]=f):f=t[0];let y;return t[1]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[f,i.jsx("div",{className:"@container",children:i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})]}),t[1]=y):y=t[1],y}if(e){let f;return t[2]!==e?(f=i.jsx(ee,{error:e}),t[2]=e,t[3]=f):f=t[3],f}let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"}),t[4]=m):m=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=f=>s(f.target.value),t[5]=d):d=t[5];let c;t[6]!==l?(c=i.jsx($,{className:"max-w-xs",placeholder:"Search",value:l,onChange:d}),t[6]=l,t[7]=c):c=t[7];let a;t[8]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsxs(k,{variant:"default",onClick:()=>x(!0),children:[i.jsx(L,{size:16}),i.jsx("span",{children:"New organization"})]}),t[8]=a):a=t[8];let g;t[9]!==c?(g=i.jsxs("div",{className:"flex items-center justify-between mb-8",children:[m,i.jsxs("div",{className:"flex items-center gap-2",children:[c,a]})]}),t[9]=c,t[10]=g):g=t[10];let p;t[11]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[11]=p):p=t[11];let j;t[12]!==o?(j=i.jsx("div",{className:"@container",children:i.jsx(C.Suspense,{fallback:p,children:i.jsx(Z,{query:o})})}),t[12]=o,t[13]=j):j=t[13];let h;t[14]!==r?(h=i.jsx(D,{open:r,onOpenChange:x}),t[14]=r,t[15]=h):h=t[15];let N;return t[16]!==g||t[17]!==j||t[18]!==h?(N=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[g,j,h]}),t[16]=g,t[17]=j,t[18]=h,t[19]=N):N=t[19],N}function xe(){const t=u.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"min-h-full",children:i.jsx(te,{})}),t[0]=e):e=t[0],e}export{xe as default};
|