decocms 4.493.0 → 4.494.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-5xWWHSL1.js → ActiveShapeUtils-C-buMql8.js} +1 -1
- package/dist/client/assets/{AlertCircle-B5gBB9h_.js → AlertCircle-xh90NARB.js} +1 -1
- package/dist/client/assets/{AreaChart-BTyzss2a.js → AreaChart-hhJtx5W4.js} +1 -1
- package/dist/client/assets/{ArrowLeft-B7455tPl.js → ArrowLeft-Xffg7q8p.js} +1 -1
- package/dist/client/assets/{ArrowUp-CP6XCJnB.js → ArrowUp-4iK8zoCx.js} +1 -1
- package/dist/client/assets/{BarChart-Ch51NWPz.js → BarChart-CvyDfHpd.js} +1 -1
- package/dist/client/assets/{Building02-BZItaEYx.js → Building02-DAEF4UrO.js} +1 -1
- package/dist/client/assets/{CategoricalChart-DqN5Jy74.js → CategoricalChart-CMQWnNBW.js} +1 -1
- package/dist/client/assets/{CheckCircle-C3CiaCW4.js → CheckCircle-DUpC1qQ4.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-DIPs2sw-.js → ChevronSelectorVertical-DCkH1mIQ.js} +1 -1
- package/dist/client/assets/{ChevronUp-nynZHATg.js → ChevronUp-D_Wjh1Pp.js} +1 -1
- package/dist/client/assets/{Copy01-CdRMK9o7.js → Copy01-BdyOQaoT.js} +1 -1
- package/dist/client/assets/{CreditCard01-DVQTLvKO.js → CreditCard01-YN58MJQp.js} +1 -1
- package/dist/client/assets/{DotsVertical-3XBYz4yU.js → DotsVertical-C0q218c1.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-Csmpy3UX.js → ErrorBarContext-thUyR0rx.js} +1 -1
- package/dist/client/assets/{Globe04-DoxNod_i.js → Globe04-brrhloqP.js} +1 -1
- package/dist/client/assets/{Image01-DdBetDCI.js → Image01-Drnu_oTX.js} +1 -1
- package/dist/client/assets/{Key01-DcSonP-G.js → Key01-DXKey19o.js} +1 -1
- package/dist/client/assets/{Link01-3BacRGrf.js → Link01-DAwi9mlM.js} +1 -1
- package/dist/client/assets/{LinkBroken01-BZFZ6N-h.js → LinkBroken01-wTJMvAdz.js} +1 -1
- package/dist/client/assets/{Monitor01-DU19-CHk.js → Monitor01-Bm_bTKyL.js} +1 -1
- package/dist/client/assets/{Play-B7i_-ibU.js → Play-CqIDE5zC.js} +1 -1
- package/dist/client/assets/{Plus-XYNDZJ4s.js → Plus-j4aDTi8e.js} +1 -1
- package/dist/client/assets/{SearchMd-BFitEH5z.js → SearchMd-DhQxjm00.js} +1 -1
- package/dist/client/assets/{Sector-CYOl8Efm.js → Sector-Dhm7L79o.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-Ci8H67G0.js → ShoppingBag01-BJ4cJNkc.js} +1 -1
- package/dist/client/assets/{Sun-D1Mdg8Cq.js → Sun-D0UkgT29.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BHr8jCjb.js → SwitchHorizontal01-6WEEE86B.js} +1 -1
- package/dist/client/assets/{Tool01-DQnW-zjg.js → Tool01-DG06N0su.js} +1 -1
- package/dist/client/assets/{Trash01-DZ8laRwu.js → Trash01-C9lhbJs7.js} +1 -1
- package/dist/client/assets/{Upload01-CrRTpeMX.js → Upload01-Bt337Shk.js} +1 -1
- package/dist/client/assets/{User01-9bZ-cKa7.js → User01-DXN8J2dA.js} +1 -1
- package/dist/client/assets/{UserSquare-CuRnLJZ6.js → UserSquare-B7AJhMXA.js} +1 -1
- package/dist/client/assets/{Users01-cUGZjxDe.js → Users01-CHS_3A2d.js} +1 -1
- package/dist/client/assets/{XAxis-DDG3qYHW.js → XAxis-M9-_1D7_.js} +1 -1
- package/dist/client/assets/{XClose-DjFCAP5F.js → XClose-pteQuwAH.js} +1 -1
- package/dist/client/assets/{ZoomOut-BggitXDv.js → ZoomOut-D4nHzX79.js} +1 -1
- package/dist/client/assets/{access-gate-Cu8JZecz.js → access-gate-CNFrC5-Q.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-DBnkMFp9.js → add-connection-dialog-BXB3P-4X.js} +1 -1
- package/dist/client/assets/{agent-analytics-B1wni80p.js → agent-analytics-C1qxm1L0.js} +1 -1
- package/dist/client/assets/agent-app-BN1xlwca.js +1 -0
- package/dist/client/assets/{agent-assets-B18leh3z.js → agent-assets-Doo6qn_B.js} +1 -1
- package/dist/client/assets/{agent-automation-CWXHzvtY.js → agent-automation-BhXRsqWt.js} +1 -1
- package/dist/client/assets/{agent-automations-C0tbQ1R9.js → agent-automations-B3GOPyc3.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-CKiU44XZ.js → agent-connect-sources-Cj-TiW7a.js} +1 -1
- package/dist/client/assets/agent-deck-gN98WSbp.js +1 -0
- package/dist/client/assets/{agent-e2e-LdVq-drf.js → agent-e2e-CyiK0Nn8.js} +1 -1
- package/dist/client/assets/{agent-experiments-ClDYYnWj.js → agent-experiments-Dero6WeN.js} +1 -1
- package/dist/client/assets/{agent-file-CjZFekiU.js → agent-file-Cao_W_me.js} +1 -1
- package/dist/client/assets/{agent-hosting-zrg11_-A.js → agent-hosting-5VKfgGQd.js} +1 -1
- package/dist/client/assets/{agent-icon-BewGjsar.js → agent-icon-CAaO4ypa.js} +1 -1
- package/dist/client/assets/agent-library-CxgcYBSr.js +1 -0
- package/dist/client/assets/agent-library-file-lpnZiokW.js +1 -0
- package/dist/client/assets/{agent-monitor-CKpvG_Lm.js → agent-monitor-UjHCObOn.js} +1 -1
- package/dist/client/assets/{agent-overview-Di3y0uXp.js → agent-overview-CARG35t2.js} +1 -1
- package/dist/client/assets/agent-settings-7e_XyBHe.js +1 -0
- package/dist/client/assets/{agent-site-editor-16duoEZY.js → agent-site-editor-CXDMfxCU.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-yflTKEXl.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-B64VGP55.js → agent-site-editor-content-BAjBb750.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-DIihiuj0.js → agent-site-editor-preview-BgyDrf4u.js} +3 -3
- package/dist/client/assets/{agent-view-guard-CoiTTfLB.js → agent-view-guard-1XKy1jVJ.js} +1 -1
- package/dist/client/assets/agent-view-vQcOlN6j.js +1 -0
- package/dist/client/assets/{agents-list-CFQQdh1t.js → agents-list-BKQ9GkqQ.js} +1 -1
- package/dist/client/assets/{ai-providers-CTzk8MgQ.js → ai-providers-DQvwi-LI.js} +1 -1
- package/dist/client/assets/{alert-Dyx5I-Y3.js → alert-DEeNrGpM.js} +1 -1
- package/dist/client/assets/{alert-dialog-BXEG2ySJ.js → alert-dialog-DhiFzLmM.js} +1 -1
- package/dist/client/assets/{analytics-sections-BeEYJnmv.js → analytics-sections-BW-0HIcE.js} +1 -1
- package/dist/client/assets/{api-keys-JMxYvHms.js → api-keys-B6xfTHb9.js} +1 -1
- package/dist/client/assets/api-keys-LZWLXizN.js +1 -0
- package/dist/client/assets/app-editor-B7dAjCr9.js +1 -0
- package/dist/client/assets/{asset-utils-Euq8y8zU.js → asset-utils-RYK8HJ3w.js} +1 -1
- package/dist/client/assets/{auth-Dwu4WH32.js → auth-CFVKU9If.js} +1 -1
- package/dist/client/assets/{auth-catchall-D9Xe8fii.js → auth-catchall-UV-w9rG5.js} +1 -1
- package/dist/client/assets/{auth-entry-CCIy-Mhs.js → auth-entry-DI7FcrqT.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DXUbMgnq.js → auth-split-layout-CuIKSb1N.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BEdNWkUl.js → authenticate-and-persist-oauth-C4TrLSCm.js} +1 -1
- package/dist/client/assets/{automation-list-row-Du4blVfm.js → automation-list-row-Dv9cy6ec.js} +1 -1
- package/dist/client/assets/{automation-runs-BsFnE3d4.js → automation-runs-qbW12Sit.js} +1 -1
- package/dist/client/assets/{automations-Cpff9O08.js → automations-CVxx9AvI.js} +1 -1
- package/dist/client/assets/{autosend-BaKgBZDQ.js → autosend-DqvDhR1V.js} +1 -1
- package/dist/client/assets/{avatar-BEl6nltF.js → avatar-DC1Cmzej.js} +1 -1
- package/dist/client/assets/{badge-DFdotQFQ.js → badge-C85ocGTA.js} +1 -1
- package/dist/client/assets/{block-document-BlUE8Eks.js → block-document-DQft1xyS.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DSOKao_H.js → blocks-preview-workspace-context-6ZMkVqw_.js} +1 -1
- package/dist/client/assets/{blog-schema-B_yGbArL.js → blog-schema-vO6IoJBM.js} +1 -1
- package/dist/client/assets/{board-analytics-UmA2i-Sq.js → board-analytics-DatP--tQ.js} +1 -1
- package/dist/client/assets/{buckets-CJ11qX_5.js → buckets-Cczodic8.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-QS7b7hRr.js → build-improve-prompt-doc-BQEdJK2P.js} +1 -1
- package/dist/client/assets/{calendar-CT7cVD7N.js → calendar-BUi8IxeZ.js} +1 -1
- package/dist/client/assets/{capability-load-error-yZzl8b80.js → capability-load-error-rL1NTtJa.js} +1 -1
- package/dist/client/assets/{category-editor-CTdWf8oW.js → category-editor-B_XTuKuu.js} +1 -1
- package/dist/client/assets/{chart-C-785ZEj.js → chart-CjiGuzpk.js} +1 -1
- package/dist/client/assets/{chat-context-DJGYyGlB.js → chat-context-oLIKqlGE.js} +1 -1
- package/dist/client/assets/{chat-draft-DbBgaLY_.js → chat-draft-Cgc2XQsH.js} +1 -1
- package/dist/client/assets/{checkbox-DmaIcPoL.js → checkbox-DZ-_DOro.js} +1 -1
- package/dist/client/assets/{choose-editor-CirVpDXw.js → choose-editor-CryRu8AV.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-BnoHLlrM.js → claim-phase-copy--pyKC4gk.js} +1 -1
- package/dist/client/assets/{cli-auth-success-XcMuETZQ.js → cli-auth-success-DmgEVi8V.js} +1 -1
- package/dist/client/assets/{client-icons-DLhjrwzL.js → client-icons-Dr3qA-pT.js} +1 -1
- package/dist/client/assets/{collapsible-CgZ4-XuF.js → collapsible-D6DR3zQ4.js} +1 -1
- package/dist/client/assets/{collection-detail-gYU6aRKx.js → collection-detail-CDuDEGYz.js} +1 -1
- package/dist/client/assets/{collection-display-button-YyNX5Efp.js → collection-display-button-DoIjEbJ3.js} +1 -1
- package/dist/client/assets/{collection-search-BC0JMMNp.js → collection-search-CacvIdKe.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DFn43mg0.js → collection-table-wrapper-hyzp9jUd.js} +1 -1
- package/dist/client/assets/{collection-tabs-DeQ7zbGh.js → collection-tabs-ywProb31.js} +1 -1
- package/dist/client/assets/{column-rules-b8eo73o4.js → column-rules-BK42oUF9.js} +1 -1
- package/dist/client/assets/{combobox-DeXU4vSR.js → combobox-DOrn42oJ.js} +1 -1
- package/dist/client/assets/{command-D2QlwSrW.js → command-fqp-0b5f.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-DtzaYg0J.js → companion-mcps-section-CzRe8aZa.js} +1 -1
- package/dist/client/assets/{config-DP6xvcYW.js → config-CIO93PJU.js} +1 -1
- package/dist/client/assets/{connect-ClKIaF8K.js → connect-Be6_BDOH.js} +1 -1
- package/dist/client/assets/{connect-layout-CyyX0xPx.js → connect-layout-Dgmc1sNX.js} +1 -1
- package/dist/client/assets/{connection-BjzBHJVc.js → connection-BCelELHr.js} +1 -1
- package/dist/client/assets/{connection-card-BVD8Ppl9.js → connection-card-BWXrChNc.js} +1 -1
- package/dist/client/assets/{connection-detail-DfYF7TR9.js → connection-detail-B7kDdVY9.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-5EXuPZ4G.js → connection-form-helpers-DCUMal7M.js} +1 -1
- package/dist/client/assets/{connections-D1tC1_hB.js → connections-BYbkoIDQ.js} +1 -1
- package/dist/client/assets/{context-DzTTGbcd.js → context-ByfIilVn.js} +1 -1
- package/dist/client/assets/{context-menu-Can7-rLt.js → context-menu-CiGJumcW.js} +1 -1
- package/dist/client/assets/{core.esm-Cvui6jds.js → core.esm-C2_DCN6Y.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CD66iA3E.js → create-organization-dialog-BHthlR2A.js} +1 -1
- package/dist/client/assets/{daily-pulse-Bz92WYIP.js → daily-pulse-E_FUA1NH.js} +1 -1
- package/dist/client/assets/{device-hint-DZcinuip.js → device-hint-DA_uRg_p.js} +1 -1
- package/dist/client/assets/{discover-BRALl0mU.js → discover-J_sID2RZ.js} +1 -1
- package/dist/client/assets/{domain-settings-DiitZO4z.js → domain-settings-BrzCpB_6.js} +1 -1
- package/dist/client/assets/{drawer-BPz4t5dt.js → drawer-BMuDp3pZ.js} +1 -1
- package/dist/client/assets/{editor-2jNHgdUN.js → editor-Dq4IMcxm.js} +1 -1
- package/dist/client/assets/{empty-state-D8iC8fkc.js → empty-state-BV6Ywh9y.js} +1 -1
- package/dist/client/assets/{empty-state-Zf0MeIMv.js → empty-state-DvEOfDhm.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BTBLhbEe.js → extract-connection-data-DU6Jox_T.js} +1 -1
- package/dist/client/assets/{feature-gate-Dhf-LwS1.js → feature-gate-BZc24_E5.js} +1 -1
- package/dist/client/assets/{feature-paywall-CHcwEHRJ.js → feature-paywall-D03mknXg.js} +1 -1
- package/dist/client/assets/{file-explorer-BhYSdjXu.js → file-explorer-Lz97U563.js} +1 -1
- package/dist/client/assets/{file-preview-DvxQuX3P.js → file-preview-CV8hE6WA.js} +1 -1
- package/dist/client/assets/{file-share-button-C1EB3dOc.js → file-share-button-Bdi3sj_s.js} +1 -1
- package/dist/client/assets/{file-type-icon-DzYK4NqY.js → file-type-icon-OOS78AjU.js} +1 -1
- package/dist/client/assets/flat-project-Br0qxJS9.js +1 -0
- package/dist/client/assets/{folder-icon-C_Jv4E7N.js → folder-icon-B0QLaV9K.js} +1 -1
- package/dist/client/assets/{form-BCYpCYIL.js → form-CZcQhZCa.js} +1 -1
- package/dist/client/assets/{general-D8kDc8NB.js → general-BMgatBn-.js} +1 -1
- package/dist/client/assets/{home-CiV29kW5.js → home-D1UZSXtn.js} +1 -1
- package/dist/client/assets/{icon-button-sHj7Q6Fp.js → icon-button-DbTR-7FA.js} +1 -1
- package/dist/client/assets/{index-GgiP6YIr.js → index-BG5IZjO1.js} +1 -1
- package/dist/client/assets/{index-KCu_K9eF.js → index-Box10IZB.js} +1 -1
- package/dist/client/assets/{index-YEKHk89C.js → index-BrozBhiV.js} +1 -1
- package/dist/client/assets/{index-wABYnbOM.js → index-BvTG_LLZ.js} +1 -1
- package/dist/client/assets/{index-DmfwrRER.js → index-BvhG_GL8.js} +3 -3
- package/dist/client/assets/{index-CuOTEpMz.js → index-C9YSJ0Pi.js} +1 -1
- package/dist/client/assets/{index-CspW_Aw1.js → index-CX4bp0FC.js} +1 -1
- package/dist/client/assets/{index-BhyQWjoM.js → index-Cj4602fN.js} +1 -1
- package/dist/client/assets/{index-D2iZ6syL.js → index-Cql9s2oo.js} +1 -1
- package/dist/client/assets/{index-6UUldwCZ.js → index-D-F3H3Df.js} +1 -1
- package/dist/client/assets/{index-Bm9FTdjr.js → index-DYLoE6lZ.js} +4 -4
- package/dist/client/assets/{index-BVmIdqXu.js → index-D_2G1SLW.js} +1 -1
- package/dist/client/assets/{index-s6P2p4h7.js → index-DcG5TBas.js} +1 -1
- package/dist/client/assets/{index-redirect-C_FoZNOn.js → index-redirect-DnUfmxMQ.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-zxl9Rj5F.js → infiniteQueryObserver-C-FPZrNN.js} +1 -1
- package/dist/client/assets/{infra-billing-heizZxEC.js → infra-billing-51h8KhW5.js} +1 -1
- package/dist/client/assets/{input-Bvc3OT4I.js → input-B0wYSpb2.js} +1 -1
- package/dist/client/assets/{input-BkQDO0Ef.js → input-Bv9QfIGh.js} +3 -3
- package/dist/client/assets/{integration-icon-DoYtKqdf.js → integration-icon-CDrootbG.js} +1 -1
- package/dist/client/assets/{jira-icon-BeORJXLw.js → jira-icon-BYFRiv-4.js} +1 -1
- package/dist/client/assets/{label-BL2W0Pcn.js → label-COS7xlc4.js} +1 -1
- package/dist/client/assets/{layout-vy24lHLj.js → layout-CBzBOevY.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-B5L4MOtR.js → legacy-agents-deep-MO8oblzi.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-Pp-THt9D.js → legacy-main-redirect-CudcgLCq.js} +1 -1
- package/dist/client/assets/library-CMmULIMr.js +1 -0
- package/dist/client/assets/{library-tab-2usQWRYi.js → library-tab-BhC4uvZL.js} +1 -1
- package/dist/client/assets/{login-CwsPhEpC.js → login-DhV7QjVw.js} +1 -1
- package/dist/client/assets/{markdown-B3PJYX-4.js → markdown-FpxtcMsE.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BLT3VM-G.js → mcp-app-renderer-oNRSzgIY.js} +1 -1
- package/dist/client/assets/{mcp-oauth-4gmyTyah.js → mcp-oauth-_2kQOfTH.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BTa4N28L.js → mcp-oauth-hlA0Q-1K.js} +1 -1
- package/dist/client/assets/{members-Dba6HROK.js → members-NF923Ad9.js} +1 -1
- package/dist/client/assets/{memory-DAV2Pmj2.js → memory-CkWrgyW6.js} +1 -1
- package/dist/client/assets/{mini-report-page-B9WE5YW-.js → mini-report-page-CtUg6esm.js} +1 -1
- package/dist/client/assets/{mock-board-D9i0Vi9l.js → mock-board-BbcelWvr.js} +1 -1
- package/dist/client/assets/{monaco-editor-DANiMmsL.js → monaco-editor-DOjflLD3.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B1hQA0Lu.js → monitoring-stats-row-5gnR_PsS.js} +1 -1
- package/dist/client/assets/{multi-select-BJgtMlC2.js → multi-select-DHbRaRWn.js} +1 -1
- package/dist/client/assets/{mustache-GMlXm0yl.js → mustache-CUJOpa04.js} +1 -1
- package/dist/client/assets/{new-project-dialog-C-thpPQ-.js → new-project-dialog-Bytx7uX5.js} +1 -1
- package/dist/client/assets/{oauth-callback-DZwrYGu7.js → oauth-callback-BOiaAtqL.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-B7d3QWP4.js → oauth-callback-ai-provider-DHi7-rTD.js} +1 -1
- package/dist/client/assets/{onboarding-DK0DTXli.js → onboarding-BcQ_H-Ta.js} +1 -1
- package/dist/client/assets/{openai-conversation-BMdPtMrp.js → openai-conversation-BgjVhT0d.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-B4v48qUS.js → optimistic-project-sidebar-views-DuLy3JAN.js} +1 -1
- package/dist/client/assets/{organization-choice-BIWVNvRP.js → organization-choice-obmsj85V.js} +1 -1
- package/dist/client/assets/{orgs-D5AZUxP6.js → orgs-D5F2hLXP.js} +1 -1
- package/dist/client/assets/{page-seo-form-gaHyPBMV.js → page-seo-form-Ba1SWsx7.js} +1 -1
- package/dist/client/assets/{pair-DXTFiJNl.js → pair-DfD0HGLO.js} +1 -1
- package/dist/client/assets/{plan-ladder-BUDRjzbj.js → plan-ladder-ByxenYnr.js} +1 -1
- package/dist/client/assets/{popover-jNB4XciF.js → popover-CsrTLLWE.js} +1 -1
- package/dist/client/assets/{post-calendar-D8EAMZvz.js → post-calendar-CAVjY12v.js} +1 -1
- package/dist/client/assets/{post-editor-BQa57f7n.js → post-editor-CLhXk7zA.js} +1 -1
- package/dist/client/assets/{preview-content-B6K8Jkd_.js → preview-content-CcXQsTVX.js} +1 -1
- package/dist/client/assets/{preview-dialog-Dl22mWwN.js → preview-dialog-CuP09SDy.js} +1 -1
- package/dist/client/assets/{preview-panel-LWLVsrdx.js → preview-panel-si7dSHQt.js} +1 -1
- package/dist/client/assets/{product-picker-dialog-RglVwX1Q.js → product-picker-dialog-Ch2ijOSh.js} +1 -1
- package/dist/client/assets/{profile-BWcfZQ7V.js → profile-D0l--Bsl.js} +1 -1
- package/dist/client/assets/{project-app-view-qeunpPC-.js → project-app-view-Bz65jJNr.js} +1 -1
- package/dist/client/assets/{project-feed-Dm758F3_.js → project-feed-DSA4fOC7.js} +1 -1
- package/dist/client/assets/{project-icon-D2vCEWQy.js → project-icon-C-N3cJkz.js} +1 -1
- package/dist/client/assets/project-reports-iIDLiTtT.js +1 -0
- package/dist/client/assets/project-tasks-D52OJfjJ.js +1 -0
- package/dist/client/assets/{projects-DyGysCyv.js → projects-DvvpjGnZ.js} +1 -1
- package/dist/client/assets/{projects-empty-state-BuMMPopD.js → projects-empty-state-DfvyQfpd.js} +1 -1
- package/dist/client/assets/{prompts-BrbpQc3X.js → prompts-BuofI3_s.js} +1 -1
- package/dist/client/assets/record-editor-wVe5Wpmu.js +1 -0
- package/dist/client/assets/redirect-editor-D6yYqLjJ.js +1 -0
- package/dist/client/assets/reports-Bj-OdndV.js +1 -0
- package/dist/client/assets/{reports-D7gOlgZm.js → reports-DOq1hOqC.js} +1 -1
- package/dist/client/assets/{reports-onboarding-DGmwN9iV.js → reports-onboarding-BC8kmZ8I.js} +1 -1
- package/dist/client/assets/{reports-tab-Bb7ApLUW.js → reports-tab-3R3ocdaz.js} +2 -2
- package/dist/client/assets/{repositories-GlkzQQVy.js → repositories-Bt6nbmSu.js} +1 -1
- package/dist/client/assets/{repository-binding-D2wL-4Vr.js → repository-binding-4wb1SqGi.js} +1 -1
- package/dist/client/assets/{repository-import-picker-DtM7QfYh.js → repository-import-picker-DgjVp-Rp.js} +1 -1
- package/dist/client/assets/{repository-picker-28zwGBgK.js → repository-picker-Dhir_mBD.js} +1 -1
- package/dist/client/assets/{require-capability-Dm4XTD9Y.js → require-capability-BXoL3s4D.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CbgA2xIU.js → required-auth-layout-rplY5gMF.js} +1 -1
- package/dist/client/assets/{reset-password-15IQ61HR.js → reset-password-CNXROw6o.js} +1 -1
- package/dist/client/assets/{resizable-CGWosOTw.js → resizable-CYDmoKgw.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-BEIojUgL.js → resolve-tab-icon-CIzsgPiq.js} +1 -1
- package/dist/client/assets/{review-settings-BAqWAPVV.js → review-settings-CIijxO9K.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-CE4nCWAz.js → rich-text-link-control-BlJN8nO0.js} +1 -1
- package/dist/client/assets/roles-rqo1THOy.js +1 -0
- package/dist/client/assets/route-3hj1gfVP.js +1 -0
- package/dist/client/assets/{route-CdaJ86mX.js → route-D_4e8W74.js} +1 -1
- package/dist/client/assets/{route-DCLsEeq7.js → route-nWQgD8-7.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-xVvcrNA2.js → runnable-block-editor-Cq2CDyKN.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-BKjyczlw.js → sandbox-lifecycle-context-qUf8Q_Xq.js} +1 -1
- package/dist/client/assets/{schema-C_wSANSe.js → schema-B7T6zvOr.js} +1 -1
- package/dist/client/assets/{scroll-area-BT00diUA.js → scroll-area-C9CkDOV0.js} +1 -1
- package/dist/client/assets/{search-input-D-uP0R3f.js → search-input-CSa-vO3l.js} +1 -1
- package/dist/client/assets/{search-toggle-Hgq_Klme.js → search-toggle-CAbpMgN6.js} +1 -1
- package/dist/client/assets/{secret-picker-BitsdCaD.js → secret-picker-DoaNLSBs.js} +1 -1
- package/dist/client/assets/{secrets-C_yZKBHs.js → secrets-byDlZpmy.js} +1 -1
- package/dist/client/assets/{sections-editor-DrNkE-5_.js → sections-editor-Bhx-Ytw3.js} +1 -1
- package/dist/client/assets/{select-BVEgIanS.js → select-BTxDOmEz.js} +1 -1
- package/dist/client/assets/{select-model-CTmCsZzT.js → select-model-DXgRM3p3.js} +1 -1
- package/dist/client/assets/{seo-editor-Cr-VPdNi.js → seo-editor-SjuXgM-3.js} +1 -1
- package/dist/client/assets/{separator-CJOPtNz-.js → separator-i5pMbmNF.js} +1 -1
- package/dist/client/assets/{settings-tab-zoRR23UC.js → settings-tab-CKfMYuwP.js} +1 -1
- package/dist/client/assets/{sheet-D-h-caij.js → sheet-B-Hh_nak.js} +1 -1
- package/dist/client/assets/{shell-layout-Ckss0QqA.js → shell-layout-BYblzqjk.js} +1 -1
- package/dist/client/assets/{skills-Dx8G-x-T.js → skills-D04V2qi_.js} +1 -1
- package/dist/client/assets/{slider-DtTzb8JT.js → slider-D3apdx8g.js} +1 -1
- package/dist/client/assets/{sortable.esm-DCsYtWcb.js → sortable.esm-BcPKBoEH.js} +1 -1
- package/dist/client/assets/{sso-DDpjWaoO.js → sso-Ba8xYn_P.js} +1 -1
- package/dist/client/assets/{suggestion-Bso4uBRF.js → suggestion-yrhgs0c3.js} +1 -1
- package/dist/client/assets/{switch-DZo6rAtc.js → switch-Bv7OaKpB.js} +1 -1
- package/dist/client/assets/{symbol-Co3D-iSE.js → symbol-CotFyP2y.js} +1 -1
- package/dist/client/assets/{synced-repos-B1f0culo.js → synced-repos-MTGAuYvc.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-ClCao4gx.js → tab-icon-glyph-gJ6W_ogl.js} +1 -1
- package/dist/client/assets/{table-Gm-jWCpy.js → table-CMo_Zd79.js} +1 -1
- package/dist/client/assets/{tabs-CXsAC8nO.js → tabs-DsQwfF9n.js} +1 -1
- package/dist/client/assets/{task-board-Bgw_xVJW.js → task-board-jYYT4T-P.js} +1 -1
- package/dist/client/assets/{task-route-BxRkc6kt.js → task-route-CWhoPEpW.js} +1 -1
- package/dist/client/assets/{task-status-B92ESgef.js → task-status-B1Q1IWuY.js} +1 -1
- package/dist/client/assets/taskboard-analytics-BnPIIn86.js +1 -0
- package/dist/client/assets/tasks-aFMERcVH.js +1 -0
- package/dist/client/assets/{tasks-BS9sXVdl.js → tasks-sExg1TPS.js} +1 -1
- package/dist/client/assets/{textarea-bcNEcwC6.js → textarea-CXxxIkE2.js} +1 -1
- package/dist/client/assets/{thread-analytics-BE8EaB4a.js → thread-analytics-CN8JIWoa.js} +1 -1
- package/dist/client/assets/{thread-button-BdyWFdme.js → thread-button-BjphGBFn.js} +1 -1
- package/dist/client/assets/{thread-intent-DzHkd78g.js → thread-intent-Cv8T2W7d.js} +1 -1
- package/dist/client/assets/{thread-route-CIiqv6HG.js → thread-route-Y6_0A4lo.js} +1 -1
- package/dist/client/assets/{thread-route-mhniW_q8.js → thread-route-md0irSaA.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-C1CJm0mZ.js → thread-sheet-body-qCnpdPMv.js} +1 -1
- package/dist/client/assets/{time-range-picker-BUGifbSV.js → time-range-picker-nGk4jkHe.js} +1 -1
- package/dist/client/assets/{toggle-group-5iPAspL-.js → toggle-group-MxDdKb-A.js} +1 -1
- package/dist/client/assets/{tool-namespace-CYa7zzrf.js → tool-namespace-NA4CQCu7.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CZBCq2Ko.js → toolbar-icon-button-DfPVpCUn.js} +1 -1
- package/dist/client/assets/{tooltip-XZmQWwgB.js → tooltip-D0bgPl8K.js} +1 -1
- package/dist/client/assets/{tooltipContext-BpyR0oly.js → tooltipContext-BJ3U7dLG.js} +1 -1
- package/dist/client/assets/{track-Ba2I9E5t.js → track-BR4OSmkP.js} +1 -1
- package/dist/client/assets/{types-2TlDAuAc.js → types-D0iAHfi-.js} +1 -1
- package/dist/client/assets/{url-slug-B-L2Z8me.js → url-slug-CsF5_jEJ.js} +1 -1
- package/dist/client/assets/{usage-stats-BihPbkIg.js → usage-stats-DMZgLWXn.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BP69qr77.js → use-ai-providers-C1zAqMn5.js} +1 -1
- package/dist/client/assets/{use-automations-Biu6cV7d.js → use-automations-guIq1Jf8.js} +1 -1
- package/dist/client/assets/{use-autosave-9jHQ-y1f.js → use-autosave-KNHbArST.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-J-94EUwt.js → use-chat-layout-state-DiI7M741.js} +1 -1
- package/dist/client/assets/{use-chat-navigation-BXZpM5MQ.js → use-chat-navigation-CoFd5UE7.js} +1 -1
- package/dist/client/assets/{use-clock-tick-rPXqIJP8.js → use-clock-tick-BMgzMfT6.js} +1 -1
- package/dist/client/assets/{use-connect-companion-BupOmQ7x.js → use-connect-companion-BNtTOOiR.js} +1 -1
- package/dist/client/assets/{use-connection-DUF3XC9E.js → use-connection-BlwV3kYC.js} +1 -1
- package/dist/client/assets/{use-copy-B01v9eRq.js → use-copy-BzyND5sN.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BxoXyDoq.js → use-create-virtual-mcp-CRjB3w_a.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-CPtrEugx.js → use-date-fns-locale-DHjSaunn.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-C__Xzre-.js → use-debounced-autosave-DzioetsZ.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D5_QO1dT.js → use-debounced-value-Bw9XyFDS.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DkZSWK0d.js → use-deco-credits-BwBAsZjN.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-1iPDcTcf.js → use-decopilot-events-LdqK-BR8.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DUG0172F.js → use-delete-connection-B1009COB.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-COeWRtXj.js → use-deployment-admin-DqRcHfUs.js} +1 -1
- package/dist/client/assets/{use-ensure-project-folder-A0But3O1.js → use-ensure-project-folder-q_3EwSkl.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-BRdebqFC.js → use-fast-preview-draft-url-BGVVIo_d.js} +1 -1
- package/dist/client/assets/{use-file-configs-B8mqylSR.js → use-file-configs-CiMmOBPH.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DewChEmc.js → use-infinite-scroll-CFznRnci.js} +1 -1
- package/dist/client/assets/{use-join-requests-CDGwHERc.js → use-join-requests-LdDd-D1N.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-D7q-AygO.js → use-main-panel-tabs-BVPkp8pd.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CUurQWMq.js → use-mcp-auth-status-BAmLODpB.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Dh_4AZgb.js → use-mcp-client-CyZFCbXf.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-LJf01t7x.js → use-mcp-prompts-hbtCEuPx.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-p8MJKmfB.js → use-mcp-tools-CqwLSwPQ.js} +1 -1
- package/dist/client/assets/{use-members-DQe3FYGy.js → use-members-0uvS2aBL.js} +1 -1
- package/dist/client/assets/{use-mobile-UYmsi-dp.js → use-mobile-DsnBmTih.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DDZo26Jw.js → use-navigate-to-agent-e1Fty-W6.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-CGtkQLL-.js +1 -0
- package/dist/client/assets/{use-open-billing-url-C0JU6CzN.js → use-open-billing-url-CtVqEeze.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CPbs0OVW.js → use-org-auth-client--vi1jVLH.js} +1 -1
- package/dist/client/assets/{use-org-fs-gQ0RuIPK.js → use-org-fs-XuRHX-wd.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-KkmagwRy.js → use-org-repo-syncs-DIFvvjD1.js} +1 -1
- package/dist/client/assets/{use-org-sso-DWtbATGD.js → use-org-sso-BY1EpA2d.js} +1 -1
- package/dist/client/assets/use-organization-roles-WaawCXoD.js +1 -0
- package/dist/client/assets/{use-organization-settings-xcc5-6DS.js → use-organization-settings-wIzO33y-.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-A1obvdVI.js → use-panel-navigate-BNghtY2T.js} +1 -1
- package/dist/client/assets/{use-project-scope-BxCbtcTE.js → use-project-scope-kaofAo-2.js} +1 -1
- package/dist/client/assets/{use-releases-G79MSxhR.js → use-releases-DGpmgwQI.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-a7ERyr_7.js → use-reports-diagnostic-C5t0yrnl.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-CSN74_aC.js → use-sandbox-events-DFZHFjJV.js} +1 -1
- package/dist/client/assets/{use-secrets-CmTpPaF9.js → use-secrets-H7WJMT_o.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DbQlCGNR.js → use-section-preview-base-7My4H7me.js} +1 -1
- package/dist/client/assets/{use-tags-Ch6_1it4.js → use-tags-LkAv2_8e.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-v7nFgyEB.js → use-task-board-analytics-DYzMdhLH.js} +1 -1
- package/dist/client/assets/{use-task-board-events-DHjlo-9e.js → use-task-board-events-DFFKnQzP.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-CoXnP9ys.js → use-task-board-item-prs-DlBSKV0p.js} +1 -1
- package/dist/client/assets/{use-task-board-items-erbHwxMh.js → use-task-board-items-GPnynZhW.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DmWCG43J.js → use-task-metadata-Bj-IbI9d.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-DJfFmK1j.js → use-thread-analytics-BaY4EBEv.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-7J4Ek_Zs.js → use-thread-outputs-BE4mR7oi.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-D4wBC58J.js +1 -0
- package/dist/client/assets/{useQueries-DoURbZYb.js → useQueries-F64PMR6y.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-ZDUWj1v_.js +1 -0
- package/dist/client/assets/{users-BfQBxfCk.js → users-BjFgJ7AD.js} +1 -1
- package/dist/client/assets/{utils-DAEMarMy.js → utils-DgqX0z1b.js} +1 -1
- package/dist/client/assets/{variant-calendar-DNADqO99.js → variant-calendar-DLNhYnQf.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-BDRgB-Pq.js → variant-matcher-override-D3WXi6Ga.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DPJfZa3C.js → view-mode-toggle-0cm3AkV5.js} +1 -1
- package/dist/client/assets/{virtual-mcp-C54PVPPw.js → virtual-mcp-C_TeGFZa.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-DmOqvBBq.js → watch-sse-pool-end_AVWu.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +598 -598
- package/package.json +1 -1
- package/dist/client/assets/agent-app-DY95_zYY.js +0 -1
- package/dist/client/assets/agent-deck-C8T7Jj3o.js +0 -1
- package/dist/client/assets/agent-library-BAUPDsyD.js +0 -1
- package/dist/client/assets/agent-library-file-CHlnBg90.js +0 -1
- package/dist/client/assets/agent-settings-C-kNuurj.js +0 -1
- package/dist/client/assets/agent-site-editor-code-BUJylH9_.js +0 -2
- package/dist/client/assets/agent-view-SjLiGW-o.js +0 -1
- package/dist/client/assets/api-keys-CH5G5_Qp.js +0 -1
- package/dist/client/assets/app-editor-DqEmpUhy.js +0 -1
- package/dist/client/assets/flat-project-D2zrr-4_.js +0 -1
- package/dist/client/assets/library-DZte0T9-.js +0 -1
- package/dist/client/assets/project-reports-6TMbK6-4.js +0 -1
- package/dist/client/assets/project-tasks-3mU9NrZf.js +0 -1
- package/dist/client/assets/record-editor-hwH5zZn-.js +0 -1
- package/dist/client/assets/redirect-editor-Dc4HBQwl.js +0 -1
- package/dist/client/assets/reports-DPHZG4Rx.js +0 -1
- package/dist/client/assets/roles-etRZjRQM.js +0 -1
- package/dist/client/assets/route-BCQ2a7UE.js +0 -1
- package/dist/client/assets/taskboard-analytics-BEBBYmzN.js +0 -1
- package/dist/client/assets/tasks-DckB4c8m.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-nCMzaJ9Q.js +0 -1
- package/dist/client/assets/use-organization-roles-BKQWBZmO.js +0 -1
- package/dist/client/assets/useInfiniteQuery-vZqvTY4f.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DdGuWYX3.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as ve,cX as Oe,cV as Me,aE as de,bU as Ee,c as U,b as F,j as t,h as Ne,B,r as Q,l as Se,a2 as te,aa as ze,R as me,K as ee,d as se,x as ye,at as _e,ff as Re,b2 as Ue,n as Ve,fE as ue,$ as Fe,I as J,X as Le,T as Be,V as qe,U as xe,H as Ge,f as He,fN as Xe,o as Ke,aC as Qe,aB as We,t as Y}from"./index-Bm9FTdjr.js";import{g as Ye}from"./extract-connection-data-BTBLhbEe.js";import{E as Ce}from"./empty-state-Zf0MeIMv.js";import{E as Je,c as Ze,r as et,b as tt,d as st}from"./connection-form-helpers-5EXuPZ4G.js";import{c as nt,S as it,D as ot}from"./index-YEKHk89C.js";import{u as we,T as at}from"./use-mcp-auth-status-CUurQWMq.js";import{a as lt}from"./use-members-DQe3FYGy.js";import{A as rt}from"./avatar-BEl6nltF.js";import{a as ct}from"./mcp-oauth-4gmyTyah.js";import{I as ae}from"./integration-icon-DoYtKqdf.js";import{s as dt}from"./Plus-XYNDZJ4s.js";import{bd as mt,ay as ut,au as xt,u as ne}from"./agent-icon-BewGjsar.js";import{a as ke,e as pt,s as ft}from"./Tool01-DQnW-zjg.js";import{s as re}from"./Trash01-DZ8laRwu.js";import{b as ht,a as gt,c as jt,S as bt,d as vt}from"./sheet-D-h-caij.js";import{F as G,b as H,c as X,d as L,f as K,e as Nt,a as St}from"./form-BCYpCYIL.js";import{a as Ie,b as Te,u as yt}from"./use-connection-DUF3XC9E.js";import{u as Ae}from"./use-mcp-client-Dh_4AZgb.js";import{u as _t}from"./use-mcp-tools-p8MJKmfB.js";import{a as Ct}from"./use-mcp-prompts-LJf01t7x.js";import{i as wt}from"./mcp-oauth-BTa4N28L.js";import{u as kt,D as It}from"./use-delete-connection-DUG0172F.js";import{c as Tt}from"./monitoring-stats-row-B1hQA0Lu.js";import{d as At,C as Pt,a as Dt}from"./chart-C-785ZEj.js";import{B as $t,a as Ot}from"./BarChart-Ch51NWPz.js";import{C as Mt}from"./tooltipContext-BpyR0oly.js";import{b as Et}from"./repository-binding-D2wL-4Vr.js";import{T as ie,a as zt,c as oe,b as Rt}from"./tabs-CXsAC8nO.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Ut}from"./ShoppingBag01-Ci8H67G0.js";import{g as ce}from"./types-2TlDAuAc.js";import{M as Vt}from"./mcp-app-renderer-BLT3VM-G.js";import{C as Ft}from"./collection-search-BC0JMMNp.js";import{B as Lt}from"./badge-DFdotQFQ.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-BVEgIanS.js";import{i as Bt}from"./CheckCircle-C3CiaCW4.js";import{t as qt}from"./ChevronUp-nynZHATg.js";import{n as Gt}from"./LinkBroken01-BZFZ6N-h.js";import{c as Ht}from"./UserSquare-CuRnLJZ6.js";import{s as Xt}from"./XClose-DjFCAP5F.js";import{p as Kt,i as Qt}from"./connection-BjzBHJVc.js";import"./metadata-D72DunRR.js";import"./Key01-DcSonP-G.js";import"./auth-Dwu4WH32.js";import"./index-GgiP6YIr.js";import"./index-KCu_K9eF.js";import"./index-BdQq_4o_.js";import"./index-s6P2p4h7.js";import"./popover-jNB4XciF.js";import"./tooltip-XZmQWwgB.js";import"./index-D2iZ6syL.js";import"./SearchMd-BFitEH5z.js";import"./use-mobile-UYmsi-dp.js";import"./use-create-virtual-mcp-BxoXyDoq.js";import"./use-navigate-to-agent-DDZo26Jw.js";import"./thread-intent-DzHkd78g.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-DmOqvBBq.js";import"./task-board-Bgw_xVJW.js";import"./schema-C_wSANSe.js";import"./slugify-CEUa2lfQ.js";import"./Image01-DdBetDCI.js";import"./use-org-auth-client-CPbs0OVW.js";import"./User01-9bZ-cKa7.js";import"./AlertCircle-B5gBB9h_.js";import"./ArrowUp-CP6XCJnB.js";import"./ArrowLeft-B7455tPl.js";import"./ZoomOut-BggitXDv.js";import"./Building02-BZItaEYx.js";import"./ChevronSelectorVertical-DIPs2sw-.js";import"./Copy01-CdRMK9o7.js";import"./CreditCard01-DVQTLvKO.js";import"./DotsVertical-3XBYz4yU.js";import"./Globe04-DoxNod_i.js";import"./SwitchHorizontal01-BHr8jCjb.js";import"./Link01-3BacRGrf.js";import"./Monitor01-DU19-CHk.js";import"./Sun-D1Mdg8Cq.js";import"./Play-B7i_-ibU.js";import"./Upload01-CrRTpeMX.js";import"./Users01-cUGZjxDe.js";import"./label-BL2W0Pcn.js";import"./alert-dialog-BXEG2ySJ.js";import"./AreaChart-BTyzss2a.js";import"./CategoricalChart-DqN5Jy74.js";import"./XAxis-DDG3qYHW.js";import"./symbol-Co3D-iSE.js";import"./ActiveShapeUtils-5xWWHSL1.js";import"./Sector-CYOl8Efm.js";import"./ErrorBarContext-Csmpy3UX.js";import"./url-slug-B-L2Z8me.js";const Wt=ve({scopes:Ee(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:o,onDelete:i,onToggleStatus:l}=s,a=F();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),x=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,f=n.status!=="active",m=x||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==m?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",m),e[2]=m,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 N;e[9]!==n.status||e[10]!==f||e[11]!==x||e[12]!==a?(N=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:a("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?a("details.connectionInstancesPanel.disabledError"):a("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=x,e[12]=a,e[13]=N):N=e[13];let _;e[14]!==j||e[15]!==N?(_=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,N]}),e[14]=j,e[15]=N,e[16]=_):_=e[16];let y;e[17]!==n||e[18]!==x||e[19]!==o||e[20]!==a?(y=x&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>o(n),children:a("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=x,e[19]=o,e[20]=a,e[21]=y):y=e[21];let C;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==a?(C=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(mt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(ut,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=a,e[26]=C):C=e[26];let D;e[27]!==n||e[28]!==c?(D=()=>c(n),e[27]=n,e[28]=c,e[29]=D):D=e[29];let w;e[30]!==a?(w=a("details.connectionInstancesPanel.configure"),e[30]=a,e[31]=w):w=e[31];let $;e[32]!==a?($=a("details.connectionInstancesPanel.configure"),e[32]=a,e[33]=$):$=e[33];let O;e[34]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(ke,{size:13}),e[34]=O):O=e[34];let P;e[35]!==D||e[36]!==w||e[37]!==$?(P=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:D,title:w,"aria-label":$,children:O}),e[35]=D,e[36]=w,e[37]=$,e[38]=P):P=e[38];let T;e[39]!==n||e[40]!==i?(T=()=>i(n),e[39]=n,e[40]=i,e[41]=T):T=e[41];let S;e[42]!==a?(S=a("details.connectionInstancesPanel.delete"),e[42]=a,e[43]=S):S=e[43];let b;e[44]!==a?(b=a("details.connectionInstancesPanel.delete"),e[44]=a,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]!==T||e[48]!==S||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:T,title:S,"aria-label":b,children:E}),e[47]=T,e[48]=S,e[49]=b,e[50]=z):z=e[50];let M;e[51]!==P||e[52]!==z||e[53]!==y||e[54]!==C?(M=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,C,P,z]}),e[51]=P,e[52]=z,e[53]=y,e[54]=C,e[55]=M):M=e[55];let A;return e[56]!==M||e[57]!==h||e[58]!==g||e[59]!==_?(A=t.jsxs("div",{className:h,children:[g,_,M]}),e[56]=M,e[57]=h,e[58]=g,e[59]=_,e[60]=A):A=e[60],A}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,o=F();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 a;e[5]!==n||e[6]!==c?(a=()=>c(n),e[5]=n,e[6]=c,e[7]=a):a=e[7];let r;e[8]!==o?(r=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=r):r=e[9];let d;e[10]!==o?(d=o("details.connectionInstancesPanel.configure"),e[10]=o,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ke,{size:13}),e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==r||e[15]!==d?(x=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:a,title:r,"aria-label":d,children:u})}),e[13]=a,e[14]=r,e[15]=d,e[16]=x):x=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==x?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,x]}),e[17]=i,e[18]=l,e[19]=x,e[20]=f):f=e[20],f}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,isAdding:r}=s,d=F();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 x;e[3]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=x):x=e[4];let f;e[5]!==r?(f=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(dt,{size:13}),e[5]=r,e[6]=f):f=e[6];let m;e[7]!==d?(m=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=m):m=e[8];let h;e[9]!==r||e[10]!==a||e[11]!==f||e[12]!==m?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:a,disabled:r,children:[f,m]}),e[9]=r,e[10]=a,e[11]=f,e[12]=m,e[13]=h):h=e[13];let g;e[14]!==x||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,h]}),e[14]=x,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==o||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==c||e[25]!==i||e[26]!==l?(y=C=>t.jsx(Q.Suspense,{fallback:t.jsx(Zt,{instance:C,onConfigure:c}),children:t.jsx(Jt,{instance:C,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l})},C.id),e[23]=o,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],j=n.map(y),e[17]=n,e[18]=o,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let N;e[28]!==j?(N=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=N):N=e[29];let _;return e[30]!==g||e[31]!==N?(_=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,N]}),e[30]=g,e[31]=N,e[32]=_):_=e[32],_}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const o=(c.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([c,o])=>({message:c,count:o})).sort((c,o)=>o.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:o}=s,i=F(),l=ze(),a=ns(o),{data:r}=me({queryKey:ee.connectionActivity(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Tt(r?.logs??[],a,void 0,r?.total,d?.total),x=u.data,f=u.totalCalls>0,m=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")})]})]}),f?t.jsxs("div",{children:[t.jsx(At,{config:is,className:"h-16 w-full",children:t.jsxs($t,{data:x,barCategoryGap:"4%",children:[t.jsx(Pt,{content:t.jsx(Dt,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx(Ot,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.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:x[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[x.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")})}),m.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:m.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(Mt,{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=F(),[o,i]=Q.useState("14d"),{org:l}=te();let a;e[0]!==c?(a=c("details.connectionActivity.activity"),e[0]=c,e[1]=a):a=e[1];let r;e[2]!==a?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,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]!==o?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":o===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",o===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=o,e[7]=u):u=e[7];let x;e[8]!==d||e[9]!==u?(x=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]=x):x=e[10];let f;e[11]!==r||e[12]!==x?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,x]}),e[11]=r,e[12]=x,e[13]=f):f=e[13];let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(cs,{}),e[14]=m):m=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(Q.Suspense,{fallback:m,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,h]}),e[19]=f,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,o=se();let i;e[0]!==o||e[1]!==c||e[2]!==n.id?(i=()=>{const x=crypto.randomUUID();o({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:x}})},e[0]=o,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 a;e[5]!==n.icon||e[6]!==n.title?(a=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=a):a=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(_e,{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]!==a||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:[a,r,d]}),e[11]=i,e[12]=a,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let o;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=a=>t.jsx(ms,{virtualMcp:a,org:c},a.id),e[3]=c,e[4]=l):l=e[4],o=n.map(l),e[0]=c,e[1]=n,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:o})}),e[5]=o,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=F(),{org:o}=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=Et(i);if(!(l.length>0)){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(t.Fragment,{}),e[2]=f):f=e[2],f}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]!==o.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:o.slug})}),e[7]=o.slug,e[8]=l,e[9]=u):u=e[9];let x;return e[10]!==d||e[11]!==u?(x=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=x):x=e[12],x}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:o}=s,i=F(),l=se(),{org:a}=te();let r;e[0]!==c||e[1]!==a.id||e[2]!==a.slug?(r={connectionId:c,orgId:a.id,orgSlug:a.slug},e[0]=c,e[1]=a.id,e[2]=a.slug,e[3]=r):r=e[3];const d=Ae(r),u=Ie(c);let x;e[4]!==u||e[5]!==c?(x=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=x):x=e[6];const f=x,[m,h]=Q.useState("");let g,j,N,_;if(e[7]!==f||e[8]!==d||e[9]!==l||e[10]!==o||e[11]!==m||e[12]!==i||e[13]!==n){const D=(n??[]).filter(fs),w=m.toLowerCase().trim(),$=w?D.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):D;let O;e[18]!==f||e[19]!==l||e[20]!==o?(O=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=f,e[19]=l,e[20]=o,e[21]=O):O=e[21];const P=O;N="flex flex-col h-full overflow-hidden";let T;e[22]!==i?(T=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=T):T=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=S):S=e[24],e[25]!==m||e[26]!==T?(_=t.jsx(Ft,{value:m,onChange:h,placeholder:T,onKeyDown:S}),e[25]=m,e[26]=T,e[27]=_):_=e[27],g="flex-1 overflow-auto p-5",j=$.length===0?t.jsx(Ce,{image:null,title:i(m?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(m?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:$.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>P(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Q.Suspense,{fallback:t.jsx(Ue,{className:"h-full w-full"}),children:t.jsx(Vt,{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]=f,e[8]=d,e[9]=l,e[10]=o,e[11]=m,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=N,e[17]=_}else g=e[14],j=e[15],N=e[16],_=e[17];let y;e[28]!==g||e[29]!==j?(y=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=y):y=e[30];let C;return e[31]!==N||e[32]!==_||e[33]!==y?(C=t.jsxs("div",{className:N,children:[_,y]}),e[31]=N,e[32]=_,e[33]=y,e[34]=C):C=e[34],C}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"]),o=e.map(n),i=e[e.length-1];return o.length>=2&&i&&c.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=F();let o;e[0]!==n||e[1]!==c?(o=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=o):o=e[2];let i;return e[3]!==o?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o})}),e[3]=o,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:o,connectionId:i,org:l}=s,a=c===void 0?je:c,r=o===void 0?je:o,d=F(),u=se(),x=Ie(i??"");let f;e[0]!==x||e[1]!==i?(f=x?Pe(x):i,e[0]=x,e[1]=i,e[2]=f):f=e[2];const m=f;let h;e[3]!==m||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(k){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:m,collectionName:"tools",itemId:encodeURIComponent(k)}})},e[3]=m,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 N=j;if(n.length+a.length+r.length===0){let v;e[12]!==d?(v=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=v):v=e[13];let k;e[14]!==v?(k=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:v}),e[14]=v,e[15]=k):k=e[15];let I;e[16]!==d?(I=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=I):I=e[17];let V;e[18]!==I?(V=t.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e[18]=I,e[19]=V):V=e[19];let W;return e[20]!==k||e[21]!==V?(W=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[k,V]}),e[20]=k,e[21]=V,e[22]=W):W=e[22],W}let y;e[23]!==d||e[24]!==n.length?(y=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=y):y=e[25];let C;e[26]!==y?(C=t.jsx(ie,{value:"tools",variant:"underline",children:y}),e[26]=y,e[27]=C):C=e[27];let D;e[28]!==N||e[29]!==d?(D=N&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=N,e[29]=d,e[30]=D):D=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let $;e[33]!==w?($=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=$):$=e[34];let O;e[35]!==d?(O=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=O):O=e[36];let P;e[37]!==O?(P=t.jsx(ie,{value:"resources",variant:"underline",children:O}),e[37]=O,e[38]=P):P=e[38];let T;e[39]!==$||e[40]!==P||e[41]!==C||e[42]!==D?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(zt,{variant:"underline",className:"gap-1",children:[C,D,$,P]})}),e[39]=$,e[40]=P,e[41]=C,e[42]=D,e[43]=T):T=e[43];let S;e[44]!==g||e[45]!==n?(S=n.length>0?n.map(v=>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(v.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(pt,{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(v.name)}),v.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:v.description})]}),t.jsx(_e,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},v.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=S):S=e[46];let b;e[47]!==S?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[47]=S,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==N||e[51]!==l||e[52]!==n?(E=N&&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]=N,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==a?(z=a.length>0?a.map(js):t.jsx(le,{label:"prompts"}),e[54]=a,e[55]=z):z=e[55];let M;e[56]!==z?(M=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=M):M=e[57];let A;e[58]!==r?(A=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=A):A=e[59];let R;e[60]!==A?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=R):R=e[61];let p;return e[62]!==T||e[63]!==b||e[64]!==E||e[65]!==M||e[66]!==R?(p=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Rt,{defaultValue:"tools",variant:"underline",children:[T,b,E,M,R]})}),e[62]=T,e[63]=b,e[64]=E,e[65]=M,e[66]=R,e[67]=p):p=e[67],p}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(xt,{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(Ut,{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(13),{connection:n,displayTitle:c}=s,o=c??n.title;let i;e[0]!==n.icon||e[1]!==o?(i=t.jsx(ae,{icon:n.icon,name:o,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=o,e[2]=i):i=e[2];let l;e[3]!==o?(l=t.jsx(Ve.Title,{children:o}),e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.description?(a=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=a):a=e[6];let r;e[7]!==l||e[8]!==a?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,e[9]=r):r=e[9];let d;return e[10]!==i||e[11]!==r?(d=t.jsxs("div",{className:"flex items-center px-4 md:px-8 bg-background border-b border-border shrink-0 gap-3 py-4",children:[i,r]}),e[10]=i,e[11]=r,e[12]=d):d=e[12],d}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:o}){const i=F(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Fe(),d=(()=>{if(typeof a!="string"||!a)return!1;try{const m=new URL(a);return m.hostname==="api.githubcopilot.com"&&m.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",f=x?Kt(e.connection_url):null;return x?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")})]}),f&&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:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{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:m.value,onValueChange:m.onChange,children:[t.jsx(L,{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(q,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(q,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(q,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(q,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(J,{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:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(q,{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(q,{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(q,{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(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Gt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(q,{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(G,{control:s.control,name:"npx_package",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...m,value:m.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(G,{control:s.control,name:"stdio_command",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...m,value:m.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(G,{control:s.control,name:"stdio_cwd",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Je,{value:m.value??[],onChange:m.onChange})}),t.jsx(K,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{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(Le,{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(Lt,{variant:"success",className:"gap-1.5",children:[t.jsx(Bt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(qt,{size:12})]})})}),t.jsxs(qe,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(ft,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&m.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:()=>m.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Xt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(J,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(Nt,{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 _s(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"&&Qt(s.connection_headers)){const c=s.connection_headers,o=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:o}}const i=_s(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:o}}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 Cs(s){let e,n=null,c=!1,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=tt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=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&&s.connection_token!==void 0,o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:o,prompts:i,resources:l,siblings:a}){const r=F(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),x=Te(),{org:f}=te(),m=kt({onSuccess:()=>{a.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Q.useState(null),[j,N]=Q.useState(!1),_=we({connectionId:e}),{data:y}=lt(),C=y?.data?.members??[],D=h??s,w=C.find(p=>p.userId===D.created_by),O=s?.connection_type==="VIRTUAL"||_.isAuthenticated,P={...s,tools:o},T=nt(P,Yt),S=Qe({resolver:We(Ze),values:be(h??s)}),b=S.formState.isDirty,E=async()=>{if(!await S.trigger())return;const v=S.getValues(),k=Cs(v),I=h?.id??e;await x.update.mutateAsync({id:I,data:k}),S.reset(v)},z=()=>{S.reset(be(h??s))},M=async p=>{const v=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:k,tokenInfo:I,error:V}=await ct({connectionId:p,orgSlug:f.slug,...v?{scope:v}:{}});if(V||!k){Y.error(r("details.connection.authFailed",{error:V??""}));return}if(I)try{const Z=await fetch(`/api/${f.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:I.accessToken,refreshToken:I.refreshToken,expiresIn:I.expiresIn,scope:I.scope,clientId:I.clientId,clientSecret:I.clientSecret,tokenEndpoint:I.tokenEndpoint})});if(!Z.ok)console.error("Failed to save OAuth token:",await Z.text()),await x.update.mutateAsync({id:p,data:{connection_token:k}});else try{await x.update.mutateAsync({id:p,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Z){console.error("Error saving OAuth token:",Z),await x.update.mutateAsync({id:p,data:{connection_token:k}})}else await x.update.mutateAsync({id:p,data:{connection_token:k}});const W=new URL(`/api/${f.slug}/mcp/${p}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(W.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>M(s.id),R=async()=>{try{const p=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!p.ok){const k=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:k}));return}const v=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(v.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(It,{...m}),t.jsx(ht,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(gt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(jt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(bt,{className:"text-base",children:h?.title??s.title}),t.jsx(vt,{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(St,{...S,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(G,{control:S.control,name:"title",render:({field:p})=>t.jsxs(H,{children:[t.jsx(X,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...p})}),t.jsx(K,{})]})}),t.jsx(G,{control:S.control,name:"description",render:({field:p})=>t.jsxs(H,{children:[t.jsx(X,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(K,{})]})})]}),t.jsx(Ns,{form:S,connection:h??s,hasOAuthToken:_.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:R}),t.jsx(it,{connection:h??s,form:S,hasMcpBinding:T,isMCPAuthenticated:O,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:A,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 p=h??s;g(null),m.requestDelete(p)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(ot,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(vs,{connection:s,displayTitle:(()=>{const p=a[0]??s;return p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.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:a,onConfigure:p=>g(p),onAuthenticate:p=>M(p.id),onDelete:p=>m.requestDelete(p),onToggleStatus:async(p,v)=>{try{await x.update.mutateAsync({id:p.id,data:{status:v}}),Y.success(r(v==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{N(!0);try{const p=a[0]??s,v=p.title.replace(/\s*\(\d+\)\s*$/,""),k=a.length+1,I=`${v} (${k})`,V=Ye("conn");await x.create.mutateAsync({id:V,title:I,description:p.description??null,connection_type:p.connection_type,connection_url:p.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p.created_by,organization_id:p.organization_id,icon:p.icon??null,app_name:p.app_name??null,app_id:p.app_id??null,connection_headers:p.connection_headers??null,oauth_config:null,configuration_state:p.configuration_state??null,metadata:null,tools:null,bindings:null});const W=new URL(`/api/${f.slug}/mcp/${V}`,window.location.origin),Z=await wt({url:W.href,token:null,orgId:f.id});Z.supportsOAuth&&!Z.isAuthenticated&&await M(V)}catch(p){console.error("Failed to add connection instance:",p),Y.error(r("details.connection.failedAddInstance"))}finally{N(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:o,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ks(){const s=U.c(43),e=F();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 o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug"},s[1]=o):o=s[1];const{appSlug:i,org:l}=He(o),{org:a}=te(),r=Te();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=yt(d),[x,f]=Q.useState(null),m=u.find(A=>A.id===x)??u[0]??null;m&&m.id!==x&&f(m.id);const h=m?.id??"",g=Ae({connectionId:h||null,orgId:a.id,orgSlug:a.slug});let j;s[4]!==g?(j={client:g},s[4]=g,s[5]=j):j=s[5];const{data:N}=_t(j),_=N?N.tools.map($s):(m?.tools??[]).map(Ds);let y;e:{if(u.length<=1){y=_;break e}const A=new Set,R=[],p=As;for(const v of u){const k=v.id===h?_:p(v.tools);for(const I of k)A.has(I.name)||(A.add(I.name),R.push(I))}y=R.length>0?R:_}const C=y;let D;s[6]!==g?(D={client:g},s[6]=g,s[7]=D):D=s[7];const{data:w}=Ct(D);let $;s[8]!==g?($={client:g},s[8]=g,s[9]=$):$=s[9];const{data:O}=Xe($);let P;s[10]!==w?.prompts?(P=w?.prompts??[],s[10]=w?.prompts,s[11]=P):P=s[11];let T;s[12]!==P?(T=P.map(Ts),s[12]=P,s[13]=T):T=s[13];const S=T;let b;s[14]!==O?.resources?(b=O?.resources??[],s[14]=O?.resources,s[15]=b):b=s[15];let E;s[16]!==b?(E=b.map(Is),s[16]=b,s[17]=E):E=s[17];const z=E;if(!m){let A;s[18]!==e?(A=e("details.connection.notFoundTitle"),s[18]=e,s[19]=A):A=s[19];let R;s[20]!==e?(R=e("details.connection.notFoundDescription"),s[20]=e,s[21]=R):R=s[21];let p;s[22]!==c||s[23]!==l?(p=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[22]=c,s[23]=l,s[24]=p):p=s[24];let v;s[25]!==e?(v=e("details.connection.backButton"),s[25]=e,s[26]=v):v=s[26];let k;s[27]!==p||s[28]!==v?(k=t.jsx(B,{variant:"outline",onClick:p,children:v}),s[27]=p,s[28]=v,s[29]=k):k=s[29];let I;return s[30]!==A||s[31]!==R||s[32]!==k?(I=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ce,{title:A,description:R,actions:k})}),s[30]=A,s[31]=R,s[32]=k,s[33]=I):I=s[33],I}let M;return s[34]!==r.update.isPending||s[35]!==C||s[36]!==m||s[37]!==h||s[38]!==l||s[39]!==S||s[40]!==z||s[41]!==u?(M=t.jsx(ws,{org:l,connection:m,connectionId:h,isUpdating:r.update.isPending,tools:C,prompts:S,resources:z,siblings:u}),s[34]=r.update.isPending,s[35]=C,s[36]=m,s[37]=h,s[38]=l,s[39]=S,s[40]=z,s[41]=u,s[42]=M):M=s[42],M}function Is(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(Ge,{children:t.jsx(Q.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(ks,{})})}),s[0]=e):e=s[0],e}function vi(){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{vi as default};
|
|
1
|
+
import{aD as ve,cX as Oe,cV as Me,aE as de,bU as Ee,c as U,b as F,j as t,h as Ne,B,r as Q,l as Se,a2 as te,aa as ze,R as me,K as ee,d as se,x as ye,at as _e,ff as Re,b2 as Ue,n as Ve,fE as ue,$ as Fe,I as J,X as Le,T as Be,V as qe,U as xe,H as Ge,f as He,fN as Xe,o as Ke,aC as Qe,aB as We,t as Y}from"./index-DYLoE6lZ.js";import{g as Ye}from"./extract-connection-data-DU6Jox_T.js";import{E as Ce}from"./empty-state-DvEOfDhm.js";import{E as Je,c as Ze,r as et,b as tt,d as st}from"./connection-form-helpers-DCUMal7M.js";import{c as nt,S as it,D as ot}from"./index-BrozBhiV.js";import{u as we,T as at}from"./use-mcp-auth-status-BAmLODpB.js";import{a as lt}from"./use-members-0uvS2aBL.js";import{A as rt}from"./avatar-DC1Cmzej.js";import{a as ct}from"./mcp-oauth-_2kQOfTH.js";import{I as ae}from"./integration-icon-CDrootbG.js";import{s as dt}from"./Plus-j4aDTi8e.js";import{bd as mt,ay as ut,au as xt,u as ne}from"./agent-icon-CAaO4ypa.js";import{a as ke,e as pt,s as ft}from"./Tool01-DG06N0su.js";import{s as re}from"./Trash01-C9lhbJs7.js";import{b as ht,a as gt,c as jt,S as bt,d as vt}from"./sheet-B-Hh_nak.js";import{F as G,b as H,c as X,d as L,f as K,e as Nt,a as St}from"./form-CZcQhZCa.js";import{a as Ie,b as Te,u as yt}from"./use-connection-BlwV3kYC.js";import{u as Ae}from"./use-mcp-client-CyZFCbXf.js";import{u as _t}from"./use-mcp-tools-CqwLSwPQ.js";import{a as Ct}from"./use-mcp-prompts-hbtCEuPx.js";import{i as wt}from"./mcp-oauth-hlA0Q-1K.js";import{u as kt,D as It}from"./use-delete-connection-B1009COB.js";import{c as Tt}from"./monitoring-stats-row-5gnR_PsS.js";import{d as At,C as Pt,a as Dt}from"./chart-CjiGuzpk.js";import{B as $t,a as Ot}from"./BarChart-CvyDfHpd.js";import{C as Mt}from"./tooltipContext-BJ3U7dLG.js";import{b as Et}from"./repository-binding-4wb1SqGi.js";import{T as ie,a as zt,c as oe,b as Rt}from"./tabs-DsQwfF9n.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Ut}from"./ShoppingBag01-BJ4cJNkc.js";import{g as ce}from"./types-D0iAHfi-.js";import{M as Vt}from"./mcp-app-renderer-oNRSzgIY.js";import{C as Ft}from"./collection-search-CacvIdKe.js";import{B as Lt}from"./badge-C85ocGTA.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-BTxDOmEz.js";import{i as Bt}from"./CheckCircle-DUpC1qQ4.js";import{t as qt}from"./ChevronUp-D_Wjh1Pp.js";import{n as Gt}from"./LinkBroken01-wTJMvAdz.js";import{c as Ht}from"./UserSquare-B7AJhMXA.js";import{s as Xt}from"./XClose-pteQuwAH.js";import{p as Kt,i as Qt}from"./connection-BCelELHr.js";import"./metadata-D72DunRR.js";import"./Key01-DXKey19o.js";import"./auth-CFVKU9If.js";import"./index-BG5IZjO1.js";import"./index-Box10IZB.js";import"./index-BdQq_4o_.js";import"./index-DcG5TBas.js";import"./popover-CsrTLLWE.js";import"./tooltip-D0bgPl8K.js";import"./index-Cql9s2oo.js";import"./SearchMd-DhQxjm00.js";import"./use-mobile-DsnBmTih.js";import"./use-create-virtual-mcp-CRjB3w_a.js";import"./use-navigate-to-agent-e1Fty-W6.js";import"./thread-intent-Cv8T2W7d.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-end_AVWu.js";import"./task-board-jYYT4T-P.js";import"./schema-B7T6zvOr.js";import"./slugify-CEUa2lfQ.js";import"./Image01-Drnu_oTX.js";import"./use-org-auth-client--vi1jVLH.js";import"./User01-DXN8J2dA.js";import"./AlertCircle-xh90NARB.js";import"./ArrowUp-4iK8zoCx.js";import"./ArrowLeft-Xffg7q8p.js";import"./ZoomOut-D4nHzX79.js";import"./Building02-DAEF4UrO.js";import"./ChevronSelectorVertical-DCkH1mIQ.js";import"./Copy01-BdyOQaoT.js";import"./CreditCard01-YN58MJQp.js";import"./DotsVertical-C0q218c1.js";import"./Globe04-brrhloqP.js";import"./SwitchHorizontal01-6WEEE86B.js";import"./Link01-DAwi9mlM.js";import"./Monitor01-Bm_bTKyL.js";import"./Sun-D0UkgT29.js";import"./Play-CqIDE5zC.js";import"./Upload01-Bt337Shk.js";import"./Users01-CHS_3A2d.js";import"./label-COS7xlc4.js";import"./alert-dialog-DhiFzLmM.js";import"./AreaChart-hhJtx5W4.js";import"./CategoricalChart-CMQWnNBW.js";import"./XAxis-M9-_1D7_.js";import"./symbol-CotFyP2y.js";import"./ActiveShapeUtils-C-buMql8.js";import"./Sector-Dhm7L79o.js";import"./ErrorBarContext-thUyR0rx.js";import"./url-slug-CsF5_jEJ.js";const Wt=ve({scopes:Ee(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:o,onDelete:i,onToggleStatus:l}=s,a=F();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),x=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,f=n.status!=="active",m=x||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==m?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",m),e[2]=m,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 N;e[9]!==n.status||e[10]!==f||e[11]!==x||e[12]!==a?(N=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:a("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?a("details.connectionInstancesPanel.disabledError"):a("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=x,e[12]=a,e[13]=N):N=e[13];let _;e[14]!==j||e[15]!==N?(_=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,N]}),e[14]=j,e[15]=N,e[16]=_):_=e[16];let y;e[17]!==n||e[18]!==x||e[19]!==o||e[20]!==a?(y=x&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>o(n),children:a("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=x,e[19]=o,e[20]=a,e[21]=y):y=e[21];let C;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==a?(C=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(mt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(ut,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=a,e[26]=C):C=e[26];let D;e[27]!==n||e[28]!==c?(D=()=>c(n),e[27]=n,e[28]=c,e[29]=D):D=e[29];let w;e[30]!==a?(w=a("details.connectionInstancesPanel.configure"),e[30]=a,e[31]=w):w=e[31];let $;e[32]!==a?($=a("details.connectionInstancesPanel.configure"),e[32]=a,e[33]=$):$=e[33];let O;e[34]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(ke,{size:13}),e[34]=O):O=e[34];let P;e[35]!==D||e[36]!==w||e[37]!==$?(P=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:D,title:w,"aria-label":$,children:O}),e[35]=D,e[36]=w,e[37]=$,e[38]=P):P=e[38];let T;e[39]!==n||e[40]!==i?(T=()=>i(n),e[39]=n,e[40]=i,e[41]=T):T=e[41];let S;e[42]!==a?(S=a("details.connectionInstancesPanel.delete"),e[42]=a,e[43]=S):S=e[43];let b;e[44]!==a?(b=a("details.connectionInstancesPanel.delete"),e[44]=a,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]!==T||e[48]!==S||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:T,title:S,"aria-label":b,children:E}),e[47]=T,e[48]=S,e[49]=b,e[50]=z):z=e[50];let M;e[51]!==P||e[52]!==z||e[53]!==y||e[54]!==C?(M=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,C,P,z]}),e[51]=P,e[52]=z,e[53]=y,e[54]=C,e[55]=M):M=e[55];let A;return e[56]!==M||e[57]!==h||e[58]!==g||e[59]!==_?(A=t.jsxs("div",{className:h,children:[g,_,M]}),e[56]=M,e[57]=h,e[58]=g,e[59]=_,e[60]=A):A=e[60],A}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,o=F();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 a;e[5]!==n||e[6]!==c?(a=()=>c(n),e[5]=n,e[6]=c,e[7]=a):a=e[7];let r;e[8]!==o?(r=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=r):r=e[9];let d;e[10]!==o?(d=o("details.connectionInstancesPanel.configure"),e[10]=o,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ke,{size:13}),e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==r||e[15]!==d?(x=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:a,title:r,"aria-label":d,children:u})}),e[13]=a,e[14]=r,e[15]=d,e[16]=x):x=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==x?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,x]}),e[17]=i,e[18]=l,e[19]=x,e[20]=f):f=e[20],f}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,isAdding:r}=s,d=F();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 x;e[3]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=x):x=e[4];let f;e[5]!==r?(f=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(dt,{size:13}),e[5]=r,e[6]=f):f=e[6];let m;e[7]!==d?(m=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=m):m=e[8];let h;e[9]!==r||e[10]!==a||e[11]!==f||e[12]!==m?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:a,disabled:r,children:[f,m]}),e[9]=r,e[10]=a,e[11]=f,e[12]=m,e[13]=h):h=e[13];let g;e[14]!==x||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,h]}),e[14]=x,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==o||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==c||e[25]!==i||e[26]!==l?(y=C=>t.jsx(Q.Suspense,{fallback:t.jsx(Zt,{instance:C,onConfigure:c}),children:t.jsx(Jt,{instance:C,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l})},C.id),e[23]=o,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],j=n.map(y),e[17]=n,e[18]=o,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let N;e[28]!==j?(N=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=N):N=e[29];let _;return e[30]!==g||e[31]!==N?(_=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,N]}),e[30]=g,e[31]=N,e[32]=_):_=e[32],_}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const o=(c.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([c,o])=>({message:c,count:o})).sort((c,o)=>o.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:o}=s,i=F(),l=ze(),a=ns(o),{data:r}=me({queryKey:ee.connectionActivity(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Tt(r?.logs??[],a,void 0,r?.total,d?.total),x=u.data,f=u.totalCalls>0,m=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")})]})]}),f?t.jsxs("div",{children:[t.jsx(At,{config:is,className:"h-16 w-full",children:t.jsxs($t,{data:x,barCategoryGap:"4%",children:[t.jsx(Pt,{content:t.jsx(Dt,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx(Ot,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.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:x[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[x.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")})}),m.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:m.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(Mt,{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=F(),[o,i]=Q.useState("14d"),{org:l}=te();let a;e[0]!==c?(a=c("details.connectionActivity.activity"),e[0]=c,e[1]=a):a=e[1];let r;e[2]!==a?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,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]!==o?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":o===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",o===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=o,e[7]=u):u=e[7];let x;e[8]!==d||e[9]!==u?(x=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]=x):x=e[10];let f;e[11]!==r||e[12]!==x?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,x]}),e[11]=r,e[12]=x,e[13]=f):f=e[13];let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(cs,{}),e[14]=m):m=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(Q.Suspense,{fallback:m,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,h]}),e[19]=f,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,o=se();let i;e[0]!==o||e[1]!==c||e[2]!==n.id?(i=()=>{const x=crypto.randomUUID();o({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:x}})},e[0]=o,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 a;e[5]!==n.icon||e[6]!==n.title?(a=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=a):a=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(_e,{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]!==a||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:[a,r,d]}),e[11]=i,e[12]=a,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let o;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=a=>t.jsx(ms,{virtualMcp:a,org:c},a.id),e[3]=c,e[4]=l):l=e[4],o=n.map(l),e[0]=c,e[1]=n,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:o})}),e[5]=o,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=F(),{org:o}=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=Et(i);if(!(l.length>0)){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(t.Fragment,{}),e[2]=f):f=e[2],f}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]!==o.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:o.slug})}),e[7]=o.slug,e[8]=l,e[9]=u):u=e[9];let x;return e[10]!==d||e[11]!==u?(x=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=x):x=e[12],x}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:o}=s,i=F(),l=se(),{org:a}=te();let r;e[0]!==c||e[1]!==a.id||e[2]!==a.slug?(r={connectionId:c,orgId:a.id,orgSlug:a.slug},e[0]=c,e[1]=a.id,e[2]=a.slug,e[3]=r):r=e[3];const d=Ae(r),u=Ie(c);let x;e[4]!==u||e[5]!==c?(x=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=x):x=e[6];const f=x,[m,h]=Q.useState("");let g,j,N,_;if(e[7]!==f||e[8]!==d||e[9]!==l||e[10]!==o||e[11]!==m||e[12]!==i||e[13]!==n){const D=(n??[]).filter(fs),w=m.toLowerCase().trim(),$=w?D.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):D;let O;e[18]!==f||e[19]!==l||e[20]!==o?(O=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=f,e[19]=l,e[20]=o,e[21]=O):O=e[21];const P=O;N="flex flex-col h-full overflow-hidden";let T;e[22]!==i?(T=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=T):T=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=S):S=e[24],e[25]!==m||e[26]!==T?(_=t.jsx(Ft,{value:m,onChange:h,placeholder:T,onKeyDown:S}),e[25]=m,e[26]=T,e[27]=_):_=e[27],g="flex-1 overflow-auto p-5",j=$.length===0?t.jsx(Ce,{image:null,title:i(m?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(m?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:$.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>P(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Q.Suspense,{fallback:t.jsx(Ue,{className:"h-full w-full"}),children:t.jsx(Vt,{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]=f,e[8]=d,e[9]=l,e[10]=o,e[11]=m,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=N,e[17]=_}else g=e[14],j=e[15],N=e[16],_=e[17];let y;e[28]!==g||e[29]!==j?(y=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=y):y=e[30];let C;return e[31]!==N||e[32]!==_||e[33]!==y?(C=t.jsxs("div",{className:N,children:[_,y]}),e[31]=N,e[32]=_,e[33]=y,e[34]=C):C=e[34],C}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"]),o=e.map(n),i=e[e.length-1];return o.length>=2&&i&&c.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=F();let o;e[0]!==n||e[1]!==c?(o=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=o):o=e[2];let i;return e[3]!==o?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o})}),e[3]=o,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:o,connectionId:i,org:l}=s,a=c===void 0?je:c,r=o===void 0?je:o,d=F(),u=se(),x=Ie(i??"");let f;e[0]!==x||e[1]!==i?(f=x?Pe(x):i,e[0]=x,e[1]=i,e[2]=f):f=e[2];const m=f;let h;e[3]!==m||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(k){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:m,collectionName:"tools",itemId:encodeURIComponent(k)}})},e[3]=m,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 N=j;if(n.length+a.length+r.length===0){let v;e[12]!==d?(v=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=v):v=e[13];let k;e[14]!==v?(k=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:v}),e[14]=v,e[15]=k):k=e[15];let I;e[16]!==d?(I=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=I):I=e[17];let V;e[18]!==I?(V=t.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e[18]=I,e[19]=V):V=e[19];let W;return e[20]!==k||e[21]!==V?(W=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[k,V]}),e[20]=k,e[21]=V,e[22]=W):W=e[22],W}let y;e[23]!==d||e[24]!==n.length?(y=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=y):y=e[25];let C;e[26]!==y?(C=t.jsx(ie,{value:"tools",variant:"underline",children:y}),e[26]=y,e[27]=C):C=e[27];let D;e[28]!==N||e[29]!==d?(D=N&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=N,e[29]=d,e[30]=D):D=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let $;e[33]!==w?($=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=$):$=e[34];let O;e[35]!==d?(O=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=O):O=e[36];let P;e[37]!==O?(P=t.jsx(ie,{value:"resources",variant:"underline",children:O}),e[37]=O,e[38]=P):P=e[38];let T;e[39]!==$||e[40]!==P||e[41]!==C||e[42]!==D?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(zt,{variant:"underline",className:"gap-1",children:[C,D,$,P]})}),e[39]=$,e[40]=P,e[41]=C,e[42]=D,e[43]=T):T=e[43];let S;e[44]!==g||e[45]!==n?(S=n.length>0?n.map(v=>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(v.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(pt,{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(v.name)}),v.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:v.description})]}),t.jsx(_e,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},v.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=S):S=e[46];let b;e[47]!==S?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[47]=S,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==N||e[51]!==l||e[52]!==n?(E=N&&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]=N,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==a?(z=a.length>0?a.map(js):t.jsx(le,{label:"prompts"}),e[54]=a,e[55]=z):z=e[55];let M;e[56]!==z?(M=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=M):M=e[57];let A;e[58]!==r?(A=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=A):A=e[59];let R;e[60]!==A?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=R):R=e[61];let p;return e[62]!==T||e[63]!==b||e[64]!==E||e[65]!==M||e[66]!==R?(p=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Rt,{defaultValue:"tools",variant:"underline",children:[T,b,E,M,R]})}),e[62]=T,e[63]=b,e[64]=E,e[65]=M,e[66]=R,e[67]=p):p=e[67],p}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(xt,{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(Ut,{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(13),{connection:n,displayTitle:c}=s,o=c??n.title;let i;e[0]!==n.icon||e[1]!==o?(i=t.jsx(ae,{icon:n.icon,name:o,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=o,e[2]=i):i=e[2];let l;e[3]!==o?(l=t.jsx(Ve.Title,{children:o}),e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.description?(a=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=a):a=e[6];let r;e[7]!==l||e[8]!==a?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,e[9]=r):r=e[9];let d;return e[10]!==i||e[11]!==r?(d=t.jsxs("div",{className:"flex items-center px-4 md:px-8 bg-background border-b border-border shrink-0 gap-3 py-4",children:[i,r]}),e[10]=i,e[11]=r,e[12]=d):d=e[12],d}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:o}){const i=F(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Fe(),d=(()=>{if(typeof a!="string"||!a)return!1;try{const m=new URL(a);return m.hostname==="api.githubcopilot.com"&&m.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",f=x?Kt(e.connection_url):null;return x?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")})]}),f&&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:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{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:m.value,onValueChange:m.onChange,children:[t.jsx(L,{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(q,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(q,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(q,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(q,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(J,{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:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(q,{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(q,{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(q,{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(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Gt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(q,{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(G,{control:s.control,name:"npx_package",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...m,value:m.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(G,{control:s.control,name:"stdio_command",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...m,value:m.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(G,{control:s.control,name:"stdio_cwd",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Je,{value:m.value??[],onChange:m.onChange})}),t.jsx(K,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{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(Le,{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(Lt,{variant:"success",className:"gap-1.5",children:[t.jsx(Bt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(qt,{size:12})]})})}),t.jsxs(qe,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(ft,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&m.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:()=>m.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Xt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(J,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(Nt,{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 _s(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"&&Qt(s.connection_headers)){const c=s.connection_headers,o=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:o}}const i=_s(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:o}}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 Cs(s){let e,n=null,c=!1,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=tt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=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&&s.connection_token!==void 0,o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:o,prompts:i,resources:l,siblings:a}){const r=F(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),x=Te(),{org:f}=te(),m=kt({onSuccess:()=>{a.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Q.useState(null),[j,N]=Q.useState(!1),_=we({connectionId:e}),{data:y}=lt(),C=y?.data?.members??[],D=h??s,w=C.find(p=>p.userId===D.created_by),O=s?.connection_type==="VIRTUAL"||_.isAuthenticated,P={...s,tools:o},T=nt(P,Yt),S=Qe({resolver:We(Ze),values:be(h??s)}),b=S.formState.isDirty,E=async()=>{if(!await S.trigger())return;const v=S.getValues(),k=Cs(v),I=h?.id??e;await x.update.mutateAsync({id:I,data:k}),S.reset(v)},z=()=>{S.reset(be(h??s))},M=async p=>{const v=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:k,tokenInfo:I,error:V}=await ct({connectionId:p,orgSlug:f.slug,...v?{scope:v}:{}});if(V||!k){Y.error(r("details.connection.authFailed",{error:V??""}));return}if(I)try{const Z=await fetch(`/api/${f.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:I.accessToken,refreshToken:I.refreshToken,expiresIn:I.expiresIn,scope:I.scope,clientId:I.clientId,clientSecret:I.clientSecret,tokenEndpoint:I.tokenEndpoint})});if(!Z.ok)console.error("Failed to save OAuth token:",await Z.text()),await x.update.mutateAsync({id:p,data:{connection_token:k}});else try{await x.update.mutateAsync({id:p,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Z){console.error("Error saving OAuth token:",Z),await x.update.mutateAsync({id:p,data:{connection_token:k}})}else await x.update.mutateAsync({id:p,data:{connection_token:k}});const W=new URL(`/api/${f.slug}/mcp/${p}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(W.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>M(s.id),R=async()=>{try{const p=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!p.ok){const k=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:k}));return}const v=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(v.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(It,{...m}),t.jsx(ht,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(gt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(jt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(bt,{className:"text-base",children:h?.title??s.title}),t.jsx(vt,{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(St,{...S,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(G,{control:S.control,name:"title",render:({field:p})=>t.jsxs(H,{children:[t.jsx(X,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...p})}),t.jsx(K,{})]})}),t.jsx(G,{control:S.control,name:"description",render:({field:p})=>t.jsxs(H,{children:[t.jsx(X,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(K,{})]})})]}),t.jsx(Ns,{form:S,connection:h??s,hasOAuthToken:_.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:R}),t.jsx(it,{connection:h??s,form:S,hasMcpBinding:T,isMCPAuthenticated:O,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:A,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 p=h??s;g(null),m.requestDelete(p)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(ot,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(vs,{connection:s,displayTitle:(()=>{const p=a[0]??s;return p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.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:a,onConfigure:p=>g(p),onAuthenticate:p=>M(p.id),onDelete:p=>m.requestDelete(p),onToggleStatus:async(p,v)=>{try{await x.update.mutateAsync({id:p.id,data:{status:v}}),Y.success(r(v==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{N(!0);try{const p=a[0]??s,v=p.title.replace(/\s*\(\d+\)\s*$/,""),k=a.length+1,I=`${v} (${k})`,V=Ye("conn");await x.create.mutateAsync({id:V,title:I,description:p.description??null,connection_type:p.connection_type,connection_url:p.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p.created_by,organization_id:p.organization_id,icon:p.icon??null,app_name:p.app_name??null,app_id:p.app_id??null,connection_headers:p.connection_headers??null,oauth_config:null,configuration_state:p.configuration_state??null,metadata:null,tools:null,bindings:null});const W=new URL(`/api/${f.slug}/mcp/${V}`,window.location.origin),Z=await wt({url:W.href,token:null,orgId:f.id});Z.supportsOAuth&&!Z.isAuthenticated&&await M(V)}catch(p){console.error("Failed to add connection instance:",p),Y.error(r("details.connection.failedAddInstance"))}finally{N(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:o,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ks(){const s=U.c(43),e=F();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 o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug"},s[1]=o):o=s[1];const{appSlug:i,org:l}=He(o),{org:a}=te(),r=Te();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=yt(d),[x,f]=Q.useState(null),m=u.find(A=>A.id===x)??u[0]??null;m&&m.id!==x&&f(m.id);const h=m?.id??"",g=Ae({connectionId:h||null,orgId:a.id,orgSlug:a.slug});let j;s[4]!==g?(j={client:g},s[4]=g,s[5]=j):j=s[5];const{data:N}=_t(j),_=N?N.tools.map($s):(m?.tools??[]).map(Ds);let y;e:{if(u.length<=1){y=_;break e}const A=new Set,R=[],p=As;for(const v of u){const k=v.id===h?_:p(v.tools);for(const I of k)A.has(I.name)||(A.add(I.name),R.push(I))}y=R.length>0?R:_}const C=y;let D;s[6]!==g?(D={client:g},s[6]=g,s[7]=D):D=s[7];const{data:w}=Ct(D);let $;s[8]!==g?($={client:g},s[8]=g,s[9]=$):$=s[9];const{data:O}=Xe($);let P;s[10]!==w?.prompts?(P=w?.prompts??[],s[10]=w?.prompts,s[11]=P):P=s[11];let T;s[12]!==P?(T=P.map(Ts),s[12]=P,s[13]=T):T=s[13];const S=T;let b;s[14]!==O?.resources?(b=O?.resources??[],s[14]=O?.resources,s[15]=b):b=s[15];let E;s[16]!==b?(E=b.map(Is),s[16]=b,s[17]=E):E=s[17];const z=E;if(!m){let A;s[18]!==e?(A=e("details.connection.notFoundTitle"),s[18]=e,s[19]=A):A=s[19];let R;s[20]!==e?(R=e("details.connection.notFoundDescription"),s[20]=e,s[21]=R):R=s[21];let p;s[22]!==c||s[23]!==l?(p=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[22]=c,s[23]=l,s[24]=p):p=s[24];let v;s[25]!==e?(v=e("details.connection.backButton"),s[25]=e,s[26]=v):v=s[26];let k;s[27]!==p||s[28]!==v?(k=t.jsx(B,{variant:"outline",onClick:p,children:v}),s[27]=p,s[28]=v,s[29]=k):k=s[29];let I;return s[30]!==A||s[31]!==R||s[32]!==k?(I=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ce,{title:A,description:R,actions:k})}),s[30]=A,s[31]=R,s[32]=k,s[33]=I):I=s[33],I}let M;return s[34]!==r.update.isPending||s[35]!==C||s[36]!==m||s[37]!==h||s[38]!==l||s[39]!==S||s[40]!==z||s[41]!==u?(M=t.jsx(ws,{org:l,connection:m,connectionId:h,isUpdating:r.update.isPending,tools:C,prompts:S,resources:z,siblings:u}),s[34]=r.update.isPending,s[35]=C,s[36]=m,s[37]=h,s[38]=l,s[39]=S,s[40]=z,s[41]=u,s[42]=M):M=s[42],M}function Is(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(Ge,{children:t.jsx(Q.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(ks,{})})}),s[0]=e):e=s[0],e}function vi(){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{vi as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as R,cX as A,cV as I,aE as o,bU as j,bT as z,c as L,j as u,I as C,B as H}from"./index-
|
|
1
|
+
import{aD as R,cX as A,cV as I,aE as o,bU as j,bT as z,c as L,j as u,I as C,B as H}from"./index-DYLoE6lZ.js";import{s as W}from"./Plus-j4aDTi8e.js";import{s as U}from"./Trash01-C9lhbJs7.js";const q=R({key:o().min(1,"Key is required"),value:o()}),B=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(q).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 K(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(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function G(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:s,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=s===void 0?"value...":s;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 N=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==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 i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},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 i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},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,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(C,{placeholder:m,value:p.key,onChange:c=>g(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(C,{type:K(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(i),children:u.jsx(U,{size:16})})]},i),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]!==N?(d=u.jsxs(H,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,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 M(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function S(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 D(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(s=>!s.startsWith("-"));return a?{packageName:a}:null}function F(n){const{uiType:e}=n,t=S(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===S("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 Y(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=S(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>S(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 Q(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const s=V(r);return Object.keys(s).length>0&&(a.envVars=s),a}export{G as E,Y as a,J as b,B as c,Q as d,F as i,D as p,M as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as z,c as W,b as te,j as t,B as E,h as de,l as he,U as ie,v as ke,aK as Te,s as we,w as Ae,q as Ie,D as Pe,T as We,X as Xe,V as Ge,H as Qe,a2 as Me,d as $e,u as qe,a as Oe,$ as Je,am as ye,a0 as Ye,a1 as Ze,aC as et,aB as tt,n as pe,I as se,y as ee,o as nt,aa as st,t as R,b6 as ot,K as it}from"./index-Bm9FTdjr.js";import{a as Fe,g as ct,e as lt}from"./extract-connection-data-BTBLhbEe.js";import{C as rt}from"./collection-display-button-YyNX5Efp.js";import{S as at}from"./search-input-D-uP0R3f.js";import{C as dt}from"./collection-tabs-DeQ7zbGh.js";import{C as Ce,u as Ue,g as ut}from"./connection-card-BVD8Ppl9.js";import{E as gt}from"./empty-state-Zf0MeIMv.js";import{u as mt,D as pt}from"./use-delete-connection-DUG0172F.js";import{u as ft}from"./use-infinite-scroll-DewChEmc.js";import{u as Ve}from"./use-mobile-UYmsi-dp.js";import{g as ae}from"./connection-slug-CITJ0kGN.js";import{A as ht,a as xt,b as jt,c as St,g as yt,d as Ct,e as vt,f as bt}from"./alert-dialog-BXEG2ySJ.js";import{n as xe}from"./LinkBroken01-BZFZ6N-h.js";import{g as _t,a as Nt}from"./metadata-D72DunRR.js";import{D as Dt,a as kt,d as Tt,b as wt,e as At,f as It,g as Pt}from"./drawer-BPz4t5dt.js";import{F as Q,b as q,c as J,d as Y,f as Z,a as Ne}from"./form-BCYpCYIL.js";import{S as Mt,b as $t,a as Ot,d as Ft,c as re}from"./select-BVEgIanS.js";import{T as Ut}from"./textarea-bcNEcwC6.js";import{b as ze,u as Vt}from"./use-connection-DUF3XC9E.js";import{m as zt}from"./use-mcp-client-Dh_4AZgb.js";import{b as Lt}from"./repository-binding-D2wL-4Vr.js";import{g as Et}from"./types-2TlDAuAc.js";import{A as Bt,bA as Kt,ay as Ht,bd as Rt,u as Se}from"./agent-icon-BewGjsar.js";import{s as Le}from"./Plus-XYNDZJ4s.js";import{c as Wt}from"./UserSquare-CuRnLJZ6.js";import{s as Ee}from"./XClose-DjFCAP5F.js";import{s as Xt}from"./use-project-scope-BxCbtcTE.js";import{i as fe,a as De,E as Gt,c as Qt,p as qt,b as Jt,d as Yt}from"./connection-form-helpers-5EXuPZ4G.js";import{a as Zt}from"./authenticate-and-persist-oauth-BEdNWkUl.js";import{I as en}from"./integration-icon-DoYtKqdf.js";import{C as Be}from"./checkbox-DmaIcPoL.js";import{i as tn}from"./DotsVertical-3XBYz4yU.js";import{s as Ke}from"./Image01-DdBetDCI.js";import{s as He}from"./Trash01-DZ8laRwu.js";import"./connection-BjzBHJVc.js";import"./url-slug-B-L2Z8me.js";import"./ArrowUp-CP6XCJnB.js";import"./SwitchHorizontal01-BHr8jCjb.js";import"./tooltip-XZmQWwgB.js";import"./index-D2iZ6syL.js";import"./view-mode-toggle-DPJfZa3C.js";import"./badge-DFdotQFQ.js";import"./SearchMd-BFitEH5z.js";import"./useInfiniteQuery-vZqvTY4f.js";import"./infiniteQueryObserver-zxl9Rj5F.js";import"./slugify-CEUa2lfQ.js";import"./label-BL2W0Pcn.js";import"./index-BdQq_4o_.js";import"./ChevronUp-nynZHATg.js";import"./auth-Dwu4WH32.js";import"./AlertCircle-B5gBB9h_.js";import"./Tool01-DQnW-zjg.js";import"./ArrowLeft-B7455tPl.js";import"./ShoppingBag01-Ci8H67G0.js";import"./ZoomOut-BggitXDv.js";import"./Building02-BZItaEYx.js";import"./CheckCircle-C3CiaCW4.js";import"./ChevronSelectorVertical-DIPs2sw-.js";import"./Copy01-CdRMK9o7.js";import"./CreditCard01-DVQTLvKO.js";import"./Globe04-DoxNod_i.js";import"./Key01-DcSonP-G.js";import"./Link01-3BacRGrf.js";import"./Monitor01-DU19-CHk.js";import"./Sun-D1Mdg8Cq.js";import"./Play-B7i_-ibU.js";import"./Upload01-CrRTpeMX.js";import"./User01-9bZ-cKa7.js";import"./Users01-cUGZjxDe.js";import"./mcp-oauth-4gmyTyah.js";import"./mcp-oauth-BTa4N28L.js";function nn(s){const e=`deco-filters-${s}`,[n,g]=z.useState(()=>{try{const i=globalThis.localStorage?.getItem(e);if(i)return JSON.parse(i)}catch(i){console.error("Failed to parse stored filters:",i)}return[]});return[n,i=>{g(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(l){console.error("Failed to save filters:",l)}}]}function sn(s){const e=W.c(7),[n,g]=z.useState(s),[o,i]=z.useState(s?"desc":null);let l;e[0]!==o||e[1]!==n?(l=p=>{n!==p?(g(p),i("asc")):o==="asc"?i("desc"):o==="desc"&&(g(void 0),i(null))},e[0]=o,e[1]=n,e[2]=l):l=e[2];const r=l;let d;return e[3]!==r||e[4]!==o||e[5]!==n?(d={sortKey:n,sortDirection:o,handleSort:r},e[3]=r,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function on(s,e){const n=W.c(12),g=e===void 0?"cards":e,o=Ve(),i=z.useRef(o),l=s?`deco-view-mode-${s}`:"deco-view-mode";let r;n[0]!==g||n[1]!==l?(r=()=>{const j=globalThis.localStorage?.getItem(l);return j==="cards"||j==="table"?j:g},n[0]=g,n[1]=l,n[2]=r):r=n[2];const[d,p]=z.useState(r);let m;n[3]!==l?(m=j=>{p(j),globalThis.localStorage?.setItem(l,j)},n[3]=l,n[4]=m):m=n[4];const u=m;let a,x;n[5]!==o||n[6]!==d?(a=()=>{!i.current&&o&&d==="table"&&p("cards"),i.current=o},x=[o,d],n[5]=o,n[6]=d,n[7]=a,n[8]=x):(a=n[7],x=n[8]),z.useEffect(a,x);let f;return n[9]!==u||n[10]!==d?(f=[d,u],n[9]=u,n[10]=d,n[11]=f):f=n[11],f}function cn(s){const e=W.c(20),{namespace:n,resource:g,defaultSortKey:o,defaultViewMode:i}=s,l=o===void 0?"title":o,r=i===void 0?"table":i,[d,p]=z.useState(""),m=z.useDeferredValue(d),u=`${n}-${g}`,[a,x]=nn(u),f=`studio-${g}-filter-visible-${n}`;let j;e[0]!==f?(j=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=j):j=e[1];const[S,C]=z.useState(j);let y;e[2]!==f?(y=$=>{C($),globalThis.localStorage?.setItem(f,String($))},e[2]=f,e[3]=y):y=e[3];const c=y;let h;e[4]!==S||e[5]!==c?(h=()=>{c(!S)},e[4]=S,e[5]=c,e[6]=h):h=e[6];const A=h,[T,w]=on(`studio-${g}-${n}`,r),{sortKey:M,sortDirection:I,handleSort:O}=sn(l),P=M;let D;return e[7]!==S||e[8]!==a||e[9]!==O||e[10]!==d||e[11]!==m||e[12]!==c||e[13]!==x||e[14]!==w||e[15]!==I||e[16]!==P||e[17]!==A||e[18]!==T?(D={search:d,searchTerm:m,setSearch:p,filters:a,setFilters:x,filterBarVisible:S,setFilterBarVisible:c,toggleFilterBar:A,viewMode:T,setViewMode:w,sortKey:P,sortDirection:I,handleSort:O},e[7]=S,e[8]=a,e[9]=O,e[10]=d,e[11]=m,e[12]=c,e[13]=x,e[14]=w,e[15]=I,e[16]=P,e[17]=A,e[18]=T,e[19]=D):D=e[19],D}function ln(s){const e=W.c(35),{open:n,onOpenChange:g,count:o,onConfirm:i}=s,l=te(),r=o===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==o||e[1]!==l||e[2]!==r?(d=l(r,{count:o}),e[0]=o,e[1]=l,e[2]=r,e[3]=d):d=e[3];let p;e[4]!==d?(p=t.jsx(ht,{children:d}),e[4]=d,e[5]=p):p=e[5];const m=o===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==l||e[7]!==m?(u=l(m),e[6]=l,e[7]=m,e[8]=u):u=e[8];let a;e[9]!==u?(a=t.jsx(xt,{children:u}),e[9]=u,e[10]=a):a=e[10];let x;e[11]!==p||e[12]!==a?(x=t.jsxs(jt,{children:[p,a]}),e[11]=p,e[12]=a,e[13]=x):x=e[13];let f;e[14]!==l?(f=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx(St,{children:f}),e[16]=f,e[17]=j):j=e[17];const S=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let C;e[18]!==o||e[19]!==l||e[20]!==S?(C=l(S,{count:o}),e[18]=o,e[19]=l,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==i||e[23]!==C?(y=t.jsx(yt,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:C}),e[22]=i,e[23]=C,e[24]=y):y=e[24];let c;e[25]!==y||e[26]!==j?(c=t.jsxs(Ct,{children:[j,y]}),e[25]=y,e[26]=j,e[27]=c):c=e[27];let h;e[28]!==c||e[29]!==x?(h=t.jsxs(vt,{children:[x,c]}),e[28]=c,e[29]=x,e[30]=h):h=e[30];let A;return e[31]!==g||e[32]!==n||e[33]!==h?(A=t.jsx(bt,{open:n,onOpenChange:g,children:h}),e[31]=g,e[32]=n,e[33]=h,e[34]=A):A=e[34],A}function rn(s){const e=W.c(39),{item:n,canManage:g,allConnections:o,connectedAppNames:i,connectingItemId:l,onNavigateConnected:r,onConnect:d}=s,p=te();let m,u;e[0]!==i||e[1]!==n?(m=Fe(n)??"",u=i.has(m),e[0]=i,e[1]=n,e[2]=m,e[3]=u):(m=e[2],u=e[3]);const a=u;let x;e[4]!==n._meta?(x=_t(n._meta),e[4]=n._meta,e[5]=x):x=e[5];const f=x,j=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",S=n.server?.description||n.description||null;let C;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(C=n.server?.icons?.[0]?.src||Nt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=C):C=e[8];const y=C;let c;if(e[9]!==o||e[10]!==m){let V;e[12]!==m?(V=b=>b.connection_type!=="VIRTUAL"&&b.app_name===m,e[12]=m,e[13]=V):V=e[13],c=o.filter(V),e[9]=o,e[10]=m,e[11]=c}else c=e[11];const h=c,A=a||g;let T,w;e[14]!==h||e[15]!==a||e[16]!==n||e[17]!==d||e[18]!==r?(T=()=>{if(a){const V=h[0];V&&r(V);return}w()},w=()=>d(n),e[14]=h,e[15]=a,e[16]=n,e[17]=d,e[18]=r,e[19]=T,e[20]=w):(T=e[19],w=e[20]);let M;e[21]!==S||e[22]!==y||e[23]!==j?(M={title:j,description:S,icon:y},e[21]=S,e[22]=y,e[23]=j,e[24]=M):M=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(xe,{}),e[25]=I):I=e[25];const O=A?T:void 0;let P;e[26]!==g||e[27]!==l||e[28]!==w||e[29]!==a||e[30]!==n.id||e[31]!==p?(P=a?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:p("orgs.catalogItemCard.connected")}):g&&t.jsx(E,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:l!==null,onClick:V=>{V.stopPropagation(),w()},children:l===n.id?t.jsx(de,{className:"size-3.5"}):p("orgs.catalogItemCard.connect")}),e[26]=g,e[27]=l,e[28]=w,e[29]=a,e[30]=n.id,e[31]=p,e[32]=P):P=e[32];let D;e[33]!==P?(D=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=D):D=e[34];let $;return e[35]!==M||e[36]!==O||e[37]!==D?($=t.jsx(Ce,{connection:M,fallbackIcon:I,onClick:O,headerActionsAlwaysVisible:!0,headerActions:D}),e[35]=M,e[36]=O,e[37]=D,e[38]=$):$=e[38],$}function an(s){return s?.length?{appToolName:s.find(n=>!!Et(n._meta))?.name??null}:null}const dn=3;function un(s){const e=new Map;for(const n of s)for(const g of n.connections??[]){const o=e.get(g.connection_id)??[];o.push(n),e.set(g.connection_id,o)}return e}function gn(s){const e=W.c(21),{projects:n}=s,g=te();if(n.length===0){let u;e[0]!==g?(u=g("projects.connections.orgWide"),e[0]=g,e[1]=u):u=e[1];let a;return e[2]!==u?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=a):a=e[3],a}let o,i,l;if(e[4]!==n){const u=n.slice(0,dn);l="flex min-w-0 items-center gap-2",o="flex shrink-0 -space-x-1.5",i=u.map(mn),e[4]=n,e[5]=o,e[6]=i,e[7]=l}else o=e[5],i=e[6],l=e[7];let r;e[8]!==o||e[9]!==i?(r=t.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=r):r=e[10];let d;e[11]!==n[0]?.title||e[12]!==n.length||e[13]!==g?(d=n.length===1?n[0]?.title:g("projects.connections.usedBy",{count:n.length}),e[11]=n[0]?.title,e[12]=n.length,e[13]=g,e[14]=d):d=e[14];let p;e[15]!==d?(p=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:d}),e[15]=d,e[16]=p):p=e[16];let m;return e[17]!==l||e[18]!==r||e[19]!==p?(m=t.jsxs("div",{className:l,children:[r,p]}),e[17]=l,e[18]=r,e[19]=p,e[20]=m):m=e[20],m}function mn(s){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:s.title,children:t.jsx(Bt,{icon:s.icon,name:s.title,size:"xs"})},s.id)}function Re(s){const e=W.c(8),{selectionMode:n,children:g}=s,o=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let i;e[0]!==o?(i=he("overflow-hidden transition-all duration-150 ease-out",o),e[0]=o,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(We,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:fn,children:t.jsx(tn,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==g?(r=t.jsxs(Xe,{children:[l,t.jsx(Ge,{align:"end",onClick:pn,children:g})]}),e[3]=g,e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==r?(d=t.jsx("div",{className:i,children:r}),e[5]=i,e[6]=r,e[7]=d):d=e[7],d}function pn(s){return s.stopPropagation()}function fn(s){return s.stopPropagation()}function hn(s){const e=W.c(57),{group:n,onOpen:g,selectionMode:o,selectedIds:i,onToggleSelect:l}=s,r=te();let d;if(e[0]!==n.connections||e[1]!==i){let N;e[3]!==i?(N=U=>i.has(U.id),e[3]=i,e[4]=N):N=e[4],d=n.connections.every(N),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const p=d;let m;if(e[5]!==n.connections||e[6]!==i){let N;e[8]!==i?(N=U=>i.has(U.id),e[8]=i,e[9]=N):N=e[9],m=n.connections.some(N),e[5]=n.connections,e[6]=i,e[7]=m}else m=e[7];const u=m;let a;e[10]!==p||e[11]!==n.connections||e[12]!==l||e[13]!==i?(a=()=>{for(const N of n.connections)p?i.has(N.id)&&l(N.id):i.has(N.id)||l(N.id)},e[10]=p,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=a):a=e[14];const x=a,f=n.title,j=n.icon;let S;e[15]!==n.connections.length||e[16]!==r?(S=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=S):S=e[17];let C;e[18]!==n.icon||e[19]!==n.title||e[20]!==S?(C={title:f,icon:j,description:S},e[18]=n.icon,e[19]=n.title,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==g||e[23]!==o||e[24]!==x?(y=()=>o?x():g(),e[22]=g,e[23]=o,e[24]=x,e[25]=y):y=e[25];const c=o&&p&&"ring-2 ring-primary",h=o&&u&&!p&&"ring-1 ring-primary/50";let A;e[26]!==h||e[27]!==c?(A=he(c,h),e[26]=h,e[27]=c,e[28]=A):A=e[28];const T=o?p?!0:u&&"mixed":void 0;let w;e[29]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(xe,{}),e[29]=w):w=e[29];let M;e[30]!==p||e[31]!==n.connections.length||e[32]!==o||e[33]!==u||e[34]!==r||e[35]!==x?(M=o?t.jsx(Be,{checked:p?!0:u?"indeterminate":!1,onCheckedChange:x}):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]=p,e[31]=n.connections.length,e[32]=o,e[33]=u,e[34]=r,e[35]=x,e[36]=M):M=e[36];let I;e[37]!==g?(I=N=>{N.stopPropagation(),g()},e[37]=g,e[38]=I):I=e[38];let O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Ke,{size:16}),e[39]=O):O=e[39];let P;e[40]!==r?(P=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=P):P=e[41];let D;e[42]!==I||e[43]!==P?(D=t.jsxs(ie,{onClick:I,children:[O,P]}),e[42]=I,e[43]=P,e[44]=D):D=e[44];let $;e[45]!==o||e[46]!==D?($=t.jsx(Re,{selectionMode:o,children:D}),e[45]=o,e[46]=D,e[47]=$):$=e[47];let V;e[48]!==M||e[49]!==$?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[M,$]}),e[48]=M,e[49]=$,e[50]=V):V=e[50];let b;return e[51]!==A||e[52]!==T||e[53]!==V||e[54]!==C||e[55]!==y?(b=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:C,onClick:y,className:A,selected:T,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=A,e[52]=T,e[53]=V,e[54]=C,e[55]=y,e[56]=b):b=e[56],b}function xn(s){const e=W.c(36),{connection:n,isSelected:g,selectionMode:o,canManage:i,canManageAgents:l,onToggleSelect:r,onOpen:d,onToggleStatus:p,onDelete:m}=s,u=te();let a;e[0]!==g||e[1]!==r||e[2]!==o||e[3]!==u?(a=o?t.jsx(Be,{checked:g,onCheckedChange:r,onClick:jn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=g,e[1]=r,e[2]=o,e[3]=u,e[4]=a):a=e[4];let x;e[5]!==d?(x=T=>{T.stopPropagation(),d()},e[5]=d,e[6]=x):x=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ke,{size:16}),e[7]=f):f=e[7];let j;e[8]!==u?(j=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=j):j=e[9];let S;e[10]!==x||e[11]!==j?(S=t.jsxs(ie,{onClick:x,children:[f,j]}),e[10]=x,e[11]=j,e[12]=S):S=e[12];let C;e[13]!==i||e[14]!==l||e[15]!==r||e[16]!==u?(C=(i||l)&&t.jsxs(ie,{onClick:T=>{T.stopPropagation(),r()},children:[t.jsx(Kt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=r,e[16]=u,e[17]=C):C=e[17];let y;e[18]!==i||e[19]!==n||e[20]!==p||e[21]!==u?(y=i&&(n.status==="active"?t.jsxs(ie,{onClick:T=>{T.stopPropagation(),p("inactive")},children:[t.jsx(Ht,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ie,{onClick:T=>{T.stopPropagation(),p("active")},children:[t.jsx(Rt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=p,e[21]=u,e[22]=y):y=e[22];let c;e[23]!==i||e[24]!==m||e[25]!==u?(c=i&&t.jsxs(ie,{variant:"destructive",onClick:T=>{T.stopPropagation(),m()},children:[t.jsx(He,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=m,e[25]=u,e[26]=c):c=e[26];let h;e[27]!==o||e[28]!==S||e[29]!==C||e[30]!==y||e[31]!==c?(h=t.jsxs(Re,{selectionMode:o,children:[S,C,y,c]}),e[27]=o,e[28]=S,e[29]=C,e[30]=y,e[31]=c,e[32]=h):h=e[32];let A;return e[33]!==a||e[34]!==h?(A=t.jsxs("div",{className:"flex items-center gap-1",children:[a,h]}),e[33]=a,e[34]=h,e[35]=A):A=e[35],A}function jn(s){return s.stopPropagation()}function Sn(s){const e=W.c(29),{count:n,total:g,canManage:o,canManageAgents:i,onSelectAll:l,onDeselectAll:r,onDelete:d,onAddToAgent:p,onToggleStatus:m,onCancel:u}=s,a=te();if(n===0)return null;let x;e[0]!==n||e[1]!==a?(x=a("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=a,e[2]=x):x=e[2];let f;e[3]!==x?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:x}),e[3]=x,e[4]=f):f=e[4];let j;e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==g?(j=n<g?t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:a("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:a("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=l,e[8]=a,e[9]=g,e[10]=j):j=e[10];let S;e[11]!==i||e[12]!==p||e[13]!==a?(S=i&&t.jsxs(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:p,children:[t.jsx(Le,{size:13}),a("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=p,e[13]=a,e[14]=S):S=e[14];let C;e[15]!==o||e[16]!==d||e[17]!==m||e[18]!==a?(C=o&&t.jsxs(t.Fragment,{children:[t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("active"),children:a("orgs.connectionSelectionUi.enable")}),t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("inactive"),children:a("orgs.connectionSelectionUi.disable")}),t.jsxs(E,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(He,{size:13}),a("orgs.connectionSelectionUi.delete")]})]}),e[15]=o,e[16]=d,e[17]=m,e[18]=a,e[19]=C):C=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ee,{size:13}),e[20]=y):y=e[20];let c;e[21]!==u?(c=t.jsx(E,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:y}),e[21]=u,e[22]=c):c=e[22];let h;return e[23]!==f||e[24]!==j||e[25]!==S||e[26]!==C||e[27]!==c?(h=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,j,S,C,c]})}),e[23]=f,e[24]=j,e[25]=S,e[26]=C,e[27]=c,e[28]=h):h=e[28],h}function yn(s){const e=W.c(47),{open:n,onOpenChange:g,agents:o,onConfirm:i}=s,l=te(),[r,d]=z.useState(null);let p;e[0]!==g?(p=D=>{D||d(null),g(D)},e[0]=g,e[1]=p):p=e[1];const m=p;let u;e[2]!==l?(u=l("orgs.connectionSelectionUi.addToAgentTitle"),e[2]=l,e[3]=u):u=e[3];let a;e[4]!==u?(a=t.jsx(ke,{children:u}),e[4]=u,e[5]=a):a=e[5];let x;e[6]!==l?(x=l("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=l,e[7]=x):x=e[7];let f;e[8]!==x?(f=t.jsx(Te,{children:x}),e[8]=x,e[9]=f):f=e[9];let j;e[10]!==a||e[11]!==f?(j=t.jsxs(we,{children:[a,f]}),e[10]=a,e[11]=f,e[12]=j):j=e[12];let S;e[13]!==o||e[14]!==r||e[15]!==l?(S=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):o.map(D=>t.jsxs("button",{type:"button",onClick:()=>d(D.id),className:he("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",r===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(en,{icon:D.icon,name:D.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:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[13]=o,e[14]=r,e[15]=l,e[16]=S):S=e[16];let C;e[17]!==S?(C=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:S}),e[17]=S,e[18]=C):C=e[18];let y;e[19]!==m?(y=()=>m(!1),e[19]=m,e[20]=y):y=e[20];let c;e[21]!==l?(c=l("orgs.connectionSelectionUi.cancel"),e[21]=l,e[22]=c):c=e[22];let h;e[23]!==c||e[24]!==y?(h=t.jsx(E,{variant:"outline",onClick:y,children:c}),e[23]=c,e[24]=y,e[25]=h):h=e[25];const A=!r;let T;e[26]!==m||e[27]!==i||e[28]!==r?(T=()=>{r&&(i(r),m(!1))},e[26]=m,e[27]=i,e[28]=r,e[29]=T):T=e[29];let w;e[30]!==l?(w=l("orgs.connectionSelectionUi.add"),e[30]=l,e[31]=w):w=e[31];let M;e[32]!==A||e[33]!==T||e[34]!==w?(M=t.jsx(E,{disabled:A,onClick:T,children:w}),e[32]=A,e[33]=T,e[34]=w,e[35]=M):M=e[35];let I;e[36]!==h||e[37]!==M?(I=t.jsxs(Ae,{children:[h,M]}),e[36]=h,e[37]=M,e[38]=I):I=e[38];let O;e[39]!==I||e[40]!==j||e[41]!==C?(O=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[j,C,I]}),e[39]=I,e[40]=j,e[41]=C,e[42]=O):O=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==O?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:O}),e[43]=m,e[44]=n,e[45]=O,e[46]=P):P=e[46],P}function Cn({listState:s,activeTab:e,typeFilter:n,statusFilter:g}){const o=te(),{org:i}=Me(),l=nt(),r=$e(),{data:d}=Oe.useSession(),p=ze(),m=Vt(s),u=mt(),{granted:a}=ye("connections:manage"),{granted:x}=ye("agents:manage"),[f,j]=z.useState(new Set),S=f.size>0,[C,y]=z.useState(!1),[c,h]=z.useState(!1),[A,T]=z.useState(null),w=Lt(),M=un(Xt(w)),I=m.filter(_=>!(n!=="ALL"&&_.connection_type!==n||g!=="ALL"&&_.status!==g)),O=ut(I),P=_=>{j(v=>{const B=new Set(v);return B.has(_)?B.delete(_):B.add(_),B})},D=()=>{j(new Set)},$=Ue(s.searchTerm),V=$.items,b=ft($.loadMore,$.hasMore,$.isLoadingMore),N=new Set(m.filter(_=>_.app_name).map(_=>_.app_name)),U=s.search.length>0,X=e==="all"||U?V.filter(_=>{if(U){const v=Fe(_);if(v&&N.has(v))return!1}return!0}):[],G=e==="connected"||U?O:[],k=async _=>{if(!(!i||!d?.user?.id)){ee("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),T(_.id);try{const v=lt(_,i.id,d.user.id,{remoteIndex:0}),B=v.connection_type==="STDIO",K=!!v.connection_url,H=B&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!K&&!H){R.error(o("orgs.connections.cannotConnectNoMethod")),T(null);return}const ve=await p.create.mutateAsync(v),{id:oe}=ve,ce=await Zt({connectionId:oe,orgId:i.id,orgSlug:i.slug,persistFallback:le=>p.update.mutateAsync({id:oe,data:{connection_token:le}}).then(()=>{})});if(ce.ran&&!ce.ok){ee("connection_oauth_failed",{connection_id:oe,flow:"connections_page_connect",error:ce.error??"no_token"}),R.error(o("orgs.connections.authenticationFailed",{error:ce.error??"no token received"}));return}if(ce.ran){ee("connection_oauth_succeeded",{connection_id:oe,flow:"connections_page_connect"});const le=new URL(`/api/${i.slug}/mcp/${oe}`,window.location.origin);await l.invalidateQueries({queryKey:it.isMCPAuthenticated(le.href,null)}),F(),R.success(o("orgs.connections.authenticationSuccessful"))}let me=null;try{const le=await l.fetchQuery(zt({connectionId:oe,orgId:i.id,orgSlug:i.slug}));me=an((await le.listTools()).tools)}catch{}const be=ae(ve),_e=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;R.success(o("orgs.connections.connectedSuccessfully"),_e?{action:{label:o("orgs.connections.openConnection"),onClick:()=>r(_e)}}:void 0)}catch(v){R.error(o("orgs.connections.failedToConnect",{error:v instanceof Error?v.message:String(v)}))}finally{T(null)}}},L=st(),F=()=>{l.invalidateQueries({predicate:_=>{const v=_.queryKey;return v[1]===i.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},ue=async()=>{y(!1);const _=[...f];ee("connections_bulk_delete",{count:_.length});const B=(await Promise.allSettled(_.map(K=>L.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;F(),R.success(o("orgs.connections.deletedConnections",{count:B})),D()},je=async(_,v)=>{try{await p.update.mutateAsync({id:_,data:{status:v}}),F(),R.success(o(v==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(o("orgs.connections.failedToUpdateConnection"))}},ge=async _=>{const v=[...f];ee("connections_bulk_status_toggled",{count:v.length,to_status:_});const K=(await Promise.allSettled(v.map(H=>p.update.mutateAsync({id:H,data:{status:_}})))).filter(H=>H.status==="fulfilled").length;F(),R.success(_==="active"?o("orgs.connections.enabledConnections",{count:K}):o("orgs.connections.disabledConnections",{count:K})),D()},ne=async _=>{const v=w.find(H=>H.id===_);if(!v)return;ee("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const B=new Set(v.connections.map(H=>H.connection_id)),K=[...f].filter(H=>!B.has(H)).map(H=>({connection_id:H,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){R.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await L.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...v.connections,...K]}}),ot(l,i.id),R.success(o("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:v.title})),D()}catch{R.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(pt,{...u}),t.jsx(ln,{open:C,onOpenChange:y,count:f.size,onConfirm:ue}),t.jsx(yn,{open:c,onOpenChange:h,agents:w,onConfirm:ne}),$.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(U?X.length===0&&I.length===0:e==="all"?X.length===0:I.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:o("orgs.connections.noConnectionsFound"),description:s.search?o("orgs.connections.noConnectionsMatchSearch",{search:s.search}):o(a?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[G.map(_=>{if(_.type==="group")return t.jsx(hn,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:_.key}})},selectionMode:S,selectedIds:f,onToggleSelect:P},_.key);const v=_.connection,B=f.has(v.id);return t.jsx(Ce,{connection:v,fallbackIcon:t.jsx(xe,{}),onClick:()=>S?P(v.id):r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),className:he(B&&"ring-2 ring-primary bg-primary/5"),selected:S?B:void 0,footer:t.jsx(gn,{projects:M.get(v.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(xn,{connection:v,isSelected:B,selectionMode:S,canManage:a,canManageAgents:x,onToggleSelect:()=>P(v.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),onToggleStatus:K=>je(v.id,K),onDelete:()=>u.requestDelete(v)})},v.id)}),X.map(_=>t.jsx(rn,{item:_,canManage:a,allConnections:m,connectedAppNames:N,connectingItemId:A,onNavigateConnected:v=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),onConnect:k},_.id)),(e==="all"||U)&&t.jsx("div",{ref:b,className:"col-span-full h-4"}),(e==="all"||U)&&$.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(de,{className:"size-6 text-muted-foreground"})})]})}),S&&t.jsx(Sn,{count:f.size,total:I.length,canManage:a,canManageAgents:x,onSelectAll:()=>{j(new Set(I.map(_=>_.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>y(!0),onAddToAgent:()=>h(!0),onToggleStatus:ge,onCancel:D})]})}function vn(){const s=te(),{org:e}=Me(),n=$e(),g=qe({strict:!1}),{data:o}=Oe.useSession(),{stdioEnabled:i}=Je(),l=Ve(),{granted:r}=ye("connections:manage"),d=cn({namespace:e.slug,resource:"connections"}),p=ze(),[m,u]=Ye(Ze.connectionsTab(e.slug),b=>g.tab==="all"||g.tab==="connected"?g.tab:b??"all"),[a,x]=z.useState("ALL"),[f,j]=z.useState("ALL"),C=Ue(d.searchTerm).items,y=d.search!==d.searchTerm,c=et({resolver:tt(Qt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),h=c.watch("ui_type"),A=c.watch("connection_url"),T=c.watch("npx_package"),w=fe({uiType:h,connectionUrl:A??"",npxPackage:T??""})??De({uiType:h,connectionUrl:A??"",registryItems:C}),M=r&&g.action==="create",I=()=>{ee("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},O=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},P=async b=>{let N,U=null,X=null,G=null;b.ui_type==="NPX"?(N="STDIO",U="",G=Jt(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(N="STDIO",U="",G=Yt(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(N=b.ui_type,U=b.connection_url||"",X=b.connection_token||null);const k=ct("conn");ee("connection_custom_created",{connection_type:N,ui_type:b.ui_type}),await p.create.mutateAsync({id:k,title:b.title,description:b.description||null,connection_type:N,connection_url:U,connection_token:X,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:e.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:G,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),O(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ae({app_name:null,connection_url:U,title:b.title,id:k})}})},D=b=>{b||(M&&O(),c.reset())},$=b=>{const N=b.trim();if(!N)return;const U=!!c.formState.dirtyFields.title,X=!!c.formState.dirtyFields.description,G=!!c.formState.dirtyFields.env_vars,k=F=>{if(F&&(!U&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!X&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!G&&F.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(ne=>ne.key)),ge=F.envVarKeys.filter(ne=>!je.has(ne));ge.length>0&&c.setValue("env_vars",[...ue,...ge.map(ne=>({key:ne,value:""}))],{shouldDirty:!0})}},L=qt(N);if(L&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",L.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),k(fe({uiType:"NPX",npxPackage:L.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const F=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",N,{shouldDirty:!0}),k(fe({uiType:F,connectionUrl:N})??De({uiType:F,connectionUrl:N,registryItems:C}));return}h==="NPX"&&k(fe({uiType:"NPX",npxPackage:N}))},V=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(E,{size:"sm",variant:"default",onClick:I,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const b=s("orgs.connections.createConnection"),N=s("orgs.connections.createConnectionDescription"),U=c.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),X=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:c.control,name:"ui_type",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.type")}),t.jsxs(Mt,{value:k.value,onValueChange:k.onChange,children:[t.jsx(Y,{children:t.jsx($t,{children:t.jsx(Ot,{})})}),t.jsxs(Ft,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Wt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),h==="NPX"&&t.jsx(Q,{control:c.control,name:"npx_package",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.npmPackage")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...k,value:k.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),$(F))},onBlur:L=>{$(L.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),h==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:c.control,name:"stdio_command",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.command")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.commandPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"stdio_args",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.arguments")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.argumentsPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(Q,{control:c.control,name:"stdio_cwd",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.workingDirectory")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...k,value:k.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(h==="NPX"||h==="STDIO")&&t.jsx(Q,{control:c.control,name:"env_vars",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.environmentVariables")}),t.jsx(Y,{children:t.jsx(Gt,{value:k.value??[],onChange:k.onChange})}),t.jsx(Z,{})]})}),h!=="NPX"&&h!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:c.control,name:"connection_url",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.url")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.urlPlaceholder"),...k,value:k.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),$(F))},onBlur:L=>{$(L.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"connection_token",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:w?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(Y,{children:t.jsx(se,{type:"password",placeholder:w?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...k,value:k.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.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:s("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(Q,{control:c.control,name:"title",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.name")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.namePlaceholder"),...k})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"description",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.description")}),t.jsx(Y,{children:t.jsx(Ut,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),G=M;return l?t.jsx(Dt,{open:G,onOpenChange:D,children:t.jsxs(kt,{className:"max-h-[90vh]",children:[t.jsx(Tt,{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(wt,{children:b}),t.jsx(At,{className:"mt-1",children:N})]}),t.jsx(It,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),t.jsx(Pt,{children:t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:U})})]})})]})}):t.jsx(Pe,{open:G,onOpenChange:D,children:t.jsxs(Ie,{className:"sm:max-w-[525px]",children:[t.jsxs(we,{children:[t.jsx(ke,{children:b}),t.jsx(Te,{children:N})]}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:X}),t.jsxs(Ae,{children:[t.jsx(E,{type:"button",variant:"outline",onClick:()=>D(!1),children:s("orgs.connections.cancel")}),t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:U})]})]})})]})})})(),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:V,children:s("orgs.connections.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(at,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:b=>{b.key==="Escape"&&(d.setSearch(""),b.target.blur())}}),t.jsx(rt,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:s("orgs.connections.sortName")},{id:"description",label:s("orgs.connections.sortDescription")},{id:"connection_type",label:s("orgs.connections.sortType")},{id:"updated_by",label:s("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:s("orgs.connections.sortUpdated")}],filters:[{label:s("orgs.connections.filterType"),value:a,onChange:b=>x(b||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:s("orgs.connections.filterStatus"),value:f,onChange:b=>j(b||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"active",label:s("orgs.connections.filterActive")},{id:"inactive",label:s("orgs.connections.filterInactive")},{id:"error",label:s("orgs.connections.filterError")}]}]})]})}),t.jsx(dt,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:m,onTabChange:b=>{const N=b;N!==m&&ee("connections_page_tab_changed",{to_tab:N}),u(N)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:y?.5:1,transition:y?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:y?"none":"auto"},children:t.jsx(Cn,{listState:d,activeTab:m,typeFilter:a,statusFilter:f})})})]})})})]})})}function Ls(){const s=W.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",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx(vn,{})})}),s[0]=e):e=s[0],e}export{Ls as default};
|
|
1
|
+
import{r as z,c as W,b as te,j as t,B as E,h as de,l as he,U as ie,v as ke,aK as Te,s as we,w as Ae,q as Ie,D as Pe,T as We,X as Xe,V as Ge,H as Qe,a2 as Me,d as $e,u as qe,a as Oe,$ as Je,am as ye,a0 as Ye,a1 as Ze,aC as et,aB as tt,n as pe,I as se,y as ee,o as nt,aa as st,t as R,b6 as ot,K as it}from"./index-DYLoE6lZ.js";import{a as Fe,g as ct,e as lt}from"./extract-connection-data-DU6Jox_T.js";import{C as rt}from"./collection-display-button-DoIjEbJ3.js";import{S as at}from"./search-input-CSa-vO3l.js";import{C as dt}from"./collection-tabs-ywProb31.js";import{C as Ce,u as Ue,g as ut}from"./connection-card-BWXrChNc.js";import{E as gt}from"./empty-state-DvEOfDhm.js";import{u as mt,D as pt}from"./use-delete-connection-B1009COB.js";import{u as ft}from"./use-infinite-scroll-CFznRnci.js";import{u as Ve}from"./use-mobile-DsnBmTih.js";import{g as ae}from"./connection-slug-CITJ0kGN.js";import{A as ht,a as xt,b as jt,c as St,g as yt,d as Ct,e as vt,f as bt}from"./alert-dialog-DhiFzLmM.js";import{n as xe}from"./LinkBroken01-wTJMvAdz.js";import{g as _t,a as Nt}from"./metadata-D72DunRR.js";import{D as Dt,a as kt,d as Tt,b as wt,e as At,f as It,g as Pt}from"./drawer-BMuDp3pZ.js";import{F as Q,b as q,c as J,d as Y,f as Z,a as Ne}from"./form-CZcQhZCa.js";import{S as Mt,b as $t,a as Ot,d as Ft,c as re}from"./select-BTxDOmEz.js";import{T as Ut}from"./textarea-CXxxIkE2.js";import{b as ze,u as Vt}from"./use-connection-BlwV3kYC.js";import{m as zt}from"./use-mcp-client-CyZFCbXf.js";import{b as Lt}from"./repository-binding-4wb1SqGi.js";import{g as Et}from"./types-D0iAHfi-.js";import{A as Bt,bA as Kt,ay as Ht,bd as Rt,u as Se}from"./agent-icon-CAaO4ypa.js";import{s as Le}from"./Plus-j4aDTi8e.js";import{c as Wt}from"./UserSquare-B7AJhMXA.js";import{s as Ee}from"./XClose-pteQuwAH.js";import{s as Xt}from"./use-project-scope-kaofAo-2.js";import{i as fe,a as De,E as Gt,c as Qt,p as qt,b as Jt,d as Yt}from"./connection-form-helpers-DCUMal7M.js";import{a as Zt}from"./authenticate-and-persist-oauth-C4TrLSCm.js";import{I as en}from"./integration-icon-CDrootbG.js";import{C as Be}from"./checkbox-DZ-_DOro.js";import{i as tn}from"./DotsVertical-C0q218c1.js";import{s as Ke}from"./Image01-Drnu_oTX.js";import{s as He}from"./Trash01-C9lhbJs7.js";import"./connection-BCelELHr.js";import"./url-slug-CsF5_jEJ.js";import"./ArrowUp-4iK8zoCx.js";import"./SwitchHorizontal01-6WEEE86B.js";import"./tooltip-D0bgPl8K.js";import"./index-Cql9s2oo.js";import"./view-mode-toggle-0cm3AkV5.js";import"./badge-C85ocGTA.js";import"./SearchMd-DhQxjm00.js";import"./useInfiniteQuery-D4wBC58J.js";import"./infiniteQueryObserver-C-FPZrNN.js";import"./slugify-CEUa2lfQ.js";import"./label-COS7xlc4.js";import"./index-BdQq_4o_.js";import"./ChevronUp-D_Wjh1Pp.js";import"./auth-CFVKU9If.js";import"./AlertCircle-xh90NARB.js";import"./Tool01-DG06N0su.js";import"./ArrowLeft-Xffg7q8p.js";import"./ShoppingBag01-BJ4cJNkc.js";import"./ZoomOut-D4nHzX79.js";import"./Building02-DAEF4UrO.js";import"./CheckCircle-DUpC1qQ4.js";import"./ChevronSelectorVertical-DCkH1mIQ.js";import"./Copy01-BdyOQaoT.js";import"./CreditCard01-YN58MJQp.js";import"./Globe04-brrhloqP.js";import"./Key01-DXKey19o.js";import"./Link01-DAwi9mlM.js";import"./Monitor01-Bm_bTKyL.js";import"./Sun-D0UkgT29.js";import"./Play-CqIDE5zC.js";import"./Upload01-Bt337Shk.js";import"./User01-DXN8J2dA.js";import"./Users01-CHS_3A2d.js";import"./mcp-oauth-_2kQOfTH.js";import"./mcp-oauth-hlA0Q-1K.js";function nn(s){const e=`deco-filters-${s}`,[n,g]=z.useState(()=>{try{const i=globalThis.localStorage?.getItem(e);if(i)return JSON.parse(i)}catch(i){console.error("Failed to parse stored filters:",i)}return[]});return[n,i=>{g(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(l){console.error("Failed to save filters:",l)}}]}function sn(s){const e=W.c(7),[n,g]=z.useState(s),[o,i]=z.useState(s?"desc":null);let l;e[0]!==o||e[1]!==n?(l=p=>{n!==p?(g(p),i("asc")):o==="asc"?i("desc"):o==="desc"&&(g(void 0),i(null))},e[0]=o,e[1]=n,e[2]=l):l=e[2];const r=l;let d;return e[3]!==r||e[4]!==o||e[5]!==n?(d={sortKey:n,sortDirection:o,handleSort:r},e[3]=r,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function on(s,e){const n=W.c(12),g=e===void 0?"cards":e,o=Ve(),i=z.useRef(o),l=s?`deco-view-mode-${s}`:"deco-view-mode";let r;n[0]!==g||n[1]!==l?(r=()=>{const j=globalThis.localStorage?.getItem(l);return j==="cards"||j==="table"?j:g},n[0]=g,n[1]=l,n[2]=r):r=n[2];const[d,p]=z.useState(r);let m;n[3]!==l?(m=j=>{p(j),globalThis.localStorage?.setItem(l,j)},n[3]=l,n[4]=m):m=n[4];const u=m;let a,x;n[5]!==o||n[6]!==d?(a=()=>{!i.current&&o&&d==="table"&&p("cards"),i.current=o},x=[o,d],n[5]=o,n[6]=d,n[7]=a,n[8]=x):(a=n[7],x=n[8]),z.useEffect(a,x);let f;return n[9]!==u||n[10]!==d?(f=[d,u],n[9]=u,n[10]=d,n[11]=f):f=n[11],f}function cn(s){const e=W.c(20),{namespace:n,resource:g,defaultSortKey:o,defaultViewMode:i}=s,l=o===void 0?"title":o,r=i===void 0?"table":i,[d,p]=z.useState(""),m=z.useDeferredValue(d),u=`${n}-${g}`,[a,x]=nn(u),f=`studio-${g}-filter-visible-${n}`;let j;e[0]!==f?(j=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=j):j=e[1];const[S,C]=z.useState(j);let y;e[2]!==f?(y=$=>{C($),globalThis.localStorage?.setItem(f,String($))},e[2]=f,e[3]=y):y=e[3];const c=y;let h;e[4]!==S||e[5]!==c?(h=()=>{c(!S)},e[4]=S,e[5]=c,e[6]=h):h=e[6];const A=h,[T,w]=on(`studio-${g}-${n}`,r),{sortKey:M,sortDirection:I,handleSort:O}=sn(l),P=M;let D;return e[7]!==S||e[8]!==a||e[9]!==O||e[10]!==d||e[11]!==m||e[12]!==c||e[13]!==x||e[14]!==w||e[15]!==I||e[16]!==P||e[17]!==A||e[18]!==T?(D={search:d,searchTerm:m,setSearch:p,filters:a,setFilters:x,filterBarVisible:S,setFilterBarVisible:c,toggleFilterBar:A,viewMode:T,setViewMode:w,sortKey:P,sortDirection:I,handleSort:O},e[7]=S,e[8]=a,e[9]=O,e[10]=d,e[11]=m,e[12]=c,e[13]=x,e[14]=w,e[15]=I,e[16]=P,e[17]=A,e[18]=T,e[19]=D):D=e[19],D}function ln(s){const e=W.c(35),{open:n,onOpenChange:g,count:o,onConfirm:i}=s,l=te(),r=o===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==o||e[1]!==l||e[2]!==r?(d=l(r,{count:o}),e[0]=o,e[1]=l,e[2]=r,e[3]=d):d=e[3];let p;e[4]!==d?(p=t.jsx(ht,{children:d}),e[4]=d,e[5]=p):p=e[5];const m=o===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==l||e[7]!==m?(u=l(m),e[6]=l,e[7]=m,e[8]=u):u=e[8];let a;e[9]!==u?(a=t.jsx(xt,{children:u}),e[9]=u,e[10]=a):a=e[10];let x;e[11]!==p||e[12]!==a?(x=t.jsxs(jt,{children:[p,a]}),e[11]=p,e[12]=a,e[13]=x):x=e[13];let f;e[14]!==l?(f=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx(St,{children:f}),e[16]=f,e[17]=j):j=e[17];const S=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let C;e[18]!==o||e[19]!==l||e[20]!==S?(C=l(S,{count:o}),e[18]=o,e[19]=l,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==i||e[23]!==C?(y=t.jsx(yt,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:C}),e[22]=i,e[23]=C,e[24]=y):y=e[24];let c;e[25]!==y||e[26]!==j?(c=t.jsxs(Ct,{children:[j,y]}),e[25]=y,e[26]=j,e[27]=c):c=e[27];let h;e[28]!==c||e[29]!==x?(h=t.jsxs(vt,{children:[x,c]}),e[28]=c,e[29]=x,e[30]=h):h=e[30];let A;return e[31]!==g||e[32]!==n||e[33]!==h?(A=t.jsx(bt,{open:n,onOpenChange:g,children:h}),e[31]=g,e[32]=n,e[33]=h,e[34]=A):A=e[34],A}function rn(s){const e=W.c(39),{item:n,canManage:g,allConnections:o,connectedAppNames:i,connectingItemId:l,onNavigateConnected:r,onConnect:d}=s,p=te();let m,u;e[0]!==i||e[1]!==n?(m=Fe(n)??"",u=i.has(m),e[0]=i,e[1]=n,e[2]=m,e[3]=u):(m=e[2],u=e[3]);const a=u;let x;e[4]!==n._meta?(x=_t(n._meta),e[4]=n._meta,e[5]=x):x=e[5];const f=x,j=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",S=n.server?.description||n.description||null;let C;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(C=n.server?.icons?.[0]?.src||Nt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=C):C=e[8];const y=C;let c;if(e[9]!==o||e[10]!==m){let V;e[12]!==m?(V=b=>b.connection_type!=="VIRTUAL"&&b.app_name===m,e[12]=m,e[13]=V):V=e[13],c=o.filter(V),e[9]=o,e[10]=m,e[11]=c}else c=e[11];const h=c,A=a||g;let T,w;e[14]!==h||e[15]!==a||e[16]!==n||e[17]!==d||e[18]!==r?(T=()=>{if(a){const V=h[0];V&&r(V);return}w()},w=()=>d(n),e[14]=h,e[15]=a,e[16]=n,e[17]=d,e[18]=r,e[19]=T,e[20]=w):(T=e[19],w=e[20]);let M;e[21]!==S||e[22]!==y||e[23]!==j?(M={title:j,description:S,icon:y},e[21]=S,e[22]=y,e[23]=j,e[24]=M):M=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(xe,{}),e[25]=I):I=e[25];const O=A?T:void 0;let P;e[26]!==g||e[27]!==l||e[28]!==w||e[29]!==a||e[30]!==n.id||e[31]!==p?(P=a?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:p("orgs.catalogItemCard.connected")}):g&&t.jsx(E,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:l!==null,onClick:V=>{V.stopPropagation(),w()},children:l===n.id?t.jsx(de,{className:"size-3.5"}):p("orgs.catalogItemCard.connect")}),e[26]=g,e[27]=l,e[28]=w,e[29]=a,e[30]=n.id,e[31]=p,e[32]=P):P=e[32];let D;e[33]!==P?(D=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=D):D=e[34];let $;return e[35]!==M||e[36]!==O||e[37]!==D?($=t.jsx(Ce,{connection:M,fallbackIcon:I,onClick:O,headerActionsAlwaysVisible:!0,headerActions:D}),e[35]=M,e[36]=O,e[37]=D,e[38]=$):$=e[38],$}function an(s){return s?.length?{appToolName:s.find(n=>!!Et(n._meta))?.name??null}:null}const dn=3;function un(s){const e=new Map;for(const n of s)for(const g of n.connections??[]){const o=e.get(g.connection_id)??[];o.push(n),e.set(g.connection_id,o)}return e}function gn(s){const e=W.c(21),{projects:n}=s,g=te();if(n.length===0){let u;e[0]!==g?(u=g("projects.connections.orgWide"),e[0]=g,e[1]=u):u=e[1];let a;return e[2]!==u?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=a):a=e[3],a}let o,i,l;if(e[4]!==n){const u=n.slice(0,dn);l="flex min-w-0 items-center gap-2",o="flex shrink-0 -space-x-1.5",i=u.map(mn),e[4]=n,e[5]=o,e[6]=i,e[7]=l}else o=e[5],i=e[6],l=e[7];let r;e[8]!==o||e[9]!==i?(r=t.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=r):r=e[10];let d;e[11]!==n[0]?.title||e[12]!==n.length||e[13]!==g?(d=n.length===1?n[0]?.title:g("projects.connections.usedBy",{count:n.length}),e[11]=n[0]?.title,e[12]=n.length,e[13]=g,e[14]=d):d=e[14];let p;e[15]!==d?(p=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:d}),e[15]=d,e[16]=p):p=e[16];let m;return e[17]!==l||e[18]!==r||e[19]!==p?(m=t.jsxs("div",{className:l,children:[r,p]}),e[17]=l,e[18]=r,e[19]=p,e[20]=m):m=e[20],m}function mn(s){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:s.title,children:t.jsx(Bt,{icon:s.icon,name:s.title,size:"xs"})},s.id)}function Re(s){const e=W.c(8),{selectionMode:n,children:g}=s,o=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let i;e[0]!==o?(i=he("overflow-hidden transition-all duration-150 ease-out",o),e[0]=o,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(We,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:fn,children:t.jsx(tn,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==g?(r=t.jsxs(Xe,{children:[l,t.jsx(Ge,{align:"end",onClick:pn,children:g})]}),e[3]=g,e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==r?(d=t.jsx("div",{className:i,children:r}),e[5]=i,e[6]=r,e[7]=d):d=e[7],d}function pn(s){return s.stopPropagation()}function fn(s){return s.stopPropagation()}function hn(s){const e=W.c(57),{group:n,onOpen:g,selectionMode:o,selectedIds:i,onToggleSelect:l}=s,r=te();let d;if(e[0]!==n.connections||e[1]!==i){let N;e[3]!==i?(N=U=>i.has(U.id),e[3]=i,e[4]=N):N=e[4],d=n.connections.every(N),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const p=d;let m;if(e[5]!==n.connections||e[6]!==i){let N;e[8]!==i?(N=U=>i.has(U.id),e[8]=i,e[9]=N):N=e[9],m=n.connections.some(N),e[5]=n.connections,e[6]=i,e[7]=m}else m=e[7];const u=m;let a;e[10]!==p||e[11]!==n.connections||e[12]!==l||e[13]!==i?(a=()=>{for(const N of n.connections)p?i.has(N.id)&&l(N.id):i.has(N.id)||l(N.id)},e[10]=p,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=a):a=e[14];const x=a,f=n.title,j=n.icon;let S;e[15]!==n.connections.length||e[16]!==r?(S=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=S):S=e[17];let C;e[18]!==n.icon||e[19]!==n.title||e[20]!==S?(C={title:f,icon:j,description:S},e[18]=n.icon,e[19]=n.title,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==g||e[23]!==o||e[24]!==x?(y=()=>o?x():g(),e[22]=g,e[23]=o,e[24]=x,e[25]=y):y=e[25];const c=o&&p&&"ring-2 ring-primary",h=o&&u&&!p&&"ring-1 ring-primary/50";let A;e[26]!==h||e[27]!==c?(A=he(c,h),e[26]=h,e[27]=c,e[28]=A):A=e[28];const T=o?p?!0:u&&"mixed":void 0;let w;e[29]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(xe,{}),e[29]=w):w=e[29];let M;e[30]!==p||e[31]!==n.connections.length||e[32]!==o||e[33]!==u||e[34]!==r||e[35]!==x?(M=o?t.jsx(Be,{checked:p?!0:u?"indeterminate":!1,onCheckedChange:x}):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]=p,e[31]=n.connections.length,e[32]=o,e[33]=u,e[34]=r,e[35]=x,e[36]=M):M=e[36];let I;e[37]!==g?(I=N=>{N.stopPropagation(),g()},e[37]=g,e[38]=I):I=e[38];let O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Ke,{size:16}),e[39]=O):O=e[39];let P;e[40]!==r?(P=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=P):P=e[41];let D;e[42]!==I||e[43]!==P?(D=t.jsxs(ie,{onClick:I,children:[O,P]}),e[42]=I,e[43]=P,e[44]=D):D=e[44];let $;e[45]!==o||e[46]!==D?($=t.jsx(Re,{selectionMode:o,children:D}),e[45]=o,e[46]=D,e[47]=$):$=e[47];let V;e[48]!==M||e[49]!==$?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[M,$]}),e[48]=M,e[49]=$,e[50]=V):V=e[50];let b;return e[51]!==A||e[52]!==T||e[53]!==V||e[54]!==C||e[55]!==y?(b=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:C,onClick:y,className:A,selected:T,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=A,e[52]=T,e[53]=V,e[54]=C,e[55]=y,e[56]=b):b=e[56],b}function xn(s){const e=W.c(36),{connection:n,isSelected:g,selectionMode:o,canManage:i,canManageAgents:l,onToggleSelect:r,onOpen:d,onToggleStatus:p,onDelete:m}=s,u=te();let a;e[0]!==g||e[1]!==r||e[2]!==o||e[3]!==u?(a=o?t.jsx(Be,{checked:g,onCheckedChange:r,onClick:jn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=g,e[1]=r,e[2]=o,e[3]=u,e[4]=a):a=e[4];let x;e[5]!==d?(x=T=>{T.stopPropagation(),d()},e[5]=d,e[6]=x):x=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ke,{size:16}),e[7]=f):f=e[7];let j;e[8]!==u?(j=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=j):j=e[9];let S;e[10]!==x||e[11]!==j?(S=t.jsxs(ie,{onClick:x,children:[f,j]}),e[10]=x,e[11]=j,e[12]=S):S=e[12];let C;e[13]!==i||e[14]!==l||e[15]!==r||e[16]!==u?(C=(i||l)&&t.jsxs(ie,{onClick:T=>{T.stopPropagation(),r()},children:[t.jsx(Kt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=r,e[16]=u,e[17]=C):C=e[17];let y;e[18]!==i||e[19]!==n||e[20]!==p||e[21]!==u?(y=i&&(n.status==="active"?t.jsxs(ie,{onClick:T=>{T.stopPropagation(),p("inactive")},children:[t.jsx(Ht,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ie,{onClick:T=>{T.stopPropagation(),p("active")},children:[t.jsx(Rt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=p,e[21]=u,e[22]=y):y=e[22];let c;e[23]!==i||e[24]!==m||e[25]!==u?(c=i&&t.jsxs(ie,{variant:"destructive",onClick:T=>{T.stopPropagation(),m()},children:[t.jsx(He,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=m,e[25]=u,e[26]=c):c=e[26];let h;e[27]!==o||e[28]!==S||e[29]!==C||e[30]!==y||e[31]!==c?(h=t.jsxs(Re,{selectionMode:o,children:[S,C,y,c]}),e[27]=o,e[28]=S,e[29]=C,e[30]=y,e[31]=c,e[32]=h):h=e[32];let A;return e[33]!==a||e[34]!==h?(A=t.jsxs("div",{className:"flex items-center gap-1",children:[a,h]}),e[33]=a,e[34]=h,e[35]=A):A=e[35],A}function jn(s){return s.stopPropagation()}function Sn(s){const e=W.c(29),{count:n,total:g,canManage:o,canManageAgents:i,onSelectAll:l,onDeselectAll:r,onDelete:d,onAddToAgent:p,onToggleStatus:m,onCancel:u}=s,a=te();if(n===0)return null;let x;e[0]!==n||e[1]!==a?(x=a("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=a,e[2]=x):x=e[2];let f;e[3]!==x?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:x}),e[3]=x,e[4]=f):f=e[4];let j;e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==g?(j=n<g?t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:a("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:a("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=l,e[8]=a,e[9]=g,e[10]=j):j=e[10];let S;e[11]!==i||e[12]!==p||e[13]!==a?(S=i&&t.jsxs(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:p,children:[t.jsx(Le,{size:13}),a("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=p,e[13]=a,e[14]=S):S=e[14];let C;e[15]!==o||e[16]!==d||e[17]!==m||e[18]!==a?(C=o&&t.jsxs(t.Fragment,{children:[t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("active"),children:a("orgs.connectionSelectionUi.enable")}),t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("inactive"),children:a("orgs.connectionSelectionUi.disable")}),t.jsxs(E,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(He,{size:13}),a("orgs.connectionSelectionUi.delete")]})]}),e[15]=o,e[16]=d,e[17]=m,e[18]=a,e[19]=C):C=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ee,{size:13}),e[20]=y):y=e[20];let c;e[21]!==u?(c=t.jsx(E,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:y}),e[21]=u,e[22]=c):c=e[22];let h;return e[23]!==f||e[24]!==j||e[25]!==S||e[26]!==C||e[27]!==c?(h=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,j,S,C,c]})}),e[23]=f,e[24]=j,e[25]=S,e[26]=C,e[27]=c,e[28]=h):h=e[28],h}function yn(s){const e=W.c(47),{open:n,onOpenChange:g,agents:o,onConfirm:i}=s,l=te(),[r,d]=z.useState(null);let p;e[0]!==g?(p=D=>{D||d(null),g(D)},e[0]=g,e[1]=p):p=e[1];const m=p;let u;e[2]!==l?(u=l("orgs.connectionSelectionUi.addToAgentTitle"),e[2]=l,e[3]=u):u=e[3];let a;e[4]!==u?(a=t.jsx(ke,{children:u}),e[4]=u,e[5]=a):a=e[5];let x;e[6]!==l?(x=l("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=l,e[7]=x):x=e[7];let f;e[8]!==x?(f=t.jsx(Te,{children:x}),e[8]=x,e[9]=f):f=e[9];let j;e[10]!==a||e[11]!==f?(j=t.jsxs(we,{children:[a,f]}),e[10]=a,e[11]=f,e[12]=j):j=e[12];let S;e[13]!==o||e[14]!==r||e[15]!==l?(S=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):o.map(D=>t.jsxs("button",{type:"button",onClick:()=>d(D.id),className:he("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",r===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(en,{icon:D.icon,name:D.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:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[13]=o,e[14]=r,e[15]=l,e[16]=S):S=e[16];let C;e[17]!==S?(C=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:S}),e[17]=S,e[18]=C):C=e[18];let y;e[19]!==m?(y=()=>m(!1),e[19]=m,e[20]=y):y=e[20];let c;e[21]!==l?(c=l("orgs.connectionSelectionUi.cancel"),e[21]=l,e[22]=c):c=e[22];let h;e[23]!==c||e[24]!==y?(h=t.jsx(E,{variant:"outline",onClick:y,children:c}),e[23]=c,e[24]=y,e[25]=h):h=e[25];const A=!r;let T;e[26]!==m||e[27]!==i||e[28]!==r?(T=()=>{r&&(i(r),m(!1))},e[26]=m,e[27]=i,e[28]=r,e[29]=T):T=e[29];let w;e[30]!==l?(w=l("orgs.connectionSelectionUi.add"),e[30]=l,e[31]=w):w=e[31];let M;e[32]!==A||e[33]!==T||e[34]!==w?(M=t.jsx(E,{disabled:A,onClick:T,children:w}),e[32]=A,e[33]=T,e[34]=w,e[35]=M):M=e[35];let I;e[36]!==h||e[37]!==M?(I=t.jsxs(Ae,{children:[h,M]}),e[36]=h,e[37]=M,e[38]=I):I=e[38];let O;e[39]!==I||e[40]!==j||e[41]!==C?(O=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[j,C,I]}),e[39]=I,e[40]=j,e[41]=C,e[42]=O):O=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==O?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:O}),e[43]=m,e[44]=n,e[45]=O,e[46]=P):P=e[46],P}function Cn({listState:s,activeTab:e,typeFilter:n,statusFilter:g}){const o=te(),{org:i}=Me(),l=nt(),r=$e(),{data:d}=Oe.useSession(),p=ze(),m=Vt(s),u=mt(),{granted:a}=ye("connections:manage"),{granted:x}=ye("agents:manage"),[f,j]=z.useState(new Set),S=f.size>0,[C,y]=z.useState(!1),[c,h]=z.useState(!1),[A,T]=z.useState(null),w=Lt(),M=un(Xt(w)),I=m.filter(_=>!(n!=="ALL"&&_.connection_type!==n||g!=="ALL"&&_.status!==g)),O=ut(I),P=_=>{j(v=>{const B=new Set(v);return B.has(_)?B.delete(_):B.add(_),B})},D=()=>{j(new Set)},$=Ue(s.searchTerm),V=$.items,b=ft($.loadMore,$.hasMore,$.isLoadingMore),N=new Set(m.filter(_=>_.app_name).map(_=>_.app_name)),U=s.search.length>0,X=e==="all"||U?V.filter(_=>{if(U){const v=Fe(_);if(v&&N.has(v))return!1}return!0}):[],G=e==="connected"||U?O:[],k=async _=>{if(!(!i||!d?.user?.id)){ee("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),T(_.id);try{const v=lt(_,i.id,d.user.id,{remoteIndex:0}),B=v.connection_type==="STDIO",K=!!v.connection_url,H=B&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!K&&!H){R.error(o("orgs.connections.cannotConnectNoMethod")),T(null);return}const ve=await p.create.mutateAsync(v),{id:oe}=ve,ce=await Zt({connectionId:oe,orgId:i.id,orgSlug:i.slug,persistFallback:le=>p.update.mutateAsync({id:oe,data:{connection_token:le}}).then(()=>{})});if(ce.ran&&!ce.ok){ee("connection_oauth_failed",{connection_id:oe,flow:"connections_page_connect",error:ce.error??"no_token"}),R.error(o("orgs.connections.authenticationFailed",{error:ce.error??"no token received"}));return}if(ce.ran){ee("connection_oauth_succeeded",{connection_id:oe,flow:"connections_page_connect"});const le=new URL(`/api/${i.slug}/mcp/${oe}`,window.location.origin);await l.invalidateQueries({queryKey:it.isMCPAuthenticated(le.href,null)}),F(),R.success(o("orgs.connections.authenticationSuccessful"))}let me=null;try{const le=await l.fetchQuery(zt({connectionId:oe,orgId:i.id,orgSlug:i.slug}));me=an((await le.listTools()).tools)}catch{}const be=ae(ve),_e=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;R.success(o("orgs.connections.connectedSuccessfully"),_e?{action:{label:o("orgs.connections.openConnection"),onClick:()=>r(_e)}}:void 0)}catch(v){R.error(o("orgs.connections.failedToConnect",{error:v instanceof Error?v.message:String(v)}))}finally{T(null)}}},L=st(),F=()=>{l.invalidateQueries({predicate:_=>{const v=_.queryKey;return v[1]===i.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},ue=async()=>{y(!1);const _=[...f];ee("connections_bulk_delete",{count:_.length});const B=(await Promise.allSettled(_.map(K=>L.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;F(),R.success(o("orgs.connections.deletedConnections",{count:B})),D()},je=async(_,v)=>{try{await p.update.mutateAsync({id:_,data:{status:v}}),F(),R.success(o(v==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(o("orgs.connections.failedToUpdateConnection"))}},ge=async _=>{const v=[...f];ee("connections_bulk_status_toggled",{count:v.length,to_status:_});const K=(await Promise.allSettled(v.map(H=>p.update.mutateAsync({id:H,data:{status:_}})))).filter(H=>H.status==="fulfilled").length;F(),R.success(_==="active"?o("orgs.connections.enabledConnections",{count:K}):o("orgs.connections.disabledConnections",{count:K})),D()},ne=async _=>{const v=w.find(H=>H.id===_);if(!v)return;ee("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const B=new Set(v.connections.map(H=>H.connection_id)),K=[...f].filter(H=>!B.has(H)).map(H=>({connection_id:H,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){R.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await L.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...v.connections,...K]}}),ot(l,i.id),R.success(o("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:v.title})),D()}catch{R.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(pt,{...u}),t.jsx(ln,{open:C,onOpenChange:y,count:f.size,onConfirm:ue}),t.jsx(yn,{open:c,onOpenChange:h,agents:w,onConfirm:ne}),$.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(U?X.length===0&&I.length===0:e==="all"?X.length===0:I.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:o("orgs.connections.noConnectionsFound"),description:s.search?o("orgs.connections.noConnectionsMatchSearch",{search:s.search}):o(a?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[G.map(_=>{if(_.type==="group")return t.jsx(hn,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:_.key}})},selectionMode:S,selectedIds:f,onToggleSelect:P},_.key);const v=_.connection,B=f.has(v.id);return t.jsx(Ce,{connection:v,fallbackIcon:t.jsx(xe,{}),onClick:()=>S?P(v.id):r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),className:he(B&&"ring-2 ring-primary bg-primary/5"),selected:S?B:void 0,footer:t.jsx(gn,{projects:M.get(v.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(xn,{connection:v,isSelected:B,selectionMode:S,canManage:a,canManageAgents:x,onToggleSelect:()=>P(v.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),onToggleStatus:K=>je(v.id,K),onDelete:()=>u.requestDelete(v)})},v.id)}),X.map(_=>t.jsx(rn,{item:_,canManage:a,allConnections:m,connectedAppNames:N,connectingItemId:A,onNavigateConnected:v=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),onConnect:k},_.id)),(e==="all"||U)&&t.jsx("div",{ref:b,className:"col-span-full h-4"}),(e==="all"||U)&&$.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(de,{className:"size-6 text-muted-foreground"})})]})}),S&&t.jsx(Sn,{count:f.size,total:I.length,canManage:a,canManageAgents:x,onSelectAll:()=>{j(new Set(I.map(_=>_.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>y(!0),onAddToAgent:()=>h(!0),onToggleStatus:ge,onCancel:D})]})}function vn(){const s=te(),{org:e}=Me(),n=$e(),g=qe({strict:!1}),{data:o}=Oe.useSession(),{stdioEnabled:i}=Je(),l=Ve(),{granted:r}=ye("connections:manage"),d=cn({namespace:e.slug,resource:"connections"}),p=ze(),[m,u]=Ye(Ze.connectionsTab(e.slug),b=>g.tab==="all"||g.tab==="connected"?g.tab:b??"all"),[a,x]=z.useState("ALL"),[f,j]=z.useState("ALL"),C=Ue(d.searchTerm).items,y=d.search!==d.searchTerm,c=et({resolver:tt(Qt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),h=c.watch("ui_type"),A=c.watch("connection_url"),T=c.watch("npx_package"),w=fe({uiType:h,connectionUrl:A??"",npxPackage:T??""})??De({uiType:h,connectionUrl:A??"",registryItems:C}),M=r&&g.action==="create",I=()=>{ee("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},O=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},P=async b=>{let N,U=null,X=null,G=null;b.ui_type==="NPX"?(N="STDIO",U="",G=Jt(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(N="STDIO",U="",G=Yt(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(N=b.ui_type,U=b.connection_url||"",X=b.connection_token||null);const k=ct("conn");ee("connection_custom_created",{connection_type:N,ui_type:b.ui_type}),await p.create.mutateAsync({id:k,title:b.title,description:b.description||null,connection_type:N,connection_url:U,connection_token:X,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:e.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:G,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),O(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ae({app_name:null,connection_url:U,title:b.title,id:k})}})},D=b=>{b||(M&&O(),c.reset())},$=b=>{const N=b.trim();if(!N)return;const U=!!c.formState.dirtyFields.title,X=!!c.formState.dirtyFields.description,G=!!c.formState.dirtyFields.env_vars,k=F=>{if(F&&(!U&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!X&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!G&&F.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(ne=>ne.key)),ge=F.envVarKeys.filter(ne=>!je.has(ne));ge.length>0&&c.setValue("env_vars",[...ue,...ge.map(ne=>({key:ne,value:""}))],{shouldDirty:!0})}},L=qt(N);if(L&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",L.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),k(fe({uiType:"NPX",npxPackage:L.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const F=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",N,{shouldDirty:!0}),k(fe({uiType:F,connectionUrl:N})??De({uiType:F,connectionUrl:N,registryItems:C}));return}h==="NPX"&&k(fe({uiType:"NPX",npxPackage:N}))},V=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(E,{size:"sm",variant:"default",onClick:I,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const b=s("orgs.connections.createConnection"),N=s("orgs.connections.createConnectionDescription"),U=c.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),X=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:c.control,name:"ui_type",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.type")}),t.jsxs(Mt,{value:k.value,onValueChange:k.onChange,children:[t.jsx(Y,{children:t.jsx($t,{children:t.jsx(Ot,{})})}),t.jsxs(Ft,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Wt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),h==="NPX"&&t.jsx(Q,{control:c.control,name:"npx_package",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.npmPackage")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...k,value:k.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),$(F))},onBlur:L=>{$(L.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),h==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:c.control,name:"stdio_command",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.command")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.commandPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"stdio_args",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.arguments")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.argumentsPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(Q,{control:c.control,name:"stdio_cwd",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.workingDirectory")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...k,value:k.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(h==="NPX"||h==="STDIO")&&t.jsx(Q,{control:c.control,name:"env_vars",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.environmentVariables")}),t.jsx(Y,{children:t.jsx(Gt,{value:k.value??[],onChange:k.onChange})}),t.jsx(Z,{})]})}),h!=="NPX"&&h!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:c.control,name:"connection_url",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.url")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.urlPlaceholder"),...k,value:k.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),$(F))},onBlur:L=>{$(L.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"connection_token",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:w?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(Y,{children:t.jsx(se,{type:"password",placeholder:w?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...k,value:k.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.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:s("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(Q,{control:c.control,name:"title",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.name")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.namePlaceholder"),...k})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"description",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.description")}),t.jsx(Y,{children:t.jsx(Ut,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),G=M;return l?t.jsx(Dt,{open:G,onOpenChange:D,children:t.jsxs(kt,{className:"max-h-[90vh]",children:[t.jsx(Tt,{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(wt,{children:b}),t.jsx(At,{className:"mt-1",children:N})]}),t.jsx(It,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),t.jsx(Pt,{children:t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:U})})]})})]})}):t.jsx(Pe,{open:G,onOpenChange:D,children:t.jsxs(Ie,{className:"sm:max-w-[525px]",children:[t.jsxs(we,{children:[t.jsx(ke,{children:b}),t.jsx(Te,{children:N})]}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:X}),t.jsxs(Ae,{children:[t.jsx(E,{type:"button",variant:"outline",onClick:()=>D(!1),children:s("orgs.connections.cancel")}),t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:U})]})]})})]})})})(),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:V,children:s("orgs.connections.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(at,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:b=>{b.key==="Escape"&&(d.setSearch(""),b.target.blur())}}),t.jsx(rt,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:s("orgs.connections.sortName")},{id:"description",label:s("orgs.connections.sortDescription")},{id:"connection_type",label:s("orgs.connections.sortType")},{id:"updated_by",label:s("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:s("orgs.connections.sortUpdated")}],filters:[{label:s("orgs.connections.filterType"),value:a,onChange:b=>x(b||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:s("orgs.connections.filterStatus"),value:f,onChange:b=>j(b||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"active",label:s("orgs.connections.filterActive")},{id:"inactive",label:s("orgs.connections.filterInactive")},{id:"error",label:s("orgs.connections.filterError")}]}]})]})}),t.jsx(dt,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:m,onTabChange:b=>{const N=b;N!==m&&ee("connections_page_tab_changed",{to_tab:N}),u(N)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:y?.5:1,transition:y?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:y?"none":"auto"},children:t.jsx(Cn,{listState:d,activeTab:m,typeFilter:a,statusFilter:f})})})]})})})]})})}function Ls(){const s=W.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",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx(vn,{})})}),s[0]=e):e=s[0],e}export{Ls as default};
|