decocms 4.579.2 → 4.580.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CTbjWy6O.js → AlertCircle-DuMz-jFi.js} +1 -1
- package/dist/client/assets/{AreaChart-DwuVDkrD.js → AreaChart-BqIC3e-u.js} +1 -1
- package/dist/client/assets/{ArrowLeft-XFXQyKrg.js → ArrowLeft-5NT3k46C.js} +1 -1
- package/dist/client/assets/{ArrowUp-BGhmN6Zx.js → ArrowUp-D5JWz7Yq.js} +1 -1
- package/dist/client/assets/{BookOpen01-BPEekJOY.js → BookOpen01-m1uNXDEc.js} +1 -1
- package/dist/client/assets/{CartesianChart-CyLm4xQH.js → CartesianChart-D9oScPZv.js} +1 -1
- package/dist/client/assets/{CategoricalChart-BaZiYgxE.js → CategoricalChart-BR_4thmy.js} +1 -1
- package/dist/client/assets/{CheckCircle-D_eKfCyb.js → CheckCircle-DAPdRkcW.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-B8yNz6I1.js → ChevronSelectorVertical-5fTMRN5v.js} +1 -1
- package/dist/client/assets/{ChevronUp-DJytO9gL.js → ChevronUp-BaKxA_AU.js} +1 -1
- package/dist/client/assets/{CreditCard01-D8vcOfs6.js → CreditCard01-BU3Icpfr.js} +1 -1
- package/dist/client/assets/{Globe04-B6PnEpLB.js → Globe04-KZ-J2ZUi.js} +1 -1
- package/dist/client/assets/{Key01-CqlMd8Tp.js → Key01-RIzbDsEi.js} +1 -1
- package/dist/client/assets/{LinkBroken01-BrTHjhI6.js → LinkBroken01-IVC8feVZ.js} +1 -1
- package/dist/client/assets/{Minus-O-Diijsb.js → Minus-Dw050KAn.js} +1 -1
- package/dist/client/assets/{Monitor01-CNesz7Zi.js → Monitor01-D7QUQToM.js} +1 -1
- package/dist/client/assets/{Play-DLBGORyf.js → Play-BDSDyO5E.js} +1 -1
- package/dist/client/assets/{Plus-D93afoay.js → Plus-CRqz0c82.js} +1 -1
- package/dist/client/assets/{ReferenceLine-DP5lPOEm.js → ReferenceLine-DKoY4fDh.js} +1 -1
- package/dist/client/assets/{SearchMd-BMSOzTwj.js → SearchMd-CcAFkP0F.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-BjOh6InC.js → ShoppingBag01-CspfAlNO.js} +1 -1
- package/dist/client/assets/{Sun-Dwiv3SBK.js → Sun-DRT9bMW5.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-TvywMML0.js → SwitchHorizontal01-D3zx9VNf.js} +1 -1
- package/dist/client/assets/{Tool01-BR0iTy6Z.js → Tool01-D9-ePNaJ.js} +1 -1
- package/dist/client/assets/{Tooltip-CMzIdphO.js → Tooltip-DZ7sGrNE.js} +1 -1
- package/dist/client/assets/{Trash01-DcgAZcrm.js → Trash01-BTZDkUzq.js} +1 -1
- package/dist/client/assets/{Upload01-C4wCuUx0.js → Upload01-BRP1bAMs.js} +1 -1
- package/dist/client/assets/{UserSquare-dl1oayK_.js → UserSquare-Dv0YcmkC.js} +1 -1
- package/dist/client/assets/{Users01-Bfq6gAwi.js → Users01-DKwguy8Z.js} +1 -1
- package/dist/client/assets/{XClose-DN30jgS9.js → XClose-CyHahh4m.js} +1 -1
- package/dist/client/assets/{Zap-C1Evk-yy.js → Zap-Dja9fdMf.js} +1 -1
- package/dist/client/assets/{access-gate-pZVUht52.js → access-gate-VlWUv9j2.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-Z992qi1w.js → add-connection-dialog-DJ5sN8e_.js} +1 -1
- package/dist/client/assets/agent-app-C3awWskd.js +1 -0
- package/dist/client/assets/{agent-assets-CFZFbPFI.js → agent-assets-n0l0tFBN.js} +1 -1
- package/dist/client/assets/{agent-automation-CK-VV9xP.js → agent-automation-DETSj7J9.js} +1 -1
- package/dist/client/assets/{agent-automations-csn7BO9I.js → agent-automations-DeXM-DYA.js} +1 -1
- package/dist/client/assets/{agent-blog-DPGRYnCY.js → agent-blog-Dw89uwrE.js} +2 -2
- package/dist/client/assets/{agent-blog-post-Cx_KL21T.js → agent-blog-post-BBh6a8oA.js} +2 -2
- package/dist/client/assets/{agent-calendar-DHfOCkRQ.js → agent-calendar-CMtYd4vL.js} +1 -1
- package/dist/client/assets/{agent-capabilities-4_vEEVov.js → agent-capabilities-BtnZBraK.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-HdEFSoEU.js → agent-connect-sources-CIDxepQB.js} +1 -1
- package/dist/client/assets/agent-deck-CQmtmyYp.js +1 -0
- package/dist/client/assets/{agent-e2e-D3d1Qsqd.js → agent-e2e-CjpTFQWV.js} +1 -1
- package/dist/client/assets/agent-experiments-BNt-4I9S.js +1 -0
- package/dist/client/assets/{agent-file-SpdJvvC2.js → agent-file-Cd74xgom.js} +1 -1
- package/dist/client/assets/{agent-hosting-BZxtmZl8.js → agent-hosting-Dv13VH72.js} +1 -1
- package/dist/client/assets/{agent-icon-BLhMgLPf.js → agent-icon-DvD5kv_K.js} +1 -1
- package/dist/client/assets/agent-library-Ggp4u0Nt.js +1 -0
- package/dist/client/assets/agent-library-file--sN5r5DJ.js +1 -0
- package/dist/client/assets/agent-overview-4OlQ8oKX.js +1 -0
- package/dist/client/assets/{agent-releases-DL4F9_VB.js → agent-releases-BNRiLrFJ.js} +1 -1
- package/dist/client/assets/agent-settings-CVXhUEvS.js +1 -0
- package/dist/client/assets/{agent-site-editor-CqV30Rul.js → agent-site-editor-87vQ9ufh.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-DmCPSKgw.js +2 -0
- package/dist/client/assets/agent-site-editor-content-cBVAi7GZ.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-kwoTpAUq.js +1 -0
- package/dist/client/assets/agent-view-BLlyMWQJ.js +1 -0
- package/dist/client/assets/{agent-view-guard-DZvQvKvl.js → agent-view-guard-H1xbnpPJ.js} +1 -1
- package/dist/client/assets/{ai-providers-RlxMy215.js → ai-providers-B9LfkD2O.js} +1 -1
- package/dist/client/assets/{alert-B5Ykyt3T.js → alert-NGt4-O3B.js} +1 -1
- package/dist/client/assets/{analytics-sections-CrpfbEYH.js → analytics-sections-LriChYtf.js} +1 -1
- package/dist/client/assets/api-keys-CN81fd1q.js +1 -0
- package/dist/client/assets/{api-keys-CSc7sP_x.js → api-keys-Dsk0h5qe.js} +1 -1
- package/dist/client/assets/{app-editor-DghRfIjT.js → app-editor-CdNfOH0q.js} +1 -1
- package/dist/client/assets/{asset-utils-BmMj5wge.js → asset-utils-CZ4gg2Dc.js} +1 -1
- package/dist/client/assets/{auth-catchall-D48r6PhG.js → auth-catchall-o-VGmahb.js} +1 -1
- package/dist/client/assets/{auth-entry-C6mHpqQT.js → auth-entry-CvNRh315.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DZ8IOzfV.js → auth-split-layout-Dy80rL_w.js} +1 -1
- package/dist/client/assets/{auth-U9K5aFal.js → auth-ygmhxR7o.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DX8Wh7d9.js → authenticate-and-persist-oauth-Di92Hz1m.js} +1 -1
- package/dist/client/assets/{automation-list-row-DFyb04uK.js → automation-list-row-BtDcNrc_.js} +1 -1
- package/dist/client/assets/{automation-runs-Bq3l9enC.js → automation-runs-dkRISa5B.js} +1 -1
- package/dist/client/assets/{automations-B2SGyI95.js → automations-Be95spA2.js} +1 -1
- package/dist/client/assets/{badge-C5mneqKN.js → badge-DzB3sqoD.js} +1 -1
- package/dist/client/assets/{block-document-DtjqDxVH.js → block-document-DrJlmgeQ.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-BddxrpRg.js → blocks-preview-workspace-context-ClN63sTc.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-BJKt49qf.js → blocks-tab-states-DQr9dBZQ.js} +1 -1
- package/dist/client/assets/{blog-preview-url-DPwtQPzJ.js → blog-preview-url-BNeiu40F.js} +1 -1
- package/dist/client/assets/{blog-schema-CMQLhziN.js → blog-schema-BSQdtgIY.js} +1 -1
- package/dist/client/assets/{blog-source-gate-WyoFGgE-.js → blog-source-gate-WL-fQwzo.js} +1 -1
- package/dist/client/assets/{blog-view-gate-CS668Ila.js → blog-view-gate-EO5JR8Eq.js} +1 -1
- package/dist/client/assets/{buckets-DeXHPgox.js → buckets-g82zij8V.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DnDGx5OC.js → build-improve-prompt-doc-BdkcM1jX.js} +1 -1
- package/dist/client/assets/{calendar-DbxCxf92.js → calendar-RWRp4FJU.js} +1 -1
- package/dist/client/assets/{capability-load-error-DCozEloC.js → capability-load-error-KmDfOtoP.js} +1 -1
- package/dist/client/assets/{category-editor-BmGhOvZr.js → category-editor-C9uuMYru.js} +1 -1
- package/dist/client/assets/{category-tree-5dEhPnK2.js → category-tree-DJrnPSNg.js} +1 -1
- package/dist/client/assets/{chart-Cy7LFFBX.js → chart-B9PgP-e_.js} +1 -1
- package/dist/client/assets/{chat-context-BOjsomdh.js → chat-context--RKzWa6k.js} +1 -1
- package/dist/client/assets/{chat-draft-CYhwlCHc.js → chat-draft-BGQDbeF5.js} +1 -1
- package/dist/client/assets/{checkbox-Bv8PV_aY.js → checkbox-H8QR9D0_.js} +1 -1
- package/dist/client/assets/{choose-editor-DoyVAhj6.js → choose-editor-WBWd1WOu.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DaytSyrs.js → cli-auth-success-C9vCBK1d.js} +1 -1
- package/dist/client/assets/{client-icons-CiAKjxAC.js → client-icons-BKCD3ufp.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-Cuu4FHx1.js → cms-settings-editor-BbDRN695.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-B9MSaBY6.js → cms-store-drafts-BejfL8Fe.js} +1 -1
- package/dist/client/assets/{collapsible-DdHbUgH7.js → collapsible-DbCvR955.js} +1 -1
- package/dist/client/assets/{collection-detail-DyddcB5w.js → collection-detail-C2j-WZ3j.js} +1 -1
- package/dist/client/assets/{collection-display-button-DVJBx_vT.js → collection-display-button-1DK_MMnx.js} +1 -1
- package/dist/client/assets/{collection-search-CwqvBBm4.js → collection-search-DvsK7hSv.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DRrebKp3.js → collection-table-wrapper-bm-LalTq.js} +1 -1
- package/dist/client/assets/{collection-tabs-81bsUeqm.js → collection-tabs-6iiAOwW9.js} +1 -1
- package/dist/client/assets/{combobox-BrOkSbhh.js → combobox-6gjOOlze.js} +1 -1
- package/dist/client/assets/{command-woRMyGZF.js → command-DQleocFC.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-B5-NAK1i.js → companion-mcps-section-CeIGkazX.js} +1 -1
- package/dist/client/assets/{config-CuCmBQuJ.js → config-C2ncmLTD.js} +1 -1
- package/dist/client/assets/{connect-HLDiwDO_.js → connect-DlXzYtCQ.js} +1 -1
- package/dist/client/assets/{connect-layout-CWZCwH8X.js → connect-layout-Boxkt-tt.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-CBKuqqHC.js → connect-source-dialog-DYJ40IKC.js} +1 -1
- package/dist/client/assets/{connection-BIE1Vidl.js → connection-CJZ6RQ2g.js} +1 -1
- package/dist/client/assets/{connection-card-gYm1H9XQ.js → connection-card-qoqR63NP.js} +1 -1
- package/dist/client/assets/{connection-detail-QqFuUNuZ.js → connection-detail-BTXE_HXc.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DA9irt8S.js → connection-form-helpers-B9JY5oaH.js} +1 -1
- package/dist/client/assets/{connection-slug-B8jXAB0J.js → connection-slug-CP70si3t.js} +1 -1
- package/dist/client/assets/{connections-JyCHdBZv.js → connections-D8py3O3a.js} +1 -1
- package/dist/client/assets/{content-tab-DRXqlCUR.js → content-tab-lkbVE2xf.js} +3 -3
- package/dist/client/assets/{context-C-ghWKlt.js → context-DH-yMERA.js} +1 -1
- package/dist/client/assets/{context-menu-DZcVKhkc.js → context-menu-Da3prNKL.js} +1 -1
- package/dist/client/assets/{context-shell-Bemo51hp.js → context-shell--6NpIOhl.js} +3 -3
- package/dist/client/assets/{core.esm-Z0qYqKj9.js → core.esm-DJRh9rDF.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-D0g-fdvV.js → create-organization-dialog-BJJn8Tn9.js} +1 -1
- package/dist/client/assets/{delete-copy-DJ_GOWB2.js → delete-copy-p7sDnlSk.js} +1 -1
- package/dist/client/assets/{device-hint-DfKyeTjV.js → device-hint-Dz-Lgu6D.js} +1 -1
- package/dist/client/assets/{discover-D7XfOvTK.js → discover-DnaaaTAL.js} +1 -1
- package/dist/client/assets/{domain-settings-DLWYAbIO.js → domain-settings-rt-urBCE.js} +1 -1
- package/dist/client/assets/{drawer-BBqyYfPx.js → drawer-CSA_YXe9.js} +1 -1
- package/dist/client/assets/{editor-D97Qyzcp.js → editor-BDmwWZXW.js} +1 -1
- package/dist/client/assets/{editor-classes-szltcTWs.js → editor-classes-BflxT3Em.js} +1 -1
- package/dist/client/assets/{empty-message-DEKaeblB.js → empty-message-CqeY7z6M.js} +1 -1
- package/dist/client/assets/{empty-state-DpGHzg8-.js → empty-state-BBFh_11d.js} +1 -1
- package/dist/client/assets/{empty-state-wwy36dTA.js → empty-state-Wyw1gzAU.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-CbqEz4gO.js → experiments-tab-choice-D-e89e6v.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CXg3fi8w.js → extract-connection-data-Dcbv_gVC.js} +1 -1
- package/dist/client/assets/{feature-gate-CveHfcPr.js → feature-gate-Z7tVIxLA.js} +1 -1
- package/dist/client/assets/{feature-paywall-DFIdKSLH.js → feature-paywall-DtbDRafp.js} +1 -1
- package/dist/client/assets/{file-explorer-OW5FLgme.js → file-explorer-CfNNkZY3.js} +1 -1
- package/dist/client/assets/{file-preview-BFUDJsk9.js → file-preview-BIcXPFXf.js} +1 -1
- package/dist/client/assets/{file-share-button-E0fcfsBv.js → file-share-button-CRptWZ51.js} +1 -1
- package/dist/client/assets/{file-type-icon-hPTLm32j.js → file-type-icon-B8w_B6Ur.js} +1 -1
- package/dist/client/assets/{folder-icon-DxENQi9B.js → folder-icon-DLenjLsE.js} +1 -1
- package/dist/client/assets/{form-Bz_uprQc.js → form-fep7EsZM.js} +1 -1
- package/dist/client/assets/{frame-navigation-EV-98oaL.js → frame-navigation-DuQkTvmc.js} +1 -1
- package/dist/client/assets/{general-DmOZe5tS.js → general-CXgCOcj0.js} +1 -1
- package/dist/client/assets/{github-icon-CR8sfoo5.js → github-icon-BmJmIA35.js} +1 -1
- package/dist/client/assets/{held-block-view-DW-NjX-S.js → held-block-view-L4ScXyc0.js} +1 -1
- package/dist/client/assets/{home-C-1mJg3e.js → home-B8uWiLZ8.js} +1 -1
- package/dist/client/assets/{home-overview-DZ5M4FB8.js → home-overview-B4YOi7ww.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-JJSMDis4.js → hosted-reconcile-TIWxrhyM.js} +1 -1
- package/dist/client/assets/{icon-button-DqWSrNSZ.js → icon-button-y7e4XAeL.js} +1 -1
- package/dist/client/assets/{index-CfMRfSbP.js → index-6bDgVJQF.js} +1 -1
- package/dist/client/assets/{index-BdtGqzV_.js → index-Bvx7roR3.js} +1 -1
- package/dist/client/assets/{index-B2FeU0Zw.js → index-C2ij8p-x.js} +1 -1
- package/dist/client/assets/{index-CUuWKDNH.js → index-CHutq_y1.js} +1 -1
- package/dist/client/assets/{index-aeiz-c5N.js → index-CMmFyekL.js} +1 -1
- package/dist/client/assets/{index-CguuJrFu.js → index-CMsvPj3a.js} +1 -1
- package/dist/client/assets/{index-lrnn1LFo.js → index-CNwv7lrZ.js} +1 -1
- package/dist/client/assets/{index-DE9SDic3.js → index-CVAn8xNL.js} +1 -1
- package/dist/client/assets/{index-B0kMZVmC.js → index-CWyPzcrL.js} +3 -3
- package/dist/client/assets/{index-CyzY-fLE.js → index-ChH0sLX7.js} +1 -1
- package/dist/client/assets/{index-Dpqgfi8_.js → index-CmAlUJfb.js} +1 -1
- package/dist/client/assets/{index-D3FgkNbL.js → index-D19_uhum.js} +1 -1
- package/dist/client/assets/{index-7-4YhBZz.js → index-DVZtQRVw.js} +1 -1
- package/dist/client/assets/{index-CeHQIaZQ.js → index-Dj0a2kN-.js} +1 -1
- package/dist/client/assets/{index-BlRhFO8i.js → index-DvJkVFQT.js} +1 -1
- package/dist/client/assets/{index-2LsnM_Ir.js → index-ixp03eW8.js} +1 -1
- package/dist/client/assets/{index-DJq5XMUI.js → index-pvUDeJng.js} +1 -1
- package/dist/client/assets/{index-redirect-Tqe_ugUp.js → index-redirect-D4F9QPKL.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Bpp7Nde9.js → infiniteQueryObserver-OShuiwgE.js} +1 -1
- package/dist/client/assets/{infra-billing-BVZxcUBX.js → infra-billing-CWpsn-Rt.js} +1 -1
- package/dist/client/assets/{input-ClzrEMuy.js → input-BgfY5gpb.js} +3 -3
- package/dist/client/assets/{input-D3CQKUJv.js → input-DTQsyDJB.js} +1 -1
- package/dist/client/assets/{integration-icon-BNTOj8TI.js → integration-icon-C_WzTScv.js} +1 -1
- package/dist/client/assets/{item-actions-DT1aQMAA.js → item-actions-DXH2d6Fe.js} +1 -1
- package/dist/client/assets/{jira-icon-CUdm8f26.js → jira-icon-D56pw7mD.js} +1 -1
- package/dist/client/assets/{label-C8wqUUzx.js → label-Cf_dlQhi.js} +1 -1
- package/dist/client/assets/{layout-BrcEe09L.js → layout-CtDg9WFK.js} +1 -1
- package/dist/client/assets/{legacy-admin-welcome-dialog-5GoRU8S5.js → legacy-admin-welcome-dialog-Bh63ptd4.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-Bf1vCfoJ.js → legacy-agents-deep-j_eDHMz_.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-Bh63rUhQ.js → legacy-main-redirect-C9oF56pC.js} +1 -1
- package/dist/client/assets/library-Bl-LzTcJ.js +1 -0
- package/dist/client/assets/{library-tab-BVzgC-sN.js → library-tab-B0xPdiji.js} +1 -1
- package/dist/client/assets/{login-DppNfiAq.js → login-XaVtTkis.js} +1 -1
- package/dist/client/assets/{markdown-ChQfidu_.js → markdown-DCvPsl1N.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-Cqipo_fr.js → mcp-app-renderer-DBs207iT.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C3I9E6hK.js → mcp-oauth-CciCTLp9.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BW9RlFd8.js → mcp-oauth-DOQO_m1D.js} +1 -1
- package/dist/client/assets/{members-BPvSGNqH.js → members-CL8zrENK.js} +1 -1
- package/dist/client/assets/{memory-CQAa3mHm.js → memory-C0eybouW.js} +1 -1
- package/dist/client/assets/{mock-board-BMaXmonr.js → mock-board-iZzwB0Ec.js} +3 -3
- package/dist/client/assets/{monaco-editor-GCVIle1A.js → monaco-editor-BjOCHD6R.js} +1 -1
- package/dist/client/assets/{monitoring-RTFaXjle.js → monitoring-auJHCqSG.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-h4pC7kD6.js → monitoring-stats-row-D-1eXI4W.js} +1 -1
- package/dist/client/assets/{multi-select-sZG2voKq.js → multi-select-C7KaI7rL.js} +1 -1
- package/dist/client/assets/{mustache-BXaNyEgZ.js → mustache-Dm8yyGpD.js} +1 -1
- package/dist/client/assets/{named-rule-step-EI_qv23D.js → named-rule-step-DLS79yYb.js} +1 -1
- package/dist/client/assets/{named-rule-view-DcHqSDt-.js → named-rule-view-Bgyvi0X-.js} +1 -1
- package/dist/client/assets/{new-project-dialog-B8ntXRJU.js → new-project-dialog-uK1Ixj7a.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-of2OYrpv.js → oauth-callback-ai-provider-xMCIdlQV.js} +1 -1
- package/dist/client/assets/{oauth-callback-p3ywWjTz.js → oauth-callback-xd-D45xF.js} +1 -1
- package/dist/client/assets/{oauth-consent-DpXLchYG.js → oauth-consent-BH8-t4eI.js} +1 -1
- package/dist/client/assets/{onboarding-DKqNWZqa.js → onboarding-C46p79BL.js} +1 -1
- package/dist/client/assets/{openai-conversation-CFoe4Qa0.js → openai-conversation-LX4vhoSF.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-B5MpSmQi.js → optimistic-project-sidebar-views-CQDM5Smz.js} +1 -1
- package/dist/client/assets/{order-monitor-day-DEpjybnZ.js → order-monitor-day-CdZki-hX.js} +1 -1
- package/dist/client/assets/{organization-choice-DP7th0jj.js → organization-choice-C2R9F9mc.js} +1 -1
- package/dist/client/assets/{orgs-DPHlMXcd.js → orgs-HpCUPqLm.js} +1 -1
- package/dist/client/assets/{own-accounts-section-DwQLTK3b.js → own-accounts-section-Bj2ZQcZp.js} +1 -1
- package/dist/client/assets/{pair-BXQ1AL58.js → pair-CZjLWCpF.js} +1 -1
- package/dist/client/assets/{parse-sections-CW6TmrTp.js → parse-sections-C-6WrwoU.js} +2 -2
- package/dist/client/assets/{plan-ladder-B0kBPdzm.js → plan-ladder-K1-uMNFn.js} +1 -1
- package/dist/client/assets/{plan-usage-card-hmzG52qo.js → plan-usage-card-ByfsqyV3.js} +1 -1
- package/dist/client/assets/{plan-DzDjgwtt.js → plan-z7jyUflE.js} +1 -1
- package/dist/client/assets/{popover-CLUI-WCq.js → popover-L7EmpGzG.js} +1 -1
- package/dist/client/assets/{post-calendar-DGbwtgLH.js → post-calendar-CrzSJ4wO.js} +1 -1
- package/dist/client/assets/{post-editor-Cb57gZLf.js → post-editor-D6PvmOkx.js} +1 -1
- package/dist/client/assets/{preview-content-YsDfk6M3.js → preview-content-BdQavgtT.js} +1 -1
- package/dist/client/assets/{preview-dialog-Bz6A7RNp.js → preview-dialog-DRt8NRQg.js} +1 -1
- package/dist/client/assets/{preview-panel-4Ms4IncO.js → preview-panel-C7R9FzB7.js} +1 -1
- package/dist/client/assets/{preview-tab-DEm7tkhA.js → preview-tab-DE998jcM.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-CNlHID1U.js → product-picker-dialog-CasJjhcc.js} +1 -1
- package/dist/client/assets/{profile-Bt00wkq5.js → profile-DaVD3rXx.js} +1 -1
- package/dist/client/assets/{project-app-view-BTWft0P3.js → project-app-view-BgNgayQ9.js} +1 -1
- package/dist/client/assets/{project-apps-XmfSXScr.js → project-apps-9RUwCLHJ.js} +1 -1
- package/dist/client/assets/{project-icon-BkeJc-xp.js → project-icon-DCOepmMu.js} +1 -1
- package/dist/client/assets/{project-index-C3tTBxDV.js → project-index-kHTy1V43.js} +1 -1
- package/dist/client/assets/project-reports-SFE87SXv.js +1 -0
- package/dist/client/assets/project-tasks-CZgEt2Vy.js +1 -0
- package/dist/client/assets/{projects-D_tybxDG.js → projects-Cfrtdtxw.js} +1 -1
- package/dist/client/assets/{projects-empty-state-BN5sLjWv.js → projects-empty-state-BOqzKLFM.js} +1 -1
- package/dist/client/assets/{prompts-CBKakZB5.js → prompts-CeNm4O78.js} +1 -1
- package/dist/client/assets/{record-editor-DF0JyxbJ.js → record-editor-BDc47aTz.js} +1 -1
- package/dist/client/assets/{redirect-editor-DCz9NXOZ.js → redirect-editor-B5YbT02W.js} +1 -1
- package/dist/client/assets/reports-CGHHsIAg.js +1 -0
- package/dist/client/assets/{reports-onboarding-DCAmw-bq.js → reports-onboarding-BF3nb40S.js} +1 -1
- package/dist/client/assets/{reports-tab-RfuGKaQ3.js → reports-tab-CGHZrbkt.js} +2 -2
- package/dist/client/assets/{reports-Df9PLvuX.js → reports-yqXMJIxG.js} +1 -1
- package/dist/client/assets/repositories-CXahUI4R.js +1 -0
- package/dist/client/assets/{repositories-B40Xay0b.js → repositories-Dxg6NBM0.js} +1 -1
- package/dist/client/assets/{repository-binding-DqsJn1Sb.js → repository-binding-SYfLLQPp.js} +1 -1
- package/dist/client/assets/{repository-picker-DjmqKxQp.js → repository-picker-CbFl2YYE.js} +1 -1
- package/dist/client/assets/{require-capability-11VEza5N.js → require-capability-BiwpdxIn.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CnCT_9Qk.js → required-auth-layout-DFuLVB75.js} +1 -1
- package/dist/client/assets/{reset-password-DhGtg5RA.js → reset-password-HUKzr46F.js} +1 -1
- package/dist/client/assets/{resizable-DqI16h9r.js → resizable-CmCl4ei7.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-SqRc32_W.js → resolve-tab-icon-BjnMFr70.js} +1 -1
- package/dist/client/assets/{review-settings-DsCgah9j.js → review-settings-CA-nqHST.js} +1 -1
- package/dist/client/assets/{role-color-Bsnv2ruh.js → role-color-boYo8Hxk.js} +1 -1
- package/dist/client/assets/{roles-CfgNfQ5D.js → roles-B5mCkh61.js} +1 -1
- package/dist/client/assets/{route-YS6zinDQ.js → route-B6oRH5TC.js} +1 -1
- package/dist/client/assets/route-BGFrmL98.js +1 -0
- package/dist/client/assets/{route-CF7rRyVo.js → route-_4HjzOd2.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-Cm_5q5SF.js → sandbox-lifecycle-context-Dz7l9f2x.js} +1 -1
- package/dist/client/assets/{save-status-DQIuewYI.js → save-status-C-e1JPTQ.js} +1 -1
- package/dist/client/assets/{schema-BtSfTK7H.js → schema-821-vfww.js} +1 -1
- package/dist/client/assets/{schema-CMu2qDHJ.js → schema-CLtIHsoR.js} +1 -1
- package/dist/client/assets/{scroll-area-CNyj4Q1_.js → scroll-area-Jht8lpyk.js} +1 -1
- package/dist/client/assets/{search-input-DfFZA2x_.js → search-input-B93QU4Dy.js} +1 -1
- package/dist/client/assets/{search-toggle-BMP-t51j.js → search-toggle-tlJ3SbIE.js} +1 -1
- package/dist/client/assets/{secret-picker-Cia0fA6k.js → secret-picker-CAALtPpd.js} +1 -1
- package/dist/client/assets/{secrets-Db72b1dr.js → secrets-C80xJsHQ.js} +1 -1
- package/dist/client/assets/{section-array-field-CItEGXFU.js → section-array-field-CBZsskhA.js} +1 -1
- package/dist/client/assets/{sections-BnvGhIDh.js → sections-B_HR2jtY.js} +1 -1
- package/dist/client/assets/{sections-editor-8kOnY41Y.js → sections-editor-EHDr6zm_.js} +1 -1
- package/dist/client/assets/{select-B-QXEyVH.js → select-e2tvI61e.js} +1 -1
- package/dist/client/assets/{select-model-BM57OK8a.js → select-model-M3nxcPkm.js} +1 -1
- package/dist/client/assets/{seo-editor-DUVQDKfJ.js → seo-editor-DEOahzw6.js} +1 -1
- package/dist/client/assets/{separator-CZVEZSKr.js → separator-BI2slX_5.js} +1 -1
- package/dist/client/assets/settings-tab-CU7bs3DW.js +1 -0
- package/dist/client/assets/{sheet-DFpCUkzK.js → sheet-DvkksJq0.js} +1 -1
- package/dist/client/assets/{shell-layout-3tQDWFJU.js → shell-layout-BCfYpYFh.js} +1 -1
- package/dist/client/assets/{site-draft-actions-BT56hEH5.js → site-draft-actions-qfCZ-0Ms.js} +1 -1
- package/dist/client/assets/{site-draft-view-DaVZ51CU.js → site-draft-view-DVJ5_AAD.js} +1 -1
- package/dist/client/assets/site-editor-Cm6TtNkp.js +1 -0
- package/dist/client/assets/{site-editor-toast-DrPEsDU7.js → site-editor-toast-B030LZGc.js} +1 -1
- package/dist/client/assets/{skills-Bh8g9zPx.js → skills-DU3JvR9H.js} +1 -1
- package/dist/client/assets/{slider-D5-tjvxC.js → slider-BqNz0Q_x.js} +1 -1
- package/dist/client/assets/{sortable.esm-CD7Wn3a-.js → sortable.esm-Dgvk_55x.js} +1 -1
- package/dist/client/assets/{sso-CgVuMvqq.js → sso-B36MJWf3.js} +1 -1
- package/dist/client/assets/{suggestion-BjK1ijWQ.js → suggestion-DjTd4iW-.js} +1 -1
- package/dist/client/assets/{super-agent-icon-D1UApnZ8.js → super-agent-icon-BFe-gjNi.js} +1 -1
- package/dist/client/assets/{switch-YFmb691t.js → switch-CVqJR3dk.js} +1 -1
- package/dist/client/assets/{synced-repos-QaqG0EO3.js → synced-repos-CdEL5OLa.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-CjjddmUR.js → tab-icon-glyph-we-DMaKk.js} +1 -1
- package/dist/client/assets/{table-EoWRqCf0.js → table-DyAbyTkr.js} +1 -1
- package/dist/client/assets/{tabs-BPfd6mHK.js → tabs-RDxPTimY.js} +1 -1
- package/dist/client/assets/{task-board-CjAeUa_m.js → task-board-CNxFcEEU.js} +1 -1
- package/dist/client/assets/{task-route-Br2Lpz0h.js → task-route-BY8SQPrf.js} +1 -1
- package/dist/client/assets/{task-status-e2bwwrq0.js → task-status-BQ9l-imv.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-Dz_bNdVa.js → taskboard-analytics-D-fKcUTx.js} +1 -1
- package/dist/client/assets/tasks-CWBTMAuG.js +1 -0
- package/dist/client/assets/{tasks-B4uBSKBg.js → tasks-H_163psh.js} +1 -1
- package/dist/client/assets/{textarea-BDeCVCG_.js → textarea-D8L9nIm0.js} +1 -1
- package/dist/client/assets/{thread-analytics-DhaZl6TQ.js → thread-analytics-B6wRhPTZ.js} +1 -1
- package/dist/client/assets/{thread-intent-oRL32U-K.js → thread-intent-BoKpDkXm.js} +1 -1
- package/dist/client/assets/{thread-route-Be5LHqPZ.js → thread-route-CjhH3Hve.js} +1 -1
- package/dist/client/assets/{thread-route-tkHuy51W.js → thread-route-D-qV5LOQ.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-De3nDIYw.js → thread-sheet-body-BmxCKr5-.js} +1 -1
- package/dist/client/assets/{time-range-picker-RqJkhR4f.js → time-range-picker-BI1bqfR0.js} +1 -1
- package/dist/client/assets/{toggle-group-Dyg7Y_bS.js → toggle-group-C9F5Qvi7.js} +1 -1
- package/dist/client/assets/{tool-namespace-pd4DYce0.js → tool-namespace-Cwe3IZ6z.js} +1 -1
- package/dist/client/assets/{tool-set-selector-BxflvD5s.js → tool-set-selector-BIHpKu9L.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-T_NjCrYE.js → toolbar-icon-button-C4QFd50C.js} +1 -1
- package/dist/client/assets/{tooltip-BTKQq4Sy.js → tooltip-C-0kDxkl.js} +1 -1
- package/dist/client/assets/{tooltipContext-B3whzr3K.js → tooltipContext-DjUViqx9.js} +1 -1
- package/dist/client/assets/{track-hg2uNpQa.js → track-DWFP8jCm.js} +1 -1
- package/dist/client/assets/{types-DD9MvS2H.js → types-DrwTBhGr.js} +1 -1
- package/dist/client/assets/{url-slug-CAaHyqrT.js → url-slug-xvxPIesW.js} +1 -1
- package/dist/client/assets/{usage-stats-LrxjpMvT.js → usage-stats-BFAUXiEn.js} +1 -1
- package/dist/client/assets/use-ai-providers-Drq9rd-R.js +1 -0
- package/dist/client/assets/{use-apply-named-rule-CQGJ9Q6I.js → use-apply-named-rule-BqLt_ETT.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-DRRgH5qP.js +1 -0
- package/dist/client/assets/{use-automations-CRCU5rUU.js → use-automations-DnYKYkJG.js} +1 -1
- package/dist/client/assets/{use-autosave-HJouXCY9.js → use-autosave-BxcdTX-O.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-Ce_mrKLc.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-DZgmLot0.js → use-chat-layout-state-CIpS2ixg.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-CQn8AjkF.js → use-cms-publish-actions-CFC3bJmB.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DgTOfpzN.js → use-connect-companion-ortXPeJY.js} +1 -1
- package/dist/client/assets/{use-connection-jMnM0Hiq.js → use-connection-CoSLklxV.js} +1 -1
- package/dist/client/assets/{use-content-sync-DvjyB8U-.js → use-content-sync-BvIburw3.js} +1 -1
- package/dist/client/assets/{use-copy-B36-QB7R.js → use-copy-ChDt5LN5.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-CVz_yaSt.js → use-date-fns-locale-6TxnLgf0.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BCwvmx_C.js → use-debounced-autosave-DuzJ4VFK.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Be2K3Tgl.js → use-debounced-value-CPC4qMn_.js} +1 -1
- package/dist/client/assets/{use-deco-credits-B5uE_Z9G.js → use-deco-credits-Cct8YuxZ.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-144aPqKs.js → use-decopilot-events-DrQkcg1u.js} +1 -1
- package/dist/client/assets/{use-delete-block-BSTpS7wO.js → use-delete-block-CZz_ptBE.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BIASpF84.js → use-delete-connection-CpvyLSMF.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CK9MBH_P.js → use-deployment-admin-DqLzMbx4.js} +1 -1
- package/dist/client/assets/{use-entitlements-D0Sb8QlP.js → use-entitlements-BTXwUzEe.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-D9g7iX8I.js → use-fast-preview-draft-url-BpU8VWnC.js} +1 -1
- package/dist/client/assets/{use-file-configs-Tkt_AHql.js → use-file-configs-DlI3360C.js} +1 -1
- package/dist/client/assets/{use-id-selection-Cpsai2fK.js → use-id-selection-q64VX8pH.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-CUpQJBQD.js → use-inbox-feed-BXQf8xik.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-C-wdmvlm.js → use-infinite-scroll-DToG_mXG.js} +1 -1
- package/dist/client/assets/{use-join-requests-D6nkHBhc.js → use-join-requests-BkEJmRDc.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-DTIYfLGl.js → use-main-panel-tabs-dGK32Zdd.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-C3bL-6Ja.js → use-mcp-auth-status-CMiOMa1q.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Cp7itm-S.js → use-mcp-client-BJYqkCGO.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CF2bE4L8.js → use-mcp-prompts-L17hBbZI.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DqfH77AW.js → use-mcp-tools-BmsHVJ_e.js} +1 -1
- package/dist/client/assets/{use-mobile-CMr55W3O.js → use-mobile-BZxtzMj7.js} +1 -1
- package/dist/client/assets/{use-move-blocks-vAC3BNbO.js → use-move-blocks-BhC8Ou_b.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Bc47TXuM.js → use-navigate-to-agent-v5tv9KVo.js} +1 -1
- package/dist/client/assets/{use-never-published-622FRxP4.js → use-never-published-ftzoQCEb.js} +1 -1
- package/dist/client/assets/{use-org-fs-CnKWtsx6.js → use-org-fs-DwXaWmOv.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CWan9UEi.js → use-org-repo-syncs-C9CNVJm1.js} +1 -1
- package/dist/client/assets/{use-org-sso-Dx6waIv3.js → use-org-sso-BxQ8a0VK.js} +1 -1
- package/dist/client/assets/{use-organization-settings-C44OxrrF.js → use-organization-settings-DNlKPHFq.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-BOiBdd4j.js → use-project-native-view-presence-AFSL4S75.js} +1 -1
- package/dist/client/assets/{use-project-scope-BpnU42cL.js → use-project-scope-Fr7Egb1F.js} +1 -1
- package/dist/client/assets/{use-recent-apps-DIc0b7h6.js → use-recent-apps-BEYnfhfp.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-l8XSuOVG.js → use-reports-diagnostic-2pn_94P0.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-BTC_EPGc.js → use-sandbox-events-jMtZqiMa.js} +1 -1
- package/dist/client/assets/{use-secrets-CFtisZrp.js → use-secrets-CBdbQcuQ.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-C9SoEJn0.js → use-section-preview-base-J9b63pbx.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-V5_gd1MI.js → use-sidebar-collapsed-BfQVGyVT.js} +1 -1
- package/dist/client/assets/{use-tags-Cxhud9Xt.js → use-tags-BEbkxwEv.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-CpAa6pHW.js → use-task-board-analytics-CjF5lq2A.js} +1 -1
- package/dist/client/assets/{use-task-board-events-DspRxQsF.js → use-task-board-events-ube60SA0.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-CZVWQT5i.js → use-task-board-item-prs-nU2PcUzp.js} +1 -1
- package/dist/client/assets/{use-task-board-items-CzVlUMOO.js → use-task-board-items-Di-1rSrZ.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-ngKSI_fY.js → use-task-board-prompts-BDQ8kbX2.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DiPyoyq1.js → use-task-metadata-DrDAhZTp.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-BT9YWT4X.js → use-thread-outputs-Ch3NEbJD.js} +1 -1
- package/dist/client/assets/{use-view-draft-kind-BTxfGo3P.js → use-view-draft-kind-C5ojzKhH.js} +1 -1
- package/dist/client/assets/{use-voice-input-D66t9nvu.js → use-voice-input-DHuYIV5W.js} +1 -1
- package/dist/client/assets/useInfiniteQuery--BgI5-DV.js +1 -0
- package/dist/client/assets/{useQueries-M4myONOE.js → useQueries-PCnHBPMW.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B_FBCJuI.js +1 -0
- package/dist/client/assets/{users-BRGauFES.js → users-y7gdQpb2.js} +1 -1
- package/dist/client/assets/{utils-CZf0WW3u.js → utils-DZ4Tq9_F.js} +1 -1
- package/dist/client/assets/{variant-calendar-MTIN2TYC.js → variant-calendar-Jezxzb2B.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-yvSV8zF4.js → variant-matcher-override-R9Ip3akP.js} +1 -1
- package/dist/client/assets/{view-header-D_yXL60l.js → view-header-DQwHRwa3.js} +1 -1
- package/dist/client/assets/{virtual-mcp-D2YHeobd.js → virtual-mcp-BMNTjIAW.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-DDOa1h_t.js → watch-sse-pool-CR6i9l-S.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +565 -565
- package/package.json +1 -1
- package/dist/client/assets/agent-app-DzDciOTO.js +0 -1
- package/dist/client/assets/agent-deck-BXpuyyHV.js +0 -1
- package/dist/client/assets/agent-experiments-BL62SJmo.js +0 -1
- package/dist/client/assets/agent-library-BFYPXgq1.js +0 -1
- package/dist/client/assets/agent-library-file-DKeb8aqf.js +0 -1
- package/dist/client/assets/agent-overview-D5jCjQVj.js +0 -1
- package/dist/client/assets/agent-settings-ESG9192X.js +0 -1
- package/dist/client/assets/agent-site-editor-code-BQnTQU7w.js +0 -2
- package/dist/client/assets/agent-site-editor-content-qd-na2CD.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-BXjMAtak.js +0 -1
- package/dist/client/assets/agent-view-BLgY0MfR.js +0 -1
- package/dist/client/assets/api-keys-vIp11w3k.js +0 -1
- package/dist/client/assets/library-CdyTGa2g.js +0 -1
- package/dist/client/assets/project-reports-CWeaaEZO.js +0 -1
- package/dist/client/assets/project-tasks-jNfpaaGU.js +0 -1
- package/dist/client/assets/reports-CffaUFeU.js +0 -1
- package/dist/client/assets/repositories-B_3cIxMq.js +0 -1
- package/dist/client/assets/route-DJv7Nx6V.js +0 -1
- package/dist/client/assets/settings-tab-B9XpN8jX.js +0 -1
- package/dist/client/assets/site-editor-DhUm8vlF.js +0 -1
- package/dist/client/assets/tasks-CwupKgpp.js +0 -1
- package/dist/client/assets/use-ai-providers-BnCLnm6i.js +0 -1
- package/dist/client/assets/use-ask-in-chat-Bn7rwpYM.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-Dd6JSEDd.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BLIxG3uZ.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BJmR9zYx.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aF as Ne,dA as Me,dy as ze,aG as de,bt as Ee,c as U,b as V,j as t,h as Se,B,r as X,m as ye,a4 as te,ak as Re,V as me,K as ee,d as se,C as _e,as as Ce,gD as Ue,dY as Fe,n as Ve,hz as ue,a3 as Le,I as J,_ as Be,X as qe,Z as Ge,Y as xe,R as He,f as Ke,hQ as Qe,q as Xe,hd as We,aE as Ye,aD as Je,o as Ze,t as Y}from"./index-B0kMZVmC.js";import{g as et}from"./extract-connection-data-CXg3fi8w.js";import{E as we}from"./empty-state-DpGHzg8-.js";import{E as tt,r as st,b as nt,c as it}from"./connection-form-helpers-DA9irt8S.js";import{c as ot,S as at,D as lt}from"./index-lrnn1LFo.js";import{u as ke,T as ct}from"./use-mcp-auth-status-C3bL-6Ja.js";import{a as rt}from"./mcp-oauth-C3I9E6hK.js";import{I as ae}from"./integration-icon-BNTOj8TI.js";import{s as dt}from"./Plus-D93afoay.js";import{bw as mt,am as ut,bp as xt,an as ne}from"./agent-icon-BLhMgLPf.js";import{a as Ie,g as pt,f as ft}from"./Tool01-BR0iTy6Z.js";import{s as ce}from"./Trash01-DcgAZcrm.js";import{b as ht,a as gt,c as jt,S as vt,d as bt}from"./sheet-DFpCUkzK.js";import{F as G,b as H,c as K,d as L,f as Q,e as pe,a as Nt}from"./form-Bz_uprQc.js";import{u as Te,a as Ae,b as St}from"./use-connection-jMnM0Hiq.js";import{u as Pe}from"./use-mcp-client-Cp7itm-S.js";import{u as yt}from"./use-mcp-tools-DqfH77AW.js";import{a as _t}from"./use-mcp-prompts-CF2bE4L8.js";import{i as Ct}from"./mcp-oauth-BW9RlFd8.js";import{u as wt,D as kt}from"./use-delete-connection-BIASpF84.js";import{c as It}from"./monitoring-stats-row-h4pC7kD6.js";import{c as Tt,b as At,C as Pt,a as Dt,B as $t}from"./chart-Cy7LFFBX.js";import{C as Ot}from"./tooltipContext-B3whzr3K.js";import{a as Mt}from"./repository-binding-DqsJn1Sb.js";import{T as ie,a as zt,c as oe,b as Et}from"./tabs-BPfd6mHK.js";import{g as De}from"./connection-slug-B8jXAB0J.js";import{n as Rt}from"./BookOpen01-BPEekJOY.js";import{g as re}from"./types-DD9MvS2H.js";import{M as Ut}from"./mcp-app-renderer-Cqipo_fr.js";import{C as Ft}from"./collection-search-CwqvBBm4.js";import{B as Vt}from"./badge-C5mneqKN.js";import{S as fe,b as he,a as ge,d as je,c as q}from"./select-B-QXEyVH.js";import{i as Lt}from"./CheckCircle-D_eKfCyb.js";import{t as Bt}from"./ChevronUp-DJytO9gL.js";import{n as qt}from"./LinkBroken01-BrTHjhI6.js";import{c as Gt}from"./UserSquare-dl1oayK_.js";import{s as Ht}from"./XClose-DN30jgS9.js";import{p as Kt,i as Qt}from"./connection-BIE1Vidl.js";import{c as Xt}from"./schema-BtSfTK7H.js";import"./metadata-D72DunRR.js";import"./Key01-CqlMd8Tp.js";import"./auth-U9K5aFal.js";import"./index-CguuJrFu.js";import"./index-D3FgkNbL.js";import"./index-CUuWKDNH.js";import"./index-BdQq_4o_.js";import"./index-DE9SDic3.js";import"./popover-CLUI-WCq.js";import"./tooltip-BTKQq4Sy.js";import"./index-2LsnM_Ir.js";import"./SearchMd-BMSOzTwj.js";import"./use-mobile-CMr55W3O.js";import"./use-navigate-to-agent-Bc47TXuM.js";import"./thread-intent-oRL32U-K.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-DDOa1h_t.js";import"./task-board-CjAeUa_m.js";import"./schema-CMu2qDHJ.js";import"./AlertCircle-CTbjWy6O.js";import"./ArrowUp-BGhmN6Zx.js";import"./ArrowLeft-XFXQyKrg.js";import"./Globe04-B6PnEpLB.js";import"./ChevronSelectorVertical-B8yNz6I1.js";import"./CreditCard01-D8vcOfs6.js";import"./SwitchHorizontal01-TvywMML0.js";import"./Minus-O-Diijsb.js";import"./Monitor01-CNesz7Zi.js";import"./Sun-Dwiv3SBK.js";import"./Play-DLBGORyf.js";import"./ShoppingBag01-BjOh6InC.js";import"./Upload01-C4wCuUx0.js";import"./Users01-Bfq6gAwi.js";import"./Zap-C1Evk-yy.js";import"./label-C8wqUUzx.js";import"./CartesianChart-CyLm4xQH.js";import"./CategoricalChart-BaZiYgxE.js";import"./AreaChart-DwuVDkrD.js";import"./active-indicator-CCMhAsc_.js";import"./url-slug-CAaHyqrT.js";const Wt=Ne({scopes:Ee(de()).describe("List of scopes available"),stateSchema:Me(de(),ze()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:Ne({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:r,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=V();let c;e[0]!==n.id?(c={connectionId:n.id},e[0]=n.id,e[1]=c):c=e[1];const d=ke(c),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=ye("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",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:"gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(mt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon-sm",className:"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]!==r?(D=()=>r(n),e[27]=n,e[28]=r,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(Ie,{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-sm",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 v;e[44]!==a?(v=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=v):v=e[45];let z;e[46]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(ce,{size:13}),e[46]=z):z=e[46];let E;e[47]!==T||e[48]!==S||e[49]!==v?(E=t.jsx(B,{variant:"ghost-destructive",size:"icon-sm",onClick:T,title:S,"aria-label":v,children:z}),e[47]=T,e[48]=S,e[49]=v,e[50]=E):E=e[50];let M;e[51]!==P||e[52]!==E||e[53]!==y||e[54]!==C?(M=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,C,P,E]}),e[51]=P,e[52]=E,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:r}=s,o=V();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]!==r?(a=()=>r(n),e[5]=n,e[6]=r,e[7]=a):a=e[7];let c;e[8]!==o?(c=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=c):c=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(Ie,{size:13}),e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==c||e[15]!==d?(x=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon-sm",onClick:a,title:c,"aria-label":d,children:u})}),e[13]=a,e[14]=c,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:r,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,isAdding:c}=s,d=V();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]!==c?(f=c?t.jsx(Se,{className:"size-[13px]"}):t.jsx(dt,{size:13}),e[5]=c,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]!==c||e[10]!==a||e[11]!==f||e[12]!==m?(h=t.jsxs(B,{variant:"default",size:"sm",className:"gap-1.5",onClick:a,disabled:c,children:[f,m]}),e[9]=c,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]!==r||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==r||e[25]!==i||e[26]!==l?(y=C=>t.jsx(X.Suspense,{fallback:t.jsx(Zt,{instance:C,onConfigure:r}),children:t.jsx(Jt,{instance:C,onConfigure:r,onAuthenticate:o,onDelete:i,onToggleStatus:l})},C.id),e[23]=o,e[24]=r,e[25]=i,e[26]=l,e[27]=y):y=e[27],j=n.map(y),e[17]=n,e[18]=o,e[19]=r,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:"surface 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 r of s){if(!r.isError)continue;const o=(r.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([r,o])=>({message:r,count:o})).sort((r,o)=>o.count-r.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:r,timeframe:o}=s,i=V(),l=Re(),a=ns(o),{data:c}=me({queryKey:ee.connectionActivity(n,o,r),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,r),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=It(c?.logs??[],a,void 0,c?.total,d?.total),x=u.data,f=u.totalCalls>0,m=ts(c?.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(Tt,{config:is,className:"h-16 w-full",children:t.jsxs(At,{data:x,barCategoryGap:"4%",children:[t.jsx(Pt,{content:t.jsx(Dt,{labelFormatter:cs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{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-2xs text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-2xs 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(Ot,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function cs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function rs(){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,r=V(),[o,i]=X.useState("14d"),{org:l}=te();let a;e[0]!==r?(a=r("details.connectionActivity.activity"),e[0]=r,e[1]=a):a=e[1];let c;e[2]!==a?(c=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,e[3]=c):c=e[3];let d;e[4]!==r?(d=r("details.connectionActivity.timeframe"),e[4]=r,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:ye("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",o===j.value?"bg-card text-foreground shadow-edge":"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]!==c||e[12]!==x?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[c,x]}),e[11]=c,e[12]=x,e[13]=f):f=e[13];let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(rs,{}),e[14]=m):m=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(X.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:"surface 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:r}=s,o=se();let i;e[0]!==o||e[1]!==r||e[2]!==n.id?(i=()=>{const x=crypto.randomUUID();o({to:"/$org/projects/$agentId",params:{org:r,agentId:n.id},search:{thread:x}})},e[0]=o,e[1]=r,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(_e,{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 c;e[8]!==n.title?(c=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=c):c=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==a||e[13]!==c?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-accent transition-colors group text-left w-full",children:[a,c,d]}),e[11]=i,e[12]=a,e[13]=c,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:r}=s;let o;if(e[0]!==r||e[1]!==n){let l;e[3]!==r?(l=a=>t.jsx(ms,{virtualMcp:a,org:r},a.id),e[3]=r,e[4]=l):l=e[4],o=n.map(l),e[0]=r,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,r=V(),{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=Mt(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 c;e[3]!==r?(c=r("details.connectionAgentsPanel.usedByAgents"),e[3]=r,e[4]=c):c=e[4];let d;e[5]!==c?(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:c})}),e[5]=c,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:"surface 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:r,org:o}=s,i=V(),l=se(),{org:a}=te();let c;e[0]!==r||e[1]!==a.id||e[2]!==a.slug?(c={connectionId:r,orgId:a.id,orgSlug:a.slug},e[0]=r,e[1]=a.id,e[2]=a.slug,e[3]=c):c=e[3];const d=Pe(c),u=Te(r);let x;e[4]!==u||e[5]!==r?(x=u?De(u):r,e[4]=u,e[5]=r,e[6]=x):x=e[6];const f=x,[m,h]=X.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(v=>v.name.toLowerCase().includes(w)||v.description&&v.description.toLowerCase().includes(w)):D;let O;e[18]!==f||e[19]!==l||e[20]!==o?(O=v=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(v.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=v=>{v.key==="Escape"&&(h(""),v.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(we,{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(v=>{const z=re(v._meta);return t.jsxs(Ue,{size:"flush",className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>P(v),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(X.Suspense,{fallback:t.jsx(Fe,{className:"h-full w-full"}),children:t.jsx(Ut,{resourceURI:z,toolInfo:{tool:v},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:v.annotations?.title??v.name}),t.jsx(ct,{annotations:v.annotations,_meta:v._meta})]}),v.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:v.description})]})]},v.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!!re(s._meta)}const ve=[];function $e(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),r=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&&r.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function le(s){const e=U.c(5),{label:n}=s,r=V();let o;e[0]!==n||e[1]!==r?(o=r("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=r,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:r,resources:o,connectionId:i,org:l}=s,a=r===void 0?ve:r,c=o===void 0?ve:o,d=V(),u=se(),x=Te(i??"");let f;e[0]!==x||e[1]!==i?(f=x?De(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(vs),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const N=j;if(n.length+a.length+c.length===0){let b;e[12]!==d?(b=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=b):b=e[13];let k;e[14]!==b?(k=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:b}),e[14]=b,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 F;e[18]!==I?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e[18]=I,e[19]=F):F=e[19];let W;return e[20]!==k||e[21]!==F?(W=t.jsxs("div",{className:"surface p-5",children:[k,F]}),e[20]=k,e[21]=F,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(b=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-accent transition-colors cursor-pointer",onClick:()=>g(b.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:$e(b.name)}),b.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:b.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},b.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=S):S=e[46];let v;e[47]!==S?(v=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[47]=S,e[48]=v):v=e[48];let z;e[49]!==i||e[50]!==N||e[51]!==l||e[52]!==n?(z=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]=z):z=e[53];let E;e[54]!==a?(E=a.length>0?a.map(js):t.jsx(le,{label:"prompts"}),e[54]=a,e[55]=E):E=e[55];let M;e[56]!==E?(M=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[56]=E,e[57]=M):M=e[57];let A;e[58]!==c?(A=c.length>0?c.map(gs):t.jsx(le,{label:"resources"}),e[58]=c,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]!==v||e[64]!==z||e[65]!==M||e[66]!==R?(p=t.jsx("div",{className:"surface overflow-hidden",children:t.jsxs(Et,{defaultValue:"tools",variant:"underline",children:[T,v,z,M,R]})}),e[62]=T,e[63]=v,e[64]=z,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(Rt,{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:$e(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 vs(s){return re(s._meta)}function bs(s){const e=U.c(13),{connection:n,displayTitle:r}=s,o=r??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 c;e[7]!==l||e[8]!==a?(c=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,e[9]=c):c=e[9];let d;return e[10]!==i||e[11]!==c?(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,c]}),e[10]=i,e[11]=c,e[12]=d):d=e[12],d}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:r,onRemoveOAuth:o}){const i=V(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Le(),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=c||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(_e,{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(K,{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(fe,{value:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsxs(he,{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(ge,{})]})}),t.jsxs(je,{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(fe,{value:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsx(he,{className:"h-10",children:t.jsx(ge,{})})}),t.jsxs(je,{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(qt,{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(Gt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(Q,{})]})}),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(K,{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"})}),t.jsx(Q,{})]})}),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(K,{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"})}),t.jsx(Q,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{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"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(Q,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{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"})}),t.jsx(Q,{})]})})]}),(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(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(tt,{value:m.value??[],onChange:m.onChange})}),t.jsx(Q,{})]})}),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(K,{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(Be,{children:[t.jsx(qe,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Vt,{variant:"success",className:"gap-1.5",children:[t.jsx(Lt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Bt,{size:12})]})})}),t.jsxs(Ge,{align:"start",children:[t.jsxs(xe,{onClick:r,children:[t.jsx(ft,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(ce,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.has_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-accent opacity-0 group-hover:opacity-100 transition-opacity rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{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"})}),d?t.jsxs(pe,{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(pe,{children:i("details.connectionSidebar.tokenSchemeHint")})]}),t.jsx(Q,{})]})})]})}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 r=s.connection_headers,o=st(r.envVars);if(Ss(r)){const l=ys(r);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(r);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,r=!1,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=nt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=it(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",r=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,...r&&{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:r,tools:o,prompts:i,resources:l,siblings:a}){const c=V(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Xe(),x=Ae(),{org:f}=te(),m=wt({onSuccess:()=>{a.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=X.useState(null),[j,N]=X.useState(!1),_=ke({connectionId:e}),{data:y}=We(),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=ot(P,Yt),S=Ye({resolver:Je(Xt),values:be(h??s)}),v=S.formState.isDirty,z=async()=>{if(!await S.trigger())return;const b=S.getValues(),k=Cs(b),I=h?.id??e;await x.update.mutateAsync({id:I,data:k}),S.reset(b)},E=()=>{S.reset(be(h??s))},M=async p=>{const b=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:k,tokenInfo:I,error:F}=await rt({connectionId:p,orgSlug:f.slug,...b?{scope:b}:{}});if(F||!k){Y.error(c("details.connection.authFailed",{error:F??""}));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(Oe){console.warn("Failed to refresh connection tools after OAuth:",Oe)}}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(c("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(c("details.connection.failedRemoveOAuth",{error:k}));return}const b=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(b.href,null)}),Y.success(c("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(c("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(kt,{...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(vt,{className:"text-base",children:h?.title??s.title}),t.jsx(bt,{className:"text-xs",children:c("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:c("details.connection.connectedBy")}),t.jsx(Ze,{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(Nt,{...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(K,{children:c("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...p})}),t.jsx(Q,{})]})}),t.jsx(G,{control:S.control,name:"description",render:({field:p})=>t.jsxs(H,{children:[t.jsx(K,{children:c("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(Q,{})]})})]}),t.jsx(Ns,{form:S,connection:h??s,hasOAuthToken:_.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:R}),t.jsx(at,{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:z,disabled:!v||r,className:"flex-1",children:c(r?"details.connection.savingButton":"details.connection.saveButton")}),v&&t.jsx(B,{variant:"outline",onClick:E,children:c("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive",onClick:()=>{const p=h??s;g(null),m.requestDelete(p)},children:[t.jsx(ce,{size:15}),c("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(lt,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(bs,{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,b)=>{try{await x.update.mutateAsync({id:p.id,data:{status:b}}),Y.success(c(b==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(c("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{N(!0);try{const p=a[0]??s,b=p.title.replace(/\s*\(\d+\)\s*$/,""),k=a.length+1,I=`${b} (${k})`,F=et("conn");await x.create.mutateAsync({id:F,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/${F}`,window.location.origin),Z=await Ct({url:W.href,token:null,orgId:f.id});Z.supportsOAuth&&!Z.isAuthenticated&&await M(F)}catch(p){console.error("Failed to add connection instance:",p),Y.error(c("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=V();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const r=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}=Ke(o),{org:a}=te(),c=Ae();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=St(d),[x,f]=X.useState(null),m=u.find(A=>A.id===x)??u[0]??null;m&&m.id!==x&&f(m.id);const h=m?.id??"",g=Pe({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}=yt(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 b of u){const k=b.id===h?_:p(b.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}=_t(D);let $;s[8]!==g?($={client:g},s[8]=g,s[9]=$):$=s[9];const{data:O}=Qe($);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 v;s[14]!==O?.resources?(v=O?.resources??[],s[14]=O?.resources,s[15]=v):v=s[15];let z;s[16]!==v?(z=v.map(Is),s[16]=v,s[17]=z):z=s[17];const E=z;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]!==r||s[23]!==l?(p=()=>r({to:"/$org/settings/connections",params:{org:l}}),s[22]=r,s[23]=l,s[24]=p):p=s[24];let b;s[25]!==e?(b=e("details.connection.backButton"),s[25]=e,s[26]=b):b=s[26];let k;s[27]!==p||s[28]!==b?(k=t.jsx(B,{variant:"outline",onClick:p,children:b}),s[27]=p,s[28]=b,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(we,{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]!==c.update.isPending||s[35]!==C||s[36]!==m||s[37]!==h||s[38]!==l||s[39]!==S||s[40]!==E||s[41]!==u?(M=t.jsx(ws,{org:l,connection:m,connectionId:h,isUpdating:c.update.isPending,tools:C,prompts:S,resources:E,siblings:u}),s[34]=c.update.isPending,s[35]=C,s[36]=m,s[37]=h,s[38]=l,s[39]=S,s[40]=E,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(He,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Se,{className:"size-8 text-muted-foreground"})}),children:t.jsx(ks,{})})}),s[0]=e):e=s[0],e}function ci(){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{ci as default};
|
|
1
|
+
import{aF as Ne,dA as Me,dy as ze,aG as de,bt as Ee,c as U,b as V,j as t,h as Se,B,r as X,m as ye,a4 as te,ak as Re,V as me,K as ee,d as se,C as _e,as as Ce,gD as Ue,dY as Fe,n as Ve,hz as ue,a3 as Le,I as J,_ as Be,X as qe,Z as Ge,Y as xe,R as He,f as Ke,hQ as Qe,q as Xe,hd as We,aE as Ye,aD as Je,o as Ze,t as Y}from"./index-CWyPzcrL.js";import{g as et}from"./extract-connection-data-Dcbv_gVC.js";import{E as we}from"./empty-state-BBFh_11d.js";import{E as tt,r as st,b as nt,c as it}from"./connection-form-helpers-B9JY5oaH.js";import{c as ot,S as at,D as lt}from"./index-CNwv7lrZ.js";import{u as ke,T as ct}from"./use-mcp-auth-status-CMiOMa1q.js";import{a as rt}from"./mcp-oauth-CciCTLp9.js";import{I as ae}from"./integration-icon-C_WzTScv.js";import{s as dt}from"./Plus-CRqz0c82.js";import{bw as mt,am as ut,bp as xt,an as ne}from"./agent-icon-DvD5kv_K.js";import{a as Ie,g as pt,f as ft}from"./Tool01-D9-ePNaJ.js";import{s as ce}from"./Trash01-BTZDkUzq.js";import{b as ht,a as gt,c as jt,S as vt,d as bt}from"./sheet-DvkksJq0.js";import{F as G,b as H,c as K,d as L,f as Q,e as pe,a as Nt}from"./form-fep7EsZM.js";import{u as Te,a as Ae,b as St}from"./use-connection-CoSLklxV.js";import{u as Pe}from"./use-mcp-client-BJYqkCGO.js";import{u as yt}from"./use-mcp-tools-BmsHVJ_e.js";import{a as _t}from"./use-mcp-prompts-L17hBbZI.js";import{i as Ct}from"./mcp-oauth-DOQO_m1D.js";import{u as wt,D as kt}from"./use-delete-connection-CpvyLSMF.js";import{c as It}from"./monitoring-stats-row-D-1eXI4W.js";import{c as Tt,b as At,C as Pt,a as Dt,B as $t}from"./chart-B9PgP-e_.js";import{C as Ot}from"./tooltipContext-DjUViqx9.js";import{a as Mt}from"./repository-binding-SYfLLQPp.js";import{T as ie,a as zt,c as oe,b as Et}from"./tabs-RDxPTimY.js";import{g as De}from"./connection-slug-CP70si3t.js";import{n as Rt}from"./BookOpen01-m1uNXDEc.js";import{g as re}from"./types-DrwTBhGr.js";import{M as Ut}from"./mcp-app-renderer-DBs207iT.js";import{C as Ft}from"./collection-search-DvsK7hSv.js";import{B as Vt}from"./badge-DzB3sqoD.js";import{S as fe,b as he,a as ge,d as je,c as q}from"./select-e2tvI61e.js";import{i as Lt}from"./CheckCircle-DAPdRkcW.js";import{t as Bt}from"./ChevronUp-BaKxA_AU.js";import{n as qt}from"./LinkBroken01-IVC8feVZ.js";import{c as Gt}from"./UserSquare-Dv0YcmkC.js";import{s as Ht}from"./XClose-CyHahh4m.js";import{p as Kt,i as Qt}from"./connection-CJZ6RQ2g.js";import{c as Xt}from"./schema-821-vfww.js";import"./metadata-D72DunRR.js";import"./Key01-RIzbDsEi.js";import"./auth-ygmhxR7o.js";import"./index-CMsvPj3a.js";import"./index-D19_uhum.js";import"./index-CHutq_y1.js";import"./index-BdQq_4o_.js";import"./index-CVAn8xNL.js";import"./popover-L7EmpGzG.js";import"./tooltip-C-0kDxkl.js";import"./index-ixp03eW8.js";import"./SearchMd-CcAFkP0F.js";import"./use-mobile-BZxtzMj7.js";import"./use-navigate-to-agent-v5tv9KVo.js";import"./thread-intent-BoKpDkXm.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-CR6i9l-S.js";import"./task-board-CNxFcEEU.js";import"./schema-CLtIHsoR.js";import"./AlertCircle-DuMz-jFi.js";import"./ArrowUp-D5JWz7Yq.js";import"./ArrowLeft-5NT3k46C.js";import"./Globe04-KZ-J2ZUi.js";import"./ChevronSelectorVertical-5fTMRN5v.js";import"./CreditCard01-BU3Icpfr.js";import"./SwitchHorizontal01-D3zx9VNf.js";import"./Minus-Dw050KAn.js";import"./Monitor01-D7QUQToM.js";import"./Sun-DRT9bMW5.js";import"./Play-BDSDyO5E.js";import"./ShoppingBag01-CspfAlNO.js";import"./Upload01-BRP1bAMs.js";import"./Users01-DKwguy8Z.js";import"./Zap-Dja9fdMf.js";import"./label-Cf_dlQhi.js";import"./CartesianChart-D9oScPZv.js";import"./CategoricalChart-BR_4thmy.js";import"./AreaChart-BqIC3e-u.js";import"./active-indicator-CCMhAsc_.js";import"./url-slug-xvxPIesW.js";const Wt=Ne({scopes:Ee(de()).describe("List of scopes available"),stateSchema:Me(de(),ze()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:Ne({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:r,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=V();let c;e[0]!==n.id?(c={connectionId:n.id},e[0]=n.id,e[1]=c):c=e[1];const d=ke(c),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=ye("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",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:"gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(mt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon-sm",className:"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]!==r?(D=()=>r(n),e[27]=n,e[28]=r,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(Ie,{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-sm",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 v;e[44]!==a?(v=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=v):v=e[45];let z;e[46]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(ce,{size:13}),e[46]=z):z=e[46];let E;e[47]!==T||e[48]!==S||e[49]!==v?(E=t.jsx(B,{variant:"ghost-destructive",size:"icon-sm",onClick:T,title:S,"aria-label":v,children:z}),e[47]=T,e[48]=S,e[49]=v,e[50]=E):E=e[50];let M;e[51]!==P||e[52]!==E||e[53]!==y||e[54]!==C?(M=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,C,P,E]}),e[51]=P,e[52]=E,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:r}=s,o=V();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]!==r?(a=()=>r(n),e[5]=n,e[6]=r,e[7]=a):a=e[7];let c;e[8]!==o?(c=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=c):c=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(Ie,{size:13}),e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==c||e[15]!==d?(x=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon-sm",onClick:a,title:c,"aria-label":d,children:u})}),e[13]=a,e[14]=c,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:r,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,isAdding:c}=s,d=V();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]!==c?(f=c?t.jsx(Se,{className:"size-[13px]"}):t.jsx(dt,{size:13}),e[5]=c,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]!==c||e[10]!==a||e[11]!==f||e[12]!==m?(h=t.jsxs(B,{variant:"default",size:"sm",className:"gap-1.5",onClick:a,disabled:c,children:[f,m]}),e[9]=c,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]!==r||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==r||e[25]!==i||e[26]!==l?(y=C=>t.jsx(X.Suspense,{fallback:t.jsx(Zt,{instance:C,onConfigure:r}),children:t.jsx(Jt,{instance:C,onConfigure:r,onAuthenticate:o,onDelete:i,onToggleStatus:l})},C.id),e[23]=o,e[24]=r,e[25]=i,e[26]=l,e[27]=y):y=e[27],j=n.map(y),e[17]=n,e[18]=o,e[19]=r,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:"surface 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 r of s){if(!r.isError)continue;const o=(r.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([r,o])=>({message:r,count:o})).sort((r,o)=>o.count-r.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:r,timeframe:o}=s,i=V(),l=Re(),a=ns(o),{data:c}=me({queryKey:ee.connectionActivity(n,o,r),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,r),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=It(c?.logs??[],a,void 0,c?.total,d?.total),x=u.data,f=u.totalCalls>0,m=ts(c?.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(Tt,{config:is,className:"h-16 w-full",children:t.jsxs(At,{data:x,barCategoryGap:"4%",children:[t.jsx(Pt,{content:t.jsx(Dt,{labelFormatter:cs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{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-2xs text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-2xs 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(Ot,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function cs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function rs(){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,r=V(),[o,i]=X.useState("14d"),{org:l}=te();let a;e[0]!==r?(a=r("details.connectionActivity.activity"),e[0]=r,e[1]=a):a=e[1];let c;e[2]!==a?(c=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,e[3]=c):c=e[3];let d;e[4]!==r?(d=r("details.connectionActivity.timeframe"),e[4]=r,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:ye("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",o===j.value?"bg-card text-foreground shadow-edge":"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]!==c||e[12]!==x?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[c,x]}),e[11]=c,e[12]=x,e[13]=f):f=e[13];let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(rs,{}),e[14]=m):m=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(X.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:"surface 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:r}=s,o=se();let i;e[0]!==o||e[1]!==r||e[2]!==n.id?(i=()=>{const x=crypto.randomUUID();o({to:"/$org/projects/$agentId",params:{org:r,agentId:n.id},search:{thread:x}})},e[0]=o,e[1]=r,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(_e,{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 c;e[8]!==n.title?(c=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=c):c=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==a||e[13]!==c?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-accent transition-colors group text-left w-full",children:[a,c,d]}),e[11]=i,e[12]=a,e[13]=c,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:r}=s;let o;if(e[0]!==r||e[1]!==n){let l;e[3]!==r?(l=a=>t.jsx(ms,{virtualMcp:a,org:r},a.id),e[3]=r,e[4]=l):l=e[4],o=n.map(l),e[0]=r,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,r=V(),{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=Mt(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 c;e[3]!==r?(c=r("details.connectionAgentsPanel.usedByAgents"),e[3]=r,e[4]=c):c=e[4];let d;e[5]!==c?(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:c})}),e[5]=c,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:"surface 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:r,org:o}=s,i=V(),l=se(),{org:a}=te();let c;e[0]!==r||e[1]!==a.id||e[2]!==a.slug?(c={connectionId:r,orgId:a.id,orgSlug:a.slug},e[0]=r,e[1]=a.id,e[2]=a.slug,e[3]=c):c=e[3];const d=Pe(c),u=Te(r);let x;e[4]!==u||e[5]!==r?(x=u?De(u):r,e[4]=u,e[5]=r,e[6]=x):x=e[6];const f=x,[m,h]=X.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(v=>v.name.toLowerCase().includes(w)||v.description&&v.description.toLowerCase().includes(w)):D;let O;e[18]!==f||e[19]!==l||e[20]!==o?(O=v=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(v.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=v=>{v.key==="Escape"&&(h(""),v.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(we,{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(v=>{const z=re(v._meta);return t.jsxs(Ue,{size:"flush",className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>P(v),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(X.Suspense,{fallback:t.jsx(Fe,{className:"h-full w-full"}),children:t.jsx(Ut,{resourceURI:z,toolInfo:{tool:v},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:v.annotations?.title??v.name}),t.jsx(ct,{annotations:v.annotations,_meta:v._meta})]}),v.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:v.description})]})]},v.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!!re(s._meta)}const ve=[];function $e(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),r=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&&r.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function le(s){const e=U.c(5),{label:n}=s,r=V();let o;e[0]!==n||e[1]!==r?(o=r("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=r,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:r,resources:o,connectionId:i,org:l}=s,a=r===void 0?ve:r,c=o===void 0?ve:o,d=V(),u=se(),x=Te(i??"");let f;e[0]!==x||e[1]!==i?(f=x?De(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(vs),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const N=j;if(n.length+a.length+c.length===0){let b;e[12]!==d?(b=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=b):b=e[13];let k;e[14]!==b?(k=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:b}),e[14]=b,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 F;e[18]!==I?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e[18]=I,e[19]=F):F=e[19];let W;return e[20]!==k||e[21]!==F?(W=t.jsxs("div",{className:"surface p-5",children:[k,F]}),e[20]=k,e[21]=F,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(b=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-accent transition-colors cursor-pointer",onClick:()=>g(b.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:$e(b.name)}),b.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:b.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},b.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=S):S=e[46];let v;e[47]!==S?(v=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[47]=S,e[48]=v):v=e[48];let z;e[49]!==i||e[50]!==N||e[51]!==l||e[52]!==n?(z=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]=z):z=e[53];let E;e[54]!==a?(E=a.length>0?a.map(js):t.jsx(le,{label:"prompts"}),e[54]=a,e[55]=E):E=e[55];let M;e[56]!==E?(M=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[56]=E,e[57]=M):M=e[57];let A;e[58]!==c?(A=c.length>0?c.map(gs):t.jsx(le,{label:"resources"}),e[58]=c,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]!==v||e[64]!==z||e[65]!==M||e[66]!==R?(p=t.jsx("div",{className:"surface overflow-hidden",children:t.jsxs(Et,{defaultValue:"tools",variant:"underline",children:[T,v,z,M,R]})}),e[62]=T,e[63]=v,e[64]=z,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(Rt,{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:$e(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 vs(s){return re(s._meta)}function bs(s){const e=U.c(13),{connection:n,displayTitle:r}=s,o=r??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 c;e[7]!==l||e[8]!==a?(c=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,e[9]=c):c=e[9];let d;return e[10]!==i||e[11]!==c?(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,c]}),e[10]=i,e[11]=c,e[12]=d):d=e[12],d}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:r,onRemoveOAuth:o}){const i=V(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Le(),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=c||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(_e,{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(K,{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(fe,{value:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsxs(he,{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(ge,{})]})}),t.jsxs(je,{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(fe,{value:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsx(he,{className:"h-10",children:t.jsx(ge,{})})}),t.jsxs(je,{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(qt,{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(Gt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(Q,{})]})}),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(K,{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"})}),t.jsx(Q,{})]})}),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(K,{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"})}),t.jsx(Q,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{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"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(Q,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{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"})}),t.jsx(Q,{})]})})]}),(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(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(tt,{value:m.value??[],onChange:m.onChange})}),t.jsx(Q,{})]})}),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(K,{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(Be,{children:[t.jsx(qe,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Vt,{variant:"success",className:"gap-1.5",children:[t.jsx(Lt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Bt,{size:12})]})})}),t.jsxs(Ge,{align:"start",children:[t.jsxs(xe,{onClick:r,children:[t.jsx(ft,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(ce,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.has_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-accent opacity-0 group-hover:opacity-100 transition-opacity rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{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"})}),d?t.jsxs(pe,{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(pe,{children:i("details.connectionSidebar.tokenSchemeHint")})]}),t.jsx(Q,{})]})})]})}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 r=s.connection_headers,o=st(r.envVars);if(Ss(r)){const l=ys(r);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(r);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,r=!1,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=nt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=it(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",r=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,...r&&{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:r,tools:o,prompts:i,resources:l,siblings:a}){const c=V(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Xe(),x=Ae(),{org:f}=te(),m=wt({onSuccess:()=>{a.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=X.useState(null),[j,N]=X.useState(!1),_=ke({connectionId:e}),{data:y}=We(),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=ot(P,Yt),S=Ye({resolver:Je(Xt),values:be(h??s)}),v=S.formState.isDirty,z=async()=>{if(!await S.trigger())return;const b=S.getValues(),k=Cs(b),I=h?.id??e;await x.update.mutateAsync({id:I,data:k}),S.reset(b)},E=()=>{S.reset(be(h??s))},M=async p=>{const b=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:k,tokenInfo:I,error:F}=await rt({connectionId:p,orgSlug:f.slug,...b?{scope:b}:{}});if(F||!k){Y.error(c("details.connection.authFailed",{error:F??""}));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(Oe){console.warn("Failed to refresh connection tools after OAuth:",Oe)}}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(c("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(c("details.connection.failedRemoveOAuth",{error:k}));return}const b=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(b.href,null)}),Y.success(c("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(c("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(kt,{...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(vt,{className:"text-base",children:h?.title??s.title}),t.jsx(bt,{className:"text-xs",children:c("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:c("details.connection.connectedBy")}),t.jsx(Ze,{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(Nt,{...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(K,{children:c("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...p})}),t.jsx(Q,{})]})}),t.jsx(G,{control:S.control,name:"description",render:({field:p})=>t.jsxs(H,{children:[t.jsx(K,{children:c("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(Q,{})]})})]}),t.jsx(Ns,{form:S,connection:h??s,hasOAuthToken:_.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:R}),t.jsx(at,{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:z,disabled:!v||r,className:"flex-1",children:c(r?"details.connection.savingButton":"details.connection.saveButton")}),v&&t.jsx(B,{variant:"outline",onClick:E,children:c("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive",onClick:()=>{const p=h??s;g(null),m.requestDelete(p)},children:[t.jsx(ce,{size:15}),c("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(lt,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(bs,{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,b)=>{try{await x.update.mutateAsync({id:p.id,data:{status:b}}),Y.success(c(b==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(c("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{N(!0);try{const p=a[0]??s,b=p.title.replace(/\s*\(\d+\)\s*$/,""),k=a.length+1,I=`${b} (${k})`,F=et("conn");await x.create.mutateAsync({id:F,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/${F}`,window.location.origin),Z=await Ct({url:W.href,token:null,orgId:f.id});Z.supportsOAuth&&!Z.isAuthenticated&&await M(F)}catch(p){console.error("Failed to add connection instance:",p),Y.error(c("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=V();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const r=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}=Ke(o),{org:a}=te(),c=Ae();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=St(d),[x,f]=X.useState(null),m=u.find(A=>A.id===x)??u[0]??null;m&&m.id!==x&&f(m.id);const h=m?.id??"",g=Pe({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}=yt(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 b of u){const k=b.id===h?_:p(b.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}=_t(D);let $;s[8]!==g?($={client:g},s[8]=g,s[9]=$):$=s[9];const{data:O}=Qe($);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 v;s[14]!==O?.resources?(v=O?.resources??[],s[14]=O?.resources,s[15]=v):v=s[15];let z;s[16]!==v?(z=v.map(Is),s[16]=v,s[17]=z):z=s[17];const E=z;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]!==r||s[23]!==l?(p=()=>r({to:"/$org/settings/connections",params:{org:l}}),s[22]=r,s[23]=l,s[24]=p):p=s[24];let b;s[25]!==e?(b=e("details.connection.backButton"),s[25]=e,s[26]=b):b=s[26];let k;s[27]!==p||s[28]!==b?(k=t.jsx(B,{variant:"outline",onClick:p,children:b}),s[27]=p,s[28]=b,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(we,{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]!==c.update.isPending||s[35]!==C||s[36]!==m||s[37]!==h||s[38]!==l||s[39]!==S||s[40]!==E||s[41]!==u?(M=t.jsx(ws,{org:l,connection:m,connectionId:h,isUpdating:c.update.isPending,tools:C,prompts:S,resources:E,siblings:u}),s[34]=c.update.isPending,s[35]=C,s[36]=m,s[37]=h,s[38]=l,s[39]=S,s[40]=E,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(He,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Se,{className:"size-8 text-muted-foreground"})}),children:t.jsx(ks,{})})}),s[0]=e):e=s[0],e}function ci(){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{ci as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as z,j as c,I as T,B as N}from"./index-
|
|
1
|
+
import{c as z,j as c,I as T,B as N}from"./index-CWyPzcrL.js";import{s as A}from"./Plus-CRqz0c82.js";import{s as H}from"./Trash01-BTZDkUzq.js";function S(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 $(n){const e=z.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:k}=n,p=o===void 0?"VARIABLE_NAME":o,h=s===void 0?"value...":s;let _;e[0]!==r||e[1]!==t?(_=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=_):_=e[2];const C=_;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((u,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let b;e[6]!==r||e[7]!==t?(b=(l,u)=>{const i=[...t],a=i[l];a&&(i[l]={key:u,value:a.value},r(i))},e[6]=r,e[7]=t,e[8]=b):b=e[8];const v=b;let P;e[9]!==r||e[10]!==t?(P=(l,u)=>{const i=[...t],a=i[l];a&&(i[l]={key:a.key,value:u},r(i))},e[9]=r,e[10]=t,e[11]=P):P=e[11];const g=P;let f;if(e[12]!==v||e[13]!==y||e[14]!==g||e[15]!==p||e[16]!==t||e[17]!==h){let l;e[19]!==v||e[20]!==y||e[21]!==g||e[22]!==p||e[23]!==h?(l=(u,i)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(T,{placeholder:p,value:u.key,onChange:a=>v(i,a.target.value),className:"h-10 flex-1 font-mono"}),c.jsx(T,{type:S(u.key)?"password":"text",placeholder:h,value:u.value,onChange:a=>g(i,a.target.value),className:"h-10 flex-1"}),c.jsx(N,{type:"button",variant:"ghost-destructive",size:"icon",className:"size-10 shrink-0",onClick:()=>y(i),children:c.jsx(H,{size:16})})]},i),e[19]=v,e[20]=y,e[21]=g,e[22]=p,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=v,e[13]=y,e[14]=g,e[15]=p,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=c.jsx(A,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let m;e[26]!==C?(m=c.jsxs(N,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:C,children:[w,"Add Environment Variable"]}),e[26]=C,e[27]=m):m=e[27];let d;e[28]!==f||e[29]!==m?(d=c.jsxs("div",{className:"flex flex-col gap-2",children:[f,m]}),e[28]=f,e[29]=m,e[30]=d):d=e[30];let E;return e[31]!==k||e[32]!==d?(E=c.jsx("div",{className:k,children:d}),e[31]=k,e[32]=d,e[33]=E):E=e[33],E}function R(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function K(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function j(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 W(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 o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function B(n){const{uiType:e}=n,t=j(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===j("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 G(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=j(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(p=>j(p.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function U(n,e){const t={command:"npx",args:["-y",n]},r=R(e);return Object.keys(r).length>0&&(t.envVars=r),t}function M(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=R(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{$ as E,G as a,U as b,M as c,B as i,W as p,K as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e}from"./thread-intent-
|
|
1
|
+
import{C as e}from"./thread-intent-BoKpDkXm.js";function s(r){if(r.app_name)return r.app_name;if(r.connection_url)try{const t=new URL(r.connection_url),a=((t.port?`${t.hostname}-${t.port}`:t.hostname)+t.pathname).replace(/\/+$/,"");return e(a)}catch{return e(r.connection_url)}return r.title?e(r.title):r.id??"unknown"}export{s as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as z,c as W,b as ne,j as t,aH as We,aI as Xe,aJ as Ge,aK as qe,b5 as Qe,aL as Je,aM as Ye,aN as Ze,B as L,h as de,m as he,Y as ie,x as Ne,aT as Te,w as Ae,y as we,v as Ie,D as Pe,X as et,_ as tt,Z as nt,R as st,a4 as Me,d as $e,u as ot,a as Fe,a3 as it,aq as ye,ar as ct,at as lt,aE as rt,aD as at,n as pe,I as se,E as te,q as dt,ak as ut,t as R,cF as gt,K as mt,gl as pt}from"./index-B0kMZVmC.js";import{a as Oe,g as ft,e as ht}from"./extract-connection-data-CXg3fi8w.js";import{C as xt}from"./collection-display-button-DVJBx_vT.js";import{S as jt}from"./search-toggle-BMP-t51j.js";import{C as St}from"./collection-tabs-81bsUeqm.js";import{C as Ce,u as Ue,g as yt}from"./connection-card-gYm1H9XQ.js";import{E as Ct}from"./empty-state-DpGHzg8-.js";import{u as vt,D as bt}from"./use-delete-connection-BIASpF84.js";import{u as _t}from"./use-infinite-scroll-C-wdmvlm.js";import{u as Ve}from"./use-mobile-CMr55W3O.js";import{g as ae}from"./connection-slug-B8jXAB0J.js";import{n as xe}from"./LinkBroken01-BrTHjhI6.js";import{g as Dt,a as kt}from"./metadata-D72DunRR.js";import{D as Nt,a as Tt,e as At,b as wt,c as It,f as Pt,g as Mt}from"./drawer-BBqyYfPx.js";import{F as q,b as Q,c as J,d as Y,f as Z,a as De}from"./form-Bz_uprQc.js";import{S as $t,b as Ft,a as Ot,d as Ut,c as re}from"./select-B-QXEyVH.js";import{T as Vt}from"./textarea-BDeCVCG_.js";import{a as ze,b as zt}from"./use-connection-jMnM0Hiq.js";import{m as Lt}from"./use-mcp-client-Cp7itm-S.js";import{a as Et}from"./repository-binding-DqsJn1Sb.js";import{g as Bt}from"./types-DD9MvS2H.js";import{A as Kt,c0 as Ht,am as Rt,bw as Wt,an as Se}from"./agent-icon-BLhMgLPf.js";import{s as Le}from"./Plus-D93afoay.js";import{c as Xt}from"./UserSquare-dl1oayK_.js";import{s as Ee}from"./XClose-DN30jgS9.js";import{s as Gt}from"./use-project-scope-BpnU42cL.js";import{c as qt}from"./schema-BtSfTK7H.js";import{i as fe,a as ke,E as Qt,p as Jt,b as Yt,c as Zt}from"./connection-form-helpers-DA9irt8S.js";import{a as en}from"./authenticate-and-persist-oauth-DX8Wh7d9.js";import{I as tn}from"./integration-icon-BNTOj8TI.js";import{C as Be}from"./checkbox-Bv8PV_aY.js";import{a as nn}from"./SwitchHorizontal01-TvywMML0.js";import{s as Ke}from"./Tool01-BR0iTy6Z.js";import{s as He}from"./Trash01-DcgAZcrm.js";import"./connection-BIE1Vidl.js";import"./url-slug-CAaHyqrT.js";import"./ArrowUp-BGhmN6Zx.js";import"./tooltip-BTKQq4Sy.js";import"./index-2LsnM_Ir.js";import"./toggle-group-Dyg7Y_bS.js";import"./active-indicator-CCMhAsc_.js";import"./badge-C5mneqKN.js";import"./SearchMd-BMSOzTwj.js";import"./icon-button-DqWSrNSZ.js";import"./useInfiniteQuery-BLIxG3uZ.js";import"./infiniteQueryObserver-Bpp7Nde9.js";import"./thread-intent-oRL32U-K.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-DDOa1h_t.js";import"./task-board-CjAeUa_m.js";import"./schema-CMu2qDHJ.js";import"./label-C8wqUUzx.js";import"./index-BdQq_4o_.js";import"./ChevronUp-DJytO9gL.js";import"./auth-U9K5aFal.js";import"./AlertCircle-CTbjWy6O.js";import"./ArrowLeft-XFXQyKrg.js";import"./BookOpen01-BPEekJOY.js";import"./Globe04-B6PnEpLB.js";import"./CheckCircle-D_eKfCyb.js";import"./ChevronSelectorVertical-B8yNz6I1.js";import"./CreditCard01-D8vcOfs6.js";import"./Key01-CqlMd8Tp.js";import"./Minus-O-Diijsb.js";import"./Monitor01-CNesz7Zi.js";import"./Sun-Dwiv3SBK.js";import"./Play-DLBGORyf.js";import"./ShoppingBag01-BjOh6InC.js";import"./Upload01-C4wCuUx0.js";import"./Users01-Bfq6gAwi.js";import"./Zap-C1Evk-yy.js";import"./mcp-oauth-C3I9E6hK.js";import"./mcp-oauth-BW9RlFd8.js";function sn(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 on(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 cn(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 S=globalThis.localStorage?.getItem(l);return S==="cards"||S==="table"?S: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=S=>{p(S),globalThis.localStorage?.setItem(l,S)},n[3]=l,n[4]=m):m=n[4];const u=m;let a,j;n[5]!==o||n[6]!==d?(a=()=>{!i.current&&o&&d==="table"&&p("cards"),i.current=o},j=[o,d],n[5]=o,n[6]=d,n[7]=a,n[8]=j):(a=n[7],j=n[8]),z.useEffect(a,j);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 ln(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,j]=sn(u),f=`studio-${g}-filter-visible-${n}`;let S;e[0]!==f?(S=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=S):S=e[1];const[y,v]=z.useState(S);let C;e[2]!==f?(C=$=>{v($),globalThis.localStorage?.setItem(f,String($))},e[2]=f,e[3]=C):C=e[3];const c=C;let h;e[4]!==y||e[5]!==c?(h=()=>{c(!y)},e[4]=y,e[5]=c,e[6]=h):h=e[6];const w=h,[N,T]=cn(`studio-${g}-${n}`,r),{sortKey:M,sortDirection:I,handleSort:F}=on(l),P=M;let k;return e[7]!==y||e[8]!==a||e[9]!==F||e[10]!==d||e[11]!==m||e[12]!==c||e[13]!==j||e[14]!==T||e[15]!==I||e[16]!==P||e[17]!==w||e[18]!==N?(k={search:d,searchTerm:m,setSearch:p,filters:a,setFilters:j,filterBarVisible:y,setFilterBarVisible:c,toggleFilterBar:w,viewMode:N,setViewMode:T,sortKey:P,sortDirection:I,handleSort:F},e[7]=y,e[8]=a,e[9]=F,e[10]=d,e[11]=m,e[12]=c,e[13]=j,e[14]=T,e[15]=I,e[16]=P,e[17]=w,e[18]=N,e[19]=k):k=e[19],k}function rn(s){const e=W.c(35),{open:n,onOpenChange:g,count:o,onConfirm:i}=s,l=ne(),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(We,{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(Xe,{children:u}),e[9]=u,e[10]=a):a=e[10];let j;e[11]!==p||e[12]!==a?(j=t.jsxs(Ge,{children:[p,a]}),e[11]=p,e[12]=a,e[13]=j):j=e[13];let f;e[14]!==l?(f=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=f):f=e[15];let S;e[16]!==f?(S=t.jsx(qe,{children:f}),e[16]=f,e[17]=S):S=e[17];const y=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let v;e[18]!==o||e[19]!==l||e[20]!==y?(v=l(y,{count:o}),e[18]=o,e[19]=l,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==i||e[23]!==v?(C=t.jsx(Qe,{onClick:i,variant:"destructive",children:v}),e[22]=i,e[23]=v,e[24]=C):C=e[24];let c;e[25]!==C||e[26]!==S?(c=t.jsxs(Je,{children:[S,C]}),e[25]=C,e[26]=S,e[27]=c):c=e[27];let h;e[28]!==c||e[29]!==j?(h=t.jsxs(Ye,{children:[j,c]}),e[28]=c,e[29]=j,e[30]=h):h=e[30];let w;return e[31]!==g||e[32]!==n||e[33]!==h?(w=t.jsx(Ze,{open:n,onOpenChange:g,children:h}),e[31]=g,e[32]=n,e[33]=h,e[34]=w):w=e[34],w}function an(s){const e=W.c(39),{item:n,canManage:g,allConnections:o,connectedAppNames:i,connectingItemId:l,onNavigateConnected:r,onConnect:d}=s,p=ne();let m,u;e[0]!==i||e[1]!==n?(m=Oe(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 j;e[4]!==n._meta?(j=Dt(n._meta),e[4]=n._meta,e[5]=j):j=e[5];const f=j,S=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",y=n.server?.description||n.description||null;let v;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(v=n.server?.icons?.[0]?.src||kt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=v):v=e[8];const C=v;let c;if(e[9]!==o||e[10]!==m){let U;e[12]!==m?(U=X=>X.connection_type!=="VIRTUAL"&&X.app_name===m,e[12]=m,e[13]=U):U=e[13],c=o.filter(U),e[9]=o,e[10]=m,e[11]=c}else c=e[11];const h=c,w=a||g;let N,T;e[14]!==h||e[15]!==a||e[16]!==n||e[17]!==d||e[18]!==r?(N=()=>{if(a){const U=h[0];U&&r(U);return}T()},T=()=>d(n),e[14]=h,e[15]=a,e[16]=n,e[17]=d,e[18]=r,e[19]=N,e[20]=T):(N=e[19],T=e[20]);let M;e[21]!==y||e[22]!==C||e[23]!==S?(M={title:S,description:y,icon:C},e[21]=y,e[22]=C,e[23]=S,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 F=w?N:void 0;let P;e[26]!==g||e[27]!==l||e[28]!==T||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(L,{variant:"outline",size:"sm",disabled:l!==null,onClick:U=>{U.stopPropagation(),T()},children:l===n.id?t.jsx(de,{className:"size-3.5"}):p("orgs.catalogItemCard.connect")}),e[26]=g,e[27]=l,e[28]=T,e[29]=a,e[30]=n.id,e[31]=p,e[32]=P):P=e[32];let k;e[33]!==P?(k=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=k):k=e[34];let $;return e[35]!==M||e[36]!==F||e[37]!==k?($=t.jsx(Ce,{connection:M,fallbackIcon:I,onClick:F,headerActionsAlwaysVisible:!0,headerActions:k}),e[35]=M,e[36]=F,e[37]=k,e[38]=$):$=e[38],$}function dn(s){return s?.length?{appToolName:s.find(n=>!!Bt(n._meta))?.name??null}:null}const un=3;function gn(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 mn(s){const e=W.c(21),{projects:n}=s,g=ne();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,un);l="flex min-w-0 items-center gap-2",o="flex shrink-0 -space-x-1.5",i=u.map(pn),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 pn(s){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:s.title,children:t.jsx(Kt,{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(et,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",onClick:hn,children:t.jsx(nn,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==g?(r=t.jsxs(tt,{children:[l,t.jsx(nt,{align:"end",onClick:fn,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 fn(s){return s.stopPropagation()}function hn(s){return s.stopPropagation()}function xn(s){const e=W.c(57),{group:n,onOpen:g,selectionMode:o,selectedIds:i,onToggleSelect:l}=s,r=ne();let d;if(e[0]!==n.connections||e[1]!==i){let x;e[3]!==i?(x=A=>i.has(A.id),e[3]=i,e[4]=x):x=e[4],d=n.connections.every(x),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 x;e[8]!==i?(x=A=>i.has(A.id),e[8]=i,e[9]=x):x=e[9],m=n.connections.some(x),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 x of n.connections)p?i.has(x.id)&&l(x.id):i.has(x.id)||l(x.id)},e[10]=p,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=a):a=e[14];const j=a,f=n.title,S=n.icon;let y;e[15]!==n.connections.length||e[16]!==r?(y=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=y):y=e[17];let v;e[18]!==n.icon||e[19]!==n.title||e[20]!==y?(v={title:f,icon:S,description:y},e[18]=n.icon,e[19]=n.title,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==g||e[23]!==o||e[24]!==j?(C=()=>o?j():g(),e[22]=g,e[23]=o,e[24]=j,e[25]=C):C=e[25];const c=o&&p&&"ring-2 ring-primary",h=o&&u&&!p&&"ring-1 ring-primary/50";let w;e[26]!==h||e[27]!==c?(w=he(c,h),e[26]=h,e[27]=c,e[28]=w):w=e[28];const N=o?p?!0:u&&"mixed":void 0;let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(xe,{}),e[29]=T):T=e[29];let M;e[30]!==p||e[31]!==n.connections.length||e[32]!==o||e[33]!==u||e[34]!==r||e[35]!==j?(M=o?t.jsx(Be,{checked:p?!0:u?"indeterminate":!1,onCheckedChange:j}):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]=j,e[36]=M):M=e[36];let I;e[37]!==g?(I=x=>{x.stopPropagation(),g()},e[37]=g,e[38]=I):I=e[38];let F;e[39]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(Ke,{size:16}),e[39]=F):F=e[39];let P;e[40]!==r?(P=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=P):P=e[41];let k;e[42]!==I||e[43]!==P?(k=t.jsxs(ie,{onClick:I,children:[F,P]}),e[42]=I,e[43]=P,e[44]=k):k=e[44];let $;e[45]!==o||e[46]!==k?($=t.jsx(Re,{selectionMode:o,children:k}),e[45]=o,e[46]=k,e[47]=$):$=e[47];let U;e[48]!==M||e[49]!==$?(U=t.jsxs("div",{className:"flex items-center gap-1",children:[M,$]}),e[48]=M,e[49]=$,e[50]=U):U=e[50];let X;return e[51]!==w||e[52]!==N||e[53]!==U||e[54]!==v||e[55]!==C?(X=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:v,onClick:C,className:w,selected:N,fallbackIcon:T,headerActionsAlwaysVisible:!0,headerActions:U})}),e[51]=w,e[52]=N,e[53]=U,e[54]=v,e[55]=C,e[56]=X):X=e[56],X}function jn(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=ne();let a;e[0]!==g||e[1]!==r||e[2]!==o||e[3]!==u?(a=o?t.jsx(Be,{checked:g,onCheckedChange:r,onClick:Sn}):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 j;e[5]!==d?(j=N=>{N.stopPropagation(),d()},e[5]=d,e[6]=j):j=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 S;e[8]!==u?(S=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=S):S=e[9];let y;e[10]!==j||e[11]!==S?(y=t.jsxs(ie,{onClick:j,children:[f,S]}),e[10]=j,e[11]=S,e[12]=y):y=e[12];let v;e[13]!==i||e[14]!==l||e[15]!==r||e[16]!==u?(v=(i||l)&&t.jsxs(ie,{onClick:N=>{N.stopPropagation(),r()},children:[t.jsx(Ht,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=r,e[16]=u,e[17]=v):v=e[17];let C;e[18]!==i||e[19]!==n||e[20]!==p||e[21]!==u?(C=i&&(n.status==="active"?t.jsxs(ie,{onClick:N=>{N.stopPropagation(),p("inactive")},children:[t.jsx(Rt,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ie,{onClick:N=>{N.stopPropagation(),p("active")},children:[t.jsx(Wt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=p,e[21]=u,e[22]=C):C=e[22];let c;e[23]!==i||e[24]!==m||e[25]!==u?(c=i&&t.jsxs(ie,{variant:"destructive",onClick:N=>{N.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]!==y||e[29]!==v||e[30]!==C||e[31]!==c?(h=t.jsxs(Re,{selectionMode:o,children:[y,v,C,c]}),e[27]=o,e[28]=y,e[29]=v,e[30]=C,e[31]=c,e[32]=h):h=e[32];let w;return e[33]!==a||e[34]!==h?(w=t.jsxs("div",{className:"flex items-center gap-1",children:[a,h]}),e[33]=a,e[34]=h,e[35]=w):w=e[35],w}function Sn(s){return s.stopPropagation()}function yn(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=ne();if(n===0)return null;let j;e[0]!==n||e[1]!==a?(j=a("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=a,e[2]=j):j=e[2];let f;e[3]!==j?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:j}),e[3]=j,e[4]=f):f=e[4];let S;e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==g?(S=n<g?t.jsx(L,{variant:"outline",size:"sm",onClick:l,children:a("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(L,{variant:"outline",size:"sm",onClick:r,children:a("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=l,e[8]=a,e[9]=g,e[10]=S):S=e[10];let y;e[11]!==i||e[12]!==p||e[13]!==a?(y=i&&t.jsxs(L,{variant:"outline",size:"sm",onClick:p,children:[t.jsx(Le,{size:13}),a("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=p,e[13]=a,e[14]=y):y=e[14];let v;e[15]!==o||e[16]!==d||e[17]!==m||e[18]!==a?(v=o&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",onClick:()=>m("active"),children:a("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",onClick:()=>m("inactive"),children:a("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",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]=v):v=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ee,{size:13}),e[20]=C):C=e[20];let c;e[21]!==u?(c=t.jsx(L,{variant:"ghost",size:"sm",onClick:u,children:C}),e[21]=u,e[22]=c):c=e[22];let h;return e[23]!==f||e[24]!==S||e[25]!==y||e[26]!==v||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 glass px-3 py-2 flex items-center gap-2",children:[f,S,y,v,c]})}),e[23]=f,e[24]=S,e[25]=y,e[26]=v,e[27]=c,e[28]=h):h=e[28],h}function Cn(s){const e=W.c(47),{open:n,onOpenChange:g,agents:o,onConfirm:i}=s,l=ne(),[r,d]=z.useState(null);let p;e[0]!==g?(p=k=>{k||d(null),g(k)},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(Ne,{children:u}),e[4]=u,e[5]=a):a=e[5];let j;e[6]!==l?(j=l("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=l,e[7]=j):j=e[7];let f;e[8]!==j?(f=t.jsx(Te,{children:j}),e[8]=j,e[9]=f):f=e[9];let S;e[10]!==a||e[11]!==f?(S=t.jsxs(Ae,{children:[a,f]}),e[10]=a,e[11]=f,e[12]=S):S=e[12];let y;e[13]!==o||e[14]!==r||e[15]!==l?(y=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):o.map(k=>t.jsxs("button",{type:"button",onClick:()=>d(k.id),className:he("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",r===k.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-accent"),children:[t.jsx(tn,{icon:k.icon,name:k.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:k.title}),k.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.description})]})]},k.id)),e[13]=o,e[14]=r,e[15]=l,e[16]=y):y=e[16];let v;e[17]!==y?(v=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[17]=y,e[18]=v):v=e[18];let C;e[19]!==m?(C=()=>m(!1),e[19]=m,e[20]=C):C=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]!==C?(h=t.jsx(L,{variant:"outline",onClick:C,children:c}),e[23]=c,e[24]=C,e[25]=h):h=e[25];const w=!r;let N;e[26]!==m||e[27]!==i||e[28]!==r?(N=()=>{r&&(i(r),m(!1))},e[26]=m,e[27]=i,e[28]=r,e[29]=N):N=e[29];let T;e[30]!==l?(T=l("orgs.connectionSelectionUi.add"),e[30]=l,e[31]=T):T=e[31];let M;e[32]!==w||e[33]!==N||e[34]!==T?(M=t.jsx(L,{disabled:w,onClick:N,children:T}),e[32]=w,e[33]=N,e[34]=T,e[35]=M):M=e[35];let I;e[36]!==h||e[37]!==M?(I=t.jsxs(we,{children:[h,M]}),e[36]=h,e[37]=M,e[38]=I):I=e[38];let F;e[39]!==I||e[40]!==S||e[41]!==v?(F=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[S,v,I]}),e[39]=I,e[40]=S,e[41]=v,e[42]=F):F=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==F?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:F}),e[43]=m,e[44]=n,e[45]=F,e[46]=P):P=e[46],P}function vn({listState:s,activeTab:e,typeFilter:n,statusFilter:g}){const o=ne(),{org:i}=Me(),l=dt(),r=$e(),{data:d}=Fe.useSession(),p=ze(),m=zt(s),u=vt(),{granted:a}=ye("connections:manage"),{granted:j}=ye("agents:manage"),[f,S]=z.useState(new Set),y=f.size>0,[v,C]=z.useState(!1),[c,h]=z.useState(!1),[w,N]=z.useState(null),T=Et(),M=gn(Gt(T)),I=m.filter(b=>!(n!=="ALL"&&b.connection_type!==n||g!=="ALL"&&b.status!==g)),F=yt(I),P=b=>{S(_=>{const E=new Set(_);return E.has(b)?E.delete(b):E.add(b),E})},k=()=>{S(new Set)},$=Ue(s.searchTerm),U=$.items,X=_t($.loadMore,$.hasMore,$.isLoadingMore),x=new Set(m.filter(b=>b.app_name).map(b=>b.app_name)),A=s.search.length>0,B=e==="all"||A?U.filter(b=>{if(A){const _=Oe(b);if(_&&x.has(_))return!1}return!0}):[],ee=e==="connected"||A?F:[],G=async b=>{if(!(!i||!d?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:b.id,source:"connections_page"}),N(b.id);try{const _=ht(b,i.id,d.user.id,{remoteIndex:0}),E=_.connection_type==="STDIO",K=!!_.connection_url,H=E&&_.connection_headers&&typeof _.connection_headers=="object"&&"command"in _.connection_headers;if(!K&&!H){R.error(o("orgs.connections.cannotConnectNoMethod")),N(null);return}const ve=await p.create.mutateAsync(_),{id:oe}=ve,ce=await en({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){te("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){te("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:mt.isMCPAuthenticated(le.href,null)}),V(),R.success(o("orgs.connections.authenticationSuccessful"))}let me=null;try{const le=await l.fetchQuery(Lt({connectionId:oe,orgId:i.id,orgSlug:i.slug}));me=dn((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(_){R.error(o("orgs.connections.failedToConnect",{error:_ instanceof Error?_.message:String(_)}))}finally{N(null)}}},D=ut(),V=()=>{pt(l,i.id)},O=async()=>{C(!1);const b=[...f];te("connections_bulk_delete",{count:b.length});const E=(await Promise.allSettled(b.map(K=>D.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;V(),R.success(o("orgs.connections.deletedConnections",{count:E})),k()},ue=async(b,_)=>{try{await p.update.mutateAsync({id:b,data:{status:_}}),V(),R.success(o(_==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(o("orgs.connections.failedToUpdateConnection"))}},je=async b=>{const _=[...f];te("connections_bulk_status_toggled",{count:_.length,to_status:b});const K=(await Promise.allSettled(_.map(H=>p.update.mutateAsync({id:H,data:{status:b}})))).filter(H=>H.status==="fulfilled").length;V(),R.success(b==="active"?o("orgs.connections.enabledConnections",{count:K}):o("orgs.connections.disabledConnections",{count:K})),k()},ge=async b=>{const _=T.find(H=>H.id===b);if(!_)return;te("connections_bulk_add_to_agent",{agent_id:b,count:f.size});const E=new Set(_.connections.map(H=>H.connection_id)),K=[...f].filter(H=>!E.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 D.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:b,data:{connections:[..._.connections,...K]}}),gt(l,i.id),R.success(o("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:_.title})),k()}catch{R.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(bt,{...u}),t.jsx(rn,{open:v,onOpenChange:C,count:f.size,onConfirm:O}),t.jsx(Cn,{open:c,onOpenChange:h,agents:T,onConfirm:ge}),$.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:(A?B.length===0&&I.length===0:e==="all"?B.length===0:I.length===0)?t.jsx(Ct,{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:[ee.map(b=>{if(b.type==="group")return t.jsx(xn,{group:b,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:b.key}})},selectionMode:y,selectedIds:f,onToggleSelect:P},b.key);const _=b.connection,E=f.has(_.id);return t.jsx(Ce,{connection:_,fallbackIcon:t.jsx(xe,{}),onClick:()=>y?P(_.id):r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(_)}}),className:he(E&&"ring-2 ring-primary bg-primary/5"),selected:y?E:void 0,footer:t.jsx(mn,{projects:M.get(_.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(jn,{connection:_,isSelected:E,selectionMode:y,canManage:a,canManageAgents:j,onToggleSelect:()=>P(_.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(_)}}),onToggleStatus:K=>ue(_.id,K),onDelete:()=>u.requestDelete(_)})},_.id)}),B.map(b=>t.jsx(an,{item:b,canManage:a,allConnections:m,connectedAppNames:x,connectingItemId:w,onNavigateConnected:_=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(_)}}),onConnect:G},b.id)),(e==="all"||A)&&t.jsx("div",{ref:X,className:"col-span-full h-4"}),(e==="all"||A)&&$.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(de,{className:"size-6 text-muted-foreground"})})]})}),y&&t.jsx(yn,{count:f.size,total:I.length,canManage:a,canManageAgents:j,onSelectAll:()=>{S(new Set(I.map(b=>b.id)))},onDeselectAll:()=>S(new Set),onDelete:()=>C(!0),onAddToAgent:()=>h(!0),onToggleStatus:je,onCancel:k})]})}function bn(){const s=ne(),{org:e}=Me(),n=$e(),g=ot({strict:!1}),{data:o}=Fe.useSession(),{stdioEnabled:i}=it(),l=Ve(),{granted:r}=ye("connections:manage"),d=ln({namespace:e.slug,resource:"connections"}),p=ze(),[m,u]=ct(lt.connectionsTab(e.slug),x=>g.tab==="all"||g.tab==="connected"?g.tab:x??"all"),[a,j]=z.useState("ALL"),[f,S]=z.useState("ALL"),v=Ue(d.searchTerm).items,C=d.search!==d.searchTerm,c=rt({resolver:at(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"),w=c.watch("connection_url"),N=c.watch("npx_package"),T=fe({uiType:h,connectionUrl:w??"",npxPackage:N??""})??ke({uiType:h,connectionUrl:w??"",registryItems:v}),M=r&&g.action==="create",I=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),n({to:".",search:x=>({...x,action:"create"})})},F=()=>{n({to:".",search:x=>({...x,action:void 0})})},P=async x=>{let A,B=null,ee=null,G=null;x.ui_type==="NPX"?(A="STDIO",B="",G=Yt(x.npx_package||"",x.env_vars||[])):x.ui_type==="STDIO"?(A="STDIO",B="",G=Zt(x.stdio_command||"",x.stdio_args||"",x.stdio_cwd,x.env_vars||[])):(A=x.ui_type,B=x.connection_url||"",ee=x.connection_token||null);const D=ft("conn");te("connection_custom_created",{connection_type:A,ui_type:x.ui_type}),await p.create.mutateAsync({id:D,title:x.title,description:x.description||null,connection_type:A,connection_url:B,connection_token:ee,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:e.id,icon:x.icon??null,app_name:null,app_id:null,connection_headers:G,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),F(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ae({app_name:null,connection_url:B,title:x.title,id:D})}})},k=x=>{x||(M&&F(),c.reset())},$=x=>{const A=x.trim();if(!A)return;const B=!!c.formState.dirtyFields.title,ee=!!c.formState.dirtyFields.description,G=!!c.formState.dirtyFields.env_vars,D=O=>{if(O&&(!B&&!c.getValues("title").trim()&&O.title&&c.setValue("title",O.title,{shouldDirty:!1}),!ee&&!(c.getValues("description")??"").trim()&&O.description&&c.setValue("description",O.description,{shouldDirty:!1}),!G&&O.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(b=>b.key)),ge=O.envVarKeys.filter(b=>!je.has(b));ge.length>0&&c.setValue("env_vars",[...ue,...ge.map(b=>({key:b,value:""}))],{shouldDirty:!0})}},V=Jt(A);if(V&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",V.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),D(fe({uiType:"NPX",npxPackage:V.packageName}));return}if(A.startsWith("http://")||A.startsWith("https://")){const O=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",O,{shouldDirty:!0}),c.setValue("connection_url",A,{shouldDirty:!0}),D(fe({uiType:O,connectionUrl:A})??ke({uiType:O,connectionUrl:A,registryItems:v}));return}h==="NPX"&&D(fe({uiType:"NPX",npxPackage:A}))},U=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{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,X=t.jsx(xt,{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:x=>j(x||"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:x=>S(x||"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")}]}]});return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const x=s("orgs.connections.createConnection"),A=s("orgs.connections.createConnectionDescription"),B=c.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),ee=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:c.control,name:"ui_type",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.type")}),t.jsxs($t,{value:D.value,onValueChange:D.onChange,children:[t.jsx(Y,{children:t.jsx(Ft,{children:t.jsx(Ot,{})})}),t.jsxs(Ut,{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(Xt,{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:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.npmPackage")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...D,value:D.value??"",onPaste:V=>{const O=V.clipboardData.getData("text");O&&(V.preventDefault(),c.setValue("npx_package",O.trim(),{shouldDirty:!0}),$(O))},onBlur:V=>{$(V.target.value),D.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:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.command")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.commandPlaceholder"),...D,value:D.value??""})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"stdio_args",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.arguments")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.argumentsPlaceholder"),...D,value:D.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:c.control,name:"stdio_cwd",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.workingDirectory")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...D,value:D.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:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.environmentVariables")}),t.jsx(Y,{children:t.jsx(Qt,{value:D.value??[],onChange:D.onChange})}),t.jsx(Z,{})]})}),h!=="NPX"&&h!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:c.control,name:"connection_url",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.url")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.urlPlaceholder"),...D,value:D.value??"",onPaste:V=>{const O=V.clipboardData.getData("text");O&&(V.preventDefault(),c.setValue("connection_url",O.trim(),{shouldDirty:!0}),$(O))},onBlur:V=>{$(V.target.value),D.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"connection_token",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:T?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(Y,{children:t.jsx(se,{type:"password",placeholder:T?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...D,value:D.value??""})}),T?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.token.helperText,T.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:s("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:c.control,name:"title",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.name")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.namePlaceholder"),...D})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"description",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.description")}),t.jsx(Y,{children:t.jsx(Vt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...D,value:D.value??""})}),t.jsx(Z,{})]})})]}),G=M;return l?t.jsx(Nt,{open:G,onOpenChange:k,children:t.jsxs(Tt,{className:"max-h-[90vh]",children:[t.jsx(At,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(wt,{children:x}),t.jsx(It,{className:"mt-1",children:A})]}),t.jsx(Pt,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(De,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:ee}),t.jsx(Mt,{children:t.jsx(L,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:B})})]})})]})}):t.jsx(Pe,{open:G,onOpenChange:k,children:t.jsxs(Ie,{className:"sm:max-w-[525px]",children:[t.jsxs(Ae,{children:[t.jsx(Ne,{children:x}),t.jsx(Te,{children:A})]}),t.jsx(De,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:ee}),t.jsxs(we,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>k(!1),children:s("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:B})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Actions,{secondary:t.jsxs(t.Fragment,{children:[t.jsx(jt,{value:d.search,onChange:d.setSearch,label:s("library.context.search"),placeholder:s("orgs.connections.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),X]}),children:U}),t.jsx(St,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:m,onTabChange:x=>{const A=x;A!==m&&te("connections_page_tab_changed",{to_tab:A}),u(A)}}),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:C?.5:1,transition:C?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:C?"none":"auto"},children:t.jsx(vn,{listState:d,activeTab:m,typeFilter:a,statusFilter:f})})})]})})})]})})}function Hs(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(st,{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(bn,{})})}),s[0]=e):e=s[0],e}export{Hs as default};
|
|
1
|
+
import{r as z,c as W,b as ne,j as t,aH as We,aI as Xe,aJ as Ge,aK as qe,b5 as Qe,aL as Je,aM as Ye,aN as Ze,B as L,h as de,m as he,Y as ie,x as Ne,aT as Te,w as Ae,y as we,v as Ie,D as Pe,X as et,_ as tt,Z as nt,R as st,a4 as Me,d as $e,u as ot,a as Fe,a3 as it,aq as ye,ar as ct,at as lt,aE as rt,aD as at,n as pe,I as se,E as te,q as dt,ak as ut,t as R,cF as gt,K as mt,gl as pt}from"./index-CWyPzcrL.js";import{a as Oe,g as ft,e as ht}from"./extract-connection-data-Dcbv_gVC.js";import{C as xt}from"./collection-display-button-1DK_MMnx.js";import{S as jt}from"./search-toggle-tlJ3SbIE.js";import{C as St}from"./collection-tabs-6iiAOwW9.js";import{C as Ce,u as Ue,g as yt}from"./connection-card-qoqR63NP.js";import{E as Ct}from"./empty-state-BBFh_11d.js";import{u as vt,D as bt}from"./use-delete-connection-CpvyLSMF.js";import{u as _t}from"./use-infinite-scroll-DToG_mXG.js";import{u as Ve}from"./use-mobile-BZxtzMj7.js";import{g as ae}from"./connection-slug-CP70si3t.js";import{n as xe}from"./LinkBroken01-IVC8feVZ.js";import{g as Dt,a as kt}from"./metadata-D72DunRR.js";import{D as Nt,a as Tt,e as At,b as wt,c as It,f as Pt,g as Mt}from"./drawer-CSA_YXe9.js";import{F as q,b as Q,c as J,d as Y,f as Z,a as De}from"./form-fep7EsZM.js";import{S as $t,b as Ft,a as Ot,d as Ut,c as re}from"./select-e2tvI61e.js";import{T as Vt}from"./textarea-D8L9nIm0.js";import{a as ze,b as zt}from"./use-connection-CoSLklxV.js";import{m as Lt}from"./use-mcp-client-BJYqkCGO.js";import{a as Et}from"./repository-binding-SYfLLQPp.js";import{g as Bt}from"./types-DrwTBhGr.js";import{A as Kt,c0 as Ht,am as Rt,bw as Wt,an as Se}from"./agent-icon-DvD5kv_K.js";import{s as Le}from"./Plus-CRqz0c82.js";import{c as Xt}from"./UserSquare-Dv0YcmkC.js";import{s as Ee}from"./XClose-CyHahh4m.js";import{s as Gt}from"./use-project-scope-Fr7Egb1F.js";import{c as qt}from"./schema-821-vfww.js";import{i as fe,a as ke,E as Qt,p as Jt,b as Yt,c as Zt}from"./connection-form-helpers-B9JY5oaH.js";import{a as en}from"./authenticate-and-persist-oauth-Di92Hz1m.js";import{I as tn}from"./integration-icon-C_WzTScv.js";import{C as Be}from"./checkbox-H8QR9D0_.js";import{a as nn}from"./SwitchHorizontal01-D3zx9VNf.js";import{s as Ke}from"./Tool01-D9-ePNaJ.js";import{s as He}from"./Trash01-BTZDkUzq.js";import"./connection-CJZ6RQ2g.js";import"./url-slug-xvxPIesW.js";import"./ArrowUp-D5JWz7Yq.js";import"./tooltip-C-0kDxkl.js";import"./index-ixp03eW8.js";import"./toggle-group-C9F5Qvi7.js";import"./active-indicator-CCMhAsc_.js";import"./badge-DzB3sqoD.js";import"./SearchMd-CcAFkP0F.js";import"./icon-button-y7e4XAeL.js";import"./useInfiniteQuery--BgI5-DV.js";import"./infiniteQueryObserver-OShuiwgE.js";import"./thread-intent-BoKpDkXm.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-CR6i9l-S.js";import"./task-board-CNxFcEEU.js";import"./schema-CLtIHsoR.js";import"./label-Cf_dlQhi.js";import"./index-BdQq_4o_.js";import"./ChevronUp-BaKxA_AU.js";import"./auth-ygmhxR7o.js";import"./AlertCircle-DuMz-jFi.js";import"./ArrowLeft-5NT3k46C.js";import"./BookOpen01-m1uNXDEc.js";import"./Globe04-KZ-J2ZUi.js";import"./CheckCircle-DAPdRkcW.js";import"./ChevronSelectorVertical-5fTMRN5v.js";import"./CreditCard01-BU3Icpfr.js";import"./Key01-RIzbDsEi.js";import"./Minus-Dw050KAn.js";import"./Monitor01-D7QUQToM.js";import"./Sun-DRT9bMW5.js";import"./Play-BDSDyO5E.js";import"./ShoppingBag01-CspfAlNO.js";import"./Upload01-BRP1bAMs.js";import"./Users01-DKwguy8Z.js";import"./Zap-Dja9fdMf.js";import"./mcp-oauth-CciCTLp9.js";import"./mcp-oauth-DOQO_m1D.js";function sn(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 on(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 cn(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 S=globalThis.localStorage?.getItem(l);return S==="cards"||S==="table"?S: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=S=>{p(S),globalThis.localStorage?.setItem(l,S)},n[3]=l,n[4]=m):m=n[4];const u=m;let a,j;n[5]!==o||n[6]!==d?(a=()=>{!i.current&&o&&d==="table"&&p("cards"),i.current=o},j=[o,d],n[5]=o,n[6]=d,n[7]=a,n[8]=j):(a=n[7],j=n[8]),z.useEffect(a,j);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 ln(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,j]=sn(u),f=`studio-${g}-filter-visible-${n}`;let S;e[0]!==f?(S=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=S):S=e[1];const[y,v]=z.useState(S);let C;e[2]!==f?(C=$=>{v($),globalThis.localStorage?.setItem(f,String($))},e[2]=f,e[3]=C):C=e[3];const c=C;let h;e[4]!==y||e[5]!==c?(h=()=>{c(!y)},e[4]=y,e[5]=c,e[6]=h):h=e[6];const w=h,[N,T]=cn(`studio-${g}-${n}`,r),{sortKey:M,sortDirection:I,handleSort:F}=on(l),P=M;let k;return e[7]!==y||e[8]!==a||e[9]!==F||e[10]!==d||e[11]!==m||e[12]!==c||e[13]!==j||e[14]!==T||e[15]!==I||e[16]!==P||e[17]!==w||e[18]!==N?(k={search:d,searchTerm:m,setSearch:p,filters:a,setFilters:j,filterBarVisible:y,setFilterBarVisible:c,toggleFilterBar:w,viewMode:N,setViewMode:T,sortKey:P,sortDirection:I,handleSort:F},e[7]=y,e[8]=a,e[9]=F,e[10]=d,e[11]=m,e[12]=c,e[13]=j,e[14]=T,e[15]=I,e[16]=P,e[17]=w,e[18]=N,e[19]=k):k=e[19],k}function rn(s){const e=W.c(35),{open:n,onOpenChange:g,count:o,onConfirm:i}=s,l=ne(),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(We,{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(Xe,{children:u}),e[9]=u,e[10]=a):a=e[10];let j;e[11]!==p||e[12]!==a?(j=t.jsxs(Ge,{children:[p,a]}),e[11]=p,e[12]=a,e[13]=j):j=e[13];let f;e[14]!==l?(f=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=f):f=e[15];let S;e[16]!==f?(S=t.jsx(qe,{children:f}),e[16]=f,e[17]=S):S=e[17];const y=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let v;e[18]!==o||e[19]!==l||e[20]!==y?(v=l(y,{count:o}),e[18]=o,e[19]=l,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==i||e[23]!==v?(C=t.jsx(Qe,{onClick:i,variant:"destructive",children:v}),e[22]=i,e[23]=v,e[24]=C):C=e[24];let c;e[25]!==C||e[26]!==S?(c=t.jsxs(Je,{children:[S,C]}),e[25]=C,e[26]=S,e[27]=c):c=e[27];let h;e[28]!==c||e[29]!==j?(h=t.jsxs(Ye,{children:[j,c]}),e[28]=c,e[29]=j,e[30]=h):h=e[30];let w;return e[31]!==g||e[32]!==n||e[33]!==h?(w=t.jsx(Ze,{open:n,onOpenChange:g,children:h}),e[31]=g,e[32]=n,e[33]=h,e[34]=w):w=e[34],w}function an(s){const e=W.c(39),{item:n,canManage:g,allConnections:o,connectedAppNames:i,connectingItemId:l,onNavigateConnected:r,onConnect:d}=s,p=ne();let m,u;e[0]!==i||e[1]!==n?(m=Oe(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 j;e[4]!==n._meta?(j=Dt(n._meta),e[4]=n._meta,e[5]=j):j=e[5];const f=j,S=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",y=n.server?.description||n.description||null;let v;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(v=n.server?.icons?.[0]?.src||kt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=v):v=e[8];const C=v;let c;if(e[9]!==o||e[10]!==m){let U;e[12]!==m?(U=X=>X.connection_type!=="VIRTUAL"&&X.app_name===m,e[12]=m,e[13]=U):U=e[13],c=o.filter(U),e[9]=o,e[10]=m,e[11]=c}else c=e[11];const h=c,w=a||g;let N,T;e[14]!==h||e[15]!==a||e[16]!==n||e[17]!==d||e[18]!==r?(N=()=>{if(a){const U=h[0];U&&r(U);return}T()},T=()=>d(n),e[14]=h,e[15]=a,e[16]=n,e[17]=d,e[18]=r,e[19]=N,e[20]=T):(N=e[19],T=e[20]);let M;e[21]!==y||e[22]!==C||e[23]!==S?(M={title:S,description:y,icon:C},e[21]=y,e[22]=C,e[23]=S,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 F=w?N:void 0;let P;e[26]!==g||e[27]!==l||e[28]!==T||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(L,{variant:"outline",size:"sm",disabled:l!==null,onClick:U=>{U.stopPropagation(),T()},children:l===n.id?t.jsx(de,{className:"size-3.5"}):p("orgs.catalogItemCard.connect")}),e[26]=g,e[27]=l,e[28]=T,e[29]=a,e[30]=n.id,e[31]=p,e[32]=P):P=e[32];let k;e[33]!==P?(k=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=k):k=e[34];let $;return e[35]!==M||e[36]!==F||e[37]!==k?($=t.jsx(Ce,{connection:M,fallbackIcon:I,onClick:F,headerActionsAlwaysVisible:!0,headerActions:k}),e[35]=M,e[36]=F,e[37]=k,e[38]=$):$=e[38],$}function dn(s){return s?.length?{appToolName:s.find(n=>!!Bt(n._meta))?.name??null}:null}const un=3;function gn(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 mn(s){const e=W.c(21),{projects:n}=s,g=ne();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,un);l="flex min-w-0 items-center gap-2",o="flex shrink-0 -space-x-1.5",i=u.map(pn),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 pn(s){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:s.title,children:t.jsx(Kt,{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(et,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",onClick:hn,children:t.jsx(nn,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==g?(r=t.jsxs(tt,{children:[l,t.jsx(nt,{align:"end",onClick:fn,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 fn(s){return s.stopPropagation()}function hn(s){return s.stopPropagation()}function xn(s){const e=W.c(57),{group:n,onOpen:g,selectionMode:o,selectedIds:i,onToggleSelect:l}=s,r=ne();let d;if(e[0]!==n.connections||e[1]!==i){let x;e[3]!==i?(x=A=>i.has(A.id),e[3]=i,e[4]=x):x=e[4],d=n.connections.every(x),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 x;e[8]!==i?(x=A=>i.has(A.id),e[8]=i,e[9]=x):x=e[9],m=n.connections.some(x),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 x of n.connections)p?i.has(x.id)&&l(x.id):i.has(x.id)||l(x.id)},e[10]=p,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=a):a=e[14];const j=a,f=n.title,S=n.icon;let y;e[15]!==n.connections.length||e[16]!==r?(y=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=y):y=e[17];let v;e[18]!==n.icon||e[19]!==n.title||e[20]!==y?(v={title:f,icon:S,description:y},e[18]=n.icon,e[19]=n.title,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==g||e[23]!==o||e[24]!==j?(C=()=>o?j():g(),e[22]=g,e[23]=o,e[24]=j,e[25]=C):C=e[25];const c=o&&p&&"ring-2 ring-primary",h=o&&u&&!p&&"ring-1 ring-primary/50";let w;e[26]!==h||e[27]!==c?(w=he(c,h),e[26]=h,e[27]=c,e[28]=w):w=e[28];const N=o?p?!0:u&&"mixed":void 0;let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(xe,{}),e[29]=T):T=e[29];let M;e[30]!==p||e[31]!==n.connections.length||e[32]!==o||e[33]!==u||e[34]!==r||e[35]!==j?(M=o?t.jsx(Be,{checked:p?!0:u?"indeterminate":!1,onCheckedChange:j}):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]=j,e[36]=M):M=e[36];let I;e[37]!==g?(I=x=>{x.stopPropagation(),g()},e[37]=g,e[38]=I):I=e[38];let F;e[39]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(Ke,{size:16}),e[39]=F):F=e[39];let P;e[40]!==r?(P=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=P):P=e[41];let k;e[42]!==I||e[43]!==P?(k=t.jsxs(ie,{onClick:I,children:[F,P]}),e[42]=I,e[43]=P,e[44]=k):k=e[44];let $;e[45]!==o||e[46]!==k?($=t.jsx(Re,{selectionMode:o,children:k}),e[45]=o,e[46]=k,e[47]=$):$=e[47];let U;e[48]!==M||e[49]!==$?(U=t.jsxs("div",{className:"flex items-center gap-1",children:[M,$]}),e[48]=M,e[49]=$,e[50]=U):U=e[50];let X;return e[51]!==w||e[52]!==N||e[53]!==U||e[54]!==v||e[55]!==C?(X=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:v,onClick:C,className:w,selected:N,fallbackIcon:T,headerActionsAlwaysVisible:!0,headerActions:U})}),e[51]=w,e[52]=N,e[53]=U,e[54]=v,e[55]=C,e[56]=X):X=e[56],X}function jn(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=ne();let a;e[0]!==g||e[1]!==r||e[2]!==o||e[3]!==u?(a=o?t.jsx(Be,{checked:g,onCheckedChange:r,onClick:Sn}):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 j;e[5]!==d?(j=N=>{N.stopPropagation(),d()},e[5]=d,e[6]=j):j=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 S;e[8]!==u?(S=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=S):S=e[9];let y;e[10]!==j||e[11]!==S?(y=t.jsxs(ie,{onClick:j,children:[f,S]}),e[10]=j,e[11]=S,e[12]=y):y=e[12];let v;e[13]!==i||e[14]!==l||e[15]!==r||e[16]!==u?(v=(i||l)&&t.jsxs(ie,{onClick:N=>{N.stopPropagation(),r()},children:[t.jsx(Ht,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=r,e[16]=u,e[17]=v):v=e[17];let C;e[18]!==i||e[19]!==n||e[20]!==p||e[21]!==u?(C=i&&(n.status==="active"?t.jsxs(ie,{onClick:N=>{N.stopPropagation(),p("inactive")},children:[t.jsx(Rt,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ie,{onClick:N=>{N.stopPropagation(),p("active")},children:[t.jsx(Wt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=p,e[21]=u,e[22]=C):C=e[22];let c;e[23]!==i||e[24]!==m||e[25]!==u?(c=i&&t.jsxs(ie,{variant:"destructive",onClick:N=>{N.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]!==y||e[29]!==v||e[30]!==C||e[31]!==c?(h=t.jsxs(Re,{selectionMode:o,children:[y,v,C,c]}),e[27]=o,e[28]=y,e[29]=v,e[30]=C,e[31]=c,e[32]=h):h=e[32];let w;return e[33]!==a||e[34]!==h?(w=t.jsxs("div",{className:"flex items-center gap-1",children:[a,h]}),e[33]=a,e[34]=h,e[35]=w):w=e[35],w}function Sn(s){return s.stopPropagation()}function yn(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=ne();if(n===0)return null;let j;e[0]!==n||e[1]!==a?(j=a("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=a,e[2]=j):j=e[2];let f;e[3]!==j?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:j}),e[3]=j,e[4]=f):f=e[4];let S;e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==g?(S=n<g?t.jsx(L,{variant:"outline",size:"sm",onClick:l,children:a("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(L,{variant:"outline",size:"sm",onClick:r,children:a("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=l,e[8]=a,e[9]=g,e[10]=S):S=e[10];let y;e[11]!==i||e[12]!==p||e[13]!==a?(y=i&&t.jsxs(L,{variant:"outline",size:"sm",onClick:p,children:[t.jsx(Le,{size:13}),a("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=p,e[13]=a,e[14]=y):y=e[14];let v;e[15]!==o||e[16]!==d||e[17]!==m||e[18]!==a?(v=o&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",onClick:()=>m("active"),children:a("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",onClick:()=>m("inactive"),children:a("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",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]=v):v=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ee,{size:13}),e[20]=C):C=e[20];let c;e[21]!==u?(c=t.jsx(L,{variant:"ghost",size:"sm",onClick:u,children:C}),e[21]=u,e[22]=c):c=e[22];let h;return e[23]!==f||e[24]!==S||e[25]!==y||e[26]!==v||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 glass px-3 py-2 flex items-center gap-2",children:[f,S,y,v,c]})}),e[23]=f,e[24]=S,e[25]=y,e[26]=v,e[27]=c,e[28]=h):h=e[28],h}function Cn(s){const e=W.c(47),{open:n,onOpenChange:g,agents:o,onConfirm:i}=s,l=ne(),[r,d]=z.useState(null);let p;e[0]!==g?(p=k=>{k||d(null),g(k)},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(Ne,{children:u}),e[4]=u,e[5]=a):a=e[5];let j;e[6]!==l?(j=l("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=l,e[7]=j):j=e[7];let f;e[8]!==j?(f=t.jsx(Te,{children:j}),e[8]=j,e[9]=f):f=e[9];let S;e[10]!==a||e[11]!==f?(S=t.jsxs(Ae,{children:[a,f]}),e[10]=a,e[11]=f,e[12]=S):S=e[12];let y;e[13]!==o||e[14]!==r||e[15]!==l?(y=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):o.map(k=>t.jsxs("button",{type:"button",onClick:()=>d(k.id),className:he("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",r===k.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-accent"),children:[t.jsx(tn,{icon:k.icon,name:k.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:k.title}),k.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.description})]})]},k.id)),e[13]=o,e[14]=r,e[15]=l,e[16]=y):y=e[16];let v;e[17]!==y?(v=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[17]=y,e[18]=v):v=e[18];let C;e[19]!==m?(C=()=>m(!1),e[19]=m,e[20]=C):C=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]!==C?(h=t.jsx(L,{variant:"outline",onClick:C,children:c}),e[23]=c,e[24]=C,e[25]=h):h=e[25];const w=!r;let N;e[26]!==m||e[27]!==i||e[28]!==r?(N=()=>{r&&(i(r),m(!1))},e[26]=m,e[27]=i,e[28]=r,e[29]=N):N=e[29];let T;e[30]!==l?(T=l("orgs.connectionSelectionUi.add"),e[30]=l,e[31]=T):T=e[31];let M;e[32]!==w||e[33]!==N||e[34]!==T?(M=t.jsx(L,{disabled:w,onClick:N,children:T}),e[32]=w,e[33]=N,e[34]=T,e[35]=M):M=e[35];let I;e[36]!==h||e[37]!==M?(I=t.jsxs(we,{children:[h,M]}),e[36]=h,e[37]=M,e[38]=I):I=e[38];let F;e[39]!==I||e[40]!==S||e[41]!==v?(F=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[S,v,I]}),e[39]=I,e[40]=S,e[41]=v,e[42]=F):F=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==F?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:F}),e[43]=m,e[44]=n,e[45]=F,e[46]=P):P=e[46],P}function vn({listState:s,activeTab:e,typeFilter:n,statusFilter:g}){const o=ne(),{org:i}=Me(),l=dt(),r=$e(),{data:d}=Fe.useSession(),p=ze(),m=zt(s),u=vt(),{granted:a}=ye("connections:manage"),{granted:j}=ye("agents:manage"),[f,S]=z.useState(new Set),y=f.size>0,[v,C]=z.useState(!1),[c,h]=z.useState(!1),[w,N]=z.useState(null),T=Et(),M=gn(Gt(T)),I=m.filter(b=>!(n!=="ALL"&&b.connection_type!==n||g!=="ALL"&&b.status!==g)),F=yt(I),P=b=>{S(_=>{const E=new Set(_);return E.has(b)?E.delete(b):E.add(b),E})},k=()=>{S(new Set)},$=Ue(s.searchTerm),U=$.items,X=_t($.loadMore,$.hasMore,$.isLoadingMore),x=new Set(m.filter(b=>b.app_name).map(b=>b.app_name)),A=s.search.length>0,B=e==="all"||A?U.filter(b=>{if(A){const _=Oe(b);if(_&&x.has(_))return!1}return!0}):[],ee=e==="connected"||A?F:[],G=async b=>{if(!(!i||!d?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:b.id,source:"connections_page"}),N(b.id);try{const _=ht(b,i.id,d.user.id,{remoteIndex:0}),E=_.connection_type==="STDIO",K=!!_.connection_url,H=E&&_.connection_headers&&typeof _.connection_headers=="object"&&"command"in _.connection_headers;if(!K&&!H){R.error(o("orgs.connections.cannotConnectNoMethod")),N(null);return}const ve=await p.create.mutateAsync(_),{id:oe}=ve,ce=await en({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){te("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){te("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:mt.isMCPAuthenticated(le.href,null)}),V(),R.success(o("orgs.connections.authenticationSuccessful"))}let me=null;try{const le=await l.fetchQuery(Lt({connectionId:oe,orgId:i.id,orgSlug:i.slug}));me=dn((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(_){R.error(o("orgs.connections.failedToConnect",{error:_ instanceof Error?_.message:String(_)}))}finally{N(null)}}},D=ut(),V=()=>{pt(l,i.id)},O=async()=>{C(!1);const b=[...f];te("connections_bulk_delete",{count:b.length});const E=(await Promise.allSettled(b.map(K=>D.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;V(),R.success(o("orgs.connections.deletedConnections",{count:E})),k()},ue=async(b,_)=>{try{await p.update.mutateAsync({id:b,data:{status:_}}),V(),R.success(o(_==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(o("orgs.connections.failedToUpdateConnection"))}},je=async b=>{const _=[...f];te("connections_bulk_status_toggled",{count:_.length,to_status:b});const K=(await Promise.allSettled(_.map(H=>p.update.mutateAsync({id:H,data:{status:b}})))).filter(H=>H.status==="fulfilled").length;V(),R.success(b==="active"?o("orgs.connections.enabledConnections",{count:K}):o("orgs.connections.disabledConnections",{count:K})),k()},ge=async b=>{const _=T.find(H=>H.id===b);if(!_)return;te("connections_bulk_add_to_agent",{agent_id:b,count:f.size});const E=new Set(_.connections.map(H=>H.connection_id)),K=[...f].filter(H=>!E.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 D.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:b,data:{connections:[..._.connections,...K]}}),gt(l,i.id),R.success(o("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:_.title})),k()}catch{R.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(bt,{...u}),t.jsx(rn,{open:v,onOpenChange:C,count:f.size,onConfirm:O}),t.jsx(Cn,{open:c,onOpenChange:h,agents:T,onConfirm:ge}),$.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:(A?B.length===0&&I.length===0:e==="all"?B.length===0:I.length===0)?t.jsx(Ct,{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:[ee.map(b=>{if(b.type==="group")return t.jsx(xn,{group:b,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:b.key}})},selectionMode:y,selectedIds:f,onToggleSelect:P},b.key);const _=b.connection,E=f.has(_.id);return t.jsx(Ce,{connection:_,fallbackIcon:t.jsx(xe,{}),onClick:()=>y?P(_.id):r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(_)}}),className:he(E&&"ring-2 ring-primary bg-primary/5"),selected:y?E:void 0,footer:t.jsx(mn,{projects:M.get(_.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(jn,{connection:_,isSelected:E,selectionMode:y,canManage:a,canManageAgents:j,onToggleSelect:()=>P(_.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(_)}}),onToggleStatus:K=>ue(_.id,K),onDelete:()=>u.requestDelete(_)})},_.id)}),B.map(b=>t.jsx(an,{item:b,canManage:a,allConnections:m,connectedAppNames:x,connectingItemId:w,onNavigateConnected:_=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(_)}}),onConnect:G},b.id)),(e==="all"||A)&&t.jsx("div",{ref:X,className:"col-span-full h-4"}),(e==="all"||A)&&$.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(de,{className:"size-6 text-muted-foreground"})})]})}),y&&t.jsx(yn,{count:f.size,total:I.length,canManage:a,canManageAgents:j,onSelectAll:()=>{S(new Set(I.map(b=>b.id)))},onDeselectAll:()=>S(new Set),onDelete:()=>C(!0),onAddToAgent:()=>h(!0),onToggleStatus:je,onCancel:k})]})}function bn(){const s=ne(),{org:e}=Me(),n=$e(),g=ot({strict:!1}),{data:o}=Fe.useSession(),{stdioEnabled:i}=it(),l=Ve(),{granted:r}=ye("connections:manage"),d=ln({namespace:e.slug,resource:"connections"}),p=ze(),[m,u]=ct(lt.connectionsTab(e.slug),x=>g.tab==="all"||g.tab==="connected"?g.tab:x??"all"),[a,j]=z.useState("ALL"),[f,S]=z.useState("ALL"),v=Ue(d.searchTerm).items,C=d.search!==d.searchTerm,c=rt({resolver:at(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"),w=c.watch("connection_url"),N=c.watch("npx_package"),T=fe({uiType:h,connectionUrl:w??"",npxPackage:N??""})??ke({uiType:h,connectionUrl:w??"",registryItems:v}),M=r&&g.action==="create",I=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),n({to:".",search:x=>({...x,action:"create"})})},F=()=>{n({to:".",search:x=>({...x,action:void 0})})},P=async x=>{let A,B=null,ee=null,G=null;x.ui_type==="NPX"?(A="STDIO",B="",G=Yt(x.npx_package||"",x.env_vars||[])):x.ui_type==="STDIO"?(A="STDIO",B="",G=Zt(x.stdio_command||"",x.stdio_args||"",x.stdio_cwd,x.env_vars||[])):(A=x.ui_type,B=x.connection_url||"",ee=x.connection_token||null);const D=ft("conn");te("connection_custom_created",{connection_type:A,ui_type:x.ui_type}),await p.create.mutateAsync({id:D,title:x.title,description:x.description||null,connection_type:A,connection_url:B,connection_token:ee,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:e.id,icon:x.icon??null,app_name:null,app_id:null,connection_headers:G,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),F(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ae({app_name:null,connection_url:B,title:x.title,id:D})}})},k=x=>{x||(M&&F(),c.reset())},$=x=>{const A=x.trim();if(!A)return;const B=!!c.formState.dirtyFields.title,ee=!!c.formState.dirtyFields.description,G=!!c.formState.dirtyFields.env_vars,D=O=>{if(O&&(!B&&!c.getValues("title").trim()&&O.title&&c.setValue("title",O.title,{shouldDirty:!1}),!ee&&!(c.getValues("description")??"").trim()&&O.description&&c.setValue("description",O.description,{shouldDirty:!1}),!G&&O.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(b=>b.key)),ge=O.envVarKeys.filter(b=>!je.has(b));ge.length>0&&c.setValue("env_vars",[...ue,...ge.map(b=>({key:b,value:""}))],{shouldDirty:!0})}},V=Jt(A);if(V&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",V.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),D(fe({uiType:"NPX",npxPackage:V.packageName}));return}if(A.startsWith("http://")||A.startsWith("https://")){const O=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",O,{shouldDirty:!0}),c.setValue("connection_url",A,{shouldDirty:!0}),D(fe({uiType:O,connectionUrl:A})??ke({uiType:O,connectionUrl:A,registryItems:v}));return}h==="NPX"&&D(fe({uiType:"NPX",npxPackage:A}))},U=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{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,X=t.jsx(xt,{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:x=>j(x||"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:x=>S(x||"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")}]}]});return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const x=s("orgs.connections.createConnection"),A=s("orgs.connections.createConnectionDescription"),B=c.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),ee=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:c.control,name:"ui_type",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.type")}),t.jsxs($t,{value:D.value,onValueChange:D.onChange,children:[t.jsx(Y,{children:t.jsx(Ft,{children:t.jsx(Ot,{})})}),t.jsxs(Ut,{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(Xt,{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:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.npmPackage")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...D,value:D.value??"",onPaste:V=>{const O=V.clipboardData.getData("text");O&&(V.preventDefault(),c.setValue("npx_package",O.trim(),{shouldDirty:!0}),$(O))},onBlur:V=>{$(V.target.value),D.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:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.command")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.commandPlaceholder"),...D,value:D.value??""})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"stdio_args",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.arguments")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.argumentsPlaceholder"),...D,value:D.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:c.control,name:"stdio_cwd",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.workingDirectory")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...D,value:D.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:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.environmentVariables")}),t.jsx(Y,{children:t.jsx(Qt,{value:D.value??[],onChange:D.onChange})}),t.jsx(Z,{})]})}),h!=="NPX"&&h!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:c.control,name:"connection_url",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.url")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.urlPlaceholder"),...D,value:D.value??"",onPaste:V=>{const O=V.clipboardData.getData("text");O&&(V.preventDefault(),c.setValue("connection_url",O.trim(),{shouldDirty:!0}),$(O))},onBlur:V=>{$(V.target.value),D.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"connection_token",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:T?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(Y,{children:t.jsx(se,{type:"password",placeholder:T?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...D,value:D.value??""})}),T?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.token.helperText,T.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:s("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:c.control,name:"title",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.name")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.namePlaceholder"),...D})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"description",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.description")}),t.jsx(Y,{children:t.jsx(Vt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...D,value:D.value??""})}),t.jsx(Z,{})]})})]}),G=M;return l?t.jsx(Nt,{open:G,onOpenChange:k,children:t.jsxs(Tt,{className:"max-h-[90vh]",children:[t.jsx(At,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(wt,{children:x}),t.jsx(It,{className:"mt-1",children:A})]}),t.jsx(Pt,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(De,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:ee}),t.jsx(Mt,{children:t.jsx(L,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:B})})]})})]})}):t.jsx(Pe,{open:G,onOpenChange:k,children:t.jsxs(Ie,{className:"sm:max-w-[525px]",children:[t.jsxs(Ae,{children:[t.jsx(Ne,{children:x}),t.jsx(Te,{children:A})]}),t.jsx(De,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:ee}),t.jsxs(we,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>k(!1),children:s("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:B})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Actions,{secondary:t.jsxs(t.Fragment,{children:[t.jsx(jt,{value:d.search,onChange:d.setSearch,label:s("library.context.search"),placeholder:s("orgs.connections.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),X]}),children:U}),t.jsx(St,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:m,onTabChange:x=>{const A=x;A!==m&&te("connections_page_tab_changed",{to_tab:A}),u(A)}}),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:C?.5:1,transition:C?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:C?"none":"auto"},children:t.jsx(vn,{listState:d,activeTab:m,typeFilter:a,statusFilter:f})})})]})})})]})})}function Hs(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(st,{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(bn,{})})}),s[0]=e):e=s[0],e}export{Hs as default};
|