decocms 4.76.76 → 4.76.78
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-BVlB73Gd.js → AlertCircle-DBEuJvXd.js} +1 -1
- package/dist/client/assets/{AreaChart-C1SgmDdh.js → AreaChart-RJnPaDTO.js} +1 -1
- package/dist/client/assets/{ArrowUp-BcoNWaDn.js → ArrowUp-OqBYOpu3.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-COlnzfbE.js → ArrowUpRight-3xkp-kWm.js} +1 -1
- package/dist/client/assets/{Check-ylcp47jh.js → Check-Oxo5mPeL.js} +1 -1
- package/dist/client/assets/{CheckCircle-jaIqf58w.js → CheckCircle-DAvZWWWn.js} +1 -1
- package/dist/client/assets/{ChevronDown-DorDM-K-.js → ChevronDown-DCZlSvzQ.js} +1 -1
- package/dist/client/assets/{ChevronRight-NJ1RHqa7.js → ChevronRight-L_rxCnv3.js} +1 -1
- package/dist/client/assets/{ChevronUp-C85SxyPM.js → ChevronUp-BXrO8J56.js} +1 -1
- package/dist/client/assets/{Circle-BGJOKhru.js → Circle-DLL8alCD.js} +1 -1
- package/dist/client/assets/{Copy01-C5M0y3sD.js → Copy01-uwiMYWRU.js} +1 -1
- package/dist/client/assets/{DotsVertical-Ckk9mZsT.js → DotsVertical-B0IViKUD.js} +1 -1
- package/dist/client/assets/{Eye-ByzbJOuX.js → Eye-DVo1_Pm2.js} +1 -1
- package/dist/client/assets/{FilterLines-hGzDxUbQ.js → FilterLines-CAdlDh3I.js} +1 -1
- package/dist/client/assets/{Flag01-D6FA8Gqb.js → Flag01-fXAeu3l9.js} +1 -1
- package/dist/client/assets/{Globe01-DwjnaG3m.js → Globe01-By9gtoyg.js} +1 -1
- package/dist/client/assets/{Globe04-KMRfe3Ap.js → Globe04-uOyvHHk7.js} +1 -1
- package/dist/client/assets/{HardDrive-BLW7r-EP.js → HardDrive-D38nWE_J.js} +1 -1
- package/dist/client/assets/{Image01-DID7YK1H.js → Image01-B-uMMK1I.js} +1 -1
- package/dist/client/assets/{Key01-BNdv9d9e.js → Key01-ChBXFLCM.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DP-M8mno.js → LayoutLeft-DPtsS7J4.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CJELREUW.js → LinkExternal01-C3luIiQr.js} +1 -1
- package/dist/client/assets/{List-B6zsWjbc.js → List-CgvHjjyd.js} +1 -1
- package/dist/client/assets/{Monitor01-DGMiqS2G.js → Monitor01-BbnHlrzQ.js} +1 -1
- package/dist/client/assets/{Package-Cys9wdnk.js → Package-CJkGCd9M.js} +1 -1
- package/dist/client/assets/{Palette-CjpYx7Ii.js → Palette-Dem2eeFJ.js} +1 -1
- package/dist/client/assets/{Play-BIDZ3Qx4.js → Play-02R_l1hm.js} +1 -1
- package/dist/client/assets/{Plus-OGxa0fdn.js → Plus-D8fSfWhL.js} +1 -1
- package/dist/client/assets/{SearchLg-BkGBAC6u.js → SearchLg-BKY8fQrj.js} +1 -1
- package/dist/client/assets/{SearchMd-DhGVvJ2r.js → SearchMd-Di7fRkvt.js} +1 -1
- package/dist/client/assets/{Settings02-s4dN6VnR.js → Settings02-CJygIZBg.js} +1 -1
- package/dist/client/assets/{Shield01-C2gwqyT0.js → Shield01-bU8ewL-C.js} +1 -1
- package/dist/client/assets/{Star01-CdWOUCGL.js → Star01-CAO22TgC.js} +1 -1
- package/dist/client/assets/{Stars01-Ce7N7beA.js → Stars01-BbGPjqZd.js} +1 -1
- package/dist/client/assets/{Stars02-Brbdnmc2.js → Stars02-Bs0TEaNy.js} +1 -1
- package/dist/client/assets/{Sun-DrhefHVP.js → Sun-BZaKEOLT.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CQC-VHSM.js → SwitchHorizontal01-DqE-u_vC.js} +1 -1
- package/dist/client/assets/{Tool01-CQ5Yi4Y5.js → Tool01-DHJpebK1.js} +1 -1
- package/dist/client/assets/{Tool02-B5mtXP4w.js → Tool02-DlSNNbnL.js} +1 -1
- package/dist/client/assets/{Trash01-9Yhy1NDp.js → Trash01-BGwW4PUs.js} +1 -1
- package/dist/client/assets/{TrendUp01-CUYb4fKq.js → TrendUp01-Lnwj2rUh.js} +1 -1
- package/dist/client/assets/{Upload01-BGaIkl8C.js → Upload01-DVcY511n.js} +1 -1
- package/dist/client/assets/{User01-DY8EdPzH.js → User01-joygJQdk.js} +1 -1
- package/dist/client/assets/{UserPlus01-ByXfLuOW.js → UserPlus01-DvdLIpOn.js} +1 -1
- package/dist/client/assets/{Users01-DnUyZ4sc.js → Users01-BVTwFHJb.js} +1 -1
- package/dist/client/assets/{Users03-DQHSM-ip.js → Users03-FhX9tiey.js} +1 -1
- package/dist/client/assets/{X-8dZUy9dd.js → X-Bs0u_0yh.js} +1 -1
- package/dist/client/assets/{XCircle-DY5ehXOb.js → XCircle-DGorVz-d.js} +1 -1
- package/dist/client/assets/{XClose-IT2oT79e.js → XClose-hq2LkF75.js} +1 -1
- package/dist/client/assets/{Zap-UNZ6wjOU.js → Zap-CT4kcBoV.js} +1 -1
- package/dist/client/assets/{ZapSquare-CIT8HcpR.js → ZapSquare-DivgtbPr.js} +1 -1
- package/dist/client/assets/{ZoomOut-DoDMe5dD.js → ZoomOut-B2C9WPW-.js} +1 -1
- package/dist/client/assets/{access-gate-BjqlcKiO.js → access-gate-B4pZWmwl.js} +1 -1
- package/dist/client/assets/{add-section-modal-C8E813YY.js → add-section-modal-JBdSC8cO.js} +1 -1
- package/dist/client/assets/{agent-icon-DCK7PpQ3.js → agent-icon-Xdz_mRuJ.js} +1 -1
- package/dist/client/assets/{agents-list-Bwjyc61n.js → agents-list-2gWOzqrw.js} +1 -1
- package/dist/client/assets/{ai-providers-peEIA4y0.js → ai-providers-N4FbEwVk.js} +1 -1
- package/dist/client/assets/{alert-dialog-iGippWYX.js → alert-dialog-CWlVUd73.js} +1 -1
- package/dist/client/assets/{alert-CMPxdRHq.js → alert-j61mFoia.js} +1 -1
- package/dist/client/assets/{app-editor-CuUlGlJd.js → app-editor-BRpM18eX.js} +1 -1
- package/dist/client/assets/{auth-BBryGktV.js → auth-DDOP_TUe.js} +1 -1
- package/dist/client/assets/{auth-catchall-CVb1uch8.js → auth-catchall-B0LUMpZy.js} +1 -1
- package/dist/client/assets/{auth-entry-C6Y1Coh9.js → auth-entry-wtr1fLwN.js} +1 -1
- package/dist/client/assets/{auth-split-layout-C7bMt_tF.js → auth-split-layout-Bifmzv2W.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BVhm4ZHQ.js → authenticate-and-persist-oauth-BcKcvBur.js} +1 -1
- package/dist/client/assets/{automation-list-row-CW2Mr4ne.js → automation-list-row-CWbyvM3t.js} +1 -1
- package/dist/client/assets/{automation-runs-DtF_plhA.js → automation-runs-ewxrJgPk.js} +1 -1
- package/dist/client/assets/automations-C5v25H5e.js +1 -0
- package/dist/client/assets/{autosend-YOQ-CO-z.js → autosend-sntJRLit.js} +1 -1
- package/dist/client/assets/{avatar-6ZpKSJQ1.js → avatar-BumqAYVV.js} +1 -1
- package/dist/client/assets/{badge-Brm7dRFm.js → badge-DuwyDvgL.js} +1 -1
- package/dist/client/assets/{block-document-BE7E93rt.js → block-document-COkNQDU1.js} +1 -1
- package/dist/client/assets/{brand-context-CMCsnbCM.js → brand-context-DJ55kBWm.js} +1 -1
- package/dist/client/assets/{buckets-sTBT-mWR.js → buckets-CZaQ9-E2.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CnXvOLen.js → bulk-category-panel-C4UbsY4X.js} +1 -1
- package/dist/client/assets/{calendar-C8mrI2UH.js → calendar-Dpt7QB2d.js} +1 -1
- package/dist/client/assets/{capability-load-error-u8-vFMPG.js → capability-load-error-CVQ-0IvS.js} +1 -1
- package/dist/client/assets/{card-DmJEBNvh.js → card-whir3-TU.js} +1 -1
- package/dist/client/assets/{category-editor-BS7auS6b.js → category-editor-DSjyTevO.js} +1 -1
- package/dist/client/assets/{chat-context-DeX0VT17.js → chat-context-CZYpc7lP.js} +1 -1
- package/dist/client/assets/{checkbox-YjFOYgvp.js → checkbox-DbEZ6b_D.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CYFaZSY8.js → cli-auth-success-DhmnJDJJ.js} +1 -1
- package/dist/client/assets/{collection-detail-DM2ekT5E.js → collection-detail-B32MmFU7.js} +1 -1
- package/dist/client/assets/{collection-display-button-B5vJJ8M2.js → collection-display-button--OVhArve.js} +1 -1
- package/dist/client/assets/{collection-search-BebQySxJ.js → collection-search-26JlKJRJ.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D1lST78v.js → collection-table-wrapper-DPtPbXkO.js} +1 -1
- package/dist/client/assets/{collection-tabs-DhPjZGgE.js → collection-tabs-CMkX9SJV.js} +1 -1
- package/dist/client/assets/{command-DgNLNLpt.js → command-BoNCgAXF.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-Di2Fzvlr.js → commerce-onboarding-DbO5ycXJ.js} +1 -1
- package/dist/client/assets/{companions-core-BXSVQzy2.js → companions-core-C3l18hJe.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-BFe8wpxN.js → connect-desktop-dialog-DR3AZpl6.js} +1 -1
- package/dist/client/assets/{connection-card-B0Odymge.js → connection-card-ClbjHgoq.js} +1 -1
- package/dist/client/assets/{connection-detail-B00fRni_.js → connection-detail-B8ktqErv.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Cfzc9ntz.js → connection-form-helpers-CkjvvPa_.js} +1 -1
- package/dist/client/assets/{connections-CDGkbkgV.js → connections-BcUWe8c_.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DpwU6Fnw.js → decopilot-sse-pool-ByDpDqQ2.js} +1 -1
- package/dist/client/assets/{dialog-C6_0qLBU.js → dialog-hBUfi5DB.js} +1 -1
- package/dist/client/assets/{domain-settings-Bhf5R19l.js → domain-settings-DnawB_fV.js} +1 -1
- package/dist/client/assets/{drawer-BtRJAb0M.js → drawer-CrQJ-4Ry.js} +1 -1
- package/dist/client/assets/{dropdown-menu-96rpJkjm.js → dropdown-menu-BDW1EJyx.js} +1 -1
- package/dist/client/assets/{empty-state-jjn-bhGa.js → empty-state-LUctNkh2.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BKfZXo3n.js → extract-connection-data-BFgBaCrk.js} +1 -1
- package/dist/client/assets/{file-explorer-CeKeprFE.js → file-explorer-1FqRLQQ5.js} +1 -1
- package/dist/client/assets/{file-type-icon-cPIVgg9x.js → file-type-icon-CaoqUw2g.js} +1 -1
- package/dist/client/assets/{files-Bn3ru1FT.js → files-BpPo_clL.js} +1 -1
- package/dist/client/assets/{form-BLqlEubb.js → form-B8zhOVR3.js} +1 -1
- package/dist/client/assets/{general-CKz0uKhP.js → general-DxlJNW0F.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CiS_eOYq.js → github-repo-picker-D93GRlsF.js} +1 -1
- package/dist/client/assets/{hooks-B5swj9vo.js → hooks-DNLn_ut2.js} +1 -1
- package/dist/client/assets/{index-Dliz359x.js → index-BUTM8e7t.js} +1 -1
- package/dist/client/assets/{index-DPSWF_0V.js → index-CWrnaczo.js} +1 -1
- package/dist/client/assets/{index-CqkHhPgZ.js → index-Cag8mnTh.js} +1 -1
- package/dist/client/assets/{index-CM-AY9Fy.js → index-CdyljS_N.js} +1 -1
- package/dist/client/assets/{index-Bb3luPLV.js → index-DArYfizl.js} +1 -1
- package/dist/client/assets/{index-BUWOf6-H.js → index-DGQdC8j6.js} +3 -3
- package/dist/client/assets/{index-BYdleGn4.js → index-DTiOXvtP.js} +1 -1
- package/dist/client/assets/{index-C_fgqMB7.js → index-F-ZMCKP-.js} +2 -2
- package/dist/client/assets/{index-_AfOMAmM.js → index-MnX4iOa5.js} +1 -1
- package/dist/client/assets/{index-gNz_kq5D.js → index-gpoC3ssJ.js} +28 -28
- package/dist/client/assets/{index-CWxmaANj.js → index-ivY09p7e.js} +1 -1
- package/dist/client/assets/{index-BdUl5bJN.js → index-qg-bT8JA.js} +1 -1
- package/dist/client/assets/{index-redirect-CmPVrw8O.js → index-redirect-UnLDnJlQ.js} +1 -1
- package/dist/client/assets/{index-C9TMdwOy.js → index-sveg7vlb.js} +1 -1
- package/dist/client/assets/{index-Qvw8OnY1.js → index-vt02LGOF.js} +1 -1
- package/dist/client/assets/{input-C2XNQcRH.js → input-DwWe5Hqk.js} +1 -1
- package/dist/client/assets/{integration-icon-IezBYdjm.js → integration-icon-CfaWXLBn.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DdEYWFzF.js → invite-member-dialog-D3eUhcy1.js} +1 -1
- package/dist/client/assets/{label-CK1XiDPB.js → label-DdsuSm6M.js} +1 -1
- package/dist/client/assets/{layout-DdW7yJtW.js → layout-Bts6NJ_J.js} +1 -1
- package/dist/client/assets/{login-dKsCPJDm.js → login-Dd4NGdu8.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BtnOcT8N.js → mcp-oauth-SHxAJnkD.js} +1 -1
- package/dist/client/assets/{members-OHD_cH5V.js → members-6mHVnRNm.js} +1 -1
- package/dist/client/assets/{monaco-editor-45RX9-wa.js → monaco-editor-DGONpAoN.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Pf0PyiYb.js → monitoring-stats-row-CfSW2sgf.js} +1 -1
- package/dist/client/assets/{multi-select-B1IegP8Y.js → multi-select-CD32kF2s.js} +1 -1
- package/dist/client/assets/{oauth-callback-NJnfVzCp.js → oauth-callback-Bzq_-z2r.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CTrqu6Je.js → oauth-callback-ai-provider-DxKql_z0.js} +1 -1
- package/dist/client/assets/{onboarding-VNgiRiDL.js → onboarding-BwDunMKX.js} +1 -1
- package/dist/client/assets/{org-install-DH3udQUZ.js → org-install-BR62T5jO.js} +1 -1
- package/dist/client/assets/{org-layout-BwVt-wlI.js → org-layout-BHG4t6-u.js} +1 -1
- package/dist/client/assets/{organization-choice-CA519nnl.js → organization-choice-DlY0QjY5.js} +1 -1
- package/dist/client/assets/{orgs-CyzbToZq.js → orgs-Bsar34iG.js} +1 -1
- package/dist/client/assets/{page-seo-form-txb12Kn3.js → page-seo-form-D8JddRAG.js} +1 -1
- package/dist/client/assets/page-seo-sheet-CaWQpVxd.js +1 -0
- package/dist/client/assets/{popover-B2zk9niv.js → popover-BoSjy_J9.js} +1 -1
- package/dist/client/assets/{post-editor-DrrNmiiH.js → post-editor-BeOF_jnK.js} +1 -1
- package/dist/client/assets/{primitives-DlChEJzy.js → primitives-cDJctbRp.js} +1 -1
- package/dist/client/assets/{profile-Ds0StJLd.js → profile-BpIHCO3e.js} +1 -1
- package/dist/client/assets/project-app-view-CD4EGdca.js +1 -0
- package/dist/client/assets/record-editor-DpnQ11Qy.js +1 -0
- package/dist/client/assets/redirect-editor-DTyzzd3k.js +1 -0
- package/dist/client/assets/registry-B76hNPE7.js +2 -0
- package/dist/client/assets/{registry-layout-Dalyr-dX.js → registry-layout-BTDmQem2.js} +1 -1
- package/dist/client/assets/{reports-zmHYxym4.js → reports-rH-WO9Po.js} +1 -1
- package/dist/client/assets/{require-capability-qkGmH7NG.js → require-capability--U_vi60H.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DJSVKequ.js → required-auth-layout-B-_kB-P-.js} +1 -1
- package/dist/client/assets/{reset-password-BQvQW_Yc.js → reset-password-BbwEGkWF.js} +1 -1
- package/dist/client/assets/{roles-BO1zYp8H.js → roles-BRucDg6D.js} +1 -1
- package/dist/client/assets/{search-input-DoQewDAM.js → search-input-B0lumlG7.js} +1 -1
- package/dist/client/assets/{secrets-CwEm2qB4.js → secrets-Cx316kN4.js} +1 -1
- package/dist/client/assets/{sections-editor-CeZVcic7.js → sections-editor-DUBW607x.js} +1 -1
- package/dist/client/assets/{select-model-w8ZEBOqQ.js → select-model-BltF0usx.js} +1 -1
- package/dist/client/assets/{select-BVg_AKhS.js → select-vVirKMnE.js} +1 -1
- package/dist/client/assets/{self-tool-result-8XOi1iaO.js → self-tool-result-hAvB5Ojq.js} +1 -1
- package/dist/client/assets/{seo-editor-Ctu5yT8I.js → seo-editor-CWtXZnRQ.js} +1 -1
- package/dist/client/assets/{settings-layout-Dpo54nzI.js → settings-layout-Bew9lvu0.js} +1 -1
- package/dist/client/assets/{settings-section-Cd7MHbmE.js → settings-section-CvpT3RW4.js} +1 -1
- package/dist/client/assets/{shell-controls-IB_xzFFr.js → shell-controls-C-g_XIqJ.js} +1 -1
- package/dist/client/assets/{shell-layout-BDvpeGAX.js → shell-layout-b2wj0DO7.js} +1 -1
- package/dist/client/assets/{sidebar-Bg21lFNS.js → sidebar-C_llE2r0.js} +1 -1
- package/dist/client/assets/{skeleton-JjNP43lD.js → skeleton-CB7DUvyX.js} +1 -1
- package/dist/client/assets/{sso-C_5vX52P.js → sso-CUBuMbRD.js} +1 -1
- package/dist/client/assets/{store-DDBShmzT.js → store-B1pmnLUq.js} +1 -1
- package/dist/client/assets/store-registry-UxzRtugx.js +2 -0
- package/dist/client/assets/{studio-tools-JGMjsS9V.js → studio-tools-DII0jqi8.js} +1 -1
- package/dist/client/assets/{switch-Dbe5CgqQ.js → switch-DW7tjnTv.js} +1 -1
- package/dist/client/assets/{table-kChvW90I.js → table-DqN44BtI.js} +1 -1
- package/dist/client/assets/{tabs-D6exMqkv.js → tabs-DoePSWje.js} +1 -1
- package/dist/client/assets/{textarea-C-upgcvq.js → textarea-BH3kgWLk.js} +1 -1
- package/dist/client/assets/{toggle-group-CSfYzN1e.js → toggle-group-Dbv18C0K.js} +1 -1
- package/dist/client/assets/{toolbar-CdhDSP7U.js → toolbar-CFkubGs8.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button--2c5nPA5.js → toolbar-icon-button-B2gRcy3Z.js} +1 -1
- package/dist/client/assets/{tooltip-cXMPTvhQ.js → tooltip-CO1zVhUs.js} +1 -1
- package/dist/client/assets/{use-ai-providers-cFLtai6A.js → use-ai-providers-DuJIHuvT.js} +1 -1
- package/dist/client/assets/{use-automations-ljR2TnPA.js → use-automations-CjVm1klr.js} +1 -1
- package/dist/client/assets/{use-autosave-hI5b40ec.js → use-autosave-IhKsmyqJ.js} +1 -1
- package/dist/client/assets/{use-capability-BI2Ao-_m.js → use-capability-CEIYeJxR.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BJ7X5vRI.js → use-clock-tick-BDXFn1B6.js} +1 -1
- package/dist/client/assets/{use-collections-7ERyEkIU.js → use-collections-BqfJEMNR.js} +1 -1
- package/dist/client/assets/{use-connection-CD2Fnptb.js → use-connection-DM8eKjeN.js} +1 -1
- package/dist/client/assets/{use-copy-BhzNp8tf.js → use-copy-eCXRBbSs.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-C-AFRt9S.js → use-create-virtual-mcp-C4Sbw3ia.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CZ0xTx2w.js → use-debounced-autosave-DQFgMtID.js} +1 -1
- package/dist/client/assets/{use-debounced-value-B52whIH7.js → use-debounced-value-CMoeorqx.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Cfgq3ZjW.js → use-deco-credits-C0lExqRa.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BNjf3dpu.js → use-decopilot-events-qGOD1WG0.js} +1 -1
- package/dist/client/assets/{use-delete-connection-zsTP85HZ.js → use-delete-connection-BOFCmtMj.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-C6GJURpg.js → use-deployment-admin-Cwn49qZM.js} +1 -1
- package/dist/client/assets/{use-file-configs-1u4ZUq9F.js → use-file-configs-Nmeyll7B.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DiSaAQPl.js → use-infinite-scroll-DW-B2iyn.js} +1 -1
- package/dist/client/assets/{use-join-requests-U5r9xSzr.js → use-join-requests-Dz8x0kbW.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-dq4wRd85.js → use-mcp-auth-status-D-ki6Fzr.js} +1 -1
- package/dist/client/assets/{use-mcp-client-qnk43eG1.js → use-mcp-client-Csg0Ohl1.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-SncKc9ct.js → use-mcp-tools-DF4E3rLo.js} +1 -1
- package/dist/client/assets/{use-members-Dey3M7mC.js → use-members-B1t5oiJJ.js} +1 -1
- package/dist/client/assets/{use-mobile-oSorlQMv.js → use-mobile-DVuyUrh-.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-7gJqLFkE.js → use-navigate-to-agent-BL2c2hni.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-aAeyG-Cs.js → use-org-auth-client-dM7W8lCQ.js} +1 -1
- package/dist/client/assets/{use-org-sso-De26T__u.js → use-org-sso-w2vntLws.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DNlG9eUj.js → use-organization-roles-7B2EryzT.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DrhRsJWG.js → use-organization-settings-Dfv3IVMe.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CmItta1b.js → use-registry-connections-DMVj_IUs.js} +1 -1
- package/dist/client/assets/{use-secrets-DDzz0qxd.js → use-secrets-j8nq_pg4.js} +1 -1
- package/dist/client/assets/{use-status-sounds-4kB8txsU.js → use-status-sounds-CQv-RBYC.js} +1 -1
- package/dist/client/assets/{use-view-mode-CtgJ6di_.js → use-view-mode-DJr2m2Jz.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BJxeG1T-.js → use-virtual-mcp-6yApsgIW.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CzbwdXBh.js +1 -0
- package/dist/client/assets/{useRouterState-DRz1wrvb.js → useRouterState-D5zTQX9l.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-0mVVL1tH.js +1 -0
- package/dist/client/assets/{users-CUTUKT6m.js → users-Dji-ZHlw.js} +1 -1
- package/dist/client/assets/{variant-calendar-HHl2ENnf.js → variant-calendar-UBPoL6eu.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DqoxH_gE.js → view-mode-toggle-BxM9Rzzk.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/automations-TF-uE_JU.js +0 -1
- package/dist/client/assets/page-seo-sheet-B7-vAcY0.js +0 -1
- package/dist/client/assets/project-app-view-Dtfecj3R.js +0 -1
- package/dist/client/assets/record-editor-5g7SCJ1d.js +0 -1
- package/dist/client/assets/redirect-editor-BVp57v49.js +0 -1
- package/dist/client/assets/registry-ddiHAuZI.js +0 -2
- package/dist/client/assets/store-registry-D43DIoAy.js +0 -2
- package/dist/client/assets/useInfiniteQuery-C6UXsGIP.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cn5B2KcA.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as M,C as $,aY as L,K as k,l as w,j as I}from"./index-
|
|
1
|
+
import{c as M,C as $,aY as L,K as k,l as w,j as I}from"./index-DGQdC8j6.js";import{u as D}from"./use-registry-connections-DMVj_IUs.js";import{d as K}from"./use-organization-settings-Dfv3IVMe.js";import{S as E}from"./constants-D_FQAPnt.js";import{u as Q}from"./useInfiniteQuery-CzbwdXBh.js";import{c as F}from"./use-mcp-client-Csg0Ohl1.js";import{i as H,f as Y}from"./extract-connection-data-BFgBaCrk.js";import{r as q,R as G}from"./retry-CErkP7V6.js";import{g as T}from"./connection-slug-eyAPH6o3.js";import{C as U}from"./card-whir3-TU.js";import{I as V}from"./integration-icon-CfaWXLBn.js";function fe(){const s=M.c(6),e=D(),t=K(),a=$().project.enabledPlugins??[];let o;if(s[0]!==a||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),a.includes("private-registry")&&t(E)&&o.push({id:E,title:"Private Registry",icon:null}),s[0]=a,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const z=24,_=3;function A(s){return s.id.includes("community-registry")}function B(s){const e=s?.trim().split(/\s+/).filter(Boolean)??[];if(e.length===0)return;const t=[["title"],["description"],["name"],["server","title"]];return{operator:"or",conditions:e.flatMap(a=>t.map(o=>({field:o,operator:"contains",value:a})))}}function S(s,e,t,a,o){const l=s.map(u=>u.id).sort().join(","),r=B(o),{data:p,fetchNextPage:d,hasNextPage:m,isFetchingNextPage:g,isLoading:C}=Q({queryKey:k.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:u})=>{const n=u??{};return await Promise.all(s.map(async i=>{const h=n[i.id];if(h==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=H(i.id,e);try{return await q(async()=>{let f=null;try{f=await F({connectionId:i.id,orgId:e,orgSlug:t});const x={limit:z};h&&(x.cursor=h),r&&(x.where=r);const N=await f.callTool({name:j,arguments:x}),v=N.structuredContent??N,P=v.nextCursor||v.cursor||void 0,b=Y(v?[v]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:b,nextCursor:P}}finally{await f?.close().catch(()=>{})}},{maxAttempts:_,minTimeout:0,maxTimeout:1e3,jitter:0})}catch(f){return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${_} attempts:`,f instanceof G?f.cause:f),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}}))},initialPageParam:{},getNextPageParam:u=>{const n={};let c=!1;for(const i of u)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,c=!0):n[i.registryId]="EXHAUSTED");return c?n:void 0},staleTime:3600*1e3,placeholderData:L,retry:!1,enabled:s.length>0}),y=[];if(p?.pages)for(const u of p.pages)for(const n of u)for(const c of n.items)y.push({...c,_sourceName:c._sourceName??n.registryTitle,_sourceIcon:c._sourceIcon??n.registryIcon,_registryId:c._registryId??n.registryId});return{items:y,hasMore:m??!1,isLoadingMore:g,isInitialLoading:C,fetchNextPage:()=>{m&&!g&&d()}}}function me(s,e){const t=M.c(16),{org:a}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const p=r,d=S(l,a.id,a.slug,!0,e),m=S(p,a.id,a.slug,!0,e);let g;if(t[4]!==m.items||t[5]!==d.items){const h=new Set;g=[];const j=[...d.items,...m.items];for(const f of j){const x=`${f._registryId}:${f.id}`;h.has(x)||(h.add(x),g.push(f))}t[4]=m.items,t[5]=d.items,t[6]=g}else g=t[6];const C=d.isInitialLoading||m.isInitialLoading,y=d.isLoadingMore||m.isLoadingMore,u=d.hasMore||m.hasMore;let n;t[7]!==m||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),m.hasMore&&m.fetchNextPage()},t[7]=m,t[8]=d,t[9]=n):n=t[9];const c=n;let i;return t[10]!==u||t[11]!==C||t[12]!==y||t[13]!==g||t[14]!==c?(i={items:g,hasMore:u,isLoadingMore:y,isInitialLoading:C,loadMore:c},t[10]=u,t[11]=C,t[12]=y,t[13]=g,t[14]=c,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function de(s){const e=new Map;for(const o of s){const l=T(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],a=new Set;for(const o of s){const l=T(o);if(a.has(l))continue;a.add(l);const r=e.get(l),p=r[0];r.length===1?t.push({type:"single",connection:p}):t.push({type:"group",key:l,icon:p.icon,title:p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title,connections:r})}return t}function pe(s){const e=M.c(37),{connection:t,onClick:a,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:p,className:d,fallbackIcon:m}=s,g=l===void 0?!1:l,C=a&&"hover:bg-muted/50";let y;e[0]!==d||e[1]!==C?(y=w("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",C,d),e[0]=d,e[1]=C,e[2]=y):y=e[2];let u;e[3]!==t.icon||e[4]!==t.title||e[5]!==m?(u=I.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=t.icon,e[4]=t.title,e[5]=m,e[6]=u):u=e[6];let n;e[7]!==o||e[8]!==g?(n=o&&I.jsx("div",{className:w("transition-opacity",!g&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:O,children:o}),e[7]=o,e[8]=g,e[9]=n):n=e[9];let c;e[10]!==n?(c=I.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=c):c=e[11];let i;e[12]!==u||e[13]!==c?(i=I.jsxs("div",{className:"flex items-start justify-between",children:[u,c]}),e[12]=u,e[13]=c,e[14]=i):i=e[14];let h;e[15]!==t.title?(h=I.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=h):h=e[16];const j=t.description||"No description";let f;e[17]!==j?(f=I.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=f):f=e[18];let x;e[19]!==f||e[20]!==h?(x=I.jsxs("div",{className:"flex flex-col gap-1",children:[h,f]}),e[19]=f,e[20]=h,e[21]=x):x=e[21];let N;e[22]!==r?(N=r&&I.jsx("div",{children:r}),e[22]=r,e[23]=N):N=e[23];let v;e[24]!==x||e[25]!==N||e[26]!==i?(v=I.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,x,N]}),e[24]=x,e[25]=N,e[26]=i,e[27]=v):v=e[27];let P;e[28]!==p?(P=p&&I.jsx("div",{className:"border-t border-border mt-auto",children:I.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:J,children:p})}),e[28]=p,e[29]=P):P=e[29];let b;e[30]!==v||e[31]!==P?(b=I.jsxs("div",{className:"flex flex-col flex-1",children:[v,P]}),e[30]=v,e[31]=P,e[32]=b):b=e[32];let R;return e[33]!==a||e[34]!==b||e[35]!==y?(R=I.jsx(U,{className:y,onClick:a,children:b}),e[33]=a,e[34]=b,e[35]=y,e[36]=R):R=e[36],R}function J(s){return s.stopPropagation()}function O(s){return s.stopPropagation()}export{pe as C,me as a,de as g,fe as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as he,af as Ie,b3 as Ae,I as le,ad as $e,c as P,j as t,i as ge,B as V,r as G,l as je,C as J,v as De,K as ne,b as Y,aI as ce,z as Pe,b4 as Oe,E as Me,e as ze,b5 as Ee,n as Ve,M as Ue,J as Re,t as q,b6 as Fe}from"./index-BUWOf6-H.js";import{g as Le}from"./extract-connection-data-BKfZXo3n.js";import{E as ve}from"./empty-state-jjn-bhGa.js";import{E as He,c as Be,r as We,b as Xe,d as qe}from"./connection-form-helpers-Cfzc9ntz.js";import{c as Ge,S as Ke,V as Qe}from"./index-C9TMdwOy.js";import{u as be,T as Je}from"./use-mcp-auth-status-dq4wRd85.js";import{u as Ye}from"./use-members-Dey3M7mC.js";import{A as Ze}from"./avatar-6ZpKSJQ1.js";import{a as Ne,b as ye,u as et}from"./use-connection-CD2Fnptb.js";import{u as _e}from"./use-mcp-client-qnk43eG1.js";import{a as tt}from"./use-mcp-tools-SncKc9ct.js";import{c as st,C as nt,a as ot,d as it}from"./AreaChart-C1SgmDdh.js";import{i as rt,a as at}from"./mcp-oauth-BtnOcT8N.js";import{I as oe}from"./integration-icon-IezBYdjm.js";import{s as lt}from"./Plus-OGxa0fdn.js";import{J as ct,K as dt,ak as mt,ag as ut}from"./agent-icon-DCK7PpQ3.js";import{a as Ce,s as xt}from"./Settings02-s4dN6VnR.js";import{s as re}from"./Trash01-9Yhy1NDp.js";import{q as pt,p as ft,o as ht,m as gt,n as jt}from"./sidebar-Bg21lFNS.js";import{F as L,b as H,c as B,d as E,f as W,e as vt,a as bt}from"./form-BLqlEubb.js";import{I as X}from"./input-C2XNQcRH.js";import{u as Nt,D as yt}from"./use-delete-connection-zsTP85HZ.js";import{c as _t,B as Ct,a as St,C as wt}from"./monitoring-stats-row-Pf0PyiYb.js";import{u as kt}from"./studio-tools-JGMjsS9V.js";import{u as Tt}from"./use-virtual-mcp-BJxeG1T-.js";import{i as Se}from"./ChevronRight-NJ1RHqa7.js";import{a as we}from"./Users03-DQHSM-ip.js";import{b as ee,c as It,T as te,a as At}from"./tabs-D6exMqkv.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as $t}from"./ZapSquare-CIT8HcpR.js";import{c as Dt}from"./Tool01-CQ5Yi4Y5.js";import{g as ae,M as Pt}from"./index-Dliz359x.js";import{C as Ot}from"./collection-search-BebQySxJ.js";import{C as Mt}from"./card-DmJEBNvh.js";import{B as zt}from"./badge-Brm7dRFm.js";import{D as Et,a as Vt,c as Ut,d as de}from"./dropdown-menu-96rpJkjm.js";import{S as me,a as ue,b as xe,c as pe,d as F}from"./select-BVg_AKhS.js";import{i as Rt}from"./CheckCircle-jaIqf58w.js";import{t as Ft}from"./ChevronDown-DorDM-K-.js";import{n as Lt}from"./Tool02-B5mtXP4w.js";import{s as se}from"./Star01-CdWOUCGL.js";import{s as Ht}from"./XClose-IT2oT79e.js";import"./constants-D_FQAPnt.js";import"./index-BdUl5bJN.js";import"./ZoomOut-DoDMe5dD.js";import"./Key01-BNdv9d9e.js";import"./auth-BBryGktV.js";import"./use-registry-connections-CmItta1b.js";import"./use-organization-settings-DrhRsJWG.js";import"./index-CWxmaANj.js";import"./index-CqkHhPgZ.js";import"./popover-B2zk9niv.js";import"./tooltip-cXMPTvhQ.js";import"./Check-ylcp47jh.js";import"./SearchMd-DhGVvJ2r.js";import"./use-mobile-oSorlQMv.js";import"./use-create-virtual-mcp-C-AFRt9S.js";import"./use-navigate-to-agent-7gJqLFkE.js";import"./hooks-B5swj9vo.js";import"./decopilot-sse-pool-DpwU6Fnw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Eye-ByzbJOuX.js";import"./use-org-auth-client-aAeyG-Cs.js";import"./User01-DY8EdPzH.js";import"./use-collections-7ERyEkIU.js";import"./AlertCircle-BVlB73Gd.js";import"./UserPlus01-ByXfLuOW.js";import"./ArrowUp-BcoNWaDn.js";import"./XCircle-DY5ehXOb.js";import"./ArrowUpRight-COlnzfbE.js";import"./TrendUp01-CUYb4fKq.js";import"./ChevronUp-C85SxyPM.js";import"./Circle-BGJOKhru.js";import"./Stars02-Brbdnmc2.js";import"./Copy01-C5M0y3sD.js";import"./DotsVertical-Ckk9mZsT.js";import"./Globe01-DwjnaG3m.js";import"./FilterLines-hGzDxUbQ.js";import"./Flag01-D6FA8Gqb.js";import"./Globe04-KMRfe3Ap.js";import"./SwitchHorizontal01-CQC-VHSM.js";import"./HardDrive-BLW7r-EP.js";import"./Image01-DID7YK1H.js";import"./LayoutLeft-DP-M8mno.js";import"./LinkExternal01-CJELREUW.js";import"./List-B6zsWjbc.js";import"./Monitor01-DGMiqS2G.js";import"./Sun-DrhefHVP.js";import"./Package-Cys9wdnk.js";import"./Palette-CjpYx7Ii.js";import"./Play-BIDZ3Qx4.js";import"./SearchLg-BkGBAC6u.js";import"./Shield01-C2gwqyT0.js";import"./Stars01-Ce7N7beA.js";import"./Upload01-BGaIkl8C.js";import"./Users01-DnUyZ4sc.js";import"./X-8dZUy9dd.js";import"./Zap-UNZ6wjOU.js";import"./label-CK1XiDPB.js";import"./alert-dialog-iGippWYX.js";const Bt=he({scopes:$e(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:he({}),outputSchema:Bt}];function Xt(s){const e=P.c(46),{instance:n,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a}=s;let d;e[0]!==n.id?(d={connectionId:n.id},e[0]=n.id,e[1]=d):d=e[1];const l=be(d),x=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",c=x||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==c?(h=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",c),e[2]=c,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{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 v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==x?(b=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=x,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==x||e[18]!==r?(N=x&&t.jsx(V,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=x,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==a?(T=p?t.jsxs(V,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>a(n,"active"),children:[t.jsx(ct,{size:13}),"Enable"]}):t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>a(n,"inactive"),title:"Disable",children:t.jsx(dt,{size:13})}),e[20]=n,e[21]=p,e[22]=a,e[23]=T):T=e[23];let S;e[24]!==n||e[25]!==i?(S=()=>i(n),e[24]=n,e[25]=i,e[26]=S):S=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ce,{size:13}),e[27]=y):y=e[27];let I;e[28]!==S?(I=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:S,title:"Configure",children:y}),e[28]=S,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(re,{size:13}),e[33]=k):k=e[33];let C;e[34]!==_?(C=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=C):C=e[35];let f;e[36]!==I||e[37]!==C||e[38]!==N||e[39]!==T?(f=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,C]}),e[36]=I,e[37]=C,e[38]=N,e[39]=T,e[40]=f):f=e[40];let w;return e[41]!==f||e[42]!==h||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:h,children:[g,j,f]}),e[41]=f,e[42]=h,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function qt(s){const e=P.c(15),{instance:n,onConfigure:i}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=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]=o):o=e[4];let a;e[5]!==n||e[6]!==i?(a=()=>i(n),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:13}),e[8]=d):d=e[8];let l;e[9]!==a?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,title:"Configure",children:d})}),e[9]=a,e[10]=l):l=e[10];let u;return e[11]!==r||e[12]!==o||e[13]!==l?(u=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=u):u=e[14],u}function Gt(s){const e=P.c(27),{instances:n,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a,onAdd:d,isAdding:l}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let x;e[0]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=x):x=e[1];let p;e[2]!==l?(p=l?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(lt,{size:13}),e[2]=l,e[3]=p):p=e[3];let c;e[4]!==l||e[5]!==d||e[6]!==p?(c=t.jsxs(V,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:d,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=d,e[6]=p,e[7]=c):c=e[7];let h;e[8]!==x||e[9]!==c?(h=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,c]}),e[8]=x,e[9]=c,e[10]=h):h=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==o||e[15]!==a){let j;e[17]!==r||e[18]!==i||e[19]!==o||e[20]!==a?(j=N=>t.jsx(G.Suspense,{fallback:t.jsx(qt,{instance:N,onConfigure:i}),children:t.jsx(Xt,{instance:N,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a})},N.id),e[17]=r,e[18]=i,e[19]=o,e[20]=a,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=i,e[14]=o,e[15]=a,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==h||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[h,v]}),e[24]=h,e[25]=v,e[26]=b):b=e[26],b}function Kt(s,e=3){const n=new Map;for(const i of s){if(!i.isError)continue;const r=(i.errorMessage??"").trim()||"Unknown error";n.set(r,(n.get(r)??0)+1)}return[...n.entries()].map(([i,r])=>({message:i,count:r})).sort((i,r)=>r.count-i.count).slice(0,e)}const Qt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Jt(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 Yt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Zt(s){const e=P.c(1),{connectionId:n,orgId:i,timeframe:r}=s,o=kt(),a=Jt(r),{data:d}=De({queryKey:ne.connectionActivity(n,r,i),queryFn:async()=>await o.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),l=_t(d?.logs??[],a),u=l.data,x=l.totalCalls>0,p=Kt(d?.logs??[]),c=l.totalCalls>0?Math.round(l.totalErrors/l.totalCalls*100):0;let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[0]=h):h=e[0],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:l.totalCalls.toLocaleString()}),h]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),x?t.jsxs("div",{children:[t.jsx(st,{config:Yt,className:"h-16 w-full",children:t.jsxs(Ct,{data:u,barCategoryGap:"4%",children:[t.jsx(nt,{content:t.jsx(ot,{labelFormatter:ss}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(ts)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.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:"No activity in this period"})}),p.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:["Top errors",c>0?` · ${c}% of calls failed`:""]}),t.jsx("ul",{className:"space-y-1.5",children:p.map(es)})]})]})}function es(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 ts(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function ss(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ns(){const s=P.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 os(s){const e=P.c(13),{connectionId:n}=s,[i,r]=G.useState("14d"),{org:o}=J();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=a):a=e[0];let d;e[1]!==i?(d=Qt.map(c=>t.jsx("button",{type:"button",onClick:()=>r(c.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===c.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:c.label},c.value)),e[1]=i,e[2]=d):d=e[2];let l;e[3]!==d?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[a,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:d})]}),e[3]=d,e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ns,{}),e[5]=u):u=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==i?(x=t.jsx(G.Suspense,{fallback:u,children:t.jsx(Zt,{connectionId:n,orgId:o.id,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=i,e[9]=x):x=e[9];let p;return e[10]!==l||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,x]}),e[10]=l,e[11]=x,e[12]=p):p=e[12],p}function is(s){const e=P.c(15),{virtualMcp:n,org:i}=s,r=Y();let o;e[0]!==r||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{size:16}),e[4]=a):a=e[4];let d;e[5]!==n.icon||e[6]!==n.title?(d=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[5]=n.icon,e[6]=n.title,e[7]=d):d=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Se,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=u):u=e[10];let x;return e[11]!==o||e[12]!==d||e[13]!==l?(x=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[d,l,u]}),e[11]=o,e[12]=d,e[13]=l,e[14]=x):x=e[14],x}function rs(s){const e=P.c(7),{virtualMcps:n,org:i}=s;let r;if(e[0]!==i||e[1]!==n){let a;e[3]!==i?(a=d=>t.jsx(is,{virtualMcp:d,org:i},d.id),e[3]=i,e[4]=a):a=e[4],r=n.map(a),e[0]=i,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function as(s){const e=P.c(7),{connection:n}=s,{org:i}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=Tt(r);if(!(o.length>0)){let u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(t.Fragment,{}),e[2]=u):u=e[2],u}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(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:"Used by agents"})}),e[3]=d):d=e[3];let l;return e[4]!==i.slug||e[5]!==o?(l=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,t.jsx("div",{className:"px-5 py-4",children:t.jsx(rs,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=l):l=e[6],l}function ls(s){const e=P.c(31),{tools:n,connectionId:i,org:r}=s,o=Y(),{org:a}=J();let d;e[0]!==i||e[1]!==a.id||e[2]!==a.slug?(d={connectionId:i,orgId:a.id,orgSlug:a.slug},e[0]=i,e[1]=a.id,e[2]=a.slug,e[3]=d):d=e[3];const l=_e(d),u=Ne(i);let x;e[4]!==u||e[5]!==i?(x=u?ke(u):i,e[4]=u,e[5]=i,e[6]=x):x=e[6];const p=x,[c,h]=G.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==c||e[12]!==n){const S=(n??[]).filter(cs),y=c.toLowerCase().trim(),I=y?S.filter(f=>f.name.toLowerCase().includes(y)||f.description&&f.description.toLowerCase().includes(y)):S;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=f=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(f.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=f=>{f.key==="Escape"&&(h(""),f.target.blur())},e[21]=C):C=e[21],e[22]!==c?(j=t.jsx(Ot,{value:c,onChange:h,placeholder:"Search apps...",onKeyDown:C}),e[22]=c,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(ve,{image:null,title:c?"No apps found":"No apps available",description:c?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(f=>{const w=ae(f._meta);return t.jsxs(Mt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(f),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Pt,{resourceURI:w,toolInfo:{tool:f},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),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:f.name}),t.jsx(Je,{annotations:f.annotations,_meta:f._meta})]}),f.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:f.description})]})]},f.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=c,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function cs(s){return!!ae(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=a=>a.charAt(0).toUpperCase()+a.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&i.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function ds(s){const e=P.c(50),{tools:n,prompts:i,resources:r,connectionId:o,org:a}=s;let d;e[0]!==i?(d=i===void 0?[]:i,e[0]=i,e[1]=d):d=e[1];const l=d;let u;e[2]!==r?(u=r===void 0?[]:r,e[2]=r,e[3]=u):u=e[3];const x=u,p=Y(),c=Ne(o??"");let h;e[4]!==c||e[5]!==o?(h=c?ke(c):o,e[4]=c,e[5]=o,e[6]=h):h=e[6];const g=h;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==a?(v=function($){!o||!a||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:g,collectionName:"tools",itemId:encodeURIComponent($)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=a,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==a||e[14]!==n?(j=o&&a&&n.some(xs),e[12]=o,e[13]=a,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+x.length===0){let m;return e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=m):m=e[16],m}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==S||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(It,{variant:"underline",className:"gap-1",children:[S,y,I,_]})}),e[23]=S,e[24]=y,e[25]=k):k=e[25];let C;e[26]!==b||e[27]!==n?(C=n.length>0?n.map(m=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(m.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(Dt,{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:Te(m.name)}),m.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:m.description})]}),t.jsx(Se,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},m.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=C):C=e[28];let f;e[29]!==C?(f=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:C})}),e[29]=C,e[30]=f):f=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==a||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ls,{tools:n,connectionId:o,org:a})}),e[31]=o,e[32]=N,e[33]=a,e[34]=n,e[35]=w):w=e[35];let M;e[36]!==l?(M=l.length>0?l.map(us):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let A;e[40]!==x?(A=x.length>0?x.map(ms):t.jsx(ie,{label:"resources"}),e[40]=x,e[41]=A):A=e[41];let z;e[42]!==A?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=z):z=e[43];let U;return e[44]!==k||e[45]!==f||e[46]!==w||e[47]!==O||e[48]!==z?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(At,{defaultValue:"tools",variant:"underline",children:[k,f,w,O,z]})}),e[44]=k,e[45]=f,e[46]=w,e[47]=O,e[48]=z,e[49]=U):U=e[49],U}function ms(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(mt,{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 us(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($t,{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:Te(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 xs(s){return ae(s._meta)}function ps(s){const e=P.c(13),{connection:n,displayTitle:i}=s,r=i??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(oe,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let a;e[3]!==r?(a=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=a):a=e[4];let d;e[5]!==n.description?(d=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]=d):d=e[6];let l;e[7]!==a||e[8]!==d?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,d]}),e[7]=a,e[8]=d,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,l]}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function fs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),a=ce({control:s.control,name:"connection_url"}),{stdioEnabled:d}=Pe(),l=(()=>{if(typeof a!="string"||!a)return!1;try{const c=new URL(a);return c.hostname==="api.githubcopilot.com"&&c.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=d||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Oe(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:"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(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsxs(ue,{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(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(F,{value:"HTTP",children:"HTTP"}),t.jsx(F,{value:"SSE",children:"SSE"}),t.jsx(F,{value:"Websocket",children:"Websocket"}),u&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:"NPX Package"}),t.jsx(F,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(X,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(F,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(F,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(F,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(F,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(W,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(X,{placeholder:"@perplexity-ai/mcp-server",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(X,{placeholder:"node, bun, python...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(X,{placeholder:"arg1 arg2 --flag value",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(W,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(X,{placeholder:"/path/to/project (optional)",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(He,{value:c.value??[],onChange:c.onChange})}),t.jsx(W,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Vt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(zt,{variant:"success",className:"gap-1.5",children:[t.jsx(Rt,{size:12}),"Authenticated via OAuth",t.jsx(Ft,{size:12})]})})}),t.jsxs(Ut,{align:"start",children:[t.jsxs(de,{onClick:i,children:[t.jsx(xt,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(re,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&c.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:()=>c.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(X,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(vt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function hs(s){return s.command==="npx"}function gs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function js(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function fe(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"&&Fe(s.connection_headers)){const i=s.connection_headers,r=We(i.envVars);if(hs(i)){const a=gs(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=js(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}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 vs(s){let e,n=null,i=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=qe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function bs({connection:s,connectionId:e,org:n,isUpdating:i,tools:r,prompts:o,resources:a,siblings:d}){const l=Y({from:"/$org/settings/connections/$appSlug"}),u=Ve(),x=ye(),{org:p}=J(),c=Nt({onSuccess:()=>{d.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=G.useState(null),[v,b]=G.useState(!1),j=be({connectionId:e}),{data:N}=Ye(),T=N?.data?.members??[],S=h??s,y=T.find(m=>m.userId===S.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},C=Ge(k,Wt),f=Ue({resolver:Re(Be),values:fe(h??s)}),w=f.formState.isDirty,M=async()=>{if(!await f.trigger())return;const $=f.getValues(),D=vs($),R=h?.id??e;await x.update.mutateAsync({id:R,data:D}),f.reset($)},O=()=>{f.reset(fe(h??s))},A=async m=>{const{token:$,tokenInfo:D,error:R}=await at({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(R||!$){q.error(`Authentication failed: ${R}`);return}if(D)try{const K=await fetch(`/api/${p.slug}/connections/${m}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await x.update.mutateAsync({id:m,data:{connection_token:$}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await x.update.mutateAsync({id:m,data:{connection_token:$}})}else await x.update.mutateAsync({id:m,data:{connection_token:$}});const Q=new URL(`/api/${p.slug}/mcp/${m}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ne.mcpClientPrefix()}),q.success("Authentication successful")},z=()=>A(s.id),U=async()=>{try{const m=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const D=await m.text();q.error(`Failed to remove OAuth: ${D}`);return}const $=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated($.href,null)}),q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(yt,{...c}),t.jsx(pt,{open:h!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(ft,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(ht,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(gt,{className:"text-base",children:h?.title??s.title}),t.jsx(jt,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(bt,{...f,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(L,{control:f.control,name:"title",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Name"}),t.jsx(E,{children:t.jsx(X,{...m})}),t.jsx(W,{})]})}),t.jsx(L,{control:f.control,name:"description",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Description"}),t.jsx(E,{children:t.jsx(X,{...m,value:m.value||""})}),t.jsx(W,{})]})})]}),t.jsx(fs,{form:f,connection:h??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:U}),t.jsx(Ke,{connection:h??s,form:f,hasMcpBinding:C,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(V,{onClick:M,disabled:!w||i,className:"flex-1",children:i?"Saving…":"Save changes"}),w&&t.jsx(V,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(V,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=h??s;g(null),c.requestDelete(m)},children:[t.jsx(re,{size:15}),"Delete"]})]})]},h?.id??s.id)]})}),t.jsx(Qe,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(ps,{connection:s,displayTitle:(()=>{const m=d[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.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(os,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Gt,{instances:d,onConfigure:m=>g(m),onAuthenticate:m=>A(m.id),onDelete:m=>c.requestDelete(m),onToggleStatus:async(m,$)=>{try{await x.update.mutateAsync({id:m.id,data:{status:$}}),q.success($==="active"?"Connection enabled":"Connection disabled")}catch{q.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const m=d[0]??s,$=m.title.replace(/\s*\(\d+\)\s*$/,""),D=d.length+1,R=`${$} (${D})`,Q=Le("conn");await x.create.mutateAsync({id:Q,title:R,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await rt({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(as,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ds,{tools:r,prompts:o,resources:a,connectionId:e,org:n})})]})})]})})]})}function Ns(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:r,org:o}=ze(i),{org:a}=J(),d=ye();let l;s[2]!==r?(l={slug:r},s[2]=r,s[3]=l):l=s[3];const u=et(l),x=u[0]??null,p=x?.id??"",c=p||null;let h;s[4]!==a.id||s[5]!==a.slug||s[6]!==c?(h={connectionId:c,orgId:a.id,orgSlug:a.slug},s[4]=a.id,s[5]=a.slug,s[6]=c,s[7]=h):h=s[7];const g=_e(h);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=tt(v);let j;if(s[10]!==x?.tools||s[11]!==p||s[12]!==u||s[13]!==b){const A=b?b.tools.map(ks):(x?.tools??[]).map(ws);e:{if(u.length<=1){j=A;break e}const z=new Set,U=[],m=Cs;for(const $ of u){const D=$.id===p?A:m($.tools);for(const R of D)z.has(R.name)||(z.add(R.name),U.push(R))}j=U.length>0?U:A}s[10]=x?.tools,s[11]=p,s[12]=u,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:S}=it(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ee(y);let _;s[19]!==S?.prompts?(_=S?.prompts??[],s[19]=S?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(_s),s[21]=_,s[22]=k):k=s[22];const C=k;let f;s[23]!==I?.resources?(f=I?.resources??[],s[23]=I?.resources,s[24]=f):f=s[24];let w;s[25]!==f?(w=f.map(ys),s[25]=f,s[26]=w):w=s[26];const M=w;if(!x){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==d.update.isPending||s[31]!==N||s[32]!==x||s[33]!==p||s[34]!==o||s[35]!==C||s[36]!==M||s[37]!==u?(O=t.jsx(bs,{org:o,connection:x,connectionId:p,isUpdating:d.update.isPending,tools:N,prompts:C,resources:M,siblings:u}),s[30]=d.update.isPending,s[31]=N,s[32]=x,s[33]=p,s[34]=o,s[35]=C,s[36]=M,s[37]=u,s[38]=O):O=s[38],O}function ys(s){return{name:s.name,description:s.description,uri:s.uri}}function _s(s){return{name:s.name,description:s.description}}function Cs(s){return(s??[]).map(Ss)}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ks(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(G.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ns,{})})}),s[0]=e):e=s[0],e}function So(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ts,{}),s[0]=e):e=s[0],e}export{So as default};
|
|
1
|
+
import{H as he,af as Ie,b3 as Ae,I as le,ad as $e,c as P,j as t,i as ge,B as V,r as G,l as je,C as J,v as De,K as ne,b as Y,aI as ce,z as Pe,b4 as Oe,E as Me,e as ze,b5 as Ee,n as Ve,M as Ue,J as Re,t as q,b6 as Fe}from"./index-DGQdC8j6.js";import{g as Le}from"./extract-connection-data-BFgBaCrk.js";import{E as ve}from"./empty-state-LUctNkh2.js";import{E as He,c as Be,r as We,b as Xe,d as qe}from"./connection-form-helpers-CkjvvPa_.js";import{c as Ge,S as Ke,V as Qe}from"./index-sveg7vlb.js";import{u as be,T as Je}from"./use-mcp-auth-status-D-ki6Fzr.js";import{u as Ye}from"./use-members-B1t5oiJJ.js";import{A as Ze}from"./avatar-BumqAYVV.js";import{a as Ne,b as ye,u as et}from"./use-connection-DM8eKjeN.js";import{u as _e}from"./use-mcp-client-Csg0Ohl1.js";import{a as tt}from"./use-mcp-tools-DF4E3rLo.js";import{c as st,C as nt,a as ot,d as it}from"./AreaChart-RJnPaDTO.js";import{i as rt,a as at}from"./mcp-oauth-SHxAJnkD.js";import{I as oe}from"./integration-icon-CfaWXLBn.js";import{s as lt}from"./Plus-D8fSfWhL.js";import{J as ct,K as dt,ak as mt,ag as ut}from"./agent-icon-Xdz_mRuJ.js";import{a as Ce,s as xt}from"./Settings02-CJygIZBg.js";import{s as re}from"./Trash01-BGwW4PUs.js";import{q as pt,p as ft,o as ht,m as gt,n as jt}from"./sidebar-C_llE2r0.js";import{F as L,b as H,c as B,d as E,f as W,e as vt,a as bt}from"./form-B8zhOVR3.js";import{I as X}from"./input-DwWe5Hqk.js";import{u as Nt,D as yt}from"./use-delete-connection-BOFCmtMj.js";import{c as _t,B as Ct,a as St,C as wt}from"./monitoring-stats-row-CfSW2sgf.js";import{u as kt}from"./studio-tools-DII0jqi8.js";import{u as Tt}from"./use-virtual-mcp-6yApsgIW.js";import{i as Se}from"./ChevronRight-L_rxCnv3.js";import{a as we}from"./Users03-FhX9tiey.js";import{b as ee,c as It,T as te,a as At}from"./tabs-DoePSWje.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as $t}from"./ZapSquare-DivgtbPr.js";import{c as Dt}from"./Tool01-DHJpebK1.js";import{g as ae,M as Pt}from"./index-BUTM8e7t.js";import{C as Ot}from"./collection-search-26JlKJRJ.js";import{C as Mt}from"./card-whir3-TU.js";import{B as zt}from"./badge-DuwyDvgL.js";import{D as Et,a as Vt,c as Ut,d as de}from"./dropdown-menu-BDW1EJyx.js";import{S as me,a as ue,b as xe,c as pe,d as F}from"./select-vVirKMnE.js";import{i as Rt}from"./CheckCircle-DAvZWWWn.js";import{t as Ft}from"./ChevronDown-DCZlSvzQ.js";import{n as Lt}from"./Tool02-DlSNNbnL.js";import{s as se}from"./Star01-CAO22TgC.js";import{s as Ht}from"./XClose-hq2LkF75.js";import"./constants-D_FQAPnt.js";import"./index-qg-bT8JA.js";import"./ZoomOut-B2C9WPW-.js";import"./Key01-ChBXFLCM.js";import"./auth-DDOP_TUe.js";import"./use-registry-connections-DMVj_IUs.js";import"./use-organization-settings-Dfv3IVMe.js";import"./index-ivY09p7e.js";import"./index-Cag8mnTh.js";import"./popover-BoSjy_J9.js";import"./tooltip-CO1zVhUs.js";import"./Check-Oxo5mPeL.js";import"./SearchMd-Di7fRkvt.js";import"./use-mobile-DVuyUrh-.js";import"./use-create-virtual-mcp-C4Sbw3ia.js";import"./use-navigate-to-agent-BL2c2hni.js";import"./hooks-DNLn_ut2.js";import"./decopilot-sse-pool-ByDpDqQ2.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Eye-DVo1_Pm2.js";import"./use-org-auth-client-dM7W8lCQ.js";import"./User01-joygJQdk.js";import"./use-collections-BqfJEMNR.js";import"./AlertCircle-DBEuJvXd.js";import"./UserPlus01-DvdLIpOn.js";import"./ArrowUp-OqBYOpu3.js";import"./XCircle-DGorVz-d.js";import"./ArrowUpRight-3xkp-kWm.js";import"./TrendUp01-Lnwj2rUh.js";import"./ChevronUp-BXrO8J56.js";import"./Circle-DLL8alCD.js";import"./Stars02-Bs0TEaNy.js";import"./Copy01-uwiMYWRU.js";import"./DotsVertical-B0IViKUD.js";import"./Globe01-By9gtoyg.js";import"./FilterLines-CAdlDh3I.js";import"./Flag01-fXAeu3l9.js";import"./Globe04-uOyvHHk7.js";import"./SwitchHorizontal01-DqE-u_vC.js";import"./HardDrive-D38nWE_J.js";import"./Image01-B-uMMK1I.js";import"./LayoutLeft-DPtsS7J4.js";import"./LinkExternal01-C3luIiQr.js";import"./List-CgvHjjyd.js";import"./Monitor01-BbnHlrzQ.js";import"./Sun-BZaKEOLT.js";import"./Package-CJkGCd9M.js";import"./Palette-Dem2eeFJ.js";import"./Play-02R_l1hm.js";import"./SearchLg-BKY8fQrj.js";import"./Shield01-bU8ewL-C.js";import"./Stars01-BbGPjqZd.js";import"./Upload01-DVcY511n.js";import"./Users01-BVTwFHJb.js";import"./X-Bs0u_0yh.js";import"./Zap-CT4kcBoV.js";import"./label-DdsuSm6M.js";import"./alert-dialog-CWlVUd73.js";const Bt=he({scopes:$e(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:he({}),outputSchema:Bt}];function Xt(s){const e=P.c(46),{instance:n,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a}=s;let d;e[0]!==n.id?(d={connectionId:n.id},e[0]=n.id,e[1]=d):d=e[1];const l=be(d),x=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",c=x||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==c?(h=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",c),e[2]=c,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{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 v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==x?(b=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=x,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==x||e[18]!==r?(N=x&&t.jsx(V,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=x,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==a?(T=p?t.jsxs(V,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>a(n,"active"),children:[t.jsx(ct,{size:13}),"Enable"]}):t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>a(n,"inactive"),title:"Disable",children:t.jsx(dt,{size:13})}),e[20]=n,e[21]=p,e[22]=a,e[23]=T):T=e[23];let S;e[24]!==n||e[25]!==i?(S=()=>i(n),e[24]=n,e[25]=i,e[26]=S):S=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ce,{size:13}),e[27]=y):y=e[27];let I;e[28]!==S?(I=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:S,title:"Configure",children:y}),e[28]=S,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(re,{size:13}),e[33]=k):k=e[33];let C;e[34]!==_?(C=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=C):C=e[35];let f;e[36]!==I||e[37]!==C||e[38]!==N||e[39]!==T?(f=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,C]}),e[36]=I,e[37]=C,e[38]=N,e[39]=T,e[40]=f):f=e[40];let w;return e[41]!==f||e[42]!==h||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:h,children:[g,j,f]}),e[41]=f,e[42]=h,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function qt(s){const e=P.c(15),{instance:n,onConfigure:i}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=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]=o):o=e[4];let a;e[5]!==n||e[6]!==i?(a=()=>i(n),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:13}),e[8]=d):d=e[8];let l;e[9]!==a?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,title:"Configure",children:d})}),e[9]=a,e[10]=l):l=e[10];let u;return e[11]!==r||e[12]!==o||e[13]!==l?(u=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=u):u=e[14],u}function Gt(s){const e=P.c(27),{instances:n,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a,onAdd:d,isAdding:l}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let x;e[0]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=x):x=e[1];let p;e[2]!==l?(p=l?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(lt,{size:13}),e[2]=l,e[3]=p):p=e[3];let c;e[4]!==l||e[5]!==d||e[6]!==p?(c=t.jsxs(V,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:d,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=d,e[6]=p,e[7]=c):c=e[7];let h;e[8]!==x||e[9]!==c?(h=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,c]}),e[8]=x,e[9]=c,e[10]=h):h=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==o||e[15]!==a){let j;e[17]!==r||e[18]!==i||e[19]!==o||e[20]!==a?(j=N=>t.jsx(G.Suspense,{fallback:t.jsx(qt,{instance:N,onConfigure:i}),children:t.jsx(Xt,{instance:N,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a})},N.id),e[17]=r,e[18]=i,e[19]=o,e[20]=a,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=i,e[14]=o,e[15]=a,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==h||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[h,v]}),e[24]=h,e[25]=v,e[26]=b):b=e[26],b}function Kt(s,e=3){const n=new Map;for(const i of s){if(!i.isError)continue;const r=(i.errorMessage??"").trim()||"Unknown error";n.set(r,(n.get(r)??0)+1)}return[...n.entries()].map(([i,r])=>({message:i,count:r})).sort((i,r)=>r.count-i.count).slice(0,e)}const Qt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Jt(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 Yt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Zt(s){const e=P.c(1),{connectionId:n,orgId:i,timeframe:r}=s,o=kt(),a=Jt(r),{data:d}=De({queryKey:ne.connectionActivity(n,r,i),queryFn:async()=>await o.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),l=_t(d?.logs??[],a),u=l.data,x=l.totalCalls>0,p=Kt(d?.logs??[]),c=l.totalCalls>0?Math.round(l.totalErrors/l.totalCalls*100):0;let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[0]=h):h=e[0],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:l.totalCalls.toLocaleString()}),h]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),x?t.jsxs("div",{children:[t.jsx(st,{config:Yt,className:"h-16 w-full",children:t.jsxs(Ct,{data:u,barCategoryGap:"4%",children:[t.jsx(nt,{content:t.jsx(ot,{labelFormatter:ss}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(ts)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.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:"No activity in this period"})}),p.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:["Top errors",c>0?` · ${c}% of calls failed`:""]}),t.jsx("ul",{className:"space-y-1.5",children:p.map(es)})]})]})}function es(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 ts(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function ss(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ns(){const s=P.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 os(s){const e=P.c(13),{connectionId:n}=s,[i,r]=G.useState("14d"),{org:o}=J();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=a):a=e[0];let d;e[1]!==i?(d=Qt.map(c=>t.jsx("button",{type:"button",onClick:()=>r(c.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===c.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:c.label},c.value)),e[1]=i,e[2]=d):d=e[2];let l;e[3]!==d?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[a,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:d})]}),e[3]=d,e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ns,{}),e[5]=u):u=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==i?(x=t.jsx(G.Suspense,{fallback:u,children:t.jsx(Zt,{connectionId:n,orgId:o.id,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=i,e[9]=x):x=e[9];let p;return e[10]!==l||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,x]}),e[10]=l,e[11]=x,e[12]=p):p=e[12],p}function is(s){const e=P.c(15),{virtualMcp:n,org:i}=s,r=Y();let o;e[0]!==r||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{size:16}),e[4]=a):a=e[4];let d;e[5]!==n.icon||e[6]!==n.title?(d=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[5]=n.icon,e[6]=n.title,e[7]=d):d=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Se,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=u):u=e[10];let x;return e[11]!==o||e[12]!==d||e[13]!==l?(x=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[d,l,u]}),e[11]=o,e[12]=d,e[13]=l,e[14]=x):x=e[14],x}function rs(s){const e=P.c(7),{virtualMcps:n,org:i}=s;let r;if(e[0]!==i||e[1]!==n){let a;e[3]!==i?(a=d=>t.jsx(is,{virtualMcp:d,org:i},d.id),e[3]=i,e[4]=a):a=e[4],r=n.map(a),e[0]=i,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function as(s){const e=P.c(7),{connection:n}=s,{org:i}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=Tt(r);if(!(o.length>0)){let u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(t.Fragment,{}),e[2]=u):u=e[2],u}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(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:"Used by agents"})}),e[3]=d):d=e[3];let l;return e[4]!==i.slug||e[5]!==o?(l=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,t.jsx("div",{className:"px-5 py-4",children:t.jsx(rs,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=l):l=e[6],l}function ls(s){const e=P.c(31),{tools:n,connectionId:i,org:r}=s,o=Y(),{org:a}=J();let d;e[0]!==i||e[1]!==a.id||e[2]!==a.slug?(d={connectionId:i,orgId:a.id,orgSlug:a.slug},e[0]=i,e[1]=a.id,e[2]=a.slug,e[3]=d):d=e[3];const l=_e(d),u=Ne(i);let x;e[4]!==u||e[5]!==i?(x=u?ke(u):i,e[4]=u,e[5]=i,e[6]=x):x=e[6];const p=x,[c,h]=G.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==c||e[12]!==n){const S=(n??[]).filter(cs),y=c.toLowerCase().trim(),I=y?S.filter(f=>f.name.toLowerCase().includes(y)||f.description&&f.description.toLowerCase().includes(y)):S;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=f=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(f.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=f=>{f.key==="Escape"&&(h(""),f.target.blur())},e[21]=C):C=e[21],e[22]!==c?(j=t.jsx(Ot,{value:c,onChange:h,placeholder:"Search apps...",onKeyDown:C}),e[22]=c,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(ve,{image:null,title:c?"No apps found":"No apps available",description:c?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(f=>{const w=ae(f._meta);return t.jsxs(Mt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(f),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Pt,{resourceURI:w,toolInfo:{tool:f},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),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:f.name}),t.jsx(Je,{annotations:f.annotations,_meta:f._meta})]}),f.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:f.description})]})]},f.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=c,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function cs(s){return!!ae(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=a=>a.charAt(0).toUpperCase()+a.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&i.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function ds(s){const e=P.c(50),{tools:n,prompts:i,resources:r,connectionId:o,org:a}=s;let d;e[0]!==i?(d=i===void 0?[]:i,e[0]=i,e[1]=d):d=e[1];const l=d;let u;e[2]!==r?(u=r===void 0?[]:r,e[2]=r,e[3]=u):u=e[3];const x=u,p=Y(),c=Ne(o??"");let h;e[4]!==c||e[5]!==o?(h=c?ke(c):o,e[4]=c,e[5]=o,e[6]=h):h=e[6];const g=h;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==a?(v=function($){!o||!a||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:g,collectionName:"tools",itemId:encodeURIComponent($)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=a,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==a||e[14]!==n?(j=o&&a&&n.some(xs),e[12]=o,e[13]=a,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+x.length===0){let m;return e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=m):m=e[16],m}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==S||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(It,{variant:"underline",className:"gap-1",children:[S,y,I,_]})}),e[23]=S,e[24]=y,e[25]=k):k=e[25];let C;e[26]!==b||e[27]!==n?(C=n.length>0?n.map(m=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(m.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(Dt,{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:Te(m.name)}),m.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:m.description})]}),t.jsx(Se,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},m.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=C):C=e[28];let f;e[29]!==C?(f=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:C})}),e[29]=C,e[30]=f):f=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==a||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ls,{tools:n,connectionId:o,org:a})}),e[31]=o,e[32]=N,e[33]=a,e[34]=n,e[35]=w):w=e[35];let M;e[36]!==l?(M=l.length>0?l.map(us):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let A;e[40]!==x?(A=x.length>0?x.map(ms):t.jsx(ie,{label:"resources"}),e[40]=x,e[41]=A):A=e[41];let z;e[42]!==A?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=z):z=e[43];let U;return e[44]!==k||e[45]!==f||e[46]!==w||e[47]!==O||e[48]!==z?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(At,{defaultValue:"tools",variant:"underline",children:[k,f,w,O,z]})}),e[44]=k,e[45]=f,e[46]=w,e[47]=O,e[48]=z,e[49]=U):U=e[49],U}function ms(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(mt,{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 us(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($t,{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:Te(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 xs(s){return ae(s._meta)}function ps(s){const e=P.c(13),{connection:n,displayTitle:i}=s,r=i??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(oe,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let a;e[3]!==r?(a=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=a):a=e[4];let d;e[5]!==n.description?(d=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]=d):d=e[6];let l;e[7]!==a||e[8]!==d?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,d]}),e[7]=a,e[8]=d,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,l]}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function fs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),a=ce({control:s.control,name:"connection_url"}),{stdioEnabled:d}=Pe(),l=(()=>{if(typeof a!="string"||!a)return!1;try{const c=new URL(a);return c.hostname==="api.githubcopilot.com"&&c.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=d||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Oe(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:"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(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsxs(ue,{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(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(F,{value:"HTTP",children:"HTTP"}),t.jsx(F,{value:"SSE",children:"SSE"}),t.jsx(F,{value:"Websocket",children:"Websocket"}),u&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:"NPX Package"}),t.jsx(F,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(X,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(F,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(F,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(F,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(F,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(W,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(X,{placeholder:"@perplexity-ai/mcp-server",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(X,{placeholder:"node, bun, python...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(X,{placeholder:"arg1 arg2 --flag value",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(W,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(X,{placeholder:"/path/to/project (optional)",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(He,{value:c.value??[],onChange:c.onChange})}),t.jsx(W,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Vt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(zt,{variant:"success",className:"gap-1.5",children:[t.jsx(Rt,{size:12}),"Authenticated via OAuth",t.jsx(Ft,{size:12})]})})}),t.jsxs(Ut,{align:"start",children:[t.jsxs(de,{onClick:i,children:[t.jsx(xt,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(re,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&c.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:()=>c.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(X,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(vt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function hs(s){return s.command==="npx"}function gs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function js(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function fe(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"&&Fe(s.connection_headers)){const i=s.connection_headers,r=We(i.envVars);if(hs(i)){const a=gs(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=js(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}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 vs(s){let e,n=null,i=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=qe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function bs({connection:s,connectionId:e,org:n,isUpdating:i,tools:r,prompts:o,resources:a,siblings:d}){const l=Y({from:"/$org/settings/connections/$appSlug"}),u=Ve(),x=ye(),{org:p}=J(),c=Nt({onSuccess:()=>{d.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=G.useState(null),[v,b]=G.useState(!1),j=be({connectionId:e}),{data:N}=Ye(),T=N?.data?.members??[],S=h??s,y=T.find(m=>m.userId===S.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},C=Ge(k,Wt),f=Ue({resolver:Re(Be),values:fe(h??s)}),w=f.formState.isDirty,M=async()=>{if(!await f.trigger())return;const $=f.getValues(),D=vs($),R=h?.id??e;await x.update.mutateAsync({id:R,data:D}),f.reset($)},O=()=>{f.reset(fe(h??s))},A=async m=>{const{token:$,tokenInfo:D,error:R}=await at({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(R||!$){q.error(`Authentication failed: ${R}`);return}if(D)try{const K=await fetch(`/api/${p.slug}/connections/${m}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await x.update.mutateAsync({id:m,data:{connection_token:$}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await x.update.mutateAsync({id:m,data:{connection_token:$}})}else await x.update.mutateAsync({id:m,data:{connection_token:$}});const Q=new URL(`/api/${p.slug}/mcp/${m}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ne.mcpClientPrefix()}),q.success("Authentication successful")},z=()=>A(s.id),U=async()=>{try{const m=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const D=await m.text();q.error(`Failed to remove OAuth: ${D}`);return}const $=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated($.href,null)}),q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(yt,{...c}),t.jsx(pt,{open:h!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(ft,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(ht,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(gt,{className:"text-base",children:h?.title??s.title}),t.jsx(jt,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(bt,{...f,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(L,{control:f.control,name:"title",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Name"}),t.jsx(E,{children:t.jsx(X,{...m})}),t.jsx(W,{})]})}),t.jsx(L,{control:f.control,name:"description",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Description"}),t.jsx(E,{children:t.jsx(X,{...m,value:m.value||""})}),t.jsx(W,{})]})})]}),t.jsx(fs,{form:f,connection:h??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:U}),t.jsx(Ke,{connection:h??s,form:f,hasMcpBinding:C,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(V,{onClick:M,disabled:!w||i,className:"flex-1",children:i?"Saving…":"Save changes"}),w&&t.jsx(V,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(V,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=h??s;g(null),c.requestDelete(m)},children:[t.jsx(re,{size:15}),"Delete"]})]})]},h?.id??s.id)]})}),t.jsx(Qe,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(ps,{connection:s,displayTitle:(()=>{const m=d[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.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(os,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Gt,{instances:d,onConfigure:m=>g(m),onAuthenticate:m=>A(m.id),onDelete:m=>c.requestDelete(m),onToggleStatus:async(m,$)=>{try{await x.update.mutateAsync({id:m.id,data:{status:$}}),q.success($==="active"?"Connection enabled":"Connection disabled")}catch{q.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const m=d[0]??s,$=m.title.replace(/\s*\(\d+\)\s*$/,""),D=d.length+1,R=`${$} (${D})`,Q=Le("conn");await x.create.mutateAsync({id:Q,title:R,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await rt({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(as,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ds,{tools:r,prompts:o,resources:a,connectionId:e,org:n})})]})})]})})]})}function Ns(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:r,org:o}=ze(i),{org:a}=J(),d=ye();let l;s[2]!==r?(l={slug:r},s[2]=r,s[3]=l):l=s[3];const u=et(l),x=u[0]??null,p=x?.id??"",c=p||null;let h;s[4]!==a.id||s[5]!==a.slug||s[6]!==c?(h={connectionId:c,orgId:a.id,orgSlug:a.slug},s[4]=a.id,s[5]=a.slug,s[6]=c,s[7]=h):h=s[7];const g=_e(h);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=tt(v);let j;if(s[10]!==x?.tools||s[11]!==p||s[12]!==u||s[13]!==b){const A=b?b.tools.map(ks):(x?.tools??[]).map(ws);e:{if(u.length<=1){j=A;break e}const z=new Set,U=[],m=Cs;for(const $ of u){const D=$.id===p?A:m($.tools);for(const R of D)z.has(R.name)||(z.add(R.name),U.push(R))}j=U.length>0?U:A}s[10]=x?.tools,s[11]=p,s[12]=u,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:S}=it(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ee(y);let _;s[19]!==S?.prompts?(_=S?.prompts??[],s[19]=S?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(_s),s[21]=_,s[22]=k):k=s[22];const C=k;let f;s[23]!==I?.resources?(f=I?.resources??[],s[23]=I?.resources,s[24]=f):f=s[24];let w;s[25]!==f?(w=f.map(ys),s[25]=f,s[26]=w):w=s[26];const M=w;if(!x){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==d.update.isPending||s[31]!==N||s[32]!==x||s[33]!==p||s[34]!==o||s[35]!==C||s[36]!==M||s[37]!==u?(O=t.jsx(bs,{org:o,connection:x,connectionId:p,isUpdating:d.update.isPending,tools:N,prompts:C,resources:M,siblings:u}),s[30]=d.update.isPending,s[31]=N,s[32]=x,s[33]=p,s[34]=o,s[35]=C,s[36]=M,s[37]=u,s[38]=O):O=s[38],O}function ys(s){return{name:s.name,description:s.description,uri:s.uri}}function _s(s){return{name:s.name,description:s.description}}function Cs(s){return(s??[]).map(Ss)}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ks(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(G.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ns,{})})}),s[0]=e):e=s[0],e}function So(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ts,{}),s[0]=e):e=s[0],e}export{So as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as R,af as V,b3 as A,I as a,ad as j,ae as z,c as L,j as u,B as C}from"./index-
|
|
1
|
+
import{H as R,af as V,b3 as A,I as a,ad as j,ae as z,c as L,j as u,B as C}from"./index-DGQdC8j6.js";import{I as H}from"./input-DwWe5Hqk.js";import{s as W}from"./Plus-D8fSfWhL.js";import{s as q}from"./Trash01-BGwW4PUs.js";const K=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(K).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:V(a(),A()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(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 X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(q,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(W,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function I(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.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 Q(n,e){const t={command:"npx",args:["-y",n]},r=I(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=I(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,F as p,D as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as V,c as se,j as t,B as K,i as ae,p as te,l as de,E as Ye,C as be,b as _e,u as Ze,a as Ne,z as et,G as tt,D as nt,M as st,J as ot,n as it,t as R,K as rt}from"./index-BUWOf6-H.js";import{a as De,b as lt,g as ct,e as at}from"./extract-connection-data-BKfZXo3n.js";import{C as dt}from"./collection-display-button-B5vJJ8M2.js";import{S as mt}from"./search-input-DoQewDAM.js";import{C as ut}from"./collection-tabs-DhPjZGgE.js";import{C as Ce,u as pt,a as ke,g as ht}from"./connection-card-B0Odymge.js";import{E as gt}from"./empty-state-jjn-bhGa.js";import{P as ue}from"./index-BdUl5bJN.js";import{u as xt,D as ft}from"./use-delete-connection-zsTP85HZ.js";import{u as ye}from"./use-capability-BI2Ao-_m.js";import{u as jt}from"./use-infinite-scroll-DiSaAQPl.js";import{u as yt}from"./use-view-mode-CtgJ6di_.js";import{g as he}from"./connection-slug-eyAPH6o3.js";import{c as Ae,d as we,b as Te,A as Ie,e as Pe,g as $e,a as Oe,f as Le}from"./alert-dialog-iGippWYX.js";import{n as ge}from"./Tool02-B5mtXP4w.js";import{D as Fe,a as Me,h as ze,c as Ve,d as Ee,e as Be}from"./dialog-C6_0qLBU.js";import{D as Ct,a as vt,c as St,b as bt,d as _t,e as Nt,f as Dt}from"./drawer-BtRJAb0M.js";import{u as kt}from"./use-mobile-oSorlQMv.js";import{F as J,b as Q,c as Y,d as Z,f as ee,a as ve}from"./form-BLqlEubb.js";import{I as ie}from"./input-C2XNQcRH.js";import{S as At,a as wt,b as Tt,c as It,d as ce}from"./select-BVg_AKhS.js";import{T as Pt}from"./textarea-C-upgcvq.js";import{b as Ke,u as $t}from"./use-connection-CD2Fnptb.js";import{u as Ot}from"./use-virtual-mcp-BJxeG1T-.js";import{u as Lt}from"./studio-tools-JGMjsS9V.js";import{s as je}from"./Star01-CdWOUCGL.js";import{s as Ue}from"./Plus-OGxa0fdn.js";import{K as Ft,J as Mt,aj as zt,ag as Vt}from"./agent-icon-DCK7PpQ3.js";import{s as He}from"./XClose-IT2oT79e.js";import{i as pe,a as Se,E as Et,c as Bt,p as Kt,b as Ut,d as Ht}from"./connection-form-helpers-Cfzc9ntz.js";import{a as Rt}from"./authenticate-and-persist-oauth-BVhm4ZHQ.js";import{I as Wt}from"./integration-icon-IezBYdjm.js";import{C as Re}from"./checkbox-YjFOYgvp.js";import{d as re,a as We,D as Xe,c as qe}from"./dropdown-menu-96rpJkjm.js";import{i as Ge}from"./DotsVertical-Ckk9mZsT.js";import{s as Je}from"./Eye-ByzbJOuX.js";import{s as Qe}from"./Trash01-9Yhy1NDp.js";import"./use-mcp-client-qnk43eG1.js";import"./constants-D_FQAPnt.js";import"./auth-BBryGktV.js";import"./ArrowUp-BcoNWaDn.js";import"./Check-ylcp47jh.js";import"./SwitchHorizontal01-CQC-VHSM.js";import"./List-B6zsWjbc.js";import"./tooltip-cXMPTvhQ.js";import"./view-mode-toggle-DqoxH_gE.js";import"./badge-Brm7dRFm.js";import"./SearchMd-DhGVvJ2r.js";import"./use-registry-connections-CmItta1b.js";import"./use-organization-settings-DrhRsJWG.js";import"./useInfiniteQuery-C6UXsGIP.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./card-DmJEBNvh.js";import"./sidebar-Bg21lFNS.js";import"./LayoutLeft-DP-M8mno.js";import"./X-8dZUy9dd.js";import"./label-CK1XiDPB.js";import"./ChevronDown-DorDM-K-.js";import"./ChevronUp-C85SxyPM.js";import"./use-collections-7ERyEkIU.js";import"./AlertCircle-BVlB73Gd.js";import"./UserPlus01-ByXfLuOW.js";import"./Tool01-CQ5Yi4Y5.js";import"./Settings02-s4dN6VnR.js";import"./XCircle-DY5ehXOb.js";import"./ArrowUpRight-COlnzfbE.js";import"./TrendUp01-CUYb4fKq.js";import"./ZapSquare-CIT8HcpR.js";import"./ZoomOut-DoDMe5dD.js";import"./Users03-DQHSM-ip.js";import"./CheckCircle-jaIqf58w.js";import"./ChevronRight-NJ1RHqa7.js";import"./Circle-BGJOKhru.js";import"./Stars02-Brbdnmc2.js";import"./Copy01-C5M0y3sD.js";import"./Globe01-DwjnaG3m.js";import"./FilterLines-hGzDxUbQ.js";import"./Flag01-D6FA8Gqb.js";import"./Globe04-KMRfe3Ap.js";import"./HardDrive-BLW7r-EP.js";import"./Image01-DID7YK1H.js";import"./Key01-BNdv9d9e.js";import"./LinkExternal01-CJELREUW.js";import"./Monitor01-DGMiqS2G.js";import"./Sun-DrhefHVP.js";import"./Package-Cys9wdnk.js";import"./Palette-CjpYx7Ii.js";import"./Play-BIDZ3Qx4.js";import"./SearchLg-BkGBAC6u.js";import"./Shield01-C2gwqyT0.js";import"./Stars01-Ce7N7beA.js";import"./Upload01-BGaIkl8C.js";import"./User01-DY8EdPzH.js";import"./Users01-DnUyZ4sc.js";import"./Zap-UNZ6wjOU.js";import"./mcp-oauth-BtnOcT8N.js";function Xt(h){const e=`deco-filters-${h}`,[n,d]=V.useState(()=>{try{const s=globalThis.localStorage?.getItem(e);if(s)return JSON.parse(s)}catch(s){console.error("Failed to parse stored filters:",s)}return[]});return[n,s=>{d(s);try{globalThis.localStorage?.setItem(e,JSON.stringify(s))}catch(i){console.error("Failed to save filters:",i)}}]}function qt(h){const e=se.c(7),[n,d]=V.useState(h),[r,s]=V.useState(h?"desc":null);let i;e[0]!==r||e[1]!==n?(i=j=>{n!==j?(d(j),s("asc")):r==="asc"?s("desc"):r==="desc"&&(d(void 0),s(null))},e[0]=r,e[1]=n,e[2]=i):i=e[2];const m=i;let u;return e[3]!==m||e[4]!==r||e[5]!==n?(u={sortKey:n,sortDirection:r,handleSort:m},e[3]=m,e[4]=r,e[5]=n,e[6]=u):u=e[6],u}function Gt(h){const e=se.c(20),{namespace:n,resource:d,defaultSortKey:r,defaultViewMode:s}=h,i=r===void 0?"title":r,m=s===void 0?"table":s,[u,j]=V.useState(""),y=V.useDeferredValue(u),v=`${n}-${d}`,[N,l]=Xt(v),f=`mesh-${d}-filter-visible-${n}`;let c;e[0]!==f?(c=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=c):c=e[1];const[C,S]=V.useState(c);let b;e[2]!==f?(b=O=>{S(O),globalThis.localStorage?.setItem(f,String(O))},e[2]=f,e[3]=b):b=e[3];const T=b;let P;e[4]!==C||e[5]!==T?(P=()=>{T(!C)},e[4]=C,e[5]=T,e[6]=P):P=e[6];const o=P,[D,$]=yt(`mesh-${d}-${n}`,m),{sortKey:w,sortDirection:I,handleSort:L}=qt(i),M=w;let _;return e[7]!==C||e[8]!==N||e[9]!==L||e[10]!==u||e[11]!==y||e[12]!==T||e[13]!==l||e[14]!==$||e[15]!==I||e[16]!==M||e[17]!==o||e[18]!==D?(_={search:u,searchTerm:y,setSearch:j,filters:N,setFilters:l,filterBarVisible:C,setFilterBarVisible:T,toggleFilterBar:o,viewMode:D,setViewMode:$,sortKey:M,sortDirection:I,handleSort:L},e[7]=C,e[8]=N,e[9]=L,e[10]=u,e[11]=y,e[12]=T,e[13]=l,e[14]=$,e[15]=I,e[16]=M,e[17]=o,e[18]=D,e[19]=_):_=e[19],_}function Jt(h){const e=se.c(20),{open:n,onOpenChange:d,count:r,onConfirm:s}=h,i=r!==1?"s":"";let m;e[0]!==r||e[1]!==i?(m=t.jsxs(Ae,{children:["Delete ",r," connection",i,"?"]}),e[0]=r,e[1]=i,e[2]=m):m=e[2];const u=r!==1?"s":"";let j;e[3]!==u?(j=t.jsxs(we,{children:["This will permanently delete the selected connection",u,". This action cannot be undone."]}),e[3]=u,e[4]=j):j=e[4];let y;e[5]!==m||e[6]!==j?(y=t.jsxs(Te,{children:[m,j]}),e[5]=m,e[6]=j,e[7]=y):y=e[7];let v;e[8]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Ie,{children:"Cancel"}),e[8]=v):v=e[8];const N=r!==1?"s":"";let l;e[9]!==r||e[10]!==s||e[11]!==N?(l=t.jsxs(Pe,{children:[v,t.jsxs($e,{onClick:s,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",r," connection",N]})]}),e[9]=r,e[10]=s,e[11]=N,e[12]=l):l=e[12];let f;e[13]!==y||e[14]!==l?(f=t.jsxs(Oe,{children:[y,l]}),e[13]=y,e[14]=l,e[15]=f):f=e[15];let c;return e[16]!==d||e[17]!==n||e[18]!==f?(c=t.jsx(Le,{open:n,onOpenChange:d,children:f}),e[16]=d,e[17]=n,e[18]=f,e[19]=c):c=e[19],c}function Qt(h){return h._registryId?.includes("community-registry")===!0}function Yt(h){const e=se.c(58),{item:n,canManage:d,allConnections:r,connectedAppNames:s,connectingItemId:i,onNavigateConnected:m,onConnect:u}=h,[j,y]=V.useState(!1),[v,N]=V.useState(null);let l,f;e[0]!==s||e[1]!==n?(l=De(n)??"",f=s.has(l),e[0]=s,e[1]=n,e[2]=l,e[3]=f):(l=e[2],f=e[3]);const c=f,C=n._meta?.["mcp.mesh"],S=C?.friendlyName||C?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",b=n.server?.description||n.description||null;let T;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(T=n.server?.icons?.[0]?.src||lt(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=T):T=e[6];const P=T;let o;if(e[7]!==r||e[8]!==l){let A;e[10]!==l?(A=oe=>oe.connection_type!=="VIRTUAL"&&oe.app_name===l,e[10]=l,e[11]=A):A=e[11],o=r.filter(A),e[7]=r,e[8]=l,e[9]=o}else o=e[9];const D=o;let $;e[12]!==n?($=Qt(n),e[12]=n,e[13]=$):$=e[13];const w=$;let I,L;e[14]!==D||e[15]!==d||e[16]!==w||e[17]!==c||e[18]!==n||e[19]!==u||e[20]!==m?(I=()=>{if(c){const A=D[0];A&&m(A);return}d&&L()},L=()=>{w?(N("connect"),y(!0)):u(n)},e[14]=D,e[15]=d,e[16]=w,e[17]=c,e[18]=n,e[19]=u,e[20]=m,e[21]=I,e[22]=L):(I=e[21],L=e[22]);let M;e[23]!==n||e[24]!==u||e[25]!==v?(M=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),y(!1),v==="connect"&&u(n),N(null)},e[23]=n,e[24]=u,e[25]=v,e[26]=M):M=e[26];const _=M;let O;e[27]!==b||e[28]!==P||e[29]!==S?(O={title:S,description:b,icon:P},e[27]=b,e[28]=P,e[29]=S,e[30]=O):O=e[30];let q;e[31]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx(ge,{}),e[31]=q):q=e[31];let H;e[32]!==w||e[33]!==n._sourceIcon?(H=w&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=w,e[33]=n._sourceIcon,e[34]=H):H=e[34];let W;e[35]!==d||e[36]!==i||e[37]!==L||e[38]!==c||e[39]!==n.id?(W=c?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):d&&t.jsx(K,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i!==null,onClick:A=>{A.stopPropagation(),L()},children:i===n.id?t.jsx(ae,{size:14,className:"animate-spin"}):"Connect"}),e[35]=d,e[36]=i,e[37]=L,e[38]=c,e[39]=n.id,e[40]=W):W=e[40];let p;e[41]!==H||e[42]!==W?(p=t.jsxs("div",{className:"flex items-center gap-2",children:[H,W]}),e[41]=H,e[42]=W,e[43]=p):p=e[43];let k;e[44]!==I||e[45]!==p||e[46]!==O?(k=t.jsx(Ce,{connection:O,fallbackIcon:q,onClick:I,headerActionsAlwaysVisible:!0,headerActions:p}),e[44]=I,e[45]=p,e[46]=O,e[47]=k):k=e[47];let z;e[48]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsxs(Te,{children:[t.jsx(Ae,{children:"Community MCP Server"}),t.jsx(we,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=z):z=e[48];let U;e[49]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Ie,{children:"Cancel"}),e[49]=U):U=e[49];let E;e[50]!==_?(E=t.jsxs(Oe,{children:[z,t.jsxs(Pe,{children:[U,t.jsx($e,{onClick:_,children:"Continue"})]})]}),e[50]=_,e[51]=E):E=e[51];let g;e[52]!==j||e[53]!==E?(g=t.jsx(Le,{open:j,onOpenChange:y,children:E}),e[52]=j,e[53]=E,e[54]=g):g=e[54];let F;return e[55]!==k||e[56]!==g?(F=t.jsxs(t.Fragment,{children:[k,g]}),e[55]=k,e[56]=g,e[57]=F):F=e[57],F}function Zt(h){const e=se.c(51),{group:n,onOpen:d,selectionMode:r,selectedIds:s,onToggleSelect:i}=h;let m;if(e[0]!==n.connections||e[1]!==s){let _;e[3]!==s?(_=O=>s.has(O.id),e[3]=s,e[4]=_):_=e[4],m=n.connections.every(_),e[0]=n.connections,e[1]=s,e[2]=m}else m=e[2];const u=m;let j;if(e[5]!==n.connections||e[6]!==s){let _;e[8]!==s?(_=O=>s.has(O.id),e[8]=s,e[9]=_):_=e[9],j=n.connections.some(_),e[5]=n.connections,e[6]=s,e[7]=j}else j=e[7];const y=j,v=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==v?(N={title:n.title,icon:n.icon,description:v},e[10]=n.icon,e[11]=n.title,e[12]=v,e[13]=N):N=e[13];let l;e[14]!==u||e[15]!==n.connections||e[16]!==d||e[17]!==i||e[18]!==s||e[19]!==r?(l=()=>r?(()=>{for(const _ of n.connections)u?s.has(_.id)&&i(_.id):s.has(_.id)||i(_.id)})():d(),e[14]=u,e[15]=n.connections,e[16]=d,e[17]=i,e[18]=s,e[19]=r,e[20]=l):l=e[20];const f=r&&u&&"ring-2 ring-primary",c=r&&y&&!u&&"ring-1 ring-primary/50";let C;e[21]!==f||e[22]!==c?(C=de(f,c),e[21]=f,e[22]=c,e[23]=C):C=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(ge,{}),e[24]=S):S=e[24];let b;e[25]!==u||e[26]!==n.connections||e[27]!==i||e[28]!==s||e[29]!==r||e[30]!==y?(b=r?t.jsx(Re,{checked:u?!0:y?"indeterminate":!1,onCheckedChange:()=>{for(const _ of n.connections)u?s.has(_.id)&&i(_.id):s.has(_.id)||i(_.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=u,e[26]=n.connections,e[27]=i,e[28]=s,e[29]=r,e[30]=y,e[31]=b):b=e[31];const T=r?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let P;e[32]!==T?(P=de("overflow-hidden transition-all duration-150 ease-out",T),e[32]=T,e[33]=P):P=e[33];let o;e[34]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(We,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:tn,children:t.jsx(Ge,{size:20})})}),e[34]=o):o=e[34];let D;e[35]!==d?(D=_=>{_.stopPropagation(),d()},e[35]=d,e[36]=D):D=e[36];let $;e[37]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Je,{size:16}),e[37]=$):$=e[37];let w;e[38]!==D?(w=t.jsxs(Xe,{children:[o,t.jsx(qe,{align:"end",onClick:en,children:t.jsxs(re,{onClick:D,children:[$,"Open"]})})]}),e[38]=D,e[39]=w):w=e[39];let I;e[40]!==P||e[41]!==w?(I=t.jsx("div",{className:P,children:w}),e[40]=P,e[41]=w,e[42]=I):I=e[42];let L;e[43]!==b||e[44]!==I?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[b,I]}),e[43]=b,e[44]=I,e[45]=L):L=e[45];let M;return e[46]!==L||e[47]!==N||e[48]!==l||e[49]!==C?(M=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:N,onClick:l,className:C,fallbackIcon:S,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=l,e[49]=C,e[50]=M):M=e[50],M}function en(h){return h.stopPropagation()}function tn(h){return h.stopPropagation()}function nn(h){const e=se.c(34),{connection:n,isSelected:d,selectionMode:r,canManage:s,canManageAgents:i,onToggleSelect:m,onOpen:u,onToggleStatus:j,onDelete:y}=h;let v;e[0]!==d||e[1]!==m||e[2]!==r?(v=r?t.jsx(Re,{checked:d,onCheckedChange:m,onClick:rn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),e[0]=d,e[1]=m,e[2]=r,e[3]=v):v=e[3];const N=r?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let l;e[4]!==N?(l=de("overflow-hidden transition-all duration-150 ease-out",N),e[4]=N,e[5]=l):l=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(We,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:on,children:t.jsx(Ge,{size:20})})}),e[6]=f):f=e[6];let c;e[7]!==u?(c=w=>{w.stopPropagation(),u()},e[7]=u,e[8]=c):c=e[8];let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Je,{size:16}),e[9]=C):C=e[9];let S;e[10]!==c?(S=t.jsxs(re,{onClick:c,children:[C,"Open"]}),e[10]=c,e[11]=S):S=e[11];let b;e[12]!==s||e[13]!==i||e[14]!==m?(b=(s||i)&&t.jsxs(re,{onClick:w=>{w.stopPropagation(),m()},children:[t.jsx(zt,{size:16}),"Select"]}),e[12]=s,e[13]=i,e[14]=m,e[15]=b):b=e[15];let T;e[16]!==s||e[17]!==n||e[18]!==j?(T=s&&(n.status==="active"?t.jsxs(re,{onClick:w=>{w.stopPropagation(),j("inactive")},children:[t.jsx(Ft,{size:16}),"Disable"]}):t.jsxs(re,{onClick:w=>{w.stopPropagation(),j("active")},children:[t.jsx(Mt,{size:16}),"Enable"]})),e[16]=s,e[17]=n,e[18]=j,e[19]=T):T=e[19];let P;e[20]!==s||e[21]!==y?(P=s&&t.jsxs(re,{variant:"destructive",onClick:w=>{w.stopPropagation(),y()},children:[t.jsx(Qe,{size:16}),"Delete"]}),e[20]=s,e[21]=y,e[22]=P):P=e[22];let o;e[23]!==P||e[24]!==S||e[25]!==b||e[26]!==T?(o=t.jsxs(Xe,{children:[f,t.jsxs(qe,{align:"end",onClick:sn,children:[S,b,T,P]})]}),e[23]=P,e[24]=S,e[25]=b,e[26]=T,e[27]=o):o=e[27];let D;e[28]!==o||e[29]!==l?(D=t.jsx("div",{className:l,children:o}),e[28]=o,e[29]=l,e[30]=D):D=e[30];let $;return e[31]!==v||e[32]!==D?($=t.jsxs("div",{className:"flex items-center gap-1",children:[v,D]}),e[31]=v,e[32]=D,e[33]=$):$=e[33],$}function sn(h){return h.stopPropagation()}function on(h){return h.stopPropagation()}function rn(h){return h.stopPropagation()}function ln(h){const e=se.c(23),{count:n,total:d,canManage:r,canManageAgents:s,onSelectAll:i,onDeselectAll:m,onDelete:u,onAddToAgent:j,onToggleStatus:y,onCancel:v}=h;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let l;e[2]!==n||e[3]!==m||e[4]!==i||e[5]!==d?(l=n<d?t.jsxs(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:["Select all (",d,")"]}):t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:"Clear selection"}),e[2]=n,e[3]=m,e[4]=i,e[5]=d,e[6]=l):l=e[6];let f;e[7]!==s||e[8]!==j?(f=s&&t.jsxs(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:[t.jsx(Ue,{size:13}),"Add to Agent"]}),e[7]=s,e[8]=j,e[9]=f):f=e[9];let c;e[10]!==r||e[11]!==u||e[12]!==y?(c=r&&t.jsxs(t.Fragment,{children:[t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("active"),children:"Enable"}),t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("inactive"),children:"Disable"}),t.jsxs(K,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:[t.jsx(Qe,{size:13}),"Delete"]})]}),e[10]=r,e[11]=u,e[12]=y,e[13]=c):c=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(He,{size:13}),e[14]=C):C=e[14];let S;e[15]!==v?(S=t.jsx(K,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:v,children:C}),e[15]=v,e[16]=S):S=e[16];let b;return e[17]!==N||e[18]!==l||e[19]!==f||e[20]!==c||e[21]!==S?(b=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[N,l,f,c,S]})}),e[17]=N,e[18]=l,e[19]=f,e[20]=c,e[21]=S,e[22]=b):b=e[22],b}function cn(h){const e=se.c(25),{open:n,onOpenChange:d,agents:r,onConfirm:s}=h,[i,m]=V.useState(null);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs(Fe,{children:[t.jsx(Me,{children:"Add to Agent"}),t.jsx(ze,{children:"Select an agent to add the selected connections to."})]}),e[0]=u):u=e[0];let j;e[1]!==r||e[2]!==i?(j=r.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):r.map(b=>t.jsxs("button",{type:"button",onClick:()=>m(b.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===b.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Wt,{icon:b.icon,name:b.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:b.title}),b.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.description})]})]},b.id)),e[1]=r,e[2]=i,e[3]=j):j=e[3];let y;e[4]!==j?(y=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=y):y=e[5];let v;e[6]!==d?(v=t.jsx(K,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),e[6]=d,e[7]=v):v=e[7];const N=!i;let l;e[8]!==s||e[9]!==d||e[10]!==i?(l=()=>{i&&(s(i),d(!1),m(null))},e[8]=s,e[9]=d,e[10]=i,e[11]=l):l=e[11];let f;e[12]!==N||e[13]!==l?(f=t.jsx(K,{disabled:N,onClick:l,children:"Add"}),e[12]=N,e[13]=l,e[14]=f):f=e[14];let c;e[15]!==v||e[16]!==f?(c=t.jsxs(Ve,{children:[v,f]}),e[15]=v,e[16]=f,e[17]=c):c=e[17];let C;e[18]!==y||e[19]!==c?(C=t.jsxs(Ee,{className:"sm:max-w-[400px]",children:[u,y,c]}),e[18]=y,e[19]=c,e[20]=C):C=e[20];let S;return e[21]!==d||e[22]!==n||e[23]!==C?(S=t.jsx(Be,{open:n,onOpenChange:d,children:C}),e[21]=d,e[22]=n,e[23]=C,e[24]=S):S=e[24],S}function an({listState:h,activeTab:e,typeFilter:n,statusFilter:d,registryFilter:r,enabledRegistries:s}){const{org:i}=be(),m=it(),u=_e(),{data:j}=Ne.useSession(),y=Ke(),v=$t(h),N=xt(),{granted:l}=ye("connections:manage"),{granted:f}=ye("agents:manage"),[c,C]=V.useState(new Set),S=c.size>0,[b,T]=V.useState(!1),[P,o]=V.useState(!1),[D,$]=V.useState(null),w=Ot(),I=v.filter(a=>!(n!=="ALL"&&a.connection_type!==n||d!=="ALL"&&a.status!==d)),L=ht(I),M=a=>{C(x=>{const B=new Set(x);return B.has(a)?B.delete(a):B.add(a),B})},_=()=>{C(new Set)},O=ke(s,h.searchTerm),q=O.items,H=jt(O.loadMore,O.hasMore,O.isLoadingMore),W=new Set(v.filter(a=>a.app_name).map(a=>a.app_name)),p=r==="ALL"||s.some(a=>a.id===r)?r:"ALL",k=h.search.length>0,z=e==="all"||k?q.filter(a=>{if(p!=="ALL"&&a._registryId!==p)return!1;if(k){const x=De(a);if(x&&W.has(x))return!1}return!0}):[],U=e==="connected"||k?L:[],E=async a=>{if(!(!i||!j?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:a.id,source:"connections_page"}),$(a.id);try{const x=at(a,i.id,j.user.id,{remoteIndex:0}),B=x.connection_type==="STDIO",G=!!x.connection_url,X=B&&x.connection_headers&&typeof x.connection_headers=="object"&&"command"in x.connection_headers;if(!G&&!X){R.error("This MCP Server cannot be connected: no connection method available"),$(null);return}const{id:ne}=await y.create.mutateAsync(x),le=await Rt({connectionId:ne,orgId:i.id,orgSlug:i.slug,persistFallback:fe=>y.update.mutateAsync({id:ne,data:{connection_token:fe}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ne,flow:"connections_page_connect",error:le.error??"no_token"}),R.error(`Authentication failed: ${le.error??"no token received"}`);return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ne,flow:"connections_page_connect"});const fe=new URL(`/api/${i.slug}/mcp/${ne}`,window.location.origin);await m.invalidateQueries({queryKey:rt.isMCPAuthenticated(fe.href,null)}),F(),R.success("Authentication successful")}R.success("Connected successfully")}catch(x){R.error(`Failed to connect: ${x instanceof Error?x.message:String(x)}`)}finally{$(null)}}},g=Lt(),F=()=>{m.invalidateQueries({predicate:a=>{const x=a.queryKey;return x[1]===i.id&&x[3]==="collection"&&x[4]==="CONNECTIONS"}})},A=async()=>{T(!1);const a=[...c];te("connections_bulk_delete",{count:a.length});let x=0;for(const B of a)try{await g.call("COLLECTION_CONNECTIONS_DELETE",{id:B,force:!0}),x++}catch{}F(),R.success(`Deleted ${x} connection${x!==1?"s":""}`),_()},oe=async(a,x)=>{try{await y.update.mutateAsync({id:a,data:{status:x}}),F(),R.success(x==="active"?"Connection enabled":"Connection disabled")}catch{R.error("Failed to update connection")}},xe=async a=>{const x=[...c];te("connections_bulk_status_toggled",{count:x.length,to_status:a});let B=0;for(const G of x)try{await y.update.mutateAsync({id:G,data:{status:a}}),B++}catch{}F(),R.success(`${a==="active"?"Enabled":"Disabled"} ${B} connection${B!==1?"s":""}`),_()},me=async a=>{const x=w.find(X=>X.id===a);if(!x)return;te("connections_bulk_add_to_agent",{agent_id:a,count:c.size});const B=new Set(x.connections.map(X=>X.connection_id)),G=[...c].filter(X=>!B.has(X)).map(X=>({connection_id:X,selected_tools:null,selected_resources:null,selected_prompts:null}));if(G.length===0){R.info("All selected connections are already in that agent");return}try{await g.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:a,data:{connections:[...x.connections,...G]}}),m.invalidateQueries({predicate:X=>{const ne=X.queryKey;return ne[1]===i.id&&ne[3]==="collection"&&ne[4]==="VIRTUAL_MCP"}}),R.success(`Added ${G.length} connection${G.length!==1?"s":""} to "${x.title}"`),_()}catch{R.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(ft,{...N}),t.jsx(Jt,{open:b,onOpenChange:T,count:c.size,onConfirm:A}),t.jsx(cn,{open:P,onOpenChange:o,agents:w,onConfirm:me}),O.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(k?z.length===0&&I.length===0:e==="all"?z.length===0:I.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:h.search?`No Connections match "${h.search}"`:l?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[U.map(a=>{if(a.type==="group")return t.jsx(Zt,{group:a,onOpen:()=>{u({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:a.key}})},selectionMode:S,selectedIds:c,onToggleSelect:M},a.key);const x=a.connection,B=c.has(x.id);return t.jsx(Ce,{connection:x,fallbackIcon:t.jsx(ge,{}),onClick:()=>S?M(x.id):u({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(x)}}),className:de(B&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsx(nn,{connection:x,isSelected:B,selectionMode:S,canManage:l,canManageAgents:f,onToggleSelect:()=>M(x.id),onOpen:()=>u({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(x)}}),onToggleStatus:G=>oe(x.id,G),onDelete:()=>N.requestDelete(x)})},x.id)}),z.map(a=>t.jsx(Yt,{item:a,canManage:l,allConnections:v,connectedAppNames:W,connectingItemId:D,onNavigateConnected:x=>u({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(x)}}),onConnect:E},`catalog-${a._registryId}:${a.id}`)),(e==="all"||k)&&s.length>0&&t.jsx("div",{ref:H,className:"col-span-full h-4"}),(e==="all"||k)&&O.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ae,{size:24,className:"animate-spin text-muted-foreground"})})]})}),S&&t.jsx(ln,{count:c.size,total:I.length,canManage:l,canManageAgents:f,onSelectAll:()=>{C(new Set(I.map(a=>a.id)))},onDeselectAll:()=>C(new Set),onDelete:()=>T(!0),onAddToAgent:()=>o(!0),onToggleStatus:xe,onCancel:_})]})}function dn(){const{org:h}=be(),e=_e(),n=Ze({strict:!1}),{data:d}=Ne.useSession(),{stdioEnabled:r}=et(),s=kt(),{granted:i}=ye("connections:manage"),m=Gt({namespace:h.slug,resource:"connections"}),u=Ke(),[j,y]=tt(nt.connectionsTab(h.slug),p=>n.tab==="all"||n.tab==="connected"?n.tab:p??"all"),[v,N]=V.useState("ALL"),[l,f]=V.useState("ALL"),[c,C]=V.useState("ALL"),S=pt(),T=ke(S,m.searchTerm).items,P=m.search!==m.searchTerm,o=st({resolver:ot(Bt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),D=o.watch("ui_type"),$=o.watch("connection_url"),w=o.watch("npx_package"),I=pe({uiType:D,connectionUrl:$??"",npxPackage:w??""})??Se({uiType:D,connectionUrl:$??"",registryItems:T}),L=i&&n.action==="create",M=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:h.slug},search:{action:"create"}})},_=()=>{e({to:"/$org/settings/connections",params:{org:h.slug},search:{}})},O=async p=>{let k,z=null,U=null,E=null;p.ui_type==="NPX"?(k="STDIO",z="",E=Ut(p.npx_package||"",p.env_vars||[])):p.ui_type==="STDIO"?(k="STDIO",z="",E=Ht(p.stdio_command||"",p.stdio_args||"",p.stdio_cwd,p.env_vars||[])):(k=p.ui_type,z=p.connection_url||"",U=p.connection_token||null);const g=ct("conn");te("connection_custom_created",{connection_type:k,ui_type:p.ui_type}),await u.create.mutateAsync({id:g,title:p.title,description:p.description||null,connection_type:k,connection_url:z,connection_token:U,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:h.id,icon:p.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),_(),o.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:h.slug,appSlug:he({app_name:null,connection_url:z,title:p.title,id:g})}})},q=p=>{p||(L&&_(),o.reset())},H=p=>{const k=p.trim();if(!k)return;const z=!!o.formState.dirtyFields.title,U=!!o.formState.dirtyFields.description,E=!!o.formState.dirtyFields.env_vars,g=A=>{if(A&&(!z&&!o.getValues("title").trim()&&A.title&&o.setValue("title",A.title,{shouldDirty:!1}),!U&&!(o.getValues("description")??"").trim()&&A.description&&o.setValue("description",A.description,{shouldDirty:!1}),!E&&A.envVarKeys?.length)){const oe=o.getValues("env_vars")??[],xe=new Set(oe.map(a=>a.key)),me=A.envVarKeys.filter(a=>!xe.has(a));me.length>0&&o.setValue("env_vars",[...oe,...me.map(a=>({key:a,value:""}))],{shouldDirty:!0})}},F=Kt(k);if(F&&r){o.setValue("ui_type","NPX",{shouldDirty:!0}),o.setValue("npx_package",F.packageName,{shouldDirty:!0}),o.setValue("connection_url","",{shouldDirty:!0}),o.setValue("connection_token",null,{shouldDirty:!0}),g(pe({uiType:"NPX",npxPackage:F.packageName}));return}if(k.startsWith("http://")||k.startsWith("https://")){const A=D==="HTTP"||D==="SSE"||D==="Websocket"?D:"HTTP";o.setValue("ui_type",A,{shouldDirty:!0}),o.setValue("connection_url",k,{shouldDirty:!0}),g(pe({uiType:A,connectionUrl:k})??Se({uiType:A,connectionUrl:k,registryItems:T}));return}D==="NPX"&&g(pe({uiType:"NPX",npxPackage:k}))},W=i?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(K,{variant:"outline",onClick:M,children:[t.jsx(Ue,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(ue,{children:[(()=>{const p="Create Connection",k="Create a custom connection in your organization. Fill in the details below.",z=o.formState.isSubmitting?"Saving...":"Create Connection",U=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(J,{control:o.control,name:"ui_type",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Type *"}),t.jsxs(At,{value:g.value,onValueChange:g.onChange,children:[t.jsx(Z,{children:t.jsx(wt,{children:t.jsx(Tt,{})})}),t.jsxs(It,{children:[t.jsx(ce,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ce,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ce,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),r&&t.jsxs(t.Fragment,{children:[t.jsx(ce,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(ce,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Vt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),D==="NPX"&&t.jsx(J,{control:o.control,name:"npx_package",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...g,value:g.value??"",onPaste:F=>{const A=F.clipboardData.getData("text");A&&(F.preventDefault(),o.setValue("npx_package",A.trim(),{shouldDirty:!0}),H(A))},onBlur:F=>{H(F.target.value),g.onBlur()}})}),t.jsx(ee,{})]})}),D==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(J,{control:o.control,name:"stdio_command",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Command *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"node, bun, python...",...g,value:g.value??""})}),t.jsx(ee,{})]})}),t.jsx(J,{control:o.control,name:"stdio_args",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...g,value:g.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(J,{control:o.control,name:"stdio_cwd",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...g,value:g.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(D==="NPX"||D==="STDIO")&&t.jsx(J,{control:o.control,name:"env_vars",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Et,{value:g.value??[],onChange:g.onChange})}),t.jsx(ee,{})]})}),D!=="NPX"&&D!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(J,{control:o.control,name:"connection_url",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"URL *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...g,value:g.value??"",onPaste:F=>{const A=F.clipboardData.getData("text");A&&(F.preventDefault(),o.setValue("connection_url",A.trim(),{shouldDirty:!0}),H(A))},onBlur:F=>{H(F.target.value),g.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(J,{control:o.control,name:"connection_token",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:I?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:I?.token?.placeholder??"Bearer token or API key",...g,value:g.value??""})}),I?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[I.token.helperText,I.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:"Open GitHub PAT settings"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(J,{control:o.control,name:"title",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Name *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"My Connection",...g})}),t.jsx(ee,{})]})}),t.jsx(J,{control:o.control,name:"description",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Description"}),t.jsx(Z,{children:t.jsx(Pt,{placeholder:"A brief description of this connection",rows:3,...g,value:g.value??""})}),t.jsx(ee,{})]})})]}),E=L;return s?t.jsx(Ct,{open:E,onOpenChange:q,children:t.jsxs(vt,{className:"max-h-[90vh]",children:[t.jsx(St,{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(bt,{children:p}),t.jsx(_t,{className:"mt-1",children:k})]}),t.jsx(Nt,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(He,{size:16})})})]})}),t.jsx(ve,{...o,children:t.jsxs("form",{onSubmit:o.handleSubmit(O),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:U}),t.jsx(Dt,{children:t.jsx(K,{type:"submit",disabled:o.formState.isSubmitting,className:"w-full",children:z})})]})})]})}):t.jsx(Be,{open:E,onOpenChange:q,children:t.jsxs(Ee,{className:"sm:max-w-[525px]",children:[t.jsxs(Fe,{children:[t.jsx(Me,{children:p}),t.jsx(ze,{children:k})]}),t.jsx(ve,{...o,children:t.jsxs("form",{onSubmit:o.handleSubmit(O),children:[t.jsx("div",{className:"py-4",children:U}),t.jsxs(Ve,{children:[t.jsx(K,{type:"button",variant:"outline",onClick:()=>q(!1),children:"Cancel"}),t.jsx(K,{type:"submit",disabled:o.formState.isSubmitting,className:"min-w-40",children:z})]})]})})]})})})(),t.jsx(ue.Content,{children:t.jsx(ue.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ue.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(mt,{value:m.search,onChange:m.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:p=>{p.key==="Escape"&&(m.setSearch(""),p.target.blur())}}),t.jsx(dt,{sortKey:m.sortKey,sortDirection:m.sortDirection,onSort:m.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:v,onChange:p=>N(p||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:l,onChange:p=>f(p||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},...S.length>1?[{label:"Registry",value:c,onChange:p=>C(p||"ALL"),options:[{id:"ALL",label:"All registries"},...S.map(p=>({id:p.id,label:p.id.includes("community-registry")?"Community MCP Registry":p.title}))]}]:[]]})]}),W]}),t.jsx(ut,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:p=>{const k=p;k!==j&&te("connections_page_tab_changed",{to_tab:k}),y(k)}}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:P?.5:1,transition:P?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:P?"none":"auto"},children:t.jsx(an,{listState:m,activeTab:j,typeFilter:v,statusFilter:l,registryFilter:c,enabledRegistries:S})})})]})})})]})})}function to(){const h=se.c(1);let e;return h[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(dn,{})})}),h[0]=e):e=h[0],e}export{to as default};
|
|
1
|
+
import{r as V,c as se,j as t,B as K,i as ae,p as te,l as de,E as Ye,C as be,b as _e,u as Ze,a as Ne,z as et,G as tt,D as nt,M as st,J as ot,n as it,t as R,K as rt}from"./index-DGQdC8j6.js";import{a as De,b as lt,g as ct,e as at}from"./extract-connection-data-BFgBaCrk.js";import{C as dt}from"./collection-display-button--OVhArve.js";import{S as mt}from"./search-input-B0lumlG7.js";import{C as ut}from"./collection-tabs-CMkX9SJV.js";import{C as Ce,u as pt,a as ke,g as ht}from"./connection-card-ClbjHgoq.js";import{E as gt}from"./empty-state-LUctNkh2.js";import{P as ue}from"./index-qg-bT8JA.js";import{u as xt,D as ft}from"./use-delete-connection-BOFCmtMj.js";import{u as ye}from"./use-capability-CEIYeJxR.js";import{u as jt}from"./use-infinite-scroll-DW-B2iyn.js";import{u as yt}from"./use-view-mode-DJr2m2Jz.js";import{g as he}from"./connection-slug-eyAPH6o3.js";import{c as Ae,d as we,b as Te,A as Ie,e as Pe,g as $e,a as Oe,f as Le}from"./alert-dialog-CWlVUd73.js";import{n as ge}from"./Tool02-DlSNNbnL.js";import{D as Fe,a as Me,h as ze,c as Ve,d as Ee,e as Be}from"./dialog-hBUfi5DB.js";import{D as Ct,a as vt,c as St,b as bt,d as _t,e as Nt,f as Dt}from"./drawer-CrQJ-4Ry.js";import{u as kt}from"./use-mobile-DVuyUrh-.js";import{F as J,b as Q,c as Y,d as Z,f as ee,a as ve}from"./form-B8zhOVR3.js";import{I as ie}from"./input-DwWe5Hqk.js";import{S as At,a as wt,b as Tt,c as It,d as ce}from"./select-vVirKMnE.js";import{T as Pt}from"./textarea-BH3kgWLk.js";import{b as Ke,u as $t}from"./use-connection-DM8eKjeN.js";import{u as Ot}from"./use-virtual-mcp-6yApsgIW.js";import{u as Lt}from"./studio-tools-DII0jqi8.js";import{s as je}from"./Star01-CAO22TgC.js";import{s as Ue}from"./Plus-D8fSfWhL.js";import{K as Ft,J as Mt,aj as zt,ag as Vt}from"./agent-icon-Xdz_mRuJ.js";import{s as He}from"./XClose-hq2LkF75.js";import{i as pe,a as Se,E as Et,c as Bt,p as Kt,b as Ut,d as Ht}from"./connection-form-helpers-CkjvvPa_.js";import{a as Rt}from"./authenticate-and-persist-oauth-BcKcvBur.js";import{I as Wt}from"./integration-icon-CfaWXLBn.js";import{C as Re}from"./checkbox-DbEZ6b_D.js";import{d as re,a as We,D as Xe,c as qe}from"./dropdown-menu-BDW1EJyx.js";import{i as Ge}from"./DotsVertical-B0IViKUD.js";import{s as Je}from"./Eye-DVo1_Pm2.js";import{s as Qe}from"./Trash01-BGwW4PUs.js";import"./use-mcp-client-Csg0Ohl1.js";import"./constants-D_FQAPnt.js";import"./auth-DDOP_TUe.js";import"./ArrowUp-OqBYOpu3.js";import"./Check-Oxo5mPeL.js";import"./SwitchHorizontal01-DqE-u_vC.js";import"./List-CgvHjjyd.js";import"./tooltip-CO1zVhUs.js";import"./view-mode-toggle-BxM9Rzzk.js";import"./badge-DuwyDvgL.js";import"./SearchMd-Di7fRkvt.js";import"./use-registry-connections-DMVj_IUs.js";import"./use-organization-settings-Dfv3IVMe.js";import"./useInfiniteQuery-CzbwdXBh.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./card-whir3-TU.js";import"./sidebar-C_llE2r0.js";import"./LayoutLeft-DPtsS7J4.js";import"./X-Bs0u_0yh.js";import"./label-DdsuSm6M.js";import"./ChevronDown-DCZlSvzQ.js";import"./ChevronUp-BXrO8J56.js";import"./use-collections-BqfJEMNR.js";import"./AlertCircle-DBEuJvXd.js";import"./UserPlus01-DvdLIpOn.js";import"./Tool01-DHJpebK1.js";import"./Settings02-CJygIZBg.js";import"./XCircle-DGorVz-d.js";import"./ArrowUpRight-3xkp-kWm.js";import"./TrendUp01-Lnwj2rUh.js";import"./ZapSquare-DivgtbPr.js";import"./ZoomOut-B2C9WPW-.js";import"./Users03-FhX9tiey.js";import"./CheckCircle-DAvZWWWn.js";import"./ChevronRight-L_rxCnv3.js";import"./Circle-DLL8alCD.js";import"./Stars02-Bs0TEaNy.js";import"./Copy01-uwiMYWRU.js";import"./Globe01-By9gtoyg.js";import"./FilterLines-CAdlDh3I.js";import"./Flag01-fXAeu3l9.js";import"./Globe04-uOyvHHk7.js";import"./HardDrive-D38nWE_J.js";import"./Image01-B-uMMK1I.js";import"./Key01-ChBXFLCM.js";import"./LinkExternal01-C3luIiQr.js";import"./Monitor01-BbnHlrzQ.js";import"./Sun-BZaKEOLT.js";import"./Package-CJkGCd9M.js";import"./Palette-Dem2eeFJ.js";import"./Play-02R_l1hm.js";import"./SearchLg-BKY8fQrj.js";import"./Shield01-bU8ewL-C.js";import"./Stars01-BbGPjqZd.js";import"./Upload01-DVcY511n.js";import"./User01-joygJQdk.js";import"./Users01-BVTwFHJb.js";import"./Zap-CT4kcBoV.js";import"./mcp-oauth-SHxAJnkD.js";function Xt(h){const e=`deco-filters-${h}`,[n,d]=V.useState(()=>{try{const s=globalThis.localStorage?.getItem(e);if(s)return JSON.parse(s)}catch(s){console.error("Failed to parse stored filters:",s)}return[]});return[n,s=>{d(s);try{globalThis.localStorage?.setItem(e,JSON.stringify(s))}catch(i){console.error("Failed to save filters:",i)}}]}function qt(h){const e=se.c(7),[n,d]=V.useState(h),[r,s]=V.useState(h?"desc":null);let i;e[0]!==r||e[1]!==n?(i=j=>{n!==j?(d(j),s("asc")):r==="asc"?s("desc"):r==="desc"&&(d(void 0),s(null))},e[0]=r,e[1]=n,e[2]=i):i=e[2];const m=i;let u;return e[3]!==m||e[4]!==r||e[5]!==n?(u={sortKey:n,sortDirection:r,handleSort:m},e[3]=m,e[4]=r,e[5]=n,e[6]=u):u=e[6],u}function Gt(h){const e=se.c(20),{namespace:n,resource:d,defaultSortKey:r,defaultViewMode:s}=h,i=r===void 0?"title":r,m=s===void 0?"table":s,[u,j]=V.useState(""),y=V.useDeferredValue(u),v=`${n}-${d}`,[N,l]=Xt(v),f=`mesh-${d}-filter-visible-${n}`;let c;e[0]!==f?(c=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=c):c=e[1];const[C,S]=V.useState(c);let b;e[2]!==f?(b=O=>{S(O),globalThis.localStorage?.setItem(f,String(O))},e[2]=f,e[3]=b):b=e[3];const T=b;let P;e[4]!==C||e[5]!==T?(P=()=>{T(!C)},e[4]=C,e[5]=T,e[6]=P):P=e[6];const o=P,[D,$]=yt(`mesh-${d}-${n}`,m),{sortKey:w,sortDirection:I,handleSort:L}=qt(i),M=w;let _;return e[7]!==C||e[8]!==N||e[9]!==L||e[10]!==u||e[11]!==y||e[12]!==T||e[13]!==l||e[14]!==$||e[15]!==I||e[16]!==M||e[17]!==o||e[18]!==D?(_={search:u,searchTerm:y,setSearch:j,filters:N,setFilters:l,filterBarVisible:C,setFilterBarVisible:T,toggleFilterBar:o,viewMode:D,setViewMode:$,sortKey:M,sortDirection:I,handleSort:L},e[7]=C,e[8]=N,e[9]=L,e[10]=u,e[11]=y,e[12]=T,e[13]=l,e[14]=$,e[15]=I,e[16]=M,e[17]=o,e[18]=D,e[19]=_):_=e[19],_}function Jt(h){const e=se.c(20),{open:n,onOpenChange:d,count:r,onConfirm:s}=h,i=r!==1?"s":"";let m;e[0]!==r||e[1]!==i?(m=t.jsxs(Ae,{children:["Delete ",r," connection",i,"?"]}),e[0]=r,e[1]=i,e[2]=m):m=e[2];const u=r!==1?"s":"";let j;e[3]!==u?(j=t.jsxs(we,{children:["This will permanently delete the selected connection",u,". This action cannot be undone."]}),e[3]=u,e[4]=j):j=e[4];let y;e[5]!==m||e[6]!==j?(y=t.jsxs(Te,{children:[m,j]}),e[5]=m,e[6]=j,e[7]=y):y=e[7];let v;e[8]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Ie,{children:"Cancel"}),e[8]=v):v=e[8];const N=r!==1?"s":"";let l;e[9]!==r||e[10]!==s||e[11]!==N?(l=t.jsxs(Pe,{children:[v,t.jsxs($e,{onClick:s,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",r," connection",N]})]}),e[9]=r,e[10]=s,e[11]=N,e[12]=l):l=e[12];let f;e[13]!==y||e[14]!==l?(f=t.jsxs(Oe,{children:[y,l]}),e[13]=y,e[14]=l,e[15]=f):f=e[15];let c;return e[16]!==d||e[17]!==n||e[18]!==f?(c=t.jsx(Le,{open:n,onOpenChange:d,children:f}),e[16]=d,e[17]=n,e[18]=f,e[19]=c):c=e[19],c}function Qt(h){return h._registryId?.includes("community-registry")===!0}function Yt(h){const e=se.c(58),{item:n,canManage:d,allConnections:r,connectedAppNames:s,connectingItemId:i,onNavigateConnected:m,onConnect:u}=h,[j,y]=V.useState(!1),[v,N]=V.useState(null);let l,f;e[0]!==s||e[1]!==n?(l=De(n)??"",f=s.has(l),e[0]=s,e[1]=n,e[2]=l,e[3]=f):(l=e[2],f=e[3]);const c=f,C=n._meta?.["mcp.mesh"],S=C?.friendlyName||C?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",b=n.server?.description||n.description||null;let T;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(T=n.server?.icons?.[0]?.src||lt(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=T):T=e[6];const P=T;let o;if(e[7]!==r||e[8]!==l){let A;e[10]!==l?(A=oe=>oe.connection_type!=="VIRTUAL"&&oe.app_name===l,e[10]=l,e[11]=A):A=e[11],o=r.filter(A),e[7]=r,e[8]=l,e[9]=o}else o=e[9];const D=o;let $;e[12]!==n?($=Qt(n),e[12]=n,e[13]=$):$=e[13];const w=$;let I,L;e[14]!==D||e[15]!==d||e[16]!==w||e[17]!==c||e[18]!==n||e[19]!==u||e[20]!==m?(I=()=>{if(c){const A=D[0];A&&m(A);return}d&&L()},L=()=>{w?(N("connect"),y(!0)):u(n)},e[14]=D,e[15]=d,e[16]=w,e[17]=c,e[18]=n,e[19]=u,e[20]=m,e[21]=I,e[22]=L):(I=e[21],L=e[22]);let M;e[23]!==n||e[24]!==u||e[25]!==v?(M=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),y(!1),v==="connect"&&u(n),N(null)},e[23]=n,e[24]=u,e[25]=v,e[26]=M):M=e[26];const _=M;let O;e[27]!==b||e[28]!==P||e[29]!==S?(O={title:S,description:b,icon:P},e[27]=b,e[28]=P,e[29]=S,e[30]=O):O=e[30];let q;e[31]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx(ge,{}),e[31]=q):q=e[31];let H;e[32]!==w||e[33]!==n._sourceIcon?(H=w&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=w,e[33]=n._sourceIcon,e[34]=H):H=e[34];let W;e[35]!==d||e[36]!==i||e[37]!==L||e[38]!==c||e[39]!==n.id?(W=c?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):d&&t.jsx(K,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i!==null,onClick:A=>{A.stopPropagation(),L()},children:i===n.id?t.jsx(ae,{size:14,className:"animate-spin"}):"Connect"}),e[35]=d,e[36]=i,e[37]=L,e[38]=c,e[39]=n.id,e[40]=W):W=e[40];let p;e[41]!==H||e[42]!==W?(p=t.jsxs("div",{className:"flex items-center gap-2",children:[H,W]}),e[41]=H,e[42]=W,e[43]=p):p=e[43];let k;e[44]!==I||e[45]!==p||e[46]!==O?(k=t.jsx(Ce,{connection:O,fallbackIcon:q,onClick:I,headerActionsAlwaysVisible:!0,headerActions:p}),e[44]=I,e[45]=p,e[46]=O,e[47]=k):k=e[47];let z;e[48]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsxs(Te,{children:[t.jsx(Ae,{children:"Community MCP Server"}),t.jsx(we,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=z):z=e[48];let U;e[49]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Ie,{children:"Cancel"}),e[49]=U):U=e[49];let E;e[50]!==_?(E=t.jsxs(Oe,{children:[z,t.jsxs(Pe,{children:[U,t.jsx($e,{onClick:_,children:"Continue"})]})]}),e[50]=_,e[51]=E):E=e[51];let g;e[52]!==j||e[53]!==E?(g=t.jsx(Le,{open:j,onOpenChange:y,children:E}),e[52]=j,e[53]=E,e[54]=g):g=e[54];let F;return e[55]!==k||e[56]!==g?(F=t.jsxs(t.Fragment,{children:[k,g]}),e[55]=k,e[56]=g,e[57]=F):F=e[57],F}function Zt(h){const e=se.c(51),{group:n,onOpen:d,selectionMode:r,selectedIds:s,onToggleSelect:i}=h;let m;if(e[0]!==n.connections||e[1]!==s){let _;e[3]!==s?(_=O=>s.has(O.id),e[3]=s,e[4]=_):_=e[4],m=n.connections.every(_),e[0]=n.connections,e[1]=s,e[2]=m}else m=e[2];const u=m;let j;if(e[5]!==n.connections||e[6]!==s){let _;e[8]!==s?(_=O=>s.has(O.id),e[8]=s,e[9]=_):_=e[9],j=n.connections.some(_),e[5]=n.connections,e[6]=s,e[7]=j}else j=e[7];const y=j,v=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==v?(N={title:n.title,icon:n.icon,description:v},e[10]=n.icon,e[11]=n.title,e[12]=v,e[13]=N):N=e[13];let l;e[14]!==u||e[15]!==n.connections||e[16]!==d||e[17]!==i||e[18]!==s||e[19]!==r?(l=()=>r?(()=>{for(const _ of n.connections)u?s.has(_.id)&&i(_.id):s.has(_.id)||i(_.id)})():d(),e[14]=u,e[15]=n.connections,e[16]=d,e[17]=i,e[18]=s,e[19]=r,e[20]=l):l=e[20];const f=r&&u&&"ring-2 ring-primary",c=r&&y&&!u&&"ring-1 ring-primary/50";let C;e[21]!==f||e[22]!==c?(C=de(f,c),e[21]=f,e[22]=c,e[23]=C):C=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(ge,{}),e[24]=S):S=e[24];let b;e[25]!==u||e[26]!==n.connections||e[27]!==i||e[28]!==s||e[29]!==r||e[30]!==y?(b=r?t.jsx(Re,{checked:u?!0:y?"indeterminate":!1,onCheckedChange:()=>{for(const _ of n.connections)u?s.has(_.id)&&i(_.id):s.has(_.id)||i(_.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=u,e[26]=n.connections,e[27]=i,e[28]=s,e[29]=r,e[30]=y,e[31]=b):b=e[31];const T=r?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let P;e[32]!==T?(P=de("overflow-hidden transition-all duration-150 ease-out",T),e[32]=T,e[33]=P):P=e[33];let o;e[34]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(We,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:tn,children:t.jsx(Ge,{size:20})})}),e[34]=o):o=e[34];let D;e[35]!==d?(D=_=>{_.stopPropagation(),d()},e[35]=d,e[36]=D):D=e[36];let $;e[37]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Je,{size:16}),e[37]=$):$=e[37];let w;e[38]!==D?(w=t.jsxs(Xe,{children:[o,t.jsx(qe,{align:"end",onClick:en,children:t.jsxs(re,{onClick:D,children:[$,"Open"]})})]}),e[38]=D,e[39]=w):w=e[39];let I;e[40]!==P||e[41]!==w?(I=t.jsx("div",{className:P,children:w}),e[40]=P,e[41]=w,e[42]=I):I=e[42];let L;e[43]!==b||e[44]!==I?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[b,I]}),e[43]=b,e[44]=I,e[45]=L):L=e[45];let M;return e[46]!==L||e[47]!==N||e[48]!==l||e[49]!==C?(M=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:N,onClick:l,className:C,fallbackIcon:S,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=l,e[49]=C,e[50]=M):M=e[50],M}function en(h){return h.stopPropagation()}function tn(h){return h.stopPropagation()}function nn(h){const e=se.c(34),{connection:n,isSelected:d,selectionMode:r,canManage:s,canManageAgents:i,onToggleSelect:m,onOpen:u,onToggleStatus:j,onDelete:y}=h;let v;e[0]!==d||e[1]!==m||e[2]!==r?(v=r?t.jsx(Re,{checked:d,onCheckedChange:m,onClick:rn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),e[0]=d,e[1]=m,e[2]=r,e[3]=v):v=e[3];const N=r?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let l;e[4]!==N?(l=de("overflow-hidden transition-all duration-150 ease-out",N),e[4]=N,e[5]=l):l=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(We,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:on,children:t.jsx(Ge,{size:20})})}),e[6]=f):f=e[6];let c;e[7]!==u?(c=w=>{w.stopPropagation(),u()},e[7]=u,e[8]=c):c=e[8];let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Je,{size:16}),e[9]=C):C=e[9];let S;e[10]!==c?(S=t.jsxs(re,{onClick:c,children:[C,"Open"]}),e[10]=c,e[11]=S):S=e[11];let b;e[12]!==s||e[13]!==i||e[14]!==m?(b=(s||i)&&t.jsxs(re,{onClick:w=>{w.stopPropagation(),m()},children:[t.jsx(zt,{size:16}),"Select"]}),e[12]=s,e[13]=i,e[14]=m,e[15]=b):b=e[15];let T;e[16]!==s||e[17]!==n||e[18]!==j?(T=s&&(n.status==="active"?t.jsxs(re,{onClick:w=>{w.stopPropagation(),j("inactive")},children:[t.jsx(Ft,{size:16}),"Disable"]}):t.jsxs(re,{onClick:w=>{w.stopPropagation(),j("active")},children:[t.jsx(Mt,{size:16}),"Enable"]})),e[16]=s,e[17]=n,e[18]=j,e[19]=T):T=e[19];let P;e[20]!==s||e[21]!==y?(P=s&&t.jsxs(re,{variant:"destructive",onClick:w=>{w.stopPropagation(),y()},children:[t.jsx(Qe,{size:16}),"Delete"]}),e[20]=s,e[21]=y,e[22]=P):P=e[22];let o;e[23]!==P||e[24]!==S||e[25]!==b||e[26]!==T?(o=t.jsxs(Xe,{children:[f,t.jsxs(qe,{align:"end",onClick:sn,children:[S,b,T,P]})]}),e[23]=P,e[24]=S,e[25]=b,e[26]=T,e[27]=o):o=e[27];let D;e[28]!==o||e[29]!==l?(D=t.jsx("div",{className:l,children:o}),e[28]=o,e[29]=l,e[30]=D):D=e[30];let $;return e[31]!==v||e[32]!==D?($=t.jsxs("div",{className:"flex items-center gap-1",children:[v,D]}),e[31]=v,e[32]=D,e[33]=$):$=e[33],$}function sn(h){return h.stopPropagation()}function on(h){return h.stopPropagation()}function rn(h){return h.stopPropagation()}function ln(h){const e=se.c(23),{count:n,total:d,canManage:r,canManageAgents:s,onSelectAll:i,onDeselectAll:m,onDelete:u,onAddToAgent:j,onToggleStatus:y,onCancel:v}=h;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let l;e[2]!==n||e[3]!==m||e[4]!==i||e[5]!==d?(l=n<d?t.jsxs(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:["Select all (",d,")"]}):t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:"Clear selection"}),e[2]=n,e[3]=m,e[4]=i,e[5]=d,e[6]=l):l=e[6];let f;e[7]!==s||e[8]!==j?(f=s&&t.jsxs(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:[t.jsx(Ue,{size:13}),"Add to Agent"]}),e[7]=s,e[8]=j,e[9]=f):f=e[9];let c;e[10]!==r||e[11]!==u||e[12]!==y?(c=r&&t.jsxs(t.Fragment,{children:[t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("active"),children:"Enable"}),t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("inactive"),children:"Disable"}),t.jsxs(K,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:[t.jsx(Qe,{size:13}),"Delete"]})]}),e[10]=r,e[11]=u,e[12]=y,e[13]=c):c=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(He,{size:13}),e[14]=C):C=e[14];let S;e[15]!==v?(S=t.jsx(K,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:v,children:C}),e[15]=v,e[16]=S):S=e[16];let b;return e[17]!==N||e[18]!==l||e[19]!==f||e[20]!==c||e[21]!==S?(b=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[N,l,f,c,S]})}),e[17]=N,e[18]=l,e[19]=f,e[20]=c,e[21]=S,e[22]=b):b=e[22],b}function cn(h){const e=se.c(25),{open:n,onOpenChange:d,agents:r,onConfirm:s}=h,[i,m]=V.useState(null);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs(Fe,{children:[t.jsx(Me,{children:"Add to Agent"}),t.jsx(ze,{children:"Select an agent to add the selected connections to."})]}),e[0]=u):u=e[0];let j;e[1]!==r||e[2]!==i?(j=r.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):r.map(b=>t.jsxs("button",{type:"button",onClick:()=>m(b.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===b.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Wt,{icon:b.icon,name:b.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:b.title}),b.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.description})]})]},b.id)),e[1]=r,e[2]=i,e[3]=j):j=e[3];let y;e[4]!==j?(y=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=y):y=e[5];let v;e[6]!==d?(v=t.jsx(K,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),e[6]=d,e[7]=v):v=e[7];const N=!i;let l;e[8]!==s||e[9]!==d||e[10]!==i?(l=()=>{i&&(s(i),d(!1),m(null))},e[8]=s,e[9]=d,e[10]=i,e[11]=l):l=e[11];let f;e[12]!==N||e[13]!==l?(f=t.jsx(K,{disabled:N,onClick:l,children:"Add"}),e[12]=N,e[13]=l,e[14]=f):f=e[14];let c;e[15]!==v||e[16]!==f?(c=t.jsxs(Ve,{children:[v,f]}),e[15]=v,e[16]=f,e[17]=c):c=e[17];let C;e[18]!==y||e[19]!==c?(C=t.jsxs(Ee,{className:"sm:max-w-[400px]",children:[u,y,c]}),e[18]=y,e[19]=c,e[20]=C):C=e[20];let S;return e[21]!==d||e[22]!==n||e[23]!==C?(S=t.jsx(Be,{open:n,onOpenChange:d,children:C}),e[21]=d,e[22]=n,e[23]=C,e[24]=S):S=e[24],S}function an({listState:h,activeTab:e,typeFilter:n,statusFilter:d,registryFilter:r,enabledRegistries:s}){const{org:i}=be(),m=it(),u=_e(),{data:j}=Ne.useSession(),y=Ke(),v=$t(h),N=xt(),{granted:l}=ye("connections:manage"),{granted:f}=ye("agents:manage"),[c,C]=V.useState(new Set),S=c.size>0,[b,T]=V.useState(!1),[P,o]=V.useState(!1),[D,$]=V.useState(null),w=Ot(),I=v.filter(a=>!(n!=="ALL"&&a.connection_type!==n||d!=="ALL"&&a.status!==d)),L=ht(I),M=a=>{C(x=>{const B=new Set(x);return B.has(a)?B.delete(a):B.add(a),B})},_=()=>{C(new Set)},O=ke(s,h.searchTerm),q=O.items,H=jt(O.loadMore,O.hasMore,O.isLoadingMore),W=new Set(v.filter(a=>a.app_name).map(a=>a.app_name)),p=r==="ALL"||s.some(a=>a.id===r)?r:"ALL",k=h.search.length>0,z=e==="all"||k?q.filter(a=>{if(p!=="ALL"&&a._registryId!==p)return!1;if(k){const x=De(a);if(x&&W.has(x))return!1}return!0}):[],U=e==="connected"||k?L:[],E=async a=>{if(!(!i||!j?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:a.id,source:"connections_page"}),$(a.id);try{const x=at(a,i.id,j.user.id,{remoteIndex:0}),B=x.connection_type==="STDIO",G=!!x.connection_url,X=B&&x.connection_headers&&typeof x.connection_headers=="object"&&"command"in x.connection_headers;if(!G&&!X){R.error("This MCP Server cannot be connected: no connection method available"),$(null);return}const{id:ne}=await y.create.mutateAsync(x),le=await Rt({connectionId:ne,orgId:i.id,orgSlug:i.slug,persistFallback:fe=>y.update.mutateAsync({id:ne,data:{connection_token:fe}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ne,flow:"connections_page_connect",error:le.error??"no_token"}),R.error(`Authentication failed: ${le.error??"no token received"}`);return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ne,flow:"connections_page_connect"});const fe=new URL(`/api/${i.slug}/mcp/${ne}`,window.location.origin);await m.invalidateQueries({queryKey:rt.isMCPAuthenticated(fe.href,null)}),F(),R.success("Authentication successful")}R.success("Connected successfully")}catch(x){R.error(`Failed to connect: ${x instanceof Error?x.message:String(x)}`)}finally{$(null)}}},g=Lt(),F=()=>{m.invalidateQueries({predicate:a=>{const x=a.queryKey;return x[1]===i.id&&x[3]==="collection"&&x[4]==="CONNECTIONS"}})},A=async()=>{T(!1);const a=[...c];te("connections_bulk_delete",{count:a.length});let x=0;for(const B of a)try{await g.call("COLLECTION_CONNECTIONS_DELETE",{id:B,force:!0}),x++}catch{}F(),R.success(`Deleted ${x} connection${x!==1?"s":""}`),_()},oe=async(a,x)=>{try{await y.update.mutateAsync({id:a,data:{status:x}}),F(),R.success(x==="active"?"Connection enabled":"Connection disabled")}catch{R.error("Failed to update connection")}},xe=async a=>{const x=[...c];te("connections_bulk_status_toggled",{count:x.length,to_status:a});let B=0;for(const G of x)try{await y.update.mutateAsync({id:G,data:{status:a}}),B++}catch{}F(),R.success(`${a==="active"?"Enabled":"Disabled"} ${B} connection${B!==1?"s":""}`),_()},me=async a=>{const x=w.find(X=>X.id===a);if(!x)return;te("connections_bulk_add_to_agent",{agent_id:a,count:c.size});const B=new Set(x.connections.map(X=>X.connection_id)),G=[...c].filter(X=>!B.has(X)).map(X=>({connection_id:X,selected_tools:null,selected_resources:null,selected_prompts:null}));if(G.length===0){R.info("All selected connections are already in that agent");return}try{await g.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:a,data:{connections:[...x.connections,...G]}}),m.invalidateQueries({predicate:X=>{const ne=X.queryKey;return ne[1]===i.id&&ne[3]==="collection"&&ne[4]==="VIRTUAL_MCP"}}),R.success(`Added ${G.length} connection${G.length!==1?"s":""} to "${x.title}"`),_()}catch{R.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(ft,{...N}),t.jsx(Jt,{open:b,onOpenChange:T,count:c.size,onConfirm:A}),t.jsx(cn,{open:P,onOpenChange:o,agents:w,onConfirm:me}),O.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(k?z.length===0&&I.length===0:e==="all"?z.length===0:I.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:h.search?`No Connections match "${h.search}"`:l?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[U.map(a=>{if(a.type==="group")return t.jsx(Zt,{group:a,onOpen:()=>{u({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:a.key}})},selectionMode:S,selectedIds:c,onToggleSelect:M},a.key);const x=a.connection,B=c.has(x.id);return t.jsx(Ce,{connection:x,fallbackIcon:t.jsx(ge,{}),onClick:()=>S?M(x.id):u({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(x)}}),className:de(B&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsx(nn,{connection:x,isSelected:B,selectionMode:S,canManage:l,canManageAgents:f,onToggleSelect:()=>M(x.id),onOpen:()=>u({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(x)}}),onToggleStatus:G=>oe(x.id,G),onDelete:()=>N.requestDelete(x)})},x.id)}),z.map(a=>t.jsx(Yt,{item:a,canManage:l,allConnections:v,connectedAppNames:W,connectingItemId:D,onNavigateConnected:x=>u({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(x)}}),onConnect:E},`catalog-${a._registryId}:${a.id}`)),(e==="all"||k)&&s.length>0&&t.jsx("div",{ref:H,className:"col-span-full h-4"}),(e==="all"||k)&&O.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ae,{size:24,className:"animate-spin text-muted-foreground"})})]})}),S&&t.jsx(ln,{count:c.size,total:I.length,canManage:l,canManageAgents:f,onSelectAll:()=>{C(new Set(I.map(a=>a.id)))},onDeselectAll:()=>C(new Set),onDelete:()=>T(!0),onAddToAgent:()=>o(!0),onToggleStatus:xe,onCancel:_})]})}function dn(){const{org:h}=be(),e=_e(),n=Ze({strict:!1}),{data:d}=Ne.useSession(),{stdioEnabled:r}=et(),s=kt(),{granted:i}=ye("connections:manage"),m=Gt({namespace:h.slug,resource:"connections"}),u=Ke(),[j,y]=tt(nt.connectionsTab(h.slug),p=>n.tab==="all"||n.tab==="connected"?n.tab:p??"all"),[v,N]=V.useState("ALL"),[l,f]=V.useState("ALL"),[c,C]=V.useState("ALL"),S=pt(),T=ke(S,m.searchTerm).items,P=m.search!==m.searchTerm,o=st({resolver:ot(Bt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),D=o.watch("ui_type"),$=o.watch("connection_url"),w=o.watch("npx_package"),I=pe({uiType:D,connectionUrl:$??"",npxPackage:w??""})??Se({uiType:D,connectionUrl:$??"",registryItems:T}),L=i&&n.action==="create",M=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:h.slug},search:{action:"create"}})},_=()=>{e({to:"/$org/settings/connections",params:{org:h.slug},search:{}})},O=async p=>{let k,z=null,U=null,E=null;p.ui_type==="NPX"?(k="STDIO",z="",E=Ut(p.npx_package||"",p.env_vars||[])):p.ui_type==="STDIO"?(k="STDIO",z="",E=Ht(p.stdio_command||"",p.stdio_args||"",p.stdio_cwd,p.env_vars||[])):(k=p.ui_type,z=p.connection_url||"",U=p.connection_token||null);const g=ct("conn");te("connection_custom_created",{connection_type:k,ui_type:p.ui_type}),await u.create.mutateAsync({id:g,title:p.title,description:p.description||null,connection_type:k,connection_url:z,connection_token:U,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:h.id,icon:p.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),_(),o.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:h.slug,appSlug:he({app_name:null,connection_url:z,title:p.title,id:g})}})},q=p=>{p||(L&&_(),o.reset())},H=p=>{const k=p.trim();if(!k)return;const z=!!o.formState.dirtyFields.title,U=!!o.formState.dirtyFields.description,E=!!o.formState.dirtyFields.env_vars,g=A=>{if(A&&(!z&&!o.getValues("title").trim()&&A.title&&o.setValue("title",A.title,{shouldDirty:!1}),!U&&!(o.getValues("description")??"").trim()&&A.description&&o.setValue("description",A.description,{shouldDirty:!1}),!E&&A.envVarKeys?.length)){const oe=o.getValues("env_vars")??[],xe=new Set(oe.map(a=>a.key)),me=A.envVarKeys.filter(a=>!xe.has(a));me.length>0&&o.setValue("env_vars",[...oe,...me.map(a=>({key:a,value:""}))],{shouldDirty:!0})}},F=Kt(k);if(F&&r){o.setValue("ui_type","NPX",{shouldDirty:!0}),o.setValue("npx_package",F.packageName,{shouldDirty:!0}),o.setValue("connection_url","",{shouldDirty:!0}),o.setValue("connection_token",null,{shouldDirty:!0}),g(pe({uiType:"NPX",npxPackage:F.packageName}));return}if(k.startsWith("http://")||k.startsWith("https://")){const A=D==="HTTP"||D==="SSE"||D==="Websocket"?D:"HTTP";o.setValue("ui_type",A,{shouldDirty:!0}),o.setValue("connection_url",k,{shouldDirty:!0}),g(pe({uiType:A,connectionUrl:k})??Se({uiType:A,connectionUrl:k,registryItems:T}));return}D==="NPX"&&g(pe({uiType:"NPX",npxPackage:k}))},W=i?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(K,{variant:"outline",onClick:M,children:[t.jsx(Ue,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(ue,{children:[(()=>{const p="Create Connection",k="Create a custom connection in your organization. Fill in the details below.",z=o.formState.isSubmitting?"Saving...":"Create Connection",U=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(J,{control:o.control,name:"ui_type",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Type *"}),t.jsxs(At,{value:g.value,onValueChange:g.onChange,children:[t.jsx(Z,{children:t.jsx(wt,{children:t.jsx(Tt,{})})}),t.jsxs(It,{children:[t.jsx(ce,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ce,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ce,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),r&&t.jsxs(t.Fragment,{children:[t.jsx(ce,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(ce,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Vt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),D==="NPX"&&t.jsx(J,{control:o.control,name:"npx_package",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...g,value:g.value??"",onPaste:F=>{const A=F.clipboardData.getData("text");A&&(F.preventDefault(),o.setValue("npx_package",A.trim(),{shouldDirty:!0}),H(A))},onBlur:F=>{H(F.target.value),g.onBlur()}})}),t.jsx(ee,{})]})}),D==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(J,{control:o.control,name:"stdio_command",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Command *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"node, bun, python...",...g,value:g.value??""})}),t.jsx(ee,{})]})}),t.jsx(J,{control:o.control,name:"stdio_args",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...g,value:g.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(J,{control:o.control,name:"stdio_cwd",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...g,value:g.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(D==="NPX"||D==="STDIO")&&t.jsx(J,{control:o.control,name:"env_vars",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Et,{value:g.value??[],onChange:g.onChange})}),t.jsx(ee,{})]})}),D!=="NPX"&&D!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(J,{control:o.control,name:"connection_url",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"URL *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...g,value:g.value??"",onPaste:F=>{const A=F.clipboardData.getData("text");A&&(F.preventDefault(),o.setValue("connection_url",A.trim(),{shouldDirty:!0}),H(A))},onBlur:F=>{H(F.target.value),g.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(J,{control:o.control,name:"connection_token",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:I?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:I?.token?.placeholder??"Bearer token or API key",...g,value:g.value??""})}),I?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[I.token.helperText,I.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:"Open GitHub PAT settings"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(J,{control:o.control,name:"title",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Name *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"My Connection",...g})}),t.jsx(ee,{})]})}),t.jsx(J,{control:o.control,name:"description",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Description"}),t.jsx(Z,{children:t.jsx(Pt,{placeholder:"A brief description of this connection",rows:3,...g,value:g.value??""})}),t.jsx(ee,{})]})})]}),E=L;return s?t.jsx(Ct,{open:E,onOpenChange:q,children:t.jsxs(vt,{className:"max-h-[90vh]",children:[t.jsx(St,{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(bt,{children:p}),t.jsx(_t,{className:"mt-1",children:k})]}),t.jsx(Nt,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(He,{size:16})})})]})}),t.jsx(ve,{...o,children:t.jsxs("form",{onSubmit:o.handleSubmit(O),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:U}),t.jsx(Dt,{children:t.jsx(K,{type:"submit",disabled:o.formState.isSubmitting,className:"w-full",children:z})})]})})]})}):t.jsx(Be,{open:E,onOpenChange:q,children:t.jsxs(Ee,{className:"sm:max-w-[525px]",children:[t.jsxs(Fe,{children:[t.jsx(Me,{children:p}),t.jsx(ze,{children:k})]}),t.jsx(ve,{...o,children:t.jsxs("form",{onSubmit:o.handleSubmit(O),children:[t.jsx("div",{className:"py-4",children:U}),t.jsxs(Ve,{children:[t.jsx(K,{type:"button",variant:"outline",onClick:()=>q(!1),children:"Cancel"}),t.jsx(K,{type:"submit",disabled:o.formState.isSubmitting,className:"min-w-40",children:z})]})]})})]})})})(),t.jsx(ue.Content,{children:t.jsx(ue.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ue.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(mt,{value:m.search,onChange:m.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:p=>{p.key==="Escape"&&(m.setSearch(""),p.target.blur())}}),t.jsx(dt,{sortKey:m.sortKey,sortDirection:m.sortDirection,onSort:m.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:v,onChange:p=>N(p||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:l,onChange:p=>f(p||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},...S.length>1?[{label:"Registry",value:c,onChange:p=>C(p||"ALL"),options:[{id:"ALL",label:"All registries"},...S.map(p=>({id:p.id,label:p.id.includes("community-registry")?"Community MCP Registry":p.title}))]}]:[]]})]}),W]}),t.jsx(ut,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:p=>{const k=p;k!==j&&te("connections_page_tab_changed",{to_tab:k}),y(k)}}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:P?.5:1,transition:P?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:P?"none":"auto"},children:t.jsx(an,{listState:m,activeTab:j,typeFilter:v,statusFilter:l,registryFilter:c,enabledRegistries:S})})})]})})})]})})}function to(){const h=se.c(1);let e;return h[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(dn,{})})}),h[0]=e):e=h[0],e}export{to as default};
|
package/dist/client/assets/{decopilot-sse-pool-DpwU6Fnw.js → decopilot-sse-pool-ByDpDqQ2.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-DGQdC8j6.js";import{e as k}from"./backoff-CrEUbyZT.js";const v={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},h=Object.values(v),R="super-agent",S="task-board.item.updated",b="task-board.item.deleted",N=3e4,g=1e3;function O(n){const{buildUrl:d,eventTypes:u,name:a,crossTab:f=!1}=n,o=new Map,i=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(i&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const s of e.handlers)try{s(t)}catch{}}function p(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(d(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(p(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&m(e)};const s=r=>{e.channel?.postMessage({kind:"event",type:r.type,data:r.data}),l(e,r)};for(const r of u)t.addEventListener(r,s)}function m(e){if(e.refCount<=0||e.reconnectTimer)return;const t=k(N,g,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function L(e){if(!i){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function w(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&p(e)}function D(e){const t=o.get(e);if(t)return t;const s={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(o.set(e,s),i){const r=new BroadcastChannel(`sse:${a}:${e}`);r.onmessage=c=>w(s,c.data),s.channel=r}return L(s),s}function y(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,o.delete(e.key)}return{subscribe(e,t,s){const r=D(e);r.refCount++,r.handlers.add(t),s&&r.reconnectHandlers.add(s);let c=!1;return()=>{c||(c=!0,r.handlers.delete(t),s&&r.reconnectHandlers.delete(s),r.refCount--,r.refCount<=0&&y(r))}}}}function A(n,d){const u=new Set(d);return{subscribe(a,f,o){const i=l=>{u.has(l.type)&&f(l)};return n.subscribe(a,i,o)}}}const _=[...h,S,b],M=_,P=_,C=O({name:"watch",buildUrl:n=>`/api/${encodeURIComponent(n)}/watch?types=${M.join(",")}`,eventTypes:P,crossTab:!0}),H=A(C,[...h]),U=A(C,[S,b]),V=H;export{v as D,R as S,b as T,V as d,U as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,j as i,cM as u,l as c,F as m,cL as x,cN as j,cO as N,cQ as b,cZ as D,cP as g}from"./index-
|
|
1
|
+
import{c as n,j as i,cM as u,l as c,F as m,cL as x,cN as j,cO as N,cQ as b,cZ as D,cP as g}from"./index-DGQdC8j6.js";import{i as h}from"./X-Bs0u_0yh.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{O as D,R as a,k as b,P as c,T as d,z as e,y as f,v as g,B as h,w as i};
|