decocms 4.400.4 → 4.400.6
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-Cdi9MsfI.js → AlertCircle-CiIF9Yxb.js} +1 -1
- package/dist/client/assets/{AreaChart-FATZKl1B.js → AreaChart-CiScmeLa.js} +1 -1
- package/dist/client/assets/{ArrowLeft--sbQIcA4.js → ArrowLeft-Cw8zoASu.js} +1 -1
- package/dist/client/assets/{ArrowRight-D3bCXfs3.js → ArrowRight-DXuJxv6z.js} +1 -1
- package/dist/client/assets/{ArrowUp-DOGYG-2d.js → ArrowUp-i7W4PLl8.js} +1 -1
- package/dist/client/assets/{CartesianChart-B8x6kuT4.js → CartesianChart-CAtvwpDL.js} +1 -1
- package/dist/client/assets/{Check-Cu8ZpiXU.js → Check-Cxn5ODoZ.js} +1 -1
- package/dist/client/assets/{CheckCircle-V_B-3A54.js → CheckCircle-Cb0ohXc_.js} +1 -1
- package/dist/client/assets/{ChevronUp-fM8pBRMJ.js → ChevronUp-B3Rmv2Rm.js} +1 -1
- package/dist/client/assets/{Copy01-B9PN4for.js → Copy01-CDFMtB2-.js} +1 -1
- package/dist/client/assets/{CreditCard01-0hm82-Yz.js → CreditCard01-Bpp7DUE2.js} +1 -1
- package/dist/client/assets/{DotsVertical-CxZAdY1u.js → DotsVertical-CsphgVVa.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-BG0OPjLW.js → ErrorBarContext-Cmgr12jK.js} +1 -1
- package/dist/client/assets/{Eye-Vnu3GFnh.js → Eye-BaKrr1k0.js} +1 -1
- package/dist/client/assets/{Globe04-hb2fIuJ3.js → Globe04-BjYimuB_.js} +1 -1
- package/dist/client/assets/{Image01-RGU0s9ee.js → Image01-BokX_Ygh.js} +1 -1
- package/dist/client/assets/{Key01-CN4l1Zci.js → Key01--iK_92aj.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CtFtWr5A.js → LayoutLeft-DbmxTpPW.js} +1 -1
- package/dist/client/assets/{Line-PKR1ayO1.js → Line-CkGSu-B6.js} +1 -1
- package/dist/client/assets/{Link01-C5_VVVM6.js → Link01-CwRVjiFm.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BXIOuIUa.js → LinkExternal01-C1LIoQUC.js} +1 -1
- package/dist/client/assets/{Monitor01-CSVz4TM7.js → Monitor01-B-jx6SlO.js} +1 -1
- package/dist/client/assets/{Palette-D27CjO4F.js → Palette-BZ8zPcQQ.js} +1 -1
- package/dist/client/assets/{Plus-91Je9mAy.js → Plus-BeOCeSsu.js} +1 -1
- package/dist/client/assets/{SearchMd-DwLB0FEi.js → SearchMd-CmoIwdFD.js} +1 -1
- package/dist/client/assets/{Sector-De0tOOsW.js → Sector-L9R2CZ3j.js} +1 -1
- package/dist/client/assets/{Share07-Vq8ntjl8.js → Share07-BQpOEypi.js} +1 -1
- package/dist/client/assets/{Sun-DGczRjF9.js → Sun-BwQeSpzv.js} +1 -1
- package/dist/client/assets/{Tool01-BUVvNqCT.js → Tool01-CFPgtTUB.js} +1 -1
- package/dist/client/assets/{Trash01-7JyRrrFx.js → Trash01-yjy5Djos.js} +1 -1
- package/dist/client/assets/{Upload01-BJxqsXwZ.js → Upload01-C3YaZ92x.js} +1 -1
- package/dist/client/assets/{User01-DlkJQdTb.js → User01-CxY9-OxA.js} +1 -1
- package/dist/client/assets/{UserSquare-DeAUSm2x.js → UserSquare-D1SexGLq.js} +1 -1
- package/dist/client/assets/{Users01-CCyYZBpM.js → Users01-C234jzz1.js} +1 -1
- package/dist/client/assets/{X-B4zsCxDW.js → X-C49OUFcX.js} +1 -1
- package/dist/client/assets/{XClose-CSFrevt_.js → XClose-CKQjrGZS.js} +1 -1
- package/dist/client/assets/{Zap-B5gdN-nI.js → Zap-GTFewWZO.js} +1 -1
- package/dist/client/assets/{ZoomOut-BHIrcxIe.js → ZoomOut-BCbY44Eu.js} +1 -1
- package/dist/client/assets/{access-gate-Ds2jKty7.js → access-gate-BWJ5-fyg.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-DYlJc7gh.js → add-connection-dialog-BRSOSKaa.js} +1 -1
- package/dist/client/assets/{agent-analytics-D1y1FIdS.js → agent-analytics-DvZELmro.js} +1 -1
- package/dist/client/assets/agent-app-CR4dhbC3.js +1 -0
- package/dist/client/assets/{agent-assets-he630f2G.js → agent-assets-CAIo2BGp.js} +1 -1
- package/dist/client/assets/{agent-automation-p3TaVles.js → agent-automation-4_v-jQ62.js} +1 -1
- package/dist/client/assets/{agent-automations-YEuTCdVe.js → agent-automations-DideyLR7.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-DsHfJ5Zx.js → agent-connect-sources-C16mG4Vi.js} +1 -1
- package/dist/client/assets/agent-deck-B2S-lir7.js +1 -0
- package/dist/client/assets/{agent-e2e-fUwXmhh1.js → agent-e2e-CQ-lGjg-.js} +1 -1
- package/dist/client/assets/{agent-experiments-DaVWJof0.js → agent-experiments-CXowDnMX.js} +1 -1
- package/dist/client/assets/{agent-file-B93Bl0TW.js → agent-file-DVtUKLrb.js} +1 -1
- package/dist/client/assets/{agent-git-f_DEDBRu.js → agent-git-CEsra0W5.js} +1 -1
- package/dist/client/assets/{agent-hosting-CRCyc8Lg.js → agent-hosting-B95vsATF.js} +1 -1
- package/dist/client/assets/{agent-icon-BbP5hNkj.js → agent-icon-B4H17A-3.js} +1 -1
- package/dist/client/assets/agent-library-file-c5FcaNLf.js +1 -0
- package/dist/client/assets/{agent-monitor-BsBVzIPX.js → agent-monitor-DKyHOvd6.js} +1 -1
- package/dist/client/assets/{agent-overview-qdoB7HzH.js → agent-overview-Dq7efx0u.js} +1 -1
- package/dist/client/assets/agent-settings-tjDRwuVg.js +1 -0
- package/dist/client/assets/{agent-site-editor-BH866jep.js → agent-site-editor-DqHsR1Oa.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-D1x0TO9d.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-CHGNvzMq.js → agent-site-editor-content-C0C8gdKB.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-B6NYDXwx.js → agent-site-editor-preview-BPAT7NTN.js} +3 -3
- package/dist/client/assets/agent-view-DECRuUKv.js +1 -0
- package/dist/client/assets/{agent-view-guard-Bp0pW9MP.js → agent-view-guard-AncI1H8B.js} +1 -1
- package/dist/client/assets/{agents-list-B4sznemV.js → agents-list-DdpIsQof.js} +1 -1
- package/dist/client/assets/{ai-providers-CZBTpGpi.js → ai-providers-C91I1RIi.js} +1 -1
- package/dist/client/assets/{alert-fmPTgSG6.js → alert-Vv8Gd72t.js} +1 -1
- package/dist/client/assets/{alert-dialog-CkMD96Bv.js → alert-dialog-p_yxBHYu.js} +1 -1
- package/dist/client/assets/analytics-sections-CJlCPTTn.js +1 -0
- package/dist/client/assets/api-keys-CAMHVAF8.js +1 -0
- package/dist/client/assets/{api-keys-U6jTLKpL.js → api-keys-Ct4yGdka.js} +1 -1
- package/dist/client/assets/app-editor-BWuGvl0o.js +1 -0
- package/dist/client/assets/{asset-utils-DFbdowi6.js → asset-utils-brdDGay3.js} +1 -1
- package/dist/client/assets/{auth-lb5mcKTR.js → auth-DN1jUXQS.js} +1 -1
- package/dist/client/assets/{auth-catchall-Cu3ndlzT.js → auth-catchall-B8jjuh3t.js} +1 -1
- package/dist/client/assets/{auth-entry-DL6KDtI_.js → auth-entry-BZ-zlX-A.js} +1 -1
- package/dist/client/assets/{auth-split-layout-B9FyTKOD.js → auth-split-layout-9lXDS5uC.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CKbQN4IJ.js → authenticate-and-persist-oauth-BS0KLtdr.js} +1 -1
- package/dist/client/assets/{automation-list-row-KGDhotTq.js → automation-list-row-Z-oEG96S.js} +1 -1
- package/dist/client/assets/{automation-runs-DeogW8xC.js → automation-runs-BfoVhm3K.js} +1 -1
- package/dist/client/assets/{automations-CpmJXxwq.js → automations-BPxNxlY1.js} +1 -1
- package/dist/client/assets/{autosend-BpkK8bzM.js → autosend-C9lP7MMD.js} +1 -1
- package/dist/client/assets/{avatar-DaUKcz80.js → avatar-CaSFUaWf.js} +1 -1
- package/dist/client/assets/{badge-BNONYRUH.js → badge-DO3CQ_LV.js} +1 -1
- package/dist/client/assets/{block-document-Tibc5A4h.js → block-document-BQbcWy3F.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-91sjF69u.js → blocks-preview-workspace-context-Bsh7P3Oa.js} +1 -1
- package/dist/client/assets/{breadcrumb-DxVQOwYp.js → breadcrumb-D3KLnh1b.js} +1 -1
- package/dist/client/assets/{buckets-BaWcFtXo.js → buckets-DAqePqsj.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DLgcijyp.js → build-improve-prompt-doc-DKmCIRM5.js} +1 -1
- package/dist/client/assets/{calendar-Dqi7n5D5.js → calendar-v3rFo_Cq.js} +1 -1
- package/dist/client/assets/{capability-load-error-Bky3ifQ3.js → capability-load-error-nzBIi4Tr.js} +1 -1
- package/dist/client/assets/{category-editor-D2BwCwQ9.js → category-editor-CLkY8j6x.js} +1 -1
- package/dist/client/assets/{chart-rMl1SR7T.js → chart-CXdIvQqa.js} +1 -1
- package/dist/client/assets/{chat-context-BhEgSLmq.js → chat-context-CypzFnUJ.js} +1 -1
- package/dist/client/assets/{chat-draft-CurOwgHM.js → chat-draft-bJa35Dyv.js} +1 -1
- package/dist/client/assets/{checkbox-DWPYmeiE.js → checkbox-RuVP2KAD.js} +1 -1
- package/dist/client/assets/{choose-editor-BTICXQM4.js → choose-editor-B6bnAbTO.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-XM4vINtj.js → claim-phase-copy-IBG3Spfs.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CA08oqhc.js → cli-auth-success-Gnusnqeq.js} +1 -1
- package/dist/client/assets/{client-icons-Dffu8riI.js → client-icons-DeH3wN29.js} +1 -1
- package/dist/client/assets/{collapsible-Dzx6i1aG.js → collapsible-Bx8hZ5vv.js} +1 -1
- package/dist/client/assets/{collection-detail-D0oyTW2f.js → collection-detail-Xqlt3OgU.js} +1 -1
- package/dist/client/assets/{collection-display-button-DbL3RQ_W.js → collection-display-button-B4JQi_wC.js} +1 -1
- package/dist/client/assets/{collection-search-CQ3mLuEi.js → collection-search-CPwy4oTQ.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D8sio31h.js → collection-table-wrapper-DzLC9Cad.js} +1 -1
- package/dist/client/assets/{collection-tabs-C6wmaayy.js → collection-tabs-VZH79ort.js} +1 -1
- package/dist/client/assets/{combobox-BRrC4Ns3.js → combobox-bXWHxi5l.js} +1 -1
- package/dist/client/assets/{command-BNyvmfvT.js → command-C0IXiNme.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-Cwou5hHH.js → companion-mcps-section-BiiIWMdJ.js} +1 -1
- package/dist/client/assets/{connect-BVapoZUA.js → connect-B9RtRyUW.js} +1 -1
- package/dist/client/assets/{connect-layout-BbzVh08-.js → connect-layout-C5m144rF.js} +1 -1
- package/dist/client/assets/{connection-BUAfkZui.js → connection-C1Cmv_sz.js} +1 -1
- package/dist/client/assets/{connection-card-CTbyclre.js → connection-card-lUin0zXZ.js} +1 -1
- package/dist/client/assets/{connection-detail-DFKUaGiK.js → connection-detail-Bgtg-egn.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-smp2bSjt.js → connection-form-helpers-DiXUvzY1.js} +1 -1
- package/dist/client/assets/{connections-DgaKYqnw.js → connections-CIFiKTz-.js} +1 -1
- package/dist/client/assets/{context-p9DQxWne.js → context-lYPc9MR3.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CKKWvs4X.js → create-organization-dialog-CVGvbMrB.js} +1 -1
- package/dist/client/assets/{decofile-api-UiO97hYj.js → decofile-api-D2rDGWIR.js} +1 -1
- package/dist/client/assets/{decopilot-7hU6n5TB.js → decopilot-DZa7cUdc.js} +1 -1
- package/dist/client/assets/{dialog-B-8VCM7c.js → dialog-fTIcTyHb.js} +1 -1
- package/dist/client/assets/{discover-B8RQrBGE.js → discover-BZC8PmWN.js} +1 -1
- package/dist/client/assets/{domain-settings-EDuO6_V6.js → domain-settings-BoCWiWyd.js} +1 -1
- package/dist/client/assets/{download-app-dialog-CTPGH9A6.js → download-app-dialog-B8fu6N4W.js} +1 -1
- package/dist/client/assets/{drawer-CjVGNrnd.js → drawer-Dj7i5SNu.js} +1 -1
- package/dist/client/assets/{editor-4IyUFq4u.js → editor-CStKuO5E.js} +1 -1
- package/dist/client/assets/{empty-state-CS6HNwRE.js → empty-state-C8J78MMg.js} +1 -1
- package/dist/client/assets/{empty-state-D72D4ZR9.js → empty-state-DuOhKQcg.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CAltfKQ-.js → extract-connection-data-BN6Gn7S7.js} +1 -1
- package/dist/client/assets/{feature-gate-CfLoLIlu.js → feature-gate-BYtexfTr.js} +1 -1
- package/dist/client/assets/{feature-paywall-BCqSjzuF.js → feature-paywall-Do9-TIse.js} +1 -1
- package/dist/client/assets/{file-explorer-Cg_F57N8.js → file-explorer-sM87NUct.js} +1 -1
- package/dist/client/assets/{file-preview-CNBkiVTE.js → file-preview-Cctwbzua.js} +1 -1
- package/dist/client/assets/{file-share-button-inbG-LwU.js → file-share-button-Dcpl3tTi.js} +1 -1
- package/dist/client/assets/{file-type-icon-rfuBA0fB.js → file-type-icon-C--_TBMw.js} +1 -1
- package/dist/client/assets/{folder-icon-Bd7gC7tF.js → folder-icon-Be-ry1Lo.js} +1 -1
- package/dist/client/assets/{form-CWAKn5Sq.js → form-msoIoPH9.js} +1 -1
- package/dist/client/assets/{gateway-client-CZp2KYL3.js → gateway-client-B7EtyAUZ.js} +1 -1
- package/dist/client/assets/{general-Cv7UmmjQ.js → general-B5uAiOFe.js} +1 -1
- package/dist/client/assets/{github-icon-Bh61uHPw.js → github-icon-Czf3JIe0.js} +1 -1
- package/dist/client/assets/{home-DJ_WJoeS.js → home-nqrW03_D.js} +1 -1
- package/dist/client/assets/{hooks-roc0TixH.js → hooks-BunFzIMc.js} +1 -1
- package/dist/client/assets/{icon-button-CP8V2gkI.js → icon-button-TBoaqswf.js} +1 -1
- package/dist/client/assets/{index-B5qcJXym.js → index-B-RfjkQs.js} +5 -5
- package/dist/client/assets/{index-Jw5ejg9y.js → index-B48I-F_s.js} +1 -1
- package/dist/client/assets/{index-DgyOWCYw.js → index-B4lO5kiB.js} +1 -1
- package/dist/client/assets/{index-D8_5URbQ.js → index-BO3WDGm0.js} +1 -1
- package/dist/client/assets/{index-BnfLIXH4.js → index-Bv9cknRX.js} +1 -1
- package/dist/client/assets/{index-CW4vFH_U.js → index-C4bcGTWO.js} +1 -1
- package/dist/client/assets/{index-B7iFtRv_.js → index-CUoS9PHq.js} +1 -1
- package/dist/client/assets/{index-Cy_Bi45u.js → index-CnM-XjMS.js} +1 -1
- package/dist/client/assets/{index-x8omtPnT.js → index-CnlnpiW9.js} +1 -1
- package/dist/client/assets/{index-DLdwKgO-.js → index-Cnm8iPpl.js} +1 -1
- package/dist/client/assets/{index-hiCS6MSh.js → index-DNOKSPYL.js} +1 -1
- package/dist/client/assets/{index-NTTMRGYQ.js → index-DU8D4REs.js} +1 -1
- package/dist/client/assets/{index-BF91oVcr.js → index-bU1o14-j.js} +1 -1
- package/dist/client/assets/{index-BhuTxB_9.js → index-haAT4fp-.js} +1 -1
- package/dist/client/assets/{index-redirect-D6q0QA7s.js → index-redirect-lHlkLUpP.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-ByWJdGMW.js → infiniteQueryObserver-CFFZE0G7.js} +1 -1
- package/dist/client/assets/{infra-billing-skPYq5PT.js → infra-billing-CI3pPi6s.js} +1 -1
- package/dist/client/assets/{input-DglraHu0.js → input-CkBBlArz.js} +1 -1
- package/dist/client/assets/{input-BrTwdDWy.js → input-DgwTyBrI.js} +1 -1
- package/dist/client/assets/{input-aIjrQZiP.js → input-bCtnK_dS.js} +1 -1
- package/dist/client/assets/{integration-icon-BrdRpcDb.js → integration-icon-DuRUAYQY.js} +1 -1
- package/dist/client/assets/{label-ESYZa9X8.js → label-COhaglCI.js} +1 -1
- package/dist/client/assets/{last-preview-page-CJAGdbss.js → last-preview-page-C2BRWzsU.js} +1 -1
- package/dist/client/assets/{layout-Csgizr4e.js → layout-ezpRdHMe.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-BxOoqRx4.js → legacy-agents-deep-7Ua9_FGE.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-DYT6A3tU.js → legacy-main-redirect-CoKgMaf6.js} +1 -1
- package/dist/client/assets/{library-CgisXDgO.js → library-nbbFy0YJ.js} +1 -1
- package/dist/client/assets/{login-DPBNsRck.js → login-zL3v_Zks.js} +1 -1
- package/dist/client/assets/{markdown-Begy36Dj.js → markdown-CL_7eJfo.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-JrmeWSX0.js → mcp-app-renderer-BF1xjUD_.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CoZvf1D5.js → mcp-oauth-CYUMx6Lt.js} +1 -1
- package/dist/client/assets/{members-nBCqgD2X.js → members-Ci31aIzf.js} +1 -1
- package/dist/client/assets/{message-templates-CWXUURL5.js → message-templates-Dievwyon.js} +1 -1
- package/dist/client/assets/{mini-report-page-5gafctPE.js → mini-report-page-D2G_6nvn.js} +1 -1
- package/dist/client/assets/{mock-board-XAVgxJ96.js → mock-board-MGFiZQqD.js} +3 -3
- package/dist/client/assets/{monaco-editor-DfJuP3fh.js → monaco-editor-B-WPLOla.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BK9c5Iu-.js → monitoring-stats-row-IwXyXgpg.js} +1 -1
- package/dist/client/assets/{multi-select-26PEVJoi.js → multi-select-B5cPO8Zc.js} +1 -1
- package/dist/client/assets/{mustache-DmHolfGP.js → mustache-D5b2aALH.js} +1 -1
- package/dist/client/assets/{oauth-callback-DbIZdvQD.js → oauth-callback-XaDe1ZVU.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Y0bz799N.js → oauth-callback-ai-provider-CG6P6aWc.js} +1 -1
- package/dist/client/assets/{onboarding-DKasotYr.js → onboarding-C0P9leUg.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BWGLmNAz.js → optimistic-project-sidebar-views-BULTvoQH.js} +1 -1
- package/dist/client/assets/{org-file-open-context-0xdMR1Zs.js → org-file-open-context-C6mgZPAr.js} +1 -1
- package/dist/client/assets/{organization-choice-CCAISK-q.js → organization-choice-5mEr1aKE.js} +1 -1
- package/dist/client/assets/{orgs-DR4WNPA-.js → orgs-3MZWLo-q.js} +1 -1
- package/dist/client/assets/{page-seo-form-DvDOZ_3p.js → page-seo-form-BHc2C0F_.js} +1 -1
- package/dist/client/assets/{pair-CUb2vHH1.js → pair-CSXFDEIQ.js} +1 -1
- package/dist/client/assets/{plan-ladder-ksxJKxrI.js → plan-ladder-B7xKH1KD.js} +1 -1
- package/dist/client/assets/{popover-BLlUZ4cA.js → popover-DFY37Yvw.js} +1 -1
- package/dist/client/assets/{post-calendar-Bzz58mtp.js → post-calendar-Jvfo43V-.js} +1 -1
- package/dist/client/assets/{post-editor-DL7JP2qP.js → post-editor-D0HMXnr-.js} +1 -1
- package/dist/client/assets/{preview-content-CB7UdkTK.js → preview-content-DyylZdej.js} +1 -1
- package/dist/client/assets/{preview-dialog-DQx8pV8f.js → preview-dialog-GxP1iGgN.js} +1 -1
- package/dist/client/assets/{profile-vtso7GBh.js → profile-Bl7SMbnv.js} +1 -1
- package/dist/client/assets/{project-app-view-r_uaIezj.js → project-app-view-C-S_SBUQ.js} +1 -1
- package/dist/client/assets/{project-feed-Bo8nl6ck.js → project-feed-C9k9tVu9.js} +1 -1
- package/dist/client/assets/{project-icon-DF-WnAKp.js → project-icon-CsZAOQy_.js} +1 -1
- package/dist/client/assets/project-reports-h9XKnGzZ.js +1 -0
- package/dist/client/assets/project-tasks-CvQsB5FR.js +1 -0
- package/dist/client/assets/{prompts-ChHNEam0.js → prompts-CvgNBkYO.js} +1 -1
- package/dist/client/assets/record-editor-Dco1ladi.js +1 -0
- package/dist/client/assets/{redirect-editor-CrU2EqK0.js → redirect-editor-D2NLj98m.js} +1 -1
- package/dist/client/assets/{reports-CwIPUFo9.js → reports-BCYtzeDa.js} +1 -1
- package/dist/client/assets/reports-KVVIwKGA.js +1 -0
- package/dist/client/assets/{reports-onboarding-O4eF7b7Y.js → reports-onboarding-BG7_PC6g.js} +1 -1
- package/dist/client/assets/{reports-tab-B7WQklEj.js → reports-tab-CZyY8SM6.js} +2 -2
- package/dist/client/assets/{repositories-CCA1wYFw.js → repositories-C5RyL_z1.js} +1 -1
- package/dist/client/assets/{repository-import-picker-CujefGI6.js → repository-import-picker-ByioO6uG.js} +1 -1
- package/dist/client/assets/{repository-picker-CNYdtW6b.js → repository-picker-BPuZL7HO.js} +1 -1
- package/dist/client/assets/{require-capability-B_6DjiAo.js → require-capability-BlL45yDc.js} +1 -1
- package/dist/client/assets/{required-auth-layout-ClB8hL7Q.js → required-auth-layout-Duev8t_N.js} +1 -1
- package/dist/client/assets/{reset-password-Dx7u8W9_.js → reset-password-JANPJ9Jd.js} +1 -1
- package/dist/client/assets/{resizable-CpLTkicX.js → resizable-yTD1tEOl.js} +1 -1
- package/dist/client/assets/{review-settings-L27vheb8.js → review-settings-vW0-yRPH.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-B-b4deKU.js → rich-text-link-control-BUscMTY0.js} +1 -1
- package/dist/client/assets/{roles-BcEzenfc.js → roles-B-T-wGt2.js} +1 -1
- package/dist/client/assets/{route-CM3iiVrn.js → route-BoE0K809.js} +1 -1
- package/dist/client/assets/{route-nRAtVHEV.js → route-Ciyyz2ig.js} +1 -1
- package/dist/client/assets/{route-Cww0fegn.js → route-X5r9RmD7.js} +1 -1
- package/dist/client/assets/{route-page-header-BscP7W0Y.js → route-page-header-Ck32Z_z1.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-KU98pXbk.js → runnable-block-editor-DXtvF8jt.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-u0nfmumC.js → sandbox-lifecycle-context-BZ0OGbvt.js} +1 -1
- package/dist/client/assets/{schema-BWeXdYUm.js → schema-kN4UiUD7.js} +1 -1
- package/dist/client/assets/{scroll-area-8CMA0JRR.js → scroll-area-DtmE_V3W.js} +1 -1
- package/dist/client/assets/{search-input-BNBSYhPG.js → search-input-5SNth6iW.js} +1 -1
- package/dist/client/assets/{search-toggle-BtIEmhkX.js → search-toggle-BQLp0m3w.js} +1 -1
- package/dist/client/assets/{secret-picker-DVfMLFZ5.js → secret-picker-CNRCwGgJ.js} +1 -1
- package/dist/client/assets/{secrets-DTkfy9bj.js → secrets-BUndq66A.js} +1 -1
- package/dist/client/assets/{sections-editor-C74U1aqE.js → sections-editor-BMGHgar4.js} +1 -1
- package/dist/client/assets/{select-DoCYMQfs.js → select-lkzYgXdD.js} +1 -1
- package/dist/client/assets/{select-model-PLFE5YwX.js → select-model-L0RmAR5m.js} +1 -1
- package/dist/client/assets/{seo-editor-B6Tb4pTp.js → seo-editor-C5sUOmWC.js} +1 -1
- package/dist/client/assets/{separator-CsHKa1W1.js → separator-DIB2NY6d.js} +1 -1
- package/dist/client/assets/{settings-tab-z4s2gHWj.js → settings-tab-BQA673_Z.js} +1 -1
- package/dist/client/assets/{sheet-C8Ka_3Bl.js → sheet-B5VBlNbo.js} +1 -1
- package/dist/client/assets/{shell-layout-CBmKAy4i.js → shell-layout-t1NP6lxk.js} +1 -1
- package/dist/client/assets/{sidebar-BBtDR060.js → sidebar-Bsj1oRm2.js} +1 -1
- package/dist/client/assets/{skill-preview-CZNJ2WCv.js → skill-preview-_2hXoPIK.js} +1 -1
- package/dist/client/assets/{skills-CVTG2yWU.js → skills-D_mDF0TE.js} +1 -1
- package/dist/client/assets/{sso-_QHlY1fi.js → sso-kIq_TNP0.js} +1 -1
- package/dist/client/assets/{suggestion-BzE4n393.js → suggestion-Bm5WiIMl.js} +1 -1
- package/dist/client/assets/{switch-BFic22ny.js → switch-C_Vj5_E0.js} +1 -1
- package/dist/client/assets/{synced-repos-BsnLFa8l.js → synced-repos-wPtrwk-M.js} +1 -1
- package/dist/client/assets/{table-DKkmnbql.js → table-EewUoElk.js} +1 -1
- package/dist/client/assets/{tabs-DU4r7quM.js → tabs-Dn00_KeP.js} +1 -1
- package/dist/client/assets/{task-board-CozK5n91.js → task-board-B1qWBX1A.js} +1 -1
- package/dist/client/assets/{task-route-rl3iH1Gq.js → task-route-D--4JOl_.js} +1 -1
- package/dist/client/assets/{task-status-5E7k7Smt.js → task-status-Nj47Imo6.js} +1 -1
- package/dist/client/assets/taskboard-analytics-DlcZmFmP.js +1 -0
- package/dist/client/assets/{tasks-BsK7tVOd.js → tasks-BKvSOVwi.js} +1 -1
- package/dist/client/assets/tasks-DhBfoBLp.js +1 -0
- package/dist/client/assets/{textarea-B5yuRdsu.js → textarea-BJstaU_4.js} +1 -1
- package/dist/client/assets/{thread-analytics-BNcg7e8K.js → thread-analytics-CJvSEofm.js} +1 -1
- package/dist/client/assets/{thread-button-2n8amwUg.js → thread-button-Dg0_8ATn.js} +1 -1
- package/dist/client/assets/{thread-intent-BTsHDxNw.js → thread-intent-Dv_ln6w2.js} +1 -1
- package/dist/client/assets/{thread-route-CGrjdB3j.js → thread-route-BBwMAr4Q.js} +1 -1
- package/dist/client/assets/{thread-route-nE_TboQI.js → thread-route-C2QO3TRR.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-CMCfZLFE.js → thread-sheet-body-a-hPHT_-.js} +1 -1
- package/dist/client/assets/{toggle-group-CNlPaZuW.js → toggle-group-n81OZ_Uu.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DHR-F1kV.js → toolbar-icon-button-G0ZB62BK.js} +1 -1
- package/dist/client/assets/{tooltip-C6PJ1j7n.js → tooltip-1YZ9_LEc.js} +1 -1
- package/dist/client/assets/{track-lTueJx3U.js → track-BdOLl-rI.js} +1 -1
- package/dist/client/assets/{types-vDN5599c.js → types-BcA15it5.js} +1 -1
- package/dist/client/assets/{usage-stats-DYDCKzqE.js → usage-stats-BXm3jzMp.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BQNZifYi.js → use-ai-providers-OZaiJf_i.js} +1 -1
- package/dist/client/assets/{use-automations-DJpHABJm.js → use-automations-D-L8pJyH.js} +1 -1
- package/dist/client/assets/{use-autosave-YwIBHqy2.js → use-autosave-WOg9IhGs.js} +1 -1
- package/dist/client/assets/{use-connect-companion-Dle_H8n2.js → use-connect-companion-dh23z2e4.js} +1 -1
- package/dist/client/assets/{use-connection-Dy2UvMsH.js → use-connection-B5_J2wP6.js} +1 -1
- package/dist/client/assets/{use-copy-Bw7YyuKq.js → use-copy-B6plqh15.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-C6KU_yQu.js → use-create-virtual-mcp-BHGrzRmt.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-wS9cqoLa.js → use-date-fns-locale-giBeaSOM.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-C_bSdi4a.js → use-debounced-autosave-B9G4Lz7n.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D7b3ywg0.js → use-debounced-value-CUPne1nm.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BuNCD-l1.js → use-deco-credits-BhBg4qYv.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DlgLtEEG.js → use-decopilot-events-CrYWYj1F.js} +1 -1
- package/dist/client/assets/{use-delete-connection-ts-TF_ss.js → use-delete-connection-XgJ1tVSe.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DJqEvn2b.js → use-deployment-admin-DhLAmeuE.js} +1 -1
- package/dist/client/assets/{use-entitlements-fEQpkKFP.js → use-entitlements-Bk0dyRQ2.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-i6FR9RFe.js → use-fast-preview-draft-url-BfzrR4he.js} +1 -1
- package/dist/client/assets/{use-file-configs-BQJBfmxg.js → use-file-configs-Q9mf6jQo.js} +1 -1
- package/dist/client/assets/{use-in-settings-Cb69tcP1.js → use-in-settings-_C3gW9Az.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-0LalUJCN.js → use-infinite-scroll-BAK1V_oQ.js} +1 -1
- package/dist/client/assets/{use-join-requests-DSW0vkRz.js → use-join-requests-DbabBnEV.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-G5nWzyVP.js → use-main-panel-tabs-rnsNQmUO.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-Cz5Y_X_F.js → use-mcp-auth-status-DetA28-g.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Dyv-A06S.js → use-mcp-client-6HSoOGyN.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CZl2jjLC.js → use-mcp-prompts-1aH_UXpe.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DYU3MkS7.js → use-mcp-tools-yAkOUoVS.js} +1 -1
- package/dist/client/assets/{use-members-KTrNaWmE.js → use-members-CNAxK8NG.js} +1 -1
- package/dist/client/assets/{use-mobile-CdSKJGCa.js → use-mobile-BA2OXMES.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-D3Xn6t_-.js → use-navigate-to-agent-B7J0geak.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-Bog7ZDbT.js → use-open-billing-url-CdE8qyDV.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-pOk6sLlZ.js → use-org-auth-client-DJC4lcTZ.js} +1 -1
- package/dist/client/assets/{use-org-fs-CNN3GCMi.js → use-org-fs-DxNvtETC.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CvlTSOj3.js → use-org-repo-syncs-BMiVfW6D.js} +1 -1
- package/dist/client/assets/{use-org-sso-DH5rPnv0.js → use-org-sso-D0y0H-Wd.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DaLGpeQ9.js → use-organization-roles-CTjyx7IB.js} +1 -1
- package/dist/client/assets/{use-organization-settings-fbMi-nT-.js → use-organization-settings-fx1CniIO.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-BlZnn1hk.js → use-panel-navigate-ZqAXzPy8.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-COFFzQP2.js → use-project-native-view-presence-DU2K0Eyd.js} +1 -1
- package/dist/client/assets/{use-project-scope-tgoWQS9k.js → use-project-scope-Hp7aDrht.js} +1 -1
- package/dist/client/assets/{use-releases-BJEH_Gxf.js → use-releases-BXIf7cF0.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-xTirWZwR.js → use-reports-diagnostic-D7jrD_HD.js} +1 -1
- package/dist/client/assets/{use-route-default-main-C9OTmlNB.js → use-route-default-main-DGbZPJrO.js} +1 -1
- package/dist/client/assets/{use-secrets-DmG_jTeJ.js → use-secrets-C-Xp8b4K.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BvD9cWJy.js → use-section-preview-base-BIeB_qzV.js} +1 -1
- package/dist/client/assets/{use-session-runtime-K-LFEX9p.js → use-session-runtime-BGl1FWUp.js} +1 -1
- package/dist/client/assets/{use-tags-r8Qc6aUA.js → use-tags-pwsJJDvy.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-mFPVusE0.js → use-task-board-analytics-Dh7V7MPv.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CEdhKynf.js → use-task-metadata-DKjAQSZf.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-DJd2F3Ap.js → use-thread-analytics-CusHOOmZ.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-Bm0ChfUV.js → use-thread-outputs-8akdlycY.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-n3oy3EAh.js → use-virtual-mcp-CbHEuH0C.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CEwPAAtp.js +1 -0
- package/dist/client/assets/{useQueries-DrNKW5a4.js → useQueries-B5DxQ3Sp.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CC4BMd5I.js +1 -0
- package/dist/client/assets/{users-C9G9oF_D.js → users-p9MUZzW1.js} +1 -1
- package/dist/client/assets/{utils-BLPcefcc.js → utils-BkPwCtYS.js} +1 -1
- package/dist/client/assets/{variant-calendar-DfSfWSQj.js → variant-calendar-CcJNDqFN.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-r8Czoqzo.js → variant-matcher-override-CexHfhU3.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BzRY2KFe.js → view-mode-toggle-CJHrx4Q2.js} +1 -1
- package/dist/client/assets/{virtual-mcp-VJeGJpq-.js → virtual-mcp-Dd5g9b73.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +41 -41
- package/dist/server/server.js +38 -38
- package/package.json +1 -1
- package/dist/client/assets/agent-app-C47b8jCZ.js +0 -1
- package/dist/client/assets/agent-deck-GsBukHOk.js +0 -1
- package/dist/client/assets/agent-library-file-CzLaKl1X.js +0 -1
- package/dist/client/assets/agent-settings-C4e2827g.js +0 -1
- package/dist/client/assets/agent-site-editor-code-DmItYB-R.js +0 -2
- package/dist/client/assets/agent-view-D_1iIPoB.js +0 -1
- package/dist/client/assets/analytics-sections-DE65c1ns.js +0 -1
- package/dist/client/assets/api-keys-DT-I-M-J.js +0 -1
- package/dist/client/assets/app-editor-wWoZmBjm.js +0 -1
- package/dist/client/assets/project-reports-55gJC-H3.js +0 -1
- package/dist/client/assets/project-tasks-Dc1m3VcV.js +0 -1
- package/dist/client/assets/record-editor-wm4M53rQ.js +0 -1
- package/dist/client/assets/reports-e1nTZkbS.js +0 -1
- package/dist/client/assets/taskboard-analytics-mrSvXE0J.js +0 -1
- package/dist/client/assets/tasks-BFbbkTC-.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BRngavau.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BWAelygX.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ao as ve,bP as Oe,bQ as Me,ap as de,bO as ze,c as U,b as L,j as t,h as Ne,B,r as Z,l as Se,Y as te,a4 as Ee,D as me,K as ee,d as se,p as ye,al as Ce,eL as Re,U as Ue,n as Fe,f5 as ue,R as Le,I as Ve,F as Be,H as Ge,G as xe,E as qe,f as He,fe as Qe,o as Ke,an as Xe,am as We,t as J}from"./index-B5qcJXym.js";import{g as Ye}from"./extract-connection-data-CAltfKQ-.js";import{E as _e}from"./empty-state-D72D4ZR9.js";import{E as Je,c as Ze,r as et,b as tt,d as st}from"./connection-form-helpers-smp2bSjt.js";import{c as nt,S as it,D as ot}from"./index-Jw5ejg9y.js";import{u as we,T as at}from"./use-mcp-auth-status-Cz5Y_X_F.js";import{a as lt}from"./use-members-KTrNaWmE.js";import{A as rt}from"./avatar-DaUKcz80.js";import{a as Ie,b as ke,u as ct}from"./use-connection-Dy2UvMsH.js";import{u as Te}from"./use-mcp-client-Dyv-A06S.js";import{u as dt}from"./use-mcp-tools-DYU3MkS7.js";import{a as mt}from"./use-mcp-prompts-CZl2jjLC.js";import{i as ut,a as xt}from"./mcp-oauth-CoZvf1D5.js";import{I as ae}from"./integration-icon-BrdRpcDb.js";import{s as pt}from"./Plus-91Je9mAy.js";import{be as ft,at as ht,Q as gt,bs as jt,l as ne,as as bt}from"./agent-icon-BbP5hNkj.js";import{a as Ae,f as vt,s as Nt}from"./Tool01-BUVvNqCT.js";import{s as re}from"./Trash01-7JyRrrFx.js";import{b as St,a as yt,c as Ct,S as _t,d as wt}from"./sheet-C8Ka_3Bl.js";import{F as q,b as H,c as Q,d as V,f as K,e as It,a as kt}from"./form-CWAKn5Sq.js";import{I as W}from"./input-BrTwdDWy.js";import{u as Tt,D as At}from"./use-delete-connection-ts-TF_ss.js";import{c as Pt,B as Dt,a as $t,C as Ot}from"./monitoring-stats-row-BK9c5Iu-.js";import{b as Mt,c as zt,d as Et}from"./chart-rMl1SR7T.js";import{b as Rt}from"./use-virtual-mcp-n3oy3EAh.js";import{T as ie,a as Ut,c as oe,b as Ft}from"./tabs-DU4r7quM.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{g as ce}from"./types-vDN5599c.js";import{M as Lt}from"./mcp-app-renderer-JrmeWSX0.js";import{C as Vt}from"./collection-search-CQ3mLuEi.js";import{B as Bt}from"./badge-BNONYRUH.js";import{S as pe,b as fe,a as he,d as ge,c as G}from"./select-DoCYMQfs.js";import{i as Gt}from"./CheckCircle-V_B-3A54.js";import{t as qt}from"./ChevronUp-fM8pBRMJ.js";import{b as Ht}from"./UserSquare-DeAUSm2x.js";import{s as Qt}from"./XClose-CSFrevt_.js";import{p as Kt,i as Xt}from"./connection-BUAfkZui.js";import"./metadata-D72DunRR.js";import"./sidebar-BBtDR060.js";import"./LayoutLeft-CtFtWr5A.js";import"./use-mobile-CdSKJGCa.js";import"./tooltip-C6PJ1j7n.js";import"./index-hiCS6MSh.js";import"./Key01-CN4l1Zci.js";import"./auth-lb5mcKTR.js";import"./index-B7iFtRv_.js";import"./index-BnfLIXH4.js";import"./index-BF91oVcr.js";import"./popover-BLlUZ4cA.js";import"./Check-Cu8ZpiXU.js";import"./SearchMd-DwLB0FEi.js";import"./use-create-virtual-mcp-C6KU_yQu.js";import"./use-navigate-to-agent-D3Xn6t_-.js";import"./hooks-roc0TixH.js";import"./backoff-8mStPHYB.js";import"./task-board-CozK5n91.js";import"./schema-BWeXdYUm.js";import"./thread-intent-BTsHDxNw.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BknN0SVI.js";import"./Eye-Vnu3GFnh.js";import"./use-org-auth-client-pOk6sLlZ.js";import"./User01-DlkJQdTb.js";import"./AlertCircle-Cdi9MsfI.js";import"./ArrowUp-DOGYG-2d.js";import"./ArrowLeft--sbQIcA4.js";import"./ArrowRight-D3bCXfs3.js";import"./ZoomOut-BHIrcxIe.js";import"./Globe04-hb2fIuJ3.js";import"./Copy01-B9PN4for.js";import"./CreditCard01-0hm82-Yz.js";import"./DotsVertical-CxZAdY1u.js";import"./Share07-Vq8ntjl8.js";import"./Image01-RGU0s9ee.js";import"./Link01-C5_VVVM6.js";import"./LinkExternal01-BXIOuIUa.js";import"./Monitor01-CSVz4TM7.js";import"./Sun-DGczRjF9.js";import"./Palette-D27CjO4F.js";import"./Upload01-BJxqsXwZ.js";import"./Users01-CCyYZBpM.js";import"./X-B4zsCxDW.js";import"./Zap-B5gdN-nI.js";import"./label-ESYZa9X8.js";import"./alert-dialog-CkMD96Bv.js";import"./CartesianChart-B8x6kuT4.js";import"./AreaChart-FATZKl1B.js";import"./ErrorBarContext-BG0OPjLW.js";import"./Sector-De0tOOsW.js";const Wt=ve({scopes:ze(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=L();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),m=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,p=n.status!=="active",x=m||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==x?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",x),e[2]=x,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let S;e[9]!==n.status||e[10]!==p||e[11]!==m||e[12]!==o?(S=m?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=p,e[11]=m,e[12]=o,e[13]=S):S=e[13];let y;e[14]!==j||e[15]!==S?(y=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,S]}),e[14]=j,e[15]=S,e[16]=y):y=e[16];let C;e[17]!==n||e[18]!==m||e[19]!==a||e[20]!==o?(C=m&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=m,e[19]=a,e[20]=o,e[21]=C):C=e[21];let _;e[22]!==n||e[23]!==p||e[24]!==l||e[25]!==o?(_=p?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(ft,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(ht,{size:13})}),e[22]=n,e[23]=p,e[24]=l,e[25]=o,e[26]=_):_=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let w;e[30]!==o?(w=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=w):w=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ae,{size:13}),e[34]=A):A=e[34];let O;e[35]!==$||e[36]!==w||e[37]!==M?(O=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:w,"aria-label":M,children:A}),e[35]=$,e[36]=w,e[37]=M,e[38]=O):O=e[38];let k;e[39]!==n||e[40]!==i?(k=()=>i(n),e[39]=n,e[40]=i,e[41]=k):k=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let b;e[44]!==o?(b=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==k||e[48]!==v||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:k,title:v,"aria-label":b,children:E}),e[47]=k,e[48]=v,e[49]=b,e[50]=z):z=e[50];let I;e[51]!==O||e[52]!==z||e[53]!==C||e[54]!==_?(I=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C,_,O,z]}),e[51]=O,e[52]=z,e[53]=C,e[54]=_,e[55]=I):I=e[55];let P;return e[56]!==I||e[57]!==h||e[58]!==g||e[59]!==y?(P=t.jsxs("div",{className:h,children:[g,y,I]}),e[56]=I,e[57]=h,e[58]=g,e[59]=y,e[60]=P):P=e[60],P}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,a=L();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let d;e[10]!==a?(d=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ae,{size:13}),e[12]=u):u=e[12];let m;e[13]!==o||e[14]!==r||e[15]!==d?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":d,children:u})}),e[13]=o,e[14]=r,e[15]=d,e[16]=m):m=e[16];let p;return e[17]!==i||e[18]!==l||e[19]!==m?(p=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,m]}),e[17]=i,e[18]=l,e[19]=m,e[20]=p):p=e[20],p}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,d=L();if(n.length===0)return null;let u;e[0]!==n.length||e[1]!==d?(u=n.length===1?d("details.connectionInstancesPanel.instance"):d("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=d,e[2]=u):u=e[2];let m;e[3]!==u?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(pt,{size:13}),e[5]=r,e[6]=p):p=e[6];let x;e[7]!==d?(x=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=x):x=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==p||e[12]!==x?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[p,x]}),e[9]=r,e[10]=o,e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;e[14]!==m||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[m,h]}),e[14]=m,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let C;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(C=_=>t.jsx(Z.Suspense,{fallback:t.jsx(Zt,{instance:_,onConfigure:c}),children:t.jsx(Jt,{instance:_,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},_.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=C):C=e[27],j=n.map(C),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let y;return e[30]!==g||e[31]!==S?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=y):y=e[32],y}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const ss=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ns(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const is={calls:{label:"Tool calls"},errors:{label:"Errors"}};function os(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=L(),l=Ee(),o=ns(a),{data:r}=me({queryKey:ee.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Pt(r?.logs??[],o,void 0,r?.total,d?.total),m=u.data,p=u.totalCalls>0,x=ts(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),p?t.jsxs("div",{children:[t.jsx(Mt,{config:is,className:"h-16 w-full",children:t.jsxs(Dt,{data:m,barCategoryGap:"4%",children:[t.jsx(zt,{content:t.jsx(Et,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:m.map(ls)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[m.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),x.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:x.map(as)})]})]})}function as(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function ls(s,e){return t.jsx(Ot,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function rs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function cs(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ds(s){const e=U.c(22),{connectionId:n}=s,c=L(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==a?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":a===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium classic:rounded-md compact:rounded-lg transition-colors",a===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==d||e[9]!==u?(m=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==m?(p=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,m]}),e[11]=r,e[12]=m,e[13]=p):p=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(cs,{}),e[14]=x):x=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==a?(h=t.jsx(Z.Suspense,{fallback:x,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:a})}),e[15]=n,e[16]=l.id,e[17]=a,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const m=crypto.randomUUID();a({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:m}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==o||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,d]}),e[11]=i,e[12]=o,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(ms,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=L(),{org:a}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=Rt(i);if(!(l.length>0)){let p;return e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(t.Fragment,{}),e[2]=p):p=e[2],p}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==a.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:a.slug})}),e[7]=a.slug,e[8]=l,e[9]=u):u=e[9];let m;return e[10]!==d||e[11]!==u?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:a}=s,i=L(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const d=Te(r),u=Ie(c);let m;e[4]!==u||e[5]!==c?(m=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=m):m=e[6];const p=m,[x,h]=Z.useState("");let g,j,S,y;if(e[7]!==p||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==x||e[12]!==i||e[13]!==n){const $=(n??[]).filter(fs),w=x.toLowerCase().trim(),M=w?$.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):$;let A;e[18]!==p||e[19]!==l||e[20]!==a?(A=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=p,e[19]=l,e[20]=a,e[21]=A):A=e[21];const O=A;S="flex flex-col h-full overflow-hidden";let k;e[22]!==i?(k=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=k):k=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=v):v=e[24],e[25]!==x||e[26]!==k?(y=t.jsx(Vt,{value:x,onChange:h,placeholder:k,onKeyDown:v}),e[25]=x,e[26]=k,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(_e,{image:null,title:i(x?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(x?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>O(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Lt,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})}),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:b.annotations?.title??b.name}),t.jsx(at,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=p,e[8]=d,e[9]=l,e[10]=a,e[11]=x,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=y}else g=e[14],j=e[15],S=e[16],y=e[17];let C;e[28]!==g||e[29]!==j?(C=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=C):C=e[30];let _;return e[31]!==S||e[32]!==y||e[33]!==C?(_=t.jsxs("div",{className:S,children:[y,C]}),e[31]=S,e[32]=y,e[33]=C,e[34]=_):_=e[34],_}function fs(s){return!!ce(s._meta)}const je=[];function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=L();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s,o=c===void 0?je:c,r=a===void 0?je:a,d=L(),u=se(),m=Ie(i??"");let p;e[0]!==m||e[1]!==i?(p=m?Pe(m):i,e[0]=m,e[1]=i,e[2]=p):p=e[2];const x=p;let h;e[3]!==x||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(T){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(T)}})},e[3]=x,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(bs),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const S=j;if(n.length+o.length+r.length===0){let N;e[12]!==d?(N=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=N):N=e[13];let T;e[14]!==N?(T=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:N}),e[14]=N,e[15]=T):T=e[15];let D;e[16]!==d?(D=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=D):D=e[17];let F;e[18]!==D?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e[18]=D,e[19]=F):F=e[19];let X;return e[20]!==T||e[21]!==F?(X=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[T,F]}),e[20]=T,e[21]=F,e[22]=X):X=e[22],X}let C;e[23]!==d||e[24]!==n.length?(C=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=C):C=e[25];let _;e[26]!==C?(_=t.jsx(ie,{value:"tools",variant:"underline",children:C}),e[26]=C,e[27]=_):_=e[27];let $;e[28]!==S||e[29]!==d?($=S&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=S,e[29]=d,e[30]=$):$=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let M;e[33]!==w?(M=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=M):M=e[34];let A;e[35]!==d?(A=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=A):A=e[36];let O;e[37]!==A?(O=t.jsx(ie,{value:"resources",variant:"underline",children:A}),e[37]=A,e[38]=O):O=e[38];let k;e[39]!==M||e[40]!==O||e[41]!==_||e[42]!==$?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Ut,{variant:"underline",className:"gap-1",children:[_,$,M,O]})}),e[39]=M,e[40]=O,e[41]=_,e[42]=$,e[43]=k):k=e[43];let v;e[44]!==g||e[45]!==n?(v=n.length>0?n.map(N=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>g(N.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(vt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=v):v=e[46];let b;e[47]!==v?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:v})}),e[47]=v,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==S||e[51]!==l||e[52]!==n?(E=S&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ps,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=S,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==o?(z=o.length>0?o.map(js):t.jsx(le,{label:"prompts"}),e[54]=o,e[55]=z):z=e[55];let I;e[56]!==z?(I=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=I):I=e[57];let P;e[58]!==r?(P=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=P):P=e[59];let R;e[60]!==P?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:P})}),e[60]=P,e[61]=R):R=e[61];let f;return e[62]!==k||e[63]!==b||e[64]!==E||e[65]!==I||e[66]!==R?(f=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Ft,{defaultValue:"tools",variant:"underline",children:[k,b,E,I,R]})}),e[62]=k,e[63]=b,e[64]=E,e[65]=I,e[66]=R,e[67]=f):f=e[67],f}function gs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(jt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function js(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(gt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function bs(s){return ce(s._meta)}function vs(s){const e=U.c(15),{connection:n,displayTitle:c}=s,a=Ue(),i=c??n.title,l=a?"md":"xl";let o;e[0]!==n.icon||e[1]!==l||e[2]!==i?(o=t.jsx(ae,{icon:n.icon,name:i,size:l,className:"shrink-0"}),e[0]=n.icon,e[1]=l,e[2]=i,e[3]=o):o=e[3];let r;e[4]!==a||e[5]!==i?(r=a?t.jsx(Fe.Title,{children:i}):t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:i})}),e[4]=a,e[5]=i,e[6]=r):r=e[6];let d;e[7]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[7]=n.description,e[8]=d):d=e[8];let u;e[9]!==r||e[10]!==d?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,d]}),e[9]=r,e[10]=d,e[11]=u):u=e[11];let m;return e[12]!==o||e[13]!==u?(m=t.jsxs("div",{className:"flex items-center classic:gap-4 classic:md:gap-6 classic:py-5 classic:md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0 compact:gap-3 compact:py-4",children:[o,u]}),e[12]=o,e[13]=u,e[14]=m):m=e[14],m}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=L(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Le(),d=(()=>{if(typeof o!="string"||!o)return!1;try{const x=new URL(o);return x.hostname==="api.githubcopilot.com"&&x.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Kt(e.connection_url):null;return m?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.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(ye,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),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:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(q,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(V,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(G,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(G,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(G,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(q,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(V,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(G,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(G,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(bt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(G,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(K,{})]})}),l==="NPX"&&t.jsx(q,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(q,{control:s.control,name:"stdio_command",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),t.jsx(q,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(K,{})]})})]}),t.jsx(q,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(q,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(V,{children:t.jsx(Je,{value:x.value??[],onChange:x.onChange})}),t.jsx(K,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(q,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ve,{children:[t.jsx(Be,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Bt,{variant:"success",className:"gap-1.5",children:[t.jsx(Gt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(qt,{size:12})]})})}),t.jsxs(Ge,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(Nt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&x.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:()=>x.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 classic:rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity compact:rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Qt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(W,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(It,{children:[i("details.connectionSidebar.createAPatAt")," ",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(K,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Cs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Xt(s.connection_headers)){const c=s.connection_headers,a=et(c.envVars);if(Ss(c)){const l=ys(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const i=Cs(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}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 _s(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=tt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=st(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=L(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),m=ke(),{org:p}=te(),x=Tt({onSuccess:()=>{o.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[j,S]=Z.useState(!1),y=we({connectionId:e}),{data:C}=lt(),_=C?.data?.members??[],$=h??s,w=_.find(f=>f.userId===$.created_by),A=s?.connection_type==="VIRTUAL"||y.isAuthenticated,O={...s,tools:a},k=nt(O,Yt),v=Xe({resolver:We(Ze),values:be(h??s)}),b=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const N=v.getValues(),T=_s(N),D=h?.id??e;await m.update.mutateAsync({id:D,data:T}),v.reset(N)},z=()=>{v.reset(be(h??s))},I=async f=>{const N=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:T,tokenInfo:D,error:F}=await xt({connectionId:f,orgSlug:p.slug,...N?{scope:N}:{}});if(F||!T){J.error(r("details.connection.authFailed",{error:F??""}));return}if(D)try{const Y=await fetch(`/api/${p.slug}/connections/${f}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!Y.ok)console.error("Failed to save OAuth token:",await Y.text()),await m.update.mutateAsync({id:f,data:{connection_token:T}});else try{await m.update.mutateAsync({id:f,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Y){console.error("Error saving OAuth token:",Y),await m.update.mutateAsync({id:f,data:{connection_token:T}})}else await m.update.mutateAsync({id:f,data:{connection_token:T}});const X=new URL(`/api/${p.slug}/mcp/${f}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(X.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},P=()=>I(s.id),R=async()=>{try{const f=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!f.ok){const T=await f.text();J.error(r("details.connection.failedRemoveOAuth",{error:T}));return}const N=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(N.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(f){console.error("Error removing OAuth token:",f),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(At,{...x}),t.jsx(St,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(yt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Ct,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(_t,{className:"text-base",children:h?.title??s.title}),t.jsx(wt,{className:"text-xs",children:r("details.connection.settingsDescription")}),w&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(rt,{url:w.user?.image??void 0,fallback:w.user?.name??w.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:w.user?.name||w.user?.email})]})]}),t.jsxs(kt,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(q,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(Q,{children:r("details.connection.nameLabel")}),t.jsx(V,{children:t.jsx(W,{...f})}),t.jsx(K,{})]})}),t.jsx(q,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(Q,{children:r("details.connection.descriptionLabel")}),t.jsx(V,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(K,{})]})})]}),t.jsx(Ns,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(it,{connection:h??s,form:v,hasMcpBinding:k,isMCPAuthenticated:A,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:P,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const f=h??s;g(null),x.requestDelete(f)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(ot,{hideTopbar:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(vs,{connection:s,displayTitle:(()=>{const f=o[0]??s;return f.app_name?f.title.replace(/\s*\(\d+\)\s*$/,""):f.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ds,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:o,onConfigure:f=>g(f),onAuthenticate:f=>I(f.id),onDelete:f=>x.requestDelete(f),onToggleStatus:async(f,N)=>{try{await m.update.mutateAsync({id:f.id,data:{status:N}}),J.success(r(N==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const f=o[0]??s,N=f.title.replace(/\s*\(\d+\)\s*$/,""),T=o.length+1,D=`${N} (${T})`,F=Ye("conn");await m.create.mutateAsync({id:F,title:D,description:f.description??null,connection_type:f.connection_type,connection_url:f.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f.created_by,organization_id:f.organization_id,icon:f.icon??null,app_name:f.app_name??null,app_id:f.app_id??null,connection_headers:f.connection_headers??null,oauth_config:null,configuration_state:f.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const X=new URL(`/api/${p.slug}/mcp/${F}`,window.location.origin),Y=await ut({url:X.href,token:null,orgId:p.id});Y.supportsOAuth&&!Y.isAuthenticated&&await I(F)}finally{S(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Is(){const s=U.c(52),e=L();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=He(a),{org:o}=te(),r=ke();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=ct(d),m=u[0]??null,p=m?.id??"",x=p||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==x?(h={connectionId:x,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=x,s[7]=h):h=s[7];const g=Te(h);let j;s[8]!==g?(j={client:g},s[8]=g,s[9]=j):j=s[9];const{data:S}=dt(j);let y;if(s[10]!==m?.tools||s[11]!==p||s[12]!==u||s[13]!==S){const I=S?S.tools.map($s):(m?.tools??[]).map(Ds);e:{if(u.length<=1){y=I;break e}const P=new Set,R=[],f=As;for(const N of u){const T=N.id===p?I:f(N.tools);for(const D of T)P.has(D.name)||(P.add(D.name),R.push(D))}y=R.length>0?R:I}s[10]=m?.tools,s[11]=p,s[12]=u,s[13]=S,s[14]=y}else y=s[14];const C=y;let _;s[15]!==g?(_={client:g},s[15]=g,s[16]=_):_=s[16];const{data:$}=mt(_);let w;s[17]!==g?(w={client:g},s[17]=g,s[18]=w):w=s[18];const{data:M}=Qe(w);let A;s[19]!==$?.prompts?(A=$?.prompts??[],s[19]=$?.prompts,s[20]=A):A=s[20];let O;s[21]!==A?(O=A.map(Ts),s[21]=A,s[22]=O):O=s[22];const k=O;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let b;s[25]!==v?(b=v.map(ks),s[25]=v,s[26]=b):b=s[26];const E=b;if(!m){let I;s[27]!==e?(I=e("details.connection.notFoundTitle"),s[27]=e,s[28]=I):I=s[28];let P;s[29]!==e?(P=e("details.connection.notFoundDescription"),s[29]=e,s[30]=P):P=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let f;s[34]!==e?(f=e("details.connection.backButton"),s[34]=e,s[35]=f):f=s[35];let N;s[36]!==R||s[37]!==f?(N=t.jsx(B,{variant:"outline",onClick:R,children:f}),s[36]=R,s[37]=f,s[38]=N):N=s[38];let T;return s[39]!==I||s[40]!==P||s[41]!==N?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(_e,{title:I,description:P,actions:N})}),s[39]=I,s[40]=P,s[41]=N,s[42]=T):T=s[42],T}let z;return s[43]!==r.update.isPending||s[44]!==C||s[45]!==m||s[46]!==p||s[47]!==l||s[48]!==k||s[49]!==E||s[50]!==u?(z=t.jsx(ws,{org:l,connection:m,connectionId:p,isUpdating:r.update.isPending,tools:C,prompts:k,resources:E,siblings:u}),s[43]=r.update.isPending,s[44]=C,s[45]=m,s[46]=p,s[47]=l,s[48]=k,s[49]=E,s[50]=u,s[51]=z):z=s[51],z}function ks(s){return{name:s.name,description:s.description,uri:s.uri}}function Ts(s){return{name:s.name,description:s.description}}function As(s){return(s??[]).map(Ps)}function Ps(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ds(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function $s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Os(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qe,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Is,{})})}),s[0]=e):e=s[0],e}function gi(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Os,{}),s[0]=e):e=s[0],e}export{gi as default};
|
|
1
|
+
import{ao as ve,bP as Oe,bQ as Me,ap as de,bO as ze,c as U,b as L,j as t,h as Ne,B,r as Z,l as Se,Y as te,a4 as Ee,D as me,K as ee,d as se,p as ye,al as Ce,eL as Re,U as Ue,n as Fe,f5 as ue,R as Le,I as Ve,F as Be,H as Ge,G as xe,E as qe,f as He,fe as Qe,o as Ke,an as Xe,am as We,t as J}from"./index-B-RfjkQs.js";import{g as Ye}from"./extract-connection-data-BN6Gn7S7.js";import{E as _e}from"./empty-state-DuOhKQcg.js";import{E as Je,c as Ze,r as et,b as tt,d as st}from"./connection-form-helpers-DiXUvzY1.js";import{c as nt,S as it,D as ot}from"./index-B48I-F_s.js";import{u as we,T as at}from"./use-mcp-auth-status-DetA28-g.js";import{a as lt}from"./use-members-CNAxK8NG.js";import{A as rt}from"./avatar-CaSFUaWf.js";import{a as Ie,b as ke,u as ct}from"./use-connection-B5_J2wP6.js";import{u as Te}from"./use-mcp-client-6HSoOGyN.js";import{u as dt}from"./use-mcp-tools-yAkOUoVS.js";import{a as mt}from"./use-mcp-prompts-1aH_UXpe.js";import{i as ut,a as xt}from"./mcp-oauth-CYUMx6Lt.js";import{I as ae}from"./integration-icon-DuRUAYQY.js";import{s as pt}from"./Plus-BeOCeSsu.js";import{be as ft,at as ht,Q as gt,bs as jt,l as ne,as as bt}from"./agent-icon-B4H17A-3.js";import{a as Ae,f as vt,s as Nt}from"./Tool01-CFPgtTUB.js";import{s as re}from"./Trash01-yjy5Djos.js";import{b as St,a as yt,c as Ct,S as _t,d as wt}from"./sheet-B5VBlNbo.js";import{F as q,b as H,c as Q,d as V,f as K,e as It,a as kt}from"./form-msoIoPH9.js";import{I as W}from"./input-DgwTyBrI.js";import{u as Tt,D as At}from"./use-delete-connection-XgJ1tVSe.js";import{c as Pt,B as Dt,a as $t,C as Ot}from"./monitoring-stats-row-IwXyXgpg.js";import{b as Mt,c as zt,d as Et}from"./chart-CXdIvQqa.js";import{b as Rt}from"./use-virtual-mcp-CbHEuH0C.js";import{T as ie,a as Ut,c as oe,b as Ft}from"./tabs-Dn00_KeP.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{g as ce}from"./types-BcA15it5.js";import{M as Lt}from"./mcp-app-renderer-BF1xjUD_.js";import{C as Vt}from"./collection-search-CPwy4oTQ.js";import{B as Bt}from"./badge-DO3CQ_LV.js";import{S as pe,b as fe,a as he,d as ge,c as G}from"./select-lkzYgXdD.js";import{i as Gt}from"./CheckCircle-Cb0ohXc_.js";import{t as qt}from"./ChevronUp-B3Rmv2Rm.js";import{b as Ht}from"./UserSquare-D1SexGLq.js";import{s as Qt}from"./XClose-CKQjrGZS.js";import{p as Kt,i as Xt}from"./connection-C1Cmv_sz.js";import"./metadata-D72DunRR.js";import"./sidebar-Bsj1oRm2.js";import"./LayoutLeft-DbmxTpPW.js";import"./use-mobile-BA2OXMES.js";import"./tooltip-1YZ9_LEc.js";import"./index-DNOKSPYL.js";import"./Key01--iK_92aj.js";import"./auth-DN1jUXQS.js";import"./index-CUoS9PHq.js";import"./index-Bv9cknRX.js";import"./index-bU1o14-j.js";import"./popover-DFY37Yvw.js";import"./Check-Cxn5ODoZ.js";import"./SearchMd-CmoIwdFD.js";import"./use-create-virtual-mcp-BHGrzRmt.js";import"./use-navigate-to-agent-B7J0geak.js";import"./hooks-BunFzIMc.js";import"./backoff-8mStPHYB.js";import"./task-board-B1qWBX1A.js";import"./schema-kN4UiUD7.js";import"./thread-intent-Dv_ln6w2.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BknN0SVI.js";import"./Eye-BaKrr1k0.js";import"./use-org-auth-client-DJC4lcTZ.js";import"./User01-CxY9-OxA.js";import"./AlertCircle-CiIF9Yxb.js";import"./ArrowUp-i7W4PLl8.js";import"./ArrowLeft-Cw8zoASu.js";import"./ArrowRight-DXuJxv6z.js";import"./ZoomOut-BCbY44Eu.js";import"./Globe04-BjYimuB_.js";import"./Copy01-CDFMtB2-.js";import"./CreditCard01-Bpp7DUE2.js";import"./DotsVertical-CsphgVVa.js";import"./Share07-BQpOEypi.js";import"./Image01-BokX_Ygh.js";import"./Link01-CwRVjiFm.js";import"./LinkExternal01-C1LIoQUC.js";import"./Monitor01-B-jx6SlO.js";import"./Sun-BwQeSpzv.js";import"./Palette-BZ8zPcQQ.js";import"./Upload01-C3YaZ92x.js";import"./Users01-C234jzz1.js";import"./X-C49OUFcX.js";import"./Zap-GTFewWZO.js";import"./label-COhaglCI.js";import"./alert-dialog-p_yxBHYu.js";import"./CartesianChart-CAtvwpDL.js";import"./AreaChart-CiScmeLa.js";import"./ErrorBarContext-Cmgr12jK.js";import"./Sector-L9R2CZ3j.js";const Wt=ve({scopes:ze(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=L();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),m=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,p=n.status!=="active",x=m||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==x?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",x),e[2]=x,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let S;e[9]!==n.status||e[10]!==p||e[11]!==m||e[12]!==o?(S=m?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=p,e[11]=m,e[12]=o,e[13]=S):S=e[13];let y;e[14]!==j||e[15]!==S?(y=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,S]}),e[14]=j,e[15]=S,e[16]=y):y=e[16];let C;e[17]!==n||e[18]!==m||e[19]!==a||e[20]!==o?(C=m&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=m,e[19]=a,e[20]=o,e[21]=C):C=e[21];let _;e[22]!==n||e[23]!==p||e[24]!==l||e[25]!==o?(_=p?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(ft,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(ht,{size:13})}),e[22]=n,e[23]=p,e[24]=l,e[25]=o,e[26]=_):_=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let w;e[30]!==o?(w=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=w):w=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ae,{size:13}),e[34]=A):A=e[34];let O;e[35]!==$||e[36]!==w||e[37]!==M?(O=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:w,"aria-label":M,children:A}),e[35]=$,e[36]=w,e[37]=M,e[38]=O):O=e[38];let k;e[39]!==n||e[40]!==i?(k=()=>i(n),e[39]=n,e[40]=i,e[41]=k):k=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let b;e[44]!==o?(b=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==k||e[48]!==v||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:k,title:v,"aria-label":b,children:E}),e[47]=k,e[48]=v,e[49]=b,e[50]=z):z=e[50];let I;e[51]!==O||e[52]!==z||e[53]!==C||e[54]!==_?(I=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C,_,O,z]}),e[51]=O,e[52]=z,e[53]=C,e[54]=_,e[55]=I):I=e[55];let P;return e[56]!==I||e[57]!==h||e[58]!==g||e[59]!==y?(P=t.jsxs("div",{className:h,children:[g,y,I]}),e[56]=I,e[57]=h,e[58]=g,e[59]=y,e[60]=P):P=e[60],P}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,a=L();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let d;e[10]!==a?(d=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ae,{size:13}),e[12]=u):u=e[12];let m;e[13]!==o||e[14]!==r||e[15]!==d?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":d,children:u})}),e[13]=o,e[14]=r,e[15]=d,e[16]=m):m=e[16];let p;return e[17]!==i||e[18]!==l||e[19]!==m?(p=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,m]}),e[17]=i,e[18]=l,e[19]=m,e[20]=p):p=e[20],p}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,d=L();if(n.length===0)return null;let u;e[0]!==n.length||e[1]!==d?(u=n.length===1?d("details.connectionInstancesPanel.instance"):d("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=d,e[2]=u):u=e[2];let m;e[3]!==u?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(pt,{size:13}),e[5]=r,e[6]=p):p=e[6];let x;e[7]!==d?(x=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=x):x=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==p||e[12]!==x?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[p,x]}),e[9]=r,e[10]=o,e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;e[14]!==m||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[m,h]}),e[14]=m,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let C;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(C=_=>t.jsx(Z.Suspense,{fallback:t.jsx(Zt,{instance:_,onConfigure:c}),children:t.jsx(Jt,{instance:_,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},_.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=C):C=e[27],j=n.map(C),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let y;return e[30]!==g||e[31]!==S?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=y):y=e[32],y}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const ss=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ns(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const is={calls:{label:"Tool calls"},errors:{label:"Errors"}};function os(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=L(),l=Ee(),o=ns(a),{data:r}=me({queryKey:ee.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Pt(r?.logs??[],o,void 0,r?.total,d?.total),m=u.data,p=u.totalCalls>0,x=ts(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),p?t.jsxs("div",{children:[t.jsx(Mt,{config:is,className:"h-16 w-full",children:t.jsxs(Dt,{data:m,barCategoryGap:"4%",children:[t.jsx(zt,{content:t.jsx(Et,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:m.map(ls)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[m.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),x.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:x.map(as)})]})]})}function as(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function ls(s,e){return t.jsx(Ot,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function rs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function cs(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ds(s){const e=U.c(22),{connectionId:n}=s,c=L(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==a?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":a===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium classic:rounded-md compact:rounded-lg transition-colors",a===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==d||e[9]!==u?(m=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==m?(p=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,m]}),e[11]=r,e[12]=m,e[13]=p):p=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(cs,{}),e[14]=x):x=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==a?(h=t.jsx(Z.Suspense,{fallback:x,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:a})}),e[15]=n,e[16]=l.id,e[17]=a,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const m=crypto.randomUUID();a({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:m}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==o||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,d]}),e[11]=i,e[12]=o,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(ms,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=L(),{org:a}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=Rt(i);if(!(l.length>0)){let p;return e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(t.Fragment,{}),e[2]=p):p=e[2],p}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==a.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:a.slug})}),e[7]=a.slug,e[8]=l,e[9]=u):u=e[9];let m;return e[10]!==d||e[11]!==u?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:a}=s,i=L(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const d=Te(r),u=Ie(c);let m;e[4]!==u||e[5]!==c?(m=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=m):m=e[6];const p=m,[x,h]=Z.useState("");let g,j,S,y;if(e[7]!==p||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==x||e[12]!==i||e[13]!==n){const $=(n??[]).filter(fs),w=x.toLowerCase().trim(),M=w?$.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):$;let A;e[18]!==p||e[19]!==l||e[20]!==a?(A=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=p,e[19]=l,e[20]=a,e[21]=A):A=e[21];const O=A;S="flex flex-col h-full overflow-hidden";let k;e[22]!==i?(k=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=k):k=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=v):v=e[24],e[25]!==x||e[26]!==k?(y=t.jsx(Vt,{value:x,onChange:h,placeholder:k,onKeyDown:v}),e[25]=x,e[26]=k,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(_e,{image:null,title:i(x?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(x?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>O(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Lt,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})}),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:b.annotations?.title??b.name}),t.jsx(at,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=p,e[8]=d,e[9]=l,e[10]=a,e[11]=x,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=y}else g=e[14],j=e[15],S=e[16],y=e[17];let C;e[28]!==g||e[29]!==j?(C=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=C):C=e[30];let _;return e[31]!==S||e[32]!==y||e[33]!==C?(_=t.jsxs("div",{className:S,children:[y,C]}),e[31]=S,e[32]=y,e[33]=C,e[34]=_):_=e[34],_}function fs(s){return!!ce(s._meta)}const je=[];function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=L();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s,o=c===void 0?je:c,r=a===void 0?je:a,d=L(),u=se(),m=Ie(i??"");let p;e[0]!==m||e[1]!==i?(p=m?Pe(m):i,e[0]=m,e[1]=i,e[2]=p):p=e[2];const x=p;let h;e[3]!==x||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(T){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(T)}})},e[3]=x,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(bs),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const S=j;if(n.length+o.length+r.length===0){let N;e[12]!==d?(N=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=N):N=e[13];let T;e[14]!==N?(T=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:N}),e[14]=N,e[15]=T):T=e[15];let D;e[16]!==d?(D=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=D):D=e[17];let F;e[18]!==D?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e[18]=D,e[19]=F):F=e[19];let X;return e[20]!==T||e[21]!==F?(X=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[T,F]}),e[20]=T,e[21]=F,e[22]=X):X=e[22],X}let C;e[23]!==d||e[24]!==n.length?(C=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=C):C=e[25];let _;e[26]!==C?(_=t.jsx(ie,{value:"tools",variant:"underline",children:C}),e[26]=C,e[27]=_):_=e[27];let $;e[28]!==S||e[29]!==d?($=S&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=S,e[29]=d,e[30]=$):$=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let M;e[33]!==w?(M=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=M):M=e[34];let A;e[35]!==d?(A=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=A):A=e[36];let O;e[37]!==A?(O=t.jsx(ie,{value:"resources",variant:"underline",children:A}),e[37]=A,e[38]=O):O=e[38];let k;e[39]!==M||e[40]!==O||e[41]!==_||e[42]!==$?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Ut,{variant:"underline",className:"gap-1",children:[_,$,M,O]})}),e[39]=M,e[40]=O,e[41]=_,e[42]=$,e[43]=k):k=e[43];let v;e[44]!==g||e[45]!==n?(v=n.length>0?n.map(N=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>g(N.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(vt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=v):v=e[46];let b;e[47]!==v?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:v})}),e[47]=v,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==S||e[51]!==l||e[52]!==n?(E=S&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ps,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=S,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==o?(z=o.length>0?o.map(js):t.jsx(le,{label:"prompts"}),e[54]=o,e[55]=z):z=e[55];let I;e[56]!==z?(I=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=I):I=e[57];let P;e[58]!==r?(P=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=P):P=e[59];let R;e[60]!==P?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:P})}),e[60]=P,e[61]=R):R=e[61];let f;return e[62]!==k||e[63]!==b||e[64]!==E||e[65]!==I||e[66]!==R?(f=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Ft,{defaultValue:"tools",variant:"underline",children:[k,b,E,I,R]})}),e[62]=k,e[63]=b,e[64]=E,e[65]=I,e[66]=R,e[67]=f):f=e[67],f}function gs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(jt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function js(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(gt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function bs(s){return ce(s._meta)}function vs(s){const e=U.c(15),{connection:n,displayTitle:c}=s,a=Ue(),i=c??n.title,l=a?"md":"xl";let o;e[0]!==n.icon||e[1]!==l||e[2]!==i?(o=t.jsx(ae,{icon:n.icon,name:i,size:l,className:"shrink-0"}),e[0]=n.icon,e[1]=l,e[2]=i,e[3]=o):o=e[3];let r;e[4]!==a||e[5]!==i?(r=a?t.jsx(Fe.Title,{children:i}):t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:i})}),e[4]=a,e[5]=i,e[6]=r):r=e[6];let d;e[7]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[7]=n.description,e[8]=d):d=e[8];let u;e[9]!==r||e[10]!==d?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,d]}),e[9]=r,e[10]=d,e[11]=u):u=e[11];let m;return e[12]!==o||e[13]!==u?(m=t.jsxs("div",{className:"flex items-center classic:gap-4 classic:md:gap-6 classic:py-5 classic:md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0 compact:gap-3 compact:py-4",children:[o,u]}),e[12]=o,e[13]=u,e[14]=m):m=e[14],m}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=L(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Le(),d=(()=>{if(typeof o!="string"||!o)return!1;try{const x=new URL(o);return x.hostname==="api.githubcopilot.com"&&x.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Kt(e.connection_url):null;return m?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.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(ye,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),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:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(q,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(V,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(G,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(G,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(G,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(q,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(V,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(G,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(G,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(bt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(G,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(K,{})]})}),l==="NPX"&&t.jsx(q,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(q,{control:s.control,name:"stdio_command",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),t.jsx(q,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(K,{})]})})]}),t.jsx(q,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(q,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(V,{children:t.jsx(Je,{value:x.value??[],onChange:x.onChange})}),t.jsx(K,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(q,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ve,{children:[t.jsx(Be,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Bt,{variant:"success",className:"gap-1.5",children:[t.jsx(Gt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(qt,{size:12})]})})}),t.jsxs(Ge,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(Nt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&x.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:()=>x.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 classic:rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity compact:rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Qt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(W,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(It,{children:[i("details.connectionSidebar.createAPatAt")," ",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(K,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Cs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Xt(s.connection_headers)){const c=s.connection_headers,a=et(c.envVars);if(Ss(c)){const l=ys(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const i=Cs(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}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 _s(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=tt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=st(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=L(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),m=ke(),{org:p}=te(),x=Tt({onSuccess:()=>{o.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[j,S]=Z.useState(!1),y=we({connectionId:e}),{data:C}=lt(),_=C?.data?.members??[],$=h??s,w=_.find(f=>f.userId===$.created_by),A=s?.connection_type==="VIRTUAL"||y.isAuthenticated,O={...s,tools:a},k=nt(O,Yt),v=Xe({resolver:We(Ze),values:be(h??s)}),b=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const N=v.getValues(),T=_s(N),D=h?.id??e;await m.update.mutateAsync({id:D,data:T}),v.reset(N)},z=()=>{v.reset(be(h??s))},I=async f=>{const N=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:T,tokenInfo:D,error:F}=await xt({connectionId:f,orgSlug:p.slug,...N?{scope:N}:{}});if(F||!T){J.error(r("details.connection.authFailed",{error:F??""}));return}if(D)try{const Y=await fetch(`/api/${p.slug}/connections/${f}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!Y.ok)console.error("Failed to save OAuth token:",await Y.text()),await m.update.mutateAsync({id:f,data:{connection_token:T}});else try{await m.update.mutateAsync({id:f,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Y){console.error("Error saving OAuth token:",Y),await m.update.mutateAsync({id:f,data:{connection_token:T}})}else await m.update.mutateAsync({id:f,data:{connection_token:T}});const X=new URL(`/api/${p.slug}/mcp/${f}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(X.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},P=()=>I(s.id),R=async()=>{try{const f=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!f.ok){const T=await f.text();J.error(r("details.connection.failedRemoveOAuth",{error:T}));return}const N=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(N.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(f){console.error("Error removing OAuth token:",f),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(At,{...x}),t.jsx(St,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(yt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Ct,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(_t,{className:"text-base",children:h?.title??s.title}),t.jsx(wt,{className:"text-xs",children:r("details.connection.settingsDescription")}),w&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(rt,{url:w.user?.image??void 0,fallback:w.user?.name??w.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:w.user?.name||w.user?.email})]})]}),t.jsxs(kt,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(q,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(Q,{children:r("details.connection.nameLabel")}),t.jsx(V,{children:t.jsx(W,{...f})}),t.jsx(K,{})]})}),t.jsx(q,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(Q,{children:r("details.connection.descriptionLabel")}),t.jsx(V,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(K,{})]})})]}),t.jsx(Ns,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(it,{connection:h??s,form:v,hasMcpBinding:k,isMCPAuthenticated:A,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:P,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const f=h??s;g(null),x.requestDelete(f)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(ot,{hideTopbar:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(vs,{connection:s,displayTitle:(()=>{const f=o[0]??s;return f.app_name?f.title.replace(/\s*\(\d+\)\s*$/,""):f.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ds,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:o,onConfigure:f=>g(f),onAuthenticate:f=>I(f.id),onDelete:f=>x.requestDelete(f),onToggleStatus:async(f,N)=>{try{await m.update.mutateAsync({id:f.id,data:{status:N}}),J.success(r(N==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const f=o[0]??s,N=f.title.replace(/\s*\(\d+\)\s*$/,""),T=o.length+1,D=`${N} (${T})`,F=Ye("conn");await m.create.mutateAsync({id:F,title:D,description:f.description??null,connection_type:f.connection_type,connection_url:f.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f.created_by,organization_id:f.organization_id,icon:f.icon??null,app_name:f.app_name??null,app_id:f.app_id??null,connection_headers:f.connection_headers??null,oauth_config:null,configuration_state:f.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const X=new URL(`/api/${p.slug}/mcp/${F}`,window.location.origin),Y=await ut({url:X.href,token:null,orgId:p.id});Y.supportsOAuth&&!Y.isAuthenticated&&await I(F)}finally{S(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Is(){const s=U.c(52),e=L();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=He(a),{org:o}=te(),r=ke();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=ct(d),m=u[0]??null,p=m?.id??"",x=p||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==x?(h={connectionId:x,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=x,s[7]=h):h=s[7];const g=Te(h);let j;s[8]!==g?(j={client:g},s[8]=g,s[9]=j):j=s[9];const{data:S}=dt(j);let y;if(s[10]!==m?.tools||s[11]!==p||s[12]!==u||s[13]!==S){const I=S?S.tools.map($s):(m?.tools??[]).map(Ds);e:{if(u.length<=1){y=I;break e}const P=new Set,R=[],f=As;for(const N of u){const T=N.id===p?I:f(N.tools);for(const D of T)P.has(D.name)||(P.add(D.name),R.push(D))}y=R.length>0?R:I}s[10]=m?.tools,s[11]=p,s[12]=u,s[13]=S,s[14]=y}else y=s[14];const C=y;let _;s[15]!==g?(_={client:g},s[15]=g,s[16]=_):_=s[16];const{data:$}=mt(_);let w;s[17]!==g?(w={client:g},s[17]=g,s[18]=w):w=s[18];const{data:M}=Qe(w);let A;s[19]!==$?.prompts?(A=$?.prompts??[],s[19]=$?.prompts,s[20]=A):A=s[20];let O;s[21]!==A?(O=A.map(Ts),s[21]=A,s[22]=O):O=s[22];const k=O;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let b;s[25]!==v?(b=v.map(ks),s[25]=v,s[26]=b):b=s[26];const E=b;if(!m){let I;s[27]!==e?(I=e("details.connection.notFoundTitle"),s[27]=e,s[28]=I):I=s[28];let P;s[29]!==e?(P=e("details.connection.notFoundDescription"),s[29]=e,s[30]=P):P=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let f;s[34]!==e?(f=e("details.connection.backButton"),s[34]=e,s[35]=f):f=s[35];let N;s[36]!==R||s[37]!==f?(N=t.jsx(B,{variant:"outline",onClick:R,children:f}),s[36]=R,s[37]=f,s[38]=N):N=s[38];let T;return s[39]!==I||s[40]!==P||s[41]!==N?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(_e,{title:I,description:P,actions:N})}),s[39]=I,s[40]=P,s[41]=N,s[42]=T):T=s[42],T}let z;return s[43]!==r.update.isPending||s[44]!==C||s[45]!==m||s[46]!==p||s[47]!==l||s[48]!==k||s[49]!==E||s[50]!==u?(z=t.jsx(ws,{org:l,connection:m,connectionId:p,isUpdating:r.update.isPending,tools:C,prompts:k,resources:E,siblings:u}),s[43]=r.update.isPending,s[44]=C,s[45]=m,s[46]=p,s[47]=l,s[48]=k,s[49]=E,s[50]=u,s[51]=z):z=s[51],z}function ks(s){return{name:s.name,description:s.description,uri:s.uri}}function Ts(s){return{name:s.name,description:s.description}}function As(s){return(s??[]).map(Ps)}function Ps(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ds(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function $s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Os(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qe,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Is,{})})}),s[0]=e):e=s[0],e}function gi(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Os,{}),s[0]=e):e=s[0],e}export{gi as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ao as R,bP as A,bQ as I,ap as o,bO as j,bN as z,c as L,j as u,B as C}from"./index-
|
|
1
|
+
import{ao as R,bP as A,bQ as I,ap as o,bO as j,bN as z,c as L,j as u,B as C}from"./index-B-RfjkQs.js";import{I as H}from"./input-DgwTyBrI.js";import{s as W}from"./Plus-BeOCeSsu.js";import{s as q}from"./Trash01-yjy5Djos.js";const K=R({key:o().min(1,"Key is required"),value:o()}),M=R({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(K).optional(),configuration_scopes:j(o()).nullable().optional(),configuration_state:A(o(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]}).refine(n=>(n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket")&&n.connection_url?.trim()?o().url().safeParse(n.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function O(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(i=>e.includes(i))||["sk_","rk_","whsec_","pk_live","sk_live"].some(i=>e.startsWith(i))||["_key","_secret","_token","_password","_auth","_pat"].some(i=>e.endsWith(i)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:i,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=i===void 0?"value...":i;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,s)=>s!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:p,value:c.value},r(s))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const g=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:c.key,value:p},r(s))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,s)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>g(s,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:O(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(s,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(s),children:u.jsx(q,{size:16})})]},s),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==S?(d=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[w,"Add Environment Variable"]}),e[26]=S,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(i=>!i.startsWith("-"));return a?{packageName:a}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Q(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(i=>(i.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function J(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const i=V(r);return Object.keys(i).length>0&&(a.envVars=i),a}export{X as E,Q as a,J as b,M as c,Z as d,Y as i,F as p,D as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as V,c as G,b as ne,j as t,B as L,h as ue,l as he,G as ce,F as Re,I as We,H as Xe,E as Ge,U as qe,Y as Ne,d as ke,u as Qe,a as Te,R as Ye,ad as ye,V as Je,X as Ze,an as et,am as tt,n as pe,q as te,o as nt,a4 as st,t as W,K as ot}from"./index-B5qcJXym.js";import{a as we,g as it,e as ct}from"./extract-connection-data-CAltfKQ-.js";import{C as lt}from"./collection-display-button-DbL3RQ_W.js";import{S as rt}from"./search-input-BNBSYhPG.js";import{C as at}from"./collection-tabs-C6wmaayy.js";import{C as Ce,u as Ae,g as dt}from"./connection-card-CTbyclre.js";import{E as ut}from"./empty-state-D72D4ZR9.js";import{u as gt,D as mt}from"./use-delete-connection-ts-TF_ss.js";import{u as pt}from"./use-infinite-scroll-0LalUJCN.js";import{u as Ie}from"./use-mobile-CdSKJGCa.js";import{g as de}from"./connection-slug-CITJ0kGN.js";import{A as ft,a as ht,b as xt,c as jt,g as St,d as yt,e as Ct,f as vt}from"./alert-dialog-CkMD96Bv.js";import{as as xe,br as bt,at as _t,be as Dt,l as Se}from"./agent-icon-BbP5hNkj.js";import{g as Nt,a as kt}from"./metadata-D72DunRR.js";import{d as Pe,h as Me,c as $e,e as Oe,b as Fe,D as Ue}from"./dialog-B-8VCM7c.js";import{D as Tt,a as wt,d as At,b as It,e as Pt,f as Mt,g as $t}from"./drawer-CjVGNrnd.js";import{F as q,b as Q,c as Y,d as J,f as Z,a as _e}from"./form-CWAKn5Sq.js";import{I as se}from"./input-BrTwdDWy.js";import{S as Ot,b as Ft,a as Ut,d as Vt,c as ae}from"./select-DoCYMQfs.js";import{T as Lt}from"./textarea-B5yuRdsu.js";import{b as Ve,u as zt}from"./use-connection-Dy2UvMsH.js";import{m as Et}from"./use-mcp-client-Dyv-A06S.js";import{b as Bt}from"./use-virtual-mcp-n3oy3EAh.js";import{g as Kt}from"./types-vDN5599c.js";import{s as Le}from"./Plus-91Je9mAy.js";import{b as Ht}from"./UserSquare-DeAUSm2x.js";import{s as ze}from"./XClose-CSFrevt_.js";import{i as fe,a as De,E as Rt,c as Wt,p as Xt,b as Gt,d as qt}from"./connection-form-helpers-smp2bSjt.js";import{a as Qt}from"./authenticate-and-persist-oauth-CKbQN4IJ.js";import{I as Yt}from"./integration-icon-BrdRpcDb.js";import{C as Ee}from"./checkbox-DWPYmeiE.js";import{i as Jt}from"./DotsVertical-CxZAdY1u.js";import{s as Be}from"./Eye-Vnu3GFnh.js";import{s as Ke}from"./Trash01-7JyRrrFx.js";import"./connection-BUAfkZui.js";import"./ArrowUp-DOGYG-2d.js";import"./Check-Cu8ZpiXU.js";import"./tooltip-C6PJ1j7n.js";import"./index-hiCS6MSh.js";import"./view-mode-toggle-BzRY2KFe.js";import"./badge-BNONYRUH.js";import"./SearchMd-DwLB0FEi.js";import"./useInfiniteQuery-BRngavau.js";import"./infiniteQueryObserver-ByWJdGMW.js";import"./slugify-CEUa2lfQ.js";import"./AlertCircle-Cdi9MsfI.js";import"./Tool01-BUVvNqCT.js";import"./ArrowLeft--sbQIcA4.js";import"./ArrowRight-D3bCXfs3.js";import"./ZoomOut-BHIrcxIe.js";import"./Globe04-hb2fIuJ3.js";import"./CheckCircle-V_B-3A54.js";import"./ChevronUp-fM8pBRMJ.js";import"./Copy01-B9PN4for.js";import"./CreditCard01-0hm82-Yz.js";import"./Share07-Vq8ntjl8.js";import"./Image01-RGU0s9ee.js";import"./Key01-CN4l1Zci.js";import"./LayoutLeft-CtFtWr5A.js";import"./Link01-C5_VVVM6.js";import"./LinkExternal01-BXIOuIUa.js";import"./Monitor01-CSVz4TM7.js";import"./Sun-DGczRjF9.js";import"./Palette-D27CjO4F.js";import"./Upload01-BJxqsXwZ.js";import"./User01-DlkJQdTb.js";import"./Users01-CCyYZBpM.js";import"./X-B4zsCxDW.js";import"./Zap-B5gdN-nI.js";import"./label-ESYZa9X8.js";import"./auth-lb5mcKTR.js";import"./mcp-oauth-CoZvf1D5.js";function Zt(C){const e=`deco-filters-${C}`,[n,d]=V.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{d(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(c){console.error("Failed to save filters:",c)}}]}function en(C){const e=G.c(7),[n,d]=V.useState(C),[s,o]=V.useState(C?"desc":null);let c;e[0]!==s||e[1]!==n?(c=a=>{n!==a?(d(a),o("asc")):s==="asc"?o("desc"):s==="desc"&&(d(void 0),o(null))},e[0]=s,e[1]=n,e[2]=c):c=e[2];const r=c;let m;return e[3]!==r||e[4]!==s||e[5]!==n?(m={sortKey:n,sortDirection:s,handleSort:r},e[3]=r,e[4]=s,e[5]=n,e[6]=m):m=e[6],m}function tn(C,e){const n=G.c(12),d=e===void 0?"cards":e,s=Ie(),o=V.useRef(s),c=C?`deco-view-mode-${C}`:"deco-view-mode";let r;n[0]!==d||n[1]!==c?(r=()=>{const h=globalThis.localStorage?.getItem(c);return h==="cards"||h==="table"?h:d},n[0]=d,n[1]=c,n[2]=r):r=n[2];const[m,a]=V.useState(r);let S;n[3]!==c?(S=h=>{a(h),globalThis.localStorage?.setItem(c,h)},n[3]=c,n[4]=S):S=n[4];const u=S;let l,p;n[5]!==s||n[6]!==m?(l=()=>{!o.current&&s&&m==="table"&&a("cards"),o.current=s},p=[s,m],n[5]=s,n[6]=m,n[7]=l,n[8]=p):(l=n[7],p=n[8]),V.useEffect(l,p);let f;return n[9]!==u||n[10]!==m?(f=[m,u],n[9]=u,n[10]=m,n[11]=f):f=n[11],f}function nn(C){const e=G.c(20),{namespace:n,resource:d,defaultSortKey:s,defaultViewMode:o}=C,c=s===void 0?"title":s,r=o===void 0?"table":o,[m,a]=V.useState(""),S=V.useDeferredValue(m),u=`${n}-${d}`,[l,p]=Zt(u),f=`studio-${d}-filter-visible-${n}`;let h;e[0]!==f?(h=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=h):h=e[1];const[x,D]=V.useState(h);let y;e[2]!==f?(y=F=>{D(F),globalThis.localStorage?.setItem(f,String(F))},e[2]=f,e[3]=y):y=e[3];const v=y;let i;e[4]!==x||e[5]!==v?(i=()=>{v(!x)},e[4]=x,e[5]=v,e[6]=i):i=e[6];const b=i,[k,A]=tn(`studio-${d}-${n}`,r),{sortKey:T,sortDirection:M,handleSort:P}=en(c),$=T;let I;return e[7]!==x||e[8]!==l||e[9]!==P||e[10]!==m||e[11]!==S||e[12]!==v||e[13]!==p||e[14]!==A||e[15]!==M||e[16]!==$||e[17]!==b||e[18]!==k?(I={search:m,searchTerm:S,setSearch:a,filters:l,setFilters:p,filterBarVisible:x,setFilterBarVisible:v,toggleFilterBar:b,viewMode:k,setViewMode:A,sortKey:$,sortDirection:M,handleSort:P},e[7]=x,e[8]=l,e[9]=P,e[10]=m,e[11]=S,e[12]=v,e[13]=p,e[14]=A,e[15]=M,e[16]=$,e[17]=b,e[18]=k,e[19]=I):I=e[19],I}function sn(C){const e=G.c(35),{open:n,onOpenChange:d,count:s,onConfirm:o}=C,c=ne(),r=s===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let m;e[0]!==s||e[1]!==c||e[2]!==r?(m=c(r,{count:s}),e[0]=s,e[1]=c,e[2]=r,e[3]=m):m=e[3];let a;e[4]!==m?(a=t.jsx(ft,{children:m}),e[4]=m,e[5]=a):a=e[5];const S=s===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==c||e[7]!==S?(u=c(S),e[6]=c,e[7]=S,e[8]=u):u=e[8];let l;e[9]!==u?(l=t.jsx(ht,{children:u}),e[9]=u,e[10]=l):l=e[10];let p;e[11]!==a||e[12]!==l?(p=t.jsxs(xt,{children:[a,l]}),e[11]=a,e[12]=l,e[13]=p):p=e[13];let f;e[14]!==c?(f=c("orgs.bulkDeleteDialog.cancelButton"),e[14]=c,e[15]=f):f=e[15];let h;e[16]!==f?(h=t.jsx(jt,{children:f}),e[16]=f,e[17]=h):h=e[17];const x=s===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let D;e[18]!==s||e[19]!==c||e[20]!==x?(D=c(x,{count:s}),e[18]=s,e[19]=c,e[20]=x,e[21]=D):D=e[21];let y;e[22]!==o||e[23]!==D?(y=t.jsx(St,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:D}),e[22]=o,e[23]=D,e[24]=y):y=e[24];let v;e[25]!==y||e[26]!==h?(v=t.jsxs(yt,{children:[h,y]}),e[25]=y,e[26]=h,e[27]=v):v=e[27];let i;e[28]!==v||e[29]!==p?(i=t.jsxs(Ct,{children:[p,v]}),e[28]=v,e[29]=p,e[30]=i):i=e[30];let b;return e[31]!==d||e[32]!==n||e[33]!==i?(b=t.jsx(vt,{open:n,onOpenChange:d,children:i}),e[31]=d,e[32]=n,e[33]=i,e[34]=b):b=e[34],b}function on(C){const e=G.c(39),{item:n,canManage:d,allConnections:s,connectedAppNames:o,connectingItemId:c,onNavigateConnected:r,onConnect:m}=C,a=ne();let S,u;e[0]!==o||e[1]!==n?(S=we(n)??"",u=o.has(S),e[0]=o,e[1]=n,e[2]=S,e[3]=u):(S=e[2],u=e[3]);const l=u;let p;e[4]!==n._meta?(p=Nt(n._meta),e[4]=n._meta,e[5]=p):p=e[5];const f=p,h=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",x=n.server?.description||n.description||null;let D;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(D=n.server?.icons?.[0]?.src||kt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=D):D=e[8];const y=D;let v;if(e[9]!==s||e[10]!==S){let O;e[12]!==S?(O=H=>H.connection_type!=="VIRTUAL"&&H.app_name===S,e[12]=S,e[13]=O):O=e[13],v=s.filter(O),e[9]=s,e[10]=S,e[11]=v}else v=e[11];const i=v,b=l||d;let k,A;e[14]!==i||e[15]!==l||e[16]!==n||e[17]!==m||e[18]!==r?(k=()=>{if(l){const O=i[0];O&&r(O);return}A()},A=()=>m(n),e[14]=i,e[15]=l,e[16]=n,e[17]=m,e[18]=r,e[19]=k,e[20]=A):(k=e[19],A=e[20]);let T;e[21]!==x||e[22]!==y||e[23]!==h?(T={title:h,description:x,icon:y},e[21]=x,e[22]=y,e[23]=h,e[24]=T):T=e[24];let M;e[25]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(xe,{}),e[25]=M):M=e[25];const P=b?k:void 0;let $;e[26]!==d||e[27]!==c||e[28]!==A||e[29]!==l||e[30]!==n.id||e[31]!==a?($=l?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.catalogItemCard.connected")}):d&&t.jsx(L,{variant:"outline",size:"sm",className:"h-7 px-3 classic:rounded-lg text-sm font-medium",disabled:c!==null,onClick:O=>{O.stopPropagation(),A()},children:c===n.id?t.jsx(ue,{className:"size-3.5"}):a("orgs.catalogItemCard.connect")}),e[26]=d,e[27]=c,e[28]=A,e[29]=l,e[30]=n.id,e[31]=a,e[32]=$):$=e[32];let I;e[33]!==$?(I=t.jsx("div",{className:"flex items-center gap-2",children:$}),e[33]=$,e[34]=I):I=e[34];let F;return e[35]!==T||e[36]!==P||e[37]!==I?(F=t.jsx(Ce,{connection:T,fallbackIcon:M,onClick:P,headerActionsAlwaysVisible:!0,headerActions:I}),e[35]=T,e[36]=P,e[37]=I,e[38]=F):F=e[38],F}function cn(C){return C?.length?{appToolName:C.find(n=>!!Kt(n._meta))?.name??null}:null}function He(C){const e=G.c(8),{selectionMode:n,children:d}=C,s=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let o;e[0]!==s?(o=he("overflow-hidden transition-all duration-150 ease-out",s),e[0]=s,e[1]=o):o=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Re,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:rn,children:t.jsx(Jt,{size:20})})}),e[2]=c):c=e[2];let r;e[3]!==d?(r=t.jsxs(We,{children:[c,t.jsx(Xe,{align:"end",onClick:ln,children:d})]}),e[3]=d,e[4]=r):r=e[4];let m;return e[5]!==o||e[6]!==r?(m=t.jsx("div",{className:o,children:r}),e[5]=o,e[6]=r,e[7]=m):m=e[7],m}function ln(C){return C.stopPropagation()}function rn(C){return C.stopPropagation()}function an(C){const e=G.c(57),{group:n,onOpen:d,selectionMode:s,selectedIds:o,onToggleSelect:c}=C,r=ne();let m;if(e[0]!==n.connections||e[1]!==o){let g;e[3]!==o?(g=w=>o.has(w.id),e[3]=o,e[4]=g):g=e[4],m=n.connections.every(g),e[0]=n.connections,e[1]=o,e[2]=m}else m=e[2];const a=m;let S;if(e[5]!==n.connections||e[6]!==o){let g;e[8]!==o?(g=w=>o.has(w.id),e[8]=o,e[9]=g):g=e[9],S=n.connections.some(g),e[5]=n.connections,e[6]=o,e[7]=S}else S=e[7];const u=S;let l;e[10]!==a||e[11]!==n.connections||e[12]!==c||e[13]!==o?(l=()=>{for(const g of n.connections)a?o.has(g.id)&&c(g.id):o.has(g.id)||c(g.id)},e[10]=a,e[11]=n.connections,e[12]=c,e[13]=o,e[14]=l):l=e[14];const p=l,f=n.title,h=n.icon;let x;e[15]!==n.connections.length||e[16]!==r?(x=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=x):x=e[17];let D;e[18]!==n.icon||e[19]!==n.title||e[20]!==x?(D={title:f,icon:h,description:x},e[18]=n.icon,e[19]=n.title,e[20]=x,e[21]=D):D=e[21];let y;e[22]!==d||e[23]!==s||e[24]!==p?(y=()=>s?p():d(),e[22]=d,e[23]=s,e[24]=p,e[25]=y):y=e[25];const v=s&&a&&"ring-2 ring-primary",i=s&&u&&!a&&"ring-1 ring-primary/50";let b;e[26]!==i||e[27]!==v?(b=he(v,i),e[26]=i,e[27]=v,e[28]=b):b=e[28];const k=s?a?!0:u&&"mixed":void 0;let A;e[29]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(xe,{}),e[29]=A):A=e[29];let T;e[30]!==a||e[31]!==n.connections.length||e[32]!==s||e[33]!==u||e[34]!==r||e[35]!==p?(T=s?t.jsx(Ee,{checked:a?!0:u?"indeterminate":!1,onCheckedChange:p}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:r("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=a,e[31]=n.connections.length,e[32]=s,e[33]=u,e[34]=r,e[35]=p,e[36]=T):T=e[36];let M;e[37]!==d?(M=g=>{g.stopPropagation(),d()},e[37]=d,e[38]=M):M=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Be,{size:16}),e[39]=P):P=e[39];let $;e[40]!==r?($=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=$):$=e[41];let I;e[42]!==M||e[43]!==$?(I=t.jsxs(ce,{onClick:M,children:[P,$]}),e[42]=M,e[43]=$,e[44]=I):I=e[44];let F;e[45]!==s||e[46]!==I?(F=t.jsx(He,{selectionMode:s,children:I}),e[45]=s,e[46]=I,e[47]=F):F=e[47];let O;e[48]!==T||e[49]!==F?(O=t.jsxs("div",{className:"flex items-center gap-1",children:[T,F]}),e[48]=T,e[49]=F,e[50]=O):O=e[50];let H;return e[51]!==b||e[52]!==k||e[53]!==O||e[54]!==D||e[55]!==y?(H=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:D,onClick:y,className:b,selected:k,fallbackIcon:A,headerActionsAlwaysVisible:!0,headerActions:O})}),e[51]=b,e[52]=k,e[53]=O,e[54]=D,e[55]=y,e[56]=H):H=e[56],H}function dn(C){const e=G.c(36),{connection:n,isSelected:d,selectionMode:s,canManage:o,canManageAgents:c,onToggleSelect:r,onOpen:m,onToggleStatus:a,onDelete:S}=C,u=ne();let l;e[0]!==d||e[1]!==r||e[2]!==s||e[3]!==u?(l=s?t.jsx(Ee,{checked:d,onCheckedChange:r,onClick:un}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=d,e[1]=r,e[2]=s,e[3]=u,e[4]=l):l=e[4];let p;e[5]!==m?(p=k=>{k.stopPropagation(),m()},e[5]=m,e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Be,{size:16}),e[7]=f):f=e[7];let h;e[8]!==u?(h=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=h):h=e[9];let x;e[10]!==p||e[11]!==h?(x=t.jsxs(ce,{onClick:p,children:[f,h]}),e[10]=p,e[11]=h,e[12]=x):x=e[12];let D;e[13]!==o||e[14]!==c||e[15]!==r||e[16]!==u?(D=(o||c)&&t.jsxs(ce,{onClick:k=>{k.stopPropagation(),r()},children:[t.jsx(bt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=o,e[14]=c,e[15]=r,e[16]=u,e[17]=D):D=e[17];let y;e[18]!==o||e[19]!==n||e[20]!==a||e[21]!==u?(y=o&&(n.status==="active"?t.jsxs(ce,{onClick:k=>{k.stopPropagation(),a("inactive")},children:[t.jsx(_t,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:k=>{k.stopPropagation(),a("active")},children:[t.jsx(Dt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=o,e[19]=n,e[20]=a,e[21]=u,e[22]=y):y=e[22];let v;e[23]!==o||e[24]!==S||e[25]!==u?(v=o&&t.jsxs(ce,{variant:"destructive",onClick:k=>{k.stopPropagation(),S()},children:[t.jsx(Ke,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=o,e[24]=S,e[25]=u,e[26]=v):v=e[26];let i;e[27]!==s||e[28]!==x||e[29]!==D||e[30]!==y||e[31]!==v?(i=t.jsxs(He,{selectionMode:s,children:[x,D,y,v]}),e[27]=s,e[28]=x,e[29]=D,e[30]=y,e[31]=v,e[32]=i):i=e[32];let b;return e[33]!==l||e[34]!==i?(b=t.jsxs("div",{className:"flex items-center gap-1",children:[l,i]}),e[33]=l,e[34]=i,e[35]=b):b=e[35],b}function un(C){return C.stopPropagation()}function gn(C){const e=G.c(29),{count:n,total:d,canManage:s,canManageAgents:o,onSelectAll:c,onDeselectAll:r,onDelete:m,onAddToAgent:a,onToggleStatus:S,onCancel:u}=C,l=ne();if(n===0)return null;let p;e[0]!==n||e[1]!==l?(p=l("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=l,e[2]=p):p=e[2];let f;e[3]!==p?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:p}),e[3]=p,e[4]=f):f=e[4];let h;e[5]!==n||e[6]!==r||e[7]!==c||e[8]!==l||e[9]!==d?(h=n<d?t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:l("orgs.connectionSelectionUi.selectAll",{total:d})}):t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:l("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=c,e[8]=l,e[9]=d,e[10]=h):h=e[10];let x;e[11]!==o||e[12]!==a||e[13]!==l?(x=o&&t.jsxs(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:[t.jsx(Le,{size:13}),l("orgs.connectionSelectionUi.addToAgent")]}),e[11]=o,e[12]=a,e[13]=l,e[14]=x):x=e[14];let D;e[15]!==s||e[16]!==m||e[17]!==S||e[18]!==l?(D=s&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>S("active"),children:l("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>S("inactive"),children:l("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:[t.jsx(Ke,{size:13}),l("orgs.connectionSelectionUi.delete")]})]}),e[15]=s,e[16]=m,e[17]=S,e[18]=l,e[19]=D):D=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ze,{size:13}),e[20]=y):y=e[20];let v;e[21]!==u?(v=t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:y}),e[21]=u,e[22]=v):v=e[22];let i;return e[23]!==f||e[24]!==h||e[25]!==x||e[26]!==D||e[27]!==v?(i=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[f,h,x,D,v]})}),e[23]=f,e[24]=h,e[25]=x,e[26]=D,e[27]=v,e[28]=i):i=e[28],i}function mn(C){const e=G.c(45),{open:n,onOpenChange:d,agents:s,onConfirm:o}=C,c=ne(),[r,m]=V.useState(null);let a;e[0]!==c?(a=c("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=c,e[1]=a):a=e[1];let S;e[2]!==a?(S=t.jsx(Pe,{children:a}),e[2]=a,e[3]=S):S=e[3];let u;e[4]!==c?(u=c("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=c,e[5]=u):u=e[5];let l;e[6]!==u?(l=t.jsx(Me,{children:u}),e[6]=u,e[7]=l):l=e[7];let p;e[8]!==S||e[9]!==l?(p=t.jsxs($e,{children:[S,l]}),e[8]=S,e[9]=l,e[10]=p):p=e[10];let f;e[11]!==s||e[12]!==r||e[13]!==c?(f=s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:c("orgs.connectionSelectionUi.noAgentsFound")}):s.map(P=>t.jsxs("button",{type:"button",onClick:()=>m(P.id),className:he("flex items-center gap-3 w-full classic:rounded-md compact:rounded-lg px-3 py-2 text-left transition-colors",r===P.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Yt,{icon:P.icon,name:P.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:P.title}),P.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:P.description})]})]},P.id)),e[11]=s,e[12]=r,e[13]=c,e[14]=f):f=e[14];let h;e[15]!==f?(h=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:f}),e[15]=f,e[16]=h):h=e[16];let x;e[17]!==d?(x=()=>d(!1),e[17]=d,e[18]=x):x=e[18];let D;e[19]!==c?(D=c("orgs.connectionSelectionUi.cancel"),e[19]=c,e[20]=D):D=e[20];let y;e[21]!==x||e[22]!==D?(y=t.jsx(L,{variant:"outline",onClick:x,children:D}),e[21]=x,e[22]=D,e[23]=y):y=e[23];const v=!r;let i;e[24]!==o||e[25]!==d||e[26]!==r?(i=()=>{r&&(o(r),d(!1),m(null))},e[24]=o,e[25]=d,e[26]=r,e[27]=i):i=e[27];let b;e[28]!==c?(b=c("orgs.connectionSelectionUi.add"),e[28]=c,e[29]=b):b=e[29];let k;e[30]!==v||e[31]!==i||e[32]!==b?(k=t.jsx(L,{disabled:v,onClick:i,children:b}),e[30]=v,e[31]=i,e[32]=b,e[33]=k):k=e[33];let A;e[34]!==y||e[35]!==k?(A=t.jsxs(Oe,{children:[y,k]}),e[34]=y,e[35]=k,e[36]=A):A=e[36];let T;e[37]!==A||e[38]!==p||e[39]!==h?(T=t.jsxs(Fe,{className:"sm:max-w-[400px]",children:[p,h,A]}),e[37]=A,e[38]=p,e[39]=h,e[40]=T):T=e[40];let M;return e[41]!==d||e[42]!==n||e[43]!==T?(M=t.jsx(Ue,{open:n,onOpenChange:d,children:T}),e[41]=d,e[42]=n,e[43]=T,e[44]=M):M=e[44],M}function pn({listState:C,activeTab:e,typeFilter:n,statusFilter:d}){const s=ne(),{org:o}=Ne(),c=nt(),r=ke(),{data:m}=Te.useSession(),a=Ve(),S=zt(C),u=gt(),{granted:l}=ye("connections:manage"),{granted:p}=ye("agents:manage"),[f,h]=V.useState(new Set),x=f.size>0,[D,y]=V.useState(!1),[v,i]=V.useState(!1),[b,k]=V.useState(null),A=Bt(),T=S.filter(_=>!(n!=="ALL"&&_.connection_type!==n||d!=="ALL"&&_.status!==d)),M=dt(T),P=_=>{h(j=>{const E=new Set(j);return E.has(_)?E.delete(_):E.add(_),E})},$=()=>{h(new Set)},I=Ae(C.searchTerm),F=I.items,O=pt(I.loadMore,I.hasMore,I.isLoadingMore),H=new Set(S.filter(_=>_.app_name).map(_=>_.app_name)),g=C.search.length>0,w=e==="all"||g?F.filter(_=>{if(g){const j=we(_);if(j&&H.has(j))return!1}return!0}):[],R=e==="connected"||g?M:[],ee=async _=>{if(!(!o||!m?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),k(_.id);try{const j=ct(_,o.id,m.user.id,{remoteIndex:0}),E=j.connection_type==="STDIO",K=!!j.connection_url,B=E&&j.connection_headers&&typeof j.connection_headers=="object"&&"command"in j.connection_headers;if(!K&&!B){W.error(s("orgs.connections.cannotConnectNoMethod")),k(null);return}const oe=await a.create.mutateAsync(j),{id:ie}=oe,le=await Qt({connectionId:ie,orgId:o.id,orgSlug:o.slug,persistFallback:re=>a.update.mutateAsync({id:ie,data:{connection_token:re}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ie,flow:"connections_page_connect",error:le.error??"no_token"}),W.error(s("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ie,flow:"connections_page_connect"});const re=new URL(`/api/${o.slug}/mcp/${ie}`,window.location.origin);await c.invalidateQueries({queryKey:ot.isMCPAuthenticated(re.href,null)}),N(),W.success(s("orgs.connections.authenticationSuccessful"))}let me=null;try{const re=await c.fetchQuery(Et({connectionId:ie,orgId:o.id,orgSlug:o.slug}));me=cn((await re.listTools()).tools)}catch{}const ve=de(oe),be=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o.slug,appSlug:ve,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ve}}:null;W.success(s("orgs.connections.connectedSuccessfully"),be?{action:{label:s("orgs.connections.openConnection"),onClick:()=>r(be)}}:void 0)}catch(j){W.error(s("orgs.connections.failedToConnect",{error:j instanceof Error?j.message:String(j)}))}finally{k(null)}}},X=st(),N=()=>{c.invalidateQueries({predicate:_=>{const j=_.queryKey;return j[1]===o.id&&j[3]==="collection"&&j[4]==="CONNECTIONS"}})},z=async()=>{y(!1);const _=[...f];te("connections_bulk_delete",{count:_.length});const E=(await Promise.allSettled(_.map(K=>X.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;N(),W.success(s("orgs.connections.deletedConnections",{count:E})),$()},U=async(_,j)=>{try{await a.update.mutateAsync({id:_,data:{status:j}}),N(),W.success(s(j==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{W.error(s("orgs.connections.failedToUpdateConnection"))}},ge=async _=>{const j=[...f];te("connections_bulk_status_toggled",{count:j.length,to_status:_});const K=(await Promise.allSettled(j.map(B=>a.update.mutateAsync({id:B,data:{status:_}})))).filter(B=>B.status==="fulfilled").length;N(),W.success(_==="active"?s("orgs.connections.enabledConnections",{count:K}):s("orgs.connections.disabledConnections",{count:K})),$()},je=async _=>{const j=A.find(B=>B.id===_);if(!j)return;te("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const E=new Set(j.connections.map(B=>B.connection_id)),K=[...f].filter(B=>!E.has(B)).map(B=>({connection_id:B,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){W.info(s("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await X.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...j.connections,...K]}}),c.invalidateQueries({predicate:B=>{const oe=B.queryKey;return oe[1]===o.id&&oe[3]==="collection"&&oe[4]==="VIRTUAL_MCP"}}),W.success(s("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:j.title})),$()}catch{W.error(s("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(mt,{...u}),t.jsx(sn,{open:D,onOpenChange:y,count:f.size,onConfirm:z}),t.jsx(mn,{open:v,onOpenChange:i,agents:A,onConfirm:je}),I.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(g?w.length===0&&T.length===0:e==="all"?w.length===0:T.length===0)?t.jsx(ut,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:s("orgs.connections.noConnectionsFound"),description:C.search?s("orgs.connections.noConnectionsMatchSearch",{search:C.search}):s(l?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(_=>{if(_.type==="group")return t.jsx(an,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:_.key}})},selectionMode:x,selectedIds:f,onToggleSelect:P},_.key);const j=_.connection,E=f.has(j.id);return t.jsx(Ce,{connection:j,fallbackIcon:t.jsx(xe,{}),onClick:()=>x?P(j.id):r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),className:he(E&&"ring-2 ring-primary bg-primary/5"),selected:x?E:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(dn,{connection:j,isSelected:E,selectionMode:x,canManage:l,canManageAgents:p,onToggleSelect:()=>P(j.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),onToggleStatus:K=>U(j.id,K),onDelete:()=>u.requestDelete(j)})},j.id)}),w.map(_=>t.jsx(on,{item:_,canManage:l,allConnections:S,connectedAppNames:H,connectingItemId:b,onNavigateConnected:j=>r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),onConnect:ee},_.id)),(e==="all"||g)&&t.jsx("div",{ref:O,className:"col-span-full h-4"}),(e==="all"||g)&&I.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ue,{className:"size-6 text-muted-foreground"})})]})}),x&&t.jsx(gn,{count:f.size,total:T.length,canManage:l,canManageAgents:p,onSelectAll:()=>{h(new Set(T.map(_=>_.id)))},onDeselectAll:()=>h(new Set),onDelete:()=>y(!0),onAddToAgent:()=>i(!0),onToggleStatus:ge,onCancel:$})]})}function fn(){const C=qe(),e=ne(),{org:n}=Ne(),d=ke(),s=Qe({strict:!1}),{data:o}=Te.useSession(),{stdioEnabled:c}=Ye(),r=Ie(),{granted:m}=ye("connections:manage"),a=nn({namespace:n.slug,resource:"connections"}),S=Ve(),[u,l]=Je(Ze.connectionsTab(n.slug),g=>s.tab==="all"||s.tab==="connected"?s.tab:g??"all"),[p,f]=V.useState("ALL"),[h,x]=V.useState("ALL"),y=Ae(a.searchTerm).items,v=a.search!==a.searchTerm,i=et({resolver:tt(Wt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),b=i.watch("ui_type"),k=i.watch("connection_url"),A=i.watch("npx_package"),T=fe({uiType:b,connectionUrl:k??"",npxPackage:A??""})??De({uiType:b,connectionUrl:k??"",registryItems:y}),M=m&&s.action==="create",P=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),d({to:"/$org/settings/connections",params:{org:n.slug},search:{action:"create"}})},$=()=>{d({to:"/$org/settings/connections",params:{org:n.slug},search:{}})},I=async g=>{let w,R=null,ee=null,X=null;g.ui_type==="NPX"?(w="STDIO",R="",X=Gt(g.npx_package||"",g.env_vars||[])):g.ui_type==="STDIO"?(w="STDIO",R="",X=qt(g.stdio_command||"",g.stdio_args||"",g.stdio_cwd,g.env_vars||[])):(w=g.ui_type,R=g.connection_url||"",ee=g.connection_token||null);const N=it("conn");te("connection_custom_created",{connection_type:w,ui_type:g.ui_type}),await S.create.mutateAsync({id:N,title:g.title,description:g.description||null,connection_type:w,connection_url:R,connection_token:ee,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:n.id,icon:g.icon??null,app_name:null,app_id:null,connection_headers:X,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),$(),i.reset(),d({to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:de({app_name:null,connection_url:R,title:g.title,id:N})}})},F=g=>{g||(M&&$(),i.reset())},O=g=>{const w=g.trim();if(!w)return;const R=!!i.formState.dirtyFields.title,ee=!!i.formState.dirtyFields.description,X=!!i.formState.dirtyFields.env_vars,N=U=>{if(U&&(!R&&!i.getValues("title").trim()&&U.title&&i.setValue("title",U.title,{shouldDirty:!1}),!ee&&!(i.getValues("description")??"").trim()&&U.description&&i.setValue("description",U.description,{shouldDirty:!1}),!X&&U.envVarKeys?.length)){const ge=i.getValues("env_vars")??[],je=new Set(ge.map(j=>j.key)),_=U.envVarKeys.filter(j=>!je.has(j));_.length>0&&i.setValue("env_vars",[...ge,..._.map(j=>({key:j,value:""}))],{shouldDirty:!0})}},z=Xt(w);if(z&&c){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",z.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),N(fe({uiType:"NPX",npxPackage:z.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const U=b==="HTTP"||b==="SSE"||b==="Websocket"?b:"HTTP";i.setValue("ui_type",U,{shouldDirty:!0}),i.setValue("connection_url",w,{shouldDirty:!0}),N(fe({uiType:U,connectionUrl:w})??De({uiType:U,connectionUrl:w,registryItems:y}));return}b==="NPX"&&N(fe({uiType:"NPX",npxPackage:w}))},H=m?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{size:C?"sm":"default",variant:C?"default":"outline",onClick:P,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:e("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const g=e("orgs.connections.createConnection"),w=e("orgs.connections.createConnectionDescription"),R=i.formState.isSubmitting?e("orgs.connections.saving"):e("orgs.connections.createConnection"),ee=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:i.control,name:"ui_type",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.type")}),t.jsxs(Ot,{value:N.value,onValueChange:N.onChange,children:[t.jsx(J,{children:t.jsx(Ft,{children:t.jsx(Ut,{})})}),t.jsxs(Vt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),c&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),e("orgs.connections.npxPackage")]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),e("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),b==="NPX"&&t.jsx(q,{control:i.control,name:"npx_package",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.npmPackage")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.npmPackagePlaceholder"),...N,value:N.value??"",onPaste:z=>{const U=z.clipboardData.getData("text");U&&(z.preventDefault(),i.setValue("npx_package",U.trim(),{shouldDirty:!0}),O(U))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Z,{})]})}),b==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(q,{control:i.control,name:"stdio_command",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.command")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.commandPlaceholder"),...N,value:N.value??""})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"stdio_args",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.arguments")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.argumentsPlaceholder"),...N,value:N.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:i.control,name:"stdio_cwd",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.workingDirectory")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.workingDirectoryPlaceholder"),...N,value:N.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(b==="NPX"||b==="STDIO")&&t.jsx(q,{control:i.control,name:"env_vars",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.environmentVariables")}),t.jsx(J,{children:t.jsx(Rt,{value:N.value??[],onChange:N.onChange})}),t.jsx(Z,{})]})}),b!=="NPX"&&b!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:i.control,name:"connection_url",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.url")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.urlPlaceholder"),...N,value:N.value??"",onPaste:z=>{const U=z.clipboardData.getData("text");U&&(z.preventDefault(),i.setValue("connection_url",U.trim(),{shouldDirty:!0}),O(U))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"connection_token",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:T?.token?.label??e("orgs.connections.tokenOptional")}),t.jsx(J,{children:t.jsx(se,{type:"password",placeholder:T?.token?.placeholder??e("orgs.connections.tokenPlaceholder"),...N,value:N.value??""})}),T?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.token.helperText,T.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:e("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:i.control,name:"title",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.name")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.namePlaceholder"),...N})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"description",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.description")}),t.jsx(J,{children:t.jsx(Lt,{placeholder:e("orgs.connections.descriptionPlaceholder"),rows:3,...N,value:N.value??""})}),t.jsx(Z,{})]})})]}),X=M;return r?t.jsx(Tt,{open:X,onOpenChange:F,children:t.jsxs(wt,{className:"max-h-[90vh]",children:[t.jsx(At,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(It,{children:g}),t.jsx(Pt,{className:"mt-1",children:w})]}),t.jsx(Mt,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":e("orgs.connections.close"),children:t.jsx(ze,{size:16})})})]})}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(I),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:ee}),t.jsx($t,{children:t.jsx(L,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:R})})]})})]})}):t.jsx(Ue,{open:X,onOpenChange:F,children:t.jsxs(Fe,{className:"sm:max-w-[525px]",children:[t.jsxs($e,{children:[t.jsx(Pe,{children:g}),t.jsx(Me,{children:w})]}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(I),children:[t.jsx("div",{className:"py-4",children:ee}),t.jsxs(Oe,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>F(!1),children:e("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:R})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{actions:C&&H,children:e("orgs.connections.pageTitle")}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(rt,{value:a.search,onChange:a.setSearch,placeholder:e("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:g=>{g.key==="Escape"&&(a.setSearch(""),g.target.blur())}}),t.jsx(lt,{sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:e("orgs.connections.sortName")},{id:"description",label:e("orgs.connections.sortDescription")},{id:"connection_type",label:e("orgs.connections.sortType")},{id:"updated_by",label:e("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:e("orgs.connections.sortUpdated")}],filters:[{label:e("orgs.connections.filterType"),value:p,onChange:g=>f(g||"ALL"),options:[{id:"ALL",label:e("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:e("orgs.connections.filterStatus"),value:h,onChange:g=>x(g||"ALL"),options:[{id:"ALL",label:e("orgs.connections.filterAll")},{id:"active",label:e("orgs.connections.filterActive")},{id:"inactive",label:e("orgs.connections.filterInactive")},{id:"error",label:e("orgs.connections.filterError")}]}]})]}),!C&&H]}),t.jsx(at,{placement:"page",tabs:[{id:"all",label:e("orgs.connections.tabAll")},{id:"connected",label:e("orgs.connections.tabConnected")}],activeTab:u,onTabChange:g=>{const w=g;w!==u&&te("connections_page_tab_changed",{to_tab:w}),l(w)}}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:v?.5:1,transition:v?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:v?"none":"auto"},children:t.jsx(pn,{listState:a,activeTab:u,typeFilter:p,statusFilter:h})})})]})})})]})})}function $s(){const C=G.c(1);let e;return C[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx(fn,{})})}),C[0]=e):e=C[0],e}export{$s as default};
|
|
1
|
+
import{r as V,c as G,b as ne,j as t,B as L,h as ue,l as he,G as ce,F as Re,I as We,H as Xe,E as Ge,U as qe,Y as Ne,d as ke,u as Qe,a as Te,R as Ye,ad as ye,V as Je,X as Ze,an as et,am as tt,n as pe,q as te,o as nt,a4 as st,t as W,K as ot}from"./index-B-RfjkQs.js";import{a as we,g as it,e as ct}from"./extract-connection-data-BN6Gn7S7.js";import{C as lt}from"./collection-display-button-B4JQi_wC.js";import{S as rt}from"./search-input-5SNth6iW.js";import{C as at}from"./collection-tabs-VZH79ort.js";import{C as Ce,u as Ae,g as dt}from"./connection-card-lUin0zXZ.js";import{E as ut}from"./empty-state-DuOhKQcg.js";import{u as gt,D as mt}from"./use-delete-connection-XgJ1tVSe.js";import{u as pt}from"./use-infinite-scroll-BAK1V_oQ.js";import{u as Ie}from"./use-mobile-BA2OXMES.js";import{g as de}from"./connection-slug-CITJ0kGN.js";import{A as ft,a as ht,b as xt,c as jt,g as St,d as yt,e as Ct,f as vt}from"./alert-dialog-p_yxBHYu.js";import{as as xe,br as bt,at as _t,be as Dt,l as Se}from"./agent-icon-B4H17A-3.js";import{g as Nt,a as kt}from"./metadata-D72DunRR.js";import{d as Pe,h as Me,c as $e,e as Oe,b as Fe,D as Ue}from"./dialog-fTIcTyHb.js";import{D as Tt,a as wt,d as At,b as It,e as Pt,f as Mt,g as $t}from"./drawer-Dj7i5SNu.js";import{F as q,b as Q,c as Y,d as J,f as Z,a as _e}from"./form-msoIoPH9.js";import{I as se}from"./input-DgwTyBrI.js";import{S as Ot,b as Ft,a as Ut,d as Vt,c as ae}from"./select-lkzYgXdD.js";import{T as Lt}from"./textarea-BJstaU_4.js";import{b as Ve,u as zt}from"./use-connection-B5_J2wP6.js";import{m as Et}from"./use-mcp-client-6HSoOGyN.js";import{b as Bt}from"./use-virtual-mcp-CbHEuH0C.js";import{g as Kt}from"./types-BcA15it5.js";import{s as Le}from"./Plus-BeOCeSsu.js";import{b as Ht}from"./UserSquare-D1SexGLq.js";import{s as ze}from"./XClose-CKQjrGZS.js";import{i as fe,a as De,E as Rt,c as Wt,p as Xt,b as Gt,d as qt}from"./connection-form-helpers-DiXUvzY1.js";import{a as Qt}from"./authenticate-and-persist-oauth-BS0KLtdr.js";import{I as Yt}from"./integration-icon-DuRUAYQY.js";import{C as Ee}from"./checkbox-RuVP2KAD.js";import{i as Jt}from"./DotsVertical-CsphgVVa.js";import{s as Be}from"./Eye-BaKrr1k0.js";import{s as Ke}from"./Trash01-yjy5Djos.js";import"./connection-C1Cmv_sz.js";import"./ArrowUp-i7W4PLl8.js";import"./Check-Cxn5ODoZ.js";import"./tooltip-1YZ9_LEc.js";import"./index-DNOKSPYL.js";import"./view-mode-toggle-CJHrx4Q2.js";import"./badge-DO3CQ_LV.js";import"./SearchMd-CmoIwdFD.js";import"./useInfiniteQuery-CEwPAAtp.js";import"./infiniteQueryObserver-CFFZE0G7.js";import"./slugify-CEUa2lfQ.js";import"./AlertCircle-CiIF9Yxb.js";import"./Tool01-CFPgtTUB.js";import"./ArrowLeft-Cw8zoASu.js";import"./ArrowRight-DXuJxv6z.js";import"./ZoomOut-BCbY44Eu.js";import"./Globe04-BjYimuB_.js";import"./CheckCircle-Cb0ohXc_.js";import"./ChevronUp-B3Rmv2Rm.js";import"./Copy01-CDFMtB2-.js";import"./CreditCard01-Bpp7DUE2.js";import"./Share07-BQpOEypi.js";import"./Image01-BokX_Ygh.js";import"./Key01--iK_92aj.js";import"./LayoutLeft-DbmxTpPW.js";import"./Link01-CwRVjiFm.js";import"./LinkExternal01-C1LIoQUC.js";import"./Monitor01-B-jx6SlO.js";import"./Sun-BwQeSpzv.js";import"./Palette-BZ8zPcQQ.js";import"./Upload01-C3YaZ92x.js";import"./User01-CxY9-OxA.js";import"./Users01-C234jzz1.js";import"./X-C49OUFcX.js";import"./Zap-GTFewWZO.js";import"./label-COhaglCI.js";import"./auth-DN1jUXQS.js";import"./mcp-oauth-CYUMx6Lt.js";function Zt(C){const e=`deco-filters-${C}`,[n,d]=V.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{d(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(c){console.error("Failed to save filters:",c)}}]}function en(C){const e=G.c(7),[n,d]=V.useState(C),[s,o]=V.useState(C?"desc":null);let c;e[0]!==s||e[1]!==n?(c=a=>{n!==a?(d(a),o("asc")):s==="asc"?o("desc"):s==="desc"&&(d(void 0),o(null))},e[0]=s,e[1]=n,e[2]=c):c=e[2];const r=c;let m;return e[3]!==r||e[4]!==s||e[5]!==n?(m={sortKey:n,sortDirection:s,handleSort:r},e[3]=r,e[4]=s,e[5]=n,e[6]=m):m=e[6],m}function tn(C,e){const n=G.c(12),d=e===void 0?"cards":e,s=Ie(),o=V.useRef(s),c=C?`deco-view-mode-${C}`:"deco-view-mode";let r;n[0]!==d||n[1]!==c?(r=()=>{const h=globalThis.localStorage?.getItem(c);return h==="cards"||h==="table"?h:d},n[0]=d,n[1]=c,n[2]=r):r=n[2];const[m,a]=V.useState(r);let S;n[3]!==c?(S=h=>{a(h),globalThis.localStorage?.setItem(c,h)},n[3]=c,n[4]=S):S=n[4];const u=S;let l,p;n[5]!==s||n[6]!==m?(l=()=>{!o.current&&s&&m==="table"&&a("cards"),o.current=s},p=[s,m],n[5]=s,n[6]=m,n[7]=l,n[8]=p):(l=n[7],p=n[8]),V.useEffect(l,p);let f;return n[9]!==u||n[10]!==m?(f=[m,u],n[9]=u,n[10]=m,n[11]=f):f=n[11],f}function nn(C){const e=G.c(20),{namespace:n,resource:d,defaultSortKey:s,defaultViewMode:o}=C,c=s===void 0?"title":s,r=o===void 0?"table":o,[m,a]=V.useState(""),S=V.useDeferredValue(m),u=`${n}-${d}`,[l,p]=Zt(u),f=`studio-${d}-filter-visible-${n}`;let h;e[0]!==f?(h=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=h):h=e[1];const[x,D]=V.useState(h);let y;e[2]!==f?(y=F=>{D(F),globalThis.localStorage?.setItem(f,String(F))},e[2]=f,e[3]=y):y=e[3];const v=y;let i;e[4]!==x||e[5]!==v?(i=()=>{v(!x)},e[4]=x,e[5]=v,e[6]=i):i=e[6];const b=i,[k,A]=tn(`studio-${d}-${n}`,r),{sortKey:T,sortDirection:M,handleSort:P}=en(c),$=T;let I;return e[7]!==x||e[8]!==l||e[9]!==P||e[10]!==m||e[11]!==S||e[12]!==v||e[13]!==p||e[14]!==A||e[15]!==M||e[16]!==$||e[17]!==b||e[18]!==k?(I={search:m,searchTerm:S,setSearch:a,filters:l,setFilters:p,filterBarVisible:x,setFilterBarVisible:v,toggleFilterBar:b,viewMode:k,setViewMode:A,sortKey:$,sortDirection:M,handleSort:P},e[7]=x,e[8]=l,e[9]=P,e[10]=m,e[11]=S,e[12]=v,e[13]=p,e[14]=A,e[15]=M,e[16]=$,e[17]=b,e[18]=k,e[19]=I):I=e[19],I}function sn(C){const e=G.c(35),{open:n,onOpenChange:d,count:s,onConfirm:o}=C,c=ne(),r=s===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let m;e[0]!==s||e[1]!==c||e[2]!==r?(m=c(r,{count:s}),e[0]=s,e[1]=c,e[2]=r,e[3]=m):m=e[3];let a;e[4]!==m?(a=t.jsx(ft,{children:m}),e[4]=m,e[5]=a):a=e[5];const S=s===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==c||e[7]!==S?(u=c(S),e[6]=c,e[7]=S,e[8]=u):u=e[8];let l;e[9]!==u?(l=t.jsx(ht,{children:u}),e[9]=u,e[10]=l):l=e[10];let p;e[11]!==a||e[12]!==l?(p=t.jsxs(xt,{children:[a,l]}),e[11]=a,e[12]=l,e[13]=p):p=e[13];let f;e[14]!==c?(f=c("orgs.bulkDeleteDialog.cancelButton"),e[14]=c,e[15]=f):f=e[15];let h;e[16]!==f?(h=t.jsx(jt,{children:f}),e[16]=f,e[17]=h):h=e[17];const x=s===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let D;e[18]!==s||e[19]!==c||e[20]!==x?(D=c(x,{count:s}),e[18]=s,e[19]=c,e[20]=x,e[21]=D):D=e[21];let y;e[22]!==o||e[23]!==D?(y=t.jsx(St,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:D}),e[22]=o,e[23]=D,e[24]=y):y=e[24];let v;e[25]!==y||e[26]!==h?(v=t.jsxs(yt,{children:[h,y]}),e[25]=y,e[26]=h,e[27]=v):v=e[27];let i;e[28]!==v||e[29]!==p?(i=t.jsxs(Ct,{children:[p,v]}),e[28]=v,e[29]=p,e[30]=i):i=e[30];let b;return e[31]!==d||e[32]!==n||e[33]!==i?(b=t.jsx(vt,{open:n,onOpenChange:d,children:i}),e[31]=d,e[32]=n,e[33]=i,e[34]=b):b=e[34],b}function on(C){const e=G.c(39),{item:n,canManage:d,allConnections:s,connectedAppNames:o,connectingItemId:c,onNavigateConnected:r,onConnect:m}=C,a=ne();let S,u;e[0]!==o||e[1]!==n?(S=we(n)??"",u=o.has(S),e[0]=o,e[1]=n,e[2]=S,e[3]=u):(S=e[2],u=e[3]);const l=u;let p;e[4]!==n._meta?(p=Nt(n._meta),e[4]=n._meta,e[5]=p):p=e[5];const f=p,h=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",x=n.server?.description||n.description||null;let D;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(D=n.server?.icons?.[0]?.src||kt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=D):D=e[8];const y=D;let v;if(e[9]!==s||e[10]!==S){let O;e[12]!==S?(O=H=>H.connection_type!=="VIRTUAL"&&H.app_name===S,e[12]=S,e[13]=O):O=e[13],v=s.filter(O),e[9]=s,e[10]=S,e[11]=v}else v=e[11];const i=v,b=l||d;let k,A;e[14]!==i||e[15]!==l||e[16]!==n||e[17]!==m||e[18]!==r?(k=()=>{if(l){const O=i[0];O&&r(O);return}A()},A=()=>m(n),e[14]=i,e[15]=l,e[16]=n,e[17]=m,e[18]=r,e[19]=k,e[20]=A):(k=e[19],A=e[20]);let T;e[21]!==x||e[22]!==y||e[23]!==h?(T={title:h,description:x,icon:y},e[21]=x,e[22]=y,e[23]=h,e[24]=T):T=e[24];let M;e[25]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(xe,{}),e[25]=M):M=e[25];const P=b?k:void 0;let $;e[26]!==d||e[27]!==c||e[28]!==A||e[29]!==l||e[30]!==n.id||e[31]!==a?($=l?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.catalogItemCard.connected")}):d&&t.jsx(L,{variant:"outline",size:"sm",className:"h-7 px-3 classic:rounded-lg text-sm font-medium",disabled:c!==null,onClick:O=>{O.stopPropagation(),A()},children:c===n.id?t.jsx(ue,{className:"size-3.5"}):a("orgs.catalogItemCard.connect")}),e[26]=d,e[27]=c,e[28]=A,e[29]=l,e[30]=n.id,e[31]=a,e[32]=$):$=e[32];let I;e[33]!==$?(I=t.jsx("div",{className:"flex items-center gap-2",children:$}),e[33]=$,e[34]=I):I=e[34];let F;return e[35]!==T||e[36]!==P||e[37]!==I?(F=t.jsx(Ce,{connection:T,fallbackIcon:M,onClick:P,headerActionsAlwaysVisible:!0,headerActions:I}),e[35]=T,e[36]=P,e[37]=I,e[38]=F):F=e[38],F}function cn(C){return C?.length?{appToolName:C.find(n=>!!Kt(n._meta))?.name??null}:null}function He(C){const e=G.c(8),{selectionMode:n,children:d}=C,s=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let o;e[0]!==s?(o=he("overflow-hidden transition-all duration-150 ease-out",s),e[0]=s,e[1]=o):o=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Re,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:rn,children:t.jsx(Jt,{size:20})})}),e[2]=c):c=e[2];let r;e[3]!==d?(r=t.jsxs(We,{children:[c,t.jsx(Xe,{align:"end",onClick:ln,children:d})]}),e[3]=d,e[4]=r):r=e[4];let m;return e[5]!==o||e[6]!==r?(m=t.jsx("div",{className:o,children:r}),e[5]=o,e[6]=r,e[7]=m):m=e[7],m}function ln(C){return C.stopPropagation()}function rn(C){return C.stopPropagation()}function an(C){const e=G.c(57),{group:n,onOpen:d,selectionMode:s,selectedIds:o,onToggleSelect:c}=C,r=ne();let m;if(e[0]!==n.connections||e[1]!==o){let g;e[3]!==o?(g=w=>o.has(w.id),e[3]=o,e[4]=g):g=e[4],m=n.connections.every(g),e[0]=n.connections,e[1]=o,e[2]=m}else m=e[2];const a=m;let S;if(e[5]!==n.connections||e[6]!==o){let g;e[8]!==o?(g=w=>o.has(w.id),e[8]=o,e[9]=g):g=e[9],S=n.connections.some(g),e[5]=n.connections,e[6]=o,e[7]=S}else S=e[7];const u=S;let l;e[10]!==a||e[11]!==n.connections||e[12]!==c||e[13]!==o?(l=()=>{for(const g of n.connections)a?o.has(g.id)&&c(g.id):o.has(g.id)||c(g.id)},e[10]=a,e[11]=n.connections,e[12]=c,e[13]=o,e[14]=l):l=e[14];const p=l,f=n.title,h=n.icon;let x;e[15]!==n.connections.length||e[16]!==r?(x=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=x):x=e[17];let D;e[18]!==n.icon||e[19]!==n.title||e[20]!==x?(D={title:f,icon:h,description:x},e[18]=n.icon,e[19]=n.title,e[20]=x,e[21]=D):D=e[21];let y;e[22]!==d||e[23]!==s||e[24]!==p?(y=()=>s?p():d(),e[22]=d,e[23]=s,e[24]=p,e[25]=y):y=e[25];const v=s&&a&&"ring-2 ring-primary",i=s&&u&&!a&&"ring-1 ring-primary/50";let b;e[26]!==i||e[27]!==v?(b=he(v,i),e[26]=i,e[27]=v,e[28]=b):b=e[28];const k=s?a?!0:u&&"mixed":void 0;let A;e[29]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(xe,{}),e[29]=A):A=e[29];let T;e[30]!==a||e[31]!==n.connections.length||e[32]!==s||e[33]!==u||e[34]!==r||e[35]!==p?(T=s?t.jsx(Ee,{checked:a?!0:u?"indeterminate":!1,onCheckedChange:p}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:r("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=a,e[31]=n.connections.length,e[32]=s,e[33]=u,e[34]=r,e[35]=p,e[36]=T):T=e[36];let M;e[37]!==d?(M=g=>{g.stopPropagation(),d()},e[37]=d,e[38]=M):M=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Be,{size:16}),e[39]=P):P=e[39];let $;e[40]!==r?($=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=$):$=e[41];let I;e[42]!==M||e[43]!==$?(I=t.jsxs(ce,{onClick:M,children:[P,$]}),e[42]=M,e[43]=$,e[44]=I):I=e[44];let F;e[45]!==s||e[46]!==I?(F=t.jsx(He,{selectionMode:s,children:I}),e[45]=s,e[46]=I,e[47]=F):F=e[47];let O;e[48]!==T||e[49]!==F?(O=t.jsxs("div",{className:"flex items-center gap-1",children:[T,F]}),e[48]=T,e[49]=F,e[50]=O):O=e[50];let H;return e[51]!==b||e[52]!==k||e[53]!==O||e[54]!==D||e[55]!==y?(H=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:D,onClick:y,className:b,selected:k,fallbackIcon:A,headerActionsAlwaysVisible:!0,headerActions:O})}),e[51]=b,e[52]=k,e[53]=O,e[54]=D,e[55]=y,e[56]=H):H=e[56],H}function dn(C){const e=G.c(36),{connection:n,isSelected:d,selectionMode:s,canManage:o,canManageAgents:c,onToggleSelect:r,onOpen:m,onToggleStatus:a,onDelete:S}=C,u=ne();let l;e[0]!==d||e[1]!==r||e[2]!==s||e[3]!==u?(l=s?t.jsx(Ee,{checked:d,onCheckedChange:r,onClick:un}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=d,e[1]=r,e[2]=s,e[3]=u,e[4]=l):l=e[4];let p;e[5]!==m?(p=k=>{k.stopPropagation(),m()},e[5]=m,e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Be,{size:16}),e[7]=f):f=e[7];let h;e[8]!==u?(h=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=h):h=e[9];let x;e[10]!==p||e[11]!==h?(x=t.jsxs(ce,{onClick:p,children:[f,h]}),e[10]=p,e[11]=h,e[12]=x):x=e[12];let D;e[13]!==o||e[14]!==c||e[15]!==r||e[16]!==u?(D=(o||c)&&t.jsxs(ce,{onClick:k=>{k.stopPropagation(),r()},children:[t.jsx(bt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=o,e[14]=c,e[15]=r,e[16]=u,e[17]=D):D=e[17];let y;e[18]!==o||e[19]!==n||e[20]!==a||e[21]!==u?(y=o&&(n.status==="active"?t.jsxs(ce,{onClick:k=>{k.stopPropagation(),a("inactive")},children:[t.jsx(_t,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:k=>{k.stopPropagation(),a("active")},children:[t.jsx(Dt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=o,e[19]=n,e[20]=a,e[21]=u,e[22]=y):y=e[22];let v;e[23]!==o||e[24]!==S||e[25]!==u?(v=o&&t.jsxs(ce,{variant:"destructive",onClick:k=>{k.stopPropagation(),S()},children:[t.jsx(Ke,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=o,e[24]=S,e[25]=u,e[26]=v):v=e[26];let i;e[27]!==s||e[28]!==x||e[29]!==D||e[30]!==y||e[31]!==v?(i=t.jsxs(He,{selectionMode:s,children:[x,D,y,v]}),e[27]=s,e[28]=x,e[29]=D,e[30]=y,e[31]=v,e[32]=i):i=e[32];let b;return e[33]!==l||e[34]!==i?(b=t.jsxs("div",{className:"flex items-center gap-1",children:[l,i]}),e[33]=l,e[34]=i,e[35]=b):b=e[35],b}function un(C){return C.stopPropagation()}function gn(C){const e=G.c(29),{count:n,total:d,canManage:s,canManageAgents:o,onSelectAll:c,onDeselectAll:r,onDelete:m,onAddToAgent:a,onToggleStatus:S,onCancel:u}=C,l=ne();if(n===0)return null;let p;e[0]!==n||e[1]!==l?(p=l("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=l,e[2]=p):p=e[2];let f;e[3]!==p?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:p}),e[3]=p,e[4]=f):f=e[4];let h;e[5]!==n||e[6]!==r||e[7]!==c||e[8]!==l||e[9]!==d?(h=n<d?t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:l("orgs.connectionSelectionUi.selectAll",{total:d})}):t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:l("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=c,e[8]=l,e[9]=d,e[10]=h):h=e[10];let x;e[11]!==o||e[12]!==a||e[13]!==l?(x=o&&t.jsxs(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:[t.jsx(Le,{size:13}),l("orgs.connectionSelectionUi.addToAgent")]}),e[11]=o,e[12]=a,e[13]=l,e[14]=x):x=e[14];let D;e[15]!==s||e[16]!==m||e[17]!==S||e[18]!==l?(D=s&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>S("active"),children:l("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>S("inactive"),children:l("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:[t.jsx(Ke,{size:13}),l("orgs.connectionSelectionUi.delete")]})]}),e[15]=s,e[16]=m,e[17]=S,e[18]=l,e[19]=D):D=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ze,{size:13}),e[20]=y):y=e[20];let v;e[21]!==u?(v=t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:y}),e[21]=u,e[22]=v):v=e[22];let i;return e[23]!==f||e[24]!==h||e[25]!==x||e[26]!==D||e[27]!==v?(i=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[f,h,x,D,v]})}),e[23]=f,e[24]=h,e[25]=x,e[26]=D,e[27]=v,e[28]=i):i=e[28],i}function mn(C){const e=G.c(45),{open:n,onOpenChange:d,agents:s,onConfirm:o}=C,c=ne(),[r,m]=V.useState(null);let a;e[0]!==c?(a=c("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=c,e[1]=a):a=e[1];let S;e[2]!==a?(S=t.jsx(Pe,{children:a}),e[2]=a,e[3]=S):S=e[3];let u;e[4]!==c?(u=c("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=c,e[5]=u):u=e[5];let l;e[6]!==u?(l=t.jsx(Me,{children:u}),e[6]=u,e[7]=l):l=e[7];let p;e[8]!==S||e[9]!==l?(p=t.jsxs($e,{children:[S,l]}),e[8]=S,e[9]=l,e[10]=p):p=e[10];let f;e[11]!==s||e[12]!==r||e[13]!==c?(f=s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:c("orgs.connectionSelectionUi.noAgentsFound")}):s.map(P=>t.jsxs("button",{type:"button",onClick:()=>m(P.id),className:he("flex items-center gap-3 w-full classic:rounded-md compact:rounded-lg px-3 py-2 text-left transition-colors",r===P.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Yt,{icon:P.icon,name:P.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:P.title}),P.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:P.description})]})]},P.id)),e[11]=s,e[12]=r,e[13]=c,e[14]=f):f=e[14];let h;e[15]!==f?(h=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:f}),e[15]=f,e[16]=h):h=e[16];let x;e[17]!==d?(x=()=>d(!1),e[17]=d,e[18]=x):x=e[18];let D;e[19]!==c?(D=c("orgs.connectionSelectionUi.cancel"),e[19]=c,e[20]=D):D=e[20];let y;e[21]!==x||e[22]!==D?(y=t.jsx(L,{variant:"outline",onClick:x,children:D}),e[21]=x,e[22]=D,e[23]=y):y=e[23];const v=!r;let i;e[24]!==o||e[25]!==d||e[26]!==r?(i=()=>{r&&(o(r),d(!1),m(null))},e[24]=o,e[25]=d,e[26]=r,e[27]=i):i=e[27];let b;e[28]!==c?(b=c("orgs.connectionSelectionUi.add"),e[28]=c,e[29]=b):b=e[29];let k;e[30]!==v||e[31]!==i||e[32]!==b?(k=t.jsx(L,{disabled:v,onClick:i,children:b}),e[30]=v,e[31]=i,e[32]=b,e[33]=k):k=e[33];let A;e[34]!==y||e[35]!==k?(A=t.jsxs(Oe,{children:[y,k]}),e[34]=y,e[35]=k,e[36]=A):A=e[36];let T;e[37]!==A||e[38]!==p||e[39]!==h?(T=t.jsxs(Fe,{className:"sm:max-w-[400px]",children:[p,h,A]}),e[37]=A,e[38]=p,e[39]=h,e[40]=T):T=e[40];let M;return e[41]!==d||e[42]!==n||e[43]!==T?(M=t.jsx(Ue,{open:n,onOpenChange:d,children:T}),e[41]=d,e[42]=n,e[43]=T,e[44]=M):M=e[44],M}function pn({listState:C,activeTab:e,typeFilter:n,statusFilter:d}){const s=ne(),{org:o}=Ne(),c=nt(),r=ke(),{data:m}=Te.useSession(),a=Ve(),S=zt(C),u=gt(),{granted:l}=ye("connections:manage"),{granted:p}=ye("agents:manage"),[f,h]=V.useState(new Set),x=f.size>0,[D,y]=V.useState(!1),[v,i]=V.useState(!1),[b,k]=V.useState(null),A=Bt(),T=S.filter(_=>!(n!=="ALL"&&_.connection_type!==n||d!=="ALL"&&_.status!==d)),M=dt(T),P=_=>{h(j=>{const E=new Set(j);return E.has(_)?E.delete(_):E.add(_),E})},$=()=>{h(new Set)},I=Ae(C.searchTerm),F=I.items,O=pt(I.loadMore,I.hasMore,I.isLoadingMore),H=new Set(S.filter(_=>_.app_name).map(_=>_.app_name)),g=C.search.length>0,w=e==="all"||g?F.filter(_=>{if(g){const j=we(_);if(j&&H.has(j))return!1}return!0}):[],R=e==="connected"||g?M:[],ee=async _=>{if(!(!o||!m?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),k(_.id);try{const j=ct(_,o.id,m.user.id,{remoteIndex:0}),E=j.connection_type==="STDIO",K=!!j.connection_url,B=E&&j.connection_headers&&typeof j.connection_headers=="object"&&"command"in j.connection_headers;if(!K&&!B){W.error(s("orgs.connections.cannotConnectNoMethod")),k(null);return}const oe=await a.create.mutateAsync(j),{id:ie}=oe,le=await Qt({connectionId:ie,orgId:o.id,orgSlug:o.slug,persistFallback:re=>a.update.mutateAsync({id:ie,data:{connection_token:re}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ie,flow:"connections_page_connect",error:le.error??"no_token"}),W.error(s("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ie,flow:"connections_page_connect"});const re=new URL(`/api/${o.slug}/mcp/${ie}`,window.location.origin);await c.invalidateQueries({queryKey:ot.isMCPAuthenticated(re.href,null)}),N(),W.success(s("orgs.connections.authenticationSuccessful"))}let me=null;try{const re=await c.fetchQuery(Et({connectionId:ie,orgId:o.id,orgSlug:o.slug}));me=cn((await re.listTools()).tools)}catch{}const ve=de(oe),be=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o.slug,appSlug:ve,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ve}}:null;W.success(s("orgs.connections.connectedSuccessfully"),be?{action:{label:s("orgs.connections.openConnection"),onClick:()=>r(be)}}:void 0)}catch(j){W.error(s("orgs.connections.failedToConnect",{error:j instanceof Error?j.message:String(j)}))}finally{k(null)}}},X=st(),N=()=>{c.invalidateQueries({predicate:_=>{const j=_.queryKey;return j[1]===o.id&&j[3]==="collection"&&j[4]==="CONNECTIONS"}})},z=async()=>{y(!1);const _=[...f];te("connections_bulk_delete",{count:_.length});const E=(await Promise.allSettled(_.map(K=>X.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;N(),W.success(s("orgs.connections.deletedConnections",{count:E})),$()},U=async(_,j)=>{try{await a.update.mutateAsync({id:_,data:{status:j}}),N(),W.success(s(j==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{W.error(s("orgs.connections.failedToUpdateConnection"))}},ge=async _=>{const j=[...f];te("connections_bulk_status_toggled",{count:j.length,to_status:_});const K=(await Promise.allSettled(j.map(B=>a.update.mutateAsync({id:B,data:{status:_}})))).filter(B=>B.status==="fulfilled").length;N(),W.success(_==="active"?s("orgs.connections.enabledConnections",{count:K}):s("orgs.connections.disabledConnections",{count:K})),$()},je=async _=>{const j=A.find(B=>B.id===_);if(!j)return;te("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const E=new Set(j.connections.map(B=>B.connection_id)),K=[...f].filter(B=>!E.has(B)).map(B=>({connection_id:B,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){W.info(s("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await X.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...j.connections,...K]}}),c.invalidateQueries({predicate:B=>{const oe=B.queryKey;return oe[1]===o.id&&oe[3]==="collection"&&oe[4]==="VIRTUAL_MCP"}}),W.success(s("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:j.title})),$()}catch{W.error(s("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(mt,{...u}),t.jsx(sn,{open:D,onOpenChange:y,count:f.size,onConfirm:z}),t.jsx(mn,{open:v,onOpenChange:i,agents:A,onConfirm:je}),I.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(g?w.length===0&&T.length===0:e==="all"?w.length===0:T.length===0)?t.jsx(ut,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:s("orgs.connections.noConnectionsFound"),description:C.search?s("orgs.connections.noConnectionsMatchSearch",{search:C.search}):s(l?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(_=>{if(_.type==="group")return t.jsx(an,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:_.key}})},selectionMode:x,selectedIds:f,onToggleSelect:P},_.key);const j=_.connection,E=f.has(j.id);return t.jsx(Ce,{connection:j,fallbackIcon:t.jsx(xe,{}),onClick:()=>x?P(j.id):r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),className:he(E&&"ring-2 ring-primary bg-primary/5"),selected:x?E:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(dn,{connection:j,isSelected:E,selectionMode:x,canManage:l,canManageAgents:p,onToggleSelect:()=>P(j.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),onToggleStatus:K=>U(j.id,K),onDelete:()=>u.requestDelete(j)})},j.id)}),w.map(_=>t.jsx(on,{item:_,canManage:l,allConnections:S,connectedAppNames:H,connectingItemId:b,onNavigateConnected:j=>r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),onConnect:ee},_.id)),(e==="all"||g)&&t.jsx("div",{ref:O,className:"col-span-full h-4"}),(e==="all"||g)&&I.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ue,{className:"size-6 text-muted-foreground"})})]})}),x&&t.jsx(gn,{count:f.size,total:T.length,canManage:l,canManageAgents:p,onSelectAll:()=>{h(new Set(T.map(_=>_.id)))},onDeselectAll:()=>h(new Set),onDelete:()=>y(!0),onAddToAgent:()=>i(!0),onToggleStatus:ge,onCancel:$})]})}function fn(){const C=qe(),e=ne(),{org:n}=Ne(),d=ke(),s=Qe({strict:!1}),{data:o}=Te.useSession(),{stdioEnabled:c}=Ye(),r=Ie(),{granted:m}=ye("connections:manage"),a=nn({namespace:n.slug,resource:"connections"}),S=Ve(),[u,l]=Je(Ze.connectionsTab(n.slug),g=>s.tab==="all"||s.tab==="connected"?s.tab:g??"all"),[p,f]=V.useState("ALL"),[h,x]=V.useState("ALL"),y=Ae(a.searchTerm).items,v=a.search!==a.searchTerm,i=et({resolver:tt(Wt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),b=i.watch("ui_type"),k=i.watch("connection_url"),A=i.watch("npx_package"),T=fe({uiType:b,connectionUrl:k??"",npxPackage:A??""})??De({uiType:b,connectionUrl:k??"",registryItems:y}),M=m&&s.action==="create",P=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),d({to:"/$org/settings/connections",params:{org:n.slug},search:{action:"create"}})},$=()=>{d({to:"/$org/settings/connections",params:{org:n.slug},search:{}})},I=async g=>{let w,R=null,ee=null,X=null;g.ui_type==="NPX"?(w="STDIO",R="",X=Gt(g.npx_package||"",g.env_vars||[])):g.ui_type==="STDIO"?(w="STDIO",R="",X=qt(g.stdio_command||"",g.stdio_args||"",g.stdio_cwd,g.env_vars||[])):(w=g.ui_type,R=g.connection_url||"",ee=g.connection_token||null);const N=it("conn");te("connection_custom_created",{connection_type:w,ui_type:g.ui_type}),await S.create.mutateAsync({id:N,title:g.title,description:g.description||null,connection_type:w,connection_url:R,connection_token:ee,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:n.id,icon:g.icon??null,app_name:null,app_id:null,connection_headers:X,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),$(),i.reset(),d({to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:de({app_name:null,connection_url:R,title:g.title,id:N})}})},F=g=>{g||(M&&$(),i.reset())},O=g=>{const w=g.trim();if(!w)return;const R=!!i.formState.dirtyFields.title,ee=!!i.formState.dirtyFields.description,X=!!i.formState.dirtyFields.env_vars,N=U=>{if(U&&(!R&&!i.getValues("title").trim()&&U.title&&i.setValue("title",U.title,{shouldDirty:!1}),!ee&&!(i.getValues("description")??"").trim()&&U.description&&i.setValue("description",U.description,{shouldDirty:!1}),!X&&U.envVarKeys?.length)){const ge=i.getValues("env_vars")??[],je=new Set(ge.map(j=>j.key)),_=U.envVarKeys.filter(j=>!je.has(j));_.length>0&&i.setValue("env_vars",[...ge,..._.map(j=>({key:j,value:""}))],{shouldDirty:!0})}},z=Xt(w);if(z&&c){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",z.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),N(fe({uiType:"NPX",npxPackage:z.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const U=b==="HTTP"||b==="SSE"||b==="Websocket"?b:"HTTP";i.setValue("ui_type",U,{shouldDirty:!0}),i.setValue("connection_url",w,{shouldDirty:!0}),N(fe({uiType:U,connectionUrl:w})??De({uiType:U,connectionUrl:w,registryItems:y}));return}b==="NPX"&&N(fe({uiType:"NPX",npxPackage:w}))},H=m?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{size:C?"sm":"default",variant:C?"default":"outline",onClick:P,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:e("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const g=e("orgs.connections.createConnection"),w=e("orgs.connections.createConnectionDescription"),R=i.formState.isSubmitting?e("orgs.connections.saving"):e("orgs.connections.createConnection"),ee=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:i.control,name:"ui_type",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.type")}),t.jsxs(Ot,{value:N.value,onValueChange:N.onChange,children:[t.jsx(J,{children:t.jsx(Ft,{children:t.jsx(Ut,{})})}),t.jsxs(Vt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),c&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),e("orgs.connections.npxPackage")]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),e("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),b==="NPX"&&t.jsx(q,{control:i.control,name:"npx_package",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.npmPackage")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.npmPackagePlaceholder"),...N,value:N.value??"",onPaste:z=>{const U=z.clipboardData.getData("text");U&&(z.preventDefault(),i.setValue("npx_package",U.trim(),{shouldDirty:!0}),O(U))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Z,{})]})}),b==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(q,{control:i.control,name:"stdio_command",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.command")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.commandPlaceholder"),...N,value:N.value??""})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"stdio_args",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.arguments")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.argumentsPlaceholder"),...N,value:N.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:i.control,name:"stdio_cwd",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.workingDirectory")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.workingDirectoryPlaceholder"),...N,value:N.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(b==="NPX"||b==="STDIO")&&t.jsx(q,{control:i.control,name:"env_vars",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.environmentVariables")}),t.jsx(J,{children:t.jsx(Rt,{value:N.value??[],onChange:N.onChange})}),t.jsx(Z,{})]})}),b!=="NPX"&&b!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:i.control,name:"connection_url",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.url")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.urlPlaceholder"),...N,value:N.value??"",onPaste:z=>{const U=z.clipboardData.getData("text");U&&(z.preventDefault(),i.setValue("connection_url",U.trim(),{shouldDirty:!0}),O(U))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"connection_token",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:T?.token?.label??e("orgs.connections.tokenOptional")}),t.jsx(J,{children:t.jsx(se,{type:"password",placeholder:T?.token?.placeholder??e("orgs.connections.tokenPlaceholder"),...N,value:N.value??""})}),T?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.token.helperText,T.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:e("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:i.control,name:"title",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.name")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.namePlaceholder"),...N})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"description",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.description")}),t.jsx(J,{children:t.jsx(Lt,{placeholder:e("orgs.connections.descriptionPlaceholder"),rows:3,...N,value:N.value??""})}),t.jsx(Z,{})]})})]}),X=M;return r?t.jsx(Tt,{open:X,onOpenChange:F,children:t.jsxs(wt,{className:"max-h-[90vh]",children:[t.jsx(At,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(It,{children:g}),t.jsx(Pt,{className:"mt-1",children:w})]}),t.jsx(Mt,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":e("orgs.connections.close"),children:t.jsx(ze,{size:16})})})]})}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(I),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:ee}),t.jsx($t,{children:t.jsx(L,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:R})})]})})]})}):t.jsx(Ue,{open:X,onOpenChange:F,children:t.jsxs(Fe,{className:"sm:max-w-[525px]",children:[t.jsxs($e,{children:[t.jsx(Pe,{children:g}),t.jsx(Me,{children:w})]}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(I),children:[t.jsx("div",{className:"py-4",children:ee}),t.jsxs(Oe,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>F(!1),children:e("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:R})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{actions:C&&H,children:e("orgs.connections.pageTitle")}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(rt,{value:a.search,onChange:a.setSearch,placeholder:e("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:g=>{g.key==="Escape"&&(a.setSearch(""),g.target.blur())}}),t.jsx(lt,{sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:e("orgs.connections.sortName")},{id:"description",label:e("orgs.connections.sortDescription")},{id:"connection_type",label:e("orgs.connections.sortType")},{id:"updated_by",label:e("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:e("orgs.connections.sortUpdated")}],filters:[{label:e("orgs.connections.filterType"),value:p,onChange:g=>f(g||"ALL"),options:[{id:"ALL",label:e("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:e("orgs.connections.filterStatus"),value:h,onChange:g=>x(g||"ALL"),options:[{id:"ALL",label:e("orgs.connections.filterAll")},{id:"active",label:e("orgs.connections.filterActive")},{id:"inactive",label:e("orgs.connections.filterInactive")},{id:"error",label:e("orgs.connections.filterError")}]}]})]}),!C&&H]}),t.jsx(at,{placement:"page",tabs:[{id:"all",label:e("orgs.connections.tabAll")},{id:"connected",label:e("orgs.connections.tabConnected")}],activeTab:u,onTabChange:g=>{const w=g;w!==u&&te("connections_page_tab_changed",{to_tab:w}),l(w)}}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:v?.5:1,transition:v?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:v?"none":"auto"},children:t.jsx(pn,{listState:a,activeTab:u,typeFilter:p,statusFilter:h})})})]})})})]})})}function $s(){const C=G.c(1);let e;return C[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx(fn,{})})}),C[0]=e):e=C[0],e}export{$s as default};
|