decocms 4.539.1 → 4.540.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-BJ9qO9gI.js → ActiveShapeUtils-ClFvSa3l.js} +1 -1
- package/dist/client/assets/{AlertCircle-C4AlXfWH.js → AlertCircle-Cxr7gZFk.js} +1 -1
- package/dist/client/assets/{AreaChart-D0lM-INL.js → AreaChart-DgmDRfhz.js} +1 -1
- package/dist/client/assets/{ArrowLeft-wEhmrFT_.js → ArrowLeft-5wkW-hEo.js} +1 -1
- package/dist/client/assets/{ArrowUp-ByoUzoe_.js → ArrowUp-ze_LLfn6.js} +1 -1
- package/dist/client/assets/{BarChart-CeqCYDTf.js → BarChart-Toa6_kFI.js} +1 -1
- package/dist/client/assets/{Building02-FHqo8UFz.js → Building02-D7vWgCSn.js} +1 -1
- package/dist/client/assets/{CartesianChart-Duqhjmhr.js → CartesianChart-DPKynmNL.js} +1 -1
- package/dist/client/assets/{CategoricalChart-CHKVHf-Y.js → CategoricalChart-8cAW3ovr.js} +1 -1
- package/dist/client/assets/{CheckCircle-DvIMPtKQ.js → CheckCircle-Dap6CDoz.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-B4fUuU69.js → ChevronSelectorVertical-BOIt7T3u.js} +1 -1
- package/dist/client/assets/{ChevronUp-BO5R2-Sx.js → ChevronUp-B635wgc1.js} +1 -1
- package/dist/client/assets/{Copy01-j7Nlt5qU.js → Copy01-D5FEj5_l.js} +1 -1
- package/dist/client/assets/{CreditCard01-Cswluz13.js → CreditCard01-CwcYwmjF.js} +1 -1
- package/dist/client/assets/{DotsVertical-CaKzUPHY.js → DotsVertical-BlJdlZxy.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-D10jKELW.js → ErrorBarContext-VBsMY4mL.js} +1 -1
- package/dist/client/assets/{Globe04-BHUGUEw-.js → Globe04-BvpBdv-m.js} +1 -1
- package/dist/client/assets/{Image01-Br2Za8Gz.js → Image01-aiwVgEhl.js} +1 -1
- package/dist/client/assets/{Key01-6xIzri6P.js → Key01-Bxg4WT0j.js} +1 -1
- package/dist/client/assets/{Link01-Dp0vu4Af.js → Link01-CcXDwgg2.js} +1 -1
- package/dist/client/assets/{LinkBroken01-DUZnTa9c.js → LinkBroken01-CAGHvVZ6.js} +1 -1
- package/dist/client/assets/{Minus-8YEgVl9l.js → Minus-Dsn0b7GK.js} +1 -1
- package/dist/client/assets/{Monitor01-x3qJMHxB.js → Monitor01-DKCvSUp5.js} +1 -1
- package/dist/client/assets/{Play-CNerU9Fh.js → Play-vsKk_Jz0.js} +1 -1
- package/dist/client/assets/{Plus-Dd1LZQDu.js → Plus-Bra09L11.js} +1 -1
- package/dist/client/assets/{ReferenceLine-mTbhIHqG.js → ReferenceLine-CaDDFuom.js} +1 -1
- package/dist/client/assets/{SearchMd-huYq_veH.js → SearchMd-CcaPghb6.js} +1 -1
- package/dist/client/assets/{Sector-C8kfjLRy.js → Sector-Dgqo2T4d.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-43aM_SvI.js → ShoppingBag01-CLHHYXzS.js} +1 -1
- package/dist/client/assets/{Sun-CsCFS7Mx.js → Sun-D80Oomy0.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DgO15jXk.js → SwitchHorizontal01-CucWWNd0.js} +1 -1
- package/dist/client/assets/{Tool01-BM_jAXaw.js → Tool01-Btqju7fM.js} +1 -1
- package/dist/client/assets/{Trash01-D_6j6Kjo.js → Trash01-BrSYsLgM.js} +1 -1
- package/dist/client/assets/{Upload01-jTJu_yfb.js → Upload01-DRsgvg8v.js} +1 -1
- package/dist/client/assets/{UserSquare-Cm6nmxmp.js → UserSquare-D2LgcI23.js} +1 -1
- package/dist/client/assets/{Users01-BM-G7vNB.js → Users01-YRcnRYKP.js} +1 -1
- package/dist/client/assets/{XClose-CmsTtHZr.js → XClose-CjCoL-G7.js} +1 -1
- package/dist/client/assets/{ZoomOut-DmiEhPgw.js → ZoomOut-CLslRLDT.js} +1 -1
- package/dist/client/assets/{access-gate-DcyD6s41.js → access-gate-NRvGMpYz.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CI1dfD2M.js → add-connection-dialog-ArB48aBC.js} +1 -1
- package/dist/client/assets/agent-analytics-BcCIFcf5.js +2 -0
- package/dist/client/assets/agent-app-BTGawEAl.js +1 -0
- package/dist/client/assets/agent-assets-BJxi96mC.js +1 -0
- package/dist/client/assets/{agent-automation-CuXnRK7H.js → agent-automation-F4Fj9gGm.js} +2 -2
- package/dist/client/assets/agent-automations-DPdxPC74.js +1 -0
- package/dist/client/assets/agent-calendar-DmZ4-S9J.js +1 -0
- package/dist/client/assets/agent-connect-sources-DiS5leUi.js +1 -0
- package/dist/client/assets/agent-deck-oywJhoOr.js +1 -0
- package/dist/client/assets/agent-e2e-Ckvaovne.js +1 -0
- package/dist/client/assets/agent-experiments-CDSby3Jb.js +1 -0
- package/dist/client/assets/agent-file-Bi6WzPE2.js +1 -0
- package/dist/client/assets/agent-hosting-DwY3IDTG.js +1 -0
- package/dist/client/assets/{agent-icon-8z_1onUt.js → agent-icon-r8Z1kQx0.js} +1 -1
- package/dist/client/assets/agent-library-Bo9r99Ao.js +1 -0
- package/dist/client/assets/agent-library-file-BD-Hx5H6.js +1 -0
- package/dist/client/assets/agent-monitor-B6G8_tf4.js +1 -0
- package/dist/client/assets/agent-overview-BNTC3CuC.js +1 -0
- package/dist/client/assets/agent-releases-B4WDlEVB.js +2 -0
- package/dist/client/assets/agent-settings-DrwNvgfn.js +1 -0
- package/dist/client/assets/{agent-site-editor-BDP7gzxw.js → agent-site-editor-CqKZe72W.js} +2 -2
- package/dist/client/assets/agent-site-editor-code-epc2EIGV.js +2 -0
- package/dist/client/assets/agent-site-editor-content-DErZLUCZ.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-CvNjulHl.js +1 -0
- package/dist/client/assets/agent-view-5PmLTSLw.js +1 -0
- package/dist/client/assets/{agent-view-guard-o5lp5yG3.js → agent-view-guard-2IDv_f14.js} +1 -1
- package/dist/client/assets/agents-list-D0i0UyzK.js +1 -0
- package/dist/client/assets/ai-providers-D42POTOI.js +1 -0
- package/dist/client/assets/{alert-z-BheMxj.js → alert-sh_9lE1j.js} +1 -1
- package/dist/client/assets/{analytics-sections-Cd1hOIgU.js → analytics-sections-DOBmjBqZ.js} +1 -1
- package/dist/client/assets/api-keys-DZ0ezHTq.js +1 -0
- package/dist/client/assets/{api-keys-BNQ_2tij.js → api-keys-E7GGN-1o.js} +1 -1
- package/dist/client/assets/app-editor-BmJSiobK.js +1 -0
- package/dist/client/assets/{asset-utils-KFyox6to.js → asset-utils-BGF2krWn.js} +1 -1
- package/dist/client/assets/{auth-DdsRd0Yn.js → auth-BaCW7whq.js} +1 -1
- package/dist/client/assets/{auth-catchall-D-E9YoBz.js → auth-catchall-WqLBMkpk.js} +1 -1
- package/dist/client/assets/{auth-entry-DxiqEo8u.js → auth-entry-Df4qDDi6.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Duvl3HAX.js → auth-split-layout-QrwyfUaa.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CpC3kbG-.js → authenticate-and-persist-oauth-DVw-HHUy.js} +1 -1
- package/dist/client/assets/{automation-list-row-DFFZOl8x.js → automation-list-row-CdYjXTyX.js} +1 -1
- package/dist/client/assets/{automation-runs-DkFjFhD7.js → automation-runs-Dzosp28H.js} +1 -1
- package/dist/client/assets/{automations-Bl6B_iMH.js → automations-C4dbgmbr.js} +1 -1
- package/dist/client/assets/{autosend-1JuiPy5f.js → autosend-Cyz0grx9.js} +1 -1
- package/dist/client/assets/{badge-DqbVW6aJ.js → badge-DXrGf1RH.js} +1 -1
- package/dist/client/assets/{block-document-BGMTxIjY.js → block-document-DZsMfWjg.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-CvEr9IEf.js → blocks-preview-workspace-context-oDr51QB4.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-BJna5TPX.js → blocks-tab-states-8ODefLbh.js} +1 -1
- package/dist/client/assets/{blog-schema-C2GcnKhl.js → blog-schema--tzgaEDh.js} +1 -1
- package/dist/client/assets/{buckets-Bs1oolpP.js → buckets-D4zl2kA5.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-Hiwx1yva.js → build-improve-prompt-doc-B9gVIbTl.js} +1 -1
- package/dist/client/assets/{calendar-DB-dU0iq.js → calendar-_mtTQBPC.js} +1 -1
- package/dist/client/assets/{capability-load-error-A9LFDt5q.js → capability-load-error-CODEJJ02.js} +1 -1
- package/dist/client/assets/category-editor-BLrXoVj7.js +1 -0
- package/dist/client/assets/{cdn-tab-D-hvfWSy.js → cdn-tab-CYZVXn7M.js} +1 -1
- package/dist/client/assets/{chart-Ql3qHXBS.js → chart-DciC8HyE.js} +1 -1
- package/dist/client/assets/{chat-context-BO-O8zYY.js → chat-context-q7TqJ1C-.js} +6 -6
- package/dist/client/assets/{chat-draft-CL98S7Qa.js → chat-draft-DA1-_rtX.js} +1 -1
- package/dist/client/assets/{checkbox-uTwuXUyB.js → checkbox-oUIybZae.js} +1 -1
- package/dist/client/assets/{choose-editor-CRlyItk_.js → choose-editor-CN33p2Cz.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DqN9LCSz.js → cli-auth-success-XAbb0SQg.js} +1 -1
- package/dist/client/assets/{client-icons-CwC1mMuq.js → client-icons-Ct-9O-sI.js} +1 -1
- package/dist/client/assets/cms-settings-editor-DB-2MJgt.js +1 -0
- package/dist/client/assets/{collapsible-CT1Srvnc.js → collapsible-CF6QTwAQ.js} +1 -1
- package/dist/client/assets/collection-detail-QFm_ohuF.js +1 -0
- package/dist/client/assets/{collection-display-button-CTgwXGtH.js → collection-display-button-DtZ_r2fC.js} +1 -1
- package/dist/client/assets/{collection-search-CA6Hdd1a.js → collection-search-cs3sNNIu.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-C43OwwrW.js → collection-table-wrapper-BvylNn6r.js} +1 -1
- package/dist/client/assets/{collection-tabs-Cx2RUmMM.js → collection-tabs-CS3-Zvq6.js} +1 -1
- package/dist/client/assets/{column-rules-Dya8Th1r.js → column-rules-B3scTGJn.js} +2 -2
- package/dist/client/assets/{combobox-YcuTN2Gw.js → combobox-CpjBTDRG.js} +1 -1
- package/dist/client/assets/{command-DQVIGVkX.js → command-ChermTHn.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-XznG9VE1.js → companion-mcps-section-bNAA5L8t.js} +1 -1
- package/dist/client/assets/{config-DkilocE4.js → config-D9RpcTcN.js} +1 -1
- package/dist/client/assets/{connect-CI39dz40.js → connect-BEDMehlu.js} +3 -3
- package/dist/client/assets/{connect-layout-Bg2f7P8T.js → connect-layout-DLeNmrtI.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-Ba4R-hS5.js → connect-source-dialog-wF7gjtEV.js} +1 -1
- package/dist/client/assets/{connection-card-jeshm-mM.js → connection-card-BJPC2LD1.js} +1 -1
- package/dist/client/assets/{connection-detail-Mo5F_dC5.js → connection-detail-BQIiIdK2.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DkuRKDLQ.js → connection-form-helpers-9iSTOC_0.js} +1 -1
- package/dist/client/assets/{connection-DB5qkIky.js → connection-lIRd-x5L.js} +1 -1
- package/dist/client/assets/{connections-DasGGdy8.js → connections-omwMleY5.js} +1 -1
- package/dist/client/assets/{content-tab-BWJhs-ed.js → content-tab-CMOs3pI-.js} +3 -3
- package/dist/client/assets/context-BPegQD0y.js +1 -0
- package/dist/client/assets/{context-menu-DE0O1IAD.js → context-menu-BjIhJNTh.js} +1 -1
- package/dist/client/assets/{context-shell-wfjVQB-Y.js → context-shell-OvxUfcFS.js} +3 -3
- package/dist/client/assets/{core.esm-_OwE5Bvr.js → core.esm-pg4Fq_TB.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DHLVl8iy.js → create-organization-dialog-Cvs1ExBM.js} +1 -1
- package/dist/client/assets/{daily-pulse-DlMtS_Ie.js → daily-pulse-CBbiZh0k.js} +1 -1
- package/dist/client/assets/discover-CA-2TqxK.js +1 -0
- package/dist/client/assets/{domain-settings-SeQfe-5v.js → domain-settings-C-gJGQ4j.js} +1 -1
- package/dist/client/assets/{drawer-DZlLGfvX.js → drawer-Bqg0yBDx.js} +1 -1
- package/dist/client/assets/{editor-classes-DgMjj3Ei.js → editor-classes-BpwwAF3C.js} +1 -1
- package/dist/client/assets/{editor-D84lw5XU.js → editor-mPZ0kVNv.js} +1 -1
- package/dist/client/assets/{empty-state-YnMyEE1u.js → empty-state-B9oIyVIp.js} +1 -1
- package/dist/client/assets/{empty-state-C1-6oKUX.js → empty-state-C79vgg_z.js} +1 -1
- package/dist/client/assets/{experiments-tab-CXflHBtw.js → experiments-tab-DPfc6GOy.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-BAGkDSHi.js → experiments-tab-choice-8xzKkZlX.js} +1 -1
- package/dist/client/assets/{extract-connection-data-3P1lh0vb.js → extract-connection-data-D9hWJKHz.js} +1 -1
- package/dist/client/assets/feature-gate-BtqZg2be.js +1 -0
- package/dist/client/assets/feature-paywall-D6hFCms_.js +1 -0
- package/dist/client/assets/file-explorer-EUveJAIL.js +2 -0
- package/dist/client/assets/{file-preview-B-sfAHHw.js → file-preview-B1hazn-f.js} +1 -1
- package/dist/client/assets/{file-share-button-B9Fb7DUQ.js → file-share-button-CWVL8de8.js} +1 -1
- package/dist/client/assets/{file-type-icon-C7xJ53He.js → file-type-icon-CszJOHRP.js} +1 -1
- package/dist/client/assets/{folder-icon-DkGrMgcn.js → folder-icon-BrFOzh35.js} +1 -1
- package/dist/client/assets/{form-CUFiE9T-.js → form-CpJsHKNZ.js} +1 -1
- package/dist/client/assets/{general-DpIis4vv.js → general-CQlaDytM.js} +1 -1
- package/dist/client/assets/github-icon-CtxsZ4zj.js +1 -0
- package/dist/client/assets/{held-block-view-U1nzFK54.js → held-block-view-CqquZXR8.js} +3 -3
- package/dist/client/assets/home-xrjnwP6i.js +1 -0
- package/dist/client/assets/{hosted-publish-feedback-Bh1VecP7.js → hosted-publish-feedback-CutWUEfr.js} +1 -1
- package/dist/client/assets/{icon-button-BxmZsAbq.js → icon-button-i_FWnpGN.js} +1 -1
- package/dist/client/assets/index-BMsnE8rU.js +4 -0
- package/dist/client/assets/{index-Cmk_c0mj.js → index-Bb3_Vv2S.js} +1 -1
- package/dist/client/assets/{index-zmKCzDkw.js → index-BdKCEpsg.js} +1 -1
- package/dist/client/assets/{index-mxLhZjJM.js → index-Bm91KVNh.js} +1 -1
- package/dist/client/assets/index-Bwvnt-S2.js +4 -0
- package/dist/client/assets/index-By_-wb1N.css +1 -0
- package/dist/client/assets/{index-DJ1OawZD.js → index-COnziA0Z.js} +41 -41
- package/dist/client/assets/{index-CHgXf2G3.js → index-CUvxA4QU.js} +1 -1
- package/dist/client/assets/{index-CsjIwzuX.js → index-CVG6lJ_v.js} +1 -1
- package/dist/client/assets/{index-Kig1FnrG.js → index-CmmBgJe2.js} +2 -2
- package/dist/client/assets/index-Dpy3WDHU.js +1 -0
- package/dist/client/assets/{index-DNmjdGkM.js → index-Du1V-xNi.js} +1 -1
- package/dist/client/assets/{index-DN5yNDF8.js → index-Duw_6D72.js} +1 -1
- package/dist/client/assets/{index-Dvnk0CSj.js → index-N3lvHn2Z.js} +1 -1
- package/dist/client/assets/{index-DNJBArc-.js → index-_xgP5c6W.js} +1 -1
- package/dist/client/assets/{index-redirect-D6XbqgNM.js → index-redirect-CWUepeSE.js} +1 -1
- package/dist/client/assets/{index-Lk-lDKnf.js → index-yKC5LgkM.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-L6rGGtyF.js → infiniteQueryObserver-Bj3tjA3X.js} +1 -1
- package/dist/client/assets/{infra-billing-CghGhArE.js → infra-billing-CeYZXwq2.js} +1 -1
- package/dist/client/assets/{input-BHvfdat6.js → input-BCYkWTfH.js} +3 -3
- package/dist/client/assets/{input-CpaVmyCl.js → input-C2ECoWjM.js} +1 -1
- package/dist/client/assets/{integration-icon-vdbLoXVP.js → integration-icon-DfwU4DVr.js} +1 -1
- package/dist/client/assets/{jira-icon-Bts6CCIP.js → jira-icon-BoR-oDVU.js} +1 -1
- package/dist/client/assets/{label-DIWSyY3V.js → label-BGevM5Zb.js} +1 -1
- package/dist/client/assets/{layout-BA2GykJG.js → layout-30w4Crds.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-VydePbjy.js → legacy-agents-deep-Bg1OmBvu.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-C7tJtw4a.js → legacy-main-redirect-C51h-pXK.js} +1 -1
- package/dist/client/assets/library-b-ntlbXh.js +1 -0
- package/dist/client/assets/{login-BouZ4qsB.js → login-BGcTYLxc.js} +1 -1
- package/dist/client/assets/{markdown-NzM3VJeN.js → markdown-DGqjdf2p.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-C3v_vbrd.js → mcp-app-renderer-CPV0UyxX.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DAaJvMdM.js → mcp-oauth-Byx9hV1d.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BYVXm7Cw.js → mcp-oauth-we2DqBn9.js} +1 -1
- package/dist/client/assets/{members-CyitmSww.js → members-Cg4UJ7N1.js} +1 -1
- package/dist/client/assets/{memory-CRIsTy-N.js → memory-CphWYQkc.js} +1 -1
- package/dist/client/assets/{mini-report-page-Df8ZVYUM.js → mini-report-page-O_faAMnc.js} +1 -1
- package/dist/client/assets/{mock-board-DJgNd81n.js → mock-board-CQktgxk_.js} +4 -4
- package/dist/client/assets/{monaco-editor-CsctCosL.js → monaco-editor-CS14LLrn.js} +1 -1
- package/dist/client/assets/monitoring-C3Ch6Teo.js +1 -0
- package/dist/client/assets/{monitoring-stats-row-BDQi5oLA.js → monitoring-stats-row--haENI5d.js} +1 -1
- package/dist/client/assets/{multi-select-CEo_kLmg.js → multi-select-B-zuXpH9.js} +1 -1
- package/dist/client/assets/{mustache-ClLytoM5.js → mustache-CQoqMaLT.js} +1 -1
- package/dist/client/assets/{named-rule-uses-ewshkS_W.js → named-rule-uses-BFiLyzQ0.js} +1 -1
- package/dist/client/assets/{new-project-dialog-Dbr37SLy.js → new-project-dialog-aU8scugU.js} +1 -1
- package/dist/client/assets/{oauth-callback-DmmDKWte.js → oauth-callback-DKy_B6sS.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BVh0_wge.js → oauth-callback-ai-provider-B1IhX-iu.js} +1 -1
- package/dist/client/assets/{onboarding-BB704NvI.js → onboarding-BJKtDuRG.js} +1 -1
- package/dist/client/assets/openai-conversation-BZT74_io.js +3 -0
- package/dist/client/assets/{optimistic-project-sidebar-views-Dn7Pz8bp.js → optimistic-project-sidebar-views-ynymb8s7.js} +1 -1
- package/dist/client/assets/{order-monitor-day-BMdD8bDK.js → order-monitor-day-DWL08pAX.js} +1 -1
- package/dist/client/assets/{organization-choice-CPEZQ_1p.js → organization-choice-DUcNXaGm.js} +1 -1
- package/dist/client/assets/{orgs-COOW2jxX.js → orgs-H9UBPKXM.js} +1 -1
- package/dist/client/assets/{page-seo-form-0qBzOf00.js → page-seo-form-DO9Vic5L.js} +1 -1
- package/dist/client/assets/{pair-RX9az_cH.js → pair-BIX6BY2B.js} +1 -1
- package/dist/client/assets/{parse-sections-BGFjtwI9.js → parse-sections-BLo4hVcc.js} +1 -1
- package/dist/client/assets/plan-DKLSpJYQ.js +1 -0
- package/dist/client/assets/plan-ladder-CjIFfgE3.js +1 -0
- package/dist/client/assets/plan-usage-card-BaLOCqds.js +6 -0
- package/dist/client/assets/{popover-Cn1OW4zx.js → popover-CDni3562.js} +1 -1
- package/dist/client/assets/post-calendar-Ds_fWL4E.js +1 -0
- package/dist/client/assets/{post-editor-DO2FeUc4.js → post-editor-Bpl8R1AD.js} +2 -2
- package/dist/client/assets/{preview-content-BY9XqHdY.js → preview-content-D6Uu7-0I.js} +1 -1
- package/dist/client/assets/{preview-dialog-5T4OQ5N2.js → preview-dialog-BirKakH8.js} +1 -1
- package/dist/client/assets/{preview-panel-Co9xo5DN.js → preview-panel-pMNaSC76.js} +1 -1
- package/dist/client/assets/preview-tab-86IcFjhE.js +551 -0
- package/dist/client/assets/{product-picker-dialog-v6iixvmA.js → product-picker-dialog-QF0K31fY.js} +1 -1
- package/dist/client/assets/{profile-DudFEHJf.js → profile-CeSI4XH9.js} +1 -1
- package/dist/client/assets/project-app-view-D0bkuBLc.js +1 -0
- package/dist/client/assets/{project-apps-CtRCYs2z.js → project-apps-lRXyFM1r.js} +1 -1
- package/dist/client/assets/project-feed-WkJFdN5v.js +1 -0
- package/dist/client/assets/{project-icon-D-mQ9iWl.js → project-icon-BjJ8vKrn.js} +1 -1
- package/dist/client/assets/project-reports-W6KiESHB.js +1 -0
- package/dist/client/assets/project-tasks-CH9CIFPr.js +1 -0
- package/dist/client/assets/projects-BTP5sS_F.js +1 -0
- package/dist/client/assets/{projects-empty-state-fQGzsUDa.js → projects-empty-state-BfLeCdxn.js} +1 -1
- package/dist/client/assets/{prompts-DihlgOG2.js → prompts-CEZb6CxD.js} +1 -1
- package/dist/client/assets/record-editor-BMrHZfpJ.js +1 -0
- package/dist/client/assets/redirect-editor-BF11laHA.js +1 -0
- package/dist/client/assets/{releases-api-CenoMthy.js → releases-api-ByaSp1jR.js} +1 -1
- package/dist/client/assets/reports-C5TYz7EY.js +1 -0
- package/dist/client/assets/{reports-DQCKA5NS.js → reports-U2_3nuZM.js} +1 -1
- package/dist/client/assets/{reports-onboarding-CPlrFSny.js → reports-onboarding-Bruf-fyJ.js} +1 -1
- package/dist/client/assets/reports-tab-Da3H-8PE.js +2 -0
- package/dist/client/assets/repositories-CpQ7e-w5.js +1 -0
- package/dist/client/assets/repositories-hb3vgifj.js +1 -0
- package/dist/client/assets/{repository-binding-BItepy-z.js → repository-binding-BGeZ0DuT.js} +1 -1
- package/dist/client/assets/{repository-import-picker-UUcvjgba.js → repository-import-picker-_KegTBCz.js} +1 -1
- package/dist/client/assets/repository-picker-CU40xoJ7.js +1 -0
- package/dist/client/assets/{require-capability-B3LM64w7.js → require-capability-B4rUwk-N.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Cx9a6Ts4.js → required-auth-layout-C2OmldxX.js} +1 -1
- package/dist/client/assets/{reset-password-BbOpXCMQ.js → reset-password-DcH680r3.js} +1 -1
- package/dist/client/assets/{resizable-DcjZRINV.js → resizable-GdeSoBXC.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-EdGN1ce5.js → resolve-tab-icon-DyiyXAmc.js} +1 -1
- package/dist/client/assets/review-settings-DWVxOdsw.js +1 -0
- package/dist/client/assets/{roles-Ba3H4RBr.js → roles-tNHszeml.js} +1 -1
- package/dist/client/assets/route-BYeuiauO.js +1 -0
- package/dist/client/assets/route-B_J7kzlG.js +1 -0
- package/dist/client/assets/route-C-s8klhs.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-C9HSR4z4.js → sandbox-lifecycle-context-D2UA9HUf.js} +1 -1
- package/dist/client/assets/{schema-Db1omEtk.js → schema-BYBruCaH.js} +1 -1
- package/dist/client/assets/{schema-C6DRY3bO.js → schema-CB4Vxu7L.js} +1 -1
- package/dist/client/assets/{scroll-area-DuhcsVwv.js → scroll-area-BUyfS5TA.js} +1 -1
- package/dist/client/assets/{search-input-BD_zzwAH.js → search-input-T7tfUlv8.js} +1 -1
- package/dist/client/assets/{search-toggle-DI1P1fkR.js → search-toggle-DL7-awnb.js} +1 -1
- package/dist/client/assets/{secret-picker-D4NRcsNL.js → secret-picker-BslDVKKv.js} +1 -1
- package/dist/client/assets/{secrets-Y-mIp1nG.js → secrets-Bqd4jPVf.js} +1 -1
- package/dist/client/assets/{section-array-field-Dx2cyr46.js → section-array-field-BWV4uW6Z.js} +1 -1
- package/dist/client/assets/sections-editor-DfuqBfpL.js +1 -0
- package/dist/client/assets/{sections-Bfbs4u2V.js → sections-q5OYq_j5.js} +1 -1
- package/dist/client/assets/{select-D9aSCbjE.js → select-BaNSHFfS.js} +1 -1
- package/dist/client/assets/{select-model-D3_W3xk0.js → select-model-DvLnkRjD.js} +1 -1
- package/dist/client/assets/seo-editor-kIki17wn.js +1 -0
- package/dist/client/assets/{separator-YTO60A4h.js → separator-D-a0pq5E.js} +1 -1
- package/dist/client/assets/settings-tab-D43TggxT.js +1 -0
- package/dist/client/assets/{sheet-jVe6rN26.js → sheet-DvSGxi5a.js} +1 -1
- package/dist/client/assets/{shell-layout-BQMms4WU.js → shell-layout-Dbb1xZ69.js} +1 -1
- package/dist/client/assets/{site-draft-actions-D47qJfS1.js → site-draft-actions-Cy4yCAlU.js} +1 -1
- package/dist/client/assets/{site-draft-view-CWkbNueZ.js → site-draft-view-C07YNlzV.js} +2 -2
- package/dist/client/assets/site-editor-Do8tzkEW.js +1 -0
- package/dist/client/assets/{site-editor-toast-CRMACk2O.js → site-editor-toast-CH9jUz3L.js} +1 -1
- package/dist/client/assets/{skills-CfT_g3p1.js → skills-DguxwEpq.js} +1 -1
- package/dist/client/assets/{slider-CRrDbpPf.js → slider-eIUNwmro.js} +1 -1
- package/dist/client/assets/{sortable.esm-Ci2IW7RC.js → sortable.esm-ChXVP1eQ.js} +1 -1
- package/dist/client/assets/{sso-Dm6OBcmB.js → sso-DdFStQXx.js} +1 -1
- package/dist/client/assets/{suggestion-D2M-2UXV.js → suggestion-s4BFDhSc.js} +2 -2
- package/dist/client/assets/{switch-CVdtqclr.js → switch-C0t-igJf.js} +1 -1
- package/dist/client/assets/{symbol-BkSYJGaa.js → symbol-BT27QHWj.js} +1 -1
- package/dist/client/assets/synced-repos-CqoJDfXB.js +1 -0
- package/dist/client/assets/{tab-icon-glyph-DWV4jizV.js → tab-icon-glyph-BWPb5Xfp.js} +1 -1
- package/dist/client/assets/{table-scnpQL_A.js → table-KCysjL80.js} +1 -1
- package/dist/client/assets/{tabs-CZmTm0b_.js → tabs-CoLoYhlT.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-D0kQ17F0.js → task-assignee-avatar-DAh0DA3d.js} +1 -1
- package/dist/client/assets/{task-board-uliYMpMh.js → task-board-CrNZ__0e.js} +1 -1
- package/dist/client/assets/{task-route-97n4qXAz.js → task-route-DKvZDUIz.js} +1 -1
- package/dist/client/assets/{task-status-BIbfLs-o.js → task-status-Ra7_uhYM.js} +1 -1
- package/dist/client/assets/taskboard-analytics-Cym7TppR.js +1 -0
- package/dist/client/assets/{tasks-Dw6mfGSg.js → tasks-CUiZakj6.js} +3 -3
- package/dist/client/assets/tasks-ChcFyM82.js +1 -0
- package/dist/client/assets/{textarea-CxbswNZX.js → textarea-C_fBPqU6.js} +1 -1
- package/dist/client/assets/thread-analytics-D22kre4r.js +1 -0
- package/dist/client/assets/{thread-intent-BpcQdr2N.js → thread-intent-4tNJ-MPs.js} +1 -1
- package/dist/client/assets/{thread-route-lJ46mBb6.js → thread-route-Bnw3gplh.js} +1 -1
- package/dist/client/assets/thread-route-DJDdAJyj.js +1 -0
- package/dist/client/assets/{thread-sheet-body-Cy2tgF2j.js → thread-sheet-body-BwIWxLs3.js} +1 -1
- package/dist/client/assets/{time-range-picker-DfZ9Y4gp.js → time-range-picker-DXIxiKEP.js} +1 -1
- package/dist/client/assets/{toggle-group-DJ6VL3oV.js → toggle-group-ythhcZKM.js} +1 -1
- package/dist/client/assets/{tool-namespace-D7Fdjyab.js → tool-namespace-BTv6Xybs.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-B0kxSi5C.js → toolbar-icon-button-dgGE6Jet.js} +1 -1
- package/dist/client/assets/{tooltip-Bbs97viR.js → tooltip-D8ZXcwhe.js} +1 -1
- package/dist/client/assets/{tooltipContext-CrwtbrM3.js → tooltipContext-DziaRNob.js} +1 -1
- package/dist/client/assets/{track-Dko_RRUu.js → track-D30a8sx3.js} +1 -1
- package/dist/client/assets/{types-D2I0j8gC.js → types-CofNWIMh.js} +1 -1
- package/dist/client/assets/{url-slug-BW4Qp5zi.js → url-slug-se91w2Rf.js} +1 -1
- package/dist/client/assets/{usage-stats-CBq4yPWo.js → usage-stats-B8cFnQJA.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BIcA-ltu.js → use-ai-providers-DTLn4WND.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-BxQGBMDb.js → use-apply-named-rule-HLQawGs9.js} +1 -1
- package/dist/client/assets/{use-automations-B4JLlxTN.js → use-automations-BgkyRpI7.js} +1 -1
- package/dist/client/assets/{use-autosave-Czc6bfK5.js → use-autosave-Bdhhmkhm.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-mgi-uN0U.js → use-chat-layout-state-DNSQAhNn.js} +1 -1
- package/dist/client/assets/{use-clock-tick-i4_RgreD.js → use-clock-tick-CRkdqRFq.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-DJMiXAXQ.js → use-cms-publish-actions-ijHf3SXF.js} +1 -1
- package/dist/client/assets/{use-connect-companion-B0DGoIM8.js → use-connect-companion-CrnfY-x7.js} +1 -1
- package/dist/client/assets/{use-connection-BqqPyNtq.js → use-connection-BOMkN6q_.js} +1 -1
- package/dist/client/assets/{use-copy-BYz3Xa4M.js → use-copy-D-ZLjAxF.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DB7KfmQO.js → use-create-virtual-mcp-BTQTbo6V.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-a0B0hAGx.js → use-date-fns-locale-B5UxfCyN.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-EUU71WFf.js → use-debounced-autosave-CSj5KwPH.js} +1 -1
- package/dist/client/assets/{use-debounced-value-gF2MCEqA.js → use-debounced-value-tZ4DXPdN.js} +1 -1
- package/dist/client/assets/{use-deco-credits-COz15zhz.js → use-deco-credits-C0z_exCV.js} +1 -1
- package/dist/client/assets/use-decopilot-events-CsyvAJLs.js +1 -0
- package/dist/client/assets/{use-delete-connection-Bcwg0d7W.js → use-delete-connection-fTuP_lVU.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BC77P2O5.js → use-deployment-admin-_9kJl1R4.js} +1 -1
- package/dist/client/assets/use-entitlements-Bek8GQfU.js +1 -0
- package/dist/client/assets/{use-fast-preview-draft-url-B3drK4IO.js → use-fast-preview-draft-url-TbXAala5.js} +1 -1
- package/dist/client/assets/{use-file-configs-DB5ttYh8.js → use-file-configs-BPOIBiEJ.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-C4dOeIYY.js → use-inbox-feed-CEGPGrQS.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-mA69WX3j.js → use-infinite-scroll-BK7m1Rbc.js} +1 -1
- package/dist/client/assets/use-join-requests-DSY52QIf.js +1 -0
- package/dist/client/assets/{use-main-panel-tabs-Bo5Ijiet.js → use-main-panel-tabs-DKwC6O2O.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DSTS5c2y.js → use-mcp-auth-status-DZTmNHLl.js} +1 -1
- package/dist/client/assets/{use-mcp-client-AOCIses4.js → use-mcp-client-CNQ2UmVO.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DB4BDCUk.js → use-mcp-prompts-DDgSZA70.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-XusMthB1.js → use-mcp-tools-F7OlrZvj.js} +1 -1
- package/dist/client/assets/{use-mobile-Dqpuq5pP.js → use-mobile-DccFwPqc.js} +1 -1
- package/dist/client/assets/{use-move-blocks-B_53l5Fl.js → use-move-blocks-ClZ1itdH.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BGSn17g4.js → use-navigate-to-agent-D_4FOoK_.js} +1 -1
- package/dist/client/assets/{use-org-fs-Bkdq3N3W.js → use-org-fs-DlkRCXe3.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-C0DcFw22.js → use-org-repo-syncs-Cr5sGILp.js} +1 -1
- package/dist/client/assets/{use-org-sso-B27z5H2P.js → use-org-sso-_0yCR_2x.js} +1 -1
- package/dist/client/assets/{use-organization-roles-B4rnH-Pw.js → use-organization-roles-DjEiTO-o.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DeGpDV0v.js → use-organization-settings-DApKHEhs.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-gymQhz_L.js → use-panel-navigate-DEzceHY3.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-D5k1m39W.js → use-project-native-view-presence-CzFo9pRQ.js} +1 -1
- package/dist/client/assets/{use-project-scope-C7QHVYKL.js → use-project-scope-DlZ3hr3v.js} +1 -1
- package/dist/client/assets/{use-recent-apps-Dz5SjsFx.js → use-recent-apps-BJGzapK6.js} +1 -1
- package/dist/client/assets/{use-releases-Bir66W5G.js → use-releases-CRrtlof1.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-BrEWn_dC.js → use-reports-diagnostic-kKOlKnuD.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-CRF_nrNL.js → use-sandbox-events-CBidgN1S.js} +1 -1
- package/dist/client/assets/{use-secrets-2iLsYUpd.js → use-secrets-CF7cOK-X.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-C0DFb7bg.js → use-section-preview-base-aV2rnRKl.js} +1 -1
- package/dist/client/assets/{use-session-runtime-GUnVOwvr.js → use-session-runtime-DAUgnVml.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-wg8O55qL.js → use-sidebar-collapsed-BWB98fPF.js} +1 -1
- package/dist/client/assets/{use-tags-Bga9AsV7.js → use-tags-C9Y_8zUq.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-CEMolBgL.js → use-task-board-analytics-D0U09TNC.js} +1 -1
- package/dist/client/assets/{use-task-board-events-CiG9lMT9.js → use-task-board-events-BnMcxz87.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BHTOHD6q.js → use-task-board-item-prs-Cm4keV8Q.js} +1 -1
- package/dist/client/assets/{use-task-metadata-dSdCiTPt.js → use-task-metadata-OcqiZ2kJ.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-BtYY_jfu.js → use-thread-analytics-DCAQaEKg.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-oiVigsJg.js → use-thread-outputs-ozdLQUlC.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CyMRSsxy.js +1 -0
- package/dist/client/assets/{useQueries-C2a_0Bnz.js → useQueries-TfPC02wF.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CwcJeHZI.js +1 -0
- package/dist/client/assets/{users-wBVSNRmN.js → users-CM3rnXWW.js} +1 -1
- package/dist/client/assets/{utils-Dg8Zqgfy.js → utils-CsFkMYtG.js} +1 -1
- package/dist/client/assets/{variant-calendar-BDtfwTgy.js → variant-calendar-CZfhcIKG.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-Bu7hp_M-.js → variant-matcher-override-CbINPKEm.js} +1 -1
- package/dist/client/assets/{view-header-C48Sd4vf.js → view-header-CZ36cUo3.js} +1 -1
- package/dist/client/assets/{virtual-mcp-K5pw5xn_.js → virtual-mcp-C73-2MCU.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-B6QIPvpK.js → watch-sse-pool-CbGDmnzl.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-analytics-BakBmdxQ.js +0 -2
- package/dist/client/assets/agent-app-T1PV_xXy.js +0 -1
- package/dist/client/assets/agent-assets--izQQNW3.js +0 -1
- package/dist/client/assets/agent-automations-BogwQqUc.js +0 -1
- package/dist/client/assets/agent-calendar-DHMMzWhJ.js +0 -1
- package/dist/client/assets/agent-connect-sources-BWtdedfw.js +0 -1
- package/dist/client/assets/agent-deck-KrgJXSfz.js +0 -1
- package/dist/client/assets/agent-e2e-4tHipcwc.js +0 -1
- package/dist/client/assets/agent-experiments-DJOTUinX.js +0 -1
- package/dist/client/assets/agent-file-D5CxFLwK.js +0 -1
- package/dist/client/assets/agent-hosting-Czt81-Ye.js +0 -1
- package/dist/client/assets/agent-library-D8SOiv1z.js +0 -1
- package/dist/client/assets/agent-library-file-CTq0zU4q.js +0 -1
- package/dist/client/assets/agent-monitor-QrWGS73P.js +0 -1
- package/dist/client/assets/agent-overview-CdhSAegd.js +0 -1
- package/dist/client/assets/agent-releases-CqbTcytr.js +0 -2
- package/dist/client/assets/agent-settings-C_bxphLA.js +0 -1
- package/dist/client/assets/agent-site-editor-code-Bufm1RMf.js +0 -2
- package/dist/client/assets/agent-site-editor-content-CBMb0_OQ.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-DSxFq0UE.js +0 -1
- package/dist/client/assets/agent-view-E1C7o8nR.js +0 -1
- package/dist/client/assets/agents-list-JX2yrQuU.js +0 -1
- package/dist/client/assets/ai-providers-DDfKxq2r.js +0 -6
- package/dist/client/assets/api-keys-D912gOT_.js +0 -1
- package/dist/client/assets/app-editor-BugTmbR6.js +0 -1
- package/dist/client/assets/category-editor-iMDNmhnX.js +0 -1
- package/dist/client/assets/cms-settings-editor-CPMIzDbm.js +0 -1
- package/dist/client/assets/collection-detail-N6MIa8jY.js +0 -1
- package/dist/client/assets/context-DzhACwZY.js +0 -1
- package/dist/client/assets/discover-dg7L59oL.js +0 -1
- package/dist/client/assets/feature-gate-fjNvm9sG.js +0 -1
- package/dist/client/assets/feature-paywall-CPUVIokY.js +0 -1
- package/dist/client/assets/file-explorer-CgWaK9E0.js +0 -2
- package/dist/client/assets/home-B-uuqedy.js +0 -1
- package/dist/client/assets/index-BhRFpSKm.js +0 -4
- package/dist/client/assets/index-Ct4tGK2o.css +0 -1
- package/dist/client/assets/index-js1r4MSM.js +0 -1
- package/dist/client/assets/index-wL6XR1W9.js +0 -4
- package/dist/client/assets/library-BZQzptxa.js +0 -1
- package/dist/client/assets/monitoring-D1uxvdzN.js +0 -1
- package/dist/client/assets/openai-conversation-BHKm-jmv.js +0 -3
- package/dist/client/assets/plan-CuLJtRi2.js +0 -1
- package/dist/client/assets/plan-ladder-DoZqyTmO.js +0 -1
- package/dist/client/assets/post-calendar-CQMQpXDl.js +0 -1
- package/dist/client/assets/preview-tab-Dk_Nbdcf.js +0 -551
- package/dist/client/assets/project-app-view-BSWik4ac.js +0 -1
- package/dist/client/assets/project-feed-D_L82rla.js +0 -1
- package/dist/client/assets/project-reports-BTGcQQsT.js +0 -1
- package/dist/client/assets/project-tasks-BN5ETFPb.js +0 -1
- package/dist/client/assets/projects-VtUjwukT.js +0 -1
- package/dist/client/assets/record-editor-MDcoFLGt.js +0 -1
- package/dist/client/assets/redirect-editor-Dbvt6k9r.js +0 -1
- package/dist/client/assets/reports-CfCdDbpl.js +0 -1
- package/dist/client/assets/reports-tab-g0FOO0ev.js +0 -2
- package/dist/client/assets/repositories-BdFi2agG.js +0 -1
- package/dist/client/assets/repositories-CXFEVMLy.js +0 -1
- package/dist/client/assets/repository-picker-DGSuy8Qj.js +0 -1
- package/dist/client/assets/review-settings-tk3z5ltO.js +0 -1
- package/dist/client/assets/route-BD2enMqQ.js +0 -1
- package/dist/client/assets/route-Cqlv51TY.js +0 -1
- package/dist/client/assets/route-CtMkt-W1.js +0 -1
- package/dist/client/assets/sections-editor-CMYyrkAw.js +0 -1
- package/dist/client/assets/seo-editor-BSLaaASc.js +0 -1
- package/dist/client/assets/settings-tab-NMe2C0fr.js +0 -1
- package/dist/client/assets/site-editor-kolDQyzi.js +0 -1
- package/dist/client/assets/synced-repos-BpnE8VHS.js +0 -1
- package/dist/client/assets/taskboard-analytics-B6k3fzc7.js +0 -1
- package/dist/client/assets/tasks-Dr846NFl.js +0 -1
- package/dist/client/assets/thread-analytics-Dyf_XwAx.js +0 -1
- package/dist/client/assets/thread-route-DD_j5hX8.js +0 -1
- package/dist/client/assets/use-decopilot-events-Cf_7qBPp.js +0 -1
- package/dist/client/assets/use-join-requests-SS5NFD1V.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BRUBBHZd.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BzvYe2de.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as L,a4 as A,aX as re,l as O,j as l,M as ae,r as B,b as $,t as z,h as H,w as U,x as V,v as X,D as Y,d as Q,C as G,aY as ne,B as W}from"./index-DJ1OawZD.js";import{n as oe}from"./ArrowUp-ByoUzoe_.js";import{d as ie,b as Z,f as ce,u as de,T as me,A as ue,j as fe,k as pe,c as xe,m as ge,n as he,p as be,L as je}from"./chat-context-BO-O8zYY.js";import{s as ye,g as J,d as ve}from"./tool-namespace-D7Fdjyab.js";import{b as F,T as we,a as Ne,c as Ce}from"./tooltip-Bbs97viR.js";import{d as Se,b as Te,a as Pe,D as ke}from"./drawer-DZlLGfvX.js";import{C as Ee}from"./collection-search-CA6Hdd1a.js";import{u as De}from"./use-mobile-Dqpuq5pP.js";import{u as Me}from"./use-mcp-client-AOCIses4.js";import{u as _e,g as Ie}from"./use-mcp-prompts-DB4BDCUk.js";import{c as Le,P as Be}from"./usage-stats-CBq4yPWo.js";import{T as Oe,c as Re,b as $e,d as Ae,H as Fe}from"./input-BHvfdat6.js";import{u as ze,a as He,S as Ge,M as q}from"./pair-RX9az_cH.js";import{a as qe}from"./use-panel-navigate-gymQhz_L.js";import{u as Ke}from"./thread-intent-BpcQdr2N.js";import{N as Ue}from"./index-BhRFpSKm.js";import{i as Ve}from"./LinkBroken01-DUZnTa9c.js";import{e as ee}from"./agent-icon-8z_1onUt.js";import{e as Xe}from"./use-decopilot-events-Cf_7qBPp.js";import{u as Ye}from"./use-deco-credits-COz15zhz.js";import{F as Qe}from"./feature-paywall-CPUVIokY.js";import{i as We}from"./AlertCircle-C4AlXfWH.js";const K=3,te="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",Ze="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function se(t){const e=L.c(46),{item:r,onSelect:a,isLoading:s,isDisabled:n,variant:d}=t,o=d===void 0?"pill":d,{prompt:i}=r;let m;if(e[0]!==i._meta||e[1]!==i.name||e[2]!==i.title){const P=J(i._meta);m=i.title??ve(i.name,P),e[0]=i._meta,e[1]=i.name,e[2]=i.title,e[3]=m}else m=e[3];const c=m,f=i.description||null;if(o==="card"){let P;e[4]!==a||e[5]!==i?(P=()=>a(i),e[4]=a,e[5]=i,e[6]=P):P=e[6];const M=n||s,_=s&&"bg-accent/40",k=(n||s)&&"cursor-not-allowed opacity-50";let E;e[7]!==_||e[8]!==k?(E=O(Ze,"hover:bg-accent text-foreground",_,k),e[7]=_,e[8]=k,e[9]=E):E=e[9];let x;e[10]!==c?(x=l.jsx("span",{className:"font-medium truncate capitalize",children:c}),e[10]=c,e[11]=x):x=e[11];let w;e[12]!==s?(w=s&&l.jsx(H,{size:"xs"}),e[12]=s,e[13]=w):w=e[13];let p;e[14]!==x||e[15]!==w?(p=l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[x,w]}),e[14]=x,e[15]=w,e[16]=p):p=e[16];let D;e[17]!==f?(D=f&&l.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:f}),e[17]=f,e[18]=D):D=e[18];let I;return e[19]!==p||e[20]!==D||e[21]!==P||e[22]!==M||e[23]!==E?(I=l.jsxs("button",{type:"button",onClick:P,disabled:M,className:E,children:[p,D]}),e[19]=p,e[20]=D,e[21]=P,e[22]=M,e[23]=E,e[24]=I):I=e[24],I}let u;e[25]!==a||e[26]!==i?(u=()=>a(i),e[25]=a,e[26]=i,e[27]=u):u=e[27];const v=n||s,b=s&&"bg-muted/50",N=(n||s)&&"cursor-not-allowed opacity-50";let g;e[28]!==b||e[29]!==N?(g=O(te,"hover:bg-accent hover:text-foreground",b,N),e[28]=b,e[29]=N,e[30]=g):g=e[30];let j;e[31]!==c?(j=l.jsx("span",{className:"capitalize",children:c}),e[31]=c,e[32]=j):j=e[32];let C;e[33]!==s?(C=s&&l.jsx(H,{size:"xs"}),e[33]=s,e[34]=C):C=e[34];let y;e[35]!==u||e[36]!==v||e[37]!==g||e[38]!==j||e[39]!==C?(y=l.jsx(we,{asChild:!0,children:l.jsxs("button",{type:"button",onClick:u,disabled:v,className:g,children:[j,C]})}),e[35]=u,e[36]=v,e[37]=g,e[38]=j,e[39]=C,e[40]=y):y=e[40];const S=f??c;let h;e[41]!==S?(h=l.jsx(Ne,{side:"top",className:"max-w-xs",children:l.jsx("p",{className:"text-xs",children:S})}),e[41]=S,e[42]=h):h=e[42];let T;return e[43]!==y||e[44]!==h?(T=l.jsxs(Ce,{delayDuration:400,children:[y,h]}),e[43]=y,e[44]=h,e[45]=T):T=e[45],T}function Je(t){const e=L.c(61),{items:r,open:a,onOpenChange:s,onSelect:n,loadingPrompt:d}=t,o=$(),[i,m]=B.useState(""),c=!!d;let f;e[0]!==r||e[1]!==i?(f=i.trim()?r.filter(x=>{const w=i.toLowerCase();return x.prompt.name.toLowerCase().includes(w)||(x.prompt.title??"").toLowerCase().includes(w)||(x.prompt.description??"").toLowerCase().includes(w)}):r,e[0]=r,e[1]=i,e[2]=f):f=e[2];const u=f,v=De();let b;e[3]!==u.length||e[4]!==i||e[5]!==o?(b=u.length===0&&l.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:o("chat.iceBreakers.noPromptsMatch",{search:i})}),e[3]=u.length,e[4]=i,e[5]=o,e[6]=b):b=e[6];let N;if(e[7]!==u||e[8]!==c||e[9]!==d?.name||e[10]!==s||e[11]!==n){let x;e[13]!==c||e[14]!==d?.name||e[15]!==s||e[16]!==n?(x=w=>l.jsx(se,{item:w,variant:"card",onSelect:p=>{s(!1),n(p)},isLoading:d?.name===w.prompt.name,isDisabled:c&&d?.name!==w.prompt.name},w.prompt.name),e[13]=c,e[14]=d?.name,e[15]=s,e[16]=n,e[17]=x):x=e[17],N=u.map(x),e[7]=u,e[8]=c,e[9]=d?.name,e[10]=s,e[11]=n,e[12]=N}else N=e[12];let g;e[18]!==b||e[19]!==N?(g=l.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:l.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[b,N]})}),e[18]=b,e[19]=N,e[20]=g):g=e[20];const j=g;let C;e[21]!==o?(C=o("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=o,e[22]=C):C=e[22];let y;e[23]===Symbol.for("react.memo_cache_sentinel")?(y=x=>{x.key==="Escape"&&m("")},e[23]=y):y=e[23];let S;e[24]!==i||e[25]!==C?(S=l.jsx(Ee,{value:i,onChange:m,placeholder:C,onKeyDown:y}),e[24]=i,e[25]=C,e[26]=S):S=e[26];const h=S;if(v){let x;e[27]!==o?(x=o("chat.iceBreakers.allPromptsTitle"),e[27]=o,e[28]=x):x=e[28];let w;e[29]!==x?(w=l.jsx(Se,{className:"sr-only",children:l.jsx(Te,{children:x})}),e[29]=x,e[30]=w):w=e[30];let p;e[31]!==o?(p=o("chat.iceBreakers.promptsLabel"),e[31]=o,e[32]=p):p=e[32];let D;e[33]!==p?(D=l.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:l.jsx("span",{className:"text-sm font-medium text-foreground",children:p})}),e[33]=p,e[34]=D):D=e[34];let I;e[35]!==j||e[36]!==h||e[37]!==D||e[38]!==w?(I=l.jsxs(Pe,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[w,D,h,j]}),e[35]=j,e[36]=h,e[37]=D,e[38]=w,e[39]=I):I=e[39];let R;return e[40]!==s||e[41]!==a||e[42]!==I?(R=l.jsx(F,{delayDuration:400,children:l.jsx(ke,{open:a,onOpenChange:s,children:I})}),e[40]=s,e[41]=a,e[42]=I,e[43]=R):R=e[43],R}let T;e[44]!==o?(T=o("chat.iceBreakers.allPromptsTitle"),e[44]=o,e[45]=T):T=e[45];let P;e[46]!==T?(P=l.jsx(U,{className:"sr-only",children:l.jsx(V,{children:T})}),e[46]=T,e[47]=P):P=e[47];let M;e[48]!==o?(M=o("chat.iceBreakers.promptsLabel"),e[48]=o,e[49]=M):M=e[49];let _;e[50]!==M?(_=l.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:l.jsx("span",{className:"text-sm font-medium text-foreground",children:M})}),e[50]=M,e[51]=_):_=e[51];let k;e[52]!==j||e[53]!==h||e[54]!==_||e[55]!==P?(k=l.jsxs(X,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[P,_,h,j]}),e[52]=j,e[53]=h,e[54]=_,e[55]=P,e[56]=k):k=e[56];let E;return e[57]!==s||e[58]!==a||e[59]!==k?(E=l.jsx(F,{delayDuration:400,children:l.jsx(Y,{open:a,onOpenChange:s,children:k})}),e[57]=s,e[58]=a,e[59]=k,e[60]=E):E=e[60],E}function et(t){const e=L.c(30),{items:r,onSelect:a,loadingPrompt:s,className:n}=t,d=$(),[o,i]=B.useState(!1);if(r.length===0)return null;let m,c,f,u,v;if(e[0]!==n||e[1]!==r||e[2]!==s||e[3]!==a||e[4]!==d){const j=r.slice(0,K),C=r.slice(K),y=!!s;let S;e[10]!==y||e[11]!==s?.name||e[12]!==a?(S=T=>l.jsx(se,{item:T,onSelect:a,isLoading:s?.name===T.prompt.name,isDisabled:y&&s?.name!==T.prompt.name},T.prompt.name),e[10]=y,e[11]=s?.name,e[12]=a,e[13]=S):S=e[13];const h=j.map(S);m=F,v=400,e[14]!==n?(c=O("w-full flex flex-wrap gap-2 justify-center",n),e[14]=n,e[15]=c):c=e[15],f=h,u=C.length>0&&l.jsx("button",{type:"button",disabled:y,onClick:()=>i(!0),className:O(te,"hover:bg-accent hover:text-foreground",y&&"opacity-50 cursor-not-allowed"),children:d("chat.iceBreakers.moreButton",{count:C.length})}),e[0]=n,e[1]=r,e[2]=s,e[3]=a,e[4]=d,e[5]=m,e[6]=c,e[7]=f,e[8]=u,e[9]=v}else m=e[5],c=e[6],f=e[7],u=e[8],v=e[9];let b;e[16]!==c||e[17]!==f||e[18]!==u?(b=l.jsxs("div",{className:c,children:[f,u]}),e[16]=c,e[17]=f,e[18]=u,e[19]=b):b=e[19];let N;e[20]!==r||e[21]!==s||e[22]!==o||e[23]!==a?(N=l.jsx(Je,{items:r,open:o,onOpenChange:i,onSelect:a,loadingPrompt:s}),e[20]=r,e[21]=s,e[22]=o,e[23]=a,e[24]=N):N=e[24];let g;return e[25]!==m||e[26]!==v||e[27]!==b||e[28]!==N?(g=l.jsxs(m,{delayDuration:v,children:[b,N]}),e[25]=m,e[26]=v,e[27]=b,e[28]=N,e[29]=g):g=e[29],g}function tt(){return null}function st(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function lt(t){const e=L.c(31),{connectionId:r}=t,a=$(),{sendMessage:s}=Z(),{org:n}=A();let d;e[0]!==r||e[1]!==n.id||e[2]!==n.slug?(d={connectionId:r,orgId:n.id,orgSlug:n.slug},e[0]=r,e[1]=n.id,e[2]=n.slug,e[3]=d):d=e[3];const o=Me(d);let i;e[4]!==o?(i={client:o,staleTime:6e4},e[4]=o,e[5]=i):i=e[5];const{data:m}=_e(i);let c;e[6]!==m?.prompts?(c=m?.prompts??[],e[6]=m?.prompts,e[7]=c):c=e[7];const f=c;let u;e[8]!==f?(u=f.map(rt),e[8]=f,e[9]=u):u=e[9];const v=u;let b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b={stage:"idle"},e[10]=b):b=e[10];const[N,g]=B.useReducer(st,b),[j,C]=B.useState(null);let y;e[11]!==o||e[12]!==s||e[13]!==a?(y=async(p,D)=>{if(!o){z.error(a("chat.iceBreakers.mcpClientNotAvailable")),g({type:"RESET"});return}try{const I=await Ie(o,p.name,D);g({type:"RESET"});const R={type:"doc",content:[{type:"paragraph",content:[Le({id:p.name,name:ye(p.name,J(p._meta)),metadata:I.messages,char:"/",kind:"prompt",args:D}),{type:"text",text:" "}]}]};await s(R)}catch(I){console.error("[ice-breakers] Failed to fetch prompt:",I),z.error(a("chat.iceBreakers.failedToLoadPrompt")),g({type:"RESET"})}},e[11]=o,e[12]=s,e[13]=a,e[14]=y):y=e[14];const S=y;let h;e[15]!==S?(h=async p=>{if(p.arguments&&p.arguments.length>0){g({type:"SELECT_PROMPT",prompt:p}),C(p);return}g({type:"START_LOADING",prompt:p}),await S(p)},e[15]=S,e[16]=h):h=e[16];const T=h;let P;e[17]!==j||e[18]!==S?(P=async p=>{j&&(g({type:"START_LOADING",prompt:j,arguments:p}),C(null),await S(j,p))},e[17]=j,e[18]=S,e[19]=P):P=e[19];const M=P;if(v.length===0)return null;const _=N.stage==="loading"?N.prompt:null;let k;e[20]!==T||e[21]!==v||e[22]!==_?(k=l.jsx(et,{items:v,onSelect:T,loadingPrompt:_}),e[20]=T,e[21]=v,e[22]=_,e[23]=k):k=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{C(null),g({type:"RESET"})},e[24]=E):E=e[24];let x;e[25]!==j||e[26]!==M?(x=l.jsx(Be,{prompt:j,setPrompt:E,onSubmit:M}),e[25]=j,e[26]=M,e[27]=x):x=e[27];let w;return e[28]!==k||e[29]!==x?(w=l.jsxs(l.Fragment,{children:[k,x]}),e[28]=k,e[29]=x,e[30]=w):w=e[30],w}function rt(t){return{prompt:t}}function at(t){const e=L.c(13),{className:r}=t,{selectedVirtualMcp:a}=ie(),{org:s}=A();let n;e[0]!==s.id?(n=re(s.id),e[0]=s.id,e[1]=n):n=e[1];const d=n.id,o=a?.id??d;let i;e[2]!==r?(i=O("w-full @container",r),e[2]=r,e[3]=i):i=e[3];const m=o??"default";let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx(tt,{}),e[4]=c):c=e[4];let f;e[5]!==o?(f=l.jsx(lt,{connectionId:o}),e[5]=o,e[6]=f):f=e[6];let u;e[7]!==m||e[8]!==f?(u=l.jsx(ae,{fallback:null,children:l.jsx(B.Suspense,{fallback:c,children:f},m)}),e[7]=m,e[8]=f,e[9]=u):u=e[9];let v;return e[10]!==i||e[11]!==u?(v=l.jsx("div",{className:i,children:u}),e[10]=i,e[11]=u,e[12]=v):v=e[12],v}function nt(t){let e=0;for(const r of t)for(const a of r.parts??[]){const s=a;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function ot(){const t=L.c(8),{openPanel:e}=qe(),r=Ke(),a=ce()?.messages??[],s=de()?.taskId??null;let n;t[0]!==a?(n=nt(a),t[0]=a,t[1]=n):n=t[1];const d=n,o=B.useRef(null),i=B.useRef(null);let m,c;t[2]!==d||t[3]!==r||t[4]!==e||t[5]!==s?(m=()=>{if(!d||!s)return;const f=`${s}:${d}`;i.current!==f&&(i.current=f,r?.refreshThreadMetadata(s)),o.current!==s&&(o.current=s,e("site-editor"))},c=[d,s,e,r],t[2]=d,t[3]=r,t[4]=e,t[5]=s,t[6]=m,t[7]=c):(m=t[6],c=t[7]),B.useEffect(m,c)}function le(t){return`deco-credits-empty-dismissed:${t}`}function Ft(t){try{return localStorage.getItem(le(t))==="1"}catch{return!1}}function it(){const t=L.c(56),e=$(),{org:r}=A(),a=Xe("credits"),s=Q(),{decoKeyId:n}=Ye(),[d,o]=B.useState(!0);let i;t[0]!==r.id?(i=()=>{G("credits_empty_state_dismissed",{organization_id:r.id}),o(!1);try{localStorage.setItem(le(r.id),"1")}catch{}},t[0]=r.id,t[1]=i):i=t[1];const m=i;let c,f;if(t[2]!==d||t[3]!==r.id?(c=()=>{d&&G("credits_empty_state_shown",{organization_id:r.id})},f=[d,r.id],t[2]=d,t[3]=r.id,t[4]=c,t[5]=f):(c=t[4],f=t[5]),B.useEffect(c,f),!d)return null;if(!a){let p;t[6]!==e?(p=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=p):p=t[7];let D;t[8]!==p?(D={title:p},t[8]=p,t[9]=D):D=t[9];let I;return t[10]!==m||t[11]!==D?(I=l.jsx(Qe,{feature:"chat",copy:D,onDismiss:m}),t[10]=m,t[11]=D,t[12]=I):I=t[12],I}let u;t[13]!==m?(u=p=>!p&&m(),t[13]=m,t[14]=u):u=t[14];let v;t[15]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-warning/8 to-transparent pointer-events-none rounded-t-lg"}),t[15]=v):v=t[15];let b;t[16]===Symbol.for("react.memo_cache_sentinel")?(b=l.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:l.jsx(ee,{size:20,className:"text-warning"})}),t[16]=b):b=t[16];let N;t[17]!==e?(N=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=N):N=t[18];let g;t[19]!==N?(g=l.jsx(V,{className:"text-lg font-semibold",children:N}),t[19]=N,t[20]=g):g=t[20];let j;t[21]!==e?(j=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=j):j=t[22];let C;t[23]!==j?(C=l.jsx(ne,{className:"mt-2 text-sm leading-relaxed max-w-[320px] mx-auto",children:j}),t[23]=j,t[24]=C):C=t[24];let y;t[25]!==g||t[26]!==C?(y=l.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[v,l.jsxs(U,{className:"relative gap-3",children:[b,l.jsxs("div",{className:"text-center",children:[g,C]})]})]}),t[25]=g,t[26]=C,t[27]=y):y=t[27];let S;t[28]!==n||t[29]!==m?(S=n&&l.jsx("div",{className:"px-6 pb-5",children:l.jsx(Oe,{source:"empty_state",onDone:m})}),t[28]=n,t[29]=m,t[30]=S):S=t[30];let h;t[31]!==m||t[32]!==s||t[33]!==r.slug?(h=()=>{s({to:"/$org/settings/ai-providers",params:{org:r.slug}}),m()},t[31]=m,t[32]=s,t[33]=r.slug,t[34]=h):h=t[34];let T;t[35]!==e?(T=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=T):T=t[36];let P;t[37]===Symbol.for("react.memo_cache_sentinel")?(P=l.jsx(Ve,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=P):P=t[37];let M;t[38]!==h||t[39]!==T?(M=l.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:h,children:[T,P]}),t[38]=h,t[39]=T,t[40]=M):M=t[40];let _;t[41]!==e?(_=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=_):_=t[42];let k;t[43]!==m||t[44]!==_?(k=l.jsx(W,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:m,children:_}),t[43]=m,t[44]=_,t[45]=k):k=t[45];let E;t[46]!==M||t[47]!==k?(E=l.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[M,k]}),t[46]=M,t[47]=k,t[48]=E):E=t[48];let x;t[49]!==y||t[50]!==S||t[51]!==E?(x=l.jsxs(X,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:ct,children:[y,S,E]}),t[49]=y,t[50]=S,t[51]=E,t[52]=x):x=t[52];let w;return t[53]!==x||t[54]!==u?(w=l.jsx(Y,{open:!0,onOpenChange:u,children:x}),t[53]=x,t[54]=u,t[55]=w):w=t[55],w}function ct(t){return t.preventDefault()}function dt(t){const e=L.c(6),{balanceDollars:r}=t;let a;e[0]!==r?(a=r.toFixed(2),e[0]=r,e[1]=a):a=e[1];const s=a;let n,d;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=O("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-success/10 border border-success/20","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),d=l.jsx(ee,{size:13,className:"text-success"}),e[2]=n,e[3]=d):(n=e[2],d=e[3]);let o;return e[4]!==s?(o=l.jsxs("div",{className:n,children:[d,l.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=o):o=e[5],o}function mt(){const t=L.c(8),{org:e}=A(),r=Q();let a;t[0]!==r||t[1]!==e.slug?(a=()=>r({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=r,t[1]=e.slug,t[2]=a):a=t[2];let s,n,d;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=O("inline-flex items-center gap-1.5 px-3 py-1 rounded-lg cursor-pointer","bg-warning/10 border border-warning/20","hover:bg-warning/15","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),n=l.jsx(We,{size:13,className:"text-warning"}),d=l.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=n,t[5]=d):(s=t[3],n=t[4],d=t[5]);let o;return t[6]!==a?(o=l.jsxs("button",{type:"button",onClick:a,className:s,children:[n,d]}),t[6]=a,t[7]=o):o=t[7],o}function ut(t){const e=L.c(7),{scrollRef:r,sentinelRef:a,hasMoreOlder:s,isFetchingOlder:n,fetchOlderMessages:d}=t;let o,i;e[0]!==d||e[1]!==s||e[2]!==n||e[3]!==r||e[4]!==a?(o=()=>{const m=a.current,c=r.current;if(!m||!c||!s)return;const f=new IntersectionObserver(async u=>{if(!u[0]?.isIntersecting||n||!s)return;const b=c.scrollHeight,N=c.scrollTop;await d(),requestAnimationFrame(()=>{const g=c.scrollHeight;c.scrollTop=N+(g-b)})},{root:c,rootMargin:"200px 0px 0px 0px"});return f.observe(m),()=>f.disconnect()},i=[r,a,s,n,d],e[0]=d,e[1]=s,e[2]=n,e[3]=r,e[4]=a,e[5]=o,e[6]=i):(o=e[5],i=e[6]),B.useEffect(o,i)}function ft(t){const e=L.c(5),{className:r,children:a}=t;let s;e[0]!==r?(s=O("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",r),e[0]=r,e[1]=s):s=e[1];let n;return e[2]!==a||e[3]!==s?(n=l.jsx("div",{className:s,children:a}),e[2]=a,e[3]=s,e[4]=n):n=e[4],n}function pt(t){const e=L.c(5),{children:r,className:a}=t;let s;e[0]!==a?(s=O("flex-1 min-h-0 overflow-y-auto isolate",a),e[0]=a,e[1]=s):s=e[1];let n;return e[2]!==r||e[3]!==s?(n=l.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=n):n=e[4],n}function xt(t){const e=L.c(2),{children:r}=t;let a;return e[0]!==r?(a=l.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:r}),e[0]=r,e[1]=a):a=e[1],a}function gt(){const t=$(),{messages:e,status:r,hasMoreOlder:a,isFetchingOlder:s,fetchOlderMessages:n,isRunInProgress:d}=Z(),{taskId:o}=xe();ot();const i=ge(o??""),m=he(i),c=m.size===0?e:e.filter(h=>!m.has(h.id)),f=be(c,r==="submitted"||r==="streaming"||d),u=f.visible,v=ze(u),b=v.at(-1),g=Ae()*Fe+16,j=B.useRef(null),C=B.useRef(null);ut({scrollRef:j,sentinelRef:C,hasMoreOlder:a,isFetchingOlder:s,fetchOlderMessages:n});const y=He({initial:!1}),S=h=>{j.current=h,y.scrollRef(h)};return l.jsx(je.Provider,{value:f,children:l.jsx(Ge,{messages:e,children:l.jsxs("div",{className:"relative h-full w-full min-w-0",children:[l.jsx("div",{ref:S,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:g},children:l.jsxs("div",{ref:y.contentRef,className:"overflow-x-clip",children:[l.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[l.jsx("div",{ref:C,"aria-hidden":!0,className:"h-px"}),s&&l.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),v.slice(0,-1).map((h,T)=>l.jsx(q,{pair:h,isLastPair:!1,status:T===v.length-1?r:void 0},`pair-${h.user?.id??h.assistant?.id}`))]}),b&&l.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:l.jsx(q,{pair:b,isLastPair:!0,status:r},`pair-${b.user?.id??b.assistant?.id}`)})]})}),!y.isAtBottom&&l.jsx(W,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 shadow-soft animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:g+8},onClick:()=>{y.scrollToBottom()},children:l.jsx(oe,{size:14})})]})})})}function ht(t){const e=L.c(5),{children:r,className:a}=t;let s;e[0]!==a?(s=O("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",a),e[0]=a,e[1]=s):s=e[1];let n;return e[2]!==r||e[3]!==s?(n=l.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=n):n=e[4],n}const zt=Object.assign(ft,{Main:pt,Messages:gt,EmptyState:xt,Footer:ht,Input:$e,Provider:pe,StreamHost:fe,ActiveTaskStreamSource:ue,ThreadlessStreamSource:me,IceBreakers:at,NoAiProviderEmptyState:Ue,CreditsEmptyState:it,CreditsEyebrow:dt,NoCreditsEyebrow:mt,CreditsExhaustedBanner:Re});export{zt as C,Ft as w};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{h2 as Oe,h3 as Xe,h4 as un,h5 as Ns,c as q,b as Z,r as Q,j as t,B as ee,h as at,l as ge,Z as Cs,V as ks,Y as Ms,X as Qe,aw as Bt,au as Wt,av as Kt,t as re,a4 as Ee,D as Je,v as Ze,w as lt,x as rt,M as Be,a5 as _s,h6 as mn,y as Dt,L as Vs,I as Se,an as fn,E as pn,fV as st,ay as Gt,am as hn,fU as Re,fT as We,aq as Pt,m as Ts,K as Ot,h7 as xn,h8 as gn,h9 as vn,c6 as be,ha as je,n as Ye,P as bn,d as At,u as jn,ai as ot,q as Ds,e as yn,ab as wn,aY as Ps,C as Ve,bB as Sn,a as Nn,hb as It,hc as Cn,b8 as kn,ag as Mn,aJ as _n,aI as Vn,a7 as Tn,hd as Dn,aS as Pn,aR as On,aO as An,aM as In,aN as $n,aQ as Fn,aP as En,bm as zn,aX as Rn}from"./index-DJ1OawZD.js";import{g as Ln}from"./extract-connection-data-3P1lh0vb.js";import{b as Un}from"./chat-context-BO-O8zYY.js";import{U as Yn,b as Bn}from"./build-improve-prompt-doc-Hiwx1yva.js";import{E as Wn}from"./empty-state-YnMyEE1u.js";import{a as Kn}from"./shell-layout-BQMms4WU.js";import{g as pt,n as Gn,a as qt,e as qn,u as Hn,f as Qn}from"./use-date-fns-locale-a0B0hAGx.js";import{a as Xn}from"./mcp-oauth-BYVXm7Cw.js";import{T as mt}from"./textarea-CxbswNZX.js";import{c as Ce,T as ke,a as Me}from"./tooltip-Bbs97viR.js";import{a as $t,b as Os,u as Jn}from"./use-connection-BqqPyNtq.js";import{b as Zn,a as As,g as Is,d as ei,k as ti}from"./repository-binding-BItepy-z.js";import{i as Ht}from"./mcp-oauth-DAaJvMdM.js";import{be as si,k as ni,bf as ii,bg as ai,aR as li,aB as ri,aE as oi,bh as ci,bi as $s,bj as Fs,bk as di,ap as ui,bl as mi,bm as wt,bn as Qt,A as Xt,N as fi,bo as pi,bp as hi,g as Es,p as Jt,n as xi,x as gi,w as vi,v as bi,u as ji,r as yi,f as zs,E as Zt,aO as wi,ad as Si,P as Ni}from"./agent-icon-8z_1onUt.js";import{s as Pe}from"./Plus-Dd1LZQDu.js";import{t as ut,a as Ci}from"./Tool01-BM_jAXaw.js";import{s as ht}from"./Trash01-D_6j6Kjo.js";import{u as es}from"./use-debounced-autosave-EUU71WFf.js";import{A as ki}from"./add-connection-dialog-CI1dfD2M.js";import{i as Mt}from"./SearchMd-huYq_veH.js";import{F as ts}from"./file-type-icon-C7xJ53He.js";import{j as Mi,k as _i,l as Vi,m as Ti}from"./use-org-fs-Bkdq3N3W.js";import{I as et}from"./integration-icon-vdbLoXVP.js";import{C as Rs}from"./checkbox-uTwuXUyB.js";import{S as Di}from"./search-input-BD_zzwAH.js";import{b as Ae,a as Ie,c as we,d as $e,S as Fe}from"./select-D9aSCbjE.js";import{s as Ft}from"./XClose-CmsTtHZr.js";import{C as Pi}from"./collection-tabs-Cx2RUmMM.js";import{T as Ls,u as Us}from"./use-mcp-auth-status-DSTS5c2y.js";import{u as xt}from"./use-mcp-client-AOCIses4.js";import{a as Ys}from"./use-mcp-tools-XusMthB1.js";import{u as Oi}from"./use-mcp-prompts-DB4BDCUk.js";import{g as Ai}from"./connection-slug-CITJ0kGN.js";import{t as _t}from"./utils-CVEq3hMx.js";import{S as gt}from"./switch-CVdtqclr.js";import{a as Bs,b as Ws,P as Ks}from"./popover-Cn1OW4zx.js";import{S as Ii}from"./scroll-area-DuhcsVwv.js";import{i as $i}from"./Upload01-jTJu_yfb.js";import{i as Fi}from"./DotsVertical-CaKzUPHY.js";import{a as Ei}from"./Image01-Br2Za8Gz.js";import{i as zi}from"./Monitor01-x3qJMHxB.js";import{g as Ri}from"./types-D2I0j8gC.js";import{a as Gs,g as Li,u as Ui}from"./experiments-tab-choice-BAGkDSHi.js";import{a as Yi}from"./use-panel-navigate-gymQhz_L.js";import{u as Bi,e as Vt,o as ss,r as Tt,p as Wi,g as Ki,s as Gi,t as qi,h as Hi,i as Qi,a as Xi}from"./use-project-native-view-presence-D5k1m39W.js";import{a as qs,u as Ji,i as Zi,o as ea,r as ns,p as ta,w as sa,b as is}from"./optimistic-project-sidebar-views-Dn7Pz8bp.js";import{P as na,a as ia,i as aa}from"./sections-Bfbs4u2V.js";import{i as Et}from"./Key01-6xIzri6P.js";import{a as vt}from"./Copy01-j7Nlt5qU.js";import{u as la}from"./use-copy-BYz3Xa4M.js";import{L as ye}from"./label-DIWSyY3V.js";import{s as Hs,k as ra,r as oa}from"./thread-intent-BpcQdr2N.js";import{V as ca,E as bt,R as as,r as Qs,C as da,w as ua}from"./virtual-mcp-K5pw5xn_.js";import{s as Xs}from"./slugify-CEUa2lfQ.js";import{b as ma,a as fa,D as pa}from"./drawer-DZlLGfvX.js";import{u as ha}from"./use-mobile-Dqpuq5pP.js";import{d as jt}from"./delay-CnY5UFtP.js";import{b as xa}from"./sandbox-url-D3mC8qhT.js";import{S as ga,a as va,b as ba}from"./secret-picker-D4NRcsNL.js";import{u as ja,a as ya}from"./use-secrets-2iLsYUpd.js";import{o as ls}from"./omit-sandbox-map-jj4lCB2U.js";import{G as wa}from"./repository-picker-DGSuy8Qj.js";import{n as rs}from"./app-preview-url-9Od4s8Sz.js";import{a as Sa}from"./use-organization-settings-DeGpDV0v.js";import{r as Na}from"./serial-task-queue-CGOeQgpr.js";function it(a,e){const s=pt(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=Oe(a,e?.in),l=i.getDay(),r=(l<n?7:0)+l-n;return i.setDate(i.getDate()-r),i.setHours(0,0,0,0),i}function ft(a,e){return it(a,{...e,weekStartsOn:1})}function Js(a,e){const s=Oe(a,e?.in),n=s.getFullYear(),i=Xe(s,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const l=ft(i),r=Xe(s,0);r.setFullYear(n,0,4),r.setHours(0,0,0,0);const o=ft(r);return s.getTime()>=l.getTime()?n+1:s.getTime()>=o.getTime()?n:n-1}function os(a,e){const s=Oe(a,e?.in);return s.setHours(0,0,0,0),s}function Ca(a,e,s){const[n,i]=Gn(s?.in,a,e),l=os(n),r=os(i),o=+l-qt(l),p=+r-qt(r);return Math.round((o-p)/un)}function ka(a,e){const s=Js(a,e),n=Xe(a,0);return n.setFullYear(s,0,4),n.setHours(0,0,0,0),ft(n)}function Ma(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function _a(a){return!(!Ma(a)&&typeof a!="number"||isNaN(+Oe(a)))}function Va(a,e){const s=Oe(a,e?.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}function Ta(a,e){const s=Oe(a,e?.in);return Ca(s,Va(s))+1}function Da(a,e){const s=Oe(a,e?.in),n=+ft(s)-+ka(s);return Math.round(n/Ns)+1}function Zs(a,e){const s=Oe(a,e?.in),n=s.getFullYear(),i=pt(),l=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=Xe(e?.in||a,0);r.setFullYear(n+1,0,l),r.setHours(0,0,0,0);const o=it(r,e),p=Xe(e?.in||a,0);p.setFullYear(n,0,l),p.setHours(0,0,0,0);const c=it(p,e);return+s>=+o?n+1:+s>=+c?n:n-1}function Pa(a,e){const s=pt(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,i=Zs(a,e),l=Xe(e?.in||a,0);return l.setFullYear(i,0,n),l.setHours(0,0,0,0),it(l,e)}function Oa(a,e){const s=Oe(a,e?.in),n=+it(s,e)-+Pa(s,e);return Math.round(n/Ns)+1}function le(a,e){const s=a<0?"-":"",n=Math.abs(a).toString().padStart(e,"0");return s+n}const ze={y(a,e){const s=a.getFullYear(),n=s>0?s:1-s;return le(e==="yy"?n%100:n,e.length)},M(a,e){const s=a.getMonth();return e==="M"?String(s+1):le(s+1,2)},d(a,e){return le(a.getDate(),e.length)},a(a,e){const s=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];default:return s==="am"?"a.m.":"p.m."}},h(a,e){return le(a.getHours()%12||12,e.length)},H(a,e){return le(a.getHours(),e.length)},m(a,e){return le(a.getMinutes(),e.length)},s(a,e){return le(a.getSeconds(),e.length)},S(a,e){const s=e.length,n=a.getMilliseconds(),i=Math.trunc(n*Math.pow(10,s-3));return le(i,e.length)}},He={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},cs={G:function(a,e,s){const n=a.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"});case"GGGGG":return s.era(n,{width:"narrow"});default:return s.era(n,{width:"wide"})}},y:function(a,e,s){if(e==="yo"){const n=a.getFullYear(),i=n>0?n:1-n;return s.ordinalNumber(i,{unit:"year"})}return ze.y(a,e)},Y:function(a,e,s,n){const i=Zs(a,n),l=i>0?i:1-i;if(e==="YY"){const r=l%100;return le(r,2)}return e==="Yo"?s.ordinalNumber(l,{unit:"year"}):le(l,e.length)},R:function(a,e){const s=Js(a);return le(s,e.length)},u:function(a,e){const s=a.getFullYear();return le(s,e.length)},Q:function(a,e,s){const n=Math.ceil((a.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return le(n,2);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});default:return s.quarter(n,{width:"wide",context:"formatting"})}},q:function(a,e,s){const n=Math.ceil((a.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return le(n,2);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});default:return s.quarter(n,{width:"wide",context:"standalone"})}},M:function(a,e,s){const n=a.getMonth();switch(e){case"M":case"MM":return ze.M(a,e);case"Mo":return s.ordinalNumber(n+1,{unit:"month"});case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});default:return s.month(n,{width:"wide",context:"formatting"})}},L:function(a,e,s){const n=a.getMonth();switch(e){case"L":return String(n+1);case"LL":return le(n+1,2);case"Lo":return s.ordinalNumber(n+1,{unit:"month"});case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});default:return s.month(n,{width:"wide",context:"standalone"})}},w:function(a,e,s,n){const i=Oa(a,n);return e==="wo"?s.ordinalNumber(i,{unit:"week"}):le(i,e.length)},I:function(a,e,s){const n=Da(a);return e==="Io"?s.ordinalNumber(n,{unit:"week"}):le(n,e.length)},d:function(a,e,s){return e==="do"?s.ordinalNumber(a.getDate(),{unit:"date"}):ze.d(a,e)},D:function(a,e,s){const n=Ta(a);return e==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):le(n,e.length)},E:function(a,e,s){const n=a.getDay();switch(e){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},e:function(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(l);case"ee":return le(l,2);case"eo":return s.ordinalNumber(l,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(l);case"cc":return le(l,e.length);case"co":return s.ordinalNumber(l,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(a,e,s){const n=a.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return le(i,e.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},a:function(a,e,s){const i=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(a,e,s){const n=a.getHours();let i;switch(n===12?i=He.noon:n===0?i=He.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(a,e,s){const n=a.getHours();let i;switch(n>=17?i=He.evening:n>=12?i=He.afternoon:n>=4?i=He.morning:i=He.night,e){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(a,e,s){if(e==="ho"){let n=a.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return ze.h(a,e)},H:function(a,e,s){return e==="Ho"?s.ordinalNumber(a.getHours(),{unit:"hour"}):ze.H(a,e)},K:function(a,e,s){const n=a.getHours()%12;return e==="Ko"?s.ordinalNumber(n,{unit:"hour"}):le(n,e.length)},k:function(a,e,s){let n=a.getHours();return n===0&&(n=24),e==="ko"?s.ordinalNumber(n,{unit:"hour"}):le(n,e.length)},m:function(a,e,s){return e==="mo"?s.ordinalNumber(a.getMinutes(),{unit:"minute"}):ze.m(a,e)},s:function(a,e,s){return e==="so"?s.ordinalNumber(a.getSeconds(),{unit:"second"}):ze.s(a,e)},S:function(a,e){return ze.S(a,e)},X:function(a,e,s){const n=a.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return us(n);case"XXXX":case"XX":return Ue(n);default:return Ue(n,":")}},x:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"x":return us(n);case"xxxx":case"xx":return Ue(n);default:return Ue(n,":")}},O:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ds(n,":");default:return"GMT"+Ue(n,":")}},z:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ds(n,":");default:return"GMT"+Ue(n,":")}},t:function(a,e,s){const n=Math.trunc(+a/1e3);return le(n,e.length)},T:function(a,e,s){return le(+a,e.length)}};function ds(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=Math.trunc(n/60),l=n%60;return l===0?s+String(i):s+String(i)+e+le(l,2)}function us(a,e){return a%60===0?(a>0?"-":"+")+le(Math.abs(a)/60,2):Ue(a,e)}function Ue(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=le(Math.trunc(n/60),2),l=le(n%60,2);return s+i+e+l}const ms=(a,e)=>{switch(a){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"})}},en=(a,e)=>{switch(a){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"})}},Aa=(a,e)=>{const s=a.match(/(P+)(p+)?/)||[],n=s[1],i=s[2];if(!i)return ms(a,e);let l;switch(n){case"P":l=e.dateTime({width:"short"});break;case"PP":l=e.dateTime({width:"medium"});break;case"PPP":l=e.dateTime({width:"long"});break;default:l=e.dateTime({width:"full"});break}return l.replace("{{date}}",ms(n,e)).replace("{{time}}",en(i,e))},Ia={p:en,P:Aa},$a=/^D+$/,Fa=/^Y+$/,Ea=["D","DD","YY","YYYY"];function za(a){return $a.test(a)}function Ra(a){return Fa.test(a)}function La(a,e,s){const n=Ua(a,e,s);if(console.warn(n),Ea.includes(a))throw new RangeError(n)}function Ua(a,e,s){const n=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${e}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Ya=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ba=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Wa=/^'([^]*?)'?$/,Ka=/''/g,Ga=/[a-zA-Z]/;function qa(a,e,s){const n=pt(),i=s?.locale??n.locale??qn,l=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Oe(a,s?.in);if(!_a(o))throw new RangeError("Invalid time value");let p=e.match(Ba).map(f=>{const m=f[0];if(m==="p"||m==="P"){const u=Ia[m];return u(f,i.formatLong)}return f}).join("").match(Ya).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:Ha(f)};if(cs[m])return{isToken:!0,value:f};if(m.match(Ga))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});i.localize.preprocessor&&(p=i.localize.preprocessor(o,p));const c={firstWeekContainsDate:l,weekStartsOn:r,locale:i};return p.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!s?.useAdditionalWeekYearTokens&&Ra(m)||!s?.useAdditionalDayOfYearTokens&&za(m))&&La(m,e,String(a));const u=cs[m[0]];return u(o,m,i.localize,c)}).join("")}function Ha(a){const e=a.match(Wa);return e?e[1].replace(Ka,"'"):a}const tn=25*1024*1024,St="home",Nt="knowledge";function fs(a){return a==null?"":a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(0)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`}function Le(a){return a.split("/").pop()??a}function Qa(a){const e=q.c(64),{form:s}=a,n=Z(),{upload:i}=Mi(St),l=_i(),r=Q.useRef(null),[o,p]=Q.useState(!1),[c,f]=Q.useState(""),[m,u]=Q.useState(!1);let h;e[0]!==o?(h={enabled:o},e[0]=o,e[1]=h):h=e[1];const{data:d}=Vi(60,h),x=d===void 0?[]:d;let g;e[2]!==o?(g={enabled:o},e[2]=o,e[3]=g):g=e[3];const{data:v}=Ti(g),y=v===void 0?[]:v;let j;e[4]!==s?(j=()=>s.getValues("metadata.knowledge")??[],e[4]=s,e[5]=j):j=e[5];const[b,S]=Q.useState(j);let N;e[6]!==s?(N=F=>{S(F),s.setValue("metadata.knowledge",F,{shouldDirty:!0})},e[6]=s,e[7]=N):N=e[7];const k=N;let w;e[8]!==l||e[9]!==b||e[10]!==k||e[11]!==n||e[12]!==i?(w=async F=>{if(!F||F.length===0)return;const se=Array.from(F),Te=se.filter(nl),D=se.filter(sl);if(D.length>0&&re.warning(n("virtualMcp.filesSection.fileTooLargeTitle"),{description:n("virtualMcp.filesSection.fileTooLargeDescription",{names:D.map(tl).join(", ")})}),Te.length!==0){try{await i.mutateAsync({dir:Nt,files:Te})}catch(te){const ne=te;re.error(ne instanceof Error?ne.message:n("virtualMcp.filesSection.failedUploadFile"));return}k([...b,...Te.map(te=>({id:crypto.randomUUID(),name:te.name,volume:St,path:`${Nt}/${te.name}`,url:l(St,`${Nt}/${te.name}`),contentType:te.type||null,size:te.size,addedAt:new Date().toISOString()}))])}},e[8]=l,e[9]=b,e[10]=k,e[11]=n,e[12]=i,e[13]=w):w=e[13];const C=w;let M;e[14]!==l||e[15]!==b||e[16]!==k?(M=F=>{b.some(se=>se.volume===F.volume&&se.path===F.path)||(k([...b,{id:crypto.randomUUID(),name:Le(F.path),volume:F.volume,path:F.path,url:l(F.volume,F.path),contentType:null,size:F.size??null,addedAt:new Date().toISOString()}]),p(!1))},e[14]=l,e[15]=b,e[16]=k,e[17]=M):M=e[17];const _=M;let V;e[18]!==l||e[19]!==b||e[20]!==k?(V=F=>{b.some(se=>se.volume===F.volume&&se.path===F.path)||(k([...b,{id:crypto.randomUUID(),name:Le(F.path),kind:"skill",volume:F.volume,path:F.path,url:l(F.volume,F.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),p(!1))},e[18]=l,e[19]=b,e[20]=k,e[21]=V):V=e[21];const E=V;let P;e[22]!==b||e[23]!==k?(P=F=>{k(b.filter(se=>se.id!==F))},e[22]=b,e[23]=k,e[24]=P):P=e[24];const I=P;let A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=F=>{p(F),F&&f("")},e[25]=A):A=e[25];const R=A;let U;e[26]!==b?(U=new Set(b.map(el)),e[26]=b,e[27]=U):U=e[27];const K=U,W=c.toLowerCase();let G;e[28]!==K?(G=F=>!K.has(`${F.volume}/${F.path}`),e[28]=K,e[29]=G):G=e[29];const L=x.filter(Za).filter(G).filter(F=>Le(F.path).toLowerCase().includes(W)).slice(0,5);let Y;e[30]!==K?(Y=F=>!K.has(`${F.volume}/${F.path}`),e[30]=K,e[31]=Y):Y=e[31];const X=y.filter(Y).filter(F=>Le(F.path).toLowerCase().includes(W)).slice(0,5),T=F=>t.jsxs(Cs,{open:o,onOpenChange:R,children:[t.jsx(ks,{asChild:!0,children:F}),t.jsxs(Ms,{align:"end",className:"w-56",children:[t.jsxs(Qe,{onSelect:()=>{r.current?.click()},children:[t.jsx(si,{size:16}),n("virtualMcp.filesSection.uploadFile")]}),t.jsxs(Bt,{children:[t.jsxs(Wt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(ni,{size:16}),n("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(Kt,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Mt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:c,onChange:se=>f(se.target.value),onKeyDown:Ja,placeholder:n("virtualMcp.filesSection.searchFilesPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:L.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noFilesFound")}):L.map(se=>t.jsxs(Qe,{onSelect:()=>_(se),children:[t.jsx(ts,{filename:Le(se.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Le(se.path)}),se.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:fs(se.size)})]},`${se.volume}/${se.path}`))})]})]}),t.jsxs(Bt,{children:[t.jsxs(Wt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(ut,{size:16}),n("virtualMcp.filesSection.selectSkill")]}),t.jsxs(Kt,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Mt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:c,onChange:se=>f(se.target.value),onKeyDown:Xa,placeholder:n("virtualMcp.filesSection.searchSkillsPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:X.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noSkillsFound")}):X.map(se=>t.jsxs(Qe,{onSelect:()=>E(se),children:[t.jsx(ut,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Le(se.path)})]},`${se.volume}/${se.path}`))})]})]})]})]}),z="flex flex-col gap-3";let B;e[32]!==n?(B=n("virtualMcp.filesSection.filesAndSkills"),e[32]=n,e[33]=B):B=e[33];let O;e[34]!==B?(O=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:B}),e[34]=B,e[35]=O):O=e[35];let $;e[36]!==n?($=n("virtualMcp.filesSection.description"),e[36]=n,e[37]=$):$=e[37];let J;e[38]!==$?(J=t.jsx("p",{className:"text-sm text-muted-foreground",children:$}),e[38]=$,e[39]=J):J=e[39];let ie;e[40]!==O||e[41]!==J?(ie=t.jsxs("div",{className:"flex flex-col gap-1",children:[O,J]}),e[40]=O,e[41]=J,e[42]=ie):ie=e[42];const de=b.length>0&&T(t.jsxs(ee,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(at,{size:"xs"}):t.jsx(Pe,{size:14}),n("virtualMcp.filesSection.add")]}));let ae;e[43]!==ie||e[44]!==de?(ae=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[ie,de]}),e[43]=ie,e[44]=de,e[45]=ae):ae=e[45];let oe;e[46]!==C?(oe=t.jsx("input",{ref:r,type:"file",multiple:!0,className:"hidden",onChange:F=>{C(F.target.files),F.target.value=""}}),e[46]=C,e[47]=oe):oe=e[47];let H,ce;e[48]===Symbol.for("react.memo_cache_sentinel")?(H=F=>{F.preventDefault(),u(!0)},ce=()=>u(!1),e[48]=H,e[49]=ce):(H=e[48],ce=e[49]);let me;e[50]!==C?(me=F=>{F.preventDefault(),F.stopPropagation(),u(!1),C(F.dataTransfer.files)},e[50]=C,e[51]=me):me=e[51];const pe=m&&"outline outline-2 outline-dashed outline-primary";let fe;e[52]!==pe?(fe=ge("flex flex-col gap-2 rounded-lg",pe),e[52]=pe,e[53]=fe):fe=e[53];const he=b.length===0?T(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 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:n("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):b.map(F=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 surface",children:[F.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(ut,{size:16})}):t.jsx(ts,{filename:F.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:F.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:F.kind==="skill"?n("virtualMcp.filesSection.kindSkill"):F.size!=null?fs(F.size):n("virtualMcp.filesSection.kindFile")})]}),t.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>I(F.id),"aria-label":n("virtualMcp.filesSection.removeAriaLabel",{name:F.name}),children:t.jsx(ht,{size:16})})]},F.id));let ve;e[54]!==H||e[55]!==ce||e[56]!==me||e[57]!==fe||e[58]!==he?(ve=t.jsx("div",{onDragOver:H,onDragLeave:ce,onDrop:me,className:fe,children:he}),e[54]=H,e[55]=ce,e[56]=me,e[57]=fe,e[58]=he,e[59]=ve):ve=e[59];let ue;return e[60]!==ae||e[61]!==oe||e[62]!==ve?(ue=t.jsxs("section",{className:z,children:[ae,oe,ve]}),e[60]=ae,e[61]=oe,e[62]=ve,e[63]=ue):ue=e[63],ue}function Xa(a){return a.stopPropagation()}function Ja(a){return a.stopPropagation()}function Za(a){return a.kind!=="dir"}function el(a){return`${a.volume}/${a.path}`}function tl(a){return a.name}function sl(a){return a.size>tn}function nl(a){return a.size<=tn}function il(a){return a==null?"all":a.length===0?"self":"selected"}function al(a){const e=q.c(88),{form:s,currentAgentId:n}=a,i=Z(),{org:l}=Ee(),r=Zn(),[o,p]=Q.useState(!1);let c;e[0]!==s?(c=s.getValues("metadata.subAgents")??null,e[0]=s,e[1]=c):c=e[1];const f=c;let m;e[2]!==f?(m=()=>il(f),e[2]=f,e[3]=m):m=e[3];const[u,h]=Q.useState(m);let d;e[4]!==f?(d=f??[],e[4]=f,e[5]=d):d=e[5];const[x,g]=Q.useState(d);let v,y,j,b,S,N;if(e[6]!==r||e[7]!==n||e[8]!==s||e[9]!==u||e[10]!==l||e[11]!==x||e[12]!==i){let M;e[19]!==n||e[20]!==l?(M=H=>H.id!==n&&H.id!==l.id&&H.status==="active",e[19]=n,e[20]=l,e[21]=M):M=e[21],v=r.filter(M);let _;e[22]!==x?(_=H=>x.includes(H.id),e[22]=x,e[23]=_):_=e[23];const V=v.filter(_);let E;e[24]!==s?(E=(H,ce)=>s.setValue("metadata.subAgents",H==="all"?null:H==="self"?[]:ce,{shouldDirty:!0}),e[24]=s,e[25]=E):E=e[25];const P=E;let I;e[26]!==P||e[27]!==x?(I=H=>{h(H),P(H,x)},e[26]=P,e[27]=x,e[28]=I):I=e[28];const A=I;let R;e[29]!==P||e[30]!==x?(R=H=>{const ce=x.includes(H)?x.filter(me=>me!==H):[...x,H];g(ce),P("selected",ce)},e[29]=P,e[30]=x,e[31]=R):R=e[31],y=R,S="flex flex-col gap-3";let U;e[32]!==i?(U=i("virtualMcp.subAgentsSection.title"),e[32]=i,e[33]=U):U=e[33];let K;e[34]!==U?(K=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:U}),e[34]=U,e[35]=K):K=e[35];let W;e[36]!==u||e[37]!==i?(W=u==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=u,e[37]=i,e[38]=W):W=e[38];let G;e[39]!==u||e[40]!==i?(G=u==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=u,e[40]=i,e[41]=G):G=e[41];let L;e[42]!==K||e[43]!==W||e[44]!==G?(L=t.jsxs("div",{className:"flex flex-col gap-1",children:[K,W,G]}),e[42]=K,e[43]=W,e[44]=G,e[45]=L):L=e[45];const Y=u==="selected"&&V.length>0&&t.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>p(!0),children:[t.jsx(Pe,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let X;e[46]!==A?(X=H=>A(H),e[46]=A,e[47]=X):X=e[47];let T;e[48]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Ae,{size:"sm",className:"w-auto",children:t.jsx(Ie,{})}),e[48]=T):T=e[48];let z;e[49]!==i?(z=i("virtualMcp.subAgentsSection.anyAgent"),e[49]=i,e[50]=z):z=e[50];let B;e[51]!==z?(B=t.jsx(we,{value:"all",children:z}),e[51]=z,e[52]=B):B=e[52];let O;e[53]!==i?(O=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=O):O=e[54];let $;e[55]!==O?($=t.jsx(we,{value:"selected",children:O}),e[55]=O,e[56]=$):$=e[56];let J;e[57]!==i?(J=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=J):J=e[58];let ie;e[59]!==J?(ie=t.jsx(we,{value:"self",children:J}),e[59]=J,e[60]=ie):ie=e[60];let de;e[61]!==B||e[62]!==$||e[63]!==ie?(de=t.jsxs($e,{align:"end",children:[B,$,ie]}),e[61]=B,e[62]=$,e[63]=ie,e[64]=de):de=e[64];let ae;e[65]!==u||e[66]!==X||e[67]!==de?(ae=t.jsxs(Fe,{value:u,onValueChange:X,children:[T,de]}),e[65]=u,e[66]=X,e[67]=de,e[68]=ae):ae=e[68];let oe;e[69]!==Y||e[70]!==ae?(oe=t.jsxs("div",{className:"flex items-center gap-2",children:[Y,ae]}),e[69]=Y,e[70]=ae,e[71]=oe):oe=e[71],e[72]!==L||e[73]!==oe?(N=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[L,oe]}),e[72]=L,e[73]=oe,e[74]=N):N=e[74],j="flex flex-col gap-2",b=u==="selected"&&(V.length>0?V.map(H=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 surface",children:[t.jsx(et,{icon:H.icon,name:H.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:H.title}),H.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:H.description})]}),t.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>y(H.id),children:t.jsx(Ft,{size:16})})]},H.id)):t.jsxs("button",{type:"button",onClick:()=>p(!0),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.emptyStateMessage")})]})),e[6]=r,e[7]=n,e[8]=s,e[9]=u,e[10]=l,e[11]=x,e[12]=i,e[13]=v,e[14]=y,e[15]=j,e[16]=b,e[17]=S,e[18]=N}else v=e[13],y=e[14],j=e[15],b=e[16],S=e[17],N=e[18];let k;e[75]!==j||e[76]!==b?(k=t.jsx("div",{className:j,children:b}),e[75]=j,e[76]=b,e[77]=k):k=e[77];let w;e[78]!==v||e[79]!==y||e[80]!==o||e[81]!==x?(w=t.jsx(ll,{open:o,onOpenChange:p,candidates:v,selectedIds:x,onToggle:y}),e[78]=v,e[79]=y,e[80]=o,e[81]=x,e[82]=w):w=e[82];let C;return e[83]!==S||e[84]!==N||e[85]!==k||e[86]!==w?(C=t.jsxs("section",{className:S,children:[N,k,w]}),e[83]=S,e[84]=N,e[85]=k,e[86]=w,e[87]=C):C=e[87],C}function ll(a){const e=q.c(39),{open:s,onOpenChange:n,candidates:i,selectedIds:l,onToggle:r}=a,o=Z(),[p,c]=Q.useState("");let f,m,u,h,d,x,g,v,y;if(e[0]!==i||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==p||e[5]!==l||e[6]!==o){const N=p.toLowerCase(),k=i.filter(M=>M.title.toLowerCase().includes(N)||M.description?.toLowerCase().includes(N));m=Je,v=s,y=n,f=Ze,d="max-w-md";let w;e[16]!==o?(w=o("virtualMcp.subAgentsSection.title"),e[16]=o,e[17]=w):w=e[17],e[18]!==w?(x=t.jsx(lt,{children:t.jsx(rt,{children:w})}),e[18]=w,e[19]=x):x=e[19];let C;e[20]!==o?(C=o("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=o,e[21]=C):C=e[21],e[22]!==p||e[23]!==C?(g=t.jsx(Di,{value:p,onChange:c,placeholder:C,className:"w-full"}),e[22]=p,e[23]=C,e[24]=g):g=e[24],u="flex flex-col gap-1 max-h-80 overflow-y-auto",h=k.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:o("virtualMcp.subAgentsSection.noAgentsFound")}):k.map(M=>t.jsxs("button",{type:"button",onClick:()=>r(M.id),className:"flex items-center gap-3 px-2 py-2 rounded-lg hover:bg-accent transition-colors cursor-pointer w-full text-left",children:[t.jsx(Rs,{checked:l.includes(M.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(et,{icon:M.icon,name:M.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:M.title}),M.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:M.description})]})]},M.id)),e[0]=i,e[1]=n,e[2]=r,e[3]=s,e[4]=p,e[5]=l,e[6]=o,e[7]=f,e[8]=m,e[9]=u,e[10]=h,e[11]=d,e[12]=x,e[13]=g,e[14]=v,e[15]=y}else f=e[7],m=e[8],u=e[9],h=e[10],d=e[11],x=e[12],g=e[13],v=e[14],y=e[15];let j;e[25]!==u||e[26]!==h?(j=t.jsx("div",{className:u,children:h}),e[25]=u,e[26]=h,e[27]=j):j=e[27];let b;e[28]!==f||e[29]!==d||e[30]!==x||e[31]!==g||e[32]!==j?(b=t.jsxs(f,{className:d,children:[x,g,j]}),e[28]=f,e[29]=d,e[30]=x,e[31]=g,e[32]=j,e[33]=b):b=e[33];let S;return e[34]!==m||e[35]!==v||e[36]!==y||e[37]!==b?(S=t.jsx(m,{open:v,onOpenChange:y,children:b}),e[34]=m,e[35]=v,e[36]=y,e[37]=b,e[38]=S):S=e[38],S}function nt(){const a=q.c(1);let e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(at,{className:"size-6 text-muted-foreground"})}),a[0]=e):e=a[0],e}function dt(a,e){return({error:s})=>s?.message?.includes("Method not found")||s?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:a})}):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(_s,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:e("virtualMcp.dependencySelectionDialog.somethingWentWrong")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:s?.message?s.message.length>200?`${s.message.slice(0,200)}...`:s.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function sn(a){const e=q.c(23),{item:s,isSelected:n,onToggle:i,disabled:l}=a,r=l?"cursor-not-allowed opacity-50":"cursor-pointer",o=n?"bg-accent/25":"hover:bg-accent";let p;e[0]!==r||e[1]!==o?(p=ge("flex items-start gap-3 p-4 rounded-lg transition-colors",r,o),e[0]=r,e[1]=o,e[2]=p):p=e[2];let c;e[3]!==s.name?(c=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=c):c=e[4];let f;e[5]!==s.tags?(f=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=f):f=e[6];let m;e[7]!==c||e[8]!==f?(m=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c,f]}),e[7]=c,e[8]=f,e[9]=m):m=e[9];let u;e[10]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=u):u=e[11];let h;e[12]!==m||e[13]!==u?(h=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[m,u]}),e[12]=m,e[13]=u,e[14]=h):h=e[14];let d;e[15]!==l||e[16]!==n||e[17]!==i?(d=t.jsx(Rs,{checked:n,onCheckedChange:i,disabled:l,className:"mt-0.5"}),e[15]=l,e[16]=n,e[17]=i,e[18]=d):d=e[18];let x;return e[19]!==p||e[20]!==h||e[21]!==d?(x=t.jsxs("label",{className:p,children:[h,d]}),e[19]=p,e[20]=h,e[21]=d,e[22]=x):x=e[22],x}function rl(a){const e=q.c(35),{activeTab:s,onTabChange:n,showSelectAll:i,isAllSelected:l,handleSelectAll:r}=a,o=Z();let p;e[0]!==o?(p=o("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=o,e[1]=p):p=e[1];let c;e[2]!==p?(c={id:"tools",label:p},e[2]=p,e[3]=c):c=e[3];let f;e[4]!==o?(f=o("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=o,e[5]=f):f=e[5];let m;e[6]!==f?(m={id:"active",label:f},e[6]=f,e[7]=m):m=e[7];let u;e[8]!==o?(u=o("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=o,e[9]=u):u=e[9];let h;e[10]!==u?(h={id:"resources",label:u},e[10]=u,e[11]=h):h=e[11];let d;e[12]!==o?(d=o("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=o,e[13]=d):d=e[13];let x;e[14]!==d?(x={id:"prompts",label:d},e[14]=d,e[15]=x):x=e[15];let g;e[16]!==c||e[17]!==m||e[18]!==h||e[19]!==x?(g=[c,m,h,x],e[16]=c,e[17]=m,e[18]=h,e[19]=x,e[20]=g):g=e[20];let v;e[21]!==n?(v=S=>n(S),e[21]=n,e[22]=v):v=e[22];let y;e[23]!==s||e[24]!==v||e[25]!==g?(y=t.jsx(Pi,{tabs:g,activeTab:s,onTabChange:v}),e[23]=s,e[24]=v,e[25]=g,e[26]=y):y=e[26];let j;e[27]!==r||e[28]!==l||e[29]!==i||e[30]!==o?(j=i&&t.jsx("button",{type:"button",onClick:r,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:o(l?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=r,e[28]=l,e[29]=i,e[30]=o,e[31]=j):j=e[31];let b;return e[32]!==y||e[33]!==j?(b=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[y,j]}),e[32]=y,e[33]=j,e[34]=b):b=e[34],b}function zt(a){const e=q.c(13),{items:s,selections:n,onToggle:i,emptyMessage:l,disabled:r}=a;let o,p,c;if(e[0]!==r||e[1]!==l||e[2]!==s||e[3]!==i||e[4]!==n){c=Symbol.for("react.early_return_sentinel");e:{const m=s.map(ol);if(s.length===0){let u;e[8]!==l?(u=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}),e[8]=l,e[9]=u):u=e[9],c=u;break e}o="flex-1 overflow-auto px-4 py-3 space-y-1",p=s.map(u=>t.jsx(sn,{item:u,isSelected:n===null||n?.includes(u.id),onToggle:()=>i(u.id,m),disabled:r},u.id))}e[0]=r,e[1]=l,e[2]=s,e[3]=i,e[4]=n,e[5]=o,e[6]=p,e[7]=c}else o=e[5],p=e[6],c=e[7];if(c!==Symbol.for("react.early_return_sentinel"))return c;let f;return e[10]!==o||e[11]!==p?(f=t.jsx("div",{className:o,children:p}),e[10]=o,e[11]=p,e[12]=f):f=e[12],f}function ol(a){return a.id}function cl(a){const e=q.c(22),{connectionId:s,toolSelections:n,onToggleTool:i}=a,l=Z(),{org:r}=Ee();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=xt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=Ys(c),m=f.tools;let u,h,d;if(e[6]!==f.tools||e[7]!==i||e[8]!==l||e[9]!==n){d=Symbol.for("react.early_return_sentinel");e:{const g=m.map(ul);let v;e[13]!==n?(v=b=>n===null||n.includes(b.name),e[13]=n,e[14]=v):v=e[14];const j=f.tools.filter(v).map(dl);if(j.length===0){let b;e[15]!==l?(b=l("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=l,e[16]=b):b=e[16];let S;e[17]!==b?(S=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:b})}),e[17]=b,e[18]=S):S=e[18],d=S;break e}u="flex-1 overflow-auto px-4 py-3 space-y-1",h=j.map(b=>t.jsx(sn,{item:b,isSelected:!0,onToggle:()=>i(b.id,g)},b.id))}e[6]=f.tools,e[7]=i,e[8]=l,e[9]=n,e[10]=u,e[11]=h,e[12]=d}else u=e[10],h=e[11],d=e[12];if(d!==Symbol.for("react.early_return_sentinel"))return d;let x;return e[19]!==u||e[20]!==h?(x=t.jsx("div",{className:u,children:h}),e[19]=u,e[20]=h,e[21]=x):x=e[21],x}function dl(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Ls,{annotations:a.annotations,_meta:a._meta})}}function ul(a){return a.name}function ml(a){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:r}=Ee();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=xt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=Ys(c);let m;e[6]!==f.tools?(m=f.tools.map(fl),e[6]=f.tools,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(zt,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function fl(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Ls,{annotations:a.annotations,_meta:a._meta})}}function pl(a){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:r}=Ee();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=xt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=mn(c);let m;e[6]!==f.resources?(m=f.resources.map(hl),e[6]=f.resources,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(zt,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function hl(a){return{id:a.name||a.uri,name:a.name||a.uri,description:a.description}}function xl(a){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:r}=Ee();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=xt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=Oi(c);let m;e[6]!==f.prompts?(m=f.prompts.map(gl),e[6]=f.prompts,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(zt,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function gl(a){return{id:a.name,name:a.name,description:a.description}}function vl(a){const e=q.c(58),{currentConnection:s,activeTab:n,selectedId:i,formData:l,toggleTool:r,toggleResource:o,togglePrompt:p,toggleAllTools:c,toggleAllResources:f,toggleAllPrompts:m,onTabChange:u}=a,h=Z(),d=l[i],x=n==="tools"?d?.tools===null:n==="resources"?d?.resources===null:n==="prompts"?d?.prompts===null:!1,g=n!=="active";let v;e[0]!==n||e[1]!==i||e[2]!==m||e[3]!==f||e[4]!==c?(v=()=>{n==="tools"?c(i):n==="resources"?f(i):n==="prompts"&&m(i)},e[0]=n,e[1]=i,e[2]=m,e[3]=f,e[4]=c,e[5]=v):v=e[5];const y=v;let j;e[6]!==s.icon||e[7]!==s.title?(j=t.jsx(et,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[6]=s.icon,e[7]=s.title,e[8]=j):j=e[8];let b;e[9]!==s.title?(b=t.jsx("h2",{className:"text-base font-semibold truncate",children:s.title}),e[9]=s.title,e[10]=b):b=e[10];let S;e[11]!==s.description?(S=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[11]=s.description,e[12]=S):S=e[12];let N;e[13]!==b||e[14]!==S?(N=t.jsxs("div",{className:"flex-1 min-w-0",children:[b,S]}),e[13]=b,e[14]=S,e[15]=N):N=e[15];let k;e[16]!==j||e[17]!==N?(k=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[j,N]})}),e[16]=j,e[17]=N,e[18]=k):k=e[18];let w;e[19]!==n||e[20]!==y||e[21]!==x||e[22]!==u||e[23]!==g?(w=t.jsx(rl,{activeTab:n,onTabChange:u,showSelectAll:g,isAllSelected:x,handleSelectAll:y}),e[19]=n,e[20]=y,e[21]=x,e[22]=u,e[23]=g,e[24]=w):w=e[24];let C;e[25]!==n||e[26]!==l||e[27]!==i||e[28]!==h||e[29]!==r?(C=n==="active"&&t.jsx(Be,{fallback:dt(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(cl,{connectionId:i,toolSelections:l[i]?l[i].tools:[],onToggleTool:(I,A)=>r(i,I,A)})})}),e[25]=n,e[26]=l,e[27]=i,e[28]=h,e[29]=r,e[30]=C):C=e[30];let M;e[31]!==n||e[32]!==l||e[33]!==i||e[34]!==h||e[35]!==r?(M=n==="tools"&&t.jsx(Be,{fallback:dt(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(ml,{connectionId:i,selections:l[i]?l[i].tools:[],onToggle:(I,A)=>r(i,I,A)})})}),e[31]=n,e[32]=l,e[33]=i,e[34]=h,e[35]=r,e[36]=M):M=e[36];let _;e[37]!==n||e[38]!==l||e[39]!==i||e[40]!==h||e[41]!==o?(_=n==="resources"&&t.jsx(Be,{fallback:dt(h("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(pl,{connectionId:i,selections:l[i]?l[i].resources:[],onToggle:(I,A)=>o(i,I,A)})})}),e[37]=n,e[38]=l,e[39]=i,e[40]=h,e[41]=o,e[42]=_):_=e[42];let V;e[43]!==n||e[44]!==l||e[45]!==i||e[46]!==h||e[47]!==p?(V=n==="prompts"&&t.jsx(Be,{fallback:dt(h("virtualMcp.dependencySelectionDialog.promptsNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(xl,{connectionId:i,selections:l[i]?l[i].prompts:[],onToggle:(I,A)=>p(i,I,A)})})}),e[43]=n,e[44]=l,e[45]=i,e[46]=h,e[47]=p,e[48]=V):V=e[48];let E;e[49]!==_||e[50]!==V||e[51]!==C||e[52]!==M?(E=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[C,M,_,V]}),e[49]=_,e[50]=V,e[51]=C,e[52]=M,e[53]=E):E=e[53];let P;return e[54]!==E||e[55]!==k||e[56]!==w?(P=t.jsxs(t.Fragment,{children:[k,w,E]}),e[54]=E,e[55]=k,e[56]=w,e[57]=P):P=e[57],P}function bl(a){const e=q.c(7),{onClose:s}=a,n=Z();let i;e[0]!==s?(i=()=>s(!1),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.dependencySelectionDialog.done"),e[2]=n,e[3]=l):l=e[3];let r;return e[4]!==i||e[5]!==l?(r=t.jsx(Dt,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(ee,{variant:"outline",onClick:i,children:l})}),e[4]=i,e[5]=l,e[6]=r):r=e[6],r}function jl(a){const e=q.c(23),{connectionId:s,onAuthenticate:n,children:i}=a,l=Z();let r;e[0]!==s?(r={connectionId:s},e[0]=s,e[1]=r):r=e[1];const o=Us(r);if(o.supportsOAuth&&!o.isAuthenticated){let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(ii,{size:22,className:"text-muted-foreground"})}),e[2]=f):f=e[2];let m;e[3]!==l?(m=l("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=l,e[4]=m):m=e[4];let u;e[5]!==m?(u=t.jsx("p",{className:"text-sm font-medium",children:m}),e[5]=m,e[6]=u):u=e[6];let h;e[7]!==l?(h=l("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=l,e[8]=h):h=e[8];let d;e[9]!==h?(d=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:h}),e[9]=h,e[10]=d):d=e[10];let x;e[11]!==u||e[12]!==d?(x=t.jsxs("div",{className:"space-y-1",children:[u,d]}),e[11]=u,e[12]=d,e[13]=x):x=e[13];let g;e[14]!==s||e[15]!==n||e[16]!==l?(g=n&&t.jsx(ee,{variant:"outline",size:"sm",onClick:()=>n(s),children:l("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=s,e[15]=n,e[16]=l,e[17]=g):g=e[17];let v;return e[18]!==x||e[19]!==g?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[f,x,g]}),e[18]=x,e[19]=g,e[20]=v):v=e[20],v}let c;return e[21]!==i?(c=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=c):c=e[22],c}function yl(a){const e={};for(const s of a)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function ps(a){return Object.entries(a).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function hs(a,e,s,n){const i=a[e]??{tools:null,resources:null,prompts:null};return{...a,[e]:{...i,[s]:n}}}function wl(a,e){return e.type==="SET_ACTIVE_TAB"?{...a,activeTab:e.payload}:a}function Sl(a){const e=q.c(49),{open:s,onOpenChange:n,selectedId:i,form:l,connections:r,onAuthenticate:o}=a;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={activeTab:"tools"},e[0]=p):p=e[0];const[c,f]=Q.useReducer(wl,p),m=$t(i??"");let u;e[1]!==r?(u=r??[],e[1]=r,e[2]=u):u=e[2];let h;e[3]!==u?(h=yl(u),e[3]=u,e[4]=h):h=e[4];const d=h;let x;e[5]!==l||e[6]!==d?(x=(L,Y,X,T)=>{const z=d[L]?.[Y];let B;z===null?B=T.filter(O=>O!==X):z?.includes(X)?B=z.filter(O=>O!==X):(B=[...z??[],X],B.length===T.length&&(B=null)),l.setValue("connections",ps(hs(d,L,Y,B)),{shouldDirty:!0,shouldTouch:!0})},e[5]=l,e[6]=d,e[7]=x):x=e[7];const g=x;let v;e[8]!==l||e[9]!==d?(v=(L,Y)=>{const T=d[L]?.[Y]===null?[]:null;l.setValue("connections",ps(hs(d,L,Y,T)),{shouldDirty:!0,shouldTouch:!0})},e[8]=l,e[9]=d,e[10]=v):v=e[10];const y=v;let j;e[11]!==g?(j=(L,Y,X)=>g(L,"tools",Y,X),e[11]=g,e[12]=j):j=e[12];const b=j;let S;e[13]!==g?(S=(L,Y,X)=>g(L,"resources",Y,X),e[13]=g,e[14]=S):S=e[14];const N=S;let k;e[15]!==g?(k=(L,Y,X)=>g(L,"prompts",Y,X),e[15]=g,e[16]=k):k=e[16];const w=k;let C;e[17]!==y?(C=L=>y(L,"tools"),e[17]=y,e[18]=C):C=e[18];const M=C;let _;e[19]!==y?(_=L=>y(L,"resources"),e[19]=y,e[20]=_):_=e[20];const V=_;let E;e[21]!==y?(E=L=>y(L,"prompts"),e[21]=y,e[22]=E):E=e[22];const P=E;if(!i||!m)return null;let I;e[23]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(nt,{}),e[23]=I):I=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=L=>f({type:"SET_ACTIVE_TAB",payload:L}),e[24]=A):A=e[24];let R;e[25]!==m||e[26]!==c.activeTab||e[27]!==d||e[28]!==i||e[29]!==P||e[30]!==V||e[31]!==M||e[32]!==w||e[33]!==N||e[34]!==b?(R=t.jsx(vl,{currentConnection:m,activeTab:c.activeTab,selectedId:i,formData:d,toggleTool:b,toggleResource:N,togglePrompt:w,toggleAllTools:M,toggleAllResources:V,toggleAllPrompts:P,onTabChange:A},i),e[25]=m,e[26]=c.activeTab,e[27]=d,e[28]=i,e[29]=P,e[30]=V,e[31]=M,e[32]=w,e[33]=N,e[34]=b,e[35]=R):R=e[35];let U;e[36]!==o||e[37]!==i||e[38]!==R?(U=t.jsx(Q.Suspense,{fallback:I,children:t.jsx(jl,{connectionId:i,onAuthenticate:o,children:R})}),e[36]=o,e[37]=i,e[38]=R,e[39]=U):U=e[39];let K;e[40]!==n?(K=t.jsx(bl,{onClose:n}),e[40]=n,e[41]=K):K=e[41];let W;e[42]!==U||e[43]!==K?(W=t.jsxs(Ze,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[U,K]}),e[42]=U,e[43]=K,e[44]=W):W=e[44];let G;return e[45]!==n||e[46]!==s||e[47]!==W?(G=t.jsx(Je,{open:s,onOpenChange:n,children:W}),e[45]=n,e[46]=s,e[47]=W,e[48]=G):G=e[48],G}const xs="__new_instance__";function Nl(a){const e=q.c(25),{connection_id:s,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:r,onSwitchInstance:o,onNewInstance:p}=a,c=$t(s),{org:f}=Ee();if(!c){let g;return e[0]!==l?(g=t.jsx(_l,{onRemove:l}),e[0]=l,e[1]=g):g=e[1],g}let m;e[2]!==c?(m=Ai(c),e[2]=c,e[3]=m):m=e[3];const u=m;let h;e[4]!==s?(h=t.jsx(Ml,{connection_id:s}),e[4]=s,e[5]=h):h=e[5];let d;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]!==s||e[13]!==r||e[14]!==p||e[15]!==i||e[16]!==l||e[17]!==o||e[18]!==f.slug||e[19]!==u||e[20]!==n?(d=t.jsx(kl,{connection_id:s,connectionTitle:c.title,connectionDescription:c.description,connectionIcon:c.icon,connectionType:c.connection_type,connectionStatus:c.status,slug:u,orgSlug:f.slug,appName:c.app_name,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:r,onSwitchInstance:o,onNewInstance:p}),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]=s,e[13]=r,e[14]=p,e[15]=i,e[16]=l,e[17]=o,e[18]=f.slug,e[19]=u,e[20]=n,e[21]=d):d=e[21];let x;return e[22]!==h||e[23]!==d?(x=t.jsx(Q.Suspense,{fallback:h,children:d}),e[22]=h,e[23]=d,e[24]=x):x=e[24],x}function Cl(a){const e=q.c(24),{appName:s,connectionId:n,usedConnectionIds:i,onSwitchInstance:l,onNewInstance:r}=a,o=Z();let p;e[0]!==s?(p={filters:[{column:"app_name",value:s}]},e[0]=s,e[1]=p):p=e[1];const c=Jn(p);if(c.length<=1&&!r)return null;let f;e[2]!==n||e[3]!==r||e[4]!==l?(f=g=>{g===xs?r?.():l(n,g)},e[2]=n,e[3]=r,e[4]=l,e[5]=f):f=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ae,{size:"xs",className:"w-auto gap-1 shadow-none",children:t.jsx(Ie,{})}),e[6]=m):m=e[6];let u;if(e[7]!==n||e[8]!==c||e[9]!==i){let g;e[11]!==n||e[12]!==i?(g=v=>t.jsx(we,{value:v.id,className:"text-xs",disabled:v.id!==n&&i.has(v.id),children:v.title},v.id),e[11]=n,e[12]=i,e[13]=g):g=e[13],u=c.map(g),e[7]=n,e[8]=c,e[9]=i,e[10]=u}else u=e[10];let h;e[14]!==r||e[15]!==o?(h=r&&t.jsxs(we,{value:xs,className:"text-xs text-muted-foreground",children:["+ ",o("virtualMcp.connectionItem.newInstance")]}),e[14]=r,e[15]=o,e[16]=h):h=e[16];let d;e[17]!==u||e[18]!==h?(d=t.jsxs($e,{children:[u,h]}),e[17]=u,e[18]=h,e[19]=d):d=e[19];let x;return e[20]!==n||e[21]!==f||e[22]!==d?(x=t.jsxs(Fe,{value:n,onValueChange:f,children:[m,d]}),e[20]=n,e[21]=f,e[22]=d,e[23]=x):x=e[23],x}function kl({connection_id:a,connectionTitle:e,connectionDescription:s,connectionIcon:n,connectionType:i,connectionStatus:l,slug:r,orgSlug:o,appName:p,usedConnectionIds:c,onOpenSettings:f,onRemove:m,onAuthenticate:u,onSwitchInstance:h,onNewInstance:d}){const x=Us({connectionId:a}),g=Os(),y=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,j=l!=="active",b=Z(),S=async N=>{try{await g.update.mutateAsync({id:a,data:{status:N}}),re.success(b(N==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{re.error(b("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:ge("surface overflow-hidden transition-colors",(y||j)&&"shadow-edge-destructive bg-destructive/5"),children:[t.jsxs(Vs,{to:"/$org/settings/connections/$appSlug",params:{org:o,appSlug:r},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-accent transition-colors",children:[t.jsx(et,{icon:n,name:e,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:e}),y?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b("virtualMcp.connectionItem.needsAuthorization")}):j?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b(l==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):s&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s})]}),y?t.jsx(ee,{variant:"outline",size:"sm",className:"shrink-0",onClick:N=>{N.preventDefault(),N.stopPropagation(),u(a)},children:b("virtualMcp.connectionItem.authorize")}):j?t.jsxs(ee,{variant:"outline",size:"sm",className:"gap-1.5 shrink-0",onClick:N=>{N.preventDefault(),N.stopPropagation(),S("active")},children:[t.jsx(ai,{size:13}),b("virtualMcp.connectionItem.enable")]}):t.jsxs(Ce,{delayDuration:0,children:[t.jsx(ke,{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(Me,{side:"bottom",children:b("virtualMcp.connectionItem.connectionSettings")})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-t border-border bg-muted/25",children:[p&&t.jsx(Cl,{appName:p,connectionId:a,usedConnectionIds:c,onSwitchInstance:h,onNewInstance:d}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(Ce,{delayDuration:0,children:[t.jsx(ke,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon-sm",onClick:f,"aria-label":b("virtualMcp.connectionItem.configureResources"),children:t.jsx(li,{size:13})})}),t.jsx(Me,{side:"bottom",children:b("virtualMcp.connectionItem.configureResources")})]}),!j&&t.jsxs(Ce,{delayDuration:0,children:[t.jsx(ke,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:()=>S("inactive"),"aria-label":b("virtualMcp.connectionItem.disableConnection"),children:t.jsx(ri,{size:13})})}),t.jsx(Me,{side:"bottom",children:b("virtualMcp.connectionItem.disable")})]}),t.jsxs(Ce,{delayDuration:0,children:[t.jsx(ke,{asChild:!0,children:t.jsx(ee,{variant:"ghost-destructive",size:"icon-sm",onClick:m,"aria-label":b("virtualMcp.connectionItem.removeConnection"),children:t.jsx(Ft,{size:13})})}),t.jsx(Me,{side:"bottom",children:b("virtualMcp.connectionItem.remove")})]})]})]})]})}function Ml(a){const e=q.c(17),{connection_id:s}=a,n=$t(s);if(!n){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(nn,{}),e[0]=m):m=e[0],m}let i;e[1]!==n.icon||e[2]!==n.title?(i=t.jsx(et,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[1]=n.icon,e[2]=n.title,e[3]=i):i=e[3];let l;e[4]!==n.title?(l=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[4]=n.title,e[5]=l):l=e[5];let r;e[6]!==n.description?(r=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[6]=n.description,e[7]=r):r=e[7];let o;e[8]!==l||e[9]!==r?(o=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,r]}),e[8]=l,e[9]=r,e[10]=o):o=e[10];let p;e[11]!==i||e[12]!==o?(p=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,o]}),e[11]=i,e[12]=o,e[13]=p):p=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 f;return e[15]!==p?(f=t.jsxs("div",{className:"surface overflow-hidden",children:[p,c]}),e[15]=p,e[16]=f):f=e[16],f}function _l(a){const e=q.c(20),{onRemove:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.connectionItem.connectionNotFound"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==i?(l=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]=l):l=e[3];let r;e[4]!==n?(r=n("virtualMcp.connectionItem.removeConnection"),e[4]=n,e[5]=r):r=e[5];let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Ft,{size:13}),e[6]=o):o=e[6];let p;e[7]!==s||e[8]!==r?(p=t.jsx(ke,{asChild:!0,children:t.jsx(ee,{variant:"ghost-destructive",size:"icon-sm",className:"shrink-0",onClick:s,"aria-label":r,children:o})}),e[7]=s,e[8]=r,e[9]=p):p=e[9];let c;e[10]!==n?(c=n("virtualMcp.connectionItem.remove"),e[10]=n,e[11]=c):c=e[11];let f;e[12]!==c?(f=t.jsx(Me,{side:"bottom",children:c}),e[12]=c,e[13]=f):f=e[13];let m;e[14]!==p||e[15]!==f?(m=t.jsxs(Ce,{delayDuration:0,children:[p,f]}),e[14]=p,e[15]=f,e[16]=m):m=e[16];let u;return e[17]!==l||e[18]!==m?(u=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[l,m]}),e[17]=l,e[18]=m,e[19]=u):u=e[19],u}function nn(){const a=q.c(3);let e;a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),a[0]=e):e=a[0];let s;a[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e,t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-48 rounded bg-muted animate-pulse"})]})]}),a[1]=s):s=a[1];let n;return a[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"surface overflow-hidden",children:[s,t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})})]}),a[2]=n):n=a[2],n}function an(a){const e=q.c(85),{value:s,onChange:n,onColorChange:i,name:l,size:r,className:o,avatarClassName:p,showHoverOverlay:c,disabled:f}=a,m=r===void 0?"lg":r,u=c===void 0?!0:c,h=f===void 0?!1:f,d=Z(),[x,g]=Q.useState(!1),[v,y]=Q.useState("icons"),[j,b]=Q.useState(""),[S,N]=Q.useState("blue");let k;e[0]!==s?(k=oi(s),e[0]=s,e[1]=k):k=e[1];const w=k,C=w.type==="icon"||w.type==="url"&&w.color?w.color:S;let M;e[2]!==n||e[3]!==C?(M=D=>{n(wt(D,C))},e[2]=n,e[3]=C,e[4]=M):M=e[4];const _=M;let V;e[5]!==n||e[6]!==i||e[7]!==w.name||e[8]!==w.type||e[9]!==w.url?(V=D=>{N(D),i?.(D),w.type==="icon"?n(wt(w.name,D)):w.type==="url"&&n(Qt(w.url,D))},e[5]=n,e[6]=i,e[7]=w.name,e[8]=w.type,e[9]=w.url,e[10]=V):V=e[10];const E=V;let P;e[11]!==n||e[12]!==C?(P=D=>{n(Qt(D,C)),g(!1)},e[11]=n,e[12]=C,e[13]=P):P=e[13];const I=P;let A;e[14]!==n||e[15]!==C?(A=()=>{const D=$s(),te=D[Math.floor(Math.random()*D.length)];n(wt(te,C))},e[14]=n,e[15]=C,e[16]=A):A=e[16];const R=A,U=h?!1:x;let K;e[17]!==d?(K=d("common.iconPicker.changeIcon"),e[17]=d,e[18]=K):K=e[18];const W=h?"cursor-default opacity-50":"cursor-pointer";let G;e[19]!==o||e[20]!==m||e[21]!==W?(G=ge("relative group overflow-hidden",W,ci(m),o),e[19]=o,e[20]=m,e[21]=W,e[22]=G):G=e[22];let L;e[23]!==p||e[24]!==l||e[25]!==m||e[26]!==s?(L=t.jsx(Xt,{icon:s,name:l,size:m,className:p}),e[23]=p,e[24]=l,e[25]=m,e[26]=s,e[27]=L):L=e[27];let Y;e[28]!==h||e[29]!==u?(Y=u&&!h&&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(fi,{size:16,className:"text-white"})}),e[28]=h,e[29]=u,e[30]=Y):Y=e[30];let X;e[31]!==h||e[32]!==K||e[33]!==G||e[34]!==L||e[35]!==Y?(X=t.jsx(Bs,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":K,disabled:h,className:G,children:[L,Y]})}),e[31]=h,e[32]=K,e[33]=G,e[34]=L,e[35]=Y,e[36]=X):X=e[36];let T;e[37]!==l||e[38]!==s?(T=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Xt,{icon:s,name:l,size:"xl"})}),e[37]=l,e[38]=s,e[39]=T):T=e[39];let z;e[40]!==v?(z=D=>{if(D.key!=="ArrowLeft"&&D.key!=="ArrowRight")return;D.preventDefault();const te=v==="icons"?"upload":"icons";y(te),document.getElementById(`icon-picker-tab-${te}`)?.focus()},e[40]=v,e[41]=z):z=e[41];const B=v==="icons",O=v==="icons"?0:-1;let $;e[42]===Symbol.for("react.memo_cache_sentinel")?($=()=>y("icons"),e[42]=$):$=e[42];const J=v==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ie;e[43]!==J?(ie=ge("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",J),e[43]=J,e[44]=ie):ie=e[44];let de;e[45]!==d?(de=d("common.iconPicker.iconsTab"),e[45]=d,e[46]=de):de=e[46];let ae;e[47]!==B||e[48]!==O||e[49]!==ie||e[50]!==de?(ae=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":B,"aria-controls":"icon-picker-panel-icons",tabIndex:O,onClick:$,className:ie,children:de}),e[47]=B,e[48]=O,e[49]=ie,e[50]=de,e[51]=ae):ae=e[51];const oe=v==="upload",H=v==="upload"?0:-1;let ce;e[52]===Symbol.for("react.memo_cache_sentinel")?(ce=()=>y("upload"),e[52]=ce):ce=e[52];const me=v==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let pe;e[53]!==me?(pe=ge("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",me),e[53]=me,e[54]=pe):pe=e[54];let fe;e[55]!==d?(fe=d("common.iconPicker.uploadTab"),e[55]=d,e[56]=fe):fe=e[56];let he;e[57]!==oe||e[58]!==H||e[59]!==pe||e[60]!==fe?(he=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":oe,"aria-controls":"icon-picker-panel-upload",tabIndex:H,onClick:ce,className:pe,children:fe}),e[57]=oe,e[58]=H,e[59]=pe,e[60]=fe,e[61]=he):he=e[61];let ve;e[62]===Symbol.for("react.memo_cache_sentinel")?(ve=t.jsx("div",{className:"flex-1"}),e[62]=ve):ve=e[62];let ue;e[63]!==z||e[64]!==ae||e[65]!==he?(ue=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:z,children:[ae,he,ve]}),e[63]=z,e[64]=ae,e[65]=he,e[66]=ue):ue=e[66];let F;e[67]!==E||e[68]!==R||e[69]!==_||e[70]!==I||e[71]!==w.name||e[72]!==w.type||e[73]!==j||e[74]!==C||e[75]!==v?(F=v==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(Pl,{search:j,onSearchChange:b,selectedColor:C,onColorChange:E,onSelectIcon:_,onRandom:R,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(Ol,{onUpload:I})}),e[67]=E,e[68]=R,e[69]=_,e[70]=I,e[71]=w.name,e[72]=w.type,e[73]=j,e[74]=C,e[75]=v,e[76]=F):F=e[76];let se;e[77]!==T||e[78]!==ue||e[79]!==F?(se=t.jsx(Ws,{align:"start",className:"w-80 p-0",onOpenAutoFocus:Vl,children:t.jsxs("div",{className:"flex flex-col",children:[T,ue,F]})}),e[77]=T,e[78]=ue,e[79]=F,e[80]=se):se=e[80];let Te;return e[81]!==X||e[82]!==se||e[83]!==U?(Te=t.jsxs(Ks,{open:U,onOpenChange:g,children:[X,se]}),e[81]=X,e[82]=se,e[83]=U,e[84]=Te):Te=e[84],Te}function Vl(a){return a.preventDefault()}function Tl(a){const e=q.c(33),{selectedColor:s,onColorChange:n}=a,i=Z(),[l,r]=Q.useState(!1);let o,p,c,f,m,u,h;if(e[0]!==l||e[1]!==s){const S=Fs(s);p=Ks,u=l,h=r,o=Bs,m=!0,c="button",f=ge("h-6 w-6 rounded-full shrink-0 ring-2 ring-offset-2 ring-offset-background transition-all cursor-pointer hover:scale-110",S.dot,"ring-foreground/20"),e[0]=l,e[1]=s,e[2]=o,e[3]=p,e[4]=c,e[5]=f,e[6]=m,e[7]=u,e[8]=h}else o=e[2],p=e[3],c=e[4],f=e[5],m=e[6],u=e[7],h=e[8];let d;e[9]!==i?(d=i("common.iconPicker.changeColor"),e[9]=i,e[10]=d):d=e[10];let x;e[11]!==i?(x=i("common.iconPicker.changeColor"),e[11]=i,e[12]=x):x=e[12];let g;e[13]!==c||e[14]!==f||e[15]!==d||e[16]!==x?(g=t.jsx("button",{type:c,className:f,title:d,"aria-label":x}),e[13]=c,e[14]=f,e[15]=d,e[16]=x,e[17]=g):g=e[17];let v;e[18]!==o||e[19]!==m||e[20]!==g?(v=t.jsx(o,{asChild:m,children:g}),e[18]=o,e[19]=m,e[20]=g,e[21]=v):v=e[21];let y;e[22]!==n||e[23]!==s?(y=hi.map(S=>t.jsx("button",{type:"button",onClick:()=>{n(S.name),r(!1)},className:ge("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",S.dot,s===S.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:S.name,"aria-label":S.name},S.name)),e[22]=n,e[23]=s,e[24]=y):y=e[24];let j;e[25]!==y?(j=t.jsx(Ws,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:Dl,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:y})}),e[25]=y,e[26]=j):j=e[26];let b;return e[27]!==p||e[28]!==j||e[29]!==u||e[30]!==h||e[31]!==v?(b=t.jsxs(p,{open:u,onOpenChange:h,children:[v,j]}),e[27]=p,e[28]=j,e[29]=u,e[30]=h,e[31]=v,e[32]=b):b=e[32],b}function Dl(a){return a.preventDefault()}function Pl(a){const e=q.c(55),{search:s,onSearchChange:n,selectedColor:i,onColorChange:l,onSelectIcon:r,onRandom:o,currentIconName:p}=a,c=Z();let f,m,u,h,d,x,g;if(e[0]!==p||e[1]!==l||e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i||e[7]!==c){const S=$s(),N=Fs(i);m=di(S,s),x="flex flex-col";let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Mt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=k):k=e[15];let w;e[16]!==n?(w=A=>n(A.target.value),e[16]=n,e[17]=w):w=e[17];let C;e[18]!==c?(C=c("common.iconPicker.filterPlaceholder"),e[18]=c,e[19]=C):C=e[19];let M;e[20]!==s||e[21]!==w||e[22]!==C?(M=t.jsxs("div",{className:"relative flex-1",children:[k,t.jsx(Se,{value:s,onChange:w,placeholder:C,size:"sm",className:"text-xs pl-7"})]}),e[20]=s,e[21]=w,e[22]=C,e[23]=M):M=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 E;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(pi,{className:"size-3.5 text-muted-foreground"}),e[28]=E):E=e[28];let P;e[29]!==o||e[30]!==_||e[31]!==V?(P=t.jsx(ee,{type:"button",variant:"outline",size:"icon",onClick:o,className:"shrink-0",title:_,"aria-label":V,children:E}),e[29]=o,e[30]=_,e[31]=V,e[32]=P):P=e[32];let I;e[33]!==l||e[34]!==i?(I=t.jsx(Tl,{selectedColor:i,onColorChange:l}),e[33]=l,e[34]=i,e[35]=I):I=e[35],e[36]!==P||e[37]!==I||e[38]!==M?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[M,P,I]}),e[36]=P,e[37]=I,e[38]=M,e[39]=g):g=e[39],f=Ii,d="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",h=m.map(A=>{const R=ui(A);return R?t.jsx("button",{type:"button",onClick:()=>r(A),className:ge("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",p===A?ge(N.bg,N.text):ge(N.text,"hover:bg-accent")),title:A,"aria-label":mi(A),children:t.jsx(R,{size:18})},A):null}),e[0]=p,e[1]=l,e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=c,e[8]=f,e[9]=m,e[10]=u,e[11]=h,e[12]=d,e[13]=x,e[14]=g}else f=e[8],m=e[9],u=e[10],h=e[11],d=e[12],x=e[13],g=e[14];let v;e[40]!==u||e[41]!==h?(v=t.jsx("div",{className:u,children:h}),e[40]=u,e[41]=h,e[42]=v):v=e[42];let y;e[43]!==m.length||e[44]!==c?(y=m.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]=m.length,e[44]=c,e[45]=y):y=e[45];let j;e[46]!==f||e[47]!==d||e[48]!==v||e[49]!==y?(j=t.jsxs(f,{className:d,children:[v,y]}),e[46]=f,e[47]=d,e[48]=v,e[49]=y,e[50]=j):j=e[50];let b;return e[51]!==x||e[52]!==g||e[53]!==j?(b=t.jsxs("div",{className:x,children:[g,j]}),e[51]=x,e[52]=g,e[53]=j,e[54]=b):b=e[54],b}function Ol(a){const e=q.c(46),{onUpload:s}=a,n=Z(),i=Q.useRef(null);let l;e[0]!==s||e[1]!==n?(l=P=>{const I=P.target.files?.[0];if(!I)return;if(I.size>2097152){re.error(n("common.iconPicker.imageTooLarge")),P.target.value="";return}const A=new FileReader;A.onerror=()=>{re.error(n("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},A.onloadend=()=>{A.readyState===FileReader.DONE&&A.result&&s(A.result),i.current&&(i.current.value="")},A.readAsDataURL(I)},e[0]=s,e[1]=n,e[2]=l):l=e[2];const r=l,[o,p]=Q.useState("");let c;e[3]!==s||e[4]!==o?(c=()=>{const P=o.trim();P&&(s(P),p(""))},e[3]=s,e[4]=o,e[5]=c):c=e[5];const f=c;let m;e[6]!==r?(m=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:r}),e[6]=r,e[7]=m):m=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i.current?.click(),e[8]=u):u=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx($i,{size:20}),e[9]=h):h=e[9];let d;e[10]!==n?(d=n("common.iconPicker.uploadHint"),e[10]=n,e[11]=d):d=e[11];let x;e[12]!==d?(x=t.jsxs("button",{type:"button",onClick:u,className:"h-24 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent transition-colors flex flex-col items-center justify-center gap-2 text-muted-foreground hover:text-foreground",children:[h,t.jsx("span",{className:"text-xs",children:d})]}),e[12]=d,e[13]=x):x=e[13];let g;e[14]!==n?(g=n("common.iconPicker.or"),e[14]=n,e[15]=g):g=e[15];let v;e[16]!==g?(v=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=v):v=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex-1 h-px bg-border"}),e[18]=y):y=e[18];let j;e[19]!==v?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[v,y]}),e[19]=v,e[20]=j):j=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=P=>p(P.target.value),e[21]=b):b=e[21];let S;e[22]!==n?(S=n("common.iconPicker.pasteUrlPlaceholder"),e[22]=n,e[23]=S):S=e[23];let N;e[24]!==f?(N=P=>{P.key==="Enter"&&(P.preventDefault(),f())},e[24]=f,e[25]=N):N=e[25];let k;e[26]!==o||e[27]!==S||e[28]!==N?(k=t.jsx(Se,{value:o,onChange:b,placeholder:S,className:"h-8 text-xs flex-1",onKeyDown:N}),e[26]=o,e[27]=S,e[28]=N,e[29]=k):k=e[29];let w;e[30]!==o?(w=o.trim(),e[30]=o,e[31]=w):w=e[31];const C=!w;let M;e[32]!==n?(M=n("common.iconPicker.apply"),e[32]=n,e[33]=M):M=e[33];let _;e[34]!==f||e[35]!==C||e[36]!==M?(_=t.jsx(ee,{variant:"outline",className:"shrink-0",onClick:f,disabled:C,children:M}),e[34]=f,e[35]=C,e[36]=M,e[37]=_):_=e[37];let V;e[38]!==k||e[39]!==_?(V=t.jsxs("div",{className:"flex items-center gap-1.5",children:[k,_]}),e[38]=k,e[39]=_,e[40]=V):V=e[40];let E;return e[41]!==j||e[42]!==V||e[43]!==m||e[44]!==x?(E=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[m,x,j,V]}),e[41]=j,e[42]=V,e[43]=m,e[44]=x,e[45]=E):E=e[45],E}function Al(a){const e=q.c(13),{viewId:s,blocksSite:n}=a,i=n===void 0?!1:n;if(s==="overview"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Es,{size:16}),e[0]=r):r=e[0],r}if(s==="reports"){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Jt,{size:16}),e[1]=r):r=e[1],r}if(s==="board"){let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(xi,{size:16}),e[2]=r):r=e[2],r}if(s==="site-editor"){let r;return e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(zi,{size:16}),e[3]=r):r=e[3],r}if(s==="assets"){let r;return e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ei,{size:16}),e[4]=r):r=e[4],r}if(s==="releases"){let r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(gi,{size:16}),e[5]=r):r=e[5],r}if(s==="hosting"){let r;return e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(fn,{size:16}),e[6]=r):r=e[6],r}if(s==="e2e"){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(vi,{size:16}),e[7]=r):r=e[7],r}if(s==="analytics"){let r;return e[8]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Jt,{size:16}),e[8]=r):r=e[8],r}if(s==="cdn"){let r;return e[9]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(bi,{size:16}),e[9]=r):r=e[9],r}if(s==="experiments"&&i){let r;return e[10]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ji,{size:16}),e[10]=r):r=e[10],r}if(s==="calendar"){let r;return e[11]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(yi,{size:16}),e[11]=r):r=e[11],r}let l;return e[12]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(zs,{size:16}),e[12]=l):l=e[12],l}function gs(a){const e=q.c(51),{pinned:s,canSetMainView:n,onOpen:i,onTogglePin:l,onSetMainView:r}=a,o=Z(),p=s?"text-foreground":"text-muted-foreground/40";let c;e[0]!==p?(c=ge("size-7",p),e[0]=p,e[1]=c):c=e[1];let f;e[2]!==s||e[3]!==o?(f=o(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=s,e[3]=o,e[4]=f):f=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Zt,{size:16}),e[5]=m):m=e[5];let u;e[6]!==l||e[7]!==s||e[8]!==c||e[9]!==f?(u=t.jsx(ke,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon",className:c,"aria-label":f,"aria-pressed":s,onClick:l,children:m})}),e[6]=l,e[7]=s,e[8]=c,e[9]=f,e[10]=u):u=e[10];let h;e[11]!==s||e[12]!==o?(h=o(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=s,e[12]=o,e[13]=h):h=e[13];let d;e[14]!==h?(d=t.jsx(Me,{side:"top",children:h}),e[14]=h,e[15]=d):d=e[15];let x;e[16]!==u||e[17]!==d?(x=t.jsxs(Ce,{delayDuration:0,children:[u,d]}),e[16]=u,e[17]=d,e[18]=x):x=e[18];let g;e[19]!==o?(g=o("virtualMcp.settings.views.rowActions"),e[19]=o,e[20]=g):g=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Fi,{size:16}),e[21]=v):v=e[21];let y;e[22]!==g?(y=t.jsx(ks,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":g,children:v})}),e[22]=g,e[23]=y):y=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(pn,{size:14}),e[24]=j):j=e[24];let b;e[25]!==o?(b=o("virtualMcp.settings.views.open"),e[25]=o,e[26]=b):b=e[26];let S;e[27]!==i||e[28]!==b?(S=t.jsxs(Qe,{onClick:i,children:[j,b]}),e[27]=i,e[28]=b,e[29]=S):S=e[29];let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Zt,{size:14}),e[30]=N):N=e[30];let k;e[31]!==s||e[32]!==o?(k=o(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=s,e[32]=o,e[33]=k):k=e[33];let w;e[34]!==l||e[35]!==k?(w=t.jsxs(Qe,{onClick:l,children:[N,k]}),e[34]=l,e[35]=k,e[36]=w):w=e[36];let C;e[37]!==n||e[38]!==r||e[39]!==o?(C=n&&t.jsxs(Qe,{onClick:r,children:[t.jsx(Es,{size:14}),o("virtualMcp.settings.views.setMainView")]}),e[37]=n,e[38]=r,e[39]=o,e[40]=C):C=e[40];let M;e[41]!==S||e[42]!==w||e[43]!==C?(M=t.jsxs(Ms,{align:"end",children:[S,w,C]}),e[41]=S,e[42]=w,e[43]=C,e[44]=M):M=e[44];let _;e[45]!==y||e[46]!==M?(_=t.jsxs(Cs,{children:[y,M]}),e[45]=y,e[46]=M,e[47]=_):_=e[47];let V;return e[48]!==_||e[49]!==x?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[x,_]}),e[48]=_,e[49]=x,e[50]=V):V=e[50],V}const vs=a=>a.stopPropagation();function Il(a){const e=q.c(8),{icon:s,title:n}=a;let i;e[0]!==s||e[1]!==n?(i=t.jsx(et,{icon:s,name:n,size:"xs",className:"shrink-0"}),e[0]=s,e[1]=n,e[2]=i):i=e[2];let l;e[3]!==n?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[3]=n,e[4]=l):l=e[4];let r;return e[5]!==i||e[6]!==l?(r=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,l]}),e[5]=i,e[6]=l,e[7]=r):r=e[7],r}function $l(a){const e=q.c(70),{views:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.views.defaults"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.layoutTabContent.mainView"),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==n?(r=n("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=n,e[5]=r):r=e[5];const o=s.defaultMainView,p=s.setMainView;let c;e[6]!==n?(c=n("virtualMcp.layoutTabContent.mainView"),e[6]=n,e[7]=c):c=e[7];let f;e[8]!==n?(f=n("virtualMcp.layoutTabContent.noMainView"),e[8]=n,e[9]=f):f=e[9];let m;e[10]!==f?(m=t.jsx(Ie,{placeholder:f}),e[10]=f,e[11]=m):m=e[11];let u;e[12]!==c||e[13]!==m?(u=t.jsx(Ae,{"aria-label":c,size:"sm",className:"w-36 shrink-0 @min-xl/project-settings:w-44",children:m}),e[12]=c,e[13]=m,e[14]=u):u=e[14];let h;e[15]!==s.defaultMainOptions?(h=s.defaultMainOptions.map(Fl),e[15]=s.defaultMainOptions,e[16]=h):h=e[16];let d;e[17]!==h?(d=t.jsx($e,{children:h}),e[17]=h,e[18]=d):d=e[18];let x;e[19]!==d||e[20]!==u||e[21]!==s.defaultMainView||e[22]!==s.setMainView?(x=t.jsxs(Fe,{value:o,onValueChange:p,children:[u,d]}),e[19]=d,e[20]=u,e[21]=s.defaultMainView,e[22]=s.setMainView,e[23]=x):x=e[23];let g;e[24]!==x||e[25]!==l||e[26]!==r?(g=t.jsx(st,{title:l,description:r,action:x}),e[24]=x,e[25]=l,e[26]=r,e[27]=g):g=e[27];let v;e[28]!==n?(v=n("virtualMcp.layoutTabContent.showChat"),e[28]=n,e[29]=v):v=e[29];let y;e[30]!==n?(y=n("virtualMcp.layoutTabContent.showChatDescription"),e[30]=n,e[31]=y):y=e[31];let j;e[32]!==n?(j=n("virtualMcp.layoutTabContent.showChat"),e[32]=n,e[33]=j):j=e[33];const b=s.noMainView?!0:s.chatDefaultOpen;let S;e[34]!==j||e[35]!==b||e[36]!==s.noMainView||e[37]!==s.setChatDefaultOpen?(S=t.jsx(ke,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(gt,{"aria-label":j,checked:b,disabled:s.noMainView,onCheckedChange:s.setChatDefaultOpen})})}),e[34]=j,e[35]=b,e[36]=s.noMainView,e[37]=s.setChatDefaultOpen,e[38]=S):S=e[38];let N;e[39]!==n||e[40]!==s.noMainView?(N=s.noMainView&&t.jsx(Me,{side:"top",children:n("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[39]=n,e[40]=s.noMainView,e[41]=N):N=e[41];let k;e[42]!==S||e[43]!==N?(k=t.jsxs(Ce,{delayDuration:0,children:[S,N]}),e[42]=S,e[43]=N,e[44]=k):k=e[44];let w;e[45]!==v||e[46]!==y||e[47]!==k?(w=t.jsx(st,{title:v,description:y,action:k}),e[45]=v,e[46]=y,e[47]=k,e[48]=w):w=e[48];let C;e[49]!==g||e[50]!==w?(C=t.jsxs(Re,{children:[g,w]}),e[49]=g,e[50]=w,e[51]=C):C=e[51];let M;e[52]!==i||e[53]!==C?(M=t.jsx(We,{title:i,children:C}),e[52]=i,e[53]=C,e[54]=M):M=e[54];let _;e[55]!==n?(_=n("virtualMcp.settings.views.sidebar"),e[55]=n,e[56]=_):_=e[56];let V;e[57]!==s?(V=s.projectViews.map(R=>{const U=s.pinned(R);return t.jsx(st,{icon:t.jsx(Al,{viewId:R,blocksSite:s.blocksSite}),title:s.labels[R],onClick:()=>s.openView(R),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(gs,{pinned:U,canSetMainView:U&&!s.isMainView(R),onOpen:()=>s.openView(R),onTogglePin:()=>s.togglePin(R,!U),onSetMainView:()=>s.setMainView(R)}),t.jsx("span",{onClick:()=>s.openView(R),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Gt,{size:16})})]})},R)}),e[57]=s,e[58]=V):V=e[58];let E;e[59]!==s?(E=s.connectionsData.flatMap(R=>[t.jsx(Il,{icon:R.icon,title:R.title},`${R.id}:header`),...R.uiTools.map(U=>{const K=s.pinnedAppViews.find(Y=>Y.connectionId===R.id&&Y.toolName===U.name),W=!!K,G=hn(R.id,U.name),L=`ext-apps:${R.id}:${U.name}`;return t.jsx(st,{onClick:()=>s.openView(G),icon:W?t.jsx("span",{onClick:vs,children:t.jsx(an,{value:K.icon??null,name:K.label||U.name,size:"xs",showHoverOverlay:!1,onChange:Y=>s.setAppViewIcon(R.id,U.name,Y)})}):t.jsx(zs,{size:16}),title:W?t.jsx("span",{onClick:vs,children:t.jsx(Se,{value:K.label,onChange:Y=>s.setAppViewLabel(R.id,U.name,Y.target.value),onBlur:s.commitAppViewLabel,"aria-label":U.title??_t(U.name),className:"h-7 w-full max-w-52 text-sm"})}):U.title??_t(U.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(gs,{pinned:W,canSetMainView:W&&!s.isMainView(L),onOpen:()=>s.openView(G),onTogglePin:()=>s.toggleAppViewPin(R.id,U.name),onSetMainView:()=>s.setMainView(L)}),t.jsx("span",{onClick:()=>s.openView(G),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Gt,{size:16})})]})},`${R.id}:${U.name}`)})]),e[59]=s,e[60]=E):E=e[60];let P;e[61]!==V||e[62]!==E?(P=t.jsxs(Re,{children:[V,E]}),e[61]=V,e[62]=E,e[63]=P):P=e[63];let I;e[64]!==_||e[65]!==P?(I=t.jsx(We,{title:_,children:P}),e[64]=_,e[65]=P,e[66]=I):I=e[66];let A;return e[67]!==M||e[68]!==I?(A=t.jsxs(t.Fragment,{children:[M,I]}),e[67]=M,e[68]=I,e[69]=A):A=e[69],A}function Fl(a){return t.jsx(we,{value:a.value,children:a.label},a.value)}const ln="site-editor",El=new Set([ln,"content"]);function zl({virtualMcpId:a,form:e,flushAndSave:s}){const n=Z(),i=Pt(),{openPanel:l}=Yi(),r=As(a),o=Bi(r),p=qs(a),c=Ji(a),f=(r?.connections??[]).map(T=>T.connection_id).sort(),{data:m}=Ts({queryKey:Ot.projectConnectionDetails(a,f),enabled:f.length>0,queryFn:async()=>await Promise.all(f.map(async z=>{try{const{item:B}=await i.call("COLLECTION_CONNECTIONS_GET",{id:z}),O=(B?.tools??[]).flatMap($=>{const J=Ri($._meta);return J?[{name:$.name,title:$.title,description:$.description,resourceUri:J}]:[]});return{fetchOk:!0,id:z,title:B?.title??z,icon:B?.icon??null,uiTools:O}}catch{return{fetchOk:!1,id:z,title:z,icon:null,uiTools:[]}}}))}),u=(m??[]).filter(T=>T.uiTools.length>0),h=new Set([...xn,...gn]),d=e.watch("metadata.ui.pinnedViews")??[],x=e.watch("metadata.ui.layout")??null,g=x?.defaultMainView??null,v=x?.chatDefaultOpen??!1,y=o.presence.calendar,j=e.watch("metadata.sidebarViewsSeen"),b=Vt(Tt({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:x}}),e.watch("metadata.sidebarViewsVersion"),ss(j,y)),S=c??(r?Vt(Tt(r.metadata),r.metadata.sidebarViewsVersion,ss(r.metadata.sidebarViewsSeen,y)):b),N=(()=>{if(!g||g.type==="chat")return"";const T=vn(g.type);return T==="instructions"||T==="connections"||T==="layout"?"settings":El.has(T)?ln:h.has(T)?T:`${T}:${g.id??""}:${g.toolName??""}`})(),k=N==="",w=T=>{const[z,B,O]=T.split(":");return z?h.has(z)?{type:z}:z==="ext-apps"&&B?{type:"ext-apps",id:B,toolName:O||void 0}:null:null},C=T=>{e.setValue("metadata.ui.pinnedViews",T,{shouldDirty:!0})},M=T=>{e.setValue("metadata.ui.layout",{...x,...T},{shouldDirty:!0})},_=Q.useRef(!1);if(m&&m.length>0&&!_.current){_.current=!0;const T=new Set((m??[]).filter($=>$.fetchOk).map($=>$.id)),z=new Set(u.flatMap($=>$.uiTools.map(J=>`${$.id}:${J.name}`))),B=new Set(f),O=d.filter($=>B.has($.connectionId)&&(!T.has($.connectionId)||z.has(`${$.connectionId}:${$.toolName}`)));O.length!==d.length&&(C(O),g?.type==="ext-apps"&&!O.some($=>$.connectionId===g.id&&$.toolName===g.toolName)&&M({defaultMainView:{type:"settings"}}))}const V=(T,z)=>{if(d.some(O=>O.connectionId===T&&O.toolName===z)){const O=d.filter(J=>!(J.connectionId===T&&J.toolName===z));C(O);const $=`ext-apps:${T}:${z}`;N===$&&M({defaultMainView:{type:"settings"}})}else{const O=u.find($=>$.id===T)?.uiTools.find($=>$.name===z)?.title;C([...d,{connectionId:T,toolName:z,label:O??_t(z),icon:null}])}s()},E=(T,z,B)=>{C(d.map(O=>O.connectionId===T&&O.toolName===z?{...O,label:B}:O))},P=()=>{s()},I=(T,z,B)=>{C(d.map(O=>O.connectionId===T&&O.toolName===z?{...O,icon:B}:O)),s()},A=T=>{M({defaultMainView:w(T)}),s()},R=(T,z)=>{const B=qi(S,T,z,1);e.setValue("metadata.sidebarViews",B,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),y&&e.setValue("metadata.sidebarViewsSeen",Hi(r?.metadata.sidebarViewsSeen??j,y),{shouldDirty:!0}),p.stage(B,S);const O=Qi(g,T,z);O!==g&&M({defaultMainView:O})},U=Gs(r?.metadata),K=Wi(U,o.presence),W=Ki(K),G=Gi(S,K,1),L={overview:n("sidebar.navDestinations.home"),reports:n("sidebar.navDestinations.reports"),board:n("sidebar.navDestinations.tasks"),"site-editor":n("virtualMcp.layoutTabContent.siteEditor"),assets:n("common.mainPanelTabs.assets"),releases:n("common.mainPanelTabs.releases"),hosting:n("common.mainPanelTabs.hosting"),e2e:n("common.mainPanelTabs.e2e"),analytics:n("common.mainPanelTabs.analytics"),cdn:n("common.mainPanelTabs.cdn"),automations:n("virtualMcp.layoutTabContent.automations"),experiments:n("experiments.title"),calendar:n("common.mainPanelTabs.calendar")},Y=[];for(const T of G)T!=="automations"&&Y.push({value:T,label:L[T]});for(const T of d)Y.push({value:`ext-apps:${T.connectionId}:${T.toolName}`,label:T.label||T.toolName});return G.includes("automations")&&Y.push({value:"automations",label:L.automations}),Y.push({value:"settings",label:n("virtualMcp.layoutTabContent.settings")}),{projectViews:W,blocksSite:y,labels:L,pinned:T=>S.includes(T),isMainView:T=>N===T,defaultMainView:N,defaultMainOptions:Y,noMainView:k,chatDefaultOpen:v,connectionsData:u,pinnedAppViews:d,openView:T=>l(T,{virtualmcpid:a}),togglePin:(T,z)=>R(T,z),setMainView:A,setChatDefaultOpen:T=>{M({chatDefaultOpen:T}),s()},toggleAppViewPin:V,setAppViewIcon:I,setAppViewLabel:E,commitAppViewLabel:P}}function Rl(a){const e=q.c(55),{form:s,onCommit:n}=a,i=Z(),l=Q.useId();let r;e[0]!==i?(r=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=r):r=e[1];let o;e[2]!==r?(o=t.jsx("p",{className:"text-sm font-medium",children:r}),e[2]=r,e[3]=o):o=e[3];let p;e[4]!==i?(p=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=p):p=e[5];let c;e[6]!==p?(c=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:p}),e[6]=p,e[7]=c):c=e[7];let f;e[8]!==o||e[9]!==c?(f=t.jsxs("div",{children:[o,c]}),e[8]=o,e[9]=c,e[10]=f):f=e[10];let m;e[11]!==s||e[12]!==n||e[13]!==i?(m=_=>{const{field:V}=_;return t.jsx("div",{className:"justify-self-start",children:t.jsx(an,{value:V.value??null,onChange:E=>{V.onChange(E),n()},onColorChange:E=>{s.setValue("metadata.ui.themeColor",E,{shouldDirty:!0}),n()},name:s.watch("title")||i("virtualMcp.virtualMcp.agentNameFallback"),size:"md",avatarClassName:"[&_svg]:w-1/2 [&_svg]:h-1/2"})})},e[11]=s,e[12]=n,e[13]=i,e[14]=m):m=e[14];let u;e[15]!==s.control||e[16]!==m?(u=t.jsx(be,{name:"icon",control:s.control,render:m}),e[15]=s.control,e[16]=m,e[17]=u):u=e[17];let h;e[18]!==f||e[19]!==u?(h=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[f,u]}),e[18]=f,e[19]=u,e[20]=h):h=e[20];const d=`${l}-name`;let x;e[21]!==i?(x=i("virtualMcp.settings.identity.name"),e[21]=i,e[22]=x):x=e[22];let g;e[23]!==x||e[24]!==d?(g=t.jsx("label",{htmlFor:d,className:"text-sm font-medium",children:x}),e[23]=x,e[24]=d,e[25]=g):g=e[25];let v;e[26]!==l||e[27]!==n||e[28]!==i?(v=_=>{const{field:V}=_;return t.jsx(Se,{...V,id:`${l}-name`,value:V.value??"",onBlur:()=>{V.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=l,e[27]=n,e[28]=i,e[29]=v):v=e[29];let y;e[30]!==s.control||e[31]!==v?(y=t.jsx(be,{name:"title",control:s.control,render:v}),e[30]=s.control,e[31]=v,e[32]=y):y=e[32];let j;e[33]!==g||e[34]!==y?(j=t.jsxs(je,{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]=j):j=e[35];const b=`${l}-description`;let S;e[36]!==i?(S=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=S):S=e[37];let N;e[38]!==b||e[39]!==S?(N=t.jsx("label",{htmlFor:b,className:"text-sm font-medium",children:S}),e[38]=b,e[39]=S,e[40]=N):N=e[40];let k;e[41]!==l||e[42]!==n||e[43]!==i?(k=_=>{const{field:V}=_;return t.jsx(mt,{...V,id:`${l}-description`,value:V.value??"",onBlur:()=>{V.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=l,e[42]=n,e[43]=i,e[44]=k):k=e[44];let w;e[45]!==s.control||e[46]!==k?(w=t.jsx(be,{name:"description",control:s.control,render:k}),e[45]=s.control,e[46]=k,e[47]=w):w=e[47];let C;e[48]!==N||e[49]!==w?(C=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[N,w]}),e[48]=N,e[49]=w,e[50]=C):C=e[50];let M;return e[51]!==j||e[52]!==C||e[53]!==h?(M=t.jsxs(Re,{children:[h,j,C]}),e[51]=j,e[52]=C,e[53]=h,e[54]=M):M=e[54],M}function Ll(a){const e=q.c(8),{section:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.navigation"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==s||e[3]!==n?(l=na.map(o=>{const{titleKey:p}=ia[o];return t.jsx(Ye.Tab,{active:s===o,asChild:!0,children:t.jsx(Vs,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:c=>({...c,section:o==="general"?void 0:o}),children:n(p)})},o)}),e[2]=s,e[3]=n,e[4]=l):l=e[4];let r;if(e[5]!==i||e[6]!==l){const o=t.jsx(Ye.Tabs,{"aria-label":i,children:l});r=t.jsx(bn.Toolbar.Left.Portal,{fallback:o,children:o}),e[5]=i,e[6]=l,e[7]=r}else r=e[7];return r}function Ul(){const a=q.c(8),e=At();let s;a[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},a[0]=s):s=a[0];const{section:n}=jn(s);let i;a[1]!==n?(i=aa(n)?n:"general",a[1]=n,a[2]=i):i=a[2];let l;a[3]!==e?(l=o=>e({to:".",search:p=>({...p,section:o??void 0})}),a[3]=e,a[4]=l):l=a[4];let r;return a[5]!==i||a[6]!==l?(r={section:i,openSection:l},a[5]=i,a[6]=l,a[7]=r):r=a[7],r}function rn(a){const e=q.c(20),{value:s,label:n,copiedLabel:i,variant:l,size:r,className:o,copiedClassName:p}=a,c=l===void 0?"ghost":l,f=r===void 0?"icon-sm":r,{handleCopy:m,copied:u}=la();let h;e[0]!==m||e[1]!==s?(h=()=>{m(s).catch(Yl)},e[0]=m,e[1]=s,e[2]=h):h=e[2];const d=u&&p;let x;e[3]!==o||e[4]!==d?(x=ge(o,d),e[3]=o,e[4]=d,e[5]=x):x=e[5];let g;e[6]!==u?(g=u?t.jsx(ot,{className:"text-success"}):t.jsx(vt,{}),e[6]=u,e[7]=g):g=e[7];let v;e[8]!==n||e[9]!==f||e[10]!==h||e[11]!==x||e[12]!==g||e[13]!==c?(v=t.jsx(ee,{type:"button",variant:c,size:f,"aria-label":n,onClick:h,className:x,children:g}),e[8]=n,e[9]=f,e[10]=h,e[11]=x,e[12]=g,e[13]=c,e[14]=v):v=e[14];const y=u?i:"";let j;e[15]!==y?(j=t.jsx("span",{className:"sr-only","aria-live":"polite",children:y}),e[15]=y,e[16]=j):j=e[16];let b;return e[17]!==v||e[18]!==j?(b=t.jsxs(t.Fragment,{children:[v,j]}),e[17]=v,e[18]=j,e[19]=b):b=e[19],b}function Yl(){}function Bl(a){const e=q.c(14),{id:s,value:n,copyLabel:i,copiedLabel:l,className:r}=a;let o;e[0]!==r?(o=ge("relative h-fit",r),e[0]=r,e[1]=o):o=e[1];let p;e[2]!==s||e[3]!==n?(p=t.jsx(Se,{id:s,value:n,readOnly:!0,disabled:!0,className:"pr-10 font-mono"}),e[2]=s,e[3]=n,e[4]=p):p=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=ge("absolute top-1/2 right-1 -translate-y-1/2 transition-opacity","opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 pointer-coarse:opacity-100"),e[5]=c):c=e[5];let f;e[6]!==l||e[7]!==i||e[8]!==n?(f=t.jsx(rn,{value:n,label:i,copiedLabel:l,className:c,copiedClassName:"opacity-100"}),e[6]=l,e[7]=i,e[8]=n,e[9]=f):f=e[9];let m;return e[10]!==o||e[11]!==p||e[12]!==f?(m=t.jsxs("div",{className:o,children:[p,f]}),e[10]=o,e[11]=p,e[12]=f,e[13]=m):m=e[13],m}async function bs(a){const e=await a.json().catch(()=>({}));if(!a.ok)throw new Error(e.error??`HTTP ${a.status}`);return e}function Wl(a){const e=q.c(106),{orgSlug:s,virtualMcpId:n}=a,i=Z(),l=Ds(),r=`/api/${s}/hosted/${encodeURIComponent(n)}/site-tokens`;let o;e[0]!==s||e[1]!==n?(o=Ot.hostedSiteTokens(s,n),e[0]=s,e[1]=n,e[2]=o):o=e[2];const p=o,[c,f]=Q.useState(null),m=Q.useId();let u;e[3]!==r?(u=async()=>bs(await fetch(r)),e[3]=r,e[4]=u):u=e[4];let h;e[5]!==p||e[6]!==u?(h={queryKey:p,queryFn:u},e[5]=p,e[6]=u,e[7]=h):h=e[7];const d=Ts(h);let x;e[8]!==r?(x=async()=>bs(await fetch(r,{method:"POST"})),e[8]=r,e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=ue=>{const{token:F}=ue;return f(F)},e[10]=g):g=e[10];let v;e[11]!==p||e[12]!==l?(v=()=>l.invalidateQueries({queryKey:p}),e[11]=p,e[12]=l,e[13]=v):v=e[13];let y;e[14]!==x||e[15]!==v?(y={mutationFn:x,onSuccess:g,onError:Kl,onSettled:v},e[14]=x,e[15]=v,e[16]=y):y=e[16];const j=yn(y);let b;e[17]!==d.data?.tokens?(b=d.data?.tokens??[],e[17]=d.data?.tokens,e[18]=b):b=e[18];const S=b,N=d.data?.site;let k;e[19]!==i?(k=i("siteTokens.title"),e[19]=i,e[20]=k):k=e[20];let w;e[21]!==i?(w=i("siteTokens.description"),e[21]=i,e[22]=w):w=e[22];let C;e[23]!==i?(C=i("siteTokens.siteId"),e[23]=i,e[24]=C):C=e[24];let M;e[25]!==m||e[26]!==C?(M=t.jsx("label",{htmlFor:m,className:"text-sm font-medium",children:C}),e[25]=m,e[26]=C,e[27]=M):M=e[27];let _;e[28]!==i?(_=i("siteTokens.siteIdDescription"),e[28]=i,e[29]=_):_=e[29];let V;e[30]!==_?(V=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:_}),e[30]=_,e[31]=V):V=e[31];let E;e[32]!==N||e[33]!==m||e[34]!==i?(E=N?t.jsx(Bl,{id:m,value:N,copyLabel:i("siteTokens.copySiteId"),copiedLabel:i("siteTokens.siteIdCopied"),className:"min-w-0 flex-1"}):t.jsx("p",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:"—"}),e[32]=N,e[33]=m,e[34]=i,e[35]=E):E=e[35];const P=!d.data||j.isPending;let I;e[36]!==j?(I=()=>j.mutate(),e[36]=j,e[37]=I):I=e[37];let A;e[38]!==j.isPending?(A=j.isPending?t.jsx(at,{className:"size-3.5"}):t.jsx(Pe,{size:14}),e[38]=j.isPending,e[39]=A):A=e[39];let R;e[40]!==i?(R=i("siteTokens.issue"),e[40]=i,e[41]=R):R=e[41];let U;e[42]!==P||e[43]!==I||e[44]!==A||e[45]!==R?(U=t.jsxs(ee,{type:"button",size:"sm",className:"shrink-0",disabled:P,onClick:I,children:[A,R]}),e[42]=P,e[43]=I,e[44]=A,e[45]=R,e[46]=U):U=e[46];let K;e[47]!==E||e[48]!==U?(K=t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[E,U]}),e[47]=E,e[48]=U,e[49]=K):K=e[49];let W;e[50]!==M||e[51]!==V||e[52]!==K?(W=t.jsxs(je,{className:"group",children:[M,V,K]}),e[50]=M,e[51]=V,e[52]=K,e[53]=W):W=e[53];let G;e[54]!==d.error||e[55]!==d.isError?(G=d.isError?t.jsx(je,{children:t.jsx("p",{className:"text-xs text-destructive",children:d.error.message})}):null,e[54]=d.error,e[55]=d.isError,e[56]=G):G=e[56];let L;if(e[57]!==i||e[58]!==S){let ue;e[60]!==i?(ue=F=>t.jsx(je,{children:t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsx(Et,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate font-mono text-xs",children:F.kid}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("siteTokens.issuedAgo",{when:wn(new Date(F.iat*1e3))})})]})]})},F.kid),e[60]=i,e[61]=ue):ue=e[61],L=S.map(ue),e[57]=i,e[58]=S,e[59]=L}else L=e[59];let Y;e[62]!==W||e[63]!==G||e[64]!==L?(Y=t.jsxs(Re,{children:[W,G,L]}),e[62]=W,e[63]=G,e[64]=L,e[65]=Y):Y=e[65];const X=c!==null;let T;e[66]===Symbol.for("react.memo_cache_sentinel")?(T=ue=>!ue&&f(null),e[66]=T):T=e[66];let z;e[67]!==i?(z=i("siteTokens.createdTitle"),e[67]=i,e[68]=z):z=e[68];let B;e[69]!==z?(B=t.jsx(rt,{children:z}),e[69]=z,e[70]=B):B=e[70];let O;e[71]!==i?(O=i("siteTokens.createdDescription"),e[71]=i,e[72]=O):O=e[72];let $;e[73]!==O?($=t.jsx(Ps,{children:O}),e[73]=O,e[74]=$):$=e[74];let J;e[75]!==B||e[76]!==$?(J=t.jsxs(lt,{children:[B,$]}),e[75]=B,e[76]=$,e[77]=J):J=e[77];let ie;e[78]!==i?(ie=i("siteTokens.createdTitle"),e[78]=i,e[79]=ie):ie=e[79];const de=c??"";let ae;e[80]!==ie||e[81]!==de?(ae=t.jsx(Se,{readOnly:!0,"aria-label":ie,value:de,className:"font-mono text-xs"}),e[80]=ie,e[81]=de,e[82]=ae):ae=e[82];let oe;e[83]!==c||e[84]!==i?(oe=c?t.jsx(rn,{value:c,label:i("siteTokens.copy"),copiedLabel:i("siteTokens.copied"),variant:"outline",size:"icon",className:"shrink-0"}):null,e[83]=c,e[84]=i,e[85]=oe):oe=e[85];let H;e[86]!==ae||e[87]!==oe?(H=t.jsxs("div",{className:"flex items-center gap-2",children:[ae,oe]}),e[86]=ae,e[87]=oe,e[88]=H):H=e[88];let ce;e[89]===Symbol.for("react.memo_cache_sentinel")?(ce=()=>f(null),e[89]=ce):ce=e[89];let me;e[90]!==i?(me=i("siteTokens.done"),e[90]=i,e[91]=me):me=e[91];let pe;e[92]!==me?(pe=t.jsx(Dt,{children:t.jsx(ee,{onClick:ce,children:me})}),e[92]=me,e[93]=pe):pe=e[93];let fe;e[94]!==J||e[95]!==H||e[96]!==pe?(fe=t.jsxs(Ze,{className:"sm:max-w-lg",children:[J,H,pe]}),e[94]=J,e[95]=H,e[96]=pe,e[97]=fe):fe=e[97];let he;e[98]!==X||e[99]!==fe?(he=t.jsx(Je,{open:X,onOpenChange:T,children:fe}),e[98]=X,e[99]=fe,e[100]=he):he=e[100];let ve;return e[101]!==w||e[102]!==Y||e[103]!==he||e[104]!==k?(ve=t.jsxs(We,{title:k,description:w,children:[Y,he]}),e[101]=w,e[102]=Y,e[103]=he,e[104]=k,e[105]=ve):ve=e[105],ve}function Kl(a){return re.error(a.message)}function Gl(a){const e=q.c(8),{control:s,previewServerUrl:n}=a,i=Z();let l;e[0]!==n?(l=Hs(n),e[0]=n,e[1]=l):l=e[1];const r=!!l;let o;e[2]!==r||e[3]!==i?(o=c=>{const{field:f}=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(ye,{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(r?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(gt,{id:"fast-preview",className:"shrink-0",checked:!!f.value&&r,disabled:!r,onCheckedChange:m=>f.onChange(m)})]})},e[2]=r,e[3]=i,e[4]=o):o=e[4];let p;return e[5]!==s||e[6]!==o?(p=t.jsx(be,{control:s,name:"metadata.fastPreview",render:o}),e[5]=s,e[6]=o,e[7]=p):p=e[7],p}function ql(a){const e=q.c(5),{control:s,fastPreview:n}=a,i=Z();if(!n)return null;let l;e[0]!==i?(l=o=>{const{field:p}=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(ye,{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(gt,{id:"fast-preview-in-place",className:"shrink-0",checked:!!p.value,onCheckedChange:c=>p.onChange(c)})]})},e[0]=i,e[1]=l):l=e[1];let r;return e[2]!==s||e[3]!==l?(r=t.jsx(be,{control:s,name:"metadata.fastPreviewInPlace",render:l}),e[2]=s,e[3]=l,e[4]=r):r=e[4],r}function Hl(a){const e=q.c(18),{control:s,isBlocksV8:n}=a,i=n===void 0?!1:n,l=Z();let r;e[0]!==l?(r=l("sandbox.previewServerUrlField.label"),e[0]=l,e[1]=r):r=e[1];let o;e[2]!==r?(o=t.jsx(ye,{htmlFor:"preview-server-url",children:r}),e[2]=r,e[3]=o):o=e[3];let p;e[4]!==l?(p=d=>{const{field:x}=d,g=x.value??"";return t.jsx(Se,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:l("sandbox.previewServerUrlField.placeholder"),value:g,onChange:v=>x.onChange(v.target.value===""?null:v.target.value),onBlur:()=>{x.onChange(ra(g)),x.onBlur()}})},e[4]=l,e[5]=p):p=e[5];let c;e[6]!==s||e[7]!==p?(c=t.jsx(be,{control:s,name:"metadata.previewServerUrl",render:p}),e[6]=s,e[7]=p,e[8]=c):c=e[8];const f=i?"sandbox.previewServerUrlField.descriptionBlocksV8":"sandbox.previewServerUrlField.description";let m;e[9]!==l||e[10]!==f?(m=l(f),e[9]=l,e[10]=f,e[11]=m):m=e[11];let u;e[12]!==m?(u=t.jsx("p",{className:"text-xs text-muted-foreground",children:m}),e[12]=m,e[13]=u):u=e[13];let h;return e[14]!==o||e[15]!==c||e[16]!==u?(h=t.jsxs("div",{className:"space-y-2",children:[o,c,u]}),e[14]=o,e[15]=c,e[16]=u,e[17]=h):h=e[17],h}function Ql(a){const e=q.c(15),{control:s,isBlocksV8:n,previewServerUrl:i,fastPreview:l}=a,r=Z(),o=n||!!l;let p;e[0]!==s||e[1]!==n?(p=t.jsx(je,{children:t.jsx(Hl,{control:s,isBlocksV8:n})}),e[0]=s,e[1]=n,e[2]=p):p=e[2];let c;e[3]!==s||e[4]!==n||e[5]!==i||e[6]!==r?(c=n?!Hs(i)&&t.jsx(je,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:r("sandbox.cmsSettings.blocksV8.needsPreviewServerUrl")})}):t.jsx(je,{children:t.jsx(Gl,{control:s,previewServerUrl:i})}),e[3]=s,e[4]=n,e[5]=i,e[6]=r,e[7]=c):c=e[7];let f;e[8]!==s||e[9]!==o?(f=o&&t.jsx(je,{children:t.jsx(ql,{control:s,fastPreview:o})}),e[8]=s,e[9]=o,e[10]=f):f=e[10];let m;return e[11]!==p||e[12]!==c||e[13]!==f?(m=t.jsxs(t.Fragment,{children:[p,c,f]}),e[11]=p,e[12]=c,e[13]=f,e[14]=m):m=e[14],m}const Ct={tools:null,resources:null,prompts:null},Xl=ca.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function Jl(a){const s=new TextEncoder().encode(a),n=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(n)}function on(a){return{"x-studio-client":a,"x-mesh-client":a}}function Zl(a){const e=q.c(15),{url:s,agentId:n}=a,i=Z(),[l,r]=Q.useState(!1);let o;e[0]!==n||e[1]!==i||e[2]!==s?(o=async()=>{Ve("agent_connect_action",{agent_id:n,action:"copy_url"}),await navigator.clipboard.writeText(s),r(!0),re.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await jt(2e3),r(!1)},e[0]=n,e[1]=i,e[2]=s,e[3]=o):o=e[3];const p=o;let c;e[4]!==l?(c=l?t.jsx(ot,{size:20,className:"text-success"}):t.jsx(vt,{size:20}),e[4]=l,e[5]=c):c=e[5];let f;e[6]!==l||e[7]!==i?(f=i(l?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=l,e[7]=i,e[8]=f):f=e[8];let m;e[9]!==f?(m=t.jsx("span",{className:"text-xs font-medium",children:f}),e[9]=f,e[10]=m):m=e[10];let u;return e[11]!==p||e[12]!==c||e[13]!==m?(u=t.jsxs(ee,{type:"button",variant:"outline",onClick:p,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,m]}),e[11]=p,e[12]=c,e[13]=m,e[14]=u):u=e[14],u}function er(a){const e=q.c(13),{url:s,serverName:n,agentId:i}=a,l=Z();let r;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(r=()=>{Ve("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=Xs(n),h={type:"http",url:s,headers:on("Cursor")},d=Jl(JSON.stringify(h,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(d)}`;window.open(x,"_blank"),re.success(l("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=r):r=e[4];const o=r;let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=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]=p):p=e[5];let c;e[6]!==l?(c=l("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=l,e[7]=c):c=e[7];let f;e[8]!==c?(f=t.jsx("span",{className:"text-xs font-medium",children:c}),e[8]=c,e[9]=f):f=e[9];let m;return e[10]!==o||e[11]!==f?(m=t.jsxs(ee,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[p,f]}),e[10]=o,e[11]=f,e[12]=m):m=e[12],m}function tr(a){const e=q.c(16),{url:s,serverName:n,agentId:i}=a,l=Z(),[r,o]=Q.useState(!1);let p;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(p=async()=>{Ve("agent_connect_action",{agent_id:i,action:"install_claude_code"});const d=Xs(n),x={type:"http",url:s,headers:on("Claude Code")},g=JSON.stringify(x,null,2),v=`claude mcp add-json "${d}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(v),o(!0),re.success(l("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await jt(2e3),o(!1)},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=p):p=e[4];const c=p;let f;e[5]!==r?(f=r?t.jsx(ot,{size:20,className:"text-success"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[5]=r,e[6]=f):f=e[6];let m;e[7]!==r||e[8]!==l?(m=l(r?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=r,e[8]=l,e[9]=m):m=e[9];let u;e[10]!==m?(u=t.jsx("span",{className:"text-xs font-medium",children:m}),e[10]=m,e[11]=u):u=e[11];let h;return e[12]!==c||e[13]!==f||e[14]!==u?(h=t.jsxs(ee,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[f,u]}),e[12]=c,e[13]=f,e[14]=u,e[15]=h):h=e[15],h}const sr=720*60*60;function nr({virtualMcp:a}){const e=Z(),s=Pt(),[n,i]=Q.useState(null),[l,r]=Q.useState(!1),[o,p]=Q.useState(!1),c=a.id,f=a.title||`agent-${c.slice(0,8)}`,m=n?`bunx @decocms/typegen@latest --mcp ${c} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${c} --key <api-key> --output client.ts`,u=async()=>{r(!0);try{const{key:d}=await s.call("API_KEY_CREATE",{name:`typegen-${f}`,permissions:{[c]:["*"]},expiresIn:sr});if(!d)throw new Error("No key in response");i(d),Ve("agent_typegen_key_generated",{agent_id:c})}catch{Ve("agent_typegen_key_failed",{agent_id:c}),re.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{r(!1)}},h=async()=>{Ve("agent_connect_action",{agent_id:c,action:"typegen_copy_command",has_api_key:!!n}),await navigator.clipboard.writeText(m),p(!0),re.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await jt(2e3),p(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClient")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClientDescription")})]}),!n&&t.jsxs(ee,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:l,children:[l?t.jsx(at,{className:"size-3.5"}):t.jsx(Et,{size:14}),t.jsx("span",{children:e(l?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),n&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateClientLabel")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:m}),t.jsx(ee,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:h,children:o?t.jsx(ot,{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(ir,{apiKey:n,agentId:c})]})}function ir(a){const e=q.c(21),{apiKey:s,agentId:n}=a,[i,l]=Q.useState(!1),r=window.location.origin,o=s?`STUDIO_API_KEY=${s}`:"STUDIO_API_KEY=<api-key>",p=`STUDIO_BASE_URL=${r}`,c=`${o}
|
|
2
|
-
${p}`;let f;e[0]!==n||e[1]!==s||e[2]!==c?(f=async()=>{Ve("agent_connect_action",{agent_id:n,action:"typegen_copy_env",has_api_key:!!s}),await navigator.clipboard.writeText(c),l(!0),await jt(2e3),l(!1)},e[0]=n,e[1]=s,e[2]=c,e[3]=f):f=e[3];const m=f,u=!s;let h;e[4]!==u?(h=ge({"opacity-50":u}),e[4]=u,e[5]=h):h=e[5];let d;e[6]!==o||e[7]!==h?(d=t.jsx("span",{className:h,children:o}),e[6]=o,e[7]=h,e[8]=d):d=e[8];let x,g;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("br",{}),g=t.jsx("span",{children:p}),e[9]=x,e[10]=g):(x=e[9],g=e[10]);let v;e[11]!==d?(v=t.jsxs("code",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:[d,x,g]}),e[11]=d,e[12]=v):v=e[12];let y;e[13]!==i?(y=i?t.jsx(ot,{size:12,className:"text-success"}):t.jsx(vt,{size:12}),e[13]=i,e[14]=y):y=e[14];let j;e[15]!==m||e[16]!==y?(j=t.jsx(ee,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:m,children:y}),e[15]=m,e[16]=y,e[17]=j):j=e[17];let b;return e[18]!==v||e[19]!==j?(b=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:[v,j]})}),e[18]=v,e[19]=j,e[20]=b):b=e[20],b}function ar(a){const e=q.c(3),{virtualMcp:s}=a;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=n):n=e[0];let i;return e[1]!==s?(i=t.jsx(Q.Suspense,{fallback:n,children:t.jsx(nr,{virtualMcp:s})}),e[1]=s,e[2]=i):i=e[2],i}function lr(a){const e=q.c(45),{open:s,onOpenChange:n,virtualMcp:i}=a,l=Z(),{org:r}=Ee(),o=`/api/${r.slug}/mcp/virtual-mcp/${i.id}`;let p;e[0]!==o?(p=new URL(o,window.location.origin),e[0]=o,e[1]=p):p=e[1];const c=p;let f;e[2]!==i.id||e[3]!==i.title?(f=i.title||`agent-${i.id?.slice(0,8)??"default"}`,e[2]=i.id,e[3]=i.title,e[4]=f):f=e[4];const m=f,u=ha();let h;e[5]!==i.id||e[6]!==c.href?(h=t.jsx(Zl,{url:c.href,agentId:i.id}),e[5]=i.id,e[6]=c.href,e[7]=h):h=e[7];let d,x;e[8]!==m||e[9]!==i.id||e[10]!==c.href?(d=t.jsx(er,{url:c.href,serverName:m,agentId:i.id}),x=t.jsx(tr,{url:c.href,serverName:m,agentId:i.id}),e[8]=m,e[9]=i.id,e[10]=c.href,e[11]=d,e[12]=x):(d=e[11],x=e[12]);let g;e[13]!==h||e[14]!==d||e[15]!==x?(g=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[h,d,x]})}),e[13]=h,e[14]=d,e[15]=x,e[16]=g):g=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"border-t border-border"}),e[17]=v):v=e[17];let y;e[18]!==i?(y=t.jsx(ar,{virtualMcp:i}),e[18]=i,e[19]=y):y=e[19];let j;e[20]!==g||e[21]!==y?(j=t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v,y]}),e[20]=g,e[21]=y,e[22]=j):j=e[22];const b=j;if(u){let C;e[23]!==l?(C=l("virtualMcp.virtualMcpShareModal.connect"),e[23]=l,e[24]=C):C=e[24];let M;e[25]!==C?(M=t.jsx(ma,{className:"mt-4 mb-4 text-base font-semibold",children:C}),e[25]=C,e[26]=M):M=e[26];let _;e[27]!==b||e[28]!==M?(_=t.jsx(fa,{children:t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-6 [touch-action:pan-y]",children:[M,b]})}),e[27]=b,e[28]=M,e[29]=_):_=e[29];let V;return e[30]!==n||e[31]!==s||e[32]!==_?(V=t.jsx(pa,{open:s,onOpenChange:n,children:_}),e[30]=n,e[31]=s,e[32]=_,e[33]=V):V=e[33],V}let S;e[34]!==l?(S=l("virtualMcp.virtualMcpShareModal.connect"),e[34]=l,e[35]=S):S=e[35];let N;e[36]!==S?(N=t.jsx(lt,{children:t.jsx(rt,{children:S})}),e[36]=S,e[37]=N):N=e[37];let k;e[38]!==b||e[39]!==N?(k=t.jsxs(Ze,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[N,b]}),e[38]=b,e[39]=N,e[40]=k):k=e[40];let w;return e[41]!==n||e[42]!==s||e[43]!==k?(w=t.jsx(Je,{open:s,onOpenChange:n,children:k}),e[41]=n,e[42]=s,e[43]=k,e[44]=w):w=e[44],w}const rr=/^[A-Za-z_][A-Za-z0-9_]*$/;function or(a){const e={},s=a.split(/\r?\n/);for(let n=0;n<s.length;n++){let i=(s[n]??"").trim();if(!i||i.startsWith("#"))continue;i.startsWith("export ")&&(i=i.slice(7).trim());const l=i.indexOf("=");if(l<0)throw new Error(`Line ${n+1}: missing '='`);const r=i.slice(0,l).trim();if(!rr.test(r))throw new Error(`Line ${n+1}: invalid key "${r}"`);let o=i.slice(l+1).trim();o.length>=2&&(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'"))&&(o=o.slice(1,-1)),e[r]=o}return e}function cr(a){const e=q.c(28),{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:r}=a,o=Z();let p;e[0]!==o?(p=o("sandbox.envVarsField.title"),e[0]=o,e[1]=p):p=e[1];let c;e[2]!==p?(c=t.jsx("div",{className:"flex items-baseline justify-between gap-2",children:t.jsx(ye,{className:"font-normal text-foreground",children:p})}),e[2]=p,e[3]=c):c=e[3];let f;e[4]!==o?(f=o("sandbox.envVarsField.description"),e[4]=o,e[5]=f):f=e[5];let m;e[6]!==f?(m=t.jsx("p",{className:"text-xs text-muted-foreground",children:f}),e[6]=f,e[7]=m):m=e[7];let u;e[8]!==s||e[9]!==n||e[10]!==l||e[11]!==r||e[12]!==i?(u=t.jsx(dr,{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:r}),e[8]=s,e[9]=n,e[10]=l,e[11]=r,e[12]=i,e[13]=u):u=e[13];let h;e[14]!==o?(h=y=>{const{error:j}=y;return t.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:j?.message??o("sandbox.envVarsField.failedToLoadSecrets")})},e[14]=o,e[15]=h):h=e[15];let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Sn,{className:"h-9 w-full"}),e[16]=d):d=e[16];let x;e[17]!==s||e[18]!==n?(x=t.jsx(Q.Suspense,{fallback:d,children:t.jsx(mr,{control:s,form:n})}),e[17]=s,e[18]=n,e[19]=x):x=e[19];let g;e[20]!==h||e[21]!==x?(g=t.jsx(Be,{fallback:h,children:x}),e[20]=h,e[21]=x,e[22]=g):g=e[22];let v;return e[23]!==c||e[24]!==m||e[25]!==u||e[26]!==g?(v=t.jsxs("div",{className:"space-y-2",children:[c,m,u,g]}),e[23]=c,e[24]=m,e[25]=u,e[26]=g,e[27]=v):v=e[27],v}function dr(a){const e=q.c(33),{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:r}=a,o=Z(),c=Nn.useSession().data?.user?.id,f="metadata.runtime.env";let m;e[0]!==n?(m=()=>JSON.stringify(js(n.getValues(f))),e[0]=n,e[1]=m):m=e[1];const[u,h]=Q.useState(m);let d;e[2]!==s?(d={control:s,name:f},e[2]=s,e[3]=d):d=e[3];const x=It(d);let g;e[4]!==x?(g=JSON.stringify(js(x)),e[4]=x,e[5]=g):g=e[5];const v=g,y=v!==u;let j;e[6]!==r||e[7]!==c?(j=c?Object.keys(r?.[c]??{}):[],e[6]=r,e[7]=c,e[8]=j):j=e[8];const b=j,S=b.length>0,[N,k]=Q.useState(!1);if(!y||!S)return null;let w;e[9]!==v||e[10]!==l||e[11]!==o||e[12]!==b||e[13]!==i?(w=async()=>{k(!0);const R=await Promise.allSettled(b.map(async K=>{const W=xa({orgSlug:l,virtualMcpId:i,branch:K,threadId:null},"setup/start"),G=await fetch(W,{method:"POST"});if(!G.ok){const L=await G.text().catch(()=>G.statusText);throw new Error(L||G.statusText)}}));k(!1);const U=R.filter(ur).length;U===0?(h(v),re.success(b.length===1?o("sandbox.envVarsField.restartedSingle"):o("sandbox.envVarsField.restartedMultiple",{count:b.length}))):re.error(o("sandbox.envVarsField.restartFailed",{failed:U,total:b.length}))},e[9]=v,e[10]=l,e[11]=o,e[12]=b,e[13]=i,e[14]=w):w=e[14];const C=w;let M;e[15]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(_s,{className:"size-3.5 shrink-0"}),e[15]=M):M=e[15];let _;e[16]!==o?(_=o("sandbox.envVarsField.sandboxRunningNotice"),e[16]=o,e[17]=_):_=e[17];let V;e[18]!==_?(V=t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-warning",children:[M,t.jsx("span",{className:"truncate",children:_})]}),e[18]=_,e[19]=V):V=e[19];let E;e[20]!==N?(E=N?t.jsx(at,{className:"size-3.5"}):t.jsx(kn,{className:"size-3.5"}),e[20]=N,e[21]=E):E=e[21];let P;e[22]!==N||e[23]!==o?(P=o(N?"sandbox.envVarsField.restarting":"sandbox.envVarsField.restartDev"),e[22]=N,e[23]=o,e[24]=P):P=e[24];let I;e[25]!==C||e[26]!==N||e[27]!==P||e[28]!==E?(I=t.jsxs(ee,{type:"button",variant:"outline",size:"sm",onClick:C,disabled:N,className:"shrink-0",children:[E,P]}),e[25]=C,e[26]=N,e[27]=P,e[28]=E,e[29]=I):I=e[29];let A;return e[30]!==I||e[31]!==V?(A=t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs",children:[V,I]}),e[30]=I,e[31]=V,e[32]=A):A=e[32],A}function ur(a){return a.status==="rejected"}function mr(a){const e=q.c(62),{control:s,form:n}=a,i=Z(),l="metadata.runtime.env";let r;e[0]!==s?(r={control:s,name:l},e[0]=s,e[1]=r):r=e[1];const o=Cn(r),{fields:p,append:c,remove:f}=o;let m;e[2]!==n?(m=(W,G)=>{n.setValue(`${l}.${W}`,G,{shouldDirty:!0,shouldTouch:!0})},e[2]=n,e[3]=m):m=e[3];const u=m,h=ja();let d;if(e[4]!==h){d=new Map;for(const W of h)d.set(W.id,W);e[4]=h,e[5]=d}else d=e[5];const[x,g]=Q.useState(null);let v;e[6]!==c?(v=()=>{c({key:"",kind:"literal",value:""})},e[6]=c,e[7]=v):v=e[7];const y=v;let j;e[8]!==c||e[9]!==n||e[10]!==i?(j=async()=>{let W;try{W=await navigator.clipboard.readText()}catch{re.error(i("sandbox.envVarsField.clipboardReadFailed"));return}if(!W.trim()){re.error(i("sandbox.envVarsField.clipboardEmpty"));return}let G;try{G=or(W)}catch(B){const O=B;re.error(O.message);return}const L=Object.entries(G);if(L.length===0){re.error(i("sandbox.envVarsField.nothingToAdd"));return}const Y=n.getValues(l)??[],X=new Set;for(const B of Y){const O=(B.key??"").trim();O&&X.add(O)}let T=0,z=0;for(const[B,O]of L){if(X.has(B)){z++;continue}c({key:B,kind:"literal",value:O}),X.add(B),T++}T===0&&z>0?re.message(i("sandbox.envVarsField.allKeysExist",{count:z})):re.success(z>0?i("sandbox.envVarsField.addedWithSkipped",{added:T,skipped:z}):i("sandbox.envVarsField.added",{added:T}))},e[8]=c,e[9]=n,e[10]=i,e[11]=j):j=e[11];const b=j;let S;if(e[12]!==s||e[13]!==p||e[14]!==n||e[15]!==f||e[16]!==d||e[17]!==h||e[18]!==u){let W;e[20]!==s||e[21]!==n||e[22]!==f||e[23]!==d||e[24]!==h||e[25]!==u?(W=(G,L)=>t.jsx("li",{className:"rounded-md border border-border bg-background",children:t.jsx(fr,{index:L,control:s,form:n,onUpdateEntry:u,fieldPath:l,secrets:h,secretById:d,onSaveAsSecret:(Y,X)=>g({kind:"save-literal",index:L,presetKey:Y,presetValue:X}),onCreateNewSecret:Y=>g({kind:"create-new",index:L,presetKey:Y}),onRemove:()=>f(L)})},G.id),e[20]=s,e[21]=n,e[22]=f,e[23]=d,e[24]=h,e[25]=u,e[26]=W):W=e[26],S=p.map(W),e[12]=s,e[13]=p,e[14]=n,e[15]=f,e[16]=d,e[17]=h,e[18]=u,e[19]=S}else S=e[19];let N;e[27]!==S?(N=t.jsx("ul",{className:"space-y-2",children:S}),e[27]=S,e[28]=N):N=e[28];let k;e[29]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Pe,{className:"size-3.5"}),e[29]=k):k=e[29];let w;e[30]!==i?(w=i("sandbox.envVarsField.addEnvVar"),e[30]=i,e[31]=w):w=e[31];let C;e[32]!==y||e[33]!==w?(C=t.jsxs(ee,{type:"button",variant:"outline",size:"sm",onClick:y,className:"flex-1",children:[k,w]}),e[32]=y,e[33]=w,e[34]=C):C=e[34];let M;e[35]!==i?(M=i("sandbox.envVarsField.pasteDotenvAriaLabel"),e[35]=i,e[36]=M):M=e[36];let _;e[37]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(wi,{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 E;e[40]!==b||e[41]!==M||e[42]!==V?(E=t.jsx(ke,{asChild:!0,children:t.jsxs(ee,{type:"button",variant:"outline",size:"sm",onClick:b,"aria-label":M,children:[_,V]})}),e[40]=b,e[41]=M,e[42]=V,e[43]=E):E=e[43];let P;e[44]!==i?(P=i("sandbox.envVarsField.pasteDotenvTooltip"),e[44]=i,e[45]=P):P=e[45];let I;e[46]!==P?(I=t.jsx(Me,{children:P}),e[46]=P,e[47]=I):I=e[47];let A;e[48]!==E||e[49]!==I?(A=t.jsxs(Ce,{children:[E,I]}),e[48]=E,e[49]=I,e[50]=A):A=e[50];let R;e[51]!==A||e[52]!==C?(R=t.jsxs("div",{className:"flex items-center gap-2",children:[C,A]}),e[51]=A,e[52]=C,e[53]=R):R=e[53];let U;e[54]!==x||e[55]!==n||e[56]!==u?(U=x!==null?t.jsx(hr,{mode:x,onClose:()=>g(null),onSaved:W=>{const G=n.getValues(`${l}.${x.index}.key`)?.trim()??"";u(x.index,{key:G,kind:"secret",secretId:W}),g(null)}}):null,e[54]=x,e[55]=n,e[56]=u,e[57]=U):U=e[57];let K;return e[58]!==R||e[59]!==U||e[60]!==N?(K=t.jsxs("div",{className:"space-y-2",children:[N,R,U]}),e[58]=R,e[59]=U,e[60]=N,e[61]=K):K=e[61],K}function fr(a){const e=q.c(77),{index:s,control:n,form:i,onUpdateEntry:l,fieldPath:r,secrets:o,secretById:p,onSaveAsSecret:c,onCreateNewSecret:f,onRemove:m}=a,u=Z(),h=`${r}.${s}.key`,d=`${r}.${s}.value`,x=`${r}.${s}.secretId`,g=`${r}.${s}.kind`;let v;e[0]!==n||e[1]!==g?(v={control:n,name:g},e[0]=n,e[1]=g,e[2]=v):v=e[2];const j=It(v)==="secret"?"secret":"literal";let b;e[3]!==i||e[4]!==s||e[5]!==h||e[6]!==c||e[7]!==l||e[8]!==d?(b=O=>{const $=i.getValues(h)?.trim()??"";if(O==="literal"){l(s,{key:$,kind:"literal",value:""});return}const J=i.getValues(d)??"";if(J.length>0){c($,J);return}l(s,{key:$,kind:"secret",secretId:""})},e[3]=i,e[4]=s,e[5]=h,e[6]=c,e[7]=l,e[8]=d,e[9]=b):b=e[9];const S=b;let N;e[10]!==s||e[11]!==u?(N=O=>{const{field:$}=O,J=($.value??"").trim(),ie=J.length>0&&!bt.test(J);return t.jsxs("div",{className:"space-y-1",children:[t.jsx(Se,{...$,value:$.value??"",placeholder:u("sandbox.envVarsField.keyPlaceholder"),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",className:ge("font-mono",ie&&"border-destructive focus-visible:ring-destructive"),"aria-invalid":ie,"aria-label":u("sandbox.envVarsField.envVarKeyLabel",{index:s+1}),onBlur:de=>{const ae=de.target.value.trim();$.onChange(ae),$.onBlur()}}),ie?t.jsx("p",{className:"text-2xs text-destructive",children:u("sandbox.envVarsField.invalidKeyMessage")}):null]})},e[10]=s,e[11]=u,e[12]=N):N=e[12];let k;e[13]!==n||e[14]!==h||e[15]!==N?(k=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(be,{control:n,name:h,render:N})}),e[13]=n,e[14]=h,e[15]=N,e[16]=k):k=e[16];let w;e[17]!==S?(w=O=>S(O),e[17]=S,e[18]=w):w=e[18];let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ae,{className:"h-9 w-[110px]",children:t.jsx(Ie,{})}),e[19]=C):C=e[19];let M;e[20]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Et,{className:"size-3.5"}),e[20]=M):M=e[20];let _;e[21]!==u?(_=u("sandbox.envVarsField.literal"),e[21]=u,e[22]=_):_=e[22];let V;e[23]!==_?(V=t.jsx(we,{value:"literal",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[M,_]})}),e[23]=_,e[24]=V):V=e[24];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Mn,{className:"size-3.5"}),e[25]=E):E=e[25];let P;e[26]!==u?(P=u("sandbox.envVarsField.secret"),e[26]=u,e[27]=P):P=e[27];let I;e[28]!==P?(I=t.jsx(we,{value:"secret",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[E,P]})}),e[28]=P,e[29]=I):I=e[29];let A;e[30]!==I||e[31]!==V?(A=t.jsxs($e,{children:[V,I]}),e[30]=I,e[31]=V,e[32]=A):A=e[32];let R;e[33]!==j||e[34]!==A||e[35]!==w?(R=t.jsx("div",{className:"shrink-0",children:t.jsxs(Fe,{value:j,onValueChange:w,children:[C,A]})}),e[33]=j,e[34]=A,e[35]=w,e[36]=R):R=e[36];let U;e[37]!==n||e[38]!==i||e[39]!==s||e[40]!==h||e[41]!==j||e[42]!==f||e[43]!==p||e[44]!==x||e[45]!==o||e[46]!==u||e[47]!==d?(U=t.jsx("div",{className:"flex flex-[2] min-w-0 items-center gap-1",children:j==="literal"?t.jsx(be,{control:n,name:d,render:O=>{const{field:$}=O;return t.jsx(Se,{...$,value:$.value??"",type:"password",placeholder:u("sandbox.envVarsField.valuePlaceholder"),spellCheck:!1,autoComplete:"off",className:"font-mono","aria-label":u("sandbox.envVarsField.envVarValueLabel",{index:s+1}),onBlur:J=>{$.onChange(J.target.value),$.onBlur()}})}}):t.jsxs(t.Fragment,{children:[t.jsx(be,{control:n,name:x,render:O=>{const{field:$}=O;return t.jsxs(Fe,{value:$.value||"",onValueChange:J=>$.onChange(J),children:[t.jsx(Ae,{className:ge("h-9 w-full",!$.value&&"text-muted-foreground"),"aria-label":u("sandbox.envVarsField.secretAriaLabel",{index:s+1}),children:t.jsx(Ie,{placeholder:u("sandbox.envVarsField.pickSecretPlaceholder"),children:t.jsx(ga,{field:$,secretById:p})})}),t.jsx($e,{children:o.length===0?t.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:u("sandbox.envVarsField.noSecretsYet")}):o.map(pr)})]})}}),t.jsxs(Ce,{children:[t.jsx(ke,{asChild:!0,children:t.jsx(ee,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.createNewSecretAriaLabel"),onClick:()=>{const O=i.getValues(h)?.trim()??"";f(O)},children:t.jsx(Pe,{className:"size-3.5"})})}),t.jsx(Me,{children:u("sandbox.envVarsField.createNewSecret")})]})]})}),e[37]=n,e[38]=i,e[39]=s,e[40]=h,e[41]=j,e[42]=f,e[43]=p,e[44]=x,e[45]=o,e[46]=u,e[47]=d,e[48]=U):U=e[48];let K;e[49]!==i||e[50]!==h||e[51]!==j||e[52]!==c||e[53]!==u||e[54]!==d?(K=j==="literal"?t.jsxs(Ce,{children:[t.jsx(ke,{asChild:!0,children:t.jsx(ee,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.saveAsSecretAriaLabel"),onClick:()=>{const O=i.getValues(h)?.trim()??"",$=i.getValues(d)??"";c(O,$)},children:t.jsx(Si,{className:"size-3.5"})})}),t.jsx(Me,{children:u("sandbox.envVarsField.saveAsSecret")})]}):null,e[49]=i,e[50]=h,e[51]=j,e[52]=c,e[53]=u,e[54]=d,e[55]=K):K=e[55];let W;e[56]!==u?(W=u("sandbox.envVarsField.removeEnvVarAriaLabel"),e[56]=u,e[57]=W):W=e[57];let G;e[58]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(ht,{className:"size-3.5"}),e[58]=G):G=e[58];let L;e[59]!==m||e[60]!==W?(L=t.jsx(ke,{asChild:!0,children:t.jsx(ee,{type:"button",variant:"ghost",size:"icon","aria-label":W,onClick:m,children:G})}),e[59]=m,e[60]=W,e[61]=L):L=e[61];let Y;e[62]!==u?(Y=u("sandbox.envVarsField.remove"),e[62]=u,e[63]=Y):Y=e[63];let X;e[64]!==Y?(X=t.jsx(Me,{children:Y}),e[64]=Y,e[65]=X):X=e[65];let T;e[66]!==L||e[67]!==X?(T=t.jsxs(Ce,{children:[L,X]}),e[66]=L,e[67]=X,e[68]=T):T=e[68];let z;e[69]!==K||e[70]!==T?(z=t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[K,T]}),e[69]=K,e[70]=T,e[71]=z):z=e[71];let B;return e[72]!==R||e[73]!==U||e[74]!==z||e[75]!==k?(B=t.jsxs("div",{className:"flex flex-col gap-2 p-2 sm:flex-row sm:items-center",children:[k,R,U,z]}),e[72]=R,e[73]=U,e[74]=z,e[75]=k,e[76]=B):B=e[76],B}function pr(a){return t.jsx(we,{value:a.id,children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(ba,{scope:a.scope}),t.jsx("span",{className:"font-mono",children:a.name})]})},a.id)}function hr({mode:a,onClose:e,onSaved:s}){const n=Z(),i=a.kind==="save-literal"?a.presetValue:"",l=a.presetKey,[r,o]=Q.useState(()=>xr(l)),[p,c]=Q.useState("organization"),[f,m]=Q.useState(i),[u,h]=Q.useState(""),d=ya(),x=r.trim(),g=f.length>0&&x.length>0&&va.test(x),v=async b=>{if(b.preventDefault(),!!g)try{const S=await d.mutateAsync({scope:p,name:x,value:f,description:u.trim()||void 0});re.success(n("sandbox.envVarsField.secretSaved",{name:S.name})),s(S.id)}catch(S){re.error(S instanceof Error?S.message:n("sandbox.envVarsField.failedToSaveSecret"))}},y=a.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretTitle"):n("sandbox.envVarsField.createNewSecretTitle"),j=a.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretDescription"):n("sandbox.envVarsField.createNewSecretDescription");return t.jsx(Je,{open:!0,onOpenChange:b=>{b||e()},children:t.jsxs(Ze,{className:"sm:max-w-md",children:[t.jsxs(lt,{children:[t.jsx(rt,{children:y}),t.jsx(Ps,{children:j})]}),t.jsxs("form",{onSubmit:v,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-scope",children:n("sandbox.envVarsField.scopeLabel")}),t.jsxs(Fe,{value:p,onValueChange:b=>c(b),children:[t.jsx(Ae,{id:"save-secret-scope",children:t.jsx(Ie,{})}),t.jsxs($e,{children:[t.jsx(we,{value:"organization",children:n("sandbox.envVarsField.scopeOrganization")}),t.jsx(we,{value:"user",children:n("sandbox.envVarsField.scopePrivate")})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-name",children:n("sandbox.envVarsField.nameLabel")}),t.jsx(Se,{id:"save-secret-name",value:r,onChange:b=>o(b.target.value),placeholder:n("sandbox.envVarsField.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.envVarsField.nameHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-value",children:n("sandbox.envVarsField.valueLabel")}),t.jsx(Se,{id:"save-secret-value",type:"password",value:f,onChange:b=>m(b.target.value),placeholder:n("sandbox.envVarsField.secretValuePlaceholder"),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-description",children:n("sandbox.envVarsField.descriptionLabel")}),t.jsx(mt,{id:"save-secret-description",value:u,onChange:b=>h(b.target.value),rows:2,placeholder:n("sandbox.envVarsField.descriptionPlaceholder")})]}),t.jsxs(Dt,{children:[t.jsx(ee,{type:"button",variant:"outline",onClick:e,disabled:d.isPending,children:n("sandbox.envVarsField.cancel")}),t.jsx(ee,{type:"submit",disabled:!g||d.isPending,children:d.isPending?n("sandbox.envVarsField.saving"):n("sandbox.envVarsField.saveSecret")})]})]})]})})}function js(a){if(!Array.isArray(a))return[];const e=[];for(const s of a){if(!s||typeof s!="object")continue;const n=s,i=(n.key??"").trim();if(!(!i||!bt.test(i))){if(n.kind==="literal"){e.push({key:i,kind:"literal",value:n.value??""});continue}n.kind==="secret"&&n.secretId&&e.push({key:i,kind:"secret",secretId:n.secretId})}}return e}function xr(a){const e=a.trim();return e&&bt.test(e)?e:""}function gr(a){const e=q.c(21),{repo:s,className:n}=a,i=Z();let l;e[0]!==n?(l=ge("space-y-2",n),e[0]=n,e[1]=l):l=e[1];let r;e[2]!==i?(r=i("sandbox.repoRow.label"),e[2]=i,e[3]=r):r=e[3];let o;e[4]!==r?(o=t.jsx(ye,{children:r}),e[4]=r,e[5]=o):o=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(wa,{size:20,className:"shrink-0 text-foreground/60"}),e[6]=p):p=e[6];let c;e[7]!==s||e[8]!==i?(c=t.jsx(ke,{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:[p,t.jsx("div",{className:"min-w-0 flex-1",children:s?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"truncate text-sm font-medium",children:[s.owner,"/",s.name]}),t.jsx("div",{className:"truncate text-xs text-muted-foreground",children:s.url})]}):t.jsx("div",{className:"text-sm text-muted-foreground",children:i("sandbox.repoRow.noRepositoryConnected")})})]})}),e[7]=s,e[8]=i,e[9]=c):c=e[9];let f;e[10]!==i?(f=i("sandbox.repoRow.tooltipContent"),e[10]=i,e[11]=f):f=e[11];let m;e[12]!==f?(m=t.jsx(Me,{children:f}),e[12]=f,e[13]=m):m=e[13];let u;e[14]!==c||e[15]!==m?(u=t.jsxs(Ce,{children:[c,m]}),e[14]=c,e[15]=m,e[16]=u):u=e[16];let h;return e[17]!==l||e[18]!==o||e[19]!==u?(h=t.jsxs("div",{className:l,children:[o,u]}),e[17]=l,e[18]=o,e[19]=u,e[20]=h):h=e[20],h}const vr={npm:{install:"npm install",run:a=>`npm run ${a}`,runtime:"node"},pnpm:{install:"pnpm install",run:a=>`pnpm run ${a}`,runtime:"node"},yarn:{install:"yarn install",run:a=>`yarn run ${a}`,runtime:"node"},bun:{install:"bun install",run:a=>`bun run ${a}`,runtime:"bun"},deno:{install:"deno install",run:a=>`deno task ${a}`,runtime:"deno"}};function br(a){const e=a.trim();if(e==="")return{ok:!0,value:null};if(!/^\d+$/.test(e))return{ok:!1};const s=Number(e);return s<1||s>65535?{ok:!1}:{ok:!0,value:String(s)}}const jr=Object.keys(vr),kt="__none__";function yr(a){const e=q.c(47),{control:s}=a,n=Z(),i=Q.useRef(null);let l;e[0]!==n?(l=n("sandbox.runtimeFields.packageManager"),e[0]=n,e[1]=l):l=e[1];let r;e[2]!==l?(r=t.jsx(ye,{htmlFor:"runtime-pm",children:l}),e[2]=l,e[3]=r):r=e[3];let o;e[4]!==n?(o=w=>{const{field:C}=w;return t.jsxs(Fe,{value:C.value??kt,onValueChange:M=>C.onChange(M===kt?null:M),children:[t.jsx(Ae,{id:"runtime-pm",children:t.jsx(Ie,{placeholder:n("sandbox.runtimeFields.autoDetect")})}),t.jsxs($e,{children:[t.jsx(we,{value:kt,children:n("sandbox.runtimeFields.autoDetect")}),jr.map(Sr)]})]})},e[4]=n,e[5]=o):o=e[5];let p;e[6]!==s||e[7]!==o?(p=t.jsx(be,{control:s,name:"metadata.runtime.selected",render:o}),e[6]=s,e[7]=o,e[8]=p):p=e[8];let c;e[9]!==r||e[10]!==p?(c=t.jsxs("div",{className:"space-y-2",children:[r,p]}),e[9]=r,e[10]=p,e[11]=c):c=e[11];let f;e[12]!==n?(f=n("sandbox.runtimeFields.packagePath"),e[12]=n,e[13]=f):f=e[13];let m;e[14]!==f?(m=t.jsx(ye,{htmlFor:"runtime-path",children:f}),e[14]=f,e[15]=m):m=e[15];let u;e[16]!==s?(u=t.jsx(be,{control:s,name:"metadata.runtime.path",render:wr}),e[16]=s,e[17]=u):u=e[17];let h;e[18]!==n?(h=n("sandbox.runtimeFields.packagePathDescription"),e[18]=n,e[19]=h):h=e[19];let d;e[20]!==h?(d=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[20]=h,e[21]=d):d=e[21];let x;e[22]!==d||e[23]!==m||e[24]!==u?(x=t.jsxs("div",{className:"space-y-2",children:[m,u,d]}),e[22]=d,e[23]=m,e[24]=u,e[25]=x):x=e[25];let g;e[26]!==n?(g=n("sandbox.runtimeFields.devServerPort"),e[26]=n,e[27]=g):g=e[27];let v;e[28]!==g?(v=t.jsx(ye,{htmlFor:"runtime-port",children:g}),e[28]=g,e[29]=v):v=e[29];let y;e[30]!==n?(y=w=>{const{field:C}=w;return t.jsx(Se,{ref:i,id:"runtime-port",inputMode:"numeric",placeholder:n("sandbox.runtimeFields.auto"),defaultValue:C.value??"",onBlur:M=>{const _=br(M.target.value);_.ok?C.onChange(_.value):i.current&&(i.current.value=C.value??"")}})},e[30]=n,e[31]=y):y=e[31];let j;e[32]!==s||e[33]!==y?(j=t.jsx(be,{control:s,name:"metadata.runtime.port",render:y}),e[32]=s,e[33]=y,e[34]=j):j=e[34];let b;e[35]!==n?(b=n("sandbox.runtimeFields.devServerPortDescription"),e[35]=n,e[36]=b):b=e[36];let S;e[37]!==b?(S=t.jsx("p",{className:"text-xs text-muted-foreground",children:b}),e[37]=b,e[38]=S):S=e[38];let N;e[39]!==v||e[40]!==j||e[41]!==S?(N=t.jsxs("div",{className:"space-y-2",children:[v,j,S]}),e[39]=v,e[40]=j,e[41]=S,e[42]=N):N=e[42];let k;return e[43]!==x||e[44]!==N||e[45]!==c?(k=t.jsxs("div",{className:"space-y-5",children:[c,x,N]}),e[43]=x,e[44]=N,e[45]=c,e[46]=k):k=e[46],k}function wr(a){const{field:e}=a;return t.jsx(Se,{id:"runtime-path",placeholder:".",defaultValue:e.value??"",onBlur:s=>{const n=s.target.value.trim();e.onChange(n===""?null:n)}})}function Sr(a){return t.jsx(we,{value:a,children:a},a)}function Nr(a){const e=q.c(10),{control:s}=a,n=Z(),[i,l]=Q.useState(null),[r,o]=Q.useState(null),p=It({control:s,name:"metadata.runtime.path"})??"";let c;e[0]!==p?(c=rs(p),e[0]=p,e[1]=c):c=e[1];const f=c;let m;e[2]!==i||e[3]!==r||e[4]!==f||e[5]!==n?(m=h=>{const{field:d}=h,x=d.value??[],g=y=>d.onChange(y.length?y:null),v=()=>{if(i===null)return;const y=rs(i);if(!y){l(null),o(null);return}if(y===f||x.some(j=>j.path===y)){o(n("sandbox.runtimeApps.duplicate"));return}g([...x,{path:y}]),l(null),o(null)};return t.jsxs("div",{className:"space-y-2",children:[t.jsx(ye,{htmlFor:"runtime-apps-draft",children:n("sandbox.runtimeApps.title")}),x.length>0&&t.jsx("ul",{className:"space-y-1.5",children:x.map(y=>t.jsxs("li",{className:"flex h-9 items-center gap-2 rounded-md border border-border px-3",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:y.path}),t.jsx(ee,{type:"button",variant:"ghost",size:"icon-sm","aria-label":n("sandbox.runtimeApps.remove",{path:y.path}),onClick:()=>g(x.filter(j=>j.path!==y.path)),children:t.jsx(ht,{})})]},y.path))}),i!==null?t.jsx(Se,{id:"runtime-apps-draft",autoFocus:!0,placeholder:"apps/checkout",value:i,"aria-invalid":!!r,onChange:y=>{l(y.target.value),o(null)},onBlur:v,onKeyDown:y=>{y.key==="Enter"?(y.preventDefault(),v()):y.key==="Escape"&&(l(null),o(null))}}):x.length<as&&t.jsxs(ee,{id:"runtime-apps-draft",type:"button",variant:"outline",size:"sm",onClick:()=>l(""),children:[t.jsx(Pe,{}),n("sandbox.runtimeApps.add")]}),r?t.jsx("p",{className:"text-xs text-destructive",children:r}):t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.runtimeApps.description",{max:String(as)})})]})},e[2]=i,e[3]=r,e[4]=f,e[5]=n,e[6]=m):m=e[6];let u;return e[7]!==s||e[8]!==m?(u=t.jsx(be,{control:s,name:"metadata.runtime.apps",render:m}),e[7]=s,e[8]=m,e[9]=u):u=e[9],u}function Cr(a){const e=q.c(5),{control:s}=a,n=Z();let i;e[0]!==n?(i=r=>{const{field:o}=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(ye,{htmlFor:"field-description-tooltips",className:"font-normal text-foreground",children:n("sandbox.fieldDescriptionTooltipsField.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.fieldDescriptionTooltipsField.description")})]}),t.jsx(gt,{id:"field-description-tooltips",className:"shrink-0",checked:o.value??!1,onCheckedChange:p=>o.onChange(p)})]})},e[0]=n,e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==i?(l=t.jsx(be,{control:s,name:"metadata.fieldDescriptionTooltips",render:i}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}function kr(a){const e=q.c(32),{control:s,onCommit:n}=a,i=Z();let l;e[0]!==i?(l=i("virtualMcp.virtualMcp.publishPolicySmart"),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==i?(r=i("virtualMcp.virtualMcp.publishPolicySmartDescription"),e[2]=i,e[3]=r):r=e[3];let o;e[4]!==l||e[5]!==r?(o={value:"smart",label:l,description:r},e[4]=l,e[5]=r,e[6]=o):o=e[6];let p;e[7]!==i?(p=i("virtualMcp.virtualMcp.publishPolicyCodeReview"),e[7]=i,e[8]=p):p=e[8];let c;e[9]!==i?(c=i("virtualMcp.virtualMcp.publishPolicyCodeReviewDescription"),e[9]=i,e[10]=c):c=e[10];let f;e[11]!==p||e[12]!==c?(f={value:"code-review",label:p,description:c},e[11]=p,e[12]=c,e[13]=f):f=e[13];let m;e[14]!==i?(m=i("virtualMcp.virtualMcp.publishPolicyOpen"),e[14]=i,e[15]=m):m=e[15];let u;e[16]!==i?(u=i("virtualMcp.virtualMcp.publishPolicyOpenDescription"),e[16]=i,e[17]=u):u=e[17];let h;e[18]!==m||e[19]!==u?(h={value:"open",label:m,description:u},e[18]=m,e[19]=u,e[20]=h):h=e[20];let d;e[21]!==o||e[22]!==f||e[23]!==h?(d=[o,f,h],e[21]=o,e[22]=f,e[23]=h,e[24]=d):d=e[24];const x=d;let g;e[25]!==n||e[26]!==x||e[27]!==i?(g=y=>{const{field:j}=y,b=j.value??"smart";return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{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(Fe,{value:b,onValueChange:S=>{j.onChange(S),n()},children:[t.jsx(Ae,{id:"publish-policy",className:"w-44 shrink-0",children:t.jsx(Ie,{})}),t.jsx($e,{className:"max-w-80",children:x.map(Mr)})]})]})},e[25]=n,e[26]=x,e[27]=i,e[28]=g):g=e[28];let v;return e[29]!==s||e[30]!==g?(v=t.jsx(be,{name:"metadata.publishPolicy",control:s,render:g}),e[29]=s,e[30]=g,e[31]=v):v=e[31],v}function Mr(a){return t.jsx(we,{value:a.value,description:a.description,children:a.label},a.value)}function _r(a){const e=q.c(24),{control:s,onCommit:n}=a,i=Z();let l;e[0]!==i?(l=i("sandbox.cmsSettings.contentEditing.off"),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==i?(r=i("sandbox.cmsSettings.contentEditing.offDescription"),e[2]=i,e[3]=r):r=e[3];let o;e[4]!==l||e[5]!==r?(o={value:"off",label:l,description:r},e[4]=l,e[5]=r,e[6]=o):o=e[6];let p;e[7]!==i?(p=i("sandbox.cmsSettings.contentEditing.on"),e[7]=i,e[8]=p):p=e[8];let c;e[9]!==i?(c=i("sandbox.cmsSettings.contentEditing.onDescription"),e[9]=i,e[10]=c):c=e[10];let f;e[11]!==p||e[12]!==c?(f={value:"on",label:p,description:c},e[11]=p,e[12]=c,e[13]=f):f=e[13];let m;e[14]!==o||e[15]!==f?(m=[o,f],e[14]=o,e[15]=f,e[16]=m):m=e[16];const u=m;let h;e[17]!==n||e[18]!==u||e[19]!==i?(h=x=>{const{field:g}=x,v=g.value??null,y=Qs(v);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(ye,{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(Fe,{value:y,onValueChange:j=>{const b=da.safeParse(j);b.success&&(g.onChange(ua(v,b.data)),n())},children:[t.jsx(Ae,{id:"content-editing-mode",className:"w-44 shrink-0",children:t.jsx(Ie,{})}),t.jsx($e,{className:"max-w-80",children:u.map(Vr)})]})]})},e[17]=n,e[18]=u,e[19]=i,e[20]=h):h=e[20];let d;return e[21]!==s||e[22]!==h?(d=t.jsx(be,{name:"metadata.ui.layout",control:s,render:h}),e[21]=s,e[22]=h,e[23]=d):d=e[23],d}function Vr(a){return t.jsx(we,{value:a.value,description:a.description,children:a.label},a.value)}function ys(a){const e=a.metadata?.sidebarViews,s=a.metadata?.sidebarViewsVersion;return{effectiveViews:[...Vt(Tt(a.metadata),s)],rawViews:e===null?null:e?[...e]:void 0,version:s,seen:a.metadata?.sidebarViewsSeen??void 0}}function ws(a,e){return a===e?!0:!a||!e||a.length!==e.length?!1:a.every((s,n)=>s===e[n])}function Tr(a,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...a,shareDialogOpen:e.payload};case"SET_ADD_DIALOG_OPEN":return{...a,addDialogOpen:e.payload};case"OPEN_SETTINGS":return{...a,settingsDialogOpen:!0,settingsConnectionId:e.payload};case"CLOSE_SETTINGS":return{...a,settingsDialogOpen:!1,settingsConnectionId:null};default:return a}}function Dr(a,e){switch(e.type){case"accumulate":{const s=a??{start:e.now,fields:new Set,saveCount:0,instructionsLength:null},n=new Set(s.fields);for(const i of e.fields)n.add(i);return{...s,fields:n,saveCount:s.saveCount+1,instructionsLength:e.instructionsLength??s.instructionsLength}}case"reset":return null}}function Pr(a){const e=a.metadata?.runtime?.env;if(!e||e.length===0)return a;const s=e.filter(n=>{if(!n||typeof n!="object")return!1;const i=(n.key??"").trim();return!i||!bt.test(i)?!1:n.kind==="literal"?!0:n.kind==="secret"?!!n.secretId:!1});return s.length===e.length?a:{...a,metadata:{...a.metadata,runtime:{...a.metadata?.runtime??{},env:s}}}}async function Or(a,e){const s=a?.idToken??null;if(s){const i=Ss(s);if(i)return i}const n=a?.userinfoEndpoint??null;if(n)try{const i=await fetch(n,{headers:{Authorization:`Bearer ${e}`}});if(i.ok){const l=await i.json(),r=typeof l.email=="string"?l.email:typeof l.upn=="string"?l.upn:typeof l.preferred_username=="string"?l.preferred_username:null;if(r)return r}}catch{}return Ss(e)}function Ss(a){try{const e=a.split(".");if(e.length===3&&e[1]){const s=JSON.parse(atob(e[1].replace(/-/g,"+").replace(/_/g,"/")));if(typeof s.email=="string")return s.email;if(typeof s.upn=="string")return s.upn;if(typeof s.preferred_username=="string")return s.preferred_username}}catch{}return null}function Ar({virtualMcp:a,contextSection:e}){const s=Z(),n=Hn(),{org:i}=Ee(),l=ei(),{data:r}=ti([a.id]),o=r?.get(a.id)?.last_used_at,p=Os(),c=Ds(),f=Pt(),m=qs(a.id),u=JSON.stringify([i.id,a.id]),h=Zi(a.metadata,m.snapshot()),d=_n({resolver:Vn(Xl),defaultValues:{...a,metadata:{...ls(a.metadata),previewServerUrl:oa(a.metadata),...h}}}),x=d.watch("connections"),g=Sa("multi_app_preview"),v=Li(a),y=Gs(a?.metadata),j=y&&Qs(d.watch("metadata.ui.layout"))==="off",b=Is(a),S=b?{owner:b.owner,name:b.name,url:b.url}:null,[N,k]=Q.useReducer(Tr,{shareDialogOpen:!1,addDialogOpen:!1,settingsDialogOpen:!1,settingsConnectionId:null}),[w,C]=Q.useState(!1),[M,_]=Q.useState(!1),{openSidePanel:V}=Kn(),{sendMessage:E}=Un(),P=async()=>{if(M)return;const D=d.getValues("metadata.instructions");if(D?.trim()){_(!0);try{K(),Ve("agent_instructions_improve_clicked",{agent_id:a.id,instructions_length:D.length}),V();const te=Rn(i.id);await E({tiptapDoc:Bn({managerAgentId:te.id,managerName:te.title,kind:"agent",id:a.id,instructions:D})})}finally{_(!1)}}},[I,A]=Q.useReducer(Dr,null),R=()=>{I!==null&&(Ve("agent_updated",{agent_id:a.id,fields:Array.from(I.fields),instructions_length:I.instructionsLength,save_count:I.saveCount,edit_duration_ms:Date.now()-I.start}),A({type:"reset"}))},{schedule:U,flush:K}=es({delayMs:3e4,save:async()=>R()}),W=async()=>{const D=m.snapshot(),te={predicate:Ne=>is(Ne.queryKey,i.id)},ne=async()=>(await c.invalidateQueries({predicate:Ne=>is(Ne.queryKey,i.id),refetchType:"all"}),ns(c,i.id,a.id)),xe=(Ne,qe)=>{if(Ne){ws(d.getValues("metadata.sidebarViews"),Ne.rawViews)||d.setValue("metadata.sidebarViews",Ne.rawViews,{shouldDirty:!1}),d.getValues("metadata.sidebarViewsVersion")!==Ne.version&&d.setValue("metadata.sidebarViewsVersion",Ne.version,{shouldDirty:!1}),ws(d.getValues("metadata.sidebarViewsSeen"),Ne.seen)||d.setValue("metadata.sidebarViewsSeen",Ne.seen,{shouldDirty:!1});return}qe!==null&&(d.setValue("metadata.sidebarViews",[...qe],{shouldDirty:!1}),d.setValue("metadata.sidebarViewsVersion",Xi,{shouldDirty:!1}))},_e=ea(D),De=Object.keys(d.control._formState.dirtyFields);if(De.length===0&&!_e){await m.settle({snapshot:D,saved:!0,authoritativeViews:D?.persistedViews});return}const Ke=De.length>0?De:["metadata"],ct=Ke.includes("metadata"),Ge=d.getValues();d.reset(Ge,{keepValues:!0});const tt=Pr(Ge),cn=ns(c,i.id,a.id),dn=ta({sidebarViews:tt.metadata?.sidebarViews,sidebarViewsVersion:tt.metadata?.sidebarViewsVersion},D,cn?.metadata);tt.metadata={...ls(tt.metadata),...dn};let yt;try{yt=await l.update.mutateAsync({id:a.id,data:tt})}catch(Ne){let qe=null;try{qe=await ne()}catch{}const Ut=qe?ys(qe):null,Yt=await m.settle({snapshot:D,saved:!1,authoritativeViews:Ut?.effectiveViews});throw Yt.settledLatest&&xe(Ut,Yt.reconciledViews),Ne}await c.cancelQueries(te),sa(c,i.id,yt);const Rt=ys(yt),Lt=await m.settle({snapshot:D,saved:!0,authoritativeViews:Rt.effectiveViews});Lt.settledLatest&&xe(Rt,Lt.reconciledViews),A({type:"accumulate",now:Date.now(),fields:Ke,instructionsLength:ct?Ge.metadata?.instructions?.length??0:null}),U()},G=()=>Na(u,W),{schedule:L,flush:Y}=es({save:G});Q.useEffect(()=>{const D=d.watch(()=>L());return()=>D.unsubscribe()},[]);const X=()=>{Ve("connections_dialog_opened",{source:"agent_settings",mode:"add"}),k({type:"SET_ADD_DIALOG_OPEN",payload:!0})},T=async D=>{const te=d.getValues("connections");if(te.some(_e=>_e.connection_id===D))return;d.setValue("connections",[...te,{connection_id:D,selected_tools:Ct.tools,selected_resources:Ct.resources,selected_prompts:Ct.prompts}],{shouldDirty:!0}),k({type:"SET_ADD_DIALOG_OPEN",payload:!1});const ne=new URL(`/api/${i.slug}/mcp/${D}`,window.location.origin),xe=await Ht({url:ne.href,token:null,orgId:i.id});xe.supportsOAuth&&!xe.isAuthenticated&&await J(D)},z=D=>{const ne=d.getValues("connections").filter(xe=>xe.connection_id!==D);d.setValue("connections",ne,{shouldDirty:!0})},B=(D,te)=>{const ne=d.getValues("connections");if(ne.some(xe=>xe.connection_id===te)){re.error(s("virtualMcp.virtualMcp.instanceAlreadyAdded"));return}d.setValue("connections",ne.map(xe=>xe.connection_id===D?{...xe,connection_id:te}:xe),{shouldDirty:!0})},O=async D=>{if(d.getValues("connections").find(ne=>ne.connection_id===D))try{const{item:ne}=await f.call("COLLECTION_CONNECTIONS_GET",{id:D});if(!ne)return;const xe=ne.title.replace(/\s*\(.*?\)\s*$/,""),_e=Ln("conn"),De=`${xe} (${Date.now().toString(36).slice(-4)})`;await p.create.mutateAsync({id:_e,title:De,description:ne.description??null,connection_type:ne.connection_type,connection_url:ne.connection_url??null,connection_token:null,icon:ne.icon??null,app_name:ne.app_name??null,app_id:ne.app_id??null,connection_headers:ne.connection_headers??null});const Ke=new URL(`/api/${i.slug}/mcp/${_e}`,window.location.origin),ct=await Ht({url:Ke.href,token:null,orgId:i.id});if(ct.supportsOAuth&&!ct.isAuthenticated){const Ge=await J(_e);if(!Ge){await p.delete.mutateAsync(_e);return}await p.update.mutateAsync({id:_e,data:{title:`${xe} (${Ge})`}})}B(D,_e),re.success(s("virtualMcp.virtualMcp.newInstanceCreated"))}catch(ne){console.error("Failed to create instance:",ne),re.error(s("virtualMcp.virtualMcp.failedToCreateInstance"))}},$=D=>{k({type:"OPEN_SETTINGS",payload:D})},J=async D=>{const{token:te,tokenInfo:ne,error:xe}=await Xn({connectionId:D,orgSlug:i.slug,scope:"offline_access"});if(xe||!te)return re.error(s("virtualMcp.virtualMcp.authenticationFailed",{error:xe??""})),null;if(ne)try{const De=await fetch(`/api/${i.slug}/connections/${D}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:ne.accessToken,refreshToken:ne.refreshToken,expiresIn:ne.expiresIn,scope:ne.scope,clientId:ne.clientId,clientSecret:ne.clientSecret,tokenEndpoint:ne.tokenEndpoint})});if(!De.ok)console.error("Failed to save OAuth token:",await De.text()),await p.update.mutateAsync({id:D,data:{connection_token:te}});else try{await p.update.mutateAsync({id:D,data:{}})}catch(Ke){console.warn("Failed to refresh connection tools after OAuth:",Ke)}}catch(De){console.error("Error saving OAuth token:",De),await p.update.mutateAsync({id:D,data:{connection_token:te}})}else await p.update.mutateAsync({id:D,data:{connection_token:te}});const _e=new URL(`/api/${i.slug}/mcp/${D}`,window.location.origin);return await c.invalidateQueries({queryKey:Ot.isMCPAuthenticated(_e.href,null)}),re.success(s("virtualMcp.virtualMcp.authenticationSuccessful")),Or(ne,te)},ie=()=>{const D=d.getValues("metadata.instructions")??"",te=s("virtualMcp.virtualMcp.promptTemplateContent"),ne=D.trim()?`${D}
|
|
3
|
-
|
|
4
|
-
${te}`:te;d.setValue("metadata.instructions",ne,{shouldDirty:!0})},de=new Set(x.map(D=>D.connection_id)),{section:ae}=Ul(),oe=e!==null,H=e==="instructions"?null:e??ae,ce=H==="general",me=oe?e==="instructions":ce,pe=Ui(a.id)==="v8",fe=zl({virtualMcpId:a.id,form:d,flushAndSave:Y}),he=At(),[ve,ue]=Q.useState(!1),F=async()=>{K();try{await l.delete.mutateAsync(a.id),Ve("agent_deleted",{agent_id:a.id,source:"agent_detail"}),re.success(s("virtualMcp.virtualMcp.agentDeleted",{title:a.title})),he({to:"/$org",params:{org:i.slug}})}catch{}},se=t.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>{Ve("agent_connect_modal_opened",{agent_id:a.id}),k({type:"SET_SHARE_DIALOG_OPEN",payload:!0})},children:[t.jsx(Tn,{size:14}),s("virtualMcp.virtualMcp.connect")]}),Te=t.jsxs("div",{className:"flex items-center gap-2",children:[!d.watch("metadata.instructions")?.trim()&&t.jsx(ee,{variant:"outline",size:"sm",onClick:ie,children:s("virtualMcp.virtualMcp.promptTemplate")}),t.jsxs(ee,{variant:"outline",size:"sm",disabled:M||!d.watch("metadata.instructions")?.trim(),onClick:P,children:[t.jsx(ut,{size:13}),s("virtualMcp.virtualMcp.improve")]})]});return t.jsxs(Ye,{children:[t.jsxs(t.Fragment,{children:[!oe&&t.jsxs(t.Fragment,{children:[t.jsx(Ye.Title,{children:s("virtualMcp.settings.title")}),t.jsx(Ll,{section:H??"general"})]}),t.jsx(Ye.Actions,{secondary:H==="connections"?se:void 0,children:H==="connections"?t.jsxs(ee,{size:"sm",onClick:X,children:[t.jsx(Pe,{size:14}),s("virtualMcp.virtualMcp.addConnection")]}):se}),t.jsx(Ye.Content,{children:t.jsx(Ye.Container,{width:"standard",className:"@container/project-settings",children:t.jsxs(Dn,{children:[ce&&t.jsx($l,{views:fe}),ce&&t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(Rl,{form:d,onCommit:Y}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 text-xs text-muted-foreground",children:[t.jsx(Yn,{id:a.created_by,size:"2xs",className:"text-sm text-muted-foreground"}),t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsxs("span",{children:[s("virtualMcp.virtualMcp.created")," ",qa(new Date(a.created_at),"PP",{locale:n})]}),t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsx("span",{children:o?s("virtualMcp.virtualMcp.lastUsed",{time:Qn(new Date(o),{addSuffix:!0,locale:n})}):s("virtualMcp.virtualMcp.neverUsed")})]})]}),H==="connections"&&t.jsx("section",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:x.length===0?t.jsxs("button",{type:"button",onClick:X,className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:s("virtualMcp.virtualMcp.noConnectionsYet")})]}):x.map(D=>t.jsx(Be,{fallback:()=>null,children:t.jsx(Q.Suspense,{fallback:t.jsx(nn,{}),children:t.jsx(Nl,{connection_id:D.connection_id,usedConnectionIds:de,onOpenSettings:()=>$(D.connection_id),onRemove:()=>z(D.connection_id),onAuthenticate:J,onSwitchInstance:B,onNewInstance:()=>O(D.connection_id)})})},D.connection_id))})}),me&&t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:s("virtualMcp.virtualMcp.instructions")}),Te]}),t.jsx(be,{name:"metadata.instructions",control:d.control,render:({field:D})=>t.jsxs("div",{className:"relative rounded-xl shadow-edge bg-card focus-within-ring",children:[t.jsx(mt,{...D,value:D.value??"",onChange:te=>{D.onChange(te)},onBlur:()=>{D.onBlur(),Y()},placeholder:s("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"min-h-[200px] max-h-[360px] overflow-auto resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed border-0 shadow-none px-4 py-3 pr-11 focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent",style:{boxShadow:"none"}}),t.jsxs(Ce,{delayDuration:0,children:[t.jsx(ke,{asChild:!0,children:t.jsx(ee,{type:"button",variant:"ghost",size:"icon-sm",className:"absolute top-2 right-2 text-muted-foreground",onClick:()=>C(!0),"aria-label":s("virtualMcp.virtualMcp.openFullscreenEditor"),children:t.jsx(Ni,{size:14})})}),t.jsx(Me,{side:"left",children:s("virtualMcp.virtualMcp.fullscreen")})]})]})})]}),me&&t.jsx(Qa,{form:d}),ce&&t.jsx(Be,{fallback:()=>null,children:t.jsx(Q.Suspense,{fallback:t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:s("virtualMcp.virtualMcp.subAgents")}),t.jsx("div",{className:"h-16 rounded-lg border border-dashed border-border animate-pulse"})]}),children:t.jsx(al,{form:d,currentAgentId:a.id})})}),H==="site"&&y&&t.jsx(We,{title:s("sandbox.cmsSettings.title"),children:t.jsxs(Re,{children:[t.jsx(je,{children:t.jsx(_r,{control:d.control,onCommit:Y})}),!j&&t.jsx(je,{children:t.jsx(Cr,{control:d.control})}),!j&&v&&t.jsx(je,{children:t.jsx(kr,{control:d.control,onCommit:Y})})]})}),H==="site"&&!j&&t.jsx(We,{title:s("sandbox.cmsSettings.preview.title"),description:s("sandbox.cmsSettings.preview.description"),children:t.jsx(Re,{children:t.jsx(Ql,{control:d.control,isBlocksV8:pe,previewServerUrl:d.watch("metadata.previewServerUrl"),fastPreview:d.watch("metadata.fastPreview")})})}),H==="site"&&pe&&v&&t.jsx(Wl,{orgSlug:i.slug,virtualMcpId:a.id}),H==="site"&&t.jsx(We,{title:s("virtualMcp.virtualMcp.sandbox"),children:t.jsxs(Re,{children:[t.jsx(je,{children:t.jsx(gr,{repo:S})}),t.jsx(je,{children:t.jsx(yr,{control:d.control})}),g&&t.jsx(je,{children:t.jsx(Nr,{control:d.control})}),t.jsx(je,{children:t.jsx(cr,{control:d.control,form:d,virtualMcpId:a.id,orgSlug:i.slug,sandboxMap:a.metadata.sandboxMap})})]})}),ce&&t.jsx(We,{title:s("virtualMcp.settings.groups.advanced"),children:t.jsx(Re,{children:t.jsx(st,{title:s("virtualMcp.virtualMcp.deleteAgent"),description:s("virtualMcp.virtualMcp.deleteAgentDescription"),action:t.jsxs(ee,{variant:"outline",size:"sm",className:"text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:()=>ue(!0),children:[t.jsx(ht,{size:14}),s("virtualMcp.virtualMcp.deleteAgent")]})})})})]})})},e??H)]}),t.jsx(Pn,{open:ve,onOpenChange:ue,children:t.jsxs(On,{children:[t.jsxs(An,{children:[t.jsx(In,{children:s("virtualMcp.virtualMcp.deleteAgentConfirm")}),t.jsx($n,{children:s("virtualMcp.virtualMcp.deleteAgentConfirmDescription",{title:a.title})})]}),t.jsxs(Fn,{children:[t.jsx(En,{children:s("virtualMcp.virtualMcp.cancel")}),t.jsx(zn,{onClick:F,variant:"destructive",children:s("virtualMcp.virtualMcp.delete")})]})]})}),t.jsx(ki,{open:N.addDialogOpen,onOpenChange:D=>k({type:"SET_ADD_DIALOG_OPEN",payload:D}),agentId:a.id,addedConnectionIds:de,onAdd:T}),t.jsx(Sl,{open:N.settingsDialogOpen,onOpenChange:D=>{D||k({type:"CLOSE_SETTINGS"})},selectedId:N.settingsConnectionId,form:d,connections:x,onAuthenticate:J}),t.jsx(lr,{open:N.shareDialogOpen,onOpenChange:D=>k({type:"SET_SHARE_DIALOG_OPEN",payload:D}),virtualMcp:a}),t.jsx(Je,{open:w,onOpenChange:C,children:t.jsxs(Ze,{className:"w-[90vw] sm:max-w-6xl h-[85vh] flex flex-col p-0 gap-0",children:[t.jsx(lt,{className:"px-6 pt-6 pb-3 border-b border-border shrink-0",children:t.jsx(rt,{children:s("virtualMcp.virtualMcp.instructions")})}),t.jsx("div",{className:"flex-1 min-h-0 p-6",children:t.jsx(be,{name:"metadata.instructions",control:d.control,render:({field:D})=>t.jsx(mt,{...D,value:D.value??"",onChange:te=>{D.onChange(te)},onBlur:()=>{D.onBlur(),Y()},placeholder:s("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"w-full h-full resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed rounded-xl shadow-edge px-4 py-3 focus-ring bg-card border-0",style:{boxShadow:"none"}})})})]})})]})}function Go(a){const e=q.c(22),{virtualMcpId:s,contextSection:n}=a,i=n===void 0?null:n,l=Z(),r=At(),{org:o}=Ee(),p=As(s);if(!p){let u;e[0]!==l?(u=l("virtualMcp.virtualMcp.spaceNotFound"),e[0]=l,e[1]=u):u=e[1];let h;e[2]!==l?(h=l("virtualMcp.virtualMcp.spaceNotFoundDescription"),e[2]=l,e[3]=h):h=e[3];let d;e[4]!==r||e[5]!==o.slug?(d=()=>r({to:"/$org",params:{org:o.slug}}),e[4]=r,e[5]=o.slug,e[6]=d):d=e[6];let x;e[7]!==l?(x=l("virtualMcp.virtualMcp.backToSpaces"),e[7]=l,e[8]=x):x=e[8];let g;e[9]!==d||e[10]!==x?(g=t.jsx(ee,{variant:"outline",onClick:d,children:x}),e[9]=d,e[10]=x,e[11]=g):g=e[11];let v;return e[12]!==u||e[13]!==h||e[14]!==g?(v=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Wn,{title:u,description:h,actions:g})}),e[12]=u,e[13]=h,e[14]=g,e[15]=v):v=e[15],v}let c;e[16]!==p?(c=Is(p)?.connectionId??"",e[16]=p,e[17]=c):c=e[17];const f=`${p.id}:${c}`;let m;return e[18]!==i||e[19]!==f||e[20]!==p?(m=t.jsx(Ar,{virtualMcp:p,contextSection:i},f),e[18]=i,e[19]=f,e[20]=p,e[21]=m):m=e[21],m}export{Go as V};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as A,d as U,u as q,ad as z,j as m,n as D}from"./index-DJ1OawZD.js";import{l as G,b as J,H as K}from"./location-V0VwTJTt.js";import{u as Q}from"./use-mobile-Dqpuq5pP.js";import{u as V,C as B}from"./index-Lk-lDKnf.js";import{C as E,o as W,a as X,L as H}from"./context-shell-wfjVQB-Y.js";import{L as R}from"./preview-panel-Co9xo5DN.js";import"./use-sidebar-collapsed-wg8O55qL.js";import"./use-chat-layout-state-mgi-uN0U.js";import"./thread-route-lJ46mBb6.js";import"./use-panel-navigate-gymQhz_L.js";import"./use-project-scope-C7QHVYKL.js";import"./repository-binding-BItepy-z.js";import"./use-mcp-client-AOCIses4.js";import"./auth-DdsRd0Yn.js";import"./thread-intent-BpcQdr2N.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-B6QIPvpK.js";import"./task-board-uliYMpMh.js";import"./schema-Db1omEtk.js";import"./slugify-CEUa2lfQ.js";import"./agent-icon-8z_1onUt.js";import"./AlertCircle-C4AlXfWH.js";import"./Tool01-BM_jAXaw.js";import"./ArrowUp-ByoUzoe_.js";import"./ArrowLeft-wEhmrFT_.js";import"./LinkBroken01-DUZnTa9c.js";import"./ShoppingBag01-43aM_SvI.js";import"./ZoomOut-DmiEhPgw.js";import"./Building02-FHqo8UFz.js";import"./CheckCircle-DvIMPtKQ.js";import"./ChevronUp-BO5R2-Sx.js";import"./ChevronSelectorVertical-B4fUuU69.js";import"./UserSquare-Cm6nmxmp.js";import"./Copy01-j7Nlt5qU.js";import"./CreditCard01-Cswluz13.js";import"./DotsVertical-CaKzUPHY.js";import"./Image01-Br2Za8Gz.js";import"./Globe04-BHUGUEw-.js";import"./SwitchHorizontal01-DgO15jXk.js";import"./Key01-6xIzri6P.js";import"./Link01-Dp0vu4Af.js";import"./Minus-8YEgVl9l.js";import"./Monitor01-x3qJMHxB.js";import"./Sun-CsCFS7Mx.js";import"./Play-CNerU9Fh.js";import"./Plus-Dd1LZQDu.js";import"./SearchMd-huYq_veH.js";import"./Trash01-D_6j6Kjo.js";import"./Upload01-jTJu_yfb.js";import"./Users01-BM-G7vNB.js";import"./XClose-CmsTtHZr.js";import"./tooltip-Bbs97viR.js";import"./index-CsjIwzuX.js";import"./toolbar-icon-button-B0kxSi5C.js";import"./shell-layout-BQMms4WU.js";import"./use-deployment-admin-BC77P2O5.js";import"./admin-fetch-BhTJlAsX.js";import"./use-clock-tick-i4_RgreD.js";import"./command-DQVIGVkX.js";import"./index-CHgXf2G3.js";import"./integration-icon-vdbLoXVP.js";import"./project-icon-D-mQ9iWl.js";import"./new-project-dialog-Dbr37SLy.js";import"./label-DIWSyY3V.js";import"./repository-import-picker-UUcvjgba.js";import"./use-navigate-to-agent-BGSn17g4.js";import"./repository-picker-DGSuy8Qj.js";import"./useInfiniteQuery-BRUBBHZd.js";import"./infiniteQueryObserver-L6rGGtyF.js";import"./collection-search-CA6Hdd1a.js";import"./use-debounced-value-gF2MCEqA.js";import"./use-organization-settings-DeGpDV0v.js";import"./required-auth-layout-Cx9a6Ts4.js";import"./autosend-1JuiPy5f.js";import"./use-org-sso-B27z5H2P.js";import"./sheet-jVe6rN26.js";import"./resizable-DcjZRINV.js";import"./icon-button-BxmZsAbq.js";import"./search-input-BD_zzwAH.js";import"./search-toggle-DI1P1fkR.js";import"./chat-context-BO-O8zYY.js";import"./use-decopilot-events-Cf_7qBPp.js";import"./use-ai-providers-BIcA-ltu.js";import"./use-org-fs-Bkdq3N3W.js";import"./use-org-repo-syncs-C0DcFw22.js";import"./textarea-CxbswNZX.js";import"./markdown-NzM3VJeN.js";import"./use-copy-BYz3Xa4M.js";import"./file-share-button-B9Fb7DUQ.js";import"./popover-Cn1OW4zx.js";import"./preview-dialog-5T4OQ5N2.js";import"./preview-content-BY9XqHdY.js";import"./file-preview-B-sfAHHw.js";import"./utils-Dg8Zqgfy.js";import"./editor-D84lw5XU.js";import"./file-type-icon-C7xJ53He.js";import"./folder-icon-DkGrMgcn.js";import"./empty-state-C1-6oKUX.js";import"./toggle-group-DJ6VL3oV.js";import"./active-indicator-CCMhAsc_.js";import"./table-scnpQL_A.js";import"./require-capability-B3LM64w7.js";import"./access-gate-DcyD6s41.js";import"./capability-load-error-A9LFDt5q.js";import"./sections-Bfbs4u2V.js";import"./empty-state-YnMyEE1u.js";function Xe(){const t=A.c(58),N=U();let v;t[0]===Symbol.for("react.memo_cache_sentinel")?(v={strict:!1},t[0]=v):v=t[0];const{preview:e,expanded:k,section:O}=q(v),b=z();let C;t[1]!==O?(C=W(O),t[1]=O,t[2]=C):C=t[2];const l=C;let y;t[3]!==N?(y=i=>N({to:".",search:r=>({...r,...i.path!==void 0&&{path:i.path},preview:i.preview,expanded:i.expanded})}),t[3]=N,t[4]=y):y=t[4];const o=y;let g;t[5]!==o?(g=()=>o({}),t[5]=o,t[6]=g):g=t[6];const p=g,F=Q(),w=V().threadOpen&&!F;if(b&&l!=="files"){let i;t[7]!==l?(i=m.jsx(X,{section:l}),t[7]=l,t[8]=i):i=t[8];let r;return t[9]!==l||t[10]!==i?(r=m.jsx(B.Content,{children:m.jsx(E,{section:l,children:i})}),t[9]=l,t[10]=i,t[11]=r):r=t[11],r}if(e&&(k||w)){let i,r,f,s,c;if(t[12]!==p||t[13]!==e||t[14]!==o){let T;t[20]!==e?(T=e.lastIndexOf("/"),t[20]=e,t[21]=T):T=t[21];const I=e.slice(0,Math.max(T,0));r=B.Content,i=D.Breadcrumbs,f="page",t[22]!==p?(s={onSelect:p},t[22]=p,t[23]=s):s=t[23];let L;t[24]!==o?(L=_=>({key:`folder:${_.path}`,label:_.label,onSelect:()=>o({path:_.path})}),t[24]=o,t[25]=L):L=t[25];const $=G(I,K).map(L);let j;t[26]!==e?(j=J(e),t[26]=e,t[27]=j):j=t[27];let M;t[28]!==j?(M={key:"file",label:j},t[28]=j,t[29]=M):M=t[29],c=[...$,M],t[12]=p,t[13]=e,t[14]=o,t[15]=i,t[16]=r,t[17]=f,t[18]=s,t[19]=c}else i=t[15],r=t[16],f=t[17],s=t[18],c=t[19];let d;t[30]!==i||t[31]!==f||t[32]!==s||t[33]!==c?(d=m.jsx(i,{after:f,parent:s,items:c}),t[30]=i,t[31]=f,t[32]=s,t[33]=c,t[34]=d):d=t[34];let x;t[35]!==w||t[36]!==e||t[37]!==o?(x=w?void 0:()=>o({preview:e}),t[35]=w,t[36]=e,t[37]=o,t[38]=x):x=t[38];let h;t[39]!==x?(h={expanded:!0,onToggle:x},t[39]=x,t[40]=h):h=t[40];let u;t[41]!==p||t[42]!==e||t[43]!==h?(u=m.jsx(R,{previewPath:e,onClose:p,expand:h},e),t[41]=p,t[42]=e,t[43]=h,t[44]=u):u=t[44];let S;return t[45]!==r||t[46]!==u||t[47]!==d?(S=m.jsxs(r,{children:[d,u]}),t[45]=r,t[46]=u,t[47]=d,t[48]=S):S=t[48],S}let a;t[49]!==p||t[50]!==e||t[51]!==o?(a=e&&m.jsx(R,{variant:"aside",previewPath:e,onClose:p,expand:{expanded:!1,onToggle:()=>o({preview:e,expanded:!0})}},e),t[49]=p,t[50]=e,t[51]=o,t[52]=a):a=t[52];let n;t[53]!==b?(n=b?m.jsx(E,{section:"files",children:m.jsx(H,{filePreview:"side",context:!0})}):m.jsx(H,{filePreview:"side"}),t[53]=b,t[54]=n):n=t[54];let P;return t[55]!==a||t[56]!==n?(P=m.jsx(B.Content,{aside:a,children:n}),t[55]=a,t[56]=n,t[57]=P):P=t[57],P}export{Xe as default};
|