decocms 4.562.0 → 4.562.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-BMgOinVw.js → AlertCircle-Cwj2JDLb.js} +1 -1
- package/dist/client/assets/{AreaChart-BcZi16Vr.js → AreaChart-M71cxP0N.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BJMjlG4g.js → ArrowLeft-D6im8CSl.js} +1 -1
- package/dist/client/assets/{ArrowUp-DcJMRdNb.js → ArrowUp-zoWFBt83.js} +1 -1
- package/dist/client/assets/{CartesianChart-C8LrSJIS.js → CartesianChart-CkRq1ukN.js} +1 -1
- package/dist/client/assets/{CategoricalChart-CUR_9ZiJ.js → CategoricalChart-CJyVrm-b.js} +1 -1
- package/dist/client/assets/{CheckCircle-By2z0uOx.js → CheckCircle-Dycaqr3_.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BTg7xsL3.js → ChevronSelectorVertical-Cq__IjWt.js} +1 -1
- package/dist/client/assets/{ChevronUp-BCfBdjs4.js → ChevronUp-B0uKxpVg.js} +1 -1
- package/dist/client/assets/{CreditCard01-kxqKIkVq.js → CreditCard01-CMHPxKus.js} +1 -1
- package/dist/client/assets/{Globe04-ri2PR4JW.js → Globe04-BLpPYUUd.js} +1 -1
- package/dist/client/assets/{Key01-By4BziN_.js → Key01-KS2Cdqso.js} +1 -1
- package/dist/client/assets/{LinkBroken01-znJYLaVP.js → LinkBroken01-CFo-1erV.js} +1 -1
- package/dist/client/assets/{Minus-Biy1YWEX.js → Minus-CR14C6Ew.js} +1 -1
- package/dist/client/assets/{Monitor01-DcAryzmn.js → Monitor01-PjSuNm4O.js} +1 -1
- package/dist/client/assets/{Play-BkYxzt1r.js → Play-DAD0wkps.js} +1 -1
- package/dist/client/assets/{Plus-BhRQRaas.js → Plus-Caq968Zm.js} +1 -1
- package/dist/client/assets/{ReferenceLine-DfxOOnGv.js → ReferenceLine-DEAQfOjW.js} +1 -1
- package/dist/client/assets/{SearchMd-DqnvtcaB.js → SearchMd-BionSqTl.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DYcJDT4V.js → ShoppingBag01-DUpALglE.js} +1 -1
- package/dist/client/assets/{Sun-tnCpymBL.js → Sun-x19ShBxe.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-D2vRhNhF.js → SwitchHorizontal01-Dghq_Bvd.js} +1 -1
- package/dist/client/assets/{Tool01-B8q2F7hW.js → Tool01-GdBdG6P_.js} +1 -1
- package/dist/client/assets/{Tooltip-B6aZIxiB.js → Tooltip-CDDThlKy.js} +1 -1
- package/dist/client/assets/{Trash01-Ccl1EX2p.js → Trash01-DhMVlpac.js} +1 -1
- package/dist/client/assets/{Upload01-DOAyGyLP.js → Upload01-hsehoAUh.js} +1 -1
- package/dist/client/assets/{UserSquare-Cbfe91aH.js → UserSquare-T5uOviXx.js} +1 -1
- package/dist/client/assets/{Users01-C1OYrFY1.js → Users01-DDaeVlhF.js} +1 -1
- package/dist/client/assets/{XClose-p8-Q8v8l.js → XClose-NmocES7U.js} +1 -1
- package/dist/client/assets/{Zap-DyRXLCnm.js → Zap-aTbgq59l.js} +1 -1
- package/dist/client/assets/{access-gate-BAXdhF61.js → access-gate-CpAtBb_h.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-I3R6bOX6.js → add-connection-dialog-BFqv_pWT.js} +1 -1
- package/dist/client/assets/agent-app-ZW_Vm-c7.js +1 -0
- package/dist/client/assets/{agent-assets-BytEk-0l.js → agent-assets-kQe7VufN.js} +1 -1
- package/dist/client/assets/{agent-automation-TykMN0zp.js → agent-automation-7-KjK-1c.js} +1 -1
- package/dist/client/assets/{agent-automations-axy_S6Px.js → agent-automations-DnNwxwTt.js} +1 -1
- package/dist/client/assets/{agent-calendar-BaUCHDte.js → agent-calendar-CbAiDaBT.js} +1 -1
- package/dist/client/assets/{agent-capabilities-DUEnZmC-.js → agent-capabilities-DKq2l6j_.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-YnQ0oiMQ.js → agent-connect-sources-SuTyB8Qe.js} +1 -1
- package/dist/client/assets/agent-deck-8VVMhl7J.js +1 -0
- package/dist/client/assets/{agent-e2e-CN8oCbtP.js → agent-e2e-C9FJgu1a.js} +1 -1
- package/dist/client/assets/{agent-file-C58LYJBC.js → agent-file-D5ZobkO7.js} +1 -1
- package/dist/client/assets/{agent-hosting-C-Xgv5CR.js → agent-hosting-Df5G-pNf.js} +1 -1
- package/dist/client/assets/{agent-icon-FkFyvRCX.js → agent-icon-DD6O0sln.js} +1 -1
- package/dist/client/assets/agent-library-C_HTRhOS.js +1 -0
- package/dist/client/assets/agent-library-file-8gKy0Im-.js +1 -0
- package/dist/client/assets/agent-overview-CSsPaJjm.js +1 -0
- package/dist/client/assets/{agent-releases-DXvHySgn.js → agent-releases-6IDVzk1I.js} +1 -1
- package/dist/client/assets/agent-settings-uWS3yWiw.js +1 -0
- package/dist/client/assets/{agent-site-editor-iOr_R9Ca.js → agent-site-editor-YGSo4JHf.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-wtgSW_Bw.js +2 -0
- package/dist/client/assets/agent-site-editor-content-BC5jgNMj.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-Dd0H-yKP.js +1 -0
- package/dist/client/assets/agent-view-C4jCWfsN.js +1 -0
- package/dist/client/assets/{agent-view-guard-CTg_3K6Q.js → agent-view-guard-Ud9RVhUT.js} +1 -1
- package/dist/client/assets/{ai-providers-SquUsRRR.js → ai-providers-CdWvTe6E.js} +1 -1
- package/dist/client/assets/{alert-BcGEYE9G.js → alert-rSlkmSpl.js} +1 -1
- package/dist/client/assets/{analytics-sections-C3xfRdmO.js → analytics-sections-CdJGMHGj.js} +1 -1
- package/dist/client/assets/{api-keys-6xNcEC8t.js → api-keys-CgV7T2W3.js} +1 -1
- package/dist/client/assets/api-keys-CmWPTVBS.js +1 -0
- package/dist/client/assets/{app-editor-CoHcQkjL.js → app-editor-DQrUb2qq.js} +1 -1
- package/dist/client/assets/{asset-utils-Bq_dJbYP.js → asset-utils-DJaTbmOK.js} +1 -1
- package/dist/client/assets/{auth-BsX6ur7b.js → auth-Dfx2bf9S.js} +1 -1
- package/dist/client/assets/{auth-catchall-BwwwkN3O.js → auth-catchall-BzI646tE.js} +1 -1
- package/dist/client/assets/{auth-entry-D3WJl0FC.js → auth-entry-BA2dv7O1.js} +1 -1
- package/dist/client/assets/{auth-split-layout-J4KMjvhP.js → auth-split-layout-3t1_TKos.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Cu0VrSF5.js → authenticate-and-persist-oauth-EuyAX3Gy.js} +1 -1
- package/dist/client/assets/{automation-list-row-QpXtin0Q.js → automation-list-row-BK5XD6ZY.js} +1 -1
- package/dist/client/assets/{automation-runs-aImufYAH.js → automation-runs-BekfbsHI.js} +1 -1
- package/dist/client/assets/{automations-DLgpPcdB.js → automations-ocOVuWpR.js} +1 -1
- package/dist/client/assets/{autosend-ce5-FRC2.js → autosend-BLYIlkXq.js} +1 -1
- package/dist/client/assets/{badge-2xhZ-r-l.js → badge-9UZ-oy57.js} +1 -1
- package/dist/client/assets/{block-document-DI7cHMPV.js → block-document-B5Xpou_B.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DbUsPnrw.js → blocks-preview-workspace-context-CGoI0EUn.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-Oy4QesXy.js → blocks-tab-states-CNkB95lx.js} +1 -1
- package/dist/client/assets/{blog-schema-CHW5Pxv_.js → blog-schema-DMB79fe6.js} +1 -1
- package/dist/client/assets/{buckets-BDCTPQpG.js → buckets-C5e8GKB5.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-5IZRp812.js → build-improve-prompt-doc-aExDV9Mz.js} +1 -1
- package/dist/client/assets/{calendar-D-rfd7JY.js → calendar-CKcdkgh5.js} +1 -1
- package/dist/client/assets/{capability-load-error-BKCZfLTa.js → capability-load-error-D8AT7eAw.js} +1 -1
- package/dist/client/assets/{category-editor-BuIyetQS.js → category-editor-DDFXYf_d.js} +1 -1
- package/dist/client/assets/{chart-wyCy3WJz.js → chart-Ch4wXn1G.js} +1 -1
- package/dist/client/assets/{chat-context-GsXpI-Rk.js → chat-context-tsaqCp6v.js} +1 -1
- package/dist/client/assets/{chat-draft-CnA31cek.js → chat-draft-DeOYn8wH.js} +1 -1
- package/dist/client/assets/{checkbox-LWvsDQWZ.js → checkbox-bO8ZnM7n.js} +1 -1
- package/dist/client/assets/{choose-editor-oX8cTiL9.js → choose-editor-B-1DX2pl.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Dal5M4-w.js → cli-auth-success-WUcj8Laj.js} +1 -1
- package/dist/client/assets/{client-icons-BUnl0ZXy.js → client-icons-CJKwmsS5.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-T8KTji6O.js → cms-settings-editor-CL1HXF3j.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-49wrBNXT.js → cms-store-drafts-C_ZG08jQ.js} +1 -1
- package/dist/client/assets/{collapsible-DwneXnWl.js → collapsible-CehJ-xlR.js} +1 -1
- package/dist/client/assets/{collection-detail-DWuKEvHr.js → collection-detail-w7NYTWNb.js} +1 -1
- package/dist/client/assets/{collection-display-button-BcvxnzA7.js → collection-display-button-CVOVdzmi.js} +1 -1
- package/dist/client/assets/{collection-search-BXhJDy4i.js → collection-search-Lm88VC-w.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CsjezWAk.js → collection-table-wrapper-LUTykEyP.js} +1 -1
- package/dist/client/assets/{collection-tabs-R5zZyWuQ.js → collection-tabs-BW9NTpao.js} +1 -1
- package/dist/client/assets/{combobox-M_E9pRSg.js → combobox-C8IS_aP5.js} +1 -1
- package/dist/client/assets/{command-D1ggU7uN.js → command-B42vqDSm.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-5tiqlnPW.js → companion-mcps-section-gN7svOR8.js} +1 -1
- package/dist/client/assets/{config-BwOe4khb.js → config--cZAprAj.js} +1 -1
- package/dist/client/assets/{connect-CZDT3prT.js → connect-BAZtz6qy.js} +1 -1
- package/dist/client/assets/{connect-layout-BlfzEMXx.js → connect-layout-FGHNVpHc.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-Bu2QM8b1.js → connect-source-dialog-BlacChCY.js} +1 -1
- package/dist/client/assets/{connection-BWg4pBgr.js → connection-Brtus8mh.js} +1 -1
- package/dist/client/assets/{connection-card-D8rA98h7.js → connection-card-CSkWTxJN.js} +1 -1
- package/dist/client/assets/{connection-detail-DSD-1Pdd.js → connection-detail-Dz92Js40.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CTdld_FZ.js → connection-form-helpers-CQaJSXmJ.js} +1 -1
- package/dist/client/assets/{connection-slug-xnxqKZgT.js → connection-slug-DREkgXeA.js} +1 -1
- package/dist/client/assets/{connections-CZPMCaga.js → connections-BZUJ_roU.js} +1 -1
- package/dist/client/assets/{content-tab-B2fyj6Jh.js → content-tab-Bc_Tg1a4.js} +3 -3
- package/dist/client/assets/{context-CUmhz6yH.js → context-2NK4t-Lg.js} +1 -1
- package/dist/client/assets/{context-menu-DPGth7tq.js → context-menu-D-JkcRvL.js} +1 -1
- package/dist/client/assets/{context-shell-tkTYv2bR.js → context-shell-Bwve3xDx.js} +3 -3
- package/dist/client/assets/{core.esm-DnEwZVMw.js → core.esm-ByTukYOF.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-UgMN3Pp1.js → create-organization-dialog-BIe1f-Sz.js} +1 -1
- package/dist/client/assets/{device-hint-DHQmntIa.js → device-hint-Djy4F7LR.js} +1 -1
- package/dist/client/assets/{discover-Cpqi_nZO.js → discover-D050EtE3.js} +1 -1
- package/dist/client/assets/{domain-settings-DJSixqz2.js → domain-settings-DPbJEdjs.js} +1 -1
- package/dist/client/assets/{drawer-BnPszJPZ.js → drawer-Dijofbhl.js} +1 -1
- package/dist/client/assets/{editor-zE4VnGLI.js → editor-BODVgWYK.js} +1 -1
- package/dist/client/assets/{editor-classes-BnzpZOY5.js → editor-classes-BdpfcKyR.js} +1 -1
- package/dist/client/assets/{empty-state-DLrHPsXZ.js → empty-state-CwfRxt_B.js} +1 -1
- package/dist/client/assets/{empty-state-BFLQtSFV.js → empty-state-Drt9QRbX.js} +1 -1
- package/dist/client/assets/{extract-connection-data-KiTWYSx4.js → extract-connection-data-Pe-Tip3g.js} +1 -1
- package/dist/client/assets/{feature-gate-C27q-aIj.js → feature-gate-2Z3FyCIy.js} +1 -1
- package/dist/client/assets/{feature-paywall-CJwXTzME.js → feature-paywall-CpM-erQe.js} +1 -1
- package/dist/client/assets/{feedback-zQMybfa1.js → feedback-DcWPFhR_.js} +1 -1
- package/dist/client/assets/{file-explorer-C_MMeMcX.js → file-explorer-xWdf34ip.js} +1 -1
- package/dist/client/assets/{file-preview-F9XVmctL.js → file-preview-Ca_4k6rv.js} +1 -1
- package/dist/client/assets/{file-share-button-A6RgU4RK.js → file-share-button-DgOCZ5mM.js} +1 -1
- package/dist/client/assets/{file-type-icon-DoyEf2kQ.js → file-type-icon-DiS0iV28.js} +1 -1
- package/dist/client/assets/{folder-icon-CsH9NIDq.js → folder-icon-swAD3bQU.js} +1 -1
- package/dist/client/assets/{form-cx1UDyF2.js → form-CRja9i9j.js} +1 -1
- package/dist/client/assets/{general-YmXk3hPt.js → general-C7SfdAAF.js} +1 -1
- package/dist/client/assets/{github-icon-DNe7j1PY.js → github-icon-tpEVyIwD.js} +1 -1
- package/dist/client/assets/{home-DgapTseA.js → home-DsrjQvGT.js} +1 -1
- package/dist/client/assets/{home-overview-CFwm7iMO.js → home-overview-CMI03yPH.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-BJXH2g7a.js → hosted-reconcile-BnVn2LVL.js} +1 -1
- package/dist/client/assets/{icon-button-CmFwjZ_m.js → icon-button-BZ9f2Pt9.js} +1 -1
- package/dist/client/assets/{index-DM3inxPC.js → index-68Cr2r1N.js} +1 -1
- package/dist/client/assets/{index-D5uF1VH5.js → index-B8Pa92mK.js} +1 -1
- package/dist/client/assets/{index-DisXhcWe.js → index-BGom2FnM.js} +1 -1
- package/dist/client/assets/{index-CmGLs6T5.js → index-BW7-bbk0.js} +1 -1
- package/dist/client/assets/{index-BCXxtUlh.js → index-C2wTYLQr.js} +1 -1
- package/dist/client/assets/{index-hZylT09v.js → index-CZXPJi4-.js} +1 -1
- package/dist/client/assets/{index-ffdfMTh-.js → index-CbuCRTrW.js} +1 -1
- package/dist/client/assets/{index-CN8uFy5p.js → index-CcZq_9Fb.js} +1 -1
- package/dist/client/assets/{index-DGn-FPge.js → index-Cvc22Qvh.js} +3 -3
- package/dist/client/assets/{index-CxEOaGFH.js → index-D-DRzVEB.js} +1 -1
- package/dist/client/assets/{index-WwIqmvy-.js → index-D0G5dFqT.js} +1 -1
- package/dist/client/assets/{index-DuD6FLZ3.js → index-DQAtcq3Z.js} +1 -1
- package/dist/client/assets/{index-qMWmRmW0.js → index-Dt7ZIwRY.js} +1 -1
- package/dist/client/assets/{index-B5lnCLuB.js → index-Dw1u8oXT.js} +1 -1
- package/dist/client/assets/{index-C9A_N0M0.js → index-LnWr599j.js} +1 -1
- package/dist/client/assets/{index-BmYeIRlv.js → index-Z8XjhDCo.js} +1 -1
- package/dist/client/assets/{index-redirect-eX7nEWSl.js → index-redirect-PbFd_QHU.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-B_P9W4Zx.js → infiniteQueryObserver-CmujZk55.js} +1 -1
- package/dist/client/assets/{infra-billing-BatrrG1f.js → infra-billing-BlZrBUYP.js} +1 -1
- package/dist/client/assets/{input-Di6BJ4Zo.js → input-C7_FCkgY.js} +3 -3
- package/dist/client/assets/{input-BEManHLB.js → input-D6ZRMHIB.js} +1 -1
- package/dist/client/assets/{integration-icon-BHx1ytyX.js → integration-icon-DMt85Vdd.js} +1 -1
- package/dist/client/assets/{jira-icon-DQhFl4az.js → jira-icon-C0C7R9Uf.js} +1 -1
- package/dist/client/assets/{label-CHRzCbuP.js → label-RB5C5N6z.js} +1 -1
- package/dist/client/assets/{layout-CvFeIpHB.js → layout-CBfnb3CZ.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-B-RkQsR1.js → legacy-agents-deep-zWqSTSjP.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-f_YEwDUU.js → legacy-main-redirect-BZlpoESe.js} +1 -1
- package/dist/client/assets/library-pMQg4GCR.js +1 -0
- package/dist/client/assets/{library-tab-DrpEkybg.js → library-tab-C7gKe5iN.js} +1 -1
- package/dist/client/assets/{login-DtH52R3F.js → login-D9zRzHBo.js} +1 -1
- package/dist/client/assets/{markdown-C7Kie5ev.js → markdown-HhU9_nSI.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CO8LOFxq.js → mcp-app-renderer-DeLjk14w.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C-mc4e6m.js → mcp-oauth-C-i6IZ7F.js} +1 -1
- package/dist/client/assets/{mcp-oauth-iB4K_uoY.js → mcp-oauth-DLwsgkOm.js} +1 -1
- package/dist/client/assets/{members-yfLvIIIT.js → members-DocomT72.js} +1 -1
- package/dist/client/assets/{memory-aeBofHaH.js → memory-BP3-K3oo.js} +1 -1
- package/dist/client/assets/{mock-board-B5SFWfb2.js → mock-board-CoWf0eSd.js} +3 -3
- package/dist/client/assets/{monaco-editor-BRY87vsh.js → monaco-editor-oUmtqDLR.js} +1 -1
- package/dist/client/assets/{monitoring-WRX4s2Md.js → monitoring-DKfNSCeR.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DZcqSbnv.js → monitoring-stats-row-XSvwSWAi.js} +1 -1
- package/dist/client/assets/{multi-select-C-iHSsuJ.js → multi-select-CISJC82c.js} +1 -1
- package/dist/client/assets/{mustache-WHgo2S29.js → mustache-D4zVU9iA.js} +1 -1
- package/dist/client/assets/{named-rule-view-ChTlMWf5.js → named-rule-view-BTwHmZ5L.js} +1 -1
- package/dist/client/assets/{new-project-dialog-UvI58my0.js → new-project-dialog-BA0jmhgS.js} +1 -1
- package/dist/client/assets/{oauth-callback-Bg-Twulk.js → oauth-callback-C1NevZMJ.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CuXrUeR4.js → oauth-callback-ai-provider-BJwoy8qA.js} +1 -1
- package/dist/client/assets/{oauth-consent-BdD4CLIL.js → oauth-consent-BTT41r6l.js} +1 -1
- package/dist/client/assets/{onboarding-DAlZ_ijb.js → onboarding-C2uIwwWY.js} +1 -1
- package/dist/client/assets/{openai-conversation-DChbcEJV.js → openai-conversation-pUSF1vof.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-uJohOkF6.js → optimistic-project-sidebar-views-BnUNFsLR.js} +1 -1
- package/dist/client/assets/{order-monitor-day-BIbj8jXM.js → order-monitor-day-BzMajB7Y.js} +1 -1
- package/dist/client/assets/{organization-choice-9Sf7qdAX.js → organization-choice-5ra3ZqkQ.js} +1 -1
- package/dist/client/assets/{orgs-DuQRavym.js → orgs-ZeqGcjOU.js} +1 -1
- package/dist/client/assets/{own-accounts-section-n50adHNX.js → own-accounts-section-Dd8ELrvu.js} +1 -1
- package/dist/client/assets/{pair-1hov1KDD.js → pair-Bx1LbJmC.js} +1 -1
- package/dist/client/assets/{parse-sections-BNf6_EjY.js → parse-sections-BTDQNPKy.js} +3 -3
- package/dist/client/assets/{plan-Dq5q5bsx.js → plan-bz8_rmrJ.js} +1 -1
- package/dist/client/assets/{plan-ladder-DJg9yABt.js → plan-ladder-CZUMQESY.js} +1 -1
- package/dist/client/assets/{plan-usage-card-D4SynKK4.js → plan-usage-card-SygAb3OS.js} +1 -1
- package/dist/client/assets/{popover-CE0A3Qit.js → popover-D5YX99Kp.js} +1 -1
- package/dist/client/assets/{post-calendar-EtCAYSiT.js → post-calendar-BIBU13NF.js} +1 -1
- package/dist/client/assets/{post-editor-CeOdXCzo.js → post-editor-BAf1z147.js} +1 -1
- package/dist/client/assets/{preview-content-CyH9JuG-.js → preview-content-TDEad-bh.js} +1 -1
- package/dist/client/assets/{preview-dialog-FVFjchHr.js → preview-dialog-BkHpQdXG.js} +1 -1
- package/dist/client/assets/{preview-panel-eL-KdUlb.js → preview-panel-DduOnxXk.js} +1 -1
- package/dist/client/assets/{preview-tab-Cuhy4gb6.js → preview-tab-Cgfndmyh.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-oaL2Geio.js → product-picker-dialog-DDkB9ByB.js} +1 -1
- package/dist/client/assets/{profile-DhXoBixo.js → profile-DHJVxDvo.js} +1 -1
- package/dist/client/assets/{project-app-view-CFDNRbPF.js → project-app-view-BfcPf6du.js} +1 -1
- package/dist/client/assets/{project-apps-B-5TAX2o.js → project-apps-Bny6_T2A.js} +1 -1
- package/dist/client/assets/{project-icon-reyc_nNY.js → project-icon-eZOGIGwj.js} +1 -1
- package/dist/client/assets/{project-index-CeS8PQv7.js → project-index-BSMjLbxc.js} +1 -1
- package/dist/client/assets/project-reports-BzA8d8hO.js +1 -0
- package/dist/client/assets/{project-sidebar-views-DYKp64W4.js → project-sidebar-views-CrRbPbLq.js} +1 -1
- package/dist/client/assets/project-tasks-BCE2SgoF.js +1 -0
- package/dist/client/assets/{projects-QRnnQxmB.js → projects-D7HB1QKY.js} +1 -1
- package/dist/client/assets/{projects-empty-state-B2R3HC7E.js → projects-empty-state-DBWek16Y.js} +1 -1
- package/dist/client/assets/{prompts-Cp6YboL1.js → prompts-MMmII7eb.js} +1 -1
- package/dist/client/assets/record-editor-DVouiUmR.js +1 -0
- package/dist/client/assets/{redirect-editor-Bf8VmZQx.js → redirect-editor-cm3-huyu.js} +1 -1
- package/dist/client/assets/reports-BHAVwnBG.js +1 -0
- package/dist/client/assets/{reports-BtW4mY0K.js → reports-D0VzI1C_.js} +1 -1
- package/dist/client/assets/{reports-onboarding-CtEi6opy.js → reports-onboarding-DonafHiF.js} +1 -1
- package/dist/client/assets/{reports-tab-DhrTVeTc.js → reports-tab-Wl9IyKm6.js} +2 -2
- package/dist/client/assets/{repositories-CGGnfQiR.js → repositories-9kTJbSW8.js} +1 -1
- package/dist/client/assets/repositories-bPxFm30V.js +1 -0
- package/dist/client/assets/{repository-binding-DHN5ihZA.js → repository-binding-B7A7NBUB.js} +1 -1
- package/dist/client/assets/{repository-picker-BVa6TfGc.js → repository-picker-CI7xSsin.js} +1 -1
- package/dist/client/assets/{require-capability-CVoJcu7H.js → require-capability-BTBUQsVM.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BQmhUScr.js → required-auth-layout-ClYF4eFR.js} +1 -1
- package/dist/client/assets/{reset-password-BLOlZYb5.js → reset-password-Ah3K7D-l.js} +1 -1
- package/dist/client/assets/{resizable-CdFCM71r.js → resizable-DzzgKGKP.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-DJ5Ncrbw.js → resolve-tab-icon-DMbVCUvi.js} +1 -1
- package/dist/client/assets/{review-settings-Deyxg2o8.js → review-settings-Fxdols3J.js} +1 -1
- package/dist/client/assets/{role-color-DfmSCdD1.js → role-color-CEkb11P4.js} +1 -1
- package/dist/client/assets/{roles-DGxZsr14.js → roles-CqJ0hOtT.js} +1 -1
- package/dist/client/assets/route-BA7jjOjA.js +1 -0
- package/dist/client/assets/{route-Dq3q8mSL.js → route-DGCMYgfH.js} +1 -1
- package/dist/client/assets/route-DJbiUXJl.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-Dp2Dt1TA.js → sandbox-lifecycle-context-WaQV2LhH.js} +1 -1
- package/dist/client/assets/{schema-C2e4bOOh.js → schema-BH82js-o.js} +1 -1
- package/dist/client/assets/{schema-77LyfVRl.js → schema-DHahXPsT.js} +1 -1
- package/dist/client/assets/{scroll-area-DOPuQKg_.js → scroll-area-BN87AboJ.js} +1 -1
- package/dist/client/assets/{search-input-Bo9D0b2l.js → search-input-BBYghT-z.js} +1 -1
- package/dist/client/assets/{search-toggle-D227Ek9d.js → search-toggle-pLnMgrhP.js} +1 -1
- package/dist/client/assets/{secret-picker-ChOT2LaB.js → secret-picker-DWWFQJzg.js} +1 -1
- package/dist/client/assets/{secrets-TvEnuoeS.js → secrets-CM4b3_qA.js} +1 -1
- package/dist/client/assets/{sections-tdmo3LjO.js → sections-CgO1w_IT.js} +1 -1
- package/dist/client/assets/{sections-editor-C7sTzFTf.js → sections-editor-Uk83RbMN.js} +1 -1
- package/dist/client/assets/{select-Di2sLm_-.js → select-GzsOSPza.js} +1 -1
- package/dist/client/assets/{select-model-Do4joh93.js → select-model-BU2ssn1V.js} +1 -1
- package/dist/client/assets/{seo-editor-BK7SzGFy.js → seo-editor-dMXY0ofk.js} +1 -1
- package/dist/client/assets/{separator-Bu1wQRuA.js → separator-CuwdHpjW.js} +1 -1
- package/dist/client/assets/settings-tab-FvtSSyQC.js +1 -0
- package/dist/client/assets/{sheet-pl7zdRHn.js → sheet-BIQm-3An.js} +1 -1
- package/dist/client/assets/{shell-layout-DzQA4K-b.js → shell-layout-CH0j9rog.js} +1 -1
- package/dist/client/assets/site-draft-view-C74WkBDm.js +3 -0
- package/dist/client/assets/site-editor-CazX9Ijc.js +1 -0
- package/dist/client/assets/{site-editor-toast-BUVxT4JG.js → site-editor-toast-DrW9VMK5.js} +1 -1
- package/dist/client/assets/{skills-Bh5rPXC6.js → skills-C71x-yhC.js} +1 -1
- package/dist/client/assets/{slider-CwE675ao.js → slider-BTgIuWj6.js} +1 -1
- package/dist/client/assets/{sortable.esm-CIP-w8Te.js → sortable.esm-Dd1EVaQb.js} +1 -1
- package/dist/client/assets/{sso-DpryG3cU.js → sso-BfwIPTh8.js} +1 -1
- package/dist/client/assets/{suggestion-Dr321Cmr.js → suggestion-CsEyXKDY.js} +1 -1
- package/dist/client/assets/{switch-D-6AqAnT.js → switch-BRZA_xq0.js} +1 -1
- package/dist/client/assets/{synced-repos-CwCJZfKG.js → synced-repos-Do7bESqI.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-CMWJQvgX.js → tab-icon-glyph-BsVyyg_A.js} +1 -1
- package/dist/client/assets/{table-DpJo1vAx.js → table-DJd8n4EY.js} +1 -1
- package/dist/client/assets/{tabs-DNziA2dZ.js → tabs-D5AMuciq.js} +1 -1
- package/dist/client/assets/{task-board-BuKyXp11.js → task-board-DN88kD7h.js} +1 -1
- package/dist/client/assets/{task-route-DlvmNWcQ.js → task-route-4C0M-4XY.js} +1 -1
- package/dist/client/assets/{task-status-B4eBo5Md.js → task-status-B2JNuBbQ.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-C-zvSFMs.js → taskboard-analytics-D_AXxVNg.js} +1 -1
- package/dist/client/assets/tasks-BlrmxtrG.js +1 -0
- package/dist/client/assets/{tasks-BHN9oqEC.js → tasks-dMEgvkta.js} +1 -1
- package/dist/client/assets/{textarea-HAezEU3R.js → textarea-D7HQlMVo.js} +1 -1
- package/dist/client/assets/{thread-analytics-DWnZrs9k.js → thread-analytics-BQjHh_yV.js} +1 -1
- package/dist/client/assets/{thread-intent-C084ju5m.js → thread-intent-Bs-Q7fma.js} +1 -1
- package/dist/client/assets/{thread-route-Dt42HUQv.js → thread-route-B44higRI.js} +1 -1
- package/dist/client/assets/{thread-route-C-GRt_yL.js → thread-route-C-uX4C4C.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-Ck1Bv0_3.js → thread-sheet-body-BNo76_XD.js} +1 -1
- package/dist/client/assets/{time-range-picker-CS9tika7.js → time-range-picker-D4sglVBw.js} +1 -1
- package/dist/client/assets/{toggle-group-CFojpTQB.js → toggle-group-BBgjmF6C.js} +1 -1
- package/dist/client/assets/{tool-namespace-Fc2c0QC4.js → tool-namespace-l4eN7YZ5.js} +1 -1
- package/dist/client/assets/{tool-set-selector-B8ePlhyl.js → tool-set-selector-Bi-Sw2KD.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-GjI5vOKF.js → toolbar-icon-button-nrUHQe-I.js} +1 -1
- package/dist/client/assets/{tooltip-BojzNY2M.js → tooltip-C0GWPsi8.js} +1 -1
- package/dist/client/assets/{tooltipContext-m-9QMOrS.js → tooltipContext-DdEokZtY.js} +1 -1
- package/dist/client/assets/{track-Bclp3q8c.js → track-29FVOdFL.js} +1 -1
- package/dist/client/assets/{types-CdXMwNZg.js → types-DKuFfsqr.js} +1 -1
- package/dist/client/assets/{url-slug-BkV5QJiU.js → url-slug-5t39ocbn.js} +1 -1
- package/dist/client/assets/{usage-stats-B39QZ3Cn.js → usage-stats-CHeI7dPd.js} +1 -1
- package/dist/client/assets/{use-ai-providers-hjEpjXQ2.js → use-ai-providers-BbVlPdZd.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-vuCkiknA.js → use-apply-named-rule-CnOcORn0.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-Cp_wqFIx.js +1 -0
- package/dist/client/assets/{use-automations-DJWCjg8T.js → use-automations-BoyfX_H0.js} +1 -1
- package/dist/client/assets/{use-autosave-DzjuxKy7.js → use-autosave-CZD-Fkyk.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-DGf4-J1Z.js → use-chat-layout-state-BC5WrKKn.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-JZTNoXFa.js → use-cms-publish-actions-BbDVRUuf.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DZPybU6m.js → use-connect-companion-DEAJWvqA.js} +1 -1
- package/dist/client/assets/{use-connection-BonBiP4H.js → use-connection-Dqyf1wn8.js} +1 -1
- package/dist/client/assets/{use-content-sync-C-LYfyy7.js → use-content-sync-vr73v2b2.js} +1 -1
- package/dist/client/assets/{use-copy-1IxNCkh9.js → use-copy-BGfQrJIh.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-KQxxLRHa.js → use-date-fns-locale-C4jbLuwI.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Eo1C-w5U.js → use-debounced-autosave-BrjHHNNB.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CzxhSP8l.js → use-debounced-value-BF84eZeF.js} +1 -1
- package/dist/client/assets/{use-deco-credits-CEMj3JGY.js → use-deco-credits-MCc3vHir.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CTD6ZdaA.js → use-decopilot-events-uSeDcfUe.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CKqCkN-k.js → use-delete-connection-CLe-XFxn.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BCIDPeyj.js → use-deployment-admin-ShnoFTNr.js} +1 -1
- package/dist/client/assets/{use-entitlements-DxVD_uCH.js → use-entitlements-wE65MYfi.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-o_WDZuY-.js → use-fast-preview-draft-url-BmUgrEyk.js} +1 -1
- package/dist/client/assets/{use-file-configs-D87qhE2e.js → use-file-configs-D9BR1kJU.js} +1 -1
- package/dist/client/assets/{use-id-selection-FN7gA0OQ.js → use-id-selection-BcfcmGZl.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-DglRSmH4.js → use-inbox-feed-EYADn16y.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-4LyFv3hi.js → use-infinite-scroll-Ds1Wd1cw.js} +1 -1
- package/dist/client/assets/{use-join-requests-czJryNA9.js → use-join-requests-CkWiAH0i.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-BeQ-NkWh.js → use-main-panel-tabs-DTMcBtUc.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-_QM-6kc-.js → use-mcp-auth-status-DhFx8XVQ.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BeYM-3mp.js → use-mcp-client-BfCmeMHR.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-IjFHP0w8.js → use-mcp-prompts-DoojBZhS.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Bi0gClZp.js → use-mcp-tools-DwTtnjNb.js} +1 -1
- package/dist/client/assets/{use-mobile-D6y1UaCv.js → use-mobile-C1stVK0E.js} +1 -1
- package/dist/client/assets/{use-move-blocks-DItjAQsv.js → use-move-blocks-Bclcq-Qe.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DP0a6y9z.js → use-navigate-to-agent-D2d0cpFU.js} +1 -1
- package/dist/client/assets/{use-org-fs-CfPaWD_N.js → use-org-fs-DHnEDbF9.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-TOw0XlBk.js → use-org-repo-syncs-CcoLGdUP.js} +1 -1
- package/dist/client/assets/{use-org-sso-BK0CtdSD.js → use-org-sso-d82WgyRM.js} +1 -1
- package/dist/client/assets/{use-organization-settings--v2ov5jL.js → use-organization-settings-a6mUKPHv.js} +1 -1
- package/dist/client/assets/{use-project-scope-BJA0ds2S.js → use-project-scope-C0EKXyqg.js} +1 -1
- package/dist/client/assets/{use-recent-apps--67lnzqC.js → use-recent-apps-DEMyNf2W.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-81WxcUY9.js → use-reports-diagnostic-rjeHGSYu.js} +1 -1
- package/dist/client/assets/{use-secrets-DEeK7thW.js → use-secrets-CifnNbah.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BO-qsUKf.js → use-section-preview-base-SkN8HQaB.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-DuLHdlSz.js → use-sidebar-collapsed-DwcGl0-e.js} +1 -1
- package/dist/client/assets/{use-tags-DEr2TlgW.js → use-tags-CgXVAtG9.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DxH9-ih7.js → use-task-board-analytics-BTZNDNnK.js} +1 -1
- package/dist/client/assets/{use-task-board-events-BZToXVGj.js → use-task-board-events-DCguN7A5.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-B2japofE.js → use-task-board-item-prs-CnqmEndd.js} +1 -1
- package/dist/client/assets/{use-task-board-items-Puwxrpek.js → use-task-board-items-BmpaMZkF.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-C5iC-R_g.js → use-task-board-prompts-DdSO4gLi.js} +1 -1
- package/dist/client/assets/{use-task-metadata-jDPe6d5C.js → use-task-metadata-D3xqf4sH.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DnX9RgWT.js → use-thread-outputs-D6sQTVJo.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-P9--kf7E.js +1 -0
- package/dist/client/assets/{useQueries-BbqzFtkh.js → useQueries-BuMODvFG.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C2ZhOGvp.js +1 -0
- package/dist/client/assets/{users-DFMP_wOE.js → users-Ct3PwBMT.js} +1 -1
- package/dist/client/assets/{utils-BU-nucb-.js → utils-DA49HMaO.js} +1 -1
- package/dist/client/assets/{variant-calendar-DKhL8Mk2.js → variant-calendar-CPtUMCAS.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-CgElSjwL.js → variant-matcher-override-DnlLYEoa.js} +1 -1
- package/dist/client/assets/{view-header-i70JKW9C.js → view-header-CAO18iqy.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CsY6ukOa.js → virtual-mcp-C4mAz3N8.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-D3b7K3Uo.js → watch-sse-pool-BI4P-Lkx.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-Djt3nisA.js +0 -1
- package/dist/client/assets/agent-deck-BZptRfb2.js +0 -1
- package/dist/client/assets/agent-library-CxsAEqgy.js +0 -1
- package/dist/client/assets/agent-library-file-BfEsr2cm.js +0 -1
- package/dist/client/assets/agent-overview-yBV3P4Kd.js +0 -1
- package/dist/client/assets/agent-settings-C7JVa4hp.js +0 -1
- package/dist/client/assets/agent-site-editor-code-0Rkb_Rlf.js +0 -2
- package/dist/client/assets/agent-site-editor-content-CKdTDsIv.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-DY2uCsMf.js +0 -1
- package/dist/client/assets/agent-view-CMZiQIOU.js +0 -1
- package/dist/client/assets/api-keys-DzWt-NPK.js +0 -1
- package/dist/client/assets/library-DQMyWPTm.js +0 -1
- package/dist/client/assets/project-reports-DxSY0pyo.js +0 -1
- package/dist/client/assets/project-tasks-joh7axEQ.js +0 -1
- package/dist/client/assets/record-editor-DzEJNlA8.js +0 -1
- package/dist/client/assets/reports-5kgLKYGo.js +0 -1
- package/dist/client/assets/repositories-D0xZPdow.js +0 -1
- package/dist/client/assets/route-C6jiJ2GR.js +0 -1
- package/dist/client/assets/route-Cf6qLb88.js +0 -1
- package/dist/client/assets/settings-tab-B2_rrm2f.js +0 -1
- package/dist/client/assets/site-draft-view-Ca1ao55E.js +0 -3
- package/dist/client/assets/site-editor-DR8x2KPW.js +0 -1
- package/dist/client/assets/tasks-DqD-0E5O.js +0 -1
- package/dist/client/assets/use-ask-in-chat-oQGHyTZE.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CCkoNUSG.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CDBL11js.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aF as Ne,e2 as Me,e0 as ze,aG as de,ba as Ee,c as U,b as V,j as t,h as Se,B,r as Q,m as ye,a5 as te,ak as Re,V as me,K as ee,d as se,C as _e,as as Ce,gw as Ue,bB as Fe,n as Ve,hr as ue,a4 as Le,I as J,_ as Be,X as qe,Z as Ge,Y as xe,R as He,f as Ke,hH as Xe,q as Qe,h6 as We,aE as Ye,aD as Je,o as Ze,t as Y}from"./index-DGn-FPge.js";import{g as et}from"./extract-connection-data-KiTWYSx4.js";import{E as we}from"./empty-state-BFLQtSFV.js";import{E as tt,r as st,b as nt,c as it}from"./connection-form-helpers-CTdld_FZ.js";import{c as ot,S as at,D as lt}from"./index-qMWmRmW0.js";import{u as ke,T as ct}from"./use-mcp-auth-status-_QM-6kc-.js";import{a as rt}from"./mcp-oauth-iB4K_uoY.js";import{I as ae}from"./integration-icon-BHx1ytyX.js";import{s as dt}from"./Plus-BhRQRaas.js";import{bt as mt,aA as ut,au as xt,aB as ne}from"./agent-icon-FkFyvRCX.js";import{a as Ie,e as pt,g as ft}from"./Tool01-B8q2F7hW.js";import{s as ce}from"./Trash01-Ccl1EX2p.js";import{b as ht,a as gt,c as jt,S as vt,d as bt}from"./sheet-pl7zdRHn.js";import{F as G,b as H,c as K,d as L,f as X,e as pe,a as Nt}from"./form-cx1UDyF2.js";import{a as Te,b as Ae,u as St}from"./use-connection-BonBiP4H.js";import{u as Pe}from"./use-mcp-client-BeYM-3mp.js";import{u as yt}from"./use-mcp-tools-Bi0gClZp.js";import{a as _t}from"./use-mcp-prompts-IjFHP0w8.js";import{i as Ct}from"./mcp-oauth-C-mc4e6m.js";import{u as wt,D as kt}from"./use-delete-connection-CKqCkN-k.js";import{c as It}from"./monitoring-stats-row-DZcqSbnv.js";import{c as Tt,b as At,C as Pt,a as Dt,B as $t}from"./chart-wyCy3WJz.js";import{C as Ot}from"./tooltipContext-m-9QMOrS.js";import{a as Mt}from"./repository-binding-DHN5ihZA.js";import{T as ie,a as zt,b as oe,c as Et}from"./tabs-DNziA2dZ.js";import{g as De}from"./connection-slug-xnxqKZgT.js";import{n as Rt}from"./ShoppingBag01-DYcJDT4V.js";import{g as re}from"./types-CdXMwNZg.js";import{M as Ut}from"./mcp-app-renderer-CO8LOFxq.js";import{C as Ft}from"./collection-search-BXhJDy4i.js";import{B as Vt}from"./badge-2xhZ-r-l.js";import{S as fe,b as he,a as ge,d as je,c as q}from"./select-Di2sLm_-.js";import{i as Lt}from"./CheckCircle-By2z0uOx.js";import{t as Bt}from"./ChevronUp-BCfBdjs4.js";import{n as qt}from"./LinkBroken01-znJYLaVP.js";import{c as Gt}from"./UserSquare-Cbfe91aH.js";import{s as Ht}from"./XClose-p8-Q8v8l.js";import{p as Kt,i as Xt}from"./connection-BWg4pBgr.js";import{c as Qt}from"./schema-77LyfVRl.js";import"./metadata-D72DunRR.js";import"./Key01-By4BziN_.js";import"./auth-BsX6ur7b.js";import"./index-B5lnCLuB.js";import"./index-hZylT09v.js";import"./index-CmGLs6T5.js";import"./index-BdQq_4o_.js";import"./index-DuD6FLZ3.js";import"./popover-CE0A3Qit.js";import"./tooltip-BojzNY2M.js";import"./index-C9A_N0M0.js";import"./SearchMd-DqnvtcaB.js";import"./use-mobile-D6y1UaCv.js";import"./use-navigate-to-agent-DP0a6y9z.js";import"./thread-intent-C084ju5m.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-D3b7K3Uo.js";import"./task-board-BuKyXp11.js";import"./schema-C2e4bOOh.js";import"./AlertCircle-BMgOinVw.js";import"./ArrowUp-DcJMRdNb.js";import"./ArrowLeft-BJMjlG4g.js";import"./Globe04-ri2PR4JW.js";import"./ChevronSelectorVertical-BTg7xsL3.js";import"./CreditCard01-kxqKIkVq.js";import"./SwitchHorizontal01-D2vRhNhF.js";import"./Minus-Biy1YWEX.js";import"./Monitor01-DcAryzmn.js";import"./Sun-tnCpymBL.js";import"./Play-BkYxzt1r.js";import"./Upload01-DOAyGyLP.js";import"./Users01-C1OYrFY1.js";import"./Zap-DyRXLCnm.js";import"./label-CHRzCbuP.js";import"./CartesianChart-C8LrSJIS.js";import"./CategoricalChart-CUR_9ZiJ.js";import"./AreaChart-BcZi16Vr.js";import"./active-indicator-CCMhAsc_.js";import"./url-slug-BkV5QJiU.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(Q.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]=Q.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(Q.Suspense,{fallback:m,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"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]=Q.useState("");let g,j,N,_;if(e[7]!==f||e[8]!==d||e[9]!==l||e[10]!==o||e[11]!==m||e[12]!==i||e[13]!==n){const D=(n??[]).filter(fs),w=m.toLowerCase().trim(),$=w?D.filter(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(Q.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(X,{})]})}),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(X,{})]})}),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(X,{})]})}),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(X,{})]})})]}),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(X,{})]})})]}),(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(X,{})]})}),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(X,{})]})})]})}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"&&Xt(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=Qe(),x=Ae(),{org:f}=te(),m=wt({onSuccess:()=>{a.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Q.useState(null),[j,N]=Q.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(Qt),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(X,{})]})}),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(X,{})]})})]}),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]=Q.useState(null),m=u.find(A=>A.id===x)??u[0]??null;m&&m.id!==x&&f(m.id);const h=m?.id??"",g=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}=Xe($);let P;s[10]!==w?.prompts?(P=w?.prompts??[],s[10]=w?.prompts,s[11]=P):P=s[11];let T;s[12]!==P?(T=P.map(Ts),s[12]=P,s[13]=T):T=s[13];const S=T;let 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(Q.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 ai(){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{ai as default};
|
|
1
|
+
import{aF as Ne,e2 as Me,e0 as ze,aG as de,ba as Ee,c as U,b as V,j as t,h as Se,B,r as Q,m as ye,a5 as te,ak as Re,V as me,K as ee,d as se,C as _e,as as Ce,gw as Ue,bB as Fe,n as Ve,hr as ue,a4 as Le,I as J,_ as Be,X as qe,Z as Ge,Y as xe,R as He,f as Ke,hH as Xe,q as Qe,h6 as We,aE as Ye,aD as Je,o as Ze,t as Y}from"./index-Cvc22Qvh.js";import{g as et}from"./extract-connection-data-Pe-Tip3g.js";import{E as we}from"./empty-state-Drt9QRbX.js";import{E as tt,r as st,b as nt,c as it}from"./connection-form-helpers-CQaJSXmJ.js";import{c as ot,S as at,D as lt}from"./index-Dt7ZIwRY.js";import{u as ke,T as ct}from"./use-mcp-auth-status-DhFx8XVQ.js";import{a as rt}from"./mcp-oauth-DLwsgkOm.js";import{I as ae}from"./integration-icon-DMt85Vdd.js";import{s as dt}from"./Plus-Caq968Zm.js";import{bt as mt,aA as ut,au as xt,aB as ne}from"./agent-icon-DD6O0sln.js";import{a as Ie,e as pt,g as ft}from"./Tool01-GdBdG6P_.js";import{s as ce}from"./Trash01-DhMVlpac.js";import{b as ht,a as gt,c as jt,S as vt,d as bt}from"./sheet-BIQm-3An.js";import{F as G,b as H,c as K,d as L,f as X,e as pe,a as Nt}from"./form-CRja9i9j.js";import{a as Te,b as Ae,u as St}from"./use-connection-Dqyf1wn8.js";import{u as Pe}from"./use-mcp-client-BfCmeMHR.js";import{u as yt}from"./use-mcp-tools-DwTtnjNb.js";import{a as _t}from"./use-mcp-prompts-DoojBZhS.js";import{i as Ct}from"./mcp-oauth-C-i6IZ7F.js";import{u as wt,D as kt}from"./use-delete-connection-CLe-XFxn.js";import{c as It}from"./monitoring-stats-row-XSvwSWAi.js";import{c as Tt,b as At,C as Pt,a as Dt,B as $t}from"./chart-Ch4wXn1G.js";import{C as Ot}from"./tooltipContext-DdEokZtY.js";import{a as Mt}from"./repository-binding-B7A7NBUB.js";import{T as ie,a as zt,b as oe,c as Et}from"./tabs-D5AMuciq.js";import{g as De}from"./connection-slug-DREkgXeA.js";import{n as Rt}from"./ShoppingBag01-DUpALglE.js";import{g as re}from"./types-DKuFfsqr.js";import{M as Ut}from"./mcp-app-renderer-DeLjk14w.js";import{C as Ft}from"./collection-search-Lm88VC-w.js";import{B as Vt}from"./badge-9UZ-oy57.js";import{S as fe,b as he,a as ge,d as je,c as q}from"./select-GzsOSPza.js";import{i as Lt}from"./CheckCircle-Dycaqr3_.js";import{t as Bt}from"./ChevronUp-B0uKxpVg.js";import{n as qt}from"./LinkBroken01-CFo-1erV.js";import{c as Gt}from"./UserSquare-T5uOviXx.js";import{s as Ht}from"./XClose-NmocES7U.js";import{p as Kt,i as Xt}from"./connection-Brtus8mh.js";import{c as Qt}from"./schema-DHahXPsT.js";import"./metadata-D72DunRR.js";import"./Key01-KS2Cdqso.js";import"./auth-Dfx2bf9S.js";import"./index-Dw1u8oXT.js";import"./index-CZXPJi4-.js";import"./index-BW7-bbk0.js";import"./index-BdQq_4o_.js";import"./index-DQAtcq3Z.js";import"./popover-D5YX99Kp.js";import"./tooltip-C0GWPsi8.js";import"./index-LnWr599j.js";import"./SearchMd-BionSqTl.js";import"./use-mobile-C1stVK0E.js";import"./use-navigate-to-agent-D2d0cpFU.js";import"./thread-intent-Bs-Q7fma.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-BI4P-Lkx.js";import"./task-board-DN88kD7h.js";import"./schema-BH82js-o.js";import"./AlertCircle-Cwj2JDLb.js";import"./ArrowUp-zoWFBt83.js";import"./ArrowLeft-D6im8CSl.js";import"./Globe04-BLpPYUUd.js";import"./ChevronSelectorVertical-Cq__IjWt.js";import"./CreditCard01-CMHPxKus.js";import"./SwitchHorizontal01-Dghq_Bvd.js";import"./Minus-CR14C6Ew.js";import"./Monitor01-PjSuNm4O.js";import"./Sun-x19ShBxe.js";import"./Play-DAD0wkps.js";import"./Upload01-hsehoAUh.js";import"./Users01-DDaeVlhF.js";import"./Zap-aTbgq59l.js";import"./label-RB5C5N6z.js";import"./CartesianChart-CkRq1ukN.js";import"./CategoricalChart-CJyVrm-b.js";import"./AreaChart-M71cxP0N.js";import"./active-indicator-CCMhAsc_.js";import"./url-slug-5t39ocbn.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(Q.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]=Q.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(Q.Suspense,{fallback:m,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"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]=Q.useState("");let g,j,N,_;if(e[7]!==f||e[8]!==d||e[9]!==l||e[10]!==o||e[11]!==m||e[12]!==i||e[13]!==n){const D=(n??[]).filter(fs),w=m.toLowerCase().trim(),$=w?D.filter(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(Q.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(X,{})]})}),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(X,{})]})}),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(X,{})]})}),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(X,{})]})})]}),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(X,{})]})})]}),(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(X,{})]})}),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(X,{})]})})]})}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"&&Xt(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=Qe(),x=Ae(),{org:f}=te(),m=wt({onSuccess:()=>{a.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Q.useState(null),[j,N]=Q.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(Qt),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(X,{})]})}),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(X,{})]})})]}),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]=Q.useState(null),m=u.find(A=>A.id===x)??u[0]??null;m&&m.id!==x&&f(m.id);const h=m?.id??"",g=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}=Xe($);let P;s[10]!==w?.prompts?(P=w?.prompts??[],s[10]=w?.prompts,s[11]=P):P=s[11];let T;s[12]!==P?(T=P.map(Ts),s[12]=P,s[13]=T):T=s[13];const S=T;let 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(Q.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 ai(){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{ai 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-Cvc22Qvh.js";import{s as A}from"./Plus-Caq968Zm.js";import{s as H}from"./Trash01-DhMVlpac.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{v as e}from"./thread-intent-
|
|
1
|
+
import{v as e}from"./thread-intent-Bs-Q7fma.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,bj 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,a5 as Me,d as $e,u as ot,a as Oe,a4 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,d9 as gt,K as mt,gc as pt}from"./index-DGn-FPge.js";import{a as Fe,g as ft,e as ht}from"./extract-connection-data-KiTWYSx4.js";import{C as xt}from"./collection-display-button-BcvxnzA7.js";import{S as jt}from"./search-toggle-D227Ek9d.js";import{C as St}from"./collection-tabs-R5zZyWuQ.js";import{C as Ce,u as Ue,g as yt}from"./connection-card-D8rA98h7.js";import{E as Ct}from"./empty-state-BFLQtSFV.js";import{u as vt,D as bt}from"./use-delete-connection-CKqCkN-k.js";import{u as _t}from"./use-infinite-scroll-4LyFv3hi.js";import{u as Ve}from"./use-mobile-D6y1UaCv.js";import{g as ae}from"./connection-slug-xnxqKZgT.js";import{n as xe}from"./LinkBroken01-znJYLaVP.js";import{g as Dt,a as kt}from"./metadata-D72DunRR.js";import{D as Nt,a as Tt,c as At,b as wt,e as It,f as Pt,g as Mt}from"./drawer-BnPszJPZ.js";import{F as q,b as Q,c as J,d as Y,f as Z,a as De}from"./form-cx1UDyF2.js";import{S as $t,b as Ot,a as Ft,d as Ut,c as re}from"./select-Di2sLm_-.js";import{T as Vt}from"./textarea-HAezEU3R.js";import{b as ze,u as zt}from"./use-connection-BonBiP4H.js";import{m as Lt}from"./use-mcp-client-BeYM-3mp.js";import{a as Et}from"./repository-binding-DHN5ihZA.js";import{g as Bt}from"./types-CdXMwNZg.js";import{A as Kt,b$ as Ht,aA as Rt,bt as Wt,aB as Se}from"./agent-icon-FkFyvRCX.js";import{s as Le}from"./Plus-BhRQRaas.js";import{c as Xt}from"./UserSquare-Cbfe91aH.js";import{s as Ee}from"./XClose-p8-Q8v8l.js";import{s as Gt}from"./use-project-scope-BJA0ds2S.js";import{c as qt}from"./schema-77LyfVRl.js";import{i as fe,a as ke,E as Qt,p as Jt,b as Yt,c as Zt}from"./connection-form-helpers-CTdld_FZ.js";import{a as en}from"./authenticate-and-persist-oauth-Cu0VrSF5.js";import{I as tn}from"./integration-icon-BHx1ytyX.js";import{C as Be}from"./checkbox-LWvsDQWZ.js";import{a as nn}from"./SwitchHorizontal01-D2vRhNhF.js";import{s as Ke}from"./Tool01-B8q2F7hW.js";import{s as He}from"./Trash01-Ccl1EX2p.js";import"./connection-BWg4pBgr.js";import"./url-slug-BkV5QJiU.js";import"./ArrowUp-DcJMRdNb.js";import"./tooltip-BojzNY2M.js";import"./index-C9A_N0M0.js";import"./toggle-group-CFojpTQB.js";import"./active-indicator-CCMhAsc_.js";import"./badge-2xhZ-r-l.js";import"./SearchMd-DqnvtcaB.js";import"./icon-button-CmFwjZ_m.js";import"./useInfiniteQuery-CCkoNUSG.js";import"./infiniteQueryObserver-B_P9W4Zx.js";import"./thread-intent-C084ju5m.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-D3b7K3Uo.js";import"./task-board-BuKyXp11.js";import"./schema-C2e4bOOh.js";import"./label-CHRzCbuP.js";import"./index-BdQq_4o_.js";import"./ChevronUp-BCfBdjs4.js";import"./auth-BsX6ur7b.js";import"./AlertCircle-BMgOinVw.js";import"./ArrowLeft-BJMjlG4g.js";import"./ShoppingBag01-DYcJDT4V.js";import"./Globe04-ri2PR4JW.js";import"./CheckCircle-By2z0uOx.js";import"./ChevronSelectorVertical-BTg7xsL3.js";import"./CreditCard01-kxqKIkVq.js";import"./Key01-By4BziN_.js";import"./Minus-Biy1YWEX.js";import"./Monitor01-DcAryzmn.js";import"./Sun-tnCpymBL.js";import"./Play-BkYxzt1r.js";import"./Upload01-DOAyGyLP.js";import"./Users01-C1OYrFY1.js";import"./Zap-DyRXLCnm.js";import"./mcp-oauth-iB4K_uoY.js";import"./mcp-oauth-C-mc4e6m.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:O}=on(l),P=M;let k;return e[7]!==y||e[8]!==a||e[9]!==O||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:O},e[7]=y,e[8]=a,e[9]=O,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=Fe(n)??"",u=i.has(m),e[0]=i,e[1]=n,e[2]=m,e[3]=u):(m=e[2],u=e[3]);const a=u;let 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 O=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]!==O||e[37]!==k?($=t.jsx(Ce,{connection:M,fallbackIcon:I,onClick:O,headerActionsAlwaysVisible:!0,headerActions:k}),e[35]=M,e[36]=O,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 O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Ke,{size:16}),e[39]=O):O=e[39];let P;e[40]!==r?(P=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=P):P=e[41];let k;e[42]!==I||e[43]!==P?(k=t.jsxs(ie,{onClick:I,children:[O,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 O;e[39]!==I||e[40]!==S||e[41]!==v?(O=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[S,v,I]}),e[39]=I,e[40]=S,e[41]=v,e[42]=O):O=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==O?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:O}),e[43]=m,e[44]=n,e[45]=O,e[46]=P):P=e[46],P}function vn({listState:s,activeTab:e,typeFilter:n,statusFilter:g}){const o=ne(),{org:i}=Me(),l=dt(),r=$e(),{data:d}=Oe.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)),O=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 _=Fe(b);if(_&&x.has(_))return!1}return!0}):[],ee=e==="connected"||A?O:[],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)},F=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:F}),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}=Oe.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"})})},O=()=>{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}),O(),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&&O(),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=F=>{if(F&&(!B&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!ee&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!G&&F.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(b=>b.key)),ge=F.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 F=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",A,{shouldDirty:!0}),D(fe({uiType:F,connectionUrl:A})??ke({uiType:F,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(Ot,{children:t.jsx(Ft,{})})}),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 F=V.clipboardData.getData("text");F&&(V.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),$(F))},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 F=V.clipboardData.getData("text");F&&(V.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),$(F))},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 Bs(){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{Bs 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,bj 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,a5 as Me,d as $e,u as ot,a as Oe,a4 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,d9 as gt,K as mt,gc as pt}from"./index-Cvc22Qvh.js";import{a as Fe,g as ft,e as ht}from"./extract-connection-data-Pe-Tip3g.js";import{C as xt}from"./collection-display-button-CVOVdzmi.js";import{S as jt}from"./search-toggle-pLnMgrhP.js";import{C as St}from"./collection-tabs-BW9NTpao.js";import{C as Ce,u as Ue,g as yt}from"./connection-card-CSkWTxJN.js";import{E as Ct}from"./empty-state-Drt9QRbX.js";import{u as vt,D as bt}from"./use-delete-connection-CLe-XFxn.js";import{u as _t}from"./use-infinite-scroll-Ds1Wd1cw.js";import{u as Ve}from"./use-mobile-C1stVK0E.js";import{g as ae}from"./connection-slug-DREkgXeA.js";import{n as xe}from"./LinkBroken01-CFo-1erV.js";import{g as Dt,a as kt}from"./metadata-D72DunRR.js";import{D as Nt,a as Tt,c as At,b as wt,e as It,f as Pt,g as Mt}from"./drawer-Dijofbhl.js";import{F as q,b as Q,c as J,d as Y,f as Z,a as De}from"./form-CRja9i9j.js";import{S as $t,b as Ot,a as Ft,d as Ut,c as re}from"./select-GzsOSPza.js";import{T as Vt}from"./textarea-D7HQlMVo.js";import{b as ze,u as zt}from"./use-connection-Dqyf1wn8.js";import{m as Lt}from"./use-mcp-client-BfCmeMHR.js";import{a as Et}from"./repository-binding-B7A7NBUB.js";import{g as Bt}from"./types-DKuFfsqr.js";import{A as Kt,b$ as Ht,aA as Rt,bt as Wt,aB as Se}from"./agent-icon-DD6O0sln.js";import{s as Le}from"./Plus-Caq968Zm.js";import{c as Xt}from"./UserSquare-T5uOviXx.js";import{s as Ee}from"./XClose-NmocES7U.js";import{s as Gt}from"./use-project-scope-C0EKXyqg.js";import{c as qt}from"./schema-DHahXPsT.js";import{i as fe,a as ke,E as Qt,p as Jt,b as Yt,c as Zt}from"./connection-form-helpers-CQaJSXmJ.js";import{a as en}from"./authenticate-and-persist-oauth-EuyAX3Gy.js";import{I as tn}from"./integration-icon-DMt85Vdd.js";import{C as Be}from"./checkbox-bO8ZnM7n.js";import{a as nn}from"./SwitchHorizontal01-Dghq_Bvd.js";import{s as Ke}from"./Tool01-GdBdG6P_.js";import{s as He}from"./Trash01-DhMVlpac.js";import"./connection-Brtus8mh.js";import"./url-slug-5t39ocbn.js";import"./ArrowUp-zoWFBt83.js";import"./tooltip-C0GWPsi8.js";import"./index-LnWr599j.js";import"./toggle-group-BBgjmF6C.js";import"./active-indicator-CCMhAsc_.js";import"./badge-9UZ-oy57.js";import"./SearchMd-BionSqTl.js";import"./icon-button-BZ9f2Pt9.js";import"./useInfiniteQuery-P9--kf7E.js";import"./infiniteQueryObserver-CmujZk55.js";import"./thread-intent-Bs-Q7fma.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-BI4P-Lkx.js";import"./task-board-DN88kD7h.js";import"./schema-BH82js-o.js";import"./label-RB5C5N6z.js";import"./index-BdQq_4o_.js";import"./ChevronUp-B0uKxpVg.js";import"./auth-Dfx2bf9S.js";import"./AlertCircle-Cwj2JDLb.js";import"./ArrowLeft-D6im8CSl.js";import"./ShoppingBag01-DUpALglE.js";import"./Globe04-BLpPYUUd.js";import"./CheckCircle-Dycaqr3_.js";import"./ChevronSelectorVertical-Cq__IjWt.js";import"./CreditCard01-CMHPxKus.js";import"./Key01-KS2Cdqso.js";import"./Minus-CR14C6Ew.js";import"./Monitor01-PjSuNm4O.js";import"./Sun-x19ShBxe.js";import"./Play-DAD0wkps.js";import"./Upload01-hsehoAUh.js";import"./Users01-DDaeVlhF.js";import"./Zap-aTbgq59l.js";import"./mcp-oauth-DLwsgkOm.js";import"./mcp-oauth-C-i6IZ7F.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:O}=on(l),P=M;let k;return e[7]!==y||e[8]!==a||e[9]!==O||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:O},e[7]=y,e[8]=a,e[9]=O,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=Fe(n)??"",u=i.has(m),e[0]=i,e[1]=n,e[2]=m,e[3]=u):(m=e[2],u=e[3]);const a=u;let 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 O=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]!==O||e[37]!==k?($=t.jsx(Ce,{connection:M,fallbackIcon:I,onClick:O,headerActionsAlwaysVisible:!0,headerActions:k}),e[35]=M,e[36]=O,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 O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Ke,{size:16}),e[39]=O):O=e[39];let P;e[40]!==r?(P=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=P):P=e[41];let k;e[42]!==I||e[43]!==P?(k=t.jsxs(ie,{onClick:I,children:[O,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 O;e[39]!==I||e[40]!==S||e[41]!==v?(O=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[S,v,I]}),e[39]=I,e[40]=S,e[41]=v,e[42]=O):O=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==O?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:O}),e[43]=m,e[44]=n,e[45]=O,e[46]=P):P=e[46],P}function vn({listState:s,activeTab:e,typeFilter:n,statusFilter:g}){const o=ne(),{org:i}=Me(),l=dt(),r=$e(),{data:d}=Oe.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)),O=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 _=Fe(b);if(_&&x.has(_))return!1}return!0}):[],ee=e==="connected"||A?O:[],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)},F=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:F}),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}=Oe.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"})})},O=()=>{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}),O(),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&&O(),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=F=>{if(F&&(!B&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!ee&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!G&&F.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(b=>b.key)),ge=F.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 F=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",A,{shouldDirty:!0}),D(fe({uiType:F,connectionUrl:A})??ke({uiType:F,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(Ot,{children:t.jsx(Ft,{})})}),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 F=V.clipboardData.getData("text");F&&(V.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),$(F))},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 F=V.clipboardData.getData("text");F&&(V.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),$(F))},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 Bs(){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{Bs as default};
|