@decocms/mesh 2.133.2 → 2.134.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BIVpB2eV.js → AlertCircle-dxGFeayp.js} +1 -1
- package/dist/client/assets/{AlignLeft-DWMdThfD.js → AlignLeft-zf4ygcA_.js} +1 -1
- package/dist/client/assets/{ArrowDown-CnXnoX-V.js → ArrowDown-BfANN175.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CvCy8CyB.js → ArrowLeft-DKmEJ5pf.js} +1 -1
- package/dist/client/assets/{ArrowUp-8t9O2FqG.js → ArrowUp-BNm6R5tp.js} +1 -1
- package/dist/client/assets/{Check-Bs28PslG.js → Check-BuBqfL8V.js} +1 -1
- package/dist/client/assets/{CheckCircle-BnSsCPeL.js → CheckCircle-B-t884rD.js} +1 -1
- package/dist/client/assets/{CheckDone01-GZyUwk0p.js → CheckDone01-C_N43WOE.js} +1 -1
- package/dist/client/assets/{CheckVerified02-CmWWqvRE.js → CheckVerified02-CF--qrDr.js} +1 -1
- package/dist/client/assets/{ChevronDown-CIw5H_8I.js → ChevronDown-D15Vpp0r.js} +1 -1
- package/dist/client/assets/{ChevronLeft-fmgWXUdB.js → ChevronLeft-CJX984rp.js} +1 -1
- package/dist/client/assets/{ChevronRight-8LnYcsyR.js → ChevronRight-u7jqeZNG.js} +1 -1
- package/dist/client/assets/{Clock-D17OAEFV.js → Clock-B88-VhpY.js} +1 -1
- package/dist/client/assets/{Code01-C0MNem7b.js → Code01-DhSY1b20.js} +1 -1
- package/dist/client/assets/{Container-C4kCziiV.js → Container-CFxptFeR.js} +1 -1
- package/dist/client/assets/{Copy01-Czr6qLQt.js → Copy01-D2l3XUry.js} +1 -1
- package/dist/client/assets/{Dataflow03-COO3w9be.js → Dataflow03-TMmWfgl9.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-cZJVkNRf.js → DotsHorizontal-CZq86zFa.js} +1 -1
- package/dist/client/assets/{DotsVertical-D9CMW5-2.js → DotsVertical-B78gtBdB.js} +1 -1
- package/dist/client/assets/{Download01-B6ed2sYF.js → Download01-DDJLkXru.js} +1 -1
- package/dist/client/assets/{Edit01-DLZcWIR-.js → Edit01-CbZPkCJz.js} +1 -1
- package/dist/client/assets/{Eye-DPTzoZL8.js → Eye-vR70tVFn.js} +1 -1
- package/dist/client/assets/{File02-Cgzx7ek0.js → File02-B1NunE2J.js} +1 -1
- package/dist/client/assets/{File06-BzbT2v0z.js → File06-D8w_IYOr.js} +1 -1
- package/dist/client/assets/{FilterLines-BilIABo8.js → FilterLines-BY-bo6_s.js} +1 -1
- package/dist/client/assets/{Globe01-BVjXPHzv.js → Globe01-CL7GrOsx.js} +1 -1
- package/dist/client/assets/{Globe02-vxtQsT0f.js → Globe02-6j3SB4QZ.js} +1 -1
- package/dist/client/assets/{Grid01-CILFuUHo.js → Grid01-DjcW2Js4.js} +1 -1
- package/dist/client/assets/{Hash02-BfcBwRkC.js → Hash02-BMwtcDtI.js} +1 -1
- package/dist/client/assets/{Home02-rg_Tmz0p.js → Home02-CMWrNstp.js} +1 -1
- package/dist/client/assets/{Image01-B_6vFaZi.js → Image01-oZtE9Z5q.js} +1 -1
- package/dist/client/assets/{Inbox01-DNp0SuVa.js → Inbox01-xF_R8liT.js} +1 -1
- package/dist/client/assets/{InfoCircle-D_SeJKcX.js → InfoCircle-B_WtF_e0.js} +1 -1
- package/dist/client/assets/{Key01-BjbQkebS.js → Key01-Cvjt_ykt.js} +1 -1
- package/dist/client/assets/{LayersTwo01-BexG7k2g.js → LayersTwo01-f778oNbj.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CN9jLsLc.js → LayoutLeft-BXJHafgx.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DPyIyKMU.js → LinkExternal01-DY3cItdE.js} +1 -1
- package/dist/client/assets/{List-BcuB27Kb.js → List-Be3XBHwN.js} +1 -1
- package/dist/client/assets/{Loading01-W-w3cVps.js → Loading01-BLoQsWVt.js} +1 -1
- package/dist/client/assets/{Lock01-C37ifJ66.js → Lock01-Cj3RiFKG.js} +1 -1
- package/dist/client/assets/{Play-BVXIxZqO.js → Play-CCz3CWMJ.js} +1 -1
- package/dist/client/assets/{Plus-7RI9qITc.js → Plus-4zX3n4bH.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-BM6X0J3F.js → RefreshCcw01-DzE0Vt_s.js} +1 -1
- package/dist/client/assets/{Save01-83pceB_J.js → Save01-DiUMsefH.js} +1 -1
- package/dist/client/assets/{SearchMd-BzFnoImC.js → SearchMd-BvHN4xgB.js} +1 -1
- package/dist/client/assets/{Settings01-D3dDBLbY.js → Settings01-B5kunEo2.js} +1 -1
- package/dist/client/assets/{Shield01-qdbJX99G.js → Shield01-DrTQ94s0.js} +1 -1
- package/dist/client/assets/{Terminal-DEkQfpQH.js → Terminal-DQnj9LXz.js} +1 -1
- package/dist/client/assets/{Trash01-BsNnpu_l.js → Trash01-BvIumE4M.js} +1 -1
- package/dist/client/assets/{Upload01-Jb2KX5F9.js → Upload01-DLPOqCLa.js} +1 -1
- package/dist/client/assets/{Users03-BY0qO7qD.js → Users03-CUxh9_Jy.js} +1 -1
- package/dist/client/assets/{X-B9LxUp5o.js → X-CpsrVd7E.js} +1 -1
- package/dist/client/assets/{XCircle-Dkkdz5ph.js → XCircle-BcvU_Xzf.js} +1 -1
- package/dist/client/assets/{XClose-7hYEQUhK.js → XClose-CnTCpAeI.js} +1 -1
- package/dist/client/assets/{Zap-iEj-0nMA.js → Zap-BACXfgKn.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-DNcTIqVr.js → agent-connections-preview-BTescy5G.js} +1 -1
- package/dist/client/assets/{agent-detail-BdpmQjrg.js → agent-detail-C9_VIiuY.js} +1 -1
- package/dist/client/assets/{agents-kyg0nDcz.js → agents-DkUxuyJc.js} +1 -1
- package/dist/client/assets/{alert-dialog-DQT_qq2D.js → alert-dialog-B0yEBEkb.js} +1 -1
- package/dist/client/assets/{auth-catchall--SSmWnAf.js → auth-catchall-CZYx2ePL.js} +1 -1
- package/dist/client/assets/{avatar-CV6z8E70.js → avatar-BeiX4aSz.js} +1 -1
- package/dist/client/assets/{badge-DaJA40lr.js → badge-UPowR1Nj.js} +1 -1
- package/dist/client/assets/{binder-Bx_2YVEH.js → binder-DUACCYIe.js} +1 -1
- package/dist/client/assets/{breadcrumb-h53M2ozZ.js → breadcrumb-DxXcAXh7.js} +1 -1
- package/dist/client/assets/{card-HOT-tKY7.js → card-BRjix5ol.js} +1 -1
- package/dist/client/assets/{chart-BIHnGavY.js → chart-FIHtzVp6.js} +1 -1
- package/dist/client/assets/{checkbox-C2xwBknU.js → checkbox-Df-Mj-oX.js} +1 -1
- package/dist/client/assets/{circle-alert-BRVau5r5.js → circle-alert-CHATLFG-.js} +1 -1
- package/dist/client/assets/collapsible-CG7okAAn.js +23 -0
- package/dist/client/assets/{collection-detail-C8c5RTfO.js → collection-detail-DnFoqwX5.js} +1 -1
- package/dist/client/assets/{collection-search-DWb-q4sb.js → collection-search-BgstpGbD.js} +1 -1
- package/dist/client/assets/{collection-tab-CGcalnFw.js → collection-tab-CkymCS_K.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-LUpcpQuR.js → collection-table-wrapper-B7II4YYC.js} +1 -1
- package/dist/client/assets/{collection-tabs-wwfnwWzq.js → collection-tabs-nglpt7Dm.js} +1 -1
- package/dist/client/assets/{command-BL2WDnzB.js → command-BvChE5AN.js} +1 -1
- package/dist/client/assets/{connect-BA2fi6ZL.js → connect-C_zUgms_.js} +1 -1
- package/dist/client/assets/{connection-card-CbQYVkic.js → connection-card-DE2PfyYV.js} +1 -1
- package/dist/client/assets/{connection-detail-CqhIu8V8.js → connection-detail-CIlY792n.js} +1 -1
- package/dist/client/assets/{connections-Bqt-ueC2.js → connections-e6eEADmb.js} +1 -1
- package/dist/client/assets/{constants-Bj4b22ad.js → constants--aQ9HnxF.js} +1 -1
- package/dist/client/assets/constants-DoLvwboP.js +1 -0
- package/dist/client/assets/{create-organization-dialog-CHicv9TM.js → create-organization-dialog-BW4s7GqS.js} +1 -1
- package/dist/client/assets/{create-project-dialog-BB0XeLGb.js → create-project-dialog-BMiLf2Mr.js} +1 -1
- package/dist/client/assets/{danger-CYug_-FH.js → danger-BAlOLeDE.js} +1 -1
- package/dist/client/assets/{danger-zone-DJn-yaAs.js → danger-zone-PDtJsuS3.js} +1 -1
- package/dist/client/assets/{decopilot-events-CdHUYzEf.js → decopilot-events-DZodCqX1.js} +1 -1
- package/dist/client/assets/{dependencies-BQ4LI5wU.js → dependencies-DOcreK8_.js} +1 -1
- package/dist/client/assets/{dialog-DDOb23Pi.js → dialog-CrYlSCa6.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BaaJ3KIr.js → dropdown-menu-DvfBJ25L.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DWZ0FIFu.js → dynamic-plugin-layout-1UBvkRf8.js} +1 -1
- package/dist/client/assets/{editable-task-title-nQdI1V_W.js → editable-task-title-emHsd6RF.js} +1 -1
- package/dist/client/assets/{empty-state-cgNnxJVh.js → empty-state-C2LU6BeW.js} +1 -1
- package/dist/client/assets/{env-vars-editor-DIkYTN09.js → env-vars-editor-DM7ragIP.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DSMZDJ4i.js → extract-connection-data-DtOGbK2O.js} +1 -1
- package/dist/client/assets/{file-browser-B5uJssDR.js → file-browser-dzB3GMud.js} +2 -2
- package/dist/client/assets/{form-CZlsOGpj.js → form-DKOb9Dxi.js} +1 -1
- package/dist/client/assets/{general-BPWx4fPN.js → general-C8KCERL-.js} +1 -1
- package/dist/client/assets/{grid-view-Bz5fCwwy.js → grid-view-Dp6SbR5A.js} +1 -1
- package/dist/client/assets/{home-DHOzeT_v.js → home-DpLONLMM.js} +1 -1
- package/dist/client/assets/{index-ehKjC5PZ.js → index-B4YFEuZr.js} +1 -1
- package/dist/client/assets/{index-BiG-bBX7.js → index-BkxNgQ-z.js} +3 -3
- package/dist/client/assets/{index-jbQKqjQl.js → index-Bq_4mEQF.js} +1 -1
- package/dist/client/assets/{index-CBDYR7h7.js → index-CKt9M-ST.js} +1 -1
- package/dist/client/assets/{index-CAR0mh84.js → index-CuJORTyw.js} +1 -1
- package/dist/client/assets/{index-mMuYpq4A.js → index-UbMd2WCz.js} +1 -1
- package/dist/client/assets/{index-B-s7dcGH.js → index-ZJA9ZP0w.js} +1 -1
- package/dist/client/assets/{index-BxikKkX5.js → index-dKQNml8k.js} +1 -1
- package/dist/client/assets/{index-D1gbzHrb.js → index-u5kBBr5i.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BZCRT6X1.js → infiniteQueryObserver-DFroUYRE.js} +1 -1
- package/dist/client/assets/{input-BcOk4EWn.js → input-BxWPl4Ur.js} +1 -1
- package/dist/client/assets/{integration-icon-DJplt18U.js → integration-icon-DqBJsR0X.js} +1 -1
- package/dist/client/assets/{label-BLk50aKt.js → label-DQ6CQRMq.js} +1 -1
- package/dist/client/assets/{layout-6pwn8f6O.js → layout-0mFUwCP9.js} +1 -1
- package/dist/client/assets/{layout-BluQBehB.js → layout-rnNZXdmD.js} +1 -1
- package/dist/client/assets/{localstorage-keys-BS2STbF7.js → localstorage-keys-2beZrYfY.js} +1 -1
- package/dist/client/assets/{login-CGh2490Y.js → login-DcPWsiJb.js} +1 -1
- package/dist/client/assets/{markdown-94xyd8w7.js → markdown-08iefd1w.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CPkL4-A0.js → mcp-app-renderer-DlqJcoS_.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DhVZXZzz.js → mcp-oauth-hrdldmcp.js} +1 -1
- package/dist/client/assets/{mcp-server-card-Csi3P08i.js → mcp-server-card-DopVvusq.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-DPle4t4_.js → mcp-server-detail-6bJ8ASSa.js} +2 -2
- package/dist/client/assets/{members-DdERnJEy.js → members-Do6CpQ6P.js} +1 -1
- package/dist/client/assets/{monitoring-DljoOm7H.js → monitoring-CKBrV8zM.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-CA-n4NwW.js → monitoring-dashboard-edit-CisDX-AH.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-CA9jMLxL.js → monitoring-dashboard-view-CLglwuRf.js} +1 -1
- package/dist/client/assets/{oauth-callback-BeMNWxMx.js → oauth-callback-EWqhoS77.js} +1 -1
- package/dist/client/assets/{page-Dd_JJkvy.js → page-BIGqii57.js} +1 -1
- package/dist/client/assets/{page-B-g-Vlk_.js → page-CrIdFE4e.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-C3IVEK8r.js → plugin-empty-state-AsJFZqlq.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-Beu1zYui.js → plugin-empty-state-DgfbXovL.js} +1 -1
- package/dist/client/assets/{plugin-header-K9IDC0OG.js → plugin-header-CdB0sXQc.js} +1 -1
- package/dist/client/assets/{plugin-header-B0VvIolY.js → plugin-header-DMTu3kKy.js} +1 -1
- package/dist/client/assets/plugins-AJrV2JnY.js +1 -0
- package/dist/client/assets/{popover-Cnhlur36.js → popover-CJnKtmVV.js} +1 -1
- package/dist/client/assets/{project-app-view-DdjQoakQ.js → project-app-view-CrOJlRSX.js} +1 -1
- package/dist/client/assets/{project-layout-COuxbNbP.js → project-layout-CxbfzuHT.js} +1 -1
- package/dist/client/assets/{project-plugins-DlaP9lSP.js → project-plugins-OrxVzBYc.js} +1 -1
- package/dist/client/assets/{projects-list-Cjk5rvoU.js → projects-list-CaeO-dsb.js} +1 -1
- package/dist/client/assets/purify.es-C0_7NiBM.js +2 -0
- package/dist/client/assets/{readme-viewer-D1PTXNQQ.js → readme-viewer-CvFtkeFt.js} +1 -1
- package/dist/client/assets/{registry-layout-C_3CFS9T.js → registry-layout-C_lUsUO4.js} +1 -1
- package/dist/client/assets/{registry-utils-B4prNmYa.js → registry-utils-Bm8aYhvn.js} +1 -1
- package/dist/client/assets/{reports-layout-BTeFiemL.js → reports-layout-COQgk5-M.js} +1 -1
- package/dist/client/assets/{reset-password-BOnVZBj0.js → reset-password-BHTKtR6U.js} +1 -1
- package/dist/client/assets/{resizable-BC2aG7ea.js → resizable-DNctE6m6.js} +1 -1
- package/dist/client/assets/{save-actions-p2U4N3h5.js → save-actions-DgW9lLRI.js} +1 -1
- package/dist/client/assets/{scroll-area-CrSif9aa.js → scroll-area-Ce3JzMbc.js} +1 -1
- package/dist/client/assets/{select-DJV0GpEL.js → select-CHQkyynJ.js} +1 -1
- package/dist/client/assets/{shell-layout-DkJCvYuh.js → shell-layout-CZrDFZIJ.js} +2 -2
- package/dist/client/assets/{sidebar-settings-C9nkZoUb.js → sidebar-settings-C8pM5SP-.js} +1 -1
- package/dist/client/assets/{skeleton-DhcP44Ov.js → skeleton-Bla1LCSZ.js} +1 -1
- package/dist/client/assets/{spinner-DSMOMT7g.js → spinner-B_k6AtHn.js} +1 -1
- package/dist/client/assets/{store-invite-CrF5fKpc.js → store-invite-CVXBjHsb.js} +1 -1
- package/dist/client/assets/{switch-CR-VYNUs.js → switch-BX7m8ylT.js} +1 -1
- package/dist/client/assets/{table-DxvlU5EN.js → table-BJ3W5Geb.js} +1 -1
- package/dist/client/assets/{tabs-C-5F-MJ5.js → tabs-tcquyh90.js} +1 -1
- package/dist/client/assets/tasks-CJro_3w3.js +1 -0
- package/dist/client/assets/{tasks-panel-CmBpoAsV.js → tasks-panel-CIityBOn.js} +1 -1
- package/dist/client/assets/{textarea-Bkod2qAV.js → textarea-CceQB-N2.js} +1 -1
- package/dist/client/assets/{time-range-picker-CygOsj38.js → time-range-picker-B9lHM6xz.js} +1 -1
- package/dist/client/assets/{toggle-group-CwfkuVwg.js → toggle-group-KbsXFu3M.js} +1 -1
- package/dist/client/assets/{tools-list-CmIBKUpX.js → tools-list-Cb9H3DsC.js} +1 -1
- package/dist/client/assets/{tooltip-BacoSwd7.js → tooltip-DvMRS01W.js} +1 -1
- package/dist/client/assets/{topbar-portal-Dfkwqxry.js → topbar-portal-CyxFPAeb.js} +1 -1
- package/dist/client/assets/{types-C6Uddd8z.js → types-9lUbCnT7.js} +1 -1
- package/dist/client/assets/{use-binding-CoVeLP6R.js → use-binding-CVLYzFG-.js} +1 -1
- package/dist/client/assets/{use-connection-CsobI-JA.js → use-connection-DjiXkPUz.js} +1 -1
- package/dist/client/assets/{use-copy-De63ENVh.js → use-copy-DiVO6tbG.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-52zuHZ4A.js → use-create-virtual-mcp-DnOGpm5h.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-BUdVd5Au.js → use-install-from-registry-kgqBLGhb.js} +1 -1
- package/dist/client/assets/{use-list-state-DZ0uTI_k.js → use-list-state-CCFlT7yz.js} +1 -1
- package/dist/client/assets/{use-llm-DTbAtUds.js → use-llm-Bkjj502R.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-ucs4znYI.js → use-mcp-resources-DS8p1Owh.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-nHTt7uoJ.js → use-mcp-tools-CHOGR3no.js} +1 -1
- package/dist/client/assets/{use-members-C4nvWeOW.js → use-members-94lmhn12.js} +1 -1
- package/dist/client/assets/{use-mobile-BwubTGYW.js → use-mobile-BArkW6j1.js} +1 -1
- package/dist/client/assets/{use-project-BVlUC7fM.js → use-project-BRlk9_cU.js} +1 -1
- package/dist/client/assets/{use-settings-modal-BivXkS-c.js → use-settings-modal-QjZt77PI.js} +1 -1
- package/dist/client/assets/{use-view-mode-RJVvlb7k.js → use-view-mode-3_G2qIMG.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-r6ou4ewu.js → use-virtual-mcp-Wj5StsuR.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-cPtxg-KP.js +1 -0
- package/dist/client/assets/{useMutation-Cxle_Mtw.js → useMutation-DtOoZO7h.js} +1 -1
- package/dist/client/assets/useQuery-Cj-miqA2.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-D62VIKAF.js +1 -0
- package/dist/client/assets/{user-DiQL4i6w.js → user-BcEL6pjj.js} +1 -1
- package/dist/client/assets/{workflow-CY-tfdwy.js → workflow-Bdyylvch.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/collapsible-DRIF4wXT.js +0 -23
- package/dist/client/assets/constants-DTlOAYW2.js +0 -1
- package/dist/client/assets/plugins-Cw7F1EwF.js +0 -1
- package/dist/client/assets/purify.es-Bzr520pe.js +0 -2
- package/dist/client/assets/tasks-KFAnwTNo.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BZXsD1Nv.js +0 -1
- package/dist/client/assets/useQuery-Us1whSan.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DcGj9DQ4.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Ae,j as t,B as Ie,b as Ye,d as Ze,u as et,r as tt,O as $e,t as st}from"./index-BiG-bBX7.js";import{g as Oe}from"./generate-id-Dyweu44Y.js";import{a as ot,C as Fe}from"./collection-table-wrapper-LUpcpQuR.js";import{C as it,E as nt}from"./collection-search-DWb-q4sb.js";import{C as rt}from"./card-HOT-tKY7.js";import{I as ke}from"./integration-icon-DJplt18U.js";import{D as Ke,a as Ue,b as Le,c as k}from"./dropdown-menu-BaaJ3KIr.js";import{a as Be}from"./Copy01-Czr6qLQt.js";import{i as Re}from"./DotsVertical-D9CMW5-2.js";import{i as Ve}from"./Edit01-DLZcWIR-.js";import{s as Ge}from"./Eye-DPTzoZL8.js";import{s as Je}from"./Trash01-BsNnpu_l.js";import{E as ze}from"./empty-state-cgNnxJVh.js";import{n as Ee}from"./Inbox01-DNp0SuVa.js";import{U as lt}from"./user-DiQL4i6w.js";import{u as at}from"./use-list-state-DZ0uTI_k.js";import{B as ct}from"./constants-DTlOAYW2.js";import{A as dt,h as pt,c as mt,b as ut,d as ft,e as ht,a as xt,f as gt}from"./alert-dialog-DQT_qq2D.js";import{u as jt,e as Ct}from"./use-connection-CsobI-JA.js";import{u as vt}from"./constants-Bj4b22ad.js";import{s as bt}from"./Plus-7RI9qITc.js";import{V as yt}from"./layout-BluQBehB.js";function Nt(n,e){const s=n.properties||{};for(const i in s){const l=s[i];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const r=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of r)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function wt(n){const e=Ae.c(25),{item:s,schema:r,actions:i}=n;let l;e[0]!==s||e[1]!==r?(l=Nt(r,s),e[0]=s,e[1]=r,e[2]=l):l=e[2];const u=l,p=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let j;e[3]!==i?(j=i&&Object.keys(i).length>0,e[3]=i,e[4]=j):j=e[4];const o=j;let m;e[5]!==u||e[6]!==s.title?(m=t.jsx(ke,{icon:u,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=u,e[6]=s.title,e[7]=m):m=e[7];let f;e[8]!==s.title?(f=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=f):f=e[9];const d=p||"No description";let c;e[10]!==d?(c=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:d}),e[10]=d,e[11]=c):c=e[11];let C;e[12]!==f||e[13]!==c?(C=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[f,c]}),e[12]=f,e[13]=c,e[14]=C):C=e[14];let y;e[15]!==m||e[16]!==C?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[m,C]}),e[15]=m,e[16]=C,e[17]=y):y=e[17];let a;e[18]!==i||e[19]!==o||e[20]!==s?(a=o&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:At,onMouseDown:_t,children:t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Dt,children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:St,children:[i.open&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.open?.(s)},children:[t.jsx(Ge,{size:16}),"Open"]}),i.edit&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.edit?.(s)},children:[t.jsx(Ve,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.duplicate?.(s)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(k,{variant:"destructive",onClick:h=>{h.stopPropagation(),i.delete?.(s)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=o,e[20]=s,e[21]=a):a=e[21];let S;return e[22]!==y||e[23]!==a?(S=t.jsxs(rt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,a]}),e[22]=y,e[23]=a,e[24]=S):S=e[24],S}function St(n){return n.stopPropagation()}function Dt(n){return n.stopPropagation()}function _t(n){return n.stopPropagation()}function At(n){return n.stopPropagation()}const It=["icon","avatar","logo"],Me=["created_at","created_by","id"];function Pt(n){return Object.keys(n).find(e=>It.includes(e.toLowerCase()))}function We(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 Tt(n){const e=Ae.c(32),{data:s,schema:r,viewMode:i,onViewModeChange:l,search:u,sortKey:p,sortDirection:j,onSort:o,actions:m,onItemClick:f,headerActions:d,emptyState:c,readOnly:C,columns:y,hideToolbar:a,sortableFields:S}=n,h=l===void 0?Mt:l,x=j===void 0?"asc":j,P=o===void 0?Et:o;let v;e[0]!==m?(v=m===void 0?{}:m,e[0]=m,e[1]=v):v=e[1];const D=v,_=f===void 0?zt:f,z=d===void 0?null:d,b=c===void 0?null:c,T=C===void 0?!1:C,N=y===void 0?void 0:y,F=a===void 0?!1:a,w=S===void 0?void 0:S;let E;e[2]!==N||e[3]!==r||e[4]!==w?(E=N?N.filter(Ot).filter(M=>!w||w.includes(M.id)).map($t):We(r,w),e[2]=N,e[3]=r,e[4]=w,e[5]=E):E=e[5];const $=E;let A;e[6]!==z||e[7]!==F||e[8]!==P||e[9]!==h||e[10]!==x||e[11]!==p||e[12]!==$||e[13]!==i?(A=!F&&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:z}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Fe,{viewMode:i,onViewModeChange:h,sortKey:p,sortDirection:x,onSort:P,sortOptions:$})})]})}),e[6]=z,e[7]=F,e[8]=P,e[9]=h,e[10]=x,e[11]=p,e[12]=$,e[13]=i,e[14]=A):A=e[14];let O;e[15]!==D||e[16]!==N||e[17]!==s||e[18]!==b||e[19]!==_||e[20]!==P||e[21]!==T||e[22]!==r||e[23]!==u||e[24]!==x||e[25]!==p||e[26]!==w||e[27]!==i?(O=i==="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:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:s.map(M=>t.jsx("div",{onClick:()=>_?.(M),className:"cursor-pointer h-full",children:t.jsx(wt,{item:M,schema:r,readOnly:T,actions:D})},M.id))})}):t.jsx(ot,{columns:Kt(N,r,w,D),data:s,sortKey:p,sortDirection:x,onSort:P,onRowClick:_,emptyState:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}),e[15]=D,e[16]=N,e[17]=s,e[18]=b,e[19]=_,e[20]=P,e[21]=T,e[22]=r,e[23]=u,e[24]=x,e[25]=p,e[26]=w,e[27]=i,e[28]=O):O=e[28];let I;return e[29]!==A||e[30]!==O?(I=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[A,O]}),e[29]=A,e[30]=O,e[31]=I):I=e[31],I}function $t(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Ot(n){return n.sortable!==!1}function zt(){}function Et(){}function Mt(){}function Ft(n){return{id:"actions",header:"",render:e=>t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ge,{size:16}),"Open"]}),n.edit&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Ve,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function He(n){const e=n.type;return Array.isArray(e)?e.every(s=>He({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function kt(n,e){const s=n.properties||{},r=Object.keys(s).filter(o=>{const m=s[o];return m&&He(m)}),i=Pt(s),l=[],u=new Set;i&&r.includes(i)&&(l.push(i),u.add(i));const p=["title","description","updated_at","updated_by"];for(const o of p)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));const j=r.filter(o=>!u.has(o)&&!Me.includes(o)).sort((o,m)=>o.localeCompare(m));for(const o of j)l.push(o),u.add(o);for(const o of Me)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));return l.map(o=>{const m=s[o],f=e?e.includes(o):!["id"].includes(o);return o===i?{id:o,header:"",render:d=>{const c=d[o];return t.jsx(ke,{icon:c,name:d.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(c)})},sortable:f,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx(lt,{id:String(c),size:"xs"}):"—"},sortable:f,cellClassName:"max-w-[250px]"}:m?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx("span",{className:"block truncate max-w-full",children:new Date(c).toLocaleDateString()}):"—"},sortable:f,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(c)})},sortable:f,cellClassName:"max-w-[200px]"}})}function Kt(n,e,s,r){const i=n||kt(e,s);return i.some(p=>p.id==="actions")?i:Object.keys(r).length>0?[...i,Ft(r)]:i}function cs(n){const e=Ae.c(113),{connectionId:s,org:r,activeCollection:i}=n,l=i.name,u=i.schema??ct,p=i.hasCreateTool,j=i.hasUpdateTool,o=i.hasDeleteTool,m=Ye(),{data:f}=Ze.useSession(),d=f?.user?.id||"unknown",{org:c}=et();let C;e[0]!==s||e[1]!==c.id?(C={connectionId:s,orgId:c.id},e[0]=s,e[1]=c.id,e[2]=C):C=e[2];const y=vt(C),a=jt(s,l,y),S=`${s}-${l}`;let h;e[3]!==r||e[4]!==S?(h={namespace:r,resource:S,defaultSortKey:"updated_at"},e[3]=r,e[4]=S,e[5]=h):h=e[5];const{search:x,searchTerm:P,setSearch:v,viewMode:D,setViewMode:_,sortKey:z,sortDirection:b,handleSort:T}=at(h);let N;e[6]!==P||e[7]!==b||e[8]!==z?(N={searchTerm:P,sortKey:z,sortDirection:b},e[6]=P,e[7]=b,e[8]=z,e[9]=N):N=e[9];const F=Ct(s,l,y,N),w=!p&&!j&&!o;let E;e[10]!==l||e[11]!==s||e[12]!==m||e[13]!==r?(E=g=>{m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:g.id}})},e[10]=l,e[11]=s,e[12]=m,e[13]=r,e[14]=E):E=e[14];const $=E;let A;e[15]!==a.create||e[16]!==d?(A=async g=>{const me=new Date().toISOString();await a.create.mutateAsync({...g,id:Oe("conn"),title:`${g.title} (Copy)`,created_at:me,updated_at:me,created_by:d,updated_by:d})},e[15]=a.create,e[16]=d,e[17]=A):A=e[17];const O=A,[I,M]=tt.useState(null);let oe;e[18]===Symbol.for("react.memo_cache_sentinel")?(oe=g=>{M(g)},e[18]=oe):oe=e[18];const qe=oe;let K;e[19]!==$||e[20]!==j?(K=j&&{edit:$},e[19]=$,e[20]=j,e[21]=K):K=e[21];let U;e[22]!==O||e[23]!==p?(U=p&&{duplicate:O},e[22]=O,e[23]=p,e[24]=U):U=e[24];let L;e[25]!==o?(L=o&&{delete:qe},e[25]=o,e[26]=L):L=e[26];let ie;e[27]!==L||e[28]!==K||e[29]!==U?(ie={...K,...U,...L},e[27]=L,e[28]=K,e[29]=U,e[30]=ie):ie=e[30];const ue=ie;let ne;e[31]!==a.delete||e[32]!==I?(ne=async()=>{I&&(await a.delete.mutateAsync(I.id),M(null))},e[31]=a.delete,e[32]=I,e[33]=ne):ne=e[33];const fe=ne;let re;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==p||e[38]!==m||e[39]!==r||e[40]!==d?(re=async()=>{if(!p){st.error("Create operation is not available for this collection");return}const g=new Date().toISOString(),me={id:Oe("conn"),title:"New Item",description:"A brief description of the item",created_at:g,updated_at:g,created_by:d,updated_by:d};try{const _e=await a.create.mutateAsync(me);m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:_e.id}})}catch(_e){console.error("Failed to create item:",_e)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=p,e[38]=m,e[39]=r,e[40]=d,e[41]=re):re=e[41];const he=re;let le;e[42]!==u?(le=We(u),e[42]=u,e[43]=le):le=e[43];const xe=le,Pe=(F?.length??0)>0,Qe=p&&Pe,Xe=p&&!Pe&&!x;let ae;e[44]!==a.create||e[45]!==he||e[46]!==p?(ae=p?t.jsxs(Ie,{onClick:he,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(bt,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=he,e[46]=p,e[47]=ae):ae=e[47];const Te=ae,ge=z;let B;e[48]!==T||e[49]!==_||e[50]!==b||e[51]!==xe||e[52]!==ge||e[53]!==D?(B=t.jsx(Fe,{viewMode:D,onViewModeChange:_,sortKey:ge,sortDirection:b,onSort:T,sortOptions:xe}),e[48]=T,e[49]=_,e[50]=b,e[51]=xe,e[52]=ge,e[53]=D,e[54]=B):B=e[54];const je=Qe&&Te;let R;e[55]!==B||e[56]!==je?(R=t.jsxs(yt,{children:[B,je]}),e[55]=B,e[56]=je,e[57]=R):R=e[57];const Ce=`Search ${l}...`;let V;e[58]!==v?(V=g=>{g.key==="Escape"&&(v(""),g.target.blur())},e[58]=v,e[59]=V):V=e[59];let G;e[60]!==x||e[61]!==v||e[62]!==Ce||e[63]!==V?(G=t.jsx(it,{value:x,onChange:v,placeholder:Ce,onKeyDown:V}),e[60]=x,e[61]=v,e[62]=Ce,e[63]=V,e[64]=G):G=e[64];let J;e[65]!==F?(J=F??[],e[65]=F,e[66]=J):J=e[66];const ve=z;let W;e[67]!==$?(W=g=>$(g),e[67]=$,e[68]=W):W=e[68];const be="No items found",ye=x?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ne=Xe?Te:void 0;let H;e[69]!==be||e[70]!==ye||e[71]!==Ne?(H=t.jsx(nt,{image:null,title:be,description:ye,actions:Ne}),e[69]=be,e[70]=ye,e[71]=Ne,e[72]=H):H=e[72];let q;e[73]!==T||e[74]!==w||e[75]!==ue||e[76]!==u||e[77]!==x||e[78]!==v||e[79]!==_||e[80]!==b||e[81]!==J||e[82]!==ve||e[83]!==W||e[84]!==H||e[85]!==D?(q=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Tt,{hideToolbar:!0,data:J,schema:u,viewMode:D,onViewModeChange:_,search:x,onSearchChange:v,sortKey:ve,sortDirection:b,onSort:T,actions:ue,onItemClick:W,readOnly:w,emptyState:H})}),e[73]=T,e[74]=w,e[75]=ue,e[76]=u,e[77]=x,e[78]=v,e[79]=_,e[80]=b,e[81]=J,e[82]=ve,e[83]=W,e[84]=H,e[85]=D,e[86]=q):q=e[86];let Q;e[87]!==G||e[88]!==q?(Q=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,q]}),e[87]=G,e[88]=q,e[89]=Q):Q=e[89];const we=!!I;let ce;e[90]===Symbol.for("react.memo_cache_sentinel")?(ce=g=>{g||M(null)},e[90]=ce):ce=e[90];let de;e[91]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx(mt,{children:"Delete item?"}),e[91]=de):de=e[91];const Se=I?.title;let X;e[92]!==Se?(X=t.jsxs(ut,{children:[de,t.jsxs(ft,{children:['Are you sure you want to delete "',Se,'"? This action cannot be undone.']})]}),e[92]=Se,e[93]=X):X=e[93];let Y;e[94]!==a.delete.isPending?(Y=t.jsx(dt,{disabled:a.delete.isPending,children:"Cancel"}),e[94]=a.delete.isPending,e[95]=Y):Y=e[95];const De=a.delete.isPending?"Deleting...":"Delete";let Z;e[96]!==a.delete.isPending||e[97]!==fe||e[98]!==De?(Z=t.jsx(pt,{onClick:fe,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:De}),e[96]=a.delete.isPending,e[97]=fe,e[98]=De,e[99]=Z):Z=e[99];let ee;e[100]!==Y||e[101]!==Z?(ee=t.jsxs(ht,{children:[Y,Z]}),e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let te;e[103]!==X||e[104]!==ee?(te=t.jsxs(xt,{children:[X,ee]}),e[103]=X,e[104]=ee,e[105]=te):te=e[105];let se;e[106]!==we||e[107]!==te?(se=t.jsx(gt,{open:we,onOpenChange:ce,children:te}),e[106]=we,e[107]=te,e[108]=se):se=e[108];let pe;return e[109]!==R||e[110]!==Q||e[111]!==se?(pe=t.jsxs(t.Fragment,{children:[R,Q,se]}),e[109]=R,e[110]=Q,e[111]=se,e[112]=pe):pe=e[112],pe}export{cs as C};
|
|
1
|
+
import{c as Ae,j as t,B as Ie,b as Ye,d as Ze,u as et,r as tt,O as $e,t as st}from"./index-BkxNgQ-z.js";import{g as Oe}from"./generate-id-Dyweu44Y.js";import{a as ot,C as Fe}from"./collection-table-wrapper-B7II4YYC.js";import{C as it,E as nt}from"./collection-search-BgstpGbD.js";import{C as rt}from"./card-BRjix5ol.js";import{I as ke}from"./integration-icon-DqBJsR0X.js";import{D as Ke,a as Ue,b as Le,c as k}from"./dropdown-menu-DvfBJ25L.js";import{a as Be}from"./Copy01-D2l3XUry.js";import{i as Re}from"./DotsVertical-B78gtBdB.js";import{i as Ve}from"./Edit01-CbZPkCJz.js";import{s as Ge}from"./Eye-vR70tVFn.js";import{s as Je}from"./Trash01-BvIumE4M.js";import{E as ze}from"./empty-state-C2LU6BeW.js";import{n as Ee}from"./Inbox01-xF_R8liT.js";import{U as lt}from"./user-BcEL6pjj.js";import{u as at}from"./use-list-state-CCFlT7yz.js";import{B as ct}from"./constants-DoLvwboP.js";import{A as dt,h as pt,c as mt,b as ut,d as ft,e as ht,a as xt,f as gt}from"./alert-dialog-B0yEBEkb.js";import{u as jt,e as Ct}from"./use-connection-DjiXkPUz.js";import{u as vt}from"./constants--aQ9HnxF.js";import{s as bt}from"./Plus-4zX3n4bH.js";import{V as yt}from"./layout-rnNZXdmD.js";function Nt(n,e){const s=n.properties||{};for(const i in s){const l=s[i];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const r=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of r)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function wt(n){const e=Ae.c(25),{item:s,schema:r,actions:i}=n;let l;e[0]!==s||e[1]!==r?(l=Nt(r,s),e[0]=s,e[1]=r,e[2]=l):l=e[2];const u=l,p=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let j;e[3]!==i?(j=i&&Object.keys(i).length>0,e[3]=i,e[4]=j):j=e[4];const o=j;let m;e[5]!==u||e[6]!==s.title?(m=t.jsx(ke,{icon:u,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=u,e[6]=s.title,e[7]=m):m=e[7];let f;e[8]!==s.title?(f=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=f):f=e[9];const d=p||"No description";let c;e[10]!==d?(c=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:d}),e[10]=d,e[11]=c):c=e[11];let C;e[12]!==f||e[13]!==c?(C=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[f,c]}),e[12]=f,e[13]=c,e[14]=C):C=e[14];let y;e[15]!==m||e[16]!==C?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[m,C]}),e[15]=m,e[16]=C,e[17]=y):y=e[17];let a;e[18]!==i||e[19]!==o||e[20]!==s?(a=o&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:At,onMouseDown:_t,children:t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Dt,children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:St,children:[i.open&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.open?.(s)},children:[t.jsx(Ge,{size:16}),"Open"]}),i.edit&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.edit?.(s)},children:[t.jsx(Ve,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.duplicate?.(s)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(k,{variant:"destructive",onClick:h=>{h.stopPropagation(),i.delete?.(s)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=o,e[20]=s,e[21]=a):a=e[21];let S;return e[22]!==y||e[23]!==a?(S=t.jsxs(rt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,a]}),e[22]=y,e[23]=a,e[24]=S):S=e[24],S}function St(n){return n.stopPropagation()}function Dt(n){return n.stopPropagation()}function _t(n){return n.stopPropagation()}function At(n){return n.stopPropagation()}const It=["icon","avatar","logo"],Me=["created_at","created_by","id"];function Pt(n){return Object.keys(n).find(e=>It.includes(e.toLowerCase()))}function We(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 Tt(n){const e=Ae.c(32),{data:s,schema:r,viewMode:i,onViewModeChange:l,search:u,sortKey:p,sortDirection:j,onSort:o,actions:m,onItemClick:f,headerActions:d,emptyState:c,readOnly:C,columns:y,hideToolbar:a,sortableFields:S}=n,h=l===void 0?Mt:l,x=j===void 0?"asc":j,P=o===void 0?Et:o;let v;e[0]!==m?(v=m===void 0?{}:m,e[0]=m,e[1]=v):v=e[1];const D=v,_=f===void 0?zt:f,z=d===void 0?null:d,b=c===void 0?null:c,T=C===void 0?!1:C,N=y===void 0?void 0:y,F=a===void 0?!1:a,w=S===void 0?void 0:S;let E;e[2]!==N||e[3]!==r||e[4]!==w?(E=N?N.filter(Ot).filter(M=>!w||w.includes(M.id)).map($t):We(r,w),e[2]=N,e[3]=r,e[4]=w,e[5]=E):E=e[5];const $=E;let A;e[6]!==z||e[7]!==F||e[8]!==P||e[9]!==h||e[10]!==x||e[11]!==p||e[12]!==$||e[13]!==i?(A=!F&&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:z}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Fe,{viewMode:i,onViewModeChange:h,sortKey:p,sortDirection:x,onSort:P,sortOptions:$})})]})}),e[6]=z,e[7]=F,e[8]=P,e[9]=h,e[10]=x,e[11]=p,e[12]=$,e[13]=i,e[14]=A):A=e[14];let O;e[15]!==D||e[16]!==N||e[17]!==s||e[18]!==b||e[19]!==_||e[20]!==P||e[21]!==T||e[22]!==r||e[23]!==u||e[24]!==x||e[25]!==p||e[26]!==w||e[27]!==i?(O=i==="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:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:s.map(M=>t.jsx("div",{onClick:()=>_?.(M),className:"cursor-pointer h-full",children:t.jsx(wt,{item:M,schema:r,readOnly:T,actions:D})},M.id))})}):t.jsx(ot,{columns:Kt(N,r,w,D),data:s,sortKey:p,sortDirection:x,onSort:P,onRowClick:_,emptyState:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}),e[15]=D,e[16]=N,e[17]=s,e[18]=b,e[19]=_,e[20]=P,e[21]=T,e[22]=r,e[23]=u,e[24]=x,e[25]=p,e[26]=w,e[27]=i,e[28]=O):O=e[28];let I;return e[29]!==A||e[30]!==O?(I=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[A,O]}),e[29]=A,e[30]=O,e[31]=I):I=e[31],I}function $t(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Ot(n){return n.sortable!==!1}function zt(){}function Et(){}function Mt(){}function Ft(n){return{id:"actions",header:"",render:e=>t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ge,{size:16}),"Open"]}),n.edit&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Ve,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function He(n){const e=n.type;return Array.isArray(e)?e.every(s=>He({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function kt(n,e){const s=n.properties||{},r=Object.keys(s).filter(o=>{const m=s[o];return m&&He(m)}),i=Pt(s),l=[],u=new Set;i&&r.includes(i)&&(l.push(i),u.add(i));const p=["title","description","updated_at","updated_by"];for(const o of p)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));const j=r.filter(o=>!u.has(o)&&!Me.includes(o)).sort((o,m)=>o.localeCompare(m));for(const o of j)l.push(o),u.add(o);for(const o of Me)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));return l.map(o=>{const m=s[o],f=e?e.includes(o):!["id"].includes(o);return o===i?{id:o,header:"",render:d=>{const c=d[o];return t.jsx(ke,{icon:c,name:d.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(c)})},sortable:f,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx(lt,{id:String(c),size:"xs"}):"—"},sortable:f,cellClassName:"max-w-[250px]"}:m?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx("span",{className:"block truncate max-w-full",children:new Date(c).toLocaleDateString()}):"—"},sortable:f,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(c)})},sortable:f,cellClassName:"max-w-[200px]"}})}function Kt(n,e,s,r){const i=n||kt(e,s);return i.some(p=>p.id==="actions")?i:Object.keys(r).length>0?[...i,Ft(r)]:i}function cs(n){const e=Ae.c(113),{connectionId:s,org:r,activeCollection:i}=n,l=i.name,u=i.schema??ct,p=i.hasCreateTool,j=i.hasUpdateTool,o=i.hasDeleteTool,m=Ye(),{data:f}=Ze.useSession(),d=f?.user?.id||"unknown",{org:c}=et();let C;e[0]!==s||e[1]!==c.id?(C={connectionId:s,orgId:c.id},e[0]=s,e[1]=c.id,e[2]=C):C=e[2];const y=vt(C),a=jt(s,l,y),S=`${s}-${l}`;let h;e[3]!==r||e[4]!==S?(h={namespace:r,resource:S,defaultSortKey:"updated_at"},e[3]=r,e[4]=S,e[5]=h):h=e[5];const{search:x,searchTerm:P,setSearch:v,viewMode:D,setViewMode:_,sortKey:z,sortDirection:b,handleSort:T}=at(h);let N;e[6]!==P||e[7]!==b||e[8]!==z?(N={searchTerm:P,sortKey:z,sortDirection:b},e[6]=P,e[7]=b,e[8]=z,e[9]=N):N=e[9];const F=Ct(s,l,y,N),w=!p&&!j&&!o;let E;e[10]!==l||e[11]!==s||e[12]!==m||e[13]!==r?(E=g=>{m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:g.id}})},e[10]=l,e[11]=s,e[12]=m,e[13]=r,e[14]=E):E=e[14];const $=E;let A;e[15]!==a.create||e[16]!==d?(A=async g=>{const me=new Date().toISOString();await a.create.mutateAsync({...g,id:Oe("conn"),title:`${g.title} (Copy)`,created_at:me,updated_at:me,created_by:d,updated_by:d})},e[15]=a.create,e[16]=d,e[17]=A):A=e[17];const O=A,[I,M]=tt.useState(null);let oe;e[18]===Symbol.for("react.memo_cache_sentinel")?(oe=g=>{M(g)},e[18]=oe):oe=e[18];const qe=oe;let K;e[19]!==$||e[20]!==j?(K=j&&{edit:$},e[19]=$,e[20]=j,e[21]=K):K=e[21];let U;e[22]!==O||e[23]!==p?(U=p&&{duplicate:O},e[22]=O,e[23]=p,e[24]=U):U=e[24];let L;e[25]!==o?(L=o&&{delete:qe},e[25]=o,e[26]=L):L=e[26];let ie;e[27]!==L||e[28]!==K||e[29]!==U?(ie={...K,...U,...L},e[27]=L,e[28]=K,e[29]=U,e[30]=ie):ie=e[30];const ue=ie;let ne;e[31]!==a.delete||e[32]!==I?(ne=async()=>{I&&(await a.delete.mutateAsync(I.id),M(null))},e[31]=a.delete,e[32]=I,e[33]=ne):ne=e[33];const fe=ne;let re;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==p||e[38]!==m||e[39]!==r||e[40]!==d?(re=async()=>{if(!p){st.error("Create operation is not available for this collection");return}const g=new Date().toISOString(),me={id:Oe("conn"),title:"New Item",description:"A brief description of the item",created_at:g,updated_at:g,created_by:d,updated_by:d};try{const _e=await a.create.mutateAsync(me);m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:_e.id}})}catch(_e){console.error("Failed to create item:",_e)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=p,e[38]=m,e[39]=r,e[40]=d,e[41]=re):re=e[41];const he=re;let le;e[42]!==u?(le=We(u),e[42]=u,e[43]=le):le=e[43];const xe=le,Pe=(F?.length??0)>0,Qe=p&&Pe,Xe=p&&!Pe&&!x;let ae;e[44]!==a.create||e[45]!==he||e[46]!==p?(ae=p?t.jsxs(Ie,{onClick:he,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(bt,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=he,e[46]=p,e[47]=ae):ae=e[47];const Te=ae,ge=z;let B;e[48]!==T||e[49]!==_||e[50]!==b||e[51]!==xe||e[52]!==ge||e[53]!==D?(B=t.jsx(Fe,{viewMode:D,onViewModeChange:_,sortKey:ge,sortDirection:b,onSort:T,sortOptions:xe}),e[48]=T,e[49]=_,e[50]=b,e[51]=xe,e[52]=ge,e[53]=D,e[54]=B):B=e[54];const je=Qe&&Te;let R;e[55]!==B||e[56]!==je?(R=t.jsxs(yt,{children:[B,je]}),e[55]=B,e[56]=je,e[57]=R):R=e[57];const Ce=`Search ${l}...`;let V;e[58]!==v?(V=g=>{g.key==="Escape"&&(v(""),g.target.blur())},e[58]=v,e[59]=V):V=e[59];let G;e[60]!==x||e[61]!==v||e[62]!==Ce||e[63]!==V?(G=t.jsx(it,{value:x,onChange:v,placeholder:Ce,onKeyDown:V}),e[60]=x,e[61]=v,e[62]=Ce,e[63]=V,e[64]=G):G=e[64];let J;e[65]!==F?(J=F??[],e[65]=F,e[66]=J):J=e[66];const ve=z;let W;e[67]!==$?(W=g=>$(g),e[67]=$,e[68]=W):W=e[68];const be="No items found",ye=x?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ne=Xe?Te:void 0;let H;e[69]!==be||e[70]!==ye||e[71]!==Ne?(H=t.jsx(nt,{image:null,title:be,description:ye,actions:Ne}),e[69]=be,e[70]=ye,e[71]=Ne,e[72]=H):H=e[72];let q;e[73]!==T||e[74]!==w||e[75]!==ue||e[76]!==u||e[77]!==x||e[78]!==v||e[79]!==_||e[80]!==b||e[81]!==J||e[82]!==ve||e[83]!==W||e[84]!==H||e[85]!==D?(q=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Tt,{hideToolbar:!0,data:J,schema:u,viewMode:D,onViewModeChange:_,search:x,onSearchChange:v,sortKey:ve,sortDirection:b,onSort:T,actions:ue,onItemClick:W,readOnly:w,emptyState:H})}),e[73]=T,e[74]=w,e[75]=ue,e[76]=u,e[77]=x,e[78]=v,e[79]=_,e[80]=b,e[81]=J,e[82]=ve,e[83]=W,e[84]=H,e[85]=D,e[86]=q):q=e[86];let Q;e[87]!==G||e[88]!==q?(Q=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,q]}),e[87]=G,e[88]=q,e[89]=Q):Q=e[89];const we=!!I;let ce;e[90]===Symbol.for("react.memo_cache_sentinel")?(ce=g=>{g||M(null)},e[90]=ce):ce=e[90];let de;e[91]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx(mt,{children:"Delete item?"}),e[91]=de):de=e[91];const Se=I?.title;let X;e[92]!==Se?(X=t.jsxs(ut,{children:[de,t.jsxs(ft,{children:['Are you sure you want to delete "',Se,'"? This action cannot be undone.']})]}),e[92]=Se,e[93]=X):X=e[93];let Y;e[94]!==a.delete.isPending?(Y=t.jsx(dt,{disabled:a.delete.isPending,children:"Cancel"}),e[94]=a.delete.isPending,e[95]=Y):Y=e[95];const De=a.delete.isPending?"Deleting...":"Delete";let Z;e[96]!==a.delete.isPending||e[97]!==fe||e[98]!==De?(Z=t.jsx(pt,{onClick:fe,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:De}),e[96]=a.delete.isPending,e[97]=fe,e[98]=De,e[99]=Z):Z=e[99];let ee;e[100]!==Y||e[101]!==Z?(ee=t.jsxs(ht,{children:[Y,Z]}),e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let te;e[103]!==X||e[104]!==ee?(te=t.jsxs(xt,{children:[X,ee]}),e[103]=X,e[104]=ee,e[105]=te):te=e[105];let se;e[106]!==we||e[107]!==te?(se=t.jsx(gt,{open:we,onOpenChange:ce,children:te}),e[106]=we,e[107]=te,e[108]=se):se=e[108];let pe;return e[109]!==R||e[110]!==Q||e[111]!==se?(pe=t.jsxs(t.Fragment,{children:[R,Q,se]}),e[109]=R,e[110]=Q,e[111]=se,e[112]=pe):pe=e[112],pe}export{cs as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as I,c as P,v as y,j as s,B as oe}from"./index-BiG-bBX7.js";import{c as ne,a as ie,D as le,b as re}from"./dropdown-menu-BaaJ3KIr.js";import{n as Y}from"./ArrowDown-CnXnoX-V.js";import{i as Z}from"./ArrowUp-8t9O2FqG.js";import{i as ae}from"./Check-Bs28PslG.js";import{c as ce}from"./Grid01-CILFuUHo.js";import{i as de}from"./List-BcuB27Kb.js";import{c as ue,T as fe,a as me,b as xe}from"./tooltip-BacoSwd7.js";import{T as pe,a as he,b as X,c as ge,d as be,e as ve}from"./table-DxvlU5EN.js";const ee=({size:C=24,color:e="currentColor",...o})=>I.createElement("svg",{viewBox:"0 0 24 24",width:C,height:C,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},I.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));ee.displayName="Sliders01";const je={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function we(C){const e=P.c(66),{value:o,onValueChange:a,options:t,size:f,fullWidth:d,className:r}=C,m=f===void 0?"sm":f,c=d===void 0?!1:d,b=I.useRef(null),u=I.useRef(null);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={left:0,width:0,opacity:0},e[0]=l):l=e[0];const[i,h]=I.useState(l);let x;e[1]===Symbol.for("react.memo_cache_sentinel")?(x=K=>{if(!K.current)return;const{offsetLeft:te,offsetWidth:se}=K.current;h({left:te,width:se,opacity:1})},e[1]=x):x=e[1];const j=x;let v;e[2]!==t[0].value||e[3]!==o?(v=()=>{const K=o===t[0].value?b:u;j(K)},e[2]=t[0].value,e[3]=o,e[4]=v):v=e[4];let p;e[5]!==t||e[6]!==o?(p=[o,t],e[5]=t,e[6]=o,e[7]=p):p=e[7],I.useEffect(v,p);const n=je[m];let g;e[8]!==r?(g=y("relative flex gap-0 bg-muted rounded-lg",r),e[8]=r,e[9]=g):g=e[9];let w;e[10]!==a||e[11]!==t[0].value?(w=()=>a(t[0].value),e[10]=a,e[11]=t[0].value,e[12]=w):w=e[12];const N=c?"flex-1 h-12 px-4":n.button,O=!c&&t[0].label?"px-3":"";let z;e[13]!==O||e[14]!==N?(z=y("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",N,O),e[13]=O,e[14]=N,e[15]=z):z=e[15];const A=o===t[0].value?"text-foreground":"text-muted-foreground";let k;e[16]!==n.icon||e[17]!==A?(k=y("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",n.icon,A),e[16]=n.icon,e[17]=A,e[18]=k):k=e[18];let S;e[19]!==t[0].icon||e[20]!==k?(S=s.jsx("span",{className:k,children:t[0].icon}),e[19]=t[0].icon,e[20]=k,e[21]=S):S=e[21];let T;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(T=t[0].label&&s.jsx("span",{className:y("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=T):T=e[25];let D;e[26]!==z||e[27]!==S||e[28]!==T||e[29]!==w?(D=s.jsxs("button",{ref:b,type:"button",onClick:w,className:z,children:[S,T]}),e[26]=z,e[27]=S,e[28]=T,e[29]=w,e[30]=D):D=e[30];let M;e[31]!==a||e[32]!==t[1].value?(M=()=>a(t[1].value),e[31]=a,e[32]=t[1].value,e[33]=M):M=e[33];const q=c?"flex-1 h-12 px-4":n.button,F=!c&&t[1].label?"px-3":"";let R;e[34]!==q||e[35]!==F?(R=y("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",q,F),e[34]=q,e[35]=F,e[36]=R):R=e[36];const G=o===t[1].value?"text-foreground":"text-muted-foreground";let $;e[37]!==n.icon||e[38]!==G?($=y("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",n.icon,G),e[37]=n.icon,e[38]=G,e[39]=$):$=e[39];let V;e[40]!==t[1].icon||e[41]!==$?(V=s.jsx("span",{className:$,children:t[1].icon}),e[40]=t[1].icon,e[41]=$,e[42]=V):V=e[42];let _;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(_=t[1].label&&s.jsx("span",{className:y("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=_):_=e[46];let L;e[47]!==M||e[48]!==R||e[49]!==V||e[50]!==_?(L=s.jsxs("button",{ref:u,type:"button",onClick:M,className:R,children:[V,_]}),e[47]=M,e[48]=R,e[49]=V,e[50]=_,e[51]=L):L=e[51];const J=c?"h-12":n.button;let E;e[52]!==J?(E=y("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",J),e[52]=J,e[53]=E):E=e[53];const Q=`${i.left}px`,U=`${i.width}px`;let W;e[54]!==i.opacity||e[55]!==Q||e[56]!==U?(W={left:Q,width:U,opacity:i.opacity},e[54]=i.opacity,e[55]=Q,e[56]=U,e[57]=W):W=e[57];let B;e[58]!==E||e[59]!==W?(B=s.jsx("div",{className:E,style:W}),e[58]=E,e[59]=W,e[60]=B):B=e[60];let H;return e[61]!==D||e[62]!==L||e[63]!==B||e[64]!==g?(H=s.jsxs("div",{className:g,children:[D,L,B]}),e[61]=D,e[62]=L,e[63]=B,e[64]=g,e[65]=H):H=e[65],H}function $e(C){const e=P.c(16),{viewMode:o,onViewModeChange:a,sortKey:t,sortDirection:f,onSort:d,sortOptions:r}=C;let m;e[0]!==r?(m=r===void 0?[]:r,e[0]=r,e[1]=m):m=e[1];const c=m;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(ue,{children:s.jsxs(fe,{children:[s.jsx(me,{asChild:!0,children:s.jsx(ie,{asChild:!0,children:s.jsx(oe,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(ee,{size:16})})})}),s.jsx(xe,{children:"Search filters"})]})}),e[2]=b):b=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={value:"table",icon:s.jsx(de,{})},e[3]=u):u=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=[u,{value:"cards",icon:s.jsx(ce,{})}],e[4]=l):l=e[4];let i;e[5]!==a||e[6]!==o?(i=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(we,{value:o,onValueChange:a,fullWidth:!0,options:l})}),e[5]=a,e[6]=o,e[7]=i):i=e[7];let h;e[8]!==d||e[9]!==f||e[10]!==t||e[11]!==c?(h=c.length>0&&d&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),c.map(j=>{const v=t===j.id;return s.jsx(ne,{onClick:()=>d(j.id),className:y("h-8 px-2 py-0 cursor-pointer",v&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[v&&s.jsx(ae,{size:16,className:"text-foreground shrink-0"}),!v&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:j.label}),v&&f&&(f==="asc"?s.jsx(Z,{size:16,className:"text-foreground shrink-0"}):s.jsx(Y,{size:16,className:"text-foreground shrink-0"}))]})},j.id)})]}),e[8]=d,e[9]=f,e[10]=t,e[11]=c,e[12]=h):h=e[12];let x;return e[13]!==i||e[14]!==h?(x=s.jsxs(le,{children:[b,s.jsxs(re,{align:"end",className:"w-[200px] p-0 gap-0",children:[i,h]})]}),e[13]=i,e[14]=h,e[15]=x):x=e[15],x}function Ne(C){const e=P.c(29),{columns:o,data:a,sortKey:t,sortDirection:f,onSort:d,onRowClick:r,rowClassName:m}=C;let c;e[0]!==f?(c=function(n,g){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:g&&f&&(f==="asc"?s.jsx(Z,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(Y,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=f,e[1]=c):c=e[1];const b=c;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=function(n,g){let w="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return n===g-1&&(w="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),w},e[2]=u):u=e[2];const l=u;let i;if(e[3]!==o||e[4]!==d||e[5]!==b||e[6]!==t){let p;e[8]!==o.length||e[9]!==d||e[10]!==b||e[11]!==t?(p=(n,g)=>{const w=t===n.id;return s.jsx(pe,{className:y(l(g,o.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&d?()=>d(n.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&b(n.id,w)]})},n.id)},e[8]=o.length,e[9]=d,e[10]=b,e[11]=t,e[12]=p):p=e[12],i=o.map(p),e[3]=o,e[4]=d,e[5]=b,e[6]=t,e[7]=i}else i=e[7];let h;e[13]!==i?(h=s.jsx(he,{className:"border-b-0",children:s.jsx(X,{className:"h-9 hover:bg-transparent border-b border-border",children:i})}),e[13]=i,e[14]=h):h=e[14];let x;if(e[15]!==o||e[16]!==a||e[17]!==r||e[18]!==m){let p;e[20]!==o||e[21]!==r||e[22]!==m?(p=(n,g)=>{const w=m?.(n);return s.jsx(X,{"data-row-index":g,className:y("group/data-row transition-colors border-b-0 hover:bg-accent/50",r?"cursor-pointer":"",w),onClick:r?()=>r(n):void 0,children:o.map(N=>s.jsx(ge,{className:y("px-5 py-4 h-16 align-middle text-sm text-foreground",N.cellClassName,N.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:y(N.wrap?"w-full":"min-w-0 w-full",!N.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:N.render?N.render(n):N.accessor?N.accessor(n):null})},N.id))},g)},e[20]=o,e[21]=r,e[22]=m,e[23]=p):p=e[23],x=a.map(p),e[15]=o,e[16]=a,e[17]=r,e[18]=m,e[19]=x}else x=e[19];let j;e[24]!==x?(j=s.jsx(be,{children:x}),e[24]=x,e[25]=j):j=e[25];let v;return e[26]!==h||e[27]!==j?(v=s.jsxs(ve,{className:"w-full border-collapse",children:[h,j]}),e[26]=h,e[27]=j,e[28]=v):v=e[28],v}function Ve(C){const e=P.c(12),{columns:o,data:a,isLoading:t,sortKey:f,sortDirection:d,onSort:r,onRowClick:m,emptyState:c}=C;if(t===void 0?!1:t){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=l):l=e[0],l}if(a.length===0){let l;e[1]!==c?(l=c||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=c,e[2]=l):l=e[2];let i;return e[3]!==l?(i=s.jsx("div",{className:"flex items-center justify-center h-full",children:l}),e[3]=l,e[4]=i):i=e[4],i}let u;return e[5]!==o||e[6]!==a||e[7]!==m||e[8]!==r||e[9]!==d||e[10]!==f?(u=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(Ne,{columns:o,data:a,sortKey:f,sortDirection:d,onSort:r,onRowClick:m})}),e[5]=o,e[6]=a,e[7]=m,e[8]=r,e[9]=d,e[10]=f,e[11]=u):u=e[11],u}export{$e as C,we as V,Ve as a};
|
|
1
|
+
import{r as I,c as P,v as y,j as s,B as oe}from"./index-BkxNgQ-z.js";import{c as ne,a as ie,D as le,b as re}from"./dropdown-menu-DvfBJ25L.js";import{n as Y}from"./ArrowDown-BfANN175.js";import{i as Z}from"./ArrowUp-BNm6R5tp.js";import{i as ae}from"./Check-BuBqfL8V.js";import{c as ce}from"./Grid01-DjcW2Js4.js";import{i as de}from"./List-Be3XBHwN.js";import{c as ue,T as fe,a as me,b as xe}from"./tooltip-DvMRS01W.js";import{T as pe,a as he,b as X,c as ge,d as be,e as ve}from"./table-BJ3W5Geb.js";const ee=({size:C=24,color:e="currentColor",...o})=>I.createElement("svg",{viewBox:"0 0 24 24",width:C,height:C,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},I.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));ee.displayName="Sliders01";const je={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function we(C){const e=P.c(66),{value:o,onValueChange:a,options:t,size:f,fullWidth:d,className:r}=C,m=f===void 0?"sm":f,c=d===void 0?!1:d,b=I.useRef(null),u=I.useRef(null);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={left:0,width:0,opacity:0},e[0]=l):l=e[0];const[i,h]=I.useState(l);let x;e[1]===Symbol.for("react.memo_cache_sentinel")?(x=K=>{if(!K.current)return;const{offsetLeft:te,offsetWidth:se}=K.current;h({left:te,width:se,opacity:1})},e[1]=x):x=e[1];const j=x;let v;e[2]!==t[0].value||e[3]!==o?(v=()=>{const K=o===t[0].value?b:u;j(K)},e[2]=t[0].value,e[3]=o,e[4]=v):v=e[4];let p;e[5]!==t||e[6]!==o?(p=[o,t],e[5]=t,e[6]=o,e[7]=p):p=e[7],I.useEffect(v,p);const n=je[m];let g;e[8]!==r?(g=y("relative flex gap-0 bg-muted rounded-lg",r),e[8]=r,e[9]=g):g=e[9];let w;e[10]!==a||e[11]!==t[0].value?(w=()=>a(t[0].value),e[10]=a,e[11]=t[0].value,e[12]=w):w=e[12];const N=c?"flex-1 h-12 px-4":n.button,O=!c&&t[0].label?"px-3":"";let z;e[13]!==O||e[14]!==N?(z=y("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",N,O),e[13]=O,e[14]=N,e[15]=z):z=e[15];const A=o===t[0].value?"text-foreground":"text-muted-foreground";let k;e[16]!==n.icon||e[17]!==A?(k=y("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",n.icon,A),e[16]=n.icon,e[17]=A,e[18]=k):k=e[18];let S;e[19]!==t[0].icon||e[20]!==k?(S=s.jsx("span",{className:k,children:t[0].icon}),e[19]=t[0].icon,e[20]=k,e[21]=S):S=e[21];let T;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(T=t[0].label&&s.jsx("span",{className:y("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=T):T=e[25];let D;e[26]!==z||e[27]!==S||e[28]!==T||e[29]!==w?(D=s.jsxs("button",{ref:b,type:"button",onClick:w,className:z,children:[S,T]}),e[26]=z,e[27]=S,e[28]=T,e[29]=w,e[30]=D):D=e[30];let M;e[31]!==a||e[32]!==t[1].value?(M=()=>a(t[1].value),e[31]=a,e[32]=t[1].value,e[33]=M):M=e[33];const q=c?"flex-1 h-12 px-4":n.button,F=!c&&t[1].label?"px-3":"";let R;e[34]!==q||e[35]!==F?(R=y("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",q,F),e[34]=q,e[35]=F,e[36]=R):R=e[36];const G=o===t[1].value?"text-foreground":"text-muted-foreground";let $;e[37]!==n.icon||e[38]!==G?($=y("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",n.icon,G),e[37]=n.icon,e[38]=G,e[39]=$):$=e[39];let V;e[40]!==t[1].icon||e[41]!==$?(V=s.jsx("span",{className:$,children:t[1].icon}),e[40]=t[1].icon,e[41]=$,e[42]=V):V=e[42];let _;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(_=t[1].label&&s.jsx("span",{className:y("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=_):_=e[46];let L;e[47]!==M||e[48]!==R||e[49]!==V||e[50]!==_?(L=s.jsxs("button",{ref:u,type:"button",onClick:M,className:R,children:[V,_]}),e[47]=M,e[48]=R,e[49]=V,e[50]=_,e[51]=L):L=e[51];const J=c?"h-12":n.button;let E;e[52]!==J?(E=y("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",J),e[52]=J,e[53]=E):E=e[53];const Q=`${i.left}px`,U=`${i.width}px`;let W;e[54]!==i.opacity||e[55]!==Q||e[56]!==U?(W={left:Q,width:U,opacity:i.opacity},e[54]=i.opacity,e[55]=Q,e[56]=U,e[57]=W):W=e[57];let B;e[58]!==E||e[59]!==W?(B=s.jsx("div",{className:E,style:W}),e[58]=E,e[59]=W,e[60]=B):B=e[60];let H;return e[61]!==D||e[62]!==L||e[63]!==B||e[64]!==g?(H=s.jsxs("div",{className:g,children:[D,L,B]}),e[61]=D,e[62]=L,e[63]=B,e[64]=g,e[65]=H):H=e[65],H}function $e(C){const e=P.c(16),{viewMode:o,onViewModeChange:a,sortKey:t,sortDirection:f,onSort:d,sortOptions:r}=C;let m;e[0]!==r?(m=r===void 0?[]:r,e[0]=r,e[1]=m):m=e[1];const c=m;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(ue,{children:s.jsxs(fe,{children:[s.jsx(me,{asChild:!0,children:s.jsx(ie,{asChild:!0,children:s.jsx(oe,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(ee,{size:16})})})}),s.jsx(xe,{children:"Search filters"})]})}),e[2]=b):b=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={value:"table",icon:s.jsx(de,{})},e[3]=u):u=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=[u,{value:"cards",icon:s.jsx(ce,{})}],e[4]=l):l=e[4];let i;e[5]!==a||e[6]!==o?(i=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(we,{value:o,onValueChange:a,fullWidth:!0,options:l})}),e[5]=a,e[6]=o,e[7]=i):i=e[7];let h;e[8]!==d||e[9]!==f||e[10]!==t||e[11]!==c?(h=c.length>0&&d&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),c.map(j=>{const v=t===j.id;return s.jsx(ne,{onClick:()=>d(j.id),className:y("h-8 px-2 py-0 cursor-pointer",v&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[v&&s.jsx(ae,{size:16,className:"text-foreground shrink-0"}),!v&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:j.label}),v&&f&&(f==="asc"?s.jsx(Z,{size:16,className:"text-foreground shrink-0"}):s.jsx(Y,{size:16,className:"text-foreground shrink-0"}))]})},j.id)})]}),e[8]=d,e[9]=f,e[10]=t,e[11]=c,e[12]=h):h=e[12];let x;return e[13]!==i||e[14]!==h?(x=s.jsxs(le,{children:[b,s.jsxs(re,{align:"end",className:"w-[200px] p-0 gap-0",children:[i,h]})]}),e[13]=i,e[14]=h,e[15]=x):x=e[15],x}function Ne(C){const e=P.c(29),{columns:o,data:a,sortKey:t,sortDirection:f,onSort:d,onRowClick:r,rowClassName:m}=C;let c;e[0]!==f?(c=function(n,g){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:g&&f&&(f==="asc"?s.jsx(Z,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(Y,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=f,e[1]=c):c=e[1];const b=c;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=function(n,g){let w="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return n===g-1&&(w="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),w},e[2]=u):u=e[2];const l=u;let i;if(e[3]!==o||e[4]!==d||e[5]!==b||e[6]!==t){let p;e[8]!==o.length||e[9]!==d||e[10]!==b||e[11]!==t?(p=(n,g)=>{const w=t===n.id;return s.jsx(pe,{className:y(l(g,o.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&d?()=>d(n.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&b(n.id,w)]})},n.id)},e[8]=o.length,e[9]=d,e[10]=b,e[11]=t,e[12]=p):p=e[12],i=o.map(p),e[3]=o,e[4]=d,e[5]=b,e[6]=t,e[7]=i}else i=e[7];let h;e[13]!==i?(h=s.jsx(he,{className:"border-b-0",children:s.jsx(X,{className:"h-9 hover:bg-transparent border-b border-border",children:i})}),e[13]=i,e[14]=h):h=e[14];let x;if(e[15]!==o||e[16]!==a||e[17]!==r||e[18]!==m){let p;e[20]!==o||e[21]!==r||e[22]!==m?(p=(n,g)=>{const w=m?.(n);return s.jsx(X,{"data-row-index":g,className:y("group/data-row transition-colors border-b-0 hover:bg-accent/50",r?"cursor-pointer":"",w),onClick:r?()=>r(n):void 0,children:o.map(N=>s.jsx(ge,{className:y("px-5 py-4 h-16 align-middle text-sm text-foreground",N.cellClassName,N.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:y(N.wrap?"w-full":"min-w-0 w-full",!N.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:N.render?N.render(n):N.accessor?N.accessor(n):null})},N.id))},g)},e[20]=o,e[21]=r,e[22]=m,e[23]=p):p=e[23],x=a.map(p),e[15]=o,e[16]=a,e[17]=r,e[18]=m,e[19]=x}else x=e[19];let j;e[24]!==x?(j=s.jsx(be,{children:x}),e[24]=x,e[25]=j):j=e[25];let v;return e[26]!==h||e[27]!==j?(v=s.jsxs(ve,{className:"w-full border-collapse",children:[h,j]}),e[26]=h,e[27]=j,e[28]=v):v=e[28],v}function Ve(C){const e=P.c(12),{columns:o,data:a,isLoading:t,sortKey:f,sortDirection:d,onSort:r,onRowClick:m,emptyState:c}=C;if(t===void 0?!1:t){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=l):l=e[0],l}if(a.length===0){let l;e[1]!==c?(l=c||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=c,e[2]=l):l=e[2];let i;return e[3]!==l?(i=s.jsx("div",{className:"flex items-center justify-center h-full",children:l}),e[3]=l,e[4]=i):i=e[4],i}let u;return e[5]!==o||e[6]!==a||e[7]!==m||e[8]!==r||e[9]!==d||e[10]!==f?(u=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(Ne,{columns:o,data:a,sortKey:f,sortDirection:d,onSort:r,onRowClick:m})}),e[5]=o,e[6]=a,e[7]=m,e[8]=r,e[9]=d,e[10]=f,e[11]=u):u=e[11],u}export{$e as C,we as V,Ve as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,v as u,j as m}from"./index-
|
|
1
|
+
import{c as f,v as u,j as m}from"./index-BkxNgQ-z.js";import{B as g}from"./badge-UPowR1Nj.js";function v(x){const e=f.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{v as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,v as m,j as n}from"./index-
|
|
1
|
+
import{c as r,v as m,j as n}from"./index-BkxNgQ-z.js";import{_ as d}from"./index-CKt9M-ST.js";import{i}from"./SearchMd-BvHN4xgB.js";function x(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function g(l){const e=r.c(9);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(i,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let a;e[4]!==t?(a=m("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=a):a=e[5];let c;return e[6]!==s||e[7]!==a?(c=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(d.Input,{"data-slot":"command-input",className:a,...s})]}),e[6]=s,e[7]=a,e[8]=c):c=e[8],c}function h(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function v(l){const e=r.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(d.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function N(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function b(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function _(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}export{N as C,h as a,x as b,g as c,v as d,_ as e,b as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as T,bY as M,j as e,bZ as P,n as q,r as R,t as f,B as y,e as O}from"./index-
|
|
1
|
+
import{c as T,bY as M,j as e,bZ as P,n as q,r as R,t as f,B as y,e as O}from"./index-BkxNgQ-z.js";import{u as A}from"./useQuery-Cj-miqA2.js";import{u as _}from"./useMutation-DtOoZO7h.js";import{C as N,a as v}from"./card-BRjix5ol.js";import{i as L,a as U}from"./mcp-oauth-hrdldmcp.js";import{c as C,C as K,a as k}from"./circle-alert-CHATLFG-.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"}]],Y=C("refresh-cw",J),B=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:(f.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");f.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){f.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}),f.success(`${s.title} connected successfully`)}catch(o){console.error("Connection error:",o);const l=o instanceof Error?o:new Error("Failed to connect");f.error(l.message),i?.(l)}finally{d(null)}},I=r?.apps.every(s=>s.status.configured),h=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(B,{}),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})]}),h&&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&&!h&&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&&!h&&e.jsxs(y,{size:"sm",variant:"outline",onClick:()=>S(s),disabled:p!==null||x.isPending,children:[e.jsx(Y,{className:"size-4 mr-2"}),"Reconnect"]}),h&&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&&!h&&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 ne(){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{ne as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $,v as N,j as t}from"./index-
|
|
1
|
+
import{c as $,v as N,j as t}from"./index-BkxNgQ-z.js";import{C as q}from"./card-BRjix5ol.js";import{I as B}from"./integration-icon-DqBJsR0X.js";function K(g){const e=$.c(46),{connection:s,onClick:C,headerActions:b,body:k,footer:y,className:I,size:A,fallbackIcon:w}=g,E=A===void 0?"md":A,i=E==="sm"?"p-4":"p-6",P=E==="sm"?"text-sm":"text-base",R=E==="sm"?"text-xs":"text-sm",S=C&&"hover:bg-muted/50";let l;e[0]!==I||e[1]!==S?(l=N("cursor-pointer transition-colors group overflow-hidden flex flex-col",S,I),e[0]=I,e[1]=S,e[2]=l):l=e[2];let o;e[3]!==i?(o=N("flex flex-col gap-4",i),e[3]=i,e[4]=o):o=e[4];let n;e[5]!==s.icon||e[6]!==s.title||e[7]!==w?(n=t.jsx(B,{icon:s.icon,name:s.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:w}),e[5]=s.icon,e[6]=s.title,e[7]=w,e[8]=n):n=e[8];let c;e[9]!==b?(c=b&&t.jsx("div",{className:N("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:F,children:b}),e[9]=b,e[10]=c):c=e[10];let r;e[11]!==c?(r=t.jsx("div",{className:"relative",children:c}),e[11]=c,e[12]=r):r=e[12];let a;e[13]!==n||e[14]!==r?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[n,r]}),e[13]=n,e[14]=r,e[15]=a):a=e[15];let d;e[16]!==P?(d=N("font-medium text-foreground truncate",P),e[16]=P,e[17]=d):d=e[17];let m;e[18]!==s.title||e[19]!==d?(m=t.jsx("h3",{className:d,children:s.title}),e[18]=s.title,e[19]=d,e[20]=m):m=e[20];let f;e[21]!==R?(f=N("text-muted-foreground line-clamp-2",R),e[21]=R,e[22]=f):f=e[22];const _=s.description||"No description";let x;e[23]!==f||e[24]!==_?(x=t.jsx("p",{className:f,children:_}),e[23]=f,e[24]=_,e[25]=x):x=e[25];let p;e[26]!==m||e[27]!==x?(p=t.jsxs("div",{className:"flex flex-col gap-0",children:[m,x]}),e[26]=m,e[27]=x,e[28]=p):p=e[28];let h;e[29]!==k?(h=k&&t.jsx("div",{children:k}),e[29]=k,e[30]=h):h=e[30];let u;e[31]!==p||e[32]!==h||e[33]!==o||e[34]!==a?(u=t.jsxs("div",{className:o,children:[a,p,h]}),e[31]=p,e[32]=h,e[33]=o,e[34]=a,e[35]=u):u=e[35];let j;e[36]!==y||e[37]!==i?(j=y&&t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:N("h-14 flex items-center",i),onClick:D,children:y})}),e[36]=y,e[37]=i,e[38]=j):j=e[38];let v;e[39]!==u||e[40]!==j?(v=t.jsxs("div",{className:"flex flex-col flex-1",children:[u,j]}),e[39]=u,e[40]=j,e[41]=v):v=e[41];let z;return e[42]!==C||e[43]!==v||e[44]!==l?(z=t.jsx(q,{className:l,onClick:C,children:v}),e[42]=C,e[43]=v,e[44]=l,e[45]=z):z=e[45],z}function D(g){return g.stopPropagation()}function F(g){return g.stopPropagation()}export{K as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as U,j as t,b as Ne,B as Ue,O as ge,aD as it,u as Be,c0 as Qe,aB as gt,p as jt,r as X,o as at,bI as bt,bQ as vt,s as z,aF as Ge,aG as Nt,E as ct,e as yt,a as _t,n as Ct,k as St,l as wt,i as Tt,t as ve,K as Je}from"./index-BiG-bBX7.js";import{E as Z,C as ze}from"./collection-search-DWb-q4sb.js";import{E as kt,r as Pt,e as lt}from"./env-vars-editor-DIkYTN09.js";import{g as Ke}from"./types-C6Uddd8z.js";import{S as It}from"./save-actions-p2U4N3h5.js";import{b as $t,a as At}from"./use-binding-CoVeLP6R.js";import{u as Vt,S as Mt}from"./index-B-s7dcGH.js";import{f as Dt,g as dt}from"./use-connection-CsobI-JA.js";import{u as mt}from"./constants-Bj4b22ad.js";import{d as Ot}from"./use-mcp-tools-nHTt7uoJ.js";import{b as Rt}from"./use-mcp-resources-ucs4znYI.js";import{a as Et}from"./decopilot-events-CdHUYzEf.js";import{a as Lt}from"./mcp-oauth-DhVZXZzz.js";import{b as Ye,c as Ut,d as Ft,e as Bt,B as zt,a as Kt}from"./breadcrumb-h53M2ozZ.js";import{C as Xt}from"./collection-tabs-wwfnwWzq.js";import{i as Oe}from"./Loading01-W-w3cVps.js";import{V as Xe,a as Ht}from"./layout-BluQBehB.js";import{C as Wt}from"./collection-tab-CGcalnFw.js";import{I as Re}from"./integration-icon-DJplt18U.js";import{B as Fe}from"./badge-DaJA40lr.js";import{D as qt,a as Qt,b as Gt,c as Ze}from"./dropdown-menu-BaaJ3KIr.js";import{F as W,a as Jt,b as q,d as K,f as Q,c as Y,e as Yt}from"./form-CZlsOGpj.js";import{I as G}from"./input-BcOk4EWn.js";import{S as et,a as tt,b as st,c as nt,d as H}from"./select-DJV0GpEL.js";import{i as ut}from"./CheckCircle-BnSsCPeL.js";import{t as Zt}from"./ChevronDown-CIw5H_8I.js";import{n as es}from"./Container-C4kCziiV.js";import{s as De}from"./Globe02-vxtQsT0f.js";import{s as ts}from"./RefreshCcw01-BM6X0J3F.js";import{i as ss}from"./Terminal-DEkQfpQH.js";import{s as ns}from"./Trash01-BsNnpu_l.js";import{t as He}from"./Users03-BY0qO7qD.js";import{s as os}from"./XClose-7hYEQUhK.js";import{U as rs}from"./user-DiQL4i6w.js";import{b as is,a as as}from"./use-virtual-mcp-r6ou4ewu.js";import{i as cs}from"./ChevronRight-8LnYcsyR.js";import{s as ls}from"./Plus-7RI9qITc.js";import{f as ds}from"./formatDistanceToNow-Cb2QZZJn.js";import{a as pt,C as ft}from"./collection-table-wrapper-LUpcpQuR.js";import{C as We}from"./card-HOT-tKY7.js";import{R as ms}from"./readme-viewer-D1PTXNQQ.js";import{T as us,a as ps}from"./tools-list-CmIBKUpX.js";import{M as fs}from"./mcp-app-renderer-CPkL4-A0.js";import"./SearchMd-BzFnoImC.js";import"./Save01-83pceB_J.js";import"./binder-Bx_2YVEH.js";import"./File06-BzbT2v0z.js";import"./Key01-BjbQkebS.js";import"./constants-DTlOAYW2.js";import"./registry-utils-B4prNmYa.js";import"./extract-connection-data-DSMZDJ4i.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-BUdVd5Au.js";import"./index-CAR0mh84.js";import"./circle-alert-BRVau5r5.js";import"./index-jbQKqjQl.js";import"./index-CBDYR7h7.js";import"./index-D1gbzHrb.js";import"./collapsible-DRIF4wXT.js";import"./use-llm-DTbAtUds.js";import"./useQuery-Us1whSan.js";import"./localstorage-keys-BS2STbF7.js";import"./useMutation-Cxle_Mtw.js";import"./tabs-C-5F-MJ5.js";import"./checkbox-C2xwBknU.js";import"./Check-Bs28PslG.js";import"./dialog-DDOb23Pi.js";import"./X-B9LxUp5o.js";import"./skeleton-DhcP44Ov.js";import"./AlignLeft-DWMdThfD.js";import"./ArrowLeft-CvCy8CyB.js";import"./Image01-B_6vFaZi.js";import"./Settings01-D3dDBLbY.js";import"./useSuspenseInfiniteQuery-DcGj9DQ4.js";import"./infiniteQueryObserver-BZCRT6X1.js";import"./popover-Cnhlur36.js";import"./spinner-DSMOMT7g.js";import"./tooltip-BacoSwd7.js";import"./index-BxikKkX5.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-8t9O2FqG.js";import"./Edit01-DLZcWIR-.js";import"./XCircle-Dkkdz5ph.js";import"./AlertCircle-BIVpB2eV.js";import"./use-copy-De63ENVh.js";import"./Code01-C0MNem7b.js";import"./use-create-virtual-mcp-52zuHZ4A.js";import"./Copy01-Czr6qLQt.js";import"./marked.esm-BaswSlok.js";import"./markdown-94xyd8w7.js";import"./Eye-DPTzoZL8.js";import"./LayersTwo01-BexG7k2g.js";import"./index-ehKjC5PZ.js";import"./Clock-D17OAEFV.js";import"./DotsVertical-D9CMW5-2.js";import"./empty-state-cgNnxJVh.js";import"./Inbox01-DNp0SuVa.js";import"./use-list-state-DZ0uTI_k.js";import"./use-view-mode-RJVvlb7k.js";import"./use-mobile-BwubTGYW.js";import"./alert-dialog-DQT_qq2D.js";import"./label-BLk50aKt.js";import"./avatar-CV6z8E70.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowDown-CnXnoX-V.js";import"./Grid01-CILFuUHo.js";import"./List-BcuB27Kb.js";import"./table-DxvlU5EN.js";function xs(s){const e=U.c(14),{virtualMcp:n,org:o}=s;let i;e[0]!==o||e[1]!==n.id?(i={org:o,project:ge,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=i):i=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(He,{size:16}),e[3]=a):a=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(Re,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let j;e[7]!==n.title?(j=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(cs,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=f):f=e[9];let m;return e[10]!==i||e[11]!==l||e[12]!==j?(m=t.jsxs(it,{to:"/$org/$project/agents/$agentId",params:i,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[l,j,f]}),e[10]=i,e[11]=l,e[12]=j,e[13]=m):m=e[13],m}function ot(s){const e=U.c(20),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:j}=s,f=Ne(),m=as();let x;e[0]!==m.create||e[1]!==i||e[2]!==a||e[3]!==n||e[4]!==o||e[5]!==f||e[6]!==l?(x=async()=>{const d=await m.create.mutateAsync({title:`${o} Agent`,description:i??null,icon:a??null,status:"active",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});f({to:"/$org/$project/agents/$agentId",params:{org:l,project:ge,agentId:d.id}})},e[0]=m.create,e[1]=i,e[2]=a,e[3]=n,e[4]=o,e[5]=f,e[6]=l,e[7]=x):x=e[7];const c=x;if(j){let d;e[8]!==m.create.isPending?(d=m.create.isPending?t.jsx(Oe,{size:16,className:"animate-spin"}):t.jsx(ls,{size:16}),e[8]=m.create.isPending,e[9]=d):d=e[9];let u;return e[10]!==m.create.isPending||e[11]!==c||e[12]!==d?(u=t.jsx(Ue,{variant:"ghost",className:"size-6 p-0",onClick:c,disabled:m.create.isPending,children:d}),e[10]=m.create.isPending,e[11]=c,e[12]=d,e[13]=u):u=e[13],u}let r;e[14]!==m.create.isPending?(r=m.create.isPending?t.jsx(Oe,{className:"animate-spin text-muted-foreground"}):t.jsx(He,{className:"size-3 text-muted-foreground"}),e[14]=m.create.isPending,e[15]=r):r=e[15];let h;return e[16]!==m.create.isPending||e[17]!==c||e[18]!==r?(h=t.jsxs(Ue,{variant:"outline",size:"sm",onClick:c,disabled:m.create.isPending,children:[r,"Create an agent"]}),e[16]=m.create.isPending,e[17]=c,e[18]=r,e[19]=h):h=e[19],h}function hs(s){const e=U.c(26),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l}=s;let j;e[0]!==n?(j={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=j):j=e[1];const f=is(j);if(!(f.length>0)){let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=u):u=e[2];let b;return e[3]!==i||e[4]!==a||e[5]!==n||e[6]!==o||e[7]!==l?(b=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[u,t.jsx(ot,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!1})]}),e[3]=i,e[4]=a,e[5]=n,e[6]=o,e[7]=l,e[8]=b):b=e[8],b}let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=x):x=e[9];let c;e[10]!==i||e[11]!==a||e[12]!==n||e[13]!==o||e[14]!==l?(c=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[x,t.jsx(ot,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!0})]})}),e[10]=i,e[11]=a,e[12]=n,e[13]=o,e[14]=l,e[15]=c):c=e[15];let r;if(e[16]!==l||e[17]!==f){let u;e[19]!==l?(u=b=>t.jsx(xs,{virtualMcp:b,org:l},b.id),e[19]=l,e[20]=u):u=e[20],r=f.map(u),e[16]=l,e[17]=f,e[18]=r}else r=e[18];let h;e[21]!==r?(h=t.jsx("div",{className:"flex flex-col gap-2",children:r}),e[21]=r,e[22]=h):h=e[22];let d;return e[23]!==c||e[24]!==h?(d=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[c,h]}),e[23]=c,e[24]=h,e[25]=d):d=e[25],d}function gs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:i}){const a=Qe({control:s.control,name:"ui_type"}),l=Qe({control:s.control,name:"connection_url"}),{stdioEnabled:j}=gt(),f=(()=>{if(typeof l!="string"||!l)return!1;try{const r=new URL(l);return r.hostname==="api.githubcopilot.com"&&r.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),m=j||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",c=x?jt(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(He,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),c&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:c})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(W,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),a!=="NPX"&&a!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(K,{children:t.jsxs(tt,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(De,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(st,{})]})}),t.jsxs(nt,{children:[t.jsx(H,{value:"HTTP",children:"HTTP"}),t.jsx(H,{value:"SSE",children:"SSE"}),t.jsx(H,{value:"Websocket",children:"Websocket"}),m&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:"NPX Package"}),t.jsx(H,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(W,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(q,{className:"flex-1 min-w-0",children:t.jsx(K,{children:t.jsx(G,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(K,{children:t.jsx(tt,{className:"h-10",children:t.jsx(st,{})})}),t.jsxs(nt,{children:[t.jsx(H,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(H,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(H,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(es,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(H,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ss,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(Q,{})]})}),a==="NPX"&&t.jsx(W,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(K,{children:t.jsx(G,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),a==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(W,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(K,{children:t.jsx(G,{placeholder:"node, bun, python...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),t.jsx(W,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(K,{children:t.jsx(G,{placeholder:"arg1 arg2 --flag value",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(Q,{})]})})]}),t.jsx(W,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(K,{children:t.jsx(G,{placeholder:"/path/to/project (optional)",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})})]}),(a==="NPX"||a==="STDIO")&&t.jsx(W,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(K,{children:t.jsx(kt,{value:r.value??[],onChange:r.onChange})}),t.jsx(Q,{})]})}),a!=="NPX"&&a!=="STDIO"&&t.jsx(W,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:f?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(qt,{children:[t.jsx(Qt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Fe,{variant:"success",className:"gap-1.5",children:[t.jsx(ut,{size:12}),"Authenticated via OAuth",t.jsx(Zt,{size:12})]})})}),t.jsxs(Gt,{align:"start",children:[t.jsxs(Ze,{onClick:o,children:[t.jsx(ts,{size:16}),"Re-authenticate"]}),t.jsxs(Ze,{variant:"destructive",onClick:i,children:[t.jsx(ns,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&r.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>r.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(os,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(K,{children:t.jsx(G,{type:"password",placeholder:f?"Paste your GitHub PAT":"Enter access token...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),f&&t.jsxs(Yt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(Q,{})]})})]})}function js(s){const e=U.c(43),{form:n,connection:o,isMCPAuthenticated:i,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}=s,{org:f}=Be();let m;e[0]!==o.icon||e[1]!==o.title?(m=t.jsx(Re,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}),e[0]=o.icon,e[1]=o.title,e[2]=m):m=e[2];let x;e[3]!==n.control?(x=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(W,{control:n.control,name:"title",render:vs}),t.jsx(W,{control:n.control,name:"description",render:bs})]}),e[3]=n.control,e[4]=x):x=e[4];let c;e[5]!==m||e[6]!==x?(c=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[m,x]}),e[5]=m,e[6]=x,e[7]=c):c=e[7];let r;e[8]!==o||e[9]!==n||e[10]!==a||e[11]!==l||e[12]!==j?(r=t.jsx(gs,{form:n,connection:o,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}),e[8]=o,e[9]=n,e[10]=a,e[11]=l,e[12]=j,e[13]=r):r=e[13];let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[14]=h):h=e[14];let d;e[15]!==i?(d=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[h,i?t.jsxs(Fe,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(ut,{size:12}),"Connected"]}):t.jsx(Fe,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[15]=i,e[16]=d):d=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[17]=u):u=e[17];let b;e[18]!==o.created_by?(b=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[u,t.jsx(rs,{id:o.created_by,size:"2xs"})]}),e[18]=o.created_by,e[19]=b):b=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[20]=v):v=e[20];let _;e[21]!==o.updated_at?(_=o.updated_at?ds(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[21]=o.updated_at,e[22]=_):_=e[22];let S;e[23]!==_?(S=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[v,t.jsx("span",{className:"text-sm text-foreground",children:_})]}),e[23]=_,e[24]=S):S=e[24];let p;e[25]!==S||e[26]!==d||e[27]!==b?(p=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[d,b,S]}),e[25]=S,e[26]=d,e[27]=b,e[28]=p):p=e[28];let C;e[29]!==o.description||e[30]!==o.icon||e[31]!==o.id||e[32]!==o.title||e[33]!==f.slug?(C=t.jsx(hs,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:f.slug}),e[29]=o.description,e[30]=o.icon,e[31]=o.id,e[32]=o.title,e[33]=f.slug,e[34]=C):C=e[34];let w;e[35]!==p||e[36]!==C||e[37]!==c||e[38]!==r?(w=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[c,r,p,C]}),e[35]=p,e[36]=C,e[37]=c,e[38]=r,e[39]=w):w=e[39];let g;return e[40]!==n||e[41]!==w?(g=t.jsx(Jt,{...n,children:w}),e[40]=n,e[41]=w,e[42]=g):g=e[42],g}function bs(s){const{field:e}=s;return t.jsxs(q,{className:"w-full space-y-0",children:[t.jsx(K,{children:t.jsx(G,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Q,{})]})}function vs(s){const{field:e}=s;return t.jsxs(q,{className:"flex-1 space-y-0",children:[t.jsx(K,{children:t.jsx(G,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),t.jsx(Q,{})]})}function Ns(s){const e=U.c(39),{prompts:n,connectionId:o,org:i,onPromptClick:a,showToolbar:l,emptyMessage:j}=s,f=l===void 0?!0:l,m=j===void 0?"This connection doesn't have any prompts yet.":j,x=Ne(),[c,r]=X.useState(""),[h,d]=X.useState("table"),[u,b]=X.useState("name"),[v,_]=X.useState("asc");let S;e[0]!==v||e[1]!==u?(S=T=>{u===T?(_(ws),v==="desc"&&b(void 0)):(b(T),_("asc"))},e[0]=v,e[1]=u,e[2]=S):S=e[2];const p=S;let C;e[3]!==o||e[4]!==x||e[5]!==a||e[6]!==i?(C=T=>{a?a(T):o&&i&&x({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ge,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(T.name)}})},e[3]=o,e[4]=x,e[5]=a,e[6]=i,e[7]=C):C=e[7];const w=C;let g;if(e[8]!==n||e[9]!==c||e[10]!==v||e[11]!==u){const T=!n||n.length===0?[]:c.trim()?(()=>{const F=c.toLowerCase();return n.filter(B=>B.name.toLowerCase().includes(F)||B.description&&B.description.toLowerCase().includes(F))})():n;g=!u||!v?T:[...T].sort((F,B)=>{const je=F[u]||"",ee=B[u]||"",J=String(je).localeCompare(String(ee));return v==="asc"?J:-J}),e[8]=n,e[9]=c,e[10]=v,e[11]=u,e[12]=g}else g=e[12];const I=g;let D;e[13]===Symbol.for("react.memo_cache_sentinel")?(D=[{id:"name",header:"Name",render:Ss,sortable:!0},{id:"description",header:"Description",render:Cs,cellClassName:"flex-1",sortable:!0}],e[13]=D):D=e[13];const A=D;let V;e[14]===Symbol.for("react.memo_cache_sentinel")?(V=A.filter(_s).map(ys),e[14]=V):V=e[14];const L=V;let y;e[15]!==p||e[16]!==f||e[17]!==v||e[18]!==u||e[19]!==h?(y=f&&t.jsx(Xe,{children:t.jsx(ft,{viewMode:h,onViewModeChange:d,sortKey:u,sortDirection:v,onSort:p,sortOptions:L})}),e[15]=p,e[16]=f,e[17]=v,e[18]=u,e[19]=h,e[20]=y):y=e[20];let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=T=>{T.key==="Escape"&&(r(""),T.target.blur())},e[21]=R):R=e[21];let M;e[22]!==c?(M=t.jsx(ze,{value:c,onChange:r,placeholder:"Search prompts...",onKeyDown:R}),e[22]=c,e[23]=M):M=e[23];let N;e[24]!==m||e[25]!==w||e[26]!==p||e[27]!==c||e[28]!==v||e[29]!==u||e[30]!==I||e[31]!==h?(N=h==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:I.length===0?t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:I.map(T=>t.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>w(T),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:T.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:T.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:T.description||"No description"})]})]})},T.name))})}):t.jsx(pt,{columns:A,data:I,isLoading:!1,sortKey:u,sortDirection:v,onSort:p,onRowClick:T=>w(T),emptyState:t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m})}),e[24]=m,e[25]=w,e[26]=p,e[27]=c,e[28]=v,e[29]=u,e[30]=I,e[31]=h,e[32]=N):N=e[32];let $;e[33]!==M||e[34]!==N?($=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[M,N]}),e[33]=M,e[34]=N,e[35]=$):$=e[35];let P;return e[36]!==$||e[37]!==y?(P=t.jsxs(t.Fragment,{children:[y,$]}),e[36]=$,e[37]=y,e[38]=P):P=e[38],P}function ys(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function _s(s){return s.sortable}function Cs(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ss(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function ws(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Ts(s){const e=U.c(4),{prompts:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(Ns,{prompts:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}function ks(s){const e=U.c(2),{repository:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(ms,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function Ps(s){const e=U.c(36),{resources:n,onResourceClick:o,showToolbar:i,emptyMessage:a}=s,l=i===void 0?!0:i,j=a===void 0?"This connection doesn't have any resources yet.":a,[f,m]=X.useState(""),[x,c]=X.useState("table"),[r,h]=X.useState("name"),[d,u]=X.useState("asc");let b;e[0]!==d||e[1]!==r?(b=N=>{r===N?(u(Os),d==="desc"&&h(void 0)):(h(N),u("asc"))},e[0]=d,e[1]=r,e[2]=b):b=e[2];const v=b;let _;e[3]!==o?(_=N=>{o&&o(N)},e[3]=o,e[4]=_):_=e[4];const S=_;let p;if(e[5]!==n||e[6]!==f||e[7]!==d||e[8]!==r){const N=!n||n.length===0?[]:f.trim()?(()=>{const $=f.toLowerCase();return n.filter(P=>P.uri.toLowerCase().includes($)||P.name&&P.name.toLowerCase().includes($)||P.description&&P.description.toLowerCase().includes($))})():n;p=!r||!d?N:[...N].sort(($,P)=>{const T=$[r]||"",F=P[r]||"",B=String(T).localeCompare(String(F));return d==="asc"?B:-B}),e[5]=n,e[6]=f,e[7]=d,e[8]=r,e[9]=p}else p=e[9];const C=p;let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=[{id:"name",header:"Name",render:Ds,sortable:!0},{id:"uri",header:"URI",render:Ms,sortable:!0},{id:"description",header:"Description",render:Vs,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:As,sortable:!0}],e[10]=w):w=e[10];const g=w;let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=g.filter($s).map(Is),e[11]=I):I=e[11];const D=I;let A;e[12]!==v||e[13]!==l||e[14]!==d||e[15]!==r||e[16]!==x?(A=l&&t.jsx(Xe,{children:t.jsx(ft,{viewMode:x,onViewModeChange:c,sortKey:r,sortDirection:d,onSort:v,sortOptions:D})}),e[12]=v,e[13]=l,e[14]=d,e[15]=r,e[16]=x,e[17]=A):A=e[17];let V;e[18]===Symbol.for("react.memo_cache_sentinel")?(V=N=>{N.key==="Escape"&&(m(""),N.target.blur())},e[18]=V):V=e[18];let L;e[19]!==f?(L=t.jsx(ze,{value:f,onChange:m,placeholder:"Search resources...",onKeyDown:V}),e[19]=f,e[20]=L):L=e[20];let y;e[21]!==j||e[22]!==S||e[23]!==v||e[24]!==f||e[25]!==d||e[26]!==r||e[27]!==C||e[28]!==x?(y=x==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:C.length===0?t.jsx(Z,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":j}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:C.map(N=>t.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>S(N),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:N.name||N.uri,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:N.name||N.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:N.uri}),N.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:N.description})]})]})},N.uri))})}):t.jsx(pt,{columns:g,data:C,isLoading:!1,sortKey:r,sortDirection:d,onSort:v,onRowClick:N=>S(N),emptyState:t.jsx(Z,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":j})}),e[21]=j,e[22]=S,e[23]=v,e[24]=f,e[25]=d,e[26]=r,e[27]=C,e[28]=x,e[29]=y):y=e[29];let R;e[30]!==L||e[31]!==y?(R=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[L,y]}),e[30]=L,e[31]=y,e[32]=R):R=e[32];let M;return e[33]!==R||e[34]!==A?(M=t.jsxs(t.Fragment,{children:[A,R]}),e[33]=R,e[34]=A,e[35]=M):M=e[35],M}function Is(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function $s(s){return s.sortable}function As(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Vs(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ms(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Ds(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function Os(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Rs(s){const e=U.c(4),{resources:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(Ps,{resources:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}const Es=at({key:z().min(1,"Key is required"),value:z()}),Ls=at({title:z().min(1,"Name is required"),description:z().nullable().optional(),ui_type:Nt(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:z().optional(),connection_token:z().nullable().optional(),npx_package:z().optional(),stdio_command:z().optional(),stdio_args:z().optional(),stdio_cwd:z().optional(),env_vars:Ge(Es).optional(),configuration_scopes:Ge(z()).nullable().optional(),configuration_state:bt(z(),vt()).nullable().optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Us(s){const e=U.c(5),{tools:n,connectionId:o,org:i,isLoading:a}=s;let l;return e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==n?(l=t.jsx(us,{tools:n,connectionId:o,org:i,isLoading:a}),e[0]=o,e[1]=a,e[2]=i,e[3]=n,e[4]=l):l=e[4],l}function Fs(s){const e=U.c(27),{tools:n,connectionId:o,org:i}=s,a=Ne(),{org:l}=Be();let j;e[0]!==o||e[1]!==l.id?(j={connectionId:o,orgId:l.id},e[0]=o,e[1]=l.id,e[2]=j):j=e[2];const f=mt(j),[m,x]=X.useState("");let c,r,h,d;if(e[3]!==f||e[4]!==o||e[5]!==a||e[6]!==i||e[7]!==m||e[8]!==n){const v=(n??[]).filter(Bs),_=m.toLowerCase().trim(),S=_?v.filter(g=>g.name.toLowerCase().includes(_)||g.description&&g.description.toLowerCase().includes(_)):v;let p;e[13]!==o||e[14]!==a||e[15]!==i?(p=g=>{a({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ge,connectionId:o,collectionName:"tools",itemId:encodeURIComponent(g.name)}})},e[13]=o,e[14]=a,e[15]=i,e[16]=p):p=e[16];const C=p;h="flex flex-col h-full overflow-hidden";let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=g=>{g.key==="Escape"&&(x(""),g.target.blur())},e[17]=w):w=e[17],e[18]!==m?(d=t.jsx(ze,{value:m,onChange:x,placeholder:"Search apps...",onKeyDown:w}),e[18]=m,e[19]=d):d=e[19],c="flex-1 overflow-auto p-5",r=S.length===0?t.jsx(Z,{image:null,title:m?"No apps found":"No apps available",description:m?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:S.map(g=>{const I=Ke(g._meta);return t.jsxs(We,{className:"cursor-pointer transition-colors overflow-hidden",onClick:()=>C(g),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(fs,{resourceURI:I,toolName:g.name,displayMode:"inline",minHeight:200,maxHeight:200,client:f})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:g.name}),t.jsx(ps,{annotations:g.annotations,_meta:g._meta})]}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:g.description})]})]},g.name)})}),e[3]=f,e[4]=o,e[5]=a,e[6]=i,e[7]=m,e[8]=n,e[9]=c,e[10]=r,e[11]=h,e[12]=d}else c=e[9],r=e[10],h=e[11],d=e[12];let u;e[20]!==c||e[21]!==r?(u=t.jsx("div",{className:c,children:r}),e[20]=c,e[21]=r,e[22]=u):u=e[22];let b;return e[23]!==h||e[24]!==d||e[25]!==u?(b=t.jsxs("div",{className:h,children:[d,u]}),e[23]=h,e[24]=d,e[25]=u,e[26]=b):b=e[26],b}function Bs(s){return!!Ke(s._meta)}function zs(s){return s.command==="npx"}function Ks(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Hs(s,e){const n={command:"npx",args:["-y",s]},o=lt(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Ws(s,e,n,o){const i={command:s};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const a=lt(o);return Object.keys(a).length>0&&(i.envVars=a),i}function rt(s,e){const n={title:s.title,description:s.description??"",configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Tt(s.connection_headers)){const o=s.connection_headers,i=Pt(o.envVars);if(zs(o)){const l=Ks(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const a=Xs(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:i}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function qs(s){let e,n=null,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=Hs(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=Ws(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",o=s.connection_token||null),{title:s.title,description:s.description||null,connection_type:e,connection_url:n,...o&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Qs(s){const e=U.c(116),{connection:n,connectionId:o,org:i,requestedTabId:a,collections:l,onUpdate:j,isUpdating:f,prompts:m,resources:x,tools:c,isLoadingTools:r}=s;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={from:"/$org/$project/mcps/$connectionId"},e[0]=h):h=e[0];const d=Ne(h),u=Ct(),b=dt();let v;e[1]!==o?(v={connectionId:o},e[1]=o,e[2]=v):v=e[2];const _=Vt(v),p=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let C;e[3]!==n?(C={connections:[n],binding:"MCP"},e[3]=n,e[4]=C):C=e[4];const g=At(C).length>0,I=n?.metadata?.repository,D=!!I?.url;let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A=St(Ls),e[5]=A):A=e[5];let V;e[6]!==n?(V=rt(n),e[6]=n,e[7]=V):V=e[7];let L;e[8]!==V?(L={resolver:A,values:V},e[8]=V,e[9]=L):L=e[9];const y=wt(L),R=y.formState.isDirty;let M;e[10]!==y||e[11]!==j?(M=async()=>{if(!await y.trigger())return;const E=y.getValues(),he=qs(E);await j(he),y.reset(E)},e[10]=y,e[11]=j,e[12]=M):M=e[12];const N=M;let $;e[13]!==n||e[14]!==y?($=()=>{y.reset(rt(n))},e[13]=n,e[14]=y,e[15]=$):$=e[15];const P=$;let T;e[16]!==n.id||e[17]!==b||e[18]!==u?(T=async()=>{const{token:k,tokenInfo:E,error:he}=await Lt({connectionId:n.id});if(he||!k){ve.error(`Authentication failed: ${he}`);return}if(E)try{const Me=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:E.accessToken,refreshToken:E.refreshToken,expiresIn:E.expiresIn,scope:E.scope,clientId:E.clientId,clientSecret:E.clientSecret,tokenEndpoint:E.tokenEndpoint})});if(!Me.ok)console.error("Failed to save OAuth token:",await Me.text()),await b.update.mutateAsync({id:n.id,data:{connection_token:k}});else try{await b.update.mutateAsync({id:n.id,data:{}})}catch(qe){console.warn("Failed to refresh connection tools after OAuth:",qe)}}catch(Me){console.error("Error saving OAuth token:",Me),await b.update.mutateAsync({id:n.id,data:{connection_token:k}})}else await b.update.mutateAsync({id:n.id,data:{connection_token:k}});const ht=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(ht.href,null)}),ve.success("Authentication successful")},e[16]=n.id,e[17]=b,e[18]=u,e[19]=T):T=e[19];const F=T;let B;e[20]!==n.id||e[21]!==u?(B=async()=>{try{const k=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!k.ok){const he=await k.text();ve.error(`Failed to remove OAuth: ${he}`);return}const E=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(E.href,null)}),ve.success("OAuth removed. You can now re-authenticate with a different account.")}catch(k){console.error("Error removing OAuth token:",k),ve.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=u,e[22]=B):B=e[22];const je=B,ee=c.length,J=m.length,ye=x.length;let _e;e[23]!==c?(_e=c.filter(Ys),e[23]=c,e[24]=_e):_e=e[24];const Ce=_e.length,Ee=ee>0||r;let Se;e[25]===Symbol.for("react.memo_cache_sentinel")?(Se={id:"settings",label:"Settings"},e[25]=Se):Se=e[25];let te;e[26]!==r||e[27]!==p||e[28]!==Ee||e[29]!==ee?(te=p&&Ee?[{id:"tools",label:"Tools",count:r?void 0:ee}]:[],e[26]=r,e[27]=p,e[28]=Ee,e[29]=ee,e[30]=te):te=e[30];let se;e[31]!==p||e[32]!==J?(se=p&&J>0?[{id:"prompts",label:"Prompts",count:J}]:[],e[31]=p,e[32]=J,e[33]=se):se=e[33];let ne;e[34]!==p||e[35]!==ye?(ne=p&&ye>0?[{id:"resources",label:"Resources",count:ye}]:[],e[34]=p,e[35]=ye,e[36]=ne):ne=e[36];let oe;e[37]!==p||e[38]!==Ce?(oe=p&&Ce>0?[{id:"ui",label:"UI",count:Ce}]:[],e[37]=p,e[38]=Ce,e[39]=oe):oe=e[39];let we;if(e[40]!==l||e[41]!==D||e[42]!==p||e[43]!==te||e[44]!==se||e[45]!==ne||e[46]!==oe){let k;e[48]!==D?(k=D?[{id:"readme",label:"README"}]:[],e[48]=D,e[49]=k):k=e[49],we=[Se,...te,...se,...ne,...oe,...p?(l||[]).map(Js):[],...k],e[40]=l,e[41]=D,e[42]=p,e[43]=te,e[44]=se,e[45]=ne,e[46]=oe,e[47]=we}else we=e[47];const be=we,xt=p&&be.some(Gs)?"tools":"settings",O=be.some(k=>k.id===a)?a:xt;let Te;e[50]!==d?(Te=k=>{d({search:E=>({...E,tab:k}),replace:!0})},e[50]=d,e[51]=Te):Te=e[51];const re=Te;let ie;e[52]!==l?(ie=l||[],e[52]=l,e[53]=ie):ie=e[53];let ke;if(e[54]!==O||e[55]!==ie){let k;e[57]!==O?(k=E=>E.name===O,e[57]=O,e[58]=k):k=e[58],ke=ie.find(k),e[54]=O,e[55]=ie,e[56]=ke}else ke=e[56];const Pe=ke;let ae;e[59]!==i?(ae=t.jsx(Ye,{children:t.jsx(Ft,{asChild:!0,children:t.jsx(it,{to:"/$org/$project/mcps",params:{org:i,project:ge},children:"Connections"})})}),e[59]=i,e[60]=ae):ae=e[60];let Ie;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx(Bt,{}),e[61]=Ie):Ie=e[61];let ce;e[62]!==n.title?(ce=t.jsx(Ye,{children:t.jsx(Ut,{children:n.title})}),e[62]=n.title,e[63]=ce):ce=e[63];let $e;e[64]!==ae||e[65]!==ce?($e=t.jsx(zt,{children:t.jsxs(Kt,{children:[ae,Ie,ce]})}),e[64]=ae,e[65]=ce,e[66]=$e):$e=e[66];const Le=$e;let le;e[67]!==N||e[68]!==P||e[69]!==R||e[70]!==f?(le=t.jsx(Xe,{children:t.jsx(It,{onSave:N,onUndo:P,isDirty:R,isSaving:f})}),e[67]=N,e[68]=P,e[69]=R,e[70]=f,e[71]=le):le=e[71];let de;e[72]!==_.hasOAuthToken||e[73]!==n||e[74]!==y||e[75]!==F||e[76]!==je||e[77]!==p?(de=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(js,{form:y,connection:n,isMCPAuthenticated:p,hasOAuthToken:_.hasOAuthToken,onReauthenticate:F,onRemoveOAuth:je})}),e[72]=_.hasOAuthToken,e[73]=n,e[74]=y,e[75]=F,e[76]=je,e[77]=p,e[78]=de):de=e[78];let me;e[79]!==O||e[80]!==re||e[81]!==be?(me=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(Xt,{tabs:be,activeTab:O,onTabChange:re,className:"flex-1"})}),e[79]=O,e[80]=re,e[81]=be,e[82]=me):me=e[82];let Ae;e[83]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),e[83]=Ae):Ae=e[83];let ue;e[84]!==Pe||e[85]!==O||e[86]!==_.isServerError||e[87]!==_.supportsOAuth||e[88]!==n||e[89]!==o||e[90]!==y||e[91]!==F||e[92]!==re||e[93]!==g||e[94]!==D||e[95]!==r||e[96]!==p||e[97]!==i||e[98]!==m||e[99]!==I||e[100]!==x||e[101]!==c?(ue=t.jsx(X.Suspense,{fallback:Ae,children:O==="tools"?t.jsx(Us,{tools:c,connectionId:o,org:i,isLoading:r}):O==="ui"?t.jsx(Fs,{tools:c,connectionId:o,org:i}):O==="prompts"?t.jsx(Ts,{prompts:m,connectionId:o,org:i}):O==="resources"?t.jsx(Rs,{resources:x,connectionId:o,org:i}):O==="settings"?t.jsx(Mt,{connection:n,form:y,hasMcpBinding:g,isMCPAuthenticated:p,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:F,onViewReadme:D?()=>re("readme"):void 0}):O==="readme"&&D?t.jsx(ks,{repository:I}):Pe&&p?t.jsx(Wt,{connectionId:o,org:i,activeCollection:Pe},O):t.jsx(Z,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[84]=Pe,e[85]=O,e[86]=_.isServerError,e[87]=_.supportsOAuth,e[88]=n,e[89]=o,e[90]=y,e[91]=F,e[92]=re,e[93]=g,e[94]=D,e[95]=r,e[96]=p,e[97]=i,e[98]=m,e[99]=I,e[100]=x,e[101]=c,e[102]=ue):ue=e[102];let pe;e[103]!==O||e[104]!==ue?(pe=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(ct,{children:ue},O)}),e[103]=O,e[104]=ue,e[105]=pe):pe=e[105];let fe;e[106]!==me||e[107]!==pe?(fe=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[me,pe]}),e[106]=me,e[107]=pe,e[108]=fe):fe=e[108];let xe;e[109]!==de||e[110]!==fe?(xe=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[de,fe]}),e[109]=de,e[110]=fe,e[111]=xe):xe=e[111];let Ve;return e[112]!==Le||e[113]!==le||e[114]!==xe?(Ve=t.jsxs(Ht,{breadcrumb:Le,children:[le,xe]}),e[112]=Le,e[113]=le,e[114]=xe,e[115]=Ve):Ve=e[115],Ve}function Gs(s){return s.id==="tools"}function Js(s){return{id:s.name,label:s.displayName}}function Ys(s){return!!Ke(s._meta)}function Zs(){const s=U.c(43);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=Ne(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:i,org:a}=yt(o),{org:l}=Be();let j;s[2]===Symbol.for("react.memo_cache_sentinel")?(j={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=j):j=s[2];const m=_t(j).tab??"",x=Dt(i),c=dt(),r=$t(x??void 0);let h;s[3]!==i||s[4]!==l.id?(h={connectionId:i,orgId:l.id},s[3]=i,s[4]=l.id,s[5]=h):h=s[5];const d=mt(h);let u;s[6]!==d?(u={client:d},s[6]=d,s[7]=u):u=s[7];const{data:b}=Et(u);let v;s[8]!==d?(v={client:d},s[8]=d,s[9]=v):v=s[9];const{data:_}=Rt(v),S=x?.connection_type==="VIRTUAL";let p;s[10]!==d||s[11]!==S?(p={client:d,enabled:S},s[10]=d,s[11]=S,s[12]=p):p=s[12];const{data:C,isLoading:w}=Ot(p);let g;s[13]!==b?.prompts?(g=b?.prompts??[],s[13]=b?.prompts,s[14]=g):g=s[14];let I;s[15]!==g?(I=g.map(sn),s[15]=g,s[16]=I):I=s[16];const D=I;let A;s[17]!==_?.resources?(A=_?.resources??[],s[17]=_?.resources,s[18]=A):A=s[18];let V;s[19]!==A?(V=A.map(tn),s[19]=A,s[20]=V):V=s[20];const L=V;let y;s[21]!==x?.tools||s[22]!==S||s[23]!==C?.tools?(y=S?(C?.tools??[]).map(en):x?.tools??[],s[21]=x?.tools,s[22]=S,s[23]=C?.tools,s[24]=y):y=s[24];const R=y;let M;s[25]!==c.update||s[26]!==i?(M=async P=>{await c.update.mutateAsync({id:i,data:P})},s[25]=c.update,s[26]=i,s[27]=M):M=s[27];const N=M;if(!x){let P;return s[28]!==n||s[29]!==a?(P=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Z,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Ue,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:a,project:ge}}),children:"Back to connections"})})}),s[28]=n,s[29]=a,s[30]=P):P=s[30],P}let $;return s[31]!==c.update.isPending||s[32]!==r||s[33]!==x||s[34]!==i||s[35]!==N||s[36]!==w||s[37]!==a||s[38]!==D||s[39]!==m||s[40]!==L||s[41]!==R?($=t.jsx(Qs,{org:a,connection:x,connectionId:i,requestedTabId:m,collections:r,onUpdate:N,isUpdating:c.update.isPending,prompts:D,resources:L,tools:R,isLoadingTools:w}),s[31]=c.update.isPending,s[32]=r,s[33]=x,s[34]=i,s[35]=N,s[36]=w,s[37]=a,s[38]=D,s[39]=m,s[40]=L,s[41]=R,s[42]=$):$=s[42],$}function en(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function tn(s){return{uri:s.uri,name:s.name,description:s.description}}function sn(s){return{name:s.name,description:s.description}}function nn(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ct,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Zs,{})})}),s[0]=e):e=s[0],e}function cr(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(nn,{}),s[0]=e):e=s[0],e}export{cr as default};
|
|
1
|
+
import{c as U,j as t,b as Ne,B as Ue,O as ge,aD as it,u as Be,c0 as Qe,aB as gt,p as jt,r as X,o as at,bI as bt,bQ as vt,s as z,aF as Ge,aG as Nt,E as ct,e as yt,a as _t,n as Ct,k as St,l as wt,i as Tt,t as ve,K as Je}from"./index-BkxNgQ-z.js";import{E as Z,C as ze}from"./collection-search-BgstpGbD.js";import{E as kt,r as Pt,e as lt}from"./env-vars-editor-DM7ragIP.js";import{g as Ke}from"./types-9lUbCnT7.js";import{S as It}from"./save-actions-DgW9lLRI.js";import{b as $t,a as At}from"./use-binding-CVLYzFG-.js";import{u as Vt,S as Mt}from"./index-ZJA9ZP0w.js";import{f as Dt,g as dt}from"./use-connection-DjiXkPUz.js";import{u as mt}from"./constants--aQ9HnxF.js";import{d as Ot}from"./use-mcp-tools-CHOGR3no.js";import{b as Rt}from"./use-mcp-resources-DS8p1Owh.js";import{a as Et}from"./decopilot-events-DZodCqX1.js";import{a as Lt}from"./mcp-oauth-hrdldmcp.js";import{b as Ye,c as Ut,d as Ft,e as Bt,B as zt,a as Kt}from"./breadcrumb-DxXcAXh7.js";import{C as Xt}from"./collection-tabs-nglpt7Dm.js";import{i as Oe}from"./Loading01-BLoQsWVt.js";import{V as Xe,a as Ht}from"./layout-rnNZXdmD.js";import{C as Wt}from"./collection-tab-CkymCS_K.js";import{I as Re}from"./integration-icon-DqBJsR0X.js";import{B as Fe}from"./badge-UPowR1Nj.js";import{D as qt,a as Qt,b as Gt,c as Ze}from"./dropdown-menu-DvfBJ25L.js";import{F as W,a as Jt,b as q,d as K,f as Q,c as Y,e as Yt}from"./form-DKOb9Dxi.js";import{I as G}from"./input-BxWPl4Ur.js";import{S as et,a as tt,b as st,c as nt,d as H}from"./select-CHQkyynJ.js";import{i as ut}from"./CheckCircle-B-t884rD.js";import{t as Zt}from"./ChevronDown-D15Vpp0r.js";import{n as es}from"./Container-CFxptFeR.js";import{s as De}from"./Globe02-6j3SB4QZ.js";import{s as ts}from"./RefreshCcw01-DzE0Vt_s.js";import{i as ss}from"./Terminal-DQnj9LXz.js";import{s as ns}from"./Trash01-BvIumE4M.js";import{t as He}from"./Users03-CUxh9_Jy.js";import{s as os}from"./XClose-CnTCpAeI.js";import{U as rs}from"./user-BcEL6pjj.js";import{b as is,a as as}from"./use-virtual-mcp-Wj5StsuR.js";import{i as cs}from"./ChevronRight-u7jqeZNG.js";import{s as ls}from"./Plus-4zX3n4bH.js";import{f as ds}from"./formatDistanceToNow-Cb2QZZJn.js";import{a as pt,C as ft}from"./collection-table-wrapper-B7II4YYC.js";import{C as We}from"./card-BRjix5ol.js";import{R as ms}from"./readme-viewer-CvFtkeFt.js";import{T as us,a as ps}from"./tools-list-Cb9H3DsC.js";import{M as fs}from"./mcp-app-renderer-DlqJcoS_.js";import"./SearchMd-BvHN4xgB.js";import"./Save01-DiUMsefH.js";import"./binder-DUACCYIe.js";import"./File06-D8w_IYOr.js";import"./Key01-Cvjt_ykt.js";import"./constants-DoLvwboP.js";import"./registry-utils-Bm8aYhvn.js";import"./extract-connection-data-DtOGbK2O.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-kgqBLGhb.js";import"./index-CuJORTyw.js";import"./circle-alert-CHATLFG-.js";import"./index-Bq_4mEQF.js";import"./index-CKt9M-ST.js";import"./index-u5kBBr5i.js";import"./collapsible-CG7okAAn.js";import"./use-llm-Bkjj502R.js";import"./useQuery-Cj-miqA2.js";import"./localstorage-keys-2beZrYfY.js";import"./useMutation-DtOoZO7h.js";import"./tabs-tcquyh90.js";import"./checkbox-Df-Mj-oX.js";import"./Check-BuBqfL8V.js";import"./dialog-CrYlSCa6.js";import"./X-CpsrVd7E.js";import"./skeleton-Bla1LCSZ.js";import"./AlignLeft-zf4ygcA_.js";import"./ArrowLeft-DKmEJ5pf.js";import"./Image01-oZtE9Z5q.js";import"./Settings01-B5kunEo2.js";import"./useSuspenseInfiniteQuery-D62VIKAF.js";import"./infiniteQueryObserver-DFroUYRE.js";import"./popover-CJnKtmVV.js";import"./spinner-B_k6AtHn.js";import"./tooltip-DvMRS01W.js";import"./index-dKQNml8k.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-BNm6R5tp.js";import"./Edit01-CbZPkCJz.js";import"./XCircle-BcvU_Xzf.js";import"./AlertCircle-dxGFeayp.js";import"./use-copy-DiVO6tbG.js";import"./Code01-DhSY1b20.js";import"./use-create-virtual-mcp-DnOGpm5h.js";import"./Copy01-D2l3XUry.js";import"./marked.esm-BaswSlok.js";import"./markdown-08iefd1w.js";import"./Eye-vR70tVFn.js";import"./LayersTwo01-f778oNbj.js";import"./index-B4YFEuZr.js";import"./Clock-B88-VhpY.js";import"./DotsVertical-B78gtBdB.js";import"./empty-state-C2LU6BeW.js";import"./Inbox01-xF_R8liT.js";import"./use-list-state-CCFlT7yz.js";import"./use-view-mode-3_G2qIMG.js";import"./use-mobile-BArkW6j1.js";import"./alert-dialog-B0yEBEkb.js";import"./label-DQ6CQRMq.js";import"./avatar-BeiX4aSz.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowDown-BfANN175.js";import"./Grid01-DjcW2Js4.js";import"./List-Be3XBHwN.js";import"./table-BJ3W5Geb.js";function xs(s){const e=U.c(14),{virtualMcp:n,org:o}=s;let i;e[0]!==o||e[1]!==n.id?(i={org:o,project:ge,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=i):i=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(He,{size:16}),e[3]=a):a=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(Re,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let j;e[7]!==n.title?(j=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(cs,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=f):f=e[9];let m;return e[10]!==i||e[11]!==l||e[12]!==j?(m=t.jsxs(it,{to:"/$org/$project/agents/$agentId",params:i,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[l,j,f]}),e[10]=i,e[11]=l,e[12]=j,e[13]=m):m=e[13],m}function ot(s){const e=U.c(20),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:j}=s,f=Ne(),m=as();let x;e[0]!==m.create||e[1]!==i||e[2]!==a||e[3]!==n||e[4]!==o||e[5]!==f||e[6]!==l?(x=async()=>{const d=await m.create.mutateAsync({title:`${o} Agent`,description:i??null,icon:a??null,status:"active",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});f({to:"/$org/$project/agents/$agentId",params:{org:l,project:ge,agentId:d.id}})},e[0]=m.create,e[1]=i,e[2]=a,e[3]=n,e[4]=o,e[5]=f,e[6]=l,e[7]=x):x=e[7];const c=x;if(j){let d;e[8]!==m.create.isPending?(d=m.create.isPending?t.jsx(Oe,{size:16,className:"animate-spin"}):t.jsx(ls,{size:16}),e[8]=m.create.isPending,e[9]=d):d=e[9];let u;return e[10]!==m.create.isPending||e[11]!==c||e[12]!==d?(u=t.jsx(Ue,{variant:"ghost",className:"size-6 p-0",onClick:c,disabled:m.create.isPending,children:d}),e[10]=m.create.isPending,e[11]=c,e[12]=d,e[13]=u):u=e[13],u}let r;e[14]!==m.create.isPending?(r=m.create.isPending?t.jsx(Oe,{className:"animate-spin text-muted-foreground"}):t.jsx(He,{className:"size-3 text-muted-foreground"}),e[14]=m.create.isPending,e[15]=r):r=e[15];let h;return e[16]!==m.create.isPending||e[17]!==c||e[18]!==r?(h=t.jsxs(Ue,{variant:"outline",size:"sm",onClick:c,disabled:m.create.isPending,children:[r,"Create an agent"]}),e[16]=m.create.isPending,e[17]=c,e[18]=r,e[19]=h):h=e[19],h}function hs(s){const e=U.c(26),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l}=s;let j;e[0]!==n?(j={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=j):j=e[1];const f=is(j);if(!(f.length>0)){let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=u):u=e[2];let b;return e[3]!==i||e[4]!==a||e[5]!==n||e[6]!==o||e[7]!==l?(b=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[u,t.jsx(ot,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!1})]}),e[3]=i,e[4]=a,e[5]=n,e[6]=o,e[7]=l,e[8]=b):b=e[8],b}let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=x):x=e[9];let c;e[10]!==i||e[11]!==a||e[12]!==n||e[13]!==o||e[14]!==l?(c=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[x,t.jsx(ot,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!0})]})}),e[10]=i,e[11]=a,e[12]=n,e[13]=o,e[14]=l,e[15]=c):c=e[15];let r;if(e[16]!==l||e[17]!==f){let u;e[19]!==l?(u=b=>t.jsx(xs,{virtualMcp:b,org:l},b.id),e[19]=l,e[20]=u):u=e[20],r=f.map(u),e[16]=l,e[17]=f,e[18]=r}else r=e[18];let h;e[21]!==r?(h=t.jsx("div",{className:"flex flex-col gap-2",children:r}),e[21]=r,e[22]=h):h=e[22];let d;return e[23]!==c||e[24]!==h?(d=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[c,h]}),e[23]=c,e[24]=h,e[25]=d):d=e[25],d}function gs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:i}){const a=Qe({control:s.control,name:"ui_type"}),l=Qe({control:s.control,name:"connection_url"}),{stdioEnabled:j}=gt(),f=(()=>{if(typeof l!="string"||!l)return!1;try{const r=new URL(l);return r.hostname==="api.githubcopilot.com"&&r.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),m=j||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",c=x?jt(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(He,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),c&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:c})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(W,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),a!=="NPX"&&a!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(K,{children:t.jsxs(tt,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(De,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(st,{})]})}),t.jsxs(nt,{children:[t.jsx(H,{value:"HTTP",children:"HTTP"}),t.jsx(H,{value:"SSE",children:"SSE"}),t.jsx(H,{value:"Websocket",children:"Websocket"}),m&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:"NPX Package"}),t.jsx(H,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(W,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(q,{className:"flex-1 min-w-0",children:t.jsx(K,{children:t.jsx(G,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(K,{children:t.jsx(tt,{className:"h-10",children:t.jsx(st,{})})}),t.jsxs(nt,{children:[t.jsx(H,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(H,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(H,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(es,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(H,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ss,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(Q,{})]})}),a==="NPX"&&t.jsx(W,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(K,{children:t.jsx(G,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),a==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(W,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(K,{children:t.jsx(G,{placeholder:"node, bun, python...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),t.jsx(W,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(K,{children:t.jsx(G,{placeholder:"arg1 arg2 --flag value",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(Q,{})]})})]}),t.jsx(W,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(K,{children:t.jsx(G,{placeholder:"/path/to/project (optional)",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})})]}),(a==="NPX"||a==="STDIO")&&t.jsx(W,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(K,{children:t.jsx(kt,{value:r.value??[],onChange:r.onChange})}),t.jsx(Q,{})]})}),a!=="NPX"&&a!=="STDIO"&&t.jsx(W,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:f?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(qt,{children:[t.jsx(Qt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Fe,{variant:"success",className:"gap-1.5",children:[t.jsx(ut,{size:12}),"Authenticated via OAuth",t.jsx(Zt,{size:12})]})})}),t.jsxs(Gt,{align:"start",children:[t.jsxs(Ze,{onClick:o,children:[t.jsx(ts,{size:16}),"Re-authenticate"]}),t.jsxs(Ze,{variant:"destructive",onClick:i,children:[t.jsx(ns,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&r.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>r.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(os,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(K,{children:t.jsx(G,{type:"password",placeholder:f?"Paste your GitHub PAT":"Enter access token...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),f&&t.jsxs(Yt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(Q,{})]})})]})}function js(s){const e=U.c(43),{form:n,connection:o,isMCPAuthenticated:i,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}=s,{org:f}=Be();let m;e[0]!==o.icon||e[1]!==o.title?(m=t.jsx(Re,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}),e[0]=o.icon,e[1]=o.title,e[2]=m):m=e[2];let x;e[3]!==n.control?(x=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(W,{control:n.control,name:"title",render:vs}),t.jsx(W,{control:n.control,name:"description",render:bs})]}),e[3]=n.control,e[4]=x):x=e[4];let c;e[5]!==m||e[6]!==x?(c=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[m,x]}),e[5]=m,e[6]=x,e[7]=c):c=e[7];let r;e[8]!==o||e[9]!==n||e[10]!==a||e[11]!==l||e[12]!==j?(r=t.jsx(gs,{form:n,connection:o,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}),e[8]=o,e[9]=n,e[10]=a,e[11]=l,e[12]=j,e[13]=r):r=e[13];let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[14]=h):h=e[14];let d;e[15]!==i?(d=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[h,i?t.jsxs(Fe,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(ut,{size:12}),"Connected"]}):t.jsx(Fe,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[15]=i,e[16]=d):d=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[17]=u):u=e[17];let b;e[18]!==o.created_by?(b=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[u,t.jsx(rs,{id:o.created_by,size:"2xs"})]}),e[18]=o.created_by,e[19]=b):b=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[20]=v):v=e[20];let _;e[21]!==o.updated_at?(_=o.updated_at?ds(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[21]=o.updated_at,e[22]=_):_=e[22];let S;e[23]!==_?(S=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[v,t.jsx("span",{className:"text-sm text-foreground",children:_})]}),e[23]=_,e[24]=S):S=e[24];let p;e[25]!==S||e[26]!==d||e[27]!==b?(p=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[d,b,S]}),e[25]=S,e[26]=d,e[27]=b,e[28]=p):p=e[28];let C;e[29]!==o.description||e[30]!==o.icon||e[31]!==o.id||e[32]!==o.title||e[33]!==f.slug?(C=t.jsx(hs,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:f.slug}),e[29]=o.description,e[30]=o.icon,e[31]=o.id,e[32]=o.title,e[33]=f.slug,e[34]=C):C=e[34];let w;e[35]!==p||e[36]!==C||e[37]!==c||e[38]!==r?(w=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[c,r,p,C]}),e[35]=p,e[36]=C,e[37]=c,e[38]=r,e[39]=w):w=e[39];let g;return e[40]!==n||e[41]!==w?(g=t.jsx(Jt,{...n,children:w}),e[40]=n,e[41]=w,e[42]=g):g=e[42],g}function bs(s){const{field:e}=s;return t.jsxs(q,{className:"w-full space-y-0",children:[t.jsx(K,{children:t.jsx(G,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Q,{})]})}function vs(s){const{field:e}=s;return t.jsxs(q,{className:"flex-1 space-y-0",children:[t.jsx(K,{children:t.jsx(G,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),t.jsx(Q,{})]})}function Ns(s){const e=U.c(39),{prompts:n,connectionId:o,org:i,onPromptClick:a,showToolbar:l,emptyMessage:j}=s,f=l===void 0?!0:l,m=j===void 0?"This connection doesn't have any prompts yet.":j,x=Ne(),[c,r]=X.useState(""),[h,d]=X.useState("table"),[u,b]=X.useState("name"),[v,_]=X.useState("asc");let S;e[0]!==v||e[1]!==u?(S=T=>{u===T?(_(ws),v==="desc"&&b(void 0)):(b(T),_("asc"))},e[0]=v,e[1]=u,e[2]=S):S=e[2];const p=S;let C;e[3]!==o||e[4]!==x||e[5]!==a||e[6]!==i?(C=T=>{a?a(T):o&&i&&x({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ge,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(T.name)}})},e[3]=o,e[4]=x,e[5]=a,e[6]=i,e[7]=C):C=e[7];const w=C;let g;if(e[8]!==n||e[9]!==c||e[10]!==v||e[11]!==u){const T=!n||n.length===0?[]:c.trim()?(()=>{const F=c.toLowerCase();return n.filter(B=>B.name.toLowerCase().includes(F)||B.description&&B.description.toLowerCase().includes(F))})():n;g=!u||!v?T:[...T].sort((F,B)=>{const je=F[u]||"",ee=B[u]||"",J=String(je).localeCompare(String(ee));return v==="asc"?J:-J}),e[8]=n,e[9]=c,e[10]=v,e[11]=u,e[12]=g}else g=e[12];const I=g;let D;e[13]===Symbol.for("react.memo_cache_sentinel")?(D=[{id:"name",header:"Name",render:Ss,sortable:!0},{id:"description",header:"Description",render:Cs,cellClassName:"flex-1",sortable:!0}],e[13]=D):D=e[13];const A=D;let V;e[14]===Symbol.for("react.memo_cache_sentinel")?(V=A.filter(_s).map(ys),e[14]=V):V=e[14];const L=V;let y;e[15]!==p||e[16]!==f||e[17]!==v||e[18]!==u||e[19]!==h?(y=f&&t.jsx(Xe,{children:t.jsx(ft,{viewMode:h,onViewModeChange:d,sortKey:u,sortDirection:v,onSort:p,sortOptions:L})}),e[15]=p,e[16]=f,e[17]=v,e[18]=u,e[19]=h,e[20]=y):y=e[20];let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=T=>{T.key==="Escape"&&(r(""),T.target.blur())},e[21]=R):R=e[21];let M;e[22]!==c?(M=t.jsx(ze,{value:c,onChange:r,placeholder:"Search prompts...",onKeyDown:R}),e[22]=c,e[23]=M):M=e[23];let N;e[24]!==m||e[25]!==w||e[26]!==p||e[27]!==c||e[28]!==v||e[29]!==u||e[30]!==I||e[31]!==h?(N=h==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:I.length===0?t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:I.map(T=>t.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>w(T),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:T.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:T.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:T.description||"No description"})]})]})},T.name))})}):t.jsx(pt,{columns:A,data:I,isLoading:!1,sortKey:u,sortDirection:v,onSort:p,onRowClick:T=>w(T),emptyState:t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m})}),e[24]=m,e[25]=w,e[26]=p,e[27]=c,e[28]=v,e[29]=u,e[30]=I,e[31]=h,e[32]=N):N=e[32];let $;e[33]!==M||e[34]!==N?($=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[M,N]}),e[33]=M,e[34]=N,e[35]=$):$=e[35];let P;return e[36]!==$||e[37]!==y?(P=t.jsxs(t.Fragment,{children:[y,$]}),e[36]=$,e[37]=y,e[38]=P):P=e[38],P}function ys(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function _s(s){return s.sortable}function Cs(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ss(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function ws(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Ts(s){const e=U.c(4),{prompts:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(Ns,{prompts:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}function ks(s){const e=U.c(2),{repository:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(ms,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function Ps(s){const e=U.c(36),{resources:n,onResourceClick:o,showToolbar:i,emptyMessage:a}=s,l=i===void 0?!0:i,j=a===void 0?"This connection doesn't have any resources yet.":a,[f,m]=X.useState(""),[x,c]=X.useState("table"),[r,h]=X.useState("name"),[d,u]=X.useState("asc");let b;e[0]!==d||e[1]!==r?(b=N=>{r===N?(u(Os),d==="desc"&&h(void 0)):(h(N),u("asc"))},e[0]=d,e[1]=r,e[2]=b):b=e[2];const v=b;let _;e[3]!==o?(_=N=>{o&&o(N)},e[3]=o,e[4]=_):_=e[4];const S=_;let p;if(e[5]!==n||e[6]!==f||e[7]!==d||e[8]!==r){const N=!n||n.length===0?[]:f.trim()?(()=>{const $=f.toLowerCase();return n.filter(P=>P.uri.toLowerCase().includes($)||P.name&&P.name.toLowerCase().includes($)||P.description&&P.description.toLowerCase().includes($))})():n;p=!r||!d?N:[...N].sort(($,P)=>{const T=$[r]||"",F=P[r]||"",B=String(T).localeCompare(String(F));return d==="asc"?B:-B}),e[5]=n,e[6]=f,e[7]=d,e[8]=r,e[9]=p}else p=e[9];const C=p;let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=[{id:"name",header:"Name",render:Ds,sortable:!0},{id:"uri",header:"URI",render:Ms,sortable:!0},{id:"description",header:"Description",render:Vs,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:As,sortable:!0}],e[10]=w):w=e[10];const g=w;let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=g.filter($s).map(Is),e[11]=I):I=e[11];const D=I;let A;e[12]!==v||e[13]!==l||e[14]!==d||e[15]!==r||e[16]!==x?(A=l&&t.jsx(Xe,{children:t.jsx(ft,{viewMode:x,onViewModeChange:c,sortKey:r,sortDirection:d,onSort:v,sortOptions:D})}),e[12]=v,e[13]=l,e[14]=d,e[15]=r,e[16]=x,e[17]=A):A=e[17];let V;e[18]===Symbol.for("react.memo_cache_sentinel")?(V=N=>{N.key==="Escape"&&(m(""),N.target.blur())},e[18]=V):V=e[18];let L;e[19]!==f?(L=t.jsx(ze,{value:f,onChange:m,placeholder:"Search resources...",onKeyDown:V}),e[19]=f,e[20]=L):L=e[20];let y;e[21]!==j||e[22]!==S||e[23]!==v||e[24]!==f||e[25]!==d||e[26]!==r||e[27]!==C||e[28]!==x?(y=x==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:C.length===0?t.jsx(Z,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":j}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:C.map(N=>t.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>S(N),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:N.name||N.uri,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:N.name||N.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:N.uri}),N.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:N.description})]})]})},N.uri))})}):t.jsx(pt,{columns:g,data:C,isLoading:!1,sortKey:r,sortDirection:d,onSort:v,onRowClick:N=>S(N),emptyState:t.jsx(Z,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":j})}),e[21]=j,e[22]=S,e[23]=v,e[24]=f,e[25]=d,e[26]=r,e[27]=C,e[28]=x,e[29]=y):y=e[29];let R;e[30]!==L||e[31]!==y?(R=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[L,y]}),e[30]=L,e[31]=y,e[32]=R):R=e[32];let M;return e[33]!==R||e[34]!==A?(M=t.jsxs(t.Fragment,{children:[A,R]}),e[33]=R,e[34]=A,e[35]=M):M=e[35],M}function Is(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function $s(s){return s.sortable}function As(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Vs(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ms(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Ds(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function Os(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Rs(s){const e=U.c(4),{resources:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(Ps,{resources:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}const Es=at({key:z().min(1,"Key is required"),value:z()}),Ls=at({title:z().min(1,"Name is required"),description:z().nullable().optional(),ui_type:Nt(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:z().optional(),connection_token:z().nullable().optional(),npx_package:z().optional(),stdio_command:z().optional(),stdio_args:z().optional(),stdio_cwd:z().optional(),env_vars:Ge(Es).optional(),configuration_scopes:Ge(z()).nullable().optional(),configuration_state:bt(z(),vt()).nullable().optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Us(s){const e=U.c(5),{tools:n,connectionId:o,org:i,isLoading:a}=s;let l;return e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==n?(l=t.jsx(us,{tools:n,connectionId:o,org:i,isLoading:a}),e[0]=o,e[1]=a,e[2]=i,e[3]=n,e[4]=l):l=e[4],l}function Fs(s){const e=U.c(27),{tools:n,connectionId:o,org:i}=s,a=Ne(),{org:l}=Be();let j;e[0]!==o||e[1]!==l.id?(j={connectionId:o,orgId:l.id},e[0]=o,e[1]=l.id,e[2]=j):j=e[2];const f=mt(j),[m,x]=X.useState("");let c,r,h,d;if(e[3]!==f||e[4]!==o||e[5]!==a||e[6]!==i||e[7]!==m||e[8]!==n){const v=(n??[]).filter(Bs),_=m.toLowerCase().trim(),S=_?v.filter(g=>g.name.toLowerCase().includes(_)||g.description&&g.description.toLowerCase().includes(_)):v;let p;e[13]!==o||e[14]!==a||e[15]!==i?(p=g=>{a({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ge,connectionId:o,collectionName:"tools",itemId:encodeURIComponent(g.name)}})},e[13]=o,e[14]=a,e[15]=i,e[16]=p):p=e[16];const C=p;h="flex flex-col h-full overflow-hidden";let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=g=>{g.key==="Escape"&&(x(""),g.target.blur())},e[17]=w):w=e[17],e[18]!==m?(d=t.jsx(ze,{value:m,onChange:x,placeholder:"Search apps...",onKeyDown:w}),e[18]=m,e[19]=d):d=e[19],c="flex-1 overflow-auto p-5",r=S.length===0?t.jsx(Z,{image:null,title:m?"No apps found":"No apps available",description:m?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:S.map(g=>{const I=Ke(g._meta);return t.jsxs(We,{className:"cursor-pointer transition-colors overflow-hidden",onClick:()=>C(g),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(fs,{resourceURI:I,toolName:g.name,displayMode:"inline",minHeight:200,maxHeight:200,client:f})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:g.name}),t.jsx(ps,{annotations:g.annotations,_meta:g._meta})]}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:g.description})]})]},g.name)})}),e[3]=f,e[4]=o,e[5]=a,e[6]=i,e[7]=m,e[8]=n,e[9]=c,e[10]=r,e[11]=h,e[12]=d}else c=e[9],r=e[10],h=e[11],d=e[12];let u;e[20]!==c||e[21]!==r?(u=t.jsx("div",{className:c,children:r}),e[20]=c,e[21]=r,e[22]=u):u=e[22];let b;return e[23]!==h||e[24]!==d||e[25]!==u?(b=t.jsxs("div",{className:h,children:[d,u]}),e[23]=h,e[24]=d,e[25]=u,e[26]=b):b=e[26],b}function Bs(s){return!!Ke(s._meta)}function zs(s){return s.command==="npx"}function Ks(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Hs(s,e){const n={command:"npx",args:["-y",s]},o=lt(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Ws(s,e,n,o){const i={command:s};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const a=lt(o);return Object.keys(a).length>0&&(i.envVars=a),i}function rt(s,e){const n={title:s.title,description:s.description??"",configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Tt(s.connection_headers)){const o=s.connection_headers,i=Pt(o.envVars);if(zs(o)){const l=Ks(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const a=Xs(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:i}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function qs(s){let e,n=null,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=Hs(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=Ws(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",o=s.connection_token||null),{title:s.title,description:s.description||null,connection_type:e,connection_url:n,...o&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Qs(s){const e=U.c(116),{connection:n,connectionId:o,org:i,requestedTabId:a,collections:l,onUpdate:j,isUpdating:f,prompts:m,resources:x,tools:c,isLoadingTools:r}=s;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={from:"/$org/$project/mcps/$connectionId"},e[0]=h):h=e[0];const d=Ne(h),u=Ct(),b=dt();let v;e[1]!==o?(v={connectionId:o},e[1]=o,e[2]=v):v=e[2];const _=Vt(v),p=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let C;e[3]!==n?(C={connections:[n],binding:"MCP"},e[3]=n,e[4]=C):C=e[4];const g=At(C).length>0,I=n?.metadata?.repository,D=!!I?.url;let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A=St(Ls),e[5]=A):A=e[5];let V;e[6]!==n?(V=rt(n),e[6]=n,e[7]=V):V=e[7];let L;e[8]!==V?(L={resolver:A,values:V},e[8]=V,e[9]=L):L=e[9];const y=wt(L),R=y.formState.isDirty;let M;e[10]!==y||e[11]!==j?(M=async()=>{if(!await y.trigger())return;const E=y.getValues(),he=qs(E);await j(he),y.reset(E)},e[10]=y,e[11]=j,e[12]=M):M=e[12];const N=M;let $;e[13]!==n||e[14]!==y?($=()=>{y.reset(rt(n))},e[13]=n,e[14]=y,e[15]=$):$=e[15];const P=$;let T;e[16]!==n.id||e[17]!==b||e[18]!==u?(T=async()=>{const{token:k,tokenInfo:E,error:he}=await Lt({connectionId:n.id});if(he||!k){ve.error(`Authentication failed: ${he}`);return}if(E)try{const Me=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:E.accessToken,refreshToken:E.refreshToken,expiresIn:E.expiresIn,scope:E.scope,clientId:E.clientId,clientSecret:E.clientSecret,tokenEndpoint:E.tokenEndpoint})});if(!Me.ok)console.error("Failed to save OAuth token:",await Me.text()),await b.update.mutateAsync({id:n.id,data:{connection_token:k}});else try{await b.update.mutateAsync({id:n.id,data:{}})}catch(qe){console.warn("Failed to refresh connection tools after OAuth:",qe)}}catch(Me){console.error("Error saving OAuth token:",Me),await b.update.mutateAsync({id:n.id,data:{connection_token:k}})}else await b.update.mutateAsync({id:n.id,data:{connection_token:k}});const ht=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(ht.href,null)}),ve.success("Authentication successful")},e[16]=n.id,e[17]=b,e[18]=u,e[19]=T):T=e[19];const F=T;let B;e[20]!==n.id||e[21]!==u?(B=async()=>{try{const k=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!k.ok){const he=await k.text();ve.error(`Failed to remove OAuth: ${he}`);return}const E=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(E.href,null)}),ve.success("OAuth removed. You can now re-authenticate with a different account.")}catch(k){console.error("Error removing OAuth token:",k),ve.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=u,e[22]=B):B=e[22];const je=B,ee=c.length,J=m.length,ye=x.length;let _e;e[23]!==c?(_e=c.filter(Ys),e[23]=c,e[24]=_e):_e=e[24];const Ce=_e.length,Ee=ee>0||r;let Se;e[25]===Symbol.for("react.memo_cache_sentinel")?(Se={id:"settings",label:"Settings"},e[25]=Se):Se=e[25];let te;e[26]!==r||e[27]!==p||e[28]!==Ee||e[29]!==ee?(te=p&&Ee?[{id:"tools",label:"Tools",count:r?void 0:ee}]:[],e[26]=r,e[27]=p,e[28]=Ee,e[29]=ee,e[30]=te):te=e[30];let se;e[31]!==p||e[32]!==J?(se=p&&J>0?[{id:"prompts",label:"Prompts",count:J}]:[],e[31]=p,e[32]=J,e[33]=se):se=e[33];let ne;e[34]!==p||e[35]!==ye?(ne=p&&ye>0?[{id:"resources",label:"Resources",count:ye}]:[],e[34]=p,e[35]=ye,e[36]=ne):ne=e[36];let oe;e[37]!==p||e[38]!==Ce?(oe=p&&Ce>0?[{id:"ui",label:"UI",count:Ce}]:[],e[37]=p,e[38]=Ce,e[39]=oe):oe=e[39];let we;if(e[40]!==l||e[41]!==D||e[42]!==p||e[43]!==te||e[44]!==se||e[45]!==ne||e[46]!==oe){let k;e[48]!==D?(k=D?[{id:"readme",label:"README"}]:[],e[48]=D,e[49]=k):k=e[49],we=[Se,...te,...se,...ne,...oe,...p?(l||[]).map(Js):[],...k],e[40]=l,e[41]=D,e[42]=p,e[43]=te,e[44]=se,e[45]=ne,e[46]=oe,e[47]=we}else we=e[47];const be=we,xt=p&&be.some(Gs)?"tools":"settings",O=be.some(k=>k.id===a)?a:xt;let Te;e[50]!==d?(Te=k=>{d({search:E=>({...E,tab:k}),replace:!0})},e[50]=d,e[51]=Te):Te=e[51];const re=Te;let ie;e[52]!==l?(ie=l||[],e[52]=l,e[53]=ie):ie=e[53];let ke;if(e[54]!==O||e[55]!==ie){let k;e[57]!==O?(k=E=>E.name===O,e[57]=O,e[58]=k):k=e[58],ke=ie.find(k),e[54]=O,e[55]=ie,e[56]=ke}else ke=e[56];const Pe=ke;let ae;e[59]!==i?(ae=t.jsx(Ye,{children:t.jsx(Ft,{asChild:!0,children:t.jsx(it,{to:"/$org/$project/mcps",params:{org:i,project:ge},children:"Connections"})})}),e[59]=i,e[60]=ae):ae=e[60];let Ie;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx(Bt,{}),e[61]=Ie):Ie=e[61];let ce;e[62]!==n.title?(ce=t.jsx(Ye,{children:t.jsx(Ut,{children:n.title})}),e[62]=n.title,e[63]=ce):ce=e[63];let $e;e[64]!==ae||e[65]!==ce?($e=t.jsx(zt,{children:t.jsxs(Kt,{children:[ae,Ie,ce]})}),e[64]=ae,e[65]=ce,e[66]=$e):$e=e[66];const Le=$e;let le;e[67]!==N||e[68]!==P||e[69]!==R||e[70]!==f?(le=t.jsx(Xe,{children:t.jsx(It,{onSave:N,onUndo:P,isDirty:R,isSaving:f})}),e[67]=N,e[68]=P,e[69]=R,e[70]=f,e[71]=le):le=e[71];let de;e[72]!==_.hasOAuthToken||e[73]!==n||e[74]!==y||e[75]!==F||e[76]!==je||e[77]!==p?(de=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(js,{form:y,connection:n,isMCPAuthenticated:p,hasOAuthToken:_.hasOAuthToken,onReauthenticate:F,onRemoveOAuth:je})}),e[72]=_.hasOAuthToken,e[73]=n,e[74]=y,e[75]=F,e[76]=je,e[77]=p,e[78]=de):de=e[78];let me;e[79]!==O||e[80]!==re||e[81]!==be?(me=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(Xt,{tabs:be,activeTab:O,onTabChange:re,className:"flex-1"})}),e[79]=O,e[80]=re,e[81]=be,e[82]=me):me=e[82];let Ae;e[83]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),e[83]=Ae):Ae=e[83];let ue;e[84]!==Pe||e[85]!==O||e[86]!==_.isServerError||e[87]!==_.supportsOAuth||e[88]!==n||e[89]!==o||e[90]!==y||e[91]!==F||e[92]!==re||e[93]!==g||e[94]!==D||e[95]!==r||e[96]!==p||e[97]!==i||e[98]!==m||e[99]!==I||e[100]!==x||e[101]!==c?(ue=t.jsx(X.Suspense,{fallback:Ae,children:O==="tools"?t.jsx(Us,{tools:c,connectionId:o,org:i,isLoading:r}):O==="ui"?t.jsx(Fs,{tools:c,connectionId:o,org:i}):O==="prompts"?t.jsx(Ts,{prompts:m,connectionId:o,org:i}):O==="resources"?t.jsx(Rs,{resources:x,connectionId:o,org:i}):O==="settings"?t.jsx(Mt,{connection:n,form:y,hasMcpBinding:g,isMCPAuthenticated:p,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:F,onViewReadme:D?()=>re("readme"):void 0}):O==="readme"&&D?t.jsx(ks,{repository:I}):Pe&&p?t.jsx(Wt,{connectionId:o,org:i,activeCollection:Pe},O):t.jsx(Z,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[84]=Pe,e[85]=O,e[86]=_.isServerError,e[87]=_.supportsOAuth,e[88]=n,e[89]=o,e[90]=y,e[91]=F,e[92]=re,e[93]=g,e[94]=D,e[95]=r,e[96]=p,e[97]=i,e[98]=m,e[99]=I,e[100]=x,e[101]=c,e[102]=ue):ue=e[102];let pe;e[103]!==O||e[104]!==ue?(pe=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(ct,{children:ue},O)}),e[103]=O,e[104]=ue,e[105]=pe):pe=e[105];let fe;e[106]!==me||e[107]!==pe?(fe=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[me,pe]}),e[106]=me,e[107]=pe,e[108]=fe):fe=e[108];let xe;e[109]!==de||e[110]!==fe?(xe=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[de,fe]}),e[109]=de,e[110]=fe,e[111]=xe):xe=e[111];let Ve;return e[112]!==Le||e[113]!==le||e[114]!==xe?(Ve=t.jsxs(Ht,{breadcrumb:Le,children:[le,xe]}),e[112]=Le,e[113]=le,e[114]=xe,e[115]=Ve):Ve=e[115],Ve}function Gs(s){return s.id==="tools"}function Js(s){return{id:s.name,label:s.displayName}}function Ys(s){return!!Ke(s._meta)}function Zs(){const s=U.c(43);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=Ne(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:i,org:a}=yt(o),{org:l}=Be();let j;s[2]===Symbol.for("react.memo_cache_sentinel")?(j={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=j):j=s[2];const m=_t(j).tab??"",x=Dt(i),c=dt(),r=$t(x??void 0);let h;s[3]!==i||s[4]!==l.id?(h={connectionId:i,orgId:l.id},s[3]=i,s[4]=l.id,s[5]=h):h=s[5];const d=mt(h);let u;s[6]!==d?(u={client:d},s[6]=d,s[7]=u):u=s[7];const{data:b}=Et(u);let v;s[8]!==d?(v={client:d},s[8]=d,s[9]=v):v=s[9];const{data:_}=Rt(v),S=x?.connection_type==="VIRTUAL";let p;s[10]!==d||s[11]!==S?(p={client:d,enabled:S},s[10]=d,s[11]=S,s[12]=p):p=s[12];const{data:C,isLoading:w}=Ot(p);let g;s[13]!==b?.prompts?(g=b?.prompts??[],s[13]=b?.prompts,s[14]=g):g=s[14];let I;s[15]!==g?(I=g.map(sn),s[15]=g,s[16]=I):I=s[16];const D=I;let A;s[17]!==_?.resources?(A=_?.resources??[],s[17]=_?.resources,s[18]=A):A=s[18];let V;s[19]!==A?(V=A.map(tn),s[19]=A,s[20]=V):V=s[20];const L=V;let y;s[21]!==x?.tools||s[22]!==S||s[23]!==C?.tools?(y=S?(C?.tools??[]).map(en):x?.tools??[],s[21]=x?.tools,s[22]=S,s[23]=C?.tools,s[24]=y):y=s[24];const R=y;let M;s[25]!==c.update||s[26]!==i?(M=async P=>{await c.update.mutateAsync({id:i,data:P})},s[25]=c.update,s[26]=i,s[27]=M):M=s[27];const N=M;if(!x){let P;return s[28]!==n||s[29]!==a?(P=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Z,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Ue,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:a,project:ge}}),children:"Back to connections"})})}),s[28]=n,s[29]=a,s[30]=P):P=s[30],P}let $;return s[31]!==c.update.isPending||s[32]!==r||s[33]!==x||s[34]!==i||s[35]!==N||s[36]!==w||s[37]!==a||s[38]!==D||s[39]!==m||s[40]!==L||s[41]!==R?($=t.jsx(Qs,{org:a,connection:x,connectionId:i,requestedTabId:m,collections:r,onUpdate:N,isUpdating:c.update.isPending,prompts:D,resources:L,tools:R,isLoadingTools:w}),s[31]=c.update.isPending,s[32]=r,s[33]=x,s[34]=i,s[35]=N,s[36]=w,s[37]=a,s[38]=D,s[39]=m,s[40]=L,s[41]=R,s[42]=$):$=s[42],$}function en(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function tn(s){return{uri:s.uri,name:s.name,description:s.description}}function sn(s){return{name:s.name,description:s.description}}function nn(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ct,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Zs,{})})}),s[0]=e):e=s[0],e}function cr(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(nn,{}),s[0]=e):e=s[0],e}export{cr as default};
|