@decocms/mesh 2.64.0 → 2.64.2
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-B7sqll3Z.js → AlertCircle-CyK0Qw5h.js} +1 -1
- package/dist/client/assets/{ArrowUp-D8YYlj5b.js → ArrowUp-BzVEz2lB.js} +1 -1
- package/dist/client/assets/{Calendar-Cn4v8JwE.js → Calendar-DtGnvM8B.js} +1 -1
- package/dist/client/assets/{Check-lN7sUZo8.js → Check-Dzm8t_lx.js} +1 -1
- package/dist/client/assets/CheckCircle-Dq1sA0pv.js +1 -0
- package/dist/client/assets/{ChevronDown-En_P43wp.js → ChevronDown-Z3Dyyuvx.js} +1 -1
- package/dist/client/assets/{ChevronRight-BB2YL4K4.js → ChevronRight-DDdY_PC7.js} +1 -1
- package/dist/client/assets/{Code01-Dgx2dgXr.js → Code01-BWP8EmsE.js} +1 -1
- package/dist/client/assets/{Copy01-daHVbD8K.js → Copy01-C6IJYSqu.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-DT2O2EOj.js → DotsHorizontal-lop24UEO.js} +1 -1
- package/dist/client/assets/{DotsVertical-D1ZY49Um.js → DotsVertical-BpzYqYSl.js} +1 -1
- package/dist/client/assets/{Download01-oP6u6TmF.js → Download01-DkL2eEzP.js} +1 -1
- package/dist/client/assets/{Edit01-C_JM_ANM.js → Edit01-BObRJWWQ.js} +1 -1
- package/dist/client/assets/{File02-DlRIy2xF.js → File02-D8LncylE.js} +1 -1
- package/dist/client/assets/{File06-2dtWfDa_.js → File06-Bwnj0Jvb.js} +1 -1
- package/dist/client/assets/{FilterLines-BCtAjuvO.js → FilterLines-Tzhosng2.js} +1 -1
- package/dist/client/assets/Globe02-DudYvjwY.js +1 -0
- package/dist/client/assets/{Grid01-DHptyetH.js → Grid01-DB4psHwp.js} +1 -1
- package/dist/client/assets/{Home02-CwpXJj-n.js → Home02-C9yoONyT.js} +1 -1
- package/dist/client/assets/{Image01-CILGPgam.js → Image01-BIunU3ME.js} +1 -1
- package/dist/client/assets/{Inbox01-BTvTBHN2.js → Inbox01-Dn_ZLwmj.js} +1 -1
- package/dist/client/assets/{InfoCircle-COTflZ7n.js → InfoCircle-p3x1ZyEw.js} +1 -1
- package/dist/client/assets/{Key01-DFKkR5uc.js → Key01-Bycaiiyx.js} +1 -1
- package/dist/client/assets/{LinkExternal01-WHnCc-Ds.js → LinkExternal01-DQ9drSdh.js} +1 -1
- package/dist/client/assets/{List-Dl-Bi1Os.js → List-BeVMnZSE.js} +1 -1
- package/dist/client/assets/{Loading01-D8raUT2q.js → Loading01-DCWQbhnz.js} +1 -1
- package/dist/client/assets/{Lock01-0pDC11sR.js → Lock01-Cnn8kQG1.js} +1 -1
- package/dist/client/assets/{Pin01-C3nTzsY2.js → Pin01-WkOPKnTb.js} +1 -1
- package/dist/client/assets/{Play-B3d026b0.js → Play-D6BmScpI.js} +1 -1
- package/dist/client/assets/{Plus-BcqTpnxy.js → Plus-CG8dB40n.js} +1 -1
- package/dist/client/assets/{SearchMd-DVuLBPJW.js → SearchMd-BWXZ4bVC.js} +1 -1
- package/dist/client/assets/{Share07-DW8M4mUv.js → Share07-DSoplUP9.js} +1 -1
- package/dist/client/assets/{Terminal-BOgtpg9n.js → Terminal-CdMAejVo.js} +1 -1
- package/dist/client/assets/{Tool01-D95FDZLP.js → Tool01-BDUyIGto.js} +1 -1
- package/dist/client/assets/{Trash01-CR6s5yrj.js → Trash01-C_hJOK44.js} +1 -1
- package/dist/client/assets/{Upload01-CkSc1CyA.js → Upload01-CnMM-V_T.js} +1 -1
- package/dist/client/assets/{Users03-CCWN1VQn.js → Users03-DkIVbHWT.js} +1 -1
- package/dist/client/assets/{X-BsLffR19.js → X-8UbCzOSY.js} +1 -1
- package/dist/client/assets/{XClose-D9VL7Fhs.js → XClose-BDdig6o8.js} +1 -1
- package/dist/client/assets/agent-connections-preview-CC_R-LrZ.js +1 -0
- package/dist/client/assets/agent-detail-yfEWcbsQ.js +1 -0
- package/dist/client/assets/agents-BLmykWZD.js +1 -0
- package/dist/client/assets/alert-dialog-CHAGlLFb.js +7 -0
- package/dist/client/assets/{auth-catchall-B3lc_CZ9.js → auth-catchall-B-Mu7VlE.js} +1 -1
- package/dist/client/assets/badge-BMiZ-mom.js +1 -0
- package/dist/client/assets/{binder-CwgOa4SG.js → binder-DC5jbVcK.js} +1 -1
- package/dist/client/assets/{breadcrumb-BuFIEIOz.js → breadcrumb-BjHn0dWR.js} +1 -1
- package/dist/client/assets/{button-BNRw8VbO.js → button-nyR0JH2l.js} +1 -1
- package/dist/client/assets/{card-B2_21gZH.js → card-DVnhjUGd.js} +1 -1
- package/dist/client/assets/{checkbox-D0Zw7dGS.js → checkbox-TpL0D3NW.js} +1 -1
- package/dist/client/assets/{circle-alert-DepalnIB.js → circle-alert-D0fEJodr.js} +1 -1
- package/dist/client/assets/{collapsible-Dg-5RnYq.js → collapsible-DJK4gRv1.js} +7 -7
- package/dist/client/assets/{collection-detail-DFH_vpkO.js → collection-detail-GbUt_XKS.js} +3 -3
- package/dist/client/assets/{collection-search-D5gi0-bL.js → collection-search-DgJbkAZh.js} +1 -1
- package/dist/client/assets/collection-tab-BTzm3KZ6.js +1 -0
- package/dist/client/assets/collection-table-wrapper-Ad_-F1tG.js +1 -0
- package/dist/client/assets/collection-tabs-UYd1fkoS.js +1 -0
- package/dist/client/assets/connect-BCgu89pq.js +1 -0
- package/dist/client/assets/connection-card-ByjFlujM.js +1 -0
- package/dist/client/assets/connection-detail-CuLe29i_.js +1 -0
- package/dist/client/assets/connections-BKV3JOBI.js +1 -0
- package/dist/client/assets/{constants-Cpe-c81c.js → constants-CJQnv32m.js} +1 -1
- package/dist/client/assets/constants-DpsR0LZe.js +1 -0
- package/dist/client/assets/{create-organization-dialog-7bdcAksX.js → create-organization-dialog-WB_1M15V.js} +1 -1
- package/dist/client/assets/{dialog-Csoqe4hG.js → dialog-DobMZv-a.js} +1 -1
- package/dist/client/assets/differenceInSeconds-NQ4PDo0z.js +1 -0
- package/dist/client/assets/dropdown-menu-BUrC7H_I.js +1 -0
- package/dist/client/assets/dynamic-plugin-layout-yJKJv0tx.js +1 -0
- package/dist/client/assets/{empty-state-Cn1CRUZO.js → empty-state-C0f9rz3s.js} +1 -1
- package/dist/client/assets/{empty-state-CpRLw49r.js → empty-state-Z8nGys2S.js} +1 -1
- package/dist/client/assets/{env-vars-editor-0JsZHlg0.js → env-vars-editor-CGiYkoF6.js} +1 -1
- package/dist/client/assets/{error-boundary-DQ5uRgdY.js → error-boundary-_n4elsYx.js} +1 -1
- package/dist/client/assets/extract-connection-data-DS_2GbRy.js +1 -0
- package/dist/client/assets/file-browser-BQ5LNDAg.js +2 -0
- package/dist/client/assets/{form-DAoJifFq.js → form-8XJyhmpO.js} +1 -1
- package/dist/client/assets/grid-view-D_Aa-emn.js +1 -0
- package/dist/client/assets/home-uc024wOV.js +1 -0
- package/dist/client/assets/index--OStx8iM.js +1 -0
- package/dist/client/assets/{index-yjsBu7QA.js → index-BAZLm9w0.js} +2 -2
- package/dist/client/assets/index-BQzGssjd.js +25 -0
- package/dist/client/assets/index-Bj5Q4dXx.css +1 -0
- package/dist/client/assets/{index-DJLvIq1X.js → index-Diri8Ct6.js} +1 -1
- package/dist/client/assets/index-Dl8GoNj7.js +1 -0
- package/dist/client/assets/{index-P_cUV9l9.js → index-LE1qlbhg.js} +1 -1
- package/dist/client/assets/{index-Bos_CuhY.js → index-ZeDSkwHv.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-D_8FFQdU.js → infiniteQueryObserver-yv2IwJ75.js} +1 -1
- package/dist/client/assets/{input-C-GM7dsu.js → input-DHWQboe4.js} +1 -1
- package/dist/client/assets/layout-DsaX6gcJ.js +1 -0
- package/dist/client/assets/localstorage-keys-Ciabbhpd.js +1 -0
- package/dist/client/assets/login-BoFTpuW0.js +1 -0
- package/dist/client/assets/{mcp-oauth-l77m3IWF.js → mcp-oauth-Cik_32Ma.js} +1 -1
- package/dist/client/assets/mcp-server-card-C9lXz3j7.js +1 -0
- package/dist/client/assets/mcp-server-detail-CKjLUZ8-.js +2 -0
- package/dist/client/assets/members-B7KaOevg.js +3 -0
- package/dist/client/assets/{monaco-editor-p_EFt-aT.js → monaco-editor-CyfxpBLo.js} +1 -1
- package/dist/client/assets/{monitoring-CFkcXam_.js → monitoring-71UNkDku.js} +5 -5
- package/dist/client/assets/{oauth-callback-DN_uk9hh.js → oauth-callback-B66O8BPw.js} +1 -1
- package/dist/client/assets/page-BTGK2JIy.js +1 -0
- package/dist/client/assets/page-CJ03HOIm.js +1 -0
- package/dist/client/assets/{plugin-empty-state-CuuSx5zh.js → plugin-empty-state-Dn9tQuRR.js} +1 -1
- package/dist/client/assets/{plugin-header-BpBy7iT0.js → plugin-header-CNqlEglT.js} +1 -1
- package/dist/client/assets/{plugins-CEFWqcJY.js → plugins-Vjr6K9Js.js} +1 -1
- package/dist/client/assets/{popover-u_i609j_.js → popover-CZsr9YrL.js} +1 -1
- package/dist/client/assets/registry-utils-DGqTJkDv.js +1 -0
- package/dist/client/assets/{resizable-Bac7VXSC.js → resizable-kmnSMXLy.js} +1 -1
- package/dist/client/assets/select-CrjtUXd1.js +1 -0
- package/dist/client/assets/settings-BupAfFFs.js +1 -0
- package/dist/client/assets/shell-layout-Ckg9pQSt.js +12 -0
- package/dist/client/assets/{spinner-Duo6KesX.js → spinner-CQdhmUjg.js} +1 -1
- package/dist/client/assets/{store-invite-CyZGTGUz.js → store-invite-C-ESgBdT.js} +1 -1
- package/dist/client/assets/{switch-DBMrpKuB.js → switch-DT-s9pj3.js} +1 -1
- package/dist/client/assets/table-oiEqEhps.js +1 -0
- package/dist/client/assets/{textarea-ByvgxbRE.js → textarea-wjx2NJJH.js} +1 -1
- package/dist/client/assets/tools-list-BIhDDkg5.js +1 -0
- package/dist/client/assets/{typewriter-title-CZvcEhZW.js → typewriter-title-BfWKHlUW.js} +2 -2
- package/dist/client/assets/use-binding-C5bwm3GP.js +23 -0
- package/dist/client/assets/use-connection-k5RUrkjP.js +1 -0
- package/dist/client/assets/use-create-virtual-mcp-BfrhVnN1.js +1 -0
- package/dist/client/assets/{use-deco-chat-open-C4y7eW_U.js → use-deco-chat-open-BwQGL7z_.js} +1 -1
- package/dist/client/assets/use-list-state-CCCWL8bD.js +1 -0
- package/dist/client/assets/{use-mcp-prompts-SKr2e7l0.js → use-mcp-prompts-DeryV1GR.js} +1 -1
- package/dist/client/assets/{use-members-C8R91dOK.js → use-members-Brv-Zo51.js} +1 -1
- package/dist/client/assets/{use-mobile-CS2zVR4m.js → use-mobile-MoR_lOMO.js} +1 -1
- package/dist/client/assets/use-organization-settings-DtbIWln6.js +1 -0
- package/dist/client/assets/use-virtual-mcp-DfnzITXx.js +1 -0
- package/dist/client/assets/useInfiniteQuery-5yIodymH.js +1 -0
- package/dist/client/assets/useMutation-ffySYpQB.js +1 -0
- package/dist/client/assets/useQuery-Da0DsMDg.js +1 -0
- package/dist/client/assets/{view-mode-toggle-zGyN0eoT.js → view-mode-toggle-DsKf8ZTT.js} +1 -1
- package/dist/client/assets/workflow-BxPDjOre.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +149 -149
- package/dist/server/migrate.js +128 -128
- package/dist/server/node_modules/kysely/dist/cjs/kysely.js +4 -1
- package/dist/server/node_modules/kysely/dist/cjs/query-compiler/default-query-compiler.js +4 -4
- package/dist/server/node_modules/kysely/dist/esm/kysely.js +4 -1
- package/dist/server/node_modules/kysely/dist/esm/query-compiler/default-query-compiler.js +4 -4
- package/dist/server/node_modules/kysely/package.json +9 -9
- package/dist/server/server.js +130 -130
- package/package.json +1 -1
- package/dist/client/assets/agent-detail-DEjCff0P.js +0 -1
- package/dist/client/assets/agents-C0Oa7sFF.js +0 -1
- package/dist/client/assets/alert-dialog-BYFUia7V.js +0 -7
- package/dist/client/assets/avatar-B6WhQiHI.js +0 -1
- package/dist/client/assets/badge-D19NcG12.js +0 -1
- package/dist/client/assets/collection-tab-DxItkIfa.js +0 -1
- package/dist/client/assets/collection-table-wrapper-igJ5OqPc.js +0 -1
- package/dist/client/assets/connect-CtxQyDSW.js +0 -1
- package/dist/client/assets/connection-card-GHfjxhQ1.js +0 -1
- package/dist/client/assets/connection-detail-sqbtlWZ0.js +0 -1
- package/dist/client/assets/connections-DeNXDjso.js +0 -1
- package/dist/client/assets/constants-gYpJq1UH.js +0 -1
- package/dist/client/assets/dropdown-menu-CsYNL9oo.js +0 -1
- package/dist/client/assets/dynamic-plugin-layout-bKoth3Ne.js +0 -1
- package/dist/client/assets/extract-connection-data-B6LHMHtn.js +0 -1
- package/dist/client/assets/file-browser-xiIO0qLw.js +0 -2
- package/dist/client/assets/grid-view-Bj9WDB_-.js +0 -1
- package/dist/client/assets/home-BgLX6VJQ.js +0 -1
- package/dist/client/assets/index-BhNLW4h1.js +0 -1
- package/dist/client/assets/index-CU94_QoM.css +0 -1
- package/dist/client/assets/index-CsOz92iP.js +0 -25
- package/dist/client/assets/index-GUdoiFzV.js +0 -1
- package/dist/client/assets/layout-D8G7uVC8.js +0 -1
- package/dist/client/assets/localstorage-keys-C_mtBNzA.js +0 -1
- package/dist/client/assets/login-FPJg9vSY.js +0 -1
- package/dist/client/assets/mcp-server-card-D5sj_LDb.js +0 -1
- package/dist/client/assets/mcp-server-detail-BFJxlaGZ.js +0 -2
- package/dist/client/assets/members-D6XXyYMu.js +0 -3
- package/dist/client/assets/page-BityQMBs.js +0 -1
- package/dist/client/assets/page-D2S0EYIA.js +0 -1
- package/dist/client/assets/pin-to-sidebar-button-qPJJKT8U.js +0 -1
- package/dist/client/assets/registry-utils-BNFgymSf.js +0 -1
- package/dist/client/assets/resource-tabs-CE-63rPp.js +0 -1
- package/dist/client/assets/select-B4SPtD5h.js +0 -1
- package/dist/client/assets/settings-CoEwEtT9.js +0 -1
- package/dist/client/assets/shell-layout-BH2X3Yeb.js +0 -12
- package/dist/client/assets/table-NP0FOAI5.js +0 -1
- package/dist/client/assets/tools-list-gkMtCYZf.js +0 -1
- package/dist/client/assets/use-binding-CNR8kDE7.js +0 -23
- package/dist/client/assets/use-collections-Hp9XPnUY.js +0 -1
- package/dist/client/assets/use-connection-Dj100t8H.js +0 -1
- package/dist/client/assets/use-create-virtual-mcp-B01dvSQa.js +0 -1
- package/dist/client/assets/use-list-state-DsM4HMGd.js +0 -1
- package/dist/client/assets/use-organization-settings-ClYOYczD.js +0 -1
- package/dist/client/assets/use-virtual-mcp-XGRCLjSr.js +0 -1
- package/dist/client/assets/useInfiniteQuery-C34Ot4VI.js +0 -1
- package/dist/client/assets/useMutation-VOj1VEf8.js +0 -1
- package/dist/client/assets/useQuery-C5RIveiE.js +0 -1
- package/dist/client/assets/workflow-BRSWFGSV.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as _,j as t,a$ as mt,ak as he,an as Ne,a_ as ut,av as ft,aZ as xt,am as pt,at as ht,b0 as Ue,aq as gt,c as T,u as ge,V as bt,s as jt,v as De,l as vt,a as Nt,b6 as yt,k as Ct,h as _t,q as Tt,ah as St}from"./index-yjsBu7QA.js";import{i as kt,a as wt,u as It,C as Et,b as At}from"./collapsible-Dg-5RnYq.js";import{I as ue,T as ce,b as ye,c as de,a as me,E as Ot}from"./empty-state-CpRLw49r.js";import{E as pe,i as Dt}from"./error-boundary-DQ5uRgdY.js";import{P as $t}from"./pin-to-sidebar-button-qPJJKT8U.js";import{u as Rt}from"./use-deco-chat-open-C4y7eW_U.js";import{B as $e}from"./badge-D19NcG12.js";import{c as Y,B as X}from"./button-BNRw8VbO.js";import{I as Fe}from"./input-C-GM7dsu.js";import{S as Lt}from"./switch-DBMrpKuB.js";import{T as Pt}from"./textarea-ByvgxbRE.js";import{b as zt,u as We}from"./use-connection-Dj100t8H.js";import{u as Vt,a as Mt}from"./use-virtual-mcp-XGRCLjSr.js";import{i as qe}from"./ChevronRight-BB2YL4K4.js";import{n as Ft}from"./select-B4SPtD5h.js";import{i as Re}from"./File02-DlRIy2xF.js";import{i as Ke}from"./Loading01-D8raUT2q.js";import{i as Bt}from"./Play-B3d026b0.js";import{s as Be}from"./Plus-BcqTpnxy.js";import{i as Gt}from"./Share07-DW8M4mUv.js";import{a as Le}from"./Tool01-D95FDZLP.js";import{B as Ht,a as Ut,b as Ge,d as Wt,e as qt,c as Kt}from"./breadcrumb-BuFIEIOz.js";import{b as Yt,V as Jt}from"./layout-D8G7uVC8.js";import{I as Zt,R as Qt,a as Xt,S as es}from"./index-BhNLW4h1.js";import{C as ts}from"./collection-search-D5gi0-bL.js";import{C as Pe}from"./checkbox-D0Zw7dGS.js";import{e as ss,a as Ye,D as Je,b as ls,c as os}from"./dialog-Csoqe4hG.js";import{f as ns}from"./use-collections-Hp9XPnUY.js";import{u as ze}from"./constants-Cpe-c81c.js";import{c as rs,u as is}from"./use-mcp-prompts-SKr2e7l0.js";import{s as Ze}from"./slugify-CEUa2lfQ.js";import{i as Qe}from"./Check-lN7sUZo8.js";import{i as as}from"./Code01-Dgx2dgXr.js";import{a as cs}from"./Copy01-daHVbD8K.js";import{i as Ce}from"./InfoCircle-COTflZ7n.js";import"./use-binding-CNR8kDE7.js";import"./binder-CwgOa4SG.js";import"./localstorage-keys-C_mtBNzA.js";import"./useQuery-C5RIveiE.js";import"./useMutation-VOj1VEf8.js";import"./popover-u_i609j_.js";import"./ChevronDown-En_P43wp.js";import"./File06-2dtWfDa_.js";import"./Grid01-DHptyetH.js";import"./Image01-CILGPgam.js";import"./SearchMd-DVuLBPJW.js";import"./Pin01-C3nTzsY2.js";import"./use-organization-settings-ClYOYczD.js";import"./index-P_cUV9l9.js";import"./X-BsLffR19.js";import"./infiniteQueryObserver-D_8FFQdU.js";const Xe=({size:o=24,color:e="currentColor",...s})=>_.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},_.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));Xe.displayName="Circle";const et=({size:o=24,color:e="currentColor",...s})=>_.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},_.createElement("path",{d:"M9 2v3m6-3v3M9 19v3m6-3v3m4-13h3m-3 5h3M2 9h3m-3 5h3m4.8 5h4.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C19 16.72 19 15.88 19 14.2V9.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C16.72 5 15.88 5 14.2 5H9.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C5 7.28 5 8.12 5 9.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C7.28 19 8.12 19 9.8 19Z"}));et.displayName="CpuChip02";const be=({size:o=24,color:e="currentColor",...s})=>_.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},_.createElement("path",{d:"m9.75 20.75 1.473.818c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l1.473-.818m-9-2.5-1.427-.793c-.3-.166-.45-.25-.558-.368a1 1 0 0 1-.215-.364C3 16.573 3 16.401 3 16.06V14.5m0-5V7.942c0-.343 0-.514.05-.667a1 1 0 0 1 .215-.364c.109-.119.258-.202.558-.368L5.25 5.75m4.5-2.5 1.473-.818c.284-.158.425-.237.576-.267a1 1 0 0 1 .402 0c.15.03.292.11.576.267l1.473.818m4.5 2.5 1.427.793c.3.166.45.25.558.368a1 1 0 0 1 .215.364c.05.153.05.324.05.667V9.5m0 5v1.559c0 .342 0 .514-.05.666a.999.999 0 0 1-.215.364c-.109.119-.258.202-.558.368l-1.427.793m-9-7.5L12 12m0 0 2.25-1.25M12 12v2.5M3 7l2.25 1.25m13.5 0L21 7m-9 12.5V22"}));be.displayName="CubeOutline";var je="Tabs",[ds]=gt(je,[Ue]),tt=Ue(),[ms,Ve]=ds(je),st=_.forwardRef((o,e)=>{const{__scopeTabs:s,value:n,onValueChange:l,defaultValue:r,orientation:c="horizontal",dir:i,activationMode:a="automatic",...m}=o,u=xt(i),[d,f]=pt({prop:n,onChange:l,defaultProp:r??"",caller:je});return t.jsx(ms,{scope:s,baseId:ht(),value:d,onValueChange:f,orientation:c,dir:u,activationMode:a,children:t.jsx(he.div,{dir:u,"data-orientation":c,...m,ref:e})})});st.displayName=je;var lt="TabsList",ot=_.forwardRef((o,e)=>{const{__scopeTabs:s,loop:n=!0,...l}=o,r=Ve(lt,s),c=tt(s);return t.jsx(ut,{asChild:!0,...c,orientation:r.orientation,dir:r.dir,loop:n,children:t.jsx(he.div,{role:"tablist","aria-orientation":r.orientation,...l,ref:e})})});ot.displayName=lt;var nt="TabsTrigger",rt=_.forwardRef((o,e)=>{const{__scopeTabs:s,value:n,disabled:l=!1,...r}=o,c=Ve(nt,s),i=tt(s),a=ct(c.baseId,n),m=dt(c.baseId,n),u=n===c.value;return t.jsx(mt,{asChild:!0,...i,focusable:!l,active:u,children:t.jsx(he.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":m,"data-state":u?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:a,...r,ref:e,onMouseDown:Ne(o.onMouseDown,d=>{!l&&d.button===0&&d.ctrlKey===!1?c.onValueChange(n):d.preventDefault()}),onKeyDown:Ne(o.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&c.onValueChange(n)}),onFocus:Ne(o.onFocus,()=>{const d=c.activationMode!=="manual";!u&&!l&&d&&c.onValueChange(n)})})})});rt.displayName=nt;var it="TabsContent",at=_.forwardRef((o,e)=>{const{__scopeTabs:s,value:n,forceMount:l,children:r,...c}=o,i=Ve(it,s),a=ct(i.baseId,n),m=dt(i.baseId,n),u=n===i.value,d=_.useRef(u);return _.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),t.jsx(ft,{present:l||u,children:({present:f})=>t.jsx(he.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":a,hidden:!f,id:m,tabIndex:0,...c,ref:e,style:{...o.style,animationDuration:d.current?"0s":void 0},children:f&&r})})});at.displayName=it;function ct(o,e){return`${o}-trigger-${e}`}function dt(o,e){return`${o}-content-${e}`}var us=st,fs=ot,xs=rt,ps=at;function hs(o){const e=T.c(10);let s,n,l;e[0]!==o?({className:s,variant:l,...n}=o,e[0]=o,e[1]=s,e[2]=n,e[3]=l):(s=e[1],n=e[2],l=e[3]);const r=l===void 0?"pill":l;let c;e[4]!==s?(c=Y("flex flex-col gap-2",s),e[4]=s,e[5]=c):c=e[5];let i;return e[6]!==n||e[7]!==c||e[8]!==r?(i=t.jsx(us,{"data-slot":"tabs","data-variant":r,className:c,...n}),e[6]=n,e[7]=c,e[8]=r,e[9]=i):i=e[9],i}function gs(o){const e=T.c(11);let s,n,l;e[0]!==o?({className:s,variant:l,...n}=o,e[0]=o,e[1]=s,e[2]=n,e[3]=l):(s=e[1],n=e[2],l=e[3]);const r=l||"pill",c=r==="underline"?"flex h-[52px] items-center border-b border-border":r==="canvas"?"flex h-10 items-center bg-background relative":"bg-muted text-muted-foreground inline-flex h-10 w-fit items-center justify-center rounded-xl p-[3px]";let i;e[4]!==s||e[5]!==c?(i=Y(c,s),e[4]=s,e[5]=c,e[6]=i):i=e[6];let a;return e[7]!==r||e[8]!==n||e[9]!==i?(a=t.jsx(fs,{"data-slot":"tabs-list","data-variant":r,className:i,...n}),e[7]=r,e[8]=n,e[9]=i,e[10]=a):a=e[10],a}function _e(o){const e=T.c(11);let s,n,l;e[0]!==o?({className:s,variant:l,...n}=o,e[0]=o,e[1]=s,e[2]=n,e[3]=l):(s=e[1],n=e[2],l=e[3]);const r=l||"pill",c=r==="underline"?"cursor-pointer flex items-center h-full px-3 relative text-sm whitespace-nowrap border-b-2 mb-[-1px] transition-all text-muted-foreground border-transparent hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-foreground disabled:pointer-events-none disabled:opacity-50":r==="canvas"?"cursor-pointer flex items-center h-full px-3 gap-2.5 text-sm whitespace-nowrap transition-all border-r border-b border-border [&>*]:opacity-50 data-[state=active]:[&>*]:opacity-100 data-[state=active]:border-b-0 last:border-r-0 disabled:pointer-events-none max-w-2xs":"data-[state=active]:bg-background dark:data-[state=active]:text-foreground cursor-pointer focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";let i;e[4]!==s||e[5]!==c?(i=Y(c,s),e[4]=s,e[5]=c,e[6]=i):i=e[6];let a;return e[7]!==r||e[8]!==n||e[9]!==i?(a=t.jsx(xs,{"data-slot":"tabs-trigger","data-variant":r,className:i,...n}),e[7]=r,e[8]=n,e[9]=i,e[10]=a):a=e[10],a}function Te(o){const e=T.c(8);let s,n;e[0]!==o?({className:s,...n}=o,e[0]=o,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let l;e[3]!==s?(l=Y("flex-1 outline-none h-full",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx(ps,{"data-slot":"tabs-content",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Se(o){return o===null?"all":o?.length??0}function bs(o,e){const s=o[e];if(!s)return"";const n=[];return s.tools===null?n.push("all tools"):s.tools&&s.tools.length>0&&n.push(`${s.tools.length} tools`),s.resources===null?n.push("all resources"):s.resources&&s.resources.length>0&&n.push(`${s.resources.length} resources`),s.prompts===null?n.push("all prompts"):s.prompts&&s.prompts.length>0&&n.push(`${s.prompts.length} prompts`),n.join(", ")}function js(o,e){const s=o[e];return s?!((s.tools===void 0||s.tools!==null&&s.tools.length===0)&&(s.resources===void 0||s.resources!==null&&s.resources.length===0)&&(s.prompts===void 0||s.prompts!==null&&s.prompts.length===0)):!1}const vs={tools:null,resources:null,prompts:null};function ke(){const o=T.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(Ke,{className:"animate-spin text-muted-foreground",size:24})}),o[0]=e):e=o[0],e}function we(o){return({error:e})=>e?.message?.includes("Method not found")||e?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:o})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(Dt,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:e?.message?e.message.length>200?`${e.message.slice(0,200)}...`:e.message:"An unexpected error occurred"})]})]})}function Ns(o){const e=T.c(18),{item:s,isSelected:n,onToggle:l,disabled:r}=o,c=r?"cursor-not-allowed opacity-50":"cursor-pointer",i=n?"bg-accent/25":"hover:bg-muted/50";let a;e[0]!==c||e[1]!==i?(a=Y("flex items-start gap-3 p-4 rounded-lg transition-colors",c,i),e[0]=c,e[1]=i,e[2]=a):a=e[2];let m;e[3]!==s.name?(m=t.jsx("p",{className:"text-sm font-medium leading-none",children:s.name}),e[3]=s.name,e[4]=m):m=e[4];let u;e[5]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[5]=s.description,e[6]=u):u=e[6];let d;e[7]!==m||e[8]!==u?(d=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[m,u]}),e[7]=m,e[8]=u,e[9]=d):d=e[9];let f;e[10]!==r||e[11]!==n||e[12]!==l?(f=t.jsx(Pe,{checked:n,onCheckedChange:l,disabled:r,className:"mt-0.5"}),e[10]=r,e[11]=n,e[12]=l,e[13]=f):f=e[13];let h;return e[14]!==a||e[15]!==d||e[16]!==f?(h=t.jsxs("label",{className:a,children:[d,f]}),e[14]=a,e[15]=d,e[16]=f,e[17]=h):h=e[17],h}function Me(o){const e=T.c(32),{items:s,selections:n,onToggle:l,onToggleAll:r,emptyMessage:c,disabled:i}=o;let a,m,u,d,f;if(e[0]!==i||e[1]!==c||e[2]!==s||e[3]!==l||e[4]!==r||e[5]!==n){f=Symbol.for("react.early_return_sentinel");e:{const x=s.map(ys);if(s.length===0){let C;e[11]!==c?(C=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:c})}),e[11]=c,e[12]=C):C=e[12],f=C;break e}u="flex flex-col h-full";const N=i?"cursor-not-allowed opacity-50":"cursor-pointer";let j;e[13]!==N?(j=Y("flex items-start gap-3 p-4",N),e[13]=N,e[14]=j):j=e[14];let v;e[15]!==s.length?(v=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsxs("span",{className:"text-sm font-medium",children:["Select All (",s.length,")"]})}),e[15]=s.length,e[16]=v):v=e[16];const g=n===null;let y;e[17]!==i||e[18]!==r||e[19]!==g?(y=t.jsx(Pe,{checked:g,onCheckedChange:r,disabled:i,className:"mt-0.5"}),e[17]=i,e[18]=r,e[19]=g,e[20]=y):y=e[20],e[21]!==y||e[22]!==j||e[23]!==v?(d=t.jsx("div",{className:"px-4 border-b border-border shrink-0",children:t.jsxs("label",{className:j,children:[v,y]})}),e[21]=y,e[22]=j,e[23]=v,e[24]=d):d=e[24],a="flex-1 overflow-auto px-4 py-3 space-y-1",m=s.map(C=>t.jsx(Ns,{item:C,isSelected:n===null||n?.includes(C.id),onToggle:()=>l(C.id,x),disabled:i},C.id))}e[0]=i,e[1]=c,e[2]=s,e[3]=l,e[4]=r,e[5]=n,e[6]=a,e[7]=m,e[8]=u,e[9]=d,e[10]=f}else a=e[6],m=e[7],u=e[8],d=e[9],f=e[10];if(f!==Symbol.for("react.early_return_sentinel"))return f;let h;e[25]!==a||e[26]!==m?(h=t.jsx("div",{className:a,children:m}),e[25]=a,e[26]=m,e[27]=h):h=e[27];let p;return e[28]!==u||e[29]!==d||e[30]!==h?(p=t.jsxs("div",{className:u,children:[d,h]}),e[28]=u,e[29]=d,e[30]=h,e[31]=p):p=e[31],p}function ys(o){return o.id}function Cs(o){const e=T.c(13),{connectionId:s,selections:n,onToggle:l,onToggleAll:r,disabled:c}=o,{org:i}=ge();let a;e[0]!==s||e[1]!==i.id?(a={connectionId:s,orgId:i.id},e[0]=s,e[1]=i.id,e[2]=a):a=e[2];const m=ze(a);let u;e[3]!==m?(u={client:m},e[3]=m,e[4]=u):u=e[4];const{data:d}=ns(u);let f;e[5]!==d.tools?(f=d.tools.map(_s),e[5]=d.tools,e[6]=f):f=e[6];const h=f;let p;return e[7]!==c||e[8]!==h||e[9]!==l||e[10]!==r||e[11]!==n?(p=t.jsx(Me,{items:h,selections:n,onToggle:l,onToggleAll:r,emptyMessage:"No tools available",disabled:c}),e[7]=c,e[8]=h,e[9]=l,e[10]=r,e[11]=n,e[12]=p):p=e[12],p}function _s(o){return{id:o.name,name:o.name,description:o.description}}function Ts(o){const e=T.c(13),{connectionId:s,selections:n,onToggle:l,onToggleAll:r,disabled:c}=o,{org:i}=ge();let a;e[0]!==s||e[1]!==i.id?(a={connectionId:s,orgId:i.id},e[0]=s,e[1]=i.id,e[2]=a):a=e[2];const m=ze(a);let u;e[3]!==m?(u={client:m},e[3]=m,e[4]=u):u=e[4];const{data:d}=rs(u);let f;e[5]!==d.resources?(f=d.resources.map(Ss),e[5]=d.resources,e[6]=f):f=e[6];const h=f;let p;return e[7]!==c||e[8]!==h||e[9]!==l||e[10]!==r||e[11]!==n?(p=t.jsx(Me,{items:h,selections:n,onToggle:l,onToggleAll:r,emptyMessage:"No resources available",disabled:c}),e[7]=c,e[8]=h,e[9]=l,e[10]=r,e[11]=n,e[12]=p):p=e[12],p}function Ss(o){return{id:o.name||o.uri,name:o.name||o.uri,description:o.description}}function ks(o){const e=T.c(13),{connectionId:s,selections:n,onToggle:l,onToggleAll:r,disabled:c}=o,{org:i}=ge();let a;e[0]!==s||e[1]!==i.id?(a={connectionId:s,orgId:i.id},e[0]=s,e[1]=i.id,e[2]=a):a=e[2];const m=ze(a);let u;e[3]!==m?(u={client:m},e[3]=m,e[4]=u):u=e[4];const{data:d}=is(u);let f;e[5]!==d.prompts?(f=d.prompts.map(ws),e[5]=d.prompts,e[6]=f):f=e[6];const h=f;let p;return e[7]!==c||e[8]!==h||e[9]!==l||e[10]!==r||e[11]!==n?(p=t.jsx(Me,{items:h,selections:n,onToggle:l,onToggleAll:r,emptyMessage:"No prompts available",disabled:c}),e[7]=c,e[8]=h,e[9]=l,e[10]=r,e[11]=n,e[12]=p):p=e[12],p}function ws(o){return{id:o.name,name:o.name,description:o.description}}function Is(o){const e=T.c(24),{connection:s,isSelected:n,hasSelections:l,summary:r,onClick:c,onToggleAll:i,disabled:a}=o,m=a?"cursor-not-allowed opacity-50":"cursor-pointer",u=n?"bg-accent":"hover:bg-muted/50";let d;e[0]!==m||e[1]!==u?(d=Y("flex items-center gap-2 p-2 h-12 rounded-lg transition-colors",m,u),e[0]=m,e[1]=u,e[2]=d):d=e[2];const f=a?void 0:c;let h;e[3]!==s.icon||e[4]!==s.title?(h=t.jsx(ue,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[3]=s.icon,e[4]=s.title,e[5]=h):h=e[5];let p;e[6]!==s.title?(p=t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[6]=s.title,e[7]=p):p=e[7];let x;e[8]!==l||e[9]!==r?(x=l&&r&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:r}),e[8]=l,e[9]=r,e[10]=x):x=e[10];let N;e[11]!==p||e[12]!==x?(N=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[p,x]}),e[11]=p,e[12]=x,e[13]=N):N=e[13];let j;e[14]!==a||e[15]!==l||e[16]!==i?(j=t.jsx(Pe,{checked:l,onCheckedChange:i,onClick:Es,disabled:a,className:"shrink-0"}),e[14]=a,e[15]=l,e[16]=i,e[17]=j):j=e[17];let v;return e[18]!==d||e[19]!==f||e[20]!==h||e[21]!==N||e[22]!==j?(v=t.jsxs("div",{className:d,onClick:f,children:[h,N,j]}),e[18]=d,e[19]=f,e[20]=h,e[21]=N,e[22]=j,e[23]=v):v=e[23],v}function Es(o){return o.stopPropagation()}function As(o){const e=T.c(22),{allConnections:s,searchTerm:n,selectedId:l,hasSelections:r,getSelectionSummary:c,onConnectionClick:i,onToggleAll:a,disabled:m}=o;let u;e[0]!==s||e[1]!==n?(u=n?s.filter(p=>p.title.toLowerCase().includes(n.toLowerCase())||p.description?.toLowerCase().includes(n.toLowerCase())):s,e[0]=s,e[1]=n,e[2]=u):u=e[2];const d=u;if(d.length===0){const p=n?"No connections found":"No connections available";let x;return e[3]!==p?(x=t.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground p-4",children:p}),e[3]=p,e[4]=x):x=e[4],x}let f;if(e[5]!==m||e[6]!==d||e[7]!==c||e[8]!==r||e[9]!==i||e[10]!==a||e[11]!==l){let p;e[13]!==m||e[14]!==c||e[15]!==r||e[16]!==i||e[17]!==a||e[18]!==l?(p=x=>t.jsx(Is,{connection:x,isSelected:l===x.id,hasSelections:r(x.id),summary:c(x.id),onClick:()=>i(x.id),onToggleAll:()=>a(x.id),disabled:m},x.id),e[13]=m,e[14]=c,e[15]=r,e[16]=i,e[17]=a,e[18]=l,e[19]=p):p=e[19],f=d.map(p),e[5]=m,e[6]=d,e[7]=c,e[8]=r,e[9]=i,e[10]=a,e[11]=l,e[12]=f}else f=e[12];let h;return e[20]!==f?(h=t.jsx("div",{className:"flex flex-col gap-0.5",children:f}),e[20]=f,e[21]=h):h=e[21],h}function Os(o){const e=T.c(75),{currentConnection:s,activeTab:n,selectedId:l,formData:r,toggleTool:c,toggleResource:i,togglePrompt:a,toggleAllTools:m,toggleAllResources:u,toggleAllPrompts:d,onTabChange:f}=o;let h;e[0]!==s.icon||e[1]!==s.title?(h=t.jsx(ue,{icon:s.icon,name:s.title,size:"md",className:"shrink-0"}),e[0]=s.icon,e[1]=s.title,e[2]=h):h=e[2];let p;e[3]!==s.title?(p=t.jsx("h2",{className:"text-lg font-semibold truncate",children:s.title}),e[3]=s.title,e[4]=p):p=e[4];let x;e[5]!==s.description?(x=s.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:s.description}),e[5]=s.description,e[6]=x):x=e[6];let N;e[7]!==p||e[8]!==x?(N=t.jsxs("div",{className:"flex-1 min-w-0",children:[p,x]}),e[7]=p,e[8]=x,e[9]=N):N=e[9];let j;e[10]!==h||e[11]!==N?(j=t.jsx("div",{className:"p-6 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[h,N]})}),e[10]=h,e[11]=N,e[12]=j):j=e[12];let v;e[13]!==f?(v=F=>f(F),e[13]=f,e[14]=v):v=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs(_e,{value:"tools",variant:"underline",className:"gap-2",children:[t.jsx(Le,{size:16}),"Tools"]}),e[15]=g):g=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsxs(_e,{value:"resources",variant:"underline",className:"gap-2",children:[t.jsx(be,{size:16}),"Resources"]}),e[16]=y):y=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs(gs,{variant:"underline",className:"shrink-0 px-6",children:[g,y,t.jsxs(_e,{value:"prompts",variant:"underline",className:"gap-2",children:[t.jsx(Re,{size:16}),"Prompts"]})]}),e[17]=C):C=e[17];let z;e[18]===Symbol.for("react.memo_cache_sentinel")?(z=we("Tools not supported by this server"),e[18]=z):z=e[18];let k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ke,{}),e[19]=k):k=e[19];let O;e[20]!==r||e[21]!==l?(O=r[l]?r[l].tools:[],e[20]=r,e[21]=l,e[22]=O):O=e[22];let S;e[23]!==l||e[24]!==c?(S=(F,Z)=>c(l,F,Z),e[23]=l,e[24]=c,e[25]=S):S=e[25];let w;e[26]!==l||e[27]!==m?(w=()=>m(l),e[26]=l,e[27]=m,e[28]=w):w=e[28];let E;e[29]!==l||e[30]!==O||e[31]!==S||e[32]!==w?(E=t.jsx(Te,{value:"tools",className:"flex-1 overflow-hidden mt-0",children:t.jsx(pe,{fallback:z,children:t.jsx(_.Suspense,{fallback:k,children:t.jsx(Cs,{connectionId:l,selections:O,onToggle:S,onToggleAll:w})})})}),e[29]=l,e[30]=O,e[31]=S,e[32]=w,e[33]=E):E=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=we("Resources not supported by this server"),e[34]=D):D=e[34];let L;e[35]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(ke,{}),e[35]=L):L=e[35];let I;e[36]!==r||e[37]!==l?(I=r[l]?r[l].resources:[],e[36]=r,e[37]=l,e[38]=I):I=e[38];let A;e[39]!==l||e[40]!==i?(A=(F,Z)=>i(l,F,Z),e[39]=l,e[40]=i,e[41]=A):A=e[41];let $;e[42]!==l||e[43]!==u?($=()=>u(l),e[42]=l,e[43]=u,e[44]=$):$=e[44];let P;e[45]!==l||e[46]!==I||e[47]!==A||e[48]!==$?(P=t.jsx(Te,{value:"resources",className:"flex-1 overflow-hidden mt-0",children:t.jsx(pe,{fallback:D,children:t.jsx(_.Suspense,{fallback:L,children:t.jsx(Ts,{connectionId:l,selections:I,onToggle:A,onToggleAll:$})})})}),e[45]=l,e[46]=I,e[47]=A,e[48]=$,e[49]=P):P=e[49];let K;e[50]===Symbol.for("react.memo_cache_sentinel")?(K=we("Prompts not supported by this server"),e[50]=K):K=e[50];let J;e[51]===Symbol.for("react.memo_cache_sentinel")?(J=t.jsx(ke,{}),e[51]=J):J=e[51];let B;e[52]!==r||e[53]!==l?(B=r[l]?r[l].prompts:[],e[52]=r,e[53]=l,e[54]=B):B=e[54];let W;e[55]!==l||e[56]!==a?(W=(F,Z)=>a(l,F,Z),e[55]=l,e[56]=a,e[57]=W):W=e[57];let G;e[58]!==l||e[59]!==d?(G=()=>d(l),e[58]=l,e[59]=d,e[60]=G):G=e[60];let q;e[61]!==l||e[62]!==B||e[63]!==W||e[64]!==G?(q=t.jsx(Te,{value:"prompts",className:"flex-1 overflow-hidden mt-0",children:t.jsx(pe,{fallback:K,children:t.jsx(_.Suspense,{fallback:J,children:t.jsx(ks,{connectionId:l,selections:B,onToggle:W,onToggleAll:G})})})}),e[61]=l,e[62]=B,e[63]=W,e[64]=G,e[65]=q):q=e[65];let H;e[66]!==n||e[67]!==E||e[68]!==P||e[69]!==q||e[70]!==v?(H=t.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:t.jsxs(hs,{value:n,onValueChange:v,variant:"underline",className:"flex-1 flex flex-col overflow-hidden",children:[C,E,P,q]})}),e[66]=n,e[67]=E,e[68]=P,e[69]=q,e[70]=v,e[71]=H):H=e[71];let U;return e[72]!==H||e[73]!==j?(U=t.jsxs(t.Fragment,{children:[j,H]}),e[72]=H,e[73]=j,e[74]=U):U=e[74],U}function Ds(o){const e={};for(const s of o)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function Ie(o){return Object.entries(o).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function $s(o,e){switch(e.type){case"SET_SEARCH_TERM":return{...o,searchTerm:e.payload};case"SET_SELECTED":return{...o,selectedId:e.payload};case"SET_ACTIVE_TAB":return{...o,activeTab:e.payload};case"RESET":return{searchTerm:"",selectedId:e.payload.selectedId??e.payload.firstConnectionId??null,activeTab:"tools"};case"SELECT_CONNECTION":return{...o,selectedId:e.payload,activeTab:"tools"};default:return o}}const He=(o,e)=>o.find(s=>s.id===e)??o[0];function Rs(o){const e=T.c(79),{open:s,onOpenChange:n,selectedId:l,form:r,connections:c}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];const a=zt(i);let m;e[1]!==a||e[2]!==l?(m=He(a,l)?.id??null,e[1]=a,e[2]=l,e[3]=m):m=e[3];let u;e[4]!==m?(u={activeTab:"tools",searchTerm:"",selectedId:m},e[4]=m,e[5]=u):u=e[5];const[d,f]=_.useReducer($s,u);let h;e[6]!==c?(h=c??[],e[6]=c,e[7]=h):h=e[7];let p;e[8]!==h?(p=Ds(h),e[8]=h,e[9]=p):p=e[9];const x=p;let N;e[10]!==a||e[11]!==d.selectedId?(N=He(a,d.selectedId),e[10]=a,e[11]=d.selectedId,e[12]=N):N=e[12];const j=N;let v;e[13]!==x?(v=b=>js(x,b),e[13]=x,e[14]=v):v=e[14];const g=v;let y;e[15]!==x?(y=b=>bs(x,b),e[15]=x,e[16]=y):y=e[16];const C=y;let z;e[17]!==r||e[18]!==x?(z=(b,R,V,Q)=>{const ie=x[b]?.[R];let M;ie===null?M=Q.filter(ve=>ve!==V):ie?.includes(V)?M=ie.filter(ve=>ve!==V):(M=[...ie??[],V],M.length===Q.length&&(M=null));const ae={...x};ae[b]?ae[b]={...ae[b]}:ae[b]={tools:null,resources:null,prompts:null},ae[b][R]=M,r.setValue("connections",Ie(ae),{shouldDirty:!0,shouldTouch:!0})},e[17]=r,e[18]=x,e[19]=z):z=e[19];const k=z;let O;e[20]!==r||e[21]!==x?(O=(b,R)=>{const ie=x[b]?.[R]===null?[]:null,M={...x};M[b]?M[b]={...M[b]}:M[b]={tools:null,resources:null,prompts:null},M[b][R]=ie,r.setValue("connections",Ie(M),{shouldDirty:!0,shouldTouch:!0})},e[20]=r,e[21]=x,e[22]=O):O=e[22];const S=O;let w;e[23]!==k?(w=(b,R,V)=>k(b,"tools",R,V),e[23]=k,e[24]=w):w=e[24];const E=w;let D;e[25]!==k?(D=(b,R,V)=>k(b,"resources",R,V),e[25]=k,e[26]=D):D=e[26];const L=D;let I;e[27]!==k?(I=(b,R,V)=>k(b,"prompts",R,V),e[27]=k,e[28]=I):I=e[28];const A=I;let $;e[29]!==S?($=b=>S(b,"tools"),e[29]=S,e[30]=$):$=e[30];const P=$;let K;e[31]!==S?(K=b=>S(b,"resources"),e[31]=S,e[32]=K):K=e[32];const J=K;let B;e[33]!==S?(B=b=>S(b,"prompts"),e[33]=S,e[34]=B):B=e[34];const W=B;let G;e[35]!==r||e[36]!==x?(G=b=>{const R=x[b],V=R&&R.tools===null&&R.resources===null&&R.prompts===null,Q={...x};V?delete Q[b]:Q[b]=vs,r.setValue("connections",Ie(Q),{shouldDirty:!0,shouldTouch:!0})},e[35]=r,e[36]=x,e[37]=G):G=e[37];const q=G;let H;e[38]!==a||e[39]!==n||e[40]!==l?(H=b=>{b&&f({type:"RESET",payload:{selectedId:l,firstConnectionId:a[0]?.id??null}}),n(b)},e[38]=a,e[39]=n,e[40]=l,e[41]=H):H=e[41];const U=H;let F;e[42]===Symbol.for("react.memo_cache_sentinel")?(F=b=>{f({type:"SELECT_CONNECTION",payload:b})},e[42]=F):F=e[42];const Z=F;let fe;e[43]===Symbol.for("react.memo_cache_sentinel")?(fe=b=>f({type:"SET_SEARCH_TERM",payload:b}),e[43]=fe):fe=e[43];let ee;e[44]!==d.searchTerm?(ee=t.jsx(ts,{value:d.searchTerm,onChange:fe,placeholder:"Search connections..."}),e[44]=d.searchTerm,e[45]=ee):ee=e[45];let te;e[46]!==a||e[47]!==d.searchTerm||e[48]!==d.selectedId||e[49]!==C||e[50]!==g||e[51]!==q?(te=t.jsx("div",{className:"flex-1 overflow-auto p-2",children:t.jsx(As,{allConnections:a,searchTerm:d.searchTerm,selectedId:d.selectedId,hasSelections:g,getSelectionSummary:C,onConnectionClick:Z,onToggleAll:q})}),e[46]=a,e[47]=d.searchTerm,e[48]=d.selectedId,e[49]=C,e[50]=g,e[51]=q,e[52]=te):te=e[52];let se;e[53]!==ee||e[54]!==te?(se=t.jsxs("div",{className:"w-full sm:w-72 sm:border-r border-b sm:border-b-0 border-border flex flex-col bg-background sm:h-full max-h-[40vh] sm:max-h-full",children:[ee,te]}),e[53]=ee,e[54]=te,e[55]=se):se=e[55];let le;e[56]!==j||e[57]!==d.activeTab||e[58]!==d.selectedId||e[59]!==x||e[60]!==W||e[61]!==J||e[62]!==P||e[63]!==A||e[64]!==L||e[65]!==E?(le=t.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:j&&d.selectedId?t.jsx(Os,{currentConnection:j,activeTab:d.activeTab,selectedId:d.selectedId,formData:x,toggleTool:E,toggleResource:L,togglePrompt:A,toggleAllTools:P,toggleAllResources:J,toggleAllPrompts:W,onTabChange:b=>f({type:"SET_ACTIVE_TAB",payload:b})},d.selectedId):t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Select a connection to view its tools, resources, and prompts"})}),e[56]=j,e[57]=d.activeTab,e[58]=d.selectedId,e[59]=x,e[60]=W,e[61]=J,e[62]=P,e[63]=A,e[64]=L,e[65]=E,e[66]=le):le=e[66];let oe;e[67]!==se||e[68]!==le?(oe=t.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0 flex-col sm:flex-row",children:[se,le]}),e[67]=se,e[68]=le,e[69]=oe):oe=e[69];let ne;e[70]!==U?(ne=t.jsx(ss,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(X,{variant:"outline",onClick:()=>U(!1),children:"Done"})}),e[70]=U,e[71]=ne):ne=e[71];let re;e[72]!==oe||e[73]!==ne?(re=t.jsxs(Ye,{className:"sm:max-w-5xl h-[80vh] max-h-[80vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[oe,ne]}),e[72]=oe,e[73]=ne,e[74]=re):re=e[74];let xe;return e[75]!==U||e[76]!==s||e[77]!==re?(xe=t.jsx(Je,{open:s,onOpenChange:U,children:re}),e[75]=U,e[76]=s,e[77]=re,e[78]=xe):xe=e[78],xe}const Ls=bt.pick({title:!0,description:!0,status:!0,metadata:!0,connections:!0}).extend({title:jt().min(1,"Name is required").max(255)});function Ps(o){const e=T.c(8);let s,n;e[0]!==o?({className:s,...n}=o,e[0]=o,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let l;e[3]!==s?(l=Y("grid gap-3",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx(Qt,{"data-slot":"radio-group",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Ee(o){const e=T.c(9);let s,n;e[0]!==o?({className:s,...n}=o,e[0]=o,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let l;e[3]!==s?(l=Y("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Xt,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(Xe,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=r):r=e[5];let c;return e[6]!==n||e[7]!==l?(c=t.jsx(Zt,{"data-slot":"radio-group-item",className:l,...n,children:r}),e[6]=n,e[7]=l,e[8]=c):c=e[8],c}function zs(o){const s=new TextEncoder().encode(o),n=Array.from(s,l=>String.fromCharCode(l)).join("");return btoa(n)}function Vs(o){const e=T.c(10),{url:s}=o,[n,l]=_.useState(!1);let r;e[0]!==s?(r=async()=>{await navigator.clipboard.writeText(s),l(!0),De.success("Agent URL copied to clipboard"),setTimeout(()=>l(!1),2e3)},e[0]=s,e[1]=r):r=e[1];const c=r;let i;e[2]!==n?(i=n?t.jsx(Qe,{size:20,className:"text-green-600"}):t.jsx(cs,{size:20}),e[2]=n,e[3]=i):i=e[3];const a=n?"Copied!":"Copy URL";let m;e[4]!==a?(m=t.jsx("span",{className:"text-xs font-medium",children:a}),e[4]=a,e[5]=m):m=e[5];let u;return e[6]!==c||e[7]!==i||e[8]!==m?(u=t.jsxs(X,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[i,m]}),e[6]=c,e[7]=i,e[8]=m,e[9]=u):u=e[9],u}function Ms(o){const e=T.c(7),{url:s,serverName:n}=o;let l;e[0]!==n||e[1]!==s?(l=()=>{const m=Ze(n),d=zs(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),f=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(m)}&config=${encodeURIComponent(d)}`;window.open(f,"_blank"),De.success("Opening Cursor...")},e[0]=n,e[1]=s,e[2]=l):l=e[2];const r=l;let c,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),i=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=c,e[4]=i):(c=e[3],i=e[4]);let a;return e[5]!==r?(a=t.jsxs(X,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,i]}),e[5]=r,e[6]=a):a=e[6],a}function Fs(o){const e=T.c(11),{url:s,serverName:n}=o,[l,r]=_.useState(!1);let c;e[0]!==n||e[1]!==s?(c=async()=>{const f=Ze(n),p=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),x=`claude mcp add-json "${f}" '${p.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(x),r(!0),De.success("Claude Code command copied to clipboard"),setTimeout(()=>r(!1),2e3)},e[0]=n,e[1]=s,e[2]=c):c=e[2];const i=c;let a;e[3]!==l?(a=l?t.jsx(Qe,{size:20,className:"text-green-600"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[3]=l,e[4]=a):a=e[4];const m=l?"Copied!":"Install on Claude";let u;e[5]!==m?(u=t.jsx("span",{className:"text-xs font-medium",children:m}),e[5]=m,e[6]=u):u=e[6];let d;return e[7]!==i||e[8]!==a||e[9]!==u?(d=t.jsxs(X,{type:"button",variant:"outline",onClick:i,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[a,u]}),e[7]=i,e[8]=a,e[9]=u,e[10]=d):d=e[10],d}function Bs(o){const e=T.c(40),{open:s,onOpenChange:n,virtualMcp:l}=o,[r,c]=_.useState("code_execution");let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=P=>{(P==="passthrough"||P==="smart_tool_selection"||P==="code_execution")&&c(P)},e[0]=i):i=e[0];const a=i;let m;e[1]!==r||e[2]!==l.id?(m=new URL(`/mcp/virtual-mcp/${l.id}`,window.location.origin),m.searchParams.set("mode",r),e[1]=r,e[2]=l.id,e[3]=m):m=e[3];let u;e[4]!==l.id||e[5]!==l.title?(u=l.title||`agent-${l.id?.slice(0,8)??"default"}`,e[4]=l.id,e[5]=l.title,e[6]=u):u=e[6];const d=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ls,{children:t.jsx(os,{children:"Share Agent"})}),e[7]=f):f=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=h):h=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(kt,{className:"size-5 text-muted-foreground"})}),e[9]=p):p=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=x):x=e[10];let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(ce,{asChild:!0,children:t.jsx(Ce,{className:"size-3.5 text-muted-foreground"})}),e[11]=N):N=e[11];let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("label",{htmlFor:"mode-passthrough",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[p,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[x,t.jsx(ye,{children:t.jsxs(de,{children:[N,t.jsx(me,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"All tools are exposed directly via tools/list. Best for small tool surfaces with deterministic behavior."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Best for small teams or when you need predictable behavior"})]}),t.jsx(Ee,{id:"mode-passthrough",value:"passthrough"})]}),e[12]=j):j=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(wt,{className:"size-5 text-muted-foreground"})}),e[13]=v):v=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=g):g=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ce,{asChild:!0,children:t.jsx(Ce,{className:"size-3.5 text-muted-foreground"})}),e[15]=y):y=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs("label",{htmlFor:"mode-smart",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[v,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[g,t.jsx(ye,{children:t.jsxs(de,{children:[y,t.jsx(me,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Uses meta-tools (GATEWAY_SEARCH_TOOLS, GATEWAY_DESCRIBE_TOOLS, GATEWAY_CALL_TOOL) to keep the tool list small and request details on demand."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Ideal for large teams with many tools - AI finds what it needs"})]}),t.jsx(Ee,{id:"mode-smart",value:"smart_tool_selection"})]}),e[16]=C):C=e[16];let z;e[17]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(as,{className:"size-5 text-muted-foreground"})}),e[17]=z):z=e[17];let k;e[18]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=k):k=e[18];let O;e[19]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(ce,{asChild:!0,children:t.jsx(Ce,{className:"size-3.5 text-muted-foreground"})}),e[19]=O):O=e[19];let S;e[20]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsxs("label",{htmlFor:"mode-code",className:"relative flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[z,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[k,t.jsx(ye,{children:t.jsxs(de,{children:[O,t.jsx(me,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Exposes meta-tools for discovery + sandboxed execution (GATEWAY_RUN_CODE). Reduces overhead on large surfaces by shifting work into a controlled runtime."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Maximum flexibility - AI can write code to orchestrate tools"})]}),t.jsx(Ee,{id:"mode-code",value:"code_execution"}),t.jsx($e,{variant:"outline",className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-background z-10",children:"Recommended"})]}),e[20]=S):S=e[20];let w;e[21]!==r?(w=t.jsxs("div",{className:"flex flex-col gap-3",children:[h,t.jsxs(Ps,{value:r,onValueChange:a,className:"flex flex-col gap-4.5",children:[j,C,S]})]}),e[21]=r,e[22]=w):w=e[22];let E;e[23]!==m.href?(E=t.jsx(Vs,{url:m.href}),e[23]=m.href,e[24]=E):E=e[24];let D,L;e[25]!==d||e[26]!==m.href?(D=t.jsx(Ms,{url:m.href,serverName:d}),L=t.jsx(Fs,{url:m.href,serverName:d}),e[25]=d,e[26]=m.href,e[27]=D,e[28]=L):(D=e[27],L=e[28]);let I;e[29]!==E||e[30]!==D||e[31]!==L?(I=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[E,D,L]})}),e[29]=E,e[30]=D,e[31]=L,e[32]=I):I=e[32];let A;e[33]!==w||e[34]!==I?(A=t.jsxs(Ye,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[f,t.jsxs("div",{className:"flex flex-col gap-6",children:[w,I]})]}),e[33]=w,e[34]=I,e[35]=A):A=e[35];let $;return e[36]!==n||e[37]!==s||e[38]!==A?($=t.jsx(Je,{open:s,onOpenChange:n,children:A}),e[36]=n,e[37]=s,e[38]=A,e[39]=$):$=e[39],$}function Gs(o,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...o,shareDialogOpen:e.payload};case"SET_CONNECTION_DIALOG_OPEN":return{...o,connectionDialogOpen:e.payload};case"SET_EDITING_CONNECTION_ID":return{...o,editingConnectionId:e.payload};case"SET_SKILLS_OPEN":return{...o,skillsOpen:e.payload};default:return o}}function Ae(o){const e=T.c(3),{connection_id:s}=o,n=We(s);if(!n)return null;let l;return e[0]!==n.icon||e[1]!==n.title?(l=t.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:t.jsx(ue,{icon:n.icon,name:n.title,size:"xs"})}),e[0]=n.icon,e[1]=n.title,e[2]=l):l=e[2],l}Ae.Fallback=function(){return t.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse"})})};function Oe(o){const e=T.c(27),{connection_id:s,selected_tools:n,selected_resources:l,selected_prompts:r,onClick:c}=o,i=We(s);if(!i)return null;let a;e[0]!==n?(a=Se(n),e[0]=n,e[1]=a):a=e[1];const m=a;let u;e[2]!==l?(u=Se(l),e[2]=l,e[3]=u):u=e[3];const d=u;let f;e[4]!==r?(f=Se(r),e[4]=r,e[5]=f):f=e[5];const h=f;let p;e[6]!==i.icon||e[7]!==i.title?(p=t.jsx(ue,{icon:i.icon,name:i.title,size:"xs"}),e[6]=i.icon,e[7]=i.title,e[8]=p):p=e[8];let x;e[9]!==i.title?(x=t.jsx("p",{className:"flex-1 text-sm font-normal text-foreground truncate",children:i.title}),e[9]=i.title,e[10]=x):x=e[10];let N;e[11]!==m?(N=m!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:m==="all"?"all":m}),t.jsx(Le,{size:12})]}),e[11]=m,e[12]=N):N=e[12];let j;e[13]!==d?(j=d!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:d==="all"?"all":d}),t.jsx(be,{size:12})]}),e[13]=d,e[14]=j):j=e[14];let v;e[15]!==h?(v=h!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:h==="all"?"all":h}),t.jsx(Re,{size:12})]}),e[15]=h,e[16]=v):v=e[16];let g;e[17]!==N||e[18]!==j||e[19]!==v?(g=t.jsxs($e,{variant:"secondary",className:"bg-muted h-5 gap-2 px-1.5 py-1 flex items-center",children:[N,j,v]}),e[17]=N,e[18]=j,e[19]=v,e[20]=g):g=e[20];let y;e[21]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(qe,{size:16,className:"text-muted-foreground shrink-0"}),e[21]=y):y=e[21];let C;return e[22]!==c||e[23]!==p||e[24]!==x||e[25]!==g?(C=t.jsxs("div",{onClick:c,className:"w-full h-12 flex items-center gap-2 px-3 rounded-lg border border-border hover:bg-accent/50 transition-colors cursor-pointer",children:[p,x,g,y]}),e[22]=c,e[23]=p,e[24]=x,e[25]=g,e[26]=C):C=e[26],C}Oe.Fallback=function(){return t.jsxs("div",{className:"w-full h-12 flex items-center gap-2 px-3 rounded-lg border border-border",children:[t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse shrink-0"}),t.jsx("div",{className:"flex-1 h-4 rounded bg-muted animate-pulse"}),t.jsxs($e,{variant:"secondary",className:"bg-muted h-5 gap-2 px-1.5 py-1 flex items-center",children:[t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(Le,{size:12})]}),t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(be,{size:12})]}),t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(Re,{size:12})]})]}),t.jsx(qe,{size:16,className:"text-muted-foreground shrink-0"})]})};function Hs({virtualMcp:o}){const{org:e}=ge(),n=yt().location.href,l=Mt(),r=Ct({resolver:_t(Ls),defaultValues:o}),c=r.watch("connections"),[i,a]=_.useReducer(Gs,{shareDialogOpen:!1,connectionDialogOpen:!1,editingConnectionId:null,skillsOpen:!1}),[,m]=Rt(),{setVirtualMcpId:u}=It();_.useEffect(()=>{m(!0),u(o.id)},[o.id]);const d=()=>{u(o.id),m(!0)},f=r.formState.isDirty,h=async()=>{const g=r.getValues(),y=await l.update.mutateAsync({id:o.id,data:g});r.reset(y)},p=()=>{r.reset(o)},x=()=>{a({type:"SET_EDITING_CONNECTION_ID",payload:null}),a({type:"SET_CONNECTION_DIALOG_OPEN",payload:!0})},N=g=>{a({type:"SET_EDITING_CONNECTION_ID",payload:g}),a({type:"SET_CONNECTION_DIALOG_OPEN",payload:!0})},j=l.update.isPending,v=t.jsx(Ht,{children:t.jsxs(Ut,{children:[t.jsx(Ge,{children:t.jsx(Wt,{asChild:!0,children:t.jsx(Tt,{to:"/$org/agents",params:{org:e.slug},children:"Agents"})})}),t.jsx(qt,{}),t.jsx(Ge,{children:t.jsx(Kt,{children:o.title})})]})});return t.jsxs(Yt,{breadcrumb:v,children:[t.jsxs(Jt,{children:[t.jsx(es,{onSave:h,onUndo:p,isDirty:f,isSaving:j}),t.jsxs(de,{delayDuration:0,children:[t.jsx(ce,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsxs(X,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 border border-input",onClick:d,"aria-label":"Test Agent",children:[t.jsx(Bt,{size:14}),"Test Agent"]})})}),t.jsx(me,{side:"bottom",children:"Test this agent in chat"})]}),t.jsxs(de,{delayDuration:0,children:[t.jsx(ce,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(X,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:()=>a({type:"SET_SHARE_DIALOG_OPEN",payload:!0}),"aria-label":"Share",children:t.jsx(Gt,{size:14})})})}),t.jsx(me,{side:"bottom",children:"Share"})]}),t.jsx($t,{title:o.title,url:n,icon:o.icon??"cpu_chip"})]}),t.jsx("div",{className:"flex h-full w-full bg-background overflow-auto",children:t.jsxs("div",{className:"flex flex-col w-full",children:[t.jsxs("div",{className:"flex items-start justify-between gap-4 p-6 shrink-0",children:[t.jsxs("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[t.jsx(ue,{icon:o.icon,name:r.watch("title")||"Agent",size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(et,{})}),t.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[t.jsx(Fe,{...r.register("title"),className:"h-auto py-0.5 text-lg! font-medium leading-7 px-1 -mx-1 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Agent Name"}),t.jsx(Fe,{...r.register("description"),className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-1 -mx-1 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})]})]}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Lt,{checked:r.watch("status")==="active",onCheckedChange:g=>r.setValue("status",g?"active":"inactive",{shouldDirty:!0})})})]}),t.jsxs(Et,{open:i.skillsOpen,onOpenChange:g=>a({type:"SET_SKILLS_OPEN",payload:g}),className:"border-t border-border shrink-0 max-h-[400px] overflow-hidden flex flex-col",children:[c.length===0?t.jsxs("button",{type:"button",onClick:x,className:"w-full flex items-center justify-between px-6 py-4 hover:bg-muted/50 transition-colors cursor-pointer",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Skills"}),t.jsxs("div",{className:"h-7 px-2 inline-flex items-center justify-center gap-1 rounded-md text-sm text-muted-foreground",children:[t.jsx(Be,{size:14}),"Add"]})]}):t.jsx(At,{asChild:!0,children:t.jsxs("button",{type:"button",className:"w-full flex items-center justify-between px-6 py-4 hover:bg-muted/50 transition-colors cursor-pointer",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Skills"}),t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"flex items-center -space-x-2 ease-(--ease-out-expo)",style:{width:i.skillsOpen?0:"auto",marginRight:i.skillsOpen?0:4,opacity:i.skillsOpen?0:1,pointerEvents:i.skillsOpen?"none":"auto",transitionProperty:"all",transitionDuration:i.skillsOpen?"0ms":"200ms"},children:c.slice(0,4).map(g=>t.jsx(_.Suspense,{fallback:t.jsx(Ae.Fallback,{}),children:t.jsx(Ae,{connection_id:g.connection_id})},g.connection_id))}),t.jsxs("div",{role:"button",tabIndex:0,className:"h-7 inline-flex items-center justify-center rounded-md text-sm text-muted-foreground overflow-hidden transition-all duration-200 ease-(--ease-out-expo) hover:bg-accent hover:text-accent-foreground",style:{width:i.skillsOpen?"auto":28,paddingLeft:i.skillsOpen?8:0,paddingRight:i.skillsOpen?8:0,gap:i.skillsOpen?4:0},onPointerDown:g=>{g.stopPropagation()},onClick:g=>{g.stopPropagation(),g.preventDefault(),x()},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.stopPropagation(),g.preventDefault(),x())},children:[t.jsx(Be,{size:14,className:"shrink-0"}),t.jsx("span",{className:"overflow-hidden whitespace-nowrap transition-all duration-200 ease-(--ease-out-expo)",style:{width:i.skillsOpen?"auto":0,opacity:i.skillsOpen?1:0},children:"Add"})]}),t.jsx("div",{className:"h-7 inline-flex items-center justify-center overflow-hidden transition-all duration-200 ease-(--ease-out-expo)",style:{width:i.skillsOpen?28:0,opacity:i.skillsOpen?1:0},children:t.jsx(Ft,{size:16,className:"shrink-0"})})]})]})}),t.jsx("div",{className:"grid overflow-hidden transition-[grid-template-rows] duration-200 ease-(--ease-out-expo)",style:{gridTemplateRows:i.skillsOpen?"1fr":"0fr"},children:t.jsx("div",{className:"min-h-0 overflow-hidden",children:t.jsx("div",{className:"overflow-y-auto max-h-[300px] mask-[linear-gradient(to_bottom,black_calc(100%-40px),transparent_100%)]",children:t.jsx("div",{className:"flex flex-col gap-2 px-6 pb-4 pt-2",children:c.map(g=>t.jsx(_.Suspense,{fallback:t.jsx(Oe.Fallback,{}),children:t.jsx(Oe,{connection_id:g.connection_id,selected_tools:g.selected_tools,selected_resources:g.selected_resources,selected_prompts:g.selected_prompts,onClick:()=>N(g.connection_id)})},g.connection_id))})})})})]}),t.jsxs("div",{className:"flex flex-col flex-1 p-6 border-t border-border overflow-auto",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Instructions"}),t.jsx(St,{name:"metadata.instructions",control:r.control,render:({field:g})=>t.jsx(Pt,{...g,value:g.value??"",placeholder:"Write instructions here...",className:"min-h-[200px] resize-none text-sm placeholder:text-muted-foreground/50 leading-relaxed border-0 rounded-none shadow-none px-0 focus-visible:ring-0 focus-visible:ring-offset-0 focus:border-0 bg-transparent"})})]})]})}),t.jsx(Rs,{open:i.connectionDialogOpen,onOpenChange:g=>a({type:"SET_CONNECTION_DIALOG_OPEN",payload:g}),selectedId:i.editingConnectionId,form:r,connections:c}),t.jsx(Bs,{open:i.shareDialogOpen,onOpenChange:g=>a({type:"SET_SHARE_DIALOG_OPEN",payload:g}),virtualMcp:o})]})}function Us(){const o=T.c(6),e=vt();let s;o[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/agents/$agentId"},o[0]=s):s=o[0];const n=Nt(s),{org:l,agentId:r}=n,c=Vt(r);if(!c){let a;return o[1]!==e||o[2]!==l?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ot,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(X,{variant:"outline",onClick:()=>e({to:"/$org/agents",params:{org:l}}),children:"Back to agents"})})}),o[1]=e,o[2]=l,o[3]=a):a=o[3],a}let i;return o[4]!==c?(i=t.jsx(Hs,{virtualMcp:c}),o[4]=c,o[5]=i):i=o[5],i}function Gl(){const o=T.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(pe,{children:t.jsx(_.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ke,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Us,{})})}),o[0]=e):e=o[0],e}export{Gl as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as se,j as t,r as oe,u as re,l as ne}from"./index-yjsBu7QA.js";import{C as ie,a as ae}from"./collection-table-wrapper-igJ5OqPc.js";import{C as le}from"./collection-search-D5gi0-bL.js";import{P as j}from"./index-P_cUV9l9.js";import{B as ce,a as de,b as me,c as ge}from"./breadcrumb-BuFIEIOz.js";import{C as ue}from"./connection-card-GHfjxhQ1.js";import{E as J,I as pe}from"./empty-state-CpRLw49r.js";import{E as he}from"./error-boundary-DQ5uRgdY.js";import{u as fe,s as U}from"./use-list-state-DsM4HMGd.js";import{u as xe}from"./use-create-virtual-mcp-B01dvSQa.js";import{i as je}from"./constants-Cpe-c81c.js";import{b as Ce,a as ye}from"./use-virtual-mcp-XGRCLjSr.js";import{c as we,b as Ne,d as be,A as De,e as Se,g as ve,a as ke,f as Ae}from"./alert-dialog-BYFUia7V.js";import{B as Pe}from"./badge-D19NcG12.js";import{B as Q}from"./button-BNRw8VbO.js";import{D as X,a as Y,b as Z,c as O}from"./dropdown-menu-CsYNL9oo.js";import{i as ee}from"./DotsVertical-D1ZY49Um.js";import{i as _e}from"./Loading01-D8raUT2q.js";import{s as te}from"./Trash01-CR6s5yrj.js";import{t as C}from"./Users03-CCWN1VQn.js";import"./ArrowUp-D8YYlj5b.js";import"./Check-lN7sUZo8.js";import"./Grid01-DHptyetH.js";import"./List-Dl-Bi1Os.js";import"./view-mode-toggle-zGyN0eoT.js";import"./table-NP0FOAI5.js";import"./SearchMd-DVuLBPJW.js";import"./input-C-GM7dsu.js";import"./ChevronRight-BB2YL4K4.js";import"./card-B2_21gZH.js";import"./use-mobile-CS2zVR4m.js";import"./use-collections-Hp9XPnUY.js";import"./useMutation-VOj1VEf8.js";import"./useQuery-C5RIveiE.js";function ze(e,r){switch(r.type){case"delete":return{mode:"deleting",virtualMcp:r.virtualMcp};case"close":return{mode:"idle"}}}function Ie(){const e=se.c(65),{org:r}=re(),i=ne();let y;e[0]!==r.slug?(y={namespace:r.slug,resource:"agents"},e[0]=r.slug,e[1]=y):y=e[1];const s=fe(y),x=Ce(s);let w;e[2]===Symbol.for("react.memo_cache_sentinel")?(w={navigateOnCreate:!0},e[2]=w):w=e[2];const{createVirtualMCP:R,isCreating:N}=xe(w),T=ye();let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b={mode:"idle"},e[3]=b):b=e[3];const[n,D]=oe.useReducer(ze,b);let S;e[4]!==T||e[5]!==n.mode||e[6]!==n.virtualMcp?(S=async()=>{if(n.mode!=="deleting")return;const o=n.virtualMcp.id;if(D({type:"close"}),!(!o||je(o)))try{await T.delete.mutateAsync(o)}catch{}},e[4]=T,e[5]=n.mode,e[6]=n.virtualMcp,e[7]=S):S=e[7];const H=S;let v,k,A,P,_;e[8]===Symbol.for("react.memo_cache_sentinel")?(v={id:"icon",header:"",render:Te,cellClassName:"w-16 shrink-0",wrap:!0},k={id:"title",header:"Name",render:Re,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},A={id:"description",header:"Description",render:Oe,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},P={id:"connections",header:"Connections",render:Ve,cellClassName:"w-24 shrink-0"},_={id:"status",header:"Status",render:Ee,cellClassName:"w-24 shrink-0",sortable:!0},e[8]=v,e[9]=k,e[10]=A,e[11]=P,e[12]=_):(v=e[8],k=e[9],A=e[10],P=e[11],_=e[12]);let z;e[13]!==i||e[14]!==r.slug?(z=[v,k,A,P,_,{id:"actions",header:"",render:o=>t.jsxs(X,{children:[t.jsx(Y,{asChild:!0,children:t.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ke,children:t.jsx(ee,{size:20})})}),t.jsxs(Z,{align:"end",onClick:Be,children:[t.jsxs(O,{onClick:a=>{a.stopPropagation(),i({to:"/$org/agents/$agentId",params:{org:r.slug,agentId:o.id}})},children:[t.jsx(U,{size:16}),"Open"]}),t.jsxs(O,{variant:"destructive",onClick:a=>{a.stopPropagation(),D({type:"delete",virtualMcp:o})},children:[t.jsx(te,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[13]=i,e[14]=r.slug,e[15]=z):z=e[15];const L=z,F=N?"Creating...":"Create Agent";let I;e[16]!==R||e[17]!==N||e[18]!==F?(I=t.jsx(Q,{onClick:R,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:N,children:F}),e[16]=R,e[17]=N,e[18]=F,e[19]=I):I=e[19];const W=I,q=n.mode==="deleting";let M;e[20]===Symbol.for("react.memo_cache_sentinel")?(M=o=>!o&&D({type:"close"}),e[20]=M):M=e[20];let $;e[21]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(we,{children:"Delete Agent?"}),e[21]=$):$=e[21];const G=n.mode==="deleting"&&n.virtualMcp.title;let l;e[22]!==G?(l=t.jsxs(Ne,{children:[$,t.jsxs(be,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:G}),"."]})]}),e[22]=G,e[23]=l):l=e[23];let B;e[24]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(De,{children:"Cancel"}),e[24]=B):B=e[24];let c;e[25]!==H?(c=t.jsxs(Se,{children:[B,t.jsx(ve,{onClick:H,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[25]=H,e[26]=c):c=e[26];let d;e[27]!==l||e[28]!==c?(d=t.jsxs(ke,{children:[l,c]}),e[27]=l,e[28]=c,e[29]=d):d=e[29];let m;e[30]!==q||e[31]!==d?(m=t.jsx(Ae,{open:q,onOpenChange:M,children:d}),e[30]=q,e[31]=d,e[32]=m):m=e[32];let K;e[33]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(j.Header.Left,{children:t.jsx(ce,{children:t.jsx(de,{children:t.jsx(me,{children:t.jsx(ge,{children:"Agents"})})})})}),e[33]=K):K=e[33];let E;e[34]===Symbol.for("react.memo_cache_sentinel")?(E=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[34]=E):E=e[34];let g;e[35]!==s.handleSort||e[36]!==s.setViewMode||e[37]!==s.sortDirection||e[38]!==s.sortKey||e[39]!==s.viewMode?(g=t.jsx(ie,{viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:E}),e[35]=s.handleSort,e[36]=s.setViewMode,e[37]=s.sortDirection,e[38]=s.sortKey,e[39]=s.viewMode,e[40]=g):g=e[40];let u;e[41]!==W||e[42]!==g?(u=t.jsxs(j.Header,{children:[K,t.jsxs(j.Header.Right,{children:[g,W]})]}),e[41]=W,e[42]=g,e[43]=u):u=e[43];let p;e[44]!==s?(p=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[44]=s,e[45]=p):p=e[45];let h;e[46]!==s.search||e[47]!==s.setSearch||e[48]!==p?(h=t.jsx(le,{value:s.search,onChange:s.setSearch,placeholder:"Search for an agent...",onKeyDown:p}),e[46]=s.search,e[47]=s.setSearch,e[48]=p,e[49]=h):h=e[49];let f;e[50]!==L||e[51]!==s.handleSort||e[52]!==s.search||e[53]!==s.sortDirection||e[54]!==s.sortKey||e[55]!==s.viewMode||e[56]!==i||e[57]!==r.slug||e[58]!==x?(f=t.jsx(j.Content,{children:s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:x.length===0?t.jsx(J,{image:t.jsx(C,{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(ue,{connection:{id:o.id??"",title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(C,{}),onClick:()=>i({to:"/$org/agents/$agentId",params:{org:r.slug,agentId:o.id}}),footer:t.jsx("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":""]})}),headerActions:t.jsxs(X,{children:[t.jsx(Y,{asChild:!0,children:t.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:$e,children:t.jsx(ee,{size:20})})}),t.jsxs(Z,{align:"end",onClick:Me,children:[t.jsxs(O,{onClick:a=>{a.stopPropagation(),i({to:"/$org/agents/$agentId",params:{org:r.slug,agentId:o.id}})},children:[t.jsx(U,{size:16}),"Open"]}),t.jsxs(O,{variant:"destructive",onClick:a=>{a.stopPropagation(),D({type:"delete",virtualMcp:o})},children:[t.jsx(te,{size:16}),"Delete"]})]})]})},o.id??"default"))})}):t.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:t.jsx(ae,{columns:L,data:x,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>i({to:"/$org/agents/$agentId",params:{org:r.slug,agentId:o.id}}),emptyState:s.search?t.jsx(J,{image:t.jsx(C,{size:36,className:"text-muted-foreground"}),title:"No agents found",description:`No agents match "${s.search}"`}):t.jsx(J,{image:t.jsx(C,{size:36,className:"text-muted-foreground"}),title:"No agents yet",description:"Create an agent to aggregate tools from multiple Connections."})})})}),e[50]=L,e[51]=s.handleSort,e[52]=s.search,e[53]=s.sortDirection,e[54]=s.sortKey,e[55]=s.viewMode,e[56]=i,e[57]=r.slug,e[58]=x,e[59]=f):f=e[59];let V;return e[60]!==m||e[61]!==u||e[62]!==h||e[63]!==f?(V=t.jsxs(j,{children:[m,u,h,f]}),e[60]=m,e[61]=u,e[62]=h,e[63]=f,e[64]=V):V=e[64],V}function Me(e){return e.stopPropagation()}function $e(e){return e.stopPropagation()}function Be(e){return e.stopPropagation()}function Ke(e){return e.stopPropagation()}function Ee(e){return t.jsx(Pe,{variant:e.status==="active"?"default":"outline",children:e.status})}function Ve(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function Oe(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Re(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Te(e){return t.jsx(pe,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(C,{size:16})})}function Nt(){const e=se.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(he,{children:t.jsx(oe.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(_e,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ie,{})})}),e[0]=r):r=e[0],r}export{Nt as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{r as i,al as m,j as r,aJ as T,z as w,an as O,G as A,R as M,T as I,D as z,B as F,aK as D,aL as L,aq as G,F as k,E as q,c as n}from"./index-yjsBu7QA.js";import{c as p,b as v}from"./button-BNRw8VbO.js";var x="AlertDialog",[B]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(M,{...a,...t,modal:!0})};N.displayName=x;var H="AlertDialogTrigger",V=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(k,{...o,...a,ref:e})});V.displayName=H;var W="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};y.displayName=W;var Y="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(q,{...o,...a,ref:e})});_.displayName=Y;var f="AlertDialogContent",[J,K]=B(f),Q=L("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(T,{contentName:f,titleName:b,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(w,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:O(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});j.displayName=f;var b="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(I,{...o,...a,ref:e})});h.displayName=b;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(z,{...o,...a,ref:e})});R.displayName=E;var U="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
|
|
2
|
-
|
|
3
|
-
You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
|
-
|
|
5
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${f}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
6
|
-
|
|
7
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return i.useEffect(()=>{document.getElementById(l.current?.getAttribute("aria-describedby"))||console.warn(e)},[e,l]),null},Z=N,ee=y,te=_,ae=j,oe=C,le=S,se=h,re=R;function pe(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=r.jsx(Z,{"data-slot":"alert-dialog",...t}),e[2]=t,e[3]=a):a=e[3],a}function ie(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=r.jsx(ee,{"data-slot":"alert-dialog-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function ne(l){const e=n.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=p("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]=o):o=e[4];let s;return e[5]!==a||e[6]!==o?(s=r.jsx(te,{"data-slot":"alert-dialog-overlay",className:o,...a}),e[5]=a,e[6]=o,e[7]=s):s=e[7],s}function fe(l){const e=n.c(9);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(ne,{}),e[3]=o):o=e[3];let s;e[4]!==t?(s=p("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-lg duration-200 sm:max-w-lg",t),e[4]=t,e[5]=s):s=e[5];let c;return e[6]!==a||e[7]!==s?(c=r.jsxs(ie,{children:[o,r.jsx(ae,{"data-slot":"alert-dialog-content",className:s,...a})]}),e[6]=a,e[7]=s,e[8]=c):c=e[8],c}function ge(l){const e=n.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=p("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=o):o=e[4];let s;return e[5]!==a||e[6]!==o?(s=r.jsx("div",{"data-slot":"alert-dialog-header",className:o,...a}),e[5]=a,e[6]=o,e[7]=s):s=e[7],s}function ue(l){const e=n.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=p("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=o):o=e[4];let s;return e[5]!==a||e[6]!==o?(s=r.jsx("div",{"data-slot":"alert-dialog-footer",className:o,...a}),e[5]=a,e[6]=o,e[7]=s):s=e[7],s}function me(l){const e=n.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=p("text-lg font-semibold",t),e[3]=t,e[4]=o):o=e[4];let s;return e[5]!==a||e[6]!==o?(s=r.jsx(se,{"data-slot":"alert-dialog-title",className:o,...a}),e[5]=a,e[6]=o,e[7]=s):s=e[7],s}function Ae(l){const e=n.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=p("text-muted-foreground text-sm",t),e[3]=t,e[4]=o):o=e[4];let s;return e[5]!==a||e[6]!==o?(s=r.jsx(re,{"data-slot":"alert-dialog-description",className:o,...a}),e[5]=a,e[6]=o,e[7]=s):s=e[7],s}function De(l){const e=n.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=p(v(),t),e[3]=t,e[4]=o):o=e[4];let s;return e[5]!==a||e[6]!==o?(s=r.jsx(oe,{className:o,...a}),e[5]=a,e[6]=o,e[7]=s):s=e[7],s}function ve(l){const e=n.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=p(v({variant:"outline"}),t),e[3]=t,e[4]=o):o=e[4];let s;return e[5]!==a||e[6]!==o?(s=r.jsx(le,{className:o,...a}),e[5]=a,e[6]=o,e[7]=s):s=e[7],s}export{ve as A,fe as a,ge as b,me as c,Ae as d,ue as e,pe as f,De as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as I,c as j,j as i,y as S,aG as $,aH as L,aI as M}from"./index-yjsBu7QA.js";import{c as f}from"./button-BNRw8VbO.js";const V=({size:a=24,color:e="currentColor",...s})=>I.createElement("svg",{viewBox:"0 0 24 24",width:a,height:a,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},I.createElement("path",{d:"M20 21c0-1.396 0-2.093-.172-2.661a4 4 0 0 0-2.667-2.667c-.568-.172-1.265-.172-2.661-.172h-5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C4 18.907 4 19.604 4 21M16.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));V.displayName="User01";function O(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx(M,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}function T(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx($,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}function W(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx(L,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}const R=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],_="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function B(a){let e=0;for(let t=0;t<a.length;t++)e=a.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%R.length;return R[s]}const U=S("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-xs font-semibold","2xs":"w-4 h-4 text-xs font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),D=S("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),G=a=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[a]||e.base};function H(a){const e=j.c(35);let s,t,o,r,n,d,g,l;e[0]!==a?({url:l,fallback:t,shape:r,size:n,objectFit:d,className:s,muted:g,...o}=a,e[0]=a,e[1]=s,e[2]=t,e[3]=o,e[4]=r,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],r=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=r===void 0?"square":r,h=n===void 0?"base":n,u=d===void 0?"cover":d,k=g===void 0?!1:g,[m,x]=I.useState(!1);let F;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],F=c;break e}F=t}const C=F;let y;e:{if(k){y=_;break e}if(typeof t=="string"){let c;e[11]!==t?(c=B(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=R[0]}const z=y;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const E=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=f(U({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==C||e[24]!==E||e[25]!==m||e[26]!==p||e[27]!==u||e[28]!==h||e[29]!==l?(v=p&&E?i.jsx("div",{className:f("flex items-center justify-center w-full h-full",z),children:i.jsx(V,{size:G(h)})}):i.jsxs(i.Fragment,{children:[l&&!m&&i.jsx(T,{src:l,loading:"lazy",alt:"Avatar",className:f(D({objectFit:u})),onError:()=>x(!0)}),(!l||m)&&i.jsx(W,{className:f(z,"rounded-none"),children:C})]}),e[22]=z,e[23]=C,e[24]=E,e[25]=m,e[26]=p,e[27]=u,e[28]=h,e[29]=l,e[30]=v):v=e[30];let A;return e[31]!==o||e[32]!==v||e[33]!==w?(A=i.jsx(O,{className:w,...o,children:v}),e[31]=o,e[32]=v,e[33]=w,e[34]=A):A=e[34],A}function Z(a){const e=j.c(18);let s,t,o,r,n,d,g,l;e[0]!==a?({shape:r,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=a,e[0]=a,e[1]=s,e[2]=t,e[3]=o,e[4]=r,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],r=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=r===void 0?"square":r,h=n===void 0?"base":n,u=d===void 0?"cover":d,k=g===void 0?!1:g,m=h??"base";let x;return e[9]!==s||e[10]!==t||e[11]!==k||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==m||e[16]!==l?(x=i.jsx(H,{shape:b,url:l,fallback:t,size:m,objectFit:u,className:s,muted:k,...o}),e[9]=s,e[10]=t,e[11]=k,e[12]=u,e[13]=o,e[14]=b,e[15]=m,e[16]=l,e[17]=x):x=e[17],x}Z.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:f(U({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{Z as A};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as d,j as u,H as l,y as v}from"./index-yjsBu7QA.js";import{c as g}from"./button-BNRw8VbO.js";const f=v("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function m(o){const e=d.c(12);let r,s,a,t;e[0]!==o?({className:r,variant:t,asChild:a,...s}=o,e[0]=o,e[1]=r,e[2]=s,e[3]=a,e[4]=t):(r=e[1],s=e[2],a=e[3],t=e[4]);const c=(a===void 0?!1:a)?l:"span";let i;e[5]!==r||e[6]!==t?(i=g(f({variant:t}),r),e[5]=r,e[6]=t,e[7]=i):i=e[7];let n;return e[8]!==c||e[9]!==s||e[10]!==i?(n=u.jsx(c,{"data-slot":"badge",className:i,...s}),e[8]=c,e[9]=s,e[10]=i,e[11]=n):n=e[11],n}export{m as B};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ne,j as t,u as Ve,K as rt,l as at,b6 as ct,g as dt,r as mt,v as ft}from"./index-yjsBu7QA.js";import{g as Ue}from"./generate-id-Dyweu44Y.js";import{a as ut,C as qe}from"./collection-table-wrapper-igJ5OqPc.js";import{C as pt}from"./collection-search-D5gi0-bL.js";import{C as ht}from"./card-B2_21gZH.js";import{I as Ge,E as xt}from"./empty-state-CpRLw49r.js";import{D as We,a as He,b as Je,c as F}from"./dropdown-menu-CsYNL9oo.js";import{B as ke,c as Oe}from"./button-BNRw8VbO.js";import{a as Qe}from"./Copy01-daHVbD8K.js";import{i as Ye}from"./DotsVertical-D1ZY49Um.js";import{i as Xe}from"./Edit01-C_JM_ANM.js";import{s as Ze,u as gt}from"./use-list-state-DsM4HMGd.js";import{s as et}from"./Trash01-CR6s5yrj.js";import{E as Le}from"./empty-state-Cn1CRUZO.js";import{n as Be}from"./Inbox01-BTvTBHN2.js";import{A as Me}from"./avatar-B6WhQiHI.js";import{u as jt}from"./useQuery-C5RIveiE.js";import{a as Ct,u as tt}from"./constants-Cpe-c81c.js";import{P as vt}from"./pin-to-sidebar-button-qPJJKT8U.js";import{u as bt,b as yt}from"./use-collections-Hp9XPnUY.js";import{u as Nt}from"./use-connection-Dj100t8H.js";import{B as wt}from"./constants-gYpJq1UH.js";import{A as St,g as _t,c as Dt,b as At,d as It,e as Pt,a as Tt,f as $t}from"./alert-dialog-BYFUia7V.js";import{s as Et}from"./Plus-BcqTpnxy.js";import{V as zt}from"./layout-D8G7uVC8.js";function Ot(n,e){const s=n.properties||{};for(const o in s){const l=s[o];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&o in e&&e[o])return e[o]}const c=["image","img","avatar","icon","logo","thumbnail","cover"];for(const o of c)if(e&&typeof e=="object"&&o in e&&typeof e[o]=="string")return e[o]}function Mt(n){const e=ne.c(25),{item:s,schema:c,actions:o}=n;let l;e[0]!==s||e[1]!==c?(l=Ot(c,s),e[0]=s,e[1]=c,e[2]=l):l=e[2];const r=l,d=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==o?(f=o&&Object.keys(o).length>0,e[3]=o,e[4]=f):f=e[4];const i=f;let u;e[5]!==r||e[6]!==s.title?(u=t.jsx(Ge,{icon:r,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=r,e[6]=s.title,e[7]=u):u=e[7];let g;e[8]!==s.title?(g=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=g):g=e[9];const h=d||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==g||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[g,m]}),e[12]=g,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let v;e[18]!==o||e[19]!==i||e[20]!==s?(v=i&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Ut,onMouseDown:Kt,children:t.jsxs(We,{children:[t.jsx(He,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ft,children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:kt,children:[o.open&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.open?.(s)},children:[t.jsx(Ze,{size:16}),"Open"]}),o.edit&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.edit?.(s)},children:[t.jsx(Xe,{size:16}),"Edit"]}),o.duplicate&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.duplicate?.(s)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),o.delete&&t.jsxs(F,{variant:"destructive",onClick:p=>{p.stopPropagation(),o.delete?.(s)},children:[t.jsx(et,{size:16}),"Delete"]})]})]})}),e[18]=o,e[19]=i,e[20]=s,e[21]=v):v=e[21];let N;return e[22]!==y||e[23]!==v?(N=t.jsxs(ht,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,v]}),e[22]=y,e[23]=v,e[24]=N):N=e[24],N}function kt(n){return n.stopPropagation()}function Ft(n){return n.stopPropagation()}function Kt(n){return n.stopPropagation()}function Ut(n){return n.stopPropagation()}function Lt(n){const e=ne.c(11),{org:s}=Ve();let c;e[0]!==s.id?(c={connectionId:Ct,orgId:s.id},e[0]=s.id,e[1]=c):c=e[1];const o=tt(c);let l;e[2]!==n?(l=rt.user(n),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==o||e[5]!==n?(r=async()=>{const i=await o.callTool({name:"USER_GET",arguments:{id:n}});return(i.structuredContent??i).user},e[4]=o,e[5]=n,e[6]=r):r=e[6];const d=!!n;let f;return e[7]!==l||e[8]!==r||e[9]!==d?(f={queryKey:l,queryFn:r,staleTime:3e5,retry:1,enabled:d},e[7]=l,e[8]=r,e[9]=d,e[10]=f):f=e[10],jt(f)}function Bt(n){const e=ne.c(39),{id:s,size:c,showEmail:o,className:l}=n,r=c===void 0?"xs":c,d=o===void 0?!1:o,{data:f,isLoading:i,isError:u}=Lt(s);if(i){let p;e[0]!==l?(p=Oe("flex items-center gap-2",l),e[0]=l,e[1]=p):p=e[1];let a;e[2]!==r?(a=t.jsx(Me.Skeleton,{shape:"circle",size:r}),e[2]=r,e[3]=a):a=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[4]=b):b=e[4];let j;e[5]!==d?(j=d&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[5]=d,e[6]=j):j=e[6];let C;e[7]!==j?(C=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,j]}),e[7]=j,e[8]=C):C=e[8];let _;return e[9]!==p||e[10]!==a||e[11]!==C?(_=t.jsxs("div",{className:p,children:[a,C]}),e[9]=p,e[10]=a,e[11]=C,e[12]=_):_=e[12],_}if(u||!f){let p;e[13]!==l?(p=Oe("flex items-center gap-2",l),e[13]=l,e[14]=p):p=e[14];let a;e[15]!==r?(a=t.jsx(Me,{shape:"circle",size:r,fallback:"?",muted:!0}),e[15]=r,e[16]=a):a=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[17]=b):b=e[17];let j;return e[18]!==p||e[19]!==a?(j=t.jsxs("div",{className:p,children:[a,b]}),e[18]=p,e[19]=a,e[20]=j):j=e[20],j}let g;e[21]!==l?(g=Oe("flex items-center gap-2",l),e[21]=l,e[22]=g):g=e[22];const h=f.image??void 0;let m;e[23]!==r||e[24]!==h||e[25]!==f.name?(m=t.jsx(Me,{shape:"circle",size:r,url:h,fallback:f.name}),e[23]=r,e[24]=h,e[25]=f.name,e[26]=m):m=e[26];let x;e[27]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[27]=f.name,e[28]=x):x=e[28];let y;e[29]!==d||e[30]!==f.email?(y=d&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[29]=d,e[30]=f.email,e[31]=y):y=e[31];let v;e[32]!==x||e[33]!==y?(v=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[32]=x,e[33]=y,e[34]=v):v=e[34];let N;return e[35]!==g||e[36]!==m||e[37]!==v?(N=t.jsxs("div",{className:g,children:[m,v]}),e[35]=g,e[36]=m,e[37]=v,e[38]=N):N=e[38],N}const Rt=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Vt(n){return Object.keys(n).find(e=>Rt.includes(e.toLowerCase()))}function st(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function qt(n){const e=ne.c(32),{data:s,schema:c,viewMode:o,onViewModeChange:l,search:r,sortKey:d,sortDirection:f,onSort:i,actions:u,onItemClick:g,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:v,sortableFields:N}=n,p=l===void 0?Qt:l,a=f===void 0?"asc":f,b=i===void 0?Jt:i;let j;e[0]!==u?(j=u===void 0?{}:u,e[0]=u,e[1]=j):j=e[1];const C=j,_=g===void 0?Ht:g,D=h===void 0?null:h,P=m===void 0?null:m,E=x===void 0?!1:x,A=y===void 0?void 0:y,I=v===void 0?!1:v,S=N===void 0?void 0:N;let M;e[2]!==A||e[3]!==c||e[4]!==S?(M=A?A.filter(Wt).filter(O=>!S||S.includes(O.id)).map(Gt):st(c,S),e[2]=A,e[3]=c,e[4]=S,e[5]=M):M=e[5];const k=M;let z;e[6]!==D||e[7]!==I||e[8]!==b||e[9]!==p||e[10]!==a||e[11]!==d||e[12]!==k||e[13]!==o?(z=!I&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:D}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(qe,{viewMode:o,onViewModeChange:p,sortKey:d,sortDirection:a,onSort:b,sortOptions:k})})]})}),e[6]=D,e[7]=I,e[8]=b,e[9]=p,e[10]=a,e[11]=d,e[12]=k,e[13]=o,e[14]=z):z=e[14];let T;e[15]!==C||e[16]!==A||e[17]!==s||e[18]!==P||e[19]!==_||e[20]!==b||e[21]!==E||e[22]!==c||e[23]!==r||e[24]!==a||e[25]!==d||e[26]!==S||e[27]!==o?(T=o==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(O=>t.jsx("div",{onClick:()=>_?.(O),className:"cursor-pointer h-full",children:t.jsx(Mt,{item:O,schema:c,readOnly:E,actions:C})},O.id))})}):t.jsx(ut,{columns:Zt(A,c,S,C),data:s,sortKey:d,sortDirection:a,onSort:b,onRowClick:_,emptyState:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}),e[15]=C,e[16]=A,e[17]=s,e[18]=P,e[19]=_,e[20]=b,e[21]=E,e[22]=c,e[23]=r,e[24]=a,e[25]=d,e[26]=S,e[27]=o,e[28]=T):T=e[28];let $;return e[29]!==z||e[30]!==T?($=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[z,T]}),e[29]=z,e[30]=T,e[31]=$):$=e[31],$}function Gt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Wt(n){return n.sortable!==!1}function Ht(){}function Jt(){}function Qt(){}function Yt(n){return{id:"actions",header:"",render:e=>t.jsxs(We,{children:[t.jsx(He,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ze,{size:16}),"Open"]}),n.edit&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Xe,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(F,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(et,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function it(n){const e=n.type;return Array.isArray(e)?e.every(s=>it({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Xt(n,e){const s=n.properties||{},c=Object.keys(s).filter(i=>{const u=s[i];return u&&it(u)}),o=Vt(s),l=[],r=new Set;o&&c.includes(o)&&(l.push(o),r.add(o));const d=["title","description","updated_at","updated_by"];for(const i of d)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));const f=c.filter(i=>!r.has(i)&&!Re.includes(i)).sort((i,u)=>i.localeCompare(u));for(const i of f)l.push(i),r.add(i);for(const i of Re)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));return l.map(i=>{const u=s[i],g=e?e.includes(i):!["id"].includes(i);return i===o?{id:i,header:"",render:h=>{const m=h[i];return t.jsx(Ge,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:i==="description"?{id:i,header:"Description",render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:g,cellClassName:"max-w-[50ch]"}:i==="created_by"||i==="updated_by"?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx(Bt,{id:String(m),size:"xs"}):"—"},sortable:g,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||i.endsWith("_at")?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:g,cellClassName:"max-w-[200px]"}})}function Zt(n,e,s,c){const o=n||Xt(e,s);return o.some(d=>d.id==="actions")?o:Object.keys(c).length>0?[...o,Yt(c)]:o}function _s(n){const e=ne.c(118),{connectionId:s,org:c,activeCollection:o}=n,l=o.name,r=o.schema??wt,d=o.hasCreateTool,f=o.hasUpdateTool,i=o.hasDeleteTool,u=at(),h=ct().location.href,{data:m}=dt.useSession(),x=m?.user?.id||"unknown",y=Nt(s),{org:v}=Ve();let N;e[0]!==s||e[1]!==v.id?(N={connectionId:s,orgId:v.id},e[0]=s,e[1]=v.id,e[2]=N):N=e[2];const p=tt(N),a=bt(s,l,p),b=`${s}-${l}`;let j;e[3]!==c||e[4]!==b?(j={namespace:c,resource:b,defaultSortKey:"updated_at"},e[3]=c,e[4]=b,e[5]=j):j=e[5];const{search:C,searchTerm:_,setSearch:D,viewMode:P,setViewMode:E,sortKey:A,sortDirection:I,handleSort:S}=gt(j);let M;e[6]!==_||e[7]!==I||e[8]!==A?(M={searchTerm:_,sortKey:A,sortDirection:I},e[6]=_,e[7]=I,e[8]=A,e[9]=M):M=e[9];const k=yt(s,l,p,M),z=!d&&!f&&!i;let T;e[10]!==l||e[11]!==s||e[12]!==u||e[13]!==c?(T=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:w.id}})},e[10]=l,e[11]=s,e[12]=u,e[13]=c,e[14]=T):T=e[14];const $=T;let O;e[15]!==a.create||e[16]!==x?(O=async w=>{const he=new Date().toISOString();await a.create.mutateAsync({...w,id:Ue("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[15]=a.create,e[16]=x,e[17]=O):O=e[17];const xe=O,[K,ge]=mt.useState(null);let le;e[18]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{ge(w)},e[18]=le):le=e[18];const ot=le;let U;e[19]!==$||e[20]!==f?(U=f&&{edit:$},e[19]=$,e[20]=f,e[21]=U):U=e[21];let L;e[22]!==xe||e[23]!==d?(L=d&&{duplicate:xe},e[22]=xe,e[23]=d,e[24]=L):L=e[24];let B;e[25]!==i?(B=i&&{delete:ot},e[25]=i,e[26]=B):B=e[26];let re;e[27]!==B||e[28]!==U||e[29]!==L?(re={...U,...L,...B},e[27]=B,e[28]=U,e[29]=L,e[30]=re):re=e[30];const je=re;let ae;e[31]!==a.delete||e[32]!==K?(ae=async()=>{K&&(await a.delete.mutateAsync(K.id),ge(null))},e[31]=a.delete,e[32]=K,e[33]=ae):ae=e[33];const Ce=ae;let ce;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==d||e[38]!==u||e[39]!==c||e[40]!==x?(ce=async()=>{if(!d){ft.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Ue("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const ze=await a.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:ze.id}})}catch(ze){console.error("Failed to create item:",ze)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=d,e[38]=u,e[39]=c,e[40]=x,e[41]=ce):ce=e[41];const ve=ce;let de;e[42]!==r?(de=st(r),e[42]=r,e[43]=de):de=e[43];const be=de,Fe=(k?.length??0)>0,nt=d&&Fe,lt=d&&!Fe&&!C;let me;e[44]!==a.create||e[45]!==ve||e[46]!==d?(me=d?t.jsxs(ke,{onClick:ve,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=ve,e[46]=d,e[47]=me):me=e[47];const Ke=me,ye=A;let R;e[48]!==S||e[49]!==E||e[50]!==I||e[51]!==be||e[52]!==ye||e[53]!==P?(R=t.jsx(qe,{viewMode:P,onViewModeChange:E,sortKey:ye,sortDirection:I,onSort:S,sortOptions:be}),e[48]=S,e[49]=E,e[50]=I,e[51]=be,e[52]=ye,e[53]=P,e[54]=R):R=e[54];const Ne=`${l}s`,we=y?.icon??"grid_view";let V;e[55]!==Ne||e[56]!==we||e[57]!==h?(V=t.jsx(vt,{title:Ne,url:h,icon:we}),e[55]=Ne,e[56]=we,e[57]=h,e[58]=V):V=e[58];const Se=nt&&Ke;let q;e[59]!==R||e[60]!==V||e[61]!==Se?(q=t.jsxs(zt,{children:[R,V,Se]}),e[59]=R,e[60]=V,e[61]=Se,e[62]=q):q=e[62];const _e=`Search ${l}...`;let G;e[63]!==D?(G=w=>{w.key==="Escape"&&(D(""),w.target.blur())},e[63]=D,e[64]=G):G=e[64];let W;e[65]!==C||e[66]!==D||e[67]!==_e||e[68]!==G?(W=t.jsx(pt,{value:C,onChange:D,placeholder:_e,onKeyDown:G}),e[65]=C,e[66]=D,e[67]=_e,e[68]=G,e[69]=W):W=e[69];let H;e[70]!==k?(H=k??[],e[70]=k,e[71]=H):H=e[71];const De=A;let J;e[72]!==$?(J=w=>$(w),e[72]=$,e[73]=J):J=e[73];const Ae="No items found",Ie=C?"Try adjusting your search terms":"This collection doesn't have any items yet.",Pe=lt?Ke:void 0;let Q;e[74]!==Ae||e[75]!==Ie||e[76]!==Pe?(Q=t.jsx(xt,{image:null,title:Ae,description:Ie,actions:Pe}),e[74]=Ae,e[75]=Ie,e[76]=Pe,e[77]=Q):Q=e[77];let Y;e[78]!==S||e[79]!==z||e[80]!==je||e[81]!==r||e[82]!==C||e[83]!==D||e[84]!==E||e[85]!==I||e[86]!==H||e[87]!==De||e[88]!==J||e[89]!==Q||e[90]!==P?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(qt,{hideToolbar:!0,data:H,schema:r,viewMode:P,onViewModeChange:E,search:C,onSearchChange:D,sortKey:De,sortDirection:I,onSort:S,actions:je,onItemClick:J,readOnly:z,emptyState:Q})}),e[78]=S,e[79]=z,e[80]=je,e[81]=r,e[82]=C,e[83]=D,e[84]=E,e[85]=I,e[86]=H,e[87]=De,e[88]=J,e[89]=Q,e[90]=P,e[91]=Y):Y=e[91];let X;e[92]!==W||e[93]!==Y?(X=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[W,Y]}),e[92]=W,e[93]=Y,e[94]=X):X=e[94];const Te=!!K;let fe;e[95]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||ge(null)},e[95]=fe):fe=e[95];let ue;e[96]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Dt,{children:"Delete item?"}),e[96]=ue):ue=e[96];const $e=K?.title;let Z;e[97]!==$e?(Z=t.jsxs(At,{children:[ue,t.jsxs(It,{children:['Are you sure you want to delete "',$e,'"? This action cannot be undone.']})]}),e[97]=$e,e[98]=Z):Z=e[98];let ee;e[99]!==a.delete.isPending?(ee=t.jsx(St,{disabled:a.delete.isPending,children:"Cancel"}),e[99]=a.delete.isPending,e[100]=ee):ee=e[100];const Ee=a.delete.isPending?"Deleting...":"Delete";let te;e[101]!==a.delete.isPending||e[102]!==Ce||e[103]!==Ee?(te=t.jsx(_t,{onClick:Ce,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee}),e[101]=a.delete.isPending,e[102]=Ce,e[103]=Ee,e[104]=te):te=e[104];let se;e[105]!==ee||e[106]!==te?(se=t.jsxs(Pt,{children:[ee,te]}),e[105]=ee,e[106]=te,e[107]=se):se=e[107];let ie;e[108]!==Z||e[109]!==se?(ie=t.jsxs(Tt,{children:[Z,se]}),e[108]=Z,e[109]=se,e[110]=ie):ie=e[110];let oe;e[111]!==Te||e[112]!==ie?(oe=t.jsx($t,{open:Te,onOpenChange:fe,children:ie}),e[111]=Te,e[112]=ie,e[113]=oe):oe=e[113];let pe;return e[114]!==q||e[115]!==X||e[116]!==oe?(pe=t.jsxs(t.Fragment,{children:[q,X,oe]}),e[114]=q,e[115]=X,e[116]=oe,e[117]=pe):pe=e[117],pe}export{_s as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as k,c as T,j as t}from"./index-yjsBu7QA.js";import{c as y,B as L}from"./button-BNRw8VbO.js";import{c as E,a as V,D as B,b as $}from"./dropdown-menu-CsYNL9oo.js";import{i as D}from"./ArrowUp-D8YYlj5b.js";import{i as R}from"./Check-lN7sUZo8.js";import{c as H}from"./Grid01-DHptyetH.js";import{i as W}from"./List-Dl-Bi1Os.js";import{b as I,c as K,T as _,a as A}from"./empty-state-CpRLw49r.js";import{V as O}from"./view-mode-toggle-zGyN0eoT.js";import{T as P,a as q,b as z,c as F,d as G,e as J}from"./table-NP0FOAI5.js";const S=({size:p=24,color:e="currentColor",...s})=>k.createElement("svg",{viewBox:"0 0 24 24",width:p,height:p,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},k.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));S.displayName="ArrowDown";const M=({size:p=24,color:e="currentColor",...s})=>k.createElement("svg",{viewBox:"0 0 24 24",width:p,height:p,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},k.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));M.displayName="Sliders01";function ie(p){const e=T.c(16),{viewMode:s,onViewModeChange:x,sortKey:u,sortDirection:d,onSort:a,sortOptions:i}=p;let l;e[0]!==i?(l=i===void 0?[]:i,e[0]=i,e[1]=l):l=e[1];const m=l;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(I,{children:t.jsxs(K,{children:[t.jsx(_,{asChild:!0,children:t.jsx(V,{asChild:!0,children:t.jsx(L,{variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(M,{size:16})})})}),t.jsx(A,{children:"Search filters"})]})}),e[2]=h):h=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c={value:"table",icon:t.jsx(W,{})},e[3]=c):c=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=[c,{value:"cards",icon:t.jsx(H,{})}],e[4]=r):r=e[4];let o;e[5]!==x||e[6]!==s?(o=t.jsx("div",{className:"p-2 border-b border-border",children:t.jsx(O,{value:s,onValueChange:x,fullWidth:!0,options:r})}),e[5]=x,e[6]=s,e[7]=o):o=e[7];let f;e[8]!==a||e[9]!==d||e[10]!==u||e[11]!==m?(f=m.length>0&&a&&t.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[t.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),m.map(j=>{const w=u===j.id;return t.jsx(E,{onClick:()=>a(j.id),className:y("h-8 px-2 py-0 cursor-pointer",w&&"bg-accent"),children:t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[w&&t.jsx(R,{size:16,className:"text-foreground shrink-0"}),!w&&t.jsx("div",{className:"w-4 shrink-0"}),t.jsx("span",{className:"text-sm text-foreground flex-1",children:j.label}),w&&d&&(d==="asc"?t.jsx(D,{size:16,className:"text-foreground shrink-0"}):t.jsx(S,{size:16,className:"text-foreground shrink-0"}))]})},j.id)})]}),e[8]=a,e[9]=d,e[10]=u,e[11]=m,e[12]=f):f=e[12];let g;return e[13]!==o||e[14]!==f?(g=t.jsxs(B,{children:[h,t.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[o,f]})]}),e[13]=o,e[14]=f,e[15]=g):g=e[15],g}function Q(p){const e=T.c(29),{columns:s,data:x,sortKey:u,sortDirection:d,onSort:a,onRowClick:i,rowClassName:l}=p;let m;e[0]!==d?(m=function(n,N){return t.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&d&&(d==="asc"?t.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):t.jsx(S,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=d,e[1]=m):m=e[1];const h=m;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=c):c=e[2];const r=c;let o;if(e[3]!==s||e[4]!==a||e[5]!==h||e[6]!==u){let b;e[8]!==s.length||e[9]!==a||e[10]!==h||e[11]!==u?(b=(n,N)=>{const C=u===n.id;return t.jsx(P,{className:y(r(N,s.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&a?()=>a(n.id):void 0,children:t.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&h(n.id,C)]})},n.id)},e[8]=s.length,e[9]=a,e[10]=h,e[11]=u,e[12]=b):b=e[12],o=s.map(b),e[3]=s,e[4]=a,e[5]=h,e[6]=u,e[7]=o}else o=e[7];let f;e[13]!==o?(f=t.jsx(q,{className:"border-b-0",children:t.jsx(z,{className:"h-9 hover:bg-transparent border-b border-border",children:o})}),e[13]=o,e[14]=f):f=e[14];let g;if(e[15]!==s||e[16]!==x||e[17]!==i||e[18]!==l){let b;e[20]!==s||e[21]!==i||e[22]!==l?(b=(n,N)=>{const C=l?.(n);return t.jsx(z,{"data-row-index":N,className:y("group/data-row transition-colors border-b-0 hover:bg-accent/50",i?"cursor-pointer":"",C),onClick:i?()=>i(n):void 0,children:s.map(v=>t.jsx(F,{className:y("px-5 py-4 h-16 align-middle text-sm text-foreground",v.cellClassName,v.wrap?"whitespace-normal wrap-break-word":""),children:t.jsx("div",{className:y(v.wrap?"w-full":"min-w-0 w-full",!v.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:v.render?v.render(n):v.accessor?v.accessor(n):null})},v.id))},N)},e[20]=s,e[21]=i,e[22]=l,e[23]=b):b=e[23],g=x.map(b),e[15]=s,e[16]=x,e[17]=i,e[18]=l,e[19]=g}else g=e[19];let j;e[24]!==g?(j=t.jsx(G,{children:g}),e[24]=g,e[25]=j):j=e[25];let w;return e[26]!==f||e[27]!==j?(w=t.jsxs(J,{className:"w-full border-collapse",children:[f,j]}),e[26]=f,e[27]=j,e[28]=w):w=e[28],w}function ae(p){const e=T.c(12),{columns:s,data:x,isLoading:u,sortKey:d,sortDirection:a,onSort:i,onRowClick:l,emptyState:m}=p;if(u===void 0?!1:u){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=r):r=e[0],r}if(x.length===0){let r;e[1]!==m?(r=m||t.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=m,e[2]=r):r=e[2];let o;return e[3]!==r?(o=t.jsx("div",{className:"flex items-center justify-center h-full",children:r}),e[3]=r,e[4]=o):o=e[4],o}let c;return e[5]!==s||e[6]!==x||e[7]!==l||e[8]!==i||e[9]!==a||e[10]!==d?(c=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Q,{columns:s,data:x,sortKey:d,sortDirection:a,onSort:i,onRowClick:l})}),e[5]=s,e[6]=x,e[7]=l,e[8]=i,e[9]=a,e[10]=d,e[11]=c):c=e[11],c}export{ie as C,ae as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as T,bn as M,j as e,bo as P,a1 as q,r as R,v as h,a as O}from"./index-yjsBu7QA.js";import{u as A}from"./useQuery-C5RIveiE.js";import{u as _}from"./useMutation-VOj1VEf8.js";import{B as y}from"./button-BNRw8VbO.js";import{C as N,a as v}from"./card-B2_21gZH.js";import{i as L,a as U}from"./mcp-oauth-l77m3IWF.js";import{c as C,C as K,a as k}from"./circle-alert-DepalnIB.js";const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],D=C("external-link",Q);const H=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],w=C("loader-circle",H);const J=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],B=C("refresh-cw",J),Y=t=>{const n=T.c(6);let i;n[0]!==t?({...i}=t,n[0]=t,n[1]=i):i=n[1];const{theme:a}=M(),d=a===void 0?"system":a;let r;n[2]===Symbol.for("react.memo_cache_sentinel")?(r={"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},n[2]=r):r=n[2];let m;return n[3]!==i||n[4]!==d?(m=e.jsx(P,{theme:d,className:"toaster group",style:r,...i}),n[3]=i,n[4]=d,n[5]=m):m=n[5],m},b={session:t=>["user-sandbox-session",t]};function V({sessionId:t,onComplete:n,onError:i}){const a=q(),[p,d]=R.useState(null),{data:r,isLoading:m,error:j}=A({queryKey:b.session(t),queryFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}`);if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to load session")}return s.json()}}),F=_({mutationFn:async({appName:s,connectionId:o})=>{const l=await fetch(`/api/user-sandbox/sessions/${t}/configure`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s,connection_id:o})});if(!l.ok){const u=await l.json();throw new Error(u.error||"Configuration failed")}return l.json()},onSuccess:()=>{a.invalidateQueries({queryKey:b.session(t)})}}),x=_({mutationFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to complete")}return s.json()},onSuccess:s=>{s.redirectUrl?window.location.href=s.redirectUrl:(h.success("Setup complete!"),a.invalidateQueries({queryKey:b.session(t)}),n?.({agentId:s.agentId,redirectUrl:s.redirectUrl}))},onError:s=>{const o=s instanceof Error?s:new Error("Failed to complete");h.error(o.message),i?.(o)}}),S=async s=>{d(s.app_name);try{const o=await fetch(`/api/user-sandbox/sessions/${t}/provision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s.app_name})});if(!o.ok){const g=await o.json();throw new Error(g.error||"Failed to provision connection")}const u=(await o.json()).connection_id;if(s.connection_type==="HTTP"||s.connection_type==="SSE"||s.connection_type==="Websocket"){const g=`/mcp/${u}`,z=await L({url:g,token:null});if(!z.isAuthenticated&&z.supportsOAuth){h.info("Opening authentication window...");const c=await U({connectionId:u,clientName:s.title,timeout:3e5});if(c.error)throw new Error(c.error);if(c.tokenInfo){const E=await fetch(`/api/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:c.tokenInfo.accessToken,refreshToken:c.tokenInfo.refreshToken,expiresIn:c.tokenInfo.expiresIn,scope:c.tokenInfo.scope,clientId:c.tokenInfo.clientId,clientSecret:c.tokenInfo.clientSecret,tokenEndpoint:c.tokenInfo.tokenEndpoint})});if(!E.ok){const $=await E.json().catch(()=>({}));throw new Error($.error||"Failed to save authentication tokens. Please try again.")}}}}await F.mutateAsync({appName:s.app_name,connectionId:u}),h.success(`${s.title} connected successfully`)}catch(o){console.error("Connection error:",o);const l=o instanceof Error?o:new Error("Failed to connect");h.error(l.message),i?.(l)}finally{d(null)}},I=r?.apps.every(s=>s.status.configured),f=r?.session.status==="completed";return m?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(w,{className:"size-8 animate-spin text-muted-foreground"})}):j?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(N,{className:"max-w-md w-full",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("div",{className:"size-12 rounded-full bg-destructive/10 flex items-center justify-center",children:e.jsx(K,{className:"size-6 text-destructive"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Session Error"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:j instanceof Error?j.message:"Failed to load"})]})]})})})}):r?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Y,{}),e.jsxs("div",{className:"max-w-lg mx-auto px-4 py-12",children:[e.jsxs("div",{className:"text-center mb-8",children:[r.template.icon&&e.jsx("div",{className:"size-16 mx-auto mb-4 rounded-xl bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:r.template.icon,alt:"",className:"size-10 object-contain"})}),e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:r.template.title}),r.template.description&&e.jsx("p",{className:"text-muted-foreground mt-2",children:r.template.description})]}),f&&e.jsx(N,{className:"mb-6 border-green-500/20 bg-green-500/5",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"size-10 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-5 text-green-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Setup Complete"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your integrations are ready to use."})]})]})})}),e.jsx("div",{className:"space-y-3",children:r.apps.map(s=>e.jsx(N,{children:e.jsx(v,{className:"py-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"size-10 rounded-lg bg-muted flex items-center justify-center shrink-0 overflow-hidden",children:s.icon?e.jsx("img",{src:s.icon,alt:"",className:"size-6 object-contain"}):e.jsx("span",{className:"text-lg",children:"📦"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.status.configured?e.jsxs("span",{className:"text-green-600 dark:text-green-400 flex items-center gap-1",children:[e.jsx(k,{className:"size-3"})," Connected"]}):s.requires_oauth?"Requires authentication":"Ready to connect"})]}),!s.status.configured&&!f&&e.jsx(y,{size:"sm",onClick:()=>S(s),disabled:p!==null||x.isPending,children:p===s.app_name?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Connecting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"size-4 mr-2"}),"Connect"]})}),s.status.configured&&!f&&e.jsxs(y,{size:"sm",variant:"outline",onClick:()=>S(s),disabled:p!==null||x.isPending,children:[e.jsx(B,{className:"size-4 mr-2"}),"Reconnect"]}),f&&e.jsx("div",{className:"size-8 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-4 text-green-500"})})]})})},s.app_name))}),I&&!f&&e.jsx("div",{className:"mt-6",children:e.jsx(y,{className:"w-full",size:"lg",onClick:()=>x.mutate(),disabled:x.isPending,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Completing..."]}):"Complete Setup"})}),e.jsx("div",{className:"mt-8 pt-6 border-t text-center",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Session expires:"," ",new Date(r.session.expires_at).toLocaleString()]})})]})]}):null}function oe(){const t=T.c(3);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/connect/$sessionId"},t[0]=n):n=t[0];const{sessionId:i}=O(n);let a;return t[1]!==i?(a=e.jsx(V,{sessionId:i}),t[1]=i,t[2]=a):a=t[2],a}export{oe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as S,j as s}from"./index-yjsBu7QA.js";import{C as _}from"./card-B2_21gZH.js";import{c as j}from"./button-BNRw8VbO.js";import{I as A}from"./empty-state-CpRLw49r.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Q,j as o,l as Y,b6 as te,r as q,a as de,u as ue,f as pe,q as fe}from"./index-yjsBu7QA.js";import{E as H,I as oe}from"./empty-state-CpRLw49r.js";import{E as se}from"./error-boundary-DQ5uRgdY.js";import{b as he}from"./use-binding-CNR8kDE7.js";import{u as xe,S as ge}from"./index-CsOz92iP.js";import{b as ee,c as be,d as je,e as ye,B as Se,a as Ce}from"./breadcrumb-BuFIEIOz.js";import{g as ve}from"./use-collections-Hp9XPnUY.js";import{u as Z,a as Ne}from"./use-connection-Dj100t8H.js";import{u as Te}from"./constants-Cpe-c81c.js";import{b as we,d as $e}from"./use-mcp-prompts-SKr2e7l0.js";import{B as Ie}from"./button-BNRw8VbO.js";import{R as Le}from"./resource-tabs-CE-63rPp.js";import{i as ne}from"./Loading01-D8raUT2q.js";import{V as re,a as _e,b as ke}from"./layout-D8G7uVC8.js";import{C as Re}from"./collection-tab-DxItkIfa.js";import{a as ie,C as ce}from"./collection-table-wrapper-igJ5OqPc.js";import{C as ae}from"./collection-search-D5gi0-bL.js";import{P as le}from"./pin-to-sidebar-button-qPJJKT8U.js";import{C as me}from"./card-B2_21gZH.js";import{R as Pe,T as Me}from"./tools-list-gkMtCYZf.js";import"./binder-CwgOa4SG.js";import"./mcp-oauth-l77m3IWF.js";import"./env-vars-editor-0JsZHlg0.js";import"./input-C-GM7dsu.js";import"./Plus-BcqTpnxy.js";import"./Trash01-CR6s5yrj.js";import"./File06-2dtWfDa_.js";import"./Key01-DFKkR5uc.js";import"./index-BhNLW4h1.js";import"./badge-D19NcG12.js";import"./dropdown-menu-CsYNL9oo.js";import"./ChevronRight-BB2YL4K4.js";import"./form-DAoJifFq.js";import"./select-B4SPtD5h.js";import"./Check-lN7sUZo8.js";import"./ChevronDown-En_P43wp.js";import"./extract-connection-data-B6LHMHtn.js";import"./constants-gYpJq1UH.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-BNFgymSf.js";import"./generate-id-Dyweu44Y.js";import"./Terminal-BOgtpg9n.js";import"./Users03-CCWN1VQn.js";import"./use-virtual-mcp-XGRCLjSr.js";import"./index-DJLvIq1X.js";import"./circle-alert-DepalnIB.js";import"./index-Bos_CuhY.js";import"./X-BsLffR19.js";import"./collapsible-Dg-5RnYq.js";import"./Code01-Dgx2dgXr.js";import"./infiniteQueryObserver-D_8FFQdU.js";import"./localstorage-keys-C_mtBNzA.js";import"./useQuery-C5RIveiE.js";import"./useMutation-VOj1VEf8.js";import"./popover-u_i609j_.js";import"./Grid01-DHptyetH.js";import"./Image01-CILGPgam.js";import"./SearchMd-DVuLBPJW.js";import"./spinner-Duo6KesX.js";import"./dialog-Csoqe4hG.js";import"./AlertCircle-B7sqll3Z.js";import"./ArrowUp-D8YYlj5b.js";import"./Edit01-C_JM_ANM.js";import"./Copy01-daHVbD8K.js";import"./monaco-editor-p_EFt-aT.js";import"./use-create-virtual-mcp-B01dvSQa.js";import"./index-P_cUV9l9.js";import"./DotsVertical-D1ZY49Um.js";import"./use-list-state-DsM4HMGd.js";import"./use-mobile-CS2zVR4m.js";import"./empty-state-Cn1CRUZO.js";import"./Inbox01-BTvTBHN2.js";import"./avatar-B6WhQiHI.js";import"./alert-dialog-BYFUia7V.js";import"./List-Dl-Bi1Os.js";import"./view-mode-toggle-zGyN0eoT.js";import"./table-NP0FOAI5.js";import"./Pin01-C3nTzsY2.js";import"./use-organization-settings-ClYOYczD.js";function Ve(t){const e=Q.c(42),{prompts:n,connectionId:s,org:r,connectionTitle:p,connectionIcon:d,onPromptClick:g,showToolbar:N,emptyMessage:A}=t,$=N===void 0?!0:N,I=A===void 0?"This connection doesn't have any prompts yet.":A,f=Y(),b=te().location.href,[x,a]=q.useState(""),[m,j]=q.useState("table"),[l,E]=q.useState("name"),[u,B]=q.useState("asc");let M;e[0]!==u||e[1]!==l?(M=h=>{l===h?(B(Oe),u==="desc"&&E(void 0)):(E(h),B("asc"))},e[0]=u,e[1]=l,e[2]=M):M=e[2];const S=M;let v;e[3]!==s||e[4]!==f||e[5]!==g||e[6]!==r?(v=h=>{g?g(h):s&&r&&f({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:r,connectionId:s,collectionName:"prompts",itemId:encodeURIComponent(h.name)}})},e[3]=s,e[4]=f,e[5]=g,e[6]=r,e[7]=v):v=e[7];const L=v;let T;if(e[8]!==n||e[9]!==x||e[10]!==u||e[11]!==l){const h=!n||n.length===0?[]:x.trim()?(()=>{const z=x.toLowerCase();return n.filter(O=>O.name.toLowerCase().includes(z)||O.description&&O.description.toLowerCase().includes(z))})():n;T=!l||!u?h:[...h].sort((z,O)=>{const G=z[l]||"",W=O[l]||"",F=String(G).localeCompare(String(W));return u==="asc"?F:-F}),e[8]=n,e[9]=x,e[10]=u,e[11]=l,e[12]=T}else T=e[12];const _=T;let D;e[13]===Symbol.for("react.memo_cache_sentinel")?(D=[{id:"name",header:"Name",render:De,sortable:!0},{id:"description",header:"Description",render:Be,cellClassName:"flex-1",sortable:!0}],e[13]=D):D=e[13];const c=D;let P;e[14]===Symbol.for("react.memo_cache_sentinel")?(P=c.filter(Ee).map(Ae),e[14]=P):P=e[14];const k=P;let y;e[15]!==d||e[16]!==p||e[17]!==S||e[18]!==$||e[19]!==u||e[20]!==l||e[21]!==b||e[22]!==m?(y=$&&o.jsxs(re,{children:[o.jsx(ce,{viewMode:m,onViewModeChange:j,sortKey:l,sortDirection:u,onSort:S,sortOptions:k}),o.jsx(le,{title:p?`${p}: Prompts`:"Prompts",url:b,icon:d??"description"})]}),e[15]=d,e[16]=p,e[17]=S,e[18]=$,e[19]=u,e[20]=l,e[21]=b,e[22]=m,e[23]=y):y=e[23];let w;e[24]===Symbol.for("react.memo_cache_sentinel")?(w=h=>{h.key==="Escape"&&(a(""),h.target.blur())},e[24]=w):w=e[24];let C;e[25]!==x?(C=o.jsx(ae,{value:x,onChange:a,placeholder:"Search prompts...",onKeyDown:w}),e[25]=x,e[26]=C):C=e[26];let i;e[27]!==I||e[28]!==L||e[29]!==S||e[30]!==x||e[31]!==u||e[32]!==l||e[33]!==_||e[34]!==m?(i=m==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:_.length===0?o.jsx(H,{image:null,title:x?"No prompts found":"No prompts available",description:x?"Try adjusting your search terms":I}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:_.map(h=>o.jsx(me,{className:"cursor-pointer transition-colors",onClick:()=>L(h),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(oe,{icon:null,name:h.name,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-0",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),o.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h.description||"No description"})]})]})},h.name))})}):o.jsx(ie,{columns:c,data:_,isLoading:!1,sortKey:l,sortDirection:u,onSort:S,onRowClick:h=>L(h),emptyState:o.jsx(H,{image:null,title:x?"No prompts found":"No prompts available",description:x?"Try adjusting your search terms":I})}),e[27]=I,e[28]=L,e[29]=S,e[30]=x,e[31]=u,e[32]=l,e[33]=_,e[34]=m,e[35]=i):i=e[35];let V;e[36]!==C||e[37]!==i?(V=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[C,i]}),e[36]=C,e[37]=i,e[38]=V):V=e[38];let R;return e[39]!==V||e[40]!==y?(R=o.jsxs(o.Fragment,{children:[y,V]}),e[39]=V,e[40]=y,e[41]=R):R=e[41],R}function Ae(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ee(t){return t.sortable}function Be(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function De(t){return o.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function Oe(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Ue(t){const e=Q.c(6),{prompts:n,connectionId:s,org:r}=t,p=Z(s),d=p?.title,g=p?.icon;let N;return e[0]!==s||e[1]!==r||e[2]!==n||e[3]!==d||e[4]!==g?(N=o.jsx(Ve,{prompts:n,connectionId:s,org:r,connectionTitle:d,connectionIcon:g}),e[0]=s,e[1]=r,e[2]=n,e[3]=d,e[4]=g,e[5]=N):N=e[5],N}function Ke(t){const e=Q.c(2),{repository:n}=t;let s;return e[0]!==n?(s=o.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:o.jsx(Pe,{repository:n})}),e[0]=n,e[1]=s):s=e[1],s}function ze(t){const e=Q.c(39),{resources:n,connectionTitle:s,connectionIcon:r,onResourceClick:p,showToolbar:d,emptyMessage:g}=t,N=d===void 0?!0:d,A=g===void 0?"This connection doesn't have any resources yet.":g,I=te().location.href,[f,U]=q.useState(""),[b,x]=q.useState("table"),[a,m]=q.useState("name"),[j,l]=q.useState("asc");let E;e[0]!==j||e[1]!==a?(E=i=>{a===i?(l(Je),j==="desc"&&m(void 0)):(m(i),l("asc"))},e[0]=j,e[1]=a,e[2]=E):E=e[2];const u=E;let B;e[3]!==p?(B=i=>{p&&p(i)},e[3]=p,e[4]=B):B=e[4];const M=B;let S;if(e[5]!==n||e[6]!==f||e[7]!==j||e[8]!==a){const i=!n||n.length===0?[]:f.trim()?(()=>{const V=f.toLowerCase();return n.filter(R=>R.uri.toLowerCase().includes(V)||R.name&&R.name.toLowerCase().includes(V)||R.description&&R.description.toLowerCase().includes(V))})():n;S=!a||!j?i:[...i].sort((V,R)=>{const h=V[a]||"",z=R[a]||"",O=String(h).localeCompare(String(z));return j==="asc"?O:-O}),e[5]=n,e[6]=f,e[7]=j,e[8]=a,e[9]=S}else S=e[9];const v=S;let L;e[10]===Symbol.for("react.memo_cache_sentinel")?(L=[{id:"name",header:"Name",render:He,sortable:!0},{id:"uri",header:"URI",render:Ge,sortable:!0},{id:"description",header:"Description",render:We,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Fe,sortable:!0}],e[10]=L):L=e[10];const T=L;let _;e[11]===Symbol.for("react.memo_cache_sentinel")?(_=T.filter(Qe).map(qe),e[11]=_):_=e[11];const D=_;let c;e[12]!==r||e[13]!==s||e[14]!==u||e[15]!==N||e[16]!==j||e[17]!==a||e[18]!==I||e[19]!==b?(c=N&&o.jsxs(re,{children:[o.jsx(ce,{viewMode:b,onViewModeChange:x,sortKey:a,sortDirection:j,onSort:u,sortOptions:D}),o.jsx(le,{title:s?`${s}: Resources`:"Resources",url:I,icon:r??"folder"})]}),e[12]=r,e[13]=s,e[14]=u,e[15]=N,e[16]=j,e[17]=a,e[18]=I,e[19]=b,e[20]=c):c=e[20];let P;e[21]===Symbol.for("react.memo_cache_sentinel")?(P=i=>{i.key==="Escape"&&(U(""),i.target.blur())},e[21]=P):P=e[21];let k;e[22]!==f?(k=o.jsx(ae,{value:f,onChange:U,placeholder:"Search resources...",onKeyDown:P}),e[22]=f,e[23]=k):k=e[23];let y;e[24]!==A||e[25]!==M||e[26]!==u||e[27]!==f||e[28]!==j||e[29]!==a||e[30]!==v||e[31]!==b?(y=b==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:v.length===0?o.jsx(H,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":A}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:v.map(i=>o.jsx(me,{className:"cursor-pointer transition-colors",onClick:()=>M(i),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(oe,{icon:null,name:i.name||i.uri,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:i.name||i.uri}),o.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:i.uri}),i.description&&o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:i.description})]})]})},i.uri))})}):o.jsx(ie,{columns:T,data:v,isLoading:!1,sortKey:a,sortDirection:j,onSort:u,onRowClick:i=>M(i),emptyState:o.jsx(H,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":A})}),e[24]=A,e[25]=M,e[26]=u,e[27]=f,e[28]=j,e[29]=a,e[30]=v,e[31]=b,e[32]=y):y=e[32];let w;e[33]!==k||e[34]!==y?(w=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[k,y]}),e[33]=k,e[34]=y,e[35]=w):w=e[35];let C;return e[36]!==w||e[37]!==c?(C=o.jsxs(o.Fragment,{children:[c,w]}),e[36]=w,e[37]=c,e[38]=C):C=e[38],C}function qe(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Qe(t){return t.sortable}function Fe(t){return o.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function We(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Ge(t){return o.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function He(t){return o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function Je(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Xe(t){const e=Q.c(6),{resources:n,connectionId:s,org:r}=t,p=Z(s),d=p?.title,g=p?.icon;let N;return e[0]!==s||e[1]!==r||e[2]!==n||e[3]!==d||e[4]!==g?(N=o.jsx(ze,{resources:n,connectionId:s,org:r,connectionTitle:d,connectionIcon:g}),e[0]=s,e[1]=r,e[2]=n,e[3]=d,e[4]=g,e[5]=N):N=e[5],N}function Ye(t){const e=Q.c(5),{tools:n,connectionId:s,org:r,isLoading:p}=t;let d;return e[0]!==s||e[1]!==p||e[2]!==r||e[3]!==n?(d=o.jsx(Me,{tools:n,connectionId:s,org:r,isLoading:p}),e[0]=s,e[1]=p,e[2]=r,e[3]=n,e[4]=d):d=e[4],d}function Ze(t){const e=Q.c(72),{connection:n,connectionId:s,org:r,requestedTabId:p,collections:d,onUpdate:g,isUpdating:N,prompts:A,resources:$,tools:I,isLoadingTools:f}=t;let U;e[0]===Symbol.for("react.memo_cache_sentinel")?(U={from:"/$org/mcps/$connectionId"},e[0]=U):U=e[0];const b=Y(U);let x;e[1]!==s?(x={connectionId:s},e[1]=s,e[2]=x):x=e[2];const a=xe(x),m=a.isAuthenticated,j=n?.metadata?.repository,l=!!j?.url,E=I.length,u=A.length,B=$.length,M=E>0||f;let S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S={id:"settings",label:"Settings"},e[3]=S):S=e[3];let v;e[4]!==f||e[5]!==m||e[6]!==M||e[7]!==E?(v=m&&M?[{id:"tools",label:"Tools",count:f?void 0:E}]:[],e[4]=f,e[5]=m,e[6]=M,e[7]=E,e[8]=v):v=e[8];let L;e[9]!==m||e[10]!==u?(L=m&&u>0?[{id:"prompts",label:"Prompts",count:u}]:[],e[9]=m,e[10]=u,e[11]=L):L=e[11];let T;e[12]!==m||e[13]!==B?(T=m&&B>0?[{id:"resources",label:"Resources",count:B}]:[],e[12]=m,e[13]=B,e[14]=T):T=e[14];let _;if(e[15]!==d||e[16]!==l||e[17]!==m||e[18]!==v||e[19]!==L||e[20]!==T){let K;e[22]!==l?(K=l?[{id:"readme",label:"README"}]:[],e[22]=l,e[23]=K):K=e[23],_=[S,...v,...L,...T,...m?(d||[]).map(et):[],...K],e[15]=d,e[16]=l,e[17]=m,e[18]=v,e[19]=L,e[20]=T,e[21]=_}else _=e[21];const D=_,c=D.some(K=>K.id===p)?p:"settings";let P;e[24]!==b?(P=K=>{b({search:X=>({...X,tab:K}),replace:!0})},e[24]=b,e[25]=P):P=e[25];const k=P;let y;e[26]!==d?(y=d||[],e[26]=d,e[27]=y):y=e[27];let w;if(e[28]!==c||e[29]!==y){let K;e[31]!==c?(K=X=>X.name===c,e[31]=c,e[32]=K):K=e[32],w=y.find(K),e[28]=c,e[29]=y,e[30]=w}else w=e[30];const C=w;let i;e[33]!==r?(i=o.jsx(ee,{children:o.jsx(je,{asChild:!0,children:o.jsx(fe,{to:"/$org/mcps",params:{org:r},children:"Connections"})})}),e[33]=r,e[34]=i):i=e[34];let V;e[35]===Symbol.for("react.memo_cache_sentinel")?(V=o.jsx(ye,{}),e[35]=V):V=e[35];let R;e[36]!==n.title?(R=o.jsx(ee,{children:o.jsx(be,{children:n.title})}),e[36]=n.title,e[37]=R):R=e[37];let h;e[38]!==i||e[39]!==R?(h=o.jsx(Se,{children:o.jsxs(Ce,{children:[i,V,R]})}),e[38]=i,e[39]=R,e[40]=h):h=e[40];const z=h;let O;e[41]!==c||e[42]!==k||e[43]!==D?(O=o.jsx(_e,{children:o.jsx(Le,{tabs:D,activeTab:c,onTabChange:k})}),e[41]=c,e[42]=k,e[43]=D,e[44]=O):O=e[44];let G;e[45]===Symbol.for("react.memo_cache_sentinel")?(G=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ne,{size:32,className:"animate-spin text-muted-foreground"})}),e[45]=G):G=e[45];let W;e[46]!==C||e[47]!==c||e[48]!==a.hasOAuthToken||e[49]!==a.isServerError||e[50]!==a.supportsOAuth||e[51]!==n||e[52]!==s||e[53]!==k||e[54]!==l||e[55]!==f||e[56]!==m||e[57]!==N||e[58]!==g||e[59]!==r||e[60]!==A||e[61]!==j||e[62]!==$||e[63]!==I?(W=o.jsx(q.Suspense,{fallback:G,children:c==="tools"?o.jsx(Ye,{tools:I,connectionId:s,org:r,isLoading:f}):c==="prompts"?o.jsx(Ue,{prompts:A,connectionId:s,org:r}):c==="resources"?o.jsx(Xe,{resources:$,connectionId:s,org:r}):c==="settings"?o.jsx(ge,{connection:n,onUpdate:g,isUpdating:N,isMCPAuthenticated:m,supportsOAuth:a.supportsOAuth,hasOAuthToken:a.hasOAuthToken,isServerError:a.isServerError,onViewReadme:l?()=>k("readme"):void 0}):c==="readme"&&l?o.jsx(Ke,{repository:j}):C&&m?o.jsx(Re,{connectionId:s,org:r,activeCollection:C},c):o.jsx(H,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[46]=C,e[47]=c,e[48]=a.hasOAuthToken,e[49]=a.isServerError,e[50]=a.supportsOAuth,e[51]=n,e[52]=s,e[53]=k,e[54]=l,e[55]=f,e[56]=m,e[57]=N,e[58]=g,e[59]=r,e[60]=A,e[61]=j,e[62]=$,e[63]=I,e[64]=W):W=e[64];let F;e[65]!==c||e[66]!==W?(F=o.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:o.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:o.jsx(se,{children:W},c)})}),e[65]=c,e[66]=W,e[67]=F):F=e[67];let J;return e[68]!==z||e[69]!==O||e[70]!==F?(J=o.jsxs(ke,{breadcrumb:z,children:[O,F]}),e[68]=z,e[69]=O,e[70]=F,e[71]=J):J=e[71],J}function et(t){return{id:t.name,label:t.displayName}}function tt(){const t=Q.c(43);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const n=Y(e);let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId"},t[1]=s):s=t[1];const{connectionId:r,org:p}=de(s),{org:d}=ue();let g;t[2]===Symbol.for("react.memo_cache_sentinel")?(g={from:"/shell/$org/mcps/$connectionId"},t[2]=g):g=t[2];const A=pe(g).tab||"settings",$=Z(r),I=Ne(),f=he($??void 0);let U;t[3]!==r||t[4]!==d.id?(U={connectionId:r,orgId:d.id},t[3]=r,t[4]=d.id,t[5]=U):U=t[5];const b=Te(U);let x;t[6]!==b?(x={client:b},t[6]=b,t[7]=x):x=t[7];const{data:a}=we(x);let m;t[8]!==b?(m={client:b},t[8]=b,t[9]=m):m=t[9];const{data:j}=$e(m),l=$?.tools&&$.tools.length>0,E=!l;let u;t[10]!==b||t[11]!==E?(u={client:b,enabled:E},t[10]=b,t[11]=E,t[12]=u):u=t[12];const{data:B,isLoading:M}=ve(u);let S;t[13]!==a?.prompts?(S=a?.prompts??[],t[13]=a?.prompts,t[14]=S):S=t[14];let v;t[15]!==S?(v=S.map(nt),t[15]=S,t[16]=v):v=t[16];const L=v;let T;t[17]!==j?.resources?(T=j?.resources??[],t[17]=j?.resources,t[18]=T):T=t[18];let _;t[19]!==T?(_=T.map(st),t[19]=T,t[20]=_):_=t[20];const D=_;let c;t[21]!==$||t[22]!==l||t[23]!==B?.tools?(c=l?$.tools??[]:(B?.tools??[]).map(ot),t[21]=$,t[22]=l,t[23]=B?.tools,t[24]=c):c=t[24];const P=c;let k;t[25]!==I.update||t[26]!==r?(k=async C=>{await I.update.mutateAsync({id:r,data:C})},t[25]=I.update,t[26]=r,t[27]=k):k=t[27];const y=k;if(!$){let C;return t[28]!==n||t[29]!==p?(C=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(H,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:o.jsx(Ie,{variant:"outline",onClick:()=>n({to:"/$org/mcps",params:{org:p}}),children:"Back to connections"})})}),t[28]=n,t[29]=p,t[30]=C):C=t[30],C}let w;return t[31]!==I.update.isPending||t[32]!==f||t[33]!==$||t[34]!==r||t[35]!==y||t[36]!==M||t[37]!==p||t[38]!==L||t[39]!==A||t[40]!==D||t[41]!==P?(w=o.jsx(Ze,{org:p,connection:$,connectionId:r,requestedTabId:A,collections:f,onUpdate:y,isUpdating:I.update.isPending,prompts:L,resources:D,tools:P,isLoadingTools:M}),t[31]=I.update.isPending,t[32]=f,t[33]=$,t[34]=r,t[35]=y,t[36]=M,t[37]=p,t[38]=L,t[39]=A,t[40]=D,t[41]=P,t[42]=w):w=t[42],w}function ot(t){return{name:t.name,description:t.description,inputSchema:t.inputSchema}}function st(t){return{uri:t.uri,name:t.name,description:t.description}}function nt(t){return{name:t.name,description:t.description}}function rt(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(se,{children:o.jsx(q.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:o.jsx(ne,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(tt,{})})}),t[0]=e):e=t[0],e}function Ro(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(rt,{}),t[0]=e):e=t[0],e}export{Ro as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ge,j as e,r as z,u as je,l as fe,f as ye,g as ve,m as _e,k as Ce,h as ke,i as Ne,o as re,n as be,s as y,_ as Se}from"./index-yjsBu7QA.js";import{C as we,a as De}from"./collection-table-wrapper-igJ5OqPc.js";import{C as Pe}from"./collection-search-D5gi0-bL.js";import{P as T}from"./index-P_cUV9l9.js";import{B as Te,a as Ie,b as Ve,c as $e}from"./breadcrumb-BuFIEIOz.js";import{C as Ae}from"./connection-card-GHfjxhQ1.js";import{n as H,E as O,I as Ee}from"./empty-state-CpRLw49r.js";import{E as Be}from"./error-boundary-DQ5uRgdY.js";import{u as Fe}from"./use-binding-CNR8kDE7.js";import{u as He,s as J}from"./use-list-state-DsM4HMGd.js";import{e as Oe}from"./use-collections-Hp9XPnUY.js";import{a as Me,b as ze}from"./use-connection-Dj100t8H.js";import{u as Re}from"./constants-Cpe-c81c.js";import{f as Ue,a as Le,b as Xe,c as We,d as Ke,e as Ge,A as qe,g as Ye}from"./alert-dialog-BYFUia7V.js";import{B as Qe}from"./badge-D19NcG12.js";import{B as _}from"./button-BNRw8VbO.js";import{D as Je,a as Ze,b as et,c as tt,d as nt,e as st}from"./dialog-Csoqe4hG.js";import{D as Z,a as ee,b as te,c as A}from"./dropdown-menu-CsYNL9oo.js";import{a as ot,F as h,b as x,c as g,d as j,f}from"./form-DAoJifFq.js";import{i as ne}from"./DotsVertical-D1ZY49Um.js";import{f as rt,e as it,s as M}from"./registry-utils-BNFgymSf.js";import{i as at}from"./Loading01-D8raUT2q.js";import{i as ct}from"./Terminal-BOgtpg9n.js";import{s as se}from"./Trash01-CR6s5yrj.js";import{I as k}from"./input-C-GM7dsu.js";import{S as lt,a as dt,b as ut,c as mt,d as I}from"./select-B4SPtD5h.js";import{T as pt}from"./textarea-ByvgxbRE.js";import{g as ht}from"./generate-id-Dyweu44Y.js";import{r as xt,E as gt,e as ie}from"./env-vars-editor-0JsZHlg0.js";import"./ArrowUp-D8YYlj5b.js";import"./Check-lN7sUZo8.js";import"./Grid01-DHptyetH.js";import"./List-Dl-Bi1Os.js";import"./view-mode-toggle-zGyN0eoT.js";import"./table-NP0FOAI5.js";import"./SearchMd-DVuLBPJW.js";import"./ChevronRight-BB2YL4K4.js";import"./card-B2_21gZH.js";import"./binder-CwgOa4SG.js";import"./use-mobile-CS2zVR4m.js";import"./useMutation-VOj1VEf8.js";import"./useQuery-C5RIveiE.js";import"./X-BsLffR19.js";import"./ChevronDown-En_P43wp.js";import"./Plus-BcqTpnxy.js";const jt=re({key:y(),value:y()}),ft=re({title:y().min(1,"Name is required"),description:y().nullable().optional(),ui_type:Se(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:y().optional(),connection_token:y().nullable().optional(),npx_package:y().optional(),stdio_command:y().optional(),stdio_args:y().optional(),stdio_cwd:y().optional(),env_vars:be(jt).optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function B(n){const o=n.trim();if(!o)return"";try{const i=new URL(o),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return o.replace(/\/+$/,"")}}function yt(n){const o=n.trim().split(/\s+/).filter(Boolean);if(o.length<2)return null;const i=o[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const m=o.slice(1).find(a=>!a.startsWith("-"));return m?{packageName:m}:null}function E(n){const{uiType:o}=n,i=B(n.connectionUrl??"");if((o==="HTTP"||o==="SSE"||o==="Websocket")&&i===B("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(n.npxPackage??"").trim();return o==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function oe(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const o=B(n.connectionUrl??"");if(!o)return null;const i=n.registryItems.find(a=>(a.server?.remotes??[]).some(N=>B(N.url??"")===o));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",m=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:m}:null}function vt(n,o){const i={command:"npx",args:["-y",n]},d=ie(o);return Object.keys(d).length>0&&(i.envVars=d),i}function _t(n,o,i,d){const m={command:n};o.trim()&&(m.args=o.trim().split(/\s+/)),i?.trim()&&(m.cwd=i.trim());const a=ie(d);return Object.keys(a).length>0&&(m.envVars=a),m}function Ct(n){return n.command==="npx"}function kt(n){return n.args?.find(o=>!o.startsWith("-"))??""}function Nt(n){return{command:n.command,args:n.args?.join(" ")??"",cwd:n.cwd??""}}function bt(n,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"close":return{mode:"idle"}}}function St(){const{org:n}=je(),o=fe(),i=ye({strict:!1}),{data:d}=ve.useSession(),{stdioEnabled:m}=_e(),a=He({namespace:n.slug,resource:"connections"}),V=Me(),N=ze(a),[v,b]=z.useReducer(bt,{mode:"idle"}),R=Fe(N)[0],U=R?.id??"",L=rt(R?.tools),ae=Re({connectionId:U||null,orgId:n.id}),{data:ce}=Oe({client:ae,toolName:L,toolArguments:{limit:200},enabled:!!(U&&L),staleTime:3600*1e3,select:t=>t.structuredContent??t}),X=it(ce??[]),W=i.action==="create",le=()=>{o({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},K=()=>{o({to:"/$org/mcps",params:{org:n.slug},search:{}})},r=Ce({resolver:ke(ft),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),u=r.watch("ui_type"),G=r.watch("connection_url"),de=r.watch("npx_package"),D=E({uiType:u,connectionUrl:G??"",npxPackage:de??""})??oe({uiType:u,connectionUrl:G??"",registryItems:X}),l=v.mode==="editing"?v.connection:null;z.useEffect(()=>{if(l){const t=Ne(l.connection_headers)?l.connection_headers:null;if(t&&l.connection_type==="STDIO"){const s=xt(t.envVars);if(Ct(t)){const c=kt(t);r.reset({title:l.title,description:l.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:s})}else{const c=Nt(t);r.reset({title:l.title,description:l.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:s})}}else r.reset({title:l.title,description:l.description,ui_type:l.connection_type,connection_url:l.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[l,r]);const ue=async()=>{if(v.mode!=="deleting")return;const t=v.connection.id;b({type:"close"});try{await V.delete.mutateAsync(t)}catch{}},me=async t=>{let s,c=null,S=null,C=null;if(t.ui_type==="NPX"?(s="STDIO",c="",C=vt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(s="STDIO",c="",C=_t(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(s=t.ui_type,c=t.connection_url||"",S=t.connection_token||null),l){await V.update.mutateAsync({id:l.id,data:{title:t.title,description:t.description||null,connection_type:s,connection_url:c,...S&&{connection_token:S},...C&&{connection_headers:C}}}),b({type:"close"}),r.reset();return}const w=ht("conn");await V.create.mutateAsync({id:w,title:t.title,description:t.description||null,connection_type:s,connection_url:c,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),K(),r.reset(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:w}})},q=t=>{t||(W?K():b({type:"close"}),r.reset())},$=t=>{const s=t.trim();if(!s)return;const c=!!r.formState.dirtyFields.title,S=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,w=p=>{if(p&&(!c&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!S&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!C&&p.envVarKeys?.length)){const Y=r.getValues("env_vars")??[],xe=new Set(Y.map(P=>P.key)),Q=p.envVarKeys.filter(P=>!xe.has(P));Q.length>0&&r.setValue("env_vars",[...Y,...Q.map(P=>({key:P,value:""}))],{shouldDirty:!0})}},F=yt(s);if(F&&m){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",F.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),w(E({uiType:"NPX",npxPackage:F.packageName}));return}if(s.startsWith("http://")||s.startsWith("https://")){const p=u==="HTTP"||u==="SSE"||u==="Websocket"?u:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",s,{shouldDirty:!0}),w(E({uiType:p,connectionUrl:s})??oe({uiType:p,connectionUrl:s,registryItems:X}));return}u==="NPX"&&w(E({uiType:"NPX",npxPackage:s}))},pe=[{id:"icon",header:"",render:t=>e.jsx(Ee,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(H,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:t=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title}),cellClassName:"w-48 max-w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:t.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-sm font-medium",children:t.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:t=>{const s=t.connection_url??"",c=s.length>40?`${s.slice(0,40)}...`:s;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:t=>e.jsx(Qe,{variant:t.status==="active"?"success":"outline",children:t.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(Z,{children:[e.jsx(ee,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(ne,{size:20})})}),e.jsxs(te,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(A,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(J,{size:16}),"Open"]}),e.jsxs(A,{variant:"destructive",onClick:s=>{s.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(se,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],he=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(_,{onClick:le,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(T,{children:[e.jsx(Je,{open:W||v.mode==="editing",onOpenChange:q,children:e.jsxs(Ze,{className:"sm:max-w-[525px]",children:[e.jsxs(et,{children:[e.jsx(tt,{children:l?"Edit Connection":"Create Connection"}),e.jsx(nt,{children:l?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(ot,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(me),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(h,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Type *"}),e.jsxs(lt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(j,{children:e.jsx(dt,{children:e.jsx(ut,{})})}),e.jsxs(mt,{children:[e.jsx(I,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(I,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(I,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"Websocket"]})}),m&&e.jsxs(e.Fragment,{children:[e.jsx(I,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(H,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(I,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ct,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(f,{})]})}),u==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"NPM Package *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:s=>{const c=s.clipboardData.getData("text");c&&(s.preventDefault(),r.setValue("npx_package",c.trim(),{shouldDirty:!0}),$(c))},onBlur:s=>{$(s.target.value),t.onBlur()}})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(f,{})]})})}),u==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(h,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Command *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Arguments"}),e.jsx(j,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Working Directory"}),e.jsx(j,{children:e.jsx(k,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(f,{})]})})]}),(u==="NPX"||u==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Environment Variables"}),e.jsx(j,{children:e.jsx(gt,{value:t.value??[],onChange:t.onChange})}),e.jsx(f,{})]})}),u!=="NPX"&&u!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"URL *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:s=>{const c=s.clipboardData.getData("text");c&&(s.preventDefault(),r.setValue("connection_url",c.trim(),{shouldDirty:!0}),$(c))},onBlur:s=>{$(s.target.value),t.onBlur()}})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:D?.token?.label??"Token (optional)"}),e.jsx(j,{children:e.jsx(k,{type:"password",placeholder:D?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),D?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[D.token.helperText,D.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Name *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Description"}),e.jsx(j,{children:e.jsx(pt,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsxs(st,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>q(!1),children:"Cancel"}),e.jsx(_,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(Ue,{open:v.mode==="deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(Le,{children:[e.jsxs(Xe,{children:[e.jsx(We,{children:"Delete Connection?"}),e.jsxs(Ke,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:v.mode==="deleting"&&v.connection.title}),"."]})]}),e.jsxs(Ge,{children:[e.jsx(qe,{children:"Cancel"}),e.jsx(Ye,{onClick:ue,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsxs(T.Header,{children:[e.jsx(T.Header.Left,{children:e.jsx(Te,{children:e.jsx(Ie,{children:e.jsx(Ve,{children:e.jsx($e,{children:"Connections"})})})})}),e.jsxs(T.Header.Right,{children:[e.jsx(we,{viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}]}),he]})]}),e.jsx(Pe,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),e.jsx(T.Content,{children:a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(O,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(_,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(t=>e.jsx(Ae,{connection:t,fallbackIcon:e.jsx(H,{}),onClick:()=>o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),headerActions:e.jsxs(Z,{children:[e.jsx(ee,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(ne,{size:20})})}),e.jsxs(te,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(A,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(J,{size:16}),"Open"]}),e.jsxs(A,{variant:"destructive",onClick:s=>{s.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(se,{size:16}),"Delete"]})]})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx(De,{columns:pe,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),emptyState:a.search?e.jsx(O,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(O,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(_,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})})})})})]})}function yn(){const n=ge.c(1);let o;return n[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(Be,{children:e.jsx(z.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(at,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(St,{})})}),n[0]=o):o=n[0],o}export{yn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as t,J as a}from"./index-yjsBu7QA.js";const e=t(a,{target:"draft-7"});export{e as B};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c,j as i,M as p,Q as f,U as m,W as g,X as x,Y as v,Z as b,$ as w,a0 as h}from"./index-yjsBu7QA.js";import{i as j}from"./ChevronRight-BB2YL4K4.js";import{c as u}from"./button-BNRw8VbO.js";function M(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function S(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function $(s){const e=c.c(10);let t,o,a;e[0]!==s?({className:t,sideOffset:a,...o}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const n=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function y(s){const e=c.c(12);let t,o,a,n;e[0]!==s?({className:t,inset:o,variant:n,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r?(l=i.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:d,...a}),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function _(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}function C(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(v,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function T(s){const e=c.c(13);let t,o,a,n;e[0]!==s?({className:o,inset:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(j,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==n||e[11]!==r?(l=i.jsxs(b,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...n,children:[t,d]}),e[8]=t,e[9]=a,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function R(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}export{M as D,S as a,$ as b,y as c,C as d,T as e,R as f,_ as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as _,a as S,g as E,j as t,aM as j,r as f,aN as b,c as L,t as P}from"./index-yjsBu7QA.js";import{i as x}from"./Loading01-D8raUT2q.js";import{c as I}from"./binder-CwgOa4SG.js";import{u as H,L as w}from"./localstorage-keys-C_mtBNzA.js";import{b as k}from"./use-connection-Dj100t8H.js";import{u as z}from"./constants-Cpe-c81c.js";import"./useQuery-C5RIveiE.js";import"./useMutation-VOj1VEf8.js";import"./use-collections-Hp9XPnUY.js";function B(e,r){return e?e.filter(a=>I(a,r)):[]}function y(e){return{id:e.id,title:e.title,icon:e.icon,description:e.description,app_name:e.app_name,app_id:e.app_id,tools:e.tools,metadata:e.metadata}}function M({binding:e,renderHeader:r,renderEmptyState:a}){const{org:s}=_(),{pluginId:n}=S({strict:!1}),d=k(),{data:o}=E.useSession(),l=B(d,e),[i,m]=H(w.pluginConnection(s.slug,n),c=>c??""),u=l.find(c=>c.id===i)??l[0]??null,p=o?.user?{user:{id:o.user.id,name:o.user.name,email:o.user.email,image:o.user.image}}:null,g={id:s.id,slug:s.slug,name:s.name};if(l.length===0||!u){const c={connectionId:null,connection:null,toolCaller:null,org:g,session:p};return t.jsx(j,{value:c,children:t.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:a()})})}const h=z({connectionId:u.id,orgId:s.id}),v={connectionId:u.id,connection:y(u),toolCaller:((c,N)=>h?h.callTool({name:c,arguments:N}).then(C=>C.structuredContent??C):Promise.reject(new Error("MCP client is not available"))),org:g,session:p};return t.jsx(j,{value:v,children:t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[r({connections:l.map(y),selectedConnectionId:u.id,onConnectionChange:m}),t.jsx("div",{className:"flex-1 overflow-hidden",children:t.jsx(f.Suspense,{fallback:t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(x,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:t.jsx(b,{})})})]})})}function F(){const e=L.c(12);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const{pluginId:a}=S(r);let s;e[1]!==a?(s=P.find(i=>i.id===a),e[1]=a,e[2]=s):s=e[2];const n=s;if(n?.renderHeader&&n?.renderEmptyState){let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(x,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[3]=i):i=e[3];let m;return e[4]!==n.binding||e[5]!==n.renderEmptyState||e[6]!==n.renderHeader?(m=t.jsx(f.Suspense,{fallback:i,children:t.jsx(M,{binding:n.binding,renderHeader:n.renderHeader,renderEmptyState:n.renderEmptyState})}),e[4]=n.binding,e[5]=n.renderEmptyState,e[6]=n.renderHeader,e[7]=m):m=e[7],m}const d=n?.LayoutComponent;if(!d){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(b,{}),e[8]=i):i=e[8],i}let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(x,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[9]=o):o=e[9];let l;return e[10]!==d?(l=t.jsx(f.Suspense,{fallback:o,children:t.jsx(d,{})}),e[10]=d,e[11]=l):l=e[11],l}export{F as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as v}from"./index-yjsBu7QA.js";import"./constants-gYpJq1UH.js";import{g as A}from"./github-icon-Dp3wHhYE.js";import{g as D}from"./registry-utils-BNFgymSf.js";import{g as H}from"./generate-id-Dyweu44Y.js";const z=({size:e=24,color:r="currentColor",...c})=>v.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...c},v.createElement("path",{d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));z.displayName="CheckCircle";const L="mcp.mesh";function O(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function R(e){const r=e?.identifier||e?.name;return r?r.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown"}function K(e,r,c,i){const n=e.server,t=e._meta?.[L],m=new Date().toISOString(),b=t?.friendlyName||t?.friendly_name||e.title||n?.title||n?.name||"Unnamed MCP Server",x=n?.description||null,C=n?.icons?.[0]?.src||A(n?.repository)||null,o=t?.oauth_config,N=o&&typeof o.authorizationEndpoint=="string"&&typeof o.tokenEndpoint=="string"&&typeof o.clientId=="string"&&Array.isArray(o.scopes)&&(o.grantType==="authorization_code"||o.grantType==="client_credentials")?o:null,w=t?.configuration_state,I=t?.configuration_scopes,P=n?.repository?{url:n.repository.url,source:n.repository.source,subfolder:n.repository.subfolder}:null,p=n?.packages??[],f=n?.remotes??[],S=i?.packageIndex??0,T=i?.remoteIndex??0,h=p.length>0&&i?.packageIndex!==void 0,a=h?p[S]:null,s=h?null:f[T];let l,u,y=null;if(a){const _=a.identifier||a.name;l="STDIO",u="";const g={};if(a.environmentVariables)for(const k of a.environmentVariables)k.name&&(g[k.name]="");y={command:"npx",args:_?["-y",_]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(l=D(s.type)||"HTTP",u=s.url||""):(l="HTTP",u="");const E=f.length>1,M=p.length>1;let d="";a&&M?d=` (${R(a)})`:s&&E&&(d=` (${O(s)})`);const U=b+d;return{id:H("conn"),title:U,description:x,icon:C,app_name:t?.appName||n?.name||null,app_id:t?.id||e.id||null,connection_type:l,connection_url:u,connection_token:null,connection_headers:y,oauth_config:N,configuration_state:w??null,configuration_scopes:I??null,metadata:{source:"store",registry_item_id:e.id,verified:t?.verified??!1,scopeName:t?.scopeName??null,toolsCount:t?.tools?.length??0,publishedAt:t?.publishedAt??null,repository:P},created_at:m,updated_at:m,created_by:c,organization_id:r,tools:null,bindings:null,status:"inactive"}}export{L as M,K as e,z as i};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/grid-view-Bj9WDB_-.js","assets/index-yjsBu7QA.js","assets/index-CU94_QoM.css","assets/button-BNRw8VbO.js","assets/AlertCircle-B7sqll3Z.js","assets/Download01-oP6u6TmF.js","assets/File02-DlRIy2xF.js","assets/File06-2dtWfDa_.js","assets/Image01-CILGPgam.js","assets/Loading01-D8raUT2q.js","assets/Trash01-CR6s5yrj.js","assets/Upload01-CkSc1CyA.js","assets/useMutation-VOj1VEf8.js","assets/useQuery-C5RIveiE.js","assets/useInfiniteQuery-C34Ot4VI.js","assets/infiniteQueryObserver-D_8FFQdU.js","assets/checkbox-D0Zw7dGS.js","assets/Check-lN7sUZo8.js","assets/ChevronRight-BB2YL4K4.js","assets/Grid01-DHptyetH.js","assets/Home02-CwpXJj-n.js","assets/List-Dl-Bi1Os.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as M,c as K,bk as Q,bl as A,a1 as Y,j as t,v as D,bm as X,a3 as ee}from"./index-yjsBu7QA.js";import{u as te}from"./useInfiniteQuery-C34Ot4VI.js";import{B as _,c as J}from"./button-BNRw8VbO.js";import{C as U}from"./checkbox-D0Zw7dGS.js";import{i as se}from"./AlertCircle-B7sqll3Z.js";import{i as ae}from"./ChevronRight-BB2YL4K4.js";import{n as ie}from"./Download01-oP6u6TmF.js";import{i as re}from"./File02-DlRIy2xF.js";import{c as G}from"./Grid01-DHptyetH.js";import{a as oe}from"./Home02-CwpXJj-n.js";import{i as V}from"./List-Dl-Bi1Os.js";import{i as L}from"./Loading01-D8raUT2q.js";import{s as W}from"./Trash01-CR6s5yrj.js";import{i as $}from"./Upload01-CkSc1CyA.js";import{u as q}from"./useMutation-VOj1VEf8.js";const Z=({size:s=24,color:e="currentColor",...i})=>M.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},M.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm10 10v-6m-3 3h6"}));Z.displayName="FolderPlus";const R={objects:(s,e,i=!1,o=100)=>["object-storage","objects",s,e,{flat:i,pageSize:o}],metadata:(s,e)=>["object-storage","metadata",s,e],imagePreview:(s,e)=>["object-storage","image-preview",s,e]},ne=100;function le(s){const e=K.c(30);let i;e[0]!==s?(i=s===void 0?{}:s,e[0]=s,e[1]=i):i=e[1];const o=i,{prefix:n,flat:x,pageSize:d}=o,m=n===void 0?"":n,l=x===void 0?!1:x,c=d===void 0?ne:d,{connectionId:b,toolCaller:S}=Q();let f;e[2]!==b||e[3]!==l||e[4]!==c||e[5]!==m?(f=R.objects(b,m,l,c),e[2]=b,e[3]=l,e[4]=c,e[5]=m,e[6]=f):f=e[6];let u;e[7]!==l||e[8]!==c||e[9]!==m||e[10]!==S?(u=async a=>{const{pageParam:r}=a;return await S("LIST_OBJECTS",{prefix:m||void 0,maxKeys:c,continuationToken:r,delimiter:l?void 0:"/"})},e[7]=l,e[8]=c,e[9]=m,e[10]=S,e[11]=u):u=e[11];let E;e[12]!==f||e[13]!==u?(E={queryKey:f,queryFn:u,initialPageParam:void 0,getNextPageParam:ge,staleTime:3e4},e[12]=f,e[13]=u,e[14]=E):E=e[14];const{data:p,isLoading:z,isFetchingNextPage:g,hasNextPage:y,fetchNextPage:h,error:w}=te(E);let v;if(l){let a;e[15]!==p?.pages?(a=p?.pages.flatMap(he).filter(pe).map(xe)??[],e[15]=p?.pages,e[16]=a):a=e[16],v=a}else{let a;if(e[17]!==p?.pages){const r=p?.pages[0]?.commonPrefixes?.map(ue)??[],j=p?.pages.flatMap(de)??[];a=[...r.sort(ce),...j],e[17]=p?.pages,e[18]=a}else a=e[18];v=a}let N;e[19]!==h||e[20]!==y||e[21]!==g?(N=()=>{y&&!g&&h()},e[19]=h,e[20]=y,e[21]=g,e[22]=N):N=e[22];const C=N,F=y??!1,P=w;let k;return e[23]!==g||e[24]!==z||e[25]!==C||e[26]!==v||e[27]!==P||e[28]!==F?(k={objects:v,isLoading:z,isFetchingMore:g,hasMore:F,loadMore:C,error:P},e[23]=g,e[24]=z,e[25]=C,e[26]=v,e[27]=P,e[28]=F,e[29]=k):k=e[29],k}function ce(s,e){return s.key.localeCompare(e.key)}function de(s){return s.objects.filter(fe).map(me)}function me(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function fe(s){return!s.key.endsWith("/")}function ue(s){return{key:s,size:0,lastModified:"",etag:"",isFolder:!0}}function xe(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function pe(s){return!s.key.endsWith("/")}function he(s){return s.objects}function ge(s){return s.nextContinuationToken}function I(s){const e=s.split("/").filter(Boolean);return e[e.length-1]||s}function je(s){if(s===0)return"0 B";const e=["B","KB","MB","GB","TB"],i=1024,o=Math.floor(Math.log(s)/Math.log(i));return`${parseFloat((s/Math.pow(i,o)).toFixed(1))} ${e[o]}`}function ye(s){return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ve(s){const e=[],i=s.split("/").filter(Boolean);let o="";for(const n of i)o+=n+"/",e.push({name:n,path:o});return e}function Re(s,e){switch(s.split(".").pop()?.toLowerCase()){case"jpg":case"jpeg":case"png":case"gif":case"webp":case"svg":return"Image01";case"mp4":case"mov":case"avi":case"webm":return"VideoRecorder";case"mp3":case"wav":case"ogg":return"Music01";case"pdf":return"File06";case"zip":case"tar":case"gz":case"rar":return"File07";case"js":case"ts":case"tsx":case"jsx":case"json":case"html":case"css":return"FileCode01";case"md":case"txt":return"File04";default:return"File02"}}const Ne=M.lazy(()=>X(()=>import("./grid-view-Bj9WDB_-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])));function be(s){const e=K.c(50),{item:i,selected:o,showFullPath:n,onSelect:x,onNavigate:d,onDownload:m,onDelete:l}=s,c=n===void 0?!1:n;let b;e[0]!==i.key||e[1]!==c?(b=c?i.key:I(i.key),e[0]=i.key,e[1]=c,e[2]=b):b=e[2];const S=b;let f;e[3]!==x||e[4]!==o?(f=t.jsx(U,{checked:o,onCheckedChange:x,className:"opacity-0 group-hover:opacity-100 focus:opacity-100 data-[state=checked]:opacity-100"}),e[3]=x,e[4]=o,e[5]=f):f=e[5];let u;e[6]!==i.isFolder||e[7]!==i.key||e[8]!==d?(u=()=>i.isFolder?d(i.key):void 0,e[6]=i.isFolder,e[7]=i.key,e[8]=d,e[9]=u):u=e[9];const E=i.isFolder&&"cursor-pointer hover:text-primary";let p;e[10]!==E?(p=J("flex items-center gap-2 flex-1 min-w-0 text-left",E),e[10]=E,e[11]=p):p=e[11];let z;e[12]!==i.isFolder?(z=i.isFolder?t.jsx(ee,{size:18,className:"text-amber-500 shrink-0"}):t.jsx(re,{size:18,className:"text-muted-foreground shrink-0"}),e[12]=i.isFolder,e[13]=z):z=e[13];let g;e[14]!==S?(g=t.jsx("span",{className:"truncate",children:S}),e[14]=S,e[15]=g):g=e[15];let y;e[16]!==u||e[17]!==p||e[18]!==z||e[19]!==g?(y=t.jsxs("button",{type:"button",onClick:u,className:p,children:[z,g]}),e[16]=u,e[17]=p,e[18]=z,e[19]=g,e[20]=y):y=e[20];let h;e[21]!==i.isFolder||e[22]!==i.size?(h=i.isFolder?"-":je(i.size),e[21]=i.isFolder,e[22]=i.size,e[23]=h):h=e[23];let w;e[24]!==h?(w=t.jsx("span",{className:"text-sm text-muted-foreground w-20 text-right shrink-0",children:h}),e[24]=h,e[25]=w):w=e[25];let v;e[26]!==i.isFolder||e[27]!==i.lastModified?(v=i.isFolder?"-":ye(i.lastModified),e[26]=i.isFolder,e[27]=i.lastModified,e[28]=v):v=e[28];let N;e[29]!==v?(N=t.jsx("span",{className:"text-sm text-muted-foreground w-28 text-right shrink-0",children:v}),e[29]=v,e[30]=N):N=e[30];let C;e[31]!==i.isFolder||e[32]!==i.key||e[33]!==m?(C=!i.isFolder&&t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0",onClick:()=>m(i.key),children:t.jsx(ie,{size:14})}),e[31]=i.isFolder,e[32]=i.key,e[33]=m,e[34]=C):C=e[34];let F;e[35]!==i.key||e[36]!==l?(F=()=>l(i.key),e[35]=i.key,e[36]=l,e[37]=F):F=e[37];let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(W,{size:14}),e[38]=P):P=e[38];let k;e[39]!==F?(k=t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F,children:P}),e[39]=F,e[40]=k):k=e[40];let a;e[41]!==C||e[42]!==k?(a=t.jsxs("div",{className:"flex items-center gap-1 w-16 justify-end shrink-0 opacity-0 group-hover:opacity-100",children:[C,k]}),e[41]=C,e[42]=k,e[43]=a):a=e[43];let r;return e[44]!==w||e[45]!==N||e[46]!==a||e[47]!==f||e[48]!==y?(r=t.jsxs("div",{className:"group flex items-center gap-3 px-4 py-2 hover:bg-muted/50 border-b border-border last:border-b-0",children:[f,y,w,N,a]}),e[44]=w,e[45]=N,e[46]=a,e[47]=f,e[48]=y,e[49]=r):r=e[49],r}function H(s){const e=K.c(8),{prefix:i,onNavigate:o}=s;let n;if(e[0]!==o||e[1]!==i){const x=ve(i);let d;e[3]!==o?(d=()=>o(""),e[3]=o,e[4]=d):d=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(oe,{size:16}),e[5]=m):m=e[5];let l;e[6]!==d?(l=t.jsx("button",{type:"button",onClick:d,className:"flex items-center gap-1 text-muted-foreground hover:text-foreground",children:m}),e[6]=d,e[7]=l):l=e[7],n=t.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[l,x.map((c,b)=>t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ae,{size:14,className:"text-muted-foreground"}),t.jsx("button",{type:"button",onClick:()=>o(c.path),className:J("hover:text-primary",b===x.length-1?"font-medium text-foreground":"text-muted-foreground"),children:c.name})]},c.path))]}),e[0]=o,e[1]=i,e[2]=n}else n=e[2];return n}function ke(){const{path:s="",flat:e=!1,view:i="table"}=A.useSearch({from:"/"}),o=A.useNavigate(),[n,x]=M.useState(new Set),d=a=>{x(new Set),o({to:"/",search:{path:a||void 0,flat:e,view:i}})},m=a=>{x(new Set),o({to:"/",search:{path:a?void 0:s||void 0,flat:a,view:i}})},l=a=>{x(new Set),o({to:"/",search:{path:s||void 0,flat:e,view:a}})},c=M.useRef(null),b=Y(),{connectionId:S,toolCaller:f}=Q(),{objects:u,isLoading:E,isFetchingMore:p,hasMore:z,loadMore:g,error:y}=le({prefix:s,flat:e}),h=q({mutationFn:async a=>{const r=s+a.name,{url:j}=await f("PUT_PRESIGNED_URL",{key:r,contentType:a.type||"application/octet-stream"}),T=await fetch(j,{method:"PUT",body:a,headers:{"Content-Type":a.type||"application/octet-stream"}});if(!T.ok)throw new Error(`Upload failed: ${T.statusText}`);return r},onSuccess:a=>{D.success(`Uploaded ${I(a)}`),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:a=>{D.error(`Upload failed: ${a.message}`)}}),w=q({mutationFn:async a=>a.length===1&&a[0]?f("DELETE_OBJECT",{key:a[0]}):f("DELETE_OBJECTS",{keys:a}),onSuccess:()=>{D.success("Deleted successfully"),x(new Set),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:a=>{D.error(`Delete failed: ${a.message}`)}}),v=async a=>{try{const{url:r}=await f("GET_PRESIGNED_URL",{key:a}),j=await fetch(r);if(!j.ok)throw new Error(`Failed to fetch file: ${j.statusText}`);const T=await j.blob(),O=URL.createObjectURL(T),B=document.createElement("a");B.href=O,B.download=I(a),document.body.appendChild(B),B.click(),document.body.removeChild(B),URL.revokeObjectURL(O)}catch(r){D.error(`Download failed: ${r instanceof Error?r.message:"Unknown error"}`)}},N=a=>{const r=a.target.files;if(r){for(const j of Array.from(r))h.mutate(j);a.target.value=""}},C=(a,r)=>{const j=new Set(n);r?j.add(a):j.delete(a),x(j)},F=a=>{x(a?new Set(u.map(r=>r.key)):new Set)},P=()=>{n.size!==0&&w.mutate(Array.from(n))},k=a=>{if(!z||p)return;const r=a.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<200&&g()};return y?t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(se,{size:48,className:"text-destructive mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),t.jsx("p",{className:"text-muted-foreground text-center",children:y.message})]}):i==="grid"?t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(H,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(U,{checked:!e,onCheckedChange:a=>m(!a)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:i==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(G,{size:16})}),t.jsx(_,{variant:i==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx(L,{size:14,className:"mr-1 animate-spin"}):t.jsx($,{size:14,className:"mr-1"}),"Upload"]})]})]}),t.jsx(M.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ne,{prefix:s,flat:e,onNavigate:d})})]}):t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(H,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(U,{checked:!e,onCheckedChange:a=>m(!a)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:i==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(G,{size:16})}),t.jsx(_,{variant:i==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[n.size>0&&t.jsxs(_,{variant:"outline",size:"sm",className:"text-destructive",onClick:P,disabled:w.isPending,children:[t.jsx(W,{size:14,className:"mr-1"}),"Delete (",n.size,")"]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx(L,{size:14,className:"mr-1 animate-spin"}):t.jsx($,{size:14,className:"mr-1"}),"Upload"]})]})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-border bg-muted/30 text-sm font-medium text-muted-foreground",children:[t.jsx(U,{checked:n.size>0&&n.size===u.length,onCheckedChange:F}),t.jsx("span",{className:"flex-1",children:"Name"}),t.jsx("span",{className:"w-20 text-right",children:"Size"}),t.jsx("span",{className:"w-28 text-right",children:"Modified"}),t.jsx("span",{className:"w-16"})]}),t.jsx("div",{className:"flex-1 overflow-y-auto",onScroll:k,children:E?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[t.jsx(L,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):u.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(Z,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),t.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),t.jsxs(_,{variant:"outline",onClick:()=>c.current?.click(),children:[t.jsx($,{size:14,className:"mr-1"}),"Upload files"]})]}):t.jsxs(t.Fragment,{children:[u.map(a=>t.jsx(be,{item:a,selected:n.has(a.key),showFullPath:e,onSelect:r=>C(a.key,r),onNavigate:d,onDownload:v,onDelete:r=>w.mutate([r])},a.key)),p&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx(L,{size:20,className:"animate-spin text-muted-foreground"})})]})})]})}const Ie=Object.freeze(Object.defineProperty({__proto__:null,default:ke},Symbol.toStringTag,{value:"Module"}));export{R as K,Re as a,Ie as b,je as f,I as g,Z as s,le as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as v,c as M,bk as D,j as s,a1 as q,v as w,a3 as H}from"./index-yjsBu7QA.js";import{K as L,u as Z,g as R,s as Q,a as W,f as U}from"./file-browser-xiIO0qLw.js";import{c as I,B as E}from"./button-BNRw8VbO.js";import{i as S}from"./AlertCircle-B7sqll3Z.js";import{n as A}from"./Download01-oP6u6TmF.js";import{i as $}from"./File02-DlRIy2xF.js";import{i as J}from"./File06-2dtWfDa_.js";import{a as P}from"./Image01-CILGPgam.js";import{i as T}from"./Loading01-D8raUT2q.js";import{s as V}from"./Trash01-CR6s5yrj.js";import{i as Y}from"./Upload01-CkSc1CyA.js";import{u as _}from"./useMutation-VOj1VEf8.js";import{u as X}from"./useQuery-C5RIveiE.js";import"./useInfiniteQuery-C34Ot4VI.js";import"./infiniteQueryObserver-D_8FFQdU.js";import"./checkbox-D0Zw7dGS.js";import"./Check-lN7sUZo8.js";import"./ChevronRight-BB2YL4K4.js";import"./Grid01-DHptyetH.js";import"./Home02-CwpXJj-n.js";import"./List-Dl-Bi1Os.js";const B=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 8 15.04 8 15.6 8h4.13M20 9.988V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));B.displayName="File04";const G=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M8 15v3m8-5v5m-4-7.5V18m8-8.012V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));G.displayName="File07";const K=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M14 17.5l2.5-2.5-2.5-2.5m-4 0L7.5 15l2.5 2.5m10-7.512V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));K.displayName="FileCode01";const O=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M22 8.931c0-.605 0-.908-.12-1.049a.5.5 0 0 0-.42-.173c-.183.014-.397.228-.826.657L17 12l3.634 3.634c.429.429.643.643.827.657a.5.5 0 0 0 .42-.173c.119-.14.119-.444.119-1.05V8.932ZM2 9.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 5 5.12 5 6.8 5h5.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C17 7.28 17 8.12 17 9.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C14.72 19 13.88 19 12.2 19H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 16.72 2 15.88 2 14.2V9.8Z"}));O.displayName="VideoRecorder";function ee(i){const e=M.c(5),[t,g]=v.useState(!1),c=v.useRef(null),d=v.useRef(!1);let n;e[0]!==i?(n=u=>{c.current&&(c.current.disconnect(),c.current=null),u&&!d.current&&(c.current=new IntersectionObserver(y=>{const[a]=y;a?.isIntersecting&&!d.current&&(d.current=!0,g(!0),c.current?.disconnect(),c.current=null)},i),c.current.observe(u))},e[0]=i,e[1]=n):n=e[1];const l=n;let h;return e[2]!==t||e[3]!==l?(h=[t,l],e[2]=t,e[3]=l,e[4]=h):h=e[4],h}function te(i){const e=M.c(24),{objectKey:t,alt:g,className:c}=i,d=c===void 0?"":c,{connectionId:n,toolCaller:l}=D();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={rootMargin:"100px",threshold:0},e[0]=h):h=e[0];const[u,y]=ee(h);let a;e[1]!==n||e[2]!==t?(a=L.imagePreview(n,t),e[1]=n,e[2]=t,e[3]=a):a=e[3];let f;e[4]!==t||e[5]!==l?(f=async()=>{const{url:m}=await l("GET_PRESIGNED_URL",{key:t});return m},e[4]=t,e[5]=l,e[6]=f):f=e[6];let k;e[7]!==u||e[8]!==a||e[9]!==f?(k={queryKey:a,queryFn:f,enabled:u,staleTime:3e5,gcTime:6e5},e[7]=u,e[8]=a,e[9]=f,e[10]=k):k=e[10];const{data:b,isLoading:x,error:j}=X(k);let p;e[11]!==d?(p=I("relative w-full h-full flex items-center justify-center overflow-hidden",d),e[11]=d,e[12]=p):p=e[12];let r;e[13]!==g||e[14]!==j||e[15]!==b||e[16]!==x||e[17]!==u||e[18]!==t?(r=!u||x?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:x?s.jsx(T,{size:24,className:"animate-spin"}):s.jsx(P,{size:48})}):j?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:s.jsx(S,{size:24})}):b?s.jsx("img",{src:b,alt:g||t,className:"w-full h-full object-cover",loading:"lazy"}):null,e[13]=g,e[14]=j,e[15]=b,e[16]=x,e[17]=u,e[18]=t,e[19]=r):r=e[19];let o;return e[20]!==y||e[21]!==p||e[22]!==r?(o=s.jsx("div",{ref:y,className:p,children:r}),e[20]=y,e[21]=p,e[22]=r,e[23]=o):o=e[23],o}const z=12,se={Image01:P,VideoRecorder:O,Music01:$,File02:$,File04:B,File06:J,File07:G,FileCode01:K,Folder:H};function re(i){const e=i.split(".").pop()?.toLowerCase();return["jpg","jpeg","png","gif","webp","svg","bmp","ico"].includes(e||"")}function oe(i){const e=M.c(41),{item:t,onNavigate:g,onDownload:c,onDelete:d}=i;let n;e[0]!==t.key?(n=R(t.key),e[0]=t.key,e[1]=n):n=e[1];const l=n,h=t.isFolder?"Folder":W(t.key),u=se[h]||$;let y;e[2]!==t.isFolder||e[3]!==t.key?(y=!t.isFolder&&re(t.key),e[2]=t.isFolder,e[3]=t.key,e[4]=y):y=e[4];const a=y;let f;e[5]!==t.isFolder||e[6]!==t.key||e[7]!==g?(f=()=>t.isFolder?g(t.key):void 0,e[5]=t.isFolder,e[6]=t.key,e[7]=g,e[8]=f):f=e[8];const k=!a&&"p-4",b=t.isFolder?"cursor-pointer":"cursor-default";let x;e[9]!==k||e[10]!==b?(x=I("flex flex-col items-center justify-center w-full h-full",k,b),e[9]=k,e[10]=b,e[11]=x):x=e[11];let j;e[12]!==u||e[13]!==a||e[14]!==t.isFolder||e[15]!==t.key||e[16]!==l?(j=a?s.jsx("div",{className:"absolute inset-0",children:s.jsx(te,{objectKey:t.key,alt:l})}):s.jsx(u,{size:48,className:I(t.isFolder?"text-amber-500":"text-muted-foreground")}),e[12]=u,e[13]=a,e[14]=t.isFolder,e[15]=t.key,e[16]=l,e[17]=j):j=e[17];let p;e[18]!==a||e[19]!==t.isFolder||e[20]!==t.size||e[21]!==l?(p=a?s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2 pt-6",children:[s.jsx("span",{className:"text-sm text-white text-center line-clamp-1 block",children:l}),s.jsx("span",{className:"text-xs text-white/70 text-center block",children:U(t.size)})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mt-3 text-sm text-center line-clamp-2 px-2",children:l}),!t.isFolder&&s.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:U(t.size)})]}),e[18]=a,e[19]=t.isFolder,e[20]=t.size,e[21]=l,e[22]=p):p=e[22];let r;e[23]!==f||e[24]!==x||e[25]!==j||e[26]!==p?(r=s.jsxs("button",{type:"button",onClick:f,className:x,children:[j,p]}),e[23]=f,e[24]=x,e[25]=j,e[26]=p,e[27]=r):r=e[27];let o;e[28]!==t.isFolder||e[29]!==t.key||e[30]!==d||e[31]!==c?(o=!t.isFolder&&s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0",onClick:F=>{F.stopPropagation(),c(t.key)},children:s.jsx(A,{size:14})}),s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})]}),e[28]=t.isFolder,e[29]=t.key,e[30]=d,e[31]=c,e[32]=o):o=e[32];let m;e[33]!==t.isFolder||e[34]!==t.key||e[35]!==d?(m=t.isFolder&&s.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})}),e[33]=t.isFolder,e[34]=t.key,e[35]=d,e[36]=m):m=e[36];let N;return e[37]!==o||e[38]!==m||e[39]!==r?(N=s.jsxs("div",{className:"group relative aspect-square bg-muted/30 rounded-lg border border-border hover:border-primary/50 hover:bg-muted/50 transition-colors overflow-hidden",children:[r,o,m]}),e[37]=o,e[38]=m,e[39]=r,e[40]=N):N=e[40],N}function we({prefix:i,flat:e,onNavigate:t}){const g=v.useRef(null),c=q(),{connectionId:d,toolCaller:n}=D(),{objects:l,isLoading:h,isFetchingMore:u,hasMore:y,loadMore:a,error:f}=Z({prefix:i,flat:e,pageSize:z}),k=_({mutationFn:async r=>{const o=i+r.name,{url:m}=await n("PUT_PRESIGNED_URL",{key:o,contentType:r.type||"application/octet-stream"}),N=await fetch(m,{method:"PUT",body:r,headers:{"Content-Type":r.type||"application/octet-stream"}});if(!N.ok)throw new Error(`Upload failed: ${N.statusText}`);return o},onSuccess:r=>{w.success(`Uploaded ${R(r)}`),c.invalidateQueries({queryKey:L.objects(d,i,e,z)})},onError:r=>{w.error(`Upload failed: ${r.message}`)}}),b=_({mutationFn:async r=>r.length===1&&r[0]?n("DELETE_OBJECT",{key:r[0]}):n("DELETE_OBJECTS",{keys:r}),onSuccess:()=>{w.success("Deleted successfully"),c.invalidateQueries({queryKey:L.objects(d,i,e,z)})},onError:r=>{w.error(`Delete failed: ${r.message}`)}}),x=async r=>{try{const{url:o}=await n("GET_PRESIGNED_URL",{key:r}),m=await fetch(o);if(!m.ok)throw new Error(`Failed to fetch file: ${m.statusText}`);const N=await m.blob(),F=URL.createObjectURL(N),C=document.createElement("a");C.href=F,C.download=R(r),document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(F)}catch(o){w.error(`Download failed: ${o instanceof Error?o.message:"Unknown error"}`)}},j=r=>{const o=r.target.files;if(o){for(const m of Array.from(o))k.mutate(m);r.target.value=""}},p=r=>{if(!y||u)return;const o=r.currentTarget;o.scrollHeight-o.scrollTop-o.clientHeight<200&&a()};return f?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(S,{size:48,className:"text-destructive mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),s.jsx("p",{className:"text-muted-foreground text-center",children:f.message})]}):s.jsx("div",{className:"flex-1 overflow-y-auto p-4",onScroll:p,children:h?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[s.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):l.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Q,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),s.jsx("input",{ref:g,type:"file",multiple:!0,className:"hidden",onChange:j}),s.jsxs(E,{variant:"outline",onClick:()=>g.current?.click(),children:[s.jsx(Y,{size:14,className:"mr-1"}),"Upload files"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:l.map(r=>s.jsx(oe,{item:r,onNavigate:t,onDownload:x,onDelete:o=>b.mutate([o])},r.key))}),u&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(T,{size:24,className:"animate-spin text-muted-foreground"})})]})})}export{we as default};
|