decocms 4.372.0 → 4.372.2
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-Ddrj7VUD.js → AlertCircle-CBmZyziw.js} +1 -1
- package/dist/client/assets/{AreaChart-0mAtLd45.js → AreaChart-S0mQzrWT.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BKbGYh2B.js → ArrowLeft-B69K0kVk.js} +1 -1
- package/dist/client/assets/{ArrowRight-6hYTENh_.js → ArrowRight-xPNMNz_B.js} +1 -1
- package/dist/client/assets/{ArrowUp-Dhew3Evs.js → ArrowUp-u0dcFMS5.js} +1 -1
- package/dist/client/assets/{CartesianChart-u2Ri6JFS.js → CartesianChart-C3sk-6j9.js} +1 -1
- package/dist/client/assets/{Check-Dnz3uW0f.js → Check-B1dsRB6C.js} +1 -1
- package/dist/client/assets/{CheckCircle-DQbrJHsr.js → CheckCircle-DWLeIAIi.js} +1 -1
- package/dist/client/assets/{ChevronRight-DK_MoZ-7.js → ChevronRight-B6hcwUgO.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-B64gqtde.js → ChevronSelectorVertical-Cyo58PlY.js} +1 -1
- package/dist/client/assets/{ChevronUp-XOZg-HiO.js → ChevronUp-CLfesB4Y.js} +1 -1
- package/dist/client/assets/{Copy01-l6PfB431.js → Copy01-BmdYCu9M.js} +1 -1
- package/dist/client/assets/{CreditCard01-DQsLDZWx.js → CreditCard01-CwXLRxxa.js} +1 -1
- package/dist/client/assets/{Database01-vUZciuwF.js → Database01-DtsDBLPS.js} +1 -1
- package/dist/client/assets/{DotsVertical-Dyzdr42E.js → DotsVertical-CVHL4KPF.js} +1 -1
- package/dist/client/assets/{Download01-_eUxcgg1.js → Download01-CSXusgOH.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DFc19StE.js → ErrorBarContext-Cr0hYOrs.js} +1 -1
- package/dist/client/assets/{Eye-B7hZLXRZ.js → Eye-cBhNaih2.js} +1 -1
- package/dist/client/assets/{File02-D1W0NjQG.js → File02-BhN-1ALj.js} +1 -1
- package/dist/client/assets/{GitBranch01-CRUhFeKk.js → GitBranch01--s8uEzME.js} +1 -1
- package/dist/client/assets/{Globe01-D9zr3JIX.js → Globe01-fgEMsm16.js} +1 -1
- package/dist/client/assets/{HardDrive-7_ZjnLMv.js → HardDrive-TyjleYaj.js} +1 -1
- package/dist/client/assets/{Image01-7_HSDHV3.js → Image01-O24XNmwN.js} +1 -1
- package/dist/client/assets/{Key01-ti2CpCiW.js → Key01-CtPEI4Eg.js} +1 -1
- package/dist/client/assets/{Line-D9piFifo.js → Line-DL6BR25n.js} +1 -1
- package/dist/client/assets/{Link01-DYWtgbsz.js → Link01-CcL48lHm.js} +1 -1
- package/dist/client/assets/{LinkExternal01--55N_6ts.js → LinkExternal01-rfdoJ7W0.js} +1 -1
- package/dist/client/assets/{MessageCircle01-DELRsE6A.js → MessageCircle01-C-CyP7IO.js} +1 -1
- package/dist/client/assets/{Monitor01-BoIweS2p.js → Monitor01-D5zc1Ggz.js} +1 -1
- package/dist/client/assets/{Package-CSgBbMFc.js → Package-BUXYnAsJ.js} +1 -1
- package/dist/client/assets/{Palette-CaHW8y9T.js → Palette-BCFMI_Wq.js} +1 -1
- package/dist/client/assets/{Play-BolLrTAn.js → Play-CKEbdlIO.js} +1 -1
- package/dist/client/assets/{Plus-C5azC59K.js → Plus-DhTGO6OU.js} +1 -1
- package/dist/client/assets/{Printer-Dn2De3ak.js → Printer-Cqaundx-.js} +1 -1
- package/dist/client/assets/{SearchLg-BZUR3n9c.js → SearchLg-Cqrhx8lj.js} +1 -1
- package/dist/client/assets/{SearchMd-Ms_xvSfF.js → SearchMd-fdzDozsD.js} +1 -1
- package/dist/client/assets/{Sector-DHu8bCK4.js → Sector-jcjEFxz0.js} +1 -1
- package/dist/client/assets/{Settings02-BLcAotUO.js → Settings02-BQWj4mrx.js} +1 -1
- package/dist/client/assets/{Share07-BypmcbEF.js → Share07-DL7pSoYx.js} +1 -1
- package/dist/client/assets/{Shield01-C_5dC1mR.js → Shield01-BwfDPRaf.js} +1 -1
- package/dist/client/assets/{Stars01-DTStBsXP.js → Stars01-OOrCszDj.js} +1 -1
- package/dist/client/assets/{Sun-CEaGM44s.js → Sun-DbDrPFGS.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-l3o5r_PJ.js → SwitchHorizontal01-D-erjhEy.js} +1 -1
- package/dist/client/assets/{Tool01-C0-Xqkxp.js → Tool01-C1iMp6Qn.js} +1 -1
- package/dist/client/assets/{Tool02-CE2Fqpba.js → Tool02-C0Kk7KSA.js} +1 -1
- package/dist/client/assets/{Trash01-DPQmLNZV.js → Trash01-UhB0CRb8.js} +1 -1
- package/dist/client/assets/{TrendUp01-uTlAwt0S.js → TrendUp01-CnwsmsBB.js} +1 -1
- package/dist/client/assets/{Upload01-D-20AdeD.js → Upload01-CZDGBHSw.js} +1 -1
- package/dist/client/assets/{User01-BA1LEBvQ.js → User01-fZfVT6XZ.js} +1 -1
- package/dist/client/assets/{UserSquare-D-v_LgOa.js → UserSquare-CxfIKRZH.js} +1 -1
- package/dist/client/assets/{Users01-BpRvBK8_.js → Users01-DtXUy7uu.js} +1 -1
- package/dist/client/assets/{Users03-BaYGM99c.js → Users03-Dw5nWIKh.js} +1 -1
- package/dist/client/assets/{X-Dh_K-VDi.js → X-DdrxBhnS.js} +1 -1
- package/dist/client/assets/{XCircle-BhDUy79p.js → XCircle-BmfJL_8e.js} +1 -1
- package/dist/client/assets/{XClose-Bw0VS-dj.js → XClose-MLfi0Jji.js} +1 -1
- package/dist/client/assets/{Zap-TxetSnv7.js → Zap-DRR3UUhJ.js} +1 -1
- package/dist/client/assets/{ZoomOut-CJKT31Kx.js → ZoomOut-7sZYwmin.js} +1 -1
- package/dist/client/assets/{access-gate-Dt6vr2zi.js → access-gate-C6q3nVJm.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-Bwzbw2rJ.js → add-connection-dialog-GCEfUHNn.js} +1 -1
- package/dist/client/assets/{agent-analytics-OtUj5VAg.js → agent-analytics-DCkhWf9p.js} +1 -1
- package/dist/client/assets/agent-app-CzCHojcy.js +1 -0
- package/dist/client/assets/{agent-assets-Ds2YrU5Y.js → agent-assets-ojJ8Xiqs.js} +1 -1
- package/dist/client/assets/{agent-automation-BzHNBuT4.js → agent-automation-B4eHDQrX.js} +1 -1
- package/dist/client/assets/{agent-automations-BvUPSQUr.js → agent-automations-ff2RUxFe.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-B2VHxv-N.js → agent-connect-sources-CcPIf5gR.js} +1 -1
- package/dist/client/assets/agent-deck-D8wRpPkn.js +1 -0
- package/dist/client/assets/{agent-e2e-CCN3csfU.js → agent-e2e-rPac5L3D.js} +1 -1
- package/dist/client/assets/{agent-experiments-C1xtDG8f.js → agent-experiments-DaPdd-X9.js} +1 -1
- package/dist/client/assets/agent-file-Do2RcnWv.js +1 -0
- package/dist/client/assets/{agent-git-O5fnLyKj.js → agent-git-DcEJ2X4i.js} +1 -1
- package/dist/client/assets/{agent-hosting-ClZ4R70M.js → agent-hosting-DuNL_wpb.js} +1 -1
- package/dist/client/assets/{agent-icon-Cyx7Smko.js → agent-icon-CG9LA776.js} +1 -1
- package/dist/client/assets/agent-library-file-BuWcxxL9.js +1 -0
- package/dist/client/assets/{agent-monitor-B2s_I09z.js → agent-monitor-BM-OnMxj.js} +1 -1
- package/dist/client/assets/{agent-overview-CLGjxUwU.js → agent-overview-D6iBUiTw.js} +1 -1
- package/dist/client/assets/agent-settings-BzjnuB_y.js +1 -0
- package/dist/client/assets/agent-site-editor-code-2yBGi2Ha.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-D8Swy0HF.js → agent-site-editor-content-_Pf4joQg.js} +2 -2
- package/dist/client/assets/{agent-site-editor-DElX-Rtx.js → agent-site-editor-ejdHfOFM.js} +1 -1
- package/dist/client/assets/{agent-site-editor-preview-BEkJn_qI.js → agent-site-editor-preview-DjTBMAQa.js} +3 -3
- package/dist/client/assets/agent-view-DnqS13ka.js +1 -0
- package/dist/client/assets/{agent-view-guard-Cc93o9kZ.js → agent-view-guard-DXWg2Gk-.js} +1 -1
- package/dist/client/assets/{agents-list-D23HRLNK.js → agents-list-CKNjfI6O.js} +1 -1
- package/dist/client/assets/{ai-providers-AQKJLPCp.js → ai-providers-DK9rldFg.js} +1 -1
- package/dist/client/assets/{alert-Bb5psHaZ.js → alert-CCseTQ3U.js} +1 -1
- package/dist/client/assets/{alert-dialog-DfGZ77rh.js → alert-dialog-D1mw46Sk.js} +1 -1
- package/dist/client/assets/api-keys-CIgCoePx.js +1 -0
- package/dist/client/assets/{api-keys-7xk7B181.js → api-keys-CKHrd_7x.js} +1 -1
- package/dist/client/assets/app-editor-O01UEByL.js +1 -0
- package/dist/client/assets/{asset-utils-Dl8tpNxx.js → asset-utils-D_zaQTaK.js} +1 -1
- package/dist/client/assets/{auth-5BCk_I76.js → auth-DD_Ixcci.js} +1 -1
- package/dist/client/assets/{auth-catchall-BXX_QHt4.js → auth-catchall-cbZs_0W-.js} +1 -1
- package/dist/client/assets/{auth-entry-BYY2pacz.js → auth-entry-CnbW7-3f.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Bh_B_vjZ.js → auth-split-layout-Bdz_uyrq.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Bj_Y1vgm.js → authenticate-and-persist-oauth-C-rkDcUs.js} +1 -1
- package/dist/client/assets/{automation-list-row-TgtbvSc5.js → automation-list-row-CR6JdgMc.js} +1 -1
- package/dist/client/assets/{automation-runs-CVEQI8qU.js → automation-runs-CZTAHOWn.js} +1 -1
- package/dist/client/assets/automations-V9ZwFDwX.js +1 -0
- package/dist/client/assets/{autosend-ClVEnX_S.js → autosend-Ui23lPKc.js} +1 -1
- package/dist/client/assets/{avatar-CR9KEb-s.js → avatar-B4O8VfWG.js} +1 -1
- package/dist/client/assets/{badge-DOT8HE5Z.js → badge-Dt3iCXyZ.js} +1 -1
- package/dist/client/assets/{block-document-Boj9yYni.js → block-document-B4aPeXms.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-Dh0KsAvE.js → blocks-preview-workspace-context-DHWKuZAa.js} +1 -1
- package/dist/client/assets/{breadcrumb-CVSmj3i3.js → breadcrumb-C1f6kD30.js} +1 -1
- package/dist/client/assets/{buckets-B0FCB4zB.js → buckets-6ACibqOT.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-C9jBTscU.js → build-improve-prompt-doc-B6wx1rP9.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-QprmcNHA.js → bulk-category-panel-F9HNDtYy.js} +1 -1
- package/dist/client/assets/{calendar-SAWOBJxF.js → calendar-vO7jAMoX.js} +1 -1
- package/dist/client/assets/{capability-load-error-D1mxtMyB.js → capability-load-error-H0rjgWhr.js} +1 -1
- package/dist/client/assets/{cards-DQPi8IW_.js → cards-kf5vSVVS.js} +1 -1
- package/dist/client/assets/category-editor-CTdcJ7FT.js +1 -0
- package/dist/client/assets/{chart-BGm-AILS.js → chart-BzMhag8P.js} +1 -1
- package/dist/client/assets/{chat-context-H28jTcB6.js → chat-context-CyABXc7f.js} +1 -1
- package/dist/client/assets/{chat-draft-BTIUwp87.js → chat-draft-D7-8Bmdq.js} +1 -1
- package/dist/client/assets/{checkbox-D_GODf3h.js → checkbox-CtOL1W3M.js} +1 -1
- package/dist/client/assets/{choose-editor-CqXPKhwg.js → choose-editor-BtO73yE_.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Nkuy_2dv.js → cli-auth-success-CoTXpnpD.js} +1 -1
- package/dist/client/assets/{client-icons-D55uOktL.js → client-icons-CQZdxqWS.js} +1 -1
- package/dist/client/assets/{collapsible-CkoFdRnK.js → collapsible-pX1z8P9s.js} +1 -1
- package/dist/client/assets/{collection-detail-7A7zRYv2.js → collection-detail-BZDl7xyG.js} +1 -1
- package/dist/client/assets/{collection-display-button-B730w9Ah.js → collection-display-button-CbltoNVs.js} +1 -1
- package/dist/client/assets/{collection-search-B2t2IaOK.js → collection-search-CDJVma9q.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-87GtYm7N.js → collection-table-wrapper-DcmT6WdT.js} +1 -1
- package/dist/client/assets/{collection-tabs-DAqaNYVU.js → collection-tabs-BxK4CJTN.js} +1 -1
- package/dist/client/assets/{combobox-CA5nnv9O.js → combobox-DXVa1WHx.js} +1 -1
- package/dist/client/assets/{command-CtFXOSiX.js → command-DQAiupfD.js} +1 -1
- package/dist/client/assets/{command-palette-store-BL5hnWnv.js → command-palette-store-BAKFtSbo.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-DVYB246Y.js → companion-mcps-section-BTo1SG3V.js} +1 -1
- package/dist/client/assets/{connect-F12K-hsA.js → connect-D69kUPQ6.js} +1 -1
- package/dist/client/assets/{connect-layout-DCgHt0wb.js → connect-layout-CCzmI4dZ.js} +1 -1
- package/dist/client/assets/{connection-DhRpG43c.js → connection-HbykX7y1.js} +1 -1
- package/dist/client/assets/{connection-card-BCofIpgI.js → connection-card-CVCUQ3aW.js} +1 -1
- package/dist/client/assets/{connection-detail-CkBpJk50.js → connection-detail-26OGwpTw.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-C7Pc9F54.js → connection-form-helpers-BbPIPH0F.js} +1 -1
- package/dist/client/assets/{connections-BsBFmd4I.js → connections-DfOC15A2.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CYwIBo_O.js → create-organization-dialog-CQqrzhNr.js} +1 -1
- package/dist/client/assets/{decofile-api-Cdto5FQ3.js → decofile-api-D4EZXGFG.js} +1 -1
- package/dist/client/assets/{decopilot-BecreIFq.js → decopilot-CS4SGQVN.js} +1 -1
- package/dist/client/assets/{dialog-SKkzdrcZ.js → dialog-DqEzjMAL.js} +1 -1
- package/dist/client/assets/{discover-BWfGXdtB.js → discover-BzlMmTOv.js} +1 -1
- package/dist/client/assets/{domain-settings-ClqqVAOw.js → domain-settings-B8sQXZqE.js} +1 -1
- package/dist/client/assets/{download-app-dialog-DQE0snIy.js → download-app-dialog-BAvoyDUp.js} +1 -1
- package/dist/client/assets/{drawer-BleKwXKQ.js → drawer-CcQRz4y-.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DRuEZVW9.js → dropdown-menu-B91kH2ef.js} +1 -1
- package/dist/client/assets/{editor-oZAad1yU.js → editor-B5kh_87R.js} +1 -1
- package/dist/client/assets/{empty-state-Bi9IU32F.js → empty-state-CsX1FA1W.js} +1 -1
- package/dist/client/assets/{empty-state-CaG0BWIR.js → empty-state-DxrEQWmF.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C8zB3-0T.js → extract-connection-data-Chw2Aon_.js} +1 -1
- package/dist/client/assets/{feature-gate-UfjS24Ou.js → feature-gate-BGURuoWY.js} +1 -1
- package/dist/client/assets/{feature-paywall-pQTqQ94T.js → feature-paywall-BnPg6xWO.js} +1 -1
- package/dist/client/assets/{file-explorer-s0AeRobY.js → file-explorer-CzROIsmv.js} +1 -1
- package/dist/client/assets/{file-preview-Dzjub9Lu.js → file-preview-4gOrulnp.js} +1 -1
- package/dist/client/assets/{file-share-button-BqqM0Upa.js → file-share-button-4P1UpMsl.js} +1 -1
- package/dist/client/assets/{file-type-icon-CMiynV8b.js → file-type-icon-ajQojKQT.js} +1 -1
- package/dist/client/assets/{folder-icon-3FCd-eRP.js → folder-icon-C8L4j1L7.js} +1 -1
- package/dist/client/assets/{form-H9AoFazU.js → form-DMzpEXyE.js} +1 -1
- package/dist/client/assets/{gateway-client-BQS5H6XZ.js → gateway-client-D6HrO7KA.js} +1 -1
- package/dist/client/assets/{general-st9zEmU7.js → general-DzSsaIiU.js} +1 -1
- package/dist/client/assets/{github-icon-TtZ8EUXE.js → github-icon-DDXLGNgI.js} +1 -1
- package/dist/client/assets/{home-DMdfBPme.js → home-C7Nc_ynT.js} +1 -1
- package/dist/client/assets/{hooks-abtcLONn.js → hooks-B2j1s3nm.js} +1 -1
- package/dist/client/assets/{hooks-D5z7CgCt.js → hooks-Cb68QwoE.js} +1 -1
- package/dist/client/assets/{index-C4m-Xj9t.js → index-BZ60Q2vF.js} +1 -1
- package/dist/client/assets/{index-BC68yJ9a.js → index-Byp-1yx-.js} +1 -1
- package/dist/client/assets/{index-CHIEfkY6.js → index-C1mE9nWp.js} +1 -1
- package/dist/client/assets/{index-Os5Hiv1r.js → index-CKrLkZIn.js} +1 -1
- package/dist/client/assets/{index-C1pofvkl.js → index-CQDDfSqE.js} +1 -1
- package/dist/client/assets/{index-CZFOUXi8.js → index-CUYQAaOU.js} +1 -1
- package/dist/client/assets/{index-Cm__CFgO.js → index-CZK4_x46.js} +1 -1
- package/dist/client/assets/{index-BQgXOHRB.js → index-CwzlBp8e.js} +1 -1
- package/dist/client/assets/{index-soiZgi77.js → index-CxD5N3g_.js} +1 -1
- package/dist/client/assets/{index-tw-L0pq4.js → index-Df1kyaWx.js} +1 -1
- package/dist/client/assets/{index-DAUnTbKR.js → index-Diborc_9.js} +1 -1
- package/dist/client/assets/{index-CdCU_XIc.js → index-JOfrpEq3.js} +1 -1
- package/dist/client/assets/{index-C-9h82SA.js → index-Lc7giPgZ.js} +1 -1
- package/dist/client/assets/{index-CoJzC8_g.js → index-rDWCi11h.js} +1 -1
- package/dist/client/assets/{index-redirect-BGMUaELH.js → index-redirect-BuWy9Z6S.js} +1 -1
- package/dist/client/assets/{index-Cjhl57C5.js → index-zEbfx_2K.js} +2 -2
- package/dist/client/assets/{infiniteQueryObserver-CTAqrRzL.js → infiniteQueryObserver-sPk7QDR1.js} +1 -1
- package/dist/client/assets/{infra-billing-D-R9Zdx8.js → infra-billing-C4xv4inC.js} +1 -1
- package/dist/client/assets/{input-CImpk8th.js → input-BYddSsu_.js} +1 -1
- package/dist/client/assets/{input-DNp0K9zv.js → input-C_NYYd89.js} +1 -1
- package/dist/client/assets/{input-DkPDVfFk.js → input-wjpeVemQ.js} +1 -1
- package/dist/client/assets/{integration-icon-Dq1cJDX8.js → integration-icon-CdbMa5vl.js} +1 -1
- package/dist/client/assets/{label-Bk7iLZH7.js → label-DeeZ_khO.js} +1 -1
- package/dist/client/assets/{last-preview-page-BmfL1c7N.js → last-preview-page-Bs7lLAHU.js} +1 -1
- package/dist/client/assets/{layout-Ci3akdxf.js → layout-CGB6UTjd.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CqdHGYTA.js → legacy-agents-deep-KBnG2EVw.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BqiddEXn.js → legacy-main-redirect-DpIQ14bR.js} +1 -1
- package/dist/client/assets/{library-BUfXzmmk.js → library-CceKr55E.js} +1 -1
- package/dist/client/assets/{login-BUL2HRoD.js → login-Ch-rMjOh.js} +1 -1
- package/dist/client/assets/{markdown-Cqyyk371.js → markdown-CxV2eB4e.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-zIU2-SQD.js → mcp-app-renderer-BV8BWgXU.js} +1 -1
- package/dist/client/assets/{mcp-oauth-qvcFIOHE.js → mcp-oauth-YLkkgmwu.js} +1 -1
- package/dist/client/assets/{members-B2ASFRpM.js → members-Cf9YeQtc.js} +1 -1
- package/dist/client/assets/{message-templates-BvJNSKe2.js → message-templates-BdE6dkny.js} +1 -1
- package/dist/client/assets/{mini-report-page-GL8Uh_Lo.js → mini-report-page-BGQ5cRDa.js} +1 -1
- package/dist/client/assets/{mock-board-D2--sNwu.js → mock-board-BKlTNwzx.js} +3 -3
- package/dist/client/assets/{monaco-editor-Bg8UPXit.js → monaco-editor-CM8IdJ5Z.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C9igDEpY.js → monitoring-stats-row-B8YXJIqJ.js} +1 -1
- package/dist/client/assets/{multi-select-B0yDI0nj.js → multi-select-CAw7QXMy.js} +1 -1
- package/dist/client/assets/{mustache-CDAsLK2v.js → mustache-BYUJMv8S.js} +1 -1
- package/dist/client/assets/{oauth-callback-D8Lk8lTx.js → oauth-callback-Cx9sp11t.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-P1E8_NRm.js → oauth-callback-ai-provider-Daw9NS6o.js} +1 -1
- package/dist/client/assets/{onboarding-Df5HIECJ.js → onboarding-4smvmYpm.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-IR0sppyV.js → optimistic-project-sidebar-views-BaFWHjow.js} +1 -1
- package/dist/client/assets/{org-file-open-context-Dd47NmeH.js → org-file-open-context--Mwc-yMq.js} +1 -1
- package/dist/client/assets/{organization-choice-B_XEkc76.js → organization-choice-CDn7Mna7.js} +1 -1
- package/dist/client/assets/{orgs-BAOnfPU8.js → orgs-D-lV9-X0.js} +1 -1
- package/dist/client/assets/{page-seo-form-DbL4-FYa.js → page-seo-form-BIFPULvd.js} +1 -1
- package/dist/client/assets/{pair-BHYz9F-Z.js → pair-DQUrmxV6.js} +1 -1
- package/dist/client/assets/{plan-ladder-Cqfgwdfc.js → plan-ladder-87xBAt0E.js} +1 -1
- package/dist/client/assets/{popover-Bn0xXLy8.js → popover-Bq4WOviU.js} +1 -1
- package/dist/client/assets/{post-calendar-6AuB-9GD.js → post-calendar-NmXDxp_f.js} +1 -1
- package/dist/client/assets/{post-editor-D6gFXTiI.js → post-editor-CyV8-7qm.js} +1 -1
- package/dist/client/assets/{preview-content-BJK2rc2w.js → preview-content-lLPCW88q.js} +1 -1
- package/dist/client/assets/{preview-dialog-CdfWw2XK.js → preview-dialog-CYHTLvBD.js} +1 -1
- package/dist/client/assets/{primitives-CSJauIt5.js → primitives-B7wT1jpV.js} +1 -1
- package/dist/client/assets/{profile-BUYSJtW_.js → profile-2MWkYt1W.js} +1 -1
- package/dist/client/assets/{project-app-view-BAHsn_eP.js → project-app-view-DnD6ABvi.js} +1 -1
- package/dist/client/assets/{project-feed-La6-iUzD.js → project-feed-9ymkpfIM.js} +1 -1
- package/dist/client/assets/{project-icon-CiuTzDLi.js → project-icon-CnsTRQs7.js} +1 -1
- package/dist/client/assets/project-reports-ucVO7tht.js +1 -0
- package/dist/client/assets/project-tasks-BkwjlR7M.js +1 -0
- package/dist/client/assets/{prompts-BAZWbRxz.js → prompts-BTWUWzEW.js} +1 -1
- package/dist/client/assets/record-editor-fArJyWhH.js +1 -0
- package/dist/client/assets/{redirect-editor-9oPfVcJw.js → redirect-editor-BrOsxFBz.js} +1 -1
- package/dist/client/assets/registry-hucrdHOL.js +2 -0
- package/dist/client/assets/{registry-layout-CrG4EYUR.js → registry-layout-ybJm-zJ1.js} +1 -1
- package/dist/client/assets/reports-DK2KYT30.js +1 -0
- package/dist/client/assets/{reports-DHS4fi6t.js → reports-gjPyOi1V.js} +1 -1
- package/dist/client/assets/{reports-onboarding-BtdzeKZT.js → reports-onboarding-zrsVhRJJ.js} +1 -1
- package/dist/client/assets/{reports-tab-B5bMQgk-.js → reports-tab-CSxOpMBu.js} +2 -2
- package/dist/client/assets/{repositories-DbRCe9LF.js → repositories-DhB53p4v.js} +1 -1
- package/dist/client/assets/{repository-import-picker-Bo_Cabzz.js → repository-import-picker-G5-hX7A2.js} +1 -1
- package/dist/client/assets/{repository-picker-CRqY_3jm.js → repository-picker-CqYIk9Jh.js} +1 -1
- package/dist/client/assets/{require-capability-CLz-loNQ.js → require-capability-ClQfFfk3.js} +1 -1
- package/dist/client/assets/{required-auth-layout-t1gcmOkS.js → required-auth-layout-DSCX2iMO.js} +1 -1
- package/dist/client/assets/{reset-password-C_PBrpSa.js → reset-password-BwIVBrTT.js} +1 -1
- package/dist/client/assets/{resizable-CTEnH3yu.js → resizable-Cfhvj7Gy.js} +1 -1
- package/dist/client/assets/{review-settings-CIZvhdQE.js → review-settings-DYJgy9wi.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-DdZo0zBm.js → rich-text-link-control-D3Q8eCOs.js} +1 -1
- package/dist/client/assets/{roles-D7Yxadr5.js → roles-IFbGtvaS.js} +1 -1
- package/dist/client/assets/{route-BhbKY_6m.js → route-3RXQg1rv.js} +1 -1
- package/dist/client/assets/{route-DMLSQe3Y.js → route-BPQK-oME.js} +1 -1
- package/dist/client/assets/{route-aV7nBxG9.js → route-Dio936vS.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-CNau3nKH.js → runnable-block-editor-DOljNlCw.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-Dhs5hLj1.js → sandbox-lifecycle-context-tfkoXu0L.js} +1 -1
- package/dist/client/assets/{schema-BTHH8GSh.js → schema-CpmuStS2.js} +1 -1
- package/dist/client/assets/{scroll-area-YQLTU6PQ.js → scroll-area-BUwrzwMz.js} +1 -1
- package/dist/client/assets/{search-input-Cx2Izgwg.js → search-input-CT4D4zLR.js} +1 -1
- package/dist/client/assets/{secrets-B1YWh_ht.js → secrets-DS5_dizq.js} +1 -1
- package/dist/client/assets/{sections-editor-C4NhZuXp.js → sections-editor-BxFRL2DR.js} +1 -1
- package/dist/client/assets/{select-C5Qbx8Kw.js → select-5CD79m_H.js} +1 -1
- package/dist/client/assets/{select-model-CIR4DebA.js → select-model-BBl_olhQ.js} +1 -1
- package/dist/client/assets/{seo-editor-b4BYh3S0.js → seo-editor-pCv-C3du.js} +1 -1
- package/dist/client/assets/{settings-tab-wJidOo3Q.js → settings-tab-BDnT7VBW.js} +1 -1
- package/dist/client/assets/{sheet-DvqFDAlT.js → sheet-D-CTuaTd.js} +1 -1
- package/dist/client/assets/{shell-layout-knqcStSb.js → shell-layout-DVwBW-8f.js} +1 -1
- package/dist/client/assets/{sidebar-CPIvGktg.js → sidebar-CnKCwozZ.js} +1 -1
- package/dist/client/assets/{skill-preview-Dr3uDA0q.js → skill-preview-Br1NvL8D.js} +1 -1
- package/dist/client/assets/{skills-B7mrIhFJ.js → skills-DQbBqdux.js} +1 -1
- package/dist/client/assets/{sso-JfSG6sY-.js → sso-BVr60kN3.js} +1 -1
- package/dist/client/assets/{store-CRU_7Bvk.js → store-aWb7HUd8.js} +1 -1
- package/dist/client/assets/store-registry-9bzkx-m3.js +2 -0
- package/dist/client/assets/{switch-Cf30aXkY.js → switch-ClJqQzki.js} +1 -1
- package/dist/client/assets/{synced-repos-C5RH3GVW.js → synced-repos-D7iLaGtW.js} +1 -1
- package/dist/client/assets/{table-D6IMkB4T.js → table-Da5i0DDT.js} +1 -1
- package/dist/client/assets/{tabs-DSOAK--9.js → tabs-CXXWDRig.js} +1 -1
- package/dist/client/assets/{task-board-DpuhnKzF.js → task-board-DgAEwWBa.js} +1 -1
- package/dist/client/assets/{task-route-CPm3yGLT.js → task-route-D9BNUMx2.js} +1 -1
- package/dist/client/assets/{task-status-CesK2f9G.js → task-status-Bt8iPML5.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-DWWMZZdU.js → taskboard-analytics-B88KUIje.js} +1 -1
- package/dist/client/assets/{tasks-BGbHPX0w.js → tasks-B9UZq7u-.js} +1 -1
- package/dist/client/assets/tasks-Dn9XFRM-.js +1 -0
- package/dist/client/assets/{textarea-DXDx4Cy0.js → textarea-Cmx8DtdI.js} +1 -1
- package/dist/client/assets/{thread-intent-Cdmdi4Qs.js → thread-intent-B0Twy-Y4.js} +1 -1
- package/dist/client/assets/{thread-route-CnHTxNkK.js → thread-route-BqVXF90R.js} +1 -1
- package/dist/client/assets/{thread-route-BMICHdvv.js → thread-route-DS6Bc_kc.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BGNoSu7i.js → thread-sheet-body-FLXrrZaF.js} +1 -1
- package/dist/client/assets/{toggle-group-Cj0z3PRY.js → toggle-group-DjgZ3Fw8.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BehOLAeE.js → toolbar-icon-button-BnICfdNs.js} +1 -1
- package/dist/client/assets/{tooltip-BDUrOxgN.js → tooltip-CgGnYGtj.js} +1 -1
- package/dist/client/assets/{track-BJHbd99y.js → track-CLzcG0zs.js} +1 -1
- package/dist/client/assets/{types-DlfDRNRB.js → types-_4eK3VIa.js} +1 -1
- package/dist/client/assets/{usage-stats-nuoZXpxw.js → usage-stats-BCiFcxmR.js} +1 -1
- package/dist/client/assets/{use-ai-providers-QvFz5SFX.js → use-ai-providers-D1prvpLy.js} +1 -1
- package/dist/client/assets/{use-automations-jwtTHLHf.js → use-automations-DQOVDERk.js} +1 -1
- package/dist/client/assets/{use-autosave-D5Khb0ju.js → use-autosave-CgR3xjdo.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DDWKSdwn.js → use-connect-companion-VfoTFThS.js} +1 -1
- package/dist/client/assets/{use-connection-CpOBycNm.js → use-connection-DYvm3CFt.js} +1 -1
- package/dist/client/assets/{use-copy-M0GDas2Q.js → use-copy-ryXIsHmg.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BFxHh87r.js → use-create-virtual-mcp-CBo7Jhzx.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BAJylOmL.js → use-date-fns-locale-BW93JelV.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CAXyZd0j.js → use-debounced-autosave-XooE91Oe.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CVkWNti9.js → use-debounced-value-o4QMDSqG.js} +1 -1
- package/dist/client/assets/{use-deco-credits-D4THYOkS.js → use-deco-credits-CA-pBDW2.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DlUI-60k.js → use-decopilot-events-CQEvF74O.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BznnJgfw.js → use-delete-connection-TJEFMdZF.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Buoxj9IO.js → use-deployment-admin-B__P-eVb.js} +1 -1
- package/dist/client/assets/{use-entitlements-BP7WwVM_.js → use-entitlements-CtB8_mAv.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-Cu15Ye_n.js → use-fast-preview-draft-url-B-DOK-ru.js} +1 -1
- package/dist/client/assets/{use-file-configs-CyU7Mcil.js → use-file-configs-COihRw2M.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-AtjP0SZW.js → use-infinite-scroll-BaFLbkIz.js} +1 -1
- package/dist/client/assets/{use-join-requests-aG0T3ECI.js → use-join-requests-DqOkUzx0.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-IIO818_j.js → use-main-panel-tabs-BlyDpOj8.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-bcJwzpw7.js → use-mcp-auth-status-n6X-ANPT.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Bf0VpOBw.js → use-mcp-client-Dpy2Y_w9.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DxcgJEJ7.js → use-mcp-prompts-Dh294adh.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DhZM9sTC.js → use-mcp-tools-DErOx9G_.js} +1 -1
- package/dist/client/assets/{use-members-CsAzsmBA.js → use-members-p6-jNNXz.js} +1 -1
- package/dist/client/assets/{use-mobile-C5SrWG9H.js → use-mobile-DI9_UYOG.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DOYg6fyU.js → use-navigate-to-agent--7G-5-aE.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-Cjz--xRu.js → use-open-billing-url-DZl00gsn.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-C16MEGGe.js → use-org-auth-client-CwCwgSJe.js} +1 -1
- package/dist/client/assets/{use-org-fs-BSDHmLev.js → use-org-fs-HohNEA-L.js} +1 -1
- package/dist/client/assets/{use-org-notice-BALWnbFe.js → use-org-notice-D1-emMG_.js} +1 -1
- package/dist/client/assets/{use-org-sso-Dpa7KwXX.js → use-org-sso-htHtfKs8.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Cog-K9KN.js → use-organization-roles-ff44n98g.js} +1 -1
- package/dist/client/assets/{use-organization-settings-pqtCEzuj.js → use-organization-settings-BIkwHnT4.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-bhAOxlzp.js → use-panel-navigate-jpI-ng6I.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-DnirX6kM.js → use-project-native-view-presence-lTz9hDFO.js} +1 -1
- package/dist/client/assets/{use-project-scope-BfeOcOX-.js → use-project-scope-1l5jykdC.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BJotyFay.js → use-registry-connections-BC2lTMUS.js} +1 -1
- package/dist/client/assets/{use-releases-CjPEhpWE.js → use-releases-BIlaWt_C.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-R9_oa5XU.js → use-reports-diagnostic-D3ATdgVr.js} +1 -1
- package/dist/client/assets/{use-route-default-main-DO9nAIOF.js → use-route-default-main-Bn6e9_Md.js} +1 -1
- package/dist/client/assets/{use-secrets-Do9S2OuA.js → use-secrets-CQys3abK.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DTsnvRL8.js → use-section-preview-base-DdpOVR5d.js} +1 -1
- package/dist/client/assets/{use-session-runtime--RMOkDN5.js → use-session-runtime-DfUQQIgJ.js} +1 -1
- package/dist/client/assets/{use-tags-C-xYWG0d.js → use-tags-DrMO9XPS.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DqKWhXe3.js → use-task-board-analytics--aa1q8Xf.js} +1 -1
- package/dist/client/assets/{use-task-metadata-Bm567Cyu.js → use-task-metadata-C0KiQ70L.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DA9fNv-d.js → use-thread-outputs-Cr0IwDUd.js} +1 -1
- package/dist/client/assets/{use-view-mode-mEqX4oRI.js → use-view-mode-Bj8v6WKY.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BvrPyGzX.js → use-virtual-mcp-4ZF94-K-.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BMvdD4sR.js +1 -0
- package/dist/client/assets/{useQueries-DqQ6INqi.js → useQueries-BPL3ni2A.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DxuC0K9H.js +1 -0
- package/dist/client/assets/{users-BS3mOvNq.js → users-DB_UA5AH.js} +1 -1
- package/dist/client/assets/{utils-DAYUNxCI.js → utils-CirfulKG.js} +1 -1
- package/dist/client/assets/{variant-calendar-D_T3c3MC.js → variant-calendar-Dr5L9BOb.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-BSFlzIhP.js → variant-matcher-override-vR8HAnnC.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CzqFE_Lp.js → view-mode-toggle-wxXVeUM6.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CG3JbZx8.js → virtual-mcp-Beu0ehlX.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +581 -581
- package/dist/server/server.js +377 -377
- package/package.json +1 -1
- package/dist/client/assets/agent-app-huXdhJP6.js +0 -1
- package/dist/client/assets/agent-deck-DGboeeyf.js +0 -1
- package/dist/client/assets/agent-file-B8pH22Ku.js +0 -1
- package/dist/client/assets/agent-library-file-D-88nLF8.js +0 -1
- package/dist/client/assets/agent-settings-BzADpWtq.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CGdhTJXE.js +0 -2
- package/dist/client/assets/agent-view-BZUeqD_l.js +0 -1
- package/dist/client/assets/api-keys-DfV1qFa5.js +0 -1
- package/dist/client/assets/app-editor-CK2-PFMD.js +0 -1
- package/dist/client/assets/automations-CfjjbeEx.js +0 -1
- package/dist/client/assets/category-editor-CG20ku6V.js +0 -1
- package/dist/client/assets/project-reports-jZGDkYDU.js +0 -1
- package/dist/client/assets/project-tasks-BDg0EJtT.js +0 -1
- package/dist/client/assets/record-editor-C96ND1CU.js +0 -1
- package/dist/client/assets/registry-rXZoWB8a.js +0 -2
- package/dist/client/assets/reports-C9YET_Fq.js +0 -1
- package/dist/client/assets/store-registry-Q0TOzx2-.js +0 -2
- package/dist/client/assets/tasks-DTqkQgJb.js +0 -1
- package/dist/client/assets/useInfiniteQuery-C-lwb5Ji.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CjJ_vWiS.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as W,b as q,r as U,l as ue,j as t,t as ie,B as X,h as lt,M as $e,E as ze,F as ks,eQ as hn,L as gn,p as vn,dP as Ze,a3 as bn,dO as tt,dN as st,_ as vt,m as jn,K as Ms,eR as yn,eS as wn,eT as Sn,eU as Nn,d as Ot,u as Cn,o as ve,cE as kn,eC as Mn,eV as _n,ax as _s,a as Tn,eW as Ts,eX as Ds,as as Dn,az as fe,D as Vn,n as In,ad as An,ac as On,P as ut,eY as Oe,ag as Pn}from"./index-Cjhl57C5.js";import{g as $n}from"./extract-connection-data-C8zB3-0T.js";import{a as Fn}from"./chat-context-H28jTcB6.js";import{U as En,b as zn}from"./build-improve-prompt-doc-C9jBTscU.js";import{E as Rn}from"./empty-state-Bi9IU32F.js";import{u as Ln}from"./shell-layout-knqcStSb.js";import{g as bt,n as Bn,a as Xt,e as Un,u as Yn,f as Kn}from"./use-date-fns-locale-BAJylOmL.js";import{a as Pt,b as Vs,u as Wn}from"./use-connection-CpOBycNm.js";import{b as Is,a as As,c as Os,g as Gn}from"./use-virtual-mcp-BvrPyGzX.js";import{a as Hn,i as Jt}from"./mcp-oauth-qvcFIOHE.js";import{f as qn,e as Qn,b as Xn,A as Jn,a as Zn,d as ei,c as ti,g as si}from"./alert-dialog-DfGZ77rh.js";import{D as qe,b as Qe,c as at,d as rt,e as $t,h as Ps}from"./dialog-SKkzdrcZ.js";import{T as pt}from"./textarea-DXDx4Cy0.js";import{c as je,T as ye,a as we}from"./tooltip-BDUrOxgN.js";import{c as ni}from"./UserSquare-D-v_LgOa.js";import{aD as Ft,aO as ii,aP as Et,aQ as $s,aR as Fs,a2 as zt,aS as Dt,aT as Ct,aU as Zt,A as es,w as li,aV as ai,aW as ri,aX as oi,aY as ci,aZ as di,aq as ui,af as mi,f as Es,e as ts,n as fi,j as pi,h as xi,c as zs,a_ as ss,ap as hi,R as gi,u as vi,a$ as bi,a4 as ji}from"./agent-icon-Cyx7Smko.js";import{i as yi}from"./Play-BolLrTAn.js";import{s as Pe}from"./Plus-C5azC59K.js";import{t as ft}from"./Stars01-DTStBsXP.js";import{s as nt}from"./Trash01-DPQmLNZV.js";import{u as ns}from"./use-debounced-autosave-CAXyZd0j.js";import{I as Se}from"./input-CImpk8th.js";import{a as Rt,b as Lt,P as Bt}from"./popover-Bn0xXLy8.js";import{S as Rs}from"./scroll-area-YQLTU6PQ.js";import{i as xt}from"./SearchMd-Ms_xvSfF.js";import{i as wi}from"./Upload01-D-20AdeD.js";import{A as Si}from"./add-connection-dialog-Bwzbw2rJ.js";import{c as Ls,D as Bs,b as Us,a as Ge,h as is,i as ls,j as as}from"./dropdown-menu-DRuEZVW9.js";import{i as Ni}from"./Share07-BypmcbEF.js";import{F as rs}from"./file-type-icon-CMiynV8b.js";import{h as Ci,i as ki,j as Mi,k as _i}from"./use-org-fs-BSDHmLev.js";import{I as Xe}from"./integration-icon-Dq1cJDX8.js";import{C as Ys}from"./checkbox-D_GODf3h.js";import{S as Ti}from"./search-input-Cx2Izgwg.js";import{b as Me,a as _e,c as pe,d as Te,S as De}from"./select-C5Qbx8Kw.js";import{s as Ut}from"./XClose-Bw0VS-dj.js";import{C as Di}from"./collection-tabs-DAqaNYVU.js";import{T as Ks,u as Ws}from"./use-mcp-auth-status-bcJwzpw7.js";import{u as jt}from"./use-mcp-client-Bf0VpOBw.js";import{a as Gs}from"./use-mcp-tools-DhZM9sTC.js";import{u as Vi}from"./use-mcp-prompts-DxcgJEJ7.js";import{g as Ii}from"./connection-slug-CITJ0kGN.js";import{a as Ai}from"./Settings02-BLcAotUO.js";import{t as Hs}from"./utils-CVEq3hMx.js";import{S as yt}from"./switch-Cf30aXkY.js";import{i as Vt}from"./ChevronRight-DK_MoZ-7.js";import{i as Oi}from"./Printer-Dn2De3ak.js";import{e as Pi}from"./TrendUp01-uTlAwt0S.js";import{i as $i}from"./DotsVertical-Dyzdr42E.js";import{a as Fi}from"./Image01-7_HSDHV3.js";import{i as Ei}from"./Monitor01-BoIweS2p.js";import{g as zi}from"./types-DlfDRNRB.js";import{b as ht,g as Ri,d as Li}from"./use-project-scope-BfeOcOX-.js";import{a as Bi}from"./use-panel-navigate-bhAOxlzp.js";import{u as Ui,e as It,r as At,p as Yi,g as Ki,s as Wi,t as Gi,h as Hi,a as qi}from"./use-project-native-view-presence-DnirX6kM.js";import{a as qs,u as Qi,i as Xi,o as Ji,r as os,p as Zi,w as el,b as cs}from"./optimistic-project-sidebar-views-IR0sppyV.js";import{b as ds,c as tl,d as sl,e as nl,B as il,a as ll}from"./breadcrumb-CVSmj3i3.js";import{V as al,E as wt,S as Qs,r as Xs,C as rl,w as ol}from"./virtual-mcp-CG3JbZx8.js";import{s as Js}from"./slugify-CEUa2lfQ.js";import{b as cl,a as dl,D as ul}from"./drawer-BleKwXKQ.js";import{u as ml}from"./use-mobile-C5SrWG9H.js";import{i as ot}from"./Check-Dnz3uW0f.js";import{a as St}from"./Copy01-l6PfB431.js";import{i as Yt}from"./Key01-ti2CpCiW.js";import{d as ct}from"./backoff-8mStPHYB.js";import{g as Zs}from"./github-repo-BknN0SVI.js";import{i as fl}from"./GitBranch01-CRUhFeKk.js";import{R as pl}from"./repository-import-picker-Bo_Cabzz.js";import{b as xl}from"./sandbox-url-D3mC8qhT.js";import{L as me}from"./label-Bk7iLZH7.js";import{s as hl}from"./User01-BA1LEBvQ.js";import{t as gl}from"./Users01-BpRvBK8_.js";import{u as en,a as tn}from"./use-secrets-Do9S2OuA.js";import{o as us}from"./omit-sandbox-map-jj4lCB2U.js";import{G as vl}from"./github-icon-TtZ8EUXE.js";import{e as bl,s as jl,a as yl}from"./thread-intent-Cdmdi4Qs.js";import{r as wl}from"./serial-task-queue-CGOeQgpr.js";import{t as Fe,c as He,m as Sl,a as sn}from"./differenceInSeconds-C3x8sHUj.js";function it(l,e){const s=bt(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=Fe(l,e?.in),a=i.getDay(),d=(a<n?7:0)+a-n;return i.setDate(i.getDate()-d),i.setHours(0,0,0,0),i}function gt(l,e){return it(l,{...e,weekStartsOn:1})}function nn(l,e){const s=Fe(l,e?.in),n=s.getFullYear(),i=He(s,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const a=gt(i),d=He(s,0);d.setFullYear(n,0,4),d.setHours(0,0,0,0);const r=gt(d);return s.getTime()>=a.getTime()?n+1:s.getTime()>=r.getTime()?n:n-1}function ms(l,e){const s=Fe(l,e?.in);return s.setHours(0,0,0,0),s}function Nl(l,e,s){const[n,i]=Bn(s?.in,l,e),a=ms(n),d=ms(i),r=+a-Xt(a),x=+d-Xt(d);return Math.round((r-x)/Sl)}function Cl(l,e){const s=nn(l,e),n=He(l,0);return n.setFullYear(s,0,4),n.setHours(0,0,0,0),gt(n)}function kl(l){return l instanceof Date||typeof l=="object"&&Object.prototype.toString.call(l)==="[object Date]"}function Ml(l){return!(!kl(l)&&typeof l!="number"||isNaN(+Fe(l)))}function _l(l,e){const s=Fe(l,e?.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}function Tl(l,e){const s=Fe(l,e?.in);return Nl(s,_l(s))+1}function Dl(l,e){const s=Fe(l,e?.in),n=+gt(s)-+Cl(s);return Math.round(n/sn)+1}function ln(l,e){const s=Fe(l,e?.in),n=s.getFullYear(),i=bt(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,d=He(e?.in||l,0);d.setFullYear(n+1,0,a),d.setHours(0,0,0,0);const r=it(d,e),x=He(e?.in||l,0);x.setFullYear(n,0,a),x.setHours(0,0,0,0);const o=it(x,e);return+s>=+r?n+1:+s>=+o?n:n-1}function Vl(l,e){const s=bt(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,i=ln(l,e),a=He(e?.in||l,0);return a.setFullYear(i,0,n),a.setHours(0,0,0,0),it(a,e)}function Il(l,e){const s=Fe(l,e?.in),n=+it(s,e)-+Vl(s,e);return Math.round(n/sn)+1}function re(l,e){const s=l<0?"-":"",n=Math.abs(l).toString().padStart(e,"0");return s+n}const Ee={y(l,e){const s=l.getFullYear(),n=s>0?s:1-s;return re(e==="yy"?n%100:n,e.length)},M(l,e){const s=l.getMonth();return e==="M"?String(s+1):re(s+1,2)},d(l,e){return re(l.getDate(),e.length)},a(l,e){const s=l.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];default:return s==="am"?"a.m.":"p.m."}},h(l,e){return re(l.getHours()%12||12,e.length)},H(l,e){return re(l.getHours(),e.length)},m(l,e){return re(l.getMinutes(),e.length)},s(l,e){return re(l.getSeconds(),e.length)},S(l,e){const s=e.length,n=l.getMilliseconds(),i=Math.trunc(n*Math.pow(10,s-3));return re(i,e.length)}},We={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},fs={G:function(l,e,s){const n=l.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"});case"GGGGG":return s.era(n,{width:"narrow"});default:return s.era(n,{width:"wide"})}},y:function(l,e,s){if(e==="yo"){const n=l.getFullYear(),i=n>0?n:1-n;return s.ordinalNumber(i,{unit:"year"})}return Ee.y(l,e)},Y:function(l,e,s,n){const i=ln(l,n),a=i>0?i:1-i;if(e==="YY"){const d=a%100;return re(d,2)}return e==="Yo"?s.ordinalNumber(a,{unit:"year"}):re(a,e.length)},R:function(l,e){const s=nn(l);return re(s,e.length)},u:function(l,e){const s=l.getFullYear();return re(s,e.length)},Q:function(l,e,s){const n=Math.ceil((l.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return re(n,2);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});default:return s.quarter(n,{width:"wide",context:"formatting"})}},q:function(l,e,s){const n=Math.ceil((l.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return re(n,2);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});default:return s.quarter(n,{width:"wide",context:"standalone"})}},M:function(l,e,s){const n=l.getMonth();switch(e){case"M":case"MM":return Ee.M(l,e);case"Mo":return s.ordinalNumber(n+1,{unit:"month"});case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});default:return s.month(n,{width:"wide",context:"formatting"})}},L:function(l,e,s){const n=l.getMonth();switch(e){case"L":return String(n+1);case"LL":return re(n+1,2);case"Lo":return s.ordinalNumber(n+1,{unit:"month"});case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});default:return s.month(n,{width:"wide",context:"standalone"})}},w:function(l,e,s,n){const i=Il(l,n);return e==="wo"?s.ordinalNumber(i,{unit:"week"}):re(i,e.length)},I:function(l,e,s){const n=Dl(l);return e==="Io"?s.ordinalNumber(n,{unit:"week"}):re(n,e.length)},d:function(l,e,s){return e==="do"?s.ordinalNumber(l.getDate(),{unit:"date"}):Ee.d(l,e)},D:function(l,e,s){const n=Tl(l);return e==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):re(n,e.length)},E:function(l,e,s){const n=l.getDay();switch(e){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},e:function(l,e,s,n){const i=l.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return re(a,2);case"eo":return s.ordinalNumber(a,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(l,e,s,n){const i=l.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return re(a,e.length);case"co":return s.ordinalNumber(a,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(l,e,s){const n=l.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return re(i,e.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},a:function(l,e,s){const i=l.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(l,e,s){const n=l.getHours();let i;switch(n===12?i=We.noon:n===0?i=We.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(l,e,s){const n=l.getHours();let i;switch(n>=17?i=We.evening:n>=12?i=We.afternoon:n>=4?i=We.morning:i=We.night,e){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(l,e,s){if(e==="ho"){let n=l.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return Ee.h(l,e)},H:function(l,e,s){return e==="Ho"?s.ordinalNumber(l.getHours(),{unit:"hour"}):Ee.H(l,e)},K:function(l,e,s){const n=l.getHours()%12;return e==="Ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},k:function(l,e,s){let n=l.getHours();return n===0&&(n=24),e==="ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},m:function(l,e,s){return e==="mo"?s.ordinalNumber(l.getMinutes(),{unit:"minute"}):Ee.m(l,e)},s:function(l,e,s){return e==="so"?s.ordinalNumber(l.getSeconds(),{unit:"second"}):Ee.s(l,e)},S:function(l,e){return Ee.S(l,e)},X:function(l,e,s){const n=l.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return xs(n);case"XXXX":case"XX":return Be(n);default:return Be(n,":")}},x:function(l,e,s){const n=l.getTimezoneOffset();switch(e){case"x":return xs(n);case"xxxx":case"xx":return Be(n);default:return Be(n,":")}},O:function(l,e,s){const n=l.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ps(n,":");default:return"GMT"+Be(n,":")}},z:function(l,e,s){const n=l.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ps(n,":");default:return"GMT"+Be(n,":")}},t:function(l,e,s){const n=Math.trunc(+l/1e3);return re(n,e.length)},T:function(l,e,s){return re(+l,e.length)}};function ps(l,e=""){const s=l>0?"-":"+",n=Math.abs(l),i=Math.trunc(n/60),a=n%60;return a===0?s+String(i):s+String(i)+e+re(a,2)}function xs(l,e){return l%60===0?(l>0?"-":"+")+re(Math.abs(l)/60,2):Be(l,e)}function Be(l,e=""){const s=l>0?"-":"+",n=Math.abs(l),i=re(Math.trunc(n/60),2),a=re(n%60,2);return s+i+e+a}const hs=(l,e)=>{switch(l){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},an=(l,e)=>{switch(l){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Al=(l,e)=>{const s=l.match(/(P+)(p+)?/)||[],n=s[1],i=s[2];if(!i)return hs(l,e);let a;switch(n){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",hs(n,e)).replace("{{time}}",an(i,e))},Ol={p:an,P:Al},Pl=/^D+$/,$l=/^Y+$/,Fl=["D","DD","YY","YYYY"];function El(l){return Pl.test(l)}function zl(l){return $l.test(l)}function Rl(l,e,s){const n=Ll(l,e,s);if(console.warn(n),Fl.includes(l))throw new RangeError(n)}function Ll(l,e,s){const n=l[0]==="Y"?"years":"days of the month";return`Use \`${l.toLowerCase()}\` instead of \`${l}\` (in \`${e}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Bl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ul=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Yl=/^'([^]*?)'?$/,Kl=/''/g,Wl=/[a-zA-Z]/;function Gl(l,e,s){const n=bt(),i=s?.locale??n.locale??Un,a=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,d=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Fe(l,s?.in);if(!Ml(r))throw new RangeError("Invalid time value");let x=e.match(Ul).map(f=>{const m=f[0];if(m==="p"||m==="P"){const u=Ol[m];return u(f,i.formatLong)}return f}).join("").match(Bl).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:Hl(f)};if(fs[m])return{isToken:!0,value:f};if(m.match(Wl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});i.localize.preprocessor&&(x=i.localize.preprocessor(r,x));const o={firstWeekContainsDate:a,weekStartsOn:d,locale:i};return x.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!s?.useAdditionalWeekYearTokens&&zl(m)||!s?.useAdditionalDayOfYearTokens&&El(m))&&Rl(m,e,String(l));const u=fs[m[0]];return u(r,m,i.localize,o)}).join("")}function Hl(l){const e=l.match(Yl);return e?e[1].replace(Kl,"'"):l}function ql(l){const e=W.c(82),{value:s,onChange:n,onColorChange:i,name:a,size:d,className:r,avatarClassName:x,showHoverOverlay:o,disabled:f}=l,m=d===void 0?"lg":d,u=o===void 0?!0:o,p=f===void 0?!1:f,c=q(),[h,g]=U.useState(!1),[b,y]=U.useState("icons"),[j,v]=U.useState(""),[N,S]=U.useState("blue");let M;e[0]!==s?(M=Ft(s),e[0]=s,e[1]=M):M=e[1];const w=M,k=w.type==="icon"||w.type==="url"&&w.color?w.color:N;let C;e[2]!==n||e[3]!==k?(C=V=>{n(Ct(V,k))},e[2]=n,e[3]=k,e[4]=C):C=e[4];const _=C;let D;e[5]!==n||e[6]!==i||e[7]!==w.name||e[8]!==w.type||e[9]!==w.url?(D=V=>{S(V),i?.(V),w.type==="icon"?n(Ct(w.name,V)):w.type==="url"&&n(Zt(w.url,V))},e[5]=n,e[6]=i,e[7]=w.name,e[8]=w.type,e[9]=w.url,e[10]=D):D=e[10];const P=D;let I;e[11]!==n||e[12]!==k?(I=V=>{n(Zt(V,k)),g(!1)},e[11]=n,e[12]=k,e[13]=I):I=e[13];const $=I;let A;e[14]!==n||e[15]!==k?(A=()=>{const V=Et(),ee=V[Math.floor(Math.random()*V.length)];n(Ct(ee,k))},e[14]=n,e[15]=k,e[16]=A):A=e[16];const Y=A,K=p?!1:h,Q=p?"cursor-default opacity-50":"cursor-pointer";let R;e[17]!==r||e[18]!==m||e[19]!==Q?(R=ue("relative group overflow-hidden",Q,ii(m),r),e[17]=r,e[18]=m,e[19]=Q,e[20]=R):R=e[20];let H;e[21]!==x||e[22]!==a||e[23]!==m||e[24]!==s?(H=t.jsx(es,{icon:s,name:a,size:m,className:x}),e[21]=x,e[22]=a,e[23]=m,e[24]=s,e[25]=H):H=e[25];let L;e[26]!==p||e[27]!==u?(L=u&&!p&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(li,{size:16,className:"text-white"})}),e[26]=p,e[27]=u,e[28]=L):L=e[28];let T;e[29]!==p||e[30]!==R||e[31]!==H||e[32]!==L?(T=t.jsx(Rt,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":"Change icon",disabled:p,className:R,children:[H,L]})}),e[29]=p,e[30]=R,e[31]=H,e[32]=L,e[33]=T):T=e[33];let O;e[34]!==a||e[35]!==s?(O=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(es,{icon:s,name:a,size:"xl"})}),e[34]=a,e[35]=s,e[36]=O):O=e[36];let G;e[37]!==b?(G=V=>{if(V.key!=="ArrowLeft"&&V.key!=="ArrowRight")return;V.preventDefault();const ee=b==="icons"?"upload":"icons";y(ee),document.getElementById(`icon-picker-tab-${ee}`)?.focus()},e[37]=b,e[38]=G):G=e[38];const z=b==="icons",F=b==="icons"?0:-1;let B;e[39]===Symbol.for("react.memo_cache_sentinel")?(B=()=>y("icons"),e[39]=B):B=e[39];const J=b==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ne;e[40]!==J?(ne=ue("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",J),e[40]=J,e[41]=ne):ne=e[41];let le;e[42]!==c?(le=c("common.iconPicker.iconsTab"),e[42]=c,e[43]=le):le=e[43];let de;e[44]!==z||e[45]!==F||e[46]!==ne||e[47]!==le?(de=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":z,"aria-controls":"icon-picker-panel-icons",tabIndex:F,onClick:B,className:ne,children:le}),e[44]=z,e[45]=F,e[46]=ne,e[47]=le,e[48]=de):de=e[48];const oe=b==="upload",ae=b==="upload"?0:-1;let te;e[49]===Symbol.for("react.memo_cache_sentinel")?(te=()=>y("upload"),e[49]=te):te=e[49];const xe=b==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let he;e[50]!==xe?(he=ue("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",xe),e[50]=xe,e[51]=he):he=e[51];let Ce;e[52]!==c?(Ce=c("common.iconPicker.uploadTab"),e[52]=c,e[53]=Ce):Ce=e[53];let ge;e[54]!==oe||e[55]!==ae||e[56]!==he||e[57]!==Ce?(ge=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":oe,"aria-controls":"icon-picker-panel-upload",tabIndex:ae,onClick:te,className:he,children:Ce}),e[54]=oe,e[55]=ae,e[56]=he,e[57]=Ce,e[58]=ge):ge=e[58];let Ie;e[59]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx("div",{className:"flex-1"}),e[59]=Ie):Ie=e[59];let be;e[60]!==G||e[61]!==de||e[62]!==ge?(be=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:G,children:[de,ge,Ie]}),e[60]=G,e[61]=de,e[62]=ge,e[63]=be):be=e[63];let Ne;e[64]!==P||e[65]!==Y||e[66]!==_||e[67]!==$||e[68]!==w.name||e[69]!==w.type||e[70]!==j||e[71]!==k||e[72]!==b?(Ne=b==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(Zl,{search:j,onSearchChange:v,selectedColor:k,onColorChange:P,onSelectIcon:_,onRandom:Y,currentIconName:w.type==="icon"?w.name:null})}):t.jsx("div",{id:"icon-picker-panel-upload",role:"tabpanel","aria-labelledby":"icon-picker-tab-upload",children:t.jsx(ea,{onUpload:$})}),e[64]=P,e[65]=Y,e[66]=_,e[67]=$,e[68]=w.name,e[69]=w.type,e[70]=j,e[71]=k,e[72]=b,e[73]=Ne):Ne=e[73];let E;e[74]!==O||e[75]!==be||e[76]!==Ne?(E=t.jsx(Lt,{align:"start",className:"w-80 p-0",onOpenAutoFocus:Ql,children:t.jsxs("div",{className:"flex flex-col",children:[O,be,Ne]})}),e[74]=O,e[75]=be,e[76]=Ne,e[77]=E):E=e[77];let se;return e[78]!==T||e[79]!==E||e[80]!==K?(se=t.jsxs(Bt,{open:K,onOpenChange:g,children:[T,E]}),e[78]=T,e[79]=E,e[80]=K,e[81]=se):se=e[81],se}function Ql(l){return l.preventDefault()}function Xl(l){const e=W.c(33),{selectedColor:s,onColorChange:n}=l,i=q(),[a,d]=U.useState(!1);let r,x,o,f,m,u,p;if(e[0]!==a||e[1]!==s){const N=$s(s);x=Bt,u=a,p=d,r=Rt,m=!0,o="button",f=ue("h-6 w-6 rounded-full shrink-0 ring-2 ring-offset-2 ring-offset-background transition-all cursor-pointer hover:scale-110",N.dot,"ring-foreground/20"),e[0]=a,e[1]=s,e[2]=r,e[3]=x,e[4]=o,e[5]=f,e[6]=m,e[7]=u,e[8]=p}else r=e[2],x=e[3],o=e[4],f=e[5],m=e[6],u=e[7],p=e[8];let c;e[9]!==i?(c=i("common.iconPicker.changeColor"),e[9]=i,e[10]=c):c=e[10];let h;e[11]!==i?(h=i("common.iconPicker.changeColor"),e[11]=i,e[12]=h):h=e[12];let g;e[13]!==o||e[14]!==f||e[15]!==c||e[16]!==h?(g=t.jsx("button",{type:o,className:f,title:c,"aria-label":h}),e[13]=o,e[14]=f,e[15]=c,e[16]=h,e[17]=g):g=e[17];let b;e[18]!==r||e[19]!==m||e[20]!==g?(b=t.jsx(r,{asChild:m,children:g}),e[18]=r,e[19]=m,e[20]=g,e[21]=b):b=e[21];let y;e[22]!==n||e[23]!==s?(y=ri.map(N=>t.jsx("button",{type:"button",onClick:()=>{n(N.name),d(!1)},className:ue("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",N.dot,s===N.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:N.name,"aria-label":N.name},N.name)),e[22]=n,e[23]=s,e[24]=y):y=e[24];let j;e[25]!==y?(j=t.jsx(Lt,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:Jl,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:y})}),e[25]=y,e[26]=j):j=e[26];let v;return e[27]!==x||e[28]!==j||e[29]!==u||e[30]!==p||e[31]!==b?(v=t.jsxs(x,{open:u,onOpenChange:p,children:[b,j]}),e[27]=x,e[28]=j,e[29]=u,e[30]=p,e[31]=b,e[32]=v):v=e[32],v}function Jl(l){return l.preventDefault()}function Zl(l){const e=W.c(55),{search:s,onSearchChange:n,selectedColor:i,onColorChange:a,onSelectIcon:d,onRandom:r,currentIconName:x}=l,o=q();let f,m,u,p,c,h,g;if(e[0]!==x||e[1]!==a||e[2]!==r||e[3]!==n||e[4]!==d||e[5]!==s||e[6]!==i||e[7]!==o){const N=Et(),S=$s(i);m=Fs(N,s),h="flex flex-col";let M;e[15]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(xt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=M):M=e[15];let w;e[16]!==n?(w=A=>n(A.target.value),e[16]=n,e[17]=w):w=e[17];let k;e[18]!==o?(k=o("common.iconPicker.filterPlaceholder"),e[18]=o,e[19]=k):k=e[19];let C;e[20]!==s||e[21]!==w||e[22]!==k?(C=t.jsxs("div",{className:"relative flex-1",children:[M,t.jsx(Se,{value:s,onChange:w,placeholder:k,className:"h-8 text-xs pl-7"})]}),e[20]=s,e[21]=w,e[22]=k,e[23]=C):C=e[23];let _;e[24]!==o?(_=o("common.iconPicker.randomIcon"),e[24]=o,e[25]=_):_=e[25];let D;e[26]!==o?(D=o("common.iconPicker.randomIcon"),e[26]=o,e[27]=D):D=e[27];let P;e[28]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(ai,{size:14,className:"text-muted-foreground"}),e[28]=P):P=e[28];let I;e[29]!==r||e[30]!==_||e[31]!==D?(I=t.jsx("button",{type:"button",onClick:r,className:"h-8 w-8 flex items-center justify-center rounded-md border border-border hover:bg-accent transition-colors shrink-0",title:_,"aria-label":D,children:P}),e[29]=r,e[30]=_,e[31]=D,e[32]=I):I=e[32];let $;e[33]!==a||e[34]!==i?($=t.jsx(Xl,{selectedColor:i,onColorChange:a}),e[33]=a,e[34]=i,e[35]=$):$=e[35],e[36]!==I||e[37]!==$||e[38]!==C?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[C,I,$]}),e[36]=I,e[37]=$,e[38]=C,e[39]=g):g=e[39],f=Rs,c="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",p=m.map(A=>{const Y=zt(A);return Y?t.jsx("button",{type:"button",onClick:()=>d(A),className:ue("h-8 w-8 flex items-center justify-center rounded-md transition-colors cursor-pointer",x===A?ue(S.bg,S.text):ue(S.text,"hover:bg-accent")),title:A,"aria-label":Dt(A),children:t.jsx(Y,{size:18})},A):null}),e[0]=x,e[1]=a,e[2]=r,e[3]=n,e[4]=d,e[5]=s,e[6]=i,e[7]=o,e[8]=f,e[9]=m,e[10]=u,e[11]=p,e[12]=c,e[13]=h,e[14]=g}else f=e[8],m=e[9],u=e[10],p=e[11],c=e[12],h=e[13],g=e[14];let b;e[40]!==u||e[41]!==p?(b=t.jsx("div",{className:u,children:p}),e[40]=u,e[41]=p,e[42]=b):b=e[42];let y;e[43]!==m.length||e[44]!==o?(y=m.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:o("common.iconPicker.noIconsFound")}),e[43]=m.length,e[44]=o,e[45]=y):y=e[45];let j;e[46]!==f||e[47]!==c||e[48]!==b||e[49]!==y?(j=t.jsxs(f,{className:c,children:[b,y]}),e[46]=f,e[47]=c,e[48]=b,e[49]=y,e[50]=j):j=e[50];let v;return e[51]!==h||e[52]!==g||e[53]!==j?(v=t.jsxs("div",{className:h,children:[g,j]}),e[51]=h,e[52]=g,e[53]=j,e[54]=v):v=e[54],v}function ea(l){const e=W.c(46),{onUpload:s}=l,n=q(),i=U.useRef(null);let a;e[0]!==s||e[1]!==n?(a=I=>{const $=I.target.files?.[0];if(!$)return;if($.size>2097152){ie.error(n("common.iconPicker.imageTooLarge")),I.target.value="";return}const A=new FileReader;A.onerror=()=>{ie.error(n("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},A.onloadend=()=>{A.readyState===FileReader.DONE&&A.result&&s(A.result),i.current&&(i.current.value="")},A.readAsDataURL($)},e[0]=s,e[1]=n,e[2]=a):a=e[2];const d=a,[r,x]=U.useState("");let o;e[3]!==s||e[4]!==r?(o=()=>{const I=r.trim();I&&(s(I),x(""))},e[3]=s,e[4]=r,e[5]=o):o=e[5];const f=o;let m;e[6]!==d?(m=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:d}),e[6]=d,e[7]=m):m=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i.current?.click(),e[8]=u):u=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(wi,{size:20}),e[9]=p):p=e[9];let c;e[10]!==n?(c=n("common.iconPicker.uploadHint"),e[10]=n,e[11]=c):c=e[11];let h;e[12]!==c?(h=t.jsxs("button",{type:"button",onClick:u,className:"h-24 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-2 text-muted-foreground hover:text-foreground",children:[p,t.jsx("span",{className:"text-xs",children:c})]}),e[12]=c,e[13]=h):h=e[13];let g;e[14]!==n?(g=n("common.iconPicker.or"),e[14]=n,e[15]=g):g=e[15];let b;e[16]!==g?(b=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=b):b=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex-1 h-px bg-border"}),e[18]=y):y=e[18];let j;e[19]!==b?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[b,y]}),e[19]=b,e[20]=j):j=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=I=>x(I.target.value),e[21]=v):v=e[21];let N;e[22]!==n?(N=n("common.iconPicker.pasteUrlPlaceholder"),e[22]=n,e[23]=N):N=e[23];let S;e[24]!==f?(S=I=>{I.key==="Enter"&&(I.preventDefault(),f())},e[24]=f,e[25]=S):S=e[25];let M;e[26]!==r||e[27]!==N||e[28]!==S?(M=t.jsx(Se,{value:r,onChange:v,placeholder:N,className:"h-8 text-xs flex-1",onKeyDown:S}),e[26]=r,e[27]=N,e[28]=S,e[29]=M):M=e[29];let w;e[30]!==r?(w=r.trim(),e[30]=r,e[31]=w):w=e[31];const k=!w;let C;e[32]!==n?(C=n("common.iconPicker.apply"),e[32]=n,e[33]=C):C=e[33];let _;e[34]!==f||e[35]!==k||e[36]!==C?(_=t.jsx(X,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs shrink-0",onClick:f,disabled:k,children:C}),e[34]=f,e[35]=k,e[36]=C,e[37]=_):_=e[37];let D;e[38]!==M||e[39]!==_?(D=t.jsxs("div",{className:"flex items-center gap-1.5",children:[M,_]}),e[38]=M,e[39]=_,e[40]=D):D=e[40];let P;return e[41]!==j||e[42]!==D||e[43]!==m||e[44]!==h?(P=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[m,h,j,D]}),e[41]=j,e[42]=D,e[43]=m,e[44]=h,e[45]=P):P=e[45],P}const rn=25*1024*1024,kt="home",Mt="knowledge";function gs(l){return l==null?"":l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(0)} KB`:`${(l/(1024*1024)).toFixed(1)} MB`}function Re(l){return l.split("/").pop()??l}function ta(l){const e=W.c(64),{form:s}=l,n=q(),{upload:i}=Ci(kt),a=ki(),d=U.useRef(null),[r,x]=U.useState(!1),[o,f]=U.useState(""),[m,u]=U.useState(!1);let p;e[0]!==r?(p={enabled:r},e[0]=r,e[1]=p):p=e[1];const{data:c}=Mi(60,p),h=c===void 0?[]:c;let g;e[2]!==r?(g={enabled:r},e[2]=r,e[3]=g):g=e[3];const{data:b}=_i(g),y=b===void 0?[]:b;let j;e[4]!==s?(j=()=>s.getValues("metadata.knowledge")??[],e[4]=s,e[5]=j):j=e[5];const[v,N]=U.useState(j);let S;e[6]!==s?(S=E=>{N(E),s.setValue("metadata.knowledge",E,{shouldDirty:!0})},e[6]=s,e[7]=S):S=e[7];const M=S;let w;e[8]!==a||e[9]!==v||e[10]!==M||e[11]!==n||e[12]!==i?(w=async E=>{if(!E||E.length===0)return;const se=Array.from(E),V=se.filter(oa),ee=se.filter(ra);if(ee.length>0&&ie.warning(n("virtualMcp.filesSection.fileTooLargeTitle"),{description:n("virtualMcp.filesSection.fileTooLargeDescription",{names:ee.map(aa).join(", ")})}),V.length!==0){try{await i.mutateAsync({dir:Mt,files:V})}catch(Z){const ce=Z;ie.error(ce instanceof Error?ce.message:n("virtualMcp.filesSection.failedUploadFile"));return}M([...v,...V.map(Z=>({id:crypto.randomUUID(),name:Z.name,volume:kt,path:`${Mt}/${Z.name}`,url:a(kt,`${Mt}/${Z.name}`),contentType:Z.type||null,size:Z.size,addedAt:new Date().toISOString()}))])}},e[8]=a,e[9]=v,e[10]=M,e[11]=n,e[12]=i,e[13]=w):w=e[13];const k=w;let C;e[14]!==a||e[15]!==v||e[16]!==M?(C=E=>{v.some(se=>se.volume===E.volume&&se.path===E.path)||(M([...v,{id:crypto.randomUUID(),name:Re(E.path),volume:E.volume,path:E.path,url:a(E.volume,E.path),contentType:null,size:E.size??null,addedAt:new Date().toISOString()}]),x(!1))},e[14]=a,e[15]=v,e[16]=M,e[17]=C):C=e[17];const _=C;let D;e[18]!==a||e[19]!==v||e[20]!==M?(D=E=>{v.some(se=>se.volume===E.volume&&se.path===E.path)||(M([...v,{id:crypto.randomUUID(),name:Re(E.path),kind:"skill",volume:E.volume,path:E.path,url:a(E.volume,E.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),x(!1))},e[18]=a,e[19]=v,e[20]=M,e[21]=D):D=e[21];const P=D;let I;e[22]!==v||e[23]!==M?(I=E=>{M(v.filter(se=>se.id!==E))},e[22]=v,e[23]=M,e[24]=I):I=e[24];const $=I;let A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=E=>{x(E),E&&f("")},e[25]=A):A=e[25];const Y=A;let K;e[26]!==v?(K=new Set(v.map(la)),e[26]=v,e[27]=K):K=e[27];const Q=K,R=o.toLowerCase();let H;e[28]!==Q?(H=E=>!Q.has(`${E.volume}/${E.path}`),e[28]=Q,e[29]=H):H=e[29];const L=h.filter(ia).filter(H).filter(E=>Re(E.path).toLowerCase().includes(R)).slice(0,5);let T;e[30]!==Q?(T=E=>!Q.has(`${E.volume}/${E.path}`),e[30]=Q,e[31]=T):T=e[31];const O=y.filter(T).filter(E=>Re(E.path).toLowerCase().includes(R)).slice(0,5),G=E=>t.jsxs(Ls,{open:r,onOpenChange:Y,children:[t.jsx(Bs,{asChild:!0,children:E}),t.jsxs(Us,{align:"end",className:"w-56",children:[t.jsxs(Ge,{onSelect:()=>{d.current?.click()},children:[t.jsx(oi,{size:16}),n("virtualMcp.filesSection.uploadFile")]}),t.jsxs(is,{children:[t.jsxs(ls,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(Ni,{size:16}),n("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(as,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(xt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:se=>f(se.target.value),onKeyDown:na,placeholder:n("virtualMcp.filesSection.searchFilesPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:L.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noFilesFound")}):L.map(se=>t.jsxs(Ge,{onSelect:()=>_(se),children:[t.jsx(rs,{filename:Re(se.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Re(se.path)}),se.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:gs(se.size)})]},`${se.volume}/${se.path}`))})]})]}),t.jsxs(is,{children:[t.jsxs(ls,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(ft,{size:16}),n("virtualMcp.filesSection.selectSkill")]}),t.jsxs(as,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(xt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:se=>f(se.target.value),onKeyDown:sa,placeholder:n("virtualMcp.filesSection.searchSkillsPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:O.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noSkillsFound")}):O.map(se=>t.jsxs(Ge,{onSelect:()=>P(se),children:[t.jsx(ft,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Re(se.path)})]},`${se.volume}/${se.path}`))})]})]})]})]}),z="flex flex-col gap-3";let F;e[32]!==n?(F=n("virtualMcp.filesSection.filesAndSkills"),e[32]=n,e[33]=F):F=e[33];let B;e[34]!==F?(B=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:F}),e[34]=F,e[35]=B):B=e[35];let J;e[36]!==n?(J=n("virtualMcp.filesSection.description"),e[36]=n,e[37]=J):J=e[37];let ne;e[38]!==J?(ne=t.jsx("p",{className:"text-sm text-muted-foreground",children:J}),e[38]=J,e[39]=ne):ne=e[39];let le;e[40]!==B||e[41]!==ne?(le=t.jsxs("div",{className:"flex flex-col gap-1",children:[B,ne]}),e[40]=B,e[41]=ne,e[42]=le):le=e[42];const de=v.length>0&&G(t.jsxs(X,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(lt,{size:"xs"}):t.jsx(Pe,{size:14}),n("virtualMcp.filesSection.add")]}));let oe;e[43]!==le||e[44]!==de?(oe=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[le,de]}),e[43]=le,e[44]=de,e[45]=oe):oe=e[45];let ae;e[46]!==k?(ae=t.jsx("input",{ref:d,type:"file",multiple:!0,className:"hidden",onChange:E=>{k(E.target.files),E.target.value=""}}),e[46]=k,e[47]=ae):ae=e[47];let te,xe;e[48]===Symbol.for("react.memo_cache_sentinel")?(te=E=>{E.preventDefault(),u(!0)},xe=()=>u(!1),e[48]=te,e[49]=xe):(te=e[48],xe=e[49]);let he;e[50]!==k?(he=E=>{E.preventDefault(),E.stopPropagation(),u(!1),k(E.dataTransfer.files)},e[50]=k,e[51]=he):he=e[51];const Ce=m&&"outline outline-2 outline-dashed outline-primary";let ge;e[52]!==Ce?(ge=ue("flex flex-col gap-2 rounded-lg",Ce),e[52]=Ce,e[53]=ge):ge=e[53];const Ie=v.length===0?G(t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:n("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):v.map(E=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-card",children:[E.kind==="skill"?t.jsx("div",{className:"flex items-center justify-center h-8 w-6.5 shrink-0 rounded-md bg-muted text-muted-foreground",children:t.jsx(ft,{size:16})}):t.jsx(rs,{filename:E.name,className:"h-8 w-6.5 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:E.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:E.kind==="skill"?n("virtualMcp.filesSection.kindSkill"):E.size!=null?gs(E.size):n("virtualMcp.filesSection.kindFile")})]}),t.jsx(X,{variant:"ghost",size:"icon",onClick:()=>$(E.id),"aria-label":n("virtualMcp.filesSection.removeAriaLabel",{name:E.name}),children:t.jsx(nt,{size:16})})]},E.id));let be;e[54]!==te||e[55]!==xe||e[56]!==he||e[57]!==ge||e[58]!==Ie?(be=t.jsx("div",{onDragOver:te,onDragLeave:xe,onDrop:he,className:ge,children:Ie}),e[54]=te,e[55]=xe,e[56]=he,e[57]=ge,e[58]=Ie,e[59]=be):be=e[59];let Ne;return e[60]!==oe||e[61]!==ae||e[62]!==be?(Ne=t.jsxs("section",{className:z,children:[oe,ae,be]}),e[60]=oe,e[61]=ae,e[62]=be,e[63]=Ne):Ne=e[63],Ne}function sa(l){return l.stopPropagation()}function na(l){return l.stopPropagation()}function ia(l){return l.kind!=="dir"}function la(l){return`${l.volume}/${l.path}`}function aa(l){return l.name}function ra(l){return l.size>rn}function oa(l){return l.size<=rn}function ca(l){return l==null?"all":l.length===0?"self":"selected"}function da(l){const e=W.c(88),{form:s,currentAgentId:n}=l,i=q(),{org:a}=$e(),d=Is(),[r,x]=U.useState(!1);let o;e[0]!==s?(o=s.getValues("metadata.subAgents")??null,e[0]=s,e[1]=o):o=e[1];const f=o;let m;e[2]!==f?(m=()=>ca(f),e[2]=f,e[3]=m):m=e[3];const[u,p]=U.useState(m);let c;e[4]!==f?(c=f??[],e[4]=f,e[5]=c):c=e[5];const[h,g]=U.useState(c);let b,y,j,v,N,S;if(e[6]!==d||e[7]!==n||e[8]!==s||e[9]!==u||e[10]!==a||e[11]!==h||e[12]!==i){let C;e[19]!==n||e[20]!==a?(C=te=>te.id!==n&&te.id!==a.id&&te.status==="active",e[19]=n,e[20]=a,e[21]=C):C=e[21],b=d.filter(C);let _;e[22]!==h?(_=te=>h.includes(te.id),e[22]=h,e[23]=_):_=e[23];const D=b.filter(_);let P;e[24]!==s?(P=(te,xe)=>s.setValue("metadata.subAgents",te==="all"?null:te==="self"?[]:xe,{shouldDirty:!0}),e[24]=s,e[25]=P):P=e[25];const I=P;let $;e[26]!==I||e[27]!==h?($=te=>{p(te),I(te,h)},e[26]=I,e[27]=h,e[28]=$):$=e[28];const A=$;let Y;e[29]!==I||e[30]!==h?(Y=te=>{const xe=h.includes(te)?h.filter(he=>he!==te):[...h,te];g(xe),I("selected",xe)},e[29]=I,e[30]=h,e[31]=Y):Y=e[31],y=Y,N="flex flex-col gap-3";let K;e[32]!==i?(K=i("virtualMcp.subAgentsSection.title"),e[32]=i,e[33]=K):K=e[33];let Q;e[34]!==K?(Q=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:K}),e[34]=K,e[35]=Q):Q=e[35];let R;e[36]!==u||e[37]!==i?(R=u==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=u,e[37]=i,e[38]=R):R=e[38];let H;e[39]!==u||e[40]!==i?(H=u==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=u,e[40]=i,e[41]=H):H=e[41];let L;e[42]!==Q||e[43]!==R||e[44]!==H?(L=t.jsxs("div",{className:"flex flex-col gap-1",children:[Q,R,H]}),e[42]=Q,e[43]=R,e[44]=H,e[45]=L):L=e[45];const T=u==="selected"&&D.length>0&&t.jsxs(X,{variant:"outline",size:"sm",onClick:()=>x(!0),children:[t.jsx(Pe,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let O;e[46]!==A?(O=te=>A(te),e[46]=A,e[47]=O):O=e[47];let G;e[48]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(Me,{size:"sm",className:"w-auto",children:t.jsx(_e,{})}),e[48]=G):G=e[48];let z;e[49]!==i?(z=i("virtualMcp.subAgentsSection.anyAgent"),e[49]=i,e[50]=z):z=e[50];let F;e[51]!==z?(F=t.jsx(pe,{value:"all",children:z}),e[51]=z,e[52]=F):F=e[52];let B;e[53]!==i?(B=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=B):B=e[54];let J;e[55]!==B?(J=t.jsx(pe,{value:"selected",children:B}),e[55]=B,e[56]=J):J=e[56];let ne;e[57]!==i?(ne=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=ne):ne=e[58];let le;e[59]!==ne?(le=t.jsx(pe,{value:"self",children:ne}),e[59]=ne,e[60]=le):le=e[60];let de;e[61]!==F||e[62]!==J||e[63]!==le?(de=t.jsxs(Te,{align:"end",children:[F,J,le]}),e[61]=F,e[62]=J,e[63]=le,e[64]=de):de=e[64];let oe;e[65]!==u||e[66]!==O||e[67]!==de?(oe=t.jsxs(De,{value:u,onValueChange:O,children:[G,de]}),e[65]=u,e[66]=O,e[67]=de,e[68]=oe):oe=e[68];let ae;e[69]!==T||e[70]!==oe?(ae=t.jsxs("div",{className:"flex items-center gap-2",children:[T,oe]}),e[69]=T,e[70]=oe,e[71]=ae):ae=e[71],e[72]!==L||e[73]!==ae?(S=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[L,ae]}),e[72]=L,e[73]=ae,e[74]=S):S=e[74],j="flex flex-col gap-2",v=u==="selected"&&(D.length>0?D.map(te=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-background",children:[t.jsx(Xe,{icon:te.icon,name:te.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:te.title}),te.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:te.description})]}),t.jsx(X,{variant:"ghost",size:"icon",onClick:()=>y(te.id),children:t.jsx(Ut,{size:16})})]},te.id)):t.jsxs("button",{type:"button",onClick:()=>x(!0),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.emptyStateMessage")})]})),e[6]=d,e[7]=n,e[8]=s,e[9]=u,e[10]=a,e[11]=h,e[12]=i,e[13]=b,e[14]=y,e[15]=j,e[16]=v,e[17]=N,e[18]=S}else b=e[13],y=e[14],j=e[15],v=e[16],N=e[17],S=e[18];let M;e[75]!==j||e[76]!==v?(M=t.jsx("div",{className:j,children:v}),e[75]=j,e[76]=v,e[77]=M):M=e[77];let w;e[78]!==b||e[79]!==y||e[80]!==r||e[81]!==h?(w=t.jsx(ua,{open:r,onOpenChange:x,candidates:b,selectedIds:h,onToggle:y}),e[78]=b,e[79]=y,e[80]=r,e[81]=h,e[82]=w):w=e[82];let k;return e[83]!==N||e[84]!==S||e[85]!==M||e[86]!==w?(k=t.jsxs("section",{className:N,children:[S,M,w]}),e[83]=N,e[84]=S,e[85]=M,e[86]=w,e[87]=k):k=e[87],k}function ua(l){const e=W.c(39),{open:s,onOpenChange:n,candidates:i,selectedIds:a,onToggle:d}=l,r=q(),[x,o]=U.useState("");let f,m,u,p,c,h,g,b,y;if(e[0]!==i||e[1]!==n||e[2]!==d||e[3]!==s||e[4]!==x||e[5]!==a||e[6]!==r){const S=x.toLowerCase(),M=i.filter(C=>C.title.toLowerCase().includes(S)||C.description?.toLowerCase().includes(S));m=qe,b=s,y=n,f=Qe,c="max-w-md";let w;e[16]!==r?(w=r("virtualMcp.subAgentsSection.title"),e[16]=r,e[17]=w):w=e[17],e[18]!==w?(h=t.jsx(at,{children:t.jsx(rt,{children:w})}),e[18]=w,e[19]=h):h=e[19];let k;e[20]!==r?(k=r("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=r,e[21]=k):k=e[21],e[22]!==x||e[23]!==k?(g=t.jsx(Ti,{value:x,onChange:o,placeholder:k,className:"w-full"}),e[22]=x,e[23]=k,e[24]=g):g=e[24],u="flex flex-col gap-1 max-h-80 overflow-y-auto",p=M.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:r("virtualMcp.subAgentsSection.noAgentsFound")}):M.map(C=>t.jsxs("button",{type:"button",onClick:()=>d(C.id),className:"flex items-center gap-3 px-2 py-2 rounded-lg hover:bg-accent/50 transition-colors cursor-pointer w-full text-left",children:[t.jsx(Ys,{checked:a.includes(C.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(Xe,{icon:C.icon,name:C.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:C.title}),C.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.description})]})]},C.id)),e[0]=i,e[1]=n,e[2]=d,e[3]=s,e[4]=x,e[5]=a,e[6]=r,e[7]=f,e[8]=m,e[9]=u,e[10]=p,e[11]=c,e[12]=h,e[13]=g,e[14]=b,e[15]=y}else f=e[7],m=e[8],u=e[9],p=e[10],c=e[11],h=e[12],g=e[13],b=e[14],y=e[15];let j;e[25]!==u||e[26]!==p?(j=t.jsx("div",{className:u,children:p}),e[25]=u,e[26]=p,e[27]=j):j=e[27];let v;e[28]!==f||e[29]!==c||e[30]!==h||e[31]!==g||e[32]!==j?(v=t.jsxs(f,{className:c,children:[h,g,j]}),e[28]=f,e[29]=c,e[30]=h,e[31]=g,e[32]=j,e[33]=v):v=e[33];let N;return e[34]!==m||e[35]!==b||e[36]!==y||e[37]!==v?(N=t.jsx(m,{open:b,onOpenChange:y,children:v}),e[34]=m,e[35]=b,e[36]=y,e[37]=v,e[38]=N):N=e[38],N}function et(){const l=W.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(lt,{className:"size-6 text-muted-foreground"})}),l[0]=e):e=l[0],e}function mt(l,e){return({error:s})=>s?.message?.includes("Method not found")||s?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ks,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:e("virtualMcp.dependencySelectionDialog.somethingWentWrong")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:s?.message?s.message.length>200?`${s.message.slice(0,200)}...`:s.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function on(l){const e=W.c(23),{item:s,isSelected:n,onToggle:i,disabled:a}=l,d=a?"cursor-not-allowed opacity-50":"cursor-pointer",r=n?"bg-accent/25":"hover:bg-muted/50";let x;e[0]!==d||e[1]!==r?(x=ue("flex items-start gap-3 p-4 rounded-lg transition-colors",d,r),e[0]=d,e[1]=r,e[2]=x):x=e[2];let o;e[3]!==s.name?(o=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=o):o=e[4];let f;e[5]!==s.tags?(f=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=f):f=e[6];let m;e[7]!==o||e[8]!==f?(m=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o,f]}),e[7]=o,e[8]=f,e[9]=m):m=e[9];let u;e[10]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=u):u=e[11];let p;e[12]!==m||e[13]!==u?(p=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[m,u]}),e[12]=m,e[13]=u,e[14]=p):p=e[14];let c;e[15]!==a||e[16]!==n||e[17]!==i?(c=t.jsx(Ys,{checked:n,onCheckedChange:i,disabled:a,className:"mt-0.5"}),e[15]=a,e[16]=n,e[17]=i,e[18]=c):c=e[18];let h;return e[19]!==x||e[20]!==p||e[21]!==c?(h=t.jsxs("label",{className:x,children:[p,c]}),e[19]=x,e[20]=p,e[21]=c,e[22]=h):h=e[22],h}function ma(l){const e=W.c(35),{activeTab:s,onTabChange:n,showSelectAll:i,isAllSelected:a,handleSelectAll:d}=l,r=q();let x;e[0]!==r?(x=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=x):x=e[1];let o;e[2]!==x?(o={id:"tools",label:x},e[2]=x,e[3]=o):o=e[3];let f;e[4]!==r?(f=r("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=r,e[5]=f):f=e[5];let m;e[6]!==f?(m={id:"active",label:f},e[6]=f,e[7]=m):m=e[7];let u;e[8]!==r?(u=r("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=r,e[9]=u):u=e[9];let p;e[10]!==u?(p={id:"resources",label:u},e[10]=u,e[11]=p):p=e[11];let c;e[12]!==r?(c=r("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=r,e[13]=c):c=e[13];let h;e[14]!==c?(h={id:"prompts",label:c},e[14]=c,e[15]=h):h=e[15];let g;e[16]!==o||e[17]!==m||e[18]!==p||e[19]!==h?(g=[o,m,p,h],e[16]=o,e[17]=m,e[18]=p,e[19]=h,e[20]=g):g=e[20];let b;e[21]!==n?(b=N=>n(N),e[21]=n,e[22]=b):b=e[22];let y;e[23]!==s||e[24]!==b||e[25]!==g?(y=t.jsx(Di,{tabs:g,activeTab:s,onTabChange:b}),e[23]=s,e[24]=b,e[25]=g,e[26]=y):y=e[26];let j;e[27]!==d||e[28]!==a||e[29]!==i||e[30]!==r?(j=i&&t.jsx("button",{type:"button",onClick:d,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(a?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=d,e[28]=a,e[29]=i,e[30]=r,e[31]=j):j=e[31];let v;return e[32]!==y||e[33]!==j?(v=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[y,j]}),e[32]=y,e[33]=j,e[34]=v):v=e[34],v}function Kt(l){const e=W.c(13),{items:s,selections:n,onToggle:i,emptyMessage:a,disabled:d}=l;let r,x,o;if(e[0]!==d||e[1]!==a||e[2]!==s||e[3]!==i||e[4]!==n){o=Symbol.for("react.early_return_sentinel");e:{const m=s.map(fa);if(s.length===0){let u;e[8]!==a?(u=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:a})}),e[8]=a,e[9]=u):u=e[9],o=u;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",x=s.map(u=>t.jsx(on,{item:u,isSelected:n===null||n?.includes(u.id),onToggle:()=>i(u.id,m),disabled:d},u.id))}e[0]=d,e[1]=a,e[2]=s,e[3]=i,e[4]=n,e[5]=r,e[6]=x,e[7]=o}else r=e[5],x=e[6],o=e[7];if(o!==Symbol.for("react.early_return_sentinel"))return o;let f;return e[10]!==r||e[11]!==x?(f=t.jsx("div",{className:r,children:x}),e[10]=r,e[11]=x,e[12]=f):f=e[12],f}function fa(l){return l.id}function pa(l){const e=W.c(22),{connectionId:s,toolSelections:n,onToggleTool:i}=l,a=q(),{org:d}=$e();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const x=jt(r);let o;e[4]!==x?(o={client:x},e[4]=x,e[5]=o):o=e[5];const{data:f}=Gs(o),m=f.tools;let u,p,c;if(e[6]!==f.tools||e[7]!==i||e[8]!==a||e[9]!==n){c=Symbol.for("react.early_return_sentinel");e:{const g=m.map(ha);let b;e[13]!==n?(b=v=>n===null||n.includes(v.name),e[13]=n,e[14]=b):b=e[14];const j=f.tools.filter(b).map(xa);if(j.length===0){let v;e[15]!==a?(v=a("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=a,e[16]=v):v=e[16];let N;e[17]!==v?(N=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:v})}),e[17]=v,e[18]=N):N=e[18],c=N;break e}u="flex-1 overflow-auto px-4 py-3 space-y-1",p=j.map(v=>t.jsx(on,{item:v,isSelected:!0,onToggle:()=>i(v.id,g)},v.id))}e[6]=f.tools,e[7]=i,e[8]=a,e[9]=n,e[10]=u,e[11]=p,e[12]=c}else u=e[10],p=e[11],c=e[12];if(c!==Symbol.for("react.early_return_sentinel"))return c;let h;return e[19]!==u||e[20]!==p?(h=t.jsx("div",{className:u,children:p}),e[19]=u,e[20]=p,e[21]=h):h=e[21],h}function xa(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(Ks,{annotations:l.annotations,_meta:l._meta})}}function ha(l){return l.name}function ga(l){const e=W.c(16),{connectionId:s,selections:n,onToggle:i,disabled:a}=l,{org:d}=$e();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const x=jt(r);let o;e[4]!==x?(o={client:x},e[4]=x,e[5]=o):o=e[5];const{data:f}=Gs(o);let m;e[6]!==f.tools?(m=f.tools.map(va),e[6]=f.tools,e[7]=m):m=e[7];const u=m,p=q();let c;e[8]!==p?(c=p("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=p,e[9]=c):c=e[9];let h;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==c?(h=t.jsx(Kt,{items:u,selections:n,onToggle:i,emptyMessage:c,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=c,e[15]=h):h=e[15],h}function va(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(Ks,{annotations:l.annotations,_meta:l._meta})}}function ba(l){const e=W.c(16),{connectionId:s,selections:n,onToggle:i,disabled:a}=l,{org:d}=$e();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const x=jt(r);let o;e[4]!==x?(o={client:x},e[4]=x,e[5]=o):o=e[5];const{data:f}=hn(o);let m;e[6]!==f.resources?(m=f.resources.map(ja),e[6]=f.resources,e[7]=m):m=e[7];const u=m,p=q();let c;e[8]!==p?(c=p("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=p,e[9]=c):c=e[9];let h;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==c?(h=t.jsx(Kt,{items:u,selections:n,onToggle:i,emptyMessage:c,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=c,e[15]=h):h=e[15],h}function ja(l){return{id:l.name||l.uri,name:l.name||l.uri,description:l.description}}function ya(l){const e=W.c(16),{connectionId:s,selections:n,onToggle:i,disabled:a}=l,{org:d}=$e();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const x=jt(r);let o;e[4]!==x?(o={client:x},e[4]=x,e[5]=o):o=e[5];const{data:f}=Vi(o);let m;e[6]!==f.prompts?(m=f.prompts.map(wa),e[6]=f.prompts,e[7]=m):m=e[7];const u=m,p=q();let c;e[8]!==p?(c=p("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=p,e[9]=c):c=e[9];let h;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==c?(h=t.jsx(Kt,{items:u,selections:n,onToggle:i,emptyMessage:c,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=c,e[15]=h):h=e[15],h}function wa(l){return{id:l.name,name:l.name,description:l.description}}function Sa(l){const e=W.c(58),{currentConnection:s,activeTab:n,selectedId:i,formData:a,toggleTool:d,toggleResource:r,togglePrompt:x,toggleAllTools:o,toggleAllResources:f,toggleAllPrompts:m,onTabChange:u}=l,p=q(),c=a[i],h=n==="tools"?c?.tools===null:n==="resources"?c?.resources===null:n==="prompts"?c?.prompts===null:!1,g=n!=="active";let b;e[0]!==n||e[1]!==i||e[2]!==m||e[3]!==f||e[4]!==o?(b=()=>{n==="tools"?o(i):n==="resources"?f(i):n==="prompts"&&m(i)},e[0]=n,e[1]=i,e[2]=m,e[3]=f,e[4]=o,e[5]=b):b=e[5];const y=b;let j;e[6]!==s.icon||e[7]!==s.title?(j=t.jsx(Xe,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[6]=s.icon,e[7]=s.title,e[8]=j):j=e[8];let v;e[9]!==s.title?(v=t.jsx("h2",{className:"text-base font-semibold truncate",children:s.title}),e[9]=s.title,e[10]=v):v=e[10];let N;e[11]!==s.description?(N=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[11]=s.description,e[12]=N):N=e[12];let S;e[13]!==v||e[14]!==N?(S=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,N]}),e[13]=v,e[14]=N,e[15]=S):S=e[15];let M;e[16]!==j||e[17]!==S?(M=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[j,S]})}),e[16]=j,e[17]=S,e[18]=M):M=e[18];let w;e[19]!==n||e[20]!==y||e[21]!==h||e[22]!==u||e[23]!==g?(w=t.jsx(ma,{activeTab:n,onTabChange:u,showSelectAll:g,isAllSelected:h,handleSelectAll:y}),e[19]=n,e[20]=y,e[21]=h,e[22]=u,e[23]=g,e[24]=w):w=e[24];let k;e[25]!==n||e[26]!==a||e[27]!==i||e[28]!==p||e[29]!==d?(k=n==="active"&&t.jsx(ze,{fallback:mt(p("virtualMcp.dependencySelectionDialog.toolsNotSupported"),p),children:t.jsx(U.Suspense,{fallback:t.jsx(et,{}),children:t.jsx(pa,{connectionId:i,toolSelections:a[i]?a[i].tools:[],onToggleTool:($,A)=>d(i,$,A)})})}),e[25]=n,e[26]=a,e[27]=i,e[28]=p,e[29]=d,e[30]=k):k=e[30];let C;e[31]!==n||e[32]!==a||e[33]!==i||e[34]!==p||e[35]!==d?(C=n==="tools"&&t.jsx(ze,{fallback:mt(p("virtualMcp.dependencySelectionDialog.toolsNotSupported"),p),children:t.jsx(U.Suspense,{fallback:t.jsx(et,{}),children:t.jsx(ga,{connectionId:i,selections:a[i]?a[i].tools:[],onToggle:($,A)=>d(i,$,A)})})}),e[31]=n,e[32]=a,e[33]=i,e[34]=p,e[35]=d,e[36]=C):C=e[36];let _;e[37]!==n||e[38]!==a||e[39]!==i||e[40]!==p||e[41]!==r?(_=n==="resources"&&t.jsx(ze,{fallback:mt(p("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),p),children:t.jsx(U.Suspense,{fallback:t.jsx(et,{}),children:t.jsx(ba,{connectionId:i,selections:a[i]?a[i].resources:[],onToggle:($,A)=>r(i,$,A)})})}),e[37]=n,e[38]=a,e[39]=i,e[40]=p,e[41]=r,e[42]=_):_=e[42];let D;e[43]!==n||e[44]!==a||e[45]!==i||e[46]!==p||e[47]!==x?(D=n==="prompts"&&t.jsx(ze,{fallback:mt(p("virtualMcp.dependencySelectionDialog.promptsNotSupported"),p),children:t.jsx(U.Suspense,{fallback:t.jsx(et,{}),children:t.jsx(ya,{connectionId:i,selections:a[i]?a[i].prompts:[],onToggle:($,A)=>x(i,$,A)})})}),e[43]=n,e[44]=a,e[45]=i,e[46]=p,e[47]=x,e[48]=D):D=e[48];let P;e[49]!==_||e[50]!==D||e[51]!==k||e[52]!==C?(P=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[k,C,_,D]}),e[49]=_,e[50]=D,e[51]=k,e[52]=C,e[53]=P):P=e[53];let I;return e[54]!==P||e[55]!==M||e[56]!==w?(I=t.jsxs(t.Fragment,{children:[M,w,P]}),e[54]=P,e[55]=M,e[56]=w,e[57]=I):I=e[57],I}function Na(l){const e=W.c(7),{onClose:s}=l,n=q();let i;e[0]!==s?(i=()=>s(!1),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n?(a=n("virtualMcp.dependencySelectionDialog.done"),e[2]=n,e[3]=a):a=e[3];let d;return e[4]!==i||e[5]!==a?(d=t.jsx($t,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(X,{variant:"outline",onClick:i,children:a})}),e[4]=i,e[5]=a,e[6]=d):d=e[6],d}function Ca(l){const e=W.c(23),{connectionId:s,onAuthenticate:n,children:i}=l,a=q();let d;e[0]!==s?(d={connectionId:s},e[0]=s,e[1]=d):d=e[1];const r=Ws(d);if(r.supportsOAuth&&!r.isAuthenticated){let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(ci,{size:22,className:"text-muted-foreground"})}),e[2]=f):f=e[2];let m;e[3]!==a?(m=a("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=a,e[4]=m):m=e[4];let u;e[5]!==m?(u=t.jsx("p",{className:"text-sm font-medium",children:m}),e[5]=m,e[6]=u):u=e[6];let p;e[7]!==a?(p=a("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=a,e[8]=p):p=e[8];let c;e[9]!==p?(c=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:p}),e[9]=p,e[10]=c):c=e[10];let h;e[11]!==u||e[12]!==c?(h=t.jsxs("div",{className:"space-y-1",children:[u,c]}),e[11]=u,e[12]=c,e[13]=h):h=e[13];let g;e[14]!==s||e[15]!==n||e[16]!==a?(g=n&&t.jsx(X,{variant:"outline",size:"sm",onClick:()=>n(s),children:a("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=s,e[15]=n,e[16]=a,e[17]=g):g=e[17];let b;return e[18]!==h||e[19]!==g?(b=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[f,h,g]}),e[18]=h,e[19]=g,e[20]=b):b=e[20],b}let o;return e[21]!==i?(o=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=o):o=e[22],o}function ka(l){const e={};for(const s of l)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function vs(l){return Object.entries(l).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function bs(l,e,s,n){const i=l[e]??{tools:null,resources:null,prompts:null};return{...l,[e]:{...i,[s]:n}}}function Ma(l,e){return e.type==="SET_ACTIVE_TAB"?{...l,activeTab:e.payload}:l}function _a(l){const e=W.c(49),{open:s,onOpenChange:n,selectedId:i,form:a,connections:d,onAuthenticate:r}=l;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={activeTab:"tools"},e[0]=x):x=e[0];const[o,f]=U.useReducer(Ma,x),m=Pt(i??"");let u;e[1]!==d?(u=d??[],e[1]=d,e[2]=u):u=e[2];let p;e[3]!==u?(p=ka(u),e[3]=u,e[4]=p):p=e[4];const c=p;let h;e[5]!==a||e[6]!==c?(h=(L,T,O,G)=>{const z=c[L]?.[T];let F;z===null?F=G.filter(B=>B!==O):z?.includes(O)?F=z.filter(B=>B!==O):(F=[...z??[],O],F.length===G.length&&(F=null)),a.setValue("connections",vs(bs(c,L,T,F)),{shouldDirty:!0,shouldTouch:!0})},e[5]=a,e[6]=c,e[7]=h):h=e[7];const g=h;let b;e[8]!==a||e[9]!==c?(b=(L,T)=>{const G=c[L]?.[T]===null?[]:null;a.setValue("connections",vs(bs(c,L,T,G)),{shouldDirty:!0,shouldTouch:!0})},e[8]=a,e[9]=c,e[10]=b):b=e[10];const y=b;let j;e[11]!==g?(j=(L,T,O)=>g(L,"tools",T,O),e[11]=g,e[12]=j):j=e[12];const v=j;let N;e[13]!==g?(N=(L,T,O)=>g(L,"resources",T,O),e[13]=g,e[14]=N):N=e[14];const S=N;let M;e[15]!==g?(M=(L,T,O)=>g(L,"prompts",T,O),e[15]=g,e[16]=M):M=e[16];const w=M;let k;e[17]!==y?(k=L=>y(L,"tools"),e[17]=y,e[18]=k):k=e[18];const C=k;let _;e[19]!==y?(_=L=>y(L,"resources"),e[19]=y,e[20]=_):_=e[20];const D=_;let P;e[21]!==y?(P=L=>y(L,"prompts"),e[21]=y,e[22]=P):P=e[22];const I=P;if(!i||!m)return null;let $;e[23]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(et,{}),e[23]=$):$=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=L=>f({type:"SET_ACTIVE_TAB",payload:L}),e[24]=A):A=e[24];let Y;e[25]!==m||e[26]!==o.activeTab||e[27]!==c||e[28]!==i||e[29]!==I||e[30]!==D||e[31]!==C||e[32]!==w||e[33]!==S||e[34]!==v?(Y=t.jsx(Sa,{currentConnection:m,activeTab:o.activeTab,selectedId:i,formData:c,toggleTool:v,toggleResource:S,togglePrompt:w,toggleAllTools:C,toggleAllResources:D,toggleAllPrompts:I,onTabChange:A},i),e[25]=m,e[26]=o.activeTab,e[27]=c,e[28]=i,e[29]=I,e[30]=D,e[31]=C,e[32]=w,e[33]=S,e[34]=v,e[35]=Y):Y=e[35];let K;e[36]!==r||e[37]!==i||e[38]!==Y?(K=t.jsx(U.Suspense,{fallback:$,children:t.jsx(Ca,{connectionId:i,onAuthenticate:r,children:Y})}),e[36]=r,e[37]=i,e[38]=Y,e[39]=K):K=e[39];let Q;e[40]!==n?(Q=t.jsx(Na,{onClose:n}),e[40]=n,e[41]=Q):Q=e[41];let R;e[42]!==K||e[43]!==Q?(R=t.jsxs(Qe,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[K,Q]}),e[42]=K,e[43]=Q,e[44]=R):R=e[44];let H;return e[45]!==n||e[46]!==s||e[47]!==R?(H=t.jsx(qe,{open:s,onOpenChange:n,children:R}),e[45]=n,e[46]=s,e[47]=R,e[48]=H):H=e[48],H}const js="__new_instance__";function Ta(l){const e=W.c(25),{connection_id:s,usedConnectionIds:n,onOpenSettings:i,onRemove:a,onAuthenticate:d,onSwitchInstance:r,onNewInstance:x}=l,o=Pt(s),{org:f}=$e();if(!o){let g;return e[0]!==a?(g=t.jsx(Aa,{onRemove:a}),e[0]=a,e[1]=g):g=e[1],g}let m;e[2]!==o?(m=Ii(o),e[2]=o,e[3]=m):m=e[3];const u=m;let p;e[4]!==s?(p=t.jsx(Ia,{connection_id:s}),e[4]=s,e[5]=p):p=e[5];let c;e[6]!==o.app_name||e[7]!==o.connection_type||e[8]!==o.description||e[9]!==o.icon||e[10]!==o.status||e[11]!==o.title||e[12]!==s||e[13]!==d||e[14]!==x||e[15]!==i||e[16]!==a||e[17]!==r||e[18]!==f.slug||e[19]!==u||e[20]!==n?(c=t.jsx(Va,{connection_id:s,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,connectionType:o.connection_type,connectionStatus:o.status,slug:u,orgSlug:f.slug,appName:o.app_name,usedConnectionIds:n,onOpenSettings:i,onRemove:a,onAuthenticate:d,onSwitchInstance:r,onNewInstance:x}),e[6]=o.app_name,e[7]=o.connection_type,e[8]=o.description,e[9]=o.icon,e[10]=o.status,e[11]=o.title,e[12]=s,e[13]=d,e[14]=x,e[15]=i,e[16]=a,e[17]=r,e[18]=f.slug,e[19]=u,e[20]=n,e[21]=c):c=e[21];let h;return e[22]!==p||e[23]!==c?(h=t.jsx(U.Suspense,{fallback:p,children:c}),e[22]=p,e[23]=c,e[24]=h):h=e[24],h}function Da(l){const e=W.c(24),{appName:s,connectionId:n,usedConnectionIds:i,onSwitchInstance:a,onNewInstance:d}=l,r=q();let x;e[0]!==s?(x={filters:[{column:"app_name",value:s}]},e[0]=s,e[1]=x):x=e[1];const o=Wn(x);if(o.length<=1&&!d)return null;let f;e[2]!==n||e[3]!==d||e[4]!==a?(f=g=>{g===js?d?.():a(n,g)},e[2]=n,e[3]=d,e[4]=a,e[5]=f):f=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Me,{size:"sm",className:"w-auto text-xs gap-1 px-2 shadow-none",children:t.jsx(_e,{})}),e[6]=m):m=e[6];let u;if(e[7]!==n||e[8]!==o||e[9]!==i){let g;e[11]!==n||e[12]!==i?(g=b=>t.jsx(pe,{value:b.id,className:"text-xs",disabled:b.id!==n&&i.has(b.id),children:b.title},b.id),e[11]=n,e[12]=i,e[13]=g):g=e[13],u=o.map(g),e[7]=n,e[8]=o,e[9]=i,e[10]=u}else u=e[10];let p;e[14]!==d||e[15]!==r?(p=d&&t.jsxs(pe,{value:js,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=d,e[15]=r,e[16]=p):p=e[16];let c;e[17]!==u||e[18]!==p?(c=t.jsxs(Te,{children:[u,p]}),e[17]=u,e[18]=p,e[19]=c):c=e[19];let h;return e[20]!==n||e[21]!==f||e[22]!==c?(h=t.jsxs(De,{value:n,onValueChange:f,children:[m,c]}),e[20]=n,e[21]=f,e[22]=c,e[23]=h):h=e[23],h}function Va({connection_id:l,connectionTitle:e,connectionDescription:s,connectionIcon:n,connectionType:i,connectionStatus:a,slug:d,orgSlug:r,appName:x,usedConnectionIds:o,onOpenSettings:f,onRemove:m,onAuthenticate:u,onSwitchInstance:p,onNewInstance:c}){const h=Ws({connectionId:l}),g=Vs(),y=!(i==="VIRTUAL")&&h.supportsOAuth&&!h.isAuthenticated,j=a!=="active",v=q(),N=async S=>{try{await g.update.mutateAsync({id:l,data:{status:S}}),ie.success(v(S==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{ie.error(v("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:ue("rounded-xl border overflow-hidden transition-colors",y||j?"border-destructive/50 bg-destructive/5":"border-border bg-card"),children:[t.jsxs(gn,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:d},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors",children:[t.jsx(Xe,{icon:n,name:e,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:e}),y?t.jsx("span",{className:"text-xs text-destructive font-medium",children:v("virtualMcp.connectionItem.needsAuthorization")}):j?t.jsx("span",{className:"text-xs text-destructive font-medium",children:v(a==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):s&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s})]}),y?t.jsx(X,{variant:"outline",size:"sm",className:"h-7 text-xs shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),u(l)},children:v("virtualMcp.connectionItem.authorize")}):j?t.jsxs(X,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),N("active")},children:[t.jsx(di,{size:13}),v("virtualMcp.connectionItem.enable")]}):t.jsxs(je,{delayDuration:0,children:[t.jsx(ye,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center rounded-md h-7 w-7 hover:bg-accent text-muted-foreground shrink-0 transition-colors",children:t.jsx(Ai,{size:16})})}),t.jsx(we,{side:"bottom",children:v("virtualMcp.connectionItem.connectionSettings")})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-t border-border bg-muted/25",children:[x&&t.jsx(Da,{appName:x,connectionId:l,usedConnectionIds:o,onSwitchInstance:p,onNewInstance:c}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(je,{delayDuration:0,children:[t.jsx(ye,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:f,"aria-label":v("virtualMcp.connectionItem.configureResources"),children:t.jsx(ui,{size:13})})}),t.jsx(we,{side:"bottom",children:v("virtualMcp.connectionItem.configureResources")})]}),!j&&t.jsxs(je,{delayDuration:0,children:[t.jsx(ye,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>N("inactive"),"aria-label":v("virtualMcp.connectionItem.disableConnection"),children:t.jsx(mi,{size:13})})}),t.jsx(we,{side:"bottom",children:v("virtualMcp.connectionItem.disable")})]}),t.jsxs(je,{delayDuration:0,children:[t.jsx(ye,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:m,"aria-label":v("virtualMcp.connectionItem.removeConnection"),children:t.jsx(Ut,{size:13})})}),t.jsx(we,{side:"bottom",children:v("virtualMcp.connectionItem.remove")})]})]})]})]})}function Ia(l){const e=W.c(17),{connection_id:s}=l,n=Pt(s);if(!n){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(cn,{}),e[0]=m):m=e[0],m}let i;e[1]!==n.icon||e[2]!==n.title?(i=t.jsx(Xe,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[1]=n.icon,e[2]=n.title,e[3]=i):i=e[3];let a;e[4]!==n.title?(a=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let d;e[6]!==n.description?(d=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[6]=n.description,e[7]=d):d=e[7];let r;e[8]!==a||e[9]!==d?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,d]}),e[8]=a,e[9]=d,e[10]=r):r=e[10];let x;e[11]!==i||e[12]!==r?(x=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,r]}),e[11]=i,e[12]=r,e[13]=x):x=e[13];let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})}),e[14]=o):o=e[14];let f;return e[15]!==x?(f=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[x,o]}),e[15]=x,e[16]=f):f=e[16],f}function Aa(l){const e=W.c(20),{onRemove:s}=l,n=q();let i;e[0]!==n?(i=n("virtualMcp.connectionItem.connectionNotFound"),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==i?(a=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm text-destructive font-medium truncate",children:i})}),e[2]=i,e[3]=a):a=e[3];let d;e[4]!==n?(d=n("virtualMcp.connectionItem.removeConnection"),e[4]=n,e[5]=d):d=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ut,{size:13}),e[6]=r):r=e[6];let x;e[7]!==s||e[8]!==d?(x=t.jsx(ye,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive shrink-0",onClick:s,"aria-label":d,children:r})}),e[7]=s,e[8]=d,e[9]=x):x=e[9];let o;e[10]!==n?(o=n("virtualMcp.connectionItem.remove"),e[10]=n,e[11]=o):o=e[11];let f;e[12]!==o?(f=t.jsx(we,{side:"bottom",children:o}),e[12]=o,e[13]=f):f=e[13];let m;e[14]!==x||e[15]!==f?(m=t.jsxs(je,{delayDuration:0,children:[x,f]}),e[14]=x,e[15]=f,e[16]=m):m=e[16];let u;return e[17]!==a||e[18]!==m?(u=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[a,m]}),e[17]=a,e[18]=m,e[19]=u):u=e[19],u}function cn(){const l=W.c(3);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),l[0]=e):e=l[0];let s;l[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e,t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-48 rounded bg-muted animate-pulse"})]})]}),l[1]=s):s=l[1];let n;return l[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[s,t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})})]}),l[2]=n):n=l[2],n}function Oa(l){const e=W.c(5),{value:s}=l;let n;if(e[0]!==s){n=Symbol.for("react.early_return_sentinel");e:{const a=Ft(s);if(a.type==="icon"){const d=zt(a.name);if(d){let r;e[2]!==d?(r=t.jsx(d,{size:16,className:"text-muted-foreground"}),e[2]=d,e[3]=r):r=e[3],n=r;break e}}}e[0]=s,e[1]=n}else n=e[1];if(n!==Symbol.for("react.early_return_sentinel"))return n;let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Oi,{size:16,className:"text-muted-foreground"}),e[4]=i):i=e[4],i}function Pa(l){const e=W.c(74),{value:s,onChange:n,className:i,disabled:a}=l,d=q(),[r,x]=U.useState(!1),[o,f]=U.useState("");let m;e[0]!==s?(m=Ft(s),e[0]=s,e[1]=m):m=e[1];const u=m,p=u.type==="icon"?u.name:null;let c,h,g,b,y,j,v,N,S,M,w,k,C,_,D;if(e[2]!==i||e[3]!==p||e[4]!==a||e[5]!==n||e[6]!==r||e[7]!==o||e[8]!==d||e[9]!==s){const Q=Et();b=Fs(Q,o),g=Bt,y=a?!1:r,j=x;let R;e[25]!==d?(R=d("common.simpleIconPicker.changeIcon"),e[25]=d,e[26]=R):R=e[26];const H=a?"cursor-default opacity-50":"cursor-pointer hover:bg-accent";let L;e[27]!==i||e[28]!==H?(L=ue("size-7 shrink-0 rounded-md transition-colors flex items-center justify-center",H,i),e[27]=i,e[28]=H,e[29]=L):L=e[29];let T;e[30]!==s?(T=t.jsx(Oa,{value:s}),e[30]=s,e[31]=T):T=e[31],e[32]!==a||e[33]!==R||e[34]!==L||e[35]!==T?(v=t.jsx(Rt,{asChild:!0,children:t.jsx("button",{type:"button",disabled:a,"aria-label":R,className:L,children:T})}),e[32]=a,e[33]=R,e[34]=L,e[35]=T,e[36]=v):v=e[36],h=Lt,C="start",_="w-64 p-0",D=$a,w="flex flex-col";let O;e[37]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(xt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[37]=O):O=e[37];let G;e[38]===Symbol.for("react.memo_cache_sentinel")?(G=B=>f(B.target.value),e[38]=G):G=e[38];let z;e[39]!==d?(z=d("common.simpleIconPicker.filterPlaceholder"),e[39]=d,e[40]=z):z=e[40],e[41]!==o||e[42]!==z?(k=t.jsx("div",{className:"px-2 py-2",children:t.jsxs("div",{className:"relative",children:[O,t.jsx(Se,{value:o,onChange:G,placeholder:z,className:"h-7 text-xs pl-7"})]})}),e[41]=o,e[42]=z,e[43]=k):k=e[43],c=Rs,M="h-48",N="grid grid-cols-8 gap-0.5 px-2 pb-2";let F;e[44]!==p||e[45]!==n?(F=B=>{const J=zt(B);return J?t.jsx("button",{type:"button",onClick:()=>{n(`icon://${B}`),x(!1)},className:ue("h-7 w-7 flex items-center justify-center rounded-md transition-colors cursor-pointer",p===B?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground"),title:Dt(B),"aria-label":Dt(B),children:t.jsx(J,{size:16})},B):null},e[44]=p,e[45]=n,e[46]=F):F=e[46],S=b.map(F),e[2]=i,e[3]=p,e[4]=a,e[5]=n,e[6]=r,e[7]=o,e[8]=d,e[9]=s,e[10]=c,e[11]=h,e[12]=g,e[13]=b,e[14]=y,e[15]=j,e[16]=v,e[17]=N,e[18]=S,e[19]=M,e[20]=w,e[21]=k,e[22]=C,e[23]=_,e[24]=D}else c=e[10],h=e[11],g=e[12],b=e[13],y=e[14],j=e[15],v=e[16],N=e[17],S=e[18],M=e[19],w=e[20],k=e[21],C=e[22],_=e[23],D=e[24];let P;e[47]!==N||e[48]!==S?(P=t.jsx("div",{className:N,children:S}),e[47]=N,e[48]=S,e[49]=P):P=e[49];let I;e[50]!==b.length||e[51]!==d?(I=b.length===0&&t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:d("common.simpleIconPicker.noIconsFound")}),e[50]=b.length,e[51]=d,e[52]=I):I=e[52];let $;e[53]!==c||e[54]!==P||e[55]!==I||e[56]!==M?($=t.jsxs(c,{className:M,children:[P,I]}),e[53]=c,e[54]=P,e[55]=I,e[56]=M,e[57]=$):$=e[57];let A;e[58]!==$||e[59]!==w||e[60]!==k?(A=t.jsxs("div",{className:w,children:[k,$]}),e[58]=$,e[59]=w,e[60]=k,e[61]=A):A=e[61];let Y;e[62]!==h||e[63]!==A||e[64]!==C||e[65]!==_||e[66]!==D?(Y=t.jsx(h,{align:C,className:_,onOpenAutoFocus:D,children:A}),e[62]=h,e[63]=A,e[64]=C,e[65]=_,e[66]=D,e[67]=Y):Y=e[67];let K;return e[68]!==g||e[69]!==y||e[70]!==j||e[71]!==v||e[72]!==Y?(K=t.jsxs(g,{open:y,onOpenChange:j,children:[v,Y]}),e[68]=g,e[69]=y,e[70]=j,e[71]=v,e[72]=Y,e[73]=K):K=e[73],K}function $a(l){return l.preventDefault()}function Fa(l){const e=W.c(10),{viewId:s}=l;if(s==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Es,{size:16}),e[0]=i):i=e[0],i}if(s==="reports"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ts,{size:16}),e[1]=i):i=e[1],i}if(s==="board"){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(fi,{size:16}),e[2]=i):i=e[2],i}if(s==="site-editor"){let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ei,{size:16}),e[3]=i):i=e[3],i}if(s==="assets"){let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Fi,{size:16}),e[4]=i):i=e[4],i}if(s==="hosting"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(pi,{size:16}),e[5]=i):i=e[5],i}if(s==="e2e"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Pi,{size:16}),e[6]=i):i=e[6],i}if(s==="analytics"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ts,{size:16}),e[7]=i):i=e[7],i}if(s==="cdn"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(xi,{size:16}),e[8]=i):i=e[8],i}let n;return e[9]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(zs,{size:16}),e[9]=n):n=e[9],n}function ys(l){const e=W.c(51),{pinned:s,canSetMainView:n,onOpen:i,onTogglePin:a,onSetMainView:d}=l,r=q(),x=s?"text-foreground":"text-muted-foreground/40";let o;e[0]!==x?(o=ue("size-7",x),e[0]=x,e[1]=o):o=e[1];let f;e[2]!==s||e[3]!==r?(f=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=s,e[3]=r,e[4]=f):f=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(ss,{size:16}),e[5]=m):m=e[5];let u;e[6]!==a||e[7]!==s||e[8]!==o||e[9]!==f?(u=t.jsx(ye,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"icon",className:o,"aria-label":f,"aria-pressed":s,onClick:a,children:m})}),e[6]=a,e[7]=s,e[8]=o,e[9]=f,e[10]=u):u=e[10];let p;e[11]!==s||e[12]!==r?(p=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=s,e[12]=r,e[13]=p):p=e[13];let c;e[14]!==p?(c=t.jsx(we,{side:"top",children:p}),e[14]=p,e[15]=c):c=e[15];let h;e[16]!==u||e[17]!==c?(h=t.jsxs(je,{delayDuration:0,children:[u,c]}),e[16]=u,e[17]=c,e[18]=h):h=e[18];let g;e[19]!==r?(g=r("virtualMcp.settings.views.rowActions"),e[19]=r,e[20]=g):g=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx($i,{size:16}),e[21]=b):b=e[21];let y;e[22]!==g?(y=t.jsx(Bs,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground","aria-label":g,children:b})}),e[22]=g,e[23]=y):y=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(vn,{size:14}),e[24]=j):j=e[24];let v;e[25]!==r?(v=r("virtualMcp.settings.views.open"),e[25]=r,e[26]=v):v=e[26];let N;e[27]!==i||e[28]!==v?(N=t.jsxs(Ge,{onClick:i,children:[j,v]}),e[27]=i,e[28]=v,e[29]=N):N=e[29];let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(ss,{size:14}),e[30]=S):S=e[30];let M;e[31]!==s||e[32]!==r?(M=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=s,e[32]=r,e[33]=M):M=e[33];let w;e[34]!==a||e[35]!==M?(w=t.jsxs(Ge,{onClick:a,children:[S,M]}),e[34]=a,e[35]=M,e[36]=w):w=e[36];let k;e[37]!==n||e[38]!==d||e[39]!==r?(k=n&&t.jsxs(Ge,{onClick:d,children:[t.jsx(Es,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=n,e[38]=d,e[39]=r,e[40]=k):k=e[40];let C;e[41]!==N||e[42]!==w||e[43]!==k?(C=t.jsxs(Us,{align:"end",children:[N,w,k]}),e[41]=N,e[42]=w,e[43]=k,e[44]=C):C=e[44];let _;e[45]!==y||e[46]!==C?(_=t.jsxs(Ls,{children:[y,C]}),e[45]=y,e[46]=C,e[47]=_):_=e[47];let D;return e[48]!==_||e[49]!==h?(D=t.jsxs("div",{className:"flex items-center gap-1",children:[h,_]}),e[48]=_,e[49]=h,e[50]=D):D=e[50],D}const ws=l=>l.stopPropagation();function Ea(l){const e=W.c(8),{icon:s,title:n}=l;let i;e[0]!==s||e[1]!==n?(i=t.jsx(Xe,{icon:s,name:n,size:"xs",className:"shrink-0"}),e[0]=s,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==n?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[3]=n,e[4]=a):a=e[4];let d;return e[5]!==i||e[6]!==a?(d=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,a]}),e[5]=i,e[6]=a,e[7]=d):d=e[7],d}function za(l){const e=W.c(53),{views:s}=l,n=q();let i;e[0]!==n?(i=n("virtualMcp.settings.views.projectViews"),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==s?(a=s.projectViews.map(C=>{const _=s.pinned(C);return t.jsx(Ze,{icon:t.jsx(Fa,{viewId:C}),title:s.labels[C],onClick:()=>s.openView(C),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ys,{pinned:_,canSetMainView:_&&!s.isMainView(C),onOpen:()=>s.openView(C),onTogglePin:()=>s.togglePin(C,!_),onSetMainView:()=>s.setMainView(C)}),t.jsx("span",{onClick:()=>s.openView(C),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Vt,{size:16})})]})},C)}),e[2]=s,e[3]=a):a=e[3];let d;e[4]!==s?(d=s.connectionsData.flatMap(C=>[t.jsx(Ea,{icon:C.icon,title:C.title},`${C.id}:header`),...C.uiTools.map(_=>{const D=s.pinnedAppViews.find(A=>A.connectionId===C.id&&A.toolName===_.name),P=!!D,I=bn(C.id,_.name),$=`ext-apps:${C.id}:${_.name}`;return t.jsx(Ze,{onClick:()=>s.openView(I),icon:P?t.jsx("span",{onClick:ws,children:t.jsx(Pa,{value:D.icon??null,onChange:A=>s.setAppViewIcon(C.id,_.name,A)})}):t.jsx(zs,{size:16}),title:P?t.jsx("span",{onClick:ws,children:t.jsx(Se,{value:D.label,onChange:A=>s.setAppViewLabel(C.id,_.name,A.target.value),onBlur:s.commitAppViewLabel,className:"h-7 w-52 text-sm"})}):_.title??Hs(_.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ys,{pinned:P,canSetMainView:P&&!s.isMainView($),onOpen:()=>s.openView(I),onTogglePin:()=>s.toggleAppViewPin(C.id,_.name),onSetMainView:()=>s.setMainView($)}),t.jsx("span",{onClick:()=>s.openView(I),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Vt,{size:16})})]})},`${C.id}:${_.name}`)})]),e[4]=s,e[5]=d):d=e[5];let r;e[6]!==n?(r=n("virtualMcp.layoutTabContent.mainView"),e[6]=n,e[7]=r):r=e[7];let x;e[8]!==n?(x=n("virtualMcp.layoutTabContent.mainViewDescription"),e[8]=n,e[9]=x):x=e[9];const o=s.defaultMainView,f=s.setMainView;let m;e[10]!==n?(m=n("virtualMcp.layoutTabContent.noMainView"),e[10]=n,e[11]=m):m=e[11];let u;e[12]!==m?(u=t.jsx(Me,{className:"w-44 h-8 text-sm shrink-0",children:t.jsx(_e,{placeholder:m})}),e[12]=m,e[13]=u):u=e[13];let p;e[14]!==s.defaultMainOptions?(p=s.defaultMainOptions.map(Ra),e[14]=s.defaultMainOptions,e[15]=p):p=e[15];let c;e[16]!==p?(c=t.jsx(Te,{children:p}),e[16]=p,e[17]=c):c=e[17];let h;e[18]!==c||e[19]!==u||e[20]!==s.defaultMainView||e[21]!==s.setMainView?(h=t.jsxs(De,{value:o,onValueChange:f,children:[u,c]}),e[18]=c,e[19]=u,e[20]=s.defaultMainView,e[21]=s.setMainView,e[22]=h):h=e[22];let g;e[23]!==h||e[24]!==r||e[25]!==x?(g=t.jsx(Ze,{title:r,description:x,action:h}),e[23]=h,e[24]=r,e[25]=x,e[26]=g):g=e[26];let b;e[27]!==n?(b=n("virtualMcp.layoutTabContent.showChat"),e[27]=n,e[28]=b):b=e[28];let y;e[29]!==n?(y=n("virtualMcp.layoutTabContent.showChatDescription"),e[29]=n,e[30]=y):y=e[30];const j=s.noMainView?!0:s.chatDefaultOpen;let v;e[31]!==j||e[32]!==s.noMainView||e[33]!==s.setChatDefaultOpen?(v=t.jsx(ye,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(yt,{checked:j,disabled:s.noMainView,onCheckedChange:s.setChatDefaultOpen})})}),e[31]=j,e[32]=s.noMainView,e[33]=s.setChatDefaultOpen,e[34]=v):v=e[34];let N;e[35]!==n||e[36]!==s.noMainView?(N=s.noMainView&&t.jsx(we,{side:"top",children:n("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[35]=n,e[36]=s.noMainView,e[37]=N):N=e[37];let S;e[38]!==v||e[39]!==N?(S=t.jsxs(je,{delayDuration:0,children:[v,N]}),e[38]=v,e[39]=N,e[40]=S):S=e[40];let M;e[41]!==b||e[42]!==y||e[43]!==S?(M=t.jsx(Ze,{title:b,description:y,action:S}),e[41]=b,e[42]=y,e[43]=S,e[44]=M):M=e[44];let w;e[45]!==g||e[46]!==a||e[47]!==M||e[48]!==d?(w=t.jsxs(tt,{children:[a,d,g,M]}),e[45]=g,e[46]=a,e[47]=M,e[48]=d,e[49]=w):w=e[49];let k;return e[50]!==i||e[51]!==w?(k=t.jsx(st,{title:i,children:w}),e[50]=i,e[51]=w,e[52]=k):k=e[52],k}function Ra(l){return t.jsx(pe,{value:l.value,children:l.label},l.value)}const dn="site-editor",La=new Set([dn,"content"]);function Ba({virtualMcpId:l,form:e,flushAndSave:s}){const n=q(),i=vt(),{openPanel:a}=Bi(),d=As(l),r=Ui(d),x=qs(l),o=Qi(l),f=(d?.connections??[]).map(T=>T.connection_id).sort(),{data:m}=jn({queryKey:Ms.projectConnectionDetails(l,f),enabled:f.length>0,queryFn:async()=>await Promise.all(f.map(async O=>{try{const{item:G}=await i.call("COLLECTION_CONNECTIONS_GET",{id:O}),z=(G?.tools??[]).flatMap(F=>{const B=zi(F._meta);return B?[{name:F.name,title:F.title,description:F.description,resourceUri:B}]:[]});return{fetchOk:!0,id:O,title:G?.title??O,icon:G?.icon??null,uiTools:z}}catch{return{fetchOk:!1,id:O,title:O,icon:null,uiTools:[]}}}))}),u=(m??[]).filter(T=>T.uiTools.length>0),p=new Set([...yn,...wn]),c=e.watch("metadata.ui.pinnedViews")??[],h=e.watch("metadata.ui.layout")??null,g=h?.defaultMainView??null,b=h?.chatDefaultOpen??!1,y=It(At({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:h}}),e.watch("metadata.sidebarViewsVersion")),j=o??(d?It(At(d.metadata),d.metadata.sidebarViewsVersion):y),v=(()=>{if(!g||g.type==="chat")return"";const T=Sn(g.type);return T==="instructions"||T==="connections"||T==="layout"?"settings":La.has(T)?dn:p.has(T)?T:`${T}:${g.id??""}:${g.toolName??""}`})(),N=v==="",S=T=>{const[O,G,z]=T.split(":");return O?p.has(O)?{type:O}:O==="ext-apps"&&G?{type:"ext-apps",id:G,toolName:z||void 0}:null:null},M=T=>{e.setValue("metadata.ui.pinnedViews",T,{shouldDirty:!0})},w=T=>{e.setValue("metadata.ui.layout",{...h,...T},{shouldDirty:!0})},k=U.useRef(!1);if(m&&m.length>0&&!k.current){k.current=!0;const T=new Set((m??[]).filter(F=>F.fetchOk).map(F=>F.id)),O=new Set(u.flatMap(F=>F.uiTools.map(B=>`${F.id}:${B.name}`))),G=new Set(f),z=c.filter(F=>G.has(F.connectionId)&&(!T.has(F.connectionId)||O.has(`${F.connectionId}:${F.toolName}`)));z.length!==c.length&&(M(z),g?.type==="ext-apps"&&!z.some(F=>F.connectionId===g.id&&F.toolName===g.toolName)&&w({defaultMainView:{type:"settings"}}))}const C=(T,O)=>{if(c.some(z=>z.connectionId===T&&z.toolName===O)){const z=c.filter(B=>!(B.connectionId===T&&B.toolName===O));M(z);const F=`ext-apps:${T}:${O}`;v===F&&w({defaultMainView:{type:"settings"}})}else{const z=u.find(F=>F.id===T)?.uiTools.find(F=>F.name===O)?.title;M([...c,{connectionId:T,toolName:O,label:z??Hs(O),icon:null}])}s()},_=(T,O,G)=>{M(c.map(z=>z.connectionId===T&&z.toolName===O?{...z,label:G}:z))},D=()=>{s()},P=(T,O,G)=>{M(c.map(z=>z.connectionId===T&&z.toolName===O?{...z,icon:G}:z)),s()},I=T=>{w({defaultMainView:S(T)}),s()},$=(T,O)=>{const G=Gi(j,T,O,1);e.setValue("metadata.sidebarViews",G,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),x.stage(G,j);const z=Hi(g,T,O);z!==g&&w({defaultMainView:z})},A=ht(d?.metadata),Y=Yi(A,r.presence),K=Ki(Y),Q=Wi(j,Y,1),R={overview:n("sidebar.navDestinations.home"),reports:n("sidebar.navDestinations.reports"),board:n("sidebar.navDestinations.tasks"),"site-editor":n("virtualMcp.layoutTabContent.siteEditor"),assets:n("common.mainPanelTabs.assets"),hosting:n("common.mainPanelTabs.hosting"),e2e:n("common.mainPanelTabs.e2e"),analytics:n("common.mainPanelTabs.analytics"),cdn:n("common.mainPanelTabs.cdn"),automations:n("virtualMcp.layoutTabContent.automations"),experiments:n("experiments.title")},H=[];for(const T of Q)T!=="automations"&&H.push({value:T,label:R[T]});for(const T of c)H.push({value:`ext-apps:${T.connectionId}:${T.toolName}`,label:T.label||T.toolName});return Q.includes("automations")&&H.push({value:"automations",label:R.automations}),H.push({value:"settings",label:n("virtualMcp.layoutTabContent.settings")}),{projectViews:K,labels:R,pinned:T=>j.includes(T),isMainView:T=>v===T,defaultMainView:v,defaultMainOptions:H,noMainView:N,chatDefaultOpen:b,connectionsData:u,pinnedAppViews:c,openView:T=>a(T,{virtualmcpid:l}),togglePin:(T,O)=>$(T,O),setMainView:I,setChatDefaultOpen:T=>{w({chatDefaultOpen:T}),s()},toggleAppViewPin:C,setAppViewIcon:P,setAppViewLabel:_,commitAppViewLabel:D}}function Ua(l){const e=W.c(5),{header:s,groups:n}=l;let i;e[0]!==n?(i=n.filter(Wa).map(Ya),e[0]=n,e[1]=i):i=e[1];let a;return e[2]!==s||e[3]!==i?(a=t.jsxs(Nn,{children:[s,i]}),e[2]=s,e[3]=i,e[4]=a):a=e[4],a}function Ya(l){return l.content?t.jsx("div",{children:l.content},l.key):t.jsx(st,{title:l.title,children:t.jsx(tt,{children:(l.rows??[]).map(Ka)})},l.key)}function Ka(l){return t.jsx(Ze,{onClick:l.onClick,icon:l.icon,title:t.jsx("span",{className:ue(l.destructive&&"text-destructive"),children:l.title}),description:l.description,action:t.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:t.jsxs("span",{onClick:l.onClick,className:"flex cursor-pointer items-center gap-2",children:[l.value&&t.jsx("span",{className:"text-sm",children:l.value}),t.jsx(Vt,{size:16})]})})},l.key)}function Wa(l){return l.content||l.rows?.length}function Ga(l){const e=W.c(19),{title:s,backLabel:n,onBack:i,actions:a,children:d}=l;let r;e[0]!==n||e[1]!==i?(r=t.jsx(ds,{children:t.jsx(tl,{asChild:!0,className:"rounded-md px-2 py-1 text-muted-foreground hover:bg-accent",children:t.jsx("button",{type:"button",onClick:i,children:n})})}),e[0]=n,e[1]=i,e[2]=r):r=e[2];let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(sl,{}),e[3]=x):x=e[3];let o;e[4]!==s?(o=t.jsx(ds,{children:t.jsx(nl,{className:"px-2 py-1",children:s})}),e[4]=s,e[5]=o):o=e[5];let f;e[6]!==r||e[7]!==o?(f=t.jsx(il,{className:"-ml-2 min-w-0",children:t.jsxs(ll,{className:"text-[15px]",children:[r,x,o]})}),e[6]=r,e[7]=o,e[8]=f):f=e[8];let m;e[9]!==a?(m=a&&t.jsx("div",{className:"shrink-0",children:a}),e[9]=a,e[10]=m):m=e[10];let u;e[11]!==f||e[12]!==m?(u=t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f,m]}),e[11]=f,e[12]=m,e[13]=u):u=e[13];let p;e[14]!==d?(p=t.jsx("div",{className:"flex flex-col gap-10",children:d}),e[14]=d,e[15]=p):p=e[15];let c;return e[16]!==u||e[17]!==p?(c=t.jsxs("div",{className:"flex flex-col gap-8",children:[u,p]}),e[16]=u,e[17]=p,e[18]=c):c=e[18],c}const Ha=["general","connections","site"],Le={general:{titleKey:"virtualMcp.settings.general.title",descriptionKey:"virtualMcp.settings.general.description"},connections:{titleKey:"virtualMcp.settings.connections.title",descriptionKey:"virtualMcp.settings.connections.description"},site:{titleKey:"virtualMcp.settings.site.title",descriptionKey:"virtualMcp.settings.site.description"}};function qa(l){return!!l&&Ha.includes(l)}function Qa(){const l=W.c(8),e=Ot();let s;l[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},l[0]=s):s=l[0];const n=Cn(s).section;let i;l[1]!==n?(i=qa(n)?n:null,l[1]=n,l[2]=i):i=l[2];const a=i;let d;l[3]!==e?(d=x=>e({to:".",search:o=>({...o,section:x??void 0})}),l[3]=e,l[4]=d):d=l[4];let r;return l[5]!==a||l[6]!==d?(r={section:a,openSection:d},l[5]=a,l[6]=d,l[7]=r):r=l[7],r}const _t={tools:null,resources:null,prompts:null},Xa=al.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function Ja(l){const s=new TextEncoder().encode(l),n=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(n)}function un(l){return{"x-studio-client":l,"x-mesh-client":l}}function Za(l){const e=W.c(15),{url:s,agentId:n}=l,i=q(),[a,d]=U.useState(!1);let r;e[0]!==n||e[1]!==i||e[2]!==s?(r=async()=>{ve("agent_connect_action",{agent_id:n,action:"copy_url"}),await navigator.clipboard.writeText(s),d(!0),ie.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await ct(2e3),d(!1)},e[0]=n,e[1]=i,e[2]=s,e[3]=r):r=e[3];const x=r;let o;e[4]!==a?(o=a?t.jsx(ot,{size:20,className:"text-success"}):t.jsx(St,{size:20}),e[4]=a,e[5]=o):o=e[5];let f;e[6]!==a||e[7]!==i?(f=i(a?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=a,e[7]=i,e[8]=f):f=e[8];let m;e[9]!==f?(m=t.jsx("span",{className:"text-xs font-medium",children:f}),e[9]=f,e[10]=m):m=e[10];let u;return e[11]!==x||e[12]!==o||e[13]!==m?(u=t.jsxs(X,{type:"button",variant:"outline",onClick:x,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[o,m]}),e[11]=x,e[12]=o,e[13]=m,e[14]=u):u=e[14],u}function er(l){const e=W.c(13),{url:s,serverName:n,agentId:i}=l,a=q();let d;e[0]!==i||e[1]!==n||e[2]!==a||e[3]!==s?(d=()=>{ve("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=Js(n),p={type:"http",url:s,headers:un("Cursor")},c=Ja(JSON.stringify(p,null,2)),h=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(c)}`;window.open(h,"_blank"),ie.success(a("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=n,e[2]=a,e[3]=s,e[4]=d):d=e[4];const r=d;let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),e[5]=x):x=e[5];let o;e[6]!==a?(o=a("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=a,e[7]=o):o=e[7];let f;e[8]!==o?(f=t.jsx("span",{className:"text-xs font-medium",children:o}),e[8]=o,e[9]=f):f=e[9];let m;return e[10]!==r||e[11]!==f?(m=t.jsxs(X,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[x,f]}),e[10]=r,e[11]=f,e[12]=m):m=e[12],m}function tr(l){const e=W.c(16),{url:s,serverName:n,agentId:i}=l,a=q(),[d,r]=U.useState(!1);let x;e[0]!==i||e[1]!==n||e[2]!==a||e[3]!==s?(x=async()=>{ve("agent_connect_action",{agent_id:i,action:"install_claude_code"});const c=Js(n),h={type:"http",url:s,headers:un("Claude Code")},g=JSON.stringify(h,null,2),b=`claude mcp add-json "${c}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(b),r(!0),ie.success(a("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await ct(2e3),r(!1)},e[0]=i,e[1]=n,e[2]=a,e[3]=s,e[4]=x):x=e[4];const o=x;let f;e[5]!==d?(f=d?t.jsx(ot,{size:20,className:"text-success"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[5]=d,e[6]=f):f=e[6];let m;e[7]!==d||e[8]!==a?(m=a(d?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=d,e[8]=a,e[9]=m):m=e[9];let u;e[10]!==m?(u=t.jsx("span",{className:"text-xs font-medium",children:m}),e[10]=m,e[11]=u):u=e[11];let p;return e[12]!==o||e[13]!==f||e[14]!==u?(p=t.jsxs(X,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[f,u]}),e[12]=o,e[13]=f,e[14]=u,e[15]=p):p=e[15],p}function sr({virtualMcp:l}){const e=q(),s=vt(),[n,i]=U.useState(null),[a,d]=U.useState(!1),[r,x]=U.useState(!1),o=l.id,f=l.title||`agent-${o.slice(0,8)}`,m=n?`bunx @decocms/typegen@latest --mcp ${o} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${o} --key <api-key> --output client.ts`,u=async()=>{d(!0);try{const{key:c}=await s.call("API_KEY_CREATE",{name:`typegen-${f}`,permissions:{[o]:["*"]}});if(!c)throw new Error("No key in response");i(c),ve("agent_typegen_key_generated",{agent_id:o})}catch{ve("agent_typegen_key_failed",{agent_id:o}),ie.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{d(!1)}},p=async()=>{ve("agent_connect_action",{agent_id:o,action:"typegen_copy_command",has_api_key:!!n}),await navigator.clipboard.writeText(m),x(!0),ie.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await ct(2e3),x(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClient")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClientDescription")})]}),!n&&t.jsxs(X,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:a,children:[a?t.jsx(lt,{className:"size-3.5"}):t.jsx(Yt,{size:14}),t.jsx("span",{children:e(a?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),n&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateClientLabel")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:m}),t.jsx(X,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:p,children:r?t.jsx(ot,{size:12,className:"text-success"}):t.jsx(St,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(nr,{apiKey:n,agentId:o})]})}function nr(l){const e=W.c(21),{apiKey:s,agentId:n}=l,[i,a]=U.useState(!1),d=window.location.origin,r=s?`STUDIO_API_KEY=${s}`:"STUDIO_API_KEY=<api-key>",x=`STUDIO_BASE_URL=${d}`,o=`${r}
|
|
1
|
+
import{c as W,b as q,r as U,l as ue,j as t,t as ie,B as X,h as lt,M as $e,E as ze,F as ks,eQ as hn,L as gn,p as vn,dP as Ze,a3 as bn,dO as tt,dN as st,_ as vt,m as jn,K as Ms,eR as yn,eS as wn,eT as Sn,eU as Nn,d as Ot,u as Cn,o as ve,cE as kn,eC as Mn,eV as _n,ax as _s,a as Tn,eW as Ts,eX as Ds,as as Dn,az as fe,D as Vn,n as In,ad as An,ac as On,P as ut,eY as Oe,ag as Pn}from"./index-zEbfx_2K.js";import{g as $n}from"./extract-connection-data-Chw2Aon_.js";import{a as Fn}from"./chat-context-CyABXc7f.js";import{U as En,b as zn}from"./build-improve-prompt-doc-B6wx1rP9.js";import{E as Rn}from"./empty-state-CsX1FA1W.js";import{u as Ln}from"./shell-layout-DVwBW-8f.js";import{g as bt,n as Bn,a as Xt,e as Un,u as Yn,f as Kn}from"./use-date-fns-locale-BW93JelV.js";import{a as Pt,b as Vs,u as Wn}from"./use-connection-DYvm3CFt.js";import{b as Is,a as As,c as Os,g as Gn}from"./use-virtual-mcp-4ZF94-K-.js";import{a as Hn,i as Jt}from"./mcp-oauth-YLkkgmwu.js";import{f as qn,e as Qn,b as Xn,A as Jn,a as Zn,d as ei,c as ti,g as si}from"./alert-dialog-D1mw46Sk.js";import{D as qe,b as Qe,c as at,d as rt,e as $t,h as Ps}from"./dialog-DqEzjMAL.js";import{T as pt}from"./textarea-Cmx8DtdI.js";import{c as je,T as ye,a as we}from"./tooltip-CgGnYGtj.js";import{c as ni}from"./UserSquare-CxfIKRZH.js";import{aD as Ft,aO as ii,aP as Et,aQ as $s,aR as Fs,a2 as zt,aS as Dt,aT as Ct,aU as Zt,A as es,w as li,aV as ai,aW as ri,aX as oi,aY as ci,aZ as di,aq as ui,af as mi,f as Es,e as ts,n as fi,j as pi,h as xi,c as zs,a_ as ss,ap as hi,R as gi,u as vi,a$ as bi,a4 as ji}from"./agent-icon-CG9LA776.js";import{i as yi}from"./Play-CKEbdlIO.js";import{s as Pe}from"./Plus-DhTGO6OU.js";import{t as ft}from"./Stars01-OOrCszDj.js";import{s as nt}from"./Trash01-UhB0CRb8.js";import{u as ns}from"./use-debounced-autosave-XooE91Oe.js";import{I as Se}from"./input-BYddSsu_.js";import{a as Rt,b as Lt,P as Bt}from"./popover-Bq4WOviU.js";import{S as Rs}from"./scroll-area-BUwrzwMz.js";import{i as xt}from"./SearchMd-fdzDozsD.js";import{i as wi}from"./Upload01-CZDGBHSw.js";import{A as Si}from"./add-connection-dialog-GCEfUHNn.js";import{c as Ls,D as Bs,b as Us,a as Ge,h as is,i as ls,j as as}from"./dropdown-menu-B91kH2ef.js";import{i as Ni}from"./Share07-DL7pSoYx.js";import{F as rs}from"./file-type-icon-ajQojKQT.js";import{h as Ci,i as ki,j as Mi,k as _i}from"./use-org-fs-HohNEA-L.js";import{I as Xe}from"./integration-icon-CdbMa5vl.js";import{C as Ys}from"./checkbox-CtOL1W3M.js";import{S as Ti}from"./search-input-CT4D4zLR.js";import{b as Me,a as _e,c as pe,d as Te,S as De}from"./select-5CD79m_H.js";import{s as Ut}from"./XClose-MLfi0Jji.js";import{C as Di}from"./collection-tabs-BxK4CJTN.js";import{T as Ks,u as Ws}from"./use-mcp-auth-status-n6X-ANPT.js";import{u as jt}from"./use-mcp-client-Dpy2Y_w9.js";import{a as Gs}from"./use-mcp-tools-DErOx9G_.js";import{u as Vi}from"./use-mcp-prompts-Dh294adh.js";import{g as Ii}from"./connection-slug-CITJ0kGN.js";import{a as Ai}from"./Settings02-BQWj4mrx.js";import{t as Hs}from"./utils-CVEq3hMx.js";import{S as yt}from"./switch-ClJqQzki.js";import{i as Vt}from"./ChevronRight-B6hcwUgO.js";import{i as Oi}from"./Printer-Cqaundx-.js";import{e as Pi}from"./TrendUp01-CnwsmsBB.js";import{i as $i}from"./DotsVertical-CVHL4KPF.js";import{a as Fi}from"./Image01-O24XNmwN.js";import{i as Ei}from"./Monitor01-D5zc1Ggz.js";import{g as zi}from"./types-_4eK3VIa.js";import{b as ht,g as Ri,d as Li}from"./use-project-scope-1l5jykdC.js";import{a as Bi}from"./use-panel-navigate-jpI-ng6I.js";import{u as Ui,e as It,r as At,p as Yi,g as Ki,s as Wi,t as Gi,h as Hi,a as qi}from"./use-project-native-view-presence-lTz9hDFO.js";import{a as qs,u as Qi,i as Xi,o as Ji,r as os,p as Zi,w as el,b as cs}from"./optimistic-project-sidebar-views-BaFWHjow.js";import{b as ds,c as tl,d as sl,e as nl,B as il,a as ll}from"./breadcrumb-C1f6kD30.js";import{V as al,E as wt,S as Qs,r as Xs,C as rl,w as ol}from"./virtual-mcp-Beu0ehlX.js";import{s as Js}from"./slugify-CEUa2lfQ.js";import{b as cl,a as dl,D as ul}from"./drawer-CcQRz4y-.js";import{u as ml}from"./use-mobile-DI9_UYOG.js";import{i as ot}from"./Check-B1dsRB6C.js";import{a as St}from"./Copy01-BmdYCu9M.js";import{i as Yt}from"./Key01-CtPEI4Eg.js";import{d as ct}from"./backoff-8mStPHYB.js";import{g as Zs}from"./github-repo-BknN0SVI.js";import{i as fl}from"./GitBranch01--s8uEzME.js";import{R as pl}from"./repository-import-picker-G5-hX7A2.js";import{b as xl}from"./sandbox-url-D3mC8qhT.js";import{L as me}from"./label-DeeZ_khO.js";import{s as hl}from"./User01-fZfVT6XZ.js";import{t as gl}from"./Users01-DtXUy7uu.js";import{u as en,a as tn}from"./use-secrets-CQys3abK.js";import{o as us}from"./omit-sandbox-map-jj4lCB2U.js";import{G as vl}from"./github-icon-DDXLGNgI.js";import{e as bl,s as jl,a as yl}from"./thread-intent-B0Twy-Y4.js";import{r as wl}from"./serial-task-queue-CGOeQgpr.js";import{t as Fe,c as He,m as Sl,a as sn}from"./differenceInSeconds-C3x8sHUj.js";function it(l,e){const s=bt(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=Fe(l,e?.in),a=i.getDay(),d=(a<n?7:0)+a-n;return i.setDate(i.getDate()-d),i.setHours(0,0,0,0),i}function gt(l,e){return it(l,{...e,weekStartsOn:1})}function nn(l,e){const s=Fe(l,e?.in),n=s.getFullYear(),i=He(s,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const a=gt(i),d=He(s,0);d.setFullYear(n,0,4),d.setHours(0,0,0,0);const r=gt(d);return s.getTime()>=a.getTime()?n+1:s.getTime()>=r.getTime()?n:n-1}function ms(l,e){const s=Fe(l,e?.in);return s.setHours(0,0,0,0),s}function Nl(l,e,s){const[n,i]=Bn(s?.in,l,e),a=ms(n),d=ms(i),r=+a-Xt(a),x=+d-Xt(d);return Math.round((r-x)/Sl)}function Cl(l,e){const s=nn(l,e),n=He(l,0);return n.setFullYear(s,0,4),n.setHours(0,0,0,0),gt(n)}function kl(l){return l instanceof Date||typeof l=="object"&&Object.prototype.toString.call(l)==="[object Date]"}function Ml(l){return!(!kl(l)&&typeof l!="number"||isNaN(+Fe(l)))}function _l(l,e){const s=Fe(l,e?.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}function Tl(l,e){const s=Fe(l,e?.in);return Nl(s,_l(s))+1}function Dl(l,e){const s=Fe(l,e?.in),n=+gt(s)-+Cl(s);return Math.round(n/sn)+1}function ln(l,e){const s=Fe(l,e?.in),n=s.getFullYear(),i=bt(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,d=He(e?.in||l,0);d.setFullYear(n+1,0,a),d.setHours(0,0,0,0);const r=it(d,e),x=He(e?.in||l,0);x.setFullYear(n,0,a),x.setHours(0,0,0,0);const o=it(x,e);return+s>=+r?n+1:+s>=+o?n:n-1}function Vl(l,e){const s=bt(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,i=ln(l,e),a=He(e?.in||l,0);return a.setFullYear(i,0,n),a.setHours(0,0,0,0),it(a,e)}function Il(l,e){const s=Fe(l,e?.in),n=+it(s,e)-+Vl(s,e);return Math.round(n/sn)+1}function re(l,e){const s=l<0?"-":"",n=Math.abs(l).toString().padStart(e,"0");return s+n}const Ee={y(l,e){const s=l.getFullYear(),n=s>0?s:1-s;return re(e==="yy"?n%100:n,e.length)},M(l,e){const s=l.getMonth();return e==="M"?String(s+1):re(s+1,2)},d(l,e){return re(l.getDate(),e.length)},a(l,e){const s=l.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];default:return s==="am"?"a.m.":"p.m."}},h(l,e){return re(l.getHours()%12||12,e.length)},H(l,e){return re(l.getHours(),e.length)},m(l,e){return re(l.getMinutes(),e.length)},s(l,e){return re(l.getSeconds(),e.length)},S(l,e){const s=e.length,n=l.getMilliseconds(),i=Math.trunc(n*Math.pow(10,s-3));return re(i,e.length)}},We={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},fs={G:function(l,e,s){const n=l.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"});case"GGGGG":return s.era(n,{width:"narrow"});default:return s.era(n,{width:"wide"})}},y:function(l,e,s){if(e==="yo"){const n=l.getFullYear(),i=n>0?n:1-n;return s.ordinalNumber(i,{unit:"year"})}return Ee.y(l,e)},Y:function(l,e,s,n){const i=ln(l,n),a=i>0?i:1-i;if(e==="YY"){const d=a%100;return re(d,2)}return e==="Yo"?s.ordinalNumber(a,{unit:"year"}):re(a,e.length)},R:function(l,e){const s=nn(l);return re(s,e.length)},u:function(l,e){const s=l.getFullYear();return re(s,e.length)},Q:function(l,e,s){const n=Math.ceil((l.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return re(n,2);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});default:return s.quarter(n,{width:"wide",context:"formatting"})}},q:function(l,e,s){const n=Math.ceil((l.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return re(n,2);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});default:return s.quarter(n,{width:"wide",context:"standalone"})}},M:function(l,e,s){const n=l.getMonth();switch(e){case"M":case"MM":return Ee.M(l,e);case"Mo":return s.ordinalNumber(n+1,{unit:"month"});case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});default:return s.month(n,{width:"wide",context:"formatting"})}},L:function(l,e,s){const n=l.getMonth();switch(e){case"L":return String(n+1);case"LL":return re(n+1,2);case"Lo":return s.ordinalNumber(n+1,{unit:"month"});case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});default:return s.month(n,{width:"wide",context:"standalone"})}},w:function(l,e,s,n){const i=Il(l,n);return e==="wo"?s.ordinalNumber(i,{unit:"week"}):re(i,e.length)},I:function(l,e,s){const n=Dl(l);return e==="Io"?s.ordinalNumber(n,{unit:"week"}):re(n,e.length)},d:function(l,e,s){return e==="do"?s.ordinalNumber(l.getDate(),{unit:"date"}):Ee.d(l,e)},D:function(l,e,s){const n=Tl(l);return e==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):re(n,e.length)},E:function(l,e,s){const n=l.getDay();switch(e){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},e:function(l,e,s,n){const i=l.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return re(a,2);case"eo":return s.ordinalNumber(a,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(l,e,s,n){const i=l.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return re(a,e.length);case"co":return s.ordinalNumber(a,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(l,e,s){const n=l.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return re(i,e.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},a:function(l,e,s){const i=l.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(l,e,s){const n=l.getHours();let i;switch(n===12?i=We.noon:n===0?i=We.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(l,e,s){const n=l.getHours();let i;switch(n>=17?i=We.evening:n>=12?i=We.afternoon:n>=4?i=We.morning:i=We.night,e){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(l,e,s){if(e==="ho"){let n=l.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return Ee.h(l,e)},H:function(l,e,s){return e==="Ho"?s.ordinalNumber(l.getHours(),{unit:"hour"}):Ee.H(l,e)},K:function(l,e,s){const n=l.getHours()%12;return e==="Ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},k:function(l,e,s){let n=l.getHours();return n===0&&(n=24),e==="ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},m:function(l,e,s){return e==="mo"?s.ordinalNumber(l.getMinutes(),{unit:"minute"}):Ee.m(l,e)},s:function(l,e,s){return e==="so"?s.ordinalNumber(l.getSeconds(),{unit:"second"}):Ee.s(l,e)},S:function(l,e){return Ee.S(l,e)},X:function(l,e,s){const n=l.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return xs(n);case"XXXX":case"XX":return Be(n);default:return Be(n,":")}},x:function(l,e,s){const n=l.getTimezoneOffset();switch(e){case"x":return xs(n);case"xxxx":case"xx":return Be(n);default:return Be(n,":")}},O:function(l,e,s){const n=l.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ps(n,":");default:return"GMT"+Be(n,":")}},z:function(l,e,s){const n=l.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ps(n,":");default:return"GMT"+Be(n,":")}},t:function(l,e,s){const n=Math.trunc(+l/1e3);return re(n,e.length)},T:function(l,e,s){return re(+l,e.length)}};function ps(l,e=""){const s=l>0?"-":"+",n=Math.abs(l),i=Math.trunc(n/60),a=n%60;return a===0?s+String(i):s+String(i)+e+re(a,2)}function xs(l,e){return l%60===0?(l>0?"-":"+")+re(Math.abs(l)/60,2):Be(l,e)}function Be(l,e=""){const s=l>0?"-":"+",n=Math.abs(l),i=re(Math.trunc(n/60),2),a=re(n%60,2);return s+i+e+a}const hs=(l,e)=>{switch(l){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},an=(l,e)=>{switch(l){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Al=(l,e)=>{const s=l.match(/(P+)(p+)?/)||[],n=s[1],i=s[2];if(!i)return hs(l,e);let a;switch(n){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",hs(n,e)).replace("{{time}}",an(i,e))},Ol={p:an,P:Al},Pl=/^D+$/,$l=/^Y+$/,Fl=["D","DD","YY","YYYY"];function El(l){return Pl.test(l)}function zl(l){return $l.test(l)}function Rl(l,e,s){const n=Ll(l,e,s);if(console.warn(n),Fl.includes(l))throw new RangeError(n)}function Ll(l,e,s){const n=l[0]==="Y"?"years":"days of the month";return`Use \`${l.toLowerCase()}\` instead of \`${l}\` (in \`${e}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Bl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ul=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Yl=/^'([^]*?)'?$/,Kl=/''/g,Wl=/[a-zA-Z]/;function Gl(l,e,s){const n=bt(),i=s?.locale??n.locale??Un,a=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,d=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Fe(l,s?.in);if(!Ml(r))throw new RangeError("Invalid time value");let x=e.match(Ul).map(f=>{const m=f[0];if(m==="p"||m==="P"){const u=Ol[m];return u(f,i.formatLong)}return f}).join("").match(Bl).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:Hl(f)};if(fs[m])return{isToken:!0,value:f};if(m.match(Wl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});i.localize.preprocessor&&(x=i.localize.preprocessor(r,x));const o={firstWeekContainsDate:a,weekStartsOn:d,locale:i};return x.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!s?.useAdditionalWeekYearTokens&&zl(m)||!s?.useAdditionalDayOfYearTokens&&El(m))&&Rl(m,e,String(l));const u=fs[m[0]];return u(r,m,i.localize,o)}).join("")}function Hl(l){const e=l.match(Yl);return e?e[1].replace(Kl,"'"):l}function ql(l){const e=W.c(82),{value:s,onChange:n,onColorChange:i,name:a,size:d,className:r,avatarClassName:x,showHoverOverlay:o,disabled:f}=l,m=d===void 0?"lg":d,u=o===void 0?!0:o,p=f===void 0?!1:f,c=q(),[h,g]=U.useState(!1),[b,y]=U.useState("icons"),[j,v]=U.useState(""),[N,S]=U.useState("blue");let M;e[0]!==s?(M=Ft(s),e[0]=s,e[1]=M):M=e[1];const w=M,k=w.type==="icon"||w.type==="url"&&w.color?w.color:N;let C;e[2]!==n||e[3]!==k?(C=V=>{n(Ct(V,k))},e[2]=n,e[3]=k,e[4]=C):C=e[4];const _=C;let D;e[5]!==n||e[6]!==i||e[7]!==w.name||e[8]!==w.type||e[9]!==w.url?(D=V=>{S(V),i?.(V),w.type==="icon"?n(Ct(w.name,V)):w.type==="url"&&n(Zt(w.url,V))},e[5]=n,e[6]=i,e[7]=w.name,e[8]=w.type,e[9]=w.url,e[10]=D):D=e[10];const P=D;let I;e[11]!==n||e[12]!==k?(I=V=>{n(Zt(V,k)),g(!1)},e[11]=n,e[12]=k,e[13]=I):I=e[13];const $=I;let A;e[14]!==n||e[15]!==k?(A=()=>{const V=Et(),ee=V[Math.floor(Math.random()*V.length)];n(Ct(ee,k))},e[14]=n,e[15]=k,e[16]=A):A=e[16];const Y=A,K=p?!1:h,Q=p?"cursor-default opacity-50":"cursor-pointer";let R;e[17]!==r||e[18]!==m||e[19]!==Q?(R=ue("relative group overflow-hidden",Q,ii(m),r),e[17]=r,e[18]=m,e[19]=Q,e[20]=R):R=e[20];let H;e[21]!==x||e[22]!==a||e[23]!==m||e[24]!==s?(H=t.jsx(es,{icon:s,name:a,size:m,className:x}),e[21]=x,e[22]=a,e[23]=m,e[24]=s,e[25]=H):H=e[25];let L;e[26]!==p||e[27]!==u?(L=u&&!p&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(li,{size:16,className:"text-white"})}),e[26]=p,e[27]=u,e[28]=L):L=e[28];let T;e[29]!==p||e[30]!==R||e[31]!==H||e[32]!==L?(T=t.jsx(Rt,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":"Change icon",disabled:p,className:R,children:[H,L]})}),e[29]=p,e[30]=R,e[31]=H,e[32]=L,e[33]=T):T=e[33];let O;e[34]!==a||e[35]!==s?(O=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(es,{icon:s,name:a,size:"xl"})}),e[34]=a,e[35]=s,e[36]=O):O=e[36];let G;e[37]!==b?(G=V=>{if(V.key!=="ArrowLeft"&&V.key!=="ArrowRight")return;V.preventDefault();const ee=b==="icons"?"upload":"icons";y(ee),document.getElementById(`icon-picker-tab-${ee}`)?.focus()},e[37]=b,e[38]=G):G=e[38];const z=b==="icons",F=b==="icons"?0:-1;let B;e[39]===Symbol.for("react.memo_cache_sentinel")?(B=()=>y("icons"),e[39]=B):B=e[39];const J=b==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ne;e[40]!==J?(ne=ue("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",J),e[40]=J,e[41]=ne):ne=e[41];let le;e[42]!==c?(le=c("common.iconPicker.iconsTab"),e[42]=c,e[43]=le):le=e[43];let de;e[44]!==z||e[45]!==F||e[46]!==ne||e[47]!==le?(de=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":z,"aria-controls":"icon-picker-panel-icons",tabIndex:F,onClick:B,className:ne,children:le}),e[44]=z,e[45]=F,e[46]=ne,e[47]=le,e[48]=de):de=e[48];const oe=b==="upload",ae=b==="upload"?0:-1;let te;e[49]===Symbol.for("react.memo_cache_sentinel")?(te=()=>y("upload"),e[49]=te):te=e[49];const xe=b==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let he;e[50]!==xe?(he=ue("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",xe),e[50]=xe,e[51]=he):he=e[51];let Ce;e[52]!==c?(Ce=c("common.iconPicker.uploadTab"),e[52]=c,e[53]=Ce):Ce=e[53];let ge;e[54]!==oe||e[55]!==ae||e[56]!==he||e[57]!==Ce?(ge=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":oe,"aria-controls":"icon-picker-panel-upload",tabIndex:ae,onClick:te,className:he,children:Ce}),e[54]=oe,e[55]=ae,e[56]=he,e[57]=Ce,e[58]=ge):ge=e[58];let Ie;e[59]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx("div",{className:"flex-1"}),e[59]=Ie):Ie=e[59];let be;e[60]!==G||e[61]!==de||e[62]!==ge?(be=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:G,children:[de,ge,Ie]}),e[60]=G,e[61]=de,e[62]=ge,e[63]=be):be=e[63];let Ne;e[64]!==P||e[65]!==Y||e[66]!==_||e[67]!==$||e[68]!==w.name||e[69]!==w.type||e[70]!==j||e[71]!==k||e[72]!==b?(Ne=b==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(Zl,{search:j,onSearchChange:v,selectedColor:k,onColorChange:P,onSelectIcon:_,onRandom:Y,currentIconName:w.type==="icon"?w.name:null})}):t.jsx("div",{id:"icon-picker-panel-upload",role:"tabpanel","aria-labelledby":"icon-picker-tab-upload",children:t.jsx(ea,{onUpload:$})}),e[64]=P,e[65]=Y,e[66]=_,e[67]=$,e[68]=w.name,e[69]=w.type,e[70]=j,e[71]=k,e[72]=b,e[73]=Ne):Ne=e[73];let E;e[74]!==O||e[75]!==be||e[76]!==Ne?(E=t.jsx(Lt,{align:"start",className:"w-80 p-0",onOpenAutoFocus:Ql,children:t.jsxs("div",{className:"flex flex-col",children:[O,be,Ne]})}),e[74]=O,e[75]=be,e[76]=Ne,e[77]=E):E=e[77];let se;return e[78]!==T||e[79]!==E||e[80]!==K?(se=t.jsxs(Bt,{open:K,onOpenChange:g,children:[T,E]}),e[78]=T,e[79]=E,e[80]=K,e[81]=se):se=e[81],se}function Ql(l){return l.preventDefault()}function Xl(l){const e=W.c(33),{selectedColor:s,onColorChange:n}=l,i=q(),[a,d]=U.useState(!1);let r,x,o,f,m,u,p;if(e[0]!==a||e[1]!==s){const N=$s(s);x=Bt,u=a,p=d,r=Rt,m=!0,o="button",f=ue("h-6 w-6 rounded-full shrink-0 ring-2 ring-offset-2 ring-offset-background transition-all cursor-pointer hover:scale-110",N.dot,"ring-foreground/20"),e[0]=a,e[1]=s,e[2]=r,e[3]=x,e[4]=o,e[5]=f,e[6]=m,e[7]=u,e[8]=p}else r=e[2],x=e[3],o=e[4],f=e[5],m=e[6],u=e[7],p=e[8];let c;e[9]!==i?(c=i("common.iconPicker.changeColor"),e[9]=i,e[10]=c):c=e[10];let h;e[11]!==i?(h=i("common.iconPicker.changeColor"),e[11]=i,e[12]=h):h=e[12];let g;e[13]!==o||e[14]!==f||e[15]!==c||e[16]!==h?(g=t.jsx("button",{type:o,className:f,title:c,"aria-label":h}),e[13]=o,e[14]=f,e[15]=c,e[16]=h,e[17]=g):g=e[17];let b;e[18]!==r||e[19]!==m||e[20]!==g?(b=t.jsx(r,{asChild:m,children:g}),e[18]=r,e[19]=m,e[20]=g,e[21]=b):b=e[21];let y;e[22]!==n||e[23]!==s?(y=ri.map(N=>t.jsx("button",{type:"button",onClick:()=>{n(N.name),d(!1)},className:ue("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",N.dot,s===N.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:N.name,"aria-label":N.name},N.name)),e[22]=n,e[23]=s,e[24]=y):y=e[24];let j;e[25]!==y?(j=t.jsx(Lt,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:Jl,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:y})}),e[25]=y,e[26]=j):j=e[26];let v;return e[27]!==x||e[28]!==j||e[29]!==u||e[30]!==p||e[31]!==b?(v=t.jsxs(x,{open:u,onOpenChange:p,children:[b,j]}),e[27]=x,e[28]=j,e[29]=u,e[30]=p,e[31]=b,e[32]=v):v=e[32],v}function Jl(l){return l.preventDefault()}function Zl(l){const e=W.c(55),{search:s,onSearchChange:n,selectedColor:i,onColorChange:a,onSelectIcon:d,onRandom:r,currentIconName:x}=l,o=q();let f,m,u,p,c,h,g;if(e[0]!==x||e[1]!==a||e[2]!==r||e[3]!==n||e[4]!==d||e[5]!==s||e[6]!==i||e[7]!==o){const N=Et(),S=$s(i);m=Fs(N,s),h="flex flex-col";let M;e[15]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(xt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=M):M=e[15];let w;e[16]!==n?(w=A=>n(A.target.value),e[16]=n,e[17]=w):w=e[17];let k;e[18]!==o?(k=o("common.iconPicker.filterPlaceholder"),e[18]=o,e[19]=k):k=e[19];let C;e[20]!==s||e[21]!==w||e[22]!==k?(C=t.jsxs("div",{className:"relative flex-1",children:[M,t.jsx(Se,{value:s,onChange:w,placeholder:k,className:"h-8 text-xs pl-7"})]}),e[20]=s,e[21]=w,e[22]=k,e[23]=C):C=e[23];let _;e[24]!==o?(_=o("common.iconPicker.randomIcon"),e[24]=o,e[25]=_):_=e[25];let D;e[26]!==o?(D=o("common.iconPicker.randomIcon"),e[26]=o,e[27]=D):D=e[27];let P;e[28]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(ai,{size:14,className:"text-muted-foreground"}),e[28]=P):P=e[28];let I;e[29]!==r||e[30]!==_||e[31]!==D?(I=t.jsx("button",{type:"button",onClick:r,className:"h-8 w-8 flex items-center justify-center rounded-md border border-border hover:bg-accent transition-colors shrink-0",title:_,"aria-label":D,children:P}),e[29]=r,e[30]=_,e[31]=D,e[32]=I):I=e[32];let $;e[33]!==a||e[34]!==i?($=t.jsx(Xl,{selectedColor:i,onColorChange:a}),e[33]=a,e[34]=i,e[35]=$):$=e[35],e[36]!==I||e[37]!==$||e[38]!==C?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[C,I,$]}),e[36]=I,e[37]=$,e[38]=C,e[39]=g):g=e[39],f=Rs,c="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",p=m.map(A=>{const Y=zt(A);return Y?t.jsx("button",{type:"button",onClick:()=>d(A),className:ue("h-8 w-8 flex items-center justify-center rounded-md transition-colors cursor-pointer",x===A?ue(S.bg,S.text):ue(S.text,"hover:bg-accent")),title:A,"aria-label":Dt(A),children:t.jsx(Y,{size:18})},A):null}),e[0]=x,e[1]=a,e[2]=r,e[3]=n,e[4]=d,e[5]=s,e[6]=i,e[7]=o,e[8]=f,e[9]=m,e[10]=u,e[11]=p,e[12]=c,e[13]=h,e[14]=g}else f=e[8],m=e[9],u=e[10],p=e[11],c=e[12],h=e[13],g=e[14];let b;e[40]!==u||e[41]!==p?(b=t.jsx("div",{className:u,children:p}),e[40]=u,e[41]=p,e[42]=b):b=e[42];let y;e[43]!==m.length||e[44]!==o?(y=m.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:o("common.iconPicker.noIconsFound")}),e[43]=m.length,e[44]=o,e[45]=y):y=e[45];let j;e[46]!==f||e[47]!==c||e[48]!==b||e[49]!==y?(j=t.jsxs(f,{className:c,children:[b,y]}),e[46]=f,e[47]=c,e[48]=b,e[49]=y,e[50]=j):j=e[50];let v;return e[51]!==h||e[52]!==g||e[53]!==j?(v=t.jsxs("div",{className:h,children:[g,j]}),e[51]=h,e[52]=g,e[53]=j,e[54]=v):v=e[54],v}function ea(l){const e=W.c(46),{onUpload:s}=l,n=q(),i=U.useRef(null);let a;e[0]!==s||e[1]!==n?(a=I=>{const $=I.target.files?.[0];if(!$)return;if($.size>2097152){ie.error(n("common.iconPicker.imageTooLarge")),I.target.value="";return}const A=new FileReader;A.onerror=()=>{ie.error(n("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},A.onloadend=()=>{A.readyState===FileReader.DONE&&A.result&&s(A.result),i.current&&(i.current.value="")},A.readAsDataURL($)},e[0]=s,e[1]=n,e[2]=a):a=e[2];const d=a,[r,x]=U.useState("");let o;e[3]!==s||e[4]!==r?(o=()=>{const I=r.trim();I&&(s(I),x(""))},e[3]=s,e[4]=r,e[5]=o):o=e[5];const f=o;let m;e[6]!==d?(m=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:d}),e[6]=d,e[7]=m):m=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i.current?.click(),e[8]=u):u=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(wi,{size:20}),e[9]=p):p=e[9];let c;e[10]!==n?(c=n("common.iconPicker.uploadHint"),e[10]=n,e[11]=c):c=e[11];let h;e[12]!==c?(h=t.jsxs("button",{type:"button",onClick:u,className:"h-24 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-2 text-muted-foreground hover:text-foreground",children:[p,t.jsx("span",{className:"text-xs",children:c})]}),e[12]=c,e[13]=h):h=e[13];let g;e[14]!==n?(g=n("common.iconPicker.or"),e[14]=n,e[15]=g):g=e[15];let b;e[16]!==g?(b=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=b):b=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex-1 h-px bg-border"}),e[18]=y):y=e[18];let j;e[19]!==b?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[b,y]}),e[19]=b,e[20]=j):j=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=I=>x(I.target.value),e[21]=v):v=e[21];let N;e[22]!==n?(N=n("common.iconPicker.pasteUrlPlaceholder"),e[22]=n,e[23]=N):N=e[23];let S;e[24]!==f?(S=I=>{I.key==="Enter"&&(I.preventDefault(),f())},e[24]=f,e[25]=S):S=e[25];let M;e[26]!==r||e[27]!==N||e[28]!==S?(M=t.jsx(Se,{value:r,onChange:v,placeholder:N,className:"h-8 text-xs flex-1",onKeyDown:S}),e[26]=r,e[27]=N,e[28]=S,e[29]=M):M=e[29];let w;e[30]!==r?(w=r.trim(),e[30]=r,e[31]=w):w=e[31];const k=!w;let C;e[32]!==n?(C=n("common.iconPicker.apply"),e[32]=n,e[33]=C):C=e[33];let _;e[34]!==f||e[35]!==k||e[36]!==C?(_=t.jsx(X,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs shrink-0",onClick:f,disabled:k,children:C}),e[34]=f,e[35]=k,e[36]=C,e[37]=_):_=e[37];let D;e[38]!==M||e[39]!==_?(D=t.jsxs("div",{className:"flex items-center gap-1.5",children:[M,_]}),e[38]=M,e[39]=_,e[40]=D):D=e[40];let P;return e[41]!==j||e[42]!==D||e[43]!==m||e[44]!==h?(P=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[m,h,j,D]}),e[41]=j,e[42]=D,e[43]=m,e[44]=h,e[45]=P):P=e[45],P}const rn=25*1024*1024,kt="home",Mt="knowledge";function gs(l){return l==null?"":l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(0)} KB`:`${(l/(1024*1024)).toFixed(1)} MB`}function Re(l){return l.split("/").pop()??l}function ta(l){const e=W.c(64),{form:s}=l,n=q(),{upload:i}=Ci(kt),a=ki(),d=U.useRef(null),[r,x]=U.useState(!1),[o,f]=U.useState(""),[m,u]=U.useState(!1);let p;e[0]!==r?(p={enabled:r},e[0]=r,e[1]=p):p=e[1];const{data:c}=Mi(60,p),h=c===void 0?[]:c;let g;e[2]!==r?(g={enabled:r},e[2]=r,e[3]=g):g=e[3];const{data:b}=_i(g),y=b===void 0?[]:b;let j;e[4]!==s?(j=()=>s.getValues("metadata.knowledge")??[],e[4]=s,e[5]=j):j=e[5];const[v,N]=U.useState(j);let S;e[6]!==s?(S=E=>{N(E),s.setValue("metadata.knowledge",E,{shouldDirty:!0})},e[6]=s,e[7]=S):S=e[7];const M=S;let w;e[8]!==a||e[9]!==v||e[10]!==M||e[11]!==n||e[12]!==i?(w=async E=>{if(!E||E.length===0)return;const se=Array.from(E),V=se.filter(oa),ee=se.filter(ra);if(ee.length>0&&ie.warning(n("virtualMcp.filesSection.fileTooLargeTitle"),{description:n("virtualMcp.filesSection.fileTooLargeDescription",{names:ee.map(aa).join(", ")})}),V.length!==0){try{await i.mutateAsync({dir:Mt,files:V})}catch(Z){const ce=Z;ie.error(ce instanceof Error?ce.message:n("virtualMcp.filesSection.failedUploadFile"));return}M([...v,...V.map(Z=>({id:crypto.randomUUID(),name:Z.name,volume:kt,path:`${Mt}/${Z.name}`,url:a(kt,`${Mt}/${Z.name}`),contentType:Z.type||null,size:Z.size,addedAt:new Date().toISOString()}))])}},e[8]=a,e[9]=v,e[10]=M,e[11]=n,e[12]=i,e[13]=w):w=e[13];const k=w;let C;e[14]!==a||e[15]!==v||e[16]!==M?(C=E=>{v.some(se=>se.volume===E.volume&&se.path===E.path)||(M([...v,{id:crypto.randomUUID(),name:Re(E.path),volume:E.volume,path:E.path,url:a(E.volume,E.path),contentType:null,size:E.size??null,addedAt:new Date().toISOString()}]),x(!1))},e[14]=a,e[15]=v,e[16]=M,e[17]=C):C=e[17];const _=C;let D;e[18]!==a||e[19]!==v||e[20]!==M?(D=E=>{v.some(se=>se.volume===E.volume&&se.path===E.path)||(M([...v,{id:crypto.randomUUID(),name:Re(E.path),kind:"skill",volume:E.volume,path:E.path,url:a(E.volume,E.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),x(!1))},e[18]=a,e[19]=v,e[20]=M,e[21]=D):D=e[21];const P=D;let I;e[22]!==v||e[23]!==M?(I=E=>{M(v.filter(se=>se.id!==E))},e[22]=v,e[23]=M,e[24]=I):I=e[24];const $=I;let A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=E=>{x(E),E&&f("")},e[25]=A):A=e[25];const Y=A;let K;e[26]!==v?(K=new Set(v.map(la)),e[26]=v,e[27]=K):K=e[27];const Q=K,R=o.toLowerCase();let H;e[28]!==Q?(H=E=>!Q.has(`${E.volume}/${E.path}`),e[28]=Q,e[29]=H):H=e[29];const L=h.filter(ia).filter(H).filter(E=>Re(E.path).toLowerCase().includes(R)).slice(0,5);let T;e[30]!==Q?(T=E=>!Q.has(`${E.volume}/${E.path}`),e[30]=Q,e[31]=T):T=e[31];const O=y.filter(T).filter(E=>Re(E.path).toLowerCase().includes(R)).slice(0,5),G=E=>t.jsxs(Ls,{open:r,onOpenChange:Y,children:[t.jsx(Bs,{asChild:!0,children:E}),t.jsxs(Us,{align:"end",className:"w-56",children:[t.jsxs(Ge,{onSelect:()=>{d.current?.click()},children:[t.jsx(oi,{size:16}),n("virtualMcp.filesSection.uploadFile")]}),t.jsxs(is,{children:[t.jsxs(ls,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(Ni,{size:16}),n("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(as,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(xt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:se=>f(se.target.value),onKeyDown:na,placeholder:n("virtualMcp.filesSection.searchFilesPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:L.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noFilesFound")}):L.map(se=>t.jsxs(Ge,{onSelect:()=>_(se),children:[t.jsx(rs,{filename:Re(se.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Re(se.path)}),se.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:gs(se.size)})]},`${se.volume}/${se.path}`))})]})]}),t.jsxs(is,{children:[t.jsxs(ls,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(ft,{size:16}),n("virtualMcp.filesSection.selectSkill")]}),t.jsxs(as,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(xt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:se=>f(se.target.value),onKeyDown:sa,placeholder:n("virtualMcp.filesSection.searchSkillsPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:O.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noSkillsFound")}):O.map(se=>t.jsxs(Ge,{onSelect:()=>P(se),children:[t.jsx(ft,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Re(se.path)})]},`${se.volume}/${se.path}`))})]})]})]})]}),z="flex flex-col gap-3";let F;e[32]!==n?(F=n("virtualMcp.filesSection.filesAndSkills"),e[32]=n,e[33]=F):F=e[33];let B;e[34]!==F?(B=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:F}),e[34]=F,e[35]=B):B=e[35];let J;e[36]!==n?(J=n("virtualMcp.filesSection.description"),e[36]=n,e[37]=J):J=e[37];let ne;e[38]!==J?(ne=t.jsx("p",{className:"text-sm text-muted-foreground",children:J}),e[38]=J,e[39]=ne):ne=e[39];let le;e[40]!==B||e[41]!==ne?(le=t.jsxs("div",{className:"flex flex-col gap-1",children:[B,ne]}),e[40]=B,e[41]=ne,e[42]=le):le=e[42];const de=v.length>0&&G(t.jsxs(X,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(lt,{size:"xs"}):t.jsx(Pe,{size:14}),n("virtualMcp.filesSection.add")]}));let oe;e[43]!==le||e[44]!==de?(oe=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[le,de]}),e[43]=le,e[44]=de,e[45]=oe):oe=e[45];let ae;e[46]!==k?(ae=t.jsx("input",{ref:d,type:"file",multiple:!0,className:"hidden",onChange:E=>{k(E.target.files),E.target.value=""}}),e[46]=k,e[47]=ae):ae=e[47];let te,xe;e[48]===Symbol.for("react.memo_cache_sentinel")?(te=E=>{E.preventDefault(),u(!0)},xe=()=>u(!1),e[48]=te,e[49]=xe):(te=e[48],xe=e[49]);let he;e[50]!==k?(he=E=>{E.preventDefault(),E.stopPropagation(),u(!1),k(E.dataTransfer.files)},e[50]=k,e[51]=he):he=e[51];const Ce=m&&"outline outline-2 outline-dashed outline-primary";let ge;e[52]!==Ce?(ge=ue("flex flex-col gap-2 rounded-lg",Ce),e[52]=Ce,e[53]=ge):ge=e[53];const Ie=v.length===0?G(t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:n("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):v.map(E=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-card",children:[E.kind==="skill"?t.jsx("div",{className:"flex items-center justify-center h-8 w-6.5 shrink-0 rounded-md bg-muted text-muted-foreground",children:t.jsx(ft,{size:16})}):t.jsx(rs,{filename:E.name,className:"h-8 w-6.5 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:E.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:E.kind==="skill"?n("virtualMcp.filesSection.kindSkill"):E.size!=null?gs(E.size):n("virtualMcp.filesSection.kindFile")})]}),t.jsx(X,{variant:"ghost",size:"icon",onClick:()=>$(E.id),"aria-label":n("virtualMcp.filesSection.removeAriaLabel",{name:E.name}),children:t.jsx(nt,{size:16})})]},E.id));let be;e[54]!==te||e[55]!==xe||e[56]!==he||e[57]!==ge||e[58]!==Ie?(be=t.jsx("div",{onDragOver:te,onDragLeave:xe,onDrop:he,className:ge,children:Ie}),e[54]=te,e[55]=xe,e[56]=he,e[57]=ge,e[58]=Ie,e[59]=be):be=e[59];let Ne;return e[60]!==oe||e[61]!==ae||e[62]!==be?(Ne=t.jsxs("section",{className:z,children:[oe,ae,be]}),e[60]=oe,e[61]=ae,e[62]=be,e[63]=Ne):Ne=e[63],Ne}function sa(l){return l.stopPropagation()}function na(l){return l.stopPropagation()}function ia(l){return l.kind!=="dir"}function la(l){return`${l.volume}/${l.path}`}function aa(l){return l.name}function ra(l){return l.size>rn}function oa(l){return l.size<=rn}function ca(l){return l==null?"all":l.length===0?"self":"selected"}function da(l){const e=W.c(88),{form:s,currentAgentId:n}=l,i=q(),{org:a}=$e(),d=Is(),[r,x]=U.useState(!1);let o;e[0]!==s?(o=s.getValues("metadata.subAgents")??null,e[0]=s,e[1]=o):o=e[1];const f=o;let m;e[2]!==f?(m=()=>ca(f),e[2]=f,e[3]=m):m=e[3];const[u,p]=U.useState(m);let c;e[4]!==f?(c=f??[],e[4]=f,e[5]=c):c=e[5];const[h,g]=U.useState(c);let b,y,j,v,N,S;if(e[6]!==d||e[7]!==n||e[8]!==s||e[9]!==u||e[10]!==a||e[11]!==h||e[12]!==i){let C;e[19]!==n||e[20]!==a?(C=te=>te.id!==n&&te.id!==a.id&&te.status==="active",e[19]=n,e[20]=a,e[21]=C):C=e[21],b=d.filter(C);let _;e[22]!==h?(_=te=>h.includes(te.id),e[22]=h,e[23]=_):_=e[23];const D=b.filter(_);let P;e[24]!==s?(P=(te,xe)=>s.setValue("metadata.subAgents",te==="all"?null:te==="self"?[]:xe,{shouldDirty:!0}),e[24]=s,e[25]=P):P=e[25];const I=P;let $;e[26]!==I||e[27]!==h?($=te=>{p(te),I(te,h)},e[26]=I,e[27]=h,e[28]=$):$=e[28];const A=$;let Y;e[29]!==I||e[30]!==h?(Y=te=>{const xe=h.includes(te)?h.filter(he=>he!==te):[...h,te];g(xe),I("selected",xe)},e[29]=I,e[30]=h,e[31]=Y):Y=e[31],y=Y,N="flex flex-col gap-3";let K;e[32]!==i?(K=i("virtualMcp.subAgentsSection.title"),e[32]=i,e[33]=K):K=e[33];let Q;e[34]!==K?(Q=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:K}),e[34]=K,e[35]=Q):Q=e[35];let R;e[36]!==u||e[37]!==i?(R=u==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=u,e[37]=i,e[38]=R):R=e[38];let H;e[39]!==u||e[40]!==i?(H=u==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=u,e[40]=i,e[41]=H):H=e[41];let L;e[42]!==Q||e[43]!==R||e[44]!==H?(L=t.jsxs("div",{className:"flex flex-col gap-1",children:[Q,R,H]}),e[42]=Q,e[43]=R,e[44]=H,e[45]=L):L=e[45];const T=u==="selected"&&D.length>0&&t.jsxs(X,{variant:"outline",size:"sm",onClick:()=>x(!0),children:[t.jsx(Pe,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let O;e[46]!==A?(O=te=>A(te),e[46]=A,e[47]=O):O=e[47];let G;e[48]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(Me,{size:"sm",className:"w-auto",children:t.jsx(_e,{})}),e[48]=G):G=e[48];let z;e[49]!==i?(z=i("virtualMcp.subAgentsSection.anyAgent"),e[49]=i,e[50]=z):z=e[50];let F;e[51]!==z?(F=t.jsx(pe,{value:"all",children:z}),e[51]=z,e[52]=F):F=e[52];let B;e[53]!==i?(B=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=B):B=e[54];let J;e[55]!==B?(J=t.jsx(pe,{value:"selected",children:B}),e[55]=B,e[56]=J):J=e[56];let ne;e[57]!==i?(ne=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=ne):ne=e[58];let le;e[59]!==ne?(le=t.jsx(pe,{value:"self",children:ne}),e[59]=ne,e[60]=le):le=e[60];let de;e[61]!==F||e[62]!==J||e[63]!==le?(de=t.jsxs(Te,{align:"end",children:[F,J,le]}),e[61]=F,e[62]=J,e[63]=le,e[64]=de):de=e[64];let oe;e[65]!==u||e[66]!==O||e[67]!==de?(oe=t.jsxs(De,{value:u,onValueChange:O,children:[G,de]}),e[65]=u,e[66]=O,e[67]=de,e[68]=oe):oe=e[68];let ae;e[69]!==T||e[70]!==oe?(ae=t.jsxs("div",{className:"flex items-center gap-2",children:[T,oe]}),e[69]=T,e[70]=oe,e[71]=ae):ae=e[71],e[72]!==L||e[73]!==ae?(S=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[L,ae]}),e[72]=L,e[73]=ae,e[74]=S):S=e[74],j="flex flex-col gap-2",v=u==="selected"&&(D.length>0?D.map(te=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-background",children:[t.jsx(Xe,{icon:te.icon,name:te.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:te.title}),te.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:te.description})]}),t.jsx(X,{variant:"ghost",size:"icon",onClick:()=>y(te.id),children:t.jsx(Ut,{size:16})})]},te.id)):t.jsxs("button",{type:"button",onClick:()=>x(!0),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.emptyStateMessage")})]})),e[6]=d,e[7]=n,e[8]=s,e[9]=u,e[10]=a,e[11]=h,e[12]=i,e[13]=b,e[14]=y,e[15]=j,e[16]=v,e[17]=N,e[18]=S}else b=e[13],y=e[14],j=e[15],v=e[16],N=e[17],S=e[18];let M;e[75]!==j||e[76]!==v?(M=t.jsx("div",{className:j,children:v}),e[75]=j,e[76]=v,e[77]=M):M=e[77];let w;e[78]!==b||e[79]!==y||e[80]!==r||e[81]!==h?(w=t.jsx(ua,{open:r,onOpenChange:x,candidates:b,selectedIds:h,onToggle:y}),e[78]=b,e[79]=y,e[80]=r,e[81]=h,e[82]=w):w=e[82];let k;return e[83]!==N||e[84]!==S||e[85]!==M||e[86]!==w?(k=t.jsxs("section",{className:N,children:[S,M,w]}),e[83]=N,e[84]=S,e[85]=M,e[86]=w,e[87]=k):k=e[87],k}function ua(l){const e=W.c(39),{open:s,onOpenChange:n,candidates:i,selectedIds:a,onToggle:d}=l,r=q(),[x,o]=U.useState("");let f,m,u,p,c,h,g,b,y;if(e[0]!==i||e[1]!==n||e[2]!==d||e[3]!==s||e[4]!==x||e[5]!==a||e[6]!==r){const S=x.toLowerCase(),M=i.filter(C=>C.title.toLowerCase().includes(S)||C.description?.toLowerCase().includes(S));m=qe,b=s,y=n,f=Qe,c="max-w-md";let w;e[16]!==r?(w=r("virtualMcp.subAgentsSection.title"),e[16]=r,e[17]=w):w=e[17],e[18]!==w?(h=t.jsx(at,{children:t.jsx(rt,{children:w})}),e[18]=w,e[19]=h):h=e[19];let k;e[20]!==r?(k=r("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=r,e[21]=k):k=e[21],e[22]!==x||e[23]!==k?(g=t.jsx(Ti,{value:x,onChange:o,placeholder:k,className:"w-full"}),e[22]=x,e[23]=k,e[24]=g):g=e[24],u="flex flex-col gap-1 max-h-80 overflow-y-auto",p=M.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:r("virtualMcp.subAgentsSection.noAgentsFound")}):M.map(C=>t.jsxs("button",{type:"button",onClick:()=>d(C.id),className:"flex items-center gap-3 px-2 py-2 rounded-lg hover:bg-accent/50 transition-colors cursor-pointer w-full text-left",children:[t.jsx(Ys,{checked:a.includes(C.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(Xe,{icon:C.icon,name:C.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:C.title}),C.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.description})]})]},C.id)),e[0]=i,e[1]=n,e[2]=d,e[3]=s,e[4]=x,e[5]=a,e[6]=r,e[7]=f,e[8]=m,e[9]=u,e[10]=p,e[11]=c,e[12]=h,e[13]=g,e[14]=b,e[15]=y}else f=e[7],m=e[8],u=e[9],p=e[10],c=e[11],h=e[12],g=e[13],b=e[14],y=e[15];let j;e[25]!==u||e[26]!==p?(j=t.jsx("div",{className:u,children:p}),e[25]=u,e[26]=p,e[27]=j):j=e[27];let v;e[28]!==f||e[29]!==c||e[30]!==h||e[31]!==g||e[32]!==j?(v=t.jsxs(f,{className:c,children:[h,g,j]}),e[28]=f,e[29]=c,e[30]=h,e[31]=g,e[32]=j,e[33]=v):v=e[33];let N;return e[34]!==m||e[35]!==b||e[36]!==y||e[37]!==v?(N=t.jsx(m,{open:b,onOpenChange:y,children:v}),e[34]=m,e[35]=b,e[36]=y,e[37]=v,e[38]=N):N=e[38],N}function et(){const l=W.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(lt,{className:"size-6 text-muted-foreground"})}),l[0]=e):e=l[0],e}function mt(l,e){return({error:s})=>s?.message?.includes("Method not found")||s?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ks,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:e("virtualMcp.dependencySelectionDialog.somethingWentWrong")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:s?.message?s.message.length>200?`${s.message.slice(0,200)}...`:s.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function on(l){const e=W.c(23),{item:s,isSelected:n,onToggle:i,disabled:a}=l,d=a?"cursor-not-allowed opacity-50":"cursor-pointer",r=n?"bg-accent/25":"hover:bg-muted/50";let x;e[0]!==d||e[1]!==r?(x=ue("flex items-start gap-3 p-4 rounded-lg transition-colors",d,r),e[0]=d,e[1]=r,e[2]=x):x=e[2];let o;e[3]!==s.name?(o=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=o):o=e[4];let f;e[5]!==s.tags?(f=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=f):f=e[6];let m;e[7]!==o||e[8]!==f?(m=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o,f]}),e[7]=o,e[8]=f,e[9]=m):m=e[9];let u;e[10]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=u):u=e[11];let p;e[12]!==m||e[13]!==u?(p=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[m,u]}),e[12]=m,e[13]=u,e[14]=p):p=e[14];let c;e[15]!==a||e[16]!==n||e[17]!==i?(c=t.jsx(Ys,{checked:n,onCheckedChange:i,disabled:a,className:"mt-0.5"}),e[15]=a,e[16]=n,e[17]=i,e[18]=c):c=e[18];let h;return e[19]!==x||e[20]!==p||e[21]!==c?(h=t.jsxs("label",{className:x,children:[p,c]}),e[19]=x,e[20]=p,e[21]=c,e[22]=h):h=e[22],h}function ma(l){const e=W.c(35),{activeTab:s,onTabChange:n,showSelectAll:i,isAllSelected:a,handleSelectAll:d}=l,r=q();let x;e[0]!==r?(x=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=x):x=e[1];let o;e[2]!==x?(o={id:"tools",label:x},e[2]=x,e[3]=o):o=e[3];let f;e[4]!==r?(f=r("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=r,e[5]=f):f=e[5];let m;e[6]!==f?(m={id:"active",label:f},e[6]=f,e[7]=m):m=e[7];let u;e[8]!==r?(u=r("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=r,e[9]=u):u=e[9];let p;e[10]!==u?(p={id:"resources",label:u},e[10]=u,e[11]=p):p=e[11];let c;e[12]!==r?(c=r("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=r,e[13]=c):c=e[13];let h;e[14]!==c?(h={id:"prompts",label:c},e[14]=c,e[15]=h):h=e[15];let g;e[16]!==o||e[17]!==m||e[18]!==p||e[19]!==h?(g=[o,m,p,h],e[16]=o,e[17]=m,e[18]=p,e[19]=h,e[20]=g):g=e[20];let b;e[21]!==n?(b=N=>n(N),e[21]=n,e[22]=b):b=e[22];let y;e[23]!==s||e[24]!==b||e[25]!==g?(y=t.jsx(Di,{tabs:g,activeTab:s,onTabChange:b}),e[23]=s,e[24]=b,e[25]=g,e[26]=y):y=e[26];let j;e[27]!==d||e[28]!==a||e[29]!==i||e[30]!==r?(j=i&&t.jsx("button",{type:"button",onClick:d,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(a?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=d,e[28]=a,e[29]=i,e[30]=r,e[31]=j):j=e[31];let v;return e[32]!==y||e[33]!==j?(v=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[y,j]}),e[32]=y,e[33]=j,e[34]=v):v=e[34],v}function Kt(l){const e=W.c(13),{items:s,selections:n,onToggle:i,emptyMessage:a,disabled:d}=l;let r,x,o;if(e[0]!==d||e[1]!==a||e[2]!==s||e[3]!==i||e[4]!==n){o=Symbol.for("react.early_return_sentinel");e:{const m=s.map(fa);if(s.length===0){let u;e[8]!==a?(u=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:a})}),e[8]=a,e[9]=u):u=e[9],o=u;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",x=s.map(u=>t.jsx(on,{item:u,isSelected:n===null||n?.includes(u.id),onToggle:()=>i(u.id,m),disabled:d},u.id))}e[0]=d,e[1]=a,e[2]=s,e[3]=i,e[4]=n,e[5]=r,e[6]=x,e[7]=o}else r=e[5],x=e[6],o=e[7];if(o!==Symbol.for("react.early_return_sentinel"))return o;let f;return e[10]!==r||e[11]!==x?(f=t.jsx("div",{className:r,children:x}),e[10]=r,e[11]=x,e[12]=f):f=e[12],f}function fa(l){return l.id}function pa(l){const e=W.c(22),{connectionId:s,toolSelections:n,onToggleTool:i}=l,a=q(),{org:d}=$e();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const x=jt(r);let o;e[4]!==x?(o={client:x},e[4]=x,e[5]=o):o=e[5];const{data:f}=Gs(o),m=f.tools;let u,p,c;if(e[6]!==f.tools||e[7]!==i||e[8]!==a||e[9]!==n){c=Symbol.for("react.early_return_sentinel");e:{const g=m.map(ha);let b;e[13]!==n?(b=v=>n===null||n.includes(v.name),e[13]=n,e[14]=b):b=e[14];const j=f.tools.filter(b).map(xa);if(j.length===0){let v;e[15]!==a?(v=a("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=a,e[16]=v):v=e[16];let N;e[17]!==v?(N=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:v})}),e[17]=v,e[18]=N):N=e[18],c=N;break e}u="flex-1 overflow-auto px-4 py-3 space-y-1",p=j.map(v=>t.jsx(on,{item:v,isSelected:!0,onToggle:()=>i(v.id,g)},v.id))}e[6]=f.tools,e[7]=i,e[8]=a,e[9]=n,e[10]=u,e[11]=p,e[12]=c}else u=e[10],p=e[11],c=e[12];if(c!==Symbol.for("react.early_return_sentinel"))return c;let h;return e[19]!==u||e[20]!==p?(h=t.jsx("div",{className:u,children:p}),e[19]=u,e[20]=p,e[21]=h):h=e[21],h}function xa(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(Ks,{annotations:l.annotations,_meta:l._meta})}}function ha(l){return l.name}function ga(l){const e=W.c(16),{connectionId:s,selections:n,onToggle:i,disabled:a}=l,{org:d}=$e();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const x=jt(r);let o;e[4]!==x?(o={client:x},e[4]=x,e[5]=o):o=e[5];const{data:f}=Gs(o);let m;e[6]!==f.tools?(m=f.tools.map(va),e[6]=f.tools,e[7]=m):m=e[7];const u=m,p=q();let c;e[8]!==p?(c=p("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=p,e[9]=c):c=e[9];let h;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==c?(h=t.jsx(Kt,{items:u,selections:n,onToggle:i,emptyMessage:c,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=c,e[15]=h):h=e[15],h}function va(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(Ks,{annotations:l.annotations,_meta:l._meta})}}function ba(l){const e=W.c(16),{connectionId:s,selections:n,onToggle:i,disabled:a}=l,{org:d}=$e();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const x=jt(r);let o;e[4]!==x?(o={client:x},e[4]=x,e[5]=o):o=e[5];const{data:f}=hn(o);let m;e[6]!==f.resources?(m=f.resources.map(ja),e[6]=f.resources,e[7]=m):m=e[7];const u=m,p=q();let c;e[8]!==p?(c=p("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=p,e[9]=c):c=e[9];let h;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==c?(h=t.jsx(Kt,{items:u,selections:n,onToggle:i,emptyMessage:c,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=c,e[15]=h):h=e[15],h}function ja(l){return{id:l.name||l.uri,name:l.name||l.uri,description:l.description}}function ya(l){const e=W.c(16),{connectionId:s,selections:n,onToggle:i,disabled:a}=l,{org:d}=$e();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const x=jt(r);let o;e[4]!==x?(o={client:x},e[4]=x,e[5]=o):o=e[5];const{data:f}=Vi(o);let m;e[6]!==f.prompts?(m=f.prompts.map(wa),e[6]=f.prompts,e[7]=m):m=e[7];const u=m,p=q();let c;e[8]!==p?(c=p("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=p,e[9]=c):c=e[9];let h;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==c?(h=t.jsx(Kt,{items:u,selections:n,onToggle:i,emptyMessage:c,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=c,e[15]=h):h=e[15],h}function wa(l){return{id:l.name,name:l.name,description:l.description}}function Sa(l){const e=W.c(58),{currentConnection:s,activeTab:n,selectedId:i,formData:a,toggleTool:d,toggleResource:r,togglePrompt:x,toggleAllTools:o,toggleAllResources:f,toggleAllPrompts:m,onTabChange:u}=l,p=q(),c=a[i],h=n==="tools"?c?.tools===null:n==="resources"?c?.resources===null:n==="prompts"?c?.prompts===null:!1,g=n!=="active";let b;e[0]!==n||e[1]!==i||e[2]!==m||e[3]!==f||e[4]!==o?(b=()=>{n==="tools"?o(i):n==="resources"?f(i):n==="prompts"&&m(i)},e[0]=n,e[1]=i,e[2]=m,e[3]=f,e[4]=o,e[5]=b):b=e[5];const y=b;let j;e[6]!==s.icon||e[7]!==s.title?(j=t.jsx(Xe,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[6]=s.icon,e[7]=s.title,e[8]=j):j=e[8];let v;e[9]!==s.title?(v=t.jsx("h2",{className:"text-base font-semibold truncate",children:s.title}),e[9]=s.title,e[10]=v):v=e[10];let N;e[11]!==s.description?(N=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[11]=s.description,e[12]=N):N=e[12];let S;e[13]!==v||e[14]!==N?(S=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,N]}),e[13]=v,e[14]=N,e[15]=S):S=e[15];let M;e[16]!==j||e[17]!==S?(M=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[j,S]})}),e[16]=j,e[17]=S,e[18]=M):M=e[18];let w;e[19]!==n||e[20]!==y||e[21]!==h||e[22]!==u||e[23]!==g?(w=t.jsx(ma,{activeTab:n,onTabChange:u,showSelectAll:g,isAllSelected:h,handleSelectAll:y}),e[19]=n,e[20]=y,e[21]=h,e[22]=u,e[23]=g,e[24]=w):w=e[24];let k;e[25]!==n||e[26]!==a||e[27]!==i||e[28]!==p||e[29]!==d?(k=n==="active"&&t.jsx(ze,{fallback:mt(p("virtualMcp.dependencySelectionDialog.toolsNotSupported"),p),children:t.jsx(U.Suspense,{fallback:t.jsx(et,{}),children:t.jsx(pa,{connectionId:i,toolSelections:a[i]?a[i].tools:[],onToggleTool:($,A)=>d(i,$,A)})})}),e[25]=n,e[26]=a,e[27]=i,e[28]=p,e[29]=d,e[30]=k):k=e[30];let C;e[31]!==n||e[32]!==a||e[33]!==i||e[34]!==p||e[35]!==d?(C=n==="tools"&&t.jsx(ze,{fallback:mt(p("virtualMcp.dependencySelectionDialog.toolsNotSupported"),p),children:t.jsx(U.Suspense,{fallback:t.jsx(et,{}),children:t.jsx(ga,{connectionId:i,selections:a[i]?a[i].tools:[],onToggle:($,A)=>d(i,$,A)})})}),e[31]=n,e[32]=a,e[33]=i,e[34]=p,e[35]=d,e[36]=C):C=e[36];let _;e[37]!==n||e[38]!==a||e[39]!==i||e[40]!==p||e[41]!==r?(_=n==="resources"&&t.jsx(ze,{fallback:mt(p("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),p),children:t.jsx(U.Suspense,{fallback:t.jsx(et,{}),children:t.jsx(ba,{connectionId:i,selections:a[i]?a[i].resources:[],onToggle:($,A)=>r(i,$,A)})})}),e[37]=n,e[38]=a,e[39]=i,e[40]=p,e[41]=r,e[42]=_):_=e[42];let D;e[43]!==n||e[44]!==a||e[45]!==i||e[46]!==p||e[47]!==x?(D=n==="prompts"&&t.jsx(ze,{fallback:mt(p("virtualMcp.dependencySelectionDialog.promptsNotSupported"),p),children:t.jsx(U.Suspense,{fallback:t.jsx(et,{}),children:t.jsx(ya,{connectionId:i,selections:a[i]?a[i].prompts:[],onToggle:($,A)=>x(i,$,A)})})}),e[43]=n,e[44]=a,e[45]=i,e[46]=p,e[47]=x,e[48]=D):D=e[48];let P;e[49]!==_||e[50]!==D||e[51]!==k||e[52]!==C?(P=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[k,C,_,D]}),e[49]=_,e[50]=D,e[51]=k,e[52]=C,e[53]=P):P=e[53];let I;return e[54]!==P||e[55]!==M||e[56]!==w?(I=t.jsxs(t.Fragment,{children:[M,w,P]}),e[54]=P,e[55]=M,e[56]=w,e[57]=I):I=e[57],I}function Na(l){const e=W.c(7),{onClose:s}=l,n=q();let i;e[0]!==s?(i=()=>s(!1),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n?(a=n("virtualMcp.dependencySelectionDialog.done"),e[2]=n,e[3]=a):a=e[3];let d;return e[4]!==i||e[5]!==a?(d=t.jsx($t,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(X,{variant:"outline",onClick:i,children:a})}),e[4]=i,e[5]=a,e[6]=d):d=e[6],d}function Ca(l){const e=W.c(23),{connectionId:s,onAuthenticate:n,children:i}=l,a=q();let d;e[0]!==s?(d={connectionId:s},e[0]=s,e[1]=d):d=e[1];const r=Ws(d);if(r.supportsOAuth&&!r.isAuthenticated){let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(ci,{size:22,className:"text-muted-foreground"})}),e[2]=f):f=e[2];let m;e[3]!==a?(m=a("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=a,e[4]=m):m=e[4];let u;e[5]!==m?(u=t.jsx("p",{className:"text-sm font-medium",children:m}),e[5]=m,e[6]=u):u=e[6];let p;e[7]!==a?(p=a("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=a,e[8]=p):p=e[8];let c;e[9]!==p?(c=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:p}),e[9]=p,e[10]=c):c=e[10];let h;e[11]!==u||e[12]!==c?(h=t.jsxs("div",{className:"space-y-1",children:[u,c]}),e[11]=u,e[12]=c,e[13]=h):h=e[13];let g;e[14]!==s||e[15]!==n||e[16]!==a?(g=n&&t.jsx(X,{variant:"outline",size:"sm",onClick:()=>n(s),children:a("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=s,e[15]=n,e[16]=a,e[17]=g):g=e[17];let b;return e[18]!==h||e[19]!==g?(b=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[f,h,g]}),e[18]=h,e[19]=g,e[20]=b):b=e[20],b}let o;return e[21]!==i?(o=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=o):o=e[22],o}function ka(l){const e={};for(const s of l)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function vs(l){return Object.entries(l).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function bs(l,e,s,n){const i=l[e]??{tools:null,resources:null,prompts:null};return{...l,[e]:{...i,[s]:n}}}function Ma(l,e){return e.type==="SET_ACTIVE_TAB"?{...l,activeTab:e.payload}:l}function _a(l){const e=W.c(49),{open:s,onOpenChange:n,selectedId:i,form:a,connections:d,onAuthenticate:r}=l;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={activeTab:"tools"},e[0]=x):x=e[0];const[o,f]=U.useReducer(Ma,x),m=Pt(i??"");let u;e[1]!==d?(u=d??[],e[1]=d,e[2]=u):u=e[2];let p;e[3]!==u?(p=ka(u),e[3]=u,e[4]=p):p=e[4];const c=p;let h;e[5]!==a||e[6]!==c?(h=(L,T,O,G)=>{const z=c[L]?.[T];let F;z===null?F=G.filter(B=>B!==O):z?.includes(O)?F=z.filter(B=>B!==O):(F=[...z??[],O],F.length===G.length&&(F=null)),a.setValue("connections",vs(bs(c,L,T,F)),{shouldDirty:!0,shouldTouch:!0})},e[5]=a,e[6]=c,e[7]=h):h=e[7];const g=h;let b;e[8]!==a||e[9]!==c?(b=(L,T)=>{const G=c[L]?.[T]===null?[]:null;a.setValue("connections",vs(bs(c,L,T,G)),{shouldDirty:!0,shouldTouch:!0})},e[8]=a,e[9]=c,e[10]=b):b=e[10];const y=b;let j;e[11]!==g?(j=(L,T,O)=>g(L,"tools",T,O),e[11]=g,e[12]=j):j=e[12];const v=j;let N;e[13]!==g?(N=(L,T,O)=>g(L,"resources",T,O),e[13]=g,e[14]=N):N=e[14];const S=N;let M;e[15]!==g?(M=(L,T,O)=>g(L,"prompts",T,O),e[15]=g,e[16]=M):M=e[16];const w=M;let k;e[17]!==y?(k=L=>y(L,"tools"),e[17]=y,e[18]=k):k=e[18];const C=k;let _;e[19]!==y?(_=L=>y(L,"resources"),e[19]=y,e[20]=_):_=e[20];const D=_;let P;e[21]!==y?(P=L=>y(L,"prompts"),e[21]=y,e[22]=P):P=e[22];const I=P;if(!i||!m)return null;let $;e[23]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(et,{}),e[23]=$):$=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=L=>f({type:"SET_ACTIVE_TAB",payload:L}),e[24]=A):A=e[24];let Y;e[25]!==m||e[26]!==o.activeTab||e[27]!==c||e[28]!==i||e[29]!==I||e[30]!==D||e[31]!==C||e[32]!==w||e[33]!==S||e[34]!==v?(Y=t.jsx(Sa,{currentConnection:m,activeTab:o.activeTab,selectedId:i,formData:c,toggleTool:v,toggleResource:S,togglePrompt:w,toggleAllTools:C,toggleAllResources:D,toggleAllPrompts:I,onTabChange:A},i),e[25]=m,e[26]=o.activeTab,e[27]=c,e[28]=i,e[29]=I,e[30]=D,e[31]=C,e[32]=w,e[33]=S,e[34]=v,e[35]=Y):Y=e[35];let K;e[36]!==r||e[37]!==i||e[38]!==Y?(K=t.jsx(U.Suspense,{fallback:$,children:t.jsx(Ca,{connectionId:i,onAuthenticate:r,children:Y})}),e[36]=r,e[37]=i,e[38]=Y,e[39]=K):K=e[39];let Q;e[40]!==n?(Q=t.jsx(Na,{onClose:n}),e[40]=n,e[41]=Q):Q=e[41];let R;e[42]!==K||e[43]!==Q?(R=t.jsxs(Qe,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[K,Q]}),e[42]=K,e[43]=Q,e[44]=R):R=e[44];let H;return e[45]!==n||e[46]!==s||e[47]!==R?(H=t.jsx(qe,{open:s,onOpenChange:n,children:R}),e[45]=n,e[46]=s,e[47]=R,e[48]=H):H=e[48],H}const js="__new_instance__";function Ta(l){const e=W.c(25),{connection_id:s,usedConnectionIds:n,onOpenSettings:i,onRemove:a,onAuthenticate:d,onSwitchInstance:r,onNewInstance:x}=l,o=Pt(s),{org:f}=$e();if(!o){let g;return e[0]!==a?(g=t.jsx(Aa,{onRemove:a}),e[0]=a,e[1]=g):g=e[1],g}let m;e[2]!==o?(m=Ii(o),e[2]=o,e[3]=m):m=e[3];const u=m;let p;e[4]!==s?(p=t.jsx(Ia,{connection_id:s}),e[4]=s,e[5]=p):p=e[5];let c;e[6]!==o.app_name||e[7]!==o.connection_type||e[8]!==o.description||e[9]!==o.icon||e[10]!==o.status||e[11]!==o.title||e[12]!==s||e[13]!==d||e[14]!==x||e[15]!==i||e[16]!==a||e[17]!==r||e[18]!==f.slug||e[19]!==u||e[20]!==n?(c=t.jsx(Va,{connection_id:s,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,connectionType:o.connection_type,connectionStatus:o.status,slug:u,orgSlug:f.slug,appName:o.app_name,usedConnectionIds:n,onOpenSettings:i,onRemove:a,onAuthenticate:d,onSwitchInstance:r,onNewInstance:x}),e[6]=o.app_name,e[7]=o.connection_type,e[8]=o.description,e[9]=o.icon,e[10]=o.status,e[11]=o.title,e[12]=s,e[13]=d,e[14]=x,e[15]=i,e[16]=a,e[17]=r,e[18]=f.slug,e[19]=u,e[20]=n,e[21]=c):c=e[21];let h;return e[22]!==p||e[23]!==c?(h=t.jsx(U.Suspense,{fallback:p,children:c}),e[22]=p,e[23]=c,e[24]=h):h=e[24],h}function Da(l){const e=W.c(24),{appName:s,connectionId:n,usedConnectionIds:i,onSwitchInstance:a,onNewInstance:d}=l,r=q();let x;e[0]!==s?(x={filters:[{column:"app_name",value:s}]},e[0]=s,e[1]=x):x=e[1];const o=Wn(x);if(o.length<=1&&!d)return null;let f;e[2]!==n||e[3]!==d||e[4]!==a?(f=g=>{g===js?d?.():a(n,g)},e[2]=n,e[3]=d,e[4]=a,e[5]=f):f=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Me,{size:"sm",className:"w-auto text-xs gap-1 px-2 shadow-none",children:t.jsx(_e,{})}),e[6]=m):m=e[6];let u;if(e[7]!==n||e[8]!==o||e[9]!==i){let g;e[11]!==n||e[12]!==i?(g=b=>t.jsx(pe,{value:b.id,className:"text-xs",disabled:b.id!==n&&i.has(b.id),children:b.title},b.id),e[11]=n,e[12]=i,e[13]=g):g=e[13],u=o.map(g),e[7]=n,e[8]=o,e[9]=i,e[10]=u}else u=e[10];let p;e[14]!==d||e[15]!==r?(p=d&&t.jsxs(pe,{value:js,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=d,e[15]=r,e[16]=p):p=e[16];let c;e[17]!==u||e[18]!==p?(c=t.jsxs(Te,{children:[u,p]}),e[17]=u,e[18]=p,e[19]=c):c=e[19];let h;return e[20]!==n||e[21]!==f||e[22]!==c?(h=t.jsxs(De,{value:n,onValueChange:f,children:[m,c]}),e[20]=n,e[21]=f,e[22]=c,e[23]=h):h=e[23],h}function Va({connection_id:l,connectionTitle:e,connectionDescription:s,connectionIcon:n,connectionType:i,connectionStatus:a,slug:d,orgSlug:r,appName:x,usedConnectionIds:o,onOpenSettings:f,onRemove:m,onAuthenticate:u,onSwitchInstance:p,onNewInstance:c}){const h=Ws({connectionId:l}),g=Vs(),y=!(i==="VIRTUAL")&&h.supportsOAuth&&!h.isAuthenticated,j=a!=="active",v=q(),N=async S=>{try{await g.update.mutateAsync({id:l,data:{status:S}}),ie.success(v(S==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{ie.error(v("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:ue("rounded-xl border overflow-hidden transition-colors",y||j?"border-destructive/50 bg-destructive/5":"border-border bg-card"),children:[t.jsxs(gn,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:d},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors",children:[t.jsx(Xe,{icon:n,name:e,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:e}),y?t.jsx("span",{className:"text-xs text-destructive font-medium",children:v("virtualMcp.connectionItem.needsAuthorization")}):j?t.jsx("span",{className:"text-xs text-destructive font-medium",children:v(a==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):s&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s})]}),y?t.jsx(X,{variant:"outline",size:"sm",className:"h-7 text-xs shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),u(l)},children:v("virtualMcp.connectionItem.authorize")}):j?t.jsxs(X,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),N("active")},children:[t.jsx(di,{size:13}),v("virtualMcp.connectionItem.enable")]}):t.jsxs(je,{delayDuration:0,children:[t.jsx(ye,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center rounded-md h-7 w-7 hover:bg-accent text-muted-foreground shrink-0 transition-colors",children:t.jsx(Ai,{size:16})})}),t.jsx(we,{side:"bottom",children:v("virtualMcp.connectionItem.connectionSettings")})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-t border-border bg-muted/25",children:[x&&t.jsx(Da,{appName:x,connectionId:l,usedConnectionIds:o,onSwitchInstance:p,onNewInstance:c}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(je,{delayDuration:0,children:[t.jsx(ye,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:f,"aria-label":v("virtualMcp.connectionItem.configureResources"),children:t.jsx(ui,{size:13})})}),t.jsx(we,{side:"bottom",children:v("virtualMcp.connectionItem.configureResources")})]}),!j&&t.jsxs(je,{delayDuration:0,children:[t.jsx(ye,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>N("inactive"),"aria-label":v("virtualMcp.connectionItem.disableConnection"),children:t.jsx(mi,{size:13})})}),t.jsx(we,{side:"bottom",children:v("virtualMcp.connectionItem.disable")})]}),t.jsxs(je,{delayDuration:0,children:[t.jsx(ye,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:m,"aria-label":v("virtualMcp.connectionItem.removeConnection"),children:t.jsx(Ut,{size:13})})}),t.jsx(we,{side:"bottom",children:v("virtualMcp.connectionItem.remove")})]})]})]})]})}function Ia(l){const e=W.c(17),{connection_id:s}=l,n=Pt(s);if(!n){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(cn,{}),e[0]=m):m=e[0],m}let i;e[1]!==n.icon||e[2]!==n.title?(i=t.jsx(Xe,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[1]=n.icon,e[2]=n.title,e[3]=i):i=e[3];let a;e[4]!==n.title?(a=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let d;e[6]!==n.description?(d=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[6]=n.description,e[7]=d):d=e[7];let r;e[8]!==a||e[9]!==d?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,d]}),e[8]=a,e[9]=d,e[10]=r):r=e[10];let x;e[11]!==i||e[12]!==r?(x=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,r]}),e[11]=i,e[12]=r,e[13]=x):x=e[13];let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})}),e[14]=o):o=e[14];let f;return e[15]!==x?(f=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[x,o]}),e[15]=x,e[16]=f):f=e[16],f}function Aa(l){const e=W.c(20),{onRemove:s}=l,n=q();let i;e[0]!==n?(i=n("virtualMcp.connectionItem.connectionNotFound"),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==i?(a=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm text-destructive font-medium truncate",children:i})}),e[2]=i,e[3]=a):a=e[3];let d;e[4]!==n?(d=n("virtualMcp.connectionItem.removeConnection"),e[4]=n,e[5]=d):d=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ut,{size:13}),e[6]=r):r=e[6];let x;e[7]!==s||e[8]!==d?(x=t.jsx(ye,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive shrink-0",onClick:s,"aria-label":d,children:r})}),e[7]=s,e[8]=d,e[9]=x):x=e[9];let o;e[10]!==n?(o=n("virtualMcp.connectionItem.remove"),e[10]=n,e[11]=o):o=e[11];let f;e[12]!==o?(f=t.jsx(we,{side:"bottom",children:o}),e[12]=o,e[13]=f):f=e[13];let m;e[14]!==x||e[15]!==f?(m=t.jsxs(je,{delayDuration:0,children:[x,f]}),e[14]=x,e[15]=f,e[16]=m):m=e[16];let u;return e[17]!==a||e[18]!==m?(u=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[a,m]}),e[17]=a,e[18]=m,e[19]=u):u=e[19],u}function cn(){const l=W.c(3);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),l[0]=e):e=l[0];let s;l[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e,t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-48 rounded bg-muted animate-pulse"})]})]}),l[1]=s):s=l[1];let n;return l[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[s,t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})})]}),l[2]=n):n=l[2],n}function Oa(l){const e=W.c(5),{value:s}=l;let n;if(e[0]!==s){n=Symbol.for("react.early_return_sentinel");e:{const a=Ft(s);if(a.type==="icon"){const d=zt(a.name);if(d){let r;e[2]!==d?(r=t.jsx(d,{size:16,className:"text-muted-foreground"}),e[2]=d,e[3]=r):r=e[3],n=r;break e}}}e[0]=s,e[1]=n}else n=e[1];if(n!==Symbol.for("react.early_return_sentinel"))return n;let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Oi,{size:16,className:"text-muted-foreground"}),e[4]=i):i=e[4],i}function Pa(l){const e=W.c(74),{value:s,onChange:n,className:i,disabled:a}=l,d=q(),[r,x]=U.useState(!1),[o,f]=U.useState("");let m;e[0]!==s?(m=Ft(s),e[0]=s,e[1]=m):m=e[1];const u=m,p=u.type==="icon"?u.name:null;let c,h,g,b,y,j,v,N,S,M,w,k,C,_,D;if(e[2]!==i||e[3]!==p||e[4]!==a||e[5]!==n||e[6]!==r||e[7]!==o||e[8]!==d||e[9]!==s){const Q=Et();b=Fs(Q,o),g=Bt,y=a?!1:r,j=x;let R;e[25]!==d?(R=d("common.simpleIconPicker.changeIcon"),e[25]=d,e[26]=R):R=e[26];const H=a?"cursor-default opacity-50":"cursor-pointer hover:bg-accent";let L;e[27]!==i||e[28]!==H?(L=ue("size-7 shrink-0 rounded-md transition-colors flex items-center justify-center",H,i),e[27]=i,e[28]=H,e[29]=L):L=e[29];let T;e[30]!==s?(T=t.jsx(Oa,{value:s}),e[30]=s,e[31]=T):T=e[31],e[32]!==a||e[33]!==R||e[34]!==L||e[35]!==T?(v=t.jsx(Rt,{asChild:!0,children:t.jsx("button",{type:"button",disabled:a,"aria-label":R,className:L,children:T})}),e[32]=a,e[33]=R,e[34]=L,e[35]=T,e[36]=v):v=e[36],h=Lt,C="start",_="w-64 p-0",D=$a,w="flex flex-col";let O;e[37]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(xt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[37]=O):O=e[37];let G;e[38]===Symbol.for("react.memo_cache_sentinel")?(G=B=>f(B.target.value),e[38]=G):G=e[38];let z;e[39]!==d?(z=d("common.simpleIconPicker.filterPlaceholder"),e[39]=d,e[40]=z):z=e[40],e[41]!==o||e[42]!==z?(k=t.jsx("div",{className:"px-2 py-2",children:t.jsxs("div",{className:"relative",children:[O,t.jsx(Se,{value:o,onChange:G,placeholder:z,className:"h-7 text-xs pl-7"})]})}),e[41]=o,e[42]=z,e[43]=k):k=e[43],c=Rs,M="h-48",N="grid grid-cols-8 gap-0.5 px-2 pb-2";let F;e[44]!==p||e[45]!==n?(F=B=>{const J=zt(B);return J?t.jsx("button",{type:"button",onClick:()=>{n(`icon://${B}`),x(!1)},className:ue("h-7 w-7 flex items-center justify-center rounded-md transition-colors cursor-pointer",p===B?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground"),title:Dt(B),"aria-label":Dt(B),children:t.jsx(J,{size:16})},B):null},e[44]=p,e[45]=n,e[46]=F):F=e[46],S=b.map(F),e[2]=i,e[3]=p,e[4]=a,e[5]=n,e[6]=r,e[7]=o,e[8]=d,e[9]=s,e[10]=c,e[11]=h,e[12]=g,e[13]=b,e[14]=y,e[15]=j,e[16]=v,e[17]=N,e[18]=S,e[19]=M,e[20]=w,e[21]=k,e[22]=C,e[23]=_,e[24]=D}else c=e[10],h=e[11],g=e[12],b=e[13],y=e[14],j=e[15],v=e[16],N=e[17],S=e[18],M=e[19],w=e[20],k=e[21],C=e[22],_=e[23],D=e[24];let P;e[47]!==N||e[48]!==S?(P=t.jsx("div",{className:N,children:S}),e[47]=N,e[48]=S,e[49]=P):P=e[49];let I;e[50]!==b.length||e[51]!==d?(I=b.length===0&&t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:d("common.simpleIconPicker.noIconsFound")}),e[50]=b.length,e[51]=d,e[52]=I):I=e[52];let $;e[53]!==c||e[54]!==P||e[55]!==I||e[56]!==M?($=t.jsxs(c,{className:M,children:[P,I]}),e[53]=c,e[54]=P,e[55]=I,e[56]=M,e[57]=$):$=e[57];let A;e[58]!==$||e[59]!==w||e[60]!==k?(A=t.jsxs("div",{className:w,children:[k,$]}),e[58]=$,e[59]=w,e[60]=k,e[61]=A):A=e[61];let Y;e[62]!==h||e[63]!==A||e[64]!==C||e[65]!==_||e[66]!==D?(Y=t.jsx(h,{align:C,className:_,onOpenAutoFocus:D,children:A}),e[62]=h,e[63]=A,e[64]=C,e[65]=_,e[66]=D,e[67]=Y):Y=e[67];let K;return e[68]!==g||e[69]!==y||e[70]!==j||e[71]!==v||e[72]!==Y?(K=t.jsxs(g,{open:y,onOpenChange:j,children:[v,Y]}),e[68]=g,e[69]=y,e[70]=j,e[71]=v,e[72]=Y,e[73]=K):K=e[73],K}function $a(l){return l.preventDefault()}function Fa(l){const e=W.c(10),{viewId:s}=l;if(s==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Es,{size:16}),e[0]=i):i=e[0],i}if(s==="reports"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ts,{size:16}),e[1]=i):i=e[1],i}if(s==="board"){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(fi,{size:16}),e[2]=i):i=e[2],i}if(s==="site-editor"){let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ei,{size:16}),e[3]=i):i=e[3],i}if(s==="assets"){let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Fi,{size:16}),e[4]=i):i=e[4],i}if(s==="hosting"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(pi,{size:16}),e[5]=i):i=e[5],i}if(s==="e2e"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Pi,{size:16}),e[6]=i):i=e[6],i}if(s==="analytics"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ts,{size:16}),e[7]=i):i=e[7],i}if(s==="cdn"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(xi,{size:16}),e[8]=i):i=e[8],i}let n;return e[9]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(zs,{size:16}),e[9]=n):n=e[9],n}function ys(l){const e=W.c(51),{pinned:s,canSetMainView:n,onOpen:i,onTogglePin:a,onSetMainView:d}=l,r=q(),x=s?"text-foreground":"text-muted-foreground/40";let o;e[0]!==x?(o=ue("size-7",x),e[0]=x,e[1]=o):o=e[1];let f;e[2]!==s||e[3]!==r?(f=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=s,e[3]=r,e[4]=f):f=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(ss,{size:16}),e[5]=m):m=e[5];let u;e[6]!==a||e[7]!==s||e[8]!==o||e[9]!==f?(u=t.jsx(ye,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"icon",className:o,"aria-label":f,"aria-pressed":s,onClick:a,children:m})}),e[6]=a,e[7]=s,e[8]=o,e[9]=f,e[10]=u):u=e[10];let p;e[11]!==s||e[12]!==r?(p=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=s,e[12]=r,e[13]=p):p=e[13];let c;e[14]!==p?(c=t.jsx(we,{side:"top",children:p}),e[14]=p,e[15]=c):c=e[15];let h;e[16]!==u||e[17]!==c?(h=t.jsxs(je,{delayDuration:0,children:[u,c]}),e[16]=u,e[17]=c,e[18]=h):h=e[18];let g;e[19]!==r?(g=r("virtualMcp.settings.views.rowActions"),e[19]=r,e[20]=g):g=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx($i,{size:16}),e[21]=b):b=e[21];let y;e[22]!==g?(y=t.jsx(Bs,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground","aria-label":g,children:b})}),e[22]=g,e[23]=y):y=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(vn,{size:14}),e[24]=j):j=e[24];let v;e[25]!==r?(v=r("virtualMcp.settings.views.open"),e[25]=r,e[26]=v):v=e[26];let N;e[27]!==i||e[28]!==v?(N=t.jsxs(Ge,{onClick:i,children:[j,v]}),e[27]=i,e[28]=v,e[29]=N):N=e[29];let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(ss,{size:14}),e[30]=S):S=e[30];let M;e[31]!==s||e[32]!==r?(M=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=s,e[32]=r,e[33]=M):M=e[33];let w;e[34]!==a||e[35]!==M?(w=t.jsxs(Ge,{onClick:a,children:[S,M]}),e[34]=a,e[35]=M,e[36]=w):w=e[36];let k;e[37]!==n||e[38]!==d||e[39]!==r?(k=n&&t.jsxs(Ge,{onClick:d,children:[t.jsx(Es,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=n,e[38]=d,e[39]=r,e[40]=k):k=e[40];let C;e[41]!==N||e[42]!==w||e[43]!==k?(C=t.jsxs(Us,{align:"end",children:[N,w,k]}),e[41]=N,e[42]=w,e[43]=k,e[44]=C):C=e[44];let _;e[45]!==y||e[46]!==C?(_=t.jsxs(Ls,{children:[y,C]}),e[45]=y,e[46]=C,e[47]=_):_=e[47];let D;return e[48]!==_||e[49]!==h?(D=t.jsxs("div",{className:"flex items-center gap-1",children:[h,_]}),e[48]=_,e[49]=h,e[50]=D):D=e[50],D}const ws=l=>l.stopPropagation();function Ea(l){const e=W.c(8),{icon:s,title:n}=l;let i;e[0]!==s||e[1]!==n?(i=t.jsx(Xe,{icon:s,name:n,size:"xs",className:"shrink-0"}),e[0]=s,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==n?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[3]=n,e[4]=a):a=e[4];let d;return e[5]!==i||e[6]!==a?(d=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,a]}),e[5]=i,e[6]=a,e[7]=d):d=e[7],d}function za(l){const e=W.c(53),{views:s}=l,n=q();let i;e[0]!==n?(i=n("virtualMcp.settings.views.projectViews"),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==s?(a=s.projectViews.map(C=>{const _=s.pinned(C);return t.jsx(Ze,{icon:t.jsx(Fa,{viewId:C}),title:s.labels[C],onClick:()=>s.openView(C),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ys,{pinned:_,canSetMainView:_&&!s.isMainView(C),onOpen:()=>s.openView(C),onTogglePin:()=>s.togglePin(C,!_),onSetMainView:()=>s.setMainView(C)}),t.jsx("span",{onClick:()=>s.openView(C),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Vt,{size:16})})]})},C)}),e[2]=s,e[3]=a):a=e[3];let d;e[4]!==s?(d=s.connectionsData.flatMap(C=>[t.jsx(Ea,{icon:C.icon,title:C.title},`${C.id}:header`),...C.uiTools.map(_=>{const D=s.pinnedAppViews.find(A=>A.connectionId===C.id&&A.toolName===_.name),P=!!D,I=bn(C.id,_.name),$=`ext-apps:${C.id}:${_.name}`;return t.jsx(Ze,{onClick:()=>s.openView(I),icon:P?t.jsx("span",{onClick:ws,children:t.jsx(Pa,{value:D.icon??null,onChange:A=>s.setAppViewIcon(C.id,_.name,A)})}):t.jsx(zs,{size:16}),title:P?t.jsx("span",{onClick:ws,children:t.jsx(Se,{value:D.label,onChange:A=>s.setAppViewLabel(C.id,_.name,A.target.value),onBlur:s.commitAppViewLabel,className:"h-7 w-52 text-sm"})}):_.title??Hs(_.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ys,{pinned:P,canSetMainView:P&&!s.isMainView($),onOpen:()=>s.openView(I),onTogglePin:()=>s.toggleAppViewPin(C.id,_.name),onSetMainView:()=>s.setMainView($)}),t.jsx("span",{onClick:()=>s.openView(I),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Vt,{size:16})})]})},`${C.id}:${_.name}`)})]),e[4]=s,e[5]=d):d=e[5];let r;e[6]!==n?(r=n("virtualMcp.layoutTabContent.mainView"),e[6]=n,e[7]=r):r=e[7];let x;e[8]!==n?(x=n("virtualMcp.layoutTabContent.mainViewDescription"),e[8]=n,e[9]=x):x=e[9];const o=s.defaultMainView,f=s.setMainView;let m;e[10]!==n?(m=n("virtualMcp.layoutTabContent.noMainView"),e[10]=n,e[11]=m):m=e[11];let u;e[12]!==m?(u=t.jsx(Me,{className:"w-44 h-8 text-sm shrink-0",children:t.jsx(_e,{placeholder:m})}),e[12]=m,e[13]=u):u=e[13];let p;e[14]!==s.defaultMainOptions?(p=s.defaultMainOptions.map(Ra),e[14]=s.defaultMainOptions,e[15]=p):p=e[15];let c;e[16]!==p?(c=t.jsx(Te,{children:p}),e[16]=p,e[17]=c):c=e[17];let h;e[18]!==c||e[19]!==u||e[20]!==s.defaultMainView||e[21]!==s.setMainView?(h=t.jsxs(De,{value:o,onValueChange:f,children:[u,c]}),e[18]=c,e[19]=u,e[20]=s.defaultMainView,e[21]=s.setMainView,e[22]=h):h=e[22];let g;e[23]!==h||e[24]!==r||e[25]!==x?(g=t.jsx(Ze,{title:r,description:x,action:h}),e[23]=h,e[24]=r,e[25]=x,e[26]=g):g=e[26];let b;e[27]!==n?(b=n("virtualMcp.layoutTabContent.showChat"),e[27]=n,e[28]=b):b=e[28];let y;e[29]!==n?(y=n("virtualMcp.layoutTabContent.showChatDescription"),e[29]=n,e[30]=y):y=e[30];const j=s.noMainView?!0:s.chatDefaultOpen;let v;e[31]!==j||e[32]!==s.noMainView||e[33]!==s.setChatDefaultOpen?(v=t.jsx(ye,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(yt,{checked:j,disabled:s.noMainView,onCheckedChange:s.setChatDefaultOpen})})}),e[31]=j,e[32]=s.noMainView,e[33]=s.setChatDefaultOpen,e[34]=v):v=e[34];let N;e[35]!==n||e[36]!==s.noMainView?(N=s.noMainView&&t.jsx(we,{side:"top",children:n("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[35]=n,e[36]=s.noMainView,e[37]=N):N=e[37];let S;e[38]!==v||e[39]!==N?(S=t.jsxs(je,{delayDuration:0,children:[v,N]}),e[38]=v,e[39]=N,e[40]=S):S=e[40];let M;e[41]!==b||e[42]!==y||e[43]!==S?(M=t.jsx(Ze,{title:b,description:y,action:S}),e[41]=b,e[42]=y,e[43]=S,e[44]=M):M=e[44];let w;e[45]!==g||e[46]!==a||e[47]!==M||e[48]!==d?(w=t.jsxs(tt,{children:[a,d,g,M]}),e[45]=g,e[46]=a,e[47]=M,e[48]=d,e[49]=w):w=e[49];let k;return e[50]!==i||e[51]!==w?(k=t.jsx(st,{title:i,children:w}),e[50]=i,e[51]=w,e[52]=k):k=e[52],k}function Ra(l){return t.jsx(pe,{value:l.value,children:l.label},l.value)}const dn="site-editor",La=new Set([dn,"content"]);function Ba({virtualMcpId:l,form:e,flushAndSave:s}){const n=q(),i=vt(),{openPanel:a}=Bi(),d=As(l),r=Ui(d),x=qs(l),o=Qi(l),f=(d?.connections??[]).map(T=>T.connection_id).sort(),{data:m}=jn({queryKey:Ms.projectConnectionDetails(l,f),enabled:f.length>0,queryFn:async()=>await Promise.all(f.map(async O=>{try{const{item:G}=await i.call("COLLECTION_CONNECTIONS_GET",{id:O}),z=(G?.tools??[]).flatMap(F=>{const B=zi(F._meta);return B?[{name:F.name,title:F.title,description:F.description,resourceUri:B}]:[]});return{fetchOk:!0,id:O,title:G?.title??O,icon:G?.icon??null,uiTools:z}}catch{return{fetchOk:!1,id:O,title:O,icon:null,uiTools:[]}}}))}),u=(m??[]).filter(T=>T.uiTools.length>0),p=new Set([...yn,...wn]),c=e.watch("metadata.ui.pinnedViews")??[],h=e.watch("metadata.ui.layout")??null,g=h?.defaultMainView??null,b=h?.chatDefaultOpen??!1,y=It(At({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:h}}),e.watch("metadata.sidebarViewsVersion")),j=o??(d?It(At(d.metadata),d.metadata.sidebarViewsVersion):y),v=(()=>{if(!g||g.type==="chat")return"";const T=Sn(g.type);return T==="instructions"||T==="connections"||T==="layout"?"settings":La.has(T)?dn:p.has(T)?T:`${T}:${g.id??""}:${g.toolName??""}`})(),N=v==="",S=T=>{const[O,G,z]=T.split(":");return O?p.has(O)?{type:O}:O==="ext-apps"&&G?{type:"ext-apps",id:G,toolName:z||void 0}:null:null},M=T=>{e.setValue("metadata.ui.pinnedViews",T,{shouldDirty:!0})},w=T=>{e.setValue("metadata.ui.layout",{...h,...T},{shouldDirty:!0})},k=U.useRef(!1);if(m&&m.length>0&&!k.current){k.current=!0;const T=new Set((m??[]).filter(F=>F.fetchOk).map(F=>F.id)),O=new Set(u.flatMap(F=>F.uiTools.map(B=>`${F.id}:${B.name}`))),G=new Set(f),z=c.filter(F=>G.has(F.connectionId)&&(!T.has(F.connectionId)||O.has(`${F.connectionId}:${F.toolName}`)));z.length!==c.length&&(M(z),g?.type==="ext-apps"&&!z.some(F=>F.connectionId===g.id&&F.toolName===g.toolName)&&w({defaultMainView:{type:"settings"}}))}const C=(T,O)=>{if(c.some(z=>z.connectionId===T&&z.toolName===O)){const z=c.filter(B=>!(B.connectionId===T&&B.toolName===O));M(z);const F=`ext-apps:${T}:${O}`;v===F&&w({defaultMainView:{type:"settings"}})}else{const z=u.find(F=>F.id===T)?.uiTools.find(F=>F.name===O)?.title;M([...c,{connectionId:T,toolName:O,label:z??Hs(O),icon:null}])}s()},_=(T,O,G)=>{M(c.map(z=>z.connectionId===T&&z.toolName===O?{...z,label:G}:z))},D=()=>{s()},P=(T,O,G)=>{M(c.map(z=>z.connectionId===T&&z.toolName===O?{...z,icon:G}:z)),s()},I=T=>{w({defaultMainView:S(T)}),s()},$=(T,O)=>{const G=Gi(j,T,O,1);e.setValue("metadata.sidebarViews",G,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),x.stage(G,j);const z=Hi(g,T,O);z!==g&&w({defaultMainView:z})},A=ht(d?.metadata),Y=Yi(A,r.presence),K=Ki(Y),Q=Wi(j,Y,1),R={overview:n("sidebar.navDestinations.home"),reports:n("sidebar.navDestinations.reports"),board:n("sidebar.navDestinations.tasks"),"site-editor":n("virtualMcp.layoutTabContent.siteEditor"),assets:n("common.mainPanelTabs.assets"),hosting:n("common.mainPanelTabs.hosting"),e2e:n("common.mainPanelTabs.e2e"),analytics:n("common.mainPanelTabs.analytics"),cdn:n("common.mainPanelTabs.cdn"),automations:n("virtualMcp.layoutTabContent.automations"),experiments:n("experiments.title")},H=[];for(const T of Q)T!=="automations"&&H.push({value:T,label:R[T]});for(const T of c)H.push({value:`ext-apps:${T.connectionId}:${T.toolName}`,label:T.label||T.toolName});return Q.includes("automations")&&H.push({value:"automations",label:R.automations}),H.push({value:"settings",label:n("virtualMcp.layoutTabContent.settings")}),{projectViews:K,labels:R,pinned:T=>j.includes(T),isMainView:T=>v===T,defaultMainView:v,defaultMainOptions:H,noMainView:N,chatDefaultOpen:b,connectionsData:u,pinnedAppViews:c,openView:T=>a(T,{virtualmcpid:l}),togglePin:(T,O)=>$(T,O),setMainView:I,setChatDefaultOpen:T=>{w({chatDefaultOpen:T}),s()},toggleAppViewPin:C,setAppViewIcon:P,setAppViewLabel:_,commitAppViewLabel:D}}function Ua(l){const e=W.c(5),{header:s,groups:n}=l;let i;e[0]!==n?(i=n.filter(Wa).map(Ya),e[0]=n,e[1]=i):i=e[1];let a;return e[2]!==s||e[3]!==i?(a=t.jsxs(Nn,{children:[s,i]}),e[2]=s,e[3]=i,e[4]=a):a=e[4],a}function Ya(l){return l.content?t.jsx("div",{children:l.content},l.key):t.jsx(st,{title:l.title,children:t.jsx(tt,{children:(l.rows??[]).map(Ka)})},l.key)}function Ka(l){return t.jsx(Ze,{onClick:l.onClick,icon:l.icon,title:t.jsx("span",{className:ue(l.destructive&&"text-destructive"),children:l.title}),description:l.description,action:t.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:t.jsxs("span",{onClick:l.onClick,className:"flex cursor-pointer items-center gap-2",children:[l.value&&t.jsx("span",{className:"text-sm",children:l.value}),t.jsx(Vt,{size:16})]})})},l.key)}function Wa(l){return l.content||l.rows?.length}function Ga(l){const e=W.c(19),{title:s,backLabel:n,onBack:i,actions:a,children:d}=l;let r;e[0]!==n||e[1]!==i?(r=t.jsx(ds,{children:t.jsx(tl,{asChild:!0,className:"rounded-md px-2 py-1 text-muted-foreground hover:bg-accent",children:t.jsx("button",{type:"button",onClick:i,children:n})})}),e[0]=n,e[1]=i,e[2]=r):r=e[2];let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(sl,{}),e[3]=x):x=e[3];let o;e[4]!==s?(o=t.jsx(ds,{children:t.jsx(nl,{className:"px-2 py-1",children:s})}),e[4]=s,e[5]=o):o=e[5];let f;e[6]!==r||e[7]!==o?(f=t.jsx(il,{className:"-ml-2 min-w-0",children:t.jsxs(ll,{className:"text-[15px]",children:[r,x,o]})}),e[6]=r,e[7]=o,e[8]=f):f=e[8];let m;e[9]!==a?(m=a&&t.jsx("div",{className:"shrink-0",children:a}),e[9]=a,e[10]=m):m=e[10];let u;e[11]!==f||e[12]!==m?(u=t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f,m]}),e[11]=f,e[12]=m,e[13]=u):u=e[13];let p;e[14]!==d?(p=t.jsx("div",{className:"flex flex-col gap-10",children:d}),e[14]=d,e[15]=p):p=e[15];let c;return e[16]!==u||e[17]!==p?(c=t.jsxs("div",{className:"flex flex-col gap-8",children:[u,p]}),e[16]=u,e[17]=p,e[18]=c):c=e[18],c}const Ha=["general","connections","site"],Le={general:{titleKey:"virtualMcp.settings.general.title",descriptionKey:"virtualMcp.settings.general.description"},connections:{titleKey:"virtualMcp.settings.connections.title",descriptionKey:"virtualMcp.settings.connections.description"},site:{titleKey:"virtualMcp.settings.site.title",descriptionKey:"virtualMcp.settings.site.description"}};function qa(l){return!!l&&Ha.includes(l)}function Qa(){const l=W.c(8),e=Ot();let s;l[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},l[0]=s):s=l[0];const n=Cn(s).section;let i;l[1]!==n?(i=qa(n)?n:null,l[1]=n,l[2]=i):i=l[2];const a=i;let d;l[3]!==e?(d=x=>e({to:".",search:o=>({...o,section:x??void 0})}),l[3]=e,l[4]=d):d=l[4];let r;return l[5]!==a||l[6]!==d?(r={section:a,openSection:d},l[5]=a,l[6]=d,l[7]=r):r=l[7],r}const _t={tools:null,resources:null,prompts:null},Xa=al.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function Ja(l){const s=new TextEncoder().encode(l),n=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(n)}function un(l){return{"x-studio-client":l,"x-mesh-client":l}}function Za(l){const e=W.c(15),{url:s,agentId:n}=l,i=q(),[a,d]=U.useState(!1);let r;e[0]!==n||e[1]!==i||e[2]!==s?(r=async()=>{ve("agent_connect_action",{agent_id:n,action:"copy_url"}),await navigator.clipboard.writeText(s),d(!0),ie.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await ct(2e3),d(!1)},e[0]=n,e[1]=i,e[2]=s,e[3]=r):r=e[3];const x=r;let o;e[4]!==a?(o=a?t.jsx(ot,{size:20,className:"text-success"}):t.jsx(St,{size:20}),e[4]=a,e[5]=o):o=e[5];let f;e[6]!==a||e[7]!==i?(f=i(a?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=a,e[7]=i,e[8]=f):f=e[8];let m;e[9]!==f?(m=t.jsx("span",{className:"text-xs font-medium",children:f}),e[9]=f,e[10]=m):m=e[10];let u;return e[11]!==x||e[12]!==o||e[13]!==m?(u=t.jsxs(X,{type:"button",variant:"outline",onClick:x,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[o,m]}),e[11]=x,e[12]=o,e[13]=m,e[14]=u):u=e[14],u}function er(l){const e=W.c(13),{url:s,serverName:n,agentId:i}=l,a=q();let d;e[0]!==i||e[1]!==n||e[2]!==a||e[3]!==s?(d=()=>{ve("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=Js(n),p={type:"http",url:s,headers:un("Cursor")},c=Ja(JSON.stringify(p,null,2)),h=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(c)}`;window.open(h,"_blank"),ie.success(a("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=n,e[2]=a,e[3]=s,e[4]=d):d=e[4];const r=d;let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),e[5]=x):x=e[5];let o;e[6]!==a?(o=a("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=a,e[7]=o):o=e[7];let f;e[8]!==o?(f=t.jsx("span",{className:"text-xs font-medium",children:o}),e[8]=o,e[9]=f):f=e[9];let m;return e[10]!==r||e[11]!==f?(m=t.jsxs(X,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[x,f]}),e[10]=r,e[11]=f,e[12]=m):m=e[12],m}function tr(l){const e=W.c(16),{url:s,serverName:n,agentId:i}=l,a=q(),[d,r]=U.useState(!1);let x;e[0]!==i||e[1]!==n||e[2]!==a||e[3]!==s?(x=async()=>{ve("agent_connect_action",{agent_id:i,action:"install_claude_code"});const c=Js(n),h={type:"http",url:s,headers:un("Claude Code")},g=JSON.stringify(h,null,2),b=`claude mcp add-json "${c}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(b),r(!0),ie.success(a("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await ct(2e3),r(!1)},e[0]=i,e[1]=n,e[2]=a,e[3]=s,e[4]=x):x=e[4];const o=x;let f;e[5]!==d?(f=d?t.jsx(ot,{size:20,className:"text-success"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[5]=d,e[6]=f):f=e[6];let m;e[7]!==d||e[8]!==a?(m=a(d?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=d,e[8]=a,e[9]=m):m=e[9];let u;e[10]!==m?(u=t.jsx("span",{className:"text-xs font-medium",children:m}),e[10]=m,e[11]=u):u=e[11];let p;return e[12]!==o||e[13]!==f||e[14]!==u?(p=t.jsxs(X,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[f,u]}),e[12]=o,e[13]=f,e[14]=u,e[15]=p):p=e[15],p}function sr({virtualMcp:l}){const e=q(),s=vt(),[n,i]=U.useState(null),[a,d]=U.useState(!1),[r,x]=U.useState(!1),o=l.id,f=l.title||`agent-${o.slice(0,8)}`,m=n?`bunx @decocms/typegen@latest --mcp ${o} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${o} --key <api-key> --output client.ts`,u=async()=>{d(!0);try{const{key:c}=await s.call("API_KEY_CREATE",{name:`typegen-${f}`,permissions:{[o]:["*"]}});if(!c)throw new Error("No key in response");i(c),ve("agent_typegen_key_generated",{agent_id:o})}catch{ve("agent_typegen_key_failed",{agent_id:o}),ie.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{d(!1)}},p=async()=>{ve("agent_connect_action",{agent_id:o,action:"typegen_copy_command",has_api_key:!!n}),await navigator.clipboard.writeText(m),x(!0),ie.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await ct(2e3),x(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClient")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClientDescription")})]}),!n&&t.jsxs(X,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:a,children:[a?t.jsx(lt,{className:"size-3.5"}):t.jsx(Yt,{size:14}),t.jsx("span",{children:e(a?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),n&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateClientLabel")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:m}),t.jsx(X,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:p,children:r?t.jsx(ot,{size:12,className:"text-success"}):t.jsx(St,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(nr,{apiKey:n,agentId:o})]})}function nr(l){const e=W.c(21),{apiKey:s,agentId:n}=l,[i,a]=U.useState(!1),d=window.location.origin,r=s?`STUDIO_API_KEY=${s}`:"STUDIO_API_KEY=<api-key>",x=`STUDIO_BASE_URL=${d}`,o=`${r}
|
|
2
2
|
${x}`;let f;e[0]!==n||e[1]!==s||e[2]!==o?(f=async()=>{ve("agent_connect_action",{agent_id:n,action:"typegen_copy_env",has_api_key:!!s}),await navigator.clipboard.writeText(o),a(!0),await ct(2e3),a(!1)},e[0]=n,e[1]=s,e[2]=o,e[3]=f):f=e[3];const m=f,u=!s;let p;e[4]!==u?(p=ue({"opacity-50":u}),e[4]=u,e[5]=p):p=e[5];let c;e[6]!==r||e[7]!==p?(c=t.jsx("span",{className:p,children:r}),e[6]=r,e[7]=p,e[8]=c):c=e[8];let h,g;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("br",{}),g=t.jsx("span",{children:x}),e[9]=h,e[10]=g):(h=e[9],g=e[10]);let b;e[11]!==c?(b=t.jsxs("code",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:[c,h,g]}),e[11]=c,e[12]=b):b=e[12];let y;e[13]!==i?(y=i?t.jsx(ot,{size:12,className:"text-success"}):t.jsx(St,{size:12}),e[13]=i,e[14]=y):y=e[14];let j;e[15]!==m||e[16]!==y?(j=t.jsx(X,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:m,children:y}),e[15]=m,e[16]=y,e[17]=j):j=e[17];let v;return e[18]!==b||e[19]!==j?(v=t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[b,j]})}),e[18]=b,e[19]=j,e[20]=v):v=e[20],v}function ir(l){const e=W.c(3),{virtualMcp:s}=l;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=n):n=e[0];let i;return e[1]!==s?(i=t.jsx(U.Suspense,{fallback:n,children:t.jsx(sr,{virtualMcp:s})}),e[1]=s,e[2]=i):i=e[2],i}const lr={self:["COLLECTION_THREADS_CREATE","COLLECTION_THREADS_GET","COLLECTION_THREAD_MESSAGES_LIST","COLLECTION_THREADS_LIST"]},ar=3600*24*90;function rr({virtualMcp:l}){const e=q(),s=vt(),{org:n}=$e(),[i,a]=U.useState(null),[d,r]=U.useState(!1),[x,o]=U.useState(!1),f=l.id,m=l.title||`agent-${f.slice(0,8)}`,p=[`STUDIO_BASE_URL=${window.location.origin}`,`STUDIO_ORG=${n.slug}`,`STUDIO_AGENT_ID=${f}`,`STUDIO_API_KEY=${i??"<api-key>"}`].join(`
|
|
3
3
|
`),c=async()=>{r(!0);try{const{key:g}=await s.call("API_KEY_CREATE",{name:`chat-bridge-${m}`,permissions:lr,expiresIn:ar});if(!g)throw new Error("No key in response");a(g),ve("agent_chat_bridge_key_generated",{agent_id:f})}catch{ve("agent_chat_bridge_key_failed",{agent_id:f}),ie.error(e("virtualMcp.virtualMcpShareModal.failedCreateApiKey"))}finally{r(!1)}},h=async()=>{ve("agent_connect_action",{agent_id:f,action:"chat_bridge_copy_env",has_api_key:!!i}),await navigator.clipboard.writeText(p),o(!0),ie.success(e("virtualMcp.virtualMcpShareModal.connectionDetailsCopied")),await ct(2e3),o(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.callFromYourApp")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.callFromYourAppDescription")})]}),!i&&t.jsxs(X,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:c,disabled:d,children:[d?t.jsx(lt,{className:"size-3.5"}):t.jsx(Yt,{size:14}),t.jsx("span",{children:e(d?"virtualMcp.virtualMcpShareModal.creating":"virtualMcp.virtualMcpShareModal.createApiKey")})]})]}),i&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.connectionDetails")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 whitespace-pre-wrap break-all font-mono text-xs text-muted-foreground",children:p}),t.jsx(X,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:h,children:x?t.jsx(ot,{size:12,className:"text-success"}):t.jsx(St,{size:12})})]})})]})}function or(l){const e=W.c(3),{virtualMcp:s}=l;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=n):n=e[0];let i;return e[1]!==s?(i=t.jsx(U.Suspense,{fallback:n,children:t.jsx(rr,{virtualMcp:s})}),e[1]=s,e[2]=i):i=e[2],i}function cr(l){const e=W.c(49),{open:s,onOpenChange:n,virtualMcp:i}=l,a=q(),{org:d}=$e(),r=`/api/${d.slug}/mcp/virtual-mcp/${i.id}`;let x;e[0]!==r?(x=new URL(r,window.location.origin),e[0]=r,e[1]=x):x=e[1];const o=x;let f;e[2]!==i.id||e[3]!==i.title?(f=i.title||`agent-${i.id?.slice(0,8)??"default"}`,e[2]=i.id,e[3]=i.title,e[4]=f):f=e[4];const m=f,u=ml();let p;e[5]!==i.id||e[6]!==o.href?(p=t.jsx(Za,{url:o.href,agentId:i.id}),e[5]=i.id,e[6]=o.href,e[7]=p):p=e[7];let c,h;e[8]!==m||e[9]!==i.id||e[10]!==o.href?(c=t.jsx(er,{url:o.href,serverName:m,agentId:i.id}),h=t.jsx(tr,{url:o.href,serverName:m,agentId:i.id}),e[8]=m,e[9]=i.id,e[10]=o.href,e[11]=c,e[12]=h):(c=e[11],h=e[12]);let g;e[13]!==p||e[14]!==c||e[15]!==h?(g=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[p,c,h]})}),e[13]=p,e[14]=c,e[15]=h,e[16]=g):g=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"border-t border-border"}),e[17]=b):b=e[17];let y;e[18]!==i?(y=t.jsx(ir,{virtualMcp:i}),e[18]=i,e[19]=y):y=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"border-t border-border"}),e[20]=j):j=e[20];let v;e[21]!==i?(v=t.jsx(or,{virtualMcp:i}),e[21]=i,e[22]=v):v=e[22];let N;e[23]!==v||e[24]!==g||e[25]!==y?(N=t.jsxs("div",{className:"flex flex-col gap-6",children:[g,b,y,j,v]}),e[23]=v,e[24]=g,e[25]=y,e[26]=N):N=e[26];const S=N;if(u){let _;e[27]!==a?(_=a("virtualMcp.virtualMcpShareModal.connect"),e[27]=a,e[28]=_):_=e[28];let D;e[29]!==_?(D=t.jsx(cl,{className:"mt-4 mb-4 text-base font-semibold",children:_}),e[29]=_,e[30]=D):D=e[30];let P;e[31]!==S||e[32]!==D?(P=t.jsx(dl,{children:t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-6 [touch-action:pan-y]",children:[D,S]})}),e[31]=S,e[32]=D,e[33]=P):P=e[33];let I;return e[34]!==n||e[35]!==s||e[36]!==P?(I=t.jsx(ul,{open:s,onOpenChange:n,children:P}),e[34]=n,e[35]=s,e[36]=P,e[37]=I):I=e[37],I}let M;e[38]!==a?(M=a("virtualMcp.virtualMcpShareModal.connect"),e[38]=a,e[39]=M):M=e[39];let w;e[40]!==M?(w=t.jsx(at,{children:t.jsx(rt,{children:M})}),e[40]=M,e[41]=w):w=e[41];let k;e[42]!==S||e[43]!==w?(k=t.jsxs(Qe,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[w,S]}),e[42]=S,e[43]=w,e[44]=k):k=e[44];let C;return e[45]!==n||e[46]!==s||e[47]!==k?(C=t.jsx(qe,{open:s,onOpenChange:n,children:k}),e[45]=n,e[46]=s,e[47]=k,e[48]=C):C=e[48],C}function dr(l){const e=W.c(50),{virtualMcp:s}=l,n=q(),i=Is(),a=Os(),[d,r]=U.useState(!1);let x,o,f,m,u,p,c,h,g;if(e[0]!==a||e[1]!==i||e[2]!==n||e[3]!==s.id||e[4]!==s.metadata){g=Symbol.for("react.early_return_sentinel");e:{const M=Ri(i);if(kn(s.id)||ht(s.metadata)||M.has(s.id)){g=null;break e}let w;e[14]!==i||e[15]!==s.id?(w=(i??[]).find(K=>K.metadata?.liveAgentId===s.id)??null,e[14]=i,e[15]=s.id,e[16]=w):w=e[16];const k=w,C=k?.id??null;let _;e[17]!==a.update?(_=(K,Q)=>a.update.mutateAsync({id:K,data:{metadata:{liveAgentId:Q}}}).catch(mr),e[17]=a.update,e[18]=_):_=e[18];const D=_;let P;e[19]!==D||e[20]!==s.id?(P=K=>{D(K,s.id)},e[19]=D,e[20]=s.id,e[21]=P):P=e[21],f=P;let I;e[22]!==C||e[23]!==D?(I=()=>{C&&D(C,null)},e[22]=C,e[23]=D,e[24]=I):I=e[24];const $=I,A=(i??[]).filter(K=>K.id!==s.id&&ht(K.metadata)&&!M.has(K.id));c="flex flex-col gap-3";let Y;e[25]!==n?(Y=n("devAgent.devAgentSetup.title"),e[25]=n,e[26]=Y):Y=e[26],e[27]!==Y?(h=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:Y}),e[27]=Y,e[28]=h):h=e[28],o=Mn,p="p-6 gap-4",x=_n,m="p-0 space-y-4",u=C?t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[t.jsx("span",{className:"text-sm text-foreground truncate",children:k?k.title:C}),t.jsx("span",{className:"text-xs text-muted-foreground",children:n("devAgent.devAgentSetup.linkedDescription")})]}),t.jsx(X,{variant:"outline",size:"sm",className:"shrink-0",onClick:$,children:n("devAgent.devAgentSetup.unlinkButton")})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:n("devAgent.devAgentSetup.linkDescription")}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs(X,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>r(!0),children:[t.jsx(fl,{className:"size-4"}),n("devAgent.devAgentSetup.importButton")]}),A.length>0?t.jsxs(De,{onValueChange:f,children:[t.jsx(Me,{size:"sm",className:"w-56",children:t.jsx(_e,{placeholder:n("devAgent.devAgentSetup.selectPlaceholder")})}),t.jsx(Te,{children:A.map(ur)})]}):null]})]})}e[0]=a,e[1]=i,e[2]=n,e[3]=s.id,e[4]=s.metadata,e[5]=x,e[6]=o,e[7]=f,e[8]=m,e[9]=u,e[10]=p,e[11]=c,e[12]=h,e[13]=g}else x=e[5],o=e[6],f=e[7],m=e[8],u=e[9],p=e[10],c=e[11],h=e[12],g=e[13];if(g!==Symbol.for("react.early_return_sentinel"))return g;let b;e[29]!==x||e[30]!==m||e[31]!==u?(b=t.jsx(x,{className:m,children:u}),e[29]=x,e[30]=m,e[31]=u,e[32]=b):b=e[32];let y;e[33]!==o||e[34]!==p||e[35]!==b?(y=t.jsx(o,{className:p,children:b}),e[33]=o,e[34]=p,e[35]=b,e[36]=y):y=e[36];let j;e[37]!==n?(j=n("devAgent.devAgentSetup.importDialogTitle"),e[37]=n,e[38]=j):j=e[38];let v;e[39]!==f?(v=M=>{const{virtualMcpId:w}=M;r(!1),w&&f(w)},e[39]=f,e[40]=v):v=e[40];let N;e[41]!==d||e[42]!==v||e[43]!==j?(N=t.jsx(pl,{open:d,onOpenChange:r,title:j,onImportComplete:v}),e[41]=d,e[42]=v,e[43]=j,e[44]=N):N=e[44];let S;return e[45]!==N||e[46]!==c||e[47]!==h||e[48]!==y?(S=t.jsxs("div",{className:c,children:[h,y,N]}),e[45]=N,e[46]=c,e[47]=h,e[48]=y,e[49]=S):S=e[49],S}function ur(l){return t.jsx(pe,{value:l.id,children:l.title},l.id)}function mr(){}const fr=/^[A-Za-z_][A-Za-z0-9_]*$/;function pr(l){const e={},s=l.split(/\r?\n/);for(let n=0;n<s.length;n++){let i=(s[n]??"").trim();if(!i||i.startsWith("#"))continue;i.startsWith("export ")&&(i=i.slice(7).trim());const a=i.indexOf("=");if(a<0)throw new Error(`Line ${n+1}: missing '='`);const d=i.slice(0,a).trim();if(!fr.test(d))throw new Error(`Line ${n+1}: invalid key "${d}"`);let r=i.slice(a+1).trim();r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),e[d]=r}return e}const mn=/^[A-Za-z0-9_.-]+$/;function fn(l){const e=W.c(15),{field:s,secretById:n}=l,i=q(),a=s.value||"";if(!a)return null;let d;e[0]!==a||e[1]!==n?(d=n.get(a),e[0]=a,e[1]=n,e[2]=d):d=e[2];const r=d;if(!r){let m;e[3]!==a||e[4]!==i?(m=i("sandbox.envVarsField.missingSecret",{id:a}),e[3]=a,e[4]=i,e[5]=m):m=e[5];let u;return e[6]!==m?(u=t.jsx("span",{className:"text-destructive",children:m}),e[6]=m,e[7]=u):u=e[7],u}let x;e[8]!==r.scope?(x=t.jsx(Wt,{scope:r.scope}),e[8]=r.scope,e[9]=x):x=e[9];let o;e[10]!==r.name?(o=t.jsx("span",{className:"truncate font-mono",children:r.name}),e[10]=r.name,e[11]=o):o=e[11];let f;return e[12]!==x||e[13]!==o?(f=t.jsxs("span",{className:"inline-flex items-center gap-1.5 truncate",children:[x,o]}),e[12]=x,e[13]=o,e[14]=f):f=e[14],f}function Wt(l){const e=W.c(2),{scope:s}=l,n=s==="user"?hl:gl;let i;return e[0]!==n?(i=t.jsx(n,{className:"size-3 text-muted-foreground"}),e[0]=n,e[1]=i):i=e[1],i}function xr(l){const e=W.c(28),{control:s,form:n,virtualMcpId:i,orgSlug:a,sandboxMap:d}=l,r=q();let x;e[0]!==r?(x=r("sandbox.envVarsField.title"),e[0]=r,e[1]=x):x=e[1];let o;e[2]!==x?(o=t.jsx("div",{className:"flex items-baseline justify-between gap-2",children:t.jsx(me,{className:"font-normal text-foreground",children:x})}),e[2]=x,e[3]=o):o=e[3];let f;e[4]!==r?(f=r("sandbox.envVarsField.description"),e[4]=r,e[5]=f):f=e[5];let m;e[6]!==f?(m=t.jsx("p",{className:"text-xs text-muted-foreground",children:f}),e[6]=f,e[7]=m):m=e[7];let u;e[8]!==s||e[9]!==n||e[10]!==a||e[11]!==d||e[12]!==i?(u=t.jsx(hr,{control:s,form:n,virtualMcpId:i,orgSlug:a,sandboxMap:d}),e[8]=s,e[9]=n,e[10]=a,e[11]=d,e[12]=i,e[13]=u):u=e[13];let p;e[14]!==r?(p=y=>{const{error:j}=y;return t.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:j?.message??r("sandbox.envVarsField.failedToLoadSecrets")})},e[14]=r,e[15]=p):p=e[15];let c;e[16]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(_s,{className:"h-9 w-full"}),e[16]=c):c=e[16];let h;e[17]!==s||e[18]!==n?(h=t.jsx(U.Suspense,{fallback:c,children:t.jsx(vr,{control:s,form:n})}),e[17]=s,e[18]=n,e[19]=h):h=e[19];let g;e[20]!==p||e[21]!==h?(g=t.jsx(ze,{fallback:p,children:h}),e[20]=p,e[21]=h,e[22]=g):g=e[22];let b;return e[23]!==o||e[24]!==m||e[25]!==u||e[26]!==g?(b=t.jsxs("div",{className:"space-y-2",children:[o,m,u,g]}),e[23]=o,e[24]=m,e[25]=u,e[26]=g,e[27]=b):b=e[27],b}function hr(l){const e=W.c(33),{control:s,form:n,virtualMcpId:i,orgSlug:a,sandboxMap:d}=l,r=q(),o=Tn.useSession().data?.user?.id,f="metadata.runtime.env";let m;e[0]!==n?(m=()=>JSON.stringify(Ss(n.getValues(f))),e[0]=n,e[1]=m):m=e[1];const[u,p]=U.useState(m);let c;e[2]!==s?(c={control:s,name:f},e[2]=s,e[3]=c):c=e[3];const h=Ts(c);let g;e[4]!==h?(g=JSON.stringify(Ss(h)),e[4]=h,e[5]=g):g=e[5];const b=g,y=b!==u;let j;e[6]!==d||e[7]!==o?(j=o?Object.keys(d?.[o]??{}):[],e[6]=d,e[7]=o,e[8]=j):j=e[8];const v=j,N=v.length>0,[S,M]=U.useState(!1);if(!y||!N)return null;let w;e[9]!==b||e[10]!==a||e[11]!==r||e[12]!==v||e[13]!==i?(w=async()=>{M(!0);const Y=await Promise.allSettled(v.map(async Q=>{const R=xl({orgSlug:a,virtualMcpId:i,branch:Q,threadId:null},"setup/start"),H=await fetch(R,{method:"POST"});if(!H.ok){const L=await H.text().catch(()=>H.statusText);throw new Error(L||H.statusText)}}));M(!1);const K=Y.filter(gr).length;K===0?(p(b),ie.success(v.length===1?r("sandbox.envVarsField.restartedSingle"):r("sandbox.envVarsField.restartedMultiple",{count:v.length}))):ie.error(r("sandbox.envVarsField.restartFailed",{failed:K,total:v.length}))},e[9]=b,e[10]=a,e[11]=r,e[12]=v,e[13]=i,e[14]=w):w=e[14];const k=w;let C;e[15]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(ks,{className:"size-3.5 shrink-0"}),e[15]=C):C=e[15];let _;e[16]!==r?(_=r("sandbox.envVarsField.sandboxRunningNotice"),e[16]=r,e[17]=_):_=e[17];let D;e[18]!==_?(D=t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-warning",children:[C,t.jsx("span",{className:"truncate",children:_})]}),e[18]=_,e[19]=D):D=e[19];let P;e[20]!==S?(P=S?t.jsx(lt,{className:"size-3.5"}):t.jsx(Dn,{className:"size-3.5"}),e[20]=S,e[21]=P):P=e[21];let I;e[22]!==S||e[23]!==r?(I=r(S?"sandbox.envVarsField.restarting":"sandbox.envVarsField.restartDev"),e[22]=S,e[23]=r,e[24]=I):I=e[24];let $;e[25]!==k||e[26]!==S||e[27]!==I||e[28]!==P?($=t.jsxs(X,{type:"button",variant:"outline",size:"sm",onClick:k,disabled:S,className:"shrink-0",children:[P,I]}),e[25]=k,e[26]=S,e[27]=I,e[28]=P,e[29]=$):$=e[29];let A;return e[30]!==$||e[31]!==D?(A=t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs",children:[D,$]}),e[30]=$,e[31]=D,e[32]=A):A=e[32],A}function gr(l){return l.status==="rejected"}function vr(l){const e=W.c(62),{control:s,form:n}=l,i=q(),a="metadata.runtime.env";let d;e[0]!==s?(d={control:s,name:a},e[0]=s,e[1]=d):d=e[1];const r=Ds(d),{fields:x,append:o,remove:f}=r;let m;e[2]!==n?(m=(R,H)=>{n.setValue(`${a}.${R}`,H,{shouldDirty:!0,shouldTouch:!0})},e[2]=n,e[3]=m):m=e[3];const u=m,p=en();let c;if(e[4]!==p){c=new Map;for(const R of p)c.set(R.id,R);e[4]=p,e[5]=c}else c=e[5];const[h,g]=U.useState(null);let b;e[6]!==o?(b=()=>{o({key:"",kind:"literal",value:""})},e[6]=o,e[7]=b):b=e[7];const y=b;let j;e[8]!==o||e[9]!==n||e[10]!==i?(j=async()=>{let R;try{R=await navigator.clipboard.readText()}catch{ie.error(i("sandbox.envVarsField.clipboardReadFailed"));return}if(!R.trim()){ie.error(i("sandbox.envVarsField.clipboardEmpty"));return}let H;try{H=pr(R)}catch(F){const B=F;ie.error(B.message);return}const L=Object.entries(H);if(L.length===0){ie.error(i("sandbox.envVarsField.nothingToAdd"));return}const T=n.getValues(a)??[],O=new Set;for(const F of T){const B=(F.key??"").trim();B&&O.add(B)}let G=0,z=0;for(const[F,B]of L){if(O.has(F)){z++;continue}o({key:F,kind:"literal",value:B}),O.add(F),G++}G===0&&z>0?ie.message(i("sandbox.envVarsField.allKeysExist",{count:z})):ie.success(z>0?i("sandbox.envVarsField.addedWithSkipped",{added:G,skipped:z}):i("sandbox.envVarsField.added",{added:G}))},e[8]=o,e[9]=n,e[10]=i,e[11]=j):j=e[11];const v=j;let N;if(e[12]!==s||e[13]!==x||e[14]!==n||e[15]!==f||e[16]!==c||e[17]!==p||e[18]!==u){let R;e[20]!==s||e[21]!==n||e[22]!==f||e[23]!==c||e[24]!==p||e[25]!==u?(R=(H,L)=>t.jsx("li",{className:"rounded-md border border-border bg-background",children:t.jsx(br,{index:L,control:s,form:n,onUpdateEntry:u,fieldPath:a,secrets:p,secretById:c,onSaveAsSecret:(T,O)=>g({kind:"save-literal",index:L,presetKey:T,presetValue:O}),onCreateNewSecret:T=>g({kind:"create-new",index:L,presetKey:T}),onRemove:()=>f(L)})},H.id),e[20]=s,e[21]=n,e[22]=f,e[23]=c,e[24]=p,e[25]=u,e[26]=R):R=e[26],N=x.map(R),e[12]=s,e[13]=x,e[14]=n,e[15]=f,e[16]=c,e[17]=p,e[18]=u,e[19]=N}else N=e[19];let S;e[27]!==N?(S=t.jsx("ul",{className:"space-y-2",children:N}),e[27]=N,e[28]=S):S=e[28];let M;e[29]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Pe,{className:"size-3.5"}),e[29]=M):M=e[29];let w;e[30]!==i?(w=i("sandbox.envVarsField.addEnvVar"),e[30]=i,e[31]=w):w=e[31];let k;e[32]!==y||e[33]!==w?(k=t.jsxs(X,{type:"button",variant:"outline",size:"sm",onClick:y,className:"flex-1",children:[M,w]}),e[32]=y,e[33]=w,e[34]=k):k=e[34];let C;e[35]!==i?(C=i("sandbox.envVarsField.pasteDotenvAriaLabel"),e[35]=i,e[36]=C):C=e[36];let _;e[37]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(hi,{className:"size-3.5"}),e[37]=_):_=e[37];let D;e[38]!==i?(D=i("sandbox.envVarsField.pasteDotenv"),e[38]=i,e[39]=D):D=e[39];let P;e[40]!==v||e[41]!==C||e[42]!==D?(P=t.jsx(ye,{asChild:!0,children:t.jsxs(X,{type:"button",variant:"outline",size:"sm",onClick:v,"aria-label":C,children:[_,D]})}),e[40]=v,e[41]=C,e[42]=D,e[43]=P):P=e[43];let I;e[44]!==i?(I=i("sandbox.envVarsField.pasteDotenvTooltip"),e[44]=i,e[45]=I):I=e[45];let $;e[46]!==I?($=t.jsx(we,{children:I}),e[46]=I,e[47]=$):$=e[47];let A;e[48]!==P||e[49]!==$?(A=t.jsxs(je,{children:[P,$]}),e[48]=P,e[49]=$,e[50]=A):A=e[50];let Y;e[51]!==A||e[52]!==k?(Y=t.jsxs("div",{className:"flex items-center gap-2",children:[k,A]}),e[51]=A,e[52]=k,e[53]=Y):Y=e[53];let K;e[54]!==h||e[55]!==n||e[56]!==u?(K=h!==null?t.jsx(yr,{mode:h,onClose:()=>g(null),onSaved:R=>{const H=n.getValues(`${a}.${h.index}.key`)?.trim()??"";u(h.index,{key:H,kind:"secret",secretId:R}),g(null)}}):null,e[54]=h,e[55]=n,e[56]=u,e[57]=K):K=e[57];let Q;return e[58]!==Y||e[59]!==K||e[60]!==S?(Q=t.jsxs("div",{className:"space-y-2",children:[S,Y,K]}),e[58]=Y,e[59]=K,e[60]=S,e[61]=Q):Q=e[61],Q}function br(l){const e=W.c(77),{index:s,control:n,form:i,onUpdateEntry:a,fieldPath:d,secrets:r,secretById:x,onSaveAsSecret:o,onCreateNewSecret:f,onRemove:m}=l,u=q(),p=`${d}.${s}.key`,c=`${d}.${s}.value`,h=`${d}.${s}.secretId`,g=`${d}.${s}.kind`;let b;e[0]!==n||e[1]!==g?(b={control:n,name:g},e[0]=n,e[1]=g,e[2]=b):b=e[2];const j=Ts(b)==="secret"?"secret":"literal";let v;e[3]!==i||e[4]!==s||e[5]!==p||e[6]!==o||e[7]!==a||e[8]!==c?(v=B=>{const J=i.getValues(p)?.trim()??"";if(B==="literal"){a(s,{key:J,kind:"literal",value:""});return}const ne=i.getValues(c)??"";if(ne.length>0){o(J,ne);return}a(s,{key:J,kind:"secret",secretId:""})},e[3]=i,e[4]=s,e[5]=p,e[6]=o,e[7]=a,e[8]=c,e[9]=v):v=e[9];const N=v;let S;e[10]!==s||e[11]!==u?(S=B=>{const{field:J}=B,ne=(J.value??"").trim(),le=ne.length>0&&!wt.test(ne);return t.jsxs("div",{className:"space-y-1",children:[t.jsx(Se,{...J,value:J.value??"",placeholder:u("sandbox.envVarsField.keyPlaceholder"),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",className:ue("font-mono",le&&"border-destructive focus-visible:ring-destructive"),"aria-invalid":le,"aria-label":u("sandbox.envVarsField.envVarKeyLabel",{index:s+1}),onBlur:de=>{const oe=de.target.value.trim();J.onChange(oe),J.onBlur()}}),le?t.jsx("p",{className:"text-[11px] text-destructive",children:u("sandbox.envVarsField.invalidKeyMessage")}):null]})},e[10]=s,e[11]=u,e[12]=S):S=e[12];let M;e[13]!==n||e[14]!==p||e[15]!==S?(M=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(fe,{control:n,name:p,render:S})}),e[13]=n,e[14]=p,e[15]=S,e[16]=M):M=e[16];let w;e[17]!==N?(w=B=>N(B),e[17]=N,e[18]=w):w=e[18];let k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Me,{className:"h-9 w-[110px]",children:t.jsx(_e,{})}),e[19]=k):k=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Yt,{className:"size-3.5"}),e[20]=C):C=e[20];let _;e[21]!==u?(_=u("sandbox.envVarsField.literal"),e[21]=u,e[22]=_):_=e[22];let D;e[23]!==_?(D=t.jsx(pe,{value:"literal",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[C,_]})}),e[23]=_,e[24]=D):D=e[24];let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Vn,{className:"size-3.5"}),e[25]=P):P=e[25];let I;e[26]!==u?(I=u("sandbox.envVarsField.secret"),e[26]=u,e[27]=I):I=e[27];let $;e[28]!==I?($=t.jsx(pe,{value:"secret",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[P,I]})}),e[28]=I,e[29]=$):$=e[29];let A;e[30]!==$||e[31]!==D?(A=t.jsxs(Te,{children:[D,$]}),e[30]=$,e[31]=D,e[32]=A):A=e[32];let Y;e[33]!==j||e[34]!==A||e[35]!==w?(Y=t.jsx("div",{className:"shrink-0",children:t.jsxs(De,{value:j,onValueChange:w,children:[k,A]})}),e[33]=j,e[34]=A,e[35]=w,e[36]=Y):Y=e[36];let K;e[37]!==n||e[38]!==i||e[39]!==s||e[40]!==p||e[41]!==j||e[42]!==f||e[43]!==x||e[44]!==h||e[45]!==r||e[46]!==u||e[47]!==c?(K=t.jsx("div",{className:"flex flex-[2] min-w-0 items-center gap-1",children:j==="literal"?t.jsx(fe,{control:n,name:c,render:B=>{const{field:J}=B;return t.jsx(Se,{...J,value:J.value??"",type:"password",placeholder:u("sandbox.envVarsField.valuePlaceholder"),spellCheck:!1,autoComplete:"off",className:"font-mono","aria-label":u("sandbox.envVarsField.envVarValueLabel",{index:s+1}),onBlur:ne=>{J.onChange(ne.target.value),J.onBlur()}})}}):t.jsxs(t.Fragment,{children:[t.jsx(fe,{control:n,name:h,render:B=>{const{field:J}=B;return t.jsxs(De,{value:J.value||"",onValueChange:ne=>J.onChange(ne),children:[t.jsx(Me,{className:ue("h-9 w-full",!J.value&&"text-muted-foreground"),children:t.jsx(_e,{placeholder:u("sandbox.envVarsField.pickSecretPlaceholder"),children:t.jsx(fn,{field:J,secretById:x})})}),t.jsx(Te,{children:r.length===0?t.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:u("sandbox.envVarsField.noSecretsYet")}):r.map(jr)})]})}}),t.jsxs(je,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(X,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.createNewSecretAriaLabel"),onClick:()=>{const B=i.getValues(p)?.trim()??"";f(B)},children:t.jsx(Pe,{className:"size-3.5"})})}),t.jsx(we,{children:u("sandbox.envVarsField.createNewSecret")})]})]})}),e[37]=n,e[38]=i,e[39]=s,e[40]=p,e[41]=j,e[42]=f,e[43]=x,e[44]=h,e[45]=r,e[46]=u,e[47]=c,e[48]=K):K=e[48];let Q;e[49]!==i||e[50]!==p||e[51]!==j||e[52]!==o||e[53]!==u||e[54]!==c?(Q=j==="literal"?t.jsxs(je,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(X,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.saveAsSecretAriaLabel"),onClick:()=>{const B=i.getValues(p)?.trim()??"",J=i.getValues(c)??"";o(B,J)},children:t.jsx(gi,{className:"size-3.5"})})}),t.jsx(we,{children:u("sandbox.envVarsField.saveAsSecret")})]}):null,e[49]=i,e[50]=p,e[51]=j,e[52]=o,e[53]=u,e[54]=c,e[55]=Q):Q=e[55];let R;e[56]!==u?(R=u("sandbox.envVarsField.removeEnvVarAriaLabel"),e[56]=u,e[57]=R):R=e[57];let H;e[58]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(nt,{className:"size-3.5"}),e[58]=H):H=e[58];let L;e[59]!==m||e[60]!==R?(L=t.jsx(ye,{asChild:!0,children:t.jsx(X,{type:"button",variant:"ghost",size:"icon","aria-label":R,onClick:m,children:H})}),e[59]=m,e[60]=R,e[61]=L):L=e[61];let T;e[62]!==u?(T=u("sandbox.envVarsField.remove"),e[62]=u,e[63]=T):T=e[63];let O;e[64]!==T?(O=t.jsx(we,{children:T}),e[64]=T,e[65]=O):O=e[65];let G;e[66]!==L||e[67]!==O?(G=t.jsxs(je,{children:[L,O]}),e[66]=L,e[67]=O,e[68]=G):G=e[68];let z;e[69]!==Q||e[70]!==G?(z=t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[Q,G]}),e[69]=Q,e[70]=G,e[71]=z):z=e[71];let F;return e[72]!==Y||e[73]!==K||e[74]!==z||e[75]!==M?(F=t.jsxs("div",{className:"flex flex-col gap-2 p-2 sm:flex-row sm:items-center",children:[M,Y,K,z]}),e[72]=Y,e[73]=K,e[74]=z,e[75]=M,e[76]=F):F=e[76],F}function jr(l){return t.jsx(pe,{value:l.id,children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(Wt,{scope:l.scope}),t.jsx("span",{className:"font-mono",children:l.name})]})},l.id)}function yr({mode:l,onClose:e,onSaved:s}){const n=q(),i=l.kind==="save-literal"?l.presetValue:"",a=l.presetKey,[d,r]=U.useState(()=>wr(a)),[x,o]=U.useState("organization"),[f,m]=U.useState(i),[u,p]=U.useState(""),c=tn(),h=d.trim(),g=f.length>0&&h.length>0&&mn.test(h),b=async v=>{if(v.preventDefault(),!!g)try{const N=await c.mutateAsync({scope:x,name:h,value:f,description:u.trim()||void 0});ie.success(n("sandbox.envVarsField.secretSaved",{name:N.name})),s(N.id)}catch(N){ie.error(N instanceof Error?N.message:n("sandbox.envVarsField.failedToSaveSecret"))}},y=l.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretTitle"):n("sandbox.envVarsField.createNewSecretTitle"),j=l.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretDescription"):n("sandbox.envVarsField.createNewSecretDescription");return t.jsx(qe,{open:!0,onOpenChange:v=>{v||e()},children:t.jsxs(Qe,{className:"sm:max-w-md",children:[t.jsxs(at,{children:[t.jsx(rt,{children:y}),t.jsx(Ps,{children:j})]}),t.jsxs("form",{onSubmit:b,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(me,{htmlFor:"save-secret-scope",children:n("sandbox.envVarsField.scopeLabel")}),t.jsxs(De,{value:x,onValueChange:v=>o(v),children:[t.jsx(Me,{id:"save-secret-scope",children:t.jsx(_e,{})}),t.jsxs(Te,{children:[t.jsx(pe,{value:"organization",children:n("sandbox.envVarsField.scopeOrganization")}),t.jsx(pe,{value:"user",children:n("sandbox.envVarsField.scopePrivate")})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(me,{htmlFor:"save-secret-name",children:n("sandbox.envVarsField.nameLabel")}),t.jsx(Se,{id:"save-secret-name",value:d,onChange:v=>r(v.target.value),placeholder:n("sandbox.envVarsField.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.envVarsField.nameHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(me,{htmlFor:"save-secret-value",children:n("sandbox.envVarsField.valueLabel")}),t.jsx(Se,{id:"save-secret-value",type:"password",value:f,onChange:v=>m(v.target.value),placeholder:n("sandbox.envVarsField.secretValuePlaceholder"),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(me,{htmlFor:"save-secret-description",children:n("sandbox.envVarsField.descriptionLabel")}),t.jsx(pt,{id:"save-secret-description",value:u,onChange:v=>p(v.target.value),rows:2,placeholder:n("sandbox.envVarsField.descriptionPlaceholder")})]}),t.jsxs($t,{children:[t.jsx(X,{type:"button",variant:"outline",onClick:e,disabled:c.isPending,children:n("sandbox.envVarsField.cancel")}),t.jsx(X,{type:"submit",disabled:!g||c.isPending,children:c.isPending?n("sandbox.envVarsField.saving"):n("sandbox.envVarsField.saveSecret")})]})]})]})})}function Ss(l){if(!Array.isArray(l))return[];const e=[];for(const s of l){if(!s||typeof s!="object")continue;const n=s,i=(n.key??"").trim();if(!(!i||!wt.test(i))){if(n.kind==="literal"){e.push({key:i,kind:"literal",value:n.value??""});continue}n.kind==="secret"&&n.secretId&&e.push({key:i,kind:"secret",secretId:n.secretId})}}return e}function wr(l){const e=l.trim();return e&&wt.test(e)?e:""}function Sr(l){const e=W.c(21),{control:s,form:n}=l,i=q();let a;e[0]!==i?(a=i("sandbox.submoduleCredentialsField.title"),e[0]=i,e[1]=a):a=e[1];let d;e[2]!==a?(d=t.jsx(me,{className:"font-normal text-foreground",children:a}),e[2]=a,e[3]=d):d=e[3];let r;e[4]!==i?(r=i("sandbox.submoduleCredentialsField.description"),e[4]=i,e[5]=r):r=e[5];let x;e[6]!==r?(x=t.jsx("p",{className:"text-xs text-muted-foreground",children:r}),e[6]=r,e[7]=x):x=e[7];let o;e[8]!==i?(o=c=>{const{error:h}=c;return t.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:h?.message??i("sandbox.submoduleCredentialsField.failedToLoadSecrets")})},e[8]=i,e[9]=o):o=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(_s,{className:"h-9 w-full"}),e[10]=f):f=e[10];let m;e[11]!==s||e[12]!==n?(m=t.jsx(U.Suspense,{fallback:f,children:t.jsx(Nr,{control:s,form:n})}),e[11]=s,e[12]=n,e[13]=m):m=e[13];let u;e[14]!==o||e[15]!==m?(u=t.jsx(ze,{fallback:o,children:m}),e[14]=o,e[15]=m,e[16]=u):u=e[16];let p;return e[17]!==d||e[18]!==x||e[19]!==u?(p=t.jsxs("div",{className:"space-y-2",children:[d,x,u]}),e[17]=d,e[18]=x,e[19]=u,e[20]=p):p=e[20],p}function Nr(l){const e=W.c(32),{control:s,form:n}=l,i=q(),a="metadata.runtime.submoduleCredentials";let d;e[0]!==s?(d={control:s,name:a},e[0]=s,e[1]=d):d=e[1];const{fields:r,append:x,remove:o}=Ds(d),f=en();let m;if(e[2]!==f){m=new Map;for(const S of f)m.set(S.id,S);e[2]=f,e[3]=m}else m=e[3];const[u,p]=U.useState(null);let c;if(e[4]!==s||e[5]!==r||e[6]!==o||e[7]!==m||e[8]!==f){let S;e[10]!==s||e[11]!==o||e[12]!==m||e[13]!==f?(S=(M,w)=>t.jsx("li",{className:"rounded-md border border-border bg-background",children:t.jsx(Cr,{index:w,control:s,fieldPath:a,secrets:f,secretById:m,onCreateNewSecret:()=>p(w),onRemove:()=>o(w)})},M.id),e[10]=s,e[11]=o,e[12]=m,e[13]=f,e[14]=S):S=e[14],c=r.map(S),e[4]=s,e[5]=r,e[6]=o,e[7]=m,e[8]=f,e[9]=c}else c=e[9];let h;e[15]!==c?(h=t.jsx("ul",{className:"space-y-2",children:c}),e[15]=c,e[16]=h):h=e[16];let g;e[17]!==x?(g=()=>x({host:"",secretId:""}),e[17]=x,e[18]=g):g=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Pe,{className:"size-3.5"}),e[19]=b):b=e[19];let y;e[20]!==i?(y=i("sandbox.submoduleCredentialsField.addSubmoduleCredential"),e[20]=i,e[21]=y):y=e[21];let j;e[22]!==g||e[23]!==y?(j=t.jsxs(X,{type:"button",variant:"outline",size:"sm",onClick:g,className:"w-full",children:[b,y]}),e[22]=g,e[23]=y,e[24]=j):j=e[24];let v;e[25]!==u||e[26]!==n?(v=u!==null?t.jsx(Mr,{onClose:()=>p(null),onSaved:S=>{n.setValue(`${a}.${u}.secretId`,S,{shouldDirty:!0,shouldTouch:!0}),p(null)}}):null,e[25]=u,e[26]=n,e[27]=v):v=e[27];let N;return e[28]!==h||e[29]!==j||e[30]!==v?(N=t.jsxs("div",{className:"space-y-2",children:[h,j,v]}),e[28]=h,e[29]=j,e[30]=v,e[31]=N):N=e[31],N}function Cr(l){const e=W.c(48),{index:s,control:n,fieldPath:i,secrets:a,secretById:d,onCreateNewSecret:r,onRemove:x}=l,o=q(),f=`${i}.${s}.host`,m=`${i}.${s}.secretId`;let u;e[0]!==s||e[1]!==o?(u=I=>{const{field:$}=I,A=($.value??"").trim(),Y=A.length>0&&!Qs.test(A);return t.jsxs("div",{className:"space-y-1",children:[t.jsx(Se,{...$,value:$.value??"",placeholder:o("sandbox.submoduleCredentialsField.hostPlaceholder"),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",className:ue("font-mono",Y&&"border-destructive focus-visible:ring-destructive"),"aria-invalid":Y,"aria-label":o("sandbox.submoduleCredentialsField.hostAriaLabel",{index:s+1}),onBlur:K=>{$.onChange(K.target.value.trim()),$.onBlur()}}),Y?t.jsx("p",{className:"text-[11px] text-destructive",children:o("sandbox.submoduleCredentialsField.hostInvalidMessage")}):null]})},e[0]=s,e[1]=o,e[2]=u):u=e[2];let p;e[3]!==n||e[4]!==f||e[5]!==u?(p=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(fe,{control:n,name:f,render:u})}),e[3]=n,e[4]=f,e[5]=u,e[6]=p):p=e[6];let c;e[7]!==d||e[8]!==a||e[9]!==o?(c=I=>{const{field:$}=I;return t.jsxs(De,{value:$.value||"",onValueChange:A=>$.onChange(A),children:[t.jsx(Me,{className:ue("h-9 w-full",!$.value&&"text-muted-foreground"),children:t.jsx(_e,{placeholder:o("sandbox.submoduleCredentialsField.pickSecretPlaceholder"),children:t.jsx(fn,{field:$,secretById:d})})}),t.jsx(Te,{children:a.length===0?t.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:o("sandbox.submoduleCredentialsField.noSecretsYet")}):a.map(kr)})]})},e[7]=d,e[8]=a,e[9]=o,e[10]=c):c=e[10];let h;e[11]!==n||e[12]!==m||e[13]!==c?(h=t.jsx(fe,{control:n,name:m,render:c}),e[11]=n,e[12]=m,e[13]=c,e[14]=h):h=e[14];let g;e[15]!==o?(g=o("sandbox.submoduleCredentialsField.createNewSecretAriaLabel"),e[15]=o,e[16]=g):g=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Pe,{className:"size-3.5"}),e[17]=b):b=e[17];let y;e[18]!==r||e[19]!==g?(y=t.jsx(ye,{asChild:!0,children:t.jsx(X,{type:"button",variant:"ghost",size:"icon","aria-label":g,onClick:r,children:b})}),e[18]=r,e[19]=g,e[20]=y):y=e[20];let j;e[21]!==o?(j=o("sandbox.submoduleCredentialsField.createNewSecret"),e[21]=o,e[22]=j):j=e[22];let v;e[23]!==j?(v=t.jsx(we,{children:j}),e[23]=j,e[24]=v):v=e[24];let N;e[25]!==y||e[26]!==v?(N=t.jsxs(je,{children:[y,v]}),e[25]=y,e[26]=v,e[27]=N):N=e[27];let S;e[28]!==N||e[29]!==h?(S=t.jsxs("div",{className:"flex flex-[2] min-w-0 items-center gap-1",children:[h,N]}),e[28]=N,e[29]=h,e[30]=S):S=e[30];let M;e[31]!==o?(M=o("sandbox.submoduleCredentialsField.removeAriaLabel"),e[31]=o,e[32]=M):M=e[32];let w;e[33]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(nt,{className:"size-3.5"}),e[33]=w):w=e[33];let k;e[34]!==x||e[35]!==M?(k=t.jsx(ye,{asChild:!0,children:t.jsx(X,{type:"button",variant:"ghost",size:"icon","aria-label":M,onClick:x,children:w})}),e[34]=x,e[35]=M,e[36]=k):k=e[36];let C;e[37]!==o?(C=o("sandbox.submoduleCredentialsField.remove"),e[37]=o,e[38]=C):C=e[38];let _;e[39]!==C?(_=t.jsx(we,{children:C}),e[39]=C,e[40]=_):_=e[40];let D;e[41]!==k||e[42]!==_?(D=t.jsx("div",{className:"flex shrink-0 items-center gap-1",children:t.jsxs(je,{children:[k,_]})}),e[41]=k,e[42]=_,e[43]=D):D=e[43];let P;return e[44]!==S||e[45]!==D||e[46]!==p?(P=t.jsxs("div",{className:"flex flex-col gap-2 p-2 sm:flex-row sm:items-center",children:[p,S,D]}),e[44]=S,e[45]=D,e[46]=p,e[47]=P):P=e[47],P}function kr(l){return t.jsx(pe,{value:l.id,children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(Wt,{scope:l.scope}),t.jsx("span",{className:"font-mono",children:l.name})]})},l.id)}function Mr({onClose:l,onSaved:e}){const s=q(),[n,i]=U.useState(""),[a,d]=U.useState("organization"),[r,x]=U.useState(""),[o,f]=U.useState(""),m=tn(),u=n.trim(),p=r.length>0&&u.length>0&&mn.test(u),c=async h=>{if(h.preventDefault(),!!p)try{const g=await m.mutateAsync({scope:a,name:u,value:r,description:o.trim()||void 0});ie.success(s("sandbox.submoduleCredentialsField.secretSaved",{name:g.name})),e(g.id)}catch(g){ie.error(g instanceof Error?g.message:s("sandbox.submoduleCredentialsField.failedToSaveSecret"))}};return t.jsx(qe,{open:!0,onOpenChange:h=>{h||l()},children:t.jsxs(Qe,{className:"sm:max-w-md",children:[t.jsxs(at,{children:[t.jsx(rt,{children:s("sandbox.submoduleCredentialsField.createNewSecretTitle")}),t.jsx(Ps,{children:s("sandbox.submoduleCredentialsField.createNewSecretDescription")})]}),t.jsxs("form",{onSubmit:c,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(me,{htmlFor:"submodule-secret-scope",children:s("sandbox.submoduleCredentialsField.scopeLabel")}),t.jsxs(De,{value:a,onValueChange:h=>d(h),children:[t.jsx(Me,{id:"submodule-secret-scope",children:t.jsx(_e,{})}),t.jsxs(Te,{children:[t.jsx(pe,{value:"organization",children:s("sandbox.submoduleCredentialsField.scopeOrganization")}),t.jsx(pe,{value:"user",children:s("sandbox.submoduleCredentialsField.scopePrivate")})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(me,{htmlFor:"submodule-secret-name",children:s("sandbox.submoduleCredentialsField.nameLabel")}),t.jsx(Se,{id:"submodule-secret-name",value:n,onChange:h=>i(h.target.value),placeholder:s("sandbox.submoduleCredentialsField.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("sandbox.submoduleCredentialsField.nameHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(me,{htmlFor:"submodule-secret-value",children:s("sandbox.submoduleCredentialsField.tokenLabel")}),t.jsx(Se,{id:"submodule-secret-value",type:"password",value:r,onChange:h=>x(h.target.value),placeholder:s("sandbox.submoduleCredentialsField.tokenPlaceholder"),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(me,{htmlFor:"submodule-secret-description",children:s("sandbox.submoduleCredentialsField.descriptionLabel")}),t.jsx(pt,{id:"submodule-secret-description",value:o,onChange:h=>f(h.target.value),rows:2,placeholder:s("sandbox.submoduleCredentialsField.descriptionPlaceholder")})]}),t.jsxs($t,{children:[t.jsx(X,{type:"button",variant:"outline",onClick:l,disabled:m.isPending,children:s("sandbox.submoduleCredentialsField.cancel")}),t.jsx(X,{type:"submit",disabled:!p||m.isPending,children:m.isPending?s("sandbox.submoduleCredentialsField.saving"):s("sandbox.submoduleCredentialsField.saveSecret")})]})]})]})})}function _r(l){const e=W.c(21),{repo:s,className:n}=l,i=q();let a;e[0]!==n?(a=ue("space-y-2",n),e[0]=n,e[1]=a):a=e[1];let d;e[2]!==i?(d=i("sandbox.repoRow.label"),e[2]=i,e[3]=d):d=e[3];let r;e[4]!==d?(r=t.jsx(me,{children:d}),e[4]=d,e[5]=r):r=e[5];let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(vl,{size:20,className:"shrink-0 text-foreground/60"}),e[6]=x):x=e[6];let o;e[7]!==s||e[8]!==i?(o=t.jsx(ye,{asChild:!0,children:t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-background px-4 py-3",tabIndex:0,children:[x,t.jsx("div",{className:"min-w-0 flex-1",children:s?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"truncate text-sm font-medium",children:[s.owner,"/",s.name]}),t.jsx("div",{className:"truncate text-xs text-muted-foreground",children:s.url})]}):t.jsx("div",{className:"text-sm text-muted-foreground",children:i("sandbox.repoRow.noRepositoryConnected")})})]})}),e[7]=s,e[8]=i,e[9]=o):o=e[9];let f;e[10]!==i?(f=i("sandbox.repoRow.tooltipContent"),e[10]=i,e[11]=f):f=e[11];let m;e[12]!==f?(m=t.jsx(we,{children:f}),e[12]=f,e[13]=m):m=e[13];let u;e[14]!==o||e[15]!==m?(u=t.jsxs(je,{children:[o,m]}),e[14]=o,e[15]=m,e[16]=u):u=e[16];let p;return e[17]!==a||e[18]!==r||e[19]!==u?(p=t.jsxs("div",{className:a,children:[r,u]}),e[17]=a,e[18]=r,e[19]=u,e[20]=p):p=e[20],p}const Tr={npm:{install:"npm install",run:l=>`npm run ${l}`,runtime:"node"},pnpm:{install:"pnpm install",run:l=>`pnpm run ${l}`,runtime:"node"},yarn:{install:"yarn install",run:l=>`yarn run ${l}`,runtime:"node"},bun:{install:"bun install",run:l=>`bun run ${l}`,runtime:"bun"},deno:{install:"deno install",run:l=>`deno task ${l}`,runtime:"deno"}};function Dr(l){const e=l.trim();if(e==="")return{ok:!0,value:null};if(!/^\d+$/.test(e))return{ok:!1};const s=Number(e);return s<1||s>65535?{ok:!1}:{ok:!0,value:String(s)}}const Vr=Object.keys(Tr),Tt="__none__";function Ir(l){const e=W.c(47),{control:s}=l,n=q(),i=U.useRef(null);let a;e[0]!==n?(a=n("sandbox.runtimeFields.packageManager"),e[0]=n,e[1]=a):a=e[1];let d;e[2]!==a?(d=t.jsx(me,{htmlFor:"runtime-pm",children:a}),e[2]=a,e[3]=d):d=e[3];let r;e[4]!==n?(r=w=>{const{field:k}=w;return t.jsxs(De,{value:k.value??Tt,onValueChange:C=>k.onChange(C===Tt?null:C),children:[t.jsx(Me,{id:"runtime-pm",children:t.jsx(_e,{placeholder:n("sandbox.runtimeFields.autoDetect")})}),t.jsxs(Te,{children:[t.jsx(pe,{value:Tt,children:n("sandbox.runtimeFields.autoDetect")}),Vr.map(Or)]})]})},e[4]=n,e[5]=r):r=e[5];let x;e[6]!==s||e[7]!==r?(x=t.jsx(fe,{control:s,name:"metadata.runtime.selected",render:r}),e[6]=s,e[7]=r,e[8]=x):x=e[8];let o;e[9]!==d||e[10]!==x?(o=t.jsxs("div",{className:"space-y-2",children:[d,x]}),e[9]=d,e[10]=x,e[11]=o):o=e[11];let f;e[12]!==n?(f=n("sandbox.runtimeFields.packagePath"),e[12]=n,e[13]=f):f=e[13];let m;e[14]!==f?(m=t.jsx(me,{htmlFor:"runtime-path",children:f}),e[14]=f,e[15]=m):m=e[15];let u;e[16]!==s?(u=t.jsx(fe,{control:s,name:"metadata.runtime.path",render:Ar}),e[16]=s,e[17]=u):u=e[17];let p;e[18]!==n?(p=n("sandbox.runtimeFields.packagePathDescription"),e[18]=n,e[19]=p):p=e[19];let c;e[20]!==p?(c=t.jsx("p",{className:"text-xs text-muted-foreground",children:p}),e[20]=p,e[21]=c):c=e[21];let h;e[22]!==c||e[23]!==m||e[24]!==u?(h=t.jsxs("div",{className:"space-y-2",children:[m,u,c]}),e[22]=c,e[23]=m,e[24]=u,e[25]=h):h=e[25];let g;e[26]!==n?(g=n("sandbox.runtimeFields.devServerPort"),e[26]=n,e[27]=g):g=e[27];let b;e[28]!==g?(b=t.jsx(me,{htmlFor:"runtime-port",children:g}),e[28]=g,e[29]=b):b=e[29];let y;e[30]!==n?(y=w=>{const{field:k}=w;return t.jsx(Se,{ref:i,id:"runtime-port",inputMode:"numeric",placeholder:n("sandbox.runtimeFields.auto"),defaultValue:k.value??"",onBlur:C=>{const _=Dr(C.target.value);_.ok?k.onChange(_.value):i.current&&(i.current.value=k.value??"")}})},e[30]=n,e[31]=y):y=e[31];let j;e[32]!==s||e[33]!==y?(j=t.jsx(fe,{control:s,name:"metadata.runtime.port",render:y}),e[32]=s,e[33]=y,e[34]=j):j=e[34];let v;e[35]!==n?(v=n("sandbox.runtimeFields.devServerPortDescription"),e[35]=n,e[36]=v):v=e[36];let N;e[37]!==v?(N=t.jsx("p",{className:"text-xs text-muted-foreground",children:v}),e[37]=v,e[38]=N):N=e[38];let S;e[39]!==b||e[40]!==j||e[41]!==N?(S=t.jsxs("div",{className:"space-y-2",children:[b,j,N]}),e[39]=b,e[40]=j,e[41]=N,e[42]=S):S=e[42];let M;return e[43]!==h||e[44]!==S||e[45]!==o?(M=t.jsxs("div",{className:"space-y-5",children:[o,h,S]}),e[43]=h,e[44]=S,e[45]=o,e[46]=M):M=e[46],M}function Ar(l){const{field:e}=l;return t.jsx(Se,{id:"runtime-path",placeholder:".",defaultValue:e.value??"",onBlur:s=>{const n=s.target.value.trim();e.onChange(n===""?null:n)}})}function Or(l){return t.jsx(pe,{value:l,children:l},l)}function Pr(l){const e=W.c(17),{control:s}=l,n=q();let i;e[0]!==n?(i=n("sandbox.previewServerUrlField.label"),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==i?(a=t.jsx(me,{htmlFor:"preview-server-url",children:i}),e[2]=i,e[3]=a):a=e[3];let d;e[4]!==n?(d=m=>{const{field:u}=m,p=u.value??"";return t.jsx(Se,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:n("sandbox.previewServerUrlField.placeholder"),value:p,onChange:c=>u.onChange(c.target.value===""?null:c.target.value),onBlur:()=>{u.onChange(bl(p)),u.onBlur()}})},e[4]=n,e[5]=d):d=e[5];let r;e[6]!==s||e[7]!==d?(r=t.jsx(fe,{control:s,name:"metadata.previewServerUrl",render:d}),e[6]=s,e[7]=d,e[8]=r):r=e[8];let x;e[9]!==n?(x=n("sandbox.previewServerUrlField.description"),e[9]=n,e[10]=x):x=e[10];let o;e[11]!==x?(o=t.jsx("p",{className:"text-xs text-muted-foreground",children:x}),e[11]=x,e[12]=o):o=e[12];let f;return e[13]!==a||e[14]!==r||e[15]!==o?(f=t.jsxs("div",{className:"space-y-2",children:[a,r,o]}),e[13]=a,e[14]=r,e[15]=o,e[16]=f):f=e[16],f}function $r(l){const e=W.c(5),{control:s}=l,n=q();let i;e[0]!==n?(i=d=>{const{field:r}=d;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(me,{htmlFor:"field-description-tooltips",className:"font-normal text-foreground",children:n("sandbox.fieldDescriptionTooltipsField.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.fieldDescriptionTooltipsField.description")})]}),t.jsx(yt,{id:"field-description-tooltips",className:"shrink-0",checked:r.value??!1,onCheckedChange:x=>r.onChange(x)})]})},e[0]=n,e[1]=i):i=e[1];let a;return e[2]!==s||e[3]!==i?(a=t.jsx(fe,{control:s,name:"metadata.fieldDescriptionTooltips",render:i}),e[2]=s,e[3]=i,e[4]=a):a=e[4],a}function Fr(l){const e=W.c(8),{control:s,previewServerUrl:n}=l,i=q();let a;e[0]!==n?(a=jl(n),e[0]=n,e[1]=a):a=e[1];const d=!!a;let r;e[2]!==d||e[3]!==i?(r=o=>{const{field:f}=o;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(me,{htmlFor:"fast-preview",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreview.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i(d?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(yt,{id:"fast-preview",className:"shrink-0",checked:!!f.value&&d,disabled:!d,onCheckedChange:m=>f.onChange(m)})]})},e[2]=d,e[3]=i,e[4]=r):r=e[4];let x;return e[5]!==s||e[6]!==r?(x=t.jsx(fe,{control:s,name:"metadata.fastPreview",render:r}),e[5]=s,e[6]=r,e[7]=x):x=e[7],x}function Er(l){const e=W.c(5),{control:s,fastPreview:n}=l,i=q();if(!n)return null;let a;e[0]!==i?(a=r=>{const{field:x}=r;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(me,{htmlFor:"fast-preview-in-place",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.description")})]}),t.jsx(yt,{id:"fast-preview-in-place",className:"shrink-0",checked:!!x.value,onCheckedChange:o=>x.onChange(o)})]})},e[0]=i,e[1]=a):a=e[1];let d;return e[2]!==s||e[3]!==a?(d=t.jsx(fe,{control:s,name:"metadata.fastPreviewInPlace",render:a}),e[2]=s,e[3]=a,e[4]=d):d=e[4],d}function zr(l){const e=W.c(32),{control:s,onCommit:n}=l,i=q();let a;e[0]!==i?(a=i("virtualMcp.virtualMcp.publishPolicySmart"),e[0]=i,e[1]=a):a=e[1];let d;e[2]!==i?(d=i("virtualMcp.virtualMcp.publishPolicySmartDescription"),e[2]=i,e[3]=d):d=e[3];let r;e[4]!==a||e[5]!==d?(r={value:"smart",label:a,description:d},e[4]=a,e[5]=d,e[6]=r):r=e[6];let x;e[7]!==i?(x=i("virtualMcp.virtualMcp.publishPolicyCodeReview"),e[7]=i,e[8]=x):x=e[8];let o;e[9]!==i?(o=i("virtualMcp.virtualMcp.publishPolicyCodeReviewDescription"),e[9]=i,e[10]=o):o=e[10];let f;e[11]!==x||e[12]!==o?(f={value:"code-review",label:x,description:o},e[11]=x,e[12]=o,e[13]=f):f=e[13];let m;e[14]!==i?(m=i("virtualMcp.virtualMcp.publishPolicyOpen"),e[14]=i,e[15]=m):m=e[15];let u;e[16]!==i?(u=i("virtualMcp.virtualMcp.publishPolicyOpenDescription"),e[16]=i,e[17]=u):u=e[17];let p;e[18]!==m||e[19]!==u?(p={value:"open",label:m,description:u},e[18]=m,e[19]=u,e[20]=p):p=e[20];let c;e[21]!==r||e[22]!==f||e[23]!==p?(c=[r,f,p],e[21]=r,e[22]=f,e[23]=p,e[24]=c):c=e[24];const h=c;let g;e[25]!==n||e[26]!==h||e[27]!==i?(g=y=>{const{field:j}=y,v=j.value??"smart";return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(me,{htmlFor:"publish-policy",className:"font-normal text-foreground",children:i("virtualMcp.virtualMcp.publishing")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("virtualMcp.virtualMcp.publishingDescription")})]}),t.jsxs(De,{value:v,onValueChange:N=>{j.onChange(N),n()},children:[t.jsx(Me,{id:"publish-policy",className:"w-44 shrink-0 text-sm",children:t.jsx(_e,{})}),t.jsx(Te,{className:"max-w-80",children:h.map(Rr)})]})]})},e[25]=n,e[26]=h,e[27]=i,e[28]=g):g=e[28];let b;return e[29]!==s||e[30]!==g?(b=t.jsx(fe,{name:"metadata.publishPolicy",control:s,render:g}),e[29]=s,e[30]=g,e[31]=b):b=e[31],b}function Rr(l){return t.jsx(pe,{value:l.value,description:l.description,children:l.label},l.value)}function Lr(l){const e=W.c(24),{control:s,onCommit:n}=l,i=q();let a;e[0]!==i?(a=i("sandbox.cmsSettings.contentEditing.off"),e[0]=i,e[1]=a):a=e[1];let d;e[2]!==i?(d=i("sandbox.cmsSettings.contentEditing.offDescription"),e[2]=i,e[3]=d):d=e[3];let r;e[4]!==a||e[5]!==d?(r={value:"off",label:a,description:d},e[4]=a,e[5]=d,e[6]=r):r=e[6];let x;e[7]!==i?(x=i("sandbox.cmsSettings.contentEditing.on"),e[7]=i,e[8]=x):x=e[8];let o;e[9]!==i?(o=i("sandbox.cmsSettings.contentEditing.onDescription"),e[9]=i,e[10]=o):o=e[10];let f;e[11]!==x||e[12]!==o?(f={value:"on",label:x,description:o},e[11]=x,e[12]=o,e[13]=f):f=e[13];let m;e[14]!==r||e[15]!==f?(m=[r,f],e[14]=r,e[15]=f,e[16]=m):m=e[16];const u=m;let p;e[17]!==n||e[18]!==u||e[19]!==i?(p=h=>{const{field:g}=h,b=g.value??null,y=Xs(b);return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(me,{htmlFor:"content-editing-mode",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.contentEditing.title")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.contentEditing.description")})]}),t.jsxs(De,{value:y,onValueChange:j=>{const v=rl.safeParse(j);v.success&&(g.onChange(ol(b,v.data)),n())},children:[t.jsx(Me,{id:"content-editing-mode",className:"w-44 shrink-0 text-sm",children:t.jsx(_e,{})}),t.jsx(Te,{className:"max-w-80",children:u.map(Br)})]})]})},e[17]=n,e[18]=u,e[19]=i,e[20]=p):p=e[20];let c;return e[21]!==s||e[22]!==p?(c=t.jsx(fe,{name:"metadata.ui.layout",control:s,render:p}),e[21]=s,e[22]=p,e[23]=c):c=e[23],c}function Br(l){return t.jsx(pe,{value:l.value,description:l.description,children:l.label},l.value)}function Ns(l){const e=l.metadata?.sidebarViews,s=l.metadata?.sidebarViewsVersion;return{effectiveViews:[...It(At(l.metadata),s)],rawViews:e===null?null:e?[...e]:void 0,version:s}}function Ur(l,e){return l===e?!0:!l||!e||l.length!==e.length?!1:l.every((s,n)=>s===e[n])}function Yr(l,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...l,shareDialogOpen:e.payload};case"SET_ADD_DIALOG_OPEN":return{...l,addDialogOpen:e.payload};case"OPEN_SETTINGS":return{...l,settingsDialogOpen:!0,settingsConnectionId:e.payload};case"CLOSE_SETTINGS":return{...l,settingsDialogOpen:!1,settingsConnectionId:null};default:return l}}function Kr(l,e){switch(e.type){case"accumulate":{const s=l??{start:e.now,fields:new Set,saveCount:0,instructionsLength:null},n=new Set(s.fields);for(const i of e.fields)n.add(i);return{...s,fields:n,saveCount:s.saveCount+1,instructionsLength:e.instructionsLength??s.instructionsLength}}case"reset":return null}}function Wr(l){const e=l.metadata?.runtime?.env;if(!e||e.length===0)return l;const s=e.filter(n=>{if(!n||typeof n!="object")return!1;const i=(n.key??"").trim();return!i||!wt.test(i)?!1:n.kind==="literal"?!0:n.kind==="secret"?!!n.secretId:!1});return s.length===e.length?l:{...l,metadata:{...l.metadata,runtime:{...l.metadata?.runtime??{},env:s}}}}function Gr(l){const e=l.metadata?.runtime?.submoduleCredentials;if(!e||e.length===0)return l;const s=e.filter(n=>{if(!n||typeof n!="object")return!1;const i=(n.host??"").trim();return!i||!Qs.test(i)?!1:!!n.secretId});return s.length===e.length?l:{...l,metadata:{...l.metadata,runtime:{...l.metadata?.runtime??{},submoduleCredentials:s}}}}async function Hr(l,e){const s=l?.idToken??null;if(s){const i=Cs(s);if(i)return i}const n=l?.userinfoEndpoint??null;if(n)try{const i=await fetch(n,{headers:{Authorization:`Bearer ${e}`}});if(i.ok){const a=await i.json(),d=typeof a.email=="string"?a.email:typeof a.upn=="string"?a.upn:typeof a.preferred_username=="string"?a.preferred_username:null;if(d)return d}}catch{}return Cs(e)}function Cs(l){try{const e=l.split(".");if(e.length===3&&e[1]){const s=JSON.parse(atob(e[1].replace(/-/g,"+").replace(/_/g,"/")));if(typeof s.email=="string")return s.email;if(typeof s.upn=="string")return s.upn;if(typeof s.preferred_username=="string")return s.preferred_username}}catch{}return null}function qr({virtualMcp:l,hideOwnTitle:e}){const s=q(),n=Yn(),{org:i}=$e(),a=Os(),{data:d}=Gn([l.id]),r=d?.get(l.id)?.last_used_at,x=Vs(),o=In(),f=vt(),m=qs(l.id),u=JSON.stringify([i.id,l.id]),p=Xi(l.metadata,m.snapshot()),c=An({resolver:On(Xa),defaultValues:{...l,metadata:{...us(l.metadata),previewServerUrl:yl(l.metadata),...p}}}),h=c.watch("connections"),g=Li(l),b=ht(l?.metadata),y=b&&Xs(c.watch("metadata.ui.layout"))==="off",j=Zs(l),v=j?{owner:j.owner,name:j.name,url:j.url}:null,[N,S]=U.useReducer(Yr,{shareDialogOpen:!1,addDialogOpen:!1,settingsDialogOpen:!1,settingsConnectionId:null}),[M,w]=U.useState(!1),[k,C]=U.useState(!1),{createNewTask:_,openSidePanel:D}=Ln(),{sendMessage:P}=Fn(),I=async()=>{if(k)return;const V=c.getValues("metadata.instructions");if(V?.trim()){C(!0);try{R(),ve("agent_instructions_improve_clicked",{agent_id:l.id,instructions_length:V.length}),D();const ee=Pn(i.id);await P({tiptapDoc:zn({managerAgentId:ee.id,managerName:ee.title,kind:"agent",id:l.id,instructions:V})})}finally{C(!1)}}},$=()=>{R(),ve("agent_test_clicked",{agent_id:l.id}),_()},[A,Y]=U.useReducer(Kr,null),K=()=>{A!==null&&(ve("agent_updated",{agent_id:l.id,fields:Array.from(A.fields),instructions_length:A.instructionsLength,save_count:A.saveCount,edit_duration_ms:Date.now()-A.start}),Y({type:"reset"}))},{schedule:Q,flush:R}=ns({delayMs:3e4,save:async()=>K()}),H=async()=>{const V=m.snapshot(),ee={predicate:Ve=>cs(Ve.queryKey,i.id)},Z=async()=>(await o.invalidateQueries({predicate:Ve=>cs(Ve.queryKey,i.id),refetchType:"all"}),os(o,i.id,l.id)),ce=(Ve,Ke)=>{if(Ve){Ur(c.getValues("metadata.sidebarViews"),Ve.rawViews)||c.setValue("metadata.sidebarViews",Ve.rawViews,{shouldDirty:!1}),c.getValues("metadata.sidebarViewsVersion")!==Ve.version&&c.setValue("metadata.sidebarViewsVersion",Ve.version,{shouldDirty:!1});return}Ke!==null&&(c.setValue("metadata.sidebarViews",[...Ke],{shouldDirty:!1}),c.setValue("metadata.sidebarViewsVersion",qi,{shouldDirty:!1}))},ke=Ji(V),Ae=Object.keys(c.control._formState.dirtyFields);if(Ae.length===0&&!ke){await m.settle({snapshot:V,saved:!0,authoritativeViews:V?.persistedViews});return}const Ue=Ae.length>0?Ae:["metadata"],dt=Ue.includes("metadata"),Ye=c.getValues();c.reset(Ye,{keepValues:!0});const Je=Gr(Wr(Ye)),pn=os(o,i.id,l.id),xn=Zi({sidebarViews:Je.metadata?.sidebarViews,sidebarViewsVersion:Je.metadata?.sidebarViewsVersion},V,pn?.metadata);Je.metadata={...us(Je.metadata),...xn};let Nt;try{Nt=await a.update.mutateAsync({id:l.id,data:Je})}catch(Ve){let Ke=null;try{Ke=await Z()}catch{}const qt=Ke?Ns(Ke):null,Qt=await m.settle({snapshot:V,saved:!1,authoritativeViews:qt?.effectiveViews});throw Qt.settledLatest&&ce(qt,Qt.reconciledViews),Ve}await o.cancelQueries(ee),el(o,i.id,Nt);const Gt=Ns(Nt),Ht=await m.settle({snapshot:V,saved:!0,authoritativeViews:Gt.effectiveViews});Ht.settledLatest&&ce(Gt,Ht.reconciledViews),Y({type:"accumulate",now:Date.now(),fields:Ue,instructionsLength:dt?Ye.metadata?.instructions?.length??0:null}),Q()},L=()=>wl(u,H),{schedule:T,flush:O}=ns({save:L});U.useEffect(()=>{const V=c.watch(()=>T());return()=>V.unsubscribe()},[]);const G=()=>{ve("connections_dialog_opened",{source:"agent_settings",mode:"add"}),S({type:"SET_ADD_DIALOG_OPEN",payload:!0})},z=async V=>{const ee=c.getValues("connections");if(ee.some(ke=>ke.connection_id===V))return;c.setValue("connections",[...ee,{connection_id:V,selected_tools:_t.tools,selected_resources:_t.resources,selected_prompts:_t.prompts}],{shouldDirty:!0}),S({type:"SET_ADD_DIALOG_OPEN",payload:!1});const Z=new URL(`/api/${i.slug}/mcp/${V}`,window.location.origin),ce=await Jt({url:Z.href,token:null,orgId:i.id});ce.supportsOAuth&&!ce.isAuthenticated&&await le(V)},F=V=>{const Z=c.getValues("connections").filter(ce=>ce.connection_id!==V);c.setValue("connections",Z,{shouldDirty:!0})},B=(V,ee)=>{const Z=c.getValues("connections");if(Z.some(ce=>ce.connection_id===ee)){ie.error(s("virtualMcp.virtualMcp.instanceAlreadyAdded"));return}c.setValue("connections",Z.map(ce=>ce.connection_id===V?{...ce,connection_id:ee}:ce),{shouldDirty:!0})},J=async V=>{if(c.getValues("connections").find(Z=>Z.connection_id===V))try{const{item:Z}=await f.call("COLLECTION_CONNECTIONS_GET",{id:V});if(!Z)return;const ce=Z.title.replace(/\s*\(.*?\)\s*$/,""),ke=$n("conn"),Ae=`${ce} (${Date.now().toString(36).slice(-4)})`;await x.create.mutateAsync({id:ke,title:Ae,description:Z.description??null,connection_type:Z.connection_type,connection_url:Z.connection_url??null,connection_token:null,icon:Z.icon??null,app_name:Z.app_name??null,app_id:Z.app_id??null,connection_headers:Z.connection_headers??null});const Ue=new URL(`/api/${i.slug}/mcp/${ke}`,window.location.origin),dt=await Jt({url:Ue.href,token:null,orgId:i.id});if(dt.supportsOAuth&&!dt.isAuthenticated){const Ye=await le(ke);if(!Ye){await x.delete.mutateAsync(ke);return}await x.update.mutateAsync({id:ke,data:{title:`${ce} (${Ye})`}})}B(V,ke),ie.success(s("virtualMcp.virtualMcp.newInstanceCreated"))}catch(Z){console.error("Failed to create instance:",Z),ie.error(s("virtualMcp.virtualMcp.failedToCreateInstance"))}},ne=V=>{S({type:"OPEN_SETTINGS",payload:V})},le=async V=>{const{token:ee,tokenInfo:Z,error:ce}=await Hn({connectionId:V,orgSlug:i.slug,scope:"offline_access"});if(ce||!ee)return ie.error(s("virtualMcp.virtualMcp.authenticationFailed",{error:ce??""})),null;if(Z)try{const Ae=await fetch(`/api/${i.slug}/connections/${V}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:Z.accessToken,refreshToken:Z.refreshToken,expiresIn:Z.expiresIn,scope:Z.scope,clientId:Z.clientId,clientSecret:Z.clientSecret,tokenEndpoint:Z.tokenEndpoint})});if(!Ae.ok)console.error("Failed to save OAuth token:",await Ae.text()),await x.update.mutateAsync({id:V,data:{connection_token:ee}});else try{await x.update.mutateAsync({id:V,data:{}})}catch(Ue){console.warn("Failed to refresh connection tools after OAuth:",Ue)}}catch(Ae){console.error("Error saving OAuth token:",Ae),await x.update.mutateAsync({id:V,data:{connection_token:ee}})}else await x.update.mutateAsync({id:V,data:{connection_token:ee}});const ke=new URL(`/api/${i.slug}/mcp/${V}`,window.location.origin);return await o.invalidateQueries({queryKey:Ms.isMCPAuthenticated(ke.href,null)}),ie.success(s("virtualMcp.virtualMcp.authenticationSuccessful")),Hr(Z,ee)},de=()=>{const V=c.getValues("metadata.instructions")??"",ee=s("virtualMcp.virtualMcp.promptTemplateContent"),Z=V.trim()?`${V}
|
|
4
4
|
|