decocms 4.581.0 → 4.581.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BNgT9H-9.js → AlertCircle-D1QqLKFH.js} +1 -1
- package/dist/client/assets/{AreaChart-CizTxrut.js → AreaChart-C-sK2ItE.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CzuIgcZK.js → ArrowLeft-B_zuPCk3.js} +1 -1
- package/dist/client/assets/{ArrowUp-DX0Oa8sk.js → ArrowUp-BVEp2Brj.js} +1 -1
- package/dist/client/assets/{BookOpen01-BDEDqARy.js → BookOpen01-DU_gf3Q9.js} +1 -1
- package/dist/client/assets/{CartesianChart-D3UU8n4G.js → CartesianChart-BR9Be1vV.js} +1 -1
- package/dist/client/assets/{CategoricalChart-BXx_yOPa.js → CategoricalChart-DhUmp4Jo.js} +1 -1
- package/dist/client/assets/{CheckCircle-DGPVeuCJ.js → CheckCircle-r_uvA104.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-CI140ew9.js → ChevronSelectorVertical-Cnj6Mtq0.js} +1 -1
- package/dist/client/assets/{ChevronUp-B9DaDvS3.js → ChevronUp-fKdis79A.js} +1 -1
- package/dist/client/assets/{CreditCard01-BmpzvB5e.js → CreditCard01-2UGmTwp0.js} +1 -1
- package/dist/client/assets/{Globe04-BpbOo7AZ.js → Globe04-BIxVPRI2.js} +1 -1
- package/dist/client/assets/{Key01-Cpl2DWV2.js → Key01-B-uaWiXd.js} +1 -1
- package/dist/client/assets/{LinkBroken01-l43AWgbv.js → LinkBroken01-ChDYryt0.js} +1 -1
- package/dist/client/assets/{Minus-DyKaWISs.js → Minus-eMZySqLh.js} +1 -1
- package/dist/client/assets/{Monitor01-BdFmkSiY.js → Monitor01-CzcVShIo.js} +1 -1
- package/dist/client/assets/{Play-BDaEp7vE.js → Play-DK3U1VA7.js} +1 -1
- package/dist/client/assets/{Plus-Dxw22W7_.js → Plus-BNdH4tYy.js} +1 -1
- package/dist/client/assets/{ReferenceLine-CdPtulni.js → ReferenceLine-DAphe5so.js} +1 -1
- package/dist/client/assets/{SearchMd-DuFQ9UgF.js → SearchMd-DWnwnZQO.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-Bf_3Yh5l.js → ShoppingBag01-BrAbYbaG.js} +1 -1
- package/dist/client/assets/{Sun-vurMVi6G.js → Sun-wrM9Jol_.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-C-rlzvYe.js → SwitchHorizontal01-D7pFOqnZ.js} +1 -1
- package/dist/client/assets/{Tool01-D4x0RZqM.js → Tool01-AMJ0J7Ld.js} +1 -1
- package/dist/client/assets/{Tooltip-BKPDgiqg.js → Tooltip-CZ7doa0d.js} +1 -1
- package/dist/client/assets/{Trash01-CGrA2ON1.js → Trash01-Chu35sQ_.js} +1 -1
- package/dist/client/assets/{Upload01-6kkhuzxl.js → Upload01-CGdoFUP8.js} +1 -1
- package/dist/client/assets/{UserSquare-nHYvjai8.js → UserSquare-DUXP0rwX.js} +1 -1
- package/dist/client/assets/{Users01-e2r7hqMU.js → Users01-BnTqMUrr.js} +1 -1
- package/dist/client/assets/{XClose-CBDYK_AJ.js → XClose-BAfH6Ebz.js} +1 -1
- package/dist/client/assets/{Zap-DfRMi_rk.js → Zap-YDxTdktJ.js} +1 -1
- package/dist/client/assets/{access-gate-3uWjt152.js → access-gate-DDMODilC.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CsWthpZ9.js → add-connection-dialog-B8fK5SPo.js} +1 -1
- package/dist/client/assets/agent-app-CTOrbTVN.js +1 -0
- package/dist/client/assets/{agent-assets-yhsnLz6V.js → agent-assets-BnRemq1c.js} +1 -1
- package/dist/client/assets/{agent-automation-B9u566HN.js → agent-automation-DNgt345_.js} +1 -1
- package/dist/client/assets/{agent-automations-C6qoE6-c.js → agent-automations-mWv09YVd.js} +1 -1
- package/dist/client/assets/{agent-blog-post-D4VabN4w.js → agent-blog-post-D5O_ItNv.js} +2 -2
- package/dist/client/assets/{agent-blog-BANd-DOA.js → agent-blog-qw7eDyTJ.js} +2 -2
- package/dist/client/assets/{agent-calendar-B1gsu6Ys.js → agent-calendar-DFwq2V3Y.js} +1 -1
- package/dist/client/assets/{agent-capabilities-BobB8G3S.js → agent-capabilities-DSfvUGIA.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-D7PAwbiu.js → agent-connect-sources-BaY-1hUg.js} +1 -1
- package/dist/client/assets/agent-deck-DAVpyFYS.js +1 -0
- package/dist/client/assets/{agent-e2e-BqPOwNTz.js → agent-e2e-BzjDB0Mp.js} +1 -1
- package/dist/client/assets/agent-experiments-BbI7pAh_.js +1 -0
- package/dist/client/assets/{agent-file-Ctv4ydWn.js → agent-file-G_Q7_eCe.js} +1 -1
- package/dist/client/assets/{agent-hosting-BwGgYisC.js → agent-hosting-DPI1YzdW.js} +1 -1
- package/dist/client/assets/{agent-icon-7pgGOyab.js → agent-icon-DFd8L1O_.js} +1 -1
- package/dist/client/assets/agent-library-CF4cgtSY.js +1 -0
- package/dist/client/assets/agent-library-file-D0_5aahe.js +1 -0
- package/dist/client/assets/agent-overview-DGOr-pbZ.js +1 -0
- package/dist/client/assets/{agent-releases-nWFHpAct.js → agent-releases-DJ49AvX3.js} +1 -1
- package/dist/client/assets/agent-settings-Dm19cEBP.js +1 -0
- package/dist/client/assets/{agent-site-editor-Beg3HEIb.js → agent-site-editor-CqHVUUAC.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-Cdro8saM.js +2 -0
- package/dist/client/assets/agent-site-editor-content-BkBXLnyf.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-OMqwm4vD.js +1 -0
- package/dist/client/assets/agent-view-D6Nsllob.js +1 -0
- package/dist/client/assets/{agent-view-guard-Cke4S3ir.js → agent-view-guard-D4yaqKiq.js} +1 -1
- package/dist/client/assets/{ai-providers-ZTS5TR34.js → ai-providers-CovrDI_x.js} +1 -1
- package/dist/client/assets/{alert-CwJgunZE.js → alert-BA8nDu40.js} +1 -1
- package/dist/client/assets/{analytics-sections-D0V5jY1C.js → analytics-sections-C7dFg_aE.js} +1 -1
- package/dist/client/assets/{api-keys-Buv3-6nf.js → api-keys-BrhrD9eO.js} +1 -1
- package/dist/client/assets/api-keys-s9GXv_s3.js +1 -0
- package/dist/client/assets/{app-editor-DalU60Mc.js → app-editor-tnp3-UhR.js} +1 -1
- package/dist/client/assets/{asset-utils-DwPuRMbV.js → asset-utils-BSepCiAa.js} +1 -1
- package/dist/client/assets/{auth-DNlWgaIH.js → auth-DiKlrdGP.js} +1 -1
- package/dist/client/assets/{auth-catchall-CmRd1j4n.js → auth-catchall-tnYz6mdY.js} +1 -1
- package/dist/client/assets/{auth-entry-4GYbBxwp.js → auth-entry-SgfwAEXQ.js} +1 -1
- package/dist/client/assets/{auth-split-layout-6Kr3YCmt.js → auth-split-layout-D_rznvbe.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DpD35C_P.js → authenticate-and-persist-oauth-osQ4PKuX.js} +1 -1
- package/dist/client/assets/{automation-list-row-_Hy4DAtc.js → automation-list-row-FS-zfRjW.js} +1 -1
- package/dist/client/assets/{automation-runs-D3xh6rqy.js → automation-runs-DLYz6YWQ.js} +1 -1
- package/dist/client/assets/{automations-TJ3lg--K.js → automations-rbGBA3mS.js} +1 -1
- package/dist/client/assets/{badge-DJzADYLN.js → badge-BpUJoM3p.js} +1 -1
- package/dist/client/assets/{block-document-CLlHaiqy.js → block-document-yqfgnbbt.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-CLkDzb1Y.js → blocks-preview-workspace-context-CzI6HAkj.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-Dos-yNvu.js → blocks-tab-states-Uq85dLE5.js} +1 -1
- package/dist/client/assets/{blog-preview-url-B9WnCIII.js → blog-preview-url-BUDrdqoz.js} +1 -1
- package/dist/client/assets/{blog-schema-BNmzJDEb.js → blog-schema-Cqi3HnFC.js} +1 -1
- package/dist/client/assets/{blog-source-gate-DKGtTR_Q.js → blog-source-gate-BWofeMwB.js} +1 -1
- package/dist/client/assets/{blog-view-gate-CQ9aPosu.js → blog-view-gate-BjGoFrlO.js} +1 -1
- package/dist/client/assets/{buckets-Bi-uiwLZ.js → buckets-QdgXdcXC.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-D2ZrR4ET.js → build-improve-prompt-doc-Yt1kTpo8.js} +1 -1
- package/dist/client/assets/{calendar-DVn2WJPG.js → calendar-RX4MUBCU.js} +1 -1
- package/dist/client/assets/{capability-load-error-BQYVgnjq.js → capability-load-error-Dco-wYs-.js} +1 -1
- package/dist/client/assets/{category-editor-BiRVC1cc.js → category-editor-DMitV3My.js} +1 -1
- package/dist/client/assets/{category-tree-jh72wtxu.js → category-tree-CYPMeaO5.js} +1 -1
- package/dist/client/assets/{chart-Ddie86U1.js → chart-Q-cSHjjY.js} +1 -1
- package/dist/client/assets/{chat-context-ChgzPsES.js → chat-context-BVOzxL7y.js} +1 -1
- package/dist/client/assets/{chat-draft-B2tS32RP.js → chat-draft-DCJJT_1i.js} +1 -1
- package/dist/client/assets/{checkbox-CQfIpQ5a.js → checkbox-x2IxTucq.js} +1 -1
- package/dist/client/assets/{choose-editor-Bwogocbp.js → choose-editor-CMLPeKz2.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DbSIbWbL.js → cli-auth-success-DupR1ypd.js} +1 -1
- package/dist/client/assets/{client-icons-yH-3z7dy.js → client-icons-BXUuRiJU.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-DuNBWNJd.js → cms-settings-editor-BPeg7XT1.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-DGLCde3H.js → cms-store-drafts-DDyrwrmA.js} +1 -1
- package/dist/client/assets/{collapsible-fuf-L_qO.js → collapsible-CmQt_iZ0.js} +1 -1
- package/dist/client/assets/{collection-detail-CJvo4hBg.js → collection-detail-D7GPiaeW.js} +1 -1
- package/dist/client/assets/{collection-display-button-zHygXgth.js → collection-display-button-Q31iiQyG.js} +1 -1
- package/dist/client/assets/{collection-search-DIXRttD3.js → collection-search-kFWWyWV8.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Bp116wWk.js → collection-table-wrapper-lwnrgmvl.js} +1 -1
- package/dist/client/assets/{collection-tabs-nxDU_6IX.js → collection-tabs-ZWO3GiY3.js} +1 -1
- package/dist/client/assets/{combobox-BOO1GhW0.js → combobox-B7xBLEqp.js} +1 -1
- package/dist/client/assets/{command-BBpufUKx.js → command-C00hDMwB.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-Cw9eOzvy.js → companion-mcps-section-DqGiryze.js} +1 -1
- package/dist/client/assets/{config-DZ1AmUim.js → config-1WcD3pf5.js} +1 -1
- package/dist/client/assets/{connect-QNbrI0M1.js → connect-CPk_XjVi.js} +1 -1
- package/dist/client/assets/{connect-layout-CmTu9QhZ.js → connect-layout-Cki4va2J.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-DgL9lhtn.js → connect-source-dialog-OGa93hL5.js} +1 -1
- package/dist/client/assets/{connection-CP9XigF8.js → connection-CLrwGffq.js} +1 -1
- package/dist/client/assets/{connection-card-C84CXoEt.js → connection-card-CG85F9R4.js} +1 -1
- package/dist/client/assets/{connection-detail-3J7QgUsN.js → connection-detail-B8RNsYKm.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-vw6gzBiD.js → connection-form-helpers-Du6e-sDu.js} +1 -1
- package/dist/client/assets/{connection-slug-CI3A8_ee.js → connection-slug-BC6vEqea.js} +1 -1
- package/dist/client/assets/{connections-BHsWCRN2.js → connections-DTZU4hmT.js} +1 -1
- package/dist/client/assets/{content-tab-UCeaV9ZK.js → content-tab-xOpBPR9g.js} +3 -3
- package/dist/client/assets/{context-CqcUfuqw.js → context-DZfW90rI.js} +1 -1
- package/dist/client/assets/{context-menu-DTU6qOVz.js → context-menu-dgkpoBmD.js} +1 -1
- package/dist/client/assets/{context-shell-DqR6-S0A.js → context-shell-Dlkux8ZE.js} +3 -3
- package/dist/client/assets/{core.esm-DCJ7aKR3.js → core.esm-DUcC46mO.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DKxaQrfF.js → create-organization-dialog-CG0hKl_H.js} +1 -1
- package/dist/client/assets/{delete-copy-sYXKk3Pf.js → delete-copy-BLgf78Hs.js} +1 -1
- package/dist/client/assets/{device-hint-D11AIkCQ.js → device-hint-CmMhxStN.js} +1 -1
- package/dist/client/assets/{discover-DOTkM1SJ.js → discover-CI_r8-3h.js} +1 -1
- package/dist/client/assets/{domain-settings-DBmeAU8w.js → domain-settings-ClKI_rRO.js} +1 -1
- package/dist/client/assets/{drawer-DyYc7c6p.js → drawer-OboTDl5r.js} +1 -1
- package/dist/client/assets/{editor-Cx1cLsfT.js → editor-ChiPsACh.js} +1 -1
- package/dist/client/assets/{editor-classes-5OQkwYAb.js → editor-classes-De5o_8lB.js} +1 -1
- package/dist/client/assets/{empty-message-BxCQf5X6.js → empty-message-D92Pb6fP.js} +1 -1
- package/dist/client/assets/{empty-state-COfoPZ3l.js → empty-state-BcZKaOw-.js} +1 -1
- package/dist/client/assets/{empty-state-A6nZ3Khe.js → empty-state-CxI5dssp.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-DaaymsEH.js → experiments-tab-choice-DdEGbuLK.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Cfb1bv3l.js → extract-connection-data-DwWq6VY0.js} +1 -1
- package/dist/client/assets/{feature-gate-CESZ0bbT.js → feature-gate-qgzTBO3A.js} +1 -1
- package/dist/client/assets/{feature-paywall-D4s9Ps36.js → feature-paywall-ljVyCUfx.js} +1 -1
- package/dist/client/assets/{file-explorer-syldxbM0.js → file-explorer-fgWC9Rob.js} +1 -1
- package/dist/client/assets/{file-preview-B5GYsNzx.js → file-preview-C1UH8fjg.js} +1 -1
- package/dist/client/assets/{file-share-button-O89-cSWp.js → file-share-button-Bm5Af9aY.js} +1 -1
- package/dist/client/assets/{file-type-icon-CK3whZmM.js → file-type-icon-Dnh_2HcY.js} +1 -1
- package/dist/client/assets/{folder-icon-B0bQ9NL4.js → folder-icon-BZSobjd4.js} +1 -1
- package/dist/client/assets/{form-CKh2Qm-8.js → form-CuAETLLt.js} +1 -1
- package/dist/client/assets/{frame-navigation-c9xPkylV.js → frame-navigation-D2IzuXnb.js} +1 -1
- package/dist/client/assets/{general-4YbTEBSJ.js → general-CThohMer.js} +1 -1
- package/dist/client/assets/{github-icon-D3u8oGuo.js → github-icon-D0vbU4b9.js} +1 -1
- package/dist/client/assets/{held-block-view-9GD7sW5O.js → held-block-view-Clis5U4a.js} +1 -1
- package/dist/client/assets/{home-7FPOWVs4.js → home-DrAlxwLg.js} +1 -1
- package/dist/client/assets/{home-overview-D_b45WGe.js → home-overview-DPAQZtaE.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-j0Z_Am5O.js → hosted-reconcile-C2j-K6SC.js} +1 -1
- package/dist/client/assets/{icon-button-Bd1QIQSI.js → icon-button-D8OdW1Ng.js} +1 -1
- package/dist/client/assets/{index-CB2dsreI.js → index-54RE0ioE.js} +1 -1
- package/dist/client/assets/{index-RtIgAXvS.js → index-BATsrbDm.js} +1 -1
- package/dist/client/assets/{index-Dnajt-Ss.js → index-BTxnnO3z.js} +1 -1
- package/dist/client/assets/{index-BtpIwkuJ.js → index-ByeVWJ7k.js} +1 -1
- package/dist/client/assets/{index-DdNgZUci.js → index-CBYIpf8n.js} +1 -1
- package/dist/client/assets/{index-D1SFZrX0.js → index-CNMZKaZ4.js} +1 -1
- package/dist/client/assets/{index-mWjBJsbL.js → index-CY0csw6V.js} +1 -1
- package/dist/client/assets/{index-ClzeL0fX.js → index-C_OpZGYh.js} +1 -1
- package/dist/client/assets/{index-Bx5tjmDd.js → index-Ch7SvmMC.js} +1 -1
- package/dist/client/assets/{index-BUdfGMTq.js → index-CldZuS5S.js} +1 -1
- package/dist/client/assets/{index-HLnjLjm4.js → index-CxjuNZbg.js} +1 -1
- package/dist/client/assets/{index-Ctd-FMgv.js → index-D1w7KFj7.js} +1 -1
- package/dist/client/assets/{index-B1ZkAVAg.js → index-D3ue61h8.js} +1 -1
- package/dist/client/assets/{index-CC3v5-e4.js → index-DAjFmo5j.js} +1 -1
- package/dist/client/assets/{index-BqA84bKQ.js → index-DDDWDv4s.js} +3 -3
- package/dist/client/assets/{index-BzeTLGQv.js → index-DxWwCAMV.js} +1 -1
- package/dist/client/assets/{index-redirect-DqohMHdx.js → index-redirect-CYDCVRJ_.js} +1 -1
- package/dist/client/assets/{index-BK7R90SQ.js → index-wTvZKrHA.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-amUGbo-h.js → infiniteQueryObserver-ktArfc_t.js} +1 -1
- package/dist/client/assets/{infra-billing-aV_8QlC0.js → infra-billing-C-QVvoRz.js} +1 -1
- package/dist/client/assets/{input-D3jDgHNU.js → input-CBsHXM-K.js} +1 -1
- package/dist/client/assets/{input-CfL5_z7D.js → input-CFiVVIga.js} +3 -3
- package/dist/client/assets/{integration-icon-C9sCBDDr.js → integration-icon-D5RK2sEk.js} +1 -1
- package/dist/client/assets/{item-actions-DxYkkZP8.js → item-actions-DjxeOUUN.js} +1 -1
- package/dist/client/assets/{jira-icon-CcSFFwnZ.js → jira-icon-CmDZL_wM.js} +1 -1
- package/dist/client/assets/{label-Ducx0j9M.js → label-EESrxoYH.js} +1 -1
- package/dist/client/assets/{layout-DCetvNif.js → layout-Byi_jW8h.js} +1 -1
- package/dist/client/assets/{legacy-admin-welcome-dialog-C1mvlaj8.js → legacy-admin-welcome-dialog-DAEkCShw.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-BrG2c50d.js → legacy-agents-deep-CQX5HShD.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-B0LLa-b2.js → legacy-main-redirect-PkEZIvXO.js} +1 -1
- package/dist/client/assets/library-DuCkVtdF.js +1 -0
- package/dist/client/assets/{library-tab-y1C-Q300.js → library-tab-BLBQDXJU.js} +1 -1
- package/dist/client/assets/{login-DnAhZq8E.js → login-BQoCsEsr.js} +1 -1
- package/dist/client/assets/{markdown-DTS1cwWT.js → markdown-D5a0osui.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DEXD8Qqv.js → mcp-app-renderer-BgUWGow9.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CMXtLqpM.js → mcp-oauth-COyT3l0E.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C8CUMukq.js → mcp-oauth-CU691SiC.js} +1 -1
- package/dist/client/assets/{members-CUn6ovIa.js → members-n8Lstn8K.js} +1 -1
- package/dist/client/assets/{memory-DEndhGVA.js → memory-BgMa5u8j.js} +1 -1
- package/dist/client/assets/{mock-board-hNoqXmUR.js → mock-board-CSrbkqG4.js} +3 -3
- package/dist/client/assets/{monaco-editor-BKbGnxf4.js → monaco-editor-CwGsSUX8.js} +1 -1
- package/dist/client/assets/{monitoring-T940h_oR.js → monitoring-s0QSQdK5.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-2tRkF4-m.js → monitoring-stats-row-BsFnLxNy.js} +1 -1
- package/dist/client/assets/{multi-select-GBdcv1ph.js → multi-select-C5VqbVMP.js} +1 -1
- package/dist/client/assets/{mustache-CNh4n0Td.js → mustache-BVD8gEp8.js} +1 -1
- package/dist/client/assets/{named-rule-step-7q8hws5D.js → named-rule-step-BTqgnNQ5.js} +1 -1
- package/dist/client/assets/{named-rule-view-cnpqxYzZ.js → named-rule-view-Bd8STvPD.js} +1 -1
- package/dist/client/assets/{new-project-dialog-BOtGKQPA.js → new-project-dialog-BiqAeUrE.js} +1 -1
- package/dist/client/assets/{oauth-callback-DG0XUetw.js → oauth-callback-B5GC_Yyx.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DeIO_gxm.js → oauth-callback-ai-provider-Cn-Tp4BP.js} +1 -1
- package/dist/client/assets/{oauth-consent-D-6r1X7a.js → oauth-consent-BVAt6oz1.js} +1 -1
- package/dist/client/assets/{onboarding-CWuOwe9b.js → onboarding-fUXPiATA.js} +1 -1
- package/dist/client/assets/{openai-conversation-DLhmBPPN.js → openai-conversation-9mnOj04I.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-CvZPbOqN.js → optimistic-project-sidebar-views-CyYUwQmb.js} +1 -1
- package/dist/client/assets/{order-monitor-day-CyPFX5Di.js → order-monitor-day-DONFE4J2.js} +1 -1
- package/dist/client/assets/{organization-choice-Cw-WUBNy.js → organization-choice-BHlAXEW9.js} +1 -1
- package/dist/client/assets/{orgs-BiS6luDN.js → orgs-BAGB65GL.js} +1 -1
- package/dist/client/assets/{own-accounts-section-BqkowOV8.js → own-accounts-section-BCe3XCOA.js} +1 -1
- package/dist/client/assets/{pair-NNIqbXGE.js → pair-Fhnk8ar3.js} +1 -1
- package/dist/client/assets/{parse-sections-D5t3BRqc.js → parse-sections-yZQqTgrz.js} +2 -2
- package/dist/client/assets/{plan-D05Kl9P6.js → plan-D1utRlpJ.js} +1 -1
- package/dist/client/assets/{plan-ladder-CiVpDo1G.js → plan-ladder-CM-HcM-s.js} +1 -1
- package/dist/client/assets/{plan-usage-card-DRsDd5Ch.js → plan-usage-card-CMfNWBwg.js} +1 -1
- package/dist/client/assets/{popover-fDNjdHxM.js → popover-B_j0y2h7.js} +1 -1
- package/dist/client/assets/{post-calendar-CgP7AZe7.js → post-calendar-JMOv3xNE.js} +1 -1
- package/dist/client/assets/{post-editor-fRXyfFpy.js → post-editor-DQrYTE_3.js} +1 -1
- package/dist/client/assets/{preview-content-DkAXLl1L.js → preview-content-DvqZaSqe.js} +1 -1
- package/dist/client/assets/{preview-dialog-N7_y9qxA.js → preview-dialog-CEbSM9Y6.js} +1 -1
- package/dist/client/assets/{preview-panel-oVdKWth1.js → preview-panel-jbh-mjn6.js} +1 -1
- package/dist/client/assets/{preview-tab-BWI7aVoc.js → preview-tab-Cm6SZitV.js} +21 -15
- package/dist/client/assets/{product-picker-dialog-Dr51YJVY.js → product-picker-dialog-V4AhQCT6.js} +1 -1
- package/dist/client/assets/{profile-BXOGbnau.js → profile-BUCYaJ8H.js} +1 -1
- package/dist/client/assets/{project-app-view-Dn9IxbKG.js → project-app-view-C1zig9vg.js} +1 -1
- package/dist/client/assets/{project-apps-DN56tnxe.js → project-apps-CY9tfRYe.js} +1 -1
- package/dist/client/assets/{project-icon-C60MdZm4.js → project-icon-DNEfBFoN.js} +1 -1
- package/dist/client/assets/{project-index-Dv-ZwV38.js → project-index--AWJOyZB.js} +1 -1
- package/dist/client/assets/project-reports-DTqtwUEL.js +1 -0
- package/dist/client/assets/project-tasks-C14eJRtf.js +1 -0
- package/dist/client/assets/{projects-By-y5Jp6.js → projects-CJc-98C_.js} +1 -1
- package/dist/client/assets/{projects-empty-state-N3hmoiH1.js → projects-empty-state-CbOIGuob.js} +1 -1
- package/dist/client/assets/{prompts-DTm9aAYf.js → prompts-CEf1e1i5.js} +1 -1
- package/dist/client/assets/{record-editor-PaaqLZHk.js → record-editor-hYaeLcuc.js} +1 -1
- package/dist/client/assets/{redirect-editor-B2Eu0M_z.js → redirect-editor-3TvH_UFo.js} +1 -1
- package/dist/client/assets/{reports-sOqJNuXD.js → reports-D10gkSrT.js} +1 -1
- package/dist/client/assets/reports-Dqx3LdYF.js +1 -0
- package/dist/client/assets/{reports-onboarding-i6k1gG6Q.js → reports-onboarding-RhfCcqej.js} +1 -1
- package/dist/client/assets/{reports-tab-DSRN7hVk.js → reports-tab-CtVgyXhu.js} +2 -2
- package/dist/client/assets/repositories-CDGzat4Q.js +1 -0
- package/dist/client/assets/{repositories-BrLF1Aq0.js → repositories-CJnEkuZk.js} +1 -1
- package/dist/client/assets/{repository-binding-CekCSlJ1.js → repository-binding-DAYbvLYj.js} +1 -1
- package/dist/client/assets/{repository-picker-UWrxu6_V.js → repository-picker-BO6sLOq7.js} +1 -1
- package/dist/client/assets/{require-capability-C5tMOw5q.js → require-capability-DQWSlcjo.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Cpnwi031.js → required-auth-layout-Dg5kgnfG.js} +1 -1
- package/dist/client/assets/{reset-password-BYIakrjI.js → reset-password-B8UgVD_T.js} +1 -1
- package/dist/client/assets/{resizable-Czy-co3c.js → resizable-CaTV7JDr.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-C3kFsoiU.js → resolve-tab-icon-DEOb6228.js} +1 -1
- package/dist/client/assets/{review-settings-frbemaNj.js → review-settings-i1b4oJDO.js} +1 -1
- package/dist/client/assets/{role-color-BjM31aAV.js → role-color-BE5BDDIE.js} +1 -1
- package/dist/client/assets/{roles-BSFp9Lh1.js → roles-BgQMqKxE.js} +1 -1
- package/dist/client/assets/{route-DCjkGlFk.js → route-B8-5mDhW.js} +1 -1
- package/dist/client/assets/{route-BiurJAiU.js → route-BmXq3cGb.js} +1 -1
- package/dist/client/assets/route-CDNrV6ea.js +1 -0
- package/dist/client/assets/{sandbox-git-api-WjmMCJsj.js → sandbox-git-api-DJ1Zj_fI.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-Ba3XN5SW.js → sandbox-lifecycle-context-DAW3x9U4.js} +1 -1
- package/dist/client/assets/{save-status-CaR8n7_Z.js → save-status-BvsiA7U3.js} +1 -1
- package/dist/client/assets/{schema-CZJq0dLP.js → schema-B5L6XabR.js} +1 -1
- package/dist/client/assets/{schema-CXcca4Yf.js → schema-CPDsJI-V.js} +1 -1
- package/dist/client/assets/{scroll-area-CFXsBb2M.js → scroll-area-BIbpYC_e.js} +1 -1
- package/dist/client/assets/{search-input-SNpnMeEh.js → search-input-CTHDb7Fb.js} +1 -1
- package/dist/client/assets/{search-toggle-cAgGYPjr.js → search-toggle--RSSxY_n.js} +1 -1
- package/dist/client/assets/{secret-picker-CoNx1OUZ.js → secret-picker-B1Qdwzz-.js} +1 -1
- package/dist/client/assets/{secrets-7PqmB5m-.js → secrets-CpTgKWI_.js} +1 -1
- package/dist/client/assets/{section-array-field-BPHe_2nS.js → section-array-field-B-W5rSAO.js} +1 -1
- package/dist/client/assets/{sections-DIGnapH7.js → sections-HCoksWSk.js} +1 -1
- package/dist/client/assets/{sections-editor-BPeB4JuU.js → sections-editor-3egytFfS.js} +1 -1
- package/dist/client/assets/{select-DKwtgT2c.js → select-CCUqWhU2.js} +1 -1
- package/dist/client/assets/{select-model-bK-HmI0T.js → select-model-fLHQEf93.js} +1 -1
- package/dist/client/assets/{seo-editor-B8a-ygHx.js → seo-editor-BSBriMlp.js} +1 -1
- package/dist/client/assets/{separator-BvEs4sKx.js → separator-W-jiHDRf.js} +1 -1
- package/dist/client/assets/settings-tab-DtZ2USkZ.js +1 -0
- package/dist/client/assets/{sheet-Cn6zqTHK.js → sheet-CJ8R5cz8.js} +1 -1
- package/dist/client/assets/{shell-layout-CMWsc7Ga.js → shell-layout-DHcyl3tS.js} +1 -1
- package/dist/client/assets/{site-draft-actions-Dqjp6JXE.js → site-draft-actions-DvTjz5UN.js} +1 -1
- package/dist/client/assets/{site-draft-view-DMbuCO3k.js → site-draft-view-DKi9gDFG.js} +1 -1
- package/dist/client/assets/site-editor-C1i1Yk8D.js +1 -0
- package/dist/client/assets/{site-editor-toast-BTadFdcN.js → site-editor-toast-DCLSfuYN.js} +1 -1
- package/dist/client/assets/{skills-BO2UAT-k.js → skills-61y8fOuN.js} +1 -1
- package/dist/client/assets/{slider-C8eFjzSI.js → slider-DGrjjZbc.js} +1 -1
- package/dist/client/assets/{sortable.esm-C-oiWjvx.js → sortable.esm-CFU3AjR2.js} +1 -1
- package/dist/client/assets/{sso-CajDON15.js → sso-Bc4JROTr.js} +1 -1
- package/dist/client/assets/{suggestion-SovccGL1.js → suggestion-C25G9PiT.js} +1 -1
- package/dist/client/assets/{super-agent-icon-BPwu34XK.js → super-agent-icon-BOjAbgwW.js} +1 -1
- package/dist/client/assets/{switch-CaR5PIVi.js → switch-C6GSkMRa.js} +1 -1
- package/dist/client/assets/{synced-repos-DVx1NnZs.js → synced-repos-MVTThVIT.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BWlOwicm.js → tab-icon-glyph-X8r_SUyr.js} +1 -1
- package/dist/client/assets/{table-GheKU3yj.js → table-CGK_amHI.js} +1 -1
- package/dist/client/assets/{tabs-1aecnZxz.js → tabs-DSwAq5ok.js} +1 -1
- package/dist/client/assets/{task-board-DYqWLLmQ.js → task-board-DGEnY-WP.js} +1 -1
- package/dist/client/assets/{task-route-lZI9xEQu.js → task-route-kuDxMB7g.js} +1 -1
- package/dist/client/assets/{task-status-sKuwZfC5.js → task-status-DwyseT36.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CC44Sfeb.js → taskboard-analytics-Bc5gvPec.js} +1 -1
- package/dist/client/assets/{tasks-QuF-w60s.js → tasks-CwTnwmgS.js} +1 -1
- package/dist/client/assets/tasks-DmaKkQjL.js +1 -0
- package/dist/client/assets/{textarea-BC5J6m5c.js → textarea-bQEpPrrj.js} +1 -1
- package/dist/client/assets/{thread-analytics--cpXNe0v.js → thread-analytics-DrA1-9Im.js} +1 -1
- package/dist/client/assets/{thread-intent-DWdkWFbM.js → thread-intent-SBN04Rtw.js} +1 -1
- package/dist/client/assets/{thread-route-TkYSs_wZ.js → thread-route-D0a5VvFp.js} +1 -1
- package/dist/client/assets/{thread-route-zZ-NhxUn.js → thread-route-hd8uqVKt.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BYVjGhFL.js → thread-sheet-body-DldXKcG5.js} +1 -1
- package/dist/client/assets/{time-range-picker-DMCZWDg9.js → time-range-picker-DkQtJ9_-.js} +1 -1
- package/dist/client/assets/{toggle-group-BGTfs-aX.js → toggle-group-D7egmHqH.js} +1 -1
- package/dist/client/assets/{tool-namespace-D1tEk-rn.js → tool-namespace-DqMAELKh.js} +1 -1
- package/dist/client/assets/{tool-set-selector-E3d0uIwk.js → tool-set-selector-CRdnTdII.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-utT3ySvv.js → toolbar-icon-button-Cf4mp3st.js} +1 -1
- package/dist/client/assets/{tooltip-TH6OTMa1.js → tooltip-7WjUlVHN.js} +1 -1
- package/dist/client/assets/{tooltipContext-DvIDN2Xh.js → tooltipContext-BM-E9VBq.js} +1 -1
- package/dist/client/assets/{track-BgU3Gaat.js → track-Dc3qAx4h.js} +1 -1
- package/dist/client/assets/{types-CUaVQ6GM.js → types-DcXrDLzi.js} +1 -1
- package/dist/client/assets/{url-slug-U3fC_LSu.js → url-slug-DGizFeaX.js} +1 -1
- package/dist/client/assets/{usage-stats-BgRx8ojv.js → usage-stats-DyA2nNO3.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BQ4cXHYk.js → use-ai-providers-C9vcyTaN.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-BkzR-L_k.js → use-apply-named-rule-2JoZ8nxT.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-BtGzAvHO.js +1 -0
- package/dist/client/assets/{use-automations-D73FKpK0.js → use-automations-BHeTrxpI.js} +1 -1
- package/dist/client/assets/{use-autosave-DnSqypPy.js → use-autosave-BZAqhdxE.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-Byep-1Pa.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-DhWMeYGY.js → use-chat-layout-state-mgFqTgen.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-DYW-ZBMI.js → use-cms-publish-actions-JTIsBKu7.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DSAJf4aL.js → use-connect-companion-DOyeAK5f.js} +1 -1
- package/dist/client/assets/{use-connection-Cm2NxfjB.js → use-connection-C4wZIedX.js} +1 -1
- package/dist/client/assets/{use-content-sync-BYfkK2UQ.js → use-content-sync-DX9AICcw.js} +1 -1
- package/dist/client/assets/{use-copy-D19rl06v.js → use-copy-C87hppcx.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DRwJQrtP.js → use-date-fns-locale-CdwoumPu.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-ByXvCGtw.js → use-debounced-autosave-BGT68o5u.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CbRaNTJb.js → use-debounced-value-CPkVN80B.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BzZax3AU.js → use-deco-credits-B_yRwpIs.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DjBmVlF5.js → use-decopilot-events-DYaMckqi.js} +1 -1
- package/dist/client/assets/{use-delete-block-Bmw2DEn_.js → use-delete-block-Bl87-vdk.js} +1 -1
- package/dist/client/assets/{use-delete-connection-XfH3saNO.js → use-delete-connection-DfHAqmGL.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-E8whHqZV.js → use-deployment-admin-C8Pxnc-A.js} +1 -1
- package/dist/client/assets/{use-entitlements-CrqU38x1.js → use-entitlements-B129mOCR.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-Br8m5G_K.js → use-fast-preview-draft-url-C1985-Ir.js} +1 -1
- package/dist/client/assets/{use-file-configs-Cb7TGwCU.js → use-file-configs-Dee9WDV4.js} +1 -1
- package/dist/client/assets/{use-id-selection-BKmrVwI0.js → use-id-selection-HxPtQK4g.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-pHAZt3_K.js → use-inbox-feed-CE46iYvK.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BkFOSUvv.js → use-infinite-scroll-CRqa_9m8.js} +1 -1
- package/dist/client/assets/{use-join-requests-CJn0V1s3.js → use-join-requests-CIJW_zlt.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-BmFZ-_OL.js → use-main-panel-tabs-qfCNgDSO.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-4GKPMGKk.js → use-mcp-auth-status-CoQg2kYd.js} +1 -1
- package/dist/client/assets/{use-mcp-client-d3hjTGOk.js → use-mcp-client-b044lJnb.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-D9iX-pNG.js → use-mcp-prompts-Dlq8VH38.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-4sj0IJhc.js → use-mcp-tools-DS8wEzPs.js} +1 -1
- package/dist/client/assets/{use-mobile-BSwhKw5s.js → use-mobile-CEHdcOx8.js} +1 -1
- package/dist/client/assets/{use-move-blocks-DUZO8kls.js → use-move-blocks-BroyCilU.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-ClknH49I.js → use-navigate-to-agent-Kz2oOKmA.js} +1 -1
- package/dist/client/assets/{use-never-published-Ct02Nsux.js → use-never-published-CT51G1NV.js} +1 -1
- package/dist/client/assets/{use-org-fs-Tz3YgtJ1.js → use-org-fs-CLPhRw3y.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-BzT6K1ie.js → use-org-repo-syncs-BoVbI9tW.js} +1 -1
- package/dist/client/assets/{use-org-sso-DKQA9PvY.js → use-org-sso-DRrVlfwY.js} +1 -1
- package/dist/client/assets/{use-organization-settings-O_jt8YRI.js → use-organization-settings-CdJMCbcP.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-DFdZfmUA.js → use-project-native-view-presence-CL3n89is.js} +1 -1
- package/dist/client/assets/{use-project-scope-CDU7oHZd.js → use-project-scope-dsKJBAry.js} +1 -1
- package/dist/client/assets/{use-recent-apps-SulI7knF.js → use-recent-apps-CmtYzKJF.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-DvKdZxC0.js → use-reports-diagnostic-DFRAKqsS.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-f-PdmD_K.js → use-sandbox-events-9oqLSRsO.js} +1 -1
- package/dist/client/assets/{use-secrets-iJZc87R8.js → use-secrets-NEOz5brl.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DlVsTPHR.js → use-section-preview-base-dFGv18ks.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-BXzuI2Yh.js → use-sidebar-collapsed-BpkHLNx1.js} +1 -1
- package/dist/client/assets/{use-tags-szK0WGVw.js → use-tags-CWDFKR0B.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-Dsx3ztNk.js → use-task-board-analytics-YY743rvT.js} +1 -1
- package/dist/client/assets/{use-task-board-events-bOYbxitP.js → use-task-board-events-De0Ql0Pn.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-DXBDSC_j.js → use-task-board-item-prs-CjIgw8Jt.js} +1 -1
- package/dist/client/assets/{use-task-board-items-2NnjAMJe.js → use-task-board-items-DNUZNAh_.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-BnnaRxj0.js → use-task-board-prompts-B1rpgS5r.js} +1 -1
- package/dist/client/assets/{use-task-metadata-GAS3u4HU.js → use-task-metadata-BOYPl3PT.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-D6gtHOkS.js → use-thread-outputs-WMuzypnI.js} +1 -1
- package/dist/client/assets/{use-view-draft-kind-vGVmYJM5.js → use-view-draft-kind-BG2f-NWf.js} +1 -1
- package/dist/client/assets/{use-voice-input-B4K2dw_4.js → use-voice-input-Br5vij9C.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-o37Jr6S0.js +1 -0
- package/dist/client/assets/{useQueries-CkzTLDl3.js → useQueries-BN4ZsbwM.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BhOGXRBX.js +1 -0
- package/dist/client/assets/{users-BAENndTE.js → users-BGI0PgLT.js} +1 -1
- package/dist/client/assets/{utils-GS2Z_6Er.js → utils-B_l1jy6k.js} +1 -1
- package/dist/client/assets/{variant-calendar-DhSlXJST.js → variant-calendar-bWZKkiCF.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-DBCe5xDS.js → variant-matcher-override-CEpfOStd.js} +1 -1
- package/dist/client/assets/{view-header-BkLkYp5J.js → view-header-CX8g-yAR.js} +1 -1
- package/dist/client/assets/{virtual-mcp-D-X8xp1B.js → virtual-mcp-BFUo5OwK.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BhRvBapO.js → watch-sse-pool-CkVyQC5r.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-i42F64Tf.js +0 -1
- package/dist/client/assets/agent-deck-CJ6F_9XA.js +0 -1
- package/dist/client/assets/agent-experiments-JXbeMR67.js +0 -1
- package/dist/client/assets/agent-library-CgajOXjC.js +0 -1
- package/dist/client/assets/agent-library-file-ROPjoIiT.js +0 -1
- package/dist/client/assets/agent-overview-CRECfM0R.js +0 -1
- package/dist/client/assets/agent-settings-CQz4H--G.js +0 -1
- package/dist/client/assets/agent-site-editor-code-BmJC3uHD.js +0 -2
- package/dist/client/assets/agent-site-editor-content-COiXn4LP.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-DdkTHBKn.js +0 -1
- package/dist/client/assets/agent-view-DP-yHMET.js +0 -1
- package/dist/client/assets/api-keys-CA73zf8R.js +0 -1
- package/dist/client/assets/library-D0Nyw5vF.js +0 -1
- package/dist/client/assets/project-reports-yBeAoZj_.js +0 -1
- package/dist/client/assets/project-tasks-Da304fiF.js +0 -1
- package/dist/client/assets/reports-D1vOcKYh.js +0 -1
- package/dist/client/assets/repositories-BeyQS9t-.js +0 -1
- package/dist/client/assets/route-Dghp6bLe.js +0 -1
- package/dist/client/assets/settings-tab-V10cXQt_.js +0 -1
- package/dist/client/assets/site-editor-BhMaxdEz.js +0 -1
- package/dist/client/assets/tasks-ChIHxZhb.js +0 -1
- package/dist/client/assets/use-ask-in-chat-D9_rhHLE.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-DVyeNJpE.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DAPRIetj.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D1yN9E9_.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-
|
|
2
|
-
import{c as le,j as r,r as N,m as Fe,b as Ee,B as _e,aF as cs,bg as ut,aG as De,bh as fi,bi as pi,bj as mi,bk as hi,v as Tr,D as Cr,K as Ys,w as Rr,x as Lr,e as gi,h as tt,I as zs,y as vi,b4 as xi,a4 as fs,aZ as bi,b2 as Ar,bl as Qn,i as _r,ar as Us,at as Ks,a7 as Or,P as Hs,E as yi,t as ds,b3 as wi,q as ki}from"./index-BqA84bKQ.js";import{u as Qs,N as Si}from"./save-status-CaR8n7_Z.js";import{b as Pi,c as st,r as $r,l as Dr,f as ji,g as Ei,w as Ni}from"./chat-context-ChgzPsES.js";import{t as Ti}from"./ChevronUp-B9DaDvS3.js";import{T as Ci,U as Ri,K as Fr,V as Li,W as Ai,b as _i,X as Oi,Y as Br,Z as $i,_ as Mr,$ as Xn,a0 as Di}from"./agent-icon-7pgGOyab.js";import{a as Fi,n as Bi}from"./UserSquare-nHYvjai8.js";import{s as Ir}from"./Plus-Dxw22W7_.js";import{a as zr,b as Ur,P as Kr}from"./popover-fDNjdHxM.js";import{e as ft,b as pt,c as Hr,f as Vr,a as Wr,C as qr}from"./command-BBpufUKx.js";import{b as Mi,c as Ii,u as zi}from"./repository-binding-CekCSlJ1.js";import{a as xt}from"./sandbox-lifecycle-context-Ba3XN5SW.js";import{a as Ui,n as Ki,u as Hi,f as Zn,H as Vi,P as Wi}from"./frame-navigation-c9xPkylV.js";import{r as qi}from"./thread-intent-DWdkWFbM.js";import{u as Gr}from"./use-voice-input-B4K2dw_4.js";import{l as Gi,m as Ji,n as Yi,o as Qi,q as Xi,t as Zi,u as zt,j as ps,v as Jr,i as Xe,w as eo,x as Xs,y as Yr,k as Qr,z as to,A as so,B as Xr,C as no,c as Zr,b as ea,D as ro,h as He,E as ao,d as io,g as oo,F as lo,G as co,H as er,I as uo,J as tr,K as fo,L as po,M as sr,N as nr,O as rr,P as ar,Q as ir,R as As,S as mo,U as ho,V as go,W as vo,e as xo}from"./site-editor-toast-BTadFdcN.js";import{u as ta}from"./use-mobile-BSwhKw5s.js";import{T as ht,a as gt,c as vt}from"./tooltip-TH6OTMa1.js";import{T as Ze}from"./toolbar-icon-button-utT3ySvv.js";import{w as ns,i as bo}from"./variant-matcher-override-DBCe5xDS.js";import{s as It,n as Zs,a as sa,f as Ve,v as na,u as ra,h as yo,i as wo,B as ko,S as So,C as Po,b as jo,e as Eo,c as No,d as To,N as Co,g as Ro,r as Lo,j as Ao,k as or,p as _o}from"./blocks-tab-states-Dos-yNvu.js";import{a as Oo}from"./use-fast-preview-draft-url-Br8m5G_K.js";import{g as $o,c as lr,B as _s,P as Do,r as Fo,R as Bo,S as Mo,l as Io,m as zo,p as Uo}from"./parse-sections-D5t3BRqc.js";import{g as Ko}from"./section-array-field-BPHe_2nS.js";import{g as Ho,l as aa}from"./shell-layout-CMWsc7Ga.js";import{u as en,b as Vo}from"./use-sandbox-events-f-PdmD_K.js";import{d as Wo,S as Os}from"./empty-message-BxCQf5X6.js";import{u as Vs}from"./useQueries-CkzTLDl3.js";import{i as qo}from"./LinkBroken01-l43AWgbv.js";import{u as ia,b as oa}from"./use-never-published-Ct02Nsux.js";import{u as la}from"./blocks-preview-workspace-context-CLkDzb1Y.js";import{c as Go,H as Jo}from"./held-block-view-9GD7sW5O.js";import{MonacoCodeEditor as ca}from"./monaco-editor-BKbGnxf4.js";import{c as da,u as ua}from"./hosted-reconcile-j0Z_Am5O.js";import{d as fa}from"./utils-GS2Z_6Er.js";import{R as cr,a as rs,b as dr}from"./resizable-Czy-co3c.js";import{u as Yo}from"./use-blocks-v8-project-DVyeNJpE.js";import{s as Qo,L as Xo,R as pa,D as ur,w as Ws}from"./device-hint-D11AIkCQ.js";import{L as Zo}from"./label-Ducx0j9M.js";import{a as el,T as fr}from"./toggle-group-BGTfs-aX.js";import{i as tl,l as sl,D as nl}from"./named-rule-step-7q8hws5D.js";import{b as rl}from"./sandbox-url-D3mC8qhT.js";import{r as al,R as il}from"./virtual-mcp-D-X8xp1B.js";import{d as ol}from"./delay-CnY5UFtP.js";import{s as ma}from"./XClose-CBDYK_AJ.js";import{o as ll}from"./omit-server-managed-metadata-L5IhjRZB.js";import{a as $s,b as cl,w as dl,n as pr}from"./app-preview-url-9Od4s8Sz.js";import{a as ul}from"./use-organization-settings-O_jt8YRI.js";import{a as Ds}from"./agent-capabilities-BobB8G3S.js";import{E as fl}from"./empty-state-A6nZ3Khe.js";import{G as mr}from"./github-icon-D3u8oGuo.js";import{R as pl}from"./new-project-dialog-BOtGKQPA.js";import{r as ml}from"./preview-source-BsRLGWUP.js";import{A as hl,a as gl,b as vl}from"./alert-CwJgunZE.js";import{u as xl}from"./use-task-metadata-GAS3u4HU.js";function bl(t){const e=le.c(10),{waiting:s}=t,n=s?"true":"false";let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(Ci,{className:"size-5 sm:size-6"})}),e[0]=a):a=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=c):c=e[1];let d;e[2]!==s?(d=s&&r.jsx("span",{"data-testid":"connection-dot",className:"absolute top-0 size-2 animate-[connection-shuttle_1.8s_var(--ease-in-out-cubic)_infinite_alternate] rounded-full bg-foreground"}),e[2]=s,e[3]=d):d=e[3];let o;e[4]!==d?(o=r.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[c,d]}),e[4]=d,e[5]=o):o=e[5];let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(Ri,{className:"size-5 sm:size-6"})}),e[6]=i):i=e[6];let l;return e[7]!==n||e[8]!==o?(l=r.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":n,className:"flex items-center gap-2",children:[a,o,i]}),e[7]=n,e[8]=o,e[9]=l):l=e[9],l}function yl(t){const e=le.c(22),{index:s,numbered:n,step:a,heading:c}=t,d=N.useId();let o;e[0]!==s||e[1]!==n?(o=n&&r.jsx("span",{"aria-hidden":"true",className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium tabular-nums text-foreground",children:s}),e[0]=s,e[1]=n,e[2]=o):o=e[2];let i;e[3]!==c||e[4]!==d||e[5]!==a.title?(i=r.jsx(c,{id:d,className:"text-sm font-medium text-foreground",children:a.title}),e[3]=c,e[4]=d,e[5]=a.title,e[6]=i):i=e[6];let l;e[7]!==o||e[8]!==i?(l=r.jsxs("div",{className:"flex items-center gap-3",children:[o,i]}),e[7]=o,e[8]=i,e[9]=l):l=e[9];const m=n&&"sm:pl-9";let p;e[10]!==m?(p=Fe("flex min-w-0 flex-col gap-3",m),e[10]=m,e[11]=p):p=e[11];let f;e[12]!==a.body?(f=a.body&&r.jsx("p",{className:"text-sm text-muted-foreground",children:a.body}),e[12]=a.body,e[13]=f):f=e[13];let y;e[14]!==a.after||e[15]!==p||e[16]!==f?(y=r.jsxs("div",{className:p,children:[f,a.after]}),e[14]=a.after,e[15]=p,e[16]=f,e[17]=y):y=e[17];let x;return e[18]!==d||e[19]!==l||e[20]!==y?(x=r.jsxs("li",{"aria-labelledby":d,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[l,y]}),e[18]=d,e[19]=l,e[20]=y,e[21]=x):x=e[21],x}const wl=[];function us(t){const e=le.c(20),{title:s,lead:n,waiting:a,alerts:c,steps:d,footer:o,headingLevel:i}=t,l=d===void 0?wl:d,m=i===void 0?1:i,p=m===1?"h1":"h2",f=a&&l.length===0?"status":void 0;let y;e[0]!==a?(y=r.jsx(bl,{waiting:a}),e[0]=a,e[1]=y):y=e[1];let x;e[2]!==p||e[3]!==s?(x=r.jsx(p,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:s}),e[2]=p,e[3]=s,e[4]=x):x=e[4];let b;e[5]!==n?(b=n&&r.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:n}),e[5]=n,e[6]=b):b=e[6];let h;e[7]!==f||e[8]!==y||e[9]!==x||e[10]!==b?(h=r.jsxs("header",{role:f,className:"flex flex-col items-center gap-3 text-center",children:[y,x,b]}),e[7]=f,e[8]=y,e[9]=x,e[10]=b,e[11]=h):h=e[11];let g;e[12]!==m||e[13]!==l?(g=l.length>0&&r.jsx("ol",{className:"flex flex-col gap-3",children:l.map((v,w)=>r.jsx(yl,{index:w+1,numbered:l.length>1,step:v,heading:m===1?"h2":"h3"},v.title))}),e[12]=m,e[13]=l,e[14]=g):g=e[14];let R;return e[15]!==c||e[16]!==o||e[17]!==h||e[18]!==g?(R=r.jsx("div",{className:"h-full w-full overflow-y-auto",children:r.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-xl flex-col justify-center gap-6 px-4 py-8 sm:py-12",children:[h,c,g,o]})}),e[15]=c,e[16]=o,e[17]=h,e[18]=g,e[19]=R):R=e[19],R}function kl(t){const e=le.c(43),{wait:s,hosts:n,invalidLink:a}=t,c=a===void 0?!1:a,d=Ee();let o;e[0]!==c||e[1]!==d?(o=c&&r.jsx(hl,{variant:"warning",children:r.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[r.jsx(gl,{className:"line-clamp-none text-foreground",children:d("decoServe.link.invalidTitle")}),r.jsx(vl,{children:d("decoServe.link.invalidBody")})]})}),e[0]=c,e[1]=d,e[2]=o):o=e[2];const i=o;if(s.kind==="problem"){let w;e[3]!==d||e[4]!==s.host||e[5]!==s.problem?(w=Qo(d,s.problem,s.host),e[3]=d,e[4]=s.host,e[5]=s.problem,e[6]=w):w=e[6];const{title:C,body:k}=w;let S;e[7]!==k?(S=r.jsx(pa,{text:k}),e[7]=k,e[8]=S):S=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=r.jsx(ur,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=j):j=e[9];let T;return e[10]!==i||e[11]!==S||e[12]!==C?(T=r.jsx(us,{headingLevel:2,waiting:!1,title:C,lead:S,alerts:i,footer:j}),e[10]=i,e[11]=S,e[12]=C,e[13]=T):T=e[13],T}const l=s.kind==="looking",m=l&&!s.paused;let p;e[14]!==d?(p=d("decoServe.waiting.title"),e[14]=d,e[15]=p):p=e[15];let f;e[16]!==d?(f=d("decoServe.waiting.lead"),e[16]=d,e[17]=f):f=e[17];let y;e[18]!==i||e[19]!==s.kind?(y=(i||s.kind==="denied")&&r.jsxs(r.Fragment,{children:[i,s.kind==="denied"&&r.jsx(Xo,{})]}),e[18]=i,e[19]=s.kind,e[20]=y):y=e[20];let x;e[21]!==d?(x=d("decoServe.waiting.connect.title"),e[21]=d,e[22]=x):x=e[22];let b;e[23]!==d?(b=d("decoServe.waiting.connect.body"),e[23]=d,e[24]=b):b=e[24];let h;e[25]!==n||e[26]!==l||e[27]!==d||e[28]!==s.kind||e[29]!==s.onStart||e[30]!==s.paused?(h=s.kind==="needs-gesture"?r.jsx(_e,{variant:"outline",className:"self-start",onClick:s.onStart,children:d("decoServe.guide.start")}):l&&r.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:s.paused?d("decoServe.guide.paused"):d("decoServe.guide.looking",{hosts:n})}),e[25]=n,e[26]=l,e[27]=d,e[28]=s.kind,e[29]=s.onStart,e[30]=s.paused,e[31]=h):h=e[31];let g;e[32]!==x||e[33]!==b||e[34]!==h?(g=[{title:x,body:b,after:h}],e[32]=x,e[33]=b,e[34]=h,e[35]=g):g=e[35];let R;e[36]===Symbol.for("react.memo_cache_sentinel")?(R=r.jsx(ur,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[36]=R):R=e[36];let v;return e[37]!==g||e[38]!==m||e[39]!==p||e[40]!==f||e[41]!==y?(v=r.jsx(us,{headingLevel:2,waiting:m,title:p,lead:f,alerts:y,steps:g,footer:R}),e[37]=g,e[38]=m,e[39]=p,e[40]=f,e[41]=y,e[42]=v):v=e[42],v}function Sl(t,e){switch(t.kind){case"needs-permission":return{kind:"denied"};case"problem":return{kind:"problem",problem:t.problem,host:e};default:return{kind:"looking"}}}const Pl=15e3,jl=3e3;function El(t){const{candidates:e,probe:s,onFound:n,onChange:a,doc:c=document,setTimer:d=(w,C)=>setTimeout(w,C),clearTimer:o=w=>clearTimeout(w),timeoutMs:i=jl}=t;let l={status:"searching",firstRoundDone:!1,problem:null},m=!1,p=!1,f=0,y=null,x=null;const b=()=>c.visibilityState==="hidden",h=w=>{l={...l,...w},a(l)},g=async w=>{x=new AbortController;const C=x,k=d(()=>C.abort(),i);try{return await s(w,C.signal),!0}catch(S){if(m)return!1;const j=Ji(S);return j.reason!=="not-answering"?h({problem:{...j,endpoint:w}}):l.problem?.endpoint===w&&h({problem:null}),!1}finally{o(k),x=null}},R=async()=>{if(y=null,!(m||p)){if(e.length===0){h({status:"stopped",firstRoundDone:!0});return}if(b()){h({status:"paused"});return}p=!0,l.status!=="searching"&&h({status:"searching"});for(const w of e){if(m)break;if(await g(w)){if(p=!1,m)return;m=!0,c.removeEventListener("visibilitychange",v),h({status:"found",firstRoundDone:!0}),n(w);return}}if(p=!1,!m){if(f+=1,l.firstRoundDone||h({firstRoundDone:!0}),b()){h({status:"paused"});return}y=d(()=>{R()},Gi(f,Pl))}}};function v(){if(!m){if(b()){y!==null&&(o(y),y=null),p||h({status:"paused"});return}y!==null&&o(y),f=0,R()}}return c.addEventListener("visibilitychange",v),a(l),R(),()=>{m=!0,y!==null&&o(y),x?.abort(),c.removeEventListener("visibilitychange",v)}}function Nl(t,e){return Qi(t,e)}const Tl=["loopback-network","local-network-access"];async function Cl(){if(Yi(window.location.origin))return null;for(const t of Tl)try{return await navigator.permissions.query({name:t})}catch{}return null}let ha=null,hr=!1;const Fs=new Set;function Rl(t){if(Fs.add(t),!hr){hr=!0;const e=s=>{ha=s;for(const n of Fs)n()};Cl().then(s=>{if(!s)return e("unsupported");e(s.state),s.addEventListener("change",()=>e(s.state))})}return()=>Fs.delete(t)}const Ll={status:"stopped",firstRoundDone:!1,problem:null},Bs=new Map;function Al(t){const e=Bs.get(t);if(e)return e;let s={status:"searching",firstRoundDone:!1,problem:null};const n=new Set;let a=null;const c={onFound:()=>{},getSnapshot:()=>s,subscribe:d=>(n.add(d),a??=El({candidates:t.split(" "),probe:Nl,onFound:o=>c.onFound(o),onChange:o=>{s=o;for(const i of n)i()}}),()=>{n.delete(d),!(n.size>0)&&(a?.(),a=null,Bs.delete(t))})};return Bs.set(t,c),c}function ga(){return N.useSyncExternalStore(Rl,vr,vr)}const _l=()=>()=>{},gr=()=>Ll,vr=()=>ha;function Xu(t){const e=le.c(9),{candidates:s,onFound:n}=t,[a,c]=N.useState(!1),d=ga(),i=(d==="granted"||d==="unsupported"||d==="prompt"&&a)&&s.length>0;let l;e[0]!==i||e[1]!==s||e[2]!==n?(l=i?Al(s.join(" ")):null,l&&(l.onFound=n),e[0]=i,e[1]=s,e[2]=n,e[3]=l):l=e[3];const m=N.useSyncExternalStore(l?.subscribe??_l,l?.getSnapshot??gr,l?.getSnapshot??gr),p=d==="prompt"&&!a;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>c(!0),e[4]=f):f=e[4];let y;return e[5]!==d||e[6]!==m||e[7]!==p?(y={state:m,access:d,needsGesture:p,start:f},e[5]=d,e[6]=m,e[7]=p,e[8]=y):y=e[8],y}const xr={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Ol(t){const{previewState:e,progressStatus:s,fastPreviewActive:n=!1,fastPreviewReady:a=!1,codingSession:c=!1,hostedDraft:d=!1}=t,o=c?null:t.previewServerUrl;return t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?xr:d&&t.hostedPointerPending&&!a?{...xr,showDecidingLoader:!0}:n&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:n&&d&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!n&&e.kind==="iframe"&&s!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const $l=1500,Dl=500;function Fl({iframe:t,reload:e,waitMs:s=$l,confirmMs:n=Dl}){let a;const c=()=>{clearTimeout(d),a=setTimeout(e,n)};t.addEventListener("load",c,{once:!0});const d=setTimeout(()=>{t.removeEventListener("load",c),e()},s);return()=>{clearTimeout(d),clearTimeout(a),t.removeEventListener("load",c)}}const Bl=cs({tag:De(),id:De(),classes:De(),text:De(),html:De(),manifestKey:De().nullable(),componentName:De().nullable(),parents:De(),url:De(),path:De(),viewport:cs({width:ut(),height:ut()}),position:cs({x:ut(),y:ut()})}),Ml=`(function() {
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-3egytFfS.js","assets/index-DDDWDv4s.js","assets/index-DYPWHH-M.css","assets/chat-context-BVOzxL7y.js","assets/use-view-draft-kind-BG2f-NWf.js","assets/thread-route-D0a5VvFp.js","assets/use-project-scope-dsKJBAry.js","assets/repository-binding-DAYbvLYj.js","assets/use-mcp-client-b044lJnb.js","assets/auth-DiKlrdGP.js","assets/use-organization-settings-CdJMCbcP.js","assets/schema-B5L6XabR.js","assets/task-board-DGEnY-WP.js","assets/thread-intent-SBN04Rtw.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-CkVyQC5r.js","assets/use-entitlements-B129mOCR.js","assets/use-ai-providers-C9vcyTaN.js","assets/use-decopilot-events-DYaMckqi.js","assets/save-status-BvsiA7U3.js","assets/Tool01-AMJ0J7Ld.js","assets/Trash01-Chu35sQ_.js","assets/Upload01-CGdoFUP8.js","assets/use-never-published-CT51G1NV.js","assets/use-voice-input-Br5vij9C.js","assets/popover-B_j0y2h7.js","assets/drawer-OboTDl5r.js","assets/tooltip-7WjUlVHN.js","assets/index-DxWwCAMV.js","assets/use-mobile-CEHdcOx8.js","assets/agent-icon-DFd8L1O_.js","assets/AlertCircle-D1QqLKFH.js","assets/ArrowUp-BVEp2Brj.js","assets/ArrowLeft-B_zuPCk3.js","assets/LinkBroken01-ChDYryt0.js","assets/BookOpen01-DU_gf3Q9.js","assets/Globe04-BIxVPRI2.js","assets/CheckCircle-r_uvA104.js","assets/ChevronUp-fKdis79A.js","assets/ChevronSelectorVertical-Cnj6Mtq0.js","assets/UserSquare-DUXP0rwX.js","assets/CreditCard01-2UGmTwp0.js","assets/SwitchHorizontal01-D7pFOqnZ.js","assets/Key01-B-uaWiXd.js","assets/Minus-eMZySqLh.js","assets/Monitor01-CzcVShIo.js","assets/Sun-wrM9Jol_.js","assets/Play-DK3U1VA7.js","assets/Plus-BNdH4tYy.js","assets/SearchMd-DWnwnZQO.js","assets/ShoppingBag01-BrAbYbaG.js","assets/Users01-BnTqMUrr.js","assets/XClose-BAfH6Ebz.js","assets/Zap-YDxTdktJ.js","assets/index-D1w7KFj7.js","assets/checkbox-x2IxTucq.js","assets/select-CCUqWhU2.js","assets/index-BdQq_4o_.js","assets/ai-providers-logos-DD3qZ33J.js","assets/openai-compatible-presets-BKGfVqEx.js","assets/site-editor-toast-DCLSfuYN.js","assets/sandbox-url-D3mC8qhT.js","assets/use-sandbox-events-9oqLSRsO.js","assets/use-blocks-v8-project-Byep-1Pa.js","assets/utils-B_l1jy6k.js","assets/sandbox-git-api-DJ1Zj_fI.js","assets/hosted-reconcile-C2j-K6SC.js","assets/blocks-tab-states-Uq85dLE5.js","assets/empty-state-CxI5dssp.js","assets/search-input-CTHDb7Fb.js","assets/tabs-DSwAq5ok.js","assets/active-indicator-CCMhAsc_.js","assets/use-debounced-value-CPkVN80B.js","assets/use-file-configs-Dee9WDV4.js","assets/asset-utils-BSepCiAa.js","assets/useInfiniteQuery-o37Jr6S0.js","assets/infiniteQueryObserver-ktArfc_t.js","assets/usage-stats-DyA2nNO3.js","assets/tool-namespace-DqMAELKh.js","assets/form-CuAETLLt.js","assets/label-EESrxoYH.js","assets/utils-CVEq3hMx.js","assets/markdown-D5a0osui.js","assets/use-copy-C87hppcx.js","assets/switch-C6GSkMRa.js","assets/toggle-group-D7egmHqH.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/parse-sections-yZQqTgrz.js","assets/held-block-view-Clis5U4a.js","assets/calendar-RX4MUBCU.js","assets/textarea-bQEpPrrj.js","assets/editor-classes-De5o_8lB.js","assets/core.esm-DUcC46mO.js","assets/sortable.esm-CFU3AjR2.js","assets/empty-message-D92Pb6fP.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-Fhnk8ar3.js","assets/collapsible-CmQt_iZ0.js","assets/shell-layout-DHcyl3tS.js","assets/use-deployment-admin-C8Pxnc-A.js","assets/admin-fetch-BhTJlAsX.js","assets/command-C00hDMwB.js","assets/index-Ch7SvmMC.js","assets/integration-icon-D5RK2sEk.js","assets/project-icon-DNEfBFoN.js","assets/use-navigate-to-agent-Kz2oOKmA.js","assets/new-project-dialog-BiqAeUrE.js","assets/repository-picker-BO6sLOq7.js","assets/github-icon-D0vbU4b9.js","assets/collection-search-kFWWyWV8.js","assets/legacy-admin-welcome-dialog-DAEkCShw.js","assets/required-auth-layout-Dg5kgnfG.js","assets/use-org-sso-DRrVlfwY.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-BgUWGow9.js","assets/types-DcXrDLzi.js","assets/omit-server-managed-metadata-L5IhjRZB.js","assets/sheet-CJ8R5cz8.js","assets/use-connection-C4wZIedX.js","assets/use-mcp-prompts-Dlq8VH38.js","assets/use-thread-outputs-WMuzypnI.js","assets/file-type-icon-Dnh_2HcY.js","assets/section-array-field-B-W5rSAO.js","assets/named-rule-step-BTqgnNQ5.js","assets/slider-DGrjjZbc.js","assets/index-CBYIpf8n.js","assets/tooltipContext-BM-E9VBq.js","assets/CategoricalChart-DhUmp4Jo.js","assets/index-54RE0ioE.js","assets/combobox-B7xBLEqp.js","assets/scroll-area-BIbpYC_e.js","assets/monaco-editor-CwGsSUX8.js","assets/editor-ChiPsACh.js","assets/use-delete-block-Bl87-vdk.js","assets/use-section-preview-base-dFGv18ks.js","assets/mustache-BVD8gEp8.js","assets/seo-editor-BSBriMlp.js","assets/use-apply-named-rule-2JoZ8nxT.js","assets/use-move-blocks-BroyCilU.js","assets/variant-matcher-override-CEpfOStd.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as le,j as r,r as N,m as Fe,b as Ee,B as _e,aF as cs,bg as ut,aG as De,bh as fi,bi as pi,bj as mi,bk as hi,v as Tr,D as Cr,K as Ys,w as Rr,x as Lr,e as gi,h as tt,I as Is,y as vi,b4 as xi,a4 as fs,aZ as bi,b2 as Ar,bl as Qn,i as _r,ar as Us,at as Ks,a7 as Or,P as Hs,E as yi,t as ds,b3 as wi,q as ki}from"./index-DDDWDv4s.js";import{u as Qs,N as Si}from"./save-status-BvsiA7U3.js";import{b as Pi,c as st,r as $r,l as Dr,f as ji,g as Ei,w as Ni}from"./chat-context-BVOzxL7y.js";import{t as Ti}from"./ChevronUp-fKdis79A.js";import{T as Ci,U as Ri,K as Fr,V as Li,W as Ai,b as _i,X as Oi,Y as Br,Z as $i,_ as Mr,$ as Xn,a0 as Di}from"./agent-icon-DFd8L1O_.js";import{a as Fi,n as Bi}from"./UserSquare-DUXP0rwX.js";import{s as zr}from"./Plus-BNdH4tYy.js";import{a as Ir,b as Ur,P as Kr}from"./popover-B_j0y2h7.js";import{e as ft,b as pt,c as Hr,f as Vr,a as Wr,C as qr}from"./command-C00hDMwB.js";import{b as Mi,c as zi,u as Ii}from"./repository-binding-DAYbvLYj.js";import{a as xt}from"./sandbox-lifecycle-context-DAW3x9U4.js";import{a as Ui,n as Ki,u as Hi,f as Zn,H as Vi,P as Wi}from"./frame-navigation-D2IzuXnb.js";import{r as qi}from"./thread-intent-SBN04Rtw.js";import{u as Gr}from"./use-voice-input-Br5vij9C.js";import{l as Gi,m as Ji,n as Yi,o as Qi,q as Xi,t as Zi,u as It,j as ps,v as Jr,i as Xe,w as eo,x as Xs,y as Yr,k as Qr,z as to,A as so,B as Xr,C as no,c as Zr,b as ea,D as ro,h as He,E as ao,d as io,g as oo,F as lo,G as co,H as er,I as uo,J as tr,K as fo,L as po,M as sr,N as nr,O as rr,P as ar,Q as ir,R as As,S as mo,U as ho,V as go,W as vo,e as xo}from"./site-editor-toast-DCLSfuYN.js";import{u as ta}from"./use-mobile-CEHdcOx8.js";import{T as ht,a as gt,c as vt}from"./tooltip-7WjUlVHN.js";import{T as Ze}from"./toolbar-icon-button-Cf4mp3st.js";import{w as ns,i as bo}from"./variant-matcher-override-CEpfOStd.js";import{s as zt,n as Zs,a as sa,f as Ve,v as na,u as ra,h as yo,i as wo,B as ko,S as So,C as Po,b as jo,e as Eo,c as No,d as To,N as Co,g as Ro,r as Lo,j as Ao,k as or,p as _o}from"./blocks-tab-states-Uq85dLE5.js";import{a as Oo}from"./use-fast-preview-draft-url-C1985-Ir.js";import{g as $o,c as lr,B as _s,P as Do,r as Fo,R as Bo,S as Mo,l as zo,m as Io,p as Uo}from"./parse-sections-yZQqTgrz.js";import{g as Ko}from"./section-array-field-B-W5rSAO.js";import{g as Ho,l as aa}from"./shell-layout-DHcyl3tS.js";import{u as en,b as Vo}from"./use-sandbox-events-9oqLSRsO.js";import{d as Wo,S as Os}from"./empty-message-D92Pb6fP.js";import{u as Vs}from"./useQueries-BN4ZsbwM.js";import{i as qo}from"./LinkBroken01-ChDYryt0.js";import{u as ia,b as oa}from"./use-never-published-CT51G1NV.js";import{u as la}from"./blocks-preview-workspace-context-CzI6HAkj.js";import{c as Go,H as Jo}from"./held-block-view-Clis5U4a.js";import{MonacoCodeEditor as ca}from"./monaco-editor-CwGsSUX8.js";import{c as da,u as ua}from"./hosted-reconcile-C2j-K6SC.js";import{d as fa}from"./utils-B_l1jy6k.js";import{R as cr,a as rs,b as dr}from"./resizable-CaTV7JDr.js";import{u as Yo}from"./use-blocks-v8-project-Byep-1Pa.js";import{s as Qo,L as Xo,R as pa,D as ur,w as Ws}from"./device-hint-CmMhxStN.js";import{L as Zo}from"./label-EESrxoYH.js";import{a as el,T as fr}from"./toggle-group-D7egmHqH.js";import{i as tl,l as sl,D as nl}from"./named-rule-step-BTqgnNQ5.js";import{b as rl}from"./sandbox-url-D3mC8qhT.js";import{r as al,R as il}from"./virtual-mcp-BFUo5OwK.js";import{d as ol}from"./delay-CnY5UFtP.js";import{s as ma}from"./XClose-BAfH6Ebz.js";import{o as ll}from"./omit-server-managed-metadata-L5IhjRZB.js";import{a as $s,b as cl,w as dl,n as pr}from"./app-preview-url-9Od4s8Sz.js";import{a as ul}from"./use-organization-settings-CdJMCbcP.js";import{a as Ds}from"./agent-capabilities-DSfvUGIA.js";import{E as fl}from"./empty-state-CxI5dssp.js";import{G as mr}from"./github-icon-D0vbU4b9.js";import{R as pl}from"./new-project-dialog-BiqAeUrE.js";import{r as ml}from"./preview-source-BsRLGWUP.js";import{A as hl,a as gl,b as vl}from"./alert-BA8nDu40.js";import{u as xl}from"./use-task-metadata-BOYPl3PT.js";function bl(t){const e=le.c(10),{waiting:s}=t,n=s?"true":"false";let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(Ci,{className:"size-5 sm:size-6"})}),e[0]=a):a=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=c):c=e[1];let d;e[2]!==s?(d=s&&r.jsx("span",{"data-testid":"connection-dot",className:"absolute top-0 size-2 animate-[connection-shuttle_1.8s_var(--ease-in-out-cubic)_infinite_alternate] rounded-full bg-foreground"}),e[2]=s,e[3]=d):d=e[3];let o;e[4]!==d?(o=r.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[c,d]}),e[4]=d,e[5]=o):o=e[5];let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(Ri,{className:"size-5 sm:size-6"})}),e[6]=i):i=e[6];let l;return e[7]!==n||e[8]!==o?(l=r.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":n,className:"flex items-center gap-2",children:[a,o,i]}),e[7]=n,e[8]=o,e[9]=l):l=e[9],l}function yl(t){const e=le.c(22),{index:s,numbered:n,step:a,heading:c}=t,d=N.useId();let o;e[0]!==s||e[1]!==n?(o=n&&r.jsx("span",{"aria-hidden":"true",className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium tabular-nums text-foreground",children:s}),e[0]=s,e[1]=n,e[2]=o):o=e[2];let i;e[3]!==c||e[4]!==d||e[5]!==a.title?(i=r.jsx(c,{id:d,className:"text-sm font-medium text-foreground",children:a.title}),e[3]=c,e[4]=d,e[5]=a.title,e[6]=i):i=e[6];let l;e[7]!==o||e[8]!==i?(l=r.jsxs("div",{className:"flex items-center gap-3",children:[o,i]}),e[7]=o,e[8]=i,e[9]=l):l=e[9];const m=n&&"sm:pl-9";let p;e[10]!==m?(p=Fe("flex min-w-0 flex-col gap-3",m),e[10]=m,e[11]=p):p=e[11];let f;e[12]!==a.body?(f=a.body&&r.jsx("p",{className:"text-sm text-muted-foreground",children:a.body}),e[12]=a.body,e[13]=f):f=e[13];let y;e[14]!==a.after||e[15]!==p||e[16]!==f?(y=r.jsxs("div",{className:p,children:[f,a.after]}),e[14]=a.after,e[15]=p,e[16]=f,e[17]=y):y=e[17];let x;return e[18]!==d||e[19]!==l||e[20]!==y?(x=r.jsxs("li",{"aria-labelledby":d,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[l,y]}),e[18]=d,e[19]=l,e[20]=y,e[21]=x):x=e[21],x}const wl=[];function us(t){const e=le.c(20),{title:s,lead:n,waiting:a,alerts:c,steps:d,footer:o,headingLevel:i}=t,l=d===void 0?wl:d,m=i===void 0?1:i,p=m===1?"h1":"h2",f=a&&l.length===0?"status":void 0;let y;e[0]!==a?(y=r.jsx(bl,{waiting:a}),e[0]=a,e[1]=y):y=e[1];let x;e[2]!==p||e[3]!==s?(x=r.jsx(p,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:s}),e[2]=p,e[3]=s,e[4]=x):x=e[4];let b;e[5]!==n?(b=n&&r.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:n}),e[5]=n,e[6]=b):b=e[6];let h;e[7]!==f||e[8]!==y||e[9]!==x||e[10]!==b?(h=r.jsxs("header",{role:f,className:"flex flex-col items-center gap-3 text-center",children:[y,x,b]}),e[7]=f,e[8]=y,e[9]=x,e[10]=b,e[11]=h):h=e[11];let g;e[12]!==m||e[13]!==l?(g=l.length>0&&r.jsx("ol",{className:"flex flex-col gap-3",children:l.map((v,w)=>r.jsx(yl,{index:w+1,numbered:l.length>1,step:v,heading:m===1?"h2":"h3"},v.title))}),e[12]=m,e[13]=l,e[14]=g):g=e[14];let R;return e[15]!==c||e[16]!==o||e[17]!==h||e[18]!==g?(R=r.jsx("div",{className:"h-full w-full overflow-y-auto",children:r.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-xl flex-col justify-center gap-6 px-4 py-8 sm:py-12",children:[h,c,g,o]})}),e[15]=c,e[16]=o,e[17]=h,e[18]=g,e[19]=R):R=e[19],R}function kl(t){const e=le.c(43),{wait:s,hosts:n,invalidLink:a}=t,c=a===void 0?!1:a,d=Ee();let o;e[0]!==c||e[1]!==d?(o=c&&r.jsx(hl,{variant:"warning",children:r.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[r.jsx(gl,{className:"line-clamp-none text-foreground",children:d("decoServe.link.invalidTitle")}),r.jsx(vl,{children:d("decoServe.link.invalidBody")})]})}),e[0]=c,e[1]=d,e[2]=o):o=e[2];const i=o;if(s.kind==="problem"){let w;e[3]!==d||e[4]!==s.host||e[5]!==s.problem?(w=Qo(d,s.problem,s.host),e[3]=d,e[4]=s.host,e[5]=s.problem,e[6]=w):w=e[6];const{title:C,body:k}=w;let S;e[7]!==k?(S=r.jsx(pa,{text:k}),e[7]=k,e[8]=S):S=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=r.jsx(ur,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=j):j=e[9];let T;return e[10]!==i||e[11]!==S||e[12]!==C?(T=r.jsx(us,{headingLevel:2,waiting:!1,title:C,lead:S,alerts:i,footer:j}),e[10]=i,e[11]=S,e[12]=C,e[13]=T):T=e[13],T}const l=s.kind==="looking",m=l&&!s.paused;let p;e[14]!==d?(p=d("decoServe.waiting.title"),e[14]=d,e[15]=p):p=e[15];let f;e[16]!==d?(f=d("decoServe.waiting.lead"),e[16]=d,e[17]=f):f=e[17];let y;e[18]!==i||e[19]!==s.kind?(y=(i||s.kind==="denied")&&r.jsxs(r.Fragment,{children:[i,s.kind==="denied"&&r.jsx(Xo,{})]}),e[18]=i,e[19]=s.kind,e[20]=y):y=e[20];let x;e[21]!==d?(x=d("decoServe.waiting.connect.title"),e[21]=d,e[22]=x):x=e[22];let b;e[23]!==d?(b=d("decoServe.waiting.connect.body"),e[23]=d,e[24]=b):b=e[24];let h;e[25]!==n||e[26]!==l||e[27]!==d||e[28]!==s.kind||e[29]!==s.onStart||e[30]!==s.paused?(h=s.kind==="needs-gesture"?r.jsx(_e,{variant:"outline",className:"self-start",onClick:s.onStart,children:d("decoServe.guide.start")}):l&&r.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:s.paused?d("decoServe.guide.paused"):d("decoServe.guide.looking",{hosts:n})}),e[25]=n,e[26]=l,e[27]=d,e[28]=s.kind,e[29]=s.onStart,e[30]=s.paused,e[31]=h):h=e[31];let g;e[32]!==x||e[33]!==b||e[34]!==h?(g=[{title:x,body:b,after:h}],e[32]=x,e[33]=b,e[34]=h,e[35]=g):g=e[35];let R;e[36]===Symbol.for("react.memo_cache_sentinel")?(R=r.jsx(ur,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[36]=R):R=e[36];let v;return e[37]!==g||e[38]!==m||e[39]!==p||e[40]!==f||e[41]!==y?(v=r.jsx(us,{headingLevel:2,waiting:m,title:p,lead:f,alerts:y,steps:g,footer:R}),e[37]=g,e[38]=m,e[39]=p,e[40]=f,e[41]=y,e[42]=v):v=e[42],v}function Sl(t,e){switch(t.kind){case"needs-permission":return{kind:"denied"};case"problem":return{kind:"problem",problem:t.problem,host:e};default:return{kind:"looking"}}}const Pl=15e3,jl=3e3;function El(t){const{candidates:e,probe:s,onFound:n,onChange:a,doc:c=document,setTimer:d=(w,C)=>setTimeout(w,C),clearTimer:o=w=>clearTimeout(w),timeoutMs:i=jl}=t;let l={status:"searching",firstRoundDone:!1,problem:null},m=!1,p=!1,f=0,y=null,x=null;const b=()=>c.visibilityState==="hidden",h=w=>{l={...l,...w},a(l)},g=async w=>{x=new AbortController;const C=x,k=d(()=>C.abort(),i);try{return await s(w,C.signal),!0}catch(S){if(m)return!1;const j=Ji(S);return j.reason!=="not-answering"?h({problem:{...j,endpoint:w}}):l.problem?.endpoint===w&&h({problem:null}),!1}finally{o(k),x=null}},R=async()=>{if(y=null,!(m||p)){if(e.length===0){h({status:"stopped",firstRoundDone:!0});return}if(b()){h({status:"paused"});return}p=!0,l.status!=="searching"&&h({status:"searching"});for(const w of e){if(m)break;if(await g(w)){if(p=!1,m)return;m=!0,c.removeEventListener("visibilitychange",v),h({status:"found",firstRoundDone:!0}),n(w);return}}if(p=!1,!m){if(f+=1,l.firstRoundDone||h({firstRoundDone:!0}),b()){h({status:"paused"});return}y=d(()=>{R()},Gi(f,Pl))}}};function v(){if(!m){if(b()){y!==null&&(o(y),y=null),p||h({status:"paused"});return}y!==null&&o(y),f=0,R()}}return c.addEventListener("visibilitychange",v),a(l),R(),()=>{m=!0,y!==null&&o(y),x?.abort(),c.removeEventListener("visibilitychange",v)}}function Nl(t,e){return Qi(t,e)}const Tl=["loopback-network","local-network-access"];async function Cl(){if(Yi(window.location.origin))return null;for(const t of Tl)try{return await navigator.permissions.query({name:t})}catch{}return null}let ha=null,hr=!1;const Fs=new Set;function Rl(t){if(Fs.add(t),!hr){hr=!0;const e=s=>{ha=s;for(const n of Fs)n()};Cl().then(s=>{if(!s)return e("unsupported");e(s.state),s.addEventListener("change",()=>e(s.state))})}return()=>Fs.delete(t)}const Ll={status:"stopped",firstRoundDone:!1,problem:null},Bs=new Map;function Al(t){const e=Bs.get(t);if(e)return e;let s={status:"searching",firstRoundDone:!1,problem:null};const n=new Set;let a=null;const c={onFound:()=>{},getSnapshot:()=>s,subscribe:d=>(n.add(d),a??=El({candidates:t.split(" "),probe:Nl,onFound:o=>c.onFound(o),onChange:o=>{s=o;for(const i of n)i()}}),()=>{n.delete(d),!(n.size>0)&&(a?.(),a=null,Bs.delete(t))})};return Bs.set(t,c),c}function ga(){return N.useSyncExternalStore(Rl,vr,vr)}const _l=()=>()=>{},gr=()=>Ll,vr=()=>ha;function Xu(t){const e=le.c(9),{candidates:s,onFound:n}=t,[a,c]=N.useState(!1),d=ga(),i=(d==="granted"||d==="unsupported"||d==="prompt"&&a)&&s.length>0;let l;e[0]!==i||e[1]!==s||e[2]!==n?(l=i?Al(s.join(" ")):null,l&&(l.onFound=n),e[0]=i,e[1]=s,e[2]=n,e[3]=l):l=e[3];const m=N.useSyncExternalStore(l?.subscribe??_l,l?.getSnapshot??gr,l?.getSnapshot??gr),p=d==="prompt"&&!a;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>c(!0),e[4]=f):f=e[4];let y;return e[5]!==d||e[6]!==m||e[7]!==p?(y={state:m,access:d,needsGesture:p,start:f},e[5]=d,e[6]=m,e[7]=p,e[8]=y):y=e[8],y}const xr={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Ol(t){const{previewState:e,progressStatus:s,fastPreviewActive:n=!1,fastPreviewReady:a=!1,codingSession:c=!1,hostedDraft:d=!1}=t,o=c?null:t.previewServerUrl;return t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?xr:d&&t.hostedPointerPending&&!a?{...xr,showDecidingLoader:!0}:n&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:n&&d&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!n&&e.kind==="iframe"&&s!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const $l=1500,Dl=500;function Fl({iframe:t,reload:e,waitMs:s=$l,confirmMs:n=Dl}){let a;const c=()=>{clearTimeout(d),a=setTimeout(e,n)};t.addEventListener("load",c,{once:!0});const d=setTimeout(()=>{t.removeEventListener("load",c),e()},s);return()=>{clearTimeout(d),clearTimeout(a),t.removeEventListener("load",c)}}const Bl=cs({tag:De(),id:De(),classes:De(),text:De(),html:De(),manifestKey:De().nullable(),componentName:De().nullable(),parents:De(),url:De(),path:De(),viewport:cs({width:ut(),height:ut()}),position:cs({x:ut(),y:ut()})}),Ml=`(function() {
|
|
3
3
|
if (window.__visualEditorActive) return;
|
|
4
4
|
window.__visualEditorActive = true;
|
|
5
5
|
|
|
@@ -28,11 +28,15 @@ import{c as le,j as r,r as N,m as Fe,b as Ee,B as _e,aF as cs,bg as ut,aG as De,
|
|
|
28
28
|
if (el === lastTarget) return;
|
|
29
29
|
lastTarget = el;
|
|
30
30
|
var r = el.getBoundingClientRect();
|
|
31
|
+
// A CSS zoom on <body> scales the overlay's lengths again; the rect is already zoomed.
|
|
32
|
+
var z = document.body.currentCSSZoom || 1;
|
|
33
|
+
var top = r.top / z;
|
|
34
|
+
var left = r.left / z;
|
|
31
35
|
highlight.style.display = "block";
|
|
32
|
-
highlight.style.top =
|
|
33
|
-
highlight.style.left =
|
|
34
|
-
highlight.style.width = r.width + "px";
|
|
35
|
-
highlight.style.height = r.height + "px";
|
|
36
|
+
highlight.style.top = top + "px";
|
|
37
|
+
highlight.style.left = left + "px";
|
|
38
|
+
highlight.style.width = r.width / z + "px";
|
|
39
|
+
highlight.style.height = r.height / z + "px";
|
|
36
40
|
var tag = el.tagName.toLowerCase();
|
|
37
41
|
var id = el.id ? "#" + el.id : "";
|
|
38
42
|
var cls = el.className && typeof el.className === "string"
|
|
@@ -40,8 +44,8 @@ import{c as le,j as r,r as N,m as Fe,b as Ee,B as _e,aF as cs,bg as ut,aG as De,
|
|
|
40
44
|
: "";
|
|
41
45
|
badge.textContent = tag + id + cls;
|
|
42
46
|
badge.style.display = "block";
|
|
43
|
-
badge.style.top = Math.max(0,
|
|
44
|
-
badge.style.left =
|
|
47
|
+
badge.style.top = Math.max(0, top - 20) + "px";
|
|
48
|
+
badge.style.left = left + "px";
|
|
45
49
|
});
|
|
46
50
|
};
|
|
47
51
|
document.addEventListener("mousemove", moveHandler, true);
|
|
@@ -130,7 +134,7 @@ import{c as le,j as r,r as N,m as Fe,b as Ee,B as _e,aF as cs,bg as ut,aG as De,
|
|
|
130
134
|
window.__visualEditorActive = false;
|
|
131
135
|
}
|
|
132
136
|
});
|
|
133
|
-
})();`;function
|
|
137
|
+
})();`;function zl(t,e){const s=t.map(()=>null),n=[];for(let b=0;b<t.length;b++)t[b]!==null&&n.push(b);const a=n.length,c=e.length;if(!a||!c)return s;const d=(b,h)=>{const g=t[n[b]??0];return!g||!g.length?1:g.indexOf(e[h]??"")>=0?2:0},o=[],i=[];for(let b=0;b<=a;b++)o.push(new Array(c+1).fill(0)),i.push(new Array(c+1).fill(2));for(let b=1;b<=a;b++){const h=o[b-1]??[],g=o[b]??[],R=i[b]??[];for(let v=1;v<=c;v++){let w=h[v]??0,C=2;const k=g[v-1]??0;k>w&&(w=k,C=0);const S=d(b-1,v-1),j=(h[v-1]??0)+S;S>0&&j>w&&(w=j,C=1),g[v]=w,R[v]=C}}let l=0,m=a,p=c;for(;m>0&&p>0;){const b=i[m]?.[p]??2;b===1?(s[n[m-1]??0]=p-1,l++,m--,p--):b===0?p--:m--}const f=new Array(c).fill(!1);for(const b of n){const h=s[b];h!=null&&(f[h]=!0)}const y=(b,h)=>{const g=t[b];return!!g&&g.length>0&&g.indexOf(e[h]??"")>=0},x=(b,h)=>{for(const g of n){const R=s[g];if(!(R==null||e[R]!==e[h])&&g<b!=R<h)return!1}return!0};for(const b of n)if(s[b]===null){for(let h=0;h<c;h++)if(!f[h]&&y(b,h)&&x(b,h)){s[b]=h,f[h]=!0,l++;break}}if(l===0&&c===a)for(let b=0;b<a;b++)s[n[b]??0]=b;return s}const Il=cs({sectionIndex:ut(),manifestKey:De(),clickSeq:ut()}),Ul=`(function() {
|
|
134
138
|
if (window.__cmsEditorActive) return;
|
|
135
139
|
window.__cmsEditorActive = true;
|
|
136
140
|
|
|
@@ -200,7 +204,7 @@ import{c as le,j as r,r as N,m as Fe,b as Ee,B as _e,aF as cs,bg as ut,aG as De,
|
|
|
200
204
|
var sectionCandidates = [];
|
|
201
205
|
|
|
202
206
|
// Stringified from section-alignment.ts so both sides share one copy.
|
|
203
|
-
var alignSections = ${
|
|
207
|
+
var alignSections = ${zl.toString()};
|
|
204
208
|
|
|
205
209
|
// Indexed like the decofile array; unmapped entries stay null (not clickable).
|
|
206
210
|
var computeAlignment = function(tops) {
|
|
@@ -295,13 +299,15 @@ import{c as le,j as r,r as N,m as Fe,b as Ee,B as _e,aF as cs,bg as ut,aG as De,
|
|
|
295
299
|
// natively — no per-frame JS repositioning, no scroll lag.
|
|
296
300
|
var positionHighlight = function(section) {
|
|
297
301
|
var r = section.getBoundingClientRect();
|
|
298
|
-
|
|
299
|
-
var
|
|
302
|
+
// A CSS zoom on <body> scales the overlay's lengths again; the rect is already zoomed.
|
|
303
|
+
var z = document.body.currentCSSZoom || 1;
|
|
304
|
+
var top = (r.top + window.scrollY) / z;
|
|
305
|
+
var left = (r.left + window.scrollX) / z;
|
|
300
306
|
highlight.style.display = "block";
|
|
301
307
|
highlight.style.top = top + "px";
|
|
302
308
|
highlight.style.left = left + "px";
|
|
303
|
-
highlight.style.width = r.width + "px";
|
|
304
|
-
highlight.style.height = r.height + "px";
|
|
309
|
+
highlight.style.width = r.width / z + "px";
|
|
310
|
+
highlight.style.height = r.height / z + "px";
|
|
305
311
|
badge.textContent = lastLabel || displayKey(section);
|
|
306
312
|
badge.style.display = "block";
|
|
307
313
|
badge.style.top = Math.max(0, top - 20) + "px";
|
|
@@ -548,4 +554,4 @@ import{c as le,j as r,r as N,m as Fe,b as Ee,B as _e,aF as cs,bg as ut,aG as De,
|
|
|
548
554
|
}
|
|
549
555
|
});
|
|
550
556
|
})();`,as=Object.freeze({ready:"deco:ready",load:"deco:load",loaded:"deco:loaded",loadError:"deco:load-error"}),Kl="v1",Hl="/studio-modules",Ms=["wireframe","html-swap"];function Vl(t,e,s){const n=new URL(`${Hl}/${Kl}/${e}.js`,t);return s&&n.searchParams.set("build",s),n.href}const Wl=2e3;class ql{constructor(e){this.options=e,this.urls=Object.fromEntries(Ms.map(s=>[s,Vl(e.studioOrigin,s,e.build)]))}options;origin=null;urls;loaded=new Set;swapId=0;pendingSwap=null;startTimer=null;has(e){return this.loaded.has(e)}handle(e){const s=this.options.frame();if(!s||e.source!==s)return!1;const n=e.data;if(!n||typeof n.type!="string")return!1;if(n.type===as.ready)return Gl(e.origin)?(this.ready(e.origin),!0):!1;if(e.origin!==this.origin)return!1;const a=n;switch(a.type){case as.loaded:{const c=this.nameOf(a.url);return c&&(this.loaded.add(c),this.options.onModulesChange?.(),c==="wireframe"&&this.options.onWireframeReady?.()),!0}case as.loadError:{const c=this.nameOf(a.url);return c&&this.loaded.delete(c)&&this.options.onModulesChange?.(),c==="html-swap"&&this.failSwap(),!0}case"wireframe:hover":case"wireframe:select":return this.options.onWireframe?.(a),!0;case"html-swap:start":return this.pendingSwap?.id===a.id&&(this.pendingSwap.started=!0,this.clearStartTimer()),!0;case"html-swap:end":return this.pendingSwap?.id!==a.id||(this.pendingSwap=null,this.clearStartTimer(),this.options.onSwapEnd?.()),!0;case"html-swap:error":return this.pendingSwap?.id===a.id&&this.failSwap(),!0;default:return!1}}wireframe(e){return this.post("wireframe",e)}refresh(e){if(e!==void 0&&!this.isFrameOrigin(e))return!1;const s=++this.swapId,n=e?{type:"html-swap:refresh",id:s,url:e}:{type:"html-swap:refresh",id:s};return this.post("html-swap",n)?(this.pendingSwap={id:s,started:!1},this.clearStartTimer(),this.startTimer=setTimeout(()=>{this.startTimer=null,this.pendingSwap?.id===s&&!this.pendingSwap.started&&this.failSwap()},Wl),!0):!1}dispose(){this.clearStartTimer(),this.pendingSwap=null,this.loaded.clear(),this.origin=null}ready(e){this.origin=e,this.loaded.size&&(this.loaded.clear(),this.options.onModulesChange?.()),this.pendingSwap&&(this.pendingSwap=null,this.clearStartTimer(),this.options.onSwapEnd?.());const s=this.options.frame();for(const n of Ms)s?.postMessage({type:as.load,url:this.urls[n]},e)}post(e,s){const n=this.options.frame();return!n||!this.origin||!this.loaded.has(e)?!1:(n.postMessage(s,this.origin),!0)}isFrameOrigin(e){try{return new URL(e).origin===this.origin}catch{return!1}}nameOf(e){return Ms.find(s=>this.urls[s]===e)??null}failSwap(){this.clearStartTimer(),this.pendingSwap&&(this.pendingSwap=null,this.options.onSwapFailed?.())}clearStartTimer(){this.startTimer&&clearTimeout(this.startTimer),this.startTimer=null}}function Gl(t){if(typeof t!="string"||t==="null")return!1;try{const e=new URL(t).origin;return e!=="null"&&e===t}catch{return!1}}function qs(t,e,s=!1){let n=t,a=typeof n?.__resolveType=="string"?n.__resolveType:"";for(let c=0;a&&c<5;c++){const d=e[a];if(d&&typeof d=="object"&&"__resolveType"in d){const o=d.__resolveType;if(typeof o=="string"&&o&&o!==a){n=d,a=o;continue}}break}if(!a)return[];if(a.includes("flags/multivariate")||s&&fi(a,s)){const c=Array.isArray(n.variants)?n.variants:[];if(c.length===0||c.every(i=>{const l=i?.rule;return pi(l?.__resolveType,s)}))return null;const o=[];for(const i of c){const l=mi(i,s);if(l&&typeof l=="object")for(const m of qs(l,e,s)??[])o.includes(m)||o.push(m)}return o}if(hi(a)){const c=n.section&&typeof n.section=="object"?qs(n.section,e,s):[];return c===null?null:c.length?[a,...c]:[a]}return[a]}function dt(t){return t.replace(/[`*_]/g,"\\$&")}function Jl(t,e){const s=[`The user selected an element on the live preview and asked: **"${dt(e.trim())}"**`,"","For text content changes, locate the correct source file and apply the change.","For code and CSS changes, understand which component the user is referring to and apply changes to the correct component.",""];t.manifestKey&&s.push(`**Section resolveType:** \`${dt(t.manifestKey)}\``,"","This is a Deco resolveType, not a literal file path. The leading segment is the app name, not a directory — the actual source file lives under a sections directory whose root varies by site (commonly `sections/`, `src/sections/`, or `site/sections/`). Locate the file by searching for the trailing path (e.g. the component filename), don't assume the resolveType is a valid path on disk.","");const n=`<${t.tag}${t.classes?` class="${dt(t.classes)}"`:""}>`;s.push(`**Clicked element:** \`${n}\``),t.parents&&s.push(`**DOM breadcrumb:** ${dt(t.parents)} > ${t.tag}`),t.text&&s.push(`**Text content:** "${dt(t.text)}"`),t.componentName&&s.push(`**Component name:** ${dt(t.componentName)}`);const a=t.html.replace(/```/g,"`` `");return s.push("","**HTML snippet:**","```html",a,"```"),s.push("","Please read the source file, locate the element, and apply the requested change."),s.join(`
|
|
551
|
-
`)}function Yl(t,e,s=320,n=44,a=12){const{x:c,y:d}=t,{width:o,height:i}=e,l=Math.max(a,Math.min(c-s/2,o-s-a)),p=d/i>.68?Math.max(a,d-n-18):Math.min(d+18,i-n-a);return{leftPct:l/o*100,topPct:p/i*100}}function Ql(t){const e=le.c(45),{element:s,onDismiss:n}=t,[a,c]=N.useState(""),d=N.useRef(null),{sendMessage:o}=Pi(),{openSidePanel:i}=Ho(),l=Ee();let m;e[0]!==s||e[1]!==a||e[2]!==n||e[3]!==i||e[4]!==o?(m=()=>{if(!a.trim())return;const z=Jl(s,a);i(),o({parts:[{type:"text",text:z}]}),n()},e[0]=s,e[1]=a,e[2]=n,e[3]=i,e[4]=o,e[5]=m):m=e[5];const p=m;let f;e[6]!==s.position||e[7]!==s.viewport?(f=Yl(s.position,s.viewport),e[6]=s.position,e[7]=s.viewport,e[8]=f):f=e[8];const y=f,x=`${y.leftPct}%`,b=`${y.topPct}%`;let h;e[9]!==x||e[10]!==b?(h={left:x,top:b,width:"320px"},e[9]=x,e[10]=b,e[11]=h):h=e[11];let g;e[12]!==p?(g=z=>{z.preventDefault(),p()},e[12]=p,e[13]=g):g=e[13];let R;e[14]===Symbol.for("react.memo_cache_sentinel")?(R=z=>c(z.target.value),e[14]=R):R=e[14];let v;e[15]!==n?(v=z=>{z.key==="Escape"&&n()},e[15]=n,e[16]=v):v=e[16];let w;e[17]!==l?(w=l("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=l,e[18]=w):w=e[18];let C;e[19]!==a||e[20]!==v||e[21]!==w?(C=r.jsx("input",{ref:d,autoFocus:!0,type:"text",value:a,onChange:R,onKeyDown:v,placeholder:w,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=a,e[20]=v,e[21]=w,e[22]=C):C=e[22];let k;e[23]!==a?(k=a.trim(),e[23]=a,e[24]=k):k=e[24];const S=!k;let j;e[25]!==l?(j=l("sandbox.visualEditorPrompt.sendButton"),e[25]=l,e[26]=j):j=e[26];let T;e[27]!==l?(T=l("sandbox.visualEditorPrompt.sendButton"),e[27]=l,e[28]=T):T=e[28];let B;e[29]!==T?(B=r.jsx("title",{children:T}),e[29]=T,e[30]=B):B=e[30];let A;e[31]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=A):A=e[31];let L;e[32]!==B?(L=r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[B,A]}),e[32]=B,e[33]=L):L=e[33];let $;e[34]!==S||e[35]!==j||e[36]!==L?($=r.jsx("button",{type:"submit",disabled:S,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:j,children:L}),e[34]=S,e[35]=j,e[36]=L,e[37]=$):$=e[37];let O;e[38]!==C||e[39]!==$||e[40]!==g?(O=r.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:g,children:[C,$]}),e[38]=C,e[39]=$,e[40]=g,e[41]=O):O=e[41];let F;return e[42]!==O||e[43]!==h?(F=r.jsx("div",{className:"absolute z-30 pointer-events-none",style:h,children:O}),e[42]=O,e[43]=h,e[44]=F):F=e[44],F}const br="site-links",Xl=/details?page|\bpdp\b/i,Zl=/listingpage|\bplp\b/i;function ec(t,e,s){const n=new Set;for(const o of s)Xl.test(o)&&n.add("product"),Zl.test(o)&&n.add("category");const a=It(Zs(t)),c=a[a.length-1],d=a[a.length-2];return c?.type==="text"&&c.text==="/p"&&d?.type==="param"&&d.name===e&&n.add("product"),e==="*"&&a.some(o=>o.type==="param"&&o.name==="*")&&n.add("category"),n}const tc=["rosa","preto","pink","black"];function is(t,e){const s=e.trim();return s?t(s):tc.flatMap(n=>t(n))}function sc(t,e){const s=e.trim(),n=[];/^\d+$/.test(s)&&n.push({resolveType:t,props:{ids:[s]}});const c=s.includes("-")&&!/\s/.test(s)?s.replace(/-+/g," "):s;return n.push({resolveType:t,props:{query:c,count:10}}),n}const va=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function tn(t){return t.split("/")[0]??""}function nc(t){const e=new Set;for(const s of t){const n=tn(s);va.has(n)&&e.add(n)}return e}function rc(t,e){const s=tn(t);return!va.has(s)||e.size===0?!0:e.has(s)}const ac=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>is(s=>sc(t,s),e),optionsFromPayload:os},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>is(s=>[{resolveType:t,props:{props:{search:s,pageSize:10,currentPage:1}}}],e),optionsFromPayload:os},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>is(s=>[{resolveType:t,props:{term:s,hitsPerPage:10}}],e),optionsFromPayload:os},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>is(s=>[{resolveType:t,props:{query:s,term:s,count:10,hitsPerPage:10}}],e),optionsFromPayload:os},{kind:"category",test:t=>t==="vtex/loaders/categories/tree.ts"||/categor(y|ies).*tree/i.test(t),clientFilter:!0,buildRequests:t=>[{resolveType:t,props:{}}],optionsFromPayload:fc}];function ic(t,e,s=new Set){const n=[...e],a=o=>{const i=[];for(const l of ac){if(l.kind!==o)continue;const m=n.find(p=>l.test(p)&&rc(p,s));m&&i.push({cand:l,resolveType:m})}return i.find(l=>s.has(tn(l.resolveType)))??i[0]},c=(o,i,l)=>({kind:o.kind,id:`${o.kind}:${i}`,resolveType:i,clientFilter:o.clientFilter,isFallback:l,buildRequests:m=>o.buildRequests(i,m),optionsFromPayload:o.optionsFromPayload}),d=[];for(const o of["product","category"]){if(!t.has(o))continue;const i=a(o);i&&d.push(c(i.cand,i.resolveType,!1))}return t.size>0&&d.push(oc(t.has("category")?"category":"product")),d}function oc(t){return{kind:t,id:br,resolveType:br,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,s)=>vc(e,s)}}function et(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function lc(t,e,s){const n=new Set,a=new Set,c=d=>{if(Array.isArray(d)){for(const l of d)c(l);return}const o=et(d);if(!o)return;const i=o.__resolveType;if(typeof i=="string"){if(s(i))n.add(i);else if(i in e&&!a.has(i)){a.add(i);const l=et(e[i])?.__resolveType;typeof l=="string"&&s(l)&&n.add(i),c(e[i])}}for(const l of Object.values(o))c(l)};return c(t),n}function xa(t){const e=new Set,s=[];for(const n of t)for(const a of n)e.has(a.value)||(e.add(a.value),s.push(a));return s}function ba(t){try{return decodeURIComponent(t)}catch{return t}}function cc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dc(t){const e=[];let s="^";for(const n of t)n.type==="text"?s+=cc(n.text):(e.push(n.name),s+=n.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${s}$`),order:e}}function ya(t,e,s){if(typeof t!="string"||!t)return null;let n;try{n=new URL(t,"https://placeholder.invalid").pathname}catch{return null}n=n.replace(/\/+$/,"");const a=It(Zs(e)),{pattern:c,order:d}=dc(a),o=d.indexOf(s);if(o===-1)return null;const i=n.match(c);if(!i)return null;const l=i[o+1]?.replace(/^\/+|\/+$/g,"");return l?ba(l):null}function os(t,e){const s=et(t),n=Array.isArray(t)?t:Array.isArray(s?.products)?s.products:Array.isArray(s?.list)?s.list:[],a=[],c=new Set;for(const d of n){const o=et(d);if(!o)continue;const i=ya(o.url,e.template,e.paramName);if(!i||c.has(i))continue;c.add(i);const l=et(o.isVariantOf),m=typeof l?.name=="string"&&l.name||typeof o.name=="string"&&o.name||i,p=Array.isArray(o.image)?et(o.image[0]):null,f=typeof p?.url=="string"?p.url:void 0;a.push({value:i,label:m,image:f})}return a}function uc(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const s=e.replace(/^\/+|\/+$/g,"");return s?ba(s):null}function fc(t){const e=[],s=new Set,n=(a,c)=>{const d=et(a);if(!d)return;const o=typeof d.name=="string"&&d.name?d.name:"",i=o?[...c,o]:c,l=uc(d.url);if(l&&!s.has(l)&&(s.add(l),e.push({value:l,label:i.join(" › ")||l})),Array.isArray(d.children))for(const m of d.children)n(m,i)};if(Array.isArray(t))for(const a of t)n(a,[]);return e}const pc=new Set(["login","logout","signin","sign-in","signup","sign-up","register","account","myaccount","my-account","minha-conta","conta","cart","carrinho","checkout","wishlist","favoritos","favorites","orders","pedidos","help","hc","sac","atendimento","contato","contact","institucional","newsletter","customer","sales","catalogsearch","search","busca","privacy-policy-cookie-restriction-mode"]);function mc(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,s=>s.toUpperCase())}function hc(t){if(typeof t!="string"||!t)return[];const e=[],s=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let n,a=0;for(;(n=s.exec(t))!==null&&a++<5e3;){const c=n[1]??"",d=(n[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:c,text:d})}return e}function gc(t){if(typeof t!="string"||!t)return[];const e=[],s=new Set,n=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,a=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let c,d=0;for(;(c=n.exec(t))!==null&&d++<3e3;){const o=(c[1]??"").replace(/\\\//g,"/");if(!o||s.has(o))continue;s.add(o);const i=t.slice(c.index,c.index+900).match(a)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:c[2]??"",image:i||void 0})}return e}function vc(t,e){const s=[],n=new Set,a=(c,d,o,i)=>{if(s.length>=200)return;const l=ya(c,e.template,e.paramName);!l||n.has(l)||e.paramName==="*"&&/(^|\/)p$/.test(l)||o==="category"&&pc.has(l.split("/")[0]??"")||(n.add(l),s.push({value:l,label:d&&d.length<=80?d:mc(l),kind:o,image:i}))};for(const{url:c,name:d,image:o}of gc(t))a(c,d,"product",o);for(const{href:c,text:d}of hc(t))c.startsWith("/")&&!c.startsWith("//")&&a(c,d,"category");return s}function Ft(t,e,s=50){const n=e.trim().toLowerCase();return(n?t.filter(c=>c.label.toLowerCase().includes(n)||c.value.toLowerCase().includes(n)):t).slice(0,s)}const wa=1e4;function xc(t){return{product:{noun:t("sandbox.pathParamPickerChip.kindProductNoun"),heading:t("sandbox.pathParamPickerChip.kindProductHeading")},category:{noun:t("sandbox.pathParamPickerChip.kindCategoryNoun"),heading:t("sandbox.pathParamPickerChip.kindCategoryHeading")}}}async function bc(t,{resolveType:e,props:s}){const n=await fetch(Xi(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...s}),signal:AbortSignal.timeout(wa)});if(!n.ok)throw new Error(`Failed to fetch options: ${n.status}`);return n.json()}async function yr(t,e){const s=await fetch(Zi(t,e),{signal:AbortSignal.timeout(wa)});if(!s.ok)throw new Error(`Failed to fetch page: ${s.status}`);return s.text()}async function yc(t,e,s){const n=e.optionsFromPayload(await yr(t,"/"),s),a=n.find(d=>d.kind==="category");if(!a)return n;const c=Ve(s.template,{[s.paramName]:a.value});if(c==="/")return n;try{const d=e.optionsFromPayload(await yr(t,c),s).filter(o=>o.kind==="product");return xa([n,d])}catch{return n}}function wc(t,e,s){return Ys.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":s}`)}async function kc(t,e,s,n){if(e.homepageLinks)return yc(t,e,n);const a=e.buildRequests?.(s)??[];if(a.length===0)return[];const c=await Promise.allSettled(a.map(o=>bc(t,o))),d=c.filter(o=>o.status==="fulfilled").map(o=>o.value);if(d.length===0){const o=c.find(i=>i.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return xa(d.map(o=>e.optionsFromPayload(o,n)))}function Gs(t,e,s,n,a){return{queryKey:wc(t,e,s),queryFn:()=>kc(t,e,s,n),enabled:a,staleTime:6e4,retry:1}}function Bt(t){const e=le.c(16),{heading:s,iconKind:n,options:a,template:c,paramName:d,keyPrefix:o,onSelect:i}=t;if(a.length===0)return null;let l;if(e[0]!==n||e[1]!==o||e[2]!==i||e[3]!==a||e[4]!==d||e[5]!==c){let p;e[7]!==n||e[8]!==o||e[9]!==i||e[10]!==d||e[11]!==c?(p=f=>r.jsxs(pt,{value:`${o}:${f.value}`,className:"gap-3 py-2",onSelect:()=>i(f.value),children:[n==="product"&&r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.image?r.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):r.jsx(Fr,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:f.label}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Ve(c,{[d]:f.value})})]})]},`${o}:${f.value}`),e[7]=n,e[8]=o,e[9]=i,e[10]=d,e[11]=c,e[12]=p):p=e[12],l=a.map(p),e[0]=n,e[1]=o,e[2]=i,e[3]=a,e[4]=d,e[5]=c,e[6]=l}else l=e[6];let m;return e[13]!==s||e[14]!==l?(m=r.jsx(ft,{heading:s,children:l}),e[13]=s,e[14]=l,e[15]=m):m=e[15],m}function wr(t){const e=le.c(2),{text:s}=t;let n;return e[0]!==s?(n=r.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1],n}function Sc(t){const e=le.c(52),{sources:s,template:n,paramName:a,value:c,sandboxRef:d,onCommit:o}=t,i=Ee(),[l,m]=N.useState(!1),[p,f]=N.useState(""),[y,x]=N.useState(""),b=N.useRef(null),h=a==="*"?i("sandbox.preview.catchAllParamLabel"):`:${a}`,g=xc(i),v=[...new Set(s.map(ne=>g[ne.kind].noun))].join(" or ");let w;e[0]!==i||e[1]!==v?(w=i("sandbox.pathParamPickerChip.searchPlaceholder",{options:v}),e[0]=i,e[1]=v,e[2]=w):w=e[2];const C=w,k={template:n,paramName:a};let S;e[3]!==p?(S=(ne,de)=>({source:ne,query:de,options:ne.clientFilter?Ft(de.data??[],p):de.data??[]}),e[3]=p,e[4]=S):S=e[4];const j=S,T=s.filter(Lc),B=s.filter(Rc),A=Vs({queries:T.map(ne=>Gs(d,ne,y,k,l))});let L;e[5]!==A||e[6]!==j?(L=(ne,de)=>j(ne,A[de]),e[5]=A,e[6]=j,e[7]=L):L=e[7];const $=T.map(L),O=$.length===0||$.every(Cc),F=Vs({queries:B.map(ne=>Gs(d,ne,y,k,l&&O))});let z;e[8]!==F||e[9]!==j?(z=(ne,de)=>j(ne,F[de]),e[8]=F,e[9]=j,e[10]=z):z=e[10];const G=B.map(z),W=O?G:$,Y=W.length===1&&W[0]?.source.homepageLinks?W[0]:null,Q=Y&&!Y.query.isLoading&&!Y.query.isError?Y?.query.data??[]:[],K=Ft(Q.filter(Tc),p),ee=Ft(Q.filter(Nc),p),H=K.length>0&&ee.length>0,J=ne=>{m(ne),b.current&&clearTimeout(b.current),f(ne?c:""),x(ne?c:"")};let V;e[11]===Symbol.for("react.memo_cache_sentinel")?(V=ne=>{f(ne),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{x(ne)},300)},e[11]=V):V=e[11];const E=V,_=ne=>{o(ne),J(!1)},D=sa(p),U=Ve(n,{[a]:D}),X=Cr,se=Tr,I="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",Z=Ec;let re;e[12]!==h||e[13]!==i?(re=i("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:h}),e[12]=h,e[13]=i,e[14]=re):re=e[14];let ie;e[15]!==re?(ie=r.jsx(Rr,{className:"sr-only",children:r.jsx(Lr,{children:re})}),e[15]=re,e[16]=ie):ie=e[16];let he;e[17]===Symbol.for("react.memo_cache_sentinel")?(he=r.jsx(Fr,{size:16,className:"shrink-0 text-foreground"}),e[17]=he):he=e[17];let pe;e[18]!==i?(pe=i("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=i,e[19]=pe):pe=e[19];let be;e[20]!==h?(be=r.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:h}),e[20]=h,e[21]=be):be=e[21];let ge;e[22]!==pe||e[23]!==be?(ge=r.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[he,r.jsxs("span",{className:"text-sm font-medium text-foreground",children:[pe," ",be]})]}),e[22]=pe,e[23]=be,e[24]=ge):ge=e[24];const ve=Vr,Se=!1,fe="min-h-0 flex-1";let ce;e[25]!==C||e[26]!==p?(ce=r.jsx(Wr,{autoFocus:!0,placeholder:C,value:p,onValueChange:E}),e[25]=C,e[26]=p,e[27]=ce):ce=e[27];const Re=Hr,Ie="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let ze;e[28]!==i?(ze=i("sandbox.pathParamPickerChip.noResults"),e[28]=i,e[29]=ze):ze=e[29];let Be;e[30]!==ze?(Be=r.jsx(qr,{children:ze}),e[30]=ze,e[31]=Be):Be=e[31];const bt=D&&r.jsx(ft,{className:"shrink-0",children:r.jsxs(pt,{value:`__raw__:${D}`,className:"gap-3 py-2",onSelect:()=>_(D),children:[r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:r.jsx(qo,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:i("sandbox.pathParamPickerChip.useRawValue",{rawTerm:D,paramLabel:h})}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:U})]})]})}),me=H?r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:r.jsx(Bt,{heading:g.category.heading,iconKind:"category",options:K,template:n,paramName:a,keyPrefix:`${Y?.source.id}:cat`,onSelect:_})}),r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r.jsx(Bt,{heading:g.product.heading,iconKind:"product",options:ee,template:n,paramName:a,keyPrefix:`${Y?.source.id}:prod`,onSelect:_})})]}):r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:W.map(ne=>{const{source:de,query:We,options:yt}=ne,{noun:qe}=g[de.kind];if(We.isLoading)return r.jsx(wr,{text:i("sandbox.pathParamPickerChip.loading",{noun:qe})},de.id);if(We.isError)return r.jsx(wr,{text:i("sandbox.pathParamPickerChip.couldNotLoad")},de.id);if(de.homepageLinks){const Ut=We.data??[];return r.jsxs(N.Fragment,{children:[r.jsx(Bt,{heading:g.category.heading,iconKind:"category",options:Ft(Ut.filter(jc),p),template:n,paramName:a,keyPrefix:`${de.id}:cat`,onSelect:_}),r.jsx(Bt,{heading:g.product.heading,iconKind:"product",options:Ft(Ut.filter(Pc),p),template:n,paramName:a,keyPrefix:`${de.id}:prod`,onSelect:_})]},de.id)}return r.jsx(Bt,{heading:W.length>1?g[de.kind].heading:void 0,iconKind:de.kind,options:yt,template:n,paramName:a,keyPrefix:de.id,onSelect:_},de.id)})});let Oe;e[32]!==Re||e[33]!==Be||e[34]!==bt||e[35]!==me?(Oe=r.jsxs(Re,{className:Ie,children:[Be,bt,me]}),e[32]=Re,e[33]=Be,e[34]=bt,e[35]=me,e[36]=Oe):Oe=e[36];let xe;e[37]!==ve||e[38]!==ce||e[39]!==Oe?(xe=r.jsxs(ve,{shouldFilter:Se,className:fe,children:[ce,Oe]}),e[37]=ve,e[38]=ce,e[39]=Oe,e[40]=xe):xe=e[40];let Ue;e[41]!==se||e[42]!==ie||e[43]!==ge||e[44]!==xe||e[45]!==Z?(Ue=r.jsxs(se,{className:I,onClick:Z,children:[ie,ge,xe]}),e[41]=se,e[42]=ie,e[43]=ge,e[44]=xe,e[45]=Z,e[46]=Ue):Ue=e[46];let Le;return e[47]!==X||e[48]!==J||e[49]!==l||e[50]!==Ue?(Le=r.jsx(X,{open:l,onOpenChange:J,children:Ue}),e[47]=X,e[48]=J,e[49]=l,e[50]=Ue,e[51]=Le):Le=e[51],r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",title:i("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:h}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-xs text-special hover:bg-special/25",onClick:ne=>{ne.stopPropagation(),J(!0)},children:c||h}),Le]})}function Pc(t){return t.kind==="product"}function jc(t){return t.kind!=="product"}function Ec(t){return t.stopPropagation()}function Nc(t){return t.kind==="product"}function Tc(t){return t.kind!=="product"}function Cc(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Rc(t){return t.isFallback}function Lc(t){return!t.isFallback}function Ac(t){const e=le.c(8),{sources:s,template:n,paramName:a,sandboxRef:c,onFill:d}=t;let o,i;if(e[0]!==a||e[1]!==c||e[2]!==s||e[3]!==n){const y={template:n,paramName:a},x=s.filter(_c);i=Vs,o=x.map(b=>Gs(c,b,"",y,!0)),e[0]=a,e[1]=c,e[2]=s,e[3]=n,e[4]=o,e[5]=i}else o=e[4],i=e[5];let l;e[6]!==o?(l={queries:o},e[6]=o,e[7]=l):l=e[7];const m=i(l),[p,f]=N.useState(!1);if(!p)for(const y of m){if(y.isLoading)break;const x=y.data?.[0];if(x){f(!0),queueMicrotask(()=>d(x.value));break}}return null}function _c(t){return!t.isFallback}function Oc(t){const e=le.c(31),{name:s,value:n,onCommit:a}=t,c=Ee(),[d,o]=N.useState(n),[i,l]=N.useState(!1),m=N.useRef(!1);let p;e[0]!==s||e[1]!==c?(p=s==="*"?c("sandbox.preview.catchAllParamLabel"):`:${s}`,e[0]=s,e[1]=c,e[2]=p):p=e[2];const f=p,y=d||f;let x;e[3]!==y?(x=r.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:y}),e[3]=y,e[4]=x):x=e[4];let b;e[5]!==f||e[6]!==c?(b=c("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=c,e[7]=b):b=e[7];let h,g;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=j=>o(j.target.value),g=()=>l(!0),e[8]=h,e[9]=g):(h=e[8],g=e[9]);let R;e[10]!==n?(R=j=>{j.key==="Enter"&&j.currentTarget.blur(),j.key==="Escape"&&(m.current=!0,o(n),j.currentTarget.blur())},e[10]=n,e[11]=R):R=e[11];let v;e[12]!==d||e[13]!==a||e[14]!==n?(v=()=>{if(l(!1),m.current){m.current=!1;return}const j=sa(d);o(j),j!==n&&a(j)},e[12]=d,e[13]=a,e[14]=n,e[15]=v):v=e[15];let w;e[16]!==d||e[17]!==f||e[18]!==b||e[19]!==R||e[20]!==v?(w=r.jsx("input",{type:"text",value:d,placeholder:f,title:b,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-xs text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:$c,onChange:h,onFocus:g,onKeyDown:R,onBlur:v}),e[16]=d,e[17]=f,e[18]=b,e[19]=R,e[20]=v,e[21]=w):w=e[21];let C;e[22]!==x||e[23]!==w?(C=r.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[x,w]}),e[22]=x,e[23]=w,e[24]=C):C=e[24];let k;e[25]!==i||e[26]!==c?(k=i&&r.jsxs("span",{className:"pointer-events-none ml-1.5 flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-border bg-muted px-1 py-0.5 text-2xs text-muted-foreground",children:[r.jsx(Li,{size:10}),c("sandbox.preview.enterToGo")]}),e[25]=i,e[26]=c,e[27]=k):k=e[27];let S;return e[28]!==k||e[29]!==C?(S=r.jsxs(r.Fragment,{children:[C,k]}),e[28]=k,e[29]=C,e[30]=S):S=e[30],S}function $c(t){return t.stopPropagation()}function Dc(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const s=new URL(e),n=t.resolvedPath==="/"?"":t.resolvedPath;return`${s.host}${n}`}catch{return e}}function Fc(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Bc(t){return t.showPreviewToolbar&&t.contentEditingEnabled}function Mc(t){return t.v8?null:t.production||t.localPreview?{type:"editor::inject",args:{script:t.script}}:{type:"visual-editor::activate",script:t.script}}function Ic(t){return t.v8?null:{type:"visual-editor::activate",script:t.script}}class ka extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function zc(t,e){if(t)return t;const s=await e?.().catch(()=>null);if(!s)throw new ka;return s}async function Uc(t,e,s){return s?lr(t,e,await zc(s.meta,s.loadMeta)):lr(t,e)}function Kc(t){const e=le.c(5);let s;e[0]!==t?(s=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=s):s=e[1];const n=ia(s);let a;return e[2]!==t||e[3]!==n?(a={mutationFn:async c=>{const{name:d,path:o,template:i,schema:l}=c;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const m=$o(d),p=i?{...i,name:d,path:o}:await Uc(d,o,l);return await n.mutateAsync({blockKey:m,data:p}),{key:m,name:d,path:o}}},e[2]=t,e[3]=n,e[4]=a):a=e[4],gi(a)}function Hc(t){const e=le.c(89),{open:s,onOpenChange:n,isPending:a,error:c,templates:d,onSubmit:o}=t,i=a===void 0?!1:a,l=Ee();let m;e[0]!==l?(m=l("sectionsEditor.createPageModal.defaultPageName"),e[0]=l,e[1]=m):m=e[1];const[p,f]=N.useState(m);let y;e[2]!==l?(y=l("sectionsEditor.createPageModal.defaultPagePath"),e[2]=l,e[3]=y):y=e[3];const[x,b]=N.useState(y),[h,g]=N.useState(_s),[R,v]=N.useState(null),[w,C]=N.useState(s);s!==w&&(C(s),s&&(f(l("sectionsEditor.createPageModal.defaultPageName")),b(l("sectionsEditor.createPageModal.defaultPagePath")),g(_s),v(null)));const k=!!d?.length;let S;e[4]!==i||e[5]!==n?(S=pe=>{!pe&&!i&&(v(null),n(!1))},e[4]=i,e[5]=n,e[6]=S):S=e[6];const j=S;let T;e[7]!==i||e[8]!==p||e[9]!==o||e[10]!==x||e[11]!==k||e[12]!==h?(T=async pe=>{pe.preventDefault();const be=p.trim(),ge=x.trim();if(!be||!ge||i)return;const ve=na(ge);if(ve){v(ve);return}v(null),await o({name:be,path:ge,templateKey:k&&h!==_s?h:null})},e[7]=i,e[8]=p,e[9]=o,e[10]=x,e[11]=k,e[12]=h,e[13]=T):T=e[13];const B=T,A=R??c;let L;e[14]!==l?(L=l("sectionsEditor.createPageModal.title"),e[14]=l,e[15]=L):L=e[15];let $;e[16]!==L?($=r.jsx(Rr,{children:r.jsx(Lr,{children:L})}),e[16]=L,e[17]=$):$=e[17];let O;e[18]!==l?(O=l("sectionsEditor.createPageModal.nameLabel"),e[18]=l,e[19]=O):O=e[19];let F;e[20]!==O?(F=r.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:O}),e[20]=O,e[21]=F):F=e[21];let z;e[22]===Symbol.for("react.memo_cache_sentinel")?(z=pe=>f(pe.target.value),e[22]=z):z=e[22];let G;e[23]!==l?(G=l("sectionsEditor.createPageModal.namePlaceholder"),e[23]=l,e[24]=G):G=e[24];let W;e[25]!==i||e[26]!==p||e[27]!==G?(W=r.jsx(zs,{id:"new-page-name",value:p,onChange:z,placeholder:G,autoFocus:!0,disabled:i}),e[25]=i,e[26]=p,e[27]=G,e[28]=W):W=e[28];let Y;e[29]!==W||e[30]!==F?(Y=r.jsxs("div",{className:"space-y-1.5",children:[F,W]}),e[29]=W,e[30]=F,e[31]=Y):Y=e[31];let q;e[32]!==l?(q=l("sectionsEditor.createPageModal.pathLabel"),e[32]=l,e[33]=q):q=e[33];let Q;e[34]!==q?(Q=r.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:q}),e[34]=q,e[35]=Q):Q=e[35];let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=pe=>b(pe.target.value),e[36]=K):K=e[36];let ee;e[37]!==l?(ee=l("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=l,e[38]=ee):ee=e[38];let H;e[39]!==i||e[40]!==x||e[41]!==ee?(H=r.jsx(zs,{id:"new-page-path",value:x,onChange:K,placeholder:ee,disabled:i}),e[39]=i,e[40]=x,e[41]=ee,e[42]=H):H=e[42];let J;e[43]!==Q||e[44]!==H?(J=r.jsxs("div",{className:"space-y-1.5",children:[Q,H]}),e[43]=Q,e[44]=H,e[45]=J):J=e[45];let V;e[46]!==i||e[47]!==k||e[48]!==l||e[49]!==h||e[50]!==d?(V=k&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.createPageModal.templateLabel")}),r.jsx(Do,{id:"new-page-template",value:h,onChange:g,templates:d??[],disabled:i})]}),e[46]=i,e[47]=k,e[48]=l,e[49]=h,e[50]=d,e[51]=V):V=e[51];let E;e[52]!==A?(E=A&&r.jsx("p",{className:"text-xs text-destructive",children:A}),e[52]=A,e[53]=E):E=e[53];let _;e[54]!==Y||e[55]!==J||e[56]!==V||e[57]!==E?(_=r.jsxs("div",{className:"space-y-4 py-4",children:[Y,J,V,E]}),e[54]=Y,e[55]=J,e[56]=V,e[57]=E,e[58]=_):_=e[58];let D;e[59]!==n?(D=()=>n(!1),e[59]=n,e[60]=D):D=e[60];let U;e[61]!==l?(U=l("sectionsEditor.createPageModal.cancelButton"),e[61]=l,e[62]=U):U=e[62];let X;e[63]!==i||e[64]!==D||e[65]!==U?(X=r.jsx(_e,{type:"button",variant:"outline",onClick:D,disabled:i,children:U}),e[63]=i,e[64]=D,e[65]=U,e[66]=X):X=e[66];let se;e[67]!==i||e[68]!==p||e[69]!==x?(se=!p.trim()||!x.trim()||i,e[67]=i,e[68]=p,e[69]=x,e[70]=se):se=e[70];let I;e[71]!==i||e[72]!==l?(I=i?r.jsxs(r.Fragment,{children:[r.jsx(tt,{className:"size-3.5"}),l("sectionsEditor.createPageModal.creatingButton")]}):l("sectionsEditor.createPageModal.createButton"),e[71]=i,e[72]=l,e[73]=I):I=e[73];let Z;e[74]!==se||e[75]!==I?(Z=r.jsx(_e,{type:"submit",disabled:se,children:I}),e[74]=se,e[75]=I,e[76]=Z):Z=e[76];let re;e[77]!==X||e[78]!==Z?(re=r.jsxs(vi,{children:[X,Z]}),e[77]=X,e[78]=Z,e[79]=re):re=e[79];let ie;e[80]!==B||e[81]!==_||e[82]!==re||e[83]!==$?(ie=r.jsx(Tr,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:B,children:[$,_,re]})}),e[80]=B,e[81]=_,e[82]=re,e[83]=$,e[84]=ie):ie=e[84];let he;return e[85]!==j||e[86]!==s||e[87]!==ie?(he=r.jsx(Cr,{open:s,onOpenChange:j,children:ie}),e[85]=j,e[86]=s,e[87]=ie,e[88]=he):he=e[88],he}function Vc(t){const e=le.c(41),{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:c,meta:d,decofile:o,blockKey:i}=t,l=Ee();let m;e[0]!==a||e[1]!==s||e[2]!==n?(m={orgSlug:s,virtualMcpId:n,branch:a},e[0]=a,e[1]=s,e[2]=n,e[3]=m):m=e[3];const p=ia(m);let f;e[4]!==p?(f=j=>p.mutate(j),e[4]=p,e[5]=f):f=e[5];let y;e[6]!==o||e[7]!==p.v8||e[8]!==f?(y=Go(f,o,p.v8),e[6]=o,e[7]=p.v8,e[8]=f,e[9]=y):y=e[9];const x=y;let b;e[10]!==i||e[11]!==o?(b=Fo(o,i),e[10]=i,e[11]=o,e[12]=b):b=e[12];const{resolveType:h,props:g,title:R}=b;if(!h){let j;e[13]!==l?(j=l("sandbox.preview.loaderNoLongerExists"),e[13]=l,e[14]=j):j=e[14];let T;return e[15]!==j?(T=r.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:j}),e[15]=j,e[16]=T):T=e[16],T}const v=`loader:${i}`,w=`loader:${i}`;let C;e[17]!==i||e[18]!==h||e[19]!==R?(C={mode:"saved",blockKey:i,resolveType:h,title:R},e[17]=i,e[18]=h,e[19]=R,e[20]=C):C=e[20];let k;e[21]!==a||e[22]!==o||e[23]!==d||e[24]!==s||e[25]!==c||e[26]!==g||e[27]!==p.isPending||e[28]!==x||e[29]!==w||e[30]!==C||e[31]!==n?(k=r.jsx(Bo,{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:c,meta:d,decofile:o,kind:"loaders",target:C,initialValue:g,isCreating:p.isPending,onCreate:Wc,onSaveReferencedBlock:x,showRun:!1},w),e[21]=a,e[22]=o,e[23]=d,e[24]=s,e[25]=c,e[26]=g,e[27]=p.isPending,e[28]=x,e[29]=w,e[30]=C,e[31]=n,e[32]=k):k=e[32];let S;return e[33]!==i||e[34]!==a||e[35]!==o||e[36]!==s||e[37]!==v||e[38]!==k||e[39]!==n?(S=r.jsx(Jo,{listing:o,orgSlug:s,virtualMcpId:n,branch:a,blockKey:i,present:void 0,children:k},v),e[33]=i,e[34]=a,e[35]=o,e[36]=s,e[37]=v,e[38]=k,e[39]=n,e[40]=S):S=e[40],S}async function Wc(){}function qc(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function kr(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:qc(t.error)}}function Gc(t){switch(t){case"clone-failed":case"install-failed":case"start-failed":return"terminal-error";case"idle":case"cloning":return"booting";case"checking-out":case"installing":case"starting":case"running":case"crashed":return"snapshot-readable"}}function Jc(t){if(t.fastPreviewActive)return t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData?{kind:"error",source:"data"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"};const e=Gc(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const s=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return s&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(a=>a.status==="error"&&!a.hasData&&a.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:s?t.lifecyclePhase==="running"||t.lifecyclePhase==="crashed"?{kind:"error",source:"data"}:{kind:"loading"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"}}const Yc=N.lazy(()=>xi(()=>import("./sections-editor-BPeB4JuU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.SectionsEditor})));function Sr(t){const e=le.c(62),{virtualMcpId:s,externalSelection:n,onSectionPicked:a,onViewJsonFile:c}=t,d=n===void 0?null:n,{org:o}=fs(),{currentBranch:i,taskId:l}=st(),m=en(),p=xt(),f=la(),y=m.lifecycle.phase==="running",x=p.previewUrl;let b;e[0]!==i||e[1]!==o||e[2]!==x||e[3]!==l||e[4]!==s?(b=i?{orgSlug:o.slug,virtualMcpId:s,branch:i,threadId:l??null,previewUrl:x}:null,e[0]=i,e[1]=o,e[2]=x,e[3]=l,e[4]=s,e[5]=b):b=e[5];const h=b,g=zt(s,i);let R;e[6]!==y?(R={fetchEnabled:y},e[6]=y,e[7]=R):R=e[7];const v=ps(h,R),w=Jr(h);let C;e[8]!==y?(C={fetchEnabled:y},e[8]=y,e[9]=C):C=e[9];const k=ra(h,C),S=Jc({lifecyclePhase:m.lifecycle.phase,decofile:kr(v),meta:kr(k),hasEditableContent:yo(v.data,k.data),fastPreviewActive:Gr(s).runtime==="cms"||Xe(g)}),j=Qs()===void 0,T=Qc;if(wo(g)){let E;return e[10]===Symbol.for("react.memo_cache_sentinel")?(E=T(r.jsx(So,{})),e[10]=E):E=e[10],E}if(g.kind==="pending"&&g.retrying){let E;return e[11]!==g?(E=T(r.jsx(Po,{backend:g})),e[11]=g,e[12]=E):E=e[12],E}if(S.kind==="loading"||j){let E;return e[13]===Symbol.for("react.memo_cache_sentinel")?(E=T(r.jsx(bi,{})),e[13]=E):E=e[13],E}if(v.data&&eo(k.data)){const E=f.state.target,_=E?.kind==="page"||E?.kind==="section"?E.key:null,D=g.kind==="legacy"?_??"":`${w}:${_??""}`,U=i??"";let X;return e[14]!==v.data||e[15]!==_||e[16]!==o.slug||e[17]!==D||e[18]!==U||e[19]!==s?(X=T(r.jsx(Mo,{orgSlug:o.slug,virtualMcpId:s,branch:U,decofile:v.data,initialKey:_,compact:!0},D)),e[14]=v.data,e[15]=_,e[16]=o.slug,e[17]=D,e[18]=U,e[19]=s,e[20]=X):X=e[20],X}if(S.kind==="empty"){let E;return e[21]===Symbol.for("react.memo_cache_sentinel")?(E=T(r.jsx(jo,{})),e[21]=E):E=e[21],E}if(S.kind==="error"){let E;e[22]!==v||e[23]!==p||e[24]!==k||e[25]!==S.source?(E=()=>{if(S.source==="sandbox"){p.retry();return}Promise.all([v.refetch(),k.refetch()])},e[22]=v,e[23]=p,e[24]=k,e[25]=S.source,e[26]=E):E=e[26];const _=E;let D;return e[27]!==_||e[28]!==S.source?(D=T(r.jsx(ko,{source:S.source,onRetry:_})),e[27]=_,e[28]=S.source,e[29]=D):D=e[29],D}let B;e[30]===Symbol.for("react.memo_cache_sentinel")?(B=E=>T(r.jsx("div",{className:"h-full min-h-0",children:E})),e[30]=B):B=e[30];const A=B,L=f.state.target;if(L?.kind==="loader"&&v.data&&k.data){const E=g.kind==="legacy"?void 0:w,_=i??"",D=x??null;let U;return e[31]!==v.data||e[32]!==k.data||e[33]!==o.slug||e[34]!==E||e[35]!==_||e[36]!==D||e[37]!==L.key||e[38]!==s?(U=A(r.jsx(Vc,{orgSlug:o.slug,virtualMcpId:s,branch:_,previewUrl:D,meta:k.data,decofile:v.data,blockKey:L.key},E)),e[31]=v.data,e[32]=k.data,e[33]=o.slug,e[34]=E,e[35]=_,e[36]=D,e[37]=L.key,e[38]=s,e[39]=U):U=e[39],U}let $;e[40]!==i||e[41]!==o.slug||e[42]!==L||e[43]!==s?($=L||!i?null:$r(Dr(o.slug,s,i)),e[40]=i,e[41]=o.slug,e[42]=L,e[43]=s,e[44]=$):$=e[44];const O=$;let F="/",z=null,G=null;L?.kind==="page"?(F=L.path,z=L.key):L?.kind==="section"?G=L.key:O&&(F=O.path,z=O.pageKey);const W=z?`page:${z}`:G?`section:${G}`:`path:${F}`;let Y;e[45]===Symbol.for("react.memo_cache_sentinel")?(Y=r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(tt,{className:"size-5 text-muted-foreground"})}),e[45]=Y):Y=e[45];const q=g.kind==="legacy"?W:`${w}:${W}`,Q=i??"",K=x??void 0,ee=G?null:d,H=G?void 0:a,J=!!z&&f.state.editSeoPageKey===z;let V;return e[46]!==G||e[47]!==z||e[48]!==F||e[49]!==c||e[50]!==o.slug||e[51]!==K||e[52]!==ee||e[53]!==H||e[54]!==J||e[55]!==q||e[56]!==Q||e[57]!==s||e[58]!==f.consumeEditSeo||e[59]!==f.setFocusedBlock||e[60]!==f.setVariantOverride?(V=A(r.jsx(N.Suspense,{fallback:Y,children:r.jsx(Yc,{orgSlug:o.slug,virtualMcpId:s,branch:Q,previewReady:!0,previewUrl:K,currentPath:F,activePageBlockKey:z,activeGlobalBlockKey:G,externalSelection:ee,onSectionPicked:H,initialEditSeo:J,onExitSeo:f.consumeEditSeo,onVariantPreviewOverride:f.setVariantOverride,onFocusedBlockChange:f.setFocusedBlock,onViewJsonFile:c},q)})),e[46]=G,e[47]=z,e[48]=F,e[49]=c,e[50]=o.slug,e[51]=K,e[52]=ee,e[53]=H,e[54]=J,e[55]=q,e[56]=Q,e[57]=s,e[58]=f.consumeEditSeo,e[59]=f.setFocusedBlock,e[60]=f.setVariantOverride,e[61]=V):V=e[61],V}function Qc(t){return r.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function Xc(t){const e=le.c(51),{virtualMcpId:s,pageKey:n,onClose:a,ref:c}=t,d=Ee(),o=Qs(),i=o===!0,l=Xs(s);let m;e[0]!==l||e[1]!==n?(m=Yr(l,fa(n)),e[0]=l,e[1]=n,e[2]=m):m=e[2];const p=m,{org:f}=fs(),{currentBranch:y,taskId:x}=st(),h=xt().previewUrl;let g;e[3]!==y||e[4]!==f.slug||e[5]!==h||e[6]!==x||e[7]!==s?(g=y?{orgSlug:f.slug,virtualMcpId:s,branch:y,threadId:x??null,previewUrl:h}:null,e[3]=y,e[4]=f.slug,e[5]=h,e[6]=x,e[7]=s,e[8]=g):g=e[8];const v=ps(g),w=y??"";let C;e[9]!==f.slug||e[10]!==w||e[11]!==s?(C={orgSlug:f.slug,virtualMcpId:s,branch:w},e[9]=f.slug,e[10]=w,e[11]=s,e[12]=C):C=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k={holdsCopy:!0},e[13]=k):k=e[13];const{save:S,flush:j,hold:T}=oa(C,k),B=y??"";let A;e[14]!==f.slug||e[15]!==B||e[16]!==s?(A=da({orgSlug:f.slug,virtualMcpId:s,branch:B}),e[14]=f.slug,e[15]=B,e[16]=s,e[17]=A):A=e[17];const L=ua(A);let $;e[18]!==n||e[19]!==L?($=L(n),e[18]=n,e[19]=L,e[20]=$):$=e[20];const O=$;let F;e[21]!==O||e[22]!==n?(F={pageKey:n,copyEpoch:O},e[21]=O,e[22]=n,e[23]=F):F=e[23];const[z,G]=N.useState(F);(z.pageKey!==n||z.copyEpoch!==O)&&(G({pageKey:n,copyEpoch:O}),T(n));const W=v.data?.[n],Y=v.data===void 0&&v.isLoading||o===void 0,q=v.data!==void 0&&W===void 0,Q=!y||q||Y;let K;e[24]!==W?(K=W===void 0?"":JSON.stringify(W,null,2),e[24]=W,e[25]=K):K=e[25];const ee=K;let H;e[26]!==n||e[27]!==Q||e[28]!==S?(H=U=>{if(Q)return;let X;try{X=JSON.parse(U)}catch{return}X===null||typeof X!="object"||Array.isArray(X)||S(n,X)},e[26]=n,e[27]=Q,e[28]=S,e[29]=H):H=e[29];const J=H;let V;e[30]!==j?(V=()=>({flush:j}),e[30]=j,e[31]=V):V=e[31],N.useImperativeHandle(c,V);let E;e[32]!==p||e[33]!==i||e[34]!==a||e[35]!==d?(E=i?r.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:r.jsx("span",{title:p,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:p})}):r.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:d("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx(_e,{variant:"ghost",size:"icon-sm",onClick:a,"aria-label":d("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(Ar,{size:14})})]}),e[32]=p,e[33]=i,e[34]=a,e[35]=d,e[36]=E):E=e[36];let _;e[37]!==O||e[38]!==v.data||e[39]!==j||e[40]!==ee||e[41]!==Y||e[42]!==q||e[43]!==n||e[44]!==Q||e[45]!==J||e[46]!==d?(_=Y?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(tt,{className:"size-5 text-muted-foreground"})}):q?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",d("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(ca,{code:ee,language:"json",readOnly:Q,height:"100%",onChange:U=>J(U??""),onSave:U=>{J(U),j()}},`${n}:${v.data===void 0?"loading":"ready"}:${O}`)}),e[37]=O,e[38]=v.data,e[39]=j,e[40]=ee,e[41]=Y,e[42]=q,e[43]=n,e[44]=Q,e[45]=J,e[46]=d,e[47]=_):_=e[47];let D;return e[48]!==E||e[49]!==_?(D=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[E,_]}),e[48]=E,e[49]=_,e[50]=D):D=e[50],D}function Pr(t){const e=le.c(3),{currentBranch:s}=st(),n=zt(t.virtualMcpId,s);let a;return e[0]!==n.kind||e[1]!==t?(a=n.kind==="legacy"?r.jsx(Xc,{...t}):r.jsx(Zc,{...t}),e[0]=n.kind,e[1]=t,e[2]=a):a=e[2],a}function Zc(t){const e=le.c(61),{virtualMcpId:s,pageKey:n,onClose:a,ref:c}=t,d=Ee(),o=Qs(),i=o===!0,l=Xs(s);let m;e[0]!==l||e[1]!==n?(m=Yr(l,fa(n)),e[0]=l,e[1]=n,e[2]=m):m=e[2];const p=m,{org:f}=fs(),{currentBranch:y,taskId:x}=st(),h=xt().previewUrl;let g;e[3]!==y||e[4]!==f.slug||e[5]!==h||e[6]!==x||e[7]!==s?(g=y?{orgSlug:f.slug,virtualMcpId:s,branch:y,threadId:x??null,previewUrl:h}:null,e[3]=y,e[4]=f.slug,e[5]=h,e[6]=x,e[7]=s,e[8]=g):g=e[8];const R=g,v=ps(R);let w;e[9]!==n?(w=[n],e[9]=n,e[10]=w):w=e[10];let C;e[11]!==v.data?(C={listing:v.data},e[11]=v.data,e[12]=C):C=e[12];const k=Qr(R,w,C),S=y??"";let j;e[13]!==f.slug||e[14]!==S||e[15]!==s?(j={orgSlug:f.slug,virtualMcpId:s,branch:S},e[13]=f.slug,e[14]=S,e[15]=s,e[16]=j):j=e[16];let T;e[17]===Symbol.for("react.memo_cache_sentinel")?(T={holdsCopy:!0},e[17]=T):T=e[17];const{save:B,flush:A,hold:L}=oa(j,T),$=y??"";let O;e[18]!==f.slug||e[19]!==$||e[20]!==s?(O=da({orgSlug:f.slug,virtualMcpId:s,branch:$}),e[18]=f.slug,e[19]=$,e[20]=s,e[21]=O):O=e[21];const F=ua(O);let z;e[22]!==n||e[23]!==F?(z=F(n),e[22]=n,e[23]=F,e[24]=z):z=e[24];const G=z,W=v.data?.[n];let Y;e[25]!==k.ready||e[26]!==v.data||e[27]!==W?(Y=k.ready&&v.data!==void 0&&(W===void 0||Qn(W)),e[25]=k.ready,e[26]=v.data,e[27]=W,e[28]=Y):Y=e[28];const q=Y;let Q;e[29]!==G||e[30]!==n?(Q={pageKey:n,copyEpoch:G,opened:!1,code:""},e[29]=G,e[30]=n,e[31]=Q):Q=e[31];const[K,ee]=N.useState(Q);if(q&&(K.pageKey!==n||K.copyEpoch!==G||!K.opened)){let Z;e[32]!==W?(Z=W===void 0?"":JSON.stringify(W,null,2),e[32]=W,e[33]=Z):Z=e[33],ee({pageKey:n,copyEpoch:G,opened:!0,code:Z}),Qn(W)&&L(n)}const H=K.pageKey===n&&K.opened,J=o===void 0||!H&&!q,V=q&&W===void 0,E=!y||V||J;let _;e[34]!==n||e[35]!==E||e[36]!==B?(_=Z=>{if(E)return;ee(ie=>({...ie,code:Z}));let re;try{re=JSON.parse(Z)}catch{return}re===null||typeof re!="object"||Array.isArray(re)||B(n,re)},e[34]=n,e[35]=E,e[36]=B,e[37]=_):_=e[37];const D=_;let U;e[38]!==A?(U=()=>({flush:A}),e[38]=A,e[39]=U):U=e[39],N.useImperativeHandle(c,U);let X;e[40]!==p||e[41]!==i||e[42]!==a||e[43]!==d?(X=i?r.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:r.jsx("span",{title:p,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:p})}):r.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:d("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx(_e,{variant:"ghost",size:"icon-sm",onClick:a,"aria-label":d("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(Ar,{size:14})})]}),e[40]=p,e[41]=i,e[42]=a,e[43]=d,e[44]=X):X=e[44];let se;e[45]!==k.failed||e[46]!==k.retry||e[47]!==A||e[48]!==K.code||e[49]!==K.copyEpoch||e[50]!==K.pageKey||e[51]!==J||e[52]!==V||e[53]!==E||e[54]!==D||e[55]!==H||e[56]!==d?(se=!H&&k.failed?r.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-4",children:[r.jsx("p",{className:"text-sm",children:d("sectionsEditor.hosted.blockLoadFailed")}),r.jsx(_e,{variant:"outline",size:"sm",onClick:k.retry,children:d("sectionsEditor.namedRules.tryAgain")})]}):J?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(tt,{className:"size-5 text-muted-foreground"})}):V?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",d("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(ca,{code:K.code,language:"json",readOnly:E,height:"100%",onChange:Z=>D(Z??""),onSave:Z=>{D(Z),A()}},`${K.pageKey}:${K.copyEpoch}`)}),e[45]=k.failed,e[46]=k.retry,e[47]=A,e[48]=K.code,e[49]=K.copyEpoch,e[50]=K.pageKey,e[51]=J,e[52]=V,e[53]=E,e[54]=D,e[55]=H,e[56]=d,e[57]=se):se=e[57];let I;return e[58]!==X||e[59]!==se?(I=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[X,se]}),e[58]=X,e[59]=se,e[60]=I):I=e[60],I}function Sa(t){return t.contentEditingEnabled&&!t.isMobile}function ed(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function td(t,e){return t==="blocks"?"preview":e?"blocks":t}function sd(t){return Sa({contentEditingEnabled:aa(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function nd(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function rd(t){const e=to(t),{display:s}=t;let n=null;if(s.mode==="production"&&s.iframeBase)try{n=new URL(t.path,s.iframeBase).href}catch{n=null}const a=so(n,e);return{value:e,frame:a?Ws(a,t.device):null,newTab:a}}function ad(t){const e=le.c(94),{tests:s,load:n,onOpen:a,options:c,onChange:d,available:o}=t,i=Ee();let l;e[0]!==c?(l=Xr(c),e[0]=c,e[1]=l):l=e[1];const m=l;let p;e[2]!==c.tests?(p=c.tests??{},e[2]=c.tests,e[3]=p):p=e[3];const f=p;let y;e[4]!==d||e[5]!==c?(y=I=>{const Z=I?sl(I):null,{at:re,...ie}=c;d(Z?{...ie,at:Z}:ie)},e[4]=d,e[5]=c,e[6]=y):y=e[6];const x=y;let b;e[7]!==f||e[8]!==d||e[9]!==c?(b=(I,Z)=>{const re={...f};Z==="on"?re[I]=!0:Z==="off"?re[I]=!1:delete re[I];const{tests:ie,...he}=c;d(Object.keys(re).length>0?{...he,tests:re}:he)},e[7]=f,e[8]=d,e[9]=c,e[10]=b):b=e[10];const h=b;let g;e[11]!==a?(g=I=>{I&&a?.()},e[11]=a,e[12]=g):g=e[12];let R;e[13]!==i?(R=i("sandbox.previewAs.label"),e[13]=i,e[14]=R):R=e[14];let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx(Ai,{size:16}),e[15]=v):v=e[15];let w;e[16]!==m||e[17]!==R?(w=r.jsx(ht,{asChild:!0,children:r.jsx(zr,{asChild:!0,children:r.jsx(Ze,{"aria-label":R,active:m,"data-testid":"preview-as-trigger",children:v})})}),e[16]=m,e[17]=R,e[18]=w):w=e[18];let C;e[19]!==i?(C=i("sandbox.previewAs.label"),e[19]=i,e[20]=C):C=e[20];let k;e[21]!==C?(k=r.jsx(gt,{children:C}),e[21]=C,e[22]=k):k=e[22];let S;e[23]!==k||e[24]!==w?(S=r.jsxs(vt,{children:[w,k]}),e[23]=k,e[24]=w,e[25]=S):S=e[25];let j;e[26]!==i?(j=i("sandbox.previewAs.label"),e[26]=i,e[27]=j):j=e[27];let T;e[28]!==j?(T=r.jsx("h3",{className:"text-sm font-medium",children:j}),e[28]=j,e[29]=T):T=e[29];let B;e[30]!==o||e[31]!==i?(B=i(o?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[30]=o,e[31]=i,e[32]=B):B=e[32];let A;e[33]!==B?(A=r.jsx("p",{className:"text-xs text-muted-foreground",children:B}),e[33]=B,e[34]=A):A=e[34];let L;e[35]!==T||e[36]!==A?(L=r.jsxs("div",{className:"flex flex-col gap-1",children:[T,A]}),e[35]=T,e[36]=A,e[37]=L):L=e[37];let $;e[38]!==i?($=i("sandbox.previewAs.momentLabel"),e[38]=i,e[39]=$):$=e[39];let O;e[40]!==$?(O=r.jsx(Zo,{htmlFor:"preview-as-moment",children:$}),e[40]=$,e[41]=O):O=e[41];let F;e[42]!==c.at?(F=tl(c.at),e[42]=c.at,e[43]=F):F=e[43];let z;e[44]!==x?(z=I=>x(I.target.value),e[44]=x,e[45]=z):z=e[45];let G;e[46]!==F||e[47]!==z?(G=r.jsx(zs,{id:"preview-as-moment",type:"datetime-local",className:nl,value:F,onChange:z}),e[46]=F,e[47]=z,e[48]=G):G=e[48];const W=c.at===void 0;let Y;e[49]!==x?(Y=()=>x(""),e[49]=x,e[50]=Y):Y=e[50];let q;e[51]!==i?(q=i("sandbox.previewAs.now"),e[51]=i,e[52]=q):q=e[52];let Q;e[53]!==W||e[54]!==Y||e[55]!==q?(Q=r.jsx(_e,{type:"button",variant:"ghost",size:"sm",disabled:W,onClick:Y,children:q}),e[53]=W,e[54]=Y,e[55]=q,e[56]=Q):Q=e[56];let K;e[57]!==G||e[58]!==Q?(K=r.jsxs("div",{className:"flex items-center gap-2",children:[G,Q]}),e[57]=G,e[58]=Q,e[59]=K):K=e[59];let ee;e[60]!==i?(ee=i("sandbox.previewAs.momentHint"),e[60]=i,e[61]=ee):ee=e[61];let H;e[62]!==ee?(H=r.jsx("p",{className:"text-xs text-muted-foreground",children:ee}),e[62]=ee,e[63]=H):H=e[63];let J;e[64]!==O||e[65]!==K||e[66]!==H?(J=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,K,H]}),e[64]=O,e[65]=K,e[66]=H,e[67]=J):J=e[67];let V;e[68]!==i?(V=i("sandbox.previewAs.testsLabel"),e[68]=i,e[69]=V):V=e[69];let E;e[70]!==V?(E=r.jsx("span",{className:"text-sm font-medium",children:V}),e[70]=V,e[71]=E):E=e[71];let _;e[72]!==f||e[73]!==n||e[74]!==h||e[75]!==i||e[76]!==s?(_=n&&!n.ready?n.failed?r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.testsLoadFailed")}),r.jsx(_e,{type:"button",variant:"outline",size:"sm",onClick:n.retry,children:i("sandbox.previewAs.tryAgain")})]}):r.jsx("div",{className:"flex justify-center py-2","data-testid":"preview-as-tests-loading",children:r.jsx(tt,{className:"size-4 text-muted-foreground"})}):s.length===0?r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.noTests")}):r.jsxs(r.Fragment,{children:[r.jsx("ul",{className:"flex flex-col gap-1.5",children:s.map(I=>r.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[r.jsx("span",{className:"min-w-0 truncate text-sm",children:I}),r.jsxs(el,{type:"single",variant:"outline",size:"sm",value:f[I]===void 0?"":f[I]?"on":"off",onValueChange:Z=>h(I,Z),"aria-label":I,children:[r.jsx(fr,{value:"off",children:i("sandbox.previewAs.off")}),r.jsx(fr,{value:"on",children:i("sandbox.previewAs.on")})]})]},I))}),r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.testsHint")})]}),e[72]=f,e[73]=n,e[74]=h,e[75]=i,e[76]=s,e[77]=_):_=e[77];let D;e[78]!==E||e[79]!==_?(D=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[E,_]}),e[78]=E,e[79]=_,e[80]=D):D=e[80];let U;e[81]!==m||e[82]!==d||e[83]!==i?(U=m&&r.jsx(_e,{type:"button",variant:"outline",size:"sm",onClick:()=>d({}),children:i("sandbox.previewAs.reset")}),e[81]=m,e[82]=d,e[83]=i,e[84]=U):U=e[84];let X;e[85]!==L||e[86]!==J||e[87]!==D||e[88]!==U?(X=r.jsxs(Ur,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[L,J,D,U]}),e[85]=L,e[86]=J,e[87]=D,e[88]=U,e[89]=X):X=e[89];let se;return e[90]!==S||e[91]!==X||e[92]!==g?(se=r.jsxs(Kr,{onOpenChange:g,children:[S,X]}),e[90]=S,e[91]=X,e[92]=g,e[93]=se):se=e[93],se}const id=["next"],od=["@tanstack/react-router","@tanstack/react-start","@tanstack/solid-router","@tanstack/solid-start"],Pa=new Set(["tsx","ts","jsx","js","mdx"]),ld=new Set(["tsx","jsx"]),cd=new Set(["404","500"]);function dd(t){const e=new Set;if(!t||typeof t!="object")return e;const s=t;for(const n of["dependencies","devDependencies"]){const a=s[n];if(a&&typeof a=="object"&&!Array.isArray(a))for(const c of Object.keys(a))e.add(c)}return e}function ud(t){const e=dd(t);return id.some(s=>e.has(s))?"next":od.some(s=>e.has(s))?"tanstack":null}function ja(t,e){const s=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return s?`${s}/${e}`:e}function fd(t,e){const s=n=>ja(e,n);switch(t){case"next":return[{router:"next-pages",dir:s("pages"),pattern:"**/*"},{router:"next-pages",dir:s("src/pages"),pattern:"**/*"},{router:"next-app",dir:s("app"),pattern:"**/page.*"},{router:"next-app",dir:s("src/app"),pattern:"**/page.*"}];case"tanstack":return[{router:"tanstack",dir:s("src/routes"),pattern:"**/*"}];default:{const n=t;throw new Error(`Unknown framework: ${String(n)}`)}}}function sn(t){const e=t.lastIndexOf(".");return e<=0?null:[t.slice(0,e),t.slice(e+1)]}function pd(t){const e=sn(t.at(-1)??"");if(!e||!Pa.has(e[1]))return null;const[s]=e;if(s.includes("."))return null;const n=[...t.slice(0,-1),s];return n[0]==="api"||n.length===1&&cd.has(s)||n.some(a=>a.startsWith("_")||a.includes("["))?null:(n.at(-1)==="index"&&n.pop(),`/${n.join("/")}`)}function md(t){const e=sn(t.at(-1)??"");if(!e||e[0]!=="page"||!Pa.has(e[1]))return null;const s=[];for(const n of t.slice(0,-1)){if(n.startsWith("_")||n.startsWith("@")||/^\(\.{1,3}\)/.test(n)||n.includes("["))return null;n.startsWith("(")&&n.endsWith(")")||s.push(n)}return`/${s.join("/")}`}function hd(t){const e=[];let s="",n=!1;for(const a of t)a==="["?n=!0:a==="]"&&(n=!1),a==="."&&!n?(e.push(s),s=""):s+=a;return e.push(s),e}function gd(t){const e=sn(t.at(-1)??"");if(!e||!ld.has(e[1]))return null;const s=[...t.slice(0,-1),...hd(e[0])].filter(Boolean);s.at(-1)==="lazy"&&s.pop();const n=s.at(-1);if(!n||n==="__root"||s.some(c=>c.startsWith("-"))||n.startsWith("_"))return null;(n==="index"||n==="route")&&s.pop();const a=[];for(const c of s){if(c.includes("$"))return null;if(c.startsWith("_")||c.startsWith("(")&&c.endsWith(")"))continue;const d=c.replace(/_$/,"").replace(/[[\]]/g,"");d&&a.push(d)}return`/${a.join("/")}`}function vd(t,e){const s=e.split("/").filter(Boolean);if(s.length===0)return null;switch(t){case"next-pages":return pd(s);case"next-app":return md(s);case"tanstack":return gd(s);default:{const n=t;throw new Error(`Unknown router: ${String(n)}`)}}}function xd(t){const e=new Set;for(const{root:s,files:n}of t){const a=`${s.dir}/`;for(const c of n){if(!c.startsWith(a))continue;const d=vd(s.router,c.slice(a.length));d&&e.add(d)}}return[...e].sort((s,n)=>s==="/"?-1:n==="/"?1:s.localeCompare(n))}const bd=5e3,yd=6e4;async function wd(t,e){const s=await fetch(rl(t,"glob"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pattern:e.pattern,path:e.dir,limit:bd})});if(!s.ok)throw new Error(`Failed to list ${e.dir}: ${s.status}`);const n=await s.json();return Array.isArray(n.files)?n.files.filter(a=>typeof a=="string"):[]}async function kd(t,e){const s=await no(t,ja(e,"package.json"));if(s.kind==="unavailable")throw new Error("package.json unavailable: sandbox not ready");const n=s.kind==="data"?ud(s.data):null;if(!n)return[];const a=fd(n,e),c=await Promise.all(a.map(async d=>({root:d,files:await wd(t,d)})));return xd(c)}function Sd(t,e,s){const n=le.c(12);let a;n[0]!==e||n[1]!==t?(a=t?Ys.frameworkRoutes(t.orgSlug,t.virtualMcpId,t.branch,t.threadId,e):["framework-routes","none"],n[0]=e,n[1]=t,n[2]=a):a=n[2];let c;n[3]!==e||n[4]!==t?(c=()=>t?kd(t,e):[],n[3]=e,n[4]=t,n[5]=c):c=n[5];const d=s&&!!t;let o;n[6]!==a||n[7]!==c||n[8]!==d?(o={queryKey:a,queryFn:c,enabled:d,staleTime:yd},n[6]=a,n[7]=c,n[8]=d,n[9]=o):o=n[9];const i=_r(o);let l;return n[10]!==i.data?(l=i.data??[],n[10]=i.data,n[11]=l):l=n[11],l}const Pd=500,jd={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},jr=1,ls=["desktop","mobile","tablet"],Ed=["preview","visual","blocks"],Er={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function Nd(t){if(!t)return null;try{const e=new URL(t,window.location.href);return e.searchParams.set("__decoFBT","0"),e.searchParams.set("__deco_ssr","1"),e.href}catch{return t}}function Mt(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function Is(t,e){try{return new URL(t,e).href}catch{return null}}function Td(t,e){if(!e.inPlaceRenderActive)return{pin:e.draftPreviewUrl?{path:e.resolvedPath,url:e.draftPreviewUrl}:null,effective:e.draftPreviewUrl};if(e.draftPreviewUrl!==null&&t?.path!==e.resolvedPath){const s={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:s,effective:s.url}}return{pin:t,effective:t?.url??null}}function Cd(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function Rd(t,e,s){const n=t.toLowerCase(),a=e.toLowerCase(),c=a.split("/").filter(Boolean),d=i=>{if(i===s)return 100;const l=i.indexOf(s);if(l===-1)return 0;let m=40;return l===0?m+=30:/[\s/-]/.test(i[l-1]??"")&&(m+=20),m+=Math.round(s.length/i.length*20),m};let o=Math.max(d(n),d(a));return c.at(-1)===s?o=Math.max(o,95):c.includes(s)&&(o=Math.max(o,90)),o}function Ld(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Ad({virtualMcpId:t}){const e=Ee(),s=ta(),{currentBranch:n,taskId:a,virtualMcpId:c}=st(),d=!!ji(),o=la(),i=Mi(c===t?t:null),l=Gr(t),m=al(i?.metadata?.ui?.layout??null),p=aa(m),f=Sa({contentEditingEnabled:p,isMobile:s}),[y]=N.useState(()=>sd({cmsMode:m,isMobile:s})),[x,b]=Us(Ks.previewEditingMode(t),u=>u&&Ed.includes(u)?u:null),h=x??y,[g,R]=Us(Ks.previewDeviceSize(t),u=>u&&ls.includes(u)?u:"desktop"),[v,w]=N.useState(null),[C,k]=N.useState(null),S=N.useRef(null),j=N.useRef(null),[T,B]=N.useState(!1),A=N.useRef(null),L=()=>{A.current?.flush(),B(!1)},$=()=>B(u=>(u&&A.current?.flush(),!u)),[O,F]=N.useState({width:0,height:0}),[z,G]=N.useState(!1),[W,Y]=N.useState({}),[q,Q]=N.useState(""),K=N.useRef(null),[ee,H]=N.useState(!1),[J,V]=N.useState(),[E,_]=N.useState(null),[D,U]=N.useState(null),[X,se]=N.useState(null),[I,Z]=N.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[re,ie]=N.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[he,pe]=N.useState({}),[be,ge]=N.useState(!1),ve=N.useRef(null),Se=()=>{ge(!0),ve.current&&clearTimeout(ve.current),ve.current=setTimeout(()=>ge(!1),15e3)},fe=()=>{ve.current&&(clearTimeout(ve.current),ve.current=null),ge(!1)},{org:ce}=fs(),Re=en(),Ie=xt(),ze=Ie.vmEntry,Be=Re.lifecycle.phase,{url:bt}=Zr(t),me=zt(t,n),{connection:Oe}=ea(t),xe=Yo(t),Ue=ro({hasServeConnection:!!Oe,runtime:l.runtime}),Le=!Xe(me)&&me.kind!=="pending",ne=He(me)??bt,de=ne??Ie.previewUrl,We=!!ne||Be==="running",yt=i?.id===t?qi(i.metadata):null,qe=!ne&&i?.id===t&&l.runtime==="cms",Ut=l.projectDefault==="cms",wt=Le?ao({sandboxUrl:de,previewServerUrl:yt,fastPreviewActive:qe}):null,nn=t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n,threadId:a??null,previewUrl:de}:null,rn=ps(nn,{fetchEnabled:We}),ms=ra(nn,{fetchEnabled:We}),ue=rn.data,Pe=ms.data,Ge=ue?Eo(ue,Pe).sort((u,P)=>u.name.localeCompare(P.name)):[],Kt=t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n}:null,an=Kc(Kt),Ea=io(Kt),hs=ue&&Pe?No(ue,Pe):[],on=Le&&ue&&Pe?Io(Pe,ue,"loaders"):[],ln=q?(()=>{const u=q.toLowerCase();return Ge.map(P=>({page:P,score:Rd(P.name,P.path,u)})).filter(({score:P})=>P>0).sort((P,M)=>M.score-P.score||P.page.path.length-M.page.path.length).map(({page:P})=>P)})():Ge,cn=hs.filter(u=>{if(!q)return!0;const P=q.toLowerCase();return u.name.toLowerCase().includes(P)||u.key.toLowerCase().includes(P)||u.resolveType.toLowerCase().includes(P)}),dn=f?on:[],un=dn.filter(u=>{if(!q)return!0;const P=q.toLowerCase();return u.title.toLowerCase().includes(P)||u.key.toLowerCase().includes(P)||u.resolveType.toLowerCase().includes(P)}),Ht=D?on.find(u=>u.key===D)??null:null,Ne=Zs,gs=E||D?null:To(Ge,I,re),oe=gs?.key??null,nt=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??oe,Vt=gs?.path??null,rt=(oe?he[oe]:void 0)??{},Ce=Ve(I,rt),vs={};if(Le&&We&&de&&Pe&&ue){const u=zo(Pe,"loaders"),P=oe?ue[oe]:void 0,M=lc(P,ue,we=>u.has(we)),ae=nc(M);for(const we of It(I)){if(we.type!=="param")continue;const Te=ec(I,we.name,M),ct=ic(Te,u,ae);ct.length>0&&(vs[we.name]=ct)}}const kt=t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n,threadId:a??null}:null,fn=ue&&oe?Ko(ue,oe,0):[],pn=Xe(me),mn=ue?Uo(fn,ue,pn):[],St=mn.map(u=>u.isSavedBlock?u.label:""),Pt=mn.map(u=>u.isSavedBlock?"global":u.isMultivariate?"variant":"normal"),jt=fn.map(u=>qs(u,ue??{},pn)),at=N.useRef(null),$e=N.useRef(null),Na=Re.status.state==="paused",xs=Re.phase,hn=Wo({claimPhase:xs,lifecycle:Re.lifecycle}),Je=Ie.previewState,Ta=Ie.userStopped,Ca=oo(ce.slug,t??""),{url:Ke}=Oo(qe&&t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n,previewServerUrl:yt??null,path:Ce}:null),Ra=Ut&&l.runtime==="sandbox",Ae=lo(me,Ue,xe),gn=co(Ae&&qe&&me.kind==="protocol"&&t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n}:null),vn=Ae?gn.pointer:null,te=Ol({previewState:Je,progressStatus:hn.status,previewServerUrl:yt,fastPreviewActive:qe,fastPreviewReady:!!Ke,codingSession:Ra,localPreviewUrl:ne,hostedDraft:Ae,hostedPointerPending:Ae&&(me.kind==="pending"||gn.pending)}),xn=te.showWakingPill||Ae&&te.mode==="production"&&!vn,Et=te.mode!=="none",La=te.mode==="production"&&te.iframeBase?Mt(te.iframeBase):null,it=te.mode==="production"?La:Mt(de),Aa=i?.id===t&&i.metadata?.fastPreviewInPlace===!0,Nt=Le?ne?te.mode==="sandbox"&&f&&h==="blocks":te.mode==="production"&&qe&&Aa&&f&&h==="blocks":!1,bn=N.useRef(null),{pin:_a,effective:Oa}=Td(bn.current,{inPlaceRenderActive:Nt,draftPreviewUrl:Ke,resolvedPath:Ce});bn.current=_a;const yn=o.state.variantOverride??[],Wt=Le?yn:[],Tt=Le?[]:yn,qt=Xe(me)&&Co.some(u=>Ro(Pe,u)==="available"),ot=qt?W:{},wn=Xr(ot),$a=qt&&ue?Object.keys(Lo(ue).experiments):[],[kn,Da]=N.useState(!1),Sn=Qr(Kt,qt&&kn?Ao:[]),Fa={...Sn,ready:!(me.kind==="protocol"&&me.hosted)||kn&&Sn.ready},Ye=t?er(ce.slug,t):null,Ba=uo(Ye),Gt=Ae?rd({display:te,path:Ce,pointer:vn,heldRevision:Ba,device:g,forcedVariants:Tt,previewOptions:ot}):null,Pn=JSON.stringify([Tt,ot]);N.useEffect(()=>{if(!Ae||!Ye)return;const[u,P]=JSON.parse(Pn);tr(Ye,{forcedVariants:u,previewOptions:P})},[Ae,Ye,Pn]),N.useEffect(()=>{if(!(!Ae||!Ye))return()=>tr(Ye,null)},[Ae,Ye]);const bs=Oe&&He(me)?fo(Oe.endpoint,Tt,wn):null,Ma=Oe&&He(me)?bs?po(bs,ot):sr:null,Qe=Nd(te.mode==="sandbox"?ns(Ws(nr(X??Is(Ce,te.iframeBase)??te.iframeBase,Ma),g),Wt):te.mode==="production"&&Gt?.frame?Gt.frame:te.mode==="production"?ns(Ws(rr(ar(nr(X??Oa??Is(Ce,te.iframeBase)??te.iframeBase,xn?sr:null),Tt),ot),g),Wt):null),jn=Ke??(te.iframeBase?Is(Ce,te.iframeBase):null),En=te.mode==="production"&&Gt?Gt.newTab:te.mode==="production"?jn?ns(rr(ar(jn,Tt),ot),Wt):null:Qe??te.iframeBase,Ia=()=>{const u=En;u&&window.open(u,"_blank","noopener")},Ct=t&&n?Dr(ce.slug,t,n):null,Rt=u=>{Ct&&Ni(Ct,u)},ke=o.state.target;N.useEffect(()=>{if(!(!ke||!wt||!Pe))if(ke.kind==="page"){const u=he[ke.key]??{};$e.current=Ve(ke.path,u),_(null),U(null),se(null),ie(ke.key),Z(ke.path),Rt({path:ke.path,pageKey:ke.key,params:u})}else if(ke.kind==="loader")$e.current=null,_(null),U(ke.key),se(null);else{const u=hs.find(P=>P.key===ke.key);if(u){$e.current=null;const P=or(Pe);U(null),_(u),se(ir(wt,P,u.key))}}},[ke,wt,Pe,he]),N.useEffect(()=>{!oe||Vt===null||ke?.kind==="page"&&ke.key===oe&&ke.path===Vt||o.selectTarget({kind:"page",key:oe,path:Vt})},[oe,Vt,ke]);const[Nn,za]=N.useState(null);if(Je.kind==="iframe"&&Nn!==Je.previewUrl){const u=Nn!==null;za(Je.previewUrl);const P=Ct?$r(Ct):null;if(P){if($e.current=Ve(P.path,P.params),Z(P.path),ie(P.pageKey),se(null),_(null),U(null),P.pageKey&&Object.keys(P.params).length>0){const M=P.pageKey;pe(ae=>({...ae,[M]:P.params}))}}else u&&($e.current=null,Z("/"),se(null),ie(null),_(null),U(null))}at.current=Qe;const Ua=te.mode==="production"&&!!Ke&&!ne,[Jt,ys]=N.useState({src:Qe??void 0,loading:!1}),[Ka,ws]=N.useState(!1),[Ha,Va]=N.useState(),[Tn,Cn]=N.useState(null),je=Ui(Tn,{base:te.iframeBase??"",frameSrc:Jt.src,loadedSrc:Ha,wanted:Qe??void 0,canSwap:xe&&Ka&&!Jt.loading});je!==Tn&&Cn(je);const Yt=Ki(Jt,je?je.src:Qe??void 0,Ua);Yt!==Jt&&ys(Yt);const lt=Yt.src,Rn=Yt.loading,Ln=Hi({iframeRef:S,src:te.mode==="sandbox"?Qe:null,active:te.mode==="sandbox"}),An=N.useRef(null);N.useEffect(()=>{const u=Rn?setTimeout(()=>ys(Zn),Vi):null,P=()=>{u&&clearTimeout(u)};if(!Ke||!lt||An.current===Ke)return P;An.current=Ke;const M=S.current;return M&&M.getAttribute("src")!==lt&&(Se(),M.src=lt),P},[Ke,lt,Rn]);const _n=()=>{const u=S.current?.contentWindow,P=it;if(!u||!P||!ue||!oe)return;const M=ue[oe];if(!M||typeof M!="object")return;const ae=vo({previewBaseUrl:P,pageBlock:M,decofile:ue,path:Ce,pathTemplate:I});if(!ae)return;const we=ns(ae.src,bo(Wt,oe));u.postMessage({type:"cms-editor::render",src:we,body:ae.body},P)},ks=N.useRef(null);N.useEffect(()=>{if(!Nt||E||D||!oe||!ue){ks.current=null;return}const u={nav:JSON.stringify({page:oe,path:Ce,pathTemplate:I}),content:JSON.stringify(ue)},P=Cd(ks.current,u);ks.current=u,P&&_n()},[ue,Nt,E,D,oe,Ce,I]);const Ss=N.useRef(null);N.useEffect(()=>{if(!Nt||E||D||!oe||!ue){Ss.current=null;return}const u=JSON.stringify(o.state.variantOverride??null),P=Ss.current;Ss.current={page:oe,sig:u},!(!P||P.page!==oe||P.sig===u)&&_n()},[o.state.variantOverride,Nt,E,D,oe]);const On=!!t&&!!n&&!Re.notFound&&!Ta&&!Na&&(xs?.kind==="ready"||Be!=="idle"),$n=!Xe(me),Wa=Xs(t??void 0),qa=Sd(kt,Wa,$n&&On),Ga=new Set(Ge.map(u=>Ne(u.path))),Qt=$n?qa.filter(u=>!Ga.has(Ne(u))):[],Dn=q?Qt.filter(u=>u.toLowerCase().includes(q.toLowerCase())):Qt,ye=nd({editingMode:h,sandboxDisplay:te.mode==="sandbox",blocksEditingEnabled:f});N.useEffect(()=>{const u=it;if(!u)return;const P=M=>{if(M.origin===u)if(M.data?.type==="visual-editor::element-clicked"){const ae=Bl.safeParse(M.data.payload);ae.success&&w(ae.data)}else if(M.data?.type==="cms-editor::section-clicked"){const ae=zl.safeParse(M.data.payload);ae.success&&k({index:ae.data.sectionIndex,seq:ae.data.clickSeq})}else M.data?.type==="cms-editor::render-start"?Se():M.data?.type==="cms-editor::render-end"?(fe(),S.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:St,kinds:Pt,keys:jt},u)):M.data?.type==="cms-editor::render-error"&&fe()};return window.addEventListener("message",P),()=>window.removeEventListener("message",P)},[it,St,Pt,jt]);const Fn=()=>{const u=S.current?.contentWindow,P=Mt(de),M=Ic({v8:xe,script:Ml});!u||!P||!M||u.postMessage(M,P)},Ja=()=>{if(xe)return;const u=S.current?.contentWindow,P=Mt(de);!u||!P||u.postMessage({type:"visual-editor::deactivate"},P)},Bn=()=>{const u=Me.current;u?.has("wireframe")&&(u.wireframe({type:"wireframe:sections",labels:St,kinds:Pt,keys:jt}),u.wireframe({type:ye==="blocks"?"wireframe:activate":"wireframe:deactivate"}))},Ps=()=>{if(xe){Bn();return}const u=S.current?.contentWindow,P=it,M=Mc({v8:xe,production:te.mode==="production",localPreview:!!ne,script:Ul});!u||!P||!M||(u.postMessage(M,P),u.postMessage({type:"cms-editor::set-labels",labels:St,kinds:Pt,keys:jt},P))},Ya=()=>{if(xe){Me.current?.wireframe({type:"wireframe:deactivate"});return}const u=S.current?.contentWindow,P=it;!u||!P||u.postMessage({type:"cms-editor::deactivate"},P)},Mn=u=>{Me.current?.wireframe({type:"wireframe:scroll-to",sectionIndex:u})},Qa=()=>{if(Me.current?.wireframe({type:"wireframe:clear-hover"}),xe)return;const u=S.current?.contentWindow,P=it;!u||!P||(u.postMessage({type:"cms-editor::clear-hover"},P),u.postMessage({type:"visual-editor::clear-hover"},P))},Xt=u=>{if(u==="blocks"&&!f)return;const P=h;!s&&u!==P&&(u==="blocks"?j.current?.resize("30%"):j.current?.collapse()),b(u),w(null),k(null),u!=="blocks"&&U(null),P==="visual"&&Ja(),u==="visual"&&Fn(),P==="blocks"&&u!=="blocks"&&Ya(),u==="blocks"&&Ps()},Xa=()=>{Xt(ed(h,f))},Za=()=>{Xt(td(h,f))},Zt=()=>{const u=S.current;if(!u)return;Se();const P=document.activeElement,M=u.tabIndex;u.tabIndex=-1,u.style.pointerEvents="none",u.blur(),Ld(u,at.current);let ae;const we=()=>{clearTimeout(ae),u.tabIndex=M,u.style.pointerEvents="";const Te=document.activeElement;(!Te||Te===document.body||Te===u)&&P?.focus(),u.removeEventListener("load",we)};u.addEventListener("load",we),ae=setTimeout(we,3e3)};Vo(Zt);const Me=N.useRef(null),In=N.useEffectEvent(Bn),ei=N.useEffectEvent((u,P)=>{k({index:u,seq:P})}),ti=N.useEffectEvent(()=>{fe(),je&&(js.current=je.shown),At&&As(Lt)}),zn=N.useEffectEvent(()=>{if(ws(!1),je&&Cn(null),je&&je.src!==at.current){Se();return}Zt()});N.useEffect(()=>{if(!xe)return;const u=new ql({studioOrigin:window.location.origin,build:"4.581.0",frame:()=>S.current?.contentWindow??null,onWireframeReady:()=>In(),onWireframe:M=>{M.type==="wireframe:select"&&ei(M.sectionIndex,M.clickSeq)},onModulesChange:()=>ws(u.has("html-swap")),onSwapEnd:()=>ti(),onSwapFailed:()=>zn()});Me.current=u;const P=M=>{u.handle(M)};return window.addEventListener("message",P),()=>{window.removeEventListener("message",P),u.dispose(),ws(!1),Me.current===u&&(Me.current=null)}},[xe,te.iframeBase]);const Un=xe?JSON.stringify([St,Pt,jt,ye]):"";N.useEffect(()=>{Un&&In()},[Un]);const Kn=N.useRef(null);N.useEffect(()=>{const u=Kn.current;if(Kn.current=je,je&&je!==u){Me.current?.refresh(je.shown)?Se():zn();return}!je&&u&&u.shown!==u.src&&u.src===at.current&&Zt()},[je]);const Hn=()=>{Me.current?.refresh()||Zt()},Lt=er(ce.slug,t??""),At=Ae&&Et&&!!t,js=N.useRef(null);N.useEffect(()=>{if(At)return mo(Lt)},[At,Lt]);const{reload:_t}=ho(ce.slug,t??""),Vn=N.useRef(_t.seq);N.useEffect(()=>{if(Vn.current!==_t.seq&&(Vn.current=_t.seq,!!At&&js.current===at.current)){if(_t.navigates){As(Lt);return}Hn()}},[_t.seq]);const Es=Jr(Kt),Ot=go(He(me)?Es:""),Wn=N.useRef(Ot);N.useEffect(()=>{const u=Wn.current;if(Wn.current=Ot,!u||!Ot||u===Ot)return;const P=S.current;if(P)return Fl({iframe:P,reload:Hn})},[Ot]);const si=()=>{const u=ls.indexOf(g);R(ls[(u+1)%ls.length])},Ns=(u,P)=>{if(!oe)return;const M=oe,ae={...rt,[u]:P};$e.current=Ve(I,ae),pe(we=>({...we,[M]:ae})),Rt({path:I,pageKey:M,params:ae})},ni=Dc({iframeBase:te.iframeBase,resolvedPath:Ce,activeGlobalSectionName:E?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),Ts=u=>{const P=he[u.key]??{},M=Ve(u.path,P);(E||Ne(M)!==Ne(Ce))&&Se(),$e.current=M,_(null),U(null),se(null),k(null),ie(u.key),Z(u.path),Rt({path:u.path,pageKey:u.key,params:P}),o.selectTarget({kind:"page",key:u.key,path:u.path})},qn=u=>{(E||Ne(u)!==Ne(Ce))&&Se(),$e.current=u,_(null),U(null),se(null),k(null),ie(null),Z(u),Rt({path:u,pageKey:null,params:{}})};Ei(Ct,qn);const ri=u=>{if(Xe(me)){const ae=ue?_o(ue,u.key,Pe):null;ae?Ts(ae):ds.info(e("sandbox.preview.blockOnNoPage"));return}if(!wt||!Pe){ds.error(e("sandbox.preview.previewMetadataNotReady"));return}Se(),$e.current=null;const P=or(Pe),M=ir(wt,P,u.key);_(u),U(null),se(M),k(null),o.selectTarget({kind:"section",key:u.key})},ai=u=>{f&&(_(null),U(u.key),se(null),Xt("blocks"),o.selectTarget({kind:"loader",key:u.key}))},ii=async({name:u,path:P,templateKey:M})=>{if(!t||!n)return;const ae=na(P);if(ae){V(ae);return}const we=P.trim().startsWith("/")?P.trim():`/${P.trim()}`;if(Ge.some(Te=>Ne(Te.path)===Ne(we))){V(e("sandbox.preview.pageAlreadyExists",{path:we}));return}V(void 0);try{const Te=M?await Ea(ue,M):void 0;if(M&&!Te){V(e("sandbox.preview.templateNoLongerExists"));return}const ct=await an.mutateAsync({name:u,path:we,template:Te,schema:Xe(me)?{meta:Pe,loadMeta:async()=>(await ms.refetch()).data}:void 0});H(!1),ds.success(e("sandbox.preview.pageCreated",{name:u})),await ol(Pd),Ts({key:ct.key,name:ct.name,path:ct.path}),Xt("blocks")}catch(Te){V(Te instanceof ka?e("sandbox.preview.pageSchemaNotReady"):Te instanceof Error?Te.message:e("sandbox.preview.failedToCreatePage"))}},es=Fc({previewSurfaceActive:Et,daemonReady:On,production:te.mode==="production",servePreviewUrl:He(me)}),oi=Bc({showPreviewToolbar:es,contentEditingEnabled:p}),$t=()=>{G(!1),Q("")},Cs=E?.name??Ht?.title??gs?.name,Rs=rn.isPending||ms.isPending,Ls=Rs?Mt(te.iframeBase):Cs,Dt=E?`section:${E.key}`:D?`loader:${D}`:oe?`page:${oe}`:Qt.includes(Ne(I))?`route:${Ne(I)}`:void 0,li=es?oi?r.jsxs(Kr,{open:z,onOpenChange:u=>{G(u),u||Q("")},children:[r.jsx(zr,{asChild:!0,children:r.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:Rs?Ls??void 0:E||Ht?Cs:[Cs,I].filter(Boolean).join(" · "),className:"group/page-picker flex h-7 w-fit min-w-[320px] items-stretch overflow-hidden whitespace-nowrap rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background text-left text-xs text-muted-foreground transition-colors hover:border-border focus-ring",children:r.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 px-2 transition-colors group-hover/page-picker:bg-accent/50 group-data-[state=open]/page-picker:bg-accent/50",children:[E&&r.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-2xs font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[r.jsx(_i,{size:11}),e("sandbox.preview.globalBadge")]}),Ht&&r.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:[r.jsx(Oi,{size:11}),e("sandbox.preview.loaderBadge")]}),Ls&&r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:Ls}),!Rs&&!E&&!Ht&&r.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:I}),r.jsx(Ti,{size:12,className:Fe("shrink-0 transition-transform",z&&"rotate-180")})]})})}),r.jsxs(Ur,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[r.jsxs(Vr,{shouldFilter:!1,defaultValue:Dt,children:[r.jsx(Wr,{value:q,onValueChange:u=>{Q(u),K.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),r.jsxs(Hr,{ref:K,className:"max-h-80",children:[r.jsx(qr,{children:Ge.length===0&&Qt.length===0&&hs.length===0&&dn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),ln.length>0&&r.jsx(ft,{children:ln.map(u=>r.jsxs(pt,{value:`page:${u.key}`,"aria-current":Dt===`page:${u.key}`||void 0,title:`${u.name} · ${u.path}`,onSelect:()=>{$t(),Ts(u)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:u.name}),r.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:u.path})]},u.key))}),Dn.length>0&&r.jsx(ft,{heading:e("sandbox.preview.siteRoutes"),children:Dn.map(u=>r.jsx(pt,{value:`route:${u}`,"aria-current":Dt===`route:${u}`||void 0,title:u,onSelect:()=>{$t(),qn(u)},className:"px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:r.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:u})},u))}),cn.length>0&&r.jsx(ft,{heading:e("sandbox.preview.globalComponents"),children:cn.map(u=>r.jsx(pt,{value:`section:${u.key}`,"aria-current":Dt===`section:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{$t(),ri(u)},children:r.jsx("span",{className:"truncate",children:u.name})},u.key))}),un.length>0&&r.jsx(ft,{heading:e("sandbox.preview.globalLoaders"),children:un.map(u=>r.jsx(pt,{value:`loader:${u.key}`,"aria-current":Dt===`loader:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{$t(),ai(u)},children:r.jsx("span",{className:"truncate",children:u.title})},u.key))})]})]}),!E&&!D&&It(I).some(u=>u.type!=="text")&&r.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:It(I).map((u,P)=>{if(u.type==="text")return r.jsx("span",{children:u.text},`text-${P}`);const M=vs[u.name];return M&&kt?r.jsx(Sc,{sources:M,template:I,paramName:u.name,value:rt[u.name]??"",sandboxRef:kt,onCommit:ae=>Ns(u.name,ae)},`${oe}:${u.name}`):r.jsx(Oc,{name:u.name,value:rt[u.name]??"",onCommit:ae=>Ns(u.name,ae)},`${oe}:${u.name}`)})}),r.jsx("div",{className:"border-t p-1.5",children:r.jsxs(_e,{variant:"ghost",className:"w-full justify-start",onClick:()=>{$t(),V(void 0),H(!0)},children:[r.jsx(Ir,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):r.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:ni}):null,Gn=es||p?r.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[r.jsxs(vt,{children:[r.jsx(ht,{asChild:!0,children:r.jsx(Ze,{onClick:si,"aria-label":e(Er[g]),children:g==="mobile"?r.jsx(Br,{size:16}):g==="tablet"?r.jsx($i,{size:16}):r.jsx(Mr,{size:16})})}),r.jsx(gt,{children:e(Er[g])})]}),li,r.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[qt&&r.jsx(ad,{tests:$a,load:Fa,onOpen:()=>Da(!0),options:W,onChange:u=>{Y(u),o.previewAsChanged()},available:!!bs||!xn||!wn}),r.jsx(Ze,{onClick:Ia,disabled:Ae&&!En,"aria-label":e("sandbox.preview.openInNewTab"),children:r.jsx(Or,{size:16})})]})]}):null,ci=(Le||d)&&te.mode==="sandbox",ts=jd[g],ss=g==="desktop"&&(O.width===0||O.width>=ts.width+2*jr),Jn=ss?1:Math.min(O.width>0?O.width/(ts.width+2*jr):1,1),di=ss?{width:"100%",height:"100%"}:{width:`${ts.width}px`,height:O.height>0?`${O.height/Jn}px`:`${ts.height}px`,transform:`scale(${Jn})`,transformOrigin:"top center"},Yn=r.jsxs(r.Fragment,{children:[ci&&(es||p)&&r.jsx(Ze,{onClick:Xa,"aria-pressed":ye==="visual","aria-label":e("sandbox.preview.visualEditor"),active:ye==="visual",children:r.jsx(Xn,{size:16})}),f&&r.jsxs(vt,{children:[r.jsx(ht,{asChild:!0,children:r.jsx(Ze,{onClick:Za,"aria-pressed":ye==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:ye==="blocks",children:r.jsx(Fi,{size:16})})}),r.jsx(gt,{children:e("sandbox.preview.blocksEditor")})]}),nt&&r.jsxs(vt,{children:[r.jsx(ht,{asChild:!0,children:r.jsx(Ze,{onClick:$,"aria-pressed":T,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:T,children:r.jsx(Di,{size:16})})}),r.jsx(gt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),ui=!!D&&ye==="blocks";return r.jsxs("div",{className:"flex flex-col w-full h-full",children:[kt&&Object.entries(vs).map(([u,P])=>(rt[u]??"")===""?r.jsx(Ac,{sources:P,template:I,paramName:u,sandboxRef:kt,onFill:M=>Ns(u,M)},`${oe}:${u}`):null),r.jsxs(r.Fragment,{children:[r.jsx(Hs.Toolbar.Center.Portal,{fallback:r.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:Gn}),children:Gn}),r.jsx(Hs.Toolbar.Right.Portal,{fallback:Yn,children:Yn})]}),r.jsx("div",{className:"flex-1 overflow-hidden relative",children:ui?r.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[r.jsx(Sr,{virtualMcpId:t,externalSelection:C,onSectionPicked:Mn,onViewJsonFile:$}),T&&nt&&r.jsx("div",{className:"absolute inset-0 z-10",children:r.jsx(Pr,{ref:A,virtualMcpId:t,pageKey:nt,onClose:L},me.kind==="legacy"?void 0:JSON.stringify([Es,xe]))})]}):r.jsxs(cr,{orientation:"horizontal",disabled:ye!=="blocks",className:"relative isolate",children:[r.jsx(rs,{ref:j,id:"preview-blocks-editor",defaultSize:ye==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:ye==="blocks"&&r.jsx(Sr,{virtualMcpId:t,externalSelection:C,onSectionPicked:Mn,onViewJsonFile:$})}),ye==="blocks"&&r.jsx(dr,{withHandle:!0}),r.jsx(rs,{id:"preview-canvas",defaultSize:ye==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:r.jsxs(cr,{orientation:"horizontal",disabled:!(T&&nt),children:[r.jsx(rs,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:r.jsxs("div",{ref:u=>{if(!u)return;const P=()=>F(ae=>ae.width===u.clientWidth&&ae.height===u.clientHeight?ae:{width:u.clientWidth,height:u.clientHeight});P();const M=new ResizeObserver(P);return M.observe(u),()=>M.disconnect()},className:Fe("h-full relative overflow-clip flex justify-center",Et&&!ss&&"bg-muted/30"),children:[(be||Ca)&&Et&&r.jsx(Wi,{}),te.showDecidingLoader&&r.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:r.jsx(tt,{className:"size-5 text-muted-foreground"})}),te.showBlockingOverlay&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Os,{kind:"starting",progress:hn,claimPhase:xs})}),!ne&&Je.kind==="suspended"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Os,{kind:"suspended",onResume:Ie.resume})}),!ne&&Je.kind==="errored"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Os,{kind:"errored",error:Je.error,onRetry:Ie.retry,connectionsHref:`/${ce.slug}/settings/connections`})}),te.showWakingPill&&r.jsxs("div",{className:"absolute top-4 left-1/2 z-20 flex max-w-md -translate-x-1/2 items-start gap-3 rounded-xl bg-muted px-4 py-3 shadow-soft pointer-events-none select-none",children:[r.jsx(tt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),r.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),ye==="visual"&&!v&&r.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-special/40 bg-special/90 px-3 py-1 text-xs font-medium text-special-foreground shadow-soft backdrop-blur-sm pointer-events-none select-none",children:[r.jsx(Xn,{size:12}),e("sandbox.preview.clickElementToAsk")]}),ye==="visual"&&v&&r.jsx(Ql,{element:v,onDismiss:()=>w(null)}),Et&&Qe&&r.jsx("div",{className:Fe("shrink-0",!ss&&"bg-background shadow-edge"),style:di,onMouseLeave:Qa,children:r.jsx("iframe",{ref:S,src:lt,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Ln.handleError,onLoad:()=>{if(ys(Zn),Va(lt),Ln.handleLoad(),fe(),js.current=at.current,At&&As(Lt),te.mode!=="sandbox"||ne){(te.mode==="production"&&!te.showWakingPill||ne)&&ye==="blocks"&&Ps();return}if(yi("vm_preview_loaded",{view_mode:ye,vm_id:ze?.sandboxHandle??null}),!E)try{const u=S.current?.contentWindow?.location?.pathname;if(!u)return;const P=$e.current;if(P!==null&&($e.current=null,Ne(u)!==Ne(P))||Ne(u)===Ne(Ce))return;Z(u),Rt({path:u,pageKey:re,params:rt})}catch{}ye==="visual"&&Fn(),ye==="blocks"&&Ps()}},te.iframeBase)})]})}),T&&nt&&r.jsxs(r.Fragment,{children:[r.jsx(dr,{withHandle:!0}),r.jsx(rs,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:r.jsx(Pr,{ref:A,virtualMcpId:t,pageKey:nt,onClose:L},me.kind==="legacy"?void 0:JSON.stringify([Es,xe]))})]})]})})]})}),r.jsx(Hc,{open:ee,onOpenChange:H,isPending:an.isPending,error:J,templates:Ge,onSubmit:ii})]})}const Js={app:null,split:!1};function _d(t){const e=le.c(24),{project:s,maxApps:n,children:a}=t,c=Ee();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={silent:!0},e[0]=d):d=e[0];const o=Ii(d),i=xt();let l;e[1]!==s.metadata.runtime?(l=s.metadata.runtime??{},e[1]=s.metadata.runtime,e[2]=l):l=e[2];const m=l;let p;e[3]!==m.apps?(p=m.apps??[],e[3]=m.apps,e[4]=p):p=e[4];const f=p;let y;e[5]!==o.update||e[6]!==i||e[7]!==s.id||e[8]!==s.metadata||e[9]!==m||e[10]!==c?(y=v=>o.update.mutate({id:s.id,data:{metadata:{...ll(s.metadata),runtime:{...m,apps:v.length?v:null}}}},{onSuccess:()=>i.start(),onError:()=>ds.error(c("sandbox.appTabs.saveError"))}),e[5]=o.update,e[6]=i,e[7]=s.id,e[8]=s.metadata,e[9]=m,e[10]=c,e[11]=y):y=e[11];const x=y,b=m.path??null;let h,g;e[12]!==f||e[13]!==x?(h=v=>x([...f,{path:v}]),g=v=>x(f.filter(w=>w.path!==v)),e[12]=f,e[13]=x,e[14]=h,e[15]=g):(h=e[14],g=e[15]);let R;return e[16]!==f||e[17]!==a||e[18]!==n||e[19]!==s.id||e[20]!==b||e[21]!==h||e[22]!==g?(R=r.jsx(Od,{virtualMcpId:s.id,mainPath:b,apps:f,maxApps:n,onAddApp:h,onRemoveApp:g,children:a}),e[16]=f,e[17]=a,e[18]=n,e[19]=s.id,e[20]=b,e[21]=h,e[22]=g,e[23]=R):R=e[23],R}function Od(t){const e=le.c(102),{virtualMcpId:s,mainPath:n,apps:a,maxApps:c,onAddApp:d,onRemoveApp:o,children:i}=t,l=Ee(),m=ta(),{currentBranch:p}=st(),f=xt(),y=en().lifecycle.phase,x=zt(s,p),{url:b}=Zr(s);let h;e[0]!==x||e[1]!==b?(h=He(x)??b,e[0]=x,e[1]=b,e[2]=h):h=e[2];const g=h,R=g??f.previewUrl,v=!!g||y==="running",w=!v&&f.status==="errored";let C;e[3]!==f.vmEntry?.startedWith?.apps?(C=f.vmEntry?.startedWith?.apps??[],e[3]=f.vmEntry?.startedWith?.apps,e[4]=C):C=e[4];const k=C;let S;e[5]!==s?(S=Ks.previewAppLayout(s),e[5]=s,e[6]=S):S=e[6];const[j,T]=Us(S,$d);let B;e[7]!==a||e[8]!==j?(B=a.some(fe=>fe.path===j.app)?j.app:null,e[7]=a,e[8]=j,e[9]=B):B=e[9];const A=B,L=A!==null&&j.split&&!m,$=A===null||L,O=A??a[0]?.path??null,[F,z]=N.useState(null),[G,W]=N.useState(!1);let Y;e[10]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>{z(null),W(!1)},e[10]=Y):Y=e[10];const q=Y;let Q;e[11]!==a||e[12]!==F||e[13]!==m||e[14]!==n||e[15]!==d||e[16]!==T?(Q=()=>{if(F===null)return;const fe=pr(F);if(!fe){q();return}if(fe===pr(n??"")||a.some(ce=>ce.path===fe)){W(!0);return}d(fe),T({app:fe,split:!m}),q()},e[11]=a,e[12]=F,e[13]=m,e[14]=n,e[15]=d,e[16]=T,e[17]=Q):Q=e[17];const K=Q;let ee;e[18]!==n||e[19]!==l?(ee=n?$s(n):l("sandbox.appTabs.root"),e[18]=n,e[19]=l,e[20]=ee):ee=e[20];const H=ee;let J;e[21]!==L||e[22]!==l?(J=l(L?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=L,e[22]=l,e[23]=J):J=e[23];const V=J;let E;e[24]!==l?(E=l("sandbox.appTabs.label"),e[24]=l,e[25]=E):E=e[25];let _;e[26]!==l?(_=l("sandbox.appTabs.main"),e[26]=l,e[27]=_):_=e[27];let D;e[28]!==l?(D=l("sandbox.appTabs.mainHint"),e[28]=l,e[29]=D):D=e[29];let U;e[30]!==T?(U=()=>T(Js),e[30]=T,e[31]=U):U=e[31];let X;e[32]!==w||e[33]!==H||e[34]!==v||e[35]!==$||e[36]!==_||e[37]!==D||e[38]!==U?(X=r.jsx(Nr,{label:H,badge:_,hint:D,ready:v,failed:w,onScreen:$,onSelect:U}),e[32]=w,e[33]=H,e[34]=v,e[35]=$,e[36]=_,e[37]=D,e[38]=U,e[39]=X):X=e[39];let se;if(e[40]!==a||e[41]!==A||e[42]!==w||e[43]!==H||e[44]!==o||e[45]!==v||e[46]!==T||e[47]!==L||e[48]!==l){let fe;e[50]!==A||e[51]!==w||e[52]!==H||e[53]!==o||e[54]!==v||e[55]!==T||e[56]!==L||e[57]!==l?(fe=ce=>{const Re=$s(ce.path);return r.jsx(Nr,{label:Re,hint:l("sandbox.appTabs.extraHint",{app:H}),ready:v,failed:w,onScreen:ce.path===A,onSelect:()=>T({app:ce.path,split:L}),onRemove:()=>o(ce.path),removeLabel:l("sandbox.appTabs.remove",{app:Re})},ce.path)},e[50]=A,e[51]=w,e[52]=H,e[53]=o,e[54]=v,e[55]=T,e[56]=L,e[57]=l,e[58]=fe):fe=e[58],se=a.map(fe),e[40]=a,e[41]=A,e[42]=w,e[43]=H,e[44]=o,e[45]=v,e[46]=T,e[47]=L,e[48]=l,e[49]=se}else se=e[49];let I;e[59]!==X||e[60]!==se||e[61]!==E?(I=r.jsxs("div",{role:"tablist","aria-label":E,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[X,se]}),e[59]=X,e[60]=se,e[61]=E,e[62]=I):I=e[62];let Z;e[63]!==a.length||e[64]!==K||e[65]!==F||e[66]!==G||e[67]!==c||e[68]!==l?(Z=F!==null?r.jsx("form",{className:"w-40 shrink-0",onSubmit:fe=>{fe.preventDefault(),K()},children:r.jsx("input",{autoFocus:!0,value:F,placeholder:"apps/checkout","aria-label":l("sandbox.appTabs.pathLabel"),"aria-invalid":G,onChange:fe=>{z(fe.target.value),W(!1)},onBlur:q,onKeyDown:fe=>{fe.key==="Escape"&&q()},className:Fe("h-7 w-full rounded-md border bg-background px-2 font-mono text-xs outline-none",G?"border-destructive":"border-border")})}):a.length<c&&r.jsx(mt,{label:l("sandbox.appTabs.add"),onClick:()=>z(""),children:r.jsx(Ir,{})}),e[63]=a.length,e[64]=K,e[65]=F,e[66]=G,e[67]=c,e[68]=l,e[69]=Z):Z=e[69];let re;e[70]!==m||e[71]!==T||e[72]!==L||e[73]!==V||e[74]!==O?(re=!m&&O&&r.jsx(mt,{label:V,active:L,onClick:()=>T(L?Js:{app:O,split:!0}),children:r.jsx(Bi,{})}),e[70]=m,e[71]=T,e[72]=L,e[73]=V,e[74]=O,e[75]=re):re=e[75];let ie;e[76]!==I||e[77]!==Z||e[78]!==re?(ie=r.jsxs(r.Fragment,{children:[I,Z,re]}),e[76]=I,e[77]=Z,e[78]=re,e[79]=ie):ie=e[79];const he=ie;let pe;e[80]!==he?(pe=r.jsx(Hs.Topbar.Left.Portal,{fallback:r.jsx("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:he}),children:r.jsx("div",{className:"ml-1 flex min-w-0 items-center gap-1 border-l border-border/60 pl-2",children:he})}),e[80]=he,e[81]=pe):pe=e[81];let be;e[82]!==i||e[83]!==$?(be=$&&r.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:i}),e[82]=i,e[83]=$,e[84]=be):be=e[84];let ge;e[85]!==A||e[86]!==w||e[87]!==f.start||e[88]!==g||e[89]!==H||e[90]!==R||e[91]!==v||e[92]!==T||e[93]!==L||e[94]!==k?(ge=A!==null&&r.jsx(Dd,{name:$s(A),mainName:H,appUrl:R?cl(R,A):null,ready:v,failed:w,notStarted:!g&&!k.includes(A),onStart:f.start,className:Fe(L&&"border-l border-border"),onClose:L?()=>T({app:A,split:!1}):void 0},A),e[85]=A,e[86]=w,e[87]=f.start,e[88]=g,e[89]=H,e[90]=R,e[91]=v,e[92]=T,e[93]=L,e[94]=k,e[95]=ge):ge=e[95];let ve;e[96]!==be||e[97]!==ge?(ve=r.jsxs("div",{className:"flex min-h-0 flex-1",children:[be,ge]}),e[96]=be,e[97]=ge,e[98]=ve):ve=e[98];let Se;return e[99]!==pe||e[100]!==ve?(Se=r.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[pe,ve]}),e[99]=pe,e[100]=ve,e[101]=Se):Se=e[101],Se}function $d(t){return t??Js}function Nr(t){const e=le.c(28),{label:s,badge:n,hint:a,ready:c,failed:d,onScreen:o,onSelect:i,onRemove:l,removeLabel:m}=t,p=o?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground";let f;e[0]!==p?(f=Fe("group/app-tab flex h-7 shrink-0 items-center rounded-md text-xs transition-colors",p),e[0]=p,e[1]=f):f=e[1];const y=c?"bg-success":d?"bg-destructive":"animate-pulse bg-warning";let x;e[2]!==y?(x=Fe("size-1.5 rounded-full",y),e[2]=y,e[3]=x):x=e[3];let b;e[4]!==x?(b=r.jsx("span",{"aria-hidden":!0,className:x}),e[4]=x,e[5]=b):b=e[5];let h;e[6]!==s?(h=r.jsx("span",{className:"max-w-40 truncate",children:s}),e[6]=s,e[7]=h):h=e[7];let g;e[8]!==n?(g=n&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:n}),e[8]=n,e[9]=g):g=e[9];let R;e[10]!==o||e[11]!==i||e[12]!==b||e[13]!==h||e[14]!==g?(R=r.jsx(ht,{asChild:!0,children:r.jsxs("button",{type:"button",role:"tab","aria-selected":o,onClick:i,className:"flex h-full items-center gap-1.5 rounded-md px-2.5 focus-ring",children:[b,h,g]})}),e[10]=o,e[11]=i,e[12]=b,e[13]=h,e[14]=g,e[15]=R):R=e[15];let v;e[16]!==a?(v=r.jsx(gt,{className:"max-w-64",children:a}),e[16]=a,e[17]=v):v=e[17];let w;e[18]!==R||e[19]!==v?(w=r.jsxs(vt,{children:[R,v]}),e[18]=R,e[19]=v,e[20]=w):w=e[20];let C;e[21]!==l||e[22]!==m?(C=l&&r.jsx("button",{type:"button","aria-label":m,onClick:l,className:"-ml-1 mr-1 flex size-5 items-center justify-center rounded opacity-0 hover:bg-sidebar-accent focus-ring focus-visible:opacity-100 group-hover/app-tab:opacity-100",children:r.jsx(ma,{className:"size-3"})}),e[21]=l,e[22]=m,e[23]=C):C=e[23];let k;return e[24]!==w||e[25]!==C||e[26]!==f?(k=r.jsxs("div",{className:f,children:[w,C]}),e[24]=w,e[25]=C,e[26]=f,e[27]=k):k=e[27],k}function Dd(t){const e=le.c(71),{name:s,mainName:n,appUrl:a,ready:c,failed:d,notStarted:o,onStart:i,className:l,onClose:m}=t,p=Ee(),[f,y]=N.useState("/"),[x,b]=N.useState("desktop"),[h,g]=N.useState(0),R=N.useRef(null);let v;e[0]!==a||e[1]!==f?(v=a?dl(a,f):null,e[0]=a,e[1]=f,e[2]=v):v=e[2];const w=v;let C;e[3]!==l?(C=Fe("flex min-h-0 min-w-0 flex-1 flex-col",l),e[3]=l,e[4]=C):C=e[4];let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=D=>{D.preventDefault(),y(R.current?.value||"/")},e[5]=k):k=e[5];let S;e[6]!==s||e[7]!==p?(S=p("sandbox.appPane.path",{app:s}),e[6]=s,e[7]=p,e[8]=S):S=e[8];let j;e[9]!==f||e[10]!==S?(j=r.jsx("form",{className:"min-w-0 flex-1",onSubmit:k,children:r.jsx("input",{ref:R,defaultValue:f,"aria-label":S,className:"h-7 w-full rounded-md border border-border/60 bg-background px-2 font-mono text-xs text-muted-foreground outline-none hover:border-border focus:border-border focus:text-foreground"})}),e[9]=f,e[10]=S,e[11]=j):j=e[11];let T;e[12]!==x||e[13]!==p?(T=p(x==="desktop"?"sandbox.preview.deviceMobile":"sandbox.preview.deviceDesktop"),e[12]=x,e[13]=p,e[14]=T):T=e[14];let B;e[15]===Symbol.for("react.memo_cache_sentinel")?(B=()=>b(Bd),e[15]=B):B=e[15];let A;e[16]!==x?(A=x==="desktop"?r.jsx(Mr,{}):r.jsx(Br,{}),e[16]=x,e[17]=A):A=e[17];let L;e[18]!==T||e[19]!==A?(L=r.jsx(mt,{label:T,onClick:B,children:A}),e[18]=T,e[19]=A,e[20]=L):L=e[20];let $;e[21]!==s||e[22]!==p?($=p("sandbox.appPane.reload",{app:s}),e[21]=s,e[22]=p,e[23]=$):$=e[23];const O=!w||!c;let F,z;e[24]===Symbol.for("react.memo_cache_sentinel")?(F=()=>g(Fd),z=r.jsx(wi,{}),e[24]=F,e[25]=z):(F=e[24],z=e[25]);let G;e[26]!==$||e[27]!==O?(G=r.jsx(mt,{label:$,disabled:O,onClick:F,children:z}),e[26]=$,e[27]=O,e[28]=G):G=e[28];let W;e[29]!==s||e[30]!==p?(W=p("sandbox.appPane.openInNewTab",{app:s}),e[29]=s,e[30]=p,e[31]=W):W=e[31];const Y=!w||!c;let q;e[32]!==w?(q=()=>w&&window.open(w,"_blank","noopener"),e[32]=w,e[33]=q):q=e[33];let Q;e[34]===Symbol.for("react.memo_cache_sentinel")?(Q=r.jsx(Or,{}),e[34]=Q):Q=e[34];let K;e[35]!==W||e[36]!==Y||e[37]!==q?(K=r.jsx(mt,{label:W,disabled:Y,onClick:q,children:Q}),e[35]=W,e[36]=Y,e[37]=q,e[38]=K):K=e[38];let ee;e[39]!==s||e[40]!==m||e[41]!==p?(ee=m&&r.jsx(mt,{label:p("sandbox.appPane.close",{app:s}),onClick:m,children:r.jsx(ma,{})}),e[39]=s,e[40]=m,e[41]=p,e[42]=ee):ee=e[42];let H;e[43]!==G||e[44]!==K||e[45]!==ee||e[46]!==j||e[47]!==L?(H=r.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:[j,L,G,K,ee]}),e[43]=G,e[44]=K,e[45]=ee,e[46]=j,e[47]=L,e[48]=H):H=e[48];let J;e[49]!==n||e[50]!==p?(J=p("sandbox.appPane.previewOnly",{app:n}),e[49]=n,e[50]=p,e[51]=J):J=e[51];let V;e[52]!==J?(V=r.jsx("p",{className:"shrink-0 truncate border-b border-border bg-muted/40 px-3 py-1.5 text-xs text-muted-foreground",children:J}),e[52]=J,e[53]=V):V=e[53];let E;e[54]!==x||e[55]!==d||e[56]!==n||e[57]!==s||e[58]!==o||e[59]!==i||e[60]!==c||e[61]!==h||e[62]!==w||e[63]!==p?(E=r.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:c&&o?r.jsxs("div",{className:"flex flex-col items-center gap-3 self-center px-6 text-center",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:p("sandbox.appPane.notStarted",{app:s})}),r.jsx(_e,{size:"sm",variant:"outline",onClick:i,children:p("sandbox.appPane.start",{app:s})})]}):!c||!w?r.jsx("p",{className:"self-center px-6 text-center text-sm text-muted-foreground",children:c?p("sandbox.appPane.noUrl"):d?p("sandbox.appPane.failed",{app:n}):p("sandbox.appPane.waiting")}):r.jsx("iframe",{src:w,title:s,className:Fe("h-full bg-background",x==="mobile"?"w-[412px] max-w-full border-x border-border":"w-full")},`${w}#${h}`)}),e[54]=x,e[55]=d,e[56]=n,e[57]=s,e[58]=o,e[59]=i,e[60]=c,e[61]=h,e[62]=w,e[63]=p,e[64]=E):E=e[64];let _;return e[65]!==s||e[66]!==C||e[67]!==H||e[68]!==V||e[69]!==E?(_=r.jsxs("section",{"aria-label":s,className:C,children:[H,V,E]}),e[65]=s,e[66]=C,e[67]=H,e[68]=V,e[69]=E,e[70]=_):_=e[70],_}function Fd(t){return t+1}function Bd(t){return t==="desktop"?"mobile":"desktop"}function mt(t){const e=le.c(11),{label:s,children:n,active:a,disabled:c,onClick:d}=t;let o;e[0]!==a||e[1]!==n||e[2]!==c||e[3]!==s||e[4]!==d?(o=r.jsx(ht,{asChild:!0,children:r.jsx(Ze,{"aria-label":s,"aria-pressed":a,active:a,disabled:c,onClick:d,children:n})}),e[0]=a,e[1]=n,e[2]=c,e[3]=s,e[4]=d,e[5]=o):o=e[5];let i;e[6]!==s?(i=r.jsx(gt,{children:s}),e[6]=s,e[7]=i):i=e[7];let l;return e[8]!==o||e[9]!==i?(l=r.jsxs(vt,{children:[o,i]}),e[8]=o,e[9]=i,e[10]=l):l=e[10],l}const Md=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},Id=1e4,zd=1e4,Ud=5e3,Kd=2;function Hd(t,e){return t&&e===0?zd:Math.min(1e3*2**Math.max(0,e-1),Ud)}function Vd(t,e,s){return e?!0:t===!0&&s<Kd}function Wd(t,e){const s=le.c(11),n=Md,a=ki();let c;s[0]!==t?(c=Ys.localAppReachable(t??""),s[0]=t,s[1]=c):c=s[1];const d=c;let o;s[2]!==n||s[3]!==a||s[4]!==d||s[5]!==t?(o=async p=>{const{signal:f}=p,y=new AbortController,x=()=>y.abort();f.addEventListener("abort",x);const b=setTimeout(x,Id),h=await n(t,y.signal).catch(Gd);clearTimeout(b),f.removeEventListener("abort",x);const g=a.getQueryData(d),R=h?0:(g?.failures??0)+1;return{up:Vd(g?.up??null,h,R),failures:R}},s[2]=n,s[3]=a,s[4]=d,s[5]=t,s[6]=o):o=s[6];const i=!!t;let l;s[7]!==d||s[8]!==o||s[9]!==i?(l={queryKey:d,queryFn:o,enabled:i,retry:!1,staleTime:0,gcTime:0,refetchInterval:qd},s[7]=d,s[8]=o,s[9]=i,s[10]=l):l=s[10];const{data:m}=_r(l);return t?m?.up??null:null}function qd(t){return t.state.data?Hd(t.state.data.up,t.state.data.failures):!1}function Gd(){return!1}function Jd(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const s=e.problem;return!s||s.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:s}}return{kind:"connecting"}}function Zu(t){const e=le.c(53),{virtualMcpId:s}=t,n=Ee(),a=zi(s),{connection:c}=ea(s),{activeTask:d,taskId:o,currentBranch:i}=st(),l=xl(o),[m,p]=N.useState(!1),f=zt(s,i);let y;e[0]!==f||e[1]!==c?(y=c?He(f):null,e[0]=f,e[1]=c,e[2]=y):y=e[2];const x=y,b=Wd(x),h=ga(),g=ul("multi_app_preview");if(ml({threadId:o,sandboxBranch:d?.branch??i,agentHasRepo:Ds(a?.metadata),threadHasRepo:Ds(l)||Ds(d?.metadata)})==="none"&&!c){let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:r.jsx(mr,{className:"size-7 text-foreground"})}),e[3]=k):k=e[3];let S;e[4]!==n?(S=n("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=n,e[5]=S):S=e[5];let j;e[6]!==n?(j=n("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=n,e[7]=j):j=e[7];let T,B;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>p(!0),B=r.jsx(mr,{className:"size-4"}),e[8]=T,e[9]=B):(T=e[8],B=e[9]);let A;e[10]!==n?(A=n("mainPanelTabs.previewTab.connectGithub"),e[10]=n,e[11]=A):A=e[11];let L;e[12]!==A?(L=r.jsxs(_e,{onClick:T,children:[B,A]}),e[12]=A,e[13]=L):L=e[13];let $;e[14]!==S||e[15]!==j||e[16]!==L?($=r.jsx(fl,{className:"h-full",image:k,title:S,description:j,actions:L}),e[14]=S,e[15]=j,e[16]=L,e[17]=$):$=e[17];let O;e[18]!==m?(O=r.jsx(pl,{open:m,onOpenChange:p,mode:"agent"}),e[18]=m,e[19]=O):O=e[19];let F;return e[20]!==O||e[21]!==$?(F=r.jsxs(r.Fragment,{children:[$,O]}),e[20]=O,e[21]=$,e[22]=F):F=e[22],F}if(c&&a&&!He(f)){let k;e[23]!==h||e[24]!==f?(k=Jd({backend:f,access:h}),e[23]=h,e[24]=f,e[25]=k):k=e[25];let S;e[26]!==c.endpoint?(S=xo(c.endpoint),e[26]=c.endpoint,e[27]=S):S=e[27];let j;return e[28]!==k||e[29]!==S?(j=r.jsx(Qd,{status:k,host:S}),e[28]=k,e[29]=S,e[30]=j):j=e[30],j}if(x&&b!==!0){let k;e[31]!==n?(k=n("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=n,e[32]=k):k=e[32];let S;e[33]!==x||e[34]!==n?(S=n("mainPanelTabs.previewTab.localAppWaiting.body",{host:Yd(x)}),e[33]=x,e[34]=n,e[35]=S):S=e[35];let j;e[36]!==S?(j=r.jsx(pa,{text:S}),e[36]=S,e[37]=j):j=e[37];let T;e[38]!==n?(T=n("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=n,e[39]=T):T=e[39];let B;e[40]!==T?(B=r.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:T}),e[40]=T,e[41]=B):B=e[41];let A;return e[42]!==k||e[43]!==j||e[44]!==B?(A=r.jsx(us,{headingLevel:2,waiting:!0,title:k,lead:j,footer:B}),e[42]=k,e[43]=j,e[44]=B,e[45]=A):A=e[45],A}let v;e[46]!==s?(v=r.jsx(Ad,{virtualMcpId:s}),e[46]=s,e[47]=v):v=e[47];const w=v;let C;return e[48]!==a||e[49]!==g||e[50]!==w||e[51]!==c?(C=r.jsx(Si,{children:g&&a&&!c?r.jsx(_d,{project:a,maxApps:il,children:w}):w}),e[48]=a,e[49]=g,e[50]=w,e[51]=c,e[52]=C):C=e[52],C}function Yd(t){try{return new URL(t).host}catch{return t}}function Qd(t){const e=le.c(13),{status:s,host:n}=t,a=Ee();if(s.kind==="connected"){let o;e[0]!==a?(o=a("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=a,e[1]=o):o=e[1];let i;e[2]!==a?(i=a("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=a,e[3]=i):i=e[3];let l;return e[4]!==o||e[5]!==i?(l=r.jsx(us,{headingLevel:2,waiting:!1,title:o,lead:i}),e[4]=o,e[5]=i,e[6]=l):l=e[6],l}let c;e[7]!==n||e[8]!==s?(c=Sl(s,n),e[7]=n,e[8]=s,e[9]=c):c=e[9];let d;return e[10]!==n||e[11]!==c?(d=r.jsx(kl,{wait:c,hosts:n}),e[10]=n,e[11]=c,e[12]=d):d=e[12],d}export{kl as L,Zu as P,us as S,Xu as u};
|
|
557
|
+
`)}function Yl(t,e,s=320,n=44,a=12){const{x:c,y:d}=t,{width:o,height:i}=e,l=Math.max(a,Math.min(c-s/2,o-s-a)),p=d/i>.68?Math.max(a,d-n-18):Math.min(d+18,i-n-a);return{leftPct:l/o*100,topPct:p/i*100}}function Ql(t){const e=le.c(45),{element:s,onDismiss:n}=t,[a,c]=N.useState(""),d=N.useRef(null),{sendMessage:o}=Pi(),{openSidePanel:i}=Ho(),l=Ee();let m;e[0]!==s||e[1]!==a||e[2]!==n||e[3]!==i||e[4]!==o?(m=()=>{if(!a.trim())return;const I=Jl(s,a);i(),o({parts:[{type:"text",text:I}]}),n()},e[0]=s,e[1]=a,e[2]=n,e[3]=i,e[4]=o,e[5]=m):m=e[5];const p=m;let f;e[6]!==s.position||e[7]!==s.viewport?(f=Yl(s.position,s.viewport),e[6]=s.position,e[7]=s.viewport,e[8]=f):f=e[8];const y=f,x=`${y.leftPct}%`,b=`${y.topPct}%`;let h;e[9]!==x||e[10]!==b?(h={left:x,top:b,width:"320px"},e[9]=x,e[10]=b,e[11]=h):h=e[11];let g;e[12]!==p?(g=I=>{I.preventDefault(),p()},e[12]=p,e[13]=g):g=e[13];let R;e[14]===Symbol.for("react.memo_cache_sentinel")?(R=I=>c(I.target.value),e[14]=R):R=e[14];let v;e[15]!==n?(v=I=>{I.key==="Escape"&&n()},e[15]=n,e[16]=v):v=e[16];let w;e[17]!==l?(w=l("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=l,e[18]=w):w=e[18];let C;e[19]!==a||e[20]!==v||e[21]!==w?(C=r.jsx("input",{ref:d,autoFocus:!0,type:"text",value:a,onChange:R,onKeyDown:v,placeholder:w,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=a,e[20]=v,e[21]=w,e[22]=C):C=e[22];let k;e[23]!==a?(k=a.trim(),e[23]=a,e[24]=k):k=e[24];const S=!k;let j;e[25]!==l?(j=l("sandbox.visualEditorPrompt.sendButton"),e[25]=l,e[26]=j):j=e[26];let T;e[27]!==l?(T=l("sandbox.visualEditorPrompt.sendButton"),e[27]=l,e[28]=T):T=e[28];let B;e[29]!==T?(B=r.jsx("title",{children:T}),e[29]=T,e[30]=B):B=e[30];let A;e[31]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=A):A=e[31];let L;e[32]!==B?(L=r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[B,A]}),e[32]=B,e[33]=L):L=e[33];let $;e[34]!==S||e[35]!==j||e[36]!==L?($=r.jsx("button",{type:"submit",disabled:S,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:j,children:L}),e[34]=S,e[35]=j,e[36]=L,e[37]=$):$=e[37];let O;e[38]!==C||e[39]!==$||e[40]!==g?(O=r.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:g,children:[C,$]}),e[38]=C,e[39]=$,e[40]=g,e[41]=O):O=e[41];let F;return e[42]!==O||e[43]!==h?(F=r.jsx("div",{className:"absolute z-30 pointer-events-none",style:h,children:O}),e[42]=O,e[43]=h,e[44]=F):F=e[44],F}const br="site-links",Xl=/details?page|\bpdp\b/i,Zl=/listingpage|\bplp\b/i;function ec(t,e,s){const n=new Set;for(const o of s)Xl.test(o)&&n.add("product"),Zl.test(o)&&n.add("category");const a=zt(Zs(t)),c=a[a.length-1],d=a[a.length-2];return c?.type==="text"&&c.text==="/p"&&d?.type==="param"&&d.name===e&&n.add("product"),e==="*"&&a.some(o=>o.type==="param"&&o.name==="*")&&n.add("category"),n}const tc=["rosa","preto","pink","black"];function is(t,e){const s=e.trim();return s?t(s):tc.flatMap(n=>t(n))}function sc(t,e){const s=e.trim(),n=[];/^\d+$/.test(s)&&n.push({resolveType:t,props:{ids:[s]}});const c=s.includes("-")&&!/\s/.test(s)?s.replace(/-+/g," "):s;return n.push({resolveType:t,props:{query:c,count:10}}),n}const va=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function tn(t){return t.split("/")[0]??""}function nc(t){const e=new Set;for(const s of t){const n=tn(s);va.has(n)&&e.add(n)}return e}function rc(t,e){const s=tn(t);return!va.has(s)||e.size===0?!0:e.has(s)}const ac=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>is(s=>sc(t,s),e),optionsFromPayload:os},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>is(s=>[{resolveType:t,props:{props:{search:s,pageSize:10,currentPage:1}}}],e),optionsFromPayload:os},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>is(s=>[{resolveType:t,props:{term:s,hitsPerPage:10}}],e),optionsFromPayload:os},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>is(s=>[{resolveType:t,props:{query:s,term:s,count:10,hitsPerPage:10}}],e),optionsFromPayload:os},{kind:"category",test:t=>t==="vtex/loaders/categories/tree.ts"||/categor(y|ies).*tree/i.test(t),clientFilter:!0,buildRequests:t=>[{resolveType:t,props:{}}],optionsFromPayload:fc}];function ic(t,e,s=new Set){const n=[...e],a=o=>{const i=[];for(const l of ac){if(l.kind!==o)continue;const m=n.find(p=>l.test(p)&&rc(p,s));m&&i.push({cand:l,resolveType:m})}return i.find(l=>s.has(tn(l.resolveType)))??i[0]},c=(o,i,l)=>({kind:o.kind,id:`${o.kind}:${i}`,resolveType:i,clientFilter:o.clientFilter,isFallback:l,buildRequests:m=>o.buildRequests(i,m),optionsFromPayload:o.optionsFromPayload}),d=[];for(const o of["product","category"]){if(!t.has(o))continue;const i=a(o);i&&d.push(c(i.cand,i.resolveType,!1))}return t.size>0&&d.push(oc(t.has("category")?"category":"product")),d}function oc(t){return{kind:t,id:br,resolveType:br,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,s)=>vc(e,s)}}function et(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function lc(t,e,s){const n=new Set,a=new Set,c=d=>{if(Array.isArray(d)){for(const l of d)c(l);return}const o=et(d);if(!o)return;const i=o.__resolveType;if(typeof i=="string"){if(s(i))n.add(i);else if(i in e&&!a.has(i)){a.add(i);const l=et(e[i])?.__resolveType;typeof l=="string"&&s(l)&&n.add(i),c(e[i])}}for(const l of Object.values(o))c(l)};return c(t),n}function xa(t){const e=new Set,s=[];for(const n of t)for(const a of n)e.has(a.value)||(e.add(a.value),s.push(a));return s}function ba(t){try{return decodeURIComponent(t)}catch{return t}}function cc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dc(t){const e=[];let s="^";for(const n of t)n.type==="text"?s+=cc(n.text):(e.push(n.name),s+=n.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${s}$`),order:e}}function ya(t,e,s){if(typeof t!="string"||!t)return null;let n;try{n=new URL(t,"https://placeholder.invalid").pathname}catch{return null}n=n.replace(/\/+$/,"");const a=zt(Zs(e)),{pattern:c,order:d}=dc(a),o=d.indexOf(s);if(o===-1)return null;const i=n.match(c);if(!i)return null;const l=i[o+1]?.replace(/^\/+|\/+$/g,"");return l?ba(l):null}function os(t,e){const s=et(t),n=Array.isArray(t)?t:Array.isArray(s?.products)?s.products:Array.isArray(s?.list)?s.list:[],a=[],c=new Set;for(const d of n){const o=et(d);if(!o)continue;const i=ya(o.url,e.template,e.paramName);if(!i||c.has(i))continue;c.add(i);const l=et(o.isVariantOf),m=typeof l?.name=="string"&&l.name||typeof o.name=="string"&&o.name||i,p=Array.isArray(o.image)?et(o.image[0]):null,f=typeof p?.url=="string"?p.url:void 0;a.push({value:i,label:m,image:f})}return a}function uc(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const s=e.replace(/^\/+|\/+$/g,"");return s?ba(s):null}function fc(t){const e=[],s=new Set,n=(a,c)=>{const d=et(a);if(!d)return;const o=typeof d.name=="string"&&d.name?d.name:"",i=o?[...c,o]:c,l=uc(d.url);if(l&&!s.has(l)&&(s.add(l),e.push({value:l,label:i.join(" › ")||l})),Array.isArray(d.children))for(const m of d.children)n(m,i)};if(Array.isArray(t))for(const a of t)n(a,[]);return e}const pc=new Set(["login","logout","signin","sign-in","signup","sign-up","register","account","myaccount","my-account","minha-conta","conta","cart","carrinho","checkout","wishlist","favoritos","favorites","orders","pedidos","help","hc","sac","atendimento","contato","contact","institucional","newsletter","customer","sales","catalogsearch","search","busca","privacy-policy-cookie-restriction-mode"]);function mc(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,s=>s.toUpperCase())}function hc(t){if(typeof t!="string"||!t)return[];const e=[],s=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let n,a=0;for(;(n=s.exec(t))!==null&&a++<5e3;){const c=n[1]??"",d=(n[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:c,text:d})}return e}function gc(t){if(typeof t!="string"||!t)return[];const e=[],s=new Set,n=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,a=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let c,d=0;for(;(c=n.exec(t))!==null&&d++<3e3;){const o=(c[1]??"").replace(/\\\//g,"/");if(!o||s.has(o))continue;s.add(o);const i=t.slice(c.index,c.index+900).match(a)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:c[2]??"",image:i||void 0})}return e}function vc(t,e){const s=[],n=new Set,a=(c,d,o,i)=>{if(s.length>=200)return;const l=ya(c,e.template,e.paramName);!l||n.has(l)||e.paramName==="*"&&/(^|\/)p$/.test(l)||o==="category"&&pc.has(l.split("/")[0]??"")||(n.add(l),s.push({value:l,label:d&&d.length<=80?d:mc(l),kind:o,image:i}))};for(const{url:c,name:d,image:o}of gc(t))a(c,d,"product",o);for(const{href:c,text:d}of hc(t))c.startsWith("/")&&!c.startsWith("//")&&a(c,d,"category");return s}function Ft(t,e,s=50){const n=e.trim().toLowerCase();return(n?t.filter(c=>c.label.toLowerCase().includes(n)||c.value.toLowerCase().includes(n)):t).slice(0,s)}const wa=1e4;function xc(t){return{product:{noun:t("sandbox.pathParamPickerChip.kindProductNoun"),heading:t("sandbox.pathParamPickerChip.kindProductHeading")},category:{noun:t("sandbox.pathParamPickerChip.kindCategoryNoun"),heading:t("sandbox.pathParamPickerChip.kindCategoryHeading")}}}async function bc(t,{resolveType:e,props:s}){const n=await fetch(Xi(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...s}),signal:AbortSignal.timeout(wa)});if(!n.ok)throw new Error(`Failed to fetch options: ${n.status}`);return n.json()}async function yr(t,e){const s=await fetch(Zi(t,e),{signal:AbortSignal.timeout(wa)});if(!s.ok)throw new Error(`Failed to fetch page: ${s.status}`);return s.text()}async function yc(t,e,s){const n=e.optionsFromPayload(await yr(t,"/"),s),a=n.find(d=>d.kind==="category");if(!a)return n;const c=Ve(s.template,{[s.paramName]:a.value});if(c==="/")return n;try{const d=e.optionsFromPayload(await yr(t,c),s).filter(o=>o.kind==="product");return xa([n,d])}catch{return n}}function wc(t,e,s){return Ys.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":s}`)}async function kc(t,e,s,n){if(e.homepageLinks)return yc(t,e,n);const a=e.buildRequests?.(s)??[];if(a.length===0)return[];const c=await Promise.allSettled(a.map(o=>bc(t,o))),d=c.filter(o=>o.status==="fulfilled").map(o=>o.value);if(d.length===0){const o=c.find(i=>i.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return xa(d.map(o=>e.optionsFromPayload(o,n)))}function Gs(t,e,s,n,a){return{queryKey:wc(t,e,s),queryFn:()=>kc(t,e,s,n),enabled:a,staleTime:6e4,retry:1}}function Bt(t){const e=le.c(16),{heading:s,iconKind:n,options:a,template:c,paramName:d,keyPrefix:o,onSelect:i}=t;if(a.length===0)return null;let l;if(e[0]!==n||e[1]!==o||e[2]!==i||e[3]!==a||e[4]!==d||e[5]!==c){let p;e[7]!==n||e[8]!==o||e[9]!==i||e[10]!==d||e[11]!==c?(p=f=>r.jsxs(pt,{value:`${o}:${f.value}`,className:"gap-3 py-2",onSelect:()=>i(f.value),children:[n==="product"&&r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.image?r.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):r.jsx(Fr,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:f.label}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Ve(c,{[d]:f.value})})]})]},`${o}:${f.value}`),e[7]=n,e[8]=o,e[9]=i,e[10]=d,e[11]=c,e[12]=p):p=e[12],l=a.map(p),e[0]=n,e[1]=o,e[2]=i,e[3]=a,e[4]=d,e[5]=c,e[6]=l}else l=e[6];let m;return e[13]!==s||e[14]!==l?(m=r.jsx(ft,{heading:s,children:l}),e[13]=s,e[14]=l,e[15]=m):m=e[15],m}function wr(t){const e=le.c(2),{text:s}=t;let n;return e[0]!==s?(n=r.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1],n}function Sc(t){const e=le.c(52),{sources:s,template:n,paramName:a,value:c,sandboxRef:d,onCommit:o}=t,i=Ee(),[l,m]=N.useState(!1),[p,f]=N.useState(""),[y,x]=N.useState(""),b=N.useRef(null),h=a==="*"?i("sandbox.preview.catchAllParamLabel"):`:${a}`,g=xc(i),v=[...new Set(s.map(ne=>g[ne.kind].noun))].join(" or ");let w;e[0]!==i||e[1]!==v?(w=i("sandbox.pathParamPickerChip.searchPlaceholder",{options:v}),e[0]=i,e[1]=v,e[2]=w):w=e[2];const C=w,k={template:n,paramName:a};let S;e[3]!==p?(S=(ne,de)=>({source:ne,query:de,options:ne.clientFilter?Ft(de.data??[],p):de.data??[]}),e[3]=p,e[4]=S):S=e[4];const j=S,T=s.filter(Lc),B=s.filter(Rc),A=Vs({queries:T.map(ne=>Gs(d,ne,y,k,l))});let L;e[5]!==A||e[6]!==j?(L=(ne,de)=>j(ne,A[de]),e[5]=A,e[6]=j,e[7]=L):L=e[7];const $=T.map(L),O=$.length===0||$.every(Cc),F=Vs({queries:B.map(ne=>Gs(d,ne,y,k,l&&O))});let I;e[8]!==F||e[9]!==j?(I=(ne,de)=>j(ne,F[de]),e[8]=F,e[9]=j,e[10]=I):I=e[10];const G=B.map(I),W=O?G:$,Y=W.length===1&&W[0]?.source.homepageLinks?W[0]:null,Q=Y&&!Y.query.isLoading&&!Y.query.isError?Y?.query.data??[]:[],K=Ft(Q.filter(Tc),p),ee=Ft(Q.filter(Nc),p),H=K.length>0&&ee.length>0,J=ne=>{m(ne),b.current&&clearTimeout(b.current),f(ne?c:""),x(ne?c:"")};let V;e[11]===Symbol.for("react.memo_cache_sentinel")?(V=ne=>{f(ne),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{x(ne)},300)},e[11]=V):V=e[11];const E=V,_=ne=>{o(ne),J(!1)},D=sa(p),U=Ve(n,{[a]:D}),X=Cr,se=Tr,z="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",Z=Ec;let re;e[12]!==h||e[13]!==i?(re=i("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:h}),e[12]=h,e[13]=i,e[14]=re):re=e[14];let ie;e[15]!==re?(ie=r.jsx(Rr,{className:"sr-only",children:r.jsx(Lr,{children:re})}),e[15]=re,e[16]=ie):ie=e[16];let he;e[17]===Symbol.for("react.memo_cache_sentinel")?(he=r.jsx(Fr,{size:16,className:"shrink-0 text-foreground"}),e[17]=he):he=e[17];let pe;e[18]!==i?(pe=i("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=i,e[19]=pe):pe=e[19];let be;e[20]!==h?(be=r.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:h}),e[20]=h,e[21]=be):be=e[21];let ge;e[22]!==pe||e[23]!==be?(ge=r.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[he,r.jsxs("span",{className:"text-sm font-medium text-foreground",children:[pe," ",be]})]}),e[22]=pe,e[23]=be,e[24]=ge):ge=e[24];const ve=Vr,Se=!1,fe="min-h-0 flex-1";let ce;e[25]!==C||e[26]!==p?(ce=r.jsx(Wr,{autoFocus:!0,placeholder:C,value:p,onValueChange:E}),e[25]=C,e[26]=p,e[27]=ce):ce=e[27];const Re=Hr,ze="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Ie;e[28]!==i?(Ie=i("sandbox.pathParamPickerChip.noResults"),e[28]=i,e[29]=Ie):Ie=e[29];let Be;e[30]!==Ie?(Be=r.jsx(qr,{children:Ie}),e[30]=Ie,e[31]=Be):Be=e[31];const bt=D&&r.jsx(ft,{className:"shrink-0",children:r.jsxs(pt,{value:`__raw__:${D}`,className:"gap-3 py-2",onSelect:()=>_(D),children:[r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:r.jsx(qo,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:i("sandbox.pathParamPickerChip.useRawValue",{rawTerm:D,paramLabel:h})}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:U})]})]})}),me=H?r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:r.jsx(Bt,{heading:g.category.heading,iconKind:"category",options:K,template:n,paramName:a,keyPrefix:`${Y?.source.id}:cat`,onSelect:_})}),r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r.jsx(Bt,{heading:g.product.heading,iconKind:"product",options:ee,template:n,paramName:a,keyPrefix:`${Y?.source.id}:prod`,onSelect:_})})]}):r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:W.map(ne=>{const{source:de,query:We,options:yt}=ne,{noun:qe}=g[de.kind];if(We.isLoading)return r.jsx(wr,{text:i("sandbox.pathParamPickerChip.loading",{noun:qe})},de.id);if(We.isError)return r.jsx(wr,{text:i("sandbox.pathParamPickerChip.couldNotLoad")},de.id);if(de.homepageLinks){const Ut=We.data??[];return r.jsxs(N.Fragment,{children:[r.jsx(Bt,{heading:g.category.heading,iconKind:"category",options:Ft(Ut.filter(jc),p),template:n,paramName:a,keyPrefix:`${de.id}:cat`,onSelect:_}),r.jsx(Bt,{heading:g.product.heading,iconKind:"product",options:Ft(Ut.filter(Pc),p),template:n,paramName:a,keyPrefix:`${de.id}:prod`,onSelect:_})]},de.id)}return r.jsx(Bt,{heading:W.length>1?g[de.kind].heading:void 0,iconKind:de.kind,options:yt,template:n,paramName:a,keyPrefix:de.id,onSelect:_},de.id)})});let Oe;e[32]!==Re||e[33]!==Be||e[34]!==bt||e[35]!==me?(Oe=r.jsxs(Re,{className:ze,children:[Be,bt,me]}),e[32]=Re,e[33]=Be,e[34]=bt,e[35]=me,e[36]=Oe):Oe=e[36];let xe;e[37]!==ve||e[38]!==ce||e[39]!==Oe?(xe=r.jsxs(ve,{shouldFilter:Se,className:fe,children:[ce,Oe]}),e[37]=ve,e[38]=ce,e[39]=Oe,e[40]=xe):xe=e[40];let Ue;e[41]!==se||e[42]!==ie||e[43]!==ge||e[44]!==xe||e[45]!==Z?(Ue=r.jsxs(se,{className:z,onClick:Z,children:[ie,ge,xe]}),e[41]=se,e[42]=ie,e[43]=ge,e[44]=xe,e[45]=Z,e[46]=Ue):Ue=e[46];let Le;return e[47]!==X||e[48]!==J||e[49]!==l||e[50]!==Ue?(Le=r.jsx(X,{open:l,onOpenChange:J,children:Ue}),e[47]=X,e[48]=J,e[49]=l,e[50]=Ue,e[51]=Le):Le=e[51],r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",title:i("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:h}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-xs text-special hover:bg-special/25",onClick:ne=>{ne.stopPropagation(),J(!0)},children:c||h}),Le]})}function Pc(t){return t.kind==="product"}function jc(t){return t.kind!=="product"}function Ec(t){return t.stopPropagation()}function Nc(t){return t.kind==="product"}function Tc(t){return t.kind!=="product"}function Cc(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Rc(t){return t.isFallback}function Lc(t){return!t.isFallback}function Ac(t){const e=le.c(8),{sources:s,template:n,paramName:a,sandboxRef:c,onFill:d}=t;let o,i;if(e[0]!==a||e[1]!==c||e[2]!==s||e[3]!==n){const y={template:n,paramName:a},x=s.filter(_c);i=Vs,o=x.map(b=>Gs(c,b,"",y,!0)),e[0]=a,e[1]=c,e[2]=s,e[3]=n,e[4]=o,e[5]=i}else o=e[4],i=e[5];let l;e[6]!==o?(l={queries:o},e[6]=o,e[7]=l):l=e[7];const m=i(l),[p,f]=N.useState(!1);if(!p)for(const y of m){if(y.isLoading)break;const x=y.data?.[0];if(x){f(!0),queueMicrotask(()=>d(x.value));break}}return null}function _c(t){return!t.isFallback}function Oc(t){const e=le.c(31),{name:s,value:n,onCommit:a}=t,c=Ee(),[d,o]=N.useState(n),[i,l]=N.useState(!1),m=N.useRef(!1);let p;e[0]!==s||e[1]!==c?(p=s==="*"?c("sandbox.preview.catchAllParamLabel"):`:${s}`,e[0]=s,e[1]=c,e[2]=p):p=e[2];const f=p,y=d||f;let x;e[3]!==y?(x=r.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:y}),e[3]=y,e[4]=x):x=e[4];let b;e[5]!==f||e[6]!==c?(b=c("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=c,e[7]=b):b=e[7];let h,g;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=j=>o(j.target.value),g=()=>l(!0),e[8]=h,e[9]=g):(h=e[8],g=e[9]);let R;e[10]!==n?(R=j=>{j.key==="Enter"&&j.currentTarget.blur(),j.key==="Escape"&&(m.current=!0,o(n),j.currentTarget.blur())},e[10]=n,e[11]=R):R=e[11];let v;e[12]!==d||e[13]!==a||e[14]!==n?(v=()=>{if(l(!1),m.current){m.current=!1;return}const j=sa(d);o(j),j!==n&&a(j)},e[12]=d,e[13]=a,e[14]=n,e[15]=v):v=e[15];let w;e[16]!==d||e[17]!==f||e[18]!==b||e[19]!==R||e[20]!==v?(w=r.jsx("input",{type:"text",value:d,placeholder:f,title:b,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-xs text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:$c,onChange:h,onFocus:g,onKeyDown:R,onBlur:v}),e[16]=d,e[17]=f,e[18]=b,e[19]=R,e[20]=v,e[21]=w):w=e[21];let C;e[22]!==x||e[23]!==w?(C=r.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[x,w]}),e[22]=x,e[23]=w,e[24]=C):C=e[24];let k;e[25]!==i||e[26]!==c?(k=i&&r.jsxs("span",{className:"pointer-events-none ml-1.5 flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-border bg-muted px-1 py-0.5 text-2xs text-muted-foreground",children:[r.jsx(Li,{size:10}),c("sandbox.preview.enterToGo")]}),e[25]=i,e[26]=c,e[27]=k):k=e[27];let S;return e[28]!==k||e[29]!==C?(S=r.jsxs(r.Fragment,{children:[C,k]}),e[28]=k,e[29]=C,e[30]=S):S=e[30],S}function $c(t){return t.stopPropagation()}function Dc(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const s=new URL(e),n=t.resolvedPath==="/"?"":t.resolvedPath;return`${s.host}${n}`}catch{return e}}function Fc(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Bc(t){return t.showPreviewToolbar&&t.contentEditingEnabled}function Mc(t){return t.v8?null:t.production||t.localPreview?{type:"editor::inject",args:{script:t.script}}:{type:"visual-editor::activate",script:t.script}}function zc(t){return t.v8?null:{type:"visual-editor::activate",script:t.script}}class ka extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function Ic(t,e){if(t)return t;const s=await e?.().catch(()=>null);if(!s)throw new ka;return s}async function Uc(t,e,s){return s?lr(t,e,await Ic(s.meta,s.loadMeta)):lr(t,e)}function Kc(t){const e=le.c(5);let s;e[0]!==t?(s=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=s):s=e[1];const n=ia(s);let a;return e[2]!==t||e[3]!==n?(a={mutationFn:async c=>{const{name:d,path:o,template:i,schema:l}=c;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const m=$o(d),p=i?{...i,name:d,path:o}:await Uc(d,o,l);return await n.mutateAsync({blockKey:m,data:p}),{key:m,name:d,path:o}}},e[2]=t,e[3]=n,e[4]=a):a=e[4],gi(a)}function Hc(t){const e=le.c(89),{open:s,onOpenChange:n,isPending:a,error:c,templates:d,onSubmit:o}=t,i=a===void 0?!1:a,l=Ee();let m;e[0]!==l?(m=l("sectionsEditor.createPageModal.defaultPageName"),e[0]=l,e[1]=m):m=e[1];const[p,f]=N.useState(m);let y;e[2]!==l?(y=l("sectionsEditor.createPageModal.defaultPagePath"),e[2]=l,e[3]=y):y=e[3];const[x,b]=N.useState(y),[h,g]=N.useState(_s),[R,v]=N.useState(null),[w,C]=N.useState(s);s!==w&&(C(s),s&&(f(l("sectionsEditor.createPageModal.defaultPageName")),b(l("sectionsEditor.createPageModal.defaultPagePath")),g(_s),v(null)));const k=!!d?.length;let S;e[4]!==i||e[5]!==n?(S=pe=>{!pe&&!i&&(v(null),n(!1))},e[4]=i,e[5]=n,e[6]=S):S=e[6];const j=S;let T;e[7]!==i||e[8]!==p||e[9]!==o||e[10]!==x||e[11]!==k||e[12]!==h?(T=async pe=>{pe.preventDefault();const be=p.trim(),ge=x.trim();if(!be||!ge||i)return;const ve=na(ge);if(ve){v(ve);return}v(null),await o({name:be,path:ge,templateKey:k&&h!==_s?h:null})},e[7]=i,e[8]=p,e[9]=o,e[10]=x,e[11]=k,e[12]=h,e[13]=T):T=e[13];const B=T,A=R??c;let L;e[14]!==l?(L=l("sectionsEditor.createPageModal.title"),e[14]=l,e[15]=L):L=e[15];let $;e[16]!==L?($=r.jsx(Rr,{children:r.jsx(Lr,{children:L})}),e[16]=L,e[17]=$):$=e[17];let O;e[18]!==l?(O=l("sectionsEditor.createPageModal.nameLabel"),e[18]=l,e[19]=O):O=e[19];let F;e[20]!==O?(F=r.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:O}),e[20]=O,e[21]=F):F=e[21];let I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I=pe=>f(pe.target.value),e[22]=I):I=e[22];let G;e[23]!==l?(G=l("sectionsEditor.createPageModal.namePlaceholder"),e[23]=l,e[24]=G):G=e[24];let W;e[25]!==i||e[26]!==p||e[27]!==G?(W=r.jsx(Is,{id:"new-page-name",value:p,onChange:I,placeholder:G,autoFocus:!0,disabled:i}),e[25]=i,e[26]=p,e[27]=G,e[28]=W):W=e[28];let Y;e[29]!==W||e[30]!==F?(Y=r.jsxs("div",{className:"space-y-1.5",children:[F,W]}),e[29]=W,e[30]=F,e[31]=Y):Y=e[31];let q;e[32]!==l?(q=l("sectionsEditor.createPageModal.pathLabel"),e[32]=l,e[33]=q):q=e[33];let Q;e[34]!==q?(Q=r.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:q}),e[34]=q,e[35]=Q):Q=e[35];let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=pe=>b(pe.target.value),e[36]=K):K=e[36];let ee;e[37]!==l?(ee=l("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=l,e[38]=ee):ee=e[38];let H;e[39]!==i||e[40]!==x||e[41]!==ee?(H=r.jsx(Is,{id:"new-page-path",value:x,onChange:K,placeholder:ee,disabled:i}),e[39]=i,e[40]=x,e[41]=ee,e[42]=H):H=e[42];let J;e[43]!==Q||e[44]!==H?(J=r.jsxs("div",{className:"space-y-1.5",children:[Q,H]}),e[43]=Q,e[44]=H,e[45]=J):J=e[45];let V;e[46]!==i||e[47]!==k||e[48]!==l||e[49]!==h||e[50]!==d?(V=k&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.createPageModal.templateLabel")}),r.jsx(Do,{id:"new-page-template",value:h,onChange:g,templates:d??[],disabled:i})]}),e[46]=i,e[47]=k,e[48]=l,e[49]=h,e[50]=d,e[51]=V):V=e[51];let E;e[52]!==A?(E=A&&r.jsx("p",{className:"text-xs text-destructive",children:A}),e[52]=A,e[53]=E):E=e[53];let _;e[54]!==Y||e[55]!==J||e[56]!==V||e[57]!==E?(_=r.jsxs("div",{className:"space-y-4 py-4",children:[Y,J,V,E]}),e[54]=Y,e[55]=J,e[56]=V,e[57]=E,e[58]=_):_=e[58];let D;e[59]!==n?(D=()=>n(!1),e[59]=n,e[60]=D):D=e[60];let U;e[61]!==l?(U=l("sectionsEditor.createPageModal.cancelButton"),e[61]=l,e[62]=U):U=e[62];let X;e[63]!==i||e[64]!==D||e[65]!==U?(X=r.jsx(_e,{type:"button",variant:"outline",onClick:D,disabled:i,children:U}),e[63]=i,e[64]=D,e[65]=U,e[66]=X):X=e[66];let se;e[67]!==i||e[68]!==p||e[69]!==x?(se=!p.trim()||!x.trim()||i,e[67]=i,e[68]=p,e[69]=x,e[70]=se):se=e[70];let z;e[71]!==i||e[72]!==l?(z=i?r.jsxs(r.Fragment,{children:[r.jsx(tt,{className:"size-3.5"}),l("sectionsEditor.createPageModal.creatingButton")]}):l("sectionsEditor.createPageModal.createButton"),e[71]=i,e[72]=l,e[73]=z):z=e[73];let Z;e[74]!==se||e[75]!==z?(Z=r.jsx(_e,{type:"submit",disabled:se,children:z}),e[74]=se,e[75]=z,e[76]=Z):Z=e[76];let re;e[77]!==X||e[78]!==Z?(re=r.jsxs(vi,{children:[X,Z]}),e[77]=X,e[78]=Z,e[79]=re):re=e[79];let ie;e[80]!==B||e[81]!==_||e[82]!==re||e[83]!==$?(ie=r.jsx(Tr,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:B,children:[$,_,re]})}),e[80]=B,e[81]=_,e[82]=re,e[83]=$,e[84]=ie):ie=e[84];let he;return e[85]!==j||e[86]!==s||e[87]!==ie?(he=r.jsx(Cr,{open:s,onOpenChange:j,children:ie}),e[85]=j,e[86]=s,e[87]=ie,e[88]=he):he=e[88],he}function Vc(t){const e=le.c(41),{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:c,meta:d,decofile:o,blockKey:i}=t,l=Ee();let m;e[0]!==a||e[1]!==s||e[2]!==n?(m={orgSlug:s,virtualMcpId:n,branch:a},e[0]=a,e[1]=s,e[2]=n,e[3]=m):m=e[3];const p=ia(m);let f;e[4]!==p?(f=j=>p.mutate(j),e[4]=p,e[5]=f):f=e[5];let y;e[6]!==o||e[7]!==p.v8||e[8]!==f?(y=Go(f,o,p.v8),e[6]=o,e[7]=p.v8,e[8]=f,e[9]=y):y=e[9];const x=y;let b;e[10]!==i||e[11]!==o?(b=Fo(o,i),e[10]=i,e[11]=o,e[12]=b):b=e[12];const{resolveType:h,props:g,title:R}=b;if(!h){let j;e[13]!==l?(j=l("sandbox.preview.loaderNoLongerExists"),e[13]=l,e[14]=j):j=e[14];let T;return e[15]!==j?(T=r.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:j}),e[15]=j,e[16]=T):T=e[16],T}const v=`loader:${i}`,w=`loader:${i}`;let C;e[17]!==i||e[18]!==h||e[19]!==R?(C={mode:"saved",blockKey:i,resolveType:h,title:R},e[17]=i,e[18]=h,e[19]=R,e[20]=C):C=e[20];let k;e[21]!==a||e[22]!==o||e[23]!==d||e[24]!==s||e[25]!==c||e[26]!==g||e[27]!==p.isPending||e[28]!==x||e[29]!==w||e[30]!==C||e[31]!==n?(k=r.jsx(Bo,{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:c,meta:d,decofile:o,kind:"loaders",target:C,initialValue:g,isCreating:p.isPending,onCreate:Wc,onSaveReferencedBlock:x,showRun:!1},w),e[21]=a,e[22]=o,e[23]=d,e[24]=s,e[25]=c,e[26]=g,e[27]=p.isPending,e[28]=x,e[29]=w,e[30]=C,e[31]=n,e[32]=k):k=e[32];let S;return e[33]!==i||e[34]!==a||e[35]!==o||e[36]!==s||e[37]!==v||e[38]!==k||e[39]!==n?(S=r.jsx(Jo,{listing:o,orgSlug:s,virtualMcpId:n,branch:a,blockKey:i,present:void 0,children:k},v),e[33]=i,e[34]=a,e[35]=o,e[36]=s,e[37]=v,e[38]=k,e[39]=n,e[40]=S):S=e[40],S}async function Wc(){}function qc(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function kr(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:qc(t.error)}}function Gc(t){switch(t){case"clone-failed":case"install-failed":case"start-failed":return"terminal-error";case"idle":case"cloning":return"booting";case"checking-out":case"installing":case"starting":case"running":case"crashed":return"snapshot-readable"}}function Jc(t){if(t.fastPreviewActive)return t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData?{kind:"error",source:"data"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"};const e=Gc(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const s=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return s&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(a=>a.status==="error"&&!a.hasData&&a.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:s?t.lifecyclePhase==="running"||t.lifecyclePhase==="crashed"?{kind:"error",source:"data"}:{kind:"loading"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"}}const Yc=N.lazy(()=>xi(()=>import("./sections-editor-3egytFfS.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.SectionsEditor})));function Sr(t){const e=le.c(62),{virtualMcpId:s,externalSelection:n,onSectionPicked:a,onViewJsonFile:c}=t,d=n===void 0?null:n,{org:o}=fs(),{currentBranch:i,taskId:l}=st(),m=en(),p=xt(),f=la(),y=m.lifecycle.phase==="running",x=p.previewUrl;let b;e[0]!==i||e[1]!==o||e[2]!==x||e[3]!==l||e[4]!==s?(b=i?{orgSlug:o.slug,virtualMcpId:s,branch:i,threadId:l??null,previewUrl:x}:null,e[0]=i,e[1]=o,e[2]=x,e[3]=l,e[4]=s,e[5]=b):b=e[5];const h=b,g=It(s,i);let R;e[6]!==y?(R={fetchEnabled:y},e[6]=y,e[7]=R):R=e[7];const v=ps(h,R),w=Jr(h);let C;e[8]!==y?(C={fetchEnabled:y},e[8]=y,e[9]=C):C=e[9];const k=ra(h,C),S=Jc({lifecyclePhase:m.lifecycle.phase,decofile:kr(v),meta:kr(k),hasEditableContent:yo(v.data,k.data),fastPreviewActive:Gr(s).runtime==="cms"||Xe(g)}),j=Qs()===void 0,T=Qc;if(wo(g)){let E;return e[10]===Symbol.for("react.memo_cache_sentinel")?(E=T(r.jsx(So,{})),e[10]=E):E=e[10],E}if(g.kind==="pending"&&g.retrying){let E;return e[11]!==g?(E=T(r.jsx(Po,{backend:g})),e[11]=g,e[12]=E):E=e[12],E}if(S.kind==="loading"||j){let E;return e[13]===Symbol.for("react.memo_cache_sentinel")?(E=T(r.jsx(bi,{})),e[13]=E):E=e[13],E}if(v.data&&eo(k.data)){const E=f.state.target,_=E?.kind==="page"||E?.kind==="section"?E.key:null,D=g.kind==="legacy"?_??"":`${w}:${_??""}`,U=i??"";let X;return e[14]!==v.data||e[15]!==_||e[16]!==o.slug||e[17]!==D||e[18]!==U||e[19]!==s?(X=T(r.jsx(Mo,{orgSlug:o.slug,virtualMcpId:s,branch:U,decofile:v.data,initialKey:_,compact:!0},D)),e[14]=v.data,e[15]=_,e[16]=o.slug,e[17]=D,e[18]=U,e[19]=s,e[20]=X):X=e[20],X}if(S.kind==="empty"){let E;return e[21]===Symbol.for("react.memo_cache_sentinel")?(E=T(r.jsx(jo,{})),e[21]=E):E=e[21],E}if(S.kind==="error"){let E;e[22]!==v||e[23]!==p||e[24]!==k||e[25]!==S.source?(E=()=>{if(S.source==="sandbox"){p.retry();return}Promise.all([v.refetch(),k.refetch()])},e[22]=v,e[23]=p,e[24]=k,e[25]=S.source,e[26]=E):E=e[26];const _=E;let D;return e[27]!==_||e[28]!==S.source?(D=T(r.jsx(ko,{source:S.source,onRetry:_})),e[27]=_,e[28]=S.source,e[29]=D):D=e[29],D}let B;e[30]===Symbol.for("react.memo_cache_sentinel")?(B=E=>T(r.jsx("div",{className:"h-full min-h-0",children:E})),e[30]=B):B=e[30];const A=B,L=f.state.target;if(L?.kind==="loader"&&v.data&&k.data){const E=g.kind==="legacy"?void 0:w,_=i??"",D=x??null;let U;return e[31]!==v.data||e[32]!==k.data||e[33]!==o.slug||e[34]!==E||e[35]!==_||e[36]!==D||e[37]!==L.key||e[38]!==s?(U=A(r.jsx(Vc,{orgSlug:o.slug,virtualMcpId:s,branch:_,previewUrl:D,meta:k.data,decofile:v.data,blockKey:L.key},E)),e[31]=v.data,e[32]=k.data,e[33]=o.slug,e[34]=E,e[35]=_,e[36]=D,e[37]=L.key,e[38]=s,e[39]=U):U=e[39],U}let $;e[40]!==i||e[41]!==o.slug||e[42]!==L||e[43]!==s?($=L||!i?null:$r(Dr(o.slug,s,i)),e[40]=i,e[41]=o.slug,e[42]=L,e[43]=s,e[44]=$):$=e[44];const O=$;let F="/",I=null,G=null;L?.kind==="page"?(F=L.path,I=L.key):L?.kind==="section"?G=L.key:O&&(F=O.path,I=O.pageKey);const W=I?`page:${I}`:G?`section:${G}`:`path:${F}`;let Y;e[45]===Symbol.for("react.memo_cache_sentinel")?(Y=r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(tt,{className:"size-5 text-muted-foreground"})}),e[45]=Y):Y=e[45];const q=g.kind==="legacy"?W:`${w}:${W}`,Q=i??"",K=x??void 0,ee=G?null:d,H=G?void 0:a,J=!!I&&f.state.editSeoPageKey===I;let V;return e[46]!==G||e[47]!==I||e[48]!==F||e[49]!==c||e[50]!==o.slug||e[51]!==K||e[52]!==ee||e[53]!==H||e[54]!==J||e[55]!==q||e[56]!==Q||e[57]!==s||e[58]!==f.consumeEditSeo||e[59]!==f.setFocusedBlock||e[60]!==f.setVariantOverride?(V=A(r.jsx(N.Suspense,{fallback:Y,children:r.jsx(Yc,{orgSlug:o.slug,virtualMcpId:s,branch:Q,previewReady:!0,previewUrl:K,currentPath:F,activePageBlockKey:I,activeGlobalBlockKey:G,externalSelection:ee,onSectionPicked:H,initialEditSeo:J,onExitSeo:f.consumeEditSeo,onVariantPreviewOverride:f.setVariantOverride,onFocusedBlockChange:f.setFocusedBlock,onViewJsonFile:c},q)})),e[46]=G,e[47]=I,e[48]=F,e[49]=c,e[50]=o.slug,e[51]=K,e[52]=ee,e[53]=H,e[54]=J,e[55]=q,e[56]=Q,e[57]=s,e[58]=f.consumeEditSeo,e[59]=f.setFocusedBlock,e[60]=f.setVariantOverride,e[61]=V):V=e[61],V}function Qc(t){return r.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function Xc(t){const e=le.c(51),{virtualMcpId:s,pageKey:n,onClose:a,ref:c}=t,d=Ee(),o=Qs(),i=o===!0,l=Xs(s);let m;e[0]!==l||e[1]!==n?(m=Yr(l,fa(n)),e[0]=l,e[1]=n,e[2]=m):m=e[2];const p=m,{org:f}=fs(),{currentBranch:y,taskId:x}=st(),h=xt().previewUrl;let g;e[3]!==y||e[4]!==f.slug||e[5]!==h||e[6]!==x||e[7]!==s?(g=y?{orgSlug:f.slug,virtualMcpId:s,branch:y,threadId:x??null,previewUrl:h}:null,e[3]=y,e[4]=f.slug,e[5]=h,e[6]=x,e[7]=s,e[8]=g):g=e[8];const v=ps(g),w=y??"";let C;e[9]!==f.slug||e[10]!==w||e[11]!==s?(C={orgSlug:f.slug,virtualMcpId:s,branch:w},e[9]=f.slug,e[10]=w,e[11]=s,e[12]=C):C=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k={holdsCopy:!0},e[13]=k):k=e[13];const{save:S,flush:j,hold:T}=oa(C,k),B=y??"";let A;e[14]!==f.slug||e[15]!==B||e[16]!==s?(A=da({orgSlug:f.slug,virtualMcpId:s,branch:B}),e[14]=f.slug,e[15]=B,e[16]=s,e[17]=A):A=e[17];const L=ua(A);let $;e[18]!==n||e[19]!==L?($=L(n),e[18]=n,e[19]=L,e[20]=$):$=e[20];const O=$;let F;e[21]!==O||e[22]!==n?(F={pageKey:n,copyEpoch:O},e[21]=O,e[22]=n,e[23]=F):F=e[23];const[I,G]=N.useState(F);(I.pageKey!==n||I.copyEpoch!==O)&&(G({pageKey:n,copyEpoch:O}),T(n));const W=v.data?.[n],Y=v.data===void 0&&v.isLoading||o===void 0,q=v.data!==void 0&&W===void 0,Q=!y||q||Y;let K;e[24]!==W?(K=W===void 0?"":JSON.stringify(W,null,2),e[24]=W,e[25]=K):K=e[25];const ee=K;let H;e[26]!==n||e[27]!==Q||e[28]!==S?(H=U=>{if(Q)return;let X;try{X=JSON.parse(U)}catch{return}X===null||typeof X!="object"||Array.isArray(X)||S(n,X)},e[26]=n,e[27]=Q,e[28]=S,e[29]=H):H=e[29];const J=H;let V;e[30]!==j?(V=()=>({flush:j}),e[30]=j,e[31]=V):V=e[31],N.useImperativeHandle(c,V);let E;e[32]!==p||e[33]!==i||e[34]!==a||e[35]!==d?(E=i?r.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:r.jsx("span",{title:p,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:p})}):r.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:d("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx(_e,{variant:"ghost",size:"icon-sm",onClick:a,"aria-label":d("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(Ar,{size:14})})]}),e[32]=p,e[33]=i,e[34]=a,e[35]=d,e[36]=E):E=e[36];let _;e[37]!==O||e[38]!==v.data||e[39]!==j||e[40]!==ee||e[41]!==Y||e[42]!==q||e[43]!==n||e[44]!==Q||e[45]!==J||e[46]!==d?(_=Y?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(tt,{className:"size-5 text-muted-foreground"})}):q?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",d("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(ca,{code:ee,language:"json",readOnly:Q,height:"100%",onChange:U=>J(U??""),onSave:U=>{J(U),j()}},`${n}:${v.data===void 0?"loading":"ready"}:${O}`)}),e[37]=O,e[38]=v.data,e[39]=j,e[40]=ee,e[41]=Y,e[42]=q,e[43]=n,e[44]=Q,e[45]=J,e[46]=d,e[47]=_):_=e[47];let D;return e[48]!==E||e[49]!==_?(D=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[E,_]}),e[48]=E,e[49]=_,e[50]=D):D=e[50],D}function Pr(t){const e=le.c(3),{currentBranch:s}=st(),n=It(t.virtualMcpId,s);let a;return e[0]!==n.kind||e[1]!==t?(a=n.kind==="legacy"?r.jsx(Xc,{...t}):r.jsx(Zc,{...t}),e[0]=n.kind,e[1]=t,e[2]=a):a=e[2],a}function Zc(t){const e=le.c(61),{virtualMcpId:s,pageKey:n,onClose:a,ref:c}=t,d=Ee(),o=Qs(),i=o===!0,l=Xs(s);let m;e[0]!==l||e[1]!==n?(m=Yr(l,fa(n)),e[0]=l,e[1]=n,e[2]=m):m=e[2];const p=m,{org:f}=fs(),{currentBranch:y,taskId:x}=st(),h=xt().previewUrl;let g;e[3]!==y||e[4]!==f.slug||e[5]!==h||e[6]!==x||e[7]!==s?(g=y?{orgSlug:f.slug,virtualMcpId:s,branch:y,threadId:x??null,previewUrl:h}:null,e[3]=y,e[4]=f.slug,e[5]=h,e[6]=x,e[7]=s,e[8]=g):g=e[8];const R=g,v=ps(R);let w;e[9]!==n?(w=[n],e[9]=n,e[10]=w):w=e[10];let C;e[11]!==v.data?(C={listing:v.data},e[11]=v.data,e[12]=C):C=e[12];const k=Qr(R,w,C),S=y??"";let j;e[13]!==f.slug||e[14]!==S||e[15]!==s?(j={orgSlug:f.slug,virtualMcpId:s,branch:S},e[13]=f.slug,e[14]=S,e[15]=s,e[16]=j):j=e[16];let T;e[17]===Symbol.for("react.memo_cache_sentinel")?(T={holdsCopy:!0},e[17]=T):T=e[17];const{save:B,flush:A,hold:L}=oa(j,T),$=y??"";let O;e[18]!==f.slug||e[19]!==$||e[20]!==s?(O=da({orgSlug:f.slug,virtualMcpId:s,branch:$}),e[18]=f.slug,e[19]=$,e[20]=s,e[21]=O):O=e[21];const F=ua(O);let I;e[22]!==n||e[23]!==F?(I=F(n),e[22]=n,e[23]=F,e[24]=I):I=e[24];const G=I,W=v.data?.[n];let Y;e[25]!==k.ready||e[26]!==v.data||e[27]!==W?(Y=k.ready&&v.data!==void 0&&(W===void 0||Qn(W)),e[25]=k.ready,e[26]=v.data,e[27]=W,e[28]=Y):Y=e[28];const q=Y;let Q;e[29]!==G||e[30]!==n?(Q={pageKey:n,copyEpoch:G,opened:!1,code:""},e[29]=G,e[30]=n,e[31]=Q):Q=e[31];const[K,ee]=N.useState(Q);if(q&&(K.pageKey!==n||K.copyEpoch!==G||!K.opened)){let Z;e[32]!==W?(Z=W===void 0?"":JSON.stringify(W,null,2),e[32]=W,e[33]=Z):Z=e[33],ee({pageKey:n,copyEpoch:G,opened:!0,code:Z}),Qn(W)&&L(n)}const H=K.pageKey===n&&K.opened,J=o===void 0||!H&&!q,V=q&&W===void 0,E=!y||V||J;let _;e[34]!==n||e[35]!==E||e[36]!==B?(_=Z=>{if(E)return;ee(ie=>({...ie,code:Z}));let re;try{re=JSON.parse(Z)}catch{return}re===null||typeof re!="object"||Array.isArray(re)||B(n,re)},e[34]=n,e[35]=E,e[36]=B,e[37]=_):_=e[37];const D=_;let U;e[38]!==A?(U=()=>({flush:A}),e[38]=A,e[39]=U):U=e[39],N.useImperativeHandle(c,U);let X;e[40]!==p||e[41]!==i||e[42]!==a||e[43]!==d?(X=i?r.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:r.jsx("span",{title:p,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:p})}):r.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:d("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx(_e,{variant:"ghost",size:"icon-sm",onClick:a,"aria-label":d("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(Ar,{size:14})})]}),e[40]=p,e[41]=i,e[42]=a,e[43]=d,e[44]=X):X=e[44];let se;e[45]!==k.failed||e[46]!==k.retry||e[47]!==A||e[48]!==K.code||e[49]!==K.copyEpoch||e[50]!==K.pageKey||e[51]!==J||e[52]!==V||e[53]!==E||e[54]!==D||e[55]!==H||e[56]!==d?(se=!H&&k.failed?r.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-4",children:[r.jsx("p",{className:"text-sm",children:d("sectionsEditor.hosted.blockLoadFailed")}),r.jsx(_e,{variant:"outline",size:"sm",onClick:k.retry,children:d("sectionsEditor.namedRules.tryAgain")})]}):J?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(tt,{className:"size-5 text-muted-foreground"})}):V?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",d("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(ca,{code:K.code,language:"json",readOnly:E,height:"100%",onChange:Z=>D(Z??""),onSave:Z=>{D(Z),A()}},`${K.pageKey}:${K.copyEpoch}`)}),e[45]=k.failed,e[46]=k.retry,e[47]=A,e[48]=K.code,e[49]=K.copyEpoch,e[50]=K.pageKey,e[51]=J,e[52]=V,e[53]=E,e[54]=D,e[55]=H,e[56]=d,e[57]=se):se=e[57];let z;return e[58]!==X||e[59]!==se?(z=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[X,se]}),e[58]=X,e[59]=se,e[60]=z):z=e[60],z}function Sa(t){return t.contentEditingEnabled&&!t.isMobile}function ed(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function td(t,e){return t==="blocks"?"preview":e?"blocks":t}function sd(t){return Sa({contentEditingEnabled:aa(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function nd(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function rd(t){const e=to(t),{display:s}=t;let n=null;if(s.mode==="production"&&s.iframeBase)try{n=new URL(t.path,s.iframeBase).href}catch{n=null}const a=so(n,e);return{value:e,frame:a?Ws(a,t.device):null,newTab:a}}function ad(t){const e=le.c(94),{tests:s,load:n,onOpen:a,options:c,onChange:d,available:o}=t,i=Ee();let l;e[0]!==c?(l=Xr(c),e[0]=c,e[1]=l):l=e[1];const m=l;let p;e[2]!==c.tests?(p=c.tests??{},e[2]=c.tests,e[3]=p):p=e[3];const f=p;let y;e[4]!==d||e[5]!==c?(y=z=>{const Z=z?sl(z):null,{at:re,...ie}=c;d(Z?{...ie,at:Z}:ie)},e[4]=d,e[5]=c,e[6]=y):y=e[6];const x=y;let b;e[7]!==f||e[8]!==d||e[9]!==c?(b=(z,Z)=>{const re={...f};Z==="on"?re[z]=!0:Z==="off"?re[z]=!1:delete re[z];const{tests:ie,...he}=c;d(Object.keys(re).length>0?{...he,tests:re}:he)},e[7]=f,e[8]=d,e[9]=c,e[10]=b):b=e[10];const h=b;let g;e[11]!==a?(g=z=>{z&&a?.()},e[11]=a,e[12]=g):g=e[12];let R;e[13]!==i?(R=i("sandbox.previewAs.label"),e[13]=i,e[14]=R):R=e[14];let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx(Ai,{size:16}),e[15]=v):v=e[15];let w;e[16]!==m||e[17]!==R?(w=r.jsx(ht,{asChild:!0,children:r.jsx(Ir,{asChild:!0,children:r.jsx(Ze,{"aria-label":R,active:m,"data-testid":"preview-as-trigger",children:v})})}),e[16]=m,e[17]=R,e[18]=w):w=e[18];let C;e[19]!==i?(C=i("sandbox.previewAs.label"),e[19]=i,e[20]=C):C=e[20];let k;e[21]!==C?(k=r.jsx(gt,{children:C}),e[21]=C,e[22]=k):k=e[22];let S;e[23]!==k||e[24]!==w?(S=r.jsxs(vt,{children:[w,k]}),e[23]=k,e[24]=w,e[25]=S):S=e[25];let j;e[26]!==i?(j=i("sandbox.previewAs.label"),e[26]=i,e[27]=j):j=e[27];let T;e[28]!==j?(T=r.jsx("h3",{className:"text-sm font-medium",children:j}),e[28]=j,e[29]=T):T=e[29];let B;e[30]!==o||e[31]!==i?(B=i(o?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[30]=o,e[31]=i,e[32]=B):B=e[32];let A;e[33]!==B?(A=r.jsx("p",{className:"text-xs text-muted-foreground",children:B}),e[33]=B,e[34]=A):A=e[34];let L;e[35]!==T||e[36]!==A?(L=r.jsxs("div",{className:"flex flex-col gap-1",children:[T,A]}),e[35]=T,e[36]=A,e[37]=L):L=e[37];let $;e[38]!==i?($=i("sandbox.previewAs.momentLabel"),e[38]=i,e[39]=$):$=e[39];let O;e[40]!==$?(O=r.jsx(Zo,{htmlFor:"preview-as-moment",children:$}),e[40]=$,e[41]=O):O=e[41];let F;e[42]!==c.at?(F=tl(c.at),e[42]=c.at,e[43]=F):F=e[43];let I;e[44]!==x?(I=z=>x(z.target.value),e[44]=x,e[45]=I):I=e[45];let G;e[46]!==F||e[47]!==I?(G=r.jsx(Is,{id:"preview-as-moment",type:"datetime-local",className:nl,value:F,onChange:I}),e[46]=F,e[47]=I,e[48]=G):G=e[48];const W=c.at===void 0;let Y;e[49]!==x?(Y=()=>x(""),e[49]=x,e[50]=Y):Y=e[50];let q;e[51]!==i?(q=i("sandbox.previewAs.now"),e[51]=i,e[52]=q):q=e[52];let Q;e[53]!==W||e[54]!==Y||e[55]!==q?(Q=r.jsx(_e,{type:"button",variant:"ghost",size:"sm",disabled:W,onClick:Y,children:q}),e[53]=W,e[54]=Y,e[55]=q,e[56]=Q):Q=e[56];let K;e[57]!==G||e[58]!==Q?(K=r.jsxs("div",{className:"flex items-center gap-2",children:[G,Q]}),e[57]=G,e[58]=Q,e[59]=K):K=e[59];let ee;e[60]!==i?(ee=i("sandbox.previewAs.momentHint"),e[60]=i,e[61]=ee):ee=e[61];let H;e[62]!==ee?(H=r.jsx("p",{className:"text-xs text-muted-foreground",children:ee}),e[62]=ee,e[63]=H):H=e[63];let J;e[64]!==O||e[65]!==K||e[66]!==H?(J=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,K,H]}),e[64]=O,e[65]=K,e[66]=H,e[67]=J):J=e[67];let V;e[68]!==i?(V=i("sandbox.previewAs.testsLabel"),e[68]=i,e[69]=V):V=e[69];let E;e[70]!==V?(E=r.jsx("span",{className:"text-sm font-medium",children:V}),e[70]=V,e[71]=E):E=e[71];let _;e[72]!==f||e[73]!==n||e[74]!==h||e[75]!==i||e[76]!==s?(_=n&&!n.ready?n.failed?r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.testsLoadFailed")}),r.jsx(_e,{type:"button",variant:"outline",size:"sm",onClick:n.retry,children:i("sandbox.previewAs.tryAgain")})]}):r.jsx("div",{className:"flex justify-center py-2","data-testid":"preview-as-tests-loading",children:r.jsx(tt,{className:"size-4 text-muted-foreground"})}):s.length===0?r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.noTests")}):r.jsxs(r.Fragment,{children:[r.jsx("ul",{className:"flex flex-col gap-1.5",children:s.map(z=>r.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[r.jsx("span",{className:"min-w-0 truncate text-sm",children:z}),r.jsxs(el,{type:"single",variant:"outline",size:"sm",value:f[z]===void 0?"":f[z]?"on":"off",onValueChange:Z=>h(z,Z),"aria-label":z,children:[r.jsx(fr,{value:"off",children:i("sandbox.previewAs.off")}),r.jsx(fr,{value:"on",children:i("sandbox.previewAs.on")})]})]},z))}),r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.testsHint")})]}),e[72]=f,e[73]=n,e[74]=h,e[75]=i,e[76]=s,e[77]=_):_=e[77];let D;e[78]!==E||e[79]!==_?(D=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[E,_]}),e[78]=E,e[79]=_,e[80]=D):D=e[80];let U;e[81]!==m||e[82]!==d||e[83]!==i?(U=m&&r.jsx(_e,{type:"button",variant:"outline",size:"sm",onClick:()=>d({}),children:i("sandbox.previewAs.reset")}),e[81]=m,e[82]=d,e[83]=i,e[84]=U):U=e[84];let X;e[85]!==L||e[86]!==J||e[87]!==D||e[88]!==U?(X=r.jsxs(Ur,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[L,J,D,U]}),e[85]=L,e[86]=J,e[87]=D,e[88]=U,e[89]=X):X=e[89];let se;return e[90]!==S||e[91]!==X||e[92]!==g?(se=r.jsxs(Kr,{onOpenChange:g,children:[S,X]}),e[90]=S,e[91]=X,e[92]=g,e[93]=se):se=e[93],se}const id=["next"],od=["@tanstack/react-router","@tanstack/react-start","@tanstack/solid-router","@tanstack/solid-start"],Pa=new Set(["tsx","ts","jsx","js","mdx"]),ld=new Set(["tsx","jsx"]),cd=new Set(["404","500"]);function dd(t){const e=new Set;if(!t||typeof t!="object")return e;const s=t;for(const n of["dependencies","devDependencies"]){const a=s[n];if(a&&typeof a=="object"&&!Array.isArray(a))for(const c of Object.keys(a))e.add(c)}return e}function ud(t){const e=dd(t);return id.some(s=>e.has(s))?"next":od.some(s=>e.has(s))?"tanstack":null}function ja(t,e){const s=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return s?`${s}/${e}`:e}function fd(t,e){const s=n=>ja(e,n);switch(t){case"next":return[{router:"next-pages",dir:s("pages"),pattern:"**/*"},{router:"next-pages",dir:s("src/pages"),pattern:"**/*"},{router:"next-app",dir:s("app"),pattern:"**/page.*"},{router:"next-app",dir:s("src/app"),pattern:"**/page.*"}];case"tanstack":return[{router:"tanstack",dir:s("src/routes"),pattern:"**/*"}];default:{const n=t;throw new Error(`Unknown framework: ${String(n)}`)}}}function sn(t){const e=t.lastIndexOf(".");return e<=0?null:[t.slice(0,e),t.slice(e+1)]}function pd(t){const e=sn(t.at(-1)??"");if(!e||!Pa.has(e[1]))return null;const[s]=e;if(s.includes("."))return null;const n=[...t.slice(0,-1),s];return n[0]==="api"||n.length===1&&cd.has(s)||n.some(a=>a.startsWith("_")||a.includes("["))?null:(n.at(-1)==="index"&&n.pop(),`/${n.join("/")}`)}function md(t){const e=sn(t.at(-1)??"");if(!e||e[0]!=="page"||!Pa.has(e[1]))return null;const s=[];for(const n of t.slice(0,-1)){if(n.startsWith("_")||n.startsWith("@")||/^\(\.{1,3}\)/.test(n)||n.includes("["))return null;n.startsWith("(")&&n.endsWith(")")||s.push(n)}return`/${s.join("/")}`}function hd(t){const e=[];let s="",n=!1;for(const a of t)a==="["?n=!0:a==="]"&&(n=!1),a==="."&&!n?(e.push(s),s=""):s+=a;return e.push(s),e}function gd(t){const e=sn(t.at(-1)??"");if(!e||!ld.has(e[1]))return null;const s=[...t.slice(0,-1),...hd(e[0])].filter(Boolean);s.at(-1)==="lazy"&&s.pop();const n=s.at(-1);if(!n||n==="__root"||s.some(c=>c.startsWith("-"))||n.startsWith("_"))return null;(n==="index"||n==="route")&&s.pop();const a=[];for(const c of s){if(c.includes("$"))return null;if(c.startsWith("_")||c.startsWith("(")&&c.endsWith(")"))continue;const d=c.replace(/_$/,"").replace(/[[\]]/g,"");d&&a.push(d)}return`/${a.join("/")}`}function vd(t,e){const s=e.split("/").filter(Boolean);if(s.length===0)return null;switch(t){case"next-pages":return pd(s);case"next-app":return md(s);case"tanstack":return gd(s);default:{const n=t;throw new Error(`Unknown router: ${String(n)}`)}}}function xd(t){const e=new Set;for(const{root:s,files:n}of t){const a=`${s.dir}/`;for(const c of n){if(!c.startsWith(a))continue;const d=vd(s.router,c.slice(a.length));d&&e.add(d)}}return[...e].sort((s,n)=>s==="/"?-1:n==="/"?1:s.localeCompare(n))}const bd=5e3,yd=6e4;async function wd(t,e){const s=await fetch(rl(t,"glob"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pattern:e.pattern,path:e.dir,limit:bd})});if(!s.ok)throw new Error(`Failed to list ${e.dir}: ${s.status}`);const n=await s.json();return Array.isArray(n.files)?n.files.filter(a=>typeof a=="string"):[]}async function kd(t,e){const s=await no(t,ja(e,"package.json"));if(s.kind==="unavailable")throw new Error("package.json unavailable: sandbox not ready");const n=s.kind==="data"?ud(s.data):null;if(!n)return[];const a=fd(n,e),c=await Promise.all(a.map(async d=>({root:d,files:await wd(t,d)})));return xd(c)}function Sd(t,e,s){const n=le.c(12);let a;n[0]!==e||n[1]!==t?(a=t?Ys.frameworkRoutes(t.orgSlug,t.virtualMcpId,t.branch,t.threadId,e):["framework-routes","none"],n[0]=e,n[1]=t,n[2]=a):a=n[2];let c;n[3]!==e||n[4]!==t?(c=()=>t?kd(t,e):[],n[3]=e,n[4]=t,n[5]=c):c=n[5];const d=s&&!!t;let o;n[6]!==a||n[7]!==c||n[8]!==d?(o={queryKey:a,queryFn:c,enabled:d,staleTime:yd},n[6]=a,n[7]=c,n[8]=d,n[9]=o):o=n[9];const i=_r(o);let l;return n[10]!==i.data?(l=i.data??[],n[10]=i.data,n[11]=l):l=n[11],l}const Pd=500,jd={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},jr=1,ls=["desktop","mobile","tablet"],Ed=["preview","visual","blocks"],Er={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function Nd(t){if(!t)return null;try{const e=new URL(t,window.location.href);return e.searchParams.set("__decoFBT","0"),e.searchParams.set("__deco_ssr","1"),e.href}catch{return t}}function Mt(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function zs(t,e){try{return new URL(t,e).href}catch{return null}}function Td(t,e){if(!e.inPlaceRenderActive)return{pin:e.draftPreviewUrl?{path:e.resolvedPath,url:e.draftPreviewUrl}:null,effective:e.draftPreviewUrl};if(e.draftPreviewUrl!==null&&t?.path!==e.resolvedPath){const s={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:s,effective:s.url}}return{pin:t,effective:t?.url??null}}function Cd(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function Rd(t,e,s){const n=t.toLowerCase(),a=e.toLowerCase(),c=a.split("/").filter(Boolean),d=i=>{if(i===s)return 100;const l=i.indexOf(s);if(l===-1)return 0;let m=40;return l===0?m+=30:/[\s/-]/.test(i[l-1]??"")&&(m+=20),m+=Math.round(s.length/i.length*20),m};let o=Math.max(d(n),d(a));return c.at(-1)===s?o=Math.max(o,95):c.includes(s)&&(o=Math.max(o,90)),o}function Ld(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Ad({virtualMcpId:t}){const e=Ee(),s=ta(),{currentBranch:n,taskId:a,virtualMcpId:c}=st(),d=!!ji(),o=la(),i=Mi(c===t?t:null),l=Gr(t),m=al(i?.metadata?.ui?.layout??null),p=aa(m),f=Sa({contentEditingEnabled:p,isMobile:s}),[y]=N.useState(()=>sd({cmsMode:m,isMobile:s})),[x,b]=Us(Ks.previewEditingMode(t),u=>u&&Ed.includes(u)?u:null),h=x??y,[g,R]=Us(Ks.previewDeviceSize(t),u=>u&&ls.includes(u)?u:"desktop"),[v,w]=N.useState(null),[C,k]=N.useState(null),S=N.useRef(null),j=N.useRef(null),[T,B]=N.useState(!1),A=N.useRef(null),L=()=>{A.current?.flush(),B(!1)},$=()=>B(u=>(u&&A.current?.flush(),!u)),[O,F]=N.useState({width:0,height:0}),[I,G]=N.useState(!1),[W,Y]=N.useState({}),[q,Q]=N.useState(""),K=N.useRef(null),[ee,H]=N.useState(!1),[J,V]=N.useState(),[E,_]=N.useState(null),[D,U]=N.useState(null),[X,se]=N.useState(null),[z,Z]=N.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[re,ie]=N.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[he,pe]=N.useState({}),[be,ge]=N.useState(!1),ve=N.useRef(null),Se=()=>{ge(!0),ve.current&&clearTimeout(ve.current),ve.current=setTimeout(()=>ge(!1),15e3)},fe=()=>{ve.current&&(clearTimeout(ve.current),ve.current=null),ge(!1)},{org:ce}=fs(),Re=en(),ze=xt(),Ie=ze.vmEntry,Be=Re.lifecycle.phase,{url:bt}=Zr(t),me=It(t,n),{connection:Oe}=ea(t),xe=Yo(t),Ue=ro({hasServeConnection:!!Oe,runtime:l.runtime}),Le=!Xe(me)&&me.kind!=="pending",ne=He(me)??bt,de=ne??ze.previewUrl,We=!!ne||Be==="running",yt=i?.id===t?qi(i.metadata):null,qe=!ne&&i?.id===t&&l.runtime==="cms",Ut=l.projectDefault==="cms",wt=Le?ao({sandboxUrl:de,previewServerUrl:yt,fastPreviewActive:qe}):null,nn=t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n,threadId:a??null,previewUrl:de}:null,rn=ps(nn,{fetchEnabled:We}),ms=ra(nn,{fetchEnabled:We}),ue=rn.data,Pe=ms.data,Ge=ue?Eo(ue,Pe).sort((u,P)=>u.name.localeCompare(P.name)):[],Kt=t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n}:null,an=Kc(Kt),Ea=io(Kt),hs=ue&&Pe?No(ue,Pe):[],on=Le&&ue&&Pe?zo(Pe,ue,"loaders"):[],ln=q?(()=>{const u=q.toLowerCase();return Ge.map(P=>({page:P,score:Rd(P.name,P.path,u)})).filter(({score:P})=>P>0).sort((P,M)=>M.score-P.score||P.page.path.length-M.page.path.length).map(({page:P})=>P)})():Ge,cn=hs.filter(u=>{if(!q)return!0;const P=q.toLowerCase();return u.name.toLowerCase().includes(P)||u.key.toLowerCase().includes(P)||u.resolveType.toLowerCase().includes(P)}),dn=f?on:[],un=dn.filter(u=>{if(!q)return!0;const P=q.toLowerCase();return u.title.toLowerCase().includes(P)||u.key.toLowerCase().includes(P)||u.resolveType.toLowerCase().includes(P)}),Ht=D?on.find(u=>u.key===D)??null:null,Ne=Zs,gs=E||D?null:To(Ge,z,re),oe=gs?.key??null,nt=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??oe,Vt=gs?.path??null,rt=(oe?he[oe]:void 0)??{},Ce=Ve(z,rt),vs={};if(Le&&We&&de&&Pe&&ue){const u=Io(Pe,"loaders"),P=oe?ue[oe]:void 0,M=lc(P,ue,we=>u.has(we)),ae=nc(M);for(const we of zt(z)){if(we.type!=="param")continue;const Te=ec(z,we.name,M),ct=ic(Te,u,ae);ct.length>0&&(vs[we.name]=ct)}}const kt=t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n,threadId:a??null}:null,fn=ue&&oe?Ko(ue,oe,0):[],pn=Xe(me),mn=ue?Uo(fn,ue,pn):[],St=mn.map(u=>u.isSavedBlock?u.label:""),Pt=mn.map(u=>u.isSavedBlock?"global":u.isMultivariate?"variant":"normal"),jt=fn.map(u=>qs(u,ue??{},pn)),at=N.useRef(null),$e=N.useRef(null),Na=Re.status.state==="paused",xs=Re.phase,hn=Wo({claimPhase:xs,lifecycle:Re.lifecycle}),Je=ze.previewState,Ta=ze.userStopped,Ca=oo(ce.slug,t??""),{url:Ke}=Oo(qe&&t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n,previewServerUrl:yt??null,path:Ce}:null),Ra=Ut&&l.runtime==="sandbox",Ae=lo(me,Ue,xe),gn=co(Ae&&qe&&me.kind==="protocol"&&t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n}:null),vn=Ae?gn.pointer:null,te=Ol({previewState:Je,progressStatus:hn.status,previewServerUrl:yt,fastPreviewActive:qe,fastPreviewReady:!!Ke,codingSession:Ra,localPreviewUrl:ne,hostedDraft:Ae,hostedPointerPending:Ae&&(me.kind==="pending"||gn.pending)}),xn=te.showWakingPill||Ae&&te.mode==="production"&&!vn,Et=te.mode!=="none",La=te.mode==="production"&&te.iframeBase?Mt(te.iframeBase):null,it=te.mode==="production"?La:Mt(de),Aa=i?.id===t&&i.metadata?.fastPreviewInPlace===!0,Nt=Le?ne?te.mode==="sandbox"&&f&&h==="blocks":te.mode==="production"&&qe&&Aa&&f&&h==="blocks":!1,bn=N.useRef(null),{pin:_a,effective:Oa}=Td(bn.current,{inPlaceRenderActive:Nt,draftPreviewUrl:Ke,resolvedPath:Ce});bn.current=_a;const yn=o.state.variantOverride??[],Wt=Le?yn:[],Tt=Le?[]:yn,qt=Xe(me)&&Co.some(u=>Ro(Pe,u)==="available"),ot=qt?W:{},wn=Xr(ot),$a=qt&&ue?Object.keys(Lo(ue).experiments):[],[kn,Da]=N.useState(!1),Sn=Qr(Kt,qt&&kn?Ao:[]),Fa={...Sn,ready:!(me.kind==="protocol"&&me.hosted)||kn&&Sn.ready},Ye=t?er(ce.slug,t):null,Ba=uo(Ye),Gt=Ae?rd({display:te,path:Ce,pointer:vn,heldRevision:Ba,device:g,forcedVariants:Tt,previewOptions:ot}):null,Pn=JSON.stringify([Tt,ot]);N.useEffect(()=>{if(!Ae||!Ye)return;const[u,P]=JSON.parse(Pn);tr(Ye,{forcedVariants:u,previewOptions:P})},[Ae,Ye,Pn]),N.useEffect(()=>{if(!(!Ae||!Ye))return()=>tr(Ye,null)},[Ae,Ye]);const bs=Oe&&He(me)?fo(Oe.endpoint,Tt,wn):null,Ma=Oe&&He(me)?bs?po(bs,ot):sr:null,Qe=Nd(te.mode==="sandbox"?ns(Ws(nr(X??zs(Ce,te.iframeBase)??te.iframeBase,Ma),g),Wt):te.mode==="production"&&Gt?.frame?Gt.frame:te.mode==="production"?ns(Ws(rr(ar(nr(X??Oa??zs(Ce,te.iframeBase)??te.iframeBase,xn?sr:null),Tt),ot),g),Wt):null),jn=Ke??(te.iframeBase?zs(Ce,te.iframeBase):null),En=te.mode==="production"&&Gt?Gt.newTab:te.mode==="production"?jn?ns(rr(ar(jn,Tt),ot),Wt):null:Qe??te.iframeBase,za=()=>{const u=En;u&&window.open(u,"_blank","noopener")},Ct=t&&n?Dr(ce.slug,t,n):null,Rt=u=>{Ct&&Ni(Ct,u)},ke=o.state.target;N.useEffect(()=>{if(!(!ke||!wt||!Pe))if(ke.kind==="page"){const u=he[ke.key]??{};$e.current=Ve(ke.path,u),_(null),U(null),se(null),ie(ke.key),Z(ke.path),Rt({path:ke.path,pageKey:ke.key,params:u})}else if(ke.kind==="loader")$e.current=null,_(null),U(ke.key),se(null);else{const u=hs.find(P=>P.key===ke.key);if(u){$e.current=null;const P=or(Pe);U(null),_(u),se(ir(wt,P,u.key))}}},[ke,wt,Pe,he]),N.useEffect(()=>{!oe||Vt===null||ke?.kind==="page"&&ke.key===oe&&ke.path===Vt||o.selectTarget({kind:"page",key:oe,path:Vt})},[oe,Vt,ke]);const[Nn,Ia]=N.useState(null);if(Je.kind==="iframe"&&Nn!==Je.previewUrl){const u=Nn!==null;Ia(Je.previewUrl);const P=Ct?$r(Ct):null;if(P){if($e.current=Ve(P.path,P.params),Z(P.path),ie(P.pageKey),se(null),_(null),U(null),P.pageKey&&Object.keys(P.params).length>0){const M=P.pageKey;pe(ae=>({...ae,[M]:P.params}))}}else u&&($e.current=null,Z("/"),se(null),ie(null),_(null),U(null))}at.current=Qe;const Ua=te.mode==="production"&&!!Ke&&!ne,[Jt,ys]=N.useState({src:Qe??void 0,loading:!1}),[Ka,ws]=N.useState(!1),[Ha,Va]=N.useState(),[Tn,Cn]=N.useState(null),je=Ui(Tn,{base:te.iframeBase??"",frameSrc:Jt.src,loadedSrc:Ha,wanted:Qe??void 0,canSwap:xe&&Ka&&!Jt.loading});je!==Tn&&Cn(je);const Yt=Ki(Jt,je?je.src:Qe??void 0,Ua);Yt!==Jt&&ys(Yt);const lt=Yt.src,Rn=Yt.loading,Ln=Hi({iframeRef:S,src:te.mode==="sandbox"?Qe:null,active:te.mode==="sandbox"}),An=N.useRef(null);N.useEffect(()=>{const u=Rn?setTimeout(()=>ys(Zn),Vi):null,P=()=>{u&&clearTimeout(u)};if(!Ke||!lt||An.current===Ke)return P;An.current=Ke;const M=S.current;return M&&M.getAttribute("src")!==lt&&(Se(),M.src=lt),P},[Ke,lt,Rn]);const _n=()=>{const u=S.current?.contentWindow,P=it;if(!u||!P||!ue||!oe)return;const M=ue[oe];if(!M||typeof M!="object")return;const ae=vo({previewBaseUrl:P,pageBlock:M,decofile:ue,path:Ce,pathTemplate:z});if(!ae)return;const we=ns(ae.src,bo(Wt,oe));u.postMessage({type:"cms-editor::render",src:we,body:ae.body},P)},ks=N.useRef(null);N.useEffect(()=>{if(!Nt||E||D||!oe||!ue){ks.current=null;return}const u={nav:JSON.stringify({page:oe,path:Ce,pathTemplate:z}),content:JSON.stringify(ue)},P=Cd(ks.current,u);ks.current=u,P&&_n()},[ue,Nt,E,D,oe,Ce,z]);const Ss=N.useRef(null);N.useEffect(()=>{if(!Nt||E||D||!oe||!ue){Ss.current=null;return}const u=JSON.stringify(o.state.variantOverride??null),P=Ss.current;Ss.current={page:oe,sig:u},!(!P||P.page!==oe||P.sig===u)&&_n()},[o.state.variantOverride,Nt,E,D,oe]);const On=!!t&&!!n&&!Re.notFound&&!Ta&&!Na&&(xs?.kind==="ready"||Be!=="idle"),$n=!Xe(me),Wa=Xs(t??void 0),qa=Sd(kt,Wa,$n&&On),Ga=new Set(Ge.map(u=>Ne(u.path))),Qt=$n?qa.filter(u=>!Ga.has(Ne(u))):[],Dn=q?Qt.filter(u=>u.toLowerCase().includes(q.toLowerCase())):Qt,ye=nd({editingMode:h,sandboxDisplay:te.mode==="sandbox",blocksEditingEnabled:f});N.useEffect(()=>{const u=it;if(!u)return;const P=M=>{if(M.origin===u)if(M.data?.type==="visual-editor::element-clicked"){const ae=Bl.safeParse(M.data.payload);ae.success&&w(ae.data)}else if(M.data?.type==="cms-editor::section-clicked"){const ae=Il.safeParse(M.data.payload);ae.success&&k({index:ae.data.sectionIndex,seq:ae.data.clickSeq})}else M.data?.type==="cms-editor::render-start"?Se():M.data?.type==="cms-editor::render-end"?(fe(),S.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:St,kinds:Pt,keys:jt},u)):M.data?.type==="cms-editor::render-error"&&fe()};return window.addEventListener("message",P),()=>window.removeEventListener("message",P)},[it,St,Pt,jt]);const Fn=()=>{const u=S.current?.contentWindow,P=Mt(de),M=zc({v8:xe,script:Ml});!u||!P||!M||u.postMessage(M,P)},Ja=()=>{if(xe)return;const u=S.current?.contentWindow,P=Mt(de);!u||!P||u.postMessage({type:"visual-editor::deactivate"},P)},Bn=()=>{const u=Me.current;u?.has("wireframe")&&(u.wireframe({type:"wireframe:sections",labels:St,kinds:Pt,keys:jt}),u.wireframe({type:ye==="blocks"?"wireframe:activate":"wireframe:deactivate"}))},Ps=()=>{if(xe){Bn();return}const u=S.current?.contentWindow,P=it,M=Mc({v8:xe,production:te.mode==="production",localPreview:!!ne,script:Ul});!u||!P||!M||(u.postMessage(M,P),u.postMessage({type:"cms-editor::set-labels",labels:St,kinds:Pt,keys:jt},P))},Ya=()=>{if(xe){Me.current?.wireframe({type:"wireframe:deactivate"});return}const u=S.current?.contentWindow,P=it;!u||!P||u.postMessage({type:"cms-editor::deactivate"},P)},Mn=u=>{Me.current?.wireframe({type:"wireframe:scroll-to",sectionIndex:u})},Qa=()=>{if(Me.current?.wireframe({type:"wireframe:clear-hover"}),xe)return;const u=S.current?.contentWindow,P=it;!u||!P||(u.postMessage({type:"cms-editor::clear-hover"},P),u.postMessage({type:"visual-editor::clear-hover"},P))},Xt=u=>{if(u==="blocks"&&!f)return;const P=h;!s&&u!==P&&(u==="blocks"?j.current?.resize("30%"):j.current?.collapse()),b(u),w(null),k(null),u!=="blocks"&&U(null),P==="visual"&&Ja(),u==="visual"&&Fn(),P==="blocks"&&u!=="blocks"&&Ya(),u==="blocks"&&Ps()},Xa=()=>{Xt(ed(h,f))},Za=()=>{Xt(td(h,f))},Zt=()=>{const u=S.current;if(!u)return;Se();const P=document.activeElement,M=u.tabIndex;u.tabIndex=-1,u.style.pointerEvents="none",u.blur(),Ld(u,at.current);let ae;const we=()=>{clearTimeout(ae),u.tabIndex=M,u.style.pointerEvents="";const Te=document.activeElement;(!Te||Te===document.body||Te===u)&&P?.focus(),u.removeEventListener("load",we)};u.addEventListener("load",we),ae=setTimeout(we,3e3)};Vo(Zt);const Me=N.useRef(null),zn=N.useEffectEvent(Bn),ei=N.useEffectEvent((u,P)=>{k({index:u,seq:P})}),ti=N.useEffectEvent(()=>{fe(),je&&(js.current=je.shown),At&&As(Lt)}),In=N.useEffectEvent(()=>{if(ws(!1),je&&Cn(null),je&&je.src!==at.current){Se();return}Zt()});N.useEffect(()=>{if(!xe)return;const u=new ql({studioOrigin:window.location.origin,build:"4.581.1",frame:()=>S.current?.contentWindow??null,onWireframeReady:()=>zn(),onWireframe:M=>{M.type==="wireframe:select"&&ei(M.sectionIndex,M.clickSeq)},onModulesChange:()=>ws(u.has("html-swap")),onSwapEnd:()=>ti(),onSwapFailed:()=>In()});Me.current=u;const P=M=>{u.handle(M)};return window.addEventListener("message",P),()=>{window.removeEventListener("message",P),u.dispose(),ws(!1),Me.current===u&&(Me.current=null)}},[xe,te.iframeBase]);const Un=xe?JSON.stringify([St,Pt,jt,ye]):"";N.useEffect(()=>{Un&&zn()},[Un]);const Kn=N.useRef(null);N.useEffect(()=>{const u=Kn.current;if(Kn.current=je,je&&je!==u){Me.current?.refresh(je.shown)?Se():In();return}!je&&u&&u.shown!==u.src&&u.src===at.current&&Zt()},[je]);const Hn=()=>{Me.current?.refresh()||Zt()},Lt=er(ce.slug,t??""),At=Ae&&Et&&!!t,js=N.useRef(null);N.useEffect(()=>{if(At)return mo(Lt)},[At,Lt]);const{reload:_t}=ho(ce.slug,t??""),Vn=N.useRef(_t.seq);N.useEffect(()=>{if(Vn.current!==_t.seq&&(Vn.current=_t.seq,!!At&&js.current===at.current)){if(_t.navigates){As(Lt);return}Hn()}},[_t.seq]);const Es=Jr(Kt),Ot=go(He(me)?Es:""),Wn=N.useRef(Ot);N.useEffect(()=>{const u=Wn.current;if(Wn.current=Ot,!u||!Ot||u===Ot)return;const P=S.current;if(P)return Fl({iframe:P,reload:Hn})},[Ot]);const si=()=>{const u=ls.indexOf(g);R(ls[(u+1)%ls.length])},Ns=(u,P)=>{if(!oe)return;const M=oe,ae={...rt,[u]:P};$e.current=Ve(z,ae),pe(we=>({...we,[M]:ae})),Rt({path:z,pageKey:M,params:ae})},ni=Dc({iframeBase:te.iframeBase,resolvedPath:Ce,activeGlobalSectionName:E?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),Ts=u=>{const P=he[u.key]??{},M=Ve(u.path,P);(E||Ne(M)!==Ne(Ce))&&Se(),$e.current=M,_(null),U(null),se(null),k(null),ie(u.key),Z(u.path),Rt({path:u.path,pageKey:u.key,params:P}),o.selectTarget({kind:"page",key:u.key,path:u.path})},qn=u=>{(E||Ne(u)!==Ne(Ce))&&Se(),$e.current=u,_(null),U(null),se(null),k(null),ie(null),Z(u),Rt({path:u,pageKey:null,params:{}})};Ei(Ct,qn);const ri=u=>{if(Xe(me)){const ae=ue?_o(ue,u.key,Pe):null;ae?Ts(ae):ds.info(e("sandbox.preview.blockOnNoPage"));return}if(!wt||!Pe){ds.error(e("sandbox.preview.previewMetadataNotReady"));return}Se(),$e.current=null;const P=or(Pe),M=ir(wt,P,u.key);_(u),U(null),se(M),k(null),o.selectTarget({kind:"section",key:u.key})},ai=u=>{f&&(_(null),U(u.key),se(null),Xt("blocks"),o.selectTarget({kind:"loader",key:u.key}))},ii=async({name:u,path:P,templateKey:M})=>{if(!t||!n)return;const ae=na(P);if(ae){V(ae);return}const we=P.trim().startsWith("/")?P.trim():`/${P.trim()}`;if(Ge.some(Te=>Ne(Te.path)===Ne(we))){V(e("sandbox.preview.pageAlreadyExists",{path:we}));return}V(void 0);try{const Te=M?await Ea(ue,M):void 0;if(M&&!Te){V(e("sandbox.preview.templateNoLongerExists"));return}const ct=await an.mutateAsync({name:u,path:we,template:Te,schema:Xe(me)?{meta:Pe,loadMeta:async()=>(await ms.refetch()).data}:void 0});H(!1),ds.success(e("sandbox.preview.pageCreated",{name:u})),await ol(Pd),Ts({key:ct.key,name:ct.name,path:ct.path}),Xt("blocks")}catch(Te){V(Te instanceof ka?e("sandbox.preview.pageSchemaNotReady"):Te instanceof Error?Te.message:e("sandbox.preview.failedToCreatePage"))}},es=Fc({previewSurfaceActive:Et,daemonReady:On,production:te.mode==="production",servePreviewUrl:He(me)}),oi=Bc({showPreviewToolbar:es,contentEditingEnabled:p}),$t=()=>{G(!1),Q("")},Cs=E?.name??Ht?.title??gs?.name,Rs=rn.isPending||ms.isPending,Ls=Rs?Mt(te.iframeBase):Cs,Dt=E?`section:${E.key}`:D?`loader:${D}`:oe?`page:${oe}`:Qt.includes(Ne(z))?`route:${Ne(z)}`:void 0,li=es?oi?r.jsxs(Kr,{open:I,onOpenChange:u=>{G(u),u||Q("")},children:[r.jsx(Ir,{asChild:!0,children:r.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:Rs?Ls??void 0:E||Ht?Cs:[Cs,z].filter(Boolean).join(" · "),className:"group/page-picker flex h-7 w-fit min-w-[320px] items-stretch overflow-hidden whitespace-nowrap rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background text-left text-xs text-muted-foreground transition-colors hover:border-border focus-ring",children:r.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 px-2 transition-colors group-hover/page-picker:bg-accent/50 group-data-[state=open]/page-picker:bg-accent/50",children:[E&&r.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-2xs font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[r.jsx(_i,{size:11}),e("sandbox.preview.globalBadge")]}),Ht&&r.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:[r.jsx(Oi,{size:11}),e("sandbox.preview.loaderBadge")]}),Ls&&r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:Ls}),!Rs&&!E&&!Ht&&r.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:z}),r.jsx(Ti,{size:12,className:Fe("shrink-0 transition-transform",I&&"rotate-180")})]})})}),r.jsxs(Ur,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[r.jsxs(Vr,{shouldFilter:!1,defaultValue:Dt,children:[r.jsx(Wr,{value:q,onValueChange:u=>{Q(u),K.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),r.jsxs(Hr,{ref:K,className:"max-h-80",children:[r.jsx(qr,{children:Ge.length===0&&Qt.length===0&&hs.length===0&&dn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),ln.length>0&&r.jsx(ft,{children:ln.map(u=>r.jsxs(pt,{value:`page:${u.key}`,"aria-current":Dt===`page:${u.key}`||void 0,title:`${u.name} · ${u.path}`,onSelect:()=>{$t(),Ts(u)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:u.name}),r.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:u.path})]},u.key))}),Dn.length>0&&r.jsx(ft,{heading:e("sandbox.preview.siteRoutes"),children:Dn.map(u=>r.jsx(pt,{value:`route:${u}`,"aria-current":Dt===`route:${u}`||void 0,title:u,onSelect:()=>{$t(),qn(u)},className:"px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:r.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:u})},u))}),cn.length>0&&r.jsx(ft,{heading:e("sandbox.preview.globalComponents"),children:cn.map(u=>r.jsx(pt,{value:`section:${u.key}`,"aria-current":Dt===`section:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{$t(),ri(u)},children:r.jsx("span",{className:"truncate",children:u.name})},u.key))}),un.length>0&&r.jsx(ft,{heading:e("sandbox.preview.globalLoaders"),children:un.map(u=>r.jsx(pt,{value:`loader:${u.key}`,"aria-current":Dt===`loader:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{$t(),ai(u)},children:r.jsx("span",{className:"truncate",children:u.title})},u.key))})]})]}),!E&&!D&&zt(z).some(u=>u.type!=="text")&&r.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:zt(z).map((u,P)=>{if(u.type==="text")return r.jsx("span",{children:u.text},`text-${P}`);const M=vs[u.name];return M&&kt?r.jsx(Sc,{sources:M,template:z,paramName:u.name,value:rt[u.name]??"",sandboxRef:kt,onCommit:ae=>Ns(u.name,ae)},`${oe}:${u.name}`):r.jsx(Oc,{name:u.name,value:rt[u.name]??"",onCommit:ae=>Ns(u.name,ae)},`${oe}:${u.name}`)})}),r.jsx("div",{className:"border-t p-1.5",children:r.jsxs(_e,{variant:"ghost",className:"w-full justify-start",onClick:()=>{$t(),V(void 0),H(!0)},children:[r.jsx(zr,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):r.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:ni}):null,Gn=es||p?r.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[r.jsxs(vt,{children:[r.jsx(ht,{asChild:!0,children:r.jsx(Ze,{onClick:si,"aria-label":e(Er[g]),children:g==="mobile"?r.jsx(Br,{size:16}):g==="tablet"?r.jsx($i,{size:16}):r.jsx(Mr,{size:16})})}),r.jsx(gt,{children:e(Er[g])})]}),li,r.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[qt&&r.jsx(ad,{tests:$a,load:Fa,onOpen:()=>Da(!0),options:W,onChange:u=>{Y(u),o.previewAsChanged()},available:!!bs||!xn||!wn}),r.jsx(Ze,{onClick:za,disabled:Ae&&!En,"aria-label":e("sandbox.preview.openInNewTab"),children:r.jsx(Or,{size:16})})]})]}):null,ci=(Le||d)&&te.mode==="sandbox",ts=jd[g],ss=g==="desktop"&&(O.width===0||O.width>=ts.width+2*jr),Jn=ss?1:Math.min(O.width>0?O.width/(ts.width+2*jr):1,1),di=ss?{width:"100%",height:"100%"}:{width:`${ts.width}px`,height:O.height>0?`${O.height/Jn}px`:`${ts.height}px`,transform:`scale(${Jn})`,transformOrigin:"top center"},Yn=r.jsxs(r.Fragment,{children:[ci&&(es||p)&&r.jsx(Ze,{onClick:Xa,"aria-pressed":ye==="visual","aria-label":e("sandbox.preview.visualEditor"),active:ye==="visual",children:r.jsx(Xn,{size:16})}),f&&r.jsxs(vt,{children:[r.jsx(ht,{asChild:!0,children:r.jsx(Ze,{onClick:Za,"aria-pressed":ye==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:ye==="blocks",children:r.jsx(Fi,{size:16})})}),r.jsx(gt,{children:e("sandbox.preview.blocksEditor")})]}),nt&&r.jsxs(vt,{children:[r.jsx(ht,{asChild:!0,children:r.jsx(Ze,{onClick:$,"aria-pressed":T,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:T,children:r.jsx(Di,{size:16})})}),r.jsx(gt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),ui=!!D&&ye==="blocks";return r.jsxs("div",{className:"flex flex-col w-full h-full",children:[kt&&Object.entries(vs).map(([u,P])=>(rt[u]??"")===""?r.jsx(Ac,{sources:P,template:z,paramName:u,sandboxRef:kt,onFill:M=>Ns(u,M)},`${oe}:${u}`):null),r.jsxs(r.Fragment,{children:[r.jsx(Hs.Toolbar.Center.Portal,{fallback:r.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:Gn}),children:Gn}),r.jsx(Hs.Toolbar.Right.Portal,{fallback:Yn,children:Yn})]}),r.jsx("div",{className:"flex-1 overflow-hidden relative",children:ui?r.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[r.jsx(Sr,{virtualMcpId:t,externalSelection:C,onSectionPicked:Mn,onViewJsonFile:$}),T&&nt&&r.jsx("div",{className:"absolute inset-0 z-10",children:r.jsx(Pr,{ref:A,virtualMcpId:t,pageKey:nt,onClose:L},me.kind==="legacy"?void 0:JSON.stringify([Es,xe]))})]}):r.jsxs(cr,{orientation:"horizontal",disabled:ye!=="blocks",className:"relative isolate",children:[r.jsx(rs,{ref:j,id:"preview-blocks-editor",defaultSize:ye==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:ye==="blocks"&&r.jsx(Sr,{virtualMcpId:t,externalSelection:C,onSectionPicked:Mn,onViewJsonFile:$})}),ye==="blocks"&&r.jsx(dr,{withHandle:!0}),r.jsx(rs,{id:"preview-canvas",defaultSize:ye==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:r.jsxs(cr,{orientation:"horizontal",disabled:!(T&&nt),children:[r.jsx(rs,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:r.jsxs("div",{ref:u=>{if(!u)return;const P=()=>F(ae=>ae.width===u.clientWidth&&ae.height===u.clientHeight?ae:{width:u.clientWidth,height:u.clientHeight});P();const M=new ResizeObserver(P);return M.observe(u),()=>M.disconnect()},className:Fe("h-full relative overflow-clip flex justify-center",Et&&!ss&&"bg-muted/30"),children:[(be||Ca)&&Et&&r.jsx(Wi,{}),te.showDecidingLoader&&r.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:r.jsx(tt,{className:"size-5 text-muted-foreground"})}),te.showBlockingOverlay&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Os,{kind:"starting",progress:hn,claimPhase:xs})}),!ne&&Je.kind==="suspended"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Os,{kind:"suspended",onResume:ze.resume})}),!ne&&Je.kind==="errored"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Os,{kind:"errored",error:Je.error,onRetry:ze.retry,connectionsHref:`/${ce.slug}/settings/connections`})}),te.showWakingPill&&r.jsxs("div",{className:"absolute top-4 left-1/2 z-20 flex max-w-md -translate-x-1/2 items-start gap-3 rounded-xl bg-muted px-4 py-3 shadow-soft pointer-events-none select-none",children:[r.jsx(tt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),r.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),ye==="visual"&&!v&&r.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-special/40 bg-special/90 px-3 py-1 text-xs font-medium text-special-foreground shadow-soft backdrop-blur-sm pointer-events-none select-none",children:[r.jsx(Xn,{size:12}),e("sandbox.preview.clickElementToAsk")]}),ye==="visual"&&v&&r.jsx(Ql,{element:v,onDismiss:()=>w(null)}),Et&&Qe&&r.jsx("div",{className:Fe("shrink-0",!ss&&"bg-background shadow-edge"),style:di,onMouseLeave:Qa,children:r.jsx("iframe",{ref:S,src:lt,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Ln.handleError,onLoad:()=>{if(ys(Zn),Va(lt),Ln.handleLoad(),fe(),js.current=at.current,At&&As(Lt),te.mode!=="sandbox"||ne){(te.mode==="production"&&!te.showWakingPill||ne)&&ye==="blocks"&&Ps();return}if(yi("vm_preview_loaded",{view_mode:ye,vm_id:Ie?.sandboxHandle??null}),!E)try{const u=S.current?.contentWindow?.location?.pathname;if(!u)return;const P=$e.current;if(P!==null&&($e.current=null,Ne(u)!==Ne(P))||Ne(u)===Ne(Ce))return;Z(u),Rt({path:u,pageKey:re,params:rt})}catch{}ye==="visual"&&Fn(),ye==="blocks"&&Ps()}},te.iframeBase)})]})}),T&&nt&&r.jsxs(r.Fragment,{children:[r.jsx(dr,{withHandle:!0}),r.jsx(rs,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:r.jsx(Pr,{ref:A,virtualMcpId:t,pageKey:nt,onClose:L},me.kind==="legacy"?void 0:JSON.stringify([Es,xe]))})]})]})})]})}),r.jsx(Hc,{open:ee,onOpenChange:H,isPending:an.isPending,error:J,templates:Ge,onSubmit:ii})]})}const Js={app:null,split:!1};function _d(t){const e=le.c(24),{project:s,maxApps:n,children:a}=t,c=Ee();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={silent:!0},e[0]=d):d=e[0];const o=zi(d),i=xt();let l;e[1]!==s.metadata.runtime?(l=s.metadata.runtime??{},e[1]=s.metadata.runtime,e[2]=l):l=e[2];const m=l;let p;e[3]!==m.apps?(p=m.apps??[],e[3]=m.apps,e[4]=p):p=e[4];const f=p;let y;e[5]!==o.update||e[6]!==i||e[7]!==s.id||e[8]!==s.metadata||e[9]!==m||e[10]!==c?(y=v=>o.update.mutate({id:s.id,data:{metadata:{...ll(s.metadata),runtime:{...m,apps:v.length?v:null}}}},{onSuccess:()=>i.start(),onError:()=>ds.error(c("sandbox.appTabs.saveError"))}),e[5]=o.update,e[6]=i,e[7]=s.id,e[8]=s.metadata,e[9]=m,e[10]=c,e[11]=y):y=e[11];const x=y,b=m.path??null;let h,g;e[12]!==f||e[13]!==x?(h=v=>x([...f,{path:v}]),g=v=>x(f.filter(w=>w.path!==v)),e[12]=f,e[13]=x,e[14]=h,e[15]=g):(h=e[14],g=e[15]);let R;return e[16]!==f||e[17]!==a||e[18]!==n||e[19]!==s.id||e[20]!==b||e[21]!==h||e[22]!==g?(R=r.jsx(Od,{virtualMcpId:s.id,mainPath:b,apps:f,maxApps:n,onAddApp:h,onRemoveApp:g,children:a}),e[16]=f,e[17]=a,e[18]=n,e[19]=s.id,e[20]=b,e[21]=h,e[22]=g,e[23]=R):R=e[23],R}function Od(t){const e=le.c(102),{virtualMcpId:s,mainPath:n,apps:a,maxApps:c,onAddApp:d,onRemoveApp:o,children:i}=t,l=Ee(),m=ta(),{currentBranch:p}=st(),f=xt(),y=en().lifecycle.phase,x=It(s,p),{url:b}=Zr(s);let h;e[0]!==x||e[1]!==b?(h=He(x)??b,e[0]=x,e[1]=b,e[2]=h):h=e[2];const g=h,R=g??f.previewUrl,v=!!g||y==="running",w=!v&&f.status==="errored";let C;e[3]!==f.vmEntry?.startedWith?.apps?(C=f.vmEntry?.startedWith?.apps??[],e[3]=f.vmEntry?.startedWith?.apps,e[4]=C):C=e[4];const k=C;let S;e[5]!==s?(S=Ks.previewAppLayout(s),e[5]=s,e[6]=S):S=e[6];const[j,T]=Us(S,$d);let B;e[7]!==a||e[8]!==j?(B=a.some(fe=>fe.path===j.app)?j.app:null,e[7]=a,e[8]=j,e[9]=B):B=e[9];const A=B,L=A!==null&&j.split&&!m,$=A===null||L,O=A??a[0]?.path??null,[F,I]=N.useState(null),[G,W]=N.useState(!1);let Y;e[10]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>{I(null),W(!1)},e[10]=Y):Y=e[10];const q=Y;let Q;e[11]!==a||e[12]!==F||e[13]!==m||e[14]!==n||e[15]!==d||e[16]!==T?(Q=()=>{if(F===null)return;const fe=pr(F);if(!fe){q();return}if(fe===pr(n??"")||a.some(ce=>ce.path===fe)){W(!0);return}d(fe),T({app:fe,split:!m}),q()},e[11]=a,e[12]=F,e[13]=m,e[14]=n,e[15]=d,e[16]=T,e[17]=Q):Q=e[17];const K=Q;let ee;e[18]!==n||e[19]!==l?(ee=n?$s(n):l("sandbox.appTabs.root"),e[18]=n,e[19]=l,e[20]=ee):ee=e[20];const H=ee;let J;e[21]!==L||e[22]!==l?(J=l(L?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=L,e[22]=l,e[23]=J):J=e[23];const V=J;let E;e[24]!==l?(E=l("sandbox.appTabs.label"),e[24]=l,e[25]=E):E=e[25];let _;e[26]!==l?(_=l("sandbox.appTabs.main"),e[26]=l,e[27]=_):_=e[27];let D;e[28]!==l?(D=l("sandbox.appTabs.mainHint"),e[28]=l,e[29]=D):D=e[29];let U;e[30]!==T?(U=()=>T(Js),e[30]=T,e[31]=U):U=e[31];let X;e[32]!==w||e[33]!==H||e[34]!==v||e[35]!==$||e[36]!==_||e[37]!==D||e[38]!==U?(X=r.jsx(Nr,{label:H,badge:_,hint:D,ready:v,failed:w,onScreen:$,onSelect:U}),e[32]=w,e[33]=H,e[34]=v,e[35]=$,e[36]=_,e[37]=D,e[38]=U,e[39]=X):X=e[39];let se;if(e[40]!==a||e[41]!==A||e[42]!==w||e[43]!==H||e[44]!==o||e[45]!==v||e[46]!==T||e[47]!==L||e[48]!==l){let fe;e[50]!==A||e[51]!==w||e[52]!==H||e[53]!==o||e[54]!==v||e[55]!==T||e[56]!==L||e[57]!==l?(fe=ce=>{const Re=$s(ce.path);return r.jsx(Nr,{label:Re,hint:l("sandbox.appTabs.extraHint",{app:H}),ready:v,failed:w,onScreen:ce.path===A,onSelect:()=>T({app:ce.path,split:L}),onRemove:()=>o(ce.path),removeLabel:l("sandbox.appTabs.remove",{app:Re})},ce.path)},e[50]=A,e[51]=w,e[52]=H,e[53]=o,e[54]=v,e[55]=T,e[56]=L,e[57]=l,e[58]=fe):fe=e[58],se=a.map(fe),e[40]=a,e[41]=A,e[42]=w,e[43]=H,e[44]=o,e[45]=v,e[46]=T,e[47]=L,e[48]=l,e[49]=se}else se=e[49];let z;e[59]!==X||e[60]!==se||e[61]!==E?(z=r.jsxs("div",{role:"tablist","aria-label":E,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[X,se]}),e[59]=X,e[60]=se,e[61]=E,e[62]=z):z=e[62];let Z;e[63]!==a.length||e[64]!==K||e[65]!==F||e[66]!==G||e[67]!==c||e[68]!==l?(Z=F!==null?r.jsx("form",{className:"w-40 shrink-0",onSubmit:fe=>{fe.preventDefault(),K()},children:r.jsx("input",{autoFocus:!0,value:F,placeholder:"apps/checkout","aria-label":l("sandbox.appTabs.pathLabel"),"aria-invalid":G,onChange:fe=>{I(fe.target.value),W(!1)},onBlur:q,onKeyDown:fe=>{fe.key==="Escape"&&q()},className:Fe("h-7 w-full rounded-md border bg-background px-2 font-mono text-xs outline-none",G?"border-destructive":"border-border")})}):a.length<c&&r.jsx(mt,{label:l("sandbox.appTabs.add"),onClick:()=>I(""),children:r.jsx(zr,{})}),e[63]=a.length,e[64]=K,e[65]=F,e[66]=G,e[67]=c,e[68]=l,e[69]=Z):Z=e[69];let re;e[70]!==m||e[71]!==T||e[72]!==L||e[73]!==V||e[74]!==O?(re=!m&&O&&r.jsx(mt,{label:V,active:L,onClick:()=>T(L?Js:{app:O,split:!0}),children:r.jsx(Bi,{})}),e[70]=m,e[71]=T,e[72]=L,e[73]=V,e[74]=O,e[75]=re):re=e[75];let ie;e[76]!==z||e[77]!==Z||e[78]!==re?(ie=r.jsxs(r.Fragment,{children:[z,Z,re]}),e[76]=z,e[77]=Z,e[78]=re,e[79]=ie):ie=e[79];const he=ie;let pe;e[80]!==he?(pe=r.jsx(Hs.Topbar.Left.Portal,{fallback:r.jsx("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:he}),children:r.jsx("div",{className:"ml-1 flex min-w-0 items-center gap-1 border-l border-border/60 pl-2",children:he})}),e[80]=he,e[81]=pe):pe=e[81];let be;e[82]!==i||e[83]!==$?(be=$&&r.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:i}),e[82]=i,e[83]=$,e[84]=be):be=e[84];let ge;e[85]!==A||e[86]!==w||e[87]!==f.start||e[88]!==g||e[89]!==H||e[90]!==R||e[91]!==v||e[92]!==T||e[93]!==L||e[94]!==k?(ge=A!==null&&r.jsx(Dd,{name:$s(A),mainName:H,appUrl:R?cl(R,A):null,ready:v,failed:w,notStarted:!g&&!k.includes(A),onStart:f.start,className:Fe(L&&"border-l border-border"),onClose:L?()=>T({app:A,split:!1}):void 0},A),e[85]=A,e[86]=w,e[87]=f.start,e[88]=g,e[89]=H,e[90]=R,e[91]=v,e[92]=T,e[93]=L,e[94]=k,e[95]=ge):ge=e[95];let ve;e[96]!==be||e[97]!==ge?(ve=r.jsxs("div",{className:"flex min-h-0 flex-1",children:[be,ge]}),e[96]=be,e[97]=ge,e[98]=ve):ve=e[98];let Se;return e[99]!==pe||e[100]!==ve?(Se=r.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[pe,ve]}),e[99]=pe,e[100]=ve,e[101]=Se):Se=e[101],Se}function $d(t){return t??Js}function Nr(t){const e=le.c(28),{label:s,badge:n,hint:a,ready:c,failed:d,onScreen:o,onSelect:i,onRemove:l,removeLabel:m}=t,p=o?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground";let f;e[0]!==p?(f=Fe("group/app-tab flex h-7 shrink-0 items-center rounded-md text-xs transition-colors",p),e[0]=p,e[1]=f):f=e[1];const y=c?"bg-success":d?"bg-destructive":"animate-pulse bg-warning";let x;e[2]!==y?(x=Fe("size-1.5 rounded-full",y),e[2]=y,e[3]=x):x=e[3];let b;e[4]!==x?(b=r.jsx("span",{"aria-hidden":!0,className:x}),e[4]=x,e[5]=b):b=e[5];let h;e[6]!==s?(h=r.jsx("span",{className:"max-w-40 truncate",children:s}),e[6]=s,e[7]=h):h=e[7];let g;e[8]!==n?(g=n&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:n}),e[8]=n,e[9]=g):g=e[9];let R;e[10]!==o||e[11]!==i||e[12]!==b||e[13]!==h||e[14]!==g?(R=r.jsx(ht,{asChild:!0,children:r.jsxs("button",{type:"button",role:"tab","aria-selected":o,onClick:i,className:"flex h-full items-center gap-1.5 rounded-md px-2.5 focus-ring",children:[b,h,g]})}),e[10]=o,e[11]=i,e[12]=b,e[13]=h,e[14]=g,e[15]=R):R=e[15];let v;e[16]!==a?(v=r.jsx(gt,{className:"max-w-64",children:a}),e[16]=a,e[17]=v):v=e[17];let w;e[18]!==R||e[19]!==v?(w=r.jsxs(vt,{children:[R,v]}),e[18]=R,e[19]=v,e[20]=w):w=e[20];let C;e[21]!==l||e[22]!==m?(C=l&&r.jsx("button",{type:"button","aria-label":m,onClick:l,className:"-ml-1 mr-1 flex size-5 items-center justify-center rounded opacity-0 hover:bg-sidebar-accent focus-ring focus-visible:opacity-100 group-hover/app-tab:opacity-100",children:r.jsx(ma,{className:"size-3"})}),e[21]=l,e[22]=m,e[23]=C):C=e[23];let k;return e[24]!==w||e[25]!==C||e[26]!==f?(k=r.jsxs("div",{className:f,children:[w,C]}),e[24]=w,e[25]=C,e[26]=f,e[27]=k):k=e[27],k}function Dd(t){const e=le.c(71),{name:s,mainName:n,appUrl:a,ready:c,failed:d,notStarted:o,onStart:i,className:l,onClose:m}=t,p=Ee(),[f,y]=N.useState("/"),[x,b]=N.useState("desktop"),[h,g]=N.useState(0),R=N.useRef(null);let v;e[0]!==a||e[1]!==f?(v=a?dl(a,f):null,e[0]=a,e[1]=f,e[2]=v):v=e[2];const w=v;let C;e[3]!==l?(C=Fe("flex min-h-0 min-w-0 flex-1 flex-col",l),e[3]=l,e[4]=C):C=e[4];let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=D=>{D.preventDefault(),y(R.current?.value||"/")},e[5]=k):k=e[5];let S;e[6]!==s||e[7]!==p?(S=p("sandbox.appPane.path",{app:s}),e[6]=s,e[7]=p,e[8]=S):S=e[8];let j;e[9]!==f||e[10]!==S?(j=r.jsx("form",{className:"min-w-0 flex-1",onSubmit:k,children:r.jsx("input",{ref:R,defaultValue:f,"aria-label":S,className:"h-7 w-full rounded-md border border-border/60 bg-background px-2 font-mono text-xs text-muted-foreground outline-none hover:border-border focus:border-border focus:text-foreground"})}),e[9]=f,e[10]=S,e[11]=j):j=e[11];let T;e[12]!==x||e[13]!==p?(T=p(x==="desktop"?"sandbox.preview.deviceMobile":"sandbox.preview.deviceDesktop"),e[12]=x,e[13]=p,e[14]=T):T=e[14];let B;e[15]===Symbol.for("react.memo_cache_sentinel")?(B=()=>b(Bd),e[15]=B):B=e[15];let A;e[16]!==x?(A=x==="desktop"?r.jsx(Mr,{}):r.jsx(Br,{}),e[16]=x,e[17]=A):A=e[17];let L;e[18]!==T||e[19]!==A?(L=r.jsx(mt,{label:T,onClick:B,children:A}),e[18]=T,e[19]=A,e[20]=L):L=e[20];let $;e[21]!==s||e[22]!==p?($=p("sandbox.appPane.reload",{app:s}),e[21]=s,e[22]=p,e[23]=$):$=e[23];const O=!w||!c;let F,I;e[24]===Symbol.for("react.memo_cache_sentinel")?(F=()=>g(Fd),I=r.jsx(wi,{}),e[24]=F,e[25]=I):(F=e[24],I=e[25]);let G;e[26]!==$||e[27]!==O?(G=r.jsx(mt,{label:$,disabled:O,onClick:F,children:I}),e[26]=$,e[27]=O,e[28]=G):G=e[28];let W;e[29]!==s||e[30]!==p?(W=p("sandbox.appPane.openInNewTab",{app:s}),e[29]=s,e[30]=p,e[31]=W):W=e[31];const Y=!w||!c;let q;e[32]!==w?(q=()=>w&&window.open(w,"_blank","noopener"),e[32]=w,e[33]=q):q=e[33];let Q;e[34]===Symbol.for("react.memo_cache_sentinel")?(Q=r.jsx(Or,{}),e[34]=Q):Q=e[34];let K;e[35]!==W||e[36]!==Y||e[37]!==q?(K=r.jsx(mt,{label:W,disabled:Y,onClick:q,children:Q}),e[35]=W,e[36]=Y,e[37]=q,e[38]=K):K=e[38];let ee;e[39]!==s||e[40]!==m||e[41]!==p?(ee=m&&r.jsx(mt,{label:p("sandbox.appPane.close",{app:s}),onClick:m,children:r.jsx(ma,{})}),e[39]=s,e[40]=m,e[41]=p,e[42]=ee):ee=e[42];let H;e[43]!==G||e[44]!==K||e[45]!==ee||e[46]!==j||e[47]!==L?(H=r.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:[j,L,G,K,ee]}),e[43]=G,e[44]=K,e[45]=ee,e[46]=j,e[47]=L,e[48]=H):H=e[48];let J;e[49]!==n||e[50]!==p?(J=p("sandbox.appPane.previewOnly",{app:n}),e[49]=n,e[50]=p,e[51]=J):J=e[51];let V;e[52]!==J?(V=r.jsx("p",{className:"shrink-0 truncate border-b border-border bg-muted/40 px-3 py-1.5 text-xs text-muted-foreground",children:J}),e[52]=J,e[53]=V):V=e[53];let E;e[54]!==x||e[55]!==d||e[56]!==n||e[57]!==s||e[58]!==o||e[59]!==i||e[60]!==c||e[61]!==h||e[62]!==w||e[63]!==p?(E=r.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:c&&o?r.jsxs("div",{className:"flex flex-col items-center gap-3 self-center px-6 text-center",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:p("sandbox.appPane.notStarted",{app:s})}),r.jsx(_e,{size:"sm",variant:"outline",onClick:i,children:p("sandbox.appPane.start",{app:s})})]}):!c||!w?r.jsx("p",{className:"self-center px-6 text-center text-sm text-muted-foreground",children:c?p("sandbox.appPane.noUrl"):d?p("sandbox.appPane.failed",{app:n}):p("sandbox.appPane.waiting")}):r.jsx("iframe",{src:w,title:s,className:Fe("h-full bg-background",x==="mobile"?"w-[412px] max-w-full border-x border-border":"w-full")},`${w}#${h}`)}),e[54]=x,e[55]=d,e[56]=n,e[57]=s,e[58]=o,e[59]=i,e[60]=c,e[61]=h,e[62]=w,e[63]=p,e[64]=E):E=e[64];let _;return e[65]!==s||e[66]!==C||e[67]!==H||e[68]!==V||e[69]!==E?(_=r.jsxs("section",{"aria-label":s,className:C,children:[H,V,E]}),e[65]=s,e[66]=C,e[67]=H,e[68]=V,e[69]=E,e[70]=_):_=e[70],_}function Fd(t){return t+1}function Bd(t){return t==="desktop"?"mobile":"desktop"}function mt(t){const e=le.c(11),{label:s,children:n,active:a,disabled:c,onClick:d}=t;let o;e[0]!==a||e[1]!==n||e[2]!==c||e[3]!==s||e[4]!==d?(o=r.jsx(ht,{asChild:!0,children:r.jsx(Ze,{"aria-label":s,"aria-pressed":a,active:a,disabled:c,onClick:d,children:n})}),e[0]=a,e[1]=n,e[2]=c,e[3]=s,e[4]=d,e[5]=o):o=e[5];let i;e[6]!==s?(i=r.jsx(gt,{children:s}),e[6]=s,e[7]=i):i=e[7];let l;return e[8]!==o||e[9]!==i?(l=r.jsxs(vt,{children:[o,i]}),e[8]=o,e[9]=i,e[10]=l):l=e[10],l}const Md=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},zd=1e4,Id=1e4,Ud=5e3,Kd=2;function Hd(t,e){return t&&e===0?Id:Math.min(1e3*2**Math.max(0,e-1),Ud)}function Vd(t,e,s){return e?!0:t===!0&&s<Kd}function Wd(t,e){const s=le.c(11),n=Md,a=ki();let c;s[0]!==t?(c=Ys.localAppReachable(t??""),s[0]=t,s[1]=c):c=s[1];const d=c;let o;s[2]!==n||s[3]!==a||s[4]!==d||s[5]!==t?(o=async p=>{const{signal:f}=p,y=new AbortController,x=()=>y.abort();f.addEventListener("abort",x);const b=setTimeout(x,zd),h=await n(t,y.signal).catch(Gd);clearTimeout(b),f.removeEventListener("abort",x);const g=a.getQueryData(d),R=h?0:(g?.failures??0)+1;return{up:Vd(g?.up??null,h,R),failures:R}},s[2]=n,s[3]=a,s[4]=d,s[5]=t,s[6]=o):o=s[6];const i=!!t;let l;s[7]!==d||s[8]!==o||s[9]!==i?(l={queryKey:d,queryFn:o,enabled:i,retry:!1,staleTime:0,gcTime:0,refetchInterval:qd},s[7]=d,s[8]=o,s[9]=i,s[10]=l):l=s[10];const{data:m}=_r(l);return t?m?.up??null:null}function qd(t){return t.state.data?Hd(t.state.data.up,t.state.data.failures):!1}function Gd(){return!1}function Jd(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const s=e.problem;return!s||s.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:s}}return{kind:"connecting"}}function Zu(t){const e=le.c(53),{virtualMcpId:s}=t,n=Ee(),a=Ii(s),{connection:c}=ea(s),{activeTask:d,taskId:o,currentBranch:i}=st(),l=xl(o),[m,p]=N.useState(!1),f=It(s,i);let y;e[0]!==f||e[1]!==c?(y=c?He(f):null,e[0]=f,e[1]=c,e[2]=y):y=e[2];const x=y,b=Wd(x),h=ga(),g=ul("multi_app_preview");if(ml({threadId:o,sandboxBranch:d?.branch??i,agentHasRepo:Ds(a?.metadata),threadHasRepo:Ds(l)||Ds(d?.metadata)})==="none"&&!c){let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:r.jsx(mr,{className:"size-7 text-foreground"})}),e[3]=k):k=e[3];let S;e[4]!==n?(S=n("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=n,e[5]=S):S=e[5];let j;e[6]!==n?(j=n("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=n,e[7]=j):j=e[7];let T,B;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>p(!0),B=r.jsx(mr,{className:"size-4"}),e[8]=T,e[9]=B):(T=e[8],B=e[9]);let A;e[10]!==n?(A=n("mainPanelTabs.previewTab.connectGithub"),e[10]=n,e[11]=A):A=e[11];let L;e[12]!==A?(L=r.jsxs(_e,{onClick:T,children:[B,A]}),e[12]=A,e[13]=L):L=e[13];let $;e[14]!==S||e[15]!==j||e[16]!==L?($=r.jsx(fl,{className:"h-full",image:k,title:S,description:j,actions:L}),e[14]=S,e[15]=j,e[16]=L,e[17]=$):$=e[17];let O;e[18]!==m?(O=r.jsx(pl,{open:m,onOpenChange:p,mode:"agent"}),e[18]=m,e[19]=O):O=e[19];let F;return e[20]!==O||e[21]!==$?(F=r.jsxs(r.Fragment,{children:[$,O]}),e[20]=O,e[21]=$,e[22]=F):F=e[22],F}if(c&&a&&!He(f)){let k;e[23]!==h||e[24]!==f?(k=Jd({backend:f,access:h}),e[23]=h,e[24]=f,e[25]=k):k=e[25];let S;e[26]!==c.endpoint?(S=xo(c.endpoint),e[26]=c.endpoint,e[27]=S):S=e[27];let j;return e[28]!==k||e[29]!==S?(j=r.jsx(Qd,{status:k,host:S}),e[28]=k,e[29]=S,e[30]=j):j=e[30],j}if(x&&b!==!0){let k;e[31]!==n?(k=n("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=n,e[32]=k):k=e[32];let S;e[33]!==x||e[34]!==n?(S=n("mainPanelTabs.previewTab.localAppWaiting.body",{host:Yd(x)}),e[33]=x,e[34]=n,e[35]=S):S=e[35];let j;e[36]!==S?(j=r.jsx(pa,{text:S}),e[36]=S,e[37]=j):j=e[37];let T;e[38]!==n?(T=n("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=n,e[39]=T):T=e[39];let B;e[40]!==T?(B=r.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:T}),e[40]=T,e[41]=B):B=e[41];let A;return e[42]!==k||e[43]!==j||e[44]!==B?(A=r.jsx(us,{headingLevel:2,waiting:!0,title:k,lead:j,footer:B}),e[42]=k,e[43]=j,e[44]=B,e[45]=A):A=e[45],A}let v;e[46]!==s?(v=r.jsx(Ad,{virtualMcpId:s}),e[46]=s,e[47]=v):v=e[47];const w=v;let C;return e[48]!==a||e[49]!==g||e[50]!==w||e[51]!==c?(C=r.jsx(Si,{children:g&&a&&!c?r.jsx(_d,{project:a,maxApps:il,children:w}):w}),e[48]=a,e[49]=g,e[50]=w,e[51]=c,e[52]=C):C=e[52],C}function Yd(t){try{return new URL(t).host}catch{return t}}function Qd(t){const e=le.c(13),{status:s,host:n}=t,a=Ee();if(s.kind==="connected"){let o;e[0]!==a?(o=a("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=a,e[1]=o):o=e[1];let i;e[2]!==a?(i=a("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=a,e[3]=i):i=e[3];let l;return e[4]!==o||e[5]!==i?(l=r.jsx(us,{headingLevel:2,waiting:!1,title:o,lead:i}),e[4]=o,e[5]=i,e[6]=l):l=e[6],l}let c;e[7]!==n||e[8]!==s?(c=Sl(s,n),e[7]=n,e[8]=s,e[9]=c):c=e[9];let d;return e[10]!==n||e[11]!==c?(d=r.jsx(kl,{wait:c,hosts:n}),e[10]=n,e[11]=c,e[12]=d):d=e[12],d}export{kl as L,Zu as P,us as S,Xu as u};
|