decocms 4.400.2 → 4.400.3
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-CjR0jbo6.js → AlertCircle-Du4pSpAv.js} +1 -1
- package/dist/client/assets/{AreaChart-BpfOJteO.js → AreaChart-CiSqbcrG.js} +1 -1
- package/dist/client/assets/{ArrowLeft-C4QBkomm.js → ArrowLeft-DcYtirf0.js} +1 -1
- package/dist/client/assets/{ArrowRight-CO-QujUS.js → ArrowRight-pEyu9bR7.js} +1 -1
- package/dist/client/assets/{ArrowUp-C9wr8Ytd.js → ArrowUp-Blhz95Gn.js} +1 -1
- package/dist/client/assets/{CartesianChart-CJ8doy_0.js → CartesianChart-dXKJjRS4.js} +1 -1
- package/dist/client/assets/{Check-DFrsPmld.js → Check-Ba60y41Y.js} +1 -1
- package/dist/client/assets/{CheckCircle-DkaKMSaV.js → CheckCircle-C7_LF2ru.js} +1 -1
- package/dist/client/assets/{ChevronUp-C9udc4Rh.js → ChevronUp-BKTM5kuE.js} +1 -1
- package/dist/client/assets/{Copy01-M-Qbz3gf.js → Copy01-ps1GrLwt.js} +1 -1
- package/dist/client/assets/{CreditCard01-CET8MOTL.js → CreditCard01-w7TsTZTh.js} +1 -1
- package/dist/client/assets/{DotsVertical-CZz-Lgk0.js → DotsVertical-CIifNiXH.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-D7-uOZDe.js → ErrorBarContext-Ca7MYjqG.js} +1 -1
- package/dist/client/assets/{Eye-CmvlR53w.js → Eye-BYwRB-B7.js} +1 -1
- package/dist/client/assets/{Globe04-Bc5TMhQV.js → Globe04-DUA_rKwg.js} +1 -1
- package/dist/client/assets/{Image01-wp07hfou.js → Image01-4eEp4rFk.js} +1 -1
- package/dist/client/assets/{Key01-hC0wHiG0.js → Key01-DFcPORPA.js} +1 -1
- package/dist/client/assets/{LayoutLeft-B4wEmr_x.js → LayoutLeft-DTet0kcn.js} +1 -1
- package/dist/client/assets/{Line-BSb7Wgn6.js → Line-B9GJKKk8.js} +1 -1
- package/dist/client/assets/{Link01-Ba4lmYHC.js → Link01-Bk8fUFT0.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BVl3Qea8.js → LinkExternal01-Sd40C2OB.js} +1 -1
- package/dist/client/assets/{Monitor01-d780LsKL.js → Monitor01-D7UgaQLg.js} +1 -1
- package/dist/client/assets/{Palette-C0NdvAWe.js → Palette-BH_QIJDy.js} +1 -1
- package/dist/client/assets/{Plus-CPtri1YM.js → Plus-C1bAoYy_.js} +1 -1
- package/dist/client/assets/{SearchMd-DoMlo04D.js → SearchMd-Bo9C0lON.js} +1 -1
- package/dist/client/assets/{Sector-Cvf-vWo6.js → Sector-DEbCB-Fv.js} +1 -1
- package/dist/client/assets/{Share07-ChCo_3pm.js → Share07-BB--BXeq.js} +1 -1
- package/dist/client/assets/{Sun-BsNGpGdi.js → Sun-Bs_C-u75.js} +1 -1
- package/dist/client/assets/{Tool01-BWmyIYi9.js → Tool01-rptoyApF.js} +1 -1
- package/dist/client/assets/{Trash01-D0sFCEiI.js → Trash01-8P2mehkt.js} +1 -1
- package/dist/client/assets/{Upload01-CQkdN0Jy.js → Upload01-Do_51Ot8.js} +1 -1
- package/dist/client/assets/{User01-DFmvr7oB.js → User01-CI_nGvGi.js} +1 -1
- package/dist/client/assets/{UserSquare-DFFgBLK6.js → UserSquare-C3h8vlGA.js} +1 -1
- package/dist/client/assets/{Users01-aZvr1NAJ.js → Users01-C8Fu7mYo.js} +1 -1
- package/dist/client/assets/{X-B3oYr7cv.js → X-Bcv3LM3l.js} +1 -1
- package/dist/client/assets/{XClose-DNumy7PJ.js → XClose-CtU5_ALA.js} +1 -1
- package/dist/client/assets/{Zap-BrtBHXca.js → Zap-qz4zBbkB.js} +1 -1
- package/dist/client/assets/{ZoomOut-6YH0qddF.js → ZoomOut-zpocZpUK.js} +1 -1
- package/dist/client/assets/{access-gate-CYUJEAks.js → access-gate-CiVrL403.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-De7olvO-.js → add-connection-dialog-BzI23RxL.js} +1 -1
- package/dist/client/assets/{agent-analytics-D7Zc1x5W.js → agent-analytics-B1tZQzMk.js} +1 -1
- package/dist/client/assets/agent-app-B3MxCldN.js +1 -0
- package/dist/client/assets/{agent-assets-DHjCRHxb.js → agent-assets-CZouYsdD.js} +1 -1
- package/dist/client/assets/{agent-automation-CLSKICib.js → agent-automation-BLN1e9Ev.js} +1 -1
- package/dist/client/assets/{agent-automations--KFfqpWc.js → agent-automations-bCgj1j-q.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-BGMEzb-f.js → agent-connect-sources-C7Po5wAa.js} +1 -1
- package/dist/client/assets/agent-deck-Cy04ayNG.js +1 -0
- package/dist/client/assets/{agent-e2e-CCHklzrp.js → agent-e2e-CmbIB2x8.js} +1 -1
- package/dist/client/assets/{agent-experiments-BotZZr4y.js → agent-experiments-OLYKC4u_.js} +1 -1
- package/dist/client/assets/{agent-file-CMP_vdw7.js → agent-file-B38Wl098.js} +1 -1
- package/dist/client/assets/{agent-git-DnfvB7FV.js → agent-git-CaQBqGlA.js} +1 -1
- package/dist/client/assets/{agent-hosting-dgU5s3Ec.js → agent-hosting-6MngD0LX.js} +1 -1
- package/dist/client/assets/{agent-icon-Cp4E_xly.js → agent-icon-DGZEAm9H.js} +1 -1
- package/dist/client/assets/agent-library-file-9QARO-bV.js +1 -0
- package/dist/client/assets/{agent-monitor-C4YirXew.js → agent-monitor-72mCRKTW.js} +1 -1
- package/dist/client/assets/{agent-overview-DnRfrqp_.js → agent-overview-BRrvELfN.js} +1 -1
- package/dist/client/assets/agent-settings-B45Tva6q.js +1 -0
- package/dist/client/assets/{agent-site-editor-BdbcwfRG.js → agent-site-editor-DW5XUZBR.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-Dc0KTnfl.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-DYLP578B.js → agent-site-editor-content-Bfjh9jEP.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-S2scoPmE.js → agent-site-editor-preview-ClmKTXWP.js} +3 -3
- package/dist/client/assets/agent-view-E9Z6tVHT.js +1 -0
- package/dist/client/assets/{agent-view-guard-B9Saq62j.js → agent-view-guard-DNMt6hB9.js} +1 -1
- package/dist/client/assets/{agents-list-DiFE-lZH.js → agents-list-BiiHiUIX.js} +1 -1
- package/dist/client/assets/{ai-providers-GgLnqqlt.js → ai-providers-BbDwb4RC.js} +1 -1
- package/dist/client/assets/{alert-DdmTPGDH.js → alert-BT3DZGcd.js} +1 -1
- package/dist/client/assets/{alert-dialog-DoyFdZHN.js → alert-dialog-DdszU1Q8.js} +1 -1
- package/dist/client/assets/{analytics-sections-DCg5oZNj.js → analytics-sections-CP__jLKC.js} +1 -1
- package/dist/client/assets/{api-keys-BKMKOatf.js → api-keys-Bi20vSIr.js} +1 -1
- package/dist/client/assets/api-keys-CBbsEXT6.js +1 -0
- package/dist/client/assets/app-editor-DFT4OeOU.js +1 -0
- package/dist/client/assets/{asset-utils-BCU6QgjZ.js → asset-utils-V9a2iXcl.js} +1 -1
- package/dist/client/assets/{auth-Dt4n2Wsi.js → auth-D02289MQ.js} +1 -1
- package/dist/client/assets/{auth-catchall-7L9jbPi8.js → auth-catchall-CnUCowRF.js} +1 -1
- package/dist/client/assets/{auth-entry-CLqY4ktY.js → auth-entry-B6Imt7RP.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DLrakCFf.js → auth-split-layout-BM39R-ss.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CSMVo-ia.js → authenticate-and-persist-oauth-CUaGScsy.js} +1 -1
- package/dist/client/assets/{automation-list-row-6XDX4ayX.js → automation-list-row-C_wU39bN.js} +1 -1
- package/dist/client/assets/{automation-runs-DL5rnjPF.js → automation-runs-gGzA_gij.js} +1 -1
- package/dist/client/assets/{automations-CSUbh53r.js → automations-Ds2o11v2.js} +1 -1
- package/dist/client/assets/{autosend-ByHAtC6V.js → autosend-CK9dEzFq.js} +1 -1
- package/dist/client/assets/{avatar-C3Tu_Zj6.js → avatar-uHIhSuBR.js} +1 -1
- package/dist/client/assets/{badge-XWwRFC3r.js → badge-Dje3gf1p.js} +1 -1
- package/dist/client/assets/{block-document-BKWBdSF6.js → block-document-nl0VK8k6.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-Ce9beMIi.js → blocks-preview-workspace-context-ByxZatd9.js} +1 -1
- package/dist/client/assets/{breadcrumb-DOba6LNd.js → breadcrumb-CW_U1f5l.js} +1 -1
- package/dist/client/assets/{buckets-BnZszphk.js → buckets-K7ac08Io.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-ibi7y-L4.js → build-improve-prompt-doc-Be3oxc4K.js} +1 -1
- package/dist/client/assets/{calendar-oa3LVYaP.js → calendar-zfi9eY9-.js} +1 -1
- package/dist/client/assets/{capability-load-error-BQ6dL73y.js → capability-load-error-1O-8RPcj.js} +1 -1
- package/dist/client/assets/{category-editor-Bb9Ea3r2.js → category-editor-JZXHaZAD.js} +1 -1
- package/dist/client/assets/{chart-D_-n_mOy.js → chart-PoDZhw9M.js} +1 -1
- package/dist/client/assets/{chat-context-L1MRASS9.js → chat-context-DotjjaCp.js} +1 -1
- package/dist/client/assets/{chat-draft-KwQvcsg2.js → chat-draft-CBzBURYR.js} +1 -1
- package/dist/client/assets/{checkbox-BVJhs11j.js → checkbox-CfvRuAMT.js} +1 -1
- package/dist/client/assets/{choose-editor-Roightxs.js → choose-editor-B4cDrRN8.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-pHFRpav0.js → claim-phase-copy-CZOX9v-1.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BOhgxLXY.js → cli-auth-success-YJrrGRHq.js} +1 -1
- package/dist/client/assets/{client-icons-BSjpPHN5.js → client-icons-1o_GEzRa.js} +1 -1
- package/dist/client/assets/{collapsible-8SEpFSOn.js → collapsible-CWaDNcN7.js} +1 -1
- package/dist/client/assets/{collection-detail-CzK6vJzc.js → collection-detail-Y9XGw5uk.js} +1 -1
- package/dist/client/assets/{collection-display-button-D-1w-XGy.js → collection-display-button-CtP91jf_.js} +1 -1
- package/dist/client/assets/{collection-search-x5NjBCrj.js → collection-search-D4nNuGDB.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DVjXvmub.js → collection-table-wrapper-CpQI6KWA.js} +1 -1
- package/dist/client/assets/{collection-tabs-CZCjpmbY.js → collection-tabs-N5ZrSPpp.js} +1 -1
- package/dist/client/assets/{combobox-Dlk94eZR.js → combobox-CF1no6bs.js} +1 -1
- package/dist/client/assets/{command-B8JP2G8U.js → command-BiVTlFnj.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-QvAZIDGQ.js → companion-mcps-section-EeMQUH2t.js} +1 -1
- package/dist/client/assets/{connect-W_AV3Sjh.js → connect-CEfqFAa-.js} +1 -1
- package/dist/client/assets/{connect-layout-B7OpAPNE.js → connect-layout-bSD8-p4f.js} +1 -1
- package/dist/client/assets/{connection-D-mDjvm_.js → connection-DlXjaPva.js} +1 -1
- package/dist/client/assets/{connection-card-CaitKKPZ.js → connection-card-Bg2a8uYW.js} +1 -1
- package/dist/client/assets/{connection-detail-yXga0v5N.js → connection-detail-DYZF6SN6.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CmvLYSpO.js → connection-form-helpers-DxRjtFnW.js} +1 -1
- package/dist/client/assets/{connections-D66DvRYj.js → connections-d31mWpT0.js} +1 -1
- package/dist/client/assets/{context-Dmc79Bjt.js → context-pHGTWx-O.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DbTqX-AI.js → create-organization-dialog-DI50Lc6L.js} +1 -1
- package/dist/client/assets/{decofile-api-PWtXzbuE.js → decofile-api-DaDwlojk.js} +1 -1
- package/dist/client/assets/{decopilot-CifemqUY.js → decopilot-DTvNz-At.js} +1 -1
- package/dist/client/assets/{dialog-BqioEhMl.js → dialog-BH40cz5f.js} +1 -1
- package/dist/client/assets/{discover-Bogkif5H.js → discover-HHkbjmau.js} +1 -1
- package/dist/client/assets/{domain-settings-BSsQ-9XO.js → domain-settings-DSQl9_lZ.js} +1 -1
- package/dist/client/assets/{download-app-dialog-aA1UuFYE.js → download-app-dialog-CEaOvDw5.js} +1 -1
- package/dist/client/assets/{drawer-BZaHn3bO.js → drawer-ComjVvmu.js} +1 -1
- package/dist/client/assets/{editor-gYjyR8eY.js → editor-CDU1j3_v.js} +1 -1
- package/dist/client/assets/{empty-state-CR81vKzY.js → empty-state-CzIH_JfN.js} +1 -1
- package/dist/client/assets/{empty-state-FjX1LyDk.js → empty-state-DhesR7qU.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DvBFazbY.js → extract-connection-data-DcoB8kAN.js} +1 -1
- package/dist/client/assets/{feature-gate-BAKGOuXY.js → feature-gate-FDK7xSej.js} +1 -1
- package/dist/client/assets/{feature-paywall-B1a-HOxV.js → feature-paywall-C6d9OZKd.js} +1 -1
- package/dist/client/assets/{file-explorer-7KzmGVjW.js → file-explorer-BXabmYF9.js} +1 -1
- package/dist/client/assets/{file-preview-CXoo8BfO.js → file-preview-BqqyeGvl.js} +1 -1
- package/dist/client/assets/{file-share-button-BMoSgmCC.js → file-share-button-2fKS6cBb.js} +1 -1
- package/dist/client/assets/{file-type-icon-DMY2pV4u.js → file-type-icon-DmiRAgFN.js} +1 -1
- package/dist/client/assets/{folder-icon-CI4H2hRS.js → folder-icon-DV0QIqJi.js} +1 -1
- package/dist/client/assets/{form-Ck4HW1Sy.js → form-CjY4wPH4.js} +1 -1
- package/dist/client/assets/{gateway-client-DywCtAlN.js → gateway-client-BWWNYsvl.js} +1 -1
- package/dist/client/assets/{general-V198Ry8r.js → general-D8PFzFNL.js} +1 -1
- package/dist/client/assets/{github-icon-CGDk98ok.js → github-icon-gx8ml2Xw.js} +1 -1
- package/dist/client/assets/{home-COeYIIf9.js → home-C2ul5WwD.js} +1 -1
- package/dist/client/assets/{hooks-Cv8CIM3K.js → hooks-CKSmikgd.js} +1 -1
- package/dist/client/assets/{icon-button-oNpj712J.js → icon-button-DFsCDguQ.js} +1 -1
- package/dist/client/assets/{index-CtfYS4f5.js → index-6J38YLa6.js} +1 -1
- package/dist/client/assets/{index-DPUxWM-C.js → index-B4AAYpyy.js} +1 -1
- package/dist/client/assets/{index-_w4ZQAxQ.js → index-BLFJ3rNx.js} +1 -1
- package/dist/client/assets/{index-CyWkcQet.js → index-CENDMkD1.js} +1 -1
- package/dist/client/assets/{index-CAIstwHo.js → index-Chk6p6cb.js} +1 -1
- package/dist/client/assets/{index-BeWJyIso.js → index-D-Qb9EKo.js} +2 -2
- package/dist/client/assets/{index-CW-IFB5_.js → index-D1EGc2WB.js} +1 -1
- package/dist/client/assets/{index-41O0UWEj.js → index-D1bV74hn.js} +1 -1
- package/dist/client/assets/{index-TgWeXQUf.js → index-D4HiLeJ8.js} +1 -1
- package/dist/client/assets/{index-TSwFhtcK.js → index-DLkfdbgp.js} +1 -1
- package/dist/client/assets/{index-USkWpFB7.js → index-DS_YYP9T.js} +1 -1
- package/dist/client/assets/{index-00RLjR1H.js → index-UD8UKuoc.js} +1 -1
- package/dist/client/assets/{index-Drb5uyEG.js → index-o2BIgZ-C.js} +1 -1
- package/dist/client/assets/{index-CaaYe61j.js → index-otD7ZsOh.js} +1 -1
- package/dist/client/assets/{index-redirect-DgA5tbhV.js → index-redirect-CoYPdvGw.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BRgJRcdJ.js → infiniteQueryObserver-C_cLYrX6.js} +1 -1
- package/dist/client/assets/{infra-billing-DpGvy5Hy.js → infra-billing-EceXg4r1.js} +1 -1
- package/dist/client/assets/{input-DxJ9jgLK.js → input-C4BmyTe6.js} +1 -1
- package/dist/client/assets/{input-BBzVpV_5.js → input-CFISiTk-.js} +1 -1
- package/dist/client/assets/{input-Dg01qG2F.js → input-CuAG4MMc.js} +1 -1
- package/dist/client/assets/{integration-icon-CwQ6RDOp.js → integration-icon-jMu9bsqq.js} +1 -1
- package/dist/client/assets/{label-BXpXMxJB.js → label-BBoHKfq-.js} +1 -1
- package/dist/client/assets/{last-preview-page-BvPOyoPv.js → last-preview-page-DO0ob5Q_.js} +1 -1
- package/dist/client/assets/{layout-DiHZAWbl.js → layout-BB3neLR9.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-Dn8Ei_HV.js → legacy-agents-deep-CtrxJEM5.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-Dp0w_7LR.js → legacy-main-redirect-DgzblCSy.js} +1 -1
- package/dist/client/assets/{library-C1MpvfWs.js → library-BDDeIFEx.js} +1 -1
- package/dist/client/assets/{login-BBUbyFZ7.js → login-CwckFuPZ.js} +1 -1
- package/dist/client/assets/{markdown-Bz_ONyie.js → markdown-TE6rwhrV.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-D-ZRsE2Y.js → mcp-app-renderer-BL5tgHAn.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CXM1ag2W.js → mcp-oauth-BjLtq_iZ.js} +1 -1
- package/dist/client/assets/{members-DwlCHu1a.js → members-B9zrrep3.js} +1 -1
- package/dist/client/assets/{message-templates-BarxAP0-.js → message-templates-DNSCI9No.js} +1 -1
- package/dist/client/assets/{mini-report-page-B0ttL80P.js → mini-report-page-CqYhI4by.js} +1 -1
- package/dist/client/assets/{mock-board-CaefLHvv.js → mock-board-KINhSCpc.js} +3 -3
- package/dist/client/assets/{monaco-editor-BGx93JF5.js → monaco-editor-pYjftJUI.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CQGtwdQJ.js → monitoring-stats-row-Bp76HqjM.js} +1 -1
- package/dist/client/assets/{multi-select-C8veeU3o.js → multi-select-BxnJ1IMn.js} +1 -1
- package/dist/client/assets/{mustache-CuDsYYUT.js → mustache-DkJq4mxv.js} +1 -1
- package/dist/client/assets/{oauth-callback-Cf5Jnd0L.js → oauth-callback-BrBP8wfe.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-C-iHfomj.js → oauth-callback-ai-provider-B-WWn0vF.js} +1 -1
- package/dist/client/assets/{onboarding-DaJJ0W_1.js → onboarding-DTMqbSHw.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-B8FyXpUR.js → optimistic-project-sidebar-views-B-iOyRUg.js} +1 -1
- package/dist/client/assets/{org-file-open-context-CxsG50dO.js → org-file-open-context-cViad2Uw.js} +1 -1
- package/dist/client/assets/{organization-choice-Chign59B.js → organization-choice-GKSImNmp.js} +1 -1
- package/dist/client/assets/{orgs-vrMUSLZM.js → orgs-BiF24oJQ.js} +1 -1
- package/dist/client/assets/{page-seo-form-P9zm1bDA.js → page-seo-form-CvLra2DO.js} +1 -1
- package/dist/client/assets/{pair-y0f1J-pj.js → pair-D96S0AT6.js} +1 -1
- package/dist/client/assets/{plan-ladder-C4UfGxPz.js → plan-ladder-Ca9VX4PN.js} +1 -1
- package/dist/client/assets/{popover-DkF53k7G.js → popover-C2l1C5I5.js} +1 -1
- package/dist/client/assets/{post-calendar-BA-wTS-M.js → post-calendar-B4RnbunB.js} +1 -1
- package/dist/client/assets/{post-editor-DhbsZODL.js → post-editor-9CCoScNo.js} +1 -1
- package/dist/client/assets/{preview-content-B7L6Fj-s.js → preview-content-Dq_AmbiQ.js} +1 -1
- package/dist/client/assets/{preview-dialog-D38BQII7.js → preview-dialog-BwBmkxNv.js} +1 -1
- package/dist/client/assets/{profile-CLgow2YI.js → profile-Ds3Fl49i.js} +1 -1
- package/dist/client/assets/{project-app-view-CzUm2pqR.js → project-app-view-BwuusJ-D.js} +1 -1
- package/dist/client/assets/{project-feed-DjNu3B6b.js → project-feed-Cvx1Upbv.js} +1 -1
- package/dist/client/assets/{project-icon-Drq3GVLp.js → project-icon-BedkzeeS.js} +1 -1
- package/dist/client/assets/project-reports-BnPglocf.js +1 -0
- package/dist/client/assets/project-tasks-BTlF_sNw.js +1 -0
- package/dist/client/assets/{prompts-Ca8xOTaA.js → prompts-DNu6GrA_.js} +1 -1
- package/dist/client/assets/record-editor-WYyBcNfd.js +1 -0
- package/dist/client/assets/{redirect-editor-U0NABoiN.js → redirect-editor-DV8otTVR.js} +1 -1
- package/dist/client/assets/reports-CTN7dqon.js +1 -0
- package/dist/client/assets/{reports-BvdLBmBt.js → reports-nFTtsiXH.js} +1 -1
- package/dist/client/assets/{reports-onboarding-CppwirEo.js → reports-onboarding--ImDAD_0.js} +1 -1
- package/dist/client/assets/{reports-tab-BRNidfyC.js → reports-tab-ZjAkL-Bt.js} +2 -2
- package/dist/client/assets/{repositories-CrSwMElw.js → repositories-D3MwQMCL.js} +1 -1
- package/dist/client/assets/{repository-import-picker-DijQtAE9.js → repository-import-picker-DISfHZZr.js} +1 -1
- package/dist/client/assets/{repository-picker-BnD1OkxH.js → repository-picker-Cc76xalS.js} +1 -1
- package/dist/client/assets/{require-capability-CnsAPr8W.js → require-capability-BylXqMPr.js} +1 -1
- package/dist/client/assets/{required-auth-layout-C2QknIQr.js → required-auth-layout-KMpl6oHR.js} +1 -1
- package/dist/client/assets/{reset-password-CPN9fnHw.js → reset-password-DaCJf9WD.js} +1 -1
- package/dist/client/assets/{resizable-DkRLH_BJ.js → resizable-DJ3A_HF3.js} +1 -1
- package/dist/client/assets/{review-settings-BMKCc_q9.js → review-settings-BJxG6Gf8.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-CdbNqZXn.js → rich-text-link-control-IiyxWT4r.js} +1 -1
- package/dist/client/assets/roles-CVbskK2U.js +1 -0
- package/dist/client/assets/{route-PWljwGyn.js → route-CVO-5yGx.js} +1 -1
- package/dist/client/assets/{route-Dwf7NO4C.js → route-ComOEk_J.js} +1 -1
- package/dist/client/assets/{route-B-5k1wdd.js → route-DOzq4ViO.js} +1 -1
- package/dist/client/assets/{route-page-header-DduGqWQv.js → route-page-header-Cs2VmTNy.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-DV9qS9r8.js → runnable-block-editor-BCjb3LCv.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-D5qsaMaM.js → sandbox-lifecycle-context-C8jwTRYz.js} +1 -1
- package/dist/client/assets/{schema-CPltpPH2.js → schema-DSDdcZr4.js} +1 -1
- package/dist/client/assets/{scroll-area-CnLiVBZG.js → scroll-area-CmIKtSED.js} +1 -1
- package/dist/client/assets/{search-input-DImB3K7A.js → search-input-BLe6KTwz.js} +1 -1
- package/dist/client/assets/{search-toggle-B-eKJxk4.js → search-toggle-DA8eq__c.js} +1 -1
- package/dist/client/assets/{secret-picker-BgSmgZby.js → secret-picker-CCs4k_B3.js} +1 -1
- package/dist/client/assets/{secrets-D-A9Jm3y.js → secrets-CshFSp9Y.js} +1 -1
- package/dist/client/assets/{sections-editor-B0qRGi7T.js → sections-editor-BJATVujT.js} +1 -1
- package/dist/client/assets/{select-Dfh2pwaV.js → select-BByR5Z_4.js} +1 -1
- package/dist/client/assets/{select-model-DLS5Rueq.js → select-model-Bq-YVhmM.js} +1 -1
- package/dist/client/assets/{seo-editor-2w6dwmUx.js → seo-editor-2i_Ec3Mm.js} +1 -1
- package/dist/client/assets/{separator-50l0lTw9.js → separator-BhbH2T84.js} +1 -1
- package/dist/client/assets/{settings-tab-n5sKUKDO.js → settings-tab-C3zOOa3n.js} +1 -1
- package/dist/client/assets/{sheet-Bf-A6APE.js → sheet-DUs41Hsj.js} +1 -1
- package/dist/client/assets/{shell-layout-D6K65ArQ.js → shell-layout-DJ3g9P4L.js} +1 -1
- package/dist/client/assets/{sidebar-B5n-YfyT.js → sidebar-9WzrDLIj.js} +1 -1
- package/dist/client/assets/{skill-preview-CymkOf3y.js → skill-preview-DbZwgabM.js} +1 -1
- package/dist/client/assets/{skills-B6baRMZo.js → skills-BPa_0P0o.js} +1 -1
- package/dist/client/assets/{sso-_QWtBnbA.js → sso-B3ub6Efg.js} +1 -1
- package/dist/client/assets/{suggestion-BC6mKrsS.js → suggestion-C-gq0hlY.js} +1 -1
- package/dist/client/assets/{switch-Bj1aWJVh.js → switch-CAJrkKRA.js} +1 -1
- package/dist/client/assets/{synced-repos-C0II5wAG.js → synced-repos-SANr_KgT.js} +1 -1
- package/dist/client/assets/{table-DjU9sM5B.js → table-BEkilohE.js} +1 -1
- package/dist/client/assets/{tabs-CQ8Y8Un1.js → tabs-Dd2tckYN.js} +1 -1
- package/dist/client/assets/{task-board-Bs0pcuKB.js → task-board-4WdRpL9H.js} +1 -1
- package/dist/client/assets/{task-route-krtI2mxq.js → task-route-Q0d48Cue.js} +1 -1
- package/dist/client/assets/{task-status-CRLzyMo_.js → task-status-BTEzjbnY.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-iKN9HPDX.js → taskboard-analytics-DswMHYcd.js} +1 -1
- package/dist/client/assets/{tasks-CShjP9JJ.js → tasks-Cbn_8mSf.js} +1 -1
- package/dist/client/assets/tasks-DAz-SSGl.js +1 -0
- package/dist/client/assets/{textarea-DqxiQTrt.js → textarea-DCGCgxQP.js} +1 -1
- package/dist/client/assets/{thread-analytics-DZ2Sq5Zw.js → thread-analytics-Ab2z6URA.js} +1 -1
- package/dist/client/assets/{thread-button-Meh_YfKm.js → thread-button-CxKu1XHV.js} +1 -1
- package/dist/client/assets/{thread-intent-UaqT-IH6.js → thread-intent-B-RLNYw1.js} +1 -1
- package/dist/client/assets/{thread-route-BAQ5E6W2.js → thread-route-Cb0OYd6k.js} +1 -1
- package/dist/client/assets/{thread-route-BPEHRb4I.js → thread-route-TLv3Q6zM.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-DC_yrPc3.js → thread-sheet-body-YLcfMih9.js} +1 -1
- package/dist/client/assets/{toggle-group-Bp5PhcNe.js → toggle-group-gyOC273T.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-XXzMOIRu.js → toolbar-icon-button-BAS1RN7w.js} +1 -1
- package/dist/client/assets/{tooltip-C6IXJ6f6.js → tooltip-TamJ0pBA.js} +1 -1
- package/dist/client/assets/{track-CIubNGVA.js → track-DKrZe8IO.js} +1 -1
- package/dist/client/assets/{types-CO-VtMYa.js → types-BEpeZDST.js} +1 -1
- package/dist/client/assets/{usage-stats-DnvjXYsH.js → usage-stats-qoZRRrPK.js} +1 -1
- package/dist/client/assets/{use-ai-providers-MuCxLEzc.js → use-ai-providers-CyGPGR57.js} +1 -1
- package/dist/client/assets/{use-automations-BbMTXD3j.js → use-automations-D0etkVQ4.js} +1 -1
- package/dist/client/assets/{use-autosave-DcYP1Kp_.js → use-autosave-BZrR4EpB.js} +1 -1
- package/dist/client/assets/{use-connect-companion-BgC9J5Gc.js → use-connect-companion-DOaPRfBo.js} +1 -1
- package/dist/client/assets/{use-connection-Ku7rB1--.js → use-connection-8slpfTIQ.js} +1 -1
- package/dist/client/assets/{use-copy-Rsdl2T2v.js → use-copy--dgNfA-q.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Bz_mu6OH.js → use-create-virtual-mcp-hxRIA5D7.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-5ABdtJOj.js → use-date-fns-locale-eJfgCCNv.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CG9JQtE1.js → use-debounced-autosave-uB2QsLPm.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BRrcicua.js → use-debounced-value-DcI4zwXq.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DiduL4Jx.js → use-deco-credits-hngMSRAS.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CYyKL-jy.js → use-decopilot-events-BuKXkEX5.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B6nzsWog.js → use-delete-connection-CqqyAD1U.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CreerjnY.js → use-deployment-admin-uTGGxxOm.js} +1 -1
- package/dist/client/assets/{use-entitlements-CXZXMVT5.js → use-entitlements-C3f6niws.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-BQQyr8UB.js → use-fast-preview-draft-url-DteSqVl0.js} +1 -1
- package/dist/client/assets/{use-file-configs-BtjJqeV5.js → use-file-configs-CueJwFUZ.js} +1 -1
- package/dist/client/assets/{use-in-settings-DiOYXD7R.js → use-in-settings-DvuMwVVv.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Dvh-VmRf.js → use-infinite-scroll-aao4CFrl.js} +1 -1
- package/dist/client/assets/{use-join-requests-CvWz9_Si.js → use-join-requests-BmYzsYtS.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-vmbbGKrO.js → use-main-panel-tabs-DGDjAK_a.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-C9w6MKri.js → use-mcp-auth-status-n70YyfJn.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BiCqEGFb.js → use-mcp-client-D5ISNy1u.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Ei_kZDY5.js → use-mcp-prompts-CpMkSs6e.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BrWSnDus.js → use-mcp-tools-DObKdEcu.js} +1 -1
- package/dist/client/assets/{use-members-DRus7xZg.js → use-members-DM2aWpGm.js} +1 -1
- package/dist/client/assets/{use-mobile-CFrwwiLD.js → use-mobile-7NdLMHiB.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DM7tn18T.js → use-navigate-to-agent-DBWvyW0p.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-BeaYFvYA.js → use-open-billing-url-DsPkGF4p.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-21d3s5Ii.js → use-org-auth-client-DN7STl4A.js} +1 -1
- package/dist/client/assets/{use-org-fs-CFCSN00v.js → use-org-fs-DKnM3E4S.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-BkXCg6n2.js → use-org-repo-syncs-CDkTEriJ.js} +1 -1
- package/dist/client/assets/{use-org-sso-DMbJNrsy.js → use-org-sso-Dj24dF4x.js} +1 -1
- package/dist/client/assets/{use-organization-roles-4sGeeC2G.js → use-organization-roles-BhoInROm.js} +1 -1
- package/dist/client/assets/{use-organization-settings-dnq1S6Fx.js → use-organization-settings-Bh1MgWMz.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-FbolIt1t.js → use-panel-navigate-CbwiVPwL.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-CXU1utGD.js → use-project-native-view-presence-DXYMkBrd.js} +1 -1
- package/dist/client/assets/{use-project-scope-BmQykMfV.js → use-project-scope-DPGZwkTE.js} +1 -1
- package/dist/client/assets/{use-releases-DDAFj1EC.js → use-releases-CnQn1QD4.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-BqOZHxBH.js → use-reports-diagnostic-D2YSYnR9.js} +1 -1
- package/dist/client/assets/{use-route-default-main-CkhnWI6M.js → use-route-default-main-BP7z3SAs.js} +1 -1
- package/dist/client/assets/{use-secrets-Jcx5hRkJ.js → use-secrets-Dq6fpQZD.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-lFbrJV5g.js → use-section-preview-base-CFgLG-CI.js} +1 -1
- package/dist/client/assets/{use-session-runtime-qqhqfMVL.js → use-session-runtime-O6hilKHL.js} +1 -1
- package/dist/client/assets/{use-tags-lcGs1CDY.js → use-tags-DimWZDr4.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DwVwElaD.js → use-task-board-analytics-ldiUXB7i.js} +1 -1
- package/dist/client/assets/{use-task-metadata-B_r4urCM.js → use-task-metadata-un4TVL9m.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-Bb3UI7mQ.js → use-thread-analytics-dT_aVduX.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CHKnkCZM.js → use-thread-outputs-DLBwIBdA.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CZe9TmcS.js → use-virtual-mcp-DLYR2teL.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-aO3Bnwb-.js +1 -0
- package/dist/client/assets/{useQueries-C2__QN_1.js → useQueries-DMxSKiQM.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CERMCpsZ.js +1 -0
- package/dist/client/assets/{users-BuSKLZ0k.js → users-Ci6P-NuA.js} +1 -1
- package/dist/client/assets/{utils-CvdqcWPw.js → utils-BcU7ok0u.js} +1 -1
- package/dist/client/assets/{variant-calendar-CQMfZ_wr.js → variant-calendar-Bg3H3F2r.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-e5NO-HEV.js → variant-matcher-override-CW9C0jan.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CWc5z3tA.js → view-mode-toggle-BIT4-lg7.js} +1 -1
- package/dist/client/assets/{virtual-mcp-o68MNg_z.js → virtual-mcp-DdvSafC6.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +429 -429
- package/dist/server/server.js +306 -306
- package/package.json +1 -1
- package/dist/client/assets/agent-app-DFZO_7Wp.js +0 -1
- package/dist/client/assets/agent-deck-Dnrc81oQ.js +0 -1
- package/dist/client/assets/agent-library-file-DW-153Ql.js +0 -1
- package/dist/client/assets/agent-settings-BNBsui4i.js +0 -1
- package/dist/client/assets/agent-site-editor-code-P1DuWSLQ.js +0 -2
- package/dist/client/assets/agent-view-DC_gjqv2.js +0 -1
- package/dist/client/assets/api-keys-a3S8wpcX.js +0 -1
- package/dist/client/assets/app-editor-CxQtPqbw.js +0 -1
- package/dist/client/assets/project-reports-Bmmgk7iU.js +0 -1
- package/dist/client/assets/project-tasks-5PTUxIrM.js +0 -1
- package/dist/client/assets/record-editor-byAQmfCC.js +0 -1
- package/dist/client/assets/reports-KxoXeWeK.js +0 -1
- package/dist/client/assets/roles-D2qYUYrd.js +0 -1
- package/dist/client/assets/tasks-B-WFytkO.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CQBOZphA.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DYo8R2JU.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as K,b as Q,r as H,l as pe,j as t,t as re,B as Z,dX as De,dY as Ve,dZ as Re,al as at,e_ as Hs,h as ot,I as qs,F as Qs,H as Xs,G as Ze,aS as ns,aT as is,aU as ls,Y as Be,E as Ye,Z as Js,e$ as $n,L as Zs,ab as En,s as Fn,U as Rt,aa as en,a4 as St,m as zn,K as tn,f0 as Rn,f1 as Ln,f2 as Bn,aV as me,f3 as ue,n as ze,P as Un,d as Lt,u as Yn,q as ve,d1 as Kn,ah as Gn,eL as Wn,f4 as Hn,aQ as qn,a as Qn,f5 as sn,f6 as Xn,aF as Jn,a8 as Zn,o as ei,an as ti,am as si,as as ni}from"./index-BeWJyIso.js";import{c as ii}from"./UserSquare-DFFgBLK6.js";import{n as li}from"./LinkExternal01-BVl3Qea8.js";import{aT as Bt,b3 as ai,b4 as Ut,b5 as nn,b6 as ln,af as Yt,b7 as $t,b8 as Dt,b9 as as,A as rs,B as ri,ba as oi,bb as ci,J as di,U as ui,bc as mi,bd as fi,be as pi,aF as xi,at as hi,j as an,h as os,n as gi,m as vi,l as ji,e as Kt,bf as cs,aD as bi,a5 as yi,y as wi,bg as Si,al as ds}from"./agent-icon-Cp4E_xly.js";import{i as Ni}from"./Sun-BsNGpGdi.js";import{s as Le}from"./Plus-CPtri1YM.js";import{t as ht,a as Ci}from"./Tool01-BWmyIYi9.js";import{s as it}from"./Trash01-D0sFCEiI.js";import{I as Me}from"./input-Dg01qG2F.js";import{a as Gt,b as Wt,P as Ht}from"./popover-DkF53k7G.js";import{S as rn}from"./scroll-area-CnLiVBZG.js";import{i as gt}from"./SearchMd-DoMlo04D.js";import{i as Mi}from"./Upload01-CQkdN0Jy.js";import{b as us,c as ki,d as _i,e as Vi,B as Ti,a as Di}from"./breadcrumb-DOba6LNd.js";import{i as Ai}from"./Link01-Ba4lmYHC.js";import{g as Ii}from"./extract-connection-data-DvBFazbY.js";import{a as Oi}from"./chat-context-L1MRASS9.js";import{U as ms,b as Pi}from"./build-improve-prompt-doc-ibi7y-L4.js";import{E as $i}from"./empty-state-CR81vKzY.js";import{a as Ei}from"./shell-layout-D6K65ArQ.js";import{g as Nt,n as Fi,a as fs,e as zi,u as Ri,f as ps}from"./use-date-fns-locale-5ABdtJOj.js";import{a as qt,b as on,u as Li}from"./use-connection-Ku7rB1--.js";import{b as cn,a as dn,c as un,g as Bi}from"./use-virtual-mcp-CZe9TmcS.js";import{a as Ui,i as xs}from"./mcp-oauth-CXM1ag2W.js";import{f as Yi,e as Ki,b as Gi,A as Wi,a as Hi,d as qi,c as Qi,g as Xi}from"./alert-dialog-DoyFdZHN.js";import{D as ct,b as dt,c as Ct,d as Mt,e as mn,h as Ji}from"./dialog-BqioEhMl.js";import{T as lt}from"./textarea-DqxiQTrt.js";import{c as ye,T as we,a as Se}from"./tooltip-C6IXJ6f6.js";import{u as hs}from"./use-debounced-autosave-CG9JQtE1.js";import{A as Zi}from"./add-connection-dialog-De7olvO-.js";import{a as el}from"./Share07-ChCo_3pm.js";import{F as gs}from"./file-type-icon-DMY2pV4u.js";import{h as tl,i as sl,j as nl,k as il}from"./use-org-fs-CFCSN00v.js";import{I as tt}from"./integration-icon-CwQ6RDOp.js";import{C as fn}from"./checkbox-BVJhs11j.js";import{S as ll}from"./search-input-DImB3K7A.js";import{b as Ae,a as Ie,c as je,d as Oe,S as Pe}from"./select-Dfh2pwaV.js";import{s as Qt}from"./XClose-DNumy7PJ.js";import{C as al}from"./collection-tabs-CZCjpmbY.js";import{T as pn,u as xn}from"./use-mcp-auth-status-C9w6MKri.js";import{u as kt}from"./use-mcp-client-BiCqEGFb.js";import{a as hn}from"./use-mcp-tools-BrWSnDus.js";import{u as rl}from"./use-mcp-prompts-Ei_kZDY5.js";import{g as ol}from"./connection-slug-CITJ0kGN.js";import{t as vt}from"./utils-CVEq3hMx.js";import{S as ut}from"./switch-Bj1aWJVh.js";import{i as cl}from"./LayoutLeft-B4wEmr_x.js";import{i as dl}from"./DotsVertical-CZz-Lgk0.js";import{a as ul}from"./Image01-wp07hfou.js";import{i as ml}from"./Monitor01-d780LsKL.js";import{g as fl}from"./types-CO-VtMYa.js";import{b as jt,g as pl,d as xl}from"./use-project-scope-BmQykMfV.js";import{a as hl}from"./use-panel-navigate-FbolIt1t.js";import{u as gl,e as Et,r as Ft,p as vl,g as jl,s as bl,t as yl,h as wl,a as Sl}from"./use-project-native-view-presence-CXU1utGD.js";import{a as gn,u as Nl,i as Cl,o as Ml,r as vs,p as kl,w as _l,b as js}from"./optimistic-project-sidebar-views-B8FyXpUR.js";import{V as Vl,E as _t,r as vn,C as Tl,w as Dl}from"./virtual-mcp-o68MNg_z.js";import{s as jn}from"./slugify-CEUa2lfQ.js";import{b as Al,a as Il,D as Ol}from"./drawer-BZaHn3bO.js";import{u as Pl}from"./use-mobile-CFrwwiLD.js";import{i as mt}from"./Check-DFrsPmld.js";import{a as Vt}from"./Copy01-M-Qbz3gf.js";import{i as Xt}from"./Key01-hC0wHiG0.js";import{d as ft}from"./backoff-8mStPHYB.js";import{g as bn}from"./github-repo-BknN0SVI.js";import{R as $l}from"./repository-import-picker-DijQtAE9.js";import{b as El}from"./sandbox-url-D3mC8qhT.js";import{L as Ne}from"./label-BXpXMxJB.js";import{S as Fl,a as zl,b as Rl}from"./secret-picker-BgSmgZby.js";import{u as Ll,a as Bl}from"./use-secrets-Jcx5hRkJ.js";import{o as bs}from"./omit-sandbox-map-jj4lCB2U.js";import{G as Ul}from"./github-icon-CGDk98ok.js";import{p as Yl,s as Kl,a as Gl}from"./thread-intent-UaqT-IH6.js";import{r as Wl}from"./serial-task-queue-CGOeQgpr.js";import{t as Ue,c as et,m as Hl,a as yn}from"./differenceInSeconds-C3x8sHUj.js";function rt(l,e){const n=Nt(),s=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Ue(l,e?.in),a=i.getDay(),o=(a<s?7:0)+a-s;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function bt(l,e){return rt(l,{...e,weekStartsOn:1})}function wn(l,e){const n=Ue(l,e?.in),s=n.getFullYear(),i=et(n,0);i.setFullYear(s+1,0,4),i.setHours(0,0,0,0);const a=bt(i),o=et(n,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const r=bt(o);return n.getTime()>=a.getTime()?s+1:n.getTime()>=r.getTime()?s:s-1}function ys(l,e){const n=Ue(l,e?.in);return n.setHours(0,0,0,0),n}function ql(l,e,n){const[s,i]=Fi(n?.in,l,e),a=ys(s),o=ys(i),r=+a-fs(a),h=+o-fs(o);return Math.round((r-h)/Hl)}function Ql(l,e){const n=wn(l,e),s=et(l,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),bt(s)}function Xl(l){return l instanceof Date||typeof l=="object"&&Object.prototype.toString.call(l)==="[object Date]"}function Jl(l){return!(!Xl(l)&&typeof l!="number"||isNaN(+Ue(l)))}function Zl(l,e){const n=Ue(l,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ea(l,e){const n=Ue(l,e?.in);return ql(n,Zl(n))+1}function ta(l,e){const n=Ue(l,e?.in),s=+bt(n)-+Ql(n);return Math.round(s/yn)+1}function Sn(l,e){const n=Ue(l,e?.in),s=n.getFullYear(),i=Nt(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=et(e?.in||l,0);o.setFullYear(s+1,0,a),o.setHours(0,0,0,0);const r=rt(o,e),h=et(e?.in||l,0);h.setFullYear(s,0,a),h.setHours(0,0,0,0);const c=rt(h,e);return+n>=+r?s+1:+n>=+c?s:s-1}function sa(l,e){const n=Nt(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Sn(l,e),a=et(e?.in||l,0);return a.setFullYear(i,0,s),a.setHours(0,0,0,0),rt(a,e)}function na(l,e){const n=Ue(l,e?.in),s=+rt(n,e)-+sa(n,e);return Math.round(s/yn)+1}function ae(l,e){const n=l<0?"-":"",s=Math.abs(l).toString().padStart(e,"0");return n+s}const Ke={y(l,e){const n=l.getFullYear(),s=n>0?n:1-n;return ae(e==="yy"?s%100:s,e.length)},M(l,e){const n=l.getMonth();return e==="M"?String(n+1):ae(n+1,2)},d(l,e){return ae(l.getDate(),e.length)},a(l,e){const n=l.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(l,e){return ae(l.getHours()%12||12,e.length)},H(l,e){return ae(l.getHours(),e.length)},m(l,e){return ae(l.getMinutes(),e.length)},s(l,e){return ae(l.getSeconds(),e.length)},S(l,e){const n=e.length,s=l.getMilliseconds(),i=Math.trunc(s*Math.pow(10,n-3));return ae(i,e.length)}},Je={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ws={G:function(l,e,n){const s=l.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});default:return n.era(s,{width:"wide"})}},y:function(l,e,n){if(e==="yo"){const s=l.getFullYear(),i=s>0?s:1-s;return n.ordinalNumber(i,{unit:"year"})}return Ke.y(l,e)},Y:function(l,e,n,s){const i=Sn(l,s),a=i>0?i:1-i;if(e==="YY"){const o=a%100;return ae(o,2)}return e==="Yo"?n.ordinalNumber(a,{unit:"year"}):ae(a,e.length)},R:function(l,e){const n=wn(l);return ae(n,e.length)},u:function(l,e){const n=l.getFullYear();return ae(n,e.length)},Q:function(l,e,n){const s=Math.ceil((l.getMonth()+1)/3);switch(e){case"Q":return String(s);case"QQ":return ae(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(l,e,n){const s=Math.ceil((l.getMonth()+1)/3);switch(e){case"q":return String(s);case"qq":return ae(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(l,e,n){const s=l.getMonth();switch(e){case"M":case"MM":return Ke.M(l,e);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(l,e,n){const s=l.getMonth();switch(e){case"L":return String(s+1);case"LL":return ae(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(l,e,n,s){const i=na(l,s);return e==="wo"?n.ordinalNumber(i,{unit:"week"}):ae(i,e.length)},I:function(l,e,n){const s=ta(l);return e==="Io"?n.ordinalNumber(s,{unit:"week"}):ae(s,e.length)},d:function(l,e,n){return e==="do"?n.ordinalNumber(l.getDate(),{unit:"date"}):Ke.d(l,e)},D:function(l,e,n){const s=ea(l);return e==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):ae(s,e.length)},E:function(l,e,n){const s=l.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(l,e,n,s){const i=l.getDay(),a=(i-s.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return ae(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(l,e,n,s){const i=l.getDay(),a=(i-s.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return ae(a,e.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(l,e,n){const s=l.getDay(),i=s===0?7:s;switch(e){case"i":return String(i);case"ii":return ae(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(l,e,n){const i=l.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(l,e,n){const s=l.getHours();let i;switch(s===12?i=Je.noon:s===0?i=Je.midnight:i=s/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(l,e,n){const s=l.getHours();let i;switch(s>=17?i=Je.evening:s>=12?i=Je.afternoon:s>=4?i=Je.morning:i=Je.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(l,e,n){if(e==="ho"){let s=l.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Ke.h(l,e)},H:function(l,e,n){return e==="Ho"?n.ordinalNumber(l.getHours(),{unit:"hour"}):Ke.H(l,e)},K:function(l,e,n){const s=l.getHours()%12;return e==="Ko"?n.ordinalNumber(s,{unit:"hour"}):ae(s,e.length)},k:function(l,e,n){let s=l.getHours();return s===0&&(s=24),e==="ko"?n.ordinalNumber(s,{unit:"hour"}):ae(s,e.length)},m:function(l,e,n){return e==="mo"?n.ordinalNumber(l.getMinutes(),{unit:"minute"}):Ke.m(l,e)},s:function(l,e,n){return e==="so"?n.ordinalNumber(l.getSeconds(),{unit:"second"}):Ke.s(l,e)},S:function(l,e){return Ke.S(l,e)},X:function(l,e,n){const s=l.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Ns(s);case"XXXX":case"XX":return We(s);default:return We(s,":")}},x:function(l,e,n){const s=l.getTimezoneOffset();switch(e){case"x":return Ns(s);case"xxxx":case"xx":return We(s);default:return We(s,":")}},O:function(l,e,n){const s=l.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ss(s,":");default:return"GMT"+We(s,":")}},z:function(l,e,n){const s=l.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ss(s,":");default:return"GMT"+We(s,":")}},t:function(l,e,n){const s=Math.trunc(+l/1e3);return ae(s,e.length)},T:function(l,e,n){return ae(+l,e.length)}};function Ss(l,e=""){const n=l>0?"-":"+",s=Math.abs(l),i=Math.trunc(s/60),a=s%60;return a===0?n+String(i):n+String(i)+e+ae(a,2)}function Ns(l,e){return l%60===0?(l>0?"-":"+")+ae(Math.abs(l)/60,2):We(l,e)}function We(l,e=""){const n=l>0?"-":"+",s=Math.abs(l),i=ae(Math.trunc(s/60),2),a=ae(s%60,2);return n+i+e+a}const Cs=(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"})}},Nn=(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"})}},ia=(l,e)=>{const n=l.match(/(P+)(p+)?/)||[],s=n[1],i=n[2];if(!i)return Cs(l,e);let a;switch(s){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}}",Cs(s,e)).replace("{{time}}",Nn(i,e))},la={p:Nn,P:ia},aa=/^D+$/,ra=/^Y+$/,oa=["D","DD","YY","YYYY"];function ca(l){return aa.test(l)}function da(l){return ra.test(l)}function ua(l,e,n){const s=ma(l,e,n);if(console.warn(s),oa.includes(l))throw new RangeError(s)}function ma(l,e,n){const s=l[0]==="Y"?"years":"days of the month";return`Use \`${l.toLowerCase()}\` instead of \`${l}\` (in \`${e}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const fa=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,pa=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xa=/^'([^]*?)'?$/,ha=/''/g,ga=/[a-zA-Z]/;function Ms(l,e,n){const s=Nt(),i=n?.locale??s.locale??zi,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,r=Ue(l,n?.in);if(!Jl(r))throw new RangeError("Invalid time value");let h=e.match(pa).map(m=>{const f=m[0];if(f==="p"||f==="P"){const d=la[f];return d(m,i.formatLong)}return m}).join("").match(fa).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const f=m[0];if(f==="'")return{isToken:!1,value:va(m)};if(ws[f])return{isToken:!0,value:m};if(f.match(ga))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:m}});i.localize.preprocessor&&(h=i.localize.preprocessor(r,h));const c={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return h.map(m=>{if(!m.isToken)return m.value;const f=m.value;(!n?.useAdditionalWeekYearTokens&&da(f)||!n?.useAdditionalDayOfYearTokens&&ca(f))&&ua(f,e,String(l));const d=ws[f[0]];return d(r,f,i.localize,c)}).join("")}function va(l){const e=l.match(xa);return e?e[1].replace(ha,"'"):l}function Cn(l){const e=K.c(82),{value:n,onChange:s,onColorChange:i,name:a,size:o,className:r,avatarClassName:h,showHoverOverlay:c,disabled:m}=l,f=o===void 0?"lg":o,d=c===void 0?!0:c,p=m===void 0?!1:m,x=Q(),[u,g]=H.useState(!1),[j,y]=H.useState("icons"),[b,v]=H.useState(""),[N,M]=H.useState("blue");let C;e[0]!==n?(C=Bt(n),e[0]=n,e[1]=C):C=e[1];const w=C,k=w.type==="icon"||w.type==="url"&&w.color?w.color:N;let S;e[2]!==s||e[3]!==k?(S=ce=>{s(Dt(ce,k))},e[2]=s,e[3]=k,e[4]=S):S=e[4];const _=S;let V;e[5]!==s||e[6]!==i||e[7]!==w.name||e[8]!==w.type||e[9]!==w.url?(V=ce=>{M(ce),i?.(ce),w.type==="icon"?s(Dt(w.name,ce)):w.type==="url"&&s(as(w.url,ce))},e[5]=s,e[6]=i,e[7]=w.name,e[8]=w.type,e[9]=w.url,e[10]=V):V=e[10];const O=V;let A;e[11]!==s||e[12]!==k?(A=ce=>{s(as(ce,k)),g(!1)},e[11]=s,e[12]=k,e[13]=A):A=e[13];const E=A;let I;e[14]!==s||e[15]!==k?(I=()=>{const ce=Ut(),Ee=ce[Math.floor(Math.random()*ce.length)];s(Dt(Ee,k))},e[14]=s,e[15]=k,e[16]=I):I=e[16];const $=I,F=p?!1:u,q=p?"cursor-default opacity-50":"cursor-pointer";let R;e[17]!==r||e[18]!==f||e[19]!==q?(R=pe("relative group overflow-hidden",q,ai(f),r),e[17]=r,e[18]=f,e[19]=q,e[20]=R):R=e[20];let G;e[21]!==h||e[22]!==a||e[23]!==f||e[24]!==n?(G=t.jsx(rs,{icon:n,name:a,size:f,className:h}),e[21]=h,e[22]=a,e[23]=f,e[24]=n,e[25]=G):G=e[25];let U;e[26]!==p||e[27]!==d?(U=d&&!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(ri,{size:16,className:"text-white"})}),e[26]=p,e[27]=d,e[28]=U):U=e[28];let T;e[29]!==p||e[30]!==R||e[31]!==G||e[32]!==U?(T=t.jsx(Gt,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":"Change icon",disabled:p,className:R,children:[G,U]})}),e[29]=p,e[30]=R,e[31]=G,e[32]=U,e[33]=T):T=e[33];let P;e[34]!==a||e[35]!==n?(P=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(rs,{icon:n,name:a,size:"xl"})}),e[34]=a,e[35]=n,e[36]=P):P=e[36];let W;e[37]!==j?(W=ce=>{if(ce.key!=="ArrowLeft"&&ce.key!=="ArrowRight")return;ce.preventDefault();const Ee=j==="icons"?"upload":"icons";y(Ee),document.getElementById(`icon-picker-tab-${Ee}`)?.focus()},e[37]=j,e[38]=W):W=e[38];const B=j==="icons",z=j==="icons"?0:-1;let Y;e[39]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>y("icons"),e[39]=Y):Y=e[39];const X=j==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ie;e[40]!==X?(ie=pe("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",X),e[40]=X,e[41]=ie):ie=e[41];let le;e[42]!==x?(le=x("common.iconPicker.iconsTab"),e[42]=x,e[43]=le):le=e[43];let de;e[44]!==B||e[45]!==z||e[46]!==ie||e[47]!==le?(de=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":B,"aria-controls":"icon-picker-panel-icons",tabIndex:z,onClick:Y,className:ie,children:le}),e[44]=B,e[45]=z,e[46]=ie,e[47]=le,e[48]=de):de=e[48];const oe=j==="upload",J=j==="upload"?0:-1;let ee;e[49]===Symbol.for("react.memo_cache_sentinel")?(ee=()=>y("upload"),e[49]=ee):ee=e[49];const xe=j==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ge;e[50]!==xe?(ge=pe("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",xe),e[50]=xe,e[51]=ge):ge=e[51];let ke;e[52]!==x?(ke=x("common.iconPicker.uploadTab"),e[52]=x,e[53]=ke):ke=e[53];let he;e[54]!==oe||e[55]!==J||e[56]!==ge||e[57]!==ke?(he=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":oe,"aria-controls":"icon-picker-panel-upload",tabIndex:J,onClick:ee,className:ge,children:ke}),e[54]=oe,e[55]=J,e[56]=ge,e[57]=ke,e[58]=he):he=e[58];let $e;e[59]===Symbol.for("react.memo_cache_sentinel")?($e=t.jsx("div",{className:"flex-1"}),e[59]=$e):$e=e[59];let be;e[60]!==W||e[61]!==de||e[62]!==he?(be=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:W,children:[de,he,$e]}),e[60]=W,e[61]=de,e[62]=he,e[63]=be):be=e[63];let Ce;e[64]!==O||e[65]!==$||e[66]!==_||e[67]!==E||e[68]!==w.name||e[69]!==w.type||e[70]!==b||e[71]!==k||e[72]!==j?(Ce=j==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(wa,{search:b,onSearchChange:v,selectedColor:k,onColorChange:O,onSelectIcon:_,onRandom:$,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(Sa,{onUpload:E})}),e[64]=O,e[65]=$,e[66]=_,e[67]=E,e[68]=w.name,e[69]=w.type,e[70]=b,e[71]=k,e[72]=j,e[73]=Ce):Ce=e[73];let L;e[74]!==P||e[75]!==be||e[76]!==Ce?(L=t.jsx(Wt,{align:"start",className:"w-80 p-0",onOpenAutoFocus:ja,children:t.jsxs("div",{className:"flex flex-col",children:[P,be,Ce]})}),e[74]=P,e[75]=be,e[76]=Ce,e[77]=L):L=e[77];let ne;return e[78]!==T||e[79]!==L||e[80]!==F?(ne=t.jsxs(Ht,{open:F,onOpenChange:g,children:[T,L]}),e[78]=T,e[79]=L,e[80]=F,e[81]=ne):ne=e[81],ne}function ja(l){return l.preventDefault()}function ba(l){const e=K.c(33),{selectedColor:n,onColorChange:s}=l,i=Q(),[a,o]=H.useState(!1);let r,h,c,m,f,d,p;if(e[0]!==a||e[1]!==n){const N=nn(n);h=Ht,d=a,p=o,r=Gt,f=!0,c="button",m=pe("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]=n,e[2]=r,e[3]=h,e[4]=c,e[5]=m,e[6]=f,e[7]=d,e[8]=p}else r=e[2],h=e[3],c=e[4],m=e[5],f=e[6],d=e[7],p=e[8];let x;e[9]!==i?(x=i("common.iconPicker.changeColor"),e[9]=i,e[10]=x):x=e[10];let u;e[11]!==i?(u=i("common.iconPicker.changeColor"),e[11]=i,e[12]=u):u=e[12];let g;e[13]!==c||e[14]!==m||e[15]!==x||e[16]!==u?(g=t.jsx("button",{type:c,className:m,title:x,"aria-label":u}),e[13]=c,e[14]=m,e[15]=x,e[16]=u,e[17]=g):g=e[17];let j;e[18]!==r||e[19]!==f||e[20]!==g?(j=t.jsx(r,{asChild:f,children:g}),e[18]=r,e[19]=f,e[20]=g,e[21]=j):j=e[21];let y;e[22]!==s||e[23]!==n?(y=ci.map(N=>t.jsx("button",{type:"button",onClick:()=>{s(N.name),o(!1)},className:pe("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",N.dot,n===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]=s,e[23]=n,e[24]=y):y=e[24];let b;e[25]!==y?(b=t.jsx(Wt,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:ya,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:y})}),e[25]=y,e[26]=b):b=e[26];let v;return e[27]!==h||e[28]!==b||e[29]!==d||e[30]!==p||e[31]!==j?(v=t.jsxs(h,{open:d,onOpenChange:p,children:[j,b]}),e[27]=h,e[28]=b,e[29]=d,e[30]=p,e[31]=j,e[32]=v):v=e[32],v}function ya(l){return l.preventDefault()}function wa(l){const e=K.c(55),{search:n,onSearchChange:s,selectedColor:i,onColorChange:a,onSelectIcon:o,onRandom:r,currentIconName:h}=l,c=Q();let m,f,d,p,x,u,g;if(e[0]!==h||e[1]!==a||e[2]!==r||e[3]!==s||e[4]!==o||e[5]!==n||e[6]!==i||e[7]!==c){const N=Ut(),M=nn(i);f=ln(N,n),u="flex flex-col";let C;e[15]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(gt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=C):C=e[15];let w;e[16]!==s?(w=I=>s(I.target.value),e[16]=s,e[17]=w):w=e[17];let k;e[18]!==c?(k=c("common.iconPicker.filterPlaceholder"),e[18]=c,e[19]=k):k=e[19];let S;e[20]!==n||e[21]!==w||e[22]!==k?(S=t.jsxs("div",{className:"relative flex-1",children:[C,t.jsx(Me,{value:n,onChange:w,placeholder:k,className:"h-8 text-xs pl-7"})]}),e[20]=n,e[21]=w,e[22]=k,e[23]=S):S=e[23];let _;e[24]!==c?(_=c("common.iconPicker.randomIcon"),e[24]=c,e[25]=_):_=e[25];let V;e[26]!==c?(V=c("common.iconPicker.randomIcon"),e[26]=c,e[27]=V):V=e[27];let O;e[28]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(oi,{size:14,className:"text-muted-foreground"}),e[28]=O):O=e[28];let A;e[29]!==r||e[30]!==_||e[31]!==V?(A=t.jsx("button",{type:"button",onClick:r,className:"h-8 w-8 flex items-center justify-center classic:rounded-md compact:rounded-lg border border-border hover:bg-accent transition-colors shrink-0",title:_,"aria-label":V,children:O}),e[29]=r,e[30]=_,e[31]=V,e[32]=A):A=e[32];let E;e[33]!==a||e[34]!==i?(E=t.jsx(ba,{selectedColor:i,onColorChange:a}),e[33]=a,e[34]=i,e[35]=E):E=e[35],e[36]!==A||e[37]!==E||e[38]!==S?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[S,A,E]}),e[36]=A,e[37]=E,e[38]=S,e[39]=g):g=e[39],m=rn,x="h-56",d="grid grid-cols-9 gap-0.5 px-2 pb-2",p=f.map(I=>{const $=Yt(I);return $?t.jsx("button",{type:"button",onClick:()=>o(I),className:pe("h-8 w-8 flex items-center justify-center classic:rounded-md compact:rounded-lg transition-colors cursor-pointer",h===I?pe(M.bg,M.text):pe(M.text,"hover:bg-accent")),title:I,"aria-label":$t(I),children:t.jsx($,{size:18})},I):null}),e[0]=h,e[1]=a,e[2]=r,e[3]=s,e[4]=o,e[5]=n,e[6]=i,e[7]=c,e[8]=m,e[9]=f,e[10]=d,e[11]=p,e[12]=x,e[13]=u,e[14]=g}else m=e[8],f=e[9],d=e[10],p=e[11],x=e[12],u=e[13],g=e[14];let j;e[40]!==d||e[41]!==p?(j=t.jsx("div",{className:d,children:p}),e[40]=d,e[41]=p,e[42]=j):j=e[42];let y;e[43]!==f.length||e[44]!==c?(y=f.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("common.iconPicker.noIconsFound")}),e[43]=f.length,e[44]=c,e[45]=y):y=e[45];let b;e[46]!==m||e[47]!==x||e[48]!==j||e[49]!==y?(b=t.jsxs(m,{className:x,children:[j,y]}),e[46]=m,e[47]=x,e[48]=j,e[49]=y,e[50]=b):b=e[50];let v;return e[51]!==u||e[52]!==g||e[53]!==b?(v=t.jsxs("div",{className:u,children:[g,b]}),e[51]=u,e[52]=g,e[53]=b,e[54]=v):v=e[54],v}function Sa(l){const e=K.c(46),{onUpload:n}=l,s=Q(),i=H.useRef(null);let a;e[0]!==n||e[1]!==s?(a=A=>{const E=A.target.files?.[0];if(!E)return;if(E.size>2097152){re.error(s("common.iconPicker.imageTooLarge")),A.target.value="";return}const I=new FileReader;I.onerror=()=>{re.error(s("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},I.onloadend=()=>{I.readyState===FileReader.DONE&&I.result&&n(I.result),i.current&&(i.current.value="")},I.readAsDataURL(E)},e[0]=n,e[1]=s,e[2]=a):a=e[2];const o=a,[r,h]=H.useState("");let c;e[3]!==n||e[4]!==r?(c=()=>{const A=r.trim();A&&(n(A),h(""))},e[3]=n,e[4]=r,e[5]=c):c=e[5];const m=c;let f;e[6]!==o?(f=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:o}),e[6]=o,e[7]=f):f=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=()=>i.current?.click(),e[8]=d):d=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Mi,{size:20}),e[9]=p):p=e[9];let x;e[10]!==s?(x=s("common.iconPicker.uploadHint"),e[10]=s,e[11]=x):x=e[11];let u;e[12]!==x?(u=t.jsxs("button",{type:"button",onClick:d,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:x})]}),e[12]=x,e[13]=u):u=e[13];let g;e[14]!==s?(g=s("common.iconPicker.or"),e[14]=s,e[15]=g):g=e[15];let j;e[16]!==g?(j=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=j):j=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 b;e[19]!==j?(b=t.jsxs("div",{className:"flex items-center gap-2",children:[j,y]}),e[19]=j,e[20]=b):b=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=A=>h(A.target.value),e[21]=v):v=e[21];let N;e[22]!==s?(N=s("common.iconPicker.pasteUrlPlaceholder"),e[22]=s,e[23]=N):N=e[23];let M;e[24]!==m?(M=A=>{A.key==="Enter"&&(A.preventDefault(),m())},e[24]=m,e[25]=M):M=e[25];let C;e[26]!==r||e[27]!==N||e[28]!==M?(C=t.jsx(Me,{value:r,onChange:v,placeholder:N,className:"h-8 text-xs flex-1",onKeyDown:M}),e[26]=r,e[27]=N,e[28]=M,e[29]=C):C=e[29];let w;e[30]!==r?(w=r.trim(),e[30]=r,e[31]=w):w=e[31];const k=!w;let S;e[32]!==s?(S=s("common.iconPicker.apply"),e[32]=s,e[33]=S):S=e[33];let _;e[34]!==m||e[35]!==k||e[36]!==S?(_=t.jsx(Z,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs shrink-0",onClick:m,disabled:k,children:S}),e[34]=m,e[35]=k,e[36]=S,e[37]=_):_=e[37];let V;e[38]!==C||e[39]!==_?(V=t.jsxs("div",{className:"flex items-center gap-1.5",children:[C,_]}),e[38]=C,e[39]=_,e[40]=V):V=e[40];let O;return e[41]!==b||e[42]!==V||e[43]!==f||e[44]!==u?(O=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[f,u,b,V]}),e[41]=b,e[42]=V,e[43]=f,e[44]=u,e[45]=O):O=e[45],O}function Na(l){const e=K.c(5),{header:n,groups:s}=l;let i;e[0]!==s?(i=s.filter(ka).map(Ca),e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs(Hs,{children:[n,i]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function Ca(l){return l.content?t.jsx("div",{children:l.content},l.key):t.jsx(De,{title:l.title,children:t.jsx(Ve,{children:(l.rows??[]).map(Ma)})},l.key)}function Ma(l){return t.jsx(Re,{onClick:l.onClick,icon:l.icon,title:t.jsx("span",{className:pe(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(at,{size:16})]})})},l.key)}function ka(l){return l.content||l.rows?.length}function _a(l){const e=K.c(19),{title:n,backLabel:s,onBack:i,actions:a,children:o}=l;let r;e[0]!==s||e[1]!==i?(r=t.jsx(us,{children:t.jsx(ki,{asChild:!0,className:"rounded-md px-2 py-1 text-muted-foreground hover:bg-accent",children:t.jsx("button",{type:"button",onClick:i,children:s})})}),e[0]=s,e[1]=i,e[2]=r):r=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(_i,{}),e[3]=h):h=e[3];let c;e[4]!==n?(c=t.jsx(us,{children:t.jsx(Vi,{className:"px-2 py-1",children:n})}),e[4]=n,e[5]=c):c=e[5];let m;e[6]!==r||e[7]!==c?(m=t.jsx(Ti,{className:"-ml-2 min-w-0",children:t.jsxs(Di,{className:"text-[15px]",children:[r,h,c]})}),e[6]=r,e[7]=c,e[8]=m):m=e[8];let f;e[9]!==a?(f=a&&t.jsx("div",{className:"shrink-0",children:a}),e[9]=a,e[10]=f):f=e[10];let d;e[11]!==m||e[12]!==f?(d=t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[m,f]}),e[11]=m,e[12]=f,e[13]=d):d=e[13];let p;e[14]!==o?(p=t.jsx("div",{className:"flex flex-col gap-10",children:o}),e[14]=o,e[15]=p):p=e[15];let x;return e[16]!==d||e[17]!==p?(x=t.jsxs("div",{className:"flex flex-col gap-8",children:[d,p]}),e[16]=d,e[17]=p,e[18]=x):x=e[18],x}const Mn=["general","connections","site"],He={general:{icon:ui,titleKey:"virtualMcp.settings.general.title",descriptionKey:"virtualMcp.settings.general.description"},connections:{icon:Ai,titleKey:"virtualMcp.settings.connections.title",descriptionKey:"virtualMcp.settings.connections.description"},site:{icon:di,titleKey:"virtualMcp.settings.site.title",descriptionKey:"virtualMcp.settings.site.description"}};function Va(l){return!!l&&Mn.includes(l)}const kn=25*1024*1024,At="home",It="knowledge";function ks(l){return l==null?"":l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(0)} KB`:`${(l/(1024*1024)).toFixed(1)} MB`}function Ge(l){return l.split("/").pop()??l}function _s(l){const e=K.c(64),{form:n}=l,s=Q(),{upload:i}=tl(At),a=sl(),o=H.useRef(null),[r,h]=H.useState(!1),[c,m]=H.useState(""),[f,d]=H.useState(!1);let p;e[0]!==r?(p={enabled:r},e[0]=r,e[1]=p):p=e[1];const{data:x}=nl(60,p),u=x===void 0?[]:x;let g;e[2]!==r?(g={enabled:r},e[2]=r,e[3]=g):g=e[3];const{data:j}=il(g),y=j===void 0?[]:j;let b;e[4]!==n?(b=()=>n.getValues("metadata.knowledge")??[],e[4]=n,e[5]=b):b=e[5];const[v,N]=H.useState(b);let M;e[6]!==n?(M=L=>{N(L),n.setValue("metadata.knowledge",L,{shouldDirty:!0})},e[6]=n,e[7]=M):M=e[7];const C=M;let w;e[8]!==a||e[9]!==v||e[10]!==C||e[11]!==s||e[12]!==i?(w=async L=>{if(!L||L.length===0)return;const ne=Array.from(L),ce=ne.filter($a),Ee=ne.filter(Pa);if(Ee.length>0&&re.warning(s("virtualMcp.filesSection.fileTooLargeTitle"),{description:s("virtualMcp.filesSection.fileTooLargeDescription",{names:Ee.map(Oa).join(", ")})}),ce.length!==0){try{await i.mutateAsync({dir:It,files:ce})}catch(D){const te=D;re.error(te instanceof Error?te.message:s("virtualMcp.filesSection.failedUploadFile"));return}C([...v,...ce.map(D=>({id:crypto.randomUUID(),name:D.name,volume:At,path:`${It}/${D.name}`,url:a(At,`${It}/${D.name}`),contentType:D.type||null,size:D.size,addedAt:new Date().toISOString()}))])}},e[8]=a,e[9]=v,e[10]=C,e[11]=s,e[12]=i,e[13]=w):w=e[13];const k=w;let S;e[14]!==a||e[15]!==v||e[16]!==C?(S=L=>{v.some(ne=>ne.volume===L.volume&&ne.path===L.path)||(C([...v,{id:crypto.randomUUID(),name:Ge(L.path),volume:L.volume,path:L.path,url:a(L.volume,L.path),contentType:null,size:L.size??null,addedAt:new Date().toISOString()}]),h(!1))},e[14]=a,e[15]=v,e[16]=C,e[17]=S):S=e[17];const _=S;let V;e[18]!==a||e[19]!==v||e[20]!==C?(V=L=>{v.some(ne=>ne.volume===L.volume&&ne.path===L.path)||(C([...v,{id:crypto.randomUUID(),name:Ge(L.path),kind:"skill",volume:L.volume,path:L.path,url:a(L.volume,L.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),h(!1))},e[18]=a,e[19]=v,e[20]=C,e[21]=V):V=e[21];const O=V;let A;e[22]!==v||e[23]!==C?(A=L=>{C(v.filter(ne=>ne.id!==L))},e[22]=v,e[23]=C,e[24]=A):A=e[24];const E=A;let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=L=>{h(L),L&&m("")},e[25]=I):I=e[25];const $=I;let F;e[26]!==v?(F=new Set(v.map(Ia)),e[26]=v,e[27]=F):F=e[27];const q=F,R=c.toLowerCase();let G;e[28]!==q?(G=L=>!q.has(`${L.volume}/${L.path}`),e[28]=q,e[29]=G):G=e[29];const U=u.filter(Aa).filter(G).filter(L=>Ge(L.path).toLowerCase().includes(R)).slice(0,5);let T;e[30]!==q?(T=L=>!q.has(`${L.volume}/${L.path}`),e[30]=q,e[31]=T):T=e[31];const P=y.filter(T).filter(L=>Ge(L.path).toLowerCase().includes(R)).slice(0,5),W=L=>t.jsxs(qs,{open:r,onOpenChange:$,children:[t.jsx(Qs,{asChild:!0,children:L}),t.jsxs(Xs,{align:"end",className:"w-56",children:[t.jsxs(Ze,{onSelect:()=>{o.current?.click()},children:[t.jsx(mi,{size:16}),s("virtualMcp.filesSection.uploadFile")]}),t.jsxs(ns,{children:[t.jsxs(is,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(el,{size:16}),s("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(ls,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(gt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:c,onChange:ne=>m(ne.target.value),onKeyDown:Da,placeholder:s("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:U.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:s("virtualMcp.filesSection.noFilesFound")}):U.map(ne=>t.jsxs(Ze,{onSelect:()=>_(ne),children:[t.jsx(gs,{filename:Ge(ne.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ge(ne.path)}),ne.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:ks(ne.size)})]},`${ne.volume}/${ne.path}`))})]})]}),t.jsxs(ns,{children:[t.jsxs(is,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(ht,{size:16}),s("virtualMcp.filesSection.selectSkill")]}),t.jsxs(ls,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(gt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:c,onChange:ne=>m(ne.target.value),onKeyDown:Ta,placeholder:s("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:P.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:s("virtualMcp.filesSection.noSkillsFound")}):P.map(ne=>t.jsxs(Ze,{onSelect:()=>O(ne),children:[t.jsx(ht,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ge(ne.path)})]},`${ne.volume}/${ne.path}`))})]})]})]})]}),B="flex flex-col gap-3";let z;e[32]!==s?(z=s("virtualMcp.filesSection.filesAndSkills"),e[32]=s,e[33]=z):z=e[33];let Y;e[34]!==z?(Y=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:z}),e[34]=z,e[35]=Y):Y=e[35];let X;e[36]!==s?(X=s("virtualMcp.filesSection.description"),e[36]=s,e[37]=X):X=e[37];let ie;e[38]!==X?(ie=t.jsx("p",{className:"text-sm text-muted-foreground",children:X}),e[38]=X,e[39]=ie):ie=e[39];let le;e[40]!==Y||e[41]!==ie?(le=t.jsxs("div",{className:"flex flex-col gap-1",children:[Y,ie]}),e[40]=Y,e[41]=ie,e[42]=le):le=e[42];const de=v.length>0&&W(t.jsxs(Z,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(ot,{size:"xs"}):t.jsx(Le,{size:14}),s("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 J;e[46]!==k?(J=t.jsx("input",{ref:o,type:"file",multiple:!0,className:"hidden",onChange:L=>{k(L.target.files),L.target.value=""}}),e[46]=k,e[47]=J):J=e[47];let ee,xe;e[48]===Symbol.for("react.memo_cache_sentinel")?(ee=L=>{L.preventDefault(),d(!0)},xe=()=>d(!1),e[48]=ee,e[49]=xe):(ee=e[48],xe=e[49]);let ge;e[50]!==k?(ge=L=>{L.preventDefault(),L.stopPropagation(),d(!1),k(L.dataTransfer.files)},e[50]=k,e[51]=ge):ge=e[51];const ke=f&&"outline outline-2 outline-dashed outline-primary";let he;e[52]!==ke?(he=pe("flex flex-col gap-2 rounded-lg",ke),e[52]=ke,e[53]=he):he=e[53];const $e=v.length===0?W(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(Le,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:s("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):v.map(L=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-card",children:[L.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(ht,{size:16})}):t.jsx(gs,{filename:L.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:L.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:L.kind==="skill"?s("virtualMcp.filesSection.kindSkill"):L.size!=null?ks(L.size):s("virtualMcp.filesSection.kindFile")})]}),t.jsx(Z,{variant:"ghost",size:"icon",onClick:()=>E(L.id),"aria-label":s("virtualMcp.filesSection.removeAriaLabel",{name:L.name}),children:t.jsx(it,{size:16})})]},L.id));let be;e[54]!==ee||e[55]!==xe||e[56]!==ge||e[57]!==he||e[58]!==$e?(be=t.jsx("div",{onDragOver:ee,onDragLeave:xe,onDrop:ge,className:he,children:$e}),e[54]=ee,e[55]=xe,e[56]=ge,e[57]=he,e[58]=$e,e[59]=be):be=e[59];let Ce;return e[60]!==oe||e[61]!==J||e[62]!==be?(Ce=t.jsxs("section",{className:B,children:[oe,J,be]}),e[60]=oe,e[61]=J,e[62]=be,e[63]=Ce):Ce=e[63],Ce}function Ta(l){return l.stopPropagation()}function Da(l){return l.stopPropagation()}function Aa(l){return l.kind!=="dir"}function Ia(l){return`${l.volume}/${l.path}`}function Oa(l){return l.name}function Pa(l){return l.size>kn}function $a(l){return l.size<=kn}function Ea(l){return l==null?"all":l.length===0?"self":"selected"}function Vs(l){const e=K.c(88),{form:n,currentAgentId:s}=l,i=Q(),{org:a}=Be(),o=cn(),[r,h]=H.useState(!1);let c;e[0]!==n?(c=n.getValues("metadata.subAgents")??null,e[0]=n,e[1]=c):c=e[1];const m=c;let f;e[2]!==m?(f=()=>Ea(m),e[2]=m,e[3]=f):f=e[3];const[d,p]=H.useState(f);let x;e[4]!==m?(x=m??[],e[4]=m,e[5]=x):x=e[5];const[u,g]=H.useState(x);let j,y,b,v,N,M;if(e[6]!==o||e[7]!==s||e[8]!==n||e[9]!==d||e[10]!==a||e[11]!==u||e[12]!==i){let S;e[19]!==s||e[20]!==a?(S=ee=>ee.id!==s&&ee.id!==a.id&&ee.status==="active",e[19]=s,e[20]=a,e[21]=S):S=e[21],j=o.filter(S);let _;e[22]!==u?(_=ee=>u.includes(ee.id),e[22]=u,e[23]=_):_=e[23];const V=j.filter(_);let O;e[24]!==n?(O=(ee,xe)=>n.setValue("metadata.subAgents",ee==="all"?null:ee==="self"?[]:xe,{shouldDirty:!0}),e[24]=n,e[25]=O):O=e[25];const A=O;let E;e[26]!==A||e[27]!==u?(E=ee=>{p(ee),A(ee,u)},e[26]=A,e[27]=u,e[28]=E):E=e[28];const I=E;let $;e[29]!==A||e[30]!==u?($=ee=>{const xe=u.includes(ee)?u.filter(ge=>ge!==ee):[...u,ee];g(xe),A("selected",xe)},e[29]=A,e[30]=u,e[31]=$):$=e[31],y=$,N="flex flex-col gap-3";let F;e[32]!==i?(F=i("virtualMcp.subAgentsSection.title"),e[32]=i,e[33]=F):F=e[33];let q;e[34]!==F?(q=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:F}),e[34]=F,e[35]=q):q=e[35];let R;e[36]!==d||e[37]!==i?(R=d==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=d,e[37]=i,e[38]=R):R=e[38];let G;e[39]!==d||e[40]!==i?(G=d==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=d,e[40]=i,e[41]=G):G=e[41];let U;e[42]!==q||e[43]!==R||e[44]!==G?(U=t.jsxs("div",{className:"flex flex-col gap-1",children:[q,R,G]}),e[42]=q,e[43]=R,e[44]=G,e[45]=U):U=e[45];const T=d==="selected"&&V.length>0&&t.jsxs(Z,{variant:"outline",size:"sm",onClick:()=>h(!0),children:[t.jsx(Le,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let P;e[46]!==I?(P=ee=>I(ee),e[46]=I,e[47]=P):P=e[47];let W;e[48]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsx(Ae,{size:"sm",className:"w-auto",children:t.jsx(Ie,{})}),e[48]=W):W=e[48];let B;e[49]!==i?(B=i("virtualMcp.subAgentsSection.anyAgent"),e[49]=i,e[50]=B):B=e[50];let z;e[51]!==B?(z=t.jsx(je,{value:"all",children:B}),e[51]=B,e[52]=z):z=e[52];let Y;e[53]!==i?(Y=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=Y):Y=e[54];let X;e[55]!==Y?(X=t.jsx(je,{value:"selected",children:Y}),e[55]=Y,e[56]=X):X=e[56];let ie;e[57]!==i?(ie=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=ie):ie=e[58];let le;e[59]!==ie?(le=t.jsx(je,{value:"self",children:ie}),e[59]=ie,e[60]=le):le=e[60];let de;e[61]!==z||e[62]!==X||e[63]!==le?(de=t.jsxs(Oe,{align:"end",children:[z,X,le]}),e[61]=z,e[62]=X,e[63]=le,e[64]=de):de=e[64];let oe;e[65]!==d||e[66]!==P||e[67]!==de?(oe=t.jsxs(Pe,{value:d,onValueChange:P,children:[W,de]}),e[65]=d,e[66]=P,e[67]=de,e[68]=oe):oe=e[68];let J;e[69]!==T||e[70]!==oe?(J=t.jsxs("div",{className:"flex items-center gap-2",children:[T,oe]}),e[69]=T,e[70]=oe,e[71]=J):J=e[71],e[72]!==U||e[73]!==J?(M=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[U,J]}),e[72]=U,e[73]=J,e[74]=M):M=e[74],b="flex flex-col gap-2",v=d==="selected"&&(V.length>0?V.map(ee=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-background",children:[t.jsx(tt,{icon:ee.icon,name:ee.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:ee.title}),ee.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ee.description})]}),t.jsx(Z,{variant:"ghost",size:"icon",onClick:()=>y(ee.id),children:t.jsx(Qt,{size:16})})]},ee.id)):t.jsxs("button",{type:"button",onClick:()=>h(!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(Le,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.emptyStateMessage")})]})),e[6]=o,e[7]=s,e[8]=n,e[9]=d,e[10]=a,e[11]=u,e[12]=i,e[13]=j,e[14]=y,e[15]=b,e[16]=v,e[17]=N,e[18]=M}else j=e[13],y=e[14],b=e[15],v=e[16],N=e[17],M=e[18];let C;e[75]!==b||e[76]!==v?(C=t.jsx("div",{className:b,children:v}),e[75]=b,e[76]=v,e[77]=C):C=e[77];let w;e[78]!==j||e[79]!==y||e[80]!==r||e[81]!==u?(w=t.jsx(Fa,{open:r,onOpenChange:h,candidates:j,selectedIds:u,onToggle:y}),e[78]=j,e[79]=y,e[80]=r,e[81]=u,e[82]=w):w=e[82];let k;return e[83]!==N||e[84]!==M||e[85]!==C||e[86]!==w?(k=t.jsxs("section",{className:N,children:[M,C,w]}),e[83]=N,e[84]=M,e[85]=C,e[86]=w,e[87]=k):k=e[87],k}function Fa(l){const e=K.c(39),{open:n,onOpenChange:s,candidates:i,selectedIds:a,onToggle:o}=l,r=Q(),[h,c]=H.useState("");let m,f,d,p,x,u,g,j,y;if(e[0]!==i||e[1]!==s||e[2]!==o||e[3]!==n||e[4]!==h||e[5]!==a||e[6]!==r){const M=h.toLowerCase(),C=i.filter(S=>S.title.toLowerCase().includes(M)||S.description?.toLowerCase().includes(M));f=ct,j=n,y=s,m=dt,x="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?(u=t.jsx(Ct,{children:t.jsx(Mt,{children:w})}),e[18]=w,e[19]=u):u=e[19];let k;e[20]!==r?(k=r("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=r,e[21]=k):k=e[21],e[22]!==h||e[23]!==k?(g=t.jsx(ll,{value:h,onChange:c,placeholder:k,className:"w-full"}),e[22]=h,e[23]=k,e[24]=g):g=e[24],d="flex flex-col gap-1 max-h-80 overflow-y-auto",p=C.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:r("virtualMcp.subAgentsSection.noAgentsFound")}):C.map(S=>t.jsxs("button",{type:"button",onClick:()=>o(S.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(fn,{checked:a.includes(S.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(tt,{icon:S.icon,name:S.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:S.title}),S.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S.description})]})]},S.id)),e[0]=i,e[1]=s,e[2]=o,e[3]=n,e[4]=h,e[5]=a,e[6]=r,e[7]=m,e[8]=f,e[9]=d,e[10]=p,e[11]=x,e[12]=u,e[13]=g,e[14]=j,e[15]=y}else m=e[7],f=e[8],d=e[9],p=e[10],x=e[11],u=e[12],g=e[13],j=e[14],y=e[15];let b;e[25]!==d||e[26]!==p?(b=t.jsx("div",{className:d,children:p}),e[25]=d,e[26]=p,e[27]=b):b=e[27];let v;e[28]!==m||e[29]!==x||e[30]!==u||e[31]!==g||e[32]!==b?(v=t.jsxs(m,{className:x,children:[u,g,b]}),e[28]=m,e[29]=x,e[30]=u,e[31]=g,e[32]=b,e[33]=v):v=e[33];let N;return e[34]!==f||e[35]!==j||e[36]!==y||e[37]!==v?(N=t.jsx(f,{open:j,onOpenChange:y,children:v}),e[34]=f,e[35]=j,e[36]=y,e[37]=v,e[38]=N):N=e[38],N}function nt(){const l=K.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(ot,{className:"size-6 text-muted-foreground"})}),l[0]=e):e=l[0],e}function xt(l,e){return({error:n})=>n?.message?.includes("Method not found")||n?.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(Js,{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:n?.message?n.message.length>200?`${n.message.slice(0,200)}...`:n.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function _n(l){const e=K.c(23),{item:n,isSelected:s,onToggle:i,disabled:a}=l,o=a?"cursor-not-allowed opacity-50":"cursor-pointer",r=s?"bg-accent/25":"hover:bg-muted/50";let h;e[0]!==o||e[1]!==r?(h=pe("flex items-start gap-3 p-4 rounded-lg transition-colors",o,r),e[0]=o,e[1]=r,e[2]=h):h=e[2];let c;e[3]!==n.name?(c=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:n.name}),e[3]=n.name,e[4]=c):c=e[4];let m;e[5]!==n.tags?(m=n.tags&&t.jsx("span",{className:"shrink-0",children:n.tags}),e[5]=n.tags,e[6]=m):m=e[6];let f;e[7]!==c||e[8]!==m?(f=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c,m]}),e[7]=c,e[8]=m,e[9]=f):f=e[9];let d;e[10]!==n.description?(d=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[10]=n.description,e[11]=d):d=e[11];let p;e[12]!==f||e[13]!==d?(p=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[f,d]}),e[12]=f,e[13]=d,e[14]=p):p=e[14];let x;e[15]!==a||e[16]!==s||e[17]!==i?(x=t.jsx(fn,{checked:s,onCheckedChange:i,disabled:a,className:"mt-0.5"}),e[15]=a,e[16]=s,e[17]=i,e[18]=x):x=e[18];let u;return e[19]!==h||e[20]!==p||e[21]!==x?(u=t.jsxs("label",{className:h,children:[p,x]}),e[19]=h,e[20]=p,e[21]=x,e[22]=u):u=e[22],u}function za(l){const e=K.c(35),{activeTab:n,onTabChange:s,showSelectAll:i,isAllSelected:a,handleSelectAll:o}=l,r=Q();let h;e[0]!==r?(h=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=h):h=e[1];let c;e[2]!==h?(c={id:"tools",label:h},e[2]=h,e[3]=c):c=e[3];let m;e[4]!==r?(m=r("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=r,e[5]=m):m=e[5];let f;e[6]!==m?(f={id:"active",label:m},e[6]=m,e[7]=f):f=e[7];let d;e[8]!==r?(d=r("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=r,e[9]=d):d=e[9];let p;e[10]!==d?(p={id:"resources",label:d},e[10]=d,e[11]=p):p=e[11];let x;e[12]!==r?(x=r("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=r,e[13]=x):x=e[13];let u;e[14]!==x?(u={id:"prompts",label:x},e[14]=x,e[15]=u):u=e[15];let g;e[16]!==c||e[17]!==f||e[18]!==p||e[19]!==u?(g=[c,f,p,u],e[16]=c,e[17]=f,e[18]=p,e[19]=u,e[20]=g):g=e[20];let j;e[21]!==s?(j=N=>s(N),e[21]=s,e[22]=j):j=e[22];let y;e[23]!==n||e[24]!==j||e[25]!==g?(y=t.jsx(al,{tabs:g,activeTab:n,onTabChange:j}),e[23]=n,e[24]=j,e[25]=g,e[26]=y):y=e[26];let b;e[27]!==o||e[28]!==a||e[29]!==i||e[30]!==r?(b=i&&t.jsx("button",{type:"button",onClick:o,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(a?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=o,e[28]=a,e[29]=i,e[30]=r,e[31]=b):b=e[31];let v;return e[32]!==y||e[33]!==b?(v=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[y,b]}),e[32]=y,e[33]=b,e[34]=v):v=e[34],v}function Jt(l){const e=K.c(13),{items:n,selections:s,onToggle:i,emptyMessage:a,disabled:o}=l;let r,h,c;if(e[0]!==o||e[1]!==a||e[2]!==n||e[3]!==i||e[4]!==s){c=Symbol.for("react.early_return_sentinel");e:{const f=n.map(Ra);if(n.length===0){let d;e[8]!==a?(d=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]=d):d=e[9],c=d;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",h=n.map(d=>t.jsx(_n,{item:d,isSelected:s===null||s?.includes(d.id),onToggle:()=>i(d.id,f),disabled:o},d.id))}e[0]=o,e[1]=a,e[2]=n,e[3]=i,e[4]=s,e[5]=r,e[6]=h,e[7]=c}else r=e[5],h=e[6],c=e[7];if(c!==Symbol.for("react.early_return_sentinel"))return c;let m;return e[10]!==r||e[11]!==h?(m=t.jsx("div",{className:r,children:h}),e[10]=r,e[11]=h,e[12]=m):m=e[12],m}function Ra(l){return l.id}function La(l){const e=K.c(22),{connectionId:n,toolSelections:s,onToggleTool:i}=l,a=Q(),{org:o}=Be();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=kt(r);let c;e[4]!==h?(c={client:h},e[4]=h,e[5]=c):c=e[5];const{data:m}=hn(c),f=m.tools;let d,p,x;if(e[6]!==m.tools||e[7]!==i||e[8]!==a||e[9]!==s){x=Symbol.for("react.early_return_sentinel");e:{const g=f.map(Ua);let j;e[13]!==s?(j=v=>s===null||s.includes(v.name),e[13]=s,e[14]=j):j=e[14];const b=m.tools.filter(j).map(Ba);if(b.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],x=N;break e}d="flex-1 overflow-auto px-4 py-3 space-y-1",p=b.map(v=>t.jsx(_n,{item:v,isSelected:!0,onToggle:()=>i(v.id,g)},v.id))}e[6]=m.tools,e[7]=i,e[8]=a,e[9]=s,e[10]=d,e[11]=p,e[12]=x}else d=e[10],p=e[11],x=e[12];if(x!==Symbol.for("react.early_return_sentinel"))return x;let u;return e[19]!==d||e[20]!==p?(u=t.jsx("div",{className:d,children:p}),e[19]=d,e[20]=p,e[21]=u):u=e[21],u}function Ba(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(pn,{annotations:l.annotations,_meta:l._meta})}}function Ua(l){return l.name}function Ya(l){const e=K.c(16),{connectionId:n,selections:s,onToggle:i,disabled:a}=l,{org:o}=Be();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=kt(r);let c;e[4]!==h?(c={client:h},e[4]=h,e[5]=c):c=e[5];const{data:m}=hn(c);let f;e[6]!==m.tools?(f=m.tools.map(Ka),e[6]=m.tools,e[7]=f):f=e[7];const d=f,p=Q();let x;e[8]!==p?(x=p("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=p,e[9]=x):x=e[9];let u;return e[10]!==a||e[11]!==d||e[12]!==i||e[13]!==s||e[14]!==x?(u=t.jsx(Jt,{items:d,selections:s,onToggle:i,emptyMessage:x,disabled:a}),e[10]=a,e[11]=d,e[12]=i,e[13]=s,e[14]=x,e[15]=u):u=e[15],u}function Ka(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(pn,{annotations:l.annotations,_meta:l._meta})}}function Ga(l){const e=K.c(16),{connectionId:n,selections:s,onToggle:i,disabled:a}=l,{org:o}=Be();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=kt(r);let c;e[4]!==h?(c={client:h},e[4]=h,e[5]=c):c=e[5];const{data:m}=$n(c);let f;e[6]!==m.resources?(f=m.resources.map(Wa),e[6]=m.resources,e[7]=f):f=e[7];const d=f,p=Q();let x;e[8]!==p?(x=p("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=p,e[9]=x):x=e[9];let u;return e[10]!==a||e[11]!==d||e[12]!==i||e[13]!==s||e[14]!==x?(u=t.jsx(Jt,{items:d,selections:s,onToggle:i,emptyMessage:x,disabled:a}),e[10]=a,e[11]=d,e[12]=i,e[13]=s,e[14]=x,e[15]=u):u=e[15],u}function Wa(l){return{id:l.name||l.uri,name:l.name||l.uri,description:l.description}}function Ha(l){const e=K.c(16),{connectionId:n,selections:s,onToggle:i,disabled:a}=l,{org:o}=Be();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=kt(r);let c;e[4]!==h?(c={client:h},e[4]=h,e[5]=c):c=e[5];const{data:m}=rl(c);let f;e[6]!==m.prompts?(f=m.prompts.map(qa),e[6]=m.prompts,e[7]=f):f=e[7];const d=f,p=Q();let x;e[8]!==p?(x=p("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=p,e[9]=x):x=e[9];let u;return e[10]!==a||e[11]!==d||e[12]!==i||e[13]!==s||e[14]!==x?(u=t.jsx(Jt,{items:d,selections:s,onToggle:i,emptyMessage:x,disabled:a}),e[10]=a,e[11]=d,e[12]=i,e[13]=s,e[14]=x,e[15]=u):u=e[15],u}function qa(l){return{id:l.name,name:l.name,description:l.description}}function Qa(l){const e=K.c(58),{currentConnection:n,activeTab:s,selectedId:i,formData:a,toggleTool:o,toggleResource:r,togglePrompt:h,toggleAllTools:c,toggleAllResources:m,toggleAllPrompts:f,onTabChange:d}=l,p=Q(),x=a[i],u=s==="tools"?x?.tools===null:s==="resources"?x?.resources===null:s==="prompts"?x?.prompts===null:!1,g=s!=="active";let j;e[0]!==s||e[1]!==i||e[2]!==f||e[3]!==m||e[4]!==c?(j=()=>{s==="tools"?c(i):s==="resources"?m(i):s==="prompts"&&f(i)},e[0]=s,e[1]=i,e[2]=f,e[3]=m,e[4]=c,e[5]=j):j=e[5];const y=j;let b;e[6]!==n.icon||e[7]!==n.title?(b=t.jsx(tt,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[6]=n.icon,e[7]=n.title,e[8]=b):b=e[8];let v;e[9]!==n.title?(v=t.jsx("h2",{className:"text-base font-semibold truncate",children:n.title}),e[9]=n.title,e[10]=v):v=e[10];let N;e[11]!==n.description?(N=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[11]=n.description,e[12]=N):N=e[12];let M;e[13]!==v||e[14]!==N?(M=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,N]}),e[13]=v,e[14]=N,e[15]=M):M=e[15];let C;e[16]!==b||e[17]!==M?(C=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[b,M]})}),e[16]=b,e[17]=M,e[18]=C):C=e[18];let w;e[19]!==s||e[20]!==y||e[21]!==u||e[22]!==d||e[23]!==g?(w=t.jsx(za,{activeTab:s,onTabChange:d,showSelectAll:g,isAllSelected:u,handleSelectAll:y}),e[19]=s,e[20]=y,e[21]=u,e[22]=d,e[23]=g,e[24]=w):w=e[24];let k;e[25]!==s||e[26]!==a||e[27]!==i||e[28]!==p||e[29]!==o?(k=s==="active"&&t.jsx(Ye,{fallback:xt(p("virtualMcp.dependencySelectionDialog.toolsNotSupported"),p),children:t.jsx(H.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(La,{connectionId:i,toolSelections:a[i]?a[i].tools:[],onToggleTool:(E,I)=>o(i,E,I)})})}),e[25]=s,e[26]=a,e[27]=i,e[28]=p,e[29]=o,e[30]=k):k=e[30];let S;e[31]!==s||e[32]!==a||e[33]!==i||e[34]!==p||e[35]!==o?(S=s==="tools"&&t.jsx(Ye,{fallback:xt(p("virtualMcp.dependencySelectionDialog.toolsNotSupported"),p),children:t.jsx(H.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(Ya,{connectionId:i,selections:a[i]?a[i].tools:[],onToggle:(E,I)=>o(i,E,I)})})}),e[31]=s,e[32]=a,e[33]=i,e[34]=p,e[35]=o,e[36]=S):S=e[36];let _;e[37]!==s||e[38]!==a||e[39]!==i||e[40]!==p||e[41]!==r?(_=s==="resources"&&t.jsx(Ye,{fallback:xt(p("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),p),children:t.jsx(H.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(Ga,{connectionId:i,selections:a[i]?a[i].resources:[],onToggle:(E,I)=>r(i,E,I)})})}),e[37]=s,e[38]=a,e[39]=i,e[40]=p,e[41]=r,e[42]=_):_=e[42];let V;e[43]!==s||e[44]!==a||e[45]!==i||e[46]!==p||e[47]!==h?(V=s==="prompts"&&t.jsx(Ye,{fallback:xt(p("virtualMcp.dependencySelectionDialog.promptsNotSupported"),p),children:t.jsx(H.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(Ha,{connectionId:i,selections:a[i]?a[i].prompts:[],onToggle:(E,I)=>h(i,E,I)})})}),e[43]=s,e[44]=a,e[45]=i,e[46]=p,e[47]=h,e[48]=V):V=e[48];let O;e[49]!==_||e[50]!==V||e[51]!==k||e[52]!==S?(O=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[k,S,_,V]}),e[49]=_,e[50]=V,e[51]=k,e[52]=S,e[53]=O):O=e[53];let A;return e[54]!==O||e[55]!==C||e[56]!==w?(A=t.jsxs(t.Fragment,{children:[C,w,O]}),e[54]=O,e[55]=C,e[56]=w,e[57]=A):A=e[57],A}function Xa(l){const e=K.c(7),{onClose:n}=l,s=Q();let i;e[0]!==n?(i=()=>n(!1),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==s?(a=s("virtualMcp.dependencySelectionDialog.done"),e[2]=s,e[3]=a):a=e[3];let o;return e[4]!==i||e[5]!==a?(o=t.jsx(mn,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(Z,{variant:"outline",onClick:i,children:a})}),e[4]=i,e[5]=a,e[6]=o):o=e[6],o}function Ja(l){const e=K.c(23),{connectionId:n,onAuthenticate:s,children:i}=l,a=Q();let o;e[0]!==n?(o={connectionId:n},e[0]=n,e[1]=o):o=e[1];const r=xn(o);if(r.supportsOAuth&&!r.isAuthenticated){let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(fi,{size:22,className:"text-muted-foreground"})}),e[2]=m):m=e[2];let f;e[3]!==a?(f=a("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=a,e[4]=f):f=e[4];let d;e[5]!==f?(d=t.jsx("p",{className:"text-sm font-medium",children:f}),e[5]=f,e[6]=d):d=e[6];let p;e[7]!==a?(p=a("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=a,e[8]=p):p=e[8];let x;e[9]!==p?(x=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:p}),e[9]=p,e[10]=x):x=e[10];let u;e[11]!==d||e[12]!==x?(u=t.jsxs("div",{className:"space-y-1",children:[d,x]}),e[11]=d,e[12]=x,e[13]=u):u=e[13];let g;e[14]!==n||e[15]!==s||e[16]!==a?(g=s&&t.jsx(Z,{variant:"outline",size:"sm",onClick:()=>s(n),children:a("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=n,e[15]=s,e[16]=a,e[17]=g):g=e[17];let j;return e[18]!==u||e[19]!==g?(j=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[m,u,g]}),e[18]=u,e[19]=g,e[20]=j):j=e[20],j}let c;return e[21]!==i?(c=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=c):c=e[22],c}function Za(l){const e={};for(const n of l)e[n.connection_id]={tools:n.selected_tools,resources:n.selected_resources??null,prompts:n.selected_prompts??null};return e}function Ts(l){return Object.entries(l).map(([e,n])=>({connection_id:e,selected_tools:n.tools,selected_resources:n.resources,selected_prompts:n.prompts}))}function Ds(l,e,n,s){const i=l[e]??{tools:null,resources:null,prompts:null};return{...l,[e]:{...i,[n]:s}}}function er(l,e){return e.type==="SET_ACTIVE_TAB"?{...l,activeTab:e.payload}:l}function tr(l){const e=K.c(49),{open:n,onOpenChange:s,selectedId:i,form:a,connections:o,onAuthenticate:r}=l;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activeTab:"tools"},e[0]=h):h=e[0];const[c,m]=H.useReducer(er,h),f=qt(i??"");let d;e[1]!==o?(d=o??[],e[1]=o,e[2]=d):d=e[2];let p;e[3]!==d?(p=Za(d),e[3]=d,e[4]=p):p=e[4];const x=p;let u;e[5]!==a||e[6]!==x?(u=(U,T,P,W)=>{const B=x[U]?.[T];let z;B===null?z=W.filter(Y=>Y!==P):B?.includes(P)?z=B.filter(Y=>Y!==P):(z=[...B??[],P],z.length===W.length&&(z=null)),a.setValue("connections",Ts(Ds(x,U,T,z)),{shouldDirty:!0,shouldTouch:!0})},e[5]=a,e[6]=x,e[7]=u):u=e[7];const g=u;let j;e[8]!==a||e[9]!==x?(j=(U,T)=>{const W=x[U]?.[T]===null?[]:null;a.setValue("connections",Ts(Ds(x,U,T,W)),{shouldDirty:!0,shouldTouch:!0})},e[8]=a,e[9]=x,e[10]=j):j=e[10];const y=j;let b;e[11]!==g?(b=(U,T,P)=>g(U,"tools",T,P),e[11]=g,e[12]=b):b=e[12];const v=b;let N;e[13]!==g?(N=(U,T,P)=>g(U,"resources",T,P),e[13]=g,e[14]=N):N=e[14];const M=N;let C;e[15]!==g?(C=(U,T,P)=>g(U,"prompts",T,P),e[15]=g,e[16]=C):C=e[16];const w=C;let k;e[17]!==y?(k=U=>y(U,"tools"),e[17]=y,e[18]=k):k=e[18];const S=k;let _;e[19]!==y?(_=U=>y(U,"resources"),e[19]=y,e[20]=_):_=e[20];const V=_;let O;e[21]!==y?(O=U=>y(U,"prompts"),e[21]=y,e[22]=O):O=e[22];const A=O;if(!i||!f)return null;let E;e[23]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(nt,{}),e[23]=E):E=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=U=>m({type:"SET_ACTIVE_TAB",payload:U}),e[24]=I):I=e[24];let $;e[25]!==f||e[26]!==c.activeTab||e[27]!==x||e[28]!==i||e[29]!==A||e[30]!==V||e[31]!==S||e[32]!==w||e[33]!==M||e[34]!==v?($=t.jsx(Qa,{currentConnection:f,activeTab:c.activeTab,selectedId:i,formData:x,toggleTool:v,toggleResource:M,togglePrompt:w,toggleAllTools:S,toggleAllResources:V,toggleAllPrompts:A,onTabChange:I},i),e[25]=f,e[26]=c.activeTab,e[27]=x,e[28]=i,e[29]=A,e[30]=V,e[31]=S,e[32]=w,e[33]=M,e[34]=v,e[35]=$):$=e[35];let F;e[36]!==r||e[37]!==i||e[38]!==$?(F=t.jsx(H.Suspense,{fallback:E,children:t.jsx(Ja,{connectionId:i,onAuthenticate:r,children:$})}),e[36]=r,e[37]=i,e[38]=$,e[39]=F):F=e[39];let q;e[40]!==s?(q=t.jsx(Xa,{onClose:s}),e[40]=s,e[41]=q):q=e[41];let R;e[42]!==F||e[43]!==q?(R=t.jsxs(dt,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[F,q]}),e[42]=F,e[43]=q,e[44]=R):R=e[44];let G;return e[45]!==s||e[46]!==n||e[47]!==R?(G=t.jsx(ct,{open:n,onOpenChange:s,children:R}),e[45]=s,e[46]=n,e[47]=R,e[48]=G):G=e[48],G}const As="__new_instance__";function Is(l){const e=K.c(25),{connection_id:n,usedConnectionIds:s,onOpenSettings:i,onRemove:a,onAuthenticate:o,onSwitchInstance:r,onNewInstance:h}=l,c=qt(n),{org:m}=Be();if(!c){let g;return e[0]!==a?(g=t.jsx(lr,{onRemove:a}),e[0]=a,e[1]=g):g=e[1],g}let f;e[2]!==c?(f=ol(c),e[2]=c,e[3]=f):f=e[3];const d=f;let p;e[4]!==n?(p=t.jsx(ir,{connection_id:n}),e[4]=n,e[5]=p):p=e[5];let x;e[6]!==c.app_name||e[7]!==c.connection_type||e[8]!==c.description||e[9]!==c.icon||e[10]!==c.status||e[11]!==c.title||e[12]!==n||e[13]!==o||e[14]!==h||e[15]!==i||e[16]!==a||e[17]!==r||e[18]!==m.slug||e[19]!==d||e[20]!==s?(x=t.jsx(nr,{connection_id:n,connectionTitle:c.title,connectionDescription:c.description,connectionIcon:c.icon,connectionType:c.connection_type,connectionStatus:c.status,slug:d,orgSlug:m.slug,appName:c.app_name,usedConnectionIds:s,onOpenSettings:i,onRemove:a,onAuthenticate:o,onSwitchInstance:r,onNewInstance:h}),e[6]=c.app_name,e[7]=c.connection_type,e[8]=c.description,e[9]=c.icon,e[10]=c.status,e[11]=c.title,e[12]=n,e[13]=o,e[14]=h,e[15]=i,e[16]=a,e[17]=r,e[18]=m.slug,e[19]=d,e[20]=s,e[21]=x):x=e[21];let u;return e[22]!==p||e[23]!==x?(u=t.jsx(H.Suspense,{fallback:p,children:x}),e[22]=p,e[23]=x,e[24]=u):u=e[24],u}function sr(l){const e=K.c(24),{appName:n,connectionId:s,usedConnectionIds:i,onSwitchInstance:a,onNewInstance:o}=l,r=Q();let h;e[0]!==n?(h={filters:[{column:"app_name",value:n}]},e[0]=n,e[1]=h):h=e[1];const c=Li(h);if(c.length<=1&&!o)return null;let m;e[2]!==s||e[3]!==o||e[4]!==a?(m=g=>{g===As?o?.():a(s,g)},e[2]=s,e[3]=o,e[4]=a,e[5]=m):m=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ae,{size:"sm",className:"w-auto text-xs gap-1 px-2 shadow-none",children:t.jsx(Ie,{})}),e[6]=f):f=e[6];let d;if(e[7]!==s||e[8]!==c||e[9]!==i){let g;e[11]!==s||e[12]!==i?(g=j=>t.jsx(je,{value:j.id,className:"text-xs",disabled:j.id!==s&&i.has(j.id),children:j.title},j.id),e[11]=s,e[12]=i,e[13]=g):g=e[13],d=c.map(g),e[7]=s,e[8]=c,e[9]=i,e[10]=d}else d=e[10];let p;e[14]!==o||e[15]!==r?(p=o&&t.jsxs(je,{value:As,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=o,e[15]=r,e[16]=p):p=e[16];let x;e[17]!==d||e[18]!==p?(x=t.jsxs(Oe,{children:[d,p]}),e[17]=d,e[18]=p,e[19]=x):x=e[19];let u;return e[20]!==s||e[21]!==m||e[22]!==x?(u=t.jsxs(Pe,{value:s,onValueChange:m,children:[f,x]}),e[20]=s,e[21]=m,e[22]=x,e[23]=u):u=e[23],u}function nr({connection_id:l,connectionTitle:e,connectionDescription:n,connectionIcon:s,connectionType:i,connectionStatus:a,slug:o,orgSlug:r,appName:h,usedConnectionIds:c,onOpenSettings:m,onRemove:f,onAuthenticate:d,onSwitchInstance:p,onNewInstance:x}){const u=xn({connectionId:l}),g=on(),y=!(i==="VIRTUAL")&&u.supportsOAuth&&!u.isAuthenticated,b=a!=="active",v=Q(),N=async M=>{try{await g.update.mutateAsync({id:l,data:{status:M}}),re.success(v(M==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{re.error(v("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:pe("rounded-xl border overflow-hidden transition-colors",y||b?"border-destructive/50 bg-destructive/5":"border-border bg-card"),children:[t.jsxs(Zs,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:o},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors",children:[t.jsx(tt,{icon:s,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")}):b?t.jsx("span",{className:"text-xs text-destructive font-medium",children:v(a==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):n&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n})]}),y?t.jsx(Z,{variant:"outline",size:"sm",className:"h-7 text-xs shrink-0",onClick:M=>{M.preventDefault(),M.stopPropagation(),d(l)},children:v("virtualMcp.connectionItem.authorize")}):b?t.jsxs(Z,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:M=>{M.preventDefault(),M.stopPropagation(),N("active")},children:[t.jsx(pi,{size:13}),v("virtualMcp.connectionItem.enable")]}):t.jsxs(ye,{delayDuration:0,children:[t.jsx(we,{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(Ci,{size:16})})}),t.jsx(Se,{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:[h&&t.jsx(sr,{appName:h,connectionId:l,usedConnectionIds:c,onSwitchInstance:p,onNewInstance:x}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(ye,{delayDuration:0,children:[t.jsx(we,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:m,"aria-label":v("virtualMcp.connectionItem.configureResources"),children:t.jsx(xi,{size:13})})}),t.jsx(Se,{side:"bottom",children:v("virtualMcp.connectionItem.configureResources")})]}),!b&&t.jsxs(ye,{delayDuration:0,children:[t.jsx(we,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>N("inactive"),"aria-label":v("virtualMcp.connectionItem.disableConnection"),children:t.jsx(hi,{size:13})})}),t.jsx(Se,{side:"bottom",children:v("virtualMcp.connectionItem.disable")})]}),t.jsxs(ye,{delayDuration:0,children:[t.jsx(we,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:f,"aria-label":v("virtualMcp.connectionItem.removeConnection"),children:t.jsx(Qt,{size:13})})}),t.jsx(Se,{side:"bottom",children:v("virtualMcp.connectionItem.remove")})]})]})]})]})}function ir(l){const e=K.c(17),{connection_id:n}=l,s=qt(n);if(!s){let f;return e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(zt,{}),e[0]=f):f=e[0],f}let i;e[1]!==s.icon||e[2]!==s.title?(i=t.jsx(tt,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[1]=s.icon,e[2]=s.title,e[3]=i):i=e[3];let a;e[4]!==s.title?(a=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[4]=s.title,e[5]=a):a=e[5];let o;e[6]!==s.description?(o=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[6]=s.description,e[7]=o):o=e[7];let r;e[8]!==a||e[9]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,o]}),e[8]=a,e[9]=o,e[10]=r):r=e[10];let h;e[11]!==i||e[12]!==r?(h=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,r]}),e[11]=i,e[12]=r,e[13]=h):h=e[13];let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=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]=c):c=e[14];let m;return e[15]!==h?(m=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[h,c]}),e[15]=h,e[16]=m):m=e[16],m}function lr(l){const e=K.c(20),{onRemove:n}=l,s=Q();let i;e[0]!==s?(i=s("virtualMcp.connectionItem.connectionNotFound"),e[0]=s,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 o;e[4]!==s?(o=s("virtualMcp.connectionItem.removeConnection"),e[4]=s,e[5]=o):o=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{size:13}),e[6]=r):r=e[6];let h;e[7]!==n||e[8]!==o?(h=t.jsx(we,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive shrink-0",onClick:n,"aria-label":o,children:r})}),e[7]=n,e[8]=o,e[9]=h):h=e[9];let c;e[10]!==s?(c=s("virtualMcp.connectionItem.remove"),e[10]=s,e[11]=c):c=e[11];let m;e[12]!==c?(m=t.jsx(Se,{side:"bottom",children:c}),e[12]=c,e[13]=m):m=e[13];let f;e[14]!==h||e[15]!==m?(f=t.jsxs(ye,{delayDuration:0,children:[h,m]}),e[14]=h,e[15]=m,e[16]=f):f=e[16];let d;return e[17]!==a||e[18]!==f?(d=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[a,f]}),e[17]=a,e[18]=f,e[19]=d):d=e[19],d}function zt(){const l=K.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 n;l[1]===Symbol.for("react.memo_cache_sentinel")?(n=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]=n):n=l[1];let s;return l[2]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[n,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]=s):s=l[2],s}function ar(l){const e=K.c(5),{value:n}=l;let s;if(e[0]!==n){s=Symbol.for("react.early_return_sentinel");e:{const a=Bt(n);if(a.type==="icon"){const o=Yt(a.name);if(o){let r;e[2]!==o?(r=t.jsx(o,{size:16,className:"text-muted-foreground"}),e[2]=o,e[3]=r):r=e[3],s=r;break e}}}e[0]=n,e[1]=s}else s=e[1];if(s!==Symbol.for("react.early_return_sentinel"))return s;let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(cl,{size:16,className:"text-muted-foreground"}),e[4]=i):i=e[4],i}function Vn(l){const e=K.c(74),{value:n,onChange:s,className:i,disabled:a}=l,o=Q(),[r,h]=H.useState(!1),[c,m]=H.useState("");let f;e[0]!==n?(f=Bt(n),e[0]=n,e[1]=f):f=e[1];const d=f,p=d.type==="icon"?d.name:null;let x,u,g,j,y,b,v,N,M,C,w,k,S,_,V;if(e[2]!==i||e[3]!==p||e[4]!==a||e[5]!==s||e[6]!==r||e[7]!==c||e[8]!==o||e[9]!==n){const q=Ut();j=ln(q,c),g=Ht,y=a?!1:r,b=h;let R;e[25]!==o?(R=o("common.simpleIconPicker.changeIcon"),e[25]=o,e[26]=R):R=e[26];const G=a?"cursor-default opacity-50":"cursor-pointer hover:bg-accent";let U;e[27]!==i||e[28]!==G?(U=pe("size-7 shrink-0 classic:rounded-md compact:rounded-lg transition-colors flex items-center justify-center",G,i),e[27]=i,e[28]=G,e[29]=U):U=e[29];let T;e[30]!==n?(T=t.jsx(ar,{value:n}),e[30]=n,e[31]=T):T=e[31],e[32]!==a||e[33]!==R||e[34]!==U||e[35]!==T?(v=t.jsx(Gt,{asChild:!0,children:t.jsx("button",{type:"button",disabled:a,"aria-label":R,className:U,children:T})}),e[32]=a,e[33]=R,e[34]=U,e[35]=T,e[36]=v):v=e[36],u=Wt,S="start",_="w-64 p-0",V=rr,w="flex flex-col";let P;e[37]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(gt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[37]=P):P=e[37];let W;e[38]===Symbol.for("react.memo_cache_sentinel")?(W=Y=>m(Y.target.value),e[38]=W):W=e[38];let B;e[39]!==o?(B=o("common.simpleIconPicker.filterPlaceholder"),e[39]=o,e[40]=B):B=e[40],e[41]!==c||e[42]!==B?(k=t.jsx("div",{className:"px-2 py-2",children:t.jsxs("div",{className:"relative",children:[P,t.jsx(Me,{value:c,onChange:W,placeholder:B,className:"h-7 text-xs pl-7"})]})}),e[41]=c,e[42]=B,e[43]=k):k=e[43],x=rn,C="h-48",N="grid grid-cols-8 gap-0.5 px-2 pb-2";let z;e[44]!==p||e[45]!==s?(z=Y=>{const X=Yt(Y);return X?t.jsx("button",{type:"button",onClick:()=>{s(`icon://${Y}`),h(!1)},className:pe("h-7 w-7 flex items-center justify-center classic:rounded-md compact:rounded-lg transition-colors cursor-pointer",p===Y?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground"),title:$t(Y),"aria-label":$t(Y),children:t.jsx(X,{size:16})},Y):null},e[44]=p,e[45]=s,e[46]=z):z=e[46],M=j.map(z),e[2]=i,e[3]=p,e[4]=a,e[5]=s,e[6]=r,e[7]=c,e[8]=o,e[9]=n,e[10]=x,e[11]=u,e[12]=g,e[13]=j,e[14]=y,e[15]=b,e[16]=v,e[17]=N,e[18]=M,e[19]=C,e[20]=w,e[21]=k,e[22]=S,e[23]=_,e[24]=V}else x=e[10],u=e[11],g=e[12],j=e[13],y=e[14],b=e[15],v=e[16],N=e[17],M=e[18],C=e[19],w=e[20],k=e[21],S=e[22],_=e[23],V=e[24];let O;e[47]!==N||e[48]!==M?(O=t.jsx("div",{className:N,children:M}),e[47]=N,e[48]=M,e[49]=O):O=e[49];let A;e[50]!==j.length||e[51]!==o?(A=j.length===0&&t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:o("common.simpleIconPicker.noIconsFound")}),e[50]=j.length,e[51]=o,e[52]=A):A=e[52];let E;e[53]!==x||e[54]!==O||e[55]!==A||e[56]!==C?(E=t.jsxs(x,{className:C,children:[O,A]}),e[53]=x,e[54]=O,e[55]=A,e[56]=C,e[57]=E):E=e[57];let I;e[58]!==E||e[59]!==w||e[60]!==k?(I=t.jsxs("div",{className:w,children:[k,E]}),e[58]=E,e[59]=w,e[60]=k,e[61]=I):I=e[61];let $;e[62]!==u||e[63]!==I||e[64]!==S||e[65]!==_||e[66]!==V?($=t.jsx(u,{align:S,className:_,onOpenAutoFocus:V,children:I}),e[62]=u,e[63]=I,e[64]=S,e[65]=_,e[66]=V,e[67]=$):$=e[67];let F;return e[68]!==g||e[69]!==y||e[70]!==b||e[71]!==v||e[72]!==$?(F=t.jsxs(g,{open:y,onOpenChange:b,children:[v,$]}),e[68]=g,e[69]=y,e[70]=b,e[71]=v,e[72]=$,e[73]=F):F=e[73],F}function rr(l){return l.preventDefault()}function Tn(l){const e=K.c(10),{viewId:n}=l;if(n==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(an,{size:16}),e[0]=i):i=e[0],i}if(n==="reports"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(os,{size:16}),e[1]=i):i=e[1],i}if(n==="board"){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(gi,{size:16}),e[2]=i):i=e[2],i}if(n==="site-editor"){let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ml,{size:16}),e[3]=i):i=e[3],i}if(n==="assets"){let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ul,{size:16}),e[4]=i):i=e[4],i}if(n==="hosting"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(En,{size:16}),e[5]=i):i=e[5],i}if(n==="e2e"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(vi,{size:16}),e[6]=i):i=e[6],i}if(n==="analytics"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(os,{size:16}),e[7]=i):i=e[7],i}if(n==="cdn"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ji,{size:16}),e[8]=i):i=e[8],i}let s;return e[9]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Kt,{size:16}),e[9]=s):s=e[9],s}function yt(l){const e=K.c(51),{pinned:n,canSetMainView:s,onOpen:i,onTogglePin:a,onSetMainView:o}=l,r=Q(),h=n?"text-foreground":"text-muted-foreground/40";let c;e[0]!==h?(c=pe("size-7",h),e[0]=h,e[1]=c):c=e[1];let m;e[2]!==n||e[3]!==r?(m=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=n,e[3]=r,e[4]=m):m=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(cs,{size:16}),e[5]=f):f=e[5];let d;e[6]!==a||e[7]!==n||e[8]!==c||e[9]!==m?(d=t.jsx(we,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:c,"aria-label":m,"aria-pressed":n,onClick:a,children:f})}),e[6]=a,e[7]=n,e[8]=c,e[9]=m,e[10]=d):d=e[10];let p;e[11]!==n||e[12]!==r?(p=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=n,e[12]=r,e[13]=p):p=e[13];let x;e[14]!==p?(x=t.jsx(Se,{side:"top",children:p}),e[14]=p,e[15]=x):x=e[15];let u;e[16]!==d||e[17]!==x?(u=t.jsxs(ye,{delayDuration:0,children:[d,x]}),e[16]=d,e[17]=x,e[18]=u):u=e[18];let g;e[19]!==r?(g=r("virtualMcp.settings.views.rowActions"),e[19]=r,e[20]=g):g=e[20];let j;e[21]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(dl,{size:16}),e[21]=j):j=e[21];let y;e[22]!==g?(y=t.jsx(Qs,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground","aria-label":g,children:j})}),e[22]=g,e[23]=y):y=e[23];let b;e[24]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Fn,{size:14}),e[24]=b):b=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(Ze,{onClick:i,children:[b,v]}),e[27]=i,e[28]=v,e[29]=N):N=e[29];let M;e[30]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(cs,{size:14}),e[30]=M):M=e[30];let C;e[31]!==n||e[32]!==r?(C=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=n,e[32]=r,e[33]=C):C=e[33];let w;e[34]!==a||e[35]!==C?(w=t.jsxs(Ze,{onClick:a,children:[M,C]}),e[34]=a,e[35]=C,e[36]=w):w=e[36];let k;e[37]!==s||e[38]!==o||e[39]!==r?(k=s&&t.jsxs(Ze,{onClick:o,children:[t.jsx(an,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=s,e[38]=o,e[39]=r,e[40]=k):k=e[40];let S;e[41]!==N||e[42]!==w||e[43]!==k?(S=t.jsxs(Xs,{align:"end",children:[N,w,k]}),e[41]=N,e[42]=w,e[43]=k,e[44]=S):S=e[44];let _;e[45]!==y||e[46]!==S?(_=t.jsxs(qs,{children:[y,S]}),e[45]=y,e[46]=S,e[47]=_):_=e[47];let V;return e[48]!==_||e[49]!==u?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[u,_]}),e[48]=_,e[49]=u,e[50]=V):V=e[50],V}const wt=l=>l.stopPropagation();function Dn(l){const e=K.c(8),{icon:n,title:s}=l;let i;e[0]!==n||e[1]!==s?(i=t.jsx(tt,{icon:n,name:s,size:"xs",className:"shrink-0"}),e[0]=n,e[1]=s,e[2]=i):i=e[2];let a;e[3]!==s?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:s}),e[3]=s,e[4]=a):a=e[4];let o;return e[5]!==i||e[6]!==a?(o=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]=o):o=e[7],o}function or(l){const e=K.c(70),{views:n}=l,s=Q();let i;e[0]!==s?(i=s("virtualMcp.settings.views.defaults"),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==s?(a=s("virtualMcp.layoutTabContent.mainView"),e[2]=s,e[3]=a):a=e[3];let o;e[4]!==s?(o=s("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=s,e[5]=o):o=e[5];const r=n.defaultMainView,h=n.setMainView;let c;e[6]!==s?(c=s("virtualMcp.layoutTabContent.mainView"),e[6]=s,e[7]=c):c=e[7];let m;e[8]!==s?(m=s("virtualMcp.layoutTabContent.noMainView"),e[8]=s,e[9]=m):m=e[9];let f;e[10]!==m?(f=t.jsx(Ie,{placeholder:m}),e[10]=m,e[11]=f):f=e[11];let d;e[12]!==c||e[13]!==f?(d=t.jsx(Ae,{"aria-label":c,className:"w-36 h-8 text-sm shrink-0 @min-xl/project-settings:w-44",children:f}),e[12]=c,e[13]=f,e[14]=d):d=e[14];let p;e[15]!==n.defaultMainOptions?(p=n.defaultMainOptions.map(cr),e[15]=n.defaultMainOptions,e[16]=p):p=e[16];let x;e[17]!==p?(x=t.jsx(Oe,{children:p}),e[17]=p,e[18]=x):x=e[18];let u;e[19]!==x||e[20]!==d||e[21]!==n.defaultMainView||e[22]!==n.setMainView?(u=t.jsxs(Pe,{value:r,onValueChange:h,children:[d,x]}),e[19]=x,e[20]=d,e[21]=n.defaultMainView,e[22]=n.setMainView,e[23]=u):u=e[23];let g;e[24]!==u||e[25]!==a||e[26]!==o?(g=t.jsx(Re,{title:a,description:o,action:u}),e[24]=u,e[25]=a,e[26]=o,e[27]=g):g=e[27];let j;e[28]!==s?(j=s("virtualMcp.layoutTabContent.showChat"),e[28]=s,e[29]=j):j=e[29];let y;e[30]!==s?(y=s("virtualMcp.layoutTabContent.showChatDescription"),e[30]=s,e[31]=y):y=e[31];let b;e[32]!==s?(b=s("virtualMcp.layoutTabContent.showChat"),e[32]=s,e[33]=b):b=e[33];const v=n.noMainView?!0:n.chatDefaultOpen;let N;e[34]!==b||e[35]!==v||e[36]!==n.noMainView||e[37]!==n.setChatDefaultOpen?(N=t.jsx(we,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(ut,{"aria-label":b,checked:v,disabled:n.noMainView,onCheckedChange:n.setChatDefaultOpen})})}),e[34]=b,e[35]=v,e[36]=n.noMainView,e[37]=n.setChatDefaultOpen,e[38]=N):N=e[38];let M;e[39]!==s||e[40]!==n.noMainView?(M=n.noMainView&&t.jsx(Se,{side:"top",children:s("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[39]=s,e[40]=n.noMainView,e[41]=M):M=e[41];let C;e[42]!==N||e[43]!==M?(C=t.jsxs(ye,{delayDuration:0,children:[N,M]}),e[42]=N,e[43]=M,e[44]=C):C=e[44];let w;e[45]!==j||e[46]!==y||e[47]!==C?(w=t.jsx(Re,{title:j,description:y,action:C}),e[45]=j,e[46]=y,e[47]=C,e[48]=w):w=e[48];let k;e[49]!==g||e[50]!==w?(k=t.jsxs(Ve,{children:[g,w]}),e[49]=g,e[50]=w,e[51]=k):k=e[51];let S;e[52]!==i||e[53]!==k?(S=t.jsx(De,{title:i,children:k}),e[52]=i,e[53]=k,e[54]=S):S=e[54];let _;e[55]!==s?(_=s("virtualMcp.settings.views.sidebar"),e[55]=s,e[56]=_):_=e[56];let V;e[57]!==n?(V=n.projectViews.map($=>{const F=n.pinned($);return t.jsx(Re,{icon:t.jsx(Tn,{viewId:$}),title:n.labels[$],onClick:()=>n.openView($),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(yt,{pinned:F,canSetMainView:F&&!n.isMainView($),onOpen:()=>n.openView($),onTogglePin:()=>n.togglePin($,!F),onSetMainView:()=>n.setMainView($)}),t.jsx("span",{onClick:()=>n.openView($),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(at,{size:16})})]})},$)}),e[57]=n,e[58]=V):V=e[58];let O;e[59]!==n?(O=n.connectionsData.flatMap($=>[t.jsx(Dn,{icon:$.icon,title:$.title},`${$.id}:header`),...$.uiTools.map(F=>{const q=n.pinnedAppViews.find(T=>T.connectionId===$.id&&T.toolName===F.name),R=!!q,G=en($.id,F.name),U=`ext-apps:${$.id}:${F.name}`;return t.jsx(Re,{onClick:()=>n.openView(G),icon:R?t.jsx("span",{onClick:wt,children:t.jsx(Vn,{value:q.icon??null,onChange:T=>n.setAppViewIcon($.id,F.name,T)})}):t.jsx(Kt,{size:16}),title:R?t.jsx("span",{onClick:wt,children:t.jsx(Me,{value:q.label,onChange:T=>n.setAppViewLabel($.id,F.name,T.target.value),onBlur:n.commitAppViewLabel,"aria-label":F.title??vt(F.name),className:"h-7 w-full max-w-52 text-sm"})}):F.title??vt(F.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(yt,{pinned:R,canSetMainView:R&&!n.isMainView(U),onOpen:()=>n.openView(G),onTogglePin:()=>n.toggleAppViewPin($.id,F.name),onSetMainView:()=>n.setMainView(U)}),t.jsx("span",{onClick:()=>n.openView(G),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(at,{size:16})})]})},`${$.id}:${F.name}`)})]),e[59]=n,e[60]=O):O=e[60];let A;e[61]!==V||e[62]!==O?(A=t.jsxs(Ve,{children:[V,O]}),e[61]=V,e[62]=O,e[63]=A):A=e[63];let E;e[64]!==_||e[65]!==A?(E=t.jsx(De,{title:_,children:A}),e[64]=_,e[65]=A,e[66]=E):E=e[66];let I;return e[67]!==S||e[68]!==E?(I=t.jsxs(t.Fragment,{children:[S,E]}),e[67]=S,e[68]=E,e[69]=I):I=e[69],I}function cr(l){return t.jsx(je,{value:l.value,children:l.label},l.value)}function dr(l){const e=K.c(53),{views:n}=l,s=Q();let i;e[0]!==s?(i=s("virtualMcp.settings.views.projectViews"),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n?(a=n.projectViews.map(S=>{const _=n.pinned(S);return t.jsx(Re,{icon:t.jsx(Tn,{viewId:S}),title:n.labels[S],onClick:()=>n.openView(S),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(yt,{pinned:_,canSetMainView:_&&!n.isMainView(S),onOpen:()=>n.openView(S),onTogglePin:()=>n.togglePin(S,!_),onSetMainView:()=>n.setMainView(S)}),t.jsx("span",{onClick:()=>n.openView(S),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(at,{size:16})})]})},S)}),e[2]=n,e[3]=a):a=e[3];let o;e[4]!==n?(o=n.connectionsData.flatMap(S=>[t.jsx(Dn,{icon:S.icon,title:S.title},`${S.id}:header`),...S.uiTools.map(_=>{const V=n.pinnedAppViews.find(I=>I.connectionId===S.id&&I.toolName===_.name),O=!!V,A=en(S.id,_.name),E=`ext-apps:${S.id}:${_.name}`;return t.jsx(Re,{onClick:()=>n.openView(A),icon:O?t.jsx("span",{onClick:wt,children:t.jsx(Vn,{value:V.icon??null,onChange:I=>n.setAppViewIcon(S.id,_.name,I)})}):t.jsx(Kt,{size:16}),title:O?t.jsx("span",{onClick:wt,children:t.jsx(Me,{value:V.label,onChange:I=>n.setAppViewLabel(S.id,_.name,I.target.value),onBlur:n.commitAppViewLabel,className:"h-7 w-52 text-sm"})}):_.title??vt(_.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(yt,{pinned:O,canSetMainView:O&&!n.isMainView(E),onOpen:()=>n.openView(A),onTogglePin:()=>n.toggleAppViewPin(S.id,_.name),onSetMainView:()=>n.setMainView(E)}),t.jsx("span",{onClick:()=>n.openView(A),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(at,{size:16})})]})},`${S.id}:${_.name}`)})]),e[4]=n,e[5]=o):o=e[5];let r;e[6]!==s?(r=s("virtualMcp.layoutTabContent.mainView"),e[6]=s,e[7]=r):r=e[7];let h;e[8]!==s?(h=s("virtualMcp.layoutTabContent.mainViewDescription"),e[8]=s,e[9]=h):h=e[9];const c=n.defaultMainView,m=n.setMainView;let f;e[10]!==s?(f=s("virtualMcp.layoutTabContent.noMainView"),e[10]=s,e[11]=f):f=e[11];let d;e[12]!==f?(d=t.jsx(Ae,{className:"w-44 h-8 text-sm shrink-0",children:t.jsx(Ie,{placeholder:f})}),e[12]=f,e[13]=d):d=e[13];let p;e[14]!==n.defaultMainOptions?(p=n.defaultMainOptions.map(ur),e[14]=n.defaultMainOptions,e[15]=p):p=e[15];let x;e[16]!==p?(x=t.jsx(Oe,{children:p}),e[16]=p,e[17]=x):x=e[17];let u;e[18]!==x||e[19]!==d||e[20]!==n.defaultMainView||e[21]!==n.setMainView?(u=t.jsxs(Pe,{value:c,onValueChange:m,children:[d,x]}),e[18]=x,e[19]=d,e[20]=n.defaultMainView,e[21]=n.setMainView,e[22]=u):u=e[22];let g;e[23]!==u||e[24]!==r||e[25]!==h?(g=t.jsx(Re,{title:r,description:h,action:u}),e[23]=u,e[24]=r,e[25]=h,e[26]=g):g=e[26];let j;e[27]!==s?(j=s("virtualMcp.layoutTabContent.showChat"),e[27]=s,e[28]=j):j=e[28];let y;e[29]!==s?(y=s("virtualMcp.layoutTabContent.showChatDescription"),e[29]=s,e[30]=y):y=e[30];const b=n.noMainView?!0:n.chatDefaultOpen;let v;e[31]!==b||e[32]!==n.noMainView||e[33]!==n.setChatDefaultOpen?(v=t.jsx(we,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(ut,{checked:b,disabled:n.noMainView,onCheckedChange:n.setChatDefaultOpen})})}),e[31]=b,e[32]=n.noMainView,e[33]=n.setChatDefaultOpen,e[34]=v):v=e[34];let N;e[35]!==s||e[36]!==n.noMainView?(N=n.noMainView&&t.jsx(Se,{side:"top",children:s("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[35]=s,e[36]=n.noMainView,e[37]=N):N=e[37];let M;e[38]!==v||e[39]!==N?(M=t.jsxs(ye,{delayDuration:0,children:[v,N]}),e[38]=v,e[39]=N,e[40]=M):M=e[40];let C;e[41]!==j||e[42]!==y||e[43]!==M?(C=t.jsx(Re,{title:j,description:y,action:M}),e[41]=j,e[42]=y,e[43]=M,e[44]=C):C=e[44];let w;e[45]!==g||e[46]!==a||e[47]!==C||e[48]!==o?(w=t.jsxs(Ve,{children:[a,o,g,C]}),e[45]=g,e[46]=a,e[47]=C,e[48]=o,e[49]=w):w=e[49];let k;return e[50]!==i||e[51]!==w?(k=t.jsx(De,{title:i,children:w}),e[50]=i,e[51]=w,e[52]=k):k=e[52],k}function ur(l){return t.jsx(je,{value:l.value,children:l.label},l.value)}function Os(l){const e=K.c(3),n=Rt();let s;return e[0]!==n||e[1]!==l?(s=n?t.jsx(or,{...l}):t.jsx(dr,{...l}),e[0]=n,e[1]=l,e[2]=s):s=e[2],s}const An="site-editor",mr=new Set([An,"content"]);function fr({virtualMcpId:l,form:e,flushAndSave:n}){const s=Q(),i=St(),{openPanel:a}=hl(),o=dn(l),r=gl(o),h=gn(l),c=Nl(l),m=(o?.connections??[]).map(T=>T.connection_id).sort(),{data:f}=zn({queryKey:tn.projectConnectionDetails(l,m),enabled:m.length>0,queryFn:async()=>await Promise.all(m.map(async P=>{try{const{item:W}=await i.call("COLLECTION_CONNECTIONS_GET",{id:P}),B=(W?.tools??[]).flatMap(z=>{const Y=fl(z._meta);return Y?[{name:z.name,title:z.title,description:z.description,resourceUri:Y}]:[]});return{fetchOk:!0,id:P,title:W?.title??P,icon:W?.icon??null,uiTools:B}}catch{return{fetchOk:!1,id:P,title:P,icon:null,uiTools:[]}}}))}),d=(f??[]).filter(T=>T.uiTools.length>0),p=new Set([...Rn,...Ln]),x=e.watch("metadata.ui.pinnedViews")??[],u=e.watch("metadata.ui.layout")??null,g=u?.defaultMainView??null,j=u?.chatDefaultOpen??!1,y=Et(Ft({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:u}}),e.watch("metadata.sidebarViewsVersion")),b=c??(o?Et(Ft(o.metadata),o.metadata.sidebarViewsVersion):y),v=(()=>{if(!g||g.type==="chat")return"";const T=Bn(g.type);return T==="instructions"||T==="connections"||T==="layout"?"settings":mr.has(T)?An:p.has(T)?T:`${T}:${g.id??""}:${g.toolName??""}`})(),N=v==="",M=T=>{const[P,W,B]=T.split(":");return P?p.has(P)?{type:P}:P==="ext-apps"&&W?{type:"ext-apps",id:W,toolName:B||void 0}:null:null},C=T=>{e.setValue("metadata.ui.pinnedViews",T,{shouldDirty:!0})},w=T=>{e.setValue("metadata.ui.layout",{...u,...T},{shouldDirty:!0})},k=H.useRef(!1);if(f&&f.length>0&&!k.current){k.current=!0;const T=new Set((f??[]).filter(z=>z.fetchOk).map(z=>z.id)),P=new Set(d.flatMap(z=>z.uiTools.map(Y=>`${z.id}:${Y.name}`))),W=new Set(m),B=x.filter(z=>W.has(z.connectionId)&&(!T.has(z.connectionId)||P.has(`${z.connectionId}:${z.toolName}`)));B.length!==x.length&&(C(B),g?.type==="ext-apps"&&!B.some(z=>z.connectionId===g.id&&z.toolName===g.toolName)&&w({defaultMainView:{type:"settings"}}))}const S=(T,P)=>{if(x.some(B=>B.connectionId===T&&B.toolName===P)){const B=x.filter(Y=>!(Y.connectionId===T&&Y.toolName===P));C(B);const z=`ext-apps:${T}:${P}`;v===z&&w({defaultMainView:{type:"settings"}})}else{const B=d.find(z=>z.id===T)?.uiTools.find(z=>z.name===P)?.title;C([...x,{connectionId:T,toolName:P,label:B??vt(P),icon:null}])}n()},_=(T,P,W)=>{C(x.map(B=>B.connectionId===T&&B.toolName===P?{...B,label:W}:B))},V=()=>{n()},O=(T,P,W)=>{C(x.map(B=>B.connectionId===T&&B.toolName===P?{...B,icon:W}:B)),n()},A=T=>{w({defaultMainView:M(T)}),n()},E=(T,P)=>{const W=yl(b,T,P,1);e.setValue("metadata.sidebarViews",W,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),h.stage(W,b);const B=wl(g,T,P);B!==g&&w({defaultMainView:B})},I=jt(o?.metadata),$=vl(I,r.presence),F=jl($),q=bl(b,$,1),R={overview:s("sidebar.navDestinations.home"),reports:s("sidebar.navDestinations.reports"),board:s("sidebar.navDestinations.tasks"),"site-editor":s("virtualMcp.layoutTabContent.siteEditor"),assets:s("common.mainPanelTabs.assets"),hosting:s("common.mainPanelTabs.hosting"),e2e:s("common.mainPanelTabs.e2e"),analytics:s("common.mainPanelTabs.analytics"),cdn:s("common.mainPanelTabs.cdn"),automations:s("virtualMcp.layoutTabContent.automations"),experiments:s("experiments.title")},G=[];for(const T of q)T!=="automations"&&G.push({value:T,label:R[T]});for(const T of x)G.push({value:`ext-apps:${T.connectionId}:${T.toolName}`,label:T.label||T.toolName});return q.includes("automations")&&G.push({value:"automations",label:R.automations}),G.push({value:"settings",label:s("virtualMcp.layoutTabContent.settings")}),{projectViews:F,labels:R,pinned:T=>b.includes(T),isMainView:T=>v===T,defaultMainView:v,defaultMainOptions:G,noMainView:N,chatDefaultOpen:j,connectionsData:d,pinnedAppViews:x,openView:T=>a(T,{virtualmcpid:l}),togglePin:(T,P)=>E(T,P),setMainView:A,setChatDefaultOpen:T=>{w({chatDefaultOpen:T}),n()},toggleAppViewPin:S,setAppViewIcon:O,setAppViewLabel:_,commitAppViewLabel:V}}function pr(l){const e=K.c(55),{form:n,onCommit:s}=l,i=Q(),a=H.useId();let o;e[0]!==i?(o=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("p",{className:"text-sm font-medium",children:o}),e[2]=o,e[3]=r):r=e[3];let h;e[4]!==i?(h=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=h):h=e[5];let c;e[6]!==h?(c=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:h}),e[6]=h,e[7]=c):c=e[7];let m;e[8]!==r||e[9]!==c?(m=t.jsxs("div",{children:[r,c]}),e[8]=r,e[9]=c,e[10]=m):m=e[10];let f;e[11]!==n||e[12]!==s||e[13]!==i?(f=_=>{const{field:V}=_;return t.jsx("div",{className:"justify-self-start",children:t.jsx(Cn,{value:V.value??null,onChange:O=>{V.onChange(O),s()},onColorChange:O=>{n.setValue("metadata.ui.themeColor",O,{shouldDirty:!0}),s()},name:n.watch("title")||i("virtualMcp.virtualMcp.agentNameFallback"),size:"md",avatarClassName:"[&_svg]:w-1/2 [&_svg]:h-1/2"})})},e[11]=n,e[12]=s,e[13]=i,e[14]=f):f=e[14];let d;e[15]!==n.control||e[16]!==f?(d=t.jsx(me,{name:"icon",control:n.control,render:f}),e[15]=n.control,e[16]=f,e[17]=d):d=e[17];let p;e[18]!==m||e[19]!==d?(p=t.jsxs(ue,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[m,d]}),e[18]=m,e[19]=d,e[20]=p):p=e[20];const x=`${a}-name`;let u;e[21]!==i?(u=i("virtualMcp.settings.identity.name"),e[21]=i,e[22]=u):u=e[22];let g;e[23]!==u||e[24]!==x?(g=t.jsx("label",{htmlFor:x,className:"text-sm font-medium",children:u}),e[23]=u,e[24]=x,e[25]=g):g=e[25];let j;e[26]!==a||e[27]!==s||e[28]!==i?(j=_=>{const{field:V}=_;return t.jsx(Me,{...V,id:`${a}-name`,value:V.value??"",onBlur:()=>{V.onBlur(),s()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=a,e[27]=s,e[28]=i,e[29]=j):j=e[29];let y;e[30]!==n.control||e[31]!==j?(y=t.jsx(me,{name:"title",control:n.control,render:j}),e[30]=n.control,e[31]=j,e[32]=y):y=e[32];let b;e[33]!==g||e[34]!==y?(b=t.jsxs(ue,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[g,y]}),e[33]=g,e[34]=y,e[35]=b):b=e[35];const v=`${a}-description`;let N;e[36]!==i?(N=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=N):N=e[37];let M;e[38]!==v||e[39]!==N?(M=t.jsx("label",{htmlFor:v,className:"text-sm font-medium",children:N}),e[38]=v,e[39]=N,e[40]=M):M=e[40];let C;e[41]!==a||e[42]!==s||e[43]!==i?(C=_=>{const{field:V}=_;return t.jsx(lt,{...V,id:`${a}-description`,value:V.value??"",onBlur:()=>{V.onBlur(),s()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=a,e[42]=s,e[43]=i,e[44]=C):C=e[44];let w;e[45]!==n.control||e[46]!==C?(w=t.jsx(me,{name:"description",control:n.control,render:C}),e[45]=n.control,e[46]=C,e[47]=w):w=e[47];let k;e[48]!==M||e[49]!==w?(k=t.jsxs(ue,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[M,w]}),e[48]=M,e[49]=w,e[50]=k):k=e[50];let S;return e[51]!==b||e[52]!==k||e[53]!==p?(S=t.jsxs(Ve,{children:[p,b,k]}),e[51]=b,e[52]=k,e[53]=p,e[54]=S):S=e[54],S}function xr(l){const e=K.c(8),{section:n}=l,s=Q();let i;e[0]!==s?(i=s("virtualMcp.settings.navigation"),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n||e[3]!==s?(a=Mn.map(r=>{const{titleKey:h}=He[r];return t.jsx(ze.Tab,{active:n===r,asChild:!0,children:t.jsx(Zs,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:c=>({...c,section:r==="general"?void 0:r}),children:s(h)})},r)}),e[2]=n,e[3]=s,e[4]=a):a=e[4];let o;if(e[5]!==i||e[6]!==a){const r=t.jsx(ze.Tabs,{"aria-label":i,children:a});o=t.jsx(Un.Toolbar.Left.Portal,{fallback:r,children:r}),e[5]=i,e[6]=a,e[7]=o}else o=e[7];return o}function hr(){const l=K.c(9),e=Rt(),n=Lt();let s;l[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},l[0]=s):s=l[0];const{section:i}=Yn(s);let a;l[1]!==e||l[2]!==i?(a=Va(i)?i:e?"general":null,l[1]=e,l[2]=i,l[3]=a):a=l[3];let o;l[4]!==n?(o=h=>n({to:".",search:c=>({...c,section:h??void 0})}),l[4]=n,l[5]=o):o=l[5];let r;return l[6]!==a||l[7]!==o?(r={section:a,openSection:o},l[6]=a,l[7]=o,l[8]=r):r=l[8],r}const Ot={tools:null,resources:null,prompts:null},gr=Vl.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function vr(l){const n=new TextEncoder().encode(l),s=Array.from(n,i=>String.fromCharCode(i)).join("");return btoa(s)}function In(l){return{"x-studio-client":l,"x-mesh-client":l}}function jr(l){const e=K.c(15),{url:n,agentId:s}=l,i=Q(),[a,o]=H.useState(!1);let r;e[0]!==s||e[1]!==i||e[2]!==n?(r=async()=>{ve("agent_connect_action",{agent_id:s,action:"copy_url"}),await navigator.clipboard.writeText(n),o(!0),re.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await ft(2e3),o(!1)},e[0]=s,e[1]=i,e[2]=n,e[3]=r):r=e[3];const h=r;let c;e[4]!==a?(c=a?t.jsx(mt,{size:20,className:"text-success"}):t.jsx(Vt,{size:20}),e[4]=a,e[5]=c):c=e[5];let m;e[6]!==a||e[7]!==i?(m=i(a?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=a,e[7]=i,e[8]=m):m=e[8];let f;e[9]!==m?(f=t.jsx("span",{className:"text-xs font-medium",children:m}),e[9]=m,e[10]=f):f=e[10];let d;return e[11]!==h||e[12]!==c||e[13]!==f?(d=t.jsxs(Z,{type:"button",variant:"outline",onClick:h,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,f]}),e[11]=h,e[12]=c,e[13]=f,e[14]=d):d=e[14],d}function br(l){const e=K.c(13),{url:n,serverName:s,agentId:i}=l,a=Q();let o;e[0]!==i||e[1]!==s||e[2]!==a||e[3]!==n?(o=()=>{ve("agent_connect_action",{agent_id:i,action:"install_cursor"});const d=jn(s),p={type:"http",url:n,headers:In("Cursor")},x=vr(JSON.stringify(p,null,2)),u=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(d)}&config=${encodeURIComponent(x)}`;window.open(u,"_blank"),re.success(a("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=s,e[2]=a,e[3]=n,e[4]=o):o=e[4];const r=o;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=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]=h):h=e[5];let c;e[6]!==a?(c=a("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=a,e[7]=c):c=e[7];let m;e[8]!==c?(m=t.jsx("span",{className:"text-xs font-medium",children:c}),e[8]=c,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m?(f=t.jsxs(Z,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[h,m]}),e[10]=r,e[11]=m,e[12]=f):f=e[12],f}function yr(l){const e=K.c(16),{url:n,serverName:s,agentId:i}=l,a=Q(),[o,r]=H.useState(!1);let h;e[0]!==i||e[1]!==s||e[2]!==a||e[3]!==n?(h=async()=>{ve("agent_connect_action",{agent_id:i,action:"install_claude_code"});const x=jn(s),u={type:"http",url:n,headers:In("Claude Code")},g=JSON.stringify(u,null,2),j=`claude mcp add-json "${x}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(j),r(!0),re.success(a("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await ft(2e3),r(!1)},e[0]=i,e[1]=s,e[2]=a,e[3]=n,e[4]=h):h=e[4];const c=h;let m;e[5]!==o?(m=o?t.jsx(mt,{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]=o,e[6]=m):m=e[6];let f;e[7]!==o||e[8]!==a?(f=a(o?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=o,e[8]=a,e[9]=f):f=e[9];let d;e[10]!==f?(d=t.jsx("span",{className:"text-xs font-medium",children:f}),e[10]=f,e[11]=d):d=e[11];let p;return e[12]!==c||e[13]!==m||e[14]!==d?(p=t.jsxs(Z,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,d]}),e[12]=c,e[13]=m,e[14]=d,e[15]=p):p=e[15],p}function wr({virtualMcp:l}){const e=Q(),n=St(),[s,i]=H.useState(null),[a,o]=H.useState(!1),[r,h]=H.useState(!1),c=l.id,m=l.title||`agent-${c.slice(0,8)}`,f=s?`bunx @decocms/typegen@latest --mcp ${c} --key ${s} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${c} --key <api-key> --output client.ts`,d=async()=>{o(!0);try{const{key:x}=await n.call("API_KEY_CREATE",{name:`typegen-${m}`,permissions:{[c]:["*"]}});if(!x)throw new Error("No key in response");i(x),ve("agent_typegen_key_generated",{agent_id:c})}catch{ve("agent_typegen_key_failed",{agent_id:c}),re.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{o(!1)}},p=async()=>{ve("agent_connect_action",{agent_id:c,action:"typegen_copy_command",has_api_key:!!s}),await navigator.clipboard.writeText(f),h(!0),re.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await ft(2e3),h(!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")})]}),!s&&t.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:d,disabled:a,children:[a?t.jsx(ot,{className:"size-3.5"}):t.jsx(Xt,{size:14}),t.jsx("span",{children:e(a?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),s&&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:f}),t.jsx(Z,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:p,children:r?t.jsx(mt,{size:12,className:"text-success"}):t.jsx(Vt,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(Sr,{apiKey:s,agentId:c})]})}function Sr(l){const e=K.c(21),{apiKey:n,agentId:s}=l,[i,a]=H.useState(!1),o=window.location.origin,r=n?`STUDIO_API_KEY=${n}`:"STUDIO_API_KEY=<api-key>",h=`STUDIO_BASE_URL=${o}`,c=`${r}
|
|
1
|
+
import{c as K,b as Q,r as H,l as pe,j as t,t as re,B as Z,dX as De,dY as Ve,dZ as Re,al as at,e_ as Hs,h as ot,I as qs,F as Qs,H as Xs,G as Ze,aS as ns,aT as is,aU as ls,Y as Be,E as Ye,Z as Js,e$ as $n,L as Zs,ab as En,s as Fn,U as Rt,aa as en,a4 as St,m as zn,K as tn,f0 as Rn,f1 as Ln,f2 as Bn,aV as me,f3 as ue,n as ze,P as Un,d as Lt,u as Yn,q as ve,d1 as Kn,ah as Gn,eL as Wn,f4 as Hn,aQ as qn,a as Qn,f5 as sn,f6 as Xn,aF as Jn,a8 as Zn,o as ei,an as ti,am as si,as as ni}from"./index-D-Qb9EKo.js";import{c as ii}from"./UserSquare-C3h8vlGA.js";import{n as li}from"./LinkExternal01-Sd40C2OB.js";import{aT as Bt,b3 as ai,b4 as Ut,b5 as nn,b6 as ln,af as Yt,b7 as $t,b8 as Dt,b9 as as,A as rs,B as ri,ba as oi,bb as ci,J as di,U as ui,bc as mi,bd as fi,be as pi,aF as xi,at as hi,j as an,h as os,n as gi,m as vi,l as ji,e as Kt,bf as cs,aD as bi,a5 as yi,y as wi,bg as Si,al as ds}from"./agent-icon-DGZEAm9H.js";import{i as Ni}from"./Sun-Bs_C-u75.js";import{s as Le}from"./Plus-C1bAoYy_.js";import{t as ht,a as Ci}from"./Tool01-rptoyApF.js";import{s as it}from"./Trash01-8P2mehkt.js";import{I as Me}from"./input-CuAG4MMc.js";import{a as Gt,b as Wt,P as Ht}from"./popover-C2l1C5I5.js";import{S as rn}from"./scroll-area-CmIKtSED.js";import{i as gt}from"./SearchMd-Bo9C0lON.js";import{i as Mi}from"./Upload01-Do_51Ot8.js";import{b as us,c as ki,d as _i,e as Vi,B as Ti,a as Di}from"./breadcrumb-CW_U1f5l.js";import{i as Ai}from"./Link01-Bk8fUFT0.js";import{g as Ii}from"./extract-connection-data-DcoB8kAN.js";import{a as Oi}from"./chat-context-DotjjaCp.js";import{U as ms,b as Pi}from"./build-improve-prompt-doc-Be3oxc4K.js";import{E as $i}from"./empty-state-CzIH_JfN.js";import{a as Ei}from"./shell-layout-DJ3g9P4L.js";import{g as Nt,n as Fi,a as fs,e as zi,u as Ri,f as ps}from"./use-date-fns-locale-eJfgCCNv.js";import{a as qt,b as on,u as Li}from"./use-connection-8slpfTIQ.js";import{b as cn,a as dn,c as un,g as Bi}from"./use-virtual-mcp-DLYR2teL.js";import{a as Ui,i as xs}from"./mcp-oauth-BjLtq_iZ.js";import{f as Yi,e as Ki,b as Gi,A as Wi,a as Hi,d as qi,c as Qi,g as Xi}from"./alert-dialog-DdszU1Q8.js";import{D as ct,b as dt,c as Ct,d as Mt,e as mn,h as Ji}from"./dialog-BH40cz5f.js";import{T as lt}from"./textarea-DCGCgxQP.js";import{c as ye,T as we,a as Se}from"./tooltip-TamJ0pBA.js";import{u as hs}from"./use-debounced-autosave-uB2QsLPm.js";import{A as Zi}from"./add-connection-dialog-BzI23RxL.js";import{a as el}from"./Share07-BB--BXeq.js";import{F as gs}from"./file-type-icon-DmiRAgFN.js";import{h as tl,i as sl,j as nl,k as il}from"./use-org-fs-DKnM3E4S.js";import{I as tt}from"./integration-icon-jMu9bsqq.js";import{C as fn}from"./checkbox-CfvRuAMT.js";import{S as ll}from"./search-input-BLe6KTwz.js";import{b as Ae,a as Ie,c as je,d as Oe,S as Pe}from"./select-BByR5Z_4.js";import{s as Qt}from"./XClose-CtU5_ALA.js";import{C as al}from"./collection-tabs-N5ZrSPpp.js";import{T as pn,u as xn}from"./use-mcp-auth-status-n70YyfJn.js";import{u as kt}from"./use-mcp-client-D5ISNy1u.js";import{a as hn}from"./use-mcp-tools-DObKdEcu.js";import{u as rl}from"./use-mcp-prompts-CpMkSs6e.js";import{g as ol}from"./connection-slug-CITJ0kGN.js";import{t as vt}from"./utils-CVEq3hMx.js";import{S as ut}from"./switch-CAJrkKRA.js";import{i as cl}from"./LayoutLeft-DTet0kcn.js";import{i as dl}from"./DotsVertical-CIifNiXH.js";import{a as ul}from"./Image01-4eEp4rFk.js";import{i as ml}from"./Monitor01-D7UgaQLg.js";import{g as fl}from"./types-BEpeZDST.js";import{b as jt,g as pl,d as xl}from"./use-project-scope-DPGZwkTE.js";import{a as hl}from"./use-panel-navigate-CbwiVPwL.js";import{u as gl,e as Et,r as Ft,p as vl,g as jl,s as bl,t as yl,h as wl,a as Sl}from"./use-project-native-view-presence-DXYMkBrd.js";import{a as gn,u as Nl,i as Cl,o as Ml,r as vs,p as kl,w as _l,b as js}from"./optimistic-project-sidebar-views-B-iOyRUg.js";import{V as Vl,E as _t,r as vn,C as Tl,w as Dl}from"./virtual-mcp-DdvSafC6.js";import{s as jn}from"./slugify-CEUa2lfQ.js";import{b as Al,a as Il,D as Ol}from"./drawer-ComjVvmu.js";import{u as Pl}from"./use-mobile-7NdLMHiB.js";import{i as mt}from"./Check-Ba60y41Y.js";import{a as Vt}from"./Copy01-ps1GrLwt.js";import{i as Xt}from"./Key01-DFcPORPA.js";import{d as ft}from"./backoff-8mStPHYB.js";import{g as bn}from"./github-repo-BknN0SVI.js";import{R as $l}from"./repository-import-picker-DISfHZZr.js";import{b as El}from"./sandbox-url-D3mC8qhT.js";import{L as Ne}from"./label-BBoHKfq-.js";import{S as Fl,a as zl,b as Rl}from"./secret-picker-CCs4k_B3.js";import{u as Ll,a as Bl}from"./use-secrets-Dq6fpQZD.js";import{o as bs}from"./omit-sandbox-map-jj4lCB2U.js";import{G as Ul}from"./github-icon-gx8ml2Xw.js";import{p as Yl,s as Kl,a as Gl}from"./thread-intent-B-RLNYw1.js";import{r as Wl}from"./serial-task-queue-CGOeQgpr.js";import{t as Ue,c as et,m as Hl,a as yn}from"./differenceInSeconds-C3x8sHUj.js";function rt(l,e){const n=Nt(),s=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Ue(l,e?.in),a=i.getDay(),o=(a<s?7:0)+a-s;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function bt(l,e){return rt(l,{...e,weekStartsOn:1})}function wn(l,e){const n=Ue(l,e?.in),s=n.getFullYear(),i=et(n,0);i.setFullYear(s+1,0,4),i.setHours(0,0,0,0);const a=bt(i),o=et(n,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const r=bt(o);return n.getTime()>=a.getTime()?s+1:n.getTime()>=r.getTime()?s:s-1}function ys(l,e){const n=Ue(l,e?.in);return n.setHours(0,0,0,0),n}function ql(l,e,n){const[s,i]=Fi(n?.in,l,e),a=ys(s),o=ys(i),r=+a-fs(a),h=+o-fs(o);return Math.round((r-h)/Hl)}function Ql(l,e){const n=wn(l,e),s=et(l,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),bt(s)}function Xl(l){return l instanceof Date||typeof l=="object"&&Object.prototype.toString.call(l)==="[object Date]"}function Jl(l){return!(!Xl(l)&&typeof l!="number"||isNaN(+Ue(l)))}function Zl(l,e){const n=Ue(l,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ea(l,e){const n=Ue(l,e?.in);return ql(n,Zl(n))+1}function ta(l,e){const n=Ue(l,e?.in),s=+bt(n)-+Ql(n);return Math.round(s/yn)+1}function Sn(l,e){const n=Ue(l,e?.in),s=n.getFullYear(),i=Nt(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=et(e?.in||l,0);o.setFullYear(s+1,0,a),o.setHours(0,0,0,0);const r=rt(o,e),h=et(e?.in||l,0);h.setFullYear(s,0,a),h.setHours(0,0,0,0);const c=rt(h,e);return+n>=+r?s+1:+n>=+c?s:s-1}function sa(l,e){const n=Nt(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Sn(l,e),a=et(e?.in||l,0);return a.setFullYear(i,0,s),a.setHours(0,0,0,0),rt(a,e)}function na(l,e){const n=Ue(l,e?.in),s=+rt(n,e)-+sa(n,e);return Math.round(s/yn)+1}function ae(l,e){const n=l<0?"-":"",s=Math.abs(l).toString().padStart(e,"0");return n+s}const Ke={y(l,e){const n=l.getFullYear(),s=n>0?n:1-n;return ae(e==="yy"?s%100:s,e.length)},M(l,e){const n=l.getMonth();return e==="M"?String(n+1):ae(n+1,2)},d(l,e){return ae(l.getDate(),e.length)},a(l,e){const n=l.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(l,e){return ae(l.getHours()%12||12,e.length)},H(l,e){return ae(l.getHours(),e.length)},m(l,e){return ae(l.getMinutes(),e.length)},s(l,e){return ae(l.getSeconds(),e.length)},S(l,e){const n=e.length,s=l.getMilliseconds(),i=Math.trunc(s*Math.pow(10,n-3));return ae(i,e.length)}},Je={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ws={G:function(l,e,n){const s=l.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});default:return n.era(s,{width:"wide"})}},y:function(l,e,n){if(e==="yo"){const s=l.getFullYear(),i=s>0?s:1-s;return n.ordinalNumber(i,{unit:"year"})}return Ke.y(l,e)},Y:function(l,e,n,s){const i=Sn(l,s),a=i>0?i:1-i;if(e==="YY"){const o=a%100;return ae(o,2)}return e==="Yo"?n.ordinalNumber(a,{unit:"year"}):ae(a,e.length)},R:function(l,e){const n=wn(l);return ae(n,e.length)},u:function(l,e){const n=l.getFullYear();return ae(n,e.length)},Q:function(l,e,n){const s=Math.ceil((l.getMonth()+1)/3);switch(e){case"Q":return String(s);case"QQ":return ae(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(l,e,n){const s=Math.ceil((l.getMonth()+1)/3);switch(e){case"q":return String(s);case"qq":return ae(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(l,e,n){const s=l.getMonth();switch(e){case"M":case"MM":return Ke.M(l,e);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(l,e,n){const s=l.getMonth();switch(e){case"L":return String(s+1);case"LL":return ae(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(l,e,n,s){const i=na(l,s);return e==="wo"?n.ordinalNumber(i,{unit:"week"}):ae(i,e.length)},I:function(l,e,n){const s=ta(l);return e==="Io"?n.ordinalNumber(s,{unit:"week"}):ae(s,e.length)},d:function(l,e,n){return e==="do"?n.ordinalNumber(l.getDate(),{unit:"date"}):Ke.d(l,e)},D:function(l,e,n){const s=ea(l);return e==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):ae(s,e.length)},E:function(l,e,n){const s=l.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(l,e,n,s){const i=l.getDay(),a=(i-s.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return ae(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(l,e,n,s){const i=l.getDay(),a=(i-s.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return ae(a,e.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(l,e,n){const s=l.getDay(),i=s===0?7:s;switch(e){case"i":return String(i);case"ii":return ae(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(l,e,n){const i=l.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(l,e,n){const s=l.getHours();let i;switch(s===12?i=Je.noon:s===0?i=Je.midnight:i=s/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(l,e,n){const s=l.getHours();let i;switch(s>=17?i=Je.evening:s>=12?i=Je.afternoon:s>=4?i=Je.morning:i=Je.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(l,e,n){if(e==="ho"){let s=l.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Ke.h(l,e)},H:function(l,e,n){return e==="Ho"?n.ordinalNumber(l.getHours(),{unit:"hour"}):Ke.H(l,e)},K:function(l,e,n){const s=l.getHours()%12;return e==="Ko"?n.ordinalNumber(s,{unit:"hour"}):ae(s,e.length)},k:function(l,e,n){let s=l.getHours();return s===0&&(s=24),e==="ko"?n.ordinalNumber(s,{unit:"hour"}):ae(s,e.length)},m:function(l,e,n){return e==="mo"?n.ordinalNumber(l.getMinutes(),{unit:"minute"}):Ke.m(l,e)},s:function(l,e,n){return e==="so"?n.ordinalNumber(l.getSeconds(),{unit:"second"}):Ke.s(l,e)},S:function(l,e){return Ke.S(l,e)},X:function(l,e,n){const s=l.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Ns(s);case"XXXX":case"XX":return We(s);default:return We(s,":")}},x:function(l,e,n){const s=l.getTimezoneOffset();switch(e){case"x":return Ns(s);case"xxxx":case"xx":return We(s);default:return We(s,":")}},O:function(l,e,n){const s=l.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ss(s,":");default:return"GMT"+We(s,":")}},z:function(l,e,n){const s=l.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ss(s,":");default:return"GMT"+We(s,":")}},t:function(l,e,n){const s=Math.trunc(+l/1e3);return ae(s,e.length)},T:function(l,e,n){return ae(+l,e.length)}};function Ss(l,e=""){const n=l>0?"-":"+",s=Math.abs(l),i=Math.trunc(s/60),a=s%60;return a===0?n+String(i):n+String(i)+e+ae(a,2)}function Ns(l,e){return l%60===0?(l>0?"-":"+")+ae(Math.abs(l)/60,2):We(l,e)}function We(l,e=""){const n=l>0?"-":"+",s=Math.abs(l),i=ae(Math.trunc(s/60),2),a=ae(s%60,2);return n+i+e+a}const Cs=(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"})}},Nn=(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"})}},ia=(l,e)=>{const n=l.match(/(P+)(p+)?/)||[],s=n[1],i=n[2];if(!i)return Cs(l,e);let a;switch(s){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}}",Cs(s,e)).replace("{{time}}",Nn(i,e))},la={p:Nn,P:ia},aa=/^D+$/,ra=/^Y+$/,oa=["D","DD","YY","YYYY"];function ca(l){return aa.test(l)}function da(l){return ra.test(l)}function ua(l,e,n){const s=ma(l,e,n);if(console.warn(s),oa.includes(l))throw new RangeError(s)}function ma(l,e,n){const s=l[0]==="Y"?"years":"days of the month";return`Use \`${l.toLowerCase()}\` instead of \`${l}\` (in \`${e}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const fa=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,pa=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xa=/^'([^]*?)'?$/,ha=/''/g,ga=/[a-zA-Z]/;function Ms(l,e,n){const s=Nt(),i=n?.locale??s.locale??zi,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,r=Ue(l,n?.in);if(!Jl(r))throw new RangeError("Invalid time value");let h=e.match(pa).map(m=>{const f=m[0];if(f==="p"||f==="P"){const d=la[f];return d(m,i.formatLong)}return m}).join("").match(fa).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const f=m[0];if(f==="'")return{isToken:!1,value:va(m)};if(ws[f])return{isToken:!0,value:m};if(f.match(ga))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:m}});i.localize.preprocessor&&(h=i.localize.preprocessor(r,h));const c={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return h.map(m=>{if(!m.isToken)return m.value;const f=m.value;(!n?.useAdditionalWeekYearTokens&&da(f)||!n?.useAdditionalDayOfYearTokens&&ca(f))&&ua(f,e,String(l));const d=ws[f[0]];return d(r,f,i.localize,c)}).join("")}function va(l){const e=l.match(xa);return e?e[1].replace(ha,"'"):l}function Cn(l){const e=K.c(82),{value:n,onChange:s,onColorChange:i,name:a,size:o,className:r,avatarClassName:h,showHoverOverlay:c,disabled:m}=l,f=o===void 0?"lg":o,d=c===void 0?!0:c,p=m===void 0?!1:m,x=Q(),[u,g]=H.useState(!1),[j,y]=H.useState("icons"),[b,v]=H.useState(""),[N,M]=H.useState("blue");let C;e[0]!==n?(C=Bt(n),e[0]=n,e[1]=C):C=e[1];const w=C,k=w.type==="icon"||w.type==="url"&&w.color?w.color:N;let S;e[2]!==s||e[3]!==k?(S=ce=>{s(Dt(ce,k))},e[2]=s,e[3]=k,e[4]=S):S=e[4];const _=S;let V;e[5]!==s||e[6]!==i||e[7]!==w.name||e[8]!==w.type||e[9]!==w.url?(V=ce=>{M(ce),i?.(ce),w.type==="icon"?s(Dt(w.name,ce)):w.type==="url"&&s(as(w.url,ce))},e[5]=s,e[6]=i,e[7]=w.name,e[8]=w.type,e[9]=w.url,e[10]=V):V=e[10];const O=V;let A;e[11]!==s||e[12]!==k?(A=ce=>{s(as(ce,k)),g(!1)},e[11]=s,e[12]=k,e[13]=A):A=e[13];const E=A;let I;e[14]!==s||e[15]!==k?(I=()=>{const ce=Ut(),Ee=ce[Math.floor(Math.random()*ce.length)];s(Dt(Ee,k))},e[14]=s,e[15]=k,e[16]=I):I=e[16];const $=I,F=p?!1:u,q=p?"cursor-default opacity-50":"cursor-pointer";let R;e[17]!==r||e[18]!==f||e[19]!==q?(R=pe("relative group overflow-hidden",q,ai(f),r),e[17]=r,e[18]=f,e[19]=q,e[20]=R):R=e[20];let G;e[21]!==h||e[22]!==a||e[23]!==f||e[24]!==n?(G=t.jsx(rs,{icon:n,name:a,size:f,className:h}),e[21]=h,e[22]=a,e[23]=f,e[24]=n,e[25]=G):G=e[25];let U;e[26]!==p||e[27]!==d?(U=d&&!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(ri,{size:16,className:"text-white"})}),e[26]=p,e[27]=d,e[28]=U):U=e[28];let T;e[29]!==p||e[30]!==R||e[31]!==G||e[32]!==U?(T=t.jsx(Gt,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":"Change icon",disabled:p,className:R,children:[G,U]})}),e[29]=p,e[30]=R,e[31]=G,e[32]=U,e[33]=T):T=e[33];let P;e[34]!==a||e[35]!==n?(P=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(rs,{icon:n,name:a,size:"xl"})}),e[34]=a,e[35]=n,e[36]=P):P=e[36];let W;e[37]!==j?(W=ce=>{if(ce.key!=="ArrowLeft"&&ce.key!=="ArrowRight")return;ce.preventDefault();const Ee=j==="icons"?"upload":"icons";y(Ee),document.getElementById(`icon-picker-tab-${Ee}`)?.focus()},e[37]=j,e[38]=W):W=e[38];const B=j==="icons",z=j==="icons"?0:-1;let Y;e[39]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>y("icons"),e[39]=Y):Y=e[39];const X=j==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ie;e[40]!==X?(ie=pe("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",X),e[40]=X,e[41]=ie):ie=e[41];let le;e[42]!==x?(le=x("common.iconPicker.iconsTab"),e[42]=x,e[43]=le):le=e[43];let de;e[44]!==B||e[45]!==z||e[46]!==ie||e[47]!==le?(de=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":B,"aria-controls":"icon-picker-panel-icons",tabIndex:z,onClick:Y,className:ie,children:le}),e[44]=B,e[45]=z,e[46]=ie,e[47]=le,e[48]=de):de=e[48];const oe=j==="upload",J=j==="upload"?0:-1;let ee;e[49]===Symbol.for("react.memo_cache_sentinel")?(ee=()=>y("upload"),e[49]=ee):ee=e[49];const xe=j==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ge;e[50]!==xe?(ge=pe("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",xe),e[50]=xe,e[51]=ge):ge=e[51];let ke;e[52]!==x?(ke=x("common.iconPicker.uploadTab"),e[52]=x,e[53]=ke):ke=e[53];let he;e[54]!==oe||e[55]!==J||e[56]!==ge||e[57]!==ke?(he=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":oe,"aria-controls":"icon-picker-panel-upload",tabIndex:J,onClick:ee,className:ge,children:ke}),e[54]=oe,e[55]=J,e[56]=ge,e[57]=ke,e[58]=he):he=e[58];let $e;e[59]===Symbol.for("react.memo_cache_sentinel")?($e=t.jsx("div",{className:"flex-1"}),e[59]=$e):$e=e[59];let be;e[60]!==W||e[61]!==de||e[62]!==he?(be=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:W,children:[de,he,$e]}),e[60]=W,e[61]=de,e[62]=he,e[63]=be):be=e[63];let Ce;e[64]!==O||e[65]!==$||e[66]!==_||e[67]!==E||e[68]!==w.name||e[69]!==w.type||e[70]!==b||e[71]!==k||e[72]!==j?(Ce=j==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(wa,{search:b,onSearchChange:v,selectedColor:k,onColorChange:O,onSelectIcon:_,onRandom:$,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(Sa,{onUpload:E})}),e[64]=O,e[65]=$,e[66]=_,e[67]=E,e[68]=w.name,e[69]=w.type,e[70]=b,e[71]=k,e[72]=j,e[73]=Ce):Ce=e[73];let L;e[74]!==P||e[75]!==be||e[76]!==Ce?(L=t.jsx(Wt,{align:"start",className:"w-80 p-0",onOpenAutoFocus:ja,children:t.jsxs("div",{className:"flex flex-col",children:[P,be,Ce]})}),e[74]=P,e[75]=be,e[76]=Ce,e[77]=L):L=e[77];let ne;return e[78]!==T||e[79]!==L||e[80]!==F?(ne=t.jsxs(Ht,{open:F,onOpenChange:g,children:[T,L]}),e[78]=T,e[79]=L,e[80]=F,e[81]=ne):ne=e[81],ne}function ja(l){return l.preventDefault()}function ba(l){const e=K.c(33),{selectedColor:n,onColorChange:s}=l,i=Q(),[a,o]=H.useState(!1);let r,h,c,m,f,d,p;if(e[0]!==a||e[1]!==n){const N=nn(n);h=Ht,d=a,p=o,r=Gt,f=!0,c="button",m=pe("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]=n,e[2]=r,e[3]=h,e[4]=c,e[5]=m,e[6]=f,e[7]=d,e[8]=p}else r=e[2],h=e[3],c=e[4],m=e[5],f=e[6],d=e[7],p=e[8];let x;e[9]!==i?(x=i("common.iconPicker.changeColor"),e[9]=i,e[10]=x):x=e[10];let u;e[11]!==i?(u=i("common.iconPicker.changeColor"),e[11]=i,e[12]=u):u=e[12];let g;e[13]!==c||e[14]!==m||e[15]!==x||e[16]!==u?(g=t.jsx("button",{type:c,className:m,title:x,"aria-label":u}),e[13]=c,e[14]=m,e[15]=x,e[16]=u,e[17]=g):g=e[17];let j;e[18]!==r||e[19]!==f||e[20]!==g?(j=t.jsx(r,{asChild:f,children:g}),e[18]=r,e[19]=f,e[20]=g,e[21]=j):j=e[21];let y;e[22]!==s||e[23]!==n?(y=ci.map(N=>t.jsx("button",{type:"button",onClick:()=>{s(N.name),o(!1)},className:pe("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",N.dot,n===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]=s,e[23]=n,e[24]=y):y=e[24];let b;e[25]!==y?(b=t.jsx(Wt,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:ya,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:y})}),e[25]=y,e[26]=b):b=e[26];let v;return e[27]!==h||e[28]!==b||e[29]!==d||e[30]!==p||e[31]!==j?(v=t.jsxs(h,{open:d,onOpenChange:p,children:[j,b]}),e[27]=h,e[28]=b,e[29]=d,e[30]=p,e[31]=j,e[32]=v):v=e[32],v}function ya(l){return l.preventDefault()}function wa(l){const e=K.c(55),{search:n,onSearchChange:s,selectedColor:i,onColorChange:a,onSelectIcon:o,onRandom:r,currentIconName:h}=l,c=Q();let m,f,d,p,x,u,g;if(e[0]!==h||e[1]!==a||e[2]!==r||e[3]!==s||e[4]!==o||e[5]!==n||e[6]!==i||e[7]!==c){const N=Ut(),M=nn(i);f=ln(N,n),u="flex flex-col";let C;e[15]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(gt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=C):C=e[15];let w;e[16]!==s?(w=I=>s(I.target.value),e[16]=s,e[17]=w):w=e[17];let k;e[18]!==c?(k=c("common.iconPicker.filterPlaceholder"),e[18]=c,e[19]=k):k=e[19];let S;e[20]!==n||e[21]!==w||e[22]!==k?(S=t.jsxs("div",{className:"relative flex-1",children:[C,t.jsx(Me,{value:n,onChange:w,placeholder:k,className:"h-8 text-xs pl-7"})]}),e[20]=n,e[21]=w,e[22]=k,e[23]=S):S=e[23];let _;e[24]!==c?(_=c("common.iconPicker.randomIcon"),e[24]=c,e[25]=_):_=e[25];let V;e[26]!==c?(V=c("common.iconPicker.randomIcon"),e[26]=c,e[27]=V):V=e[27];let O;e[28]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(oi,{size:14,className:"text-muted-foreground"}),e[28]=O):O=e[28];let A;e[29]!==r||e[30]!==_||e[31]!==V?(A=t.jsx("button",{type:"button",onClick:r,className:"h-8 w-8 flex items-center justify-center classic:rounded-md compact:rounded-lg border border-border hover:bg-accent transition-colors shrink-0",title:_,"aria-label":V,children:O}),e[29]=r,e[30]=_,e[31]=V,e[32]=A):A=e[32];let E;e[33]!==a||e[34]!==i?(E=t.jsx(ba,{selectedColor:i,onColorChange:a}),e[33]=a,e[34]=i,e[35]=E):E=e[35],e[36]!==A||e[37]!==E||e[38]!==S?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[S,A,E]}),e[36]=A,e[37]=E,e[38]=S,e[39]=g):g=e[39],m=rn,x="h-56",d="grid grid-cols-9 gap-0.5 px-2 pb-2",p=f.map(I=>{const $=Yt(I);return $?t.jsx("button",{type:"button",onClick:()=>o(I),className:pe("h-8 w-8 flex items-center justify-center classic:rounded-md compact:rounded-lg transition-colors cursor-pointer",h===I?pe(M.bg,M.text):pe(M.text,"hover:bg-accent")),title:I,"aria-label":$t(I),children:t.jsx($,{size:18})},I):null}),e[0]=h,e[1]=a,e[2]=r,e[3]=s,e[4]=o,e[5]=n,e[6]=i,e[7]=c,e[8]=m,e[9]=f,e[10]=d,e[11]=p,e[12]=x,e[13]=u,e[14]=g}else m=e[8],f=e[9],d=e[10],p=e[11],x=e[12],u=e[13],g=e[14];let j;e[40]!==d||e[41]!==p?(j=t.jsx("div",{className:d,children:p}),e[40]=d,e[41]=p,e[42]=j):j=e[42];let y;e[43]!==f.length||e[44]!==c?(y=f.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("common.iconPicker.noIconsFound")}),e[43]=f.length,e[44]=c,e[45]=y):y=e[45];let b;e[46]!==m||e[47]!==x||e[48]!==j||e[49]!==y?(b=t.jsxs(m,{className:x,children:[j,y]}),e[46]=m,e[47]=x,e[48]=j,e[49]=y,e[50]=b):b=e[50];let v;return e[51]!==u||e[52]!==g||e[53]!==b?(v=t.jsxs("div",{className:u,children:[g,b]}),e[51]=u,e[52]=g,e[53]=b,e[54]=v):v=e[54],v}function Sa(l){const e=K.c(46),{onUpload:n}=l,s=Q(),i=H.useRef(null);let a;e[0]!==n||e[1]!==s?(a=A=>{const E=A.target.files?.[0];if(!E)return;if(E.size>2097152){re.error(s("common.iconPicker.imageTooLarge")),A.target.value="";return}const I=new FileReader;I.onerror=()=>{re.error(s("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},I.onloadend=()=>{I.readyState===FileReader.DONE&&I.result&&n(I.result),i.current&&(i.current.value="")},I.readAsDataURL(E)},e[0]=n,e[1]=s,e[2]=a):a=e[2];const o=a,[r,h]=H.useState("");let c;e[3]!==n||e[4]!==r?(c=()=>{const A=r.trim();A&&(n(A),h(""))},e[3]=n,e[4]=r,e[5]=c):c=e[5];const m=c;let f;e[6]!==o?(f=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:o}),e[6]=o,e[7]=f):f=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=()=>i.current?.click(),e[8]=d):d=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Mi,{size:20}),e[9]=p):p=e[9];let x;e[10]!==s?(x=s("common.iconPicker.uploadHint"),e[10]=s,e[11]=x):x=e[11];let u;e[12]!==x?(u=t.jsxs("button",{type:"button",onClick:d,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:x})]}),e[12]=x,e[13]=u):u=e[13];let g;e[14]!==s?(g=s("common.iconPicker.or"),e[14]=s,e[15]=g):g=e[15];let j;e[16]!==g?(j=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=j):j=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 b;e[19]!==j?(b=t.jsxs("div",{className:"flex items-center gap-2",children:[j,y]}),e[19]=j,e[20]=b):b=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=A=>h(A.target.value),e[21]=v):v=e[21];let N;e[22]!==s?(N=s("common.iconPicker.pasteUrlPlaceholder"),e[22]=s,e[23]=N):N=e[23];let M;e[24]!==m?(M=A=>{A.key==="Enter"&&(A.preventDefault(),m())},e[24]=m,e[25]=M):M=e[25];let C;e[26]!==r||e[27]!==N||e[28]!==M?(C=t.jsx(Me,{value:r,onChange:v,placeholder:N,className:"h-8 text-xs flex-1",onKeyDown:M}),e[26]=r,e[27]=N,e[28]=M,e[29]=C):C=e[29];let w;e[30]!==r?(w=r.trim(),e[30]=r,e[31]=w):w=e[31];const k=!w;let S;e[32]!==s?(S=s("common.iconPicker.apply"),e[32]=s,e[33]=S):S=e[33];let _;e[34]!==m||e[35]!==k||e[36]!==S?(_=t.jsx(Z,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs shrink-0",onClick:m,disabled:k,children:S}),e[34]=m,e[35]=k,e[36]=S,e[37]=_):_=e[37];let V;e[38]!==C||e[39]!==_?(V=t.jsxs("div",{className:"flex items-center gap-1.5",children:[C,_]}),e[38]=C,e[39]=_,e[40]=V):V=e[40];let O;return e[41]!==b||e[42]!==V||e[43]!==f||e[44]!==u?(O=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[f,u,b,V]}),e[41]=b,e[42]=V,e[43]=f,e[44]=u,e[45]=O):O=e[45],O}function Na(l){const e=K.c(5),{header:n,groups:s}=l;let i;e[0]!==s?(i=s.filter(ka).map(Ca),e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs(Hs,{children:[n,i]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function Ca(l){return l.content?t.jsx("div",{children:l.content},l.key):t.jsx(De,{title:l.title,children:t.jsx(Ve,{children:(l.rows??[]).map(Ma)})},l.key)}function Ma(l){return t.jsx(Re,{onClick:l.onClick,icon:l.icon,title:t.jsx("span",{className:pe(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(at,{size:16})]})})},l.key)}function ka(l){return l.content||l.rows?.length}function _a(l){const e=K.c(19),{title:n,backLabel:s,onBack:i,actions:a,children:o}=l;let r;e[0]!==s||e[1]!==i?(r=t.jsx(us,{children:t.jsx(ki,{asChild:!0,className:"rounded-md px-2 py-1 text-muted-foreground hover:bg-accent",children:t.jsx("button",{type:"button",onClick:i,children:s})})}),e[0]=s,e[1]=i,e[2]=r):r=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(_i,{}),e[3]=h):h=e[3];let c;e[4]!==n?(c=t.jsx(us,{children:t.jsx(Vi,{className:"px-2 py-1",children:n})}),e[4]=n,e[5]=c):c=e[5];let m;e[6]!==r||e[7]!==c?(m=t.jsx(Ti,{className:"-ml-2 min-w-0",children:t.jsxs(Di,{className:"text-[15px]",children:[r,h,c]})}),e[6]=r,e[7]=c,e[8]=m):m=e[8];let f;e[9]!==a?(f=a&&t.jsx("div",{className:"shrink-0",children:a}),e[9]=a,e[10]=f):f=e[10];let d;e[11]!==m||e[12]!==f?(d=t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[m,f]}),e[11]=m,e[12]=f,e[13]=d):d=e[13];let p;e[14]!==o?(p=t.jsx("div",{className:"flex flex-col gap-10",children:o}),e[14]=o,e[15]=p):p=e[15];let x;return e[16]!==d||e[17]!==p?(x=t.jsxs("div",{className:"flex flex-col gap-8",children:[d,p]}),e[16]=d,e[17]=p,e[18]=x):x=e[18],x}const Mn=["general","connections","site"],He={general:{icon:ui,titleKey:"virtualMcp.settings.general.title",descriptionKey:"virtualMcp.settings.general.description"},connections:{icon:Ai,titleKey:"virtualMcp.settings.connections.title",descriptionKey:"virtualMcp.settings.connections.description"},site:{icon:di,titleKey:"virtualMcp.settings.site.title",descriptionKey:"virtualMcp.settings.site.description"}};function Va(l){return!!l&&Mn.includes(l)}const kn=25*1024*1024,At="home",It="knowledge";function ks(l){return l==null?"":l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(0)} KB`:`${(l/(1024*1024)).toFixed(1)} MB`}function Ge(l){return l.split("/").pop()??l}function _s(l){const e=K.c(64),{form:n}=l,s=Q(),{upload:i}=tl(At),a=sl(),o=H.useRef(null),[r,h]=H.useState(!1),[c,m]=H.useState(""),[f,d]=H.useState(!1);let p;e[0]!==r?(p={enabled:r},e[0]=r,e[1]=p):p=e[1];const{data:x}=nl(60,p),u=x===void 0?[]:x;let g;e[2]!==r?(g={enabled:r},e[2]=r,e[3]=g):g=e[3];const{data:j}=il(g),y=j===void 0?[]:j;let b;e[4]!==n?(b=()=>n.getValues("metadata.knowledge")??[],e[4]=n,e[5]=b):b=e[5];const[v,N]=H.useState(b);let M;e[6]!==n?(M=L=>{N(L),n.setValue("metadata.knowledge",L,{shouldDirty:!0})},e[6]=n,e[7]=M):M=e[7];const C=M;let w;e[8]!==a||e[9]!==v||e[10]!==C||e[11]!==s||e[12]!==i?(w=async L=>{if(!L||L.length===0)return;const ne=Array.from(L),ce=ne.filter($a),Ee=ne.filter(Pa);if(Ee.length>0&&re.warning(s("virtualMcp.filesSection.fileTooLargeTitle"),{description:s("virtualMcp.filesSection.fileTooLargeDescription",{names:Ee.map(Oa).join(", ")})}),ce.length!==0){try{await i.mutateAsync({dir:It,files:ce})}catch(D){const te=D;re.error(te instanceof Error?te.message:s("virtualMcp.filesSection.failedUploadFile"));return}C([...v,...ce.map(D=>({id:crypto.randomUUID(),name:D.name,volume:At,path:`${It}/${D.name}`,url:a(At,`${It}/${D.name}`),contentType:D.type||null,size:D.size,addedAt:new Date().toISOString()}))])}},e[8]=a,e[9]=v,e[10]=C,e[11]=s,e[12]=i,e[13]=w):w=e[13];const k=w;let S;e[14]!==a||e[15]!==v||e[16]!==C?(S=L=>{v.some(ne=>ne.volume===L.volume&&ne.path===L.path)||(C([...v,{id:crypto.randomUUID(),name:Ge(L.path),volume:L.volume,path:L.path,url:a(L.volume,L.path),contentType:null,size:L.size??null,addedAt:new Date().toISOString()}]),h(!1))},e[14]=a,e[15]=v,e[16]=C,e[17]=S):S=e[17];const _=S;let V;e[18]!==a||e[19]!==v||e[20]!==C?(V=L=>{v.some(ne=>ne.volume===L.volume&&ne.path===L.path)||(C([...v,{id:crypto.randomUUID(),name:Ge(L.path),kind:"skill",volume:L.volume,path:L.path,url:a(L.volume,L.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),h(!1))},e[18]=a,e[19]=v,e[20]=C,e[21]=V):V=e[21];const O=V;let A;e[22]!==v||e[23]!==C?(A=L=>{C(v.filter(ne=>ne.id!==L))},e[22]=v,e[23]=C,e[24]=A):A=e[24];const E=A;let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=L=>{h(L),L&&m("")},e[25]=I):I=e[25];const $=I;let F;e[26]!==v?(F=new Set(v.map(Ia)),e[26]=v,e[27]=F):F=e[27];const q=F,R=c.toLowerCase();let G;e[28]!==q?(G=L=>!q.has(`${L.volume}/${L.path}`),e[28]=q,e[29]=G):G=e[29];const U=u.filter(Aa).filter(G).filter(L=>Ge(L.path).toLowerCase().includes(R)).slice(0,5);let T;e[30]!==q?(T=L=>!q.has(`${L.volume}/${L.path}`),e[30]=q,e[31]=T):T=e[31];const P=y.filter(T).filter(L=>Ge(L.path).toLowerCase().includes(R)).slice(0,5),W=L=>t.jsxs(qs,{open:r,onOpenChange:$,children:[t.jsx(Qs,{asChild:!0,children:L}),t.jsxs(Xs,{align:"end",className:"w-56",children:[t.jsxs(Ze,{onSelect:()=>{o.current?.click()},children:[t.jsx(mi,{size:16}),s("virtualMcp.filesSection.uploadFile")]}),t.jsxs(ns,{children:[t.jsxs(is,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(el,{size:16}),s("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(ls,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(gt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:c,onChange:ne=>m(ne.target.value),onKeyDown:Da,placeholder:s("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:U.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:s("virtualMcp.filesSection.noFilesFound")}):U.map(ne=>t.jsxs(Ze,{onSelect:()=>_(ne),children:[t.jsx(gs,{filename:Ge(ne.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ge(ne.path)}),ne.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:ks(ne.size)})]},`${ne.volume}/${ne.path}`))})]})]}),t.jsxs(ns,{children:[t.jsxs(is,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(ht,{size:16}),s("virtualMcp.filesSection.selectSkill")]}),t.jsxs(ls,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(gt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:c,onChange:ne=>m(ne.target.value),onKeyDown:Ta,placeholder:s("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:P.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:s("virtualMcp.filesSection.noSkillsFound")}):P.map(ne=>t.jsxs(Ze,{onSelect:()=>O(ne),children:[t.jsx(ht,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ge(ne.path)})]},`${ne.volume}/${ne.path}`))})]})]})]})]}),B="flex flex-col gap-3";let z;e[32]!==s?(z=s("virtualMcp.filesSection.filesAndSkills"),e[32]=s,e[33]=z):z=e[33];let Y;e[34]!==z?(Y=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:z}),e[34]=z,e[35]=Y):Y=e[35];let X;e[36]!==s?(X=s("virtualMcp.filesSection.description"),e[36]=s,e[37]=X):X=e[37];let ie;e[38]!==X?(ie=t.jsx("p",{className:"text-sm text-muted-foreground",children:X}),e[38]=X,e[39]=ie):ie=e[39];let le;e[40]!==Y||e[41]!==ie?(le=t.jsxs("div",{className:"flex flex-col gap-1",children:[Y,ie]}),e[40]=Y,e[41]=ie,e[42]=le):le=e[42];const de=v.length>0&&W(t.jsxs(Z,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(ot,{size:"xs"}):t.jsx(Le,{size:14}),s("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 J;e[46]!==k?(J=t.jsx("input",{ref:o,type:"file",multiple:!0,className:"hidden",onChange:L=>{k(L.target.files),L.target.value=""}}),e[46]=k,e[47]=J):J=e[47];let ee,xe;e[48]===Symbol.for("react.memo_cache_sentinel")?(ee=L=>{L.preventDefault(),d(!0)},xe=()=>d(!1),e[48]=ee,e[49]=xe):(ee=e[48],xe=e[49]);let ge;e[50]!==k?(ge=L=>{L.preventDefault(),L.stopPropagation(),d(!1),k(L.dataTransfer.files)},e[50]=k,e[51]=ge):ge=e[51];const ke=f&&"outline outline-2 outline-dashed outline-primary";let he;e[52]!==ke?(he=pe("flex flex-col gap-2 rounded-lg",ke),e[52]=ke,e[53]=he):he=e[53];const $e=v.length===0?W(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(Le,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:s("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):v.map(L=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-card",children:[L.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(ht,{size:16})}):t.jsx(gs,{filename:L.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:L.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:L.kind==="skill"?s("virtualMcp.filesSection.kindSkill"):L.size!=null?ks(L.size):s("virtualMcp.filesSection.kindFile")})]}),t.jsx(Z,{variant:"ghost",size:"icon",onClick:()=>E(L.id),"aria-label":s("virtualMcp.filesSection.removeAriaLabel",{name:L.name}),children:t.jsx(it,{size:16})})]},L.id));let be;e[54]!==ee||e[55]!==xe||e[56]!==ge||e[57]!==he||e[58]!==$e?(be=t.jsx("div",{onDragOver:ee,onDragLeave:xe,onDrop:ge,className:he,children:$e}),e[54]=ee,e[55]=xe,e[56]=ge,e[57]=he,e[58]=$e,e[59]=be):be=e[59];let Ce;return e[60]!==oe||e[61]!==J||e[62]!==be?(Ce=t.jsxs("section",{className:B,children:[oe,J,be]}),e[60]=oe,e[61]=J,e[62]=be,e[63]=Ce):Ce=e[63],Ce}function Ta(l){return l.stopPropagation()}function Da(l){return l.stopPropagation()}function Aa(l){return l.kind!=="dir"}function Ia(l){return`${l.volume}/${l.path}`}function Oa(l){return l.name}function Pa(l){return l.size>kn}function $a(l){return l.size<=kn}function Ea(l){return l==null?"all":l.length===0?"self":"selected"}function Vs(l){const e=K.c(88),{form:n,currentAgentId:s}=l,i=Q(),{org:a}=Be(),o=cn(),[r,h]=H.useState(!1);let c;e[0]!==n?(c=n.getValues("metadata.subAgents")??null,e[0]=n,e[1]=c):c=e[1];const m=c;let f;e[2]!==m?(f=()=>Ea(m),e[2]=m,e[3]=f):f=e[3];const[d,p]=H.useState(f);let x;e[4]!==m?(x=m??[],e[4]=m,e[5]=x):x=e[5];const[u,g]=H.useState(x);let j,y,b,v,N,M;if(e[6]!==o||e[7]!==s||e[8]!==n||e[9]!==d||e[10]!==a||e[11]!==u||e[12]!==i){let S;e[19]!==s||e[20]!==a?(S=ee=>ee.id!==s&&ee.id!==a.id&&ee.status==="active",e[19]=s,e[20]=a,e[21]=S):S=e[21],j=o.filter(S);let _;e[22]!==u?(_=ee=>u.includes(ee.id),e[22]=u,e[23]=_):_=e[23];const V=j.filter(_);let O;e[24]!==n?(O=(ee,xe)=>n.setValue("metadata.subAgents",ee==="all"?null:ee==="self"?[]:xe,{shouldDirty:!0}),e[24]=n,e[25]=O):O=e[25];const A=O;let E;e[26]!==A||e[27]!==u?(E=ee=>{p(ee),A(ee,u)},e[26]=A,e[27]=u,e[28]=E):E=e[28];const I=E;let $;e[29]!==A||e[30]!==u?($=ee=>{const xe=u.includes(ee)?u.filter(ge=>ge!==ee):[...u,ee];g(xe),A("selected",xe)},e[29]=A,e[30]=u,e[31]=$):$=e[31],y=$,N="flex flex-col gap-3";let F;e[32]!==i?(F=i("virtualMcp.subAgentsSection.title"),e[32]=i,e[33]=F):F=e[33];let q;e[34]!==F?(q=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:F}),e[34]=F,e[35]=q):q=e[35];let R;e[36]!==d||e[37]!==i?(R=d==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=d,e[37]=i,e[38]=R):R=e[38];let G;e[39]!==d||e[40]!==i?(G=d==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=d,e[40]=i,e[41]=G):G=e[41];let U;e[42]!==q||e[43]!==R||e[44]!==G?(U=t.jsxs("div",{className:"flex flex-col gap-1",children:[q,R,G]}),e[42]=q,e[43]=R,e[44]=G,e[45]=U):U=e[45];const T=d==="selected"&&V.length>0&&t.jsxs(Z,{variant:"outline",size:"sm",onClick:()=>h(!0),children:[t.jsx(Le,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let P;e[46]!==I?(P=ee=>I(ee),e[46]=I,e[47]=P):P=e[47];let W;e[48]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsx(Ae,{size:"sm",className:"w-auto",children:t.jsx(Ie,{})}),e[48]=W):W=e[48];let B;e[49]!==i?(B=i("virtualMcp.subAgentsSection.anyAgent"),e[49]=i,e[50]=B):B=e[50];let z;e[51]!==B?(z=t.jsx(je,{value:"all",children:B}),e[51]=B,e[52]=z):z=e[52];let Y;e[53]!==i?(Y=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=Y):Y=e[54];let X;e[55]!==Y?(X=t.jsx(je,{value:"selected",children:Y}),e[55]=Y,e[56]=X):X=e[56];let ie;e[57]!==i?(ie=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=ie):ie=e[58];let le;e[59]!==ie?(le=t.jsx(je,{value:"self",children:ie}),e[59]=ie,e[60]=le):le=e[60];let de;e[61]!==z||e[62]!==X||e[63]!==le?(de=t.jsxs(Oe,{align:"end",children:[z,X,le]}),e[61]=z,e[62]=X,e[63]=le,e[64]=de):de=e[64];let oe;e[65]!==d||e[66]!==P||e[67]!==de?(oe=t.jsxs(Pe,{value:d,onValueChange:P,children:[W,de]}),e[65]=d,e[66]=P,e[67]=de,e[68]=oe):oe=e[68];let J;e[69]!==T||e[70]!==oe?(J=t.jsxs("div",{className:"flex items-center gap-2",children:[T,oe]}),e[69]=T,e[70]=oe,e[71]=J):J=e[71],e[72]!==U||e[73]!==J?(M=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[U,J]}),e[72]=U,e[73]=J,e[74]=M):M=e[74],b="flex flex-col gap-2",v=d==="selected"&&(V.length>0?V.map(ee=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-background",children:[t.jsx(tt,{icon:ee.icon,name:ee.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:ee.title}),ee.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ee.description})]}),t.jsx(Z,{variant:"ghost",size:"icon",onClick:()=>y(ee.id),children:t.jsx(Qt,{size:16})})]},ee.id)):t.jsxs("button",{type:"button",onClick:()=>h(!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(Le,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.emptyStateMessage")})]})),e[6]=o,e[7]=s,e[8]=n,e[9]=d,e[10]=a,e[11]=u,e[12]=i,e[13]=j,e[14]=y,e[15]=b,e[16]=v,e[17]=N,e[18]=M}else j=e[13],y=e[14],b=e[15],v=e[16],N=e[17],M=e[18];let C;e[75]!==b||e[76]!==v?(C=t.jsx("div",{className:b,children:v}),e[75]=b,e[76]=v,e[77]=C):C=e[77];let w;e[78]!==j||e[79]!==y||e[80]!==r||e[81]!==u?(w=t.jsx(Fa,{open:r,onOpenChange:h,candidates:j,selectedIds:u,onToggle:y}),e[78]=j,e[79]=y,e[80]=r,e[81]=u,e[82]=w):w=e[82];let k;return e[83]!==N||e[84]!==M||e[85]!==C||e[86]!==w?(k=t.jsxs("section",{className:N,children:[M,C,w]}),e[83]=N,e[84]=M,e[85]=C,e[86]=w,e[87]=k):k=e[87],k}function Fa(l){const e=K.c(39),{open:n,onOpenChange:s,candidates:i,selectedIds:a,onToggle:o}=l,r=Q(),[h,c]=H.useState("");let m,f,d,p,x,u,g,j,y;if(e[0]!==i||e[1]!==s||e[2]!==o||e[3]!==n||e[4]!==h||e[5]!==a||e[6]!==r){const M=h.toLowerCase(),C=i.filter(S=>S.title.toLowerCase().includes(M)||S.description?.toLowerCase().includes(M));f=ct,j=n,y=s,m=dt,x="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?(u=t.jsx(Ct,{children:t.jsx(Mt,{children:w})}),e[18]=w,e[19]=u):u=e[19];let k;e[20]!==r?(k=r("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=r,e[21]=k):k=e[21],e[22]!==h||e[23]!==k?(g=t.jsx(ll,{value:h,onChange:c,placeholder:k,className:"w-full"}),e[22]=h,e[23]=k,e[24]=g):g=e[24],d="flex flex-col gap-1 max-h-80 overflow-y-auto",p=C.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:r("virtualMcp.subAgentsSection.noAgentsFound")}):C.map(S=>t.jsxs("button",{type:"button",onClick:()=>o(S.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(fn,{checked:a.includes(S.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(tt,{icon:S.icon,name:S.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:S.title}),S.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S.description})]})]},S.id)),e[0]=i,e[1]=s,e[2]=o,e[3]=n,e[4]=h,e[5]=a,e[6]=r,e[7]=m,e[8]=f,e[9]=d,e[10]=p,e[11]=x,e[12]=u,e[13]=g,e[14]=j,e[15]=y}else m=e[7],f=e[8],d=e[9],p=e[10],x=e[11],u=e[12],g=e[13],j=e[14],y=e[15];let b;e[25]!==d||e[26]!==p?(b=t.jsx("div",{className:d,children:p}),e[25]=d,e[26]=p,e[27]=b):b=e[27];let v;e[28]!==m||e[29]!==x||e[30]!==u||e[31]!==g||e[32]!==b?(v=t.jsxs(m,{className:x,children:[u,g,b]}),e[28]=m,e[29]=x,e[30]=u,e[31]=g,e[32]=b,e[33]=v):v=e[33];let N;return e[34]!==f||e[35]!==j||e[36]!==y||e[37]!==v?(N=t.jsx(f,{open:j,onOpenChange:y,children:v}),e[34]=f,e[35]=j,e[36]=y,e[37]=v,e[38]=N):N=e[38],N}function nt(){const l=K.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(ot,{className:"size-6 text-muted-foreground"})}),l[0]=e):e=l[0],e}function xt(l,e){return({error:n})=>n?.message?.includes("Method not found")||n?.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(Js,{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:n?.message?n.message.length>200?`${n.message.slice(0,200)}...`:n.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function _n(l){const e=K.c(23),{item:n,isSelected:s,onToggle:i,disabled:a}=l,o=a?"cursor-not-allowed opacity-50":"cursor-pointer",r=s?"bg-accent/25":"hover:bg-muted/50";let h;e[0]!==o||e[1]!==r?(h=pe("flex items-start gap-3 p-4 rounded-lg transition-colors",o,r),e[0]=o,e[1]=r,e[2]=h):h=e[2];let c;e[3]!==n.name?(c=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:n.name}),e[3]=n.name,e[4]=c):c=e[4];let m;e[5]!==n.tags?(m=n.tags&&t.jsx("span",{className:"shrink-0",children:n.tags}),e[5]=n.tags,e[6]=m):m=e[6];let f;e[7]!==c||e[8]!==m?(f=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c,m]}),e[7]=c,e[8]=m,e[9]=f):f=e[9];let d;e[10]!==n.description?(d=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[10]=n.description,e[11]=d):d=e[11];let p;e[12]!==f||e[13]!==d?(p=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[f,d]}),e[12]=f,e[13]=d,e[14]=p):p=e[14];let x;e[15]!==a||e[16]!==s||e[17]!==i?(x=t.jsx(fn,{checked:s,onCheckedChange:i,disabled:a,className:"mt-0.5"}),e[15]=a,e[16]=s,e[17]=i,e[18]=x):x=e[18];let u;return e[19]!==h||e[20]!==p||e[21]!==x?(u=t.jsxs("label",{className:h,children:[p,x]}),e[19]=h,e[20]=p,e[21]=x,e[22]=u):u=e[22],u}function za(l){const e=K.c(35),{activeTab:n,onTabChange:s,showSelectAll:i,isAllSelected:a,handleSelectAll:o}=l,r=Q();let h;e[0]!==r?(h=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=h):h=e[1];let c;e[2]!==h?(c={id:"tools",label:h},e[2]=h,e[3]=c):c=e[3];let m;e[4]!==r?(m=r("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=r,e[5]=m):m=e[5];let f;e[6]!==m?(f={id:"active",label:m},e[6]=m,e[7]=f):f=e[7];let d;e[8]!==r?(d=r("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=r,e[9]=d):d=e[9];let p;e[10]!==d?(p={id:"resources",label:d},e[10]=d,e[11]=p):p=e[11];let x;e[12]!==r?(x=r("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=r,e[13]=x):x=e[13];let u;e[14]!==x?(u={id:"prompts",label:x},e[14]=x,e[15]=u):u=e[15];let g;e[16]!==c||e[17]!==f||e[18]!==p||e[19]!==u?(g=[c,f,p,u],e[16]=c,e[17]=f,e[18]=p,e[19]=u,e[20]=g):g=e[20];let j;e[21]!==s?(j=N=>s(N),e[21]=s,e[22]=j):j=e[22];let y;e[23]!==n||e[24]!==j||e[25]!==g?(y=t.jsx(al,{tabs:g,activeTab:n,onTabChange:j}),e[23]=n,e[24]=j,e[25]=g,e[26]=y):y=e[26];let b;e[27]!==o||e[28]!==a||e[29]!==i||e[30]!==r?(b=i&&t.jsx("button",{type:"button",onClick:o,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(a?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=o,e[28]=a,e[29]=i,e[30]=r,e[31]=b):b=e[31];let v;return e[32]!==y||e[33]!==b?(v=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[y,b]}),e[32]=y,e[33]=b,e[34]=v):v=e[34],v}function Jt(l){const e=K.c(13),{items:n,selections:s,onToggle:i,emptyMessage:a,disabled:o}=l;let r,h,c;if(e[0]!==o||e[1]!==a||e[2]!==n||e[3]!==i||e[4]!==s){c=Symbol.for("react.early_return_sentinel");e:{const f=n.map(Ra);if(n.length===0){let d;e[8]!==a?(d=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]=d):d=e[9],c=d;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",h=n.map(d=>t.jsx(_n,{item:d,isSelected:s===null||s?.includes(d.id),onToggle:()=>i(d.id,f),disabled:o},d.id))}e[0]=o,e[1]=a,e[2]=n,e[3]=i,e[4]=s,e[5]=r,e[6]=h,e[7]=c}else r=e[5],h=e[6],c=e[7];if(c!==Symbol.for("react.early_return_sentinel"))return c;let m;return e[10]!==r||e[11]!==h?(m=t.jsx("div",{className:r,children:h}),e[10]=r,e[11]=h,e[12]=m):m=e[12],m}function Ra(l){return l.id}function La(l){const e=K.c(22),{connectionId:n,toolSelections:s,onToggleTool:i}=l,a=Q(),{org:o}=Be();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=kt(r);let c;e[4]!==h?(c={client:h},e[4]=h,e[5]=c):c=e[5];const{data:m}=hn(c),f=m.tools;let d,p,x;if(e[6]!==m.tools||e[7]!==i||e[8]!==a||e[9]!==s){x=Symbol.for("react.early_return_sentinel");e:{const g=f.map(Ua);let j;e[13]!==s?(j=v=>s===null||s.includes(v.name),e[13]=s,e[14]=j):j=e[14];const b=m.tools.filter(j).map(Ba);if(b.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],x=N;break e}d="flex-1 overflow-auto px-4 py-3 space-y-1",p=b.map(v=>t.jsx(_n,{item:v,isSelected:!0,onToggle:()=>i(v.id,g)},v.id))}e[6]=m.tools,e[7]=i,e[8]=a,e[9]=s,e[10]=d,e[11]=p,e[12]=x}else d=e[10],p=e[11],x=e[12];if(x!==Symbol.for("react.early_return_sentinel"))return x;let u;return e[19]!==d||e[20]!==p?(u=t.jsx("div",{className:d,children:p}),e[19]=d,e[20]=p,e[21]=u):u=e[21],u}function Ba(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(pn,{annotations:l.annotations,_meta:l._meta})}}function Ua(l){return l.name}function Ya(l){const e=K.c(16),{connectionId:n,selections:s,onToggle:i,disabled:a}=l,{org:o}=Be();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=kt(r);let c;e[4]!==h?(c={client:h},e[4]=h,e[5]=c):c=e[5];const{data:m}=hn(c);let f;e[6]!==m.tools?(f=m.tools.map(Ka),e[6]=m.tools,e[7]=f):f=e[7];const d=f,p=Q();let x;e[8]!==p?(x=p("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=p,e[9]=x):x=e[9];let u;return e[10]!==a||e[11]!==d||e[12]!==i||e[13]!==s||e[14]!==x?(u=t.jsx(Jt,{items:d,selections:s,onToggle:i,emptyMessage:x,disabled:a}),e[10]=a,e[11]=d,e[12]=i,e[13]=s,e[14]=x,e[15]=u):u=e[15],u}function Ka(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(pn,{annotations:l.annotations,_meta:l._meta})}}function Ga(l){const e=K.c(16),{connectionId:n,selections:s,onToggle:i,disabled:a}=l,{org:o}=Be();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=kt(r);let c;e[4]!==h?(c={client:h},e[4]=h,e[5]=c):c=e[5];const{data:m}=$n(c);let f;e[6]!==m.resources?(f=m.resources.map(Wa),e[6]=m.resources,e[7]=f):f=e[7];const d=f,p=Q();let x;e[8]!==p?(x=p("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=p,e[9]=x):x=e[9];let u;return e[10]!==a||e[11]!==d||e[12]!==i||e[13]!==s||e[14]!==x?(u=t.jsx(Jt,{items:d,selections:s,onToggle:i,emptyMessage:x,disabled:a}),e[10]=a,e[11]=d,e[12]=i,e[13]=s,e[14]=x,e[15]=u):u=e[15],u}function Wa(l){return{id:l.name||l.uri,name:l.name||l.uri,description:l.description}}function Ha(l){const e=K.c(16),{connectionId:n,selections:s,onToggle:i,disabled:a}=l,{org:o}=Be();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=kt(r);let c;e[4]!==h?(c={client:h},e[4]=h,e[5]=c):c=e[5];const{data:m}=rl(c);let f;e[6]!==m.prompts?(f=m.prompts.map(qa),e[6]=m.prompts,e[7]=f):f=e[7];const d=f,p=Q();let x;e[8]!==p?(x=p("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=p,e[9]=x):x=e[9];let u;return e[10]!==a||e[11]!==d||e[12]!==i||e[13]!==s||e[14]!==x?(u=t.jsx(Jt,{items:d,selections:s,onToggle:i,emptyMessage:x,disabled:a}),e[10]=a,e[11]=d,e[12]=i,e[13]=s,e[14]=x,e[15]=u):u=e[15],u}function qa(l){return{id:l.name,name:l.name,description:l.description}}function Qa(l){const e=K.c(58),{currentConnection:n,activeTab:s,selectedId:i,formData:a,toggleTool:o,toggleResource:r,togglePrompt:h,toggleAllTools:c,toggleAllResources:m,toggleAllPrompts:f,onTabChange:d}=l,p=Q(),x=a[i],u=s==="tools"?x?.tools===null:s==="resources"?x?.resources===null:s==="prompts"?x?.prompts===null:!1,g=s!=="active";let j;e[0]!==s||e[1]!==i||e[2]!==f||e[3]!==m||e[4]!==c?(j=()=>{s==="tools"?c(i):s==="resources"?m(i):s==="prompts"&&f(i)},e[0]=s,e[1]=i,e[2]=f,e[3]=m,e[4]=c,e[5]=j):j=e[5];const y=j;let b;e[6]!==n.icon||e[7]!==n.title?(b=t.jsx(tt,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[6]=n.icon,e[7]=n.title,e[8]=b):b=e[8];let v;e[9]!==n.title?(v=t.jsx("h2",{className:"text-base font-semibold truncate",children:n.title}),e[9]=n.title,e[10]=v):v=e[10];let N;e[11]!==n.description?(N=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[11]=n.description,e[12]=N):N=e[12];let M;e[13]!==v||e[14]!==N?(M=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,N]}),e[13]=v,e[14]=N,e[15]=M):M=e[15];let C;e[16]!==b||e[17]!==M?(C=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[b,M]})}),e[16]=b,e[17]=M,e[18]=C):C=e[18];let w;e[19]!==s||e[20]!==y||e[21]!==u||e[22]!==d||e[23]!==g?(w=t.jsx(za,{activeTab:s,onTabChange:d,showSelectAll:g,isAllSelected:u,handleSelectAll:y}),e[19]=s,e[20]=y,e[21]=u,e[22]=d,e[23]=g,e[24]=w):w=e[24];let k;e[25]!==s||e[26]!==a||e[27]!==i||e[28]!==p||e[29]!==o?(k=s==="active"&&t.jsx(Ye,{fallback:xt(p("virtualMcp.dependencySelectionDialog.toolsNotSupported"),p),children:t.jsx(H.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(La,{connectionId:i,toolSelections:a[i]?a[i].tools:[],onToggleTool:(E,I)=>o(i,E,I)})})}),e[25]=s,e[26]=a,e[27]=i,e[28]=p,e[29]=o,e[30]=k):k=e[30];let S;e[31]!==s||e[32]!==a||e[33]!==i||e[34]!==p||e[35]!==o?(S=s==="tools"&&t.jsx(Ye,{fallback:xt(p("virtualMcp.dependencySelectionDialog.toolsNotSupported"),p),children:t.jsx(H.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(Ya,{connectionId:i,selections:a[i]?a[i].tools:[],onToggle:(E,I)=>o(i,E,I)})})}),e[31]=s,e[32]=a,e[33]=i,e[34]=p,e[35]=o,e[36]=S):S=e[36];let _;e[37]!==s||e[38]!==a||e[39]!==i||e[40]!==p||e[41]!==r?(_=s==="resources"&&t.jsx(Ye,{fallback:xt(p("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),p),children:t.jsx(H.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(Ga,{connectionId:i,selections:a[i]?a[i].resources:[],onToggle:(E,I)=>r(i,E,I)})})}),e[37]=s,e[38]=a,e[39]=i,e[40]=p,e[41]=r,e[42]=_):_=e[42];let V;e[43]!==s||e[44]!==a||e[45]!==i||e[46]!==p||e[47]!==h?(V=s==="prompts"&&t.jsx(Ye,{fallback:xt(p("virtualMcp.dependencySelectionDialog.promptsNotSupported"),p),children:t.jsx(H.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(Ha,{connectionId:i,selections:a[i]?a[i].prompts:[],onToggle:(E,I)=>h(i,E,I)})})}),e[43]=s,e[44]=a,e[45]=i,e[46]=p,e[47]=h,e[48]=V):V=e[48];let O;e[49]!==_||e[50]!==V||e[51]!==k||e[52]!==S?(O=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[k,S,_,V]}),e[49]=_,e[50]=V,e[51]=k,e[52]=S,e[53]=O):O=e[53];let A;return e[54]!==O||e[55]!==C||e[56]!==w?(A=t.jsxs(t.Fragment,{children:[C,w,O]}),e[54]=O,e[55]=C,e[56]=w,e[57]=A):A=e[57],A}function Xa(l){const e=K.c(7),{onClose:n}=l,s=Q();let i;e[0]!==n?(i=()=>n(!1),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==s?(a=s("virtualMcp.dependencySelectionDialog.done"),e[2]=s,e[3]=a):a=e[3];let o;return e[4]!==i||e[5]!==a?(o=t.jsx(mn,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(Z,{variant:"outline",onClick:i,children:a})}),e[4]=i,e[5]=a,e[6]=o):o=e[6],o}function Ja(l){const e=K.c(23),{connectionId:n,onAuthenticate:s,children:i}=l,a=Q();let o;e[0]!==n?(o={connectionId:n},e[0]=n,e[1]=o):o=e[1];const r=xn(o);if(r.supportsOAuth&&!r.isAuthenticated){let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(fi,{size:22,className:"text-muted-foreground"})}),e[2]=m):m=e[2];let f;e[3]!==a?(f=a("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=a,e[4]=f):f=e[4];let d;e[5]!==f?(d=t.jsx("p",{className:"text-sm font-medium",children:f}),e[5]=f,e[6]=d):d=e[6];let p;e[7]!==a?(p=a("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=a,e[8]=p):p=e[8];let x;e[9]!==p?(x=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:p}),e[9]=p,e[10]=x):x=e[10];let u;e[11]!==d||e[12]!==x?(u=t.jsxs("div",{className:"space-y-1",children:[d,x]}),e[11]=d,e[12]=x,e[13]=u):u=e[13];let g;e[14]!==n||e[15]!==s||e[16]!==a?(g=s&&t.jsx(Z,{variant:"outline",size:"sm",onClick:()=>s(n),children:a("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=n,e[15]=s,e[16]=a,e[17]=g):g=e[17];let j;return e[18]!==u||e[19]!==g?(j=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[m,u,g]}),e[18]=u,e[19]=g,e[20]=j):j=e[20],j}let c;return e[21]!==i?(c=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=c):c=e[22],c}function Za(l){const e={};for(const n of l)e[n.connection_id]={tools:n.selected_tools,resources:n.selected_resources??null,prompts:n.selected_prompts??null};return e}function Ts(l){return Object.entries(l).map(([e,n])=>({connection_id:e,selected_tools:n.tools,selected_resources:n.resources,selected_prompts:n.prompts}))}function Ds(l,e,n,s){const i=l[e]??{tools:null,resources:null,prompts:null};return{...l,[e]:{...i,[n]:s}}}function er(l,e){return e.type==="SET_ACTIVE_TAB"?{...l,activeTab:e.payload}:l}function tr(l){const e=K.c(49),{open:n,onOpenChange:s,selectedId:i,form:a,connections:o,onAuthenticate:r}=l;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activeTab:"tools"},e[0]=h):h=e[0];const[c,m]=H.useReducer(er,h),f=qt(i??"");let d;e[1]!==o?(d=o??[],e[1]=o,e[2]=d):d=e[2];let p;e[3]!==d?(p=Za(d),e[3]=d,e[4]=p):p=e[4];const x=p;let u;e[5]!==a||e[6]!==x?(u=(U,T,P,W)=>{const B=x[U]?.[T];let z;B===null?z=W.filter(Y=>Y!==P):B?.includes(P)?z=B.filter(Y=>Y!==P):(z=[...B??[],P],z.length===W.length&&(z=null)),a.setValue("connections",Ts(Ds(x,U,T,z)),{shouldDirty:!0,shouldTouch:!0})},e[5]=a,e[6]=x,e[7]=u):u=e[7];const g=u;let j;e[8]!==a||e[9]!==x?(j=(U,T)=>{const W=x[U]?.[T]===null?[]:null;a.setValue("connections",Ts(Ds(x,U,T,W)),{shouldDirty:!0,shouldTouch:!0})},e[8]=a,e[9]=x,e[10]=j):j=e[10];const y=j;let b;e[11]!==g?(b=(U,T,P)=>g(U,"tools",T,P),e[11]=g,e[12]=b):b=e[12];const v=b;let N;e[13]!==g?(N=(U,T,P)=>g(U,"resources",T,P),e[13]=g,e[14]=N):N=e[14];const M=N;let C;e[15]!==g?(C=(U,T,P)=>g(U,"prompts",T,P),e[15]=g,e[16]=C):C=e[16];const w=C;let k;e[17]!==y?(k=U=>y(U,"tools"),e[17]=y,e[18]=k):k=e[18];const S=k;let _;e[19]!==y?(_=U=>y(U,"resources"),e[19]=y,e[20]=_):_=e[20];const V=_;let O;e[21]!==y?(O=U=>y(U,"prompts"),e[21]=y,e[22]=O):O=e[22];const A=O;if(!i||!f)return null;let E;e[23]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(nt,{}),e[23]=E):E=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=U=>m({type:"SET_ACTIVE_TAB",payload:U}),e[24]=I):I=e[24];let $;e[25]!==f||e[26]!==c.activeTab||e[27]!==x||e[28]!==i||e[29]!==A||e[30]!==V||e[31]!==S||e[32]!==w||e[33]!==M||e[34]!==v?($=t.jsx(Qa,{currentConnection:f,activeTab:c.activeTab,selectedId:i,formData:x,toggleTool:v,toggleResource:M,togglePrompt:w,toggleAllTools:S,toggleAllResources:V,toggleAllPrompts:A,onTabChange:I},i),e[25]=f,e[26]=c.activeTab,e[27]=x,e[28]=i,e[29]=A,e[30]=V,e[31]=S,e[32]=w,e[33]=M,e[34]=v,e[35]=$):$=e[35];let F;e[36]!==r||e[37]!==i||e[38]!==$?(F=t.jsx(H.Suspense,{fallback:E,children:t.jsx(Ja,{connectionId:i,onAuthenticate:r,children:$})}),e[36]=r,e[37]=i,e[38]=$,e[39]=F):F=e[39];let q;e[40]!==s?(q=t.jsx(Xa,{onClose:s}),e[40]=s,e[41]=q):q=e[41];let R;e[42]!==F||e[43]!==q?(R=t.jsxs(dt,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[F,q]}),e[42]=F,e[43]=q,e[44]=R):R=e[44];let G;return e[45]!==s||e[46]!==n||e[47]!==R?(G=t.jsx(ct,{open:n,onOpenChange:s,children:R}),e[45]=s,e[46]=n,e[47]=R,e[48]=G):G=e[48],G}const As="__new_instance__";function Is(l){const e=K.c(25),{connection_id:n,usedConnectionIds:s,onOpenSettings:i,onRemove:a,onAuthenticate:o,onSwitchInstance:r,onNewInstance:h}=l,c=qt(n),{org:m}=Be();if(!c){let g;return e[0]!==a?(g=t.jsx(lr,{onRemove:a}),e[0]=a,e[1]=g):g=e[1],g}let f;e[2]!==c?(f=ol(c),e[2]=c,e[3]=f):f=e[3];const d=f;let p;e[4]!==n?(p=t.jsx(ir,{connection_id:n}),e[4]=n,e[5]=p):p=e[5];let x;e[6]!==c.app_name||e[7]!==c.connection_type||e[8]!==c.description||e[9]!==c.icon||e[10]!==c.status||e[11]!==c.title||e[12]!==n||e[13]!==o||e[14]!==h||e[15]!==i||e[16]!==a||e[17]!==r||e[18]!==m.slug||e[19]!==d||e[20]!==s?(x=t.jsx(nr,{connection_id:n,connectionTitle:c.title,connectionDescription:c.description,connectionIcon:c.icon,connectionType:c.connection_type,connectionStatus:c.status,slug:d,orgSlug:m.slug,appName:c.app_name,usedConnectionIds:s,onOpenSettings:i,onRemove:a,onAuthenticate:o,onSwitchInstance:r,onNewInstance:h}),e[6]=c.app_name,e[7]=c.connection_type,e[8]=c.description,e[9]=c.icon,e[10]=c.status,e[11]=c.title,e[12]=n,e[13]=o,e[14]=h,e[15]=i,e[16]=a,e[17]=r,e[18]=m.slug,e[19]=d,e[20]=s,e[21]=x):x=e[21];let u;return e[22]!==p||e[23]!==x?(u=t.jsx(H.Suspense,{fallback:p,children:x}),e[22]=p,e[23]=x,e[24]=u):u=e[24],u}function sr(l){const e=K.c(24),{appName:n,connectionId:s,usedConnectionIds:i,onSwitchInstance:a,onNewInstance:o}=l,r=Q();let h;e[0]!==n?(h={filters:[{column:"app_name",value:n}]},e[0]=n,e[1]=h):h=e[1];const c=Li(h);if(c.length<=1&&!o)return null;let m;e[2]!==s||e[3]!==o||e[4]!==a?(m=g=>{g===As?o?.():a(s,g)},e[2]=s,e[3]=o,e[4]=a,e[5]=m):m=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ae,{size:"sm",className:"w-auto text-xs gap-1 px-2 shadow-none",children:t.jsx(Ie,{})}),e[6]=f):f=e[6];let d;if(e[7]!==s||e[8]!==c||e[9]!==i){let g;e[11]!==s||e[12]!==i?(g=j=>t.jsx(je,{value:j.id,className:"text-xs",disabled:j.id!==s&&i.has(j.id),children:j.title},j.id),e[11]=s,e[12]=i,e[13]=g):g=e[13],d=c.map(g),e[7]=s,e[8]=c,e[9]=i,e[10]=d}else d=e[10];let p;e[14]!==o||e[15]!==r?(p=o&&t.jsxs(je,{value:As,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=o,e[15]=r,e[16]=p):p=e[16];let x;e[17]!==d||e[18]!==p?(x=t.jsxs(Oe,{children:[d,p]}),e[17]=d,e[18]=p,e[19]=x):x=e[19];let u;return e[20]!==s||e[21]!==m||e[22]!==x?(u=t.jsxs(Pe,{value:s,onValueChange:m,children:[f,x]}),e[20]=s,e[21]=m,e[22]=x,e[23]=u):u=e[23],u}function nr({connection_id:l,connectionTitle:e,connectionDescription:n,connectionIcon:s,connectionType:i,connectionStatus:a,slug:o,orgSlug:r,appName:h,usedConnectionIds:c,onOpenSettings:m,onRemove:f,onAuthenticate:d,onSwitchInstance:p,onNewInstance:x}){const u=xn({connectionId:l}),g=on(),y=!(i==="VIRTUAL")&&u.supportsOAuth&&!u.isAuthenticated,b=a!=="active",v=Q(),N=async M=>{try{await g.update.mutateAsync({id:l,data:{status:M}}),re.success(v(M==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{re.error(v("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:pe("rounded-xl border overflow-hidden transition-colors",y||b?"border-destructive/50 bg-destructive/5":"border-border bg-card"),children:[t.jsxs(Zs,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:o},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors",children:[t.jsx(tt,{icon:s,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")}):b?t.jsx("span",{className:"text-xs text-destructive font-medium",children:v(a==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):n&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n})]}),y?t.jsx(Z,{variant:"outline",size:"sm",className:"h-7 text-xs shrink-0",onClick:M=>{M.preventDefault(),M.stopPropagation(),d(l)},children:v("virtualMcp.connectionItem.authorize")}):b?t.jsxs(Z,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:M=>{M.preventDefault(),M.stopPropagation(),N("active")},children:[t.jsx(pi,{size:13}),v("virtualMcp.connectionItem.enable")]}):t.jsxs(ye,{delayDuration:0,children:[t.jsx(we,{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(Ci,{size:16})})}),t.jsx(Se,{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:[h&&t.jsx(sr,{appName:h,connectionId:l,usedConnectionIds:c,onSwitchInstance:p,onNewInstance:x}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(ye,{delayDuration:0,children:[t.jsx(we,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:m,"aria-label":v("virtualMcp.connectionItem.configureResources"),children:t.jsx(xi,{size:13})})}),t.jsx(Se,{side:"bottom",children:v("virtualMcp.connectionItem.configureResources")})]}),!b&&t.jsxs(ye,{delayDuration:0,children:[t.jsx(we,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>N("inactive"),"aria-label":v("virtualMcp.connectionItem.disableConnection"),children:t.jsx(hi,{size:13})})}),t.jsx(Se,{side:"bottom",children:v("virtualMcp.connectionItem.disable")})]}),t.jsxs(ye,{delayDuration:0,children:[t.jsx(we,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:f,"aria-label":v("virtualMcp.connectionItem.removeConnection"),children:t.jsx(Qt,{size:13})})}),t.jsx(Se,{side:"bottom",children:v("virtualMcp.connectionItem.remove")})]})]})]})]})}function ir(l){const e=K.c(17),{connection_id:n}=l,s=qt(n);if(!s){let f;return e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(zt,{}),e[0]=f):f=e[0],f}let i;e[1]!==s.icon||e[2]!==s.title?(i=t.jsx(tt,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[1]=s.icon,e[2]=s.title,e[3]=i):i=e[3];let a;e[4]!==s.title?(a=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[4]=s.title,e[5]=a):a=e[5];let o;e[6]!==s.description?(o=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[6]=s.description,e[7]=o):o=e[7];let r;e[8]!==a||e[9]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,o]}),e[8]=a,e[9]=o,e[10]=r):r=e[10];let h;e[11]!==i||e[12]!==r?(h=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,r]}),e[11]=i,e[12]=r,e[13]=h):h=e[13];let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=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]=c):c=e[14];let m;return e[15]!==h?(m=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[h,c]}),e[15]=h,e[16]=m):m=e[16],m}function lr(l){const e=K.c(20),{onRemove:n}=l,s=Q();let i;e[0]!==s?(i=s("virtualMcp.connectionItem.connectionNotFound"),e[0]=s,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 o;e[4]!==s?(o=s("virtualMcp.connectionItem.removeConnection"),e[4]=s,e[5]=o):o=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{size:13}),e[6]=r):r=e[6];let h;e[7]!==n||e[8]!==o?(h=t.jsx(we,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive shrink-0",onClick:n,"aria-label":o,children:r})}),e[7]=n,e[8]=o,e[9]=h):h=e[9];let c;e[10]!==s?(c=s("virtualMcp.connectionItem.remove"),e[10]=s,e[11]=c):c=e[11];let m;e[12]!==c?(m=t.jsx(Se,{side:"bottom",children:c}),e[12]=c,e[13]=m):m=e[13];let f;e[14]!==h||e[15]!==m?(f=t.jsxs(ye,{delayDuration:0,children:[h,m]}),e[14]=h,e[15]=m,e[16]=f):f=e[16];let d;return e[17]!==a||e[18]!==f?(d=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[a,f]}),e[17]=a,e[18]=f,e[19]=d):d=e[19],d}function zt(){const l=K.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 n;l[1]===Symbol.for("react.memo_cache_sentinel")?(n=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]=n):n=l[1];let s;return l[2]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[n,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]=s):s=l[2],s}function ar(l){const e=K.c(5),{value:n}=l;let s;if(e[0]!==n){s=Symbol.for("react.early_return_sentinel");e:{const a=Bt(n);if(a.type==="icon"){const o=Yt(a.name);if(o){let r;e[2]!==o?(r=t.jsx(o,{size:16,className:"text-muted-foreground"}),e[2]=o,e[3]=r):r=e[3],s=r;break e}}}e[0]=n,e[1]=s}else s=e[1];if(s!==Symbol.for("react.early_return_sentinel"))return s;let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(cl,{size:16,className:"text-muted-foreground"}),e[4]=i):i=e[4],i}function Vn(l){const e=K.c(74),{value:n,onChange:s,className:i,disabled:a}=l,o=Q(),[r,h]=H.useState(!1),[c,m]=H.useState("");let f;e[0]!==n?(f=Bt(n),e[0]=n,e[1]=f):f=e[1];const d=f,p=d.type==="icon"?d.name:null;let x,u,g,j,y,b,v,N,M,C,w,k,S,_,V;if(e[2]!==i||e[3]!==p||e[4]!==a||e[5]!==s||e[6]!==r||e[7]!==c||e[8]!==o||e[9]!==n){const q=Ut();j=ln(q,c),g=Ht,y=a?!1:r,b=h;let R;e[25]!==o?(R=o("common.simpleIconPicker.changeIcon"),e[25]=o,e[26]=R):R=e[26];const G=a?"cursor-default opacity-50":"cursor-pointer hover:bg-accent";let U;e[27]!==i||e[28]!==G?(U=pe("size-7 shrink-0 classic:rounded-md compact:rounded-lg transition-colors flex items-center justify-center",G,i),e[27]=i,e[28]=G,e[29]=U):U=e[29];let T;e[30]!==n?(T=t.jsx(ar,{value:n}),e[30]=n,e[31]=T):T=e[31],e[32]!==a||e[33]!==R||e[34]!==U||e[35]!==T?(v=t.jsx(Gt,{asChild:!0,children:t.jsx("button",{type:"button",disabled:a,"aria-label":R,className:U,children:T})}),e[32]=a,e[33]=R,e[34]=U,e[35]=T,e[36]=v):v=e[36],u=Wt,S="start",_="w-64 p-0",V=rr,w="flex flex-col";let P;e[37]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(gt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[37]=P):P=e[37];let W;e[38]===Symbol.for("react.memo_cache_sentinel")?(W=Y=>m(Y.target.value),e[38]=W):W=e[38];let B;e[39]!==o?(B=o("common.simpleIconPicker.filterPlaceholder"),e[39]=o,e[40]=B):B=e[40],e[41]!==c||e[42]!==B?(k=t.jsx("div",{className:"px-2 py-2",children:t.jsxs("div",{className:"relative",children:[P,t.jsx(Me,{value:c,onChange:W,placeholder:B,className:"h-7 text-xs pl-7"})]})}),e[41]=c,e[42]=B,e[43]=k):k=e[43],x=rn,C="h-48",N="grid grid-cols-8 gap-0.5 px-2 pb-2";let z;e[44]!==p||e[45]!==s?(z=Y=>{const X=Yt(Y);return X?t.jsx("button",{type:"button",onClick:()=>{s(`icon://${Y}`),h(!1)},className:pe("h-7 w-7 flex items-center justify-center classic:rounded-md compact:rounded-lg transition-colors cursor-pointer",p===Y?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground"),title:$t(Y),"aria-label":$t(Y),children:t.jsx(X,{size:16})},Y):null},e[44]=p,e[45]=s,e[46]=z):z=e[46],M=j.map(z),e[2]=i,e[3]=p,e[4]=a,e[5]=s,e[6]=r,e[7]=c,e[8]=o,e[9]=n,e[10]=x,e[11]=u,e[12]=g,e[13]=j,e[14]=y,e[15]=b,e[16]=v,e[17]=N,e[18]=M,e[19]=C,e[20]=w,e[21]=k,e[22]=S,e[23]=_,e[24]=V}else x=e[10],u=e[11],g=e[12],j=e[13],y=e[14],b=e[15],v=e[16],N=e[17],M=e[18],C=e[19],w=e[20],k=e[21],S=e[22],_=e[23],V=e[24];let O;e[47]!==N||e[48]!==M?(O=t.jsx("div",{className:N,children:M}),e[47]=N,e[48]=M,e[49]=O):O=e[49];let A;e[50]!==j.length||e[51]!==o?(A=j.length===0&&t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:o("common.simpleIconPicker.noIconsFound")}),e[50]=j.length,e[51]=o,e[52]=A):A=e[52];let E;e[53]!==x||e[54]!==O||e[55]!==A||e[56]!==C?(E=t.jsxs(x,{className:C,children:[O,A]}),e[53]=x,e[54]=O,e[55]=A,e[56]=C,e[57]=E):E=e[57];let I;e[58]!==E||e[59]!==w||e[60]!==k?(I=t.jsxs("div",{className:w,children:[k,E]}),e[58]=E,e[59]=w,e[60]=k,e[61]=I):I=e[61];let $;e[62]!==u||e[63]!==I||e[64]!==S||e[65]!==_||e[66]!==V?($=t.jsx(u,{align:S,className:_,onOpenAutoFocus:V,children:I}),e[62]=u,e[63]=I,e[64]=S,e[65]=_,e[66]=V,e[67]=$):$=e[67];let F;return e[68]!==g||e[69]!==y||e[70]!==b||e[71]!==v||e[72]!==$?(F=t.jsxs(g,{open:y,onOpenChange:b,children:[v,$]}),e[68]=g,e[69]=y,e[70]=b,e[71]=v,e[72]=$,e[73]=F):F=e[73],F}function rr(l){return l.preventDefault()}function Tn(l){const e=K.c(10),{viewId:n}=l;if(n==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(an,{size:16}),e[0]=i):i=e[0],i}if(n==="reports"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(os,{size:16}),e[1]=i):i=e[1],i}if(n==="board"){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(gi,{size:16}),e[2]=i):i=e[2],i}if(n==="site-editor"){let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ml,{size:16}),e[3]=i):i=e[3],i}if(n==="assets"){let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ul,{size:16}),e[4]=i):i=e[4],i}if(n==="hosting"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(En,{size:16}),e[5]=i):i=e[5],i}if(n==="e2e"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(vi,{size:16}),e[6]=i):i=e[6],i}if(n==="analytics"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(os,{size:16}),e[7]=i):i=e[7],i}if(n==="cdn"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ji,{size:16}),e[8]=i):i=e[8],i}let s;return e[9]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Kt,{size:16}),e[9]=s):s=e[9],s}function yt(l){const e=K.c(51),{pinned:n,canSetMainView:s,onOpen:i,onTogglePin:a,onSetMainView:o}=l,r=Q(),h=n?"text-foreground":"text-muted-foreground/40";let c;e[0]!==h?(c=pe("size-7",h),e[0]=h,e[1]=c):c=e[1];let m;e[2]!==n||e[3]!==r?(m=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=n,e[3]=r,e[4]=m):m=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(cs,{size:16}),e[5]=f):f=e[5];let d;e[6]!==a||e[7]!==n||e[8]!==c||e[9]!==m?(d=t.jsx(we,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:c,"aria-label":m,"aria-pressed":n,onClick:a,children:f})}),e[6]=a,e[7]=n,e[8]=c,e[9]=m,e[10]=d):d=e[10];let p;e[11]!==n||e[12]!==r?(p=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=n,e[12]=r,e[13]=p):p=e[13];let x;e[14]!==p?(x=t.jsx(Se,{side:"top",children:p}),e[14]=p,e[15]=x):x=e[15];let u;e[16]!==d||e[17]!==x?(u=t.jsxs(ye,{delayDuration:0,children:[d,x]}),e[16]=d,e[17]=x,e[18]=u):u=e[18];let g;e[19]!==r?(g=r("virtualMcp.settings.views.rowActions"),e[19]=r,e[20]=g):g=e[20];let j;e[21]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(dl,{size:16}),e[21]=j):j=e[21];let y;e[22]!==g?(y=t.jsx(Qs,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground","aria-label":g,children:j})}),e[22]=g,e[23]=y):y=e[23];let b;e[24]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Fn,{size:14}),e[24]=b):b=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(Ze,{onClick:i,children:[b,v]}),e[27]=i,e[28]=v,e[29]=N):N=e[29];let M;e[30]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(cs,{size:14}),e[30]=M):M=e[30];let C;e[31]!==n||e[32]!==r?(C=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=n,e[32]=r,e[33]=C):C=e[33];let w;e[34]!==a||e[35]!==C?(w=t.jsxs(Ze,{onClick:a,children:[M,C]}),e[34]=a,e[35]=C,e[36]=w):w=e[36];let k;e[37]!==s||e[38]!==o||e[39]!==r?(k=s&&t.jsxs(Ze,{onClick:o,children:[t.jsx(an,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=s,e[38]=o,e[39]=r,e[40]=k):k=e[40];let S;e[41]!==N||e[42]!==w||e[43]!==k?(S=t.jsxs(Xs,{align:"end",children:[N,w,k]}),e[41]=N,e[42]=w,e[43]=k,e[44]=S):S=e[44];let _;e[45]!==y||e[46]!==S?(_=t.jsxs(qs,{children:[y,S]}),e[45]=y,e[46]=S,e[47]=_):_=e[47];let V;return e[48]!==_||e[49]!==u?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[u,_]}),e[48]=_,e[49]=u,e[50]=V):V=e[50],V}const wt=l=>l.stopPropagation();function Dn(l){const e=K.c(8),{icon:n,title:s}=l;let i;e[0]!==n||e[1]!==s?(i=t.jsx(tt,{icon:n,name:s,size:"xs",className:"shrink-0"}),e[0]=n,e[1]=s,e[2]=i):i=e[2];let a;e[3]!==s?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:s}),e[3]=s,e[4]=a):a=e[4];let o;return e[5]!==i||e[6]!==a?(o=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]=o):o=e[7],o}function or(l){const e=K.c(70),{views:n}=l,s=Q();let i;e[0]!==s?(i=s("virtualMcp.settings.views.defaults"),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==s?(a=s("virtualMcp.layoutTabContent.mainView"),e[2]=s,e[3]=a):a=e[3];let o;e[4]!==s?(o=s("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=s,e[5]=o):o=e[5];const r=n.defaultMainView,h=n.setMainView;let c;e[6]!==s?(c=s("virtualMcp.layoutTabContent.mainView"),e[6]=s,e[7]=c):c=e[7];let m;e[8]!==s?(m=s("virtualMcp.layoutTabContent.noMainView"),e[8]=s,e[9]=m):m=e[9];let f;e[10]!==m?(f=t.jsx(Ie,{placeholder:m}),e[10]=m,e[11]=f):f=e[11];let d;e[12]!==c||e[13]!==f?(d=t.jsx(Ae,{"aria-label":c,className:"w-36 h-8 text-sm shrink-0 @min-xl/project-settings:w-44",children:f}),e[12]=c,e[13]=f,e[14]=d):d=e[14];let p;e[15]!==n.defaultMainOptions?(p=n.defaultMainOptions.map(cr),e[15]=n.defaultMainOptions,e[16]=p):p=e[16];let x;e[17]!==p?(x=t.jsx(Oe,{children:p}),e[17]=p,e[18]=x):x=e[18];let u;e[19]!==x||e[20]!==d||e[21]!==n.defaultMainView||e[22]!==n.setMainView?(u=t.jsxs(Pe,{value:r,onValueChange:h,children:[d,x]}),e[19]=x,e[20]=d,e[21]=n.defaultMainView,e[22]=n.setMainView,e[23]=u):u=e[23];let g;e[24]!==u||e[25]!==a||e[26]!==o?(g=t.jsx(Re,{title:a,description:o,action:u}),e[24]=u,e[25]=a,e[26]=o,e[27]=g):g=e[27];let j;e[28]!==s?(j=s("virtualMcp.layoutTabContent.showChat"),e[28]=s,e[29]=j):j=e[29];let y;e[30]!==s?(y=s("virtualMcp.layoutTabContent.showChatDescription"),e[30]=s,e[31]=y):y=e[31];let b;e[32]!==s?(b=s("virtualMcp.layoutTabContent.showChat"),e[32]=s,e[33]=b):b=e[33];const v=n.noMainView?!0:n.chatDefaultOpen;let N;e[34]!==b||e[35]!==v||e[36]!==n.noMainView||e[37]!==n.setChatDefaultOpen?(N=t.jsx(we,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(ut,{"aria-label":b,checked:v,disabled:n.noMainView,onCheckedChange:n.setChatDefaultOpen})})}),e[34]=b,e[35]=v,e[36]=n.noMainView,e[37]=n.setChatDefaultOpen,e[38]=N):N=e[38];let M;e[39]!==s||e[40]!==n.noMainView?(M=n.noMainView&&t.jsx(Se,{side:"top",children:s("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[39]=s,e[40]=n.noMainView,e[41]=M):M=e[41];let C;e[42]!==N||e[43]!==M?(C=t.jsxs(ye,{delayDuration:0,children:[N,M]}),e[42]=N,e[43]=M,e[44]=C):C=e[44];let w;e[45]!==j||e[46]!==y||e[47]!==C?(w=t.jsx(Re,{title:j,description:y,action:C}),e[45]=j,e[46]=y,e[47]=C,e[48]=w):w=e[48];let k;e[49]!==g||e[50]!==w?(k=t.jsxs(Ve,{children:[g,w]}),e[49]=g,e[50]=w,e[51]=k):k=e[51];let S;e[52]!==i||e[53]!==k?(S=t.jsx(De,{title:i,children:k}),e[52]=i,e[53]=k,e[54]=S):S=e[54];let _;e[55]!==s?(_=s("virtualMcp.settings.views.sidebar"),e[55]=s,e[56]=_):_=e[56];let V;e[57]!==n?(V=n.projectViews.map($=>{const F=n.pinned($);return t.jsx(Re,{icon:t.jsx(Tn,{viewId:$}),title:n.labels[$],onClick:()=>n.openView($),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(yt,{pinned:F,canSetMainView:F&&!n.isMainView($),onOpen:()=>n.openView($),onTogglePin:()=>n.togglePin($,!F),onSetMainView:()=>n.setMainView($)}),t.jsx("span",{onClick:()=>n.openView($),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(at,{size:16})})]})},$)}),e[57]=n,e[58]=V):V=e[58];let O;e[59]!==n?(O=n.connectionsData.flatMap($=>[t.jsx(Dn,{icon:$.icon,title:$.title},`${$.id}:header`),...$.uiTools.map(F=>{const q=n.pinnedAppViews.find(T=>T.connectionId===$.id&&T.toolName===F.name),R=!!q,G=en($.id,F.name),U=`ext-apps:${$.id}:${F.name}`;return t.jsx(Re,{onClick:()=>n.openView(G),icon:R?t.jsx("span",{onClick:wt,children:t.jsx(Vn,{value:q.icon??null,onChange:T=>n.setAppViewIcon($.id,F.name,T)})}):t.jsx(Kt,{size:16}),title:R?t.jsx("span",{onClick:wt,children:t.jsx(Me,{value:q.label,onChange:T=>n.setAppViewLabel($.id,F.name,T.target.value),onBlur:n.commitAppViewLabel,"aria-label":F.title??vt(F.name),className:"h-7 w-full max-w-52 text-sm"})}):F.title??vt(F.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(yt,{pinned:R,canSetMainView:R&&!n.isMainView(U),onOpen:()=>n.openView(G),onTogglePin:()=>n.toggleAppViewPin($.id,F.name),onSetMainView:()=>n.setMainView(U)}),t.jsx("span",{onClick:()=>n.openView(G),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(at,{size:16})})]})},`${$.id}:${F.name}`)})]),e[59]=n,e[60]=O):O=e[60];let A;e[61]!==V||e[62]!==O?(A=t.jsxs(Ve,{children:[V,O]}),e[61]=V,e[62]=O,e[63]=A):A=e[63];let E;e[64]!==_||e[65]!==A?(E=t.jsx(De,{title:_,children:A}),e[64]=_,e[65]=A,e[66]=E):E=e[66];let I;return e[67]!==S||e[68]!==E?(I=t.jsxs(t.Fragment,{children:[S,E]}),e[67]=S,e[68]=E,e[69]=I):I=e[69],I}function cr(l){return t.jsx(je,{value:l.value,children:l.label},l.value)}function dr(l){const e=K.c(53),{views:n}=l,s=Q();let i;e[0]!==s?(i=s("virtualMcp.settings.views.projectViews"),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n?(a=n.projectViews.map(S=>{const _=n.pinned(S);return t.jsx(Re,{icon:t.jsx(Tn,{viewId:S}),title:n.labels[S],onClick:()=>n.openView(S),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(yt,{pinned:_,canSetMainView:_&&!n.isMainView(S),onOpen:()=>n.openView(S),onTogglePin:()=>n.togglePin(S,!_),onSetMainView:()=>n.setMainView(S)}),t.jsx("span",{onClick:()=>n.openView(S),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(at,{size:16})})]})},S)}),e[2]=n,e[3]=a):a=e[3];let o;e[4]!==n?(o=n.connectionsData.flatMap(S=>[t.jsx(Dn,{icon:S.icon,title:S.title},`${S.id}:header`),...S.uiTools.map(_=>{const V=n.pinnedAppViews.find(I=>I.connectionId===S.id&&I.toolName===_.name),O=!!V,A=en(S.id,_.name),E=`ext-apps:${S.id}:${_.name}`;return t.jsx(Re,{onClick:()=>n.openView(A),icon:O?t.jsx("span",{onClick:wt,children:t.jsx(Vn,{value:V.icon??null,onChange:I=>n.setAppViewIcon(S.id,_.name,I)})}):t.jsx(Kt,{size:16}),title:O?t.jsx("span",{onClick:wt,children:t.jsx(Me,{value:V.label,onChange:I=>n.setAppViewLabel(S.id,_.name,I.target.value),onBlur:n.commitAppViewLabel,className:"h-7 w-52 text-sm"})}):_.title??vt(_.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(yt,{pinned:O,canSetMainView:O&&!n.isMainView(E),onOpen:()=>n.openView(A),onTogglePin:()=>n.toggleAppViewPin(S.id,_.name),onSetMainView:()=>n.setMainView(E)}),t.jsx("span",{onClick:()=>n.openView(A),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(at,{size:16})})]})},`${S.id}:${_.name}`)})]),e[4]=n,e[5]=o):o=e[5];let r;e[6]!==s?(r=s("virtualMcp.layoutTabContent.mainView"),e[6]=s,e[7]=r):r=e[7];let h;e[8]!==s?(h=s("virtualMcp.layoutTabContent.mainViewDescription"),e[8]=s,e[9]=h):h=e[9];const c=n.defaultMainView,m=n.setMainView;let f;e[10]!==s?(f=s("virtualMcp.layoutTabContent.noMainView"),e[10]=s,e[11]=f):f=e[11];let d;e[12]!==f?(d=t.jsx(Ae,{className:"w-44 h-8 text-sm shrink-0",children:t.jsx(Ie,{placeholder:f})}),e[12]=f,e[13]=d):d=e[13];let p;e[14]!==n.defaultMainOptions?(p=n.defaultMainOptions.map(ur),e[14]=n.defaultMainOptions,e[15]=p):p=e[15];let x;e[16]!==p?(x=t.jsx(Oe,{children:p}),e[16]=p,e[17]=x):x=e[17];let u;e[18]!==x||e[19]!==d||e[20]!==n.defaultMainView||e[21]!==n.setMainView?(u=t.jsxs(Pe,{value:c,onValueChange:m,children:[d,x]}),e[18]=x,e[19]=d,e[20]=n.defaultMainView,e[21]=n.setMainView,e[22]=u):u=e[22];let g;e[23]!==u||e[24]!==r||e[25]!==h?(g=t.jsx(Re,{title:r,description:h,action:u}),e[23]=u,e[24]=r,e[25]=h,e[26]=g):g=e[26];let j;e[27]!==s?(j=s("virtualMcp.layoutTabContent.showChat"),e[27]=s,e[28]=j):j=e[28];let y;e[29]!==s?(y=s("virtualMcp.layoutTabContent.showChatDescription"),e[29]=s,e[30]=y):y=e[30];const b=n.noMainView?!0:n.chatDefaultOpen;let v;e[31]!==b||e[32]!==n.noMainView||e[33]!==n.setChatDefaultOpen?(v=t.jsx(we,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(ut,{checked:b,disabled:n.noMainView,onCheckedChange:n.setChatDefaultOpen})})}),e[31]=b,e[32]=n.noMainView,e[33]=n.setChatDefaultOpen,e[34]=v):v=e[34];let N;e[35]!==s||e[36]!==n.noMainView?(N=n.noMainView&&t.jsx(Se,{side:"top",children:s("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[35]=s,e[36]=n.noMainView,e[37]=N):N=e[37];let M;e[38]!==v||e[39]!==N?(M=t.jsxs(ye,{delayDuration:0,children:[v,N]}),e[38]=v,e[39]=N,e[40]=M):M=e[40];let C;e[41]!==j||e[42]!==y||e[43]!==M?(C=t.jsx(Re,{title:j,description:y,action:M}),e[41]=j,e[42]=y,e[43]=M,e[44]=C):C=e[44];let w;e[45]!==g||e[46]!==a||e[47]!==C||e[48]!==o?(w=t.jsxs(Ve,{children:[a,o,g,C]}),e[45]=g,e[46]=a,e[47]=C,e[48]=o,e[49]=w):w=e[49];let k;return e[50]!==i||e[51]!==w?(k=t.jsx(De,{title:i,children:w}),e[50]=i,e[51]=w,e[52]=k):k=e[52],k}function ur(l){return t.jsx(je,{value:l.value,children:l.label},l.value)}function Os(l){const e=K.c(3),n=Rt();let s;return e[0]!==n||e[1]!==l?(s=n?t.jsx(or,{...l}):t.jsx(dr,{...l}),e[0]=n,e[1]=l,e[2]=s):s=e[2],s}const An="site-editor",mr=new Set([An,"content"]);function fr({virtualMcpId:l,form:e,flushAndSave:n}){const s=Q(),i=St(),{openPanel:a}=hl(),o=dn(l),r=gl(o),h=gn(l),c=Nl(l),m=(o?.connections??[]).map(T=>T.connection_id).sort(),{data:f}=zn({queryKey:tn.projectConnectionDetails(l,m),enabled:m.length>0,queryFn:async()=>await Promise.all(m.map(async P=>{try{const{item:W}=await i.call("COLLECTION_CONNECTIONS_GET",{id:P}),B=(W?.tools??[]).flatMap(z=>{const Y=fl(z._meta);return Y?[{name:z.name,title:z.title,description:z.description,resourceUri:Y}]:[]});return{fetchOk:!0,id:P,title:W?.title??P,icon:W?.icon??null,uiTools:B}}catch{return{fetchOk:!1,id:P,title:P,icon:null,uiTools:[]}}}))}),d=(f??[]).filter(T=>T.uiTools.length>0),p=new Set([...Rn,...Ln]),x=e.watch("metadata.ui.pinnedViews")??[],u=e.watch("metadata.ui.layout")??null,g=u?.defaultMainView??null,j=u?.chatDefaultOpen??!1,y=Et(Ft({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:u}}),e.watch("metadata.sidebarViewsVersion")),b=c??(o?Et(Ft(o.metadata),o.metadata.sidebarViewsVersion):y),v=(()=>{if(!g||g.type==="chat")return"";const T=Bn(g.type);return T==="instructions"||T==="connections"||T==="layout"?"settings":mr.has(T)?An:p.has(T)?T:`${T}:${g.id??""}:${g.toolName??""}`})(),N=v==="",M=T=>{const[P,W,B]=T.split(":");return P?p.has(P)?{type:P}:P==="ext-apps"&&W?{type:"ext-apps",id:W,toolName:B||void 0}:null:null},C=T=>{e.setValue("metadata.ui.pinnedViews",T,{shouldDirty:!0})},w=T=>{e.setValue("metadata.ui.layout",{...u,...T},{shouldDirty:!0})},k=H.useRef(!1);if(f&&f.length>0&&!k.current){k.current=!0;const T=new Set((f??[]).filter(z=>z.fetchOk).map(z=>z.id)),P=new Set(d.flatMap(z=>z.uiTools.map(Y=>`${z.id}:${Y.name}`))),W=new Set(m),B=x.filter(z=>W.has(z.connectionId)&&(!T.has(z.connectionId)||P.has(`${z.connectionId}:${z.toolName}`)));B.length!==x.length&&(C(B),g?.type==="ext-apps"&&!B.some(z=>z.connectionId===g.id&&z.toolName===g.toolName)&&w({defaultMainView:{type:"settings"}}))}const S=(T,P)=>{if(x.some(B=>B.connectionId===T&&B.toolName===P)){const B=x.filter(Y=>!(Y.connectionId===T&&Y.toolName===P));C(B);const z=`ext-apps:${T}:${P}`;v===z&&w({defaultMainView:{type:"settings"}})}else{const B=d.find(z=>z.id===T)?.uiTools.find(z=>z.name===P)?.title;C([...x,{connectionId:T,toolName:P,label:B??vt(P),icon:null}])}n()},_=(T,P,W)=>{C(x.map(B=>B.connectionId===T&&B.toolName===P?{...B,label:W}:B))},V=()=>{n()},O=(T,P,W)=>{C(x.map(B=>B.connectionId===T&&B.toolName===P?{...B,icon:W}:B)),n()},A=T=>{w({defaultMainView:M(T)}),n()},E=(T,P)=>{const W=yl(b,T,P,1);e.setValue("metadata.sidebarViews",W,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),h.stage(W,b);const B=wl(g,T,P);B!==g&&w({defaultMainView:B})},I=jt(o?.metadata),$=vl(I,r.presence),F=jl($),q=bl(b,$,1),R={overview:s("sidebar.navDestinations.home"),reports:s("sidebar.navDestinations.reports"),board:s("sidebar.navDestinations.tasks"),"site-editor":s("virtualMcp.layoutTabContent.siteEditor"),assets:s("common.mainPanelTabs.assets"),hosting:s("common.mainPanelTabs.hosting"),e2e:s("common.mainPanelTabs.e2e"),analytics:s("common.mainPanelTabs.analytics"),cdn:s("common.mainPanelTabs.cdn"),automations:s("virtualMcp.layoutTabContent.automations"),experiments:s("experiments.title")},G=[];for(const T of q)T!=="automations"&&G.push({value:T,label:R[T]});for(const T of x)G.push({value:`ext-apps:${T.connectionId}:${T.toolName}`,label:T.label||T.toolName});return q.includes("automations")&&G.push({value:"automations",label:R.automations}),G.push({value:"settings",label:s("virtualMcp.layoutTabContent.settings")}),{projectViews:F,labels:R,pinned:T=>b.includes(T),isMainView:T=>v===T,defaultMainView:v,defaultMainOptions:G,noMainView:N,chatDefaultOpen:j,connectionsData:d,pinnedAppViews:x,openView:T=>a(T,{virtualmcpid:l}),togglePin:(T,P)=>E(T,P),setMainView:A,setChatDefaultOpen:T=>{w({chatDefaultOpen:T}),n()},toggleAppViewPin:S,setAppViewIcon:O,setAppViewLabel:_,commitAppViewLabel:V}}function pr(l){const e=K.c(55),{form:n,onCommit:s}=l,i=Q(),a=H.useId();let o;e[0]!==i?(o=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("p",{className:"text-sm font-medium",children:o}),e[2]=o,e[3]=r):r=e[3];let h;e[4]!==i?(h=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=h):h=e[5];let c;e[6]!==h?(c=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:h}),e[6]=h,e[7]=c):c=e[7];let m;e[8]!==r||e[9]!==c?(m=t.jsxs("div",{children:[r,c]}),e[8]=r,e[9]=c,e[10]=m):m=e[10];let f;e[11]!==n||e[12]!==s||e[13]!==i?(f=_=>{const{field:V}=_;return t.jsx("div",{className:"justify-self-start",children:t.jsx(Cn,{value:V.value??null,onChange:O=>{V.onChange(O),s()},onColorChange:O=>{n.setValue("metadata.ui.themeColor",O,{shouldDirty:!0}),s()},name:n.watch("title")||i("virtualMcp.virtualMcp.agentNameFallback"),size:"md",avatarClassName:"[&_svg]:w-1/2 [&_svg]:h-1/2"})})},e[11]=n,e[12]=s,e[13]=i,e[14]=f):f=e[14];let d;e[15]!==n.control||e[16]!==f?(d=t.jsx(me,{name:"icon",control:n.control,render:f}),e[15]=n.control,e[16]=f,e[17]=d):d=e[17];let p;e[18]!==m||e[19]!==d?(p=t.jsxs(ue,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[m,d]}),e[18]=m,e[19]=d,e[20]=p):p=e[20];const x=`${a}-name`;let u;e[21]!==i?(u=i("virtualMcp.settings.identity.name"),e[21]=i,e[22]=u):u=e[22];let g;e[23]!==u||e[24]!==x?(g=t.jsx("label",{htmlFor:x,className:"text-sm font-medium",children:u}),e[23]=u,e[24]=x,e[25]=g):g=e[25];let j;e[26]!==a||e[27]!==s||e[28]!==i?(j=_=>{const{field:V}=_;return t.jsx(Me,{...V,id:`${a}-name`,value:V.value??"",onBlur:()=>{V.onBlur(),s()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=a,e[27]=s,e[28]=i,e[29]=j):j=e[29];let y;e[30]!==n.control||e[31]!==j?(y=t.jsx(me,{name:"title",control:n.control,render:j}),e[30]=n.control,e[31]=j,e[32]=y):y=e[32];let b;e[33]!==g||e[34]!==y?(b=t.jsxs(ue,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[g,y]}),e[33]=g,e[34]=y,e[35]=b):b=e[35];const v=`${a}-description`;let N;e[36]!==i?(N=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=N):N=e[37];let M;e[38]!==v||e[39]!==N?(M=t.jsx("label",{htmlFor:v,className:"text-sm font-medium",children:N}),e[38]=v,e[39]=N,e[40]=M):M=e[40];let C;e[41]!==a||e[42]!==s||e[43]!==i?(C=_=>{const{field:V}=_;return t.jsx(lt,{...V,id:`${a}-description`,value:V.value??"",onBlur:()=>{V.onBlur(),s()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=a,e[42]=s,e[43]=i,e[44]=C):C=e[44];let w;e[45]!==n.control||e[46]!==C?(w=t.jsx(me,{name:"description",control:n.control,render:C}),e[45]=n.control,e[46]=C,e[47]=w):w=e[47];let k;e[48]!==M||e[49]!==w?(k=t.jsxs(ue,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[M,w]}),e[48]=M,e[49]=w,e[50]=k):k=e[50];let S;return e[51]!==b||e[52]!==k||e[53]!==p?(S=t.jsxs(Ve,{children:[p,b,k]}),e[51]=b,e[52]=k,e[53]=p,e[54]=S):S=e[54],S}function xr(l){const e=K.c(8),{section:n}=l,s=Q();let i;e[0]!==s?(i=s("virtualMcp.settings.navigation"),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n||e[3]!==s?(a=Mn.map(r=>{const{titleKey:h}=He[r];return t.jsx(ze.Tab,{active:n===r,asChild:!0,children:t.jsx(Zs,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:c=>({...c,section:r==="general"?void 0:r}),children:s(h)})},r)}),e[2]=n,e[3]=s,e[4]=a):a=e[4];let o;if(e[5]!==i||e[6]!==a){const r=t.jsx(ze.Tabs,{"aria-label":i,children:a});o=t.jsx(Un.Toolbar.Left.Portal,{fallback:r,children:r}),e[5]=i,e[6]=a,e[7]=o}else o=e[7];return o}function hr(){const l=K.c(9),e=Rt(),n=Lt();let s;l[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},l[0]=s):s=l[0];const{section:i}=Yn(s);let a;l[1]!==e||l[2]!==i?(a=Va(i)?i:e?"general":null,l[1]=e,l[2]=i,l[3]=a):a=l[3];let o;l[4]!==n?(o=h=>n({to:".",search:c=>({...c,section:h??void 0})}),l[4]=n,l[5]=o):o=l[5];let r;return l[6]!==a||l[7]!==o?(r={section:a,openSection:o},l[6]=a,l[7]=o,l[8]=r):r=l[8],r}const Ot={tools:null,resources:null,prompts:null},gr=Vl.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function vr(l){const n=new TextEncoder().encode(l),s=Array.from(n,i=>String.fromCharCode(i)).join("");return btoa(s)}function In(l){return{"x-studio-client":l,"x-mesh-client":l}}function jr(l){const e=K.c(15),{url:n,agentId:s}=l,i=Q(),[a,o]=H.useState(!1);let r;e[0]!==s||e[1]!==i||e[2]!==n?(r=async()=>{ve("agent_connect_action",{agent_id:s,action:"copy_url"}),await navigator.clipboard.writeText(n),o(!0),re.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await ft(2e3),o(!1)},e[0]=s,e[1]=i,e[2]=n,e[3]=r):r=e[3];const h=r;let c;e[4]!==a?(c=a?t.jsx(mt,{size:20,className:"text-success"}):t.jsx(Vt,{size:20}),e[4]=a,e[5]=c):c=e[5];let m;e[6]!==a||e[7]!==i?(m=i(a?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=a,e[7]=i,e[8]=m):m=e[8];let f;e[9]!==m?(f=t.jsx("span",{className:"text-xs font-medium",children:m}),e[9]=m,e[10]=f):f=e[10];let d;return e[11]!==h||e[12]!==c||e[13]!==f?(d=t.jsxs(Z,{type:"button",variant:"outline",onClick:h,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,f]}),e[11]=h,e[12]=c,e[13]=f,e[14]=d):d=e[14],d}function br(l){const e=K.c(13),{url:n,serverName:s,agentId:i}=l,a=Q();let o;e[0]!==i||e[1]!==s||e[2]!==a||e[3]!==n?(o=()=>{ve("agent_connect_action",{agent_id:i,action:"install_cursor"});const d=jn(s),p={type:"http",url:n,headers:In("Cursor")},x=vr(JSON.stringify(p,null,2)),u=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(d)}&config=${encodeURIComponent(x)}`;window.open(u,"_blank"),re.success(a("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=s,e[2]=a,e[3]=n,e[4]=o):o=e[4];const r=o;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=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]=h):h=e[5];let c;e[6]!==a?(c=a("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=a,e[7]=c):c=e[7];let m;e[8]!==c?(m=t.jsx("span",{className:"text-xs font-medium",children:c}),e[8]=c,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m?(f=t.jsxs(Z,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[h,m]}),e[10]=r,e[11]=m,e[12]=f):f=e[12],f}function yr(l){const e=K.c(16),{url:n,serverName:s,agentId:i}=l,a=Q(),[o,r]=H.useState(!1);let h;e[0]!==i||e[1]!==s||e[2]!==a||e[3]!==n?(h=async()=>{ve("agent_connect_action",{agent_id:i,action:"install_claude_code"});const x=jn(s),u={type:"http",url:n,headers:In("Claude Code")},g=JSON.stringify(u,null,2),j=`claude mcp add-json "${x}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(j),r(!0),re.success(a("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await ft(2e3),r(!1)},e[0]=i,e[1]=s,e[2]=a,e[3]=n,e[4]=h):h=e[4];const c=h;let m;e[5]!==o?(m=o?t.jsx(mt,{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]=o,e[6]=m):m=e[6];let f;e[7]!==o||e[8]!==a?(f=a(o?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=o,e[8]=a,e[9]=f):f=e[9];let d;e[10]!==f?(d=t.jsx("span",{className:"text-xs font-medium",children:f}),e[10]=f,e[11]=d):d=e[11];let p;return e[12]!==c||e[13]!==m||e[14]!==d?(p=t.jsxs(Z,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,d]}),e[12]=c,e[13]=m,e[14]=d,e[15]=p):p=e[15],p}function wr({virtualMcp:l}){const e=Q(),n=St(),[s,i]=H.useState(null),[a,o]=H.useState(!1),[r,h]=H.useState(!1),c=l.id,m=l.title||`agent-${c.slice(0,8)}`,f=s?`bunx @decocms/typegen@latest --mcp ${c} --key ${s} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${c} --key <api-key> --output client.ts`,d=async()=>{o(!0);try{const{key:x}=await n.call("API_KEY_CREATE",{name:`typegen-${m}`,permissions:{[c]:["*"]}});if(!x)throw new Error("No key in response");i(x),ve("agent_typegen_key_generated",{agent_id:c})}catch{ve("agent_typegen_key_failed",{agent_id:c}),re.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{o(!1)}},p=async()=>{ve("agent_connect_action",{agent_id:c,action:"typegen_copy_command",has_api_key:!!s}),await navigator.clipboard.writeText(f),h(!0),re.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await ft(2e3),h(!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")})]}),!s&&t.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:d,disabled:a,children:[a?t.jsx(ot,{className:"size-3.5"}):t.jsx(Xt,{size:14}),t.jsx("span",{children:e(a?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),s&&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:f}),t.jsx(Z,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:p,children:r?t.jsx(mt,{size:12,className:"text-success"}):t.jsx(Vt,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(Sr,{apiKey:s,agentId:c})]})}function Sr(l){const e=K.c(21),{apiKey:n,agentId:s}=l,[i,a]=H.useState(!1),o=window.location.origin,r=n?`STUDIO_API_KEY=${n}`:"STUDIO_API_KEY=<api-key>",h=`STUDIO_BASE_URL=${o}`,c=`${r}
|
|
2
2
|
${h}`;let m;e[0]!==s||e[1]!==n||e[2]!==c?(m=async()=>{ve("agent_connect_action",{agent_id:s,action:"typegen_copy_env",has_api_key:!!n}),await navigator.clipboard.writeText(c),a(!0),await ft(2e3),a(!1)},e[0]=s,e[1]=n,e[2]=c,e[3]=m):m=e[3];const f=m,d=!n;let p;e[4]!==d?(p=pe({"opacity-50":d}),e[4]=d,e[5]=p):p=e[5];let x;e[6]!==r||e[7]!==p?(x=t.jsx("span",{className:p,children:r}),e[6]=r,e[7]=p,e[8]=x):x=e[8];let u,g;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("br",{}),g=t.jsx("span",{children:h}),e[9]=u,e[10]=g):(u=e[9],g=e[10]);let j;e[11]!==x?(j=t.jsxs("code",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:[x,u,g]}),e[11]=x,e[12]=j):j=e[12];let y;e[13]!==i?(y=i?t.jsx(mt,{size:12,className:"text-success"}):t.jsx(Vt,{size:12}),e[13]=i,e[14]=y):y=e[14];let b;e[15]!==f||e[16]!==y?(b=t.jsx(Z,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:f,children:y}),e[15]=f,e[16]=y,e[17]=b):b=e[17];let v;return e[18]!==j||e[19]!==b?(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:[j,b]})}),e[18]=j,e[19]=b,e[20]=v):v=e[20],v}function Nr(l){const e=K.c(3),{virtualMcp:n}=l;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=s):s=e[0];let i;return e[1]!==n?(i=t.jsx(H.Suspense,{fallback:s,children:t.jsx(wr,{virtualMcp:n})}),e[1]=n,e[2]=i):i=e[2],i}const Cr={self:["COLLECTION_THREADS_CREATE","COLLECTION_THREADS_GET","COLLECTION_THREAD_MESSAGES_LIST","COLLECTION_THREADS_LIST"]},Mr=3600*24*90;function kr({virtualMcp:l}){const e=Q(),n=St(),{org:s}=Be(),[i,a]=H.useState(null),[o,r]=H.useState(!1),[h,c]=H.useState(!1),m=l.id,f=l.title||`agent-${m.slice(0,8)}`,p=[`STUDIO_BASE_URL=${window.location.origin}`,`STUDIO_ORG=${s.slug}`,`STUDIO_AGENT_ID=${m}`,`STUDIO_API_KEY=${i??"<api-key>"}`].join(`
|
|
3
3
|
`),x=async()=>{r(!0);try{const{key:g}=await n.call("API_KEY_CREATE",{name:`chat-bridge-${f}`,permissions:Cr,expiresIn:Mr});if(!g)throw new Error("No key in response");a(g),ve("agent_chat_bridge_key_generated",{agent_id:m})}catch{ve("agent_chat_bridge_key_failed",{agent_id:m}),re.error(e("virtualMcp.virtualMcpShareModal.failedCreateApiKey"))}finally{r(!1)}},u=async()=>{ve("agent_connect_action",{agent_id:m,action:"chat_bridge_copy_env",has_api_key:!!i}),await navigator.clipboard.writeText(p),c(!0),re.success(e("virtualMcp.virtualMcpShareModal.connectionDetailsCopied")),await ft(2e3),c(!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(Z,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:x,disabled:o,children:[o?t.jsx(ot,{className:"size-3.5"}):t.jsx(Xt,{size:14}),t.jsx("span",{children:e(o?"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(Z,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:u,children:h?t.jsx(mt,{size:12,className:"text-success"}):t.jsx(Vt,{size:12})})]})})]})}function _r(l){const e=K.c(3),{virtualMcp:n}=l;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=s):s=e[0];let i;return e[1]!==n?(i=t.jsx(H.Suspense,{fallback:s,children:t.jsx(kr,{virtualMcp:n})}),e[1]=n,e[2]=i):i=e[2],i}function Vr(l){const e=K.c(49),{open:n,onOpenChange:s,virtualMcp:i}=l,a=Q(),{org:o}=Be(),r=`/api/${o.slug}/mcp/virtual-mcp/${i.id}`;let h;e[0]!==r?(h=new URL(r,window.location.origin),e[0]=r,e[1]=h):h=e[1];const c=h;let m;e[2]!==i.id||e[3]!==i.title?(m=i.title||`agent-${i.id?.slice(0,8)??"default"}`,e[2]=i.id,e[3]=i.title,e[4]=m):m=e[4];const f=m,d=Pl();let p;e[5]!==i.id||e[6]!==c.href?(p=t.jsx(jr,{url:c.href,agentId:i.id}),e[5]=i.id,e[6]=c.href,e[7]=p):p=e[7];let x,u;e[8]!==f||e[9]!==i.id||e[10]!==c.href?(x=t.jsx(br,{url:c.href,serverName:f,agentId:i.id}),u=t.jsx(yr,{url:c.href,serverName:f,agentId:i.id}),e[8]=f,e[9]=i.id,e[10]=c.href,e[11]=x,e[12]=u):(x=e[11],u=e[12]);let g;e[13]!==p||e[14]!==x||e[15]!==u?(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,x,u]})}),e[13]=p,e[14]=x,e[15]=u,e[16]=g):g=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"border-t border-border"}),e[17]=j):j=e[17];let y;e[18]!==i?(y=t.jsx(Nr,{virtualMcp:i}),e[18]=i,e[19]=y):y=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"border-t border-border"}),e[20]=b):b=e[20];let v;e[21]!==i?(v=t.jsx(_r,{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,j,y,b,v]}),e[23]=v,e[24]=g,e[25]=y,e[26]=N):N=e[26];const M=N;if(d){let _;e[27]!==a?(_=a("virtualMcp.virtualMcpShareModal.connect"),e[27]=a,e[28]=_):_=e[28];let V;e[29]!==_?(V=t.jsx(Al,{className:"mt-4 mb-4 text-base font-semibold",children:_}),e[29]=_,e[30]=V):V=e[30];let O;e[31]!==M||e[32]!==V?(O=t.jsx(Il,{children:t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-6 [touch-action:pan-y]",children:[V,M]})}),e[31]=M,e[32]=V,e[33]=O):O=e[33];let A;return e[34]!==s||e[35]!==n||e[36]!==O?(A=t.jsx(Ol,{open:n,onOpenChange:s,children:O}),e[34]=s,e[35]=n,e[36]=O,e[37]=A):A=e[37],A}let C;e[38]!==a?(C=a("virtualMcp.virtualMcpShareModal.connect"),e[38]=a,e[39]=C):C=e[39];let w;e[40]!==C?(w=t.jsx(Ct,{children:t.jsx(Mt,{children:C})}),e[40]=C,e[41]=w):w=e[41];let k;e[42]!==M||e[43]!==w?(k=t.jsxs(dt,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[w,M]}),e[42]=M,e[43]=w,e[44]=k):k=e[44];let S;return e[45]!==s||e[46]!==n||e[47]!==k?(S=t.jsx(ct,{open:n,onOpenChange:s,children:k}),e[45]=s,e[46]=n,e[47]=k,e[48]=S):S=e[48],S}function Ps(l){const e=K.c(50),{virtualMcp:n}=l,s=Q(),i=cn(),a=un(),[o,r]=H.useState(!1);let h,c,m,f,d,p,x,u,g;if(e[0]!==a||e[1]!==i||e[2]!==s||e[3]!==n.id||e[4]!==n.metadata){g=Symbol.for("react.early_return_sentinel");e:{const C=pl(i);if(Kn(n.id)||jt(n.metadata)||C.has(n.id)){g=null;break e}let w;e[14]!==i||e[15]!==n.id?(w=(i??[]).find(F=>F.metadata?.liveAgentId===n.id)??null,e[14]=i,e[15]=n.id,e[16]=w):w=e[16];const k=w,S=k?.id??null;let _;e[17]!==a.update?(_=(F,q)=>a.update.mutateAsync({id:F,data:{metadata:{liveAgentId:q}}}).catch(Dr),e[17]=a.update,e[18]=_):_=e[18];const V=_;let O;e[19]!==V||e[20]!==n.id?(O=F=>{V(F,n.id)},e[19]=V,e[20]=n.id,e[21]=O):O=e[21],m=O;let A;e[22]!==S||e[23]!==V?(A=()=>{S&&V(S,null)},e[22]=S,e[23]=V,e[24]=A):A=e[24];const E=A,I=(i??[]).filter(F=>F.id!==n.id&&jt(F.metadata)&&!C.has(F.id));x="flex flex-col gap-3";let $;e[25]!==s?($=s("devAgent.devAgentSetup.title"),e[25]=s,e[26]=$):$=e[26],e[27]!==$?(u=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:$}),e[27]=$,e[28]=u):u=e[28],c=Wn,p="p-6 gap-4",h=Hn,f="p-0 space-y-4",d=S?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:S}),t.jsx("span",{className:"text-xs text-muted-foreground",children:s("devAgent.devAgentSetup.linkedDescription")})]}),t.jsx(Z,{variant:"outline",size:"sm",className:"shrink-0",onClick:E,children:s("devAgent.devAgentSetup.unlinkButton")})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:s("devAgent.devAgentSetup.linkDescription")}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs(Z,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>r(!0),children:[t.jsx(Gn,{className:"size-4"}),s("devAgent.devAgentSetup.importButton")]}),I.length>0?t.jsxs(Pe,{onValueChange:m,children:[t.jsx(Ae,{size:"sm",className:"w-56",children:t.jsx(Ie,{placeholder:s("devAgent.devAgentSetup.selectPlaceholder")})}),t.jsx(Oe,{children:I.map(Tr)})]}):null]})]})}e[0]=a,e[1]=i,e[2]=s,e[3]=n.id,e[4]=n.metadata,e[5]=h,e[6]=c,e[7]=m,e[8]=f,e[9]=d,e[10]=p,e[11]=x,e[12]=u,e[13]=g}else h=e[5],c=e[6],m=e[7],f=e[8],d=e[9],p=e[10],x=e[11],u=e[12],g=e[13];if(g!==Symbol.for("react.early_return_sentinel"))return g;let j;e[29]!==h||e[30]!==f||e[31]!==d?(j=t.jsx(h,{className:f,children:d}),e[29]=h,e[30]=f,e[31]=d,e[32]=j):j=e[32];let y;e[33]!==c||e[34]!==p||e[35]!==j?(y=t.jsx(c,{className:p,children:j}),e[33]=c,e[34]=p,e[35]=j,e[36]=y):y=e[36];let b;e[37]!==s?(b=s("devAgent.devAgentSetup.importDialogTitle"),e[37]=s,e[38]=b):b=e[38];let v;e[39]!==m?(v=C=>{const{virtualMcpId:w}=C;r(!1),w&&m(w)},e[39]=m,e[40]=v):v=e[40];let N;e[41]!==o||e[42]!==v||e[43]!==b?(N=t.jsx($l,{open:o,onOpenChange:r,title:b,onImportComplete:v}),e[41]=o,e[42]=v,e[43]=b,e[44]=N):N=e[44];let M;return e[45]!==N||e[46]!==x||e[47]!==u||e[48]!==y?(M=t.jsxs("div",{className:x,children:[u,y,N]}),e[45]=N,e[46]=x,e[47]=u,e[48]=y,e[49]=M):M=e[49],M}function Tr(l){return t.jsx(je,{value:l.id,children:l.title},l.id)}function Dr(){}const Ar=/^[A-Za-z_][A-Za-z0-9_]*$/;function Ir(l){const e={},n=l.split(/\r?\n/);for(let s=0;s<n.length;s++){let i=(n[s]??"").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 ${s+1}: missing '='`);const o=i.slice(0,a).trim();if(!Ar.test(o))throw new Error(`Line ${s+1}: invalid key "${o}"`);let r=i.slice(a+1).trim();r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),e[o]=r}return e}function $s(l){const e=K.c(28),{control:n,form:s,virtualMcpId:i,orgSlug:a,sandboxMap:o}=l,r=Q();let h;e[0]!==r?(h=r("sandbox.envVarsField.title"),e[0]=r,e[1]=h):h=e[1];let c;e[2]!==h?(c=t.jsx("div",{className:"flex items-baseline justify-between gap-2",children:t.jsx(Ne,{className:"font-normal text-foreground",children:h})}),e[2]=h,e[3]=c):c=e[3];let m;e[4]!==r?(m=r("sandbox.envVarsField.description"),e[4]=r,e[5]=m):m=e[5];let f;e[6]!==m?(f=t.jsx("p",{className:"text-xs text-muted-foreground",children:m}),e[6]=m,e[7]=f):f=e[7];let d;e[8]!==n||e[9]!==s||e[10]!==a||e[11]!==o||e[12]!==i?(d=t.jsx(Or,{control:n,form:s,virtualMcpId:i,orgSlug:a,sandboxMap:o}),e[8]=n,e[9]=s,e[10]=a,e[11]=o,e[12]=i,e[13]=d):d=e[13];let p;e[14]!==r?(p=y=>{const{error:b}=y;return t.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:b?.message??r("sandbox.envVarsField.failedToLoadSecrets")})},e[14]=r,e[15]=p):p=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(qn,{className:"h-9 w-full"}),e[16]=x):x=e[16];let u;e[17]!==n||e[18]!==s?(u=t.jsx(H.Suspense,{fallback:x,children:t.jsx($r,{control:n,form:s})}),e[17]=n,e[18]=s,e[19]=u):u=e[19];let g;e[20]!==p||e[21]!==u?(g=t.jsx(Ye,{fallback:p,children:u}),e[20]=p,e[21]=u,e[22]=g):g=e[22];let j;return e[23]!==c||e[24]!==f||e[25]!==d||e[26]!==g?(j=t.jsxs("div",{className:"space-y-2",children:[c,f,d,g]}),e[23]=c,e[24]=f,e[25]=d,e[26]=g,e[27]=j):j=e[27],j}function Or(l){const e=K.c(33),{control:n,form:s,virtualMcpId:i,orgSlug:a,sandboxMap:o}=l,r=Q(),c=Qn.useSession().data?.user?.id,m="metadata.runtime.env";let f;e[0]!==s?(f=()=>JSON.stringify(Es(s.getValues(m))),e[0]=s,e[1]=f):f=e[1];const[d,p]=H.useState(f);let x;e[2]!==n?(x={control:n,name:m},e[2]=n,e[3]=x):x=e[3];const u=sn(x);let g;e[4]!==u?(g=JSON.stringify(Es(u)),e[4]=u,e[5]=g):g=e[5];const j=g,y=j!==d;let b;e[6]!==o||e[7]!==c?(b=c?Object.keys(o?.[c]??{}):[],e[6]=o,e[7]=c,e[8]=b):b=e[8];const v=b,N=v.length>0,[M,C]=H.useState(!1);if(!y||!N)return null;let w;e[9]!==j||e[10]!==a||e[11]!==r||e[12]!==v||e[13]!==i?(w=async()=>{C(!0);const $=await Promise.allSettled(v.map(async q=>{const R=El({orgSlug:a,virtualMcpId:i,branch:q,threadId:null},"setup/start"),G=await fetch(R,{method:"POST"});if(!G.ok){const U=await G.text().catch(()=>G.statusText);throw new Error(U||G.statusText)}}));C(!1);const F=$.filter(Pr).length;F===0?(p(j),re.success(v.length===1?r("sandbox.envVarsField.restartedSingle"):r("sandbox.envVarsField.restartedMultiple",{count:v.length}))):re.error(r("sandbox.envVarsField.restartFailed",{failed:F,total:v.length}))},e[9]=j,e[10]=a,e[11]=r,e[12]=v,e[13]=i,e[14]=w):w=e[14];const k=w;let S;e[15]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Js,{className:"size-3.5 shrink-0"}),e[15]=S):S=e[15];let _;e[16]!==r?(_=r("sandbox.envVarsField.sandboxRunningNotice"),e[16]=r,e[17]=_):_=e[17];let V;e[18]!==_?(V=t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-warning",children:[S,t.jsx("span",{className:"truncate",children:_})]}),e[18]=_,e[19]=V):V=e[19];let O;e[20]!==M?(O=M?t.jsx(ot,{className:"size-3.5"}):t.jsx(Jn,{className:"size-3.5"}),e[20]=M,e[21]=O):O=e[21];let A;e[22]!==M||e[23]!==r?(A=r(M?"sandbox.envVarsField.restarting":"sandbox.envVarsField.restartDev"),e[22]=M,e[23]=r,e[24]=A):A=e[24];let E;e[25]!==k||e[26]!==M||e[27]!==A||e[28]!==O?(E=t.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:k,disabled:M,className:"shrink-0",children:[O,A]}),e[25]=k,e[26]=M,e[27]=A,e[28]=O,e[29]=E):E=e[29];let I;return e[30]!==E||e[31]!==V?(I=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:[V,E]}),e[30]=E,e[31]=V,e[32]=I):I=e[32],I}function Pr(l){return l.status==="rejected"}function $r(l){const e=K.c(62),{control:n,form:s}=l,i=Q(),a="metadata.runtime.env";let o;e[0]!==n?(o={control:n,name:a},e[0]=n,e[1]=o):o=e[1];const r=Xn(o),{fields:h,append:c,remove:m}=r;let f;e[2]!==s?(f=(R,G)=>{s.setValue(`${a}.${R}`,G,{shouldDirty:!0,shouldTouch:!0})},e[2]=s,e[3]=f):f=e[3];const d=f,p=Ll();let x;if(e[4]!==p){x=new Map;for(const R of p)x.set(R.id,R);e[4]=p,e[5]=x}else x=e[5];const[u,g]=H.useState(null);let j;e[6]!==c?(j=()=>{c({key:"",kind:"literal",value:""})},e[6]=c,e[7]=j):j=e[7];const y=j;let b;e[8]!==c||e[9]!==s||e[10]!==i?(b=async()=>{let R;try{R=await navigator.clipboard.readText()}catch{re.error(i("sandbox.envVarsField.clipboardReadFailed"));return}if(!R.trim()){re.error(i("sandbox.envVarsField.clipboardEmpty"));return}let G;try{G=Ir(R)}catch(z){const Y=z;re.error(Y.message);return}const U=Object.entries(G);if(U.length===0){re.error(i("sandbox.envVarsField.nothingToAdd"));return}const T=s.getValues(a)??[],P=new Set;for(const z of T){const Y=(z.key??"").trim();Y&&P.add(Y)}let W=0,B=0;for(const[z,Y]of U){if(P.has(z)){B++;continue}c({key:z,kind:"literal",value:Y}),P.add(z),W++}W===0&&B>0?re.message(i("sandbox.envVarsField.allKeysExist",{count:B})):re.success(B>0?i("sandbox.envVarsField.addedWithSkipped",{added:W,skipped:B}):i("sandbox.envVarsField.added",{added:W}))},e[8]=c,e[9]=s,e[10]=i,e[11]=b):b=e[11];const v=b;let N;if(e[12]!==n||e[13]!==h||e[14]!==s||e[15]!==m||e[16]!==x||e[17]!==p||e[18]!==d){let R;e[20]!==n||e[21]!==s||e[22]!==m||e[23]!==x||e[24]!==p||e[25]!==d?(R=(G,U)=>t.jsx("li",{className:"rounded-md border border-border bg-background",children:t.jsx(Er,{index:U,control:n,form:s,onUpdateEntry:d,fieldPath:a,secrets:p,secretById:x,onSaveAsSecret:(T,P)=>g({kind:"save-literal",index:U,presetKey:T,presetValue:P}),onCreateNewSecret:T=>g({kind:"create-new",index:U,presetKey:T}),onRemove:()=>m(U)})},G.id),e[20]=n,e[21]=s,e[22]=m,e[23]=x,e[24]=p,e[25]=d,e[26]=R):R=e[26],N=h.map(R),e[12]=n,e[13]=h,e[14]=s,e[15]=m,e[16]=x,e[17]=p,e[18]=d,e[19]=N}else N=e[19];let M;e[27]!==N?(M=t.jsx("ul",{className:"space-y-2",children:N}),e[27]=N,e[28]=M):M=e[28];let C;e[29]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Le,{className:"size-3.5"}),e[29]=C):C=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(Z,{type:"button",variant:"outline",size:"sm",onClick:y,className:"flex-1",children:[C,w]}),e[32]=y,e[33]=w,e[34]=k):k=e[34];let S;e[35]!==i?(S=i("sandbox.envVarsField.pasteDotenvAriaLabel"),e[35]=i,e[36]=S):S=e[36];let _;e[37]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(bi,{className:"size-3.5"}),e[37]=_):_=e[37];let V;e[38]!==i?(V=i("sandbox.envVarsField.pasteDotenv"),e[38]=i,e[39]=V):V=e[39];let O;e[40]!==v||e[41]!==S||e[42]!==V?(O=t.jsx(we,{asChild:!0,children:t.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:v,"aria-label":S,children:[_,V]})}),e[40]=v,e[41]=S,e[42]=V,e[43]=O):O=e[43];let A;e[44]!==i?(A=i("sandbox.envVarsField.pasteDotenvTooltip"),e[44]=i,e[45]=A):A=e[45];let E;e[46]!==A?(E=t.jsx(Se,{children:A}),e[46]=A,e[47]=E):E=e[47];let I;e[48]!==O||e[49]!==E?(I=t.jsxs(ye,{children:[O,E]}),e[48]=O,e[49]=E,e[50]=I):I=e[50];let $;e[51]!==I||e[52]!==k?($=t.jsxs("div",{className:"flex items-center gap-2",children:[k,I]}),e[51]=I,e[52]=k,e[53]=$):$=e[53];let F;e[54]!==u||e[55]!==s||e[56]!==d?(F=u!==null?t.jsx(zr,{mode:u,onClose:()=>g(null),onSaved:R=>{const G=s.getValues(`${a}.${u.index}.key`)?.trim()??"";d(u.index,{key:G,kind:"secret",secretId:R}),g(null)}}):null,e[54]=u,e[55]=s,e[56]=d,e[57]=F):F=e[57];let q;return e[58]!==$||e[59]!==F||e[60]!==M?(q=t.jsxs("div",{className:"space-y-2",children:[M,$,F]}),e[58]=$,e[59]=F,e[60]=M,e[61]=q):q=e[61],q}function Er(l){const e=K.c(77),{index:n,control:s,form:i,onUpdateEntry:a,fieldPath:o,secrets:r,secretById:h,onSaveAsSecret:c,onCreateNewSecret:m,onRemove:f}=l,d=Q(),p=`${o}.${n}.key`,x=`${o}.${n}.value`,u=`${o}.${n}.secretId`,g=`${o}.${n}.kind`;let j;e[0]!==s||e[1]!==g?(j={control:s,name:g},e[0]=s,e[1]=g,e[2]=j):j=e[2];const b=sn(j)==="secret"?"secret":"literal";let v;e[3]!==i||e[4]!==n||e[5]!==p||e[6]!==c||e[7]!==a||e[8]!==x?(v=Y=>{const X=i.getValues(p)?.trim()??"";if(Y==="literal"){a(n,{key:X,kind:"literal",value:""});return}const ie=i.getValues(x)??"";if(ie.length>0){c(X,ie);return}a(n,{key:X,kind:"secret",secretId:""})},e[3]=i,e[4]=n,e[5]=p,e[6]=c,e[7]=a,e[8]=x,e[9]=v):v=e[9];const N=v;let M;e[10]!==n||e[11]!==d?(M=Y=>{const{field:X}=Y,ie=(X.value??"").trim(),le=ie.length>0&&!_t.test(ie);return t.jsxs("div",{className:"space-y-1",children:[t.jsx(Me,{...X,value:X.value??"",placeholder:d("sandbox.envVarsField.keyPlaceholder"),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",className:pe("font-mono",le&&"border-destructive focus-visible:ring-destructive"),"aria-invalid":le,"aria-label":d("sandbox.envVarsField.envVarKeyLabel",{index:n+1}),onBlur:de=>{const oe=de.target.value.trim();X.onChange(oe),X.onBlur()}}),le?t.jsx("p",{className:"text-[11px] text-destructive",children:d("sandbox.envVarsField.invalidKeyMessage")}):null]})},e[10]=n,e[11]=d,e[12]=M):M=e[12];let C;e[13]!==s||e[14]!==p||e[15]!==M?(C=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(me,{control:s,name:p,render:M})}),e[13]=s,e[14]=p,e[15]=M,e[16]=C):C=e[16];let w;e[17]!==N?(w=Y=>N(Y),e[17]=N,e[18]=w):w=e[18];let k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ae,{className:"h-9 w-[110px]",children:t.jsx(Ie,{})}),e[19]=k):k=e[19];let S;e[20]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Xt,{className:"size-3.5"}),e[20]=S):S=e[20];let _;e[21]!==d?(_=d("sandbox.envVarsField.literal"),e[21]=d,e[22]=_):_=e[22];let V;e[23]!==_?(V=t.jsx(je,{value:"literal",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[S,_]})}),e[23]=_,e[24]=V):V=e[24];let O;e[25]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Zn,{className:"size-3.5"}),e[25]=O):O=e[25];let A;e[26]!==d?(A=d("sandbox.envVarsField.secret"),e[26]=d,e[27]=A):A=e[27];let E;e[28]!==A?(E=t.jsx(je,{value:"secret",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[O,A]})}),e[28]=A,e[29]=E):E=e[29];let I;e[30]!==E||e[31]!==V?(I=t.jsxs(Oe,{children:[V,E]}),e[30]=E,e[31]=V,e[32]=I):I=e[32];let $;e[33]!==b||e[34]!==I||e[35]!==w?($=t.jsx("div",{className:"shrink-0",children:t.jsxs(Pe,{value:b,onValueChange:w,children:[k,I]})}),e[33]=b,e[34]=I,e[35]=w,e[36]=$):$=e[36];let F;e[37]!==s||e[38]!==i||e[39]!==n||e[40]!==p||e[41]!==b||e[42]!==m||e[43]!==h||e[44]!==u||e[45]!==r||e[46]!==d||e[47]!==x?(F=t.jsx("div",{className:"flex flex-[2] min-w-0 items-center gap-1",children:b==="literal"?t.jsx(me,{control:s,name:x,render:Y=>{const{field:X}=Y;return t.jsx(Me,{...X,value:X.value??"",type:"password",placeholder:d("sandbox.envVarsField.valuePlaceholder"),spellCheck:!1,autoComplete:"off",className:"font-mono","aria-label":d("sandbox.envVarsField.envVarValueLabel",{index:n+1}),onBlur:ie=>{X.onChange(ie.target.value),X.onBlur()}})}}):t.jsxs(t.Fragment,{children:[t.jsx(me,{control:s,name:u,render:Y=>{const{field:X}=Y;return t.jsxs(Pe,{value:X.value||"",onValueChange:ie=>X.onChange(ie),children:[t.jsx(Ae,{className:pe("h-9 w-full",!X.value&&"text-muted-foreground"),"aria-label":d("sandbox.envVarsField.secretAriaLabel",{index:n+1}),children:t.jsx(Ie,{placeholder:d("sandbox.envVarsField.pickSecretPlaceholder"),children:t.jsx(Fl,{field:X,secretById:h})})}),t.jsx(Oe,{children:r.length===0?t.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:d("sandbox.envVarsField.noSecretsYet")}):r.map(Fr)})]})}}),t.jsxs(ye,{children:[t.jsx(we,{asChild:!0,children:t.jsx(Z,{type:"button",variant:"ghost",size:"icon","aria-label":d("sandbox.envVarsField.createNewSecretAriaLabel"),onClick:()=>{const Y=i.getValues(p)?.trim()??"";m(Y)},children:t.jsx(Le,{className:"size-3.5"})})}),t.jsx(Se,{children:d("sandbox.envVarsField.createNewSecret")})]})]})}),e[37]=s,e[38]=i,e[39]=n,e[40]=p,e[41]=b,e[42]=m,e[43]=h,e[44]=u,e[45]=r,e[46]=d,e[47]=x,e[48]=F):F=e[48];let q;e[49]!==i||e[50]!==p||e[51]!==b||e[52]!==c||e[53]!==d||e[54]!==x?(q=b==="literal"?t.jsxs(ye,{children:[t.jsx(we,{asChild:!0,children:t.jsx(Z,{type:"button",variant:"ghost",size:"icon","aria-label":d("sandbox.envVarsField.saveAsSecretAriaLabel"),onClick:()=>{const Y=i.getValues(p)?.trim()??"",X=i.getValues(x)??"";c(Y,X)},children:t.jsx(yi,{className:"size-3.5"})})}),t.jsx(Se,{children:d("sandbox.envVarsField.saveAsSecret")})]}):null,e[49]=i,e[50]=p,e[51]=b,e[52]=c,e[53]=d,e[54]=x,e[55]=q):q=e[55];let R;e[56]!==d?(R=d("sandbox.envVarsField.removeEnvVarAriaLabel"),e[56]=d,e[57]=R):R=e[57];let G;e[58]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(it,{className:"size-3.5"}),e[58]=G):G=e[58];let U;e[59]!==f||e[60]!==R?(U=t.jsx(we,{asChild:!0,children:t.jsx(Z,{type:"button",variant:"ghost",size:"icon","aria-label":R,onClick:f,children:G})}),e[59]=f,e[60]=R,e[61]=U):U=e[61];let T;e[62]!==d?(T=d("sandbox.envVarsField.remove"),e[62]=d,e[63]=T):T=e[63];let P;e[64]!==T?(P=t.jsx(Se,{children:T}),e[64]=T,e[65]=P):P=e[65];let W;e[66]!==U||e[67]!==P?(W=t.jsxs(ye,{children:[U,P]}),e[66]=U,e[67]=P,e[68]=W):W=e[68];let B;e[69]!==q||e[70]!==W?(B=t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[q,W]}),e[69]=q,e[70]=W,e[71]=B):B=e[71];let z;return e[72]!==$||e[73]!==F||e[74]!==B||e[75]!==C?(z=t.jsxs("div",{className:"flex flex-col gap-2 p-2 sm:flex-row sm:items-center",children:[C,$,F,B]}),e[72]=$,e[73]=F,e[74]=B,e[75]=C,e[76]=z):z=e[76],z}function Fr(l){return t.jsx(je,{value:l.id,children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(Rl,{scope:l.scope}),t.jsx("span",{className:"font-mono",children:l.name})]})},l.id)}function zr({mode:l,onClose:e,onSaved:n}){const s=Q(),i=l.kind==="save-literal"?l.presetValue:"",a=l.presetKey,[o,r]=H.useState(()=>Rr(a)),[h,c]=H.useState("organization"),[m,f]=H.useState(i),[d,p]=H.useState(""),x=Bl(),u=o.trim(),g=m.length>0&&u.length>0&&zl.test(u),j=async v=>{if(v.preventDefault(),!!g)try{const N=await x.mutateAsync({scope:h,name:u,value:m,description:d.trim()||void 0});re.success(s("sandbox.envVarsField.secretSaved",{name:N.name})),n(N.id)}catch(N){re.error(N instanceof Error?N.message:s("sandbox.envVarsField.failedToSaveSecret"))}},y=l.kind==="save-literal"?s("sandbox.envVarsField.saveValueAsSecretTitle"):s("sandbox.envVarsField.createNewSecretTitle"),b=l.kind==="save-literal"?s("sandbox.envVarsField.saveValueAsSecretDescription"):s("sandbox.envVarsField.createNewSecretDescription");return t.jsx(ct,{open:!0,onOpenChange:v=>{v||e()},children:t.jsxs(dt,{className:"sm:max-w-md",children:[t.jsxs(Ct,{children:[t.jsx(Mt,{children:y}),t.jsx(Ji,{children:b})]}),t.jsxs("form",{onSubmit:j,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Ne,{htmlFor:"save-secret-scope",children:s("sandbox.envVarsField.scopeLabel")}),t.jsxs(Pe,{value:h,onValueChange:v=>c(v),children:[t.jsx(Ae,{id:"save-secret-scope",children:t.jsx(Ie,{})}),t.jsxs(Oe,{children:[t.jsx(je,{value:"organization",children:s("sandbox.envVarsField.scopeOrganization")}),t.jsx(je,{value:"user",children:s("sandbox.envVarsField.scopePrivate")})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Ne,{htmlFor:"save-secret-name",children:s("sandbox.envVarsField.nameLabel")}),t.jsx(Me,{id:"save-secret-name",value:o,onChange:v=>r(v.target.value),placeholder:s("sandbox.envVarsField.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("sandbox.envVarsField.nameHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Ne,{htmlFor:"save-secret-value",children:s("sandbox.envVarsField.valueLabel")}),t.jsx(Me,{id:"save-secret-value",type:"password",value:m,onChange:v=>f(v.target.value),placeholder:s("sandbox.envVarsField.secretValuePlaceholder"),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Ne,{htmlFor:"save-secret-description",children:s("sandbox.envVarsField.descriptionLabel")}),t.jsx(lt,{id:"save-secret-description",value:d,onChange:v=>p(v.target.value),rows:2,placeholder:s("sandbox.envVarsField.descriptionPlaceholder")})]}),t.jsxs(mn,{children:[t.jsx(Z,{type:"button",variant:"outline",onClick:e,disabled:x.isPending,children:s("sandbox.envVarsField.cancel")}),t.jsx(Z,{type:"submit",disabled:!g||x.isPending,children:x.isPending?s("sandbox.envVarsField.saving"):s("sandbox.envVarsField.saveSecret")})]})]})]})})}function Es(l){if(!Array.isArray(l))return[];const e=[];for(const n of l){if(!n||typeof n!="object")continue;const s=n,i=(s.key??"").trim();if(!(!i||!_t.test(i))){if(s.kind==="literal"){e.push({key:i,kind:"literal",value:s.value??""});continue}s.kind==="secret"&&s.secretId&&e.push({key:i,kind:"secret",secretId:s.secretId})}}return e}function Rr(l){const e=l.trim();return e&&_t.test(e)?e:""}function Fs(l){const e=K.c(21),{repo:n,className:s}=l,i=Q();let a;e[0]!==s?(a=pe("space-y-2",s),e[0]=s,e[1]=a):a=e[1];let o;e[2]!==i?(o=i("sandbox.repoRow.label"),e[2]=i,e[3]=o):o=e[3];let r;e[4]!==o?(r=t.jsx(Ne,{children:o}),e[4]=o,e[5]=r):r=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Ul,{size:20,className:"shrink-0 text-foreground/60"}),e[6]=h):h=e[6];let c;e[7]!==n||e[8]!==i?(c=t.jsx(we,{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:[h,t.jsx("div",{className:"min-w-0 flex-1",children:n?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"truncate text-sm font-medium",children:[n.owner,"/",n.name]}),t.jsx("div",{className:"truncate text-xs text-muted-foreground",children:n.url})]}):t.jsx("div",{className:"text-sm text-muted-foreground",children:i("sandbox.repoRow.noRepositoryConnected")})})]})}),e[7]=n,e[8]=i,e[9]=c):c=e[9];let m;e[10]!==i?(m=i("sandbox.repoRow.tooltipContent"),e[10]=i,e[11]=m):m=e[11];let f;e[12]!==m?(f=t.jsx(Se,{children:m}),e[12]=m,e[13]=f):f=e[13];let d;e[14]!==c||e[15]!==f?(d=t.jsxs(ye,{children:[c,f]}),e[14]=c,e[15]=f,e[16]=d):d=e[16];let p;return e[17]!==a||e[18]!==r||e[19]!==d?(p=t.jsxs("div",{className:a,children:[r,d]}),e[17]=a,e[18]=r,e[19]=d,e[20]=p):p=e[20],p}const Lr={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 Br(l){const e=l.trim();if(e==="")return{ok:!0,value:null};if(!/^\d+$/.test(e))return{ok:!1};const n=Number(e);return n<1||n>65535?{ok:!1}:{ok:!0,value:String(n)}}const Ur=Object.keys(Lr),Pt="__none__";function zs(l){const e=K.c(47),{control:n}=l,s=Q(),i=H.useRef(null);let a;e[0]!==s?(a=s("sandbox.runtimeFields.packageManager"),e[0]=s,e[1]=a):a=e[1];let o;e[2]!==a?(o=t.jsx(Ne,{htmlFor:"runtime-pm",children:a}),e[2]=a,e[3]=o):o=e[3];let r;e[4]!==s?(r=w=>{const{field:k}=w;return t.jsxs(Pe,{value:k.value??Pt,onValueChange:S=>k.onChange(S===Pt?null:S),children:[t.jsx(Ae,{id:"runtime-pm",children:t.jsx(Ie,{placeholder:s("sandbox.runtimeFields.autoDetect")})}),t.jsxs(Oe,{children:[t.jsx(je,{value:Pt,children:s("sandbox.runtimeFields.autoDetect")}),Ur.map(Kr)]})]})},e[4]=s,e[5]=r):r=e[5];let h;e[6]!==n||e[7]!==r?(h=t.jsx(me,{control:n,name:"metadata.runtime.selected",render:r}),e[6]=n,e[7]=r,e[8]=h):h=e[8];let c;e[9]!==o||e[10]!==h?(c=t.jsxs("div",{className:"space-y-2",children:[o,h]}),e[9]=o,e[10]=h,e[11]=c):c=e[11];let m;e[12]!==s?(m=s("sandbox.runtimeFields.packagePath"),e[12]=s,e[13]=m):m=e[13];let f;e[14]!==m?(f=t.jsx(Ne,{htmlFor:"runtime-path",children:m}),e[14]=m,e[15]=f):f=e[15];let d;e[16]!==n?(d=t.jsx(me,{control:n,name:"metadata.runtime.path",render:Yr}),e[16]=n,e[17]=d):d=e[17];let p;e[18]!==s?(p=s("sandbox.runtimeFields.packagePathDescription"),e[18]=s,e[19]=p):p=e[19];let x;e[20]!==p?(x=t.jsx("p",{className:"text-xs text-muted-foreground",children:p}),e[20]=p,e[21]=x):x=e[21];let u;e[22]!==x||e[23]!==f||e[24]!==d?(u=t.jsxs("div",{className:"space-y-2",children:[f,d,x]}),e[22]=x,e[23]=f,e[24]=d,e[25]=u):u=e[25];let g;e[26]!==s?(g=s("sandbox.runtimeFields.devServerPort"),e[26]=s,e[27]=g):g=e[27];let j;e[28]!==g?(j=t.jsx(Ne,{htmlFor:"runtime-port",children:g}),e[28]=g,e[29]=j):j=e[29];let y;e[30]!==s?(y=w=>{const{field:k}=w;return t.jsx(Me,{ref:i,id:"runtime-port",inputMode:"numeric",placeholder:s("sandbox.runtimeFields.auto"),defaultValue:k.value??"",onBlur:S=>{const _=Br(S.target.value);_.ok?k.onChange(_.value):i.current&&(i.current.value=k.value??"")}})},e[30]=s,e[31]=y):y=e[31];let b;e[32]!==n||e[33]!==y?(b=t.jsx(me,{control:n,name:"metadata.runtime.port",render:y}),e[32]=n,e[33]=y,e[34]=b):b=e[34];let v;e[35]!==s?(v=s("sandbox.runtimeFields.devServerPortDescription"),e[35]=s,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 M;e[39]!==j||e[40]!==b||e[41]!==N?(M=t.jsxs("div",{className:"space-y-2",children:[j,b,N]}),e[39]=j,e[40]=b,e[41]=N,e[42]=M):M=e[42];let C;return e[43]!==u||e[44]!==M||e[45]!==c?(C=t.jsxs("div",{className:"space-y-5",children:[c,u,M]}),e[43]=u,e[44]=M,e[45]=c,e[46]=C):C=e[46],C}function Yr(l){const{field:e}=l;return t.jsx(Me,{id:"runtime-path",placeholder:".",defaultValue:e.value??"",onBlur:n=>{const s=n.target.value.trim();e.onChange(s===""?null:s)}})}function Kr(l){return t.jsx(je,{value:l,children:l},l)}function Rs(l){const e=K.c(17),{control:n}=l,s=Q();let i;e[0]!==s?(i=s("sandbox.previewServerUrlField.label"),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==i?(a=t.jsx(Ne,{htmlFor:"preview-server-url",children:i}),e[2]=i,e[3]=a):a=e[3];let o;e[4]!==s?(o=f=>{const{field:d}=f,p=d.value??"";return t.jsx(Me,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:s("sandbox.previewServerUrlField.placeholder"),value:p,onChange:x=>d.onChange(x.target.value===""?null:x.target.value),onBlur:()=>{d.onChange(Yl(p)),d.onBlur()}})},e[4]=s,e[5]=o):o=e[5];let r;e[6]!==n||e[7]!==o?(r=t.jsx(me,{control:n,name:"metadata.previewServerUrl",render:o}),e[6]=n,e[7]=o,e[8]=r):r=e[8];let h;e[9]!==s?(h=s("sandbox.previewServerUrlField.description"),e[9]=s,e[10]=h):h=e[10];let c;e[11]!==h?(c=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[11]=h,e[12]=c):c=e[12];let m;return e[13]!==a||e[14]!==r||e[15]!==c?(m=t.jsxs("div",{className:"space-y-2",children:[a,r,c]}),e[13]=a,e[14]=r,e[15]=c,e[16]=m):m=e[16],m}function Ls(l){const e=K.c(5),{control:n}=l,s=Q();let i;e[0]!==s?(i=o=>{const{field:r}=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(Ne,{htmlFor:"field-description-tooltips",className:"font-normal text-foreground",children:s("sandbox.fieldDescriptionTooltipsField.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("sandbox.fieldDescriptionTooltipsField.description")})]}),t.jsx(ut,{id:"field-description-tooltips",className:"shrink-0",checked:r.value??!1,onCheckedChange:h=>r.onChange(h)})]})},e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsx(me,{control:n,name:"metadata.fieldDescriptionTooltips",render:i}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function Bs(l){const e=K.c(8),{control:n,previewServerUrl:s}=l,i=Q();let a;e[0]!==s?(a=Kl(s),e[0]=s,e[1]=a):a=e[1];const o=!!a;let r;e[2]!==o||e[3]!==i?(r=c=>{const{field:m}=c;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(Ne,{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(o?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(ut,{id:"fast-preview",className:"shrink-0",checked:!!m.value&&o,disabled:!o,onCheckedChange:f=>m.onChange(f)})]})},e[2]=o,e[3]=i,e[4]=r):r=e[4];let h;return e[5]!==n||e[6]!==r?(h=t.jsx(me,{control:n,name:"metadata.fastPreview",render:r}),e[5]=n,e[6]=r,e[7]=h):h=e[7],h}function Us(l){const e=K.c(5),{control:n,fastPreview:s}=l,i=Q();if(!s)return null;let a;e[0]!==i?(a=r=>{const{field:h}=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(Ne,{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(ut,{id:"fast-preview-in-place",className:"shrink-0",checked:!!h.value,onCheckedChange:c=>h.onChange(c)})]})},e[0]=i,e[1]=a):a=e[1];let o;return e[2]!==n||e[3]!==a?(o=t.jsx(me,{control:n,name:"metadata.fastPreviewInPlace",render:a}),e[2]=n,e[3]=a,e[4]=o):o=e[4],o}function Ys(l){const e=K.c(32),{control:n,onCommit:s}=l,i=Q();let a;e[0]!==i?(a=i("virtualMcp.virtualMcp.publishPolicySmart"),e[0]=i,e[1]=a):a=e[1];let o;e[2]!==i?(o=i("virtualMcp.virtualMcp.publishPolicySmartDescription"),e[2]=i,e[3]=o):o=e[3];let r;e[4]!==a||e[5]!==o?(r={value:"smart",label:a,description:o},e[4]=a,e[5]=o,e[6]=r):r=e[6];let h;e[7]!==i?(h=i("virtualMcp.virtualMcp.publishPolicyCodeReview"),e[7]=i,e[8]=h):h=e[8];let c;e[9]!==i?(c=i("virtualMcp.virtualMcp.publishPolicyCodeReviewDescription"),e[9]=i,e[10]=c):c=e[10];let m;e[11]!==h||e[12]!==c?(m={value:"code-review",label:h,description:c},e[11]=h,e[12]=c,e[13]=m):m=e[13];let f;e[14]!==i?(f=i("virtualMcp.virtualMcp.publishPolicyOpen"),e[14]=i,e[15]=f):f=e[15];let d;e[16]!==i?(d=i("virtualMcp.virtualMcp.publishPolicyOpenDescription"),e[16]=i,e[17]=d):d=e[17];let p;e[18]!==f||e[19]!==d?(p={value:"open",label:f,description:d},e[18]=f,e[19]=d,e[20]=p):p=e[20];let x;e[21]!==r||e[22]!==m||e[23]!==p?(x=[r,m,p],e[21]=r,e[22]=m,e[23]=p,e[24]=x):x=e[24];const u=x;let g;e[25]!==s||e[26]!==u||e[27]!==i?(g=y=>{const{field:b}=y,v=b.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(Ne,{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(Pe,{value:v,onValueChange:N=>{b.onChange(N),s()},children:[t.jsx(Ae,{id:"publish-policy",className:"w-44 shrink-0 text-sm",children:t.jsx(Ie,{})}),t.jsx(Oe,{className:"max-w-80",children:u.map(Gr)})]})]})},e[25]=s,e[26]=u,e[27]=i,e[28]=g):g=e[28];let j;return e[29]!==n||e[30]!==g?(j=t.jsx(me,{name:"metadata.publishPolicy",control:n,render:g}),e[29]=n,e[30]=g,e[31]=j):j=e[31],j}function Gr(l){return t.jsx(je,{value:l.value,description:l.description,children:l.label},l.value)}function Ks(l){const e=K.c(24),{control:n,onCommit:s}=l,i=Q();let a;e[0]!==i?(a=i("sandbox.cmsSettings.contentEditing.off"),e[0]=i,e[1]=a):a=e[1];let o;e[2]!==i?(o=i("sandbox.cmsSettings.contentEditing.offDescription"),e[2]=i,e[3]=o):o=e[3];let r;e[4]!==a||e[5]!==o?(r={value:"off",label:a,description:o},e[4]=a,e[5]=o,e[6]=r):r=e[6];let h;e[7]!==i?(h=i("sandbox.cmsSettings.contentEditing.on"),e[7]=i,e[8]=h):h=e[8];let c;e[9]!==i?(c=i("sandbox.cmsSettings.contentEditing.onDescription"),e[9]=i,e[10]=c):c=e[10];let m;e[11]!==h||e[12]!==c?(m={value:"on",label:h,description:c},e[11]=h,e[12]=c,e[13]=m):m=e[13];let f;e[14]!==r||e[15]!==m?(f=[r,m],e[14]=r,e[15]=m,e[16]=f):f=e[16];const d=f;let p;e[17]!==s||e[18]!==d||e[19]!==i?(p=u=>{const{field:g}=u,j=g.value??null,y=vn(j);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(Ne,{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(Pe,{value:y,onValueChange:b=>{const v=Tl.safeParse(b);v.success&&(g.onChange(Dl(j,v.data)),s())},children:[t.jsx(Ae,{id:"content-editing-mode",className:"w-44 shrink-0 text-sm",children:t.jsx(Ie,{})}),t.jsx(Oe,{className:"max-w-80",children:d.map(Wr)})]})]})},e[17]=s,e[18]=d,e[19]=i,e[20]=p):p=e[20];let x;return e[21]!==n||e[22]!==p?(x=t.jsx(me,{name:"metadata.ui.layout",control:n,render:p}),e[21]=n,e[22]=p,e[23]=x):x=e[23],x}function Wr(l){return t.jsx(je,{value:l.value,description:l.description,children:l.label},l.value)}function Gs(l){const e=l.metadata?.sidebarViews,n=l.metadata?.sidebarViewsVersion;return{effectiveViews:[...Et(Ft(l.metadata),n)],rawViews:e===null?null:e?[...e]:void 0,version:n}}function Hr(l,e){return l===e?!0:!l||!e||l.length!==e.length?!1:l.every((n,s)=>n===e[s])}function qr(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 Qr(l,e){switch(e.type){case"accumulate":{const n=l??{start:e.now,fields:new Set,saveCount:0,instructionsLength:null},s=new Set(n.fields);for(const i of e.fields)s.add(i);return{...n,fields:s,saveCount:n.saveCount+1,instructionsLength:e.instructionsLength??n.instructionsLength}}case"reset":return null}}function Xr(l){const e=l.metadata?.runtime?.env;if(!e||e.length===0)return l;const n=e.filter(s=>{if(!s||typeof s!="object")return!1;const i=(s.key??"").trim();return!i||!_t.test(i)?!1:s.kind==="literal"?!0:s.kind==="secret"?!!s.secretId:!1});return n.length===e.length?l:{...l,metadata:{...l.metadata,runtime:{...l.metadata?.runtime??{},env:n}}}}async function Jr(l,e){const n=l?.idToken??null;if(n){const i=Ws(n);if(i)return i}const s=l?.userinfoEndpoint??null;if(s)try{const i=await fetch(s,{headers:{Authorization:`Bearer ${e}`}});if(i.ok){const a=await i.json(),o=typeof a.email=="string"?a.email:typeof a.upn=="string"?a.upn:typeof a.preferred_username=="string"?a.preferred_username:null;if(o)return o}}catch{}return Ws(e)}function Ws(l){try{const e=l.split(".");if(e.length===3&&e[1]){const n=JSON.parse(atob(e[1].replace(/-/g,"+").replace(/_/g,"/")));if(typeof n.email=="string")return n.email;if(typeof n.upn=="string")return n.upn;if(typeof n.preferred_username=="string")return n.preferred_username}}catch{}return null}function Zr({virtualMcp:l,hideOwnTitle:e}){const n=Rt(),s=Q(),i=Ri(),{org:a}=Be(),o=un(),{data:r}=Bi([l.id]),h=r?.get(l.id)?.last_used_at,c=on(),m=ei(),f=St(),d=gn(l.id),p=JSON.stringify([a.id,l.id]),x=Cl(l.metadata,d.snapshot()),u=ti({resolver:si(gr),defaultValues:{...l,metadata:{...bs(l.metadata),previewServerUrl:Gl(l.metadata),...x}}}),g=u.watch("connections"),j=xl(l),y=jt(l?.metadata),b=y&&vn(u.watch("metadata.ui.layout"))==="off",v=bn(l),N=v?{owner:v.owner,name:v.name,url:v.url}:null,[M,C]=H.useReducer(qr,{shareDialogOpen:!1,addDialogOpen:!1,settingsDialogOpen:!1,settingsConnectionId:null}),[w,k]=H.useState(!1),[S,_]=H.useState(!1),{createNewTask:V,openSidePanel:O}=Ei(),{sendMessage:A}=Oi(),E=async()=>{if(S)return;const D=u.getValues("metadata.instructions");if(D?.trim()){_(!0);try{R(),ve("agent_instructions_improve_clicked",{agent_id:l.id,instructions_length:D.length}),O();const te=ni(a.id);await A({tiptapDoc:Pi({managerAgentId:te.id,managerName:te.title,kind:"agent",id:l.id,instructions:D})})}finally{_(!1)}}},[I,$]=H.useReducer(Qr,null),F=()=>{I!==null&&(ve("agent_updated",{agent_id:l.id,fields:Array.from(I.fields),instructions_length:I.instructionsLength,save_count:I.saveCount,edit_duration_ms:Date.now()-I.start}),$({type:"reset"}))},{schedule:q,flush:R}=hs({delayMs:3e4,save:async()=>F()}),G=async()=>{const D=d.snapshot(),te={predicate:Te=>js(Te.queryKey,a.id)},se=async()=>(await m.invalidateQueries({predicate:Te=>js(Te.queryKey,a.id),refetchType:"all"}),vs(m,a.id,l.id)),fe=(Te,Xe)=>{if(Te){Hr(u.getValues("metadata.sidebarViews"),Te.rawViews)||u.setValue("metadata.sidebarViews",Te.rawViews,{shouldDirty:!1}),u.getValues("metadata.sidebarViewsVersion")!==Te.version&&u.setValue("metadata.sidebarViewsVersion",Te.version,{shouldDirty:!1});return}Xe!==null&&(u.setValue("metadata.sidebarViews",[...Xe],{shouldDirty:!1}),u.setValue("metadata.sidebarViewsVersion",Sl,{shouldDirty:!1}))},_e=Ml(D),Fe=Object.keys(u.control._formState.dirtyFields);if(Fe.length===0&&!_e){await d.settle({snapshot:D,saved:!0,authoritativeViews:D?.persistedViews});return}const qe=Fe.length>0?Fe:["metadata"],pt=qe.includes("metadata"),Qe=u.getValues();u.reset(Qe,{keepValues:!0});const st=Xr(Qe),On=vs(m,a.id,l.id),Pn=kl({sidebarViews:st.metadata?.sidebarViews,sidebarViewsVersion:st.metadata?.sidebarViewsVersion},D,On?.metadata);st.metadata={...bs(st.metadata),...Pn};let Tt;try{Tt=await o.update.mutateAsync({id:l.id,data:st})}catch(Te){let Xe=null;try{Xe=await se()}catch{}const ts=Xe?Gs(Xe):null,ss=await d.settle({snapshot:D,saved:!1,authoritativeViews:ts?.effectiveViews});throw ss.settledLatest&&fe(ts,ss.reconciledViews),Te}await m.cancelQueries(te),_l(m,a.id,Tt);const Zt=Gs(Tt),es=await d.settle({snapshot:D,saved:!0,authoritativeViews:Zt.effectiveViews});es.settledLatest&&fe(Zt,es.reconciledViews),$({type:"accumulate",now:Date.now(),fields:qe,instructionsLength:pt?Qe.metadata?.instructions?.length??0:null}),q()},U=()=>Wl(p,G),{schedule:T,flush:P}=hs({save:U});H.useEffect(()=>{const D=u.watch(()=>T());return()=>D.unsubscribe()},[]);const W=()=>{ve("connections_dialog_opened",{source:"agent_settings",mode:"add"}),C({type:"SET_ADD_DIALOG_OPEN",payload:!0})},B=async D=>{const te=u.getValues("connections");if(te.some(_e=>_e.connection_id===D))return;u.setValue("connections",[...te,{connection_id:D,selected_tools:Ot.tools,selected_resources:Ot.resources,selected_prompts:Ot.prompts}],{shouldDirty:!0}),C({type:"SET_ADD_DIALOG_OPEN",payload:!1});const se=new URL(`/api/${a.slug}/mcp/${D}`,window.location.origin),fe=await xs({url:se.href,token:null,orgId:a.id});fe.supportsOAuth&&!fe.isAuthenticated&&await le(D)},z=D=>{const se=u.getValues("connections").filter(fe=>fe.connection_id!==D);u.setValue("connections",se,{shouldDirty:!0})},Y=(D,te)=>{const se=u.getValues("connections");if(se.some(fe=>fe.connection_id===te)){re.error(s("virtualMcp.virtualMcp.instanceAlreadyAdded"));return}u.setValue("connections",se.map(fe=>fe.connection_id===D?{...fe,connection_id:te}:fe),{shouldDirty:!0})},X=async D=>{if(u.getValues("connections").find(se=>se.connection_id===D))try{const{item:se}=await f.call("COLLECTION_CONNECTIONS_GET",{id:D});if(!se)return;const fe=se.title.replace(/\s*\(.*?\)\s*$/,""),_e=Ii("conn"),Fe=`${fe} (${Date.now().toString(36).slice(-4)})`;await c.create.mutateAsync({id:_e,title:Fe,description:se.description??null,connection_type:se.connection_type,connection_url:se.connection_url??null,connection_token:null,icon:se.icon??null,app_name:se.app_name??null,app_id:se.app_id??null,connection_headers:se.connection_headers??null});const qe=new URL(`/api/${a.slug}/mcp/${_e}`,window.location.origin),pt=await xs({url:qe.href,token:null,orgId:a.id});if(pt.supportsOAuth&&!pt.isAuthenticated){const Qe=await le(_e);if(!Qe){await c.delete.mutateAsync(_e);return}await c.update.mutateAsync({id:_e,data:{title:`${fe} (${Qe})`}})}Y(D,_e),re.success(s("virtualMcp.virtualMcp.newInstanceCreated"))}catch(se){console.error("Failed to create instance:",se),re.error(s("virtualMcp.virtualMcp.failedToCreateInstance"))}},ie=D=>{C({type:"OPEN_SETTINGS",payload:D})},le=async D=>{const{token:te,tokenInfo:se,error:fe}=await Ui({connectionId:D,orgSlug:a.slug,scope:"offline_access"});if(fe||!te)return re.error(s("virtualMcp.virtualMcp.authenticationFailed",{error:fe??""})),null;if(se)try{const Fe=await fetch(`/api/${a.slug}/connections/${D}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:se.accessToken,refreshToken:se.refreshToken,expiresIn:se.expiresIn,scope:se.scope,clientId:se.clientId,clientSecret:se.clientSecret,tokenEndpoint:se.tokenEndpoint})});if(!Fe.ok)console.error("Failed to save OAuth token:",await Fe.text()),await c.update.mutateAsync({id:D,data:{connection_token:te}});else try{await c.update.mutateAsync({id:D,data:{}})}catch(qe){console.warn("Failed to refresh connection tools after OAuth:",qe)}}catch(Fe){console.error("Error saving OAuth token:",Fe),await c.update.mutateAsync({id:D,data:{connection_token:te}})}else await c.update.mutateAsync({id:D,data:{connection_token:te}});const _e=new URL(`/api/${a.slug}/mcp/${D}`,window.location.origin);return await m.invalidateQueries({queryKey:tn.isMCPAuthenticated(_e.href,null)}),re.success(s("virtualMcp.virtualMcp.authenticationSuccessful")),Jr(se,te)},de=()=>{const D=u.getValues("metadata.instructions")??"",te=s("virtualMcp.virtualMcp.promptTemplateContent"),se=D.trim()?`${D}
|
|
4
4
|
|