decocms 4.574.8 → 4.574.9
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-BAmHKKsU.js → AlertCircle-BrBujzmj.js} +1 -1
- package/dist/client/assets/{AreaChart-Dzi9L-5c.js → AreaChart-Bs4ZyKEJ.js} +1 -1
- package/dist/client/assets/{ArrowLeft-gk0ZCHpe.js → ArrowLeft-B2qsUhAF.js} +1 -1
- package/dist/client/assets/{ArrowUp-Oow5hGQz.js → ArrowUp-Bq_XWrMf.js} +1 -1
- package/dist/client/assets/{CartesianChart-GB7-WfQw.js → CartesianChart-BzQXSn72.js} +1 -1
- package/dist/client/assets/{CategoricalChart-BQlyLGsu.js → CategoricalChart-B34tgPab.js} +1 -1
- package/dist/client/assets/{CheckCircle-DmfFwydo.js → CheckCircle-BrU3KNn_.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-DhmNgA1s.js → ChevronSelectorVertical-C15U3mNk.js} +1 -1
- package/dist/client/assets/{ChevronUp-h3R0LiST.js → ChevronUp-CxdkHAYX.js} +1 -1
- package/dist/client/assets/{CreditCard01-opvzFjuh.js → CreditCard01-gy5ViYmH.js} +1 -1
- package/dist/client/assets/{Globe04-B7My-KRc.js → Globe04-Qb5La101.js} +1 -1
- package/dist/client/assets/{Key01-DtUFXCmn.js → Key01-XBNKfFAD.js} +1 -1
- package/dist/client/assets/{LinkBroken01-DbqgHdC0.js → LinkBroken01-BNA4t2nT.js} +1 -1
- package/dist/client/assets/{Minus-BrKkP3oW.js → Minus-BQ1U44OY.js} +1 -1
- package/dist/client/assets/{Monitor01-ZcR52K7T.js → Monitor01-CTMwaVR_.js} +1 -1
- package/dist/client/assets/{Play-CmLZLyOc.js → Play-oyq9OzZ5.js} +1 -1
- package/dist/client/assets/{Plus-Ci-A-fWx.js → Plus-B14W9n_P.js} +1 -1
- package/dist/client/assets/{ReferenceLine-k6lFOpoF.js → ReferenceLine-CBcoZK_U.js} +1 -1
- package/dist/client/assets/{SearchMd-DjJWIBOz.js → SearchMd-DDYfB5ME.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DqYzokeC.js → ShoppingBag01-B4Qpz0kc.js} +1 -1
- package/dist/client/assets/{Sun-DRGxYgs4.js → Sun-SepDLWMM.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BUmyYri2.js → SwitchHorizontal01-B1owjF7D.js} +1 -1
- package/dist/client/assets/{Tool01-BpRZdana.js → Tool01-D4V2T_mI.js} +1 -1
- package/dist/client/assets/{Tooltip-CiaiPRI1.js → Tooltip-BrxiV7qQ.js} +1 -1
- package/dist/client/assets/{Trash01-b7MmLF07.js → Trash01-CTl0J4n_.js} +1 -1
- package/dist/client/assets/{Upload01-DGExuych.js → Upload01-CE3wDuuV.js} +1 -1
- package/dist/client/assets/{UserSquare-aPvg2Nw7.js → UserSquare-D6mrj9zR.js} +1 -1
- package/dist/client/assets/{Users01-BKOqY1GP.js → Users01-vnVJQGsa.js} +1 -1
- package/dist/client/assets/{XClose-w7hRM8A3.js → XClose-DWFAtfm6.js} +1 -1
- package/dist/client/assets/{Zap-z5XiOqRJ.js → Zap-4X8Ik5ls.js} +1 -1
- package/dist/client/assets/{access-gate-DVYwMQ0P.js → access-gate-CmrYCcY4.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-KFg0vdbz.js → add-connection-dialog-C7VuLdpX.js} +1 -1
- package/dist/client/assets/agent-app-D6yj-pMQ.js +1 -0
- package/dist/client/assets/{agent-assets-DBXXdN-F.js → agent-assets-CtfeFO-q.js} +1 -1
- package/dist/client/assets/{agent-automation-mqokXjnT.js → agent-automation-CBfmQGxD.js} +1 -1
- package/dist/client/assets/{agent-automations-4REoeTdH.js → agent-automations-C9pDoA5t.js} +1 -1
- package/dist/client/assets/{agent-calendar-D3Ep29wr.js → agent-calendar-Dpbs8ukc.js} +1 -1
- package/dist/client/assets/{agent-capabilities-CVf7Tm9q.js → agent-capabilities-CANCMZIX.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-5aNARyd1.js → agent-connect-sources-CUOKdCzE.js} +1 -1
- package/dist/client/assets/agent-deck-9cClb9g8.js +1 -0
- package/dist/client/assets/{agent-e2e-B_HILHfY.js → agent-e2e-Do0w1Fmk.js} +1 -1
- package/dist/client/assets/agent-experiments-i1khXsMD.js +1 -0
- package/dist/client/assets/{agent-file-ChXQ_dxN.js → agent-file-BGZ-rpXM.js} +1 -1
- package/dist/client/assets/{agent-hosting-Q-HUFuhy.js → agent-hosting-BcEptfro.js} +1 -1
- package/dist/client/assets/{agent-icon-Cq6bkxhD.js → agent-icon-C4zAUQeZ.js} +1 -1
- package/dist/client/assets/agent-library-D7XfbskT.js +1 -0
- package/dist/client/assets/agent-library-file-BETUEujK.js +1 -0
- package/dist/client/assets/agent-overview-BT1unfrS.js +1 -0
- package/dist/client/assets/{agent-releases-V69FFrsa.js → agent-releases-dth3gbg2.js} +1 -1
- package/dist/client/assets/agent-settings-CjJHki-K.js +1 -0
- package/dist/client/assets/{agent-site-editor-CN1s3wDa.js → agent-site-editor--0x03xZz.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-B-MqMBV6.js +2 -0
- package/dist/client/assets/agent-site-editor-content-T7SQ0eTX.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-CLHaZdDj.js +1 -0
- package/dist/client/assets/agent-view-BD06Jv6z.js +1 -0
- package/dist/client/assets/{agent-view-guard-D_qa8QG0.js → agent-view-guard-DRTikUW7.js} +1 -1
- package/dist/client/assets/{ai-providers-Dpuo8FL0.js → ai-providers-BIsnOJUw.js} +1 -1
- package/dist/client/assets/{alert-UQKKr_Kk.js → alert-ChcrHQqB.js} +1 -1
- package/dist/client/assets/{analytics-sections-CplA1JwF.js → analytics-sections-IEaJPRpN.js} +1 -1
- package/dist/client/assets/api-keys-BEjN8NqZ.js +1 -0
- package/dist/client/assets/{api-keys-C2CtORaM.js → api-keys-DyiCkrNJ.js} +1 -1
- package/dist/client/assets/{app-editor-DxS_SOS1.js → app-editor-cC2ECYDV.js} +1 -1
- package/dist/client/assets/{asset-utils-D7YjAVSU.js → asset-utils-BemSLLjv.js} +1 -1
- package/dist/client/assets/{auth-Cy8U0vN0.js → auth-DZBq7iRr.js} +1 -1
- package/dist/client/assets/{auth-catchall-BzWkrG7V.js → auth-catchall-DrPulr77.js} +1 -1
- package/dist/client/assets/{auth-entry-D9eSm7L9.js → auth-entry-7YktIufn.js} +1 -1
- package/dist/client/assets/{auth-split-layout-QrGrLjO_.js → auth-split-layout-BIjGKhmF.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-qsvUUvW_.js → authenticate-and-persist-oauth-DArrCFGG.js} +1 -1
- package/dist/client/assets/{automation-list-row-CirPKB_R.js → automation-list-row-DjfCNmU2.js} +1 -1
- package/dist/client/assets/{automation-runs-DkcFNSpy.js → automation-runs-HL4m0VQL.js} +1 -1
- package/dist/client/assets/{automations-DQrJLYNP.js → automations-B1iMF-BH.js} +1 -1
- package/dist/client/assets/{autosend-BneXym43.js → autosend-VANv9yLj.js} +1 -1
- package/dist/client/assets/{badge-DkIOux3v.js → badge-DaX-o_aM.js} +1 -1
- package/dist/client/assets/{block-document-C7UjkOY9.js → block-document-Cx04oYbY.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-CfDmwLLA.js → blocks-preview-workspace-context-DgF7HYHj.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-BfcuzOZT.js → blocks-tab-states-C8jjKnoC.js} +1 -1
- package/dist/client/assets/{blog-schema-D_gjHI6M.js → blog-schema-O25l7G8m.js} +1 -1
- package/dist/client/assets/{buckets-CzLaj5xW.js → buckets-Bb4wZzzE.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-UX5YM4et.js → build-improve-prompt-doc-BQ6BtFA5.js} +1 -1
- package/dist/client/assets/{calendar-DoivltYN.js → calendar-CI3L7G9u.js} +1 -1
- package/dist/client/assets/{capability-load-error-Dk8QULrM.js → capability-load-error-De4jloBS.js} +1 -1
- package/dist/client/assets/{category-editor-CKte_uBr.js → category-editor-DMUoSfne.js} +1 -1
- package/dist/client/assets/{chart-BpO8BFbN.js → chart-DFYkssKS.js} +1 -1
- package/dist/client/assets/{chat-context-B1Dc5lsu.js → chat-context-BFrEkp-x.js} +1 -1
- package/dist/client/assets/{chat-draft-zRebzdTN.js → chat-draft-WVue6bVm.js} +1 -1
- package/dist/client/assets/{checkbox-BADwu2Rj.js → checkbox-C9g8LYdj.js} +1 -1
- package/dist/client/assets/{choose-editor-mfO2CtNV.js → choose-editor-K8PxtGC5.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BkkXQ3np.js → cli-auth-success-7WGG5Ny7.js} +1 -1
- package/dist/client/assets/{client-icons-CHsHOEe7.js → client-icons-Dg3AySOi.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-DfZDkcQ1.js → cms-settings-editor-BGVlbtsi.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-BuRwcXPq.js → cms-store-drafts-B7OZSklj.js} +1 -1
- package/dist/client/assets/{collapsible-BFh_qMlo.js → collapsible-CouDnhO6.js} +1 -1
- package/dist/client/assets/{collection-detail-Cq-xHp6m.js → collection-detail-UPbZXX41.js} +1 -1
- package/dist/client/assets/{collection-display-button-BYbMEj23.js → collection-display-button-D8katl6X.js} +1 -1
- package/dist/client/assets/{collection-search-Bg84Y9_0.js → collection-search-OjmLQPGA.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-4Lsn1giX.js → collection-table-wrapper-BC08hxFi.js} +1 -1
- package/dist/client/assets/{collection-tabs-D57aIX5v.js → collection-tabs-CwlrIKLz.js} +1 -1
- package/dist/client/assets/{combobox-iSV-CQzM.js → combobox-Fnhph1yB.js} +1 -1
- package/dist/client/assets/{command-CnVdPyj_.js → command-DZp1V8X-.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-Bmqe6SeC.js → companion-mcps-section-1gPvogQd.js} +1 -1
- package/dist/client/assets/{config-DUlh6l4D.js → config-C4Gsnqii.js} +1 -1
- package/dist/client/assets/{connect-Bw0GJuTn.js → connect-DiSxRkvs.js} +1 -1
- package/dist/client/assets/{connect-layout-CwJayWyX.js → connect-layout-DQX9wvNz.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-B1fyzn4u.js → connect-source-dialog-ZMMXP6WV.js} +1 -1
- package/dist/client/assets/{connection-Ds0NPGRv.js → connection-B5iqnjJS.js} +1 -1
- package/dist/client/assets/{connection-card-Cnzr9qgv.js → connection-card-dWBeLnkC.js} +1 -1
- package/dist/client/assets/{connection-detail-C94Si9oS.js → connection-detail-vQx4JY7p.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DLZm80Vh.js → connection-form-helpers-C-PfuEYz.js} +1 -1
- package/dist/client/assets/{connection-slug-JtkQvH-U.js → connection-slug-BPPZqv13.js} +1 -1
- package/dist/client/assets/{connections-BwWpc88q.js → connections-BNB5dOFV.js} +1 -1
- package/dist/client/assets/{content-tab-Frzx5T6f.js → content-tab-BjndC62X.js} +3 -3
- package/dist/client/assets/{context--tEugIHA.js → context-B-eGOpuA.js} +1 -1
- package/dist/client/assets/{context-menu-DmK-hmJb.js → context-menu-DqHkPsZX.js} +1 -1
- package/dist/client/assets/{context-shell-M8Z1NRsU.js → context-shell-DkPH0WI3.js} +3 -3
- package/dist/client/assets/{core.esm-PCFOeq2F.js → core.esm-CEehG5ej.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-c0RCVWjZ.js → create-organization-dialog-C-eZv_C7.js} +1 -1
- package/dist/client/assets/{device-hint-Cb5Yk9vR.js → device-hint-juJpe-S9.js} +1 -1
- package/dist/client/assets/{discover-1n4s1YWq.js → discover-COI3hr0O.js} +1 -1
- package/dist/client/assets/{domain-settings-BWnBbfZl.js → domain-settings-BBV7EcxE.js} +1 -1
- package/dist/client/assets/{drawer-BbDXg4uh.js → drawer-CwBC6h27.js} +1 -1
- package/dist/client/assets/{editor-SbnY9UBB.js → editor-YZleAELh.js} +1 -1
- package/dist/client/assets/{editor-classes-DIUoFA4r.js → editor-classes-CK9ai0gl.js} +1 -1
- package/dist/client/assets/{empty-state-Dx0vUNGR.js → empty-state-B9QiU_VY.js} +1 -1
- package/dist/client/assets/{empty-state-DUtU0We7.js → empty-state-CwTtE-MO.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-8BUY4PRB.js → experiments-tab-choice-C1gEvb6G.js} +1 -1
- package/dist/client/assets/{extract-connection-data-5aIWs5nm.js → extract-connection-data-CkWpG9Fj.js} +1 -1
- package/dist/client/assets/{feature-gate-B4_WUn2S.js → feature-gate-CEDC08jo.js} +1 -1
- package/dist/client/assets/{feature-paywall-Ci_hk3eZ.js → feature-paywall-UROHXvVY.js} +1 -1
- package/dist/client/assets/{file-explorer-DS7-0IU7.js → file-explorer-DktEvpiP.js} +1 -1
- package/dist/client/assets/{file-preview-3QxlKUQz.js → file-preview-xiRlJpsu.js} +1 -1
- package/dist/client/assets/{file-share-button-CA034yeE.js → file-share-button-Br7H7qe9.js} +1 -1
- package/dist/client/assets/{file-type-icon-Bp2pbI2H.js → file-type-icon-BRiZbFJM.js} +1 -1
- package/dist/client/assets/{folder-icon-BkUUZm4G.js → folder-icon-CHiicbmI.js} +1 -1
- package/dist/client/assets/{form-BZxHXIID.js → form-BbCRE2mk.js} +1 -1
- package/dist/client/assets/{general-j2gaIDEz.js → general-CYLLbCmH.js} +1 -1
- package/dist/client/assets/{github-icon-ddw588tY.js → github-icon-q1xudgoP.js} +1 -1
- package/dist/client/assets/{home-8Ff5iue5.js → home-CVchwepi.js} +1 -1
- package/dist/client/assets/{home-overview-DGDE6TGI.js → home-overview-BGSikjDJ.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-DB9dOS9F.js → hosted-reconcile-rqZnV2Vw.js} +1 -1
- package/dist/client/assets/{icon-button-D5w08aAD.js → icon-button-Bq3ZJEeE.js} +1 -1
- package/dist/client/assets/{index-Cp6n42Yr.js → index-BD2-Tfve.js} +3 -3
- package/dist/client/assets/{index-CTsVtX6Z.js → index-BD6O45bL.js} +1 -1
- package/dist/client/assets/{index-Bew7RNKQ.js → index-BEFauG6g.js} +1 -1
- package/dist/client/assets/{index-CuNO2v8I.js → index-BW39Ccy3.js} +1 -1
- package/dist/client/assets/{index--SSY-JG1.js → index-BfxFxvBn.js} +1 -1
- package/dist/client/assets/{index-D4OC_zRz.js → index-CGTT47Gs.js} +1 -1
- package/dist/client/assets/{index-B5NK1-t4.js → index-CH4-90Yv.js} +1 -1
- package/dist/client/assets/{index-CMIbJ8MG.js → index-CdvPHHMd.js} +1 -1
- package/dist/client/assets/{index-Dz6SE42K.js → index-CwSLxVp3.js} +1 -1
- package/dist/client/assets/{index-Bs6auyxm.js → index-D8kKxC0w.js} +1 -1
- package/dist/client/assets/{index-CH52vsqw.js → index-DLzGeaMa.js} +1 -1
- package/dist/client/assets/{index-DXV9Rrgh.js → index-DRQaomOR.js} +1 -1
- package/dist/client/assets/{index-CllkIJqm.js → index-DcLP2Uex.js} +1 -1
- package/dist/client/assets/{index-BSoGrbzN.js → index-KVVHw2gU.js} +1 -1
- package/dist/client/assets/{index-DZucODSP.js → index-ULZrkDIx.js} +1 -1
- package/dist/client/assets/{index-DY7W6fVv.js → index-WlHdhzWm.js} +1 -1
- package/dist/client/assets/{index-redirect-D5oUlGVq.js → index-redirect-cM8n5Bf0.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-C6Hka48g.js → infiniteQueryObserver-CFbscoFz.js} +1 -1
- package/dist/client/assets/{infra-billing-cI61pY-d.js → infra-billing-CVwEnJc4.js} +1 -1
- package/dist/client/assets/{input-DGGlfIK5.js → input-mbVW2uET.js} +1 -1
- package/dist/client/assets/{input-C0CJR9vr.js → input-vtcNycLk.js} +3 -3
- package/dist/client/assets/{integration-icon-C9enxTmo.js → integration-icon-C5Anrc8v.js} +1 -1
- package/dist/client/assets/{jira-icon-BrLIhIWw.js → jira-icon-Bmi1xI6r.js} +1 -1
- package/dist/client/assets/{label-DollvLW8.js → label-CZVy73g_.js} +1 -1
- package/dist/client/assets/{layout-BfONeqKu.js → layout-mU_v4Bh-.js} +1 -1
- package/dist/client/assets/{legacy-admin-welcome-dialog-DGD5VDL8.js → legacy-admin-welcome-dialog-xczBeRkI.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-gnvJlDT7.js → legacy-agents-deep-DOprMiQ8.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-Ceue37fQ.js → legacy-main-redirect-frLtUhr7.js} +1 -1
- package/dist/client/assets/library-H2QdAzSR.js +1 -0
- package/dist/client/assets/{library-tab-C4UPTrtu.js → library-tab-DB25yn1i.js} +1 -1
- package/dist/client/assets/{login-BJ2i0F0x.js → login-CmHRnJOc.js} +1 -1
- package/dist/client/assets/{markdown-BAasaHPS.js → markdown-Bn6_U_KJ.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BZ0wqpxq.js → mcp-app-renderer-CLwGZiBS.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BdTbmZs-.js → mcp-oauth-DLp_LyKE.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DMVjZNG4.js → mcp-oauth-nWMLUxbw.js} +1 -1
- package/dist/client/assets/{members-B5rwN-xs.js → members-ZiG-LF73.js} +1 -1
- package/dist/client/assets/{memory-D2wUtT6f.js → memory-Bc4AG_R5.js} +1 -1
- package/dist/client/assets/{mock-board-B5ve8ttC.js → mock-board-vq_twtUH.js} +3 -3
- package/dist/client/assets/{monaco-editor-D3FwWS6z.js → monaco-editor-Cwn1FokD.js} +1 -1
- package/dist/client/assets/{monitoring-NCSiQ2Pk.js → monitoring-Ck9IWyMH.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-us5YxB_s.js → monitoring-stats-row-CBa0yJyc.js} +1 -1
- package/dist/client/assets/{multi-select-C9p48rxb.js → multi-select-VgSnOaCE.js} +1 -1
- package/dist/client/assets/{mustache-BE51OfHp.js → mustache-DsmTghzT.js} +1 -1
- package/dist/client/assets/{named-rule-view-Dr1gx6K_.js → named-rule-view-D2hRJFjn.js} +1 -1
- package/dist/client/assets/{new-project-dialog-COHpjNot.js → new-project-dialog-Bq2ZRt1E.js} +1 -1
- package/dist/client/assets/{oauth-callback-CUBLm5wr.js → oauth-callback-DisZamoA.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CIj7gVYm.js → oauth-callback-ai-provider-CQY9pH53.js} +1 -1
- package/dist/client/assets/{oauth-consent-bt38CVDY.js → oauth-consent-BLSOh8Vc.js} +1 -1
- package/dist/client/assets/{onboarding-Bx5RinvH.js → onboarding-knc2o8kj.js} +1 -1
- package/dist/client/assets/{openai-conversation-BtohP0w7.js → openai-conversation-D0zBymrP.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BFYfi1F9.js → optimistic-project-sidebar-views-CkyuDF51.js} +1 -1
- package/dist/client/assets/{order-monitor-day-CKVt2dpk.js → order-monitor-day--YYykwM7.js} +1 -1
- package/dist/client/assets/{organization-choice-BLQB1MdJ.js → organization-choice-DihqTAxR.js} +1 -1
- package/dist/client/assets/{orgs-CEDevUSC.js → orgs-05_Ljhax.js} +1 -1
- package/dist/client/assets/{own-accounts-section-BvxGuDLU.js → own-accounts-section-Vq-dKaIp.js} +1 -1
- package/dist/client/assets/{pair-BjJ0vlX3.js → pair-B-D0jk5j.js} +1 -1
- package/dist/client/assets/{parse-sections-CLMVUWEK.js → parse-sections-DH_6p8mX.js} +3 -3
- package/dist/client/assets/{plan-KNHptWXW.js → plan-C8ZCF1fK.js} +1 -1
- package/dist/client/assets/{plan-ladder-NH52TbUB.js → plan-ladder-ia9SV_u2.js} +1 -1
- package/dist/client/assets/{plan-usage-card-CicIxe-V.js → plan-usage-card-BhMgoOQ-.js} +1 -1
- package/dist/client/assets/{popover-D24o9prf.js → popover-BX49i_9-.js} +1 -1
- package/dist/client/assets/{post-calendar-Bz188EnX.js → post-calendar-BRPy06yS.js} +1 -1
- package/dist/client/assets/{post-editor-CuUceih2.js → post-editor-DO094Qrr.js} +1 -1
- package/dist/client/assets/{preview-content-BA-6vON6.js → preview-content-ByMvryRR.js} +1 -1
- package/dist/client/assets/{preview-dialog-oxja9bAU.js → preview-dialog-CsbNSWkE.js} +1 -1
- package/dist/client/assets/{preview-panel-D9I-ugJU.js → preview-panel-CBrKmmim.js} +1 -1
- package/dist/client/assets/{preview-tab-BwdMydLW.js → preview-tab-DEjq4YQm.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-COzRJ8BW.js → product-picker-dialog-D8SJ6ifV.js} +1 -1
- package/dist/client/assets/{profile-My2od47M.js → profile-DGZtmJpW.js} +1 -1
- package/dist/client/assets/{project-app-view-E76q47JL.js → project-app-view-CSFErIuG.js} +1 -1
- package/dist/client/assets/{project-apps-DrYTNZ5G.js → project-apps-DsmVr6MW.js} +1 -1
- package/dist/client/assets/{project-icon-BM-iwutu.js → project-icon-BMNmURUS.js} +1 -1
- package/dist/client/assets/{project-index-BUVdFrBG.js → project-index-Cf8pv3Xb.js} +1 -1
- package/dist/client/assets/project-reports-DmwAf8Qf.js +1 -0
- package/dist/client/assets/project-tasks-D5vOWT5d.js +1 -0
- package/dist/client/assets/{projects-B3gCjiBk.js → projects-BbuSRcBC.js} +1 -1
- package/dist/client/assets/{projects-empty-state-CTxV56Xs.js → projects-empty-state-D2U4ObkW.js} +1 -1
- package/dist/client/assets/{prompts-D5bhWe_R.js → prompts-ev7-vW68.js} +1 -1
- package/dist/client/assets/{record-editor-D6SsY0SM.js → record-editor-B82Hi6oO.js} +1 -1
- package/dist/client/assets/{redirect-editor-B3698ZCQ.js → redirect-editor-1Kyi1-Qo.js} +1 -1
- package/dist/client/assets/reports-D8_7BSxz.js +1 -0
- package/dist/client/assets/{reports-DaZdSGhj.js → reports-DaISkEl7.js} +1 -1
- package/dist/client/assets/{reports-onboarding-AyYmW8fp.js → reports-onboarding-3NRLE0S7.js} +1 -1
- package/dist/client/assets/{reports-tab-CxSjMYsb.js → reports-tab-BTnE3zXc.js} +2 -2
- package/dist/client/assets/repositories-Rj9HwEBO.js +1 -0
- package/dist/client/assets/{repositories-DQ6Ky9_o.js → repositories-iO0v9MBk.js} +1 -1
- package/dist/client/assets/{repository-binding-D4ffxM0-.js → repository-binding-t2SUt_ly.js} +1 -1
- package/dist/client/assets/{repository-picker-D3voXCbp.js → repository-picker-lw8HWu2E.js} +1 -1
- package/dist/client/assets/{require-capability-D4DqAm-3.js → require-capability-BpHMNsFK.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CNDWmtf1.js → required-auth-layout-D0fYWaPn.js} +1 -1
- package/dist/client/assets/{reset-password-BiiJ_CmP.js → reset-password-GLJcH65P.js} +1 -1
- package/dist/client/assets/{resizable-DsL82mTc.js → resizable-vYXdh-GF.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-BRctEg0A.js → resolve-tab-icon-V8LVv3Xn.js} +1 -1
- package/dist/client/assets/{review-settings-BJLhtyo0.js → review-settings-Daf3NI57.js} +1 -1
- package/dist/client/assets/{role-color-Lpygw__k.js → role-color-C4jOHzdR.js} +1 -1
- package/dist/client/assets/{roles-miGbxbmy.js → roles-CV8Os6WH.js} +1 -1
- package/dist/client/assets/{route-Dp0kuMSx.js → route-ChpHpM6U.js} +1 -1
- package/dist/client/assets/{route-CHU5WEK3.js → route-D4eWmnLE.js} +1 -1
- package/dist/client/assets/route-DpfhbI1P.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-WRNVQRt_.js → sandbox-lifecycle-context-wSSR64uz.js} +1 -1
- package/dist/client/assets/{schema-DEsOzh4i.js → schema-lfiSlL5j.js} +1 -1
- package/dist/client/assets/{schema-wLAfgKNj.js → schema-rAmMhTAU.js} +1 -1
- package/dist/client/assets/{scroll-area-DOw7gsKP.js → scroll-area-BdbZ2pRg.js} +1 -1
- package/dist/client/assets/{search-input-B3MNzTE0.js → search-input-DvpyQdwd.js} +1 -1
- package/dist/client/assets/{search-toggle-DReGYaJo.js → search-toggle-EaKGGn7w.js} +1 -1
- package/dist/client/assets/{secret-picker-C20_xwTo.js → secret-picker-ZdBMvgUe.js} +1 -1
- package/dist/client/assets/{secrets-BySkDPIF.js → secrets-D35RaSBM.js} +1 -1
- package/dist/client/assets/{section-array-field-DTljbrtq.js → section-array-field-C3FXtjzL.js} +1 -1
- package/dist/client/assets/{sections-BoRSb0eA.js → sections-BXC8sRej.js} +1 -1
- package/dist/client/assets/{sections-editor-CHnIwFIR.js → sections-editor-oQAkX7iV.js} +1 -1
- package/dist/client/assets/{select-CF7TydOZ.js → select-DzfQ0lJI.js} +1 -1
- package/dist/client/assets/{select-model-B9Bic-T3.js → select-model-Bc-aj0Ca.js} +1 -1
- package/dist/client/assets/{seo-editor-DOkOiarr.js → seo-editor-B-SmTz7B.js} +1 -1
- package/dist/client/assets/{separator-DhcQY19g.js → separator-CtG551Kh.js} +1 -1
- package/dist/client/assets/settings-tab--GGe5YhB.js +1 -0
- package/dist/client/assets/{sheet-BdVmV6Pq.js → sheet-ChvL33ih.js} +1 -1
- package/dist/client/assets/{shell-layout-MQ4OcCap.js → shell-layout-CUa5MDUh.js} +1 -1
- package/dist/client/assets/{site-draft-actions-BaadF58T.js → site-draft-actions-C7WlFKVv.js} +1 -1
- package/dist/client/assets/{site-draft-view-Ccdq_-fk.js → site-draft-view-CjzDGxji.js} +1 -1
- package/dist/client/assets/site-editor-BgYmGLHo.js +1 -0
- package/dist/client/assets/{site-editor-toast-DM5YZS3Y.js → site-editor-toast-CWugfiSd.js} +1 -1
- package/dist/client/assets/{skills-DJOLRmph.js → skills-C5QLe26M.js} +1 -1
- package/dist/client/assets/{slider-DJcSL4Tw.js → slider-Ecd2IIkn.js} +1 -1
- package/dist/client/assets/{sortable.esm-C_BgVL5v.js → sortable.esm-B7uFfy_P.js} +1 -1
- package/dist/client/assets/{sso-BZDDOaue.js → sso-0gVFO2bM.js} +1 -1
- package/dist/client/assets/{suggestion-B3N1mIWr.js → suggestion-DNThc8_w.js} +1 -1
- package/dist/client/assets/{super-agent-icon-g2NhNxGd.js → super-agent-icon-WK3PJICd.js} +1 -1
- package/dist/client/assets/{switch-IAv0jmhq.js → switch-rEtvwmeJ.js} +1 -1
- package/dist/client/assets/{synced-repos-GfE9kIif.js → synced-repos-CsB9l6Mv.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-CJmmHM_1.js → tab-icon-glyph-DuRegJvy.js} +1 -1
- package/dist/client/assets/{table-DO96vrVz.js → table-tgAIcOjU.js} +1 -1
- package/dist/client/assets/{tabs-B1aOuHa_.js → tabs-CRh6BkF5.js} +1 -1
- package/dist/client/assets/{task-board-Bc-7X8Cr.js → task-board-DVzbOFVa.js} +1 -1
- package/dist/client/assets/{task-route-UOwF7ZyB.js → task-route-DJww-aBE.js} +1 -1
- package/dist/client/assets/{task-status-BjQzfxdG.js → task-status-CPDhSMht.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CIxAcfXM.js → taskboard-analytics-Dmg8kQ7N.js} +1 -1
- package/dist/client/assets/{tasks-6JgQa8El.js → tasks-BSfgBHRO.js} +1 -1
- package/dist/client/assets/tasks-BiPHQc84.js +1 -0
- package/dist/client/assets/{textarea-DCa16Aq1.js → textarea-CvTlfpHc.js} +1 -1
- package/dist/client/assets/{thread-analytics-10dzcGNV.js → thread-analytics-DD_Y3FQw.js} +1 -1
- package/dist/client/assets/{thread-intent-Ddlv1EMC.js → thread-intent-BhJhZ_UP.js} +1 -1
- package/dist/client/assets/{thread-route-C_pt-wyk.js → thread-route-DFmD7mlY.js} +1 -1
- package/dist/client/assets/{thread-route-AJ1czxsb.js → thread-route-Df1f7USR.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BF95jdw2.js → thread-sheet-body-CCNPZBqb.js} +1 -1
- package/dist/client/assets/{time-range-picker-BOytGVlx.js → time-range-picker-CNJKAQia.js} +1 -1
- package/dist/client/assets/{toggle-group-DTX-YKoE.js → toggle-group-CEtlbqEu.js} +1 -1
- package/dist/client/assets/{tool-namespace-BKOiLsuX.js → tool-namespace-xhn6qzed.js} +1 -1
- package/dist/client/assets/{tool-set-selector-DnHiuvkS.js → tool-set-selector-0qJqj3BN.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BImRw-Lv.js → toolbar-icon-button-BYM1l_EM.js} +1 -1
- package/dist/client/assets/{tooltip-D6hu1dbX.js → tooltip-CPWUruKJ.js} +1 -1
- package/dist/client/assets/{tooltipContext-Dofwvvi6.js → tooltipContext-DYzAHA8b.js} +1 -1
- package/dist/client/assets/{track-t0ME1Ly8.js → track-As-I-W_o.js} +1 -1
- package/dist/client/assets/{types-CM-Rkav0.js → types-BM3wGHXs.js} +1 -1
- package/dist/client/assets/{url-slug-jY-crr9m.js → url-slug-C7LbKTWT.js} +1 -1
- package/dist/client/assets/{usage-stats-wdmn6GE1.js → usage-stats-BITMwpzs.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CRYxK9KK.js → use-ai-providers-pPbmGXbG.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-DvjmPUTS.js → use-apply-named-rule-Bv0WgvtT.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-COLxNYu8.js +1 -0
- package/dist/client/assets/{use-automations-BpFoHkvb.js → use-automations-BEx9jN5g.js} +1 -1
- package/dist/client/assets/{use-autosave-DGu11Mbg.js → use-autosave-BxToYayg.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-BKzS5s7M.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-SqWJFsf3.js → use-chat-layout-state-YDnStvp0.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-XDOPUQHc.js → use-cms-publish-actions-BJxFUgnP.js} +1 -1
- package/dist/client/assets/{use-connect-companion-B3czJAuB.js → use-connect-companion-CMi6qABv.js} +1 -1
- package/dist/client/assets/{use-connection-BQ2tY3eA.js → use-connection-BeyjX32e.js} +1 -1
- package/dist/client/assets/{use-content-sync-fcT1LgMa.js → use-content-sync-D9WlRyAv.js} +1 -1
- package/dist/client/assets/{use-copy-8YzW6-lz.js → use-copy-Yov8ynUc.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-PI2Bl-dF.js → use-date-fns-locale-CqG8akF0.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BcrhTA1Q.js → use-debounced-autosave-BwG78Eft.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BTFyu_fg.js → use-debounced-value-CjUdoTQj.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DT_w_P1F.js → use-deco-credits-CHVv60jE.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Cgg-kjzY.js → use-decopilot-events-Dxkyyj-f.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B-NX9bKA.js → use-delete-connection-DcDccx5j.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-59-ElZAe.js → use-deployment-admin-BP73XI6k.js} +1 -1
- package/dist/client/assets/{use-entitlements-DLe5ef_A.js → use-entitlements-B6JBu_O9.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-D1k789oB.js → use-fast-preview-draft-url-Be4qQSKF.js} +1 -1
- package/dist/client/assets/{use-file-configs-BpNaWDSz.js → use-file-configs-4JpNA1Tb.js} +1 -1
- package/dist/client/assets/{use-id-selection-ouzPuXIU.js → use-id-selection-CdOmebQh.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-ClYflJTd.js → use-inbox-feed-vv9gd7Sc.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BgEfhgKU.js → use-infinite-scroll-DuiGO_jY.js} +1 -1
- package/dist/client/assets/{use-join-requests-BUkPdRUf.js → use-join-requests-aN5r5Pxn.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-DvzXIGUh.js → use-main-panel-tabs-LFa8N1wr.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-D-uKGgD8.js → use-mcp-auth-status-D1KHm_6z.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DwDMU7Zt.js → use-mcp-client-Dwx3joSc.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-C6NWo9MQ.js → use-mcp-prompts-CgaLso39.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DZaATGrv.js → use-mcp-tools-KrWmb9CR.js} +1 -1
- package/dist/client/assets/{use-mobile-BGUAkmF8.js → use-mobile-BL_lLwbJ.js} +1 -1
- package/dist/client/assets/{use-move-blocks-CC7bxDZW.js → use-move-blocks-DLKMXFIt.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DgVOA-5d.js → use-navigate-to-agent-DquGUsnU.js} +1 -1
- package/dist/client/assets/{use-org-fs-DunUzjbR.js → use-org-fs-DDN_Ivwy.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DrOMrEnQ.js → use-org-repo-syncs-VLN8P34E.js} +1 -1
- package/dist/client/assets/{use-org-sso-bHD0WS2b.js → use-org-sso-DCyl-5Yq.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CPT_AQxx.js → use-organization-settings-ezDxn50S.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-1t6Rz_Yq.js → use-project-native-view-presence-Dmz_uZfw.js} +1 -1
- package/dist/client/assets/{use-project-scope-DZ381aQg.js → use-project-scope-Bv0XQrp-.js} +1 -1
- package/dist/client/assets/{use-recent-apps-CMUESJxc.js → use-recent-apps-C1nVs7iP.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-Rl_4afQa.js → use-reports-diagnostic-CG1-7P8p.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-C4Btxk0W.js → use-sandbox-events-DGTvdxAG.js} +1 -1
- package/dist/client/assets/{use-secrets-DWea_YYg.js → use-secrets-BDKLIqQa.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-C5OIxUQk.js → use-section-preview-base-RsRAdpLG.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-DwaUZcOQ.js → use-sidebar-collapsed-pjufulEj.js} +1 -1
- package/dist/client/assets/{use-tags-CnnPBapF.js → use-tags-DRgt7SdO.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BCEU5OIE.js → use-task-board-analytics-BBqVIyLD.js} +1 -1
- package/dist/client/assets/{use-task-board-events-C0YoK98Y.js → use-task-board-events-C076JDrW.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-DHx4WnJL.js → use-task-board-item-prs-CMWcegEQ.js} +1 -1
- package/dist/client/assets/{use-task-board-items-Gk66Irve.js → use-task-board-items-C3wN6VZ7.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-_ANJzZ4J.js → use-task-board-prompts-BljQAl60.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DJcBNC2v.js → use-task-metadata-IKal_B89.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-sLAJub_R.js → use-thread-outputs-DW15e6qt.js} +1 -1
- package/dist/client/assets/{use-voice-input-CxbYDlyj.js → use-voice-input-Bhc30U5o.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DIP1SnGb.js +1 -0
- package/dist/client/assets/{useQueries-mzrH2emD.js → useQueries-BWsosSvF.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DrHv36Dy.js +1 -0
- package/dist/client/assets/{users-Bu6Qt6s2.js → users-BL-cP3wa.js} +1 -1
- package/dist/client/assets/{utils-DM_dS343.js → utils-DgoaBGZ5.js} +1 -1
- package/dist/client/assets/{variant-calendar-CTxdQFVd.js → variant-calendar-D9HBG0p_.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-BVs7zu47.js → variant-matcher-override-DoXeO1c0.js} +1 -1
- package/dist/client/assets/{view-header-p1uaKDV9.js → view-header-j_OBPXJD.js} +1 -1
- package/dist/client/assets/{virtual-mcp-C1hB0s55.js → virtual-mcp-DUuDRM1F.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-xnhJvZvd.js → watch-sse-pool-Bno2kqCn.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +412 -412
- package/package.json +1 -1
- package/dist/client/assets/agent-app-DXwdoAjf.js +0 -1
- package/dist/client/assets/agent-deck-Dd-94Ll1.js +0 -1
- package/dist/client/assets/agent-experiments-ScITEgVg.js +0 -1
- package/dist/client/assets/agent-library-BeNJQBOC.js +0 -1
- package/dist/client/assets/agent-library-file-B2Ucnk93.js +0 -1
- package/dist/client/assets/agent-overview-CmWFjWhR.js +0 -1
- package/dist/client/assets/agent-settings-ClO775W2.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CbYxsWDQ.js +0 -2
- package/dist/client/assets/agent-site-editor-content-DiQWw-fO.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-lCIgS5W9.js +0 -1
- package/dist/client/assets/agent-view-BNMlU9Xn.js +0 -1
- package/dist/client/assets/api-keys-VCcvSSAk.js +0 -1
- package/dist/client/assets/library-DKGbQOFX.js +0 -1
- package/dist/client/assets/project-reports-Fc7-jScE.js +0 -1
- package/dist/client/assets/project-tasks-Bhf7Ee7Q.js +0 -1
- package/dist/client/assets/reports-CANELH-J.js +0 -1
- package/dist/client/assets/repositories-BSWAcVK8.js +0 -1
- package/dist/client/assets/route-wjqv8tCV.js +0 -1
- package/dist/client/assets/settings-tab-D25mtqBG.js +0 -1
- package/dist/client/assets/site-editor-4daajG8m.js +0 -1
- package/dist/client/assets/tasks-Cbn3588T.js +0 -1
- package/dist/client/assets/use-ask-in-chat-CTdK-Xy9.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-BY-tUedz.js +0 -1
- package/dist/client/assets/useInfiniteQuery-B3K8Xwsj.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DMjSwk6C.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 E,m as Fe,b as Ee,B as _e,aE as dn,b3 as ut,aF as $e,b4 as fi,b5 as pi,b6 as mi,b7 as hi,v as Tr,D as Cr,K as Qn,w as Rr,x as Lr,e as gi,h as tt,I as zn,y as vi,b8 as xi,a4 as pn,aY as bi,b1 as Ar,b9 as Qs,i as _r,aq as Kn,as as Hn,a7 as Or,P as Vn,E as yi,t as un,b2 as wi,q as ki}from"./index-Cp6n42Yr.js";import{u as Dr,g as Si,c as Xs,B as _n,P as Pi,a as ji,r as Ei,R as Ni,H as Ti,b as Xn,S as Ci,d as $r,l as Ri,m as Li,p as Ai,e as _i,f as On,N as Oi}from"./parse-sections-CLMVUWEK.js";import{b as Di,c as nt,r as Fr,l as Br,f as $i,g as Fi,w as Bi}from"./chat-context-B1Dc5lsu.js";import{t as Mi}from"./ChevronUp-h3R0LiST.js";import{P as Ii,Q as Ui,K as Mr,R as zi,S as Ki,b as Hi,T as Vi,U as Ir,V as Wi,W as Ur,X as Zs,Y as qi}from"./agent-icon-Cq6bkxhD.js";import{a as Gi,n as Ji}from"./UserSquare-aPvg2Nw7.js";import{s as zr}from"./Plus-Ci-A-fWx.js";import{a as Kr,b as Hr,P as Vr}from"./popover-D24o9prf.js";import{e as ft,b as pt,c as Wr,f as qr,a as Gr,C as Jr}from"./command-CnVdPyj_.js";import{b as Yi,c as Qi,u as Xi}from"./repository-binding-D4ffxM0-.js";import{a as xt}from"./sandbox-lifecycle-context-WRNVQRt_.js";import{e as Zi}from"./backoff-CrEUbyZT.js";import{r as eo}from"./thread-intent-Ddlv1EMC.js";import{u as Yr}from"./use-voice-input-CxbYDlyj.js";import{d as to,f as no,i as so,g as ro,h as ao,j as io,u as Ut,k as mn,l as Qr,m as Xe,n as oo,o as Zn,q as Xr,t as Zr,v as lo,w as co,x as ea,y as uo,c as ta,b as na,z as fo,A as He,B as po,C as mo,D as ho,E as go,F as vo,G as er,H as xo,I as tr,J as bo,K as yo,L as nr,M as sr,N as rr,O as ar,P as ir,Q as Dn,R as wo,S as ko,U as So,V as Po,e as jo}from"./site-editor-toast-DM5YZS3Y.js";import{u as sa}from"./use-mobile-BGUAkmF8.js";import{T as ht,a as gt,c as vt}from"./tooltip-D6hu1dbX.js";import{T as Ze}from"./toolbar-icon-button-BImRw-Lv.js";import{w as sn,i as Eo}from"./variant-matcher-override-BVs7zu47.js";import{s as It,n as es,a as ra,f as Ve,v as aa,u as ia,h as No,i as To,B as Co,S as Ro,C as Lo,b as Ao,e as _o,c as Oo,d as Do,N as $o,g as Fo,r as Bo,j as Mo,k as or,p as Io}from"./blocks-tab-states-BfcuzOZT.js";import{u as Uo}from"./use-fast-preview-draft-url-D1k789oB.js";import{g as zo}from"./section-array-field-DTljbrtq.js";import{g as Ko,l as oa}from"./shell-layout-MQ4OcCap.js";import{u as ts,b as Ho}from"./use-sandbox-events-C4Btxk0W.js";import{u as Wn}from"./useQueries-mzrH2emD.js";import{i as Vo}from"./LinkBroken01-DbqgHdC0.js";import{u as la}from"./blocks-preview-workspace-context-CfDmwLLA.js";import{MonacoCodeEditor as ca}from"./monaco-editor-D3FwWS6z.js";import{c as da,u as ua,i as Wo,l as qo,D as Go}from"./hosted-reconcile-DB9dOS9F.js";import{d as fa}from"./utils-DM_dS343.js";import{R as lr,a as rn,b as cr}from"./resizable-DsL82mTc.js";import{u as Jo}from"./use-blocks-v8-project-BY-tUedz.js";import{s as Yo,L as Qo,R as pa,D as dr,w as qn}from"./device-hint-Cb5Yk9vR.js";import{L as Xo}from"./label-DollvLW8.js";import{a as Zo,T as ur}from"./toggle-group-DTX-YKoE.js";import{b as el}from"./sandbox-url-D3mC8qhT.js";import{r as tl,R as nl}from"./virtual-mcp-C1hB0s55.js";import{d as sl}from"./delay-CnY5UFtP.js";import{s as ma}from"./XClose-w7hRM8A3.js";import{o as rl}from"./omit-server-managed-metadata-L5IhjRZB.js";import{a as $n,b as al,w as il,n as fr}from"./app-preview-url-9Od4s8Sz.js";import{a as ol}from"./use-organization-settings-CPT_AQxx.js";import{a as Fn}from"./agent-capabilities-CVf7Tm9q.js";import{E as ll}from"./empty-state-Dx0vUNGR.js";import{G as pr}from"./github-icon-ddw588tY.js";import{R as cl}from"./new-project-dialog-COHpjNot.js";import{r as dl}from"./preview-source-BsRLGWUP.js";import{A as ul,a as fl,b as pl}from"./alert-UQKKr_Kk.js";import{u as ml}from"./use-task-metadata-DJcBNC2v.js";function hl(t){const e=le.c(10),{waiting:n}=t,s=n?"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(Ii,{className:"size-5 sm:size-6"})}),e[0]=a):a=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=l):l=e[1];let d;e[2]!==n?(d=n&&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]=n,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:[l,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(Ui,{className:"size-5 sm:size-6"})}),e[6]=i):i=e[6];let c;return e[7]!==s||e[8]!==o?(c=r.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":s,className:"flex items-center gap-2",children:[a,o,i]}),e[7]=s,e[8]=o,e[9]=c):c=e[9],c}function gl(t){const e=le.c(22),{index:n,numbered:s,step:a,heading:l}=t,d=E.useId();let o;e[0]!==n||e[1]!==s?(o=s&&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:n}),e[0]=n,e[1]=s,e[2]=o):o=e[2];let i;e[3]!==l||e[4]!==d||e[5]!==a.title?(i=r.jsx(l,{id:d,className:"text-sm font-medium text-foreground",children:a.title}),e[3]=l,e[4]=d,e[5]=a.title,e[6]=i):i=e[6];let c;e[7]!==o||e[8]!==i?(c=r.jsxs("div",{className:"flex items-center gap-3",children:[o,i]}),e[7]=o,e[8]=i,e[9]=c):c=e[9];const m=s&&"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]!==c||e[20]!==y?(x=r.jsxs("li",{"aria-labelledby":d,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[c,y]}),e[18]=d,e[19]=c,e[20]=y,e[21]=x):x=e[21],x}const vl=[];function fn(t){const e=le.c(20),{title:n,lead:s,waiting:a,alerts:l,steps:d,footer:o,headingLevel:i}=t,c=d===void 0?vl:d,m=i===void 0?1:i,p=m===1?"h1":"h2",f=a&&c.length===0?"status":void 0;let y;e[0]!==a?(y=r.jsx(hl,{waiting:a}),e[0]=a,e[1]=y):y=e[1];let x;e[2]!==p||e[3]!==n?(x=r.jsx(p,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:n}),e[2]=p,e[3]=n,e[4]=x):x=e[4];let b;e[5]!==s?(b=s&&r.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:s}),e[5]=s,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]!==c?(g=c.length>0&&r.jsx("ol",{className:"flex flex-col gap-3",children:c.map((v,w)=>r.jsx(gl,{index:w+1,numbered:c.length>1,step:v,heading:m===1?"h2":"h3"},v.title))}),e[12]=m,e[13]=c,e[14]=g):g=e[14];let R;return e[15]!==l||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,l,g,o]})}),e[15]=l,e[16]=o,e[17]=h,e[18]=g,e[19]=R):R=e[19],R}function xl(t){const e=le.c(43),{wait:n,hosts:s,invalidLink:a}=t,l=a===void 0?!1:a,d=Ee();let o;e[0]!==l||e[1]!==d?(o=l&&r.jsx(ul,{variant:"warning",children:r.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[r.jsx(fl,{className:"line-clamp-none text-foreground",children:d("decoServe.link.invalidTitle")}),r.jsx(pl,{children:d("decoServe.link.invalidBody")})]})}),e[0]=l,e[1]=d,e[2]=o):o=e[2];const i=o;if(n.kind==="problem"){let w;e[3]!==d||e[4]!==n.host||e[5]!==n.problem?(w=Yo(d,n.problem,n.host),e[3]=d,e[4]=n.host,e[5]=n.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(dr,{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(fn,{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 c=n.kind==="looking",m=c&&!n.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]!==n.kind?(y=(i||n.kind==="denied")&&r.jsxs(r.Fragment,{children:[i,n.kind==="denied"&&r.jsx(Qo,{})]}),e[18]=i,e[19]=n.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]!==s||e[26]!==c||e[27]!==d||e[28]!==n.kind||e[29]!==n.onStart||e[30]!==n.paused?(h=n.kind==="needs-gesture"?r.jsx(_e,{variant:"outline",className:"self-start",onClick:n.onStart,children:d("decoServe.guide.start")}):c&&r.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:n.paused?d("decoServe.guide.paused"):d("decoServe.guide.looking",{hosts:s})}),e[25]=s,e[26]=c,e[27]=d,e[28]=n.kind,e[29]=n.onStart,e[30]=n.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(dr,{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(fn,{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 bl(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 yl=15e3,wl=3e3;function kl(t){const{candidates:e,probe:n,onFound:s,onChange:a,doc:l=document,setTimer:d=(w,C)=>setTimeout(w,C),clearTimer:o=w=>clearTimeout(w),timeoutMs:i=wl}=t;let c={status:"searching",firstRoundDone:!1,problem:null},m=!1,p=!1,f=0,y=null,x=null;const b=()=>l.visibilityState==="hidden",h=w=>{c={...c,...w},a(c)},g=async w=>{x=new AbortController;const C=x,k=d(()=>C.abort(),i);try{return await n(w,C.signal),!0}catch(S){if(m)return!1;const j=no(S);return j.reason!=="not-answering"?h({problem:{...j,endpoint:w}}):c.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,c.status!=="searching"&&h({status:"searching"});for(const w of e){if(m)break;if(await g(w)){if(p=!1,m)return;m=!0,l.removeEventListener("visibilitychange",v),h({status:"found",firstRoundDone:!0}),s(w);return}}if(p=!1,!m){if(f+=1,c.firstRoundDone||h({firstRoundDone:!0}),b()){h({status:"paused"});return}y=d(()=>{R()},to(f,yl))}}};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 l.addEventListener("visibilitychange",v),a(c),R(),()=>{m=!0,y!==null&&o(y),x?.abort(),l.removeEventListener("visibilitychange",v)}}function Sl(t,e){return ro(t,e)}const Pl=["loopback-network","local-network-access"];async function jl(){if(so(window.location.origin))return null;for(const t of Pl)try{return await navigator.permissions.query({name:t})}catch{}return null}let ha=null,mr=!1;const Bn=new Set;function El(t){if(Bn.add(t),!mr){mr=!0;const e=n=>{ha=n;for(const s of Bn)s()};jl().then(n=>{if(!n)return e("unsupported");e(n.state),n.addEventListener("change",()=>e(n.state))})}return()=>Bn.delete(t)}const Nl={status:"stopped",firstRoundDone:!1,problem:null},Mn=new Map;function Tl(t){const e=Mn.get(t);if(e)return e;let n={status:"searching",firstRoundDone:!1,problem:null};const s=new Set;let a=null;const l={onFound:()=>{},getSnapshot:()=>n,subscribe:d=>(s.add(d),a??=kl({candidates:t.split(" "),probe:Sl,onFound:o=>l.onFound(o),onChange:o=>{n=o;for(const i of s)i()}}),()=>{s.delete(d),!(s.size>0)&&(a?.(),a=null,Mn.delete(t))})};return Mn.set(t,l),l}function ga(){return E.useSyncExternalStore(El,gr,gr)}const Cl=()=>()=>{},hr=()=>Nl,gr=()=>ha;function Qu(t){const e=le.c(9),{candidates:n,onFound:s}=t,[a,l]=E.useState(!1),d=ga(),i=(d==="granted"||d==="unsupported"||d==="prompt"&&a)&&n.length>0;let c;e[0]!==i||e[1]!==n||e[2]!==s?(c=i?Tl(n.join(" ")):null,c&&(c.onFound=s),e[0]=i,e[1]=n,e[2]=s,e[3]=c):c=e[3];const m=E.useSyncExternalStore(c?.subscribe??Cl,c?.getSnapshot??hr,c?.getSnapshot??hr),p=d==="prompt"&&!a;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(!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 vr={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Rl(t){const{previewState:e,progressStatus:n,fastPreviewActive:s=!1,fastPreviewReady:a=!1,codingSession:l=!1,hostedDraft:d=!1}=t,o=l?null:t.previewServerUrl;return t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?vr:d&&t.hostedPointerPending&&!a?{...vr,showDecidingLoader:!0}:s&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:s&&d&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!s&&e.kind==="iframe"&&n!=="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 Ll=1e4,Al=1e3,_l=3e4;function Ol({iframeRef:t,src:e,active:n}){const s=E.useRef(0),a=E.useRef(null),l=E.useRef(null),d=E.useRef(e),o=E.useRef(n);d.current=e,o.current=n;const i=()=>{a.current&&clearTimeout(a.current),l.current&&clearTimeout(l.current),a.current=null,l.current=null},c=()=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,m()},Ll)},m=()=>{if(!o.current||!d.current)return;l.current&&clearTimeout(l.current);const y=Zi(_l,Al,s.current,2,.5);s.current+=1,l.current=setTimeout(()=>{l.current=null;const x=t.current,b=d.current;!x||!b||!o.current||(x.src=b,c())},y)},p=()=>{s.current=0,i()},f=()=>{a.current&&(clearTimeout(a.current),a.current=null),m()};return E.useEffect(()=>{if(i(),s.current=0,!(!n||!e))return c(),i},[e,n]),{handleLoad:p,handleError:f}}const Dl=1500,$l=500;function Fl({iframe:t,reload:e,waitMs:n=Dl,confirmMs:s=$l}){let a;const l=()=>{clearTimeout(d),a=setTimeout(e,s)};t.addEventListener("load",l,{once:!0});const d=setTimeout(()=>{t.removeEventListener("load",l),e()},n);return()=>{clearTimeout(d),clearTimeout(a),t.removeEventListener("load",l)}}const Bl=dn({tag:$e(),id:$e(),classes:$e(),text:$e(),html:$e(),manifestKey:$e().nullable(),componentName:$e().nullable(),parents:$e(),url:$e(),path:$e(),viewport:dn({width:ut(),height:ut()}),position:dn({x:ut(),y:ut()})}),Ml=`(function() {
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-oQAkX7iV.js","assets/index-BD2-Tfve.js","assets/index-BkJtJQz4.css","assets/chat-context-BFrEkp-x.js","assets/autosend-VANv9yLj.js","assets/thread-route-DFmD7mlY.js","assets/use-project-scope-Bv0XQrp-.js","assets/repository-binding-t2SUt_ly.js","assets/use-mcp-client-Dwx3joSc.js","assets/auth-DZBq7iRr.js","assets/thread-intent-BhJhZ_UP.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-Bno2kqCn.js","assets/task-board-DVzbOFVa.js","assets/schema-rAmMhTAU.js","assets/use-entitlements-B6JBu_O9.js","assets/use-ai-providers-pPbmGXbG.js","assets/use-decopilot-events-Dxkyyj-f.js","assets/use-organization-settings-ezDxn50S.js","assets/parse-sections-DH_6p8mX.js","assets/utils-DgoaBGZ5.js","assets/agent-icon-C4zAUQeZ.js","assets/AlertCircle-BrBujzmj.js","assets/Tool01-D4V2T_mI.js","assets/ArrowUp-Bq_XWrMf.js","assets/ArrowLeft-B2qsUhAF.js","assets/LinkBroken01-BNA4t2nT.js","assets/ShoppingBag01-B4Qpz0kc.js","assets/Globe04-Qb5La101.js","assets/CheckCircle-BrU3KNn_.js","assets/ChevronUp-CxdkHAYX.js","assets/ChevronSelectorVertical-C15U3mNk.js","assets/UserSquare-D6mrj9zR.js","assets/CreditCard01-gy5ViYmH.js","assets/SwitchHorizontal01-B1owjF7D.js","assets/Key01-XBNKfFAD.js","assets/Minus-BQ1U44OY.js","assets/Monitor01-CTMwaVR_.js","assets/Sun-SepDLWMM.js","assets/Play-oyq9OzZ5.js","assets/Plus-B14W9n_P.js","assets/SearchMd-DDYfB5ME.js","assets/Trash01-CTl0J4n_.js","assets/Upload01-CE3wDuuV.js","assets/Users01-vnVJQGsa.js","assets/XClose-DWFAtfm6.js","assets/Zap-4X8Ik5ls.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-B-D0jk5j.js","assets/collapsible-CouDnhO6.js","assets/use-copy-Yov8ynUc.js","assets/usage-stats-BITMwpzs.js","assets/tool-namespace-xhn6qzed.js","assets/form-BbCRE2mk.js","assets/label-CZVy73g_.js","assets/utils-CVEq3hMx.js","assets/markdown-Bn6_U_KJ.js","assets/use-mobile-BL_lLwbJ.js","assets/tooltip-CPWUruKJ.js","assets/index-DLzGeaMa.js","assets/shell-layout-CUa5MDUh.js","assets/use-deployment-admin-BP73XI6k.js","assets/admin-fetch-BhTJlAsX.js","assets/command-DZp1V8X-.js","assets/index-KVVHw2gU.js","assets/integration-icon-C5Anrc8v.js","assets/project-icon-BMNmURUS.js","assets/use-navigate-to-agent-DquGUsnU.js","assets/use-debounced-value-CjUdoTQj.js","assets/new-project-dialog-Bq2ZRt1E.js","assets/repository-picker-lw8HWu2E.js","assets/github-icon-q1xudgoP.js","assets/useInfiniteQuery-DIP1SnGb.js","assets/infiniteQueryObserver-CFbscoFz.js","assets/collection-search-OjmLQPGA.js","assets/legacy-admin-welcome-dialog-xczBeRkI.js","assets/drawer-CwBC6h27.js","assets/required-auth-layout-D0fYWaPn.js","assets/use-org-sso-DCyl-5Yq.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-CLwGZiBS.js","assets/types-BM3wGHXs.js","assets/omit-server-managed-metadata-L5IhjRZB.js","assets/sheet-ChvL33ih.js","assets/use-connection-BeyjX32e.js","assets/use-mcp-prompts-CgaLso39.js","assets/use-thread-outputs-DW15e6qt.js","assets/file-type-icon-BRiZbFJM.js","assets/section-array-field-C3FXtjzL.js","assets/blocks-tab-states-C8jjKnoC.js","assets/site-editor-toast-CWugfiSd.js","assets/sandbox-url-D3mC8qhT.js","assets/use-sandbox-events-DGTvdxAG.js","assets/use-blocks-v8-project-BKzS5s7M.js","assets/use-voice-input-Bhc30U5o.js","assets/popover-BX49i_9-.js","assets/index-CH4-90Yv.js","assets/checkbox-C9g8LYdj.js","assets/select-DzfQ0lJI.js","assets/index-BdQq_4o_.js","assets/ai-providers-logos-DD3qZ33J.js","assets/openai-compatible-presets-BKGfVqEx.js","assets/sandbox-git-api-DcqI6XE4.js","assets/empty-state-B9QiU_VY.js","assets/hosted-reconcile-rqZnV2Vw.js","assets/slider-Ecd2IIkn.js","assets/index-BD6O45bL.js","assets/tooltipContext-DYzAHA8b.js","assets/CategoricalChart-B34tgPab.js","assets/index-D8kKxC0w.js","assets/switch-rEtvwmeJ.js","assets/textarea-CvTlfpHc.js","assets/scroll-area-BdbZ2pRg.js","assets/monaco-editor-Cwn1FokD.js","assets/editor-YZleAELh.js","assets/calendar-CI3L7G9u.js","assets/editor-classes-CK9ai0gl.js","assets/core.esm-CEehG5ej.js","assets/sortable.esm-B7uFfy_P.js","assets/toggle-group-CEtlbqEu.js","assets/active-indicator-CCMhAsc_.js","assets/combobox-Fnhph1yB.js","assets/search-input-DvpyQdwd.js","assets/tabs-CRh6BkF5.js","assets/use-file-configs-4JpNA1Tb.js","assets/asset-utils-BemSLLjv.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/mustache-DsmTghzT.js","assets/use-section-preview-base-RsRAdpLG.js","assets/seo-editor-B-SmTz7B.js","assets/use-apply-named-rule-Bv0WgvtT.js","assets/use-move-blocks-DLKMXFIt.js","assets/variant-matcher-override-DoXeO1c0.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as le,j as r,r as E,m as Fe,b as Ee,B as _e,aE as dn,b3 as ut,aF as $e,b4 as fi,b5 as pi,b6 as mi,b7 as hi,v as Tr,D as Cr,K as Qn,w as Rr,x as Lr,e as gi,h as tt,I as zn,y as vi,b8 as xi,a4 as pn,aY as bi,b1 as Ar,b9 as Qs,i as _r,aq as Kn,as as Hn,a7 as Or,P as Vn,E as yi,t as un,b2 as wi,q as ki}from"./index-BD2-Tfve.js";import{u as Dr,g as Si,c as Xs,B as _n,P as Pi,a as ji,r as Ei,R as Ni,H as Ti,b as Xn,S as Ci,d as $r,l as Ri,m as Li,p as Ai,e as _i,f as On,N as Oi}from"./parse-sections-DH_6p8mX.js";import{b as Di,c as nt,r as Fr,l as Br,f as $i,g as Fi,w as Bi}from"./chat-context-BFrEkp-x.js";import{t as Mi}from"./ChevronUp-CxdkHAYX.js";import{P as Ii,Q as Ui,K as Mr,R as zi,S as Ki,b as Hi,T as Vi,U as Ir,V as Wi,W as Ur,X as Zs,Y as qi}from"./agent-icon-C4zAUQeZ.js";import{a as Gi,n as Ji}from"./UserSquare-D6mrj9zR.js";import{s as zr}from"./Plus-B14W9n_P.js";import{a as Kr,b as Hr,P as Vr}from"./popover-BX49i_9-.js";import{e as ft,b as pt,c as Wr,f as qr,a as Gr,C as Jr}from"./command-DZp1V8X-.js";import{b as Yi,c as Qi,u as Xi}from"./repository-binding-t2SUt_ly.js";import{a as xt}from"./sandbox-lifecycle-context-wSSR64uz.js";import{e as Zi}from"./backoff-CrEUbyZT.js";import{r as eo}from"./thread-intent-BhJhZ_UP.js";import{u as Yr}from"./use-voice-input-Bhc30U5o.js";import{d as to,f as no,i as so,g as ro,h as ao,j as io,u as Ut,k as mn,l as Qr,m as Xe,n as oo,o as Zn,q as Xr,t as Zr,v as lo,w as co,x as ea,y as uo,c as ta,b as na,z as fo,A as He,B as po,C as mo,D as ho,E as go,F as vo,G as er,H as xo,I as tr,J as bo,K as yo,L as nr,M as sr,N as rr,O as ar,P as ir,Q as Dn,R as wo,S as ko,U as So,V as Po,e as jo}from"./site-editor-toast-CWugfiSd.js";import{u as sa}from"./use-mobile-BL_lLwbJ.js";import{T as ht,a as gt,c as vt}from"./tooltip-CPWUruKJ.js";import{T as Ze}from"./toolbar-icon-button-BYM1l_EM.js";import{w as sn,i as Eo}from"./variant-matcher-override-DoXeO1c0.js";import{s as It,n as es,a as ra,f as Ve,v as aa,u as ia,h as No,i as To,B as Co,S as Ro,C as Lo,b as Ao,e as _o,c as Oo,d as Do,N as $o,g as Fo,r as Bo,j as Mo,k as or,p as Io}from"./blocks-tab-states-C8jjKnoC.js";import{u as Uo}from"./use-fast-preview-draft-url-Be4qQSKF.js";import{g as zo}from"./section-array-field-C3FXtjzL.js";import{g as Ko,l as oa}from"./shell-layout-CUa5MDUh.js";import{u as ts,b as Ho}from"./use-sandbox-events-DGTvdxAG.js";import{u as Wn}from"./useQueries-BWsosSvF.js";import{i as Vo}from"./LinkBroken01-BNA4t2nT.js";import{u as la}from"./blocks-preview-workspace-context-DgF7HYHj.js";import{MonacoCodeEditor as ca}from"./monaco-editor-Cwn1FokD.js";import{c as da,u as ua,i as Wo,l as qo,D as Go}from"./hosted-reconcile-rqZnV2Vw.js";import{d as fa}from"./utils-DgoaBGZ5.js";import{R as lr,a as rn,b as cr}from"./resizable-vYXdh-GF.js";import{u as Jo}from"./use-blocks-v8-project-BKzS5s7M.js";import{s as Yo,L as Qo,R as pa,D as dr,w as qn}from"./device-hint-juJpe-S9.js";import{L as Xo}from"./label-CZVy73g_.js";import{a as Zo,T as ur}from"./toggle-group-CEtlbqEu.js";import{b as el}from"./sandbox-url-D3mC8qhT.js";import{r as tl,R as nl}from"./virtual-mcp-DUuDRM1F.js";import{d as sl}from"./delay-CnY5UFtP.js";import{s as ma}from"./XClose-DWFAtfm6.js";import{o as rl}from"./omit-server-managed-metadata-L5IhjRZB.js";import{a as $n,b as al,w as il,n as fr}from"./app-preview-url-9Od4s8Sz.js";import{a as ol}from"./use-organization-settings-ezDxn50S.js";import{a as Fn}from"./agent-capabilities-CANCMZIX.js";import{E as ll}from"./empty-state-B9QiU_VY.js";import{G as pr}from"./github-icon-q1xudgoP.js";import{R as cl}from"./new-project-dialog-Bq2ZRt1E.js";import{r as dl}from"./preview-source-BsRLGWUP.js";import{A as ul,a as fl,b as pl}from"./alert-ChcrHQqB.js";import{u as ml}from"./use-task-metadata-IKal_B89.js";function hl(t){const e=le.c(10),{waiting:n}=t,s=n?"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(Ii,{className:"size-5 sm:size-6"})}),e[0]=a):a=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=l):l=e[1];let d;e[2]!==n?(d=n&&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]=n,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:[l,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(Ui,{className:"size-5 sm:size-6"})}),e[6]=i):i=e[6];let c;return e[7]!==s||e[8]!==o?(c=r.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":s,className:"flex items-center gap-2",children:[a,o,i]}),e[7]=s,e[8]=o,e[9]=c):c=e[9],c}function gl(t){const e=le.c(22),{index:n,numbered:s,step:a,heading:l}=t,d=E.useId();let o;e[0]!==n||e[1]!==s?(o=s&&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:n}),e[0]=n,e[1]=s,e[2]=o):o=e[2];let i;e[3]!==l||e[4]!==d||e[5]!==a.title?(i=r.jsx(l,{id:d,className:"text-sm font-medium text-foreground",children:a.title}),e[3]=l,e[4]=d,e[5]=a.title,e[6]=i):i=e[6];let c;e[7]!==o||e[8]!==i?(c=r.jsxs("div",{className:"flex items-center gap-3",children:[o,i]}),e[7]=o,e[8]=i,e[9]=c):c=e[9];const m=s&&"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]!==c||e[20]!==y?(x=r.jsxs("li",{"aria-labelledby":d,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[c,y]}),e[18]=d,e[19]=c,e[20]=y,e[21]=x):x=e[21],x}const vl=[];function fn(t){const e=le.c(20),{title:n,lead:s,waiting:a,alerts:l,steps:d,footer:o,headingLevel:i}=t,c=d===void 0?vl:d,m=i===void 0?1:i,p=m===1?"h1":"h2",f=a&&c.length===0?"status":void 0;let y;e[0]!==a?(y=r.jsx(hl,{waiting:a}),e[0]=a,e[1]=y):y=e[1];let x;e[2]!==p||e[3]!==n?(x=r.jsx(p,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:n}),e[2]=p,e[3]=n,e[4]=x):x=e[4];let b;e[5]!==s?(b=s&&r.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:s}),e[5]=s,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]!==c?(g=c.length>0&&r.jsx("ol",{className:"flex flex-col gap-3",children:c.map((v,w)=>r.jsx(gl,{index:w+1,numbered:c.length>1,step:v,heading:m===1?"h2":"h3"},v.title))}),e[12]=m,e[13]=c,e[14]=g):g=e[14];let R;return e[15]!==l||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,l,g,o]})}),e[15]=l,e[16]=o,e[17]=h,e[18]=g,e[19]=R):R=e[19],R}function xl(t){const e=le.c(43),{wait:n,hosts:s,invalidLink:a}=t,l=a===void 0?!1:a,d=Ee();let o;e[0]!==l||e[1]!==d?(o=l&&r.jsx(ul,{variant:"warning",children:r.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[r.jsx(fl,{className:"line-clamp-none text-foreground",children:d("decoServe.link.invalidTitle")}),r.jsx(pl,{children:d("decoServe.link.invalidBody")})]})}),e[0]=l,e[1]=d,e[2]=o):o=e[2];const i=o;if(n.kind==="problem"){let w;e[3]!==d||e[4]!==n.host||e[5]!==n.problem?(w=Yo(d,n.problem,n.host),e[3]=d,e[4]=n.host,e[5]=n.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(dr,{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(fn,{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 c=n.kind==="looking",m=c&&!n.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]!==n.kind?(y=(i||n.kind==="denied")&&r.jsxs(r.Fragment,{children:[i,n.kind==="denied"&&r.jsx(Qo,{})]}),e[18]=i,e[19]=n.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]!==s||e[26]!==c||e[27]!==d||e[28]!==n.kind||e[29]!==n.onStart||e[30]!==n.paused?(h=n.kind==="needs-gesture"?r.jsx(_e,{variant:"outline",className:"self-start",onClick:n.onStart,children:d("decoServe.guide.start")}):c&&r.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:n.paused?d("decoServe.guide.paused"):d("decoServe.guide.looking",{hosts:s})}),e[25]=s,e[26]=c,e[27]=d,e[28]=n.kind,e[29]=n.onStart,e[30]=n.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(dr,{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(fn,{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 bl(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 yl=15e3,wl=3e3;function kl(t){const{candidates:e,probe:n,onFound:s,onChange:a,doc:l=document,setTimer:d=(w,C)=>setTimeout(w,C),clearTimer:o=w=>clearTimeout(w),timeoutMs:i=wl}=t;let c={status:"searching",firstRoundDone:!1,problem:null},m=!1,p=!1,f=0,y=null,x=null;const b=()=>l.visibilityState==="hidden",h=w=>{c={...c,...w},a(c)},g=async w=>{x=new AbortController;const C=x,k=d(()=>C.abort(),i);try{return await n(w,C.signal),!0}catch(S){if(m)return!1;const j=no(S);return j.reason!=="not-answering"?h({problem:{...j,endpoint:w}}):c.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,c.status!=="searching"&&h({status:"searching"});for(const w of e){if(m)break;if(await g(w)){if(p=!1,m)return;m=!0,l.removeEventListener("visibilitychange",v),h({status:"found",firstRoundDone:!0}),s(w);return}}if(p=!1,!m){if(f+=1,c.firstRoundDone||h({firstRoundDone:!0}),b()){h({status:"paused"});return}y=d(()=>{R()},to(f,yl))}}};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 l.addEventListener("visibilitychange",v),a(c),R(),()=>{m=!0,y!==null&&o(y),x?.abort(),l.removeEventListener("visibilitychange",v)}}function Sl(t,e){return ro(t,e)}const Pl=["loopback-network","local-network-access"];async function jl(){if(so(window.location.origin))return null;for(const t of Pl)try{return await navigator.permissions.query({name:t})}catch{}return null}let ha=null,mr=!1;const Bn=new Set;function El(t){if(Bn.add(t),!mr){mr=!0;const e=n=>{ha=n;for(const s of Bn)s()};jl().then(n=>{if(!n)return e("unsupported");e(n.state),n.addEventListener("change",()=>e(n.state))})}return()=>Bn.delete(t)}const Nl={status:"stopped",firstRoundDone:!1,problem:null},Mn=new Map;function Tl(t){const e=Mn.get(t);if(e)return e;let n={status:"searching",firstRoundDone:!1,problem:null};const s=new Set;let a=null;const l={onFound:()=>{},getSnapshot:()=>n,subscribe:d=>(s.add(d),a??=kl({candidates:t.split(" "),probe:Sl,onFound:o=>l.onFound(o),onChange:o=>{n=o;for(const i of s)i()}}),()=>{s.delete(d),!(s.size>0)&&(a?.(),a=null,Mn.delete(t))})};return Mn.set(t,l),l}function ga(){return E.useSyncExternalStore(El,gr,gr)}const Cl=()=>()=>{},hr=()=>Nl,gr=()=>ha;function Qu(t){const e=le.c(9),{candidates:n,onFound:s}=t,[a,l]=E.useState(!1),d=ga(),i=(d==="granted"||d==="unsupported"||d==="prompt"&&a)&&n.length>0;let c;e[0]!==i||e[1]!==n||e[2]!==s?(c=i?Tl(n.join(" ")):null,c&&(c.onFound=s),e[0]=i,e[1]=n,e[2]=s,e[3]=c):c=e[3];const m=E.useSyncExternalStore(c?.subscribe??Cl,c?.getSnapshot??hr,c?.getSnapshot??hr),p=d==="prompt"&&!a;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(!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 vr={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Rl(t){const{previewState:e,progressStatus:n,fastPreviewActive:s=!1,fastPreviewReady:a=!1,codingSession:l=!1,hostedDraft:d=!1}=t,o=l?null:t.previewServerUrl;return t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?vr:d&&t.hostedPointerPending&&!a?{...vr,showDecidingLoader:!0}:s&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:s&&d&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!s&&e.kind==="iframe"&&n!=="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 Ll=1e4,Al=1e3,_l=3e4;function Ol({iframeRef:t,src:e,active:n}){const s=E.useRef(0),a=E.useRef(null),l=E.useRef(null),d=E.useRef(e),o=E.useRef(n);d.current=e,o.current=n;const i=()=>{a.current&&clearTimeout(a.current),l.current&&clearTimeout(l.current),a.current=null,l.current=null},c=()=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,m()},Ll)},m=()=>{if(!o.current||!d.current)return;l.current&&clearTimeout(l.current);const y=Zi(_l,Al,s.current,2,.5);s.current+=1,l.current=setTimeout(()=>{l.current=null;const x=t.current,b=d.current;!x||!b||!o.current||(x.src=b,c())},y)},p=()=>{s.current=0,i()},f=()=>{a.current&&(clearTimeout(a.current),a.current=null),m()};return E.useEffect(()=>{if(i(),s.current=0,!(!n||!e))return c(),i},[e,n]),{handleLoad:p,handleError:f}}const Dl=1500,$l=500;function Fl({iframe:t,reload:e,waitMs:n=Dl,confirmMs:s=$l}){let a;const l=()=>{clearTimeout(d),a=setTimeout(e,s)};t.addEventListener("load",l,{once:!0});const d=setTimeout(()=>{t.removeEventListener("load",l),e()},n);return()=>{clearTimeout(d),clearTimeout(a),t.removeEventListener("load",l)}}const Bl=dn({tag:$e(),id:$e(),classes:$e(),text:$e(),html:$e(),manifestKey:$e().nullable(),componentName:$e().nullable(),parents:$e(),url:$e(),path:$e(),viewport:dn({width:ut(),height:ut()}),position:dn({x:ut(),y:ut()})}),Ml=`(function() {
|
|
3
3
|
if (window.__visualEditorActive) return;
|
|
4
4
|
window.__visualEditorActive = true;
|
|
5
5
|
|
|
@@ -548,4 +548,4 @@ import{c as le,j as r,r as E,m as Fe,b as Ee,B as _e,aE as dn,b3 as ut,aF as $e,
|
|
|
548
548
|
}
|
|
549
549
|
});
|
|
550
550
|
})();`,an=Object.freeze({ready:"deco:ready",load:"deco:load",loaded:"deco:loaded",loadError:"deco:load-error"}),Kl="v1",Hl="/studio-modules",In=["wireframe","html-swap"];function Vl(t,e,n){const s=new URL(`${Hl}/${Kl}/${e}.js`,t);return n&&s.searchParams.set("build",n),s.href}const Wl=2e3;class ql{constructor(e){this.options=e,this.urls=Object.fromEntries(In.map(n=>[n,Vl(e.studioOrigin,n,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 n=this.options.frame();if(!n||e.source!==n)return!1;const s=e.data;if(!s||typeof s.type!="string")return!1;if(s.type===an.ready)return Gl(e.origin)?(this.ready(e.origin),!0):!1;if(e.origin!==this.origin)return!1;const a=s;switch(a.type){case an.loaded:{const l=this.nameOf(a.url);return l&&(this.loaded.add(l),this.options.onModulesChange?.(),l==="wireframe"&&this.options.onWireframeReady?.()),!0}case an.loadError:{const l=this.nameOf(a.url);return l&&this.loaded.delete(l)&&this.options.onModulesChange?.(),l==="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 n=++this.swapId,s=e?{type:"html-swap:refresh",id:n,url:e}:{type:"html-swap:refresh",id:n};return this.post("html-swap",s)?(this.pendingSwap={id:n,started:!1},this.clearStartTimer(),this.startTimer=setTimeout(()=>{this.startTimer=null,this.pendingSwap?.id===n&&!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 n=this.options.frame();for(const s of In)n?.postMessage({type:an.load,url:this.urls[s]},e)}post(e,n){const s=this.options.frame();return!s||!this.origin||!this.loaded.has(e)?!1:(s.postMessage(n,this.origin),!0)}isFrameOrigin(e){try{return new URL(e).origin===this.origin}catch{return!1}}nameOf(e){return In.find(n=>this.urls[n]===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 Gn(t,e,n=!1){let s=t,a=typeof s?.__resolveType=="string"?s.__resolveType:"";for(let l=0;a&&l<5;l++){const d=e[a];if(d&&typeof d=="object"&&"__resolveType"in d){const o=d.__resolveType;if(typeof o=="string"&&o&&o!==a){s=d,a=o;continue}}break}if(!a)return[];if(a.includes("flags/multivariate")||n&&fi(a,n)){const l=Array.isArray(s.variants)?s.variants:[];if(l.length===0||l.every(i=>{const c=i?.rule;return pi(c?.__resolveType,n)}))return null;const o=[];for(const i of l){const c=mi(i,n);if(c&&typeof c=="object")for(const m of Gn(c,e,n)??[])o.includes(m)||o.push(m)}return o}if(hi(a)){const l=s.section&&typeof s.section=="object"?Gn(s.section,e,n):[];return l===null?null:l.length?[a,...l]:[a]}return[a]}function dt(t){return t.replace(/[`*_]/g,"\\$&")}function Jl(t,e){const n=[`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&&n.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 s=`<${t.tag}${t.classes?` class="${dt(t.classes)}"`:""}>`;n.push(`**Clicked element:** \`${s}\``),t.parents&&n.push(`**DOM breadcrumb:** ${dt(t.parents)} > ${t.tag}`),t.text&&n.push(`**Text content:** "${dt(t.text)}"`),t.componentName&&n.push(`**Component name:** ${dt(t.componentName)}`);const a=t.html.replace(/```/g,"`` `");return n.push("","**HTML snippet:**","```html",a,"```"),n.push("","Please read the source file, locate the element, and apply the requested change."),n.join(`
|
|
551
|
-
`)}function Yl(t,e,n=320,s=44,a=12){const{x:l,y:d}=t,{width:o,height:i}=e,c=Math.max(a,Math.min(l-n/2,o-n-a)),p=d/i>.68?Math.max(a,d-s-18):Math.min(d+18,i-s-a);return{leftPct:c/o*100,topPct:p/i*100}}function Ql(t){const e=le.c(45),{element:n,onDismiss:s}=t,[a,l]=E.useState(""),d=E.useRef(null),{sendMessage:o}=Di(),{openSidePanel:i}=Ko(),c=Ee();let m;e[0]!==n||e[1]!==a||e[2]!==s||e[3]!==i||e[4]!==o?(m=()=>{if(!a.trim())return;const U=Jl(n,a);i(),o({parts:[{type:"text",text:U}]}),s()},e[0]=n,e[1]=a,e[2]=s,e[3]=i,e[4]=o,e[5]=m):m=e[5];const p=m;let f;e[6]!==n.position||e[7]!==n.viewport?(f=Yl(n.position,n.viewport),e[6]=n.position,e[7]=n.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=U=>{U.preventDefault(),p()},e[12]=p,e[13]=g):g=e[13];let R;e[14]===Symbol.for("react.memo_cache_sentinel")?(R=U=>l(U.target.value),e[14]=R):R=e[14];let v;e[15]!==s?(v=U=>{U.key==="Escape"&&s()},e[15]=s,e[16]=v):v=e[16];let w;e[17]!==c?(w=c("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=c,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]!==c?(j=c("sandbox.visualEditorPrompt.sendButton"),e[25]=c,e[26]=j):j=e[26];let T;e[27]!==c?(T=c("sandbox.visualEditorPrompt.sendButton"),e[27]=c,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 D;e[34]!==S||e[35]!==j||e[36]!==L?(D=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]=D):D=e[37];let O;e[38]!==C||e[39]!==D||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,D]}),e[38]=C,e[39]=D,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 xr="site-links",Xl=/details?page|\bpdp\b/i,Zl=/listingpage|\bplp\b/i;function ec(t,e,n){const s=new Set;for(const o of n)Xl.test(o)&&s.add("product"),Zl.test(o)&&s.add("category");const a=It(es(t)),l=a[a.length-1],d=a[a.length-2];return l?.type==="text"&&l.text==="/p"&&d?.type==="param"&&d.name===e&&s.add("product"),e==="*"&&a.some(o=>o.type==="param"&&o.name==="*")&&s.add("category"),s}const tc=["rosa","preto","pink","black"];function on(t,e){const n=e.trim();return n?t(n):tc.flatMap(s=>t(s))}function nc(t,e){const n=e.trim(),s=[];/^\d+$/.test(n)&&s.push({resolveType:t,props:{ids:[n]}});const l=n.includes("-")&&!/\s/.test(n)?n.replace(/-+/g," "):n;return s.push({resolveType:t,props:{query:l,count:10}}),s}const va=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function ns(t){return t.split("/")[0]??""}function sc(t){const e=new Set;for(const n of t){const s=ns(n);va.has(s)&&e.add(s)}return e}function rc(t,e){const n=ns(t);return!va.has(n)||e.size===0?!0:e.has(n)}const ac=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>on(n=>nc(t,n),e),optionsFromPayload:ln},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>on(n=>[{resolveType:t,props:{props:{search:n,pageSize:10,currentPage:1}}}],e),optionsFromPayload:ln},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>on(n=>[{resolveType:t,props:{term:n,hitsPerPage:10}}],e),optionsFromPayload:ln},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>on(n=>[{resolveType:t,props:{query:n,term:n,count:10,hitsPerPage:10}}],e),optionsFromPayload:ln},{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,n=new Set){const s=[...e],a=o=>{const i=[];for(const c of ac){if(c.kind!==o)continue;const m=s.find(p=>c.test(p)&&rc(p,n));m&&i.push({cand:c,resolveType:m})}return i.find(c=>n.has(ns(c.resolveType)))??i[0]},l=(o,i,c)=>({kind:o.kind,id:`${o.kind}:${i}`,resolveType:i,clientFilter:o.clientFilter,isFallback:c,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(l(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:xr,resolveType:xr,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,n)=>vc(e,n)}}function et(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function lc(t,e,n){const s=new Set,a=new Set,l=d=>{if(Array.isArray(d)){for(const c of d)l(c);return}const o=et(d);if(!o)return;const i=o.__resolveType;if(typeof i=="string"){if(n(i))s.add(i);else if(i in e&&!a.has(i)){a.add(i);const c=et(e[i])?.__resolveType;typeof c=="string"&&n(c)&&s.add(i),l(e[i])}}for(const c of Object.values(o))l(c)};return l(t),s}function xa(t){const e=new Set,n=[];for(const s of t)for(const a of s)e.has(a.value)||(e.add(a.value),n.push(a));return n}function ba(t){try{return decodeURIComponent(t)}catch{return t}}function cc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dc(t){const e=[];let n="^";for(const s of t)s.type==="text"?n+=cc(s.text):(e.push(s.name),n+=s.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${n}$`),order:e}}function ya(t,e,n){if(typeof t!="string"||!t)return null;let s;try{s=new URL(t,"https://placeholder.invalid").pathname}catch{return null}s=s.replace(/\/+$/,"");const a=It(es(e)),{pattern:l,order:d}=dc(a),o=d.indexOf(n);if(o===-1)return null;const i=s.match(l);if(!i)return null;const c=i[o+1]?.replace(/^\/+|\/+$/g,"");return c?ba(c):null}function ln(t,e){const n=et(t),s=Array.isArray(t)?t:Array.isArray(n?.products)?n.products:Array.isArray(n?.list)?n.list:[],a=[],l=new Set;for(const d of s){const o=et(d);if(!o)continue;const i=ya(o.url,e.template,e.paramName);if(!i||l.has(i))continue;l.add(i);const c=et(o.isVariantOf),m=typeof c?.name=="string"&&c.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 n=e.replace(/^\/+|\/+$/g,"");return n?ba(n):null}function fc(t){const e=[],n=new Set,s=(a,l)=>{const d=et(a);if(!d)return;const o=typeof d.name=="string"&&d.name?d.name:"",i=o?[...l,o]:l,c=uc(d.url);if(c&&!n.has(c)&&(n.add(c),e.push({value:c,label:i.join(" › ")||c})),Array.isArray(d.children))for(const m of d.children)s(m,i)};if(Array.isArray(t))for(const a of t)s(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,n=>n.toUpperCase())}function hc(t){if(typeof t!="string"||!t)return[];const e=[],n=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let s,a=0;for(;(s=n.exec(t))!==null&&a++<5e3;){const l=s[1]??"",d=(s[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:l,text:d})}return e}function gc(t){if(typeof t!="string"||!t)return[];const e=[],n=new Set,s=/"@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 l,d=0;for(;(l=s.exec(t))!==null&&d++<3e3;){const o=(l[1]??"").replace(/\\\//g,"/");if(!o||n.has(o))continue;n.add(o);const i=t.slice(l.index,l.index+900).match(a)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:l[2]??"",image:i||void 0})}return e}function vc(t,e){const n=[],s=new Set,a=(l,d,o,i)=>{if(n.length>=200)return;const c=ya(l,e.template,e.paramName);!c||s.has(c)||e.paramName==="*"&&/(^|\/)p$/.test(c)||o==="category"&&pc.has(c.split("/")[0]??"")||(s.add(c),n.push({value:c,label:d&&d.length<=80?d:mc(c),kind:o,image:i}))};for(const{url:l,name:d,image:o}of gc(t))a(l,d,"product",o);for(const{href:l,text:d}of hc(t))l.startsWith("/")&&!l.startsWith("//")&&a(l,d,"category");return n}function Ft(t,e,n=50){const s=e.trim().toLowerCase();return(s?t.filter(l=>l.label.toLowerCase().includes(s)||l.value.toLowerCase().includes(s)):t).slice(0,n)}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:n}){const s=await fetch(ao(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...n}),signal:AbortSignal.timeout(wa)});if(!s.ok)throw new Error(`Failed to fetch options: ${s.status}`);return s.json()}async function br(t,e){const n=await fetch(io(t,e),{signal:AbortSignal.timeout(wa)});if(!n.ok)throw new Error(`Failed to fetch page: ${n.status}`);return n.text()}async function yc(t,e,n){const s=e.optionsFromPayload(await br(t,"/"),n),a=s.find(d=>d.kind==="category");if(!a)return s;const l=Ve(n.template,{[n.paramName]:a.value});if(l==="/")return s;try{const d=e.optionsFromPayload(await br(t,l),n).filter(o=>o.kind==="product");return xa([s,d])}catch{return s}}function wc(t,e,n){return Qn.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":n}`)}async function kc(t,e,n,s){if(e.homepageLinks)return yc(t,e,s);const a=e.buildRequests?.(n)??[];if(a.length===0)return[];const l=await Promise.allSettled(a.map(o=>bc(t,o))),d=l.filter(o=>o.status==="fulfilled").map(o=>o.value);if(d.length===0){const o=l.find(i=>i.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return xa(d.map(o=>e.optionsFromPayload(o,s)))}function Jn(t,e,n,s,a){return{queryKey:wc(t,e,n),queryFn:()=>kc(t,e,n,s),enabled:a,staleTime:6e4,retry:1}}function Bt(t){const e=le.c(16),{heading:n,iconKind:s,options:a,template:l,paramName:d,keyPrefix:o,onSelect:i}=t;if(a.length===0)return null;let c;if(e[0]!==s||e[1]!==o||e[2]!==i||e[3]!==a||e[4]!==d||e[5]!==l){let p;e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==d||e[11]!==l?(p=f=>r.jsxs(pt,{value:`${o}:${f.value}`,className:"gap-3 py-2",onSelect:()=>i(f.value),children:[s==="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(Mr,{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(l,{[d]:f.value})})]})]},`${o}:${f.value}`),e[7]=s,e[8]=o,e[9]=i,e[10]=d,e[11]=l,e[12]=p):p=e[12],c=a.map(p),e[0]=s,e[1]=o,e[2]=i,e[3]=a,e[4]=d,e[5]=l,e[6]=c}else c=e[6];let m;return e[13]!==n||e[14]!==c?(m=r.jsx(ft,{heading:n,children:c}),e[13]=n,e[14]=c,e[15]=m):m=e[15],m}function yr(t){const e=le.c(2),{text:n}=t;let s;return e[0]!==n?(s=r.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=s):s=e[1],s}function Sc(t){const e=le.c(52),{sources:n,template:s,paramName:a,value:l,sandboxRef:d,onCommit:o}=t,i=Ee(),[c,m]=E.useState(!1),[p,f]=E.useState(""),[y,x]=E.useState(""),b=E.useRef(null),h=a==="*"?i("sandbox.preview.catchAllParamLabel"):`:${a}`,g=xc(i),v=[...new Set(n.map(se=>g[se.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:s,paramName:a};let S;e[3]!==p?(S=(se,de)=>({source:se,query:de,options:se.clientFilter?Ft(de.data??[],p):de.data??[]}),e[3]=p,e[4]=S):S=e[4];const j=S,T=n.filter(Lc),B=n.filter(Rc),A=Wn({queries:T.map(se=>Jn(d,se,y,k,c))});let L;e[5]!==A||e[6]!==j?(L=(se,de)=>j(se,A[de]),e[5]=A,e[6]=j,e[7]=L):L=e[7];const D=T.map(L),O=D.length===0||D.every(Cc),F=Wn({queries:B.map(se=>Jn(d,se,y,k,c&&O))});let U;e[8]!==F||e[9]!==j?(U=(se,de)=>j(se,F[de]),e[8]=F,e[9]=j,e[10]=U):U=e[10];const G=B.map(U),W=O?G:D,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=se=>{m(se),b.current&&clearTimeout(b.current),f(se?l:""),x(se?l:"")};let V;e[11]===Symbol.for("react.memo_cache_sentinel")?(V=se=>{f(se),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{x(se)},300)},e[11]=V):V=e[11];const N=V,_=se=>{o(se),J(!1)},$=ra(p),z=Ve(s,{[a]:$}),X=Cr,ne=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(Mr,{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=qr,Se=!1,fe="min-h-0 flex-1";let ce;e[25]!==C||e[26]!==p?(ce=r.jsx(Gr,{autoFocus:!0,placeholder:C,value:p,onValueChange:N}),e[25]=C,e[26]=p,e[27]=ce):ce=e[27];const Re=Wr,Ie="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Ue;e[28]!==i?(Ue=i("sandbox.pathParamPickerChip.noResults"),e[28]=i,e[29]=Ue):Ue=e[29];let Be;e[30]!==Ue?(Be=r.jsx(Jr,{children:Ue}),e[30]=Ue,e[31]=Be):Be=e[31];const bt=$&&r.jsx(ft,{className:"shrink-0",children:r.jsxs(pt,{value:`__raw__:${$}`,className:"gap-3 py-2",onSelect:()=>_($),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(Vo,{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:$,paramLabel:h})}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:z})]})]})}),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:s,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:s,paramName:a,keyPrefix:`${Y?.source.id}:prod`,onSelect:_})})]}):r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:W.map(se=>{const{source:de,query:We,options:yt}=se,{noun:qe}=g[de.kind];if(We.isLoading)return r.jsx(yr,{text:i("sandbox.pathParamPickerChip.loading",{noun:qe})},de.id);if(We.isError)return r.jsx(yr,{text:i("sandbox.pathParamPickerChip.couldNotLoad")},de.id);if(de.homepageLinks){const zt=We.data??[];return r.jsxs(E.Fragment,{children:[r.jsx(Bt,{heading:g.category.heading,iconKind:"category",options:Ft(zt.filter(jc),p),template:s,paramName:a,keyPrefix:`${de.id}:cat`,onSelect:_}),r.jsx(Bt,{heading:g.product.heading,iconKind:"product",options:Ft(zt.filter(Pc),p),template:s,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:s,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 ze;e[41]!==ne||e[42]!==ie||e[43]!==ge||e[44]!==xe||e[45]!==Z?(ze=r.jsxs(ne,{className:I,onClick:Z,children:[ie,ge,xe]}),e[41]=ne,e[42]=ie,e[43]=ge,e[44]=xe,e[45]=Z,e[46]=ze):ze=e[46];let Le;return e[47]!==X||e[48]!==J||e[49]!==c||e[50]!==ze?(Le=r.jsx(X,{open:c,onOpenChange:J,children:ze}),e[47]=X,e[48]=J,e[49]=c,e[50]=ze,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:se=>{se.stopPropagation(),J(!0)},children:l||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:n,template:s,paramName:a,sandboxRef:l,onFill:d}=t;let o,i;if(e[0]!==a||e[1]!==l||e[2]!==n||e[3]!==s){const y={template:s,paramName:a},x=n.filter(_c);i=Wn,o=x.map(b=>Jn(l,b,"",y,!0)),e[0]=a,e[1]=l,e[2]=n,e[3]=s,e[4]=o,e[5]=i}else o=e[4],i=e[5];let c;e[6]!==o?(c={queries:o},e[6]=o,e[7]=c):c=e[7];const m=i(c),[p,f]=E.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:n,value:s,onCommit:a}=t,l=Ee(),[d,o]=E.useState(s),[i,c]=E.useState(!1),m=E.useRef(!1);let p;e[0]!==n||e[1]!==l?(p=n==="*"?l("sandbox.preview.catchAllParamLabel"):`:${n}`,e[0]=n,e[1]=l,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]!==l?(b=l("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=l,e[7]=b):b=e[7];let h,g;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=j=>o(j.target.value),g=()=>c(!0),e[8]=h,e[9]=g):(h=e[8],g=e[9]);let R;e[10]!==s?(R=j=>{j.key==="Enter"&&j.currentTarget.blur(),j.key==="Escape"&&(m.current=!0,o(s),j.currentTarget.blur())},e[10]=s,e[11]=R):R=e[11];let v;e[12]!==d||e[13]!==a||e[14]!==s?(v=()=>{if(c(!1),m.current){m.current=!1;return}const j=ra(d);o(j),j!==s&&a(j)},e[12]=d,e[13]=a,e[14]=s,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:Dc,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]!==l?(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(zi,{size:10}),l("sandbox.preview.enterToGo")]}),e[25]=i,e[26]=l,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 Dc(t){return t.stopPropagation()}function $c(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const n=new URL(e),s=t.resolvedPath==="/"?"":t.resolvedPath;return`${n.host}${s}`}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 Uc(t,e){if(t)return t;const n=await e?.().catch(()=>null);if(!n)throw new ka;return n}async function zc(t,e,n){return n?Xs(t,e,await Uc(n.meta,n.loadMeta)):Xs(t,e)}function Kc(t){const e=le.c(5);let n;e[0]!==t?(n=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=n):n=e[1];const s=Dr(n);let a;return e[2]!==t||e[3]!==s?(a={mutationFn:async l=>{const{name:d,path:o,template:i,schema:c}=l;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const m=Si(d),p=i?{...i,name:d,path:o}:await zc(d,o,c);return await s.mutateAsync({blockKey:m,data:p}),{key:m,name:d,path:o}}},e[2]=t,e[3]=s,e[4]=a):a=e[4],gi(a)}function Hc(t){const e=le.c(89),{open:n,onOpenChange:s,isPending:a,error:l,templates:d,onSubmit:o}=t,i=a===void 0?!1:a,c=Ee();let m;e[0]!==c?(m=c("sectionsEditor.createPageModal.defaultPageName"),e[0]=c,e[1]=m):m=e[1];const[p,f]=E.useState(m);let y;e[2]!==c?(y=c("sectionsEditor.createPageModal.defaultPagePath"),e[2]=c,e[3]=y):y=e[3];const[x,b]=E.useState(y),[h,g]=E.useState(_n),[R,v]=E.useState(null),[w,C]=E.useState(n);n!==w&&(C(n),n&&(f(c("sectionsEditor.createPageModal.defaultPageName")),b(c("sectionsEditor.createPageModal.defaultPagePath")),g(_n),v(null)));const k=!!d?.length;let S;e[4]!==i||e[5]!==s?(S=pe=>{!pe&&!i&&(v(null),s(!1))},e[4]=i,e[5]=s,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=aa(ge);if(ve){v(ve);return}v(null),await o({name:be,path:ge,templateKey:k&&h!==_n?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??l;let L;e[14]!==c?(L=c("sectionsEditor.createPageModal.title"),e[14]=c,e[15]=L):L=e[15];let D;e[16]!==L?(D=r.jsx(Rr,{children:r.jsx(Lr,{children:L})}),e[16]=L,e[17]=D):D=e[17];let O;e[18]!==c?(O=c("sectionsEditor.createPageModal.nameLabel"),e[18]=c,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 U;e[22]===Symbol.for("react.memo_cache_sentinel")?(U=pe=>f(pe.target.value),e[22]=U):U=e[22];let G;e[23]!==c?(G=c("sectionsEditor.createPageModal.namePlaceholder"),e[23]=c,e[24]=G):G=e[24];let W;e[25]!==i||e[26]!==p||e[27]!==G?(W=r.jsx(zn,{id:"new-page-name",value:p,onChange:U,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]!==c?(q=c("sectionsEditor.createPageModal.pathLabel"),e[32]=c,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]!==c?(ee=c("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=c,e[38]=ee):ee=e[38];let H;e[39]!==i||e[40]!==x||e[41]!==ee?(H=r.jsx(zn,{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]!==c||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:c("sectionsEditor.createPageModal.templateLabel")}),r.jsx(Pi,{id:"new-page-template",value:h,onChange:g,templates:d??[],disabled:i})]}),e[46]=i,e[47]=k,e[48]=c,e[49]=h,e[50]=d,e[51]=V):V=e[51];let N;e[52]!==A?(N=A&&r.jsx("p",{className:"text-xs text-destructive",children:A}),e[52]=A,e[53]=N):N=e[53];let _;e[54]!==Y||e[55]!==J||e[56]!==V||e[57]!==N?(_=r.jsxs("div",{className:"space-y-4 py-4",children:[Y,J,V,N]}),e[54]=Y,e[55]=J,e[56]=V,e[57]=N,e[58]=_):_=e[58];let $;e[59]!==s?($=()=>s(!1),e[59]=s,e[60]=$):$=e[60];let z;e[61]!==c?(z=c("sectionsEditor.createPageModal.cancelButton"),e[61]=c,e[62]=z):z=e[62];let X;e[63]!==i||e[64]!==$||e[65]!==z?(X=r.jsx(_e,{type:"button",variant:"outline",onClick:$,disabled:i,children:z}),e[63]=i,e[64]=$,e[65]=z,e[66]=X):X=e[66];let ne;e[67]!==i||e[68]!==p||e[69]!==x?(ne=!p.trim()||!x.trim()||i,e[67]=i,e[68]=p,e[69]=x,e[70]=ne):ne=e[70];let I;e[71]!==i||e[72]!==c?(I=i?r.jsxs(r.Fragment,{children:[r.jsx(tt,{className:"size-3.5"}),c("sectionsEditor.createPageModal.creatingButton")]}):c("sectionsEditor.createPageModal.createButton"),e[71]=i,e[72]=c,e[73]=I):I=e[73];let Z;e[74]!==ne||e[75]!==I?(Z=r.jsx(_e,{type:"submit",disabled:ne,children:I}),e[74]=ne,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]!==D?(ie=r.jsx(Tr,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:B,children:[D,_,re]})}),e[80]=B,e[81]=_,e[82]=re,e[83]=D,e[84]=ie):ie=e[84];let he;return e[85]!==j||e[86]!==n||e[87]!==ie?(he=r.jsx(Cr,{open:n,onOpenChange:j,children:ie}),e[85]=j,e[86]=n,e[87]=ie,e[88]=he):he=e[88],he}function Vc(t){const e=le.c(41),{orgSlug:n,virtualMcpId:s,branch:a,previewUrl:l,meta:d,decofile:o,blockKey:i}=t,c=Ee();let m;e[0]!==a||e[1]!==n||e[2]!==s?(m={orgSlug:n,virtualMcpId:s,branch:a},e[0]=a,e[1]=n,e[2]=s,e[3]=m):m=e[3];const p=Dr(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=ji(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=Ei(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]!==c?(j=c("sandbox.preview.loaderNoLongerExists"),e[13]=c,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]!==n||e[25]!==l||e[26]!==g||e[27]!==p.isPending||e[28]!==x||e[29]!==w||e[30]!==C||e[31]!==s?(k=r.jsx(Ni,{orgSlug:n,virtualMcpId:s,branch:a,previewUrl:l,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]=n,e[25]=l,e[26]=g,e[27]=p.isPending,e[28]=x,e[29]=w,e[30]=C,e[31]=s,e[32]=k):k=e[32];let S;return e[33]!==i||e[34]!==a||e[35]!==o||e[36]!==n||e[37]!==v||e[38]!==k||e[39]!==s?(S=r.jsx(Ti,{listing:o,orgSlug:n,virtualMcpId:s,branch:a,blockKey:i,present:void 0,children:k},v),e[33]=i,e[34]=a,e[35]=o,e[36]=n,e[37]=v,e[38]=k,e[39]=s,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 wr(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 n=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return n&&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"}:n?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=E.lazy(()=>xi(()=>import("./sections-editor-CHnIwFIR.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])).then(t=>({default:t.SectionsEditor})));function kr(t){const e=le.c(62),{virtualMcpId:n,externalSelection:s,onSectionPicked:a,onViewJsonFile:l}=t,d=s===void 0?null:s,{org:o}=pn(),{currentBranch:i,taskId:c}=nt(),m=ts(),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]!==c||e[4]!==n?(b=i?{orgSlug:o.slug,virtualMcpId:n,branch:i,threadId:c??null,previewUrl:x}:null,e[0]=i,e[1]=o,e[2]=x,e[3]=c,e[4]=n,e[5]=b):b=e[5];const h=b,g=Ut(n,i);let R;e[6]!==y?(R={fetchEnabled:y},e[6]=y,e[7]=R):R=e[7];const v=mn(h,R),w=Qr(h);let C;e[8]!==y?(C={fetchEnabled:y},e[8]=y,e[9]=C):C=e[9];const k=ia(h,C),S=Jc({lifecyclePhase:m.lifecycle.phase,decofile:wr(v),meta:wr(k),hasEditableContent:No(v.data,k.data),fastPreviewActive:Yr(n).runtime==="cms"||Xe(g)}),j=Xn()===void 0,T=Qc;if(To(g)){let N;return e[10]===Symbol.for("react.memo_cache_sentinel")?(N=T(r.jsx(Ro,{})),e[10]=N):N=e[10],N}if(g.kind==="pending"&&g.retrying){let N;return e[11]!==g?(N=T(r.jsx(Lo,{backend:g})),e[11]=g,e[12]=N):N=e[12],N}if(S.kind==="loading"||j){let N;return e[13]===Symbol.for("react.memo_cache_sentinel")?(N=T(r.jsx(bi,{})),e[13]=N):N=e[13],N}if(v.data&&oo(k.data)){const N=f.state.target,_=N?.kind==="page"||N?.kind==="section"?N.key:null,$=g.kind==="legacy"?_??"":`${w}:${_??""}`,z=i??"";let X;return e[14]!==v.data||e[15]!==_||e[16]!==o.slug||e[17]!==$||e[18]!==z||e[19]!==n?(X=T(r.jsx(Ci,{orgSlug:o.slug,virtualMcpId:n,branch:z,decofile:v.data,initialKey:_,compact:!0},$)),e[14]=v.data,e[15]=_,e[16]=o.slug,e[17]=$,e[18]=z,e[19]=n,e[20]=X):X=e[20],X}if(S.kind==="empty"){let N;return e[21]===Symbol.for("react.memo_cache_sentinel")?(N=T(r.jsx(Ao,{})),e[21]=N):N=e[21],N}if(S.kind==="error"){let N;e[22]!==v||e[23]!==p||e[24]!==k||e[25]!==S.source?(N=()=>{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]=N):N=e[26];const _=N;let $;return e[27]!==_||e[28]!==S.source?($=T(r.jsx(Co,{source:S.source,onRetry:_})),e[27]=_,e[28]=S.source,e[29]=$):$=e[29],$}let B;e[30]===Symbol.for("react.memo_cache_sentinel")?(B=N=>T(r.jsx("div",{className:"h-full min-h-0",children:N})),e[30]=B):B=e[30];const A=B,L=f.state.target;if(L?.kind==="loader"&&v.data&&k.data){const N=g.kind==="legacy"?void 0:w,_=i??"",$=x??null;let z;return e[31]!==v.data||e[32]!==k.data||e[33]!==o.slug||e[34]!==N||e[35]!==_||e[36]!==$||e[37]!==L.key||e[38]!==n?(z=A(r.jsx(Vc,{orgSlug:o.slug,virtualMcpId:n,branch:_,previewUrl:$,meta:k.data,decofile:v.data,blockKey:L.key},N)),e[31]=v.data,e[32]=k.data,e[33]=o.slug,e[34]=N,e[35]=_,e[36]=$,e[37]=L.key,e[38]=n,e[39]=z):z=e[39],z}let D;e[40]!==i||e[41]!==o.slug||e[42]!==L||e[43]!==n?(D=L||!i?null:Fr(Br(o.slug,n,i)),e[40]=i,e[41]=o.slug,e[42]=L,e[43]=n,e[44]=D):D=e[44];const O=D;let F="/",U=null,G=null;L?.kind==="page"?(F=L.path,U=L.key):L?.kind==="section"?G=L.key:O&&(F=O.path,U=O.pageKey);const W=U?`page:${U}`: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=!!U&&f.state.editSeoPageKey===U;let V;return e[46]!==G||e[47]!==U||e[48]!==F||e[49]!==l||e[50]!==o.slug||e[51]!==K||e[52]!==ee||e[53]!==H||e[54]!==J||e[55]!==q||e[56]!==Q||e[57]!==n||e[58]!==f.consumeEditSeo||e[59]!==f.setFocusedBlock||e[60]!==f.setVariantOverride?(V=A(r.jsx(E.Suspense,{fallback:Y,children:r.jsx(Yc,{orgSlug:o.slug,virtualMcpId:n,branch:Q,previewReady:!0,previewUrl:K,currentPath:F,activePageBlockKey:U,activeGlobalBlockKey:G,externalSelection:ee,onSectionPicked:H,initialEditSeo:J,onExitSeo:f.consumeEditSeo,onVariantPreviewOverride:f.setVariantOverride,onFocusedBlockChange:f.setFocusedBlock,onViewJsonFile:l},q)})),e[46]=G,e[47]=U,e[48]=F,e[49]=l,e[50]=o.slug,e[51]=K,e[52]=ee,e[53]=H,e[54]=J,e[55]=q,e[56]=Q,e[57]=n,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:n,pageKey:s,onClose:a,ref:l}=t,d=Ee(),o=Xn(),i=o===!0,c=Zn(n);let m;e[0]!==c||e[1]!==s?(m=Xr(c,fa(s)),e[0]=c,e[1]=s,e[2]=m):m=e[2];const p=m,{org:f}=pn(),{currentBranch:y,taskId:x}=nt(),h=xt().previewUrl;let g;e[3]!==y||e[4]!==f.slug||e[5]!==h||e[6]!==x||e[7]!==n?(g=y?{orgSlug:f.slug,virtualMcpId:n,branch:y,threadId:x??null,previewUrl:h}:null,e[3]=y,e[4]=f.slug,e[5]=h,e[6]=x,e[7]=n,e[8]=g):g=e[8];const v=mn(g),w=y??"";let C;e[9]!==f.slug||e[10]!==w||e[11]!==n?(C={orgSlug:f.slug,virtualMcpId:n,branch:w},e[9]=f.slug,e[10]=w,e[11]=n,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}=$r(C,k),B=y??"";let A;e[14]!==f.slug||e[15]!==B||e[16]!==n?(A=da({orgSlug:f.slug,virtualMcpId:n,branch:B}),e[14]=f.slug,e[15]=B,e[16]=n,e[17]=A):A=e[17];const L=ua(A);let D;e[18]!==s||e[19]!==L?(D=L(s),e[18]=s,e[19]=L,e[20]=D):D=e[20];const O=D;let F;e[21]!==O||e[22]!==s?(F={pageKey:s,copyEpoch:O},e[21]=O,e[22]=s,e[23]=F):F=e[23];const[U,G]=E.useState(F);(U.pageKey!==s||U.copyEpoch!==O)&&(G({pageKey:s,copyEpoch:O}),T(s));const W=v.data?.[s],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]!==s||e[27]!==Q||e[28]!==S?(H=z=>{if(Q)return;let X;try{X=JSON.parse(z)}catch{return}X===null||typeof X!="object"||Array.isArray(X)||S(s,X)},e[26]=s,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],E.useImperativeHandle(l,V);let N;e[32]!==p||e[33]!==i||e[34]!==a||e[35]!==d?(N=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]=N):N=e[36];let _;e[37]!==O||e[38]!==v.data||e[39]!==j||e[40]!==ee||e[41]!==Y||e[42]!==q||e[43]!==s||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:z=>J(z??""),onSave:z=>{J(z),j()}},`${s}:${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]=s,e[44]=Q,e[45]=J,e[46]=d,e[47]=_):_=e[47];let $;return e[48]!==N||e[49]!==_?($=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[N,_]}),e[48]=N,e[49]=_,e[50]=$):$=e[50],$}function Sr(t){const e=le.c(3),{currentBranch:n}=nt(),s=Ut(t.virtualMcpId,n);let a;return e[0]!==s.kind||e[1]!==t?(a=s.kind==="legacy"?r.jsx(Xc,{...t}):r.jsx(Zc,{...t}),e[0]=s.kind,e[1]=t,e[2]=a):a=e[2],a}function Zc(t){const e=le.c(61),{virtualMcpId:n,pageKey:s,onClose:a,ref:l}=t,d=Ee(),o=Xn(),i=o===!0,c=Zn(n);let m;e[0]!==c||e[1]!==s?(m=Xr(c,fa(s)),e[0]=c,e[1]=s,e[2]=m):m=e[2];const p=m,{org:f}=pn(),{currentBranch:y,taskId:x}=nt(),h=xt().previewUrl;let g;e[3]!==y||e[4]!==f.slug||e[5]!==h||e[6]!==x||e[7]!==n?(g=y?{orgSlug:f.slug,virtualMcpId:n,branch:y,threadId:x??null,previewUrl:h}:null,e[3]=y,e[4]=f.slug,e[5]=h,e[6]=x,e[7]=n,e[8]=g):g=e[8];const R=g,v=mn(R);let w;e[9]!==s?(w=[s],e[9]=s,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=Zr(R,w,C),S=y??"";let j;e[13]!==f.slug||e[14]!==S||e[15]!==n?(j={orgSlug:f.slug,virtualMcpId:n,branch:S},e[13]=f.slug,e[14]=S,e[15]=n,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}=$r(j,T),D=y??"";let O;e[18]!==f.slug||e[19]!==D||e[20]!==n?(O=da({orgSlug:f.slug,virtualMcpId:n,branch:D}),e[18]=f.slug,e[19]=D,e[20]=n,e[21]=O):O=e[21];const F=ua(O);let U;e[22]!==s||e[23]!==F?(U=F(s),e[22]=s,e[23]=F,e[24]=U):U=e[24];const G=U,W=v.data?.[s];let Y;e[25]!==k.ready||e[26]!==v.data||e[27]!==W?(Y=k.ready&&v.data!==void 0&&(W===void 0||Qs(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]!==s?(Q={pageKey:s,copyEpoch:G,opened:!1,code:""},e[29]=G,e[30]=s,e[31]=Q):Q=e[31];const[K,ee]=E.useState(Q);if(q&&(K.pageKey!==s||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:s,copyEpoch:G,opened:!0,code:Z}),Qs(W)&&L(s)}const H=K.pageKey===s&&K.opened,J=o===void 0||!H&&!q,V=q&&W===void 0,N=!y||V||J;let _;e[34]!==s||e[35]!==N||e[36]!==B?(_=Z=>{if(N)return;ee(ie=>({...ie,code:Z}));let re;try{re=JSON.parse(Z)}catch{return}re===null||typeof re!="object"||Array.isArray(re)||B(s,re)},e[34]=s,e[35]=N,e[36]=B,e[37]=_):_=e[37];const $=_;let z;e[38]!==A?(z=()=>({flush:A}),e[38]=A,e[39]=z):z=e[39],E.useImperativeHandle(l,z);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 ne;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]!==N||e[54]!==$||e[55]!==H||e[56]!==d?(ne=!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:N,height:"100%",onChange:Z=>$(Z??""),onSave:Z=>{$(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]=N,e[54]=$,e[55]=H,e[56]=d,e[57]=ne):ne=e[57];let I;return e[58]!==X||e[59]!==ne?(I=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[X,ne]}),e[58]=X,e[59]=ne,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 nd(t){return Sa({contentEditingEnabled:oa(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function sd(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function rd(t){const e=lo(t),{display:n}=t;let s=null;if(n.mode==="production"&&n.iframeBase)try{s=new URL(t.path,n.iframeBase).href}catch{s=null}const a=co(s,e);return{value:e,frame:a?qn(a,t.device):null,newTab:a}}function ad(t){const e=le.c(94),{tests:n,load:s,onOpen:a,options:l,onChange:d,available:o}=t,i=Ee();let c;e[0]!==l?(c=ea(l),e[0]=l,e[1]=c):c=e[1];const m=c;let p;e[2]!==l.tests?(p=l.tests??{},e[2]=l.tests,e[3]=p):p=e[3];const f=p;let y;e[4]!==d||e[5]!==l?(y=I=>{const Z=I?qo(I):null,{at:re,...ie}=l;d(Z?{...ie,at:Z}:ie)},e[4]=d,e[5]=l,e[6]=y):y=e[6];const x=y;let b;e[7]!==f||e[8]!==d||e[9]!==l?(b=(I,Z)=>{const re={...f};Z==="on"?re[I]=!0:Z==="off"?re[I]=!1:delete re[I];const{tests:ie,...he}=l;d(Object.keys(re).length>0?{...he,tests:re}:he)},e[7]=f,e[8]=d,e[9]=l,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(Ki,{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(Kr,{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 D;e[38]!==i?(D=i("sandbox.previewAs.momentLabel"),e[38]=i,e[39]=D):D=e[39];let O;e[40]!==D?(O=r.jsx(Xo,{htmlFor:"preview-as-moment",children:D}),e[40]=D,e[41]=O):O=e[41];let F;e[42]!==l.at?(F=Wo(l.at),e[42]=l.at,e[43]=F):F=e[43];let U;e[44]!==x?(U=I=>x(I.target.value),e[44]=x,e[45]=U):U=e[45];let G;e[46]!==F||e[47]!==U?(G=r.jsx(zn,{id:"preview-as-moment",type:"datetime-local",className:Go,value:F,onChange:U}),e[46]=F,e[47]=U,e[48]=G):G=e[48];const W=l.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 N;e[70]!==V?(N=r.jsx("span",{className:"text-sm font-medium",children:V}),e[70]=V,e[71]=N):N=e[71];let _;e[72]!==f||e[73]!==s||e[74]!==h||e[75]!==i||e[76]!==n?(_=s&&!s.ready?s.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:s.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"})}):n.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:n.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(Zo,{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(ur,{value:"off",children:i("sandbox.previewAs.off")}),r.jsx(ur,{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]=s,e[74]=h,e[75]=i,e[76]=n,e[77]=_):_=e[77];let $;e[78]!==N||e[79]!==_?($=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[N,_]}),e[78]=N,e[79]=_,e[80]=$):$=e[80];let z;e[81]!==m||e[82]!==d||e[83]!==i?(z=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]=z):z=e[84];let X;e[85]!==L||e[86]!==J||e[87]!==$||e[88]!==z?(X=r.jsxs(Hr,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[L,J,$,z]}),e[85]=L,e[86]=J,e[87]=$,e[88]=z,e[89]=X):X=e[89];let ne;return e[90]!==S||e[91]!==X||e[92]!==g?(ne=r.jsxs(Vr,{onOpenChange:g,children:[S,X]}),e[90]=S,e[91]=X,e[92]=g,e[93]=ne):ne=e[93],ne}const id=15e3;function od(t,e,n){return n?t.src===e||t.loading?t:{src:e,loading:!0}:t.src===e&&!t.loading?t:{src:e,loading:!1}}function Pr(t){return t.loading?{...t,loading:!1}:t}function ld(t,e){try{const n=new URL(t),s=new URL(e);return n.origin===s.origin&&n.pathname===s.pathname}catch{return!1}}function cd(t,{base:e,frameSrc:n,loadedSrc:s,wanted:a,canSwap:l}){const d=t?.base===e?t:null,o=d?.src??n,i=d?.shown??n;return!a||!o||!i?null:i===a?d:l&&s===o&&ld(i,a)?{base:e,src:o,shown:a}:null}const dd=["next"],ud=["@tanstack/react-router","@tanstack/react-start","@tanstack/solid-router","@tanstack/solid-start"],Pa=new Set(["tsx","ts","jsx","js","mdx"]),fd=new Set(["tsx","jsx"]),pd=new Set(["404","500"]);function md(t){const e=new Set;if(!t||typeof t!="object")return e;const n=t;for(const s of["dependencies","devDependencies"]){const a=n[s];if(a&&typeof a=="object"&&!Array.isArray(a))for(const l of Object.keys(a))e.add(l)}return e}function hd(t){const e=md(t);return dd.some(n=>e.has(n))?"next":ud.some(n=>e.has(n))?"tanstack":null}function ja(t,e){const n=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${e}`:e}function gd(t,e){const n=s=>ja(e,s);switch(t){case"next":return[{router:"next-pages",dir:n("pages"),pattern:"**/*"},{router:"next-pages",dir:n("src/pages"),pattern:"**/*"},{router:"next-app",dir:n("app"),pattern:"**/page.*"},{router:"next-app",dir:n("src/app"),pattern:"**/page.*"}];case"tanstack":return[{router:"tanstack",dir:n("src/routes"),pattern:"**/*"}];default:{const s=t;throw new Error(`Unknown framework: ${String(s)}`)}}}function ss(t){const e=t.lastIndexOf(".");return e<=0?null:[t.slice(0,e),t.slice(e+1)]}function vd(t){const e=ss(t.at(-1)??"");if(!e||!Pa.has(e[1]))return null;const[n]=e;if(n.includes("."))return null;const s=[...t.slice(0,-1),n];return s[0]==="api"||s.length===1&&pd.has(n)||s.some(a=>a.startsWith("_")||a.includes("["))?null:(s.at(-1)==="index"&&s.pop(),`/${s.join("/")}`)}function xd(t){const e=ss(t.at(-1)??"");if(!e||e[0]!=="page"||!Pa.has(e[1]))return null;const n=[];for(const s of t.slice(0,-1)){if(s.startsWith("_")||s.startsWith("@")||/^\(\.{1,3}\)/.test(s)||s.includes("["))return null;s.startsWith("(")&&s.endsWith(")")||n.push(s)}return`/${n.join("/")}`}function bd(t){const e=[];let n="",s=!1;for(const a of t)a==="["?s=!0:a==="]"&&(s=!1),a==="."&&!s?(e.push(n),n=""):n+=a;return e.push(n),e}function yd(t){const e=ss(t.at(-1)??"");if(!e||!fd.has(e[1]))return null;const n=[...t.slice(0,-1),...bd(e[0])].filter(Boolean);n.at(-1)==="lazy"&&n.pop();const s=n.at(-1);if(!s||s==="__root"||n.some(l=>l.startsWith("-"))||s.startsWith("_"))return null;(s==="index"||s==="route")&&n.pop();const a=[];for(const l of n){if(l.includes("$"))return null;if(l.startsWith("_")||l.startsWith("(")&&l.endsWith(")"))continue;const d=l.replace(/_$/,"").replace(/[[\]]/g,"");d&&a.push(d)}return`/${a.join("/")}`}function wd(t,e){const n=e.split("/").filter(Boolean);if(n.length===0)return null;switch(t){case"next-pages":return vd(n);case"next-app":return xd(n);case"tanstack":return yd(n);default:{const s=t;throw new Error(`Unknown router: ${String(s)}`)}}}function kd(t){const e=new Set;for(const{root:n,files:s}of t){const a=`${n.dir}/`;for(const l of s){if(!l.startsWith(a))continue;const d=wd(n.router,l.slice(a.length));d&&e.add(d)}}return[...e].sort((n,s)=>n==="/"?-1:s==="/"?1:n.localeCompare(s))}const Sd=5e3,Pd=6e4;async function jd(t,e){const n=await fetch(el(t,"glob"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pattern:e.pattern,path:e.dir,limit:Sd})});if(!n.ok)throw new Error(`Failed to list ${e.dir}: ${n.status}`);const s=await n.json();return Array.isArray(s.files)?s.files.filter(a=>typeof a=="string"):[]}async function Ed(t,e){const n=await uo(t,ja(e,"package.json"));if(n.kind==="unavailable")throw new Error("package.json unavailable: sandbox not ready");const s=n.kind==="data"?hd(n.data):null;if(!s)return[];const a=gd(s,e),l=await Promise.all(a.map(async d=>({root:d,files:await jd(t,d)})));return kd(l)}function Nd(t,e,n){const s=le.c(12);let a;s[0]!==e||s[1]!==t?(a=t?Qn.frameworkRoutes(t.orgSlug,t.virtualMcpId,t.branch,t.threadId,e):["framework-routes","none"],s[0]=e,s[1]=t,s[2]=a):a=s[2];let l;s[3]!==e||s[4]!==t?(l=()=>t?Ed(t,e):[],s[3]=e,s[4]=t,s[5]=l):l=s[5];const d=n&&!!t;let o;s[6]!==a||s[7]!==l||s[8]!==d?(o={queryKey:a,queryFn:l,enabled:d,staleTime:Pd},s[6]=a,s[7]=l,s[8]=d,s[9]=o):o=s[9];const i=_r(o);let c;return s[10]!==i.data?(c=i.data??[],s[10]=i.data,s[11]=c):c=s[11],c}const Td=500,Cd={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},jr=1,cn=["desktop","mobile","tablet"],Rd=["preview","visual","blocks"],Er={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function Ld(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 Un(t,e){try{return new URL(t,e).href}catch{return null}}function Ad(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 n={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:n,effective:n.url}}return{pin:t,effective:t?.url??null}}function _d(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function Od(t,e,n){const s=t.toLowerCase(),a=e.toLowerCase(),l=a.split("/").filter(Boolean),d=i=>{if(i===n)return 100;const c=i.indexOf(n);if(c===-1)return 0;let m=40;return c===0?m+=30:/[\s/-]/.test(i[c-1]??"")&&(m+=20),m+=Math.round(n.length/i.length*20),m};let o=Math.max(d(s),d(a));return l.at(-1)===n?o=Math.max(o,95):l.includes(n)&&(o=Math.max(o,90)),o}function Dd(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function $d({virtualMcpId:t}){const e=Ee(),n=sa(),{currentBranch:s,taskId:a,virtualMcpId:l}=nt(),d=!!$i(),o=la(),i=Yi(l===t?t:null),c=Yr(t),m=tl(i?.metadata?.ui?.layout??null),p=oa(m),f=Sa({contentEditingEnabled:p,isMobile:n}),[y]=E.useState(()=>nd({cmsMode:m,isMobile:n})),[x,b]=Kn(Hn.previewEditingMode(t),u=>u&&Rd.includes(u)?u:null),h=x??y,[g,R]=Kn(Hn.previewDeviceSize(t),u=>u&&cn.includes(u)?u:"desktop"),[v,w]=E.useState(null),[C,k]=E.useState(null),S=E.useRef(null),j=E.useRef(null),[T,B]=E.useState(!1),A=E.useRef(null),L=()=>{A.current?.flush(),B(!1)},D=()=>B(u=>(u&&A.current?.flush(),!u)),[O,F]=E.useState({width:0,height:0}),[U,G]=E.useState(!1),[W,Y]=E.useState({}),[q,Q]=E.useState(""),K=E.useRef(null),[ee,H]=E.useState(!1),[J,V]=E.useState(),[N,_]=E.useState(null),[$,z]=E.useState(null),[X,ne]=E.useState(null),[I,Z]=E.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[re,ie]=E.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[he,pe]=E.useState({}),[be,ge]=E.useState(!1),ve=E.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}=pn(),Re=ts(),Ie=xt(),Ue=Ie.vmEntry,Be=Re.lifecycle.phase,{url:bt}=ta(t),me=Ut(t,s),{connection:Oe}=na(t),xe=Jo(t),ze=fo({hasServeConnection:!!Oe,runtime:c.runtime}),Le=!Xe(me)&&me.kind!=="pending",se=He(me)??bt,de=se??Ie.previewUrl,We=!!se||Be==="running",yt=i?.id===t?eo(i.metadata):null,qe=!se&&i?.id===t&&c.runtime==="cms",zt=c.projectDefault==="cms",wt=Le?po({sandboxUrl:de,previewServerUrl:yt,fastPreviewActive:qe}):null,rs=t&&s?{orgSlug:ce.slug,virtualMcpId:t,branch:s,threadId:a??null,previewUrl:de}:null,as=mn(rs,{fetchEnabled:We}),hn=ia(rs,{fetchEnabled:We}),ue=as.data,Pe=hn.data,Ge=ue?_o(ue,Pe).sort((u,P)=>u.name.localeCompare(P.name)):[],Kt=t&&s?{orgSlug:ce.slug,virtualMcpId:t,branch:s}:null,is=Kc(Kt),Ea=mo(Kt),gn=ue&&Pe?Oo(ue,Pe):[],os=Le&&ue&&Pe?Ri(Pe,ue,"loaders"):[],ls=q?(()=>{const u=q.toLowerCase();return Ge.map(P=>({page:P,score:Od(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,cs=gn.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)}),ds=f?os:[],us=ds.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=$?os.find(u=>u.key===$)??null:null,Ne=es,vn=N||$?null:Do(Ge,I,re),oe=vn?.key??null,st=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??oe,Vt=vn?.path??null,rt=(oe?he[oe]:void 0)??{},Ce=Ve(I,rt),xn={};if(Le&&We&&de&&Pe&&ue){const u=Li(Pe,"loaders"),P=oe?ue[oe]:void 0,M=lc(P,ue,we=>u.has(we)),ae=sc(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&&(xn[we.name]=ct)}}const kt=t&&s?{orgSlug:ce.slug,virtualMcpId:t,branch:s,threadId:a??null}:null,fs=ue&&oe?zo(ue,oe,0):[],ps=Xe(me),ms=ue?Ai(fs,ue,ps):[],St=ms.map(u=>u.isSavedBlock?u.label:""),Pt=ms.map(u=>u.isSavedBlock?"global":u.isMultivariate?"variant":"normal"),jt=fs.map(u=>Gn(u,ue??{},ps)),at=E.useRef(null),De=E.useRef(null),Na=Re.status.state==="paused",bn=Re.phase,hs=_i({claimPhase:bn,lifecycle:Re.lifecycle}),Je=Ie.previewState,Ta=Ie.userStopped,Ca=ho(ce.slug,t??""),{url:Ke}=Uo(qe&&t&&s?{orgSlug:ce.slug,virtualMcpId:t,branch:s,previewServerUrl:yt??null,path:Ce}:null),Ra=zt&&c.runtime==="sandbox",Ae=go(me,ze,xe),gs=vo(Ae&&qe&&me.kind==="protocol"&&t&&s?{orgSlug:ce.slug,virtualMcpId:t,branch:s}:null),vs=Ae?gs.pointer:null,te=Rl({previewState:Je,progressStatus:hs.status,previewServerUrl:yt,fastPreviewActive:qe,fastPreviewReady:!!Ke,codingSession:Ra,localPreviewUrl:se,hostedDraft:Ae,hostedPointerPending:Ae&&(me.kind==="pending"||gs.pending)}),xs=te.showWakingPill||Ae&&te.mode==="production"&&!vs,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?se?te.mode==="sandbox"&&f&&h==="blocks":te.mode==="production"&&qe&&Aa&&f&&h==="blocks":!1,bs=E.useRef(null),{pin:_a,effective:Oa}=Ad(bs.current,{inPlaceRenderActive:Nt,draftPreviewUrl:Ke,resolvedPath:Ce});bs.current=_a;const ys=o.state.variantOverride??[],Wt=Le?ys:[],Tt=Le?[]:ys,qt=Xe(me)&&$o.some(u=>Fo(Pe,u)==="available"),ot=qt?W:{},ws=ea(ot),Da=qt&&ue?Object.keys(Bo(ue).experiments):[],[ks,$a]=E.useState(!1),Ss=Zr(Kt,qt&&ks?Mo:[]),Fa={...Ss,ready:!(me.kind==="protocol"&&me.hosted)||ks&&Ss.ready},Ye=t?er(ce.slug,t):null,Ba=xo(Ye),Gt=Ae?rd({display:te,path:Ce,pointer:vs,heldRevision:Ba,device:g,forcedVariants:Tt,previewOptions:ot}):null,Ps=JSON.stringify([Tt,ot]);E.useEffect(()=>{if(!Ae||!Ye)return;const[u,P]=JSON.parse(Ps);tr(Ye,{forcedVariants:u,previewOptions:P})},[Ae,Ye,Ps]),E.useEffect(()=>{if(!(!Ae||!Ye))return()=>tr(Ye,null)},[Ae,Ye]);const yn=Oe&&He(me)?bo(Oe.endpoint,Tt,ws):null,Ma=Oe&&He(me)?yn?yo(yn,ot):nr:null,Qe=Ld(te.mode==="sandbox"?sn(qn(sr(X??Un(Ce,te.iframeBase)??te.iframeBase,Ma),g),Wt):te.mode==="production"&&Gt?.frame?Gt.frame:te.mode==="production"?sn(qn(rr(ar(sr(X??Oa??Un(Ce,te.iframeBase)??te.iframeBase,xs?nr:null),Tt),ot),g),Wt):null),js=Ke??(te.iframeBase?Un(Ce,te.iframeBase):null),Es=te.mode==="production"&&Gt?Gt.newTab:te.mode==="production"?js?sn(rr(ar(js,Tt),ot),Wt):null:Qe??te.iframeBase,Ia=()=>{const u=Es;u&&window.open(u,"_blank","noopener")},Ct=t&&s?Br(ce.slug,t,s):null,Rt=u=>{Ct&&Bi(Ct,u)},ke=o.state.target;E.useEffect(()=>{if(!(!ke||!wt||!Pe))if(ke.kind==="page"){const u=he[ke.key]??{};De.current=Ve(ke.path,u),_(null),z(null),ne(null),ie(ke.key),Z(ke.path),Rt({path:ke.path,pageKey:ke.key,params:u})}else if(ke.kind==="loader")De.current=null,_(null),z(ke.key),ne(null);else{const u=gn.find(P=>P.key===ke.key);if(u){De.current=null;const P=or(Pe);z(null),_(u),ne(ir(wt,P,u.key))}}},[ke,wt,Pe,he]),E.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[Ns,Ua]=E.useState(null);if(Je.kind==="iframe"&&Ns!==Je.previewUrl){const u=Ns!==null;Ua(Je.previewUrl);const P=Ct?Fr(Ct):null;if(P){if(De.current=Ve(P.path,P.params),Z(P.path),ie(P.pageKey),ne(null),_(null),z(null),P.pageKey&&Object.keys(P.params).length>0){const M=P.pageKey;pe(ae=>({...ae,[M]:P.params}))}}else u&&(De.current=null,Z("/"),ne(null),ie(null),_(null),z(null))}at.current=Qe;const za=te.mode==="production"&&!!Ke&&!se,[Jt,wn]=E.useState({src:Qe??void 0,loading:!1}),[Ka,kn]=E.useState(!1),[Ha,Va]=E.useState(),[Ts,Cs]=E.useState(null),je=cd(Ts,{base:te.iframeBase??"",frameSrc:Jt.src,loadedSrc:Ha,wanted:Qe??void 0,canSwap:xe&&Ka&&!Jt.loading});je!==Ts&&Cs(je);const Yt=od(Jt,je?je.src:Qe??void 0,za);Yt!==Jt&&wn(Yt);const lt=Yt.src,Rs=Yt.loading,Ls=Ol({iframeRef:S,src:te.mode==="sandbox"?Qe:null,active:te.mode==="sandbox"}),As=E.useRef(null);E.useEffect(()=>{const u=Rs?setTimeout(()=>wn(Pr),id):null,P=()=>{u&&clearTimeout(u)};if(!Ke||!lt||As.current===Ke)return P;As.current=Ke;const M=S.current;return M&&M.getAttribute("src")!==lt&&(Se(),M.src=lt),P},[Ke,lt,Rs]);const _s=()=>{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=Po({previewBaseUrl:P,pageBlock:M,decofile:ue,path:Ce,pathTemplate:I});if(!ae)return;const we=sn(ae.src,Eo(Wt,oe));u.postMessage({type:"cms-editor::render",src:we,body:ae.body},P)},Sn=E.useRef(null);E.useEffect(()=>{if(!Nt||N||$||!oe||!ue){Sn.current=null;return}const u={nav:JSON.stringify({page:oe,path:Ce,pathTemplate:I}),content:JSON.stringify(ue)},P=_d(Sn.current,u);Sn.current=u,P&&_s()},[ue,Nt,N,$,oe,Ce,I]);const Pn=E.useRef(null);E.useEffect(()=>{if(!Nt||N||$||!oe||!ue){Pn.current=null;return}const u=JSON.stringify(o.state.variantOverride??null),P=Pn.current;Pn.current={page:oe,sig:u},!(!P||P.page!==oe||P.sig===u)&&_s()},[o.state.variantOverride,Nt,N,$,oe]);const Os=!!t&&!!s&&!Re.notFound&&!Ta&&!Na&&(bn?.kind==="ready"||Be!=="idle"),Ds=!Xe(me),Wa=Zn(t??void 0),qa=Nd(kt,Wa,Ds&&Os),Ga=new Set(Ge.map(u=>Ne(u.path))),Qt=Ds?qa.filter(u=>!Ga.has(Ne(u))):[],$s=q?Qt.filter(u=>u.toLowerCase().includes(q.toLowerCase())):Qt,ye=sd({editingMode:h,sandboxDisplay:te.mode==="sandbox",blocksEditingEnabled:f});E.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=Ul.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 Fs=()=>{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)},Bs=()=>{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"}))},jn=()=>{if(xe){Bs();return}const u=S.current?.contentWindow,P=it,M=Mc({v8:xe,production:te.mode==="production",localPreview:!!se,script:zl});!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)},Ms=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;!n&&u!==P&&(u==="blocks"?j.current?.resize("30%"):j.current?.collapse()),b(u),w(null),k(null),u!=="blocks"&&z(null),P==="visual"&&Ja(),u==="visual"&&Fs(),P==="blocks"&&u!=="blocks"&&Ya(),u==="blocks"&&jn()},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(),Dd(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)};Ho(Zt);const Me=E.useRef(null),Is=E.useEffectEvent(Bs),ei=E.useEffectEvent((u,P)=>{k({index:u,seq:P})}),ti=E.useEffectEvent(()=>{fe(),je&&(En.current=je.shown),At&&Dn(Lt)}),Us=E.useEffectEvent(()=>{if(kn(!1),je&&Cs(null),je&&je.src!==at.current){Se();return}Zt()});E.useEffect(()=>{if(!xe)return;const u=new ql({studioOrigin:window.location.origin,build:"4.574.8",frame:()=>S.current?.contentWindow??null,onWireframeReady:()=>Is(),onWireframe:M=>{M.type==="wireframe:select"&&ei(M.sectionIndex,M.clickSeq)},onModulesChange:()=>kn(u.has("html-swap")),onSwapEnd:()=>ti(),onSwapFailed:()=>Us()});Me.current=u;const P=M=>{u.handle(M)};return window.addEventListener("message",P),()=>{window.removeEventListener("message",P),u.dispose(),kn(!1),Me.current===u&&(Me.current=null)}},[xe,te.iframeBase]);const zs=xe?JSON.stringify([St,Pt,jt,ye]):"";E.useEffect(()=>{zs&&Is()},[zs]);const Ks=E.useRef(null);E.useEffect(()=>{const u=Ks.current;if(Ks.current=je,je&&je!==u){Me.current?.refresh(je.shown)?Se():Us();return}!je&&u&&u.shown!==u.src&&u.src===at.current&&Zt()},[je]);const Hs=()=>{Me.current?.refresh()||Zt()},Lt=er(ce.slug,t??""),At=Ae&&Et&&!!t,En=E.useRef(null);E.useEffect(()=>{if(At)return wo(Lt)},[At,Lt]);const{reload:_t}=ko(ce.slug,t??""),Vs=E.useRef(_t.seq);E.useEffect(()=>{if(Vs.current!==_t.seq&&(Vs.current=_t.seq,!!At&&En.current===at.current)){if(_t.navigates){Dn(Lt);return}Hs()}},[_t.seq]);const Nn=Qr(Kt),Ot=So(He(me)?Nn:""),Ws=E.useRef(Ot);E.useEffect(()=>{const u=Ws.current;if(Ws.current=Ot,!u||!Ot||u===Ot)return;const P=S.current;if(P)return Fl({iframe:P,reload:Hs})},[Ot]);const ni=()=>{const u=cn.indexOf(g);R(cn[(u+1)%cn.length])},Tn=(u,P)=>{if(!oe)return;const M=oe,ae={...rt,[u]:P};De.current=Ve(I,ae),pe(we=>({...we,[M]:ae})),Rt({path:I,pageKey:M,params:ae})},si=$c({iframeBase:te.iframeBase,resolvedPath:Ce,activeGlobalSectionName:N?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),Cn=u=>{const P=he[u.key]??{},M=Ve(u.path,P);(N||Ne(M)!==Ne(Ce))&&Se(),De.current=M,_(null),z(null),ne(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})},qs=u=>{(N||Ne(u)!==Ne(Ce))&&Se(),De.current=u,_(null),z(null),ne(null),k(null),ie(null),Z(u),Rt({path:u,pageKey:null,params:{}})};Fi(Ct,qs);const ri=u=>{if(Xe(me)){const ae=ue?Io(ue,u.key,Pe):null;ae?Cn(ae):un.info(e("sandbox.preview.blockOnNoPage"));return}if(!wt||!Pe){un.error(e("sandbox.preview.previewMetadataNotReady"));return}Se(),De.current=null;const P=or(Pe),M=ir(wt,P,u.key);_(u),z(null),ne(M),k(null),o.selectTarget({kind:"section",key:u.key})},ai=u=>{f&&(_(null),z(u.key),ne(null),Xt("blocks"),o.selectTarget({kind:"loader",key:u.key}))},ii=async({name:u,path:P,templateKey:M})=>{if(!t||!s)return;const ae=aa(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 is.mutateAsync({name:u,path:we,template:Te,schema:Xe(me)?{meta:Pe,loadMeta:async()=>(await hn.refetch()).data}:void 0});H(!1),un.success(e("sandbox.preview.pageCreated",{name:u})),await sl(Td),Cn({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"))}},en=Fc({previewSurfaceActive:Et,daemonReady:Os,production:te.mode==="production",servePreviewUrl:He(me)}),oi=Bc({showPreviewToolbar:en,contentEditingEnabled:p}),Dt=()=>{G(!1),Q("")},Rn=N?.name??Ht?.title??vn?.name,Ln=as.isPending||hn.isPending,An=Ln?Mt(te.iframeBase):Rn,$t=N?`section:${N.key}`:$?`loader:${$}`:oe?`page:${oe}`:Qt.includes(Ne(I))?`route:${Ne(I)}`:void 0,li=en?oi?r.jsxs(Vr,{open:U,onOpenChange:u=>{G(u),u||Q("")},children:[r.jsx(Kr,{asChild:!0,children:r.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:Ln?An??void 0:N||Ht?Rn:[Rn,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:[N&&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(Hi,{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(Vi,{size:11}),e("sandbox.preview.loaderBadge")]}),An&&r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:An}),!Ln&&!N&&!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(Mi,{size:12,className:Fe("shrink-0 transition-transform",U&&"rotate-180")})]})})}),r.jsxs(Hr,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[r.jsxs(qr,{shouldFilter:!1,defaultValue:$t,children:[r.jsx(Gr,{value:q,onValueChange:u=>{Q(u),K.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),r.jsxs(Wr,{ref:K,className:"max-h-80",children:[r.jsx(Jr,{children:Ge.length===0&&Qt.length===0&&gn.length===0&&ds.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),ls.length>0&&r.jsx(ft,{children:ls.map(u=>r.jsxs(pt,{value:`page:${u.key}`,"aria-current":$t===`page:${u.key}`||void 0,title:`${u.name} · ${u.path}`,onSelect:()=>{Dt(),Cn(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))}),$s.length>0&&r.jsx(ft,{heading:e("sandbox.preview.siteRoutes"),children:$s.map(u=>r.jsx(pt,{value:`route:${u}`,"aria-current":$t===`route:${u}`||void 0,title:u,onSelect:()=>{Dt(),qs(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))}),cs.length>0&&r.jsx(ft,{heading:e("sandbox.preview.globalComponents"),children:cs.map(u=>r.jsx(pt,{value:`section:${u.key}`,"aria-current":$t===`section:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Dt(),ri(u)},children:r.jsx("span",{className:"truncate",children:u.name})},u.key))}),us.length>0&&r.jsx(ft,{heading:e("sandbox.preview.globalLoaders"),children:us.map(u=>r.jsx(pt,{value:`loader:${u.key}`,"aria-current":$t===`loader:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Dt(),ai(u)},children:r.jsx("span",{className:"truncate",children:u.title})},u.key))})]})]}),!N&&!$&&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=xn[u.name];return M&&kt?r.jsx(Sc,{sources:M,template:I,paramName:u.name,value:rt[u.name]??"",sandboxRef:kt,onCommit:ae=>Tn(u.name,ae)},`${oe}:${u.name}`):r.jsx(Oc,{name:u.name,value:rt[u.name]??"",onCommit:ae=>Tn(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:()=>{Dt(),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:si}):null,Gs=en||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:ni,"aria-label":e(Er[g]),children:g==="mobile"?r.jsx(Ir,{size:16}):g==="tablet"?r.jsx(Wi,{size:16}):r.jsx(Ur,{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:Da,load:Fa,onOpen:()=>$a(!0),options:W,onChange:u=>{Y(u),o.previewAsChanged()},available:!!yn||!xs||!ws}),r.jsx(Ze,{onClick:Ia,disabled:Ae&&!Es,"aria-label":e("sandbox.preview.openInNewTab"),children:r.jsx(Or,{size:16})})]})]}):null,ci=(Le||d)&&te.mode==="sandbox",tn=Cd[g],nn=g==="desktop"&&(O.width===0||O.width>=tn.width+2*jr),Js=nn?1:Math.min(O.width>0?O.width/(tn.width+2*jr):1,1),di=nn?{width:"100%",height:"100%"}:{width:`${tn.width}px`,height:O.height>0?`${O.height/Js}px`:`${tn.height}px`,transform:`scale(${Js})`,transformOrigin:"top center"},Ys=r.jsxs(r.Fragment,{children:[ci&&(en||p)&&r.jsx(Ze,{onClick:Xa,"aria-pressed":ye==="visual","aria-label":e("sandbox.preview.visualEditor"),active:ye==="visual",children:r.jsx(Zs,{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(Gi,{size:16})})}),r.jsx(gt,{children:e("sandbox.preview.blocksEditor")})]}),st&&r.jsxs(vt,{children:[r.jsx(ht,{asChild:!0,children:r.jsx(Ze,{onClick:D,"aria-pressed":T,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:T,children:r.jsx(qi,{size:16})})}),r.jsx(gt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),ui=!!$&&ye==="blocks";return r.jsxs("div",{className:"flex flex-col w-full h-full",children:[kt&&Object.entries(xn).map(([u,P])=>(rt[u]??"")===""?r.jsx(Ac,{sources:P,template:I,paramName:u,sandboxRef:kt,onFill:M=>Tn(u,M)},`${oe}:${u}`):null),r.jsxs(r.Fragment,{children:[r.jsx(Vn.Toolbar.Center.Portal,{fallback:r.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:Gs}),children:Gs}),r.jsx(Vn.Toolbar.Right.Portal,{fallback:Ys,children:Ys})]}),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(kr,{virtualMcpId:t,externalSelection:C,onSectionPicked:Ms,onViewJsonFile:D}),T&&st&&r.jsx("div",{className:"absolute inset-0 z-10",children:r.jsx(Sr,{ref:A,virtualMcpId:t,pageKey:st,onClose:L},me.kind==="legacy"?void 0:JSON.stringify([Nn,xe]))})]}):r.jsxs(lr,{orientation:"horizontal",disabled:ye!=="blocks",className:"relative isolate",children:[r.jsx(rn,{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(kr,{virtualMcpId:t,externalSelection:C,onSectionPicked:Ms,onViewJsonFile:D})}),ye==="blocks"&&r.jsx(cr,{withHandle:!0}),r.jsx(rn,{id:"preview-canvas",defaultSize:ye==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:r.jsxs(lr,{orientation:"horizontal",disabled:!(T&&st),children:[r.jsx(rn,{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&&!nn&&"bg-muted/30"),children:[(be||Ca)&&Et&&r.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:r.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),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(On,{kind:"starting",progress:hs,claimPhase:bn})}),!se&&Je.kind==="suspended"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(On,{kind:"suspended",onResume:Ie.resume})}),!se&&Je.kind==="errored"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(On,{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(Zs,{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",!nn&&"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:Ls.handleError,onLoad:()=>{if(wn(Pr),Va(lt),Ls.handleLoad(),fe(),En.current=at.current,At&&Dn(Lt),te.mode!=="sandbox"||se){(te.mode==="production"&&!te.showWakingPill||se)&&ye==="blocks"&&jn();return}if(yi("vm_preview_loaded",{view_mode:ye,vm_id:Ue?.sandboxHandle??null}),!N)try{const u=S.current?.contentWindow?.location?.pathname;if(!u)return;const P=De.current;if(P!==null&&(De.current=null,Ne(u)!==Ne(P))||Ne(u)===Ne(Ce))return;Z(u),Rt({path:u,pageKey:re,params:rt})}catch{}ye==="visual"&&Fs(),ye==="blocks"&&jn()}},te.iframeBase)})]})}),T&&st&&r.jsxs(r.Fragment,{children:[r.jsx(cr,{withHandle:!0}),r.jsx(rn,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:r.jsx(Sr,{ref:A,virtualMcpId:t,pageKey:st,onClose:L},me.kind==="legacy"?void 0:JSON.stringify([Nn,xe]))})]})]})})]})}),r.jsx(Hc,{open:ee,onOpenChange:H,isPending:is.isPending,error:J,templates:Ge,onSubmit:ii})]})}const Yn={app:null,split:!1};function Fd(t){const e=le.c(24),{project:n,maxApps:s,children:a}=t,l=Ee();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={silent:!0},e[0]=d):d=e[0];const o=Qi(d),i=xt();let c;e[1]!==n.metadata.runtime?(c=n.metadata.runtime??{},e[1]=n.metadata.runtime,e[2]=c):c=e[2];const m=c;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]!==n.id||e[8]!==n.metadata||e[9]!==m||e[10]!==l?(y=v=>o.update.mutate({id:n.id,data:{metadata:{...rl(n.metadata),runtime:{...m,apps:v.length?v:null}}}},{onSuccess:()=>i.start(),onError:()=>un.error(l("sandbox.appTabs.saveError"))}),e[5]=o.update,e[6]=i,e[7]=n.id,e[8]=n.metadata,e[9]=m,e[10]=l,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]!==s||e[19]!==n.id||e[20]!==b||e[21]!==h||e[22]!==g?(R=r.jsx(Bd,{virtualMcpId:n.id,mainPath:b,apps:f,maxApps:s,onAddApp:h,onRemoveApp:g,children:a}),e[16]=f,e[17]=a,e[18]=s,e[19]=n.id,e[20]=b,e[21]=h,e[22]=g,e[23]=R):R=e[23],R}function Bd(t){const e=le.c(102),{virtualMcpId:n,mainPath:s,apps:a,maxApps:l,onAddApp:d,onRemoveApp:o,children:i}=t,c=Ee(),m=sa(),{currentBranch:p}=nt(),f=xt(),y=ts().lifecycle.phase,x=Ut(n,p),{url:b}=ta(n);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]!==n?(S=Hn.previewAppLayout(n),e[5]=n,e[6]=S):S=e[6];const[j,T]=Kn(S,Md);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,D=A===null||L,O=A??a[0]?.path??null,[F,U]=E.useState(null),[G,W]=E.useState(!1);let Y;e[10]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>{U(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]!==s||e[15]!==d||e[16]!==T?(Q=()=>{if(F===null)return;const fe=fr(F);if(!fe){q();return}if(fe===fr(s??"")||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]=s,e[15]=d,e[16]=T,e[17]=Q):Q=e[17];const K=Q;let ee;e[18]!==s||e[19]!==c?(ee=s?$n(s):c("sandbox.appTabs.root"),e[18]=s,e[19]=c,e[20]=ee):ee=e[20];const H=ee;let J;e[21]!==L||e[22]!==c?(J=c(L?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=L,e[22]=c,e[23]=J):J=e[23];const V=J;let N;e[24]!==c?(N=c("sandbox.appTabs.label"),e[24]=c,e[25]=N):N=e[25];let _;e[26]!==c?(_=c("sandbox.appTabs.main"),e[26]=c,e[27]=_):_=e[27];let $;e[28]!==c?($=c("sandbox.appTabs.mainHint"),e[28]=c,e[29]=$):$=e[29];let z;e[30]!==T?(z=()=>T(Yn),e[30]=T,e[31]=z):z=e[31];let X;e[32]!==w||e[33]!==H||e[34]!==v||e[35]!==D||e[36]!==_||e[37]!==$||e[38]!==z?(X=r.jsx(Nr,{label:H,badge:_,hint:$,ready:v,failed:w,onScreen:D,onSelect:z}),e[32]=w,e[33]=H,e[34]=v,e[35]=D,e[36]=_,e[37]=$,e[38]=z,e[39]=X):X=e[39];let ne;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]!==c){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]!==c?(fe=ce=>{const Re=$n(ce.path);return r.jsx(Nr,{label:Re,hint:c("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:c("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]=c,e[58]=fe):fe=e[58],ne=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]=c,e[49]=ne}else ne=e[49];let I;e[59]!==X||e[60]!==ne||e[61]!==N?(I=r.jsxs("div",{role:"tablist","aria-label":N,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[X,ne]}),e[59]=X,e[60]=ne,e[61]=N,e[62]=I):I=e[62];let Z;e[63]!==a.length||e[64]!==K||e[65]!==F||e[66]!==G||e[67]!==l||e[68]!==c?(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":c("sandbox.appTabs.pathLabel"),"aria-invalid":G,onChange:fe=>{U(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<l&&r.jsx(mt,{label:c("sandbox.appTabs.add"),onClick:()=>U(""),children:r.jsx(zr,{})}),e[63]=a.length,e[64]=K,e[65]=F,e[66]=G,e[67]=l,e[68]=c,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?Yn:{app:O,split:!0}),children:r.jsx(Ji,{})}),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(Vn.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]!==D?(be=D&&r.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:i}),e[82]=i,e[83]=D,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(Id,{name:$n(A),mainName:H,appUrl:R?al(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 Md(t){return t??Yn}function Nr(t){const e=le.c(28),{label:n,badge:s,hint:a,ready:l,failed:d,onScreen:o,onSelect:i,onRemove:c,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=l?"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]!==n?(h=r.jsx("span",{className:"max-w-40 truncate",children:n}),e[6]=n,e[7]=h):h=e[7];let g;e[8]!==s?(g=s&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:s}),e[8]=s,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]!==c||e[22]!==m?(C=c&&r.jsx("button",{type:"button","aria-label":m,onClick:c,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]=c,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 Id(t){const e=le.c(71),{name:n,mainName:s,appUrl:a,ready:l,failed:d,notStarted:o,onStart:i,className:c,onClose:m}=t,p=Ee(),[f,y]=E.useState("/"),[x,b]=E.useState("desktop"),[h,g]=E.useState(0),R=E.useRef(null);let v;e[0]!==a||e[1]!==f?(v=a?il(a,f):null,e[0]=a,e[1]=f,e[2]=v):v=e[2];const w=v;let C;e[3]!==c?(C=Fe("flex min-h-0 min-w-0 flex-1 flex-col",c),e[3]=c,e[4]=C):C=e[4];let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=$=>{$.preventDefault(),y(R.current?.value||"/")},e[5]=k):k=e[5];let S;e[6]!==n||e[7]!==p?(S=p("sandbox.appPane.path",{app:n}),e[6]=n,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(zd),e[15]=B):B=e[15];let A;e[16]!==x?(A=x==="desktop"?r.jsx(Ur,{}):r.jsx(Ir,{}),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 D;e[21]!==n||e[22]!==p?(D=p("sandbox.appPane.reload",{app:n}),e[21]=n,e[22]=p,e[23]=D):D=e[23];const O=!w||!l;let F,U;e[24]===Symbol.for("react.memo_cache_sentinel")?(F=()=>g(Ud),U=r.jsx(wi,{}),e[24]=F,e[25]=U):(F=e[24],U=e[25]);let G;e[26]!==D||e[27]!==O?(G=r.jsx(mt,{label:D,disabled:O,onClick:F,children:U}),e[26]=D,e[27]=O,e[28]=G):G=e[28];let W;e[29]!==n||e[30]!==p?(W=p("sandbox.appPane.openInNewTab",{app:n}),e[29]=n,e[30]=p,e[31]=W):W=e[31];const Y=!w||!l;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]!==n||e[40]!==m||e[41]!==p?(ee=m&&r.jsx(mt,{label:p("sandbox.appPane.close",{app:n}),onClick:m,children:r.jsx(ma,{})}),e[39]=n,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]!==s||e[50]!==p?(J=p("sandbox.appPane.previewOnly",{app:s}),e[49]=s,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 N;e[54]!==x||e[55]!==d||e[56]!==s||e[57]!==n||e[58]!==o||e[59]!==i||e[60]!==l||e[61]!==h||e[62]!==w||e[63]!==p?(N=r.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:l&&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:n})}),r.jsx(_e,{size:"sm",variant:"outline",onClick:i,children:p("sandbox.appPane.start",{app:n})})]}):!l||!w?r.jsx("p",{className:"self-center px-6 text-center text-sm text-muted-foreground",children:l?p("sandbox.appPane.noUrl"):d?p("sandbox.appPane.failed",{app:s}):p("sandbox.appPane.waiting")}):r.jsx("iframe",{src:w,title:n,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]=s,e[57]=n,e[58]=o,e[59]=i,e[60]=l,e[61]=h,e[62]=w,e[63]=p,e[64]=N):N=e[64];let _;return e[65]!==n||e[66]!==C||e[67]!==H||e[68]!==V||e[69]!==N?(_=r.jsxs("section",{"aria-label":n,className:C,children:[H,V,N]}),e[65]=n,e[66]=C,e[67]=H,e[68]=V,e[69]=N,e[70]=_):_=e[70],_}function Ud(t){return t+1}function zd(t){return t==="desktop"?"mobile":"desktop"}function mt(t){const e=le.c(11),{label:n,children:s,active:a,disabled:l,onClick:d}=t;let o;e[0]!==a||e[1]!==s||e[2]!==l||e[3]!==n||e[4]!==d?(o=r.jsx(ht,{asChild:!0,children:r.jsx(Ze,{"aria-label":n,"aria-pressed":a,active:a,disabled:l,onClick:d,children:s})}),e[0]=a,e[1]=s,e[2]=l,e[3]=n,e[4]=d,e[5]=o):o=e[5];let i;e[6]!==n?(i=r.jsx(gt,{children:n}),e[6]=n,e[7]=i):i=e[7];let c;return e[8]!==o||e[9]!==i?(c=r.jsxs(vt,{children:[o,i]}),e[8]=o,e[9]=i,e[10]=c):c=e[10],c}const Kd=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},Hd=1e4,Vd=1e4,Wd=5e3,qd=2;function Gd(t,e){return t&&e===0?Vd:Math.min(1e3*2**Math.max(0,e-1),Wd)}function Jd(t,e,n){return e?!0:t===!0&&n<qd}function Yd(t,e){const n=le.c(11),s=Kd,a=ki();let l;n[0]!==t?(l=Qn.localAppReachable(t??""),n[0]=t,n[1]=l):l=n[1];const d=l;let o;n[2]!==s||n[3]!==a||n[4]!==d||n[5]!==t?(o=async p=>{const{signal:f}=p,y=new AbortController,x=()=>y.abort();f.addEventListener("abort",x);const b=setTimeout(x,Hd),h=await s(t,y.signal).catch(Xd);clearTimeout(b),f.removeEventListener("abort",x);const g=a.getQueryData(d),R=h?0:(g?.failures??0)+1;return{up:Jd(g?.up??null,h,R),failures:R}},n[2]=s,n[3]=a,n[4]=d,n[5]=t,n[6]=o):o=n[6];const i=!!t;let c;n[7]!==d||n[8]!==o||n[9]!==i?(c={queryKey:d,queryFn:o,enabled:i,retry:!1,staleTime:0,gcTime:0,refetchInterval:Qd},n[7]=d,n[8]=o,n[9]=i,n[10]=c):c=n[10];const{data:m}=_r(c);return t?m?.up??null:null}function Qd(t){return t.state.data?Gd(t.state.data.up,t.state.data.failures):!1}function Xd(){return!1}function Zd(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const n=e.problem;return!n||n.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:n}}return{kind:"connecting"}}function Xu(t){const e=le.c(53),{virtualMcpId:n}=t,s=Ee(),a=Xi(n),{connection:l}=na(n),{activeTask:d,taskId:o,currentBranch:i}=nt(),c=ml(o),[m,p]=E.useState(!1),f=Ut(n,i);let y;e[0]!==f||e[1]!==l?(y=l?He(f):null,e[0]=f,e[1]=l,e[2]=y):y=e[2];const x=y,b=Yd(x),h=ga(),g=ol("multi_app_preview");if(dl({threadId:o,sandboxBranch:d?.branch??i,agentHasRepo:Fn(a?.metadata),threadHasRepo:Fn(c)||Fn(d?.metadata)})==="none"&&!l){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(pr,{className:"size-7 text-foreground"})}),e[3]=k):k=e[3];let S;e[4]!==s?(S=s("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=s,e[5]=S):S=e[5];let j;e[6]!==s?(j=s("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=s,e[7]=j):j=e[7];let T,B;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>p(!0),B=r.jsx(pr,{className:"size-4"}),e[8]=T,e[9]=B):(T=e[8],B=e[9]);let A;e[10]!==s?(A=s("mainPanelTabs.previewTab.connectGithub"),e[10]=s,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 D;e[14]!==S||e[15]!==j||e[16]!==L?(D=r.jsx(ll,{className:"h-full",image:k,title:S,description:j,actions:L}),e[14]=S,e[15]=j,e[16]=L,e[17]=D):D=e[17];let O;e[18]!==m?(O=r.jsx(cl,{open:m,onOpenChange:p,mode:"agent"}),e[18]=m,e[19]=O):O=e[19];let F;return e[20]!==O||e[21]!==D?(F=r.jsxs(r.Fragment,{children:[D,O]}),e[20]=O,e[21]=D,e[22]=F):F=e[22],F}if(l&&a&&!He(f)){let k;e[23]!==h||e[24]!==f?(k=Zd({backend:f,access:h}),e[23]=h,e[24]=f,e[25]=k):k=e[25];let S;e[26]!==l.endpoint?(S=jo(l.endpoint),e[26]=l.endpoint,e[27]=S):S=e[27];let j;return e[28]!==k||e[29]!==S?(j=r.jsx(tu,{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]!==s?(k=s("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=s,e[32]=k):k=e[32];let S;e[33]!==x||e[34]!==s?(S=s("mainPanelTabs.previewTab.localAppWaiting.body",{host:eu(x)}),e[33]=x,e[34]=s,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]!==s?(T=s("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=s,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(fn,{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]!==n?(v=r.jsx($d,{virtualMcpId:n}),e[46]=n,e[47]=v):v=e[47];const w=v;let C;return e[48]!==a||e[49]!==g||e[50]!==w||e[51]!==l?(C=r.jsx(Oi,{children:g&&a&&!l?r.jsx(Fd,{project:a,maxApps:nl,children:w}):w}),e[48]=a,e[49]=g,e[50]=w,e[51]=l,e[52]=C):C=e[52],C}function eu(t){try{return new URL(t).host}catch{return t}}function tu(t){const e=le.c(13),{status:n,host:s}=t,a=Ee();if(n.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 c;return e[4]!==o||e[5]!==i?(c=r.jsx(fn,{headingLevel:2,waiting:!1,title:o,lead:i}),e[4]=o,e[5]=i,e[6]=c):c=e[6],c}let l;e[7]!==s||e[8]!==n?(l=bl(n,s),e[7]=s,e[8]=n,e[9]=l):l=e[9];let d;return e[10]!==s||e[11]!==l?(d=r.jsx(xl,{wait:l,hosts:s}),e[10]=s,e[11]=l,e[12]=d):d=e[12],d}export{xl as L,Xu as P,fn as S,Qu as u};
|
|
551
|
+
`)}function Yl(t,e,n=320,s=44,a=12){const{x:l,y:d}=t,{width:o,height:i}=e,c=Math.max(a,Math.min(l-n/2,o-n-a)),p=d/i>.68?Math.max(a,d-s-18):Math.min(d+18,i-s-a);return{leftPct:c/o*100,topPct:p/i*100}}function Ql(t){const e=le.c(45),{element:n,onDismiss:s}=t,[a,l]=E.useState(""),d=E.useRef(null),{sendMessage:o}=Di(),{openSidePanel:i}=Ko(),c=Ee();let m;e[0]!==n||e[1]!==a||e[2]!==s||e[3]!==i||e[4]!==o?(m=()=>{if(!a.trim())return;const U=Jl(n,a);i(),o({parts:[{type:"text",text:U}]}),s()},e[0]=n,e[1]=a,e[2]=s,e[3]=i,e[4]=o,e[5]=m):m=e[5];const p=m;let f;e[6]!==n.position||e[7]!==n.viewport?(f=Yl(n.position,n.viewport),e[6]=n.position,e[7]=n.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=U=>{U.preventDefault(),p()},e[12]=p,e[13]=g):g=e[13];let R;e[14]===Symbol.for("react.memo_cache_sentinel")?(R=U=>l(U.target.value),e[14]=R):R=e[14];let v;e[15]!==s?(v=U=>{U.key==="Escape"&&s()},e[15]=s,e[16]=v):v=e[16];let w;e[17]!==c?(w=c("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=c,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]!==c?(j=c("sandbox.visualEditorPrompt.sendButton"),e[25]=c,e[26]=j):j=e[26];let T;e[27]!==c?(T=c("sandbox.visualEditorPrompt.sendButton"),e[27]=c,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 D;e[34]!==S||e[35]!==j||e[36]!==L?(D=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]=D):D=e[37];let O;e[38]!==C||e[39]!==D||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,D]}),e[38]=C,e[39]=D,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 xr="site-links",Xl=/details?page|\bpdp\b/i,Zl=/listingpage|\bplp\b/i;function ec(t,e,n){const s=new Set;for(const o of n)Xl.test(o)&&s.add("product"),Zl.test(o)&&s.add("category");const a=It(es(t)),l=a[a.length-1],d=a[a.length-2];return l?.type==="text"&&l.text==="/p"&&d?.type==="param"&&d.name===e&&s.add("product"),e==="*"&&a.some(o=>o.type==="param"&&o.name==="*")&&s.add("category"),s}const tc=["rosa","preto","pink","black"];function on(t,e){const n=e.trim();return n?t(n):tc.flatMap(s=>t(s))}function nc(t,e){const n=e.trim(),s=[];/^\d+$/.test(n)&&s.push({resolveType:t,props:{ids:[n]}});const l=n.includes("-")&&!/\s/.test(n)?n.replace(/-+/g," "):n;return s.push({resolveType:t,props:{query:l,count:10}}),s}const va=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function ns(t){return t.split("/")[0]??""}function sc(t){const e=new Set;for(const n of t){const s=ns(n);va.has(s)&&e.add(s)}return e}function rc(t,e){const n=ns(t);return!va.has(n)||e.size===0?!0:e.has(n)}const ac=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>on(n=>nc(t,n),e),optionsFromPayload:ln},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>on(n=>[{resolveType:t,props:{props:{search:n,pageSize:10,currentPage:1}}}],e),optionsFromPayload:ln},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>on(n=>[{resolveType:t,props:{term:n,hitsPerPage:10}}],e),optionsFromPayload:ln},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>on(n=>[{resolveType:t,props:{query:n,term:n,count:10,hitsPerPage:10}}],e),optionsFromPayload:ln},{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,n=new Set){const s=[...e],a=o=>{const i=[];for(const c of ac){if(c.kind!==o)continue;const m=s.find(p=>c.test(p)&&rc(p,n));m&&i.push({cand:c,resolveType:m})}return i.find(c=>n.has(ns(c.resolveType)))??i[0]},l=(o,i,c)=>({kind:o.kind,id:`${o.kind}:${i}`,resolveType:i,clientFilter:o.clientFilter,isFallback:c,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(l(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:xr,resolveType:xr,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,n)=>vc(e,n)}}function et(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function lc(t,e,n){const s=new Set,a=new Set,l=d=>{if(Array.isArray(d)){for(const c of d)l(c);return}const o=et(d);if(!o)return;const i=o.__resolveType;if(typeof i=="string"){if(n(i))s.add(i);else if(i in e&&!a.has(i)){a.add(i);const c=et(e[i])?.__resolveType;typeof c=="string"&&n(c)&&s.add(i),l(e[i])}}for(const c of Object.values(o))l(c)};return l(t),s}function xa(t){const e=new Set,n=[];for(const s of t)for(const a of s)e.has(a.value)||(e.add(a.value),n.push(a));return n}function ba(t){try{return decodeURIComponent(t)}catch{return t}}function cc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dc(t){const e=[];let n="^";for(const s of t)s.type==="text"?n+=cc(s.text):(e.push(s.name),n+=s.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${n}$`),order:e}}function ya(t,e,n){if(typeof t!="string"||!t)return null;let s;try{s=new URL(t,"https://placeholder.invalid").pathname}catch{return null}s=s.replace(/\/+$/,"");const a=It(es(e)),{pattern:l,order:d}=dc(a),o=d.indexOf(n);if(o===-1)return null;const i=s.match(l);if(!i)return null;const c=i[o+1]?.replace(/^\/+|\/+$/g,"");return c?ba(c):null}function ln(t,e){const n=et(t),s=Array.isArray(t)?t:Array.isArray(n?.products)?n.products:Array.isArray(n?.list)?n.list:[],a=[],l=new Set;for(const d of s){const o=et(d);if(!o)continue;const i=ya(o.url,e.template,e.paramName);if(!i||l.has(i))continue;l.add(i);const c=et(o.isVariantOf),m=typeof c?.name=="string"&&c.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 n=e.replace(/^\/+|\/+$/g,"");return n?ba(n):null}function fc(t){const e=[],n=new Set,s=(a,l)=>{const d=et(a);if(!d)return;const o=typeof d.name=="string"&&d.name?d.name:"",i=o?[...l,o]:l,c=uc(d.url);if(c&&!n.has(c)&&(n.add(c),e.push({value:c,label:i.join(" › ")||c})),Array.isArray(d.children))for(const m of d.children)s(m,i)};if(Array.isArray(t))for(const a of t)s(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,n=>n.toUpperCase())}function hc(t){if(typeof t!="string"||!t)return[];const e=[],n=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let s,a=0;for(;(s=n.exec(t))!==null&&a++<5e3;){const l=s[1]??"",d=(s[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:l,text:d})}return e}function gc(t){if(typeof t!="string"||!t)return[];const e=[],n=new Set,s=/"@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 l,d=0;for(;(l=s.exec(t))!==null&&d++<3e3;){const o=(l[1]??"").replace(/\\\//g,"/");if(!o||n.has(o))continue;n.add(o);const i=t.slice(l.index,l.index+900).match(a)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:l[2]??"",image:i||void 0})}return e}function vc(t,e){const n=[],s=new Set,a=(l,d,o,i)=>{if(n.length>=200)return;const c=ya(l,e.template,e.paramName);!c||s.has(c)||e.paramName==="*"&&/(^|\/)p$/.test(c)||o==="category"&&pc.has(c.split("/")[0]??"")||(s.add(c),n.push({value:c,label:d&&d.length<=80?d:mc(c),kind:o,image:i}))};for(const{url:l,name:d,image:o}of gc(t))a(l,d,"product",o);for(const{href:l,text:d}of hc(t))l.startsWith("/")&&!l.startsWith("//")&&a(l,d,"category");return n}function Ft(t,e,n=50){const s=e.trim().toLowerCase();return(s?t.filter(l=>l.label.toLowerCase().includes(s)||l.value.toLowerCase().includes(s)):t).slice(0,n)}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:n}){const s=await fetch(ao(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...n}),signal:AbortSignal.timeout(wa)});if(!s.ok)throw new Error(`Failed to fetch options: ${s.status}`);return s.json()}async function br(t,e){const n=await fetch(io(t,e),{signal:AbortSignal.timeout(wa)});if(!n.ok)throw new Error(`Failed to fetch page: ${n.status}`);return n.text()}async function yc(t,e,n){const s=e.optionsFromPayload(await br(t,"/"),n),a=s.find(d=>d.kind==="category");if(!a)return s;const l=Ve(n.template,{[n.paramName]:a.value});if(l==="/")return s;try{const d=e.optionsFromPayload(await br(t,l),n).filter(o=>o.kind==="product");return xa([s,d])}catch{return s}}function wc(t,e,n){return Qn.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":n}`)}async function kc(t,e,n,s){if(e.homepageLinks)return yc(t,e,s);const a=e.buildRequests?.(n)??[];if(a.length===0)return[];const l=await Promise.allSettled(a.map(o=>bc(t,o))),d=l.filter(o=>o.status==="fulfilled").map(o=>o.value);if(d.length===0){const o=l.find(i=>i.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return xa(d.map(o=>e.optionsFromPayload(o,s)))}function Jn(t,e,n,s,a){return{queryKey:wc(t,e,n),queryFn:()=>kc(t,e,n,s),enabled:a,staleTime:6e4,retry:1}}function Bt(t){const e=le.c(16),{heading:n,iconKind:s,options:a,template:l,paramName:d,keyPrefix:o,onSelect:i}=t;if(a.length===0)return null;let c;if(e[0]!==s||e[1]!==o||e[2]!==i||e[3]!==a||e[4]!==d||e[5]!==l){let p;e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==d||e[11]!==l?(p=f=>r.jsxs(pt,{value:`${o}:${f.value}`,className:"gap-3 py-2",onSelect:()=>i(f.value),children:[s==="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(Mr,{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(l,{[d]:f.value})})]})]},`${o}:${f.value}`),e[7]=s,e[8]=o,e[9]=i,e[10]=d,e[11]=l,e[12]=p):p=e[12],c=a.map(p),e[0]=s,e[1]=o,e[2]=i,e[3]=a,e[4]=d,e[5]=l,e[6]=c}else c=e[6];let m;return e[13]!==n||e[14]!==c?(m=r.jsx(ft,{heading:n,children:c}),e[13]=n,e[14]=c,e[15]=m):m=e[15],m}function yr(t){const e=le.c(2),{text:n}=t;let s;return e[0]!==n?(s=r.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=s):s=e[1],s}function Sc(t){const e=le.c(52),{sources:n,template:s,paramName:a,value:l,sandboxRef:d,onCommit:o}=t,i=Ee(),[c,m]=E.useState(!1),[p,f]=E.useState(""),[y,x]=E.useState(""),b=E.useRef(null),h=a==="*"?i("sandbox.preview.catchAllParamLabel"):`:${a}`,g=xc(i),v=[...new Set(n.map(se=>g[se.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:s,paramName:a};let S;e[3]!==p?(S=(se,de)=>({source:se,query:de,options:se.clientFilter?Ft(de.data??[],p):de.data??[]}),e[3]=p,e[4]=S):S=e[4];const j=S,T=n.filter(Lc),B=n.filter(Rc),A=Wn({queries:T.map(se=>Jn(d,se,y,k,c))});let L;e[5]!==A||e[6]!==j?(L=(se,de)=>j(se,A[de]),e[5]=A,e[6]=j,e[7]=L):L=e[7];const D=T.map(L),O=D.length===0||D.every(Cc),F=Wn({queries:B.map(se=>Jn(d,se,y,k,c&&O))});let U;e[8]!==F||e[9]!==j?(U=(se,de)=>j(se,F[de]),e[8]=F,e[9]=j,e[10]=U):U=e[10];const G=B.map(U),W=O?G:D,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=se=>{m(se),b.current&&clearTimeout(b.current),f(se?l:""),x(se?l:"")};let V;e[11]===Symbol.for("react.memo_cache_sentinel")?(V=se=>{f(se),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{x(se)},300)},e[11]=V):V=e[11];const N=V,_=se=>{o(se),J(!1)},$=ra(p),z=Ve(s,{[a]:$}),X=Cr,ne=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(Mr,{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=qr,Se=!1,fe="min-h-0 flex-1";let ce;e[25]!==C||e[26]!==p?(ce=r.jsx(Gr,{autoFocus:!0,placeholder:C,value:p,onValueChange:N}),e[25]=C,e[26]=p,e[27]=ce):ce=e[27];const Re=Wr,Ie="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Ue;e[28]!==i?(Ue=i("sandbox.pathParamPickerChip.noResults"),e[28]=i,e[29]=Ue):Ue=e[29];let Be;e[30]!==Ue?(Be=r.jsx(Jr,{children:Ue}),e[30]=Ue,e[31]=Be):Be=e[31];const bt=$&&r.jsx(ft,{className:"shrink-0",children:r.jsxs(pt,{value:`__raw__:${$}`,className:"gap-3 py-2",onSelect:()=>_($),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(Vo,{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:$,paramLabel:h})}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:z})]})]})}),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:s,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:s,paramName:a,keyPrefix:`${Y?.source.id}:prod`,onSelect:_})})]}):r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:W.map(se=>{const{source:de,query:We,options:yt}=se,{noun:qe}=g[de.kind];if(We.isLoading)return r.jsx(yr,{text:i("sandbox.pathParamPickerChip.loading",{noun:qe})},de.id);if(We.isError)return r.jsx(yr,{text:i("sandbox.pathParamPickerChip.couldNotLoad")},de.id);if(de.homepageLinks){const zt=We.data??[];return r.jsxs(E.Fragment,{children:[r.jsx(Bt,{heading:g.category.heading,iconKind:"category",options:Ft(zt.filter(jc),p),template:s,paramName:a,keyPrefix:`${de.id}:cat`,onSelect:_}),r.jsx(Bt,{heading:g.product.heading,iconKind:"product",options:Ft(zt.filter(Pc),p),template:s,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:s,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 ze;e[41]!==ne||e[42]!==ie||e[43]!==ge||e[44]!==xe||e[45]!==Z?(ze=r.jsxs(ne,{className:I,onClick:Z,children:[ie,ge,xe]}),e[41]=ne,e[42]=ie,e[43]=ge,e[44]=xe,e[45]=Z,e[46]=ze):ze=e[46];let Le;return e[47]!==X||e[48]!==J||e[49]!==c||e[50]!==ze?(Le=r.jsx(X,{open:c,onOpenChange:J,children:ze}),e[47]=X,e[48]=J,e[49]=c,e[50]=ze,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:se=>{se.stopPropagation(),J(!0)},children:l||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:n,template:s,paramName:a,sandboxRef:l,onFill:d}=t;let o,i;if(e[0]!==a||e[1]!==l||e[2]!==n||e[3]!==s){const y={template:s,paramName:a},x=n.filter(_c);i=Wn,o=x.map(b=>Jn(l,b,"",y,!0)),e[0]=a,e[1]=l,e[2]=n,e[3]=s,e[4]=o,e[5]=i}else o=e[4],i=e[5];let c;e[6]!==o?(c={queries:o},e[6]=o,e[7]=c):c=e[7];const m=i(c),[p,f]=E.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:n,value:s,onCommit:a}=t,l=Ee(),[d,o]=E.useState(s),[i,c]=E.useState(!1),m=E.useRef(!1);let p;e[0]!==n||e[1]!==l?(p=n==="*"?l("sandbox.preview.catchAllParamLabel"):`:${n}`,e[0]=n,e[1]=l,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]!==l?(b=l("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=l,e[7]=b):b=e[7];let h,g;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=j=>o(j.target.value),g=()=>c(!0),e[8]=h,e[9]=g):(h=e[8],g=e[9]);let R;e[10]!==s?(R=j=>{j.key==="Enter"&&j.currentTarget.blur(),j.key==="Escape"&&(m.current=!0,o(s),j.currentTarget.blur())},e[10]=s,e[11]=R):R=e[11];let v;e[12]!==d||e[13]!==a||e[14]!==s?(v=()=>{if(c(!1),m.current){m.current=!1;return}const j=ra(d);o(j),j!==s&&a(j)},e[12]=d,e[13]=a,e[14]=s,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:Dc,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]!==l?(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(zi,{size:10}),l("sandbox.preview.enterToGo")]}),e[25]=i,e[26]=l,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 Dc(t){return t.stopPropagation()}function $c(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const n=new URL(e),s=t.resolvedPath==="/"?"":t.resolvedPath;return`${n.host}${s}`}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 Uc(t,e){if(t)return t;const n=await e?.().catch(()=>null);if(!n)throw new ka;return n}async function zc(t,e,n){return n?Xs(t,e,await Uc(n.meta,n.loadMeta)):Xs(t,e)}function Kc(t){const e=le.c(5);let n;e[0]!==t?(n=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=n):n=e[1];const s=Dr(n);let a;return e[2]!==t||e[3]!==s?(a={mutationFn:async l=>{const{name:d,path:o,template:i,schema:c}=l;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const m=Si(d),p=i?{...i,name:d,path:o}:await zc(d,o,c);return await s.mutateAsync({blockKey:m,data:p}),{key:m,name:d,path:o}}},e[2]=t,e[3]=s,e[4]=a):a=e[4],gi(a)}function Hc(t){const e=le.c(89),{open:n,onOpenChange:s,isPending:a,error:l,templates:d,onSubmit:o}=t,i=a===void 0?!1:a,c=Ee();let m;e[0]!==c?(m=c("sectionsEditor.createPageModal.defaultPageName"),e[0]=c,e[1]=m):m=e[1];const[p,f]=E.useState(m);let y;e[2]!==c?(y=c("sectionsEditor.createPageModal.defaultPagePath"),e[2]=c,e[3]=y):y=e[3];const[x,b]=E.useState(y),[h,g]=E.useState(_n),[R,v]=E.useState(null),[w,C]=E.useState(n);n!==w&&(C(n),n&&(f(c("sectionsEditor.createPageModal.defaultPageName")),b(c("sectionsEditor.createPageModal.defaultPagePath")),g(_n),v(null)));const k=!!d?.length;let S;e[4]!==i||e[5]!==s?(S=pe=>{!pe&&!i&&(v(null),s(!1))},e[4]=i,e[5]=s,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=aa(ge);if(ve){v(ve);return}v(null),await o({name:be,path:ge,templateKey:k&&h!==_n?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??l;let L;e[14]!==c?(L=c("sectionsEditor.createPageModal.title"),e[14]=c,e[15]=L):L=e[15];let D;e[16]!==L?(D=r.jsx(Rr,{children:r.jsx(Lr,{children:L})}),e[16]=L,e[17]=D):D=e[17];let O;e[18]!==c?(O=c("sectionsEditor.createPageModal.nameLabel"),e[18]=c,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 U;e[22]===Symbol.for("react.memo_cache_sentinel")?(U=pe=>f(pe.target.value),e[22]=U):U=e[22];let G;e[23]!==c?(G=c("sectionsEditor.createPageModal.namePlaceholder"),e[23]=c,e[24]=G):G=e[24];let W;e[25]!==i||e[26]!==p||e[27]!==G?(W=r.jsx(zn,{id:"new-page-name",value:p,onChange:U,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]!==c?(q=c("sectionsEditor.createPageModal.pathLabel"),e[32]=c,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]!==c?(ee=c("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=c,e[38]=ee):ee=e[38];let H;e[39]!==i||e[40]!==x||e[41]!==ee?(H=r.jsx(zn,{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]!==c||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:c("sectionsEditor.createPageModal.templateLabel")}),r.jsx(Pi,{id:"new-page-template",value:h,onChange:g,templates:d??[],disabled:i})]}),e[46]=i,e[47]=k,e[48]=c,e[49]=h,e[50]=d,e[51]=V):V=e[51];let N;e[52]!==A?(N=A&&r.jsx("p",{className:"text-xs text-destructive",children:A}),e[52]=A,e[53]=N):N=e[53];let _;e[54]!==Y||e[55]!==J||e[56]!==V||e[57]!==N?(_=r.jsxs("div",{className:"space-y-4 py-4",children:[Y,J,V,N]}),e[54]=Y,e[55]=J,e[56]=V,e[57]=N,e[58]=_):_=e[58];let $;e[59]!==s?($=()=>s(!1),e[59]=s,e[60]=$):$=e[60];let z;e[61]!==c?(z=c("sectionsEditor.createPageModal.cancelButton"),e[61]=c,e[62]=z):z=e[62];let X;e[63]!==i||e[64]!==$||e[65]!==z?(X=r.jsx(_e,{type:"button",variant:"outline",onClick:$,disabled:i,children:z}),e[63]=i,e[64]=$,e[65]=z,e[66]=X):X=e[66];let ne;e[67]!==i||e[68]!==p||e[69]!==x?(ne=!p.trim()||!x.trim()||i,e[67]=i,e[68]=p,e[69]=x,e[70]=ne):ne=e[70];let I;e[71]!==i||e[72]!==c?(I=i?r.jsxs(r.Fragment,{children:[r.jsx(tt,{className:"size-3.5"}),c("sectionsEditor.createPageModal.creatingButton")]}):c("sectionsEditor.createPageModal.createButton"),e[71]=i,e[72]=c,e[73]=I):I=e[73];let Z;e[74]!==ne||e[75]!==I?(Z=r.jsx(_e,{type:"submit",disabled:ne,children:I}),e[74]=ne,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]!==D?(ie=r.jsx(Tr,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:B,children:[D,_,re]})}),e[80]=B,e[81]=_,e[82]=re,e[83]=D,e[84]=ie):ie=e[84];let he;return e[85]!==j||e[86]!==n||e[87]!==ie?(he=r.jsx(Cr,{open:n,onOpenChange:j,children:ie}),e[85]=j,e[86]=n,e[87]=ie,e[88]=he):he=e[88],he}function Vc(t){const e=le.c(41),{orgSlug:n,virtualMcpId:s,branch:a,previewUrl:l,meta:d,decofile:o,blockKey:i}=t,c=Ee();let m;e[0]!==a||e[1]!==n||e[2]!==s?(m={orgSlug:n,virtualMcpId:s,branch:a},e[0]=a,e[1]=n,e[2]=s,e[3]=m):m=e[3];const p=Dr(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=ji(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=Ei(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]!==c?(j=c("sandbox.preview.loaderNoLongerExists"),e[13]=c,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]!==n||e[25]!==l||e[26]!==g||e[27]!==p.isPending||e[28]!==x||e[29]!==w||e[30]!==C||e[31]!==s?(k=r.jsx(Ni,{orgSlug:n,virtualMcpId:s,branch:a,previewUrl:l,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]=n,e[25]=l,e[26]=g,e[27]=p.isPending,e[28]=x,e[29]=w,e[30]=C,e[31]=s,e[32]=k):k=e[32];let S;return e[33]!==i||e[34]!==a||e[35]!==o||e[36]!==n||e[37]!==v||e[38]!==k||e[39]!==s?(S=r.jsx(Ti,{listing:o,orgSlug:n,virtualMcpId:s,branch:a,blockKey:i,present:void 0,children:k},v),e[33]=i,e[34]=a,e[35]=o,e[36]=n,e[37]=v,e[38]=k,e[39]=s,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 wr(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 n=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return n&&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"}:n?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=E.lazy(()=>xi(()=>import("./sections-editor-oQAkX7iV.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])).then(t=>({default:t.SectionsEditor})));function kr(t){const e=le.c(62),{virtualMcpId:n,externalSelection:s,onSectionPicked:a,onViewJsonFile:l}=t,d=s===void 0?null:s,{org:o}=pn(),{currentBranch:i,taskId:c}=nt(),m=ts(),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]!==c||e[4]!==n?(b=i?{orgSlug:o.slug,virtualMcpId:n,branch:i,threadId:c??null,previewUrl:x}:null,e[0]=i,e[1]=o,e[2]=x,e[3]=c,e[4]=n,e[5]=b):b=e[5];const h=b,g=Ut(n,i);let R;e[6]!==y?(R={fetchEnabled:y},e[6]=y,e[7]=R):R=e[7];const v=mn(h,R),w=Qr(h);let C;e[8]!==y?(C={fetchEnabled:y},e[8]=y,e[9]=C):C=e[9];const k=ia(h,C),S=Jc({lifecyclePhase:m.lifecycle.phase,decofile:wr(v),meta:wr(k),hasEditableContent:No(v.data,k.data),fastPreviewActive:Yr(n).runtime==="cms"||Xe(g)}),j=Xn()===void 0,T=Qc;if(To(g)){let N;return e[10]===Symbol.for("react.memo_cache_sentinel")?(N=T(r.jsx(Ro,{})),e[10]=N):N=e[10],N}if(g.kind==="pending"&&g.retrying){let N;return e[11]!==g?(N=T(r.jsx(Lo,{backend:g})),e[11]=g,e[12]=N):N=e[12],N}if(S.kind==="loading"||j){let N;return e[13]===Symbol.for("react.memo_cache_sentinel")?(N=T(r.jsx(bi,{})),e[13]=N):N=e[13],N}if(v.data&&oo(k.data)){const N=f.state.target,_=N?.kind==="page"||N?.kind==="section"?N.key:null,$=g.kind==="legacy"?_??"":`${w}:${_??""}`,z=i??"";let X;return e[14]!==v.data||e[15]!==_||e[16]!==o.slug||e[17]!==$||e[18]!==z||e[19]!==n?(X=T(r.jsx(Ci,{orgSlug:o.slug,virtualMcpId:n,branch:z,decofile:v.data,initialKey:_,compact:!0},$)),e[14]=v.data,e[15]=_,e[16]=o.slug,e[17]=$,e[18]=z,e[19]=n,e[20]=X):X=e[20],X}if(S.kind==="empty"){let N;return e[21]===Symbol.for("react.memo_cache_sentinel")?(N=T(r.jsx(Ao,{})),e[21]=N):N=e[21],N}if(S.kind==="error"){let N;e[22]!==v||e[23]!==p||e[24]!==k||e[25]!==S.source?(N=()=>{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]=N):N=e[26];const _=N;let $;return e[27]!==_||e[28]!==S.source?($=T(r.jsx(Co,{source:S.source,onRetry:_})),e[27]=_,e[28]=S.source,e[29]=$):$=e[29],$}let B;e[30]===Symbol.for("react.memo_cache_sentinel")?(B=N=>T(r.jsx("div",{className:"h-full min-h-0",children:N})),e[30]=B):B=e[30];const A=B,L=f.state.target;if(L?.kind==="loader"&&v.data&&k.data){const N=g.kind==="legacy"?void 0:w,_=i??"",$=x??null;let z;return e[31]!==v.data||e[32]!==k.data||e[33]!==o.slug||e[34]!==N||e[35]!==_||e[36]!==$||e[37]!==L.key||e[38]!==n?(z=A(r.jsx(Vc,{orgSlug:o.slug,virtualMcpId:n,branch:_,previewUrl:$,meta:k.data,decofile:v.data,blockKey:L.key},N)),e[31]=v.data,e[32]=k.data,e[33]=o.slug,e[34]=N,e[35]=_,e[36]=$,e[37]=L.key,e[38]=n,e[39]=z):z=e[39],z}let D;e[40]!==i||e[41]!==o.slug||e[42]!==L||e[43]!==n?(D=L||!i?null:Fr(Br(o.slug,n,i)),e[40]=i,e[41]=o.slug,e[42]=L,e[43]=n,e[44]=D):D=e[44];const O=D;let F="/",U=null,G=null;L?.kind==="page"?(F=L.path,U=L.key):L?.kind==="section"?G=L.key:O&&(F=O.path,U=O.pageKey);const W=U?`page:${U}`: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=!!U&&f.state.editSeoPageKey===U;let V;return e[46]!==G||e[47]!==U||e[48]!==F||e[49]!==l||e[50]!==o.slug||e[51]!==K||e[52]!==ee||e[53]!==H||e[54]!==J||e[55]!==q||e[56]!==Q||e[57]!==n||e[58]!==f.consumeEditSeo||e[59]!==f.setFocusedBlock||e[60]!==f.setVariantOverride?(V=A(r.jsx(E.Suspense,{fallback:Y,children:r.jsx(Yc,{orgSlug:o.slug,virtualMcpId:n,branch:Q,previewReady:!0,previewUrl:K,currentPath:F,activePageBlockKey:U,activeGlobalBlockKey:G,externalSelection:ee,onSectionPicked:H,initialEditSeo:J,onExitSeo:f.consumeEditSeo,onVariantPreviewOverride:f.setVariantOverride,onFocusedBlockChange:f.setFocusedBlock,onViewJsonFile:l},q)})),e[46]=G,e[47]=U,e[48]=F,e[49]=l,e[50]=o.slug,e[51]=K,e[52]=ee,e[53]=H,e[54]=J,e[55]=q,e[56]=Q,e[57]=n,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:n,pageKey:s,onClose:a,ref:l}=t,d=Ee(),o=Xn(),i=o===!0,c=Zn(n);let m;e[0]!==c||e[1]!==s?(m=Xr(c,fa(s)),e[0]=c,e[1]=s,e[2]=m):m=e[2];const p=m,{org:f}=pn(),{currentBranch:y,taskId:x}=nt(),h=xt().previewUrl;let g;e[3]!==y||e[4]!==f.slug||e[5]!==h||e[6]!==x||e[7]!==n?(g=y?{orgSlug:f.slug,virtualMcpId:n,branch:y,threadId:x??null,previewUrl:h}:null,e[3]=y,e[4]=f.slug,e[5]=h,e[6]=x,e[7]=n,e[8]=g):g=e[8];const v=mn(g),w=y??"";let C;e[9]!==f.slug||e[10]!==w||e[11]!==n?(C={orgSlug:f.slug,virtualMcpId:n,branch:w},e[9]=f.slug,e[10]=w,e[11]=n,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}=$r(C,k),B=y??"";let A;e[14]!==f.slug||e[15]!==B||e[16]!==n?(A=da({orgSlug:f.slug,virtualMcpId:n,branch:B}),e[14]=f.slug,e[15]=B,e[16]=n,e[17]=A):A=e[17];const L=ua(A);let D;e[18]!==s||e[19]!==L?(D=L(s),e[18]=s,e[19]=L,e[20]=D):D=e[20];const O=D;let F;e[21]!==O||e[22]!==s?(F={pageKey:s,copyEpoch:O},e[21]=O,e[22]=s,e[23]=F):F=e[23];const[U,G]=E.useState(F);(U.pageKey!==s||U.copyEpoch!==O)&&(G({pageKey:s,copyEpoch:O}),T(s));const W=v.data?.[s],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]!==s||e[27]!==Q||e[28]!==S?(H=z=>{if(Q)return;let X;try{X=JSON.parse(z)}catch{return}X===null||typeof X!="object"||Array.isArray(X)||S(s,X)},e[26]=s,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],E.useImperativeHandle(l,V);let N;e[32]!==p||e[33]!==i||e[34]!==a||e[35]!==d?(N=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]=N):N=e[36];let _;e[37]!==O||e[38]!==v.data||e[39]!==j||e[40]!==ee||e[41]!==Y||e[42]!==q||e[43]!==s||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:z=>J(z??""),onSave:z=>{J(z),j()}},`${s}:${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]=s,e[44]=Q,e[45]=J,e[46]=d,e[47]=_):_=e[47];let $;return e[48]!==N||e[49]!==_?($=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[N,_]}),e[48]=N,e[49]=_,e[50]=$):$=e[50],$}function Sr(t){const e=le.c(3),{currentBranch:n}=nt(),s=Ut(t.virtualMcpId,n);let a;return e[0]!==s.kind||e[1]!==t?(a=s.kind==="legacy"?r.jsx(Xc,{...t}):r.jsx(Zc,{...t}),e[0]=s.kind,e[1]=t,e[2]=a):a=e[2],a}function Zc(t){const e=le.c(61),{virtualMcpId:n,pageKey:s,onClose:a,ref:l}=t,d=Ee(),o=Xn(),i=o===!0,c=Zn(n);let m;e[0]!==c||e[1]!==s?(m=Xr(c,fa(s)),e[0]=c,e[1]=s,e[2]=m):m=e[2];const p=m,{org:f}=pn(),{currentBranch:y,taskId:x}=nt(),h=xt().previewUrl;let g;e[3]!==y||e[4]!==f.slug||e[5]!==h||e[6]!==x||e[7]!==n?(g=y?{orgSlug:f.slug,virtualMcpId:n,branch:y,threadId:x??null,previewUrl:h}:null,e[3]=y,e[4]=f.slug,e[5]=h,e[6]=x,e[7]=n,e[8]=g):g=e[8];const R=g,v=mn(R);let w;e[9]!==s?(w=[s],e[9]=s,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=Zr(R,w,C),S=y??"";let j;e[13]!==f.slug||e[14]!==S||e[15]!==n?(j={orgSlug:f.slug,virtualMcpId:n,branch:S},e[13]=f.slug,e[14]=S,e[15]=n,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}=$r(j,T),D=y??"";let O;e[18]!==f.slug||e[19]!==D||e[20]!==n?(O=da({orgSlug:f.slug,virtualMcpId:n,branch:D}),e[18]=f.slug,e[19]=D,e[20]=n,e[21]=O):O=e[21];const F=ua(O);let U;e[22]!==s||e[23]!==F?(U=F(s),e[22]=s,e[23]=F,e[24]=U):U=e[24];const G=U,W=v.data?.[s];let Y;e[25]!==k.ready||e[26]!==v.data||e[27]!==W?(Y=k.ready&&v.data!==void 0&&(W===void 0||Qs(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]!==s?(Q={pageKey:s,copyEpoch:G,opened:!1,code:""},e[29]=G,e[30]=s,e[31]=Q):Q=e[31];const[K,ee]=E.useState(Q);if(q&&(K.pageKey!==s||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:s,copyEpoch:G,opened:!0,code:Z}),Qs(W)&&L(s)}const H=K.pageKey===s&&K.opened,J=o===void 0||!H&&!q,V=q&&W===void 0,N=!y||V||J;let _;e[34]!==s||e[35]!==N||e[36]!==B?(_=Z=>{if(N)return;ee(ie=>({...ie,code:Z}));let re;try{re=JSON.parse(Z)}catch{return}re===null||typeof re!="object"||Array.isArray(re)||B(s,re)},e[34]=s,e[35]=N,e[36]=B,e[37]=_):_=e[37];const $=_;let z;e[38]!==A?(z=()=>({flush:A}),e[38]=A,e[39]=z):z=e[39],E.useImperativeHandle(l,z);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 ne;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]!==N||e[54]!==$||e[55]!==H||e[56]!==d?(ne=!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:N,height:"100%",onChange:Z=>$(Z??""),onSave:Z=>{$(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]=N,e[54]=$,e[55]=H,e[56]=d,e[57]=ne):ne=e[57];let I;return e[58]!==X||e[59]!==ne?(I=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[X,ne]}),e[58]=X,e[59]=ne,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 nd(t){return Sa({contentEditingEnabled:oa(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function sd(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function rd(t){const e=lo(t),{display:n}=t;let s=null;if(n.mode==="production"&&n.iframeBase)try{s=new URL(t.path,n.iframeBase).href}catch{s=null}const a=co(s,e);return{value:e,frame:a?qn(a,t.device):null,newTab:a}}function ad(t){const e=le.c(94),{tests:n,load:s,onOpen:a,options:l,onChange:d,available:o}=t,i=Ee();let c;e[0]!==l?(c=ea(l),e[0]=l,e[1]=c):c=e[1];const m=c;let p;e[2]!==l.tests?(p=l.tests??{},e[2]=l.tests,e[3]=p):p=e[3];const f=p;let y;e[4]!==d||e[5]!==l?(y=I=>{const Z=I?qo(I):null,{at:re,...ie}=l;d(Z?{...ie,at:Z}:ie)},e[4]=d,e[5]=l,e[6]=y):y=e[6];const x=y;let b;e[7]!==f||e[8]!==d||e[9]!==l?(b=(I,Z)=>{const re={...f};Z==="on"?re[I]=!0:Z==="off"?re[I]=!1:delete re[I];const{tests:ie,...he}=l;d(Object.keys(re).length>0?{...he,tests:re}:he)},e[7]=f,e[8]=d,e[9]=l,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(Ki,{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(Kr,{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 D;e[38]!==i?(D=i("sandbox.previewAs.momentLabel"),e[38]=i,e[39]=D):D=e[39];let O;e[40]!==D?(O=r.jsx(Xo,{htmlFor:"preview-as-moment",children:D}),e[40]=D,e[41]=O):O=e[41];let F;e[42]!==l.at?(F=Wo(l.at),e[42]=l.at,e[43]=F):F=e[43];let U;e[44]!==x?(U=I=>x(I.target.value),e[44]=x,e[45]=U):U=e[45];let G;e[46]!==F||e[47]!==U?(G=r.jsx(zn,{id:"preview-as-moment",type:"datetime-local",className:Go,value:F,onChange:U}),e[46]=F,e[47]=U,e[48]=G):G=e[48];const W=l.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 N;e[70]!==V?(N=r.jsx("span",{className:"text-sm font-medium",children:V}),e[70]=V,e[71]=N):N=e[71];let _;e[72]!==f||e[73]!==s||e[74]!==h||e[75]!==i||e[76]!==n?(_=s&&!s.ready?s.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:s.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"})}):n.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:n.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(Zo,{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(ur,{value:"off",children:i("sandbox.previewAs.off")}),r.jsx(ur,{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]=s,e[74]=h,e[75]=i,e[76]=n,e[77]=_):_=e[77];let $;e[78]!==N||e[79]!==_?($=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[N,_]}),e[78]=N,e[79]=_,e[80]=$):$=e[80];let z;e[81]!==m||e[82]!==d||e[83]!==i?(z=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]=z):z=e[84];let X;e[85]!==L||e[86]!==J||e[87]!==$||e[88]!==z?(X=r.jsxs(Hr,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[L,J,$,z]}),e[85]=L,e[86]=J,e[87]=$,e[88]=z,e[89]=X):X=e[89];let ne;return e[90]!==S||e[91]!==X||e[92]!==g?(ne=r.jsxs(Vr,{onOpenChange:g,children:[S,X]}),e[90]=S,e[91]=X,e[92]=g,e[93]=ne):ne=e[93],ne}const id=15e3;function od(t,e,n){return n?t.src===e||t.loading?t:{src:e,loading:!0}:t.src===e&&!t.loading?t:{src:e,loading:!1}}function Pr(t){return t.loading?{...t,loading:!1}:t}function ld(t,e){try{const n=new URL(t),s=new URL(e);return n.origin===s.origin&&n.pathname===s.pathname}catch{return!1}}function cd(t,{base:e,frameSrc:n,loadedSrc:s,wanted:a,canSwap:l}){const d=t?.base===e?t:null,o=d?.src??n,i=d?.shown??n;return!a||!o||!i?null:i===a?d:l&&s===o&&ld(i,a)?{base:e,src:o,shown:a}:null}const dd=["next"],ud=["@tanstack/react-router","@tanstack/react-start","@tanstack/solid-router","@tanstack/solid-start"],Pa=new Set(["tsx","ts","jsx","js","mdx"]),fd=new Set(["tsx","jsx"]),pd=new Set(["404","500"]);function md(t){const e=new Set;if(!t||typeof t!="object")return e;const n=t;for(const s of["dependencies","devDependencies"]){const a=n[s];if(a&&typeof a=="object"&&!Array.isArray(a))for(const l of Object.keys(a))e.add(l)}return e}function hd(t){const e=md(t);return dd.some(n=>e.has(n))?"next":ud.some(n=>e.has(n))?"tanstack":null}function ja(t,e){const n=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${e}`:e}function gd(t,e){const n=s=>ja(e,s);switch(t){case"next":return[{router:"next-pages",dir:n("pages"),pattern:"**/*"},{router:"next-pages",dir:n("src/pages"),pattern:"**/*"},{router:"next-app",dir:n("app"),pattern:"**/page.*"},{router:"next-app",dir:n("src/app"),pattern:"**/page.*"}];case"tanstack":return[{router:"tanstack",dir:n("src/routes"),pattern:"**/*"}];default:{const s=t;throw new Error(`Unknown framework: ${String(s)}`)}}}function ss(t){const e=t.lastIndexOf(".");return e<=0?null:[t.slice(0,e),t.slice(e+1)]}function vd(t){const e=ss(t.at(-1)??"");if(!e||!Pa.has(e[1]))return null;const[n]=e;if(n.includes("."))return null;const s=[...t.slice(0,-1),n];return s[0]==="api"||s.length===1&&pd.has(n)||s.some(a=>a.startsWith("_")||a.includes("["))?null:(s.at(-1)==="index"&&s.pop(),`/${s.join("/")}`)}function xd(t){const e=ss(t.at(-1)??"");if(!e||e[0]!=="page"||!Pa.has(e[1]))return null;const n=[];for(const s of t.slice(0,-1)){if(s.startsWith("_")||s.startsWith("@")||/^\(\.{1,3}\)/.test(s)||s.includes("["))return null;s.startsWith("(")&&s.endsWith(")")||n.push(s)}return`/${n.join("/")}`}function bd(t){const e=[];let n="",s=!1;for(const a of t)a==="["?s=!0:a==="]"&&(s=!1),a==="."&&!s?(e.push(n),n=""):n+=a;return e.push(n),e}function yd(t){const e=ss(t.at(-1)??"");if(!e||!fd.has(e[1]))return null;const n=[...t.slice(0,-1),...bd(e[0])].filter(Boolean);n.at(-1)==="lazy"&&n.pop();const s=n.at(-1);if(!s||s==="__root"||n.some(l=>l.startsWith("-"))||s.startsWith("_"))return null;(s==="index"||s==="route")&&n.pop();const a=[];for(const l of n){if(l.includes("$"))return null;if(l.startsWith("_")||l.startsWith("(")&&l.endsWith(")"))continue;const d=l.replace(/_$/,"").replace(/[[\]]/g,"");d&&a.push(d)}return`/${a.join("/")}`}function wd(t,e){const n=e.split("/").filter(Boolean);if(n.length===0)return null;switch(t){case"next-pages":return vd(n);case"next-app":return xd(n);case"tanstack":return yd(n);default:{const s=t;throw new Error(`Unknown router: ${String(s)}`)}}}function kd(t){const e=new Set;for(const{root:n,files:s}of t){const a=`${n.dir}/`;for(const l of s){if(!l.startsWith(a))continue;const d=wd(n.router,l.slice(a.length));d&&e.add(d)}}return[...e].sort((n,s)=>n==="/"?-1:s==="/"?1:n.localeCompare(s))}const Sd=5e3,Pd=6e4;async function jd(t,e){const n=await fetch(el(t,"glob"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pattern:e.pattern,path:e.dir,limit:Sd})});if(!n.ok)throw new Error(`Failed to list ${e.dir}: ${n.status}`);const s=await n.json();return Array.isArray(s.files)?s.files.filter(a=>typeof a=="string"):[]}async function Ed(t,e){const n=await uo(t,ja(e,"package.json"));if(n.kind==="unavailable")throw new Error("package.json unavailable: sandbox not ready");const s=n.kind==="data"?hd(n.data):null;if(!s)return[];const a=gd(s,e),l=await Promise.all(a.map(async d=>({root:d,files:await jd(t,d)})));return kd(l)}function Nd(t,e,n){const s=le.c(12);let a;s[0]!==e||s[1]!==t?(a=t?Qn.frameworkRoutes(t.orgSlug,t.virtualMcpId,t.branch,t.threadId,e):["framework-routes","none"],s[0]=e,s[1]=t,s[2]=a):a=s[2];let l;s[3]!==e||s[4]!==t?(l=()=>t?Ed(t,e):[],s[3]=e,s[4]=t,s[5]=l):l=s[5];const d=n&&!!t;let o;s[6]!==a||s[7]!==l||s[8]!==d?(o={queryKey:a,queryFn:l,enabled:d,staleTime:Pd},s[6]=a,s[7]=l,s[8]=d,s[9]=o):o=s[9];const i=_r(o);let c;return s[10]!==i.data?(c=i.data??[],s[10]=i.data,s[11]=c):c=s[11],c}const Td=500,Cd={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},jr=1,cn=["desktop","mobile","tablet"],Rd=["preview","visual","blocks"],Er={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function Ld(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 Un(t,e){try{return new URL(t,e).href}catch{return null}}function Ad(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 n={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:n,effective:n.url}}return{pin:t,effective:t?.url??null}}function _d(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function Od(t,e,n){const s=t.toLowerCase(),a=e.toLowerCase(),l=a.split("/").filter(Boolean),d=i=>{if(i===n)return 100;const c=i.indexOf(n);if(c===-1)return 0;let m=40;return c===0?m+=30:/[\s/-]/.test(i[c-1]??"")&&(m+=20),m+=Math.round(n.length/i.length*20),m};let o=Math.max(d(s),d(a));return l.at(-1)===n?o=Math.max(o,95):l.includes(n)&&(o=Math.max(o,90)),o}function Dd(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function $d({virtualMcpId:t}){const e=Ee(),n=sa(),{currentBranch:s,taskId:a,virtualMcpId:l}=nt(),d=!!$i(),o=la(),i=Yi(l===t?t:null),c=Yr(t),m=tl(i?.metadata?.ui?.layout??null),p=oa(m),f=Sa({contentEditingEnabled:p,isMobile:n}),[y]=E.useState(()=>nd({cmsMode:m,isMobile:n})),[x,b]=Kn(Hn.previewEditingMode(t),u=>u&&Rd.includes(u)?u:null),h=x??y,[g,R]=Kn(Hn.previewDeviceSize(t),u=>u&&cn.includes(u)?u:"desktop"),[v,w]=E.useState(null),[C,k]=E.useState(null),S=E.useRef(null),j=E.useRef(null),[T,B]=E.useState(!1),A=E.useRef(null),L=()=>{A.current?.flush(),B(!1)},D=()=>B(u=>(u&&A.current?.flush(),!u)),[O,F]=E.useState({width:0,height:0}),[U,G]=E.useState(!1),[W,Y]=E.useState({}),[q,Q]=E.useState(""),K=E.useRef(null),[ee,H]=E.useState(!1),[J,V]=E.useState(),[N,_]=E.useState(null),[$,z]=E.useState(null),[X,ne]=E.useState(null),[I,Z]=E.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[re,ie]=E.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[he,pe]=E.useState({}),[be,ge]=E.useState(!1),ve=E.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}=pn(),Re=ts(),Ie=xt(),Ue=Ie.vmEntry,Be=Re.lifecycle.phase,{url:bt}=ta(t),me=Ut(t,s),{connection:Oe}=na(t),xe=Jo(t),ze=fo({hasServeConnection:!!Oe,runtime:c.runtime}),Le=!Xe(me)&&me.kind!=="pending",se=He(me)??bt,de=se??Ie.previewUrl,We=!!se||Be==="running",yt=i?.id===t?eo(i.metadata):null,qe=!se&&i?.id===t&&c.runtime==="cms",zt=c.projectDefault==="cms",wt=Le?po({sandboxUrl:de,previewServerUrl:yt,fastPreviewActive:qe}):null,rs=t&&s?{orgSlug:ce.slug,virtualMcpId:t,branch:s,threadId:a??null,previewUrl:de}:null,as=mn(rs,{fetchEnabled:We}),hn=ia(rs,{fetchEnabled:We}),ue=as.data,Pe=hn.data,Ge=ue?_o(ue,Pe).sort((u,P)=>u.name.localeCompare(P.name)):[],Kt=t&&s?{orgSlug:ce.slug,virtualMcpId:t,branch:s}:null,is=Kc(Kt),Ea=mo(Kt),gn=ue&&Pe?Oo(ue,Pe):[],os=Le&&ue&&Pe?Ri(Pe,ue,"loaders"):[],ls=q?(()=>{const u=q.toLowerCase();return Ge.map(P=>({page:P,score:Od(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,cs=gn.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)}),ds=f?os:[],us=ds.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=$?os.find(u=>u.key===$)??null:null,Ne=es,vn=N||$?null:Do(Ge,I,re),oe=vn?.key??null,st=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??oe,Vt=vn?.path??null,rt=(oe?he[oe]:void 0)??{},Ce=Ve(I,rt),xn={};if(Le&&We&&de&&Pe&&ue){const u=Li(Pe,"loaders"),P=oe?ue[oe]:void 0,M=lc(P,ue,we=>u.has(we)),ae=sc(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&&(xn[we.name]=ct)}}const kt=t&&s?{orgSlug:ce.slug,virtualMcpId:t,branch:s,threadId:a??null}:null,fs=ue&&oe?zo(ue,oe,0):[],ps=Xe(me),ms=ue?Ai(fs,ue,ps):[],St=ms.map(u=>u.isSavedBlock?u.label:""),Pt=ms.map(u=>u.isSavedBlock?"global":u.isMultivariate?"variant":"normal"),jt=fs.map(u=>Gn(u,ue??{},ps)),at=E.useRef(null),De=E.useRef(null),Na=Re.status.state==="paused",bn=Re.phase,hs=_i({claimPhase:bn,lifecycle:Re.lifecycle}),Je=Ie.previewState,Ta=Ie.userStopped,Ca=ho(ce.slug,t??""),{url:Ke}=Uo(qe&&t&&s?{orgSlug:ce.slug,virtualMcpId:t,branch:s,previewServerUrl:yt??null,path:Ce}:null),Ra=zt&&c.runtime==="sandbox",Ae=go(me,ze,xe),gs=vo(Ae&&qe&&me.kind==="protocol"&&t&&s?{orgSlug:ce.slug,virtualMcpId:t,branch:s}:null),vs=Ae?gs.pointer:null,te=Rl({previewState:Je,progressStatus:hs.status,previewServerUrl:yt,fastPreviewActive:qe,fastPreviewReady:!!Ke,codingSession:Ra,localPreviewUrl:se,hostedDraft:Ae,hostedPointerPending:Ae&&(me.kind==="pending"||gs.pending)}),xs=te.showWakingPill||Ae&&te.mode==="production"&&!vs,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?se?te.mode==="sandbox"&&f&&h==="blocks":te.mode==="production"&&qe&&Aa&&f&&h==="blocks":!1,bs=E.useRef(null),{pin:_a,effective:Oa}=Ad(bs.current,{inPlaceRenderActive:Nt,draftPreviewUrl:Ke,resolvedPath:Ce});bs.current=_a;const ys=o.state.variantOverride??[],Wt=Le?ys:[],Tt=Le?[]:ys,qt=Xe(me)&&$o.some(u=>Fo(Pe,u)==="available"),ot=qt?W:{},ws=ea(ot),Da=qt&&ue?Object.keys(Bo(ue).experiments):[],[ks,$a]=E.useState(!1),Ss=Zr(Kt,qt&&ks?Mo:[]),Fa={...Ss,ready:!(me.kind==="protocol"&&me.hosted)||ks&&Ss.ready},Ye=t?er(ce.slug,t):null,Ba=xo(Ye),Gt=Ae?rd({display:te,path:Ce,pointer:vs,heldRevision:Ba,device:g,forcedVariants:Tt,previewOptions:ot}):null,Ps=JSON.stringify([Tt,ot]);E.useEffect(()=>{if(!Ae||!Ye)return;const[u,P]=JSON.parse(Ps);tr(Ye,{forcedVariants:u,previewOptions:P})},[Ae,Ye,Ps]),E.useEffect(()=>{if(!(!Ae||!Ye))return()=>tr(Ye,null)},[Ae,Ye]);const yn=Oe&&He(me)?bo(Oe.endpoint,Tt,ws):null,Ma=Oe&&He(me)?yn?yo(yn,ot):nr:null,Qe=Ld(te.mode==="sandbox"?sn(qn(sr(X??Un(Ce,te.iframeBase)??te.iframeBase,Ma),g),Wt):te.mode==="production"&&Gt?.frame?Gt.frame:te.mode==="production"?sn(qn(rr(ar(sr(X??Oa??Un(Ce,te.iframeBase)??te.iframeBase,xs?nr:null),Tt),ot),g),Wt):null),js=Ke??(te.iframeBase?Un(Ce,te.iframeBase):null),Es=te.mode==="production"&&Gt?Gt.newTab:te.mode==="production"?js?sn(rr(ar(js,Tt),ot),Wt):null:Qe??te.iframeBase,Ia=()=>{const u=Es;u&&window.open(u,"_blank","noopener")},Ct=t&&s?Br(ce.slug,t,s):null,Rt=u=>{Ct&&Bi(Ct,u)},ke=o.state.target;E.useEffect(()=>{if(!(!ke||!wt||!Pe))if(ke.kind==="page"){const u=he[ke.key]??{};De.current=Ve(ke.path,u),_(null),z(null),ne(null),ie(ke.key),Z(ke.path),Rt({path:ke.path,pageKey:ke.key,params:u})}else if(ke.kind==="loader")De.current=null,_(null),z(ke.key),ne(null);else{const u=gn.find(P=>P.key===ke.key);if(u){De.current=null;const P=or(Pe);z(null),_(u),ne(ir(wt,P,u.key))}}},[ke,wt,Pe,he]),E.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[Ns,Ua]=E.useState(null);if(Je.kind==="iframe"&&Ns!==Je.previewUrl){const u=Ns!==null;Ua(Je.previewUrl);const P=Ct?Fr(Ct):null;if(P){if(De.current=Ve(P.path,P.params),Z(P.path),ie(P.pageKey),ne(null),_(null),z(null),P.pageKey&&Object.keys(P.params).length>0){const M=P.pageKey;pe(ae=>({...ae,[M]:P.params}))}}else u&&(De.current=null,Z("/"),ne(null),ie(null),_(null),z(null))}at.current=Qe;const za=te.mode==="production"&&!!Ke&&!se,[Jt,wn]=E.useState({src:Qe??void 0,loading:!1}),[Ka,kn]=E.useState(!1),[Ha,Va]=E.useState(),[Ts,Cs]=E.useState(null),je=cd(Ts,{base:te.iframeBase??"",frameSrc:Jt.src,loadedSrc:Ha,wanted:Qe??void 0,canSwap:xe&&Ka&&!Jt.loading});je!==Ts&&Cs(je);const Yt=od(Jt,je?je.src:Qe??void 0,za);Yt!==Jt&&wn(Yt);const lt=Yt.src,Rs=Yt.loading,Ls=Ol({iframeRef:S,src:te.mode==="sandbox"?Qe:null,active:te.mode==="sandbox"}),As=E.useRef(null);E.useEffect(()=>{const u=Rs?setTimeout(()=>wn(Pr),id):null,P=()=>{u&&clearTimeout(u)};if(!Ke||!lt||As.current===Ke)return P;As.current=Ke;const M=S.current;return M&&M.getAttribute("src")!==lt&&(Se(),M.src=lt),P},[Ke,lt,Rs]);const _s=()=>{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=Po({previewBaseUrl:P,pageBlock:M,decofile:ue,path:Ce,pathTemplate:I});if(!ae)return;const we=sn(ae.src,Eo(Wt,oe));u.postMessage({type:"cms-editor::render",src:we,body:ae.body},P)},Sn=E.useRef(null);E.useEffect(()=>{if(!Nt||N||$||!oe||!ue){Sn.current=null;return}const u={nav:JSON.stringify({page:oe,path:Ce,pathTemplate:I}),content:JSON.stringify(ue)},P=_d(Sn.current,u);Sn.current=u,P&&_s()},[ue,Nt,N,$,oe,Ce,I]);const Pn=E.useRef(null);E.useEffect(()=>{if(!Nt||N||$||!oe||!ue){Pn.current=null;return}const u=JSON.stringify(o.state.variantOverride??null),P=Pn.current;Pn.current={page:oe,sig:u},!(!P||P.page!==oe||P.sig===u)&&_s()},[o.state.variantOverride,Nt,N,$,oe]);const Os=!!t&&!!s&&!Re.notFound&&!Ta&&!Na&&(bn?.kind==="ready"||Be!=="idle"),Ds=!Xe(me),Wa=Zn(t??void 0),qa=Nd(kt,Wa,Ds&&Os),Ga=new Set(Ge.map(u=>Ne(u.path))),Qt=Ds?qa.filter(u=>!Ga.has(Ne(u))):[],$s=q?Qt.filter(u=>u.toLowerCase().includes(q.toLowerCase())):Qt,ye=sd({editingMode:h,sandboxDisplay:te.mode==="sandbox",blocksEditingEnabled:f});E.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=Ul.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 Fs=()=>{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)},Bs=()=>{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"}))},jn=()=>{if(xe){Bs();return}const u=S.current?.contentWindow,P=it,M=Mc({v8:xe,production:te.mode==="production",localPreview:!!se,script:zl});!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)},Ms=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;!n&&u!==P&&(u==="blocks"?j.current?.resize("30%"):j.current?.collapse()),b(u),w(null),k(null),u!=="blocks"&&z(null),P==="visual"&&Ja(),u==="visual"&&Fs(),P==="blocks"&&u!=="blocks"&&Ya(),u==="blocks"&&jn()},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(),Dd(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)};Ho(Zt);const Me=E.useRef(null),Is=E.useEffectEvent(Bs),ei=E.useEffectEvent((u,P)=>{k({index:u,seq:P})}),ti=E.useEffectEvent(()=>{fe(),je&&(En.current=je.shown),At&&Dn(Lt)}),Us=E.useEffectEvent(()=>{if(kn(!1),je&&Cs(null),je&&je.src!==at.current){Se();return}Zt()});E.useEffect(()=>{if(!xe)return;const u=new ql({studioOrigin:window.location.origin,build:"4.574.9",frame:()=>S.current?.contentWindow??null,onWireframeReady:()=>Is(),onWireframe:M=>{M.type==="wireframe:select"&&ei(M.sectionIndex,M.clickSeq)},onModulesChange:()=>kn(u.has("html-swap")),onSwapEnd:()=>ti(),onSwapFailed:()=>Us()});Me.current=u;const P=M=>{u.handle(M)};return window.addEventListener("message",P),()=>{window.removeEventListener("message",P),u.dispose(),kn(!1),Me.current===u&&(Me.current=null)}},[xe,te.iframeBase]);const zs=xe?JSON.stringify([St,Pt,jt,ye]):"";E.useEffect(()=>{zs&&Is()},[zs]);const Ks=E.useRef(null);E.useEffect(()=>{const u=Ks.current;if(Ks.current=je,je&&je!==u){Me.current?.refresh(je.shown)?Se():Us();return}!je&&u&&u.shown!==u.src&&u.src===at.current&&Zt()},[je]);const Hs=()=>{Me.current?.refresh()||Zt()},Lt=er(ce.slug,t??""),At=Ae&&Et&&!!t,En=E.useRef(null);E.useEffect(()=>{if(At)return wo(Lt)},[At,Lt]);const{reload:_t}=ko(ce.slug,t??""),Vs=E.useRef(_t.seq);E.useEffect(()=>{if(Vs.current!==_t.seq&&(Vs.current=_t.seq,!!At&&En.current===at.current)){if(_t.navigates){Dn(Lt);return}Hs()}},[_t.seq]);const Nn=Qr(Kt),Ot=So(He(me)?Nn:""),Ws=E.useRef(Ot);E.useEffect(()=>{const u=Ws.current;if(Ws.current=Ot,!u||!Ot||u===Ot)return;const P=S.current;if(P)return Fl({iframe:P,reload:Hs})},[Ot]);const ni=()=>{const u=cn.indexOf(g);R(cn[(u+1)%cn.length])},Tn=(u,P)=>{if(!oe)return;const M=oe,ae={...rt,[u]:P};De.current=Ve(I,ae),pe(we=>({...we,[M]:ae})),Rt({path:I,pageKey:M,params:ae})},si=$c({iframeBase:te.iframeBase,resolvedPath:Ce,activeGlobalSectionName:N?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),Cn=u=>{const P=he[u.key]??{},M=Ve(u.path,P);(N||Ne(M)!==Ne(Ce))&&Se(),De.current=M,_(null),z(null),ne(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})},qs=u=>{(N||Ne(u)!==Ne(Ce))&&Se(),De.current=u,_(null),z(null),ne(null),k(null),ie(null),Z(u),Rt({path:u,pageKey:null,params:{}})};Fi(Ct,qs);const ri=u=>{if(Xe(me)){const ae=ue?Io(ue,u.key,Pe):null;ae?Cn(ae):un.info(e("sandbox.preview.blockOnNoPage"));return}if(!wt||!Pe){un.error(e("sandbox.preview.previewMetadataNotReady"));return}Se(),De.current=null;const P=or(Pe),M=ir(wt,P,u.key);_(u),z(null),ne(M),k(null),o.selectTarget({kind:"section",key:u.key})},ai=u=>{f&&(_(null),z(u.key),ne(null),Xt("blocks"),o.selectTarget({kind:"loader",key:u.key}))},ii=async({name:u,path:P,templateKey:M})=>{if(!t||!s)return;const ae=aa(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 is.mutateAsync({name:u,path:we,template:Te,schema:Xe(me)?{meta:Pe,loadMeta:async()=>(await hn.refetch()).data}:void 0});H(!1),un.success(e("sandbox.preview.pageCreated",{name:u})),await sl(Td),Cn({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"))}},en=Fc({previewSurfaceActive:Et,daemonReady:Os,production:te.mode==="production",servePreviewUrl:He(me)}),oi=Bc({showPreviewToolbar:en,contentEditingEnabled:p}),Dt=()=>{G(!1),Q("")},Rn=N?.name??Ht?.title??vn?.name,Ln=as.isPending||hn.isPending,An=Ln?Mt(te.iframeBase):Rn,$t=N?`section:${N.key}`:$?`loader:${$}`:oe?`page:${oe}`:Qt.includes(Ne(I))?`route:${Ne(I)}`:void 0,li=en?oi?r.jsxs(Vr,{open:U,onOpenChange:u=>{G(u),u||Q("")},children:[r.jsx(Kr,{asChild:!0,children:r.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:Ln?An??void 0:N||Ht?Rn:[Rn,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:[N&&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(Hi,{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(Vi,{size:11}),e("sandbox.preview.loaderBadge")]}),An&&r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:An}),!Ln&&!N&&!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(Mi,{size:12,className:Fe("shrink-0 transition-transform",U&&"rotate-180")})]})})}),r.jsxs(Hr,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[r.jsxs(qr,{shouldFilter:!1,defaultValue:$t,children:[r.jsx(Gr,{value:q,onValueChange:u=>{Q(u),K.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),r.jsxs(Wr,{ref:K,className:"max-h-80",children:[r.jsx(Jr,{children:Ge.length===0&&Qt.length===0&&gn.length===0&&ds.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),ls.length>0&&r.jsx(ft,{children:ls.map(u=>r.jsxs(pt,{value:`page:${u.key}`,"aria-current":$t===`page:${u.key}`||void 0,title:`${u.name} · ${u.path}`,onSelect:()=>{Dt(),Cn(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))}),$s.length>0&&r.jsx(ft,{heading:e("sandbox.preview.siteRoutes"),children:$s.map(u=>r.jsx(pt,{value:`route:${u}`,"aria-current":$t===`route:${u}`||void 0,title:u,onSelect:()=>{Dt(),qs(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))}),cs.length>0&&r.jsx(ft,{heading:e("sandbox.preview.globalComponents"),children:cs.map(u=>r.jsx(pt,{value:`section:${u.key}`,"aria-current":$t===`section:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Dt(),ri(u)},children:r.jsx("span",{className:"truncate",children:u.name})},u.key))}),us.length>0&&r.jsx(ft,{heading:e("sandbox.preview.globalLoaders"),children:us.map(u=>r.jsx(pt,{value:`loader:${u.key}`,"aria-current":$t===`loader:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Dt(),ai(u)},children:r.jsx("span",{className:"truncate",children:u.title})},u.key))})]})]}),!N&&!$&&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=xn[u.name];return M&&kt?r.jsx(Sc,{sources:M,template:I,paramName:u.name,value:rt[u.name]??"",sandboxRef:kt,onCommit:ae=>Tn(u.name,ae)},`${oe}:${u.name}`):r.jsx(Oc,{name:u.name,value:rt[u.name]??"",onCommit:ae=>Tn(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:()=>{Dt(),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:si}):null,Gs=en||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:ni,"aria-label":e(Er[g]),children:g==="mobile"?r.jsx(Ir,{size:16}):g==="tablet"?r.jsx(Wi,{size:16}):r.jsx(Ur,{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:Da,load:Fa,onOpen:()=>$a(!0),options:W,onChange:u=>{Y(u),o.previewAsChanged()},available:!!yn||!xs||!ws}),r.jsx(Ze,{onClick:Ia,disabled:Ae&&!Es,"aria-label":e("sandbox.preview.openInNewTab"),children:r.jsx(Or,{size:16})})]})]}):null,ci=(Le||d)&&te.mode==="sandbox",tn=Cd[g],nn=g==="desktop"&&(O.width===0||O.width>=tn.width+2*jr),Js=nn?1:Math.min(O.width>0?O.width/(tn.width+2*jr):1,1),di=nn?{width:"100%",height:"100%"}:{width:`${tn.width}px`,height:O.height>0?`${O.height/Js}px`:`${tn.height}px`,transform:`scale(${Js})`,transformOrigin:"top center"},Ys=r.jsxs(r.Fragment,{children:[ci&&(en||p)&&r.jsx(Ze,{onClick:Xa,"aria-pressed":ye==="visual","aria-label":e("sandbox.preview.visualEditor"),active:ye==="visual",children:r.jsx(Zs,{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(Gi,{size:16})})}),r.jsx(gt,{children:e("sandbox.preview.blocksEditor")})]}),st&&r.jsxs(vt,{children:[r.jsx(ht,{asChild:!0,children:r.jsx(Ze,{onClick:D,"aria-pressed":T,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:T,children:r.jsx(qi,{size:16})})}),r.jsx(gt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),ui=!!$&&ye==="blocks";return r.jsxs("div",{className:"flex flex-col w-full h-full",children:[kt&&Object.entries(xn).map(([u,P])=>(rt[u]??"")===""?r.jsx(Ac,{sources:P,template:I,paramName:u,sandboxRef:kt,onFill:M=>Tn(u,M)},`${oe}:${u}`):null),r.jsxs(r.Fragment,{children:[r.jsx(Vn.Toolbar.Center.Portal,{fallback:r.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:Gs}),children:Gs}),r.jsx(Vn.Toolbar.Right.Portal,{fallback:Ys,children:Ys})]}),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(kr,{virtualMcpId:t,externalSelection:C,onSectionPicked:Ms,onViewJsonFile:D}),T&&st&&r.jsx("div",{className:"absolute inset-0 z-10",children:r.jsx(Sr,{ref:A,virtualMcpId:t,pageKey:st,onClose:L},me.kind==="legacy"?void 0:JSON.stringify([Nn,xe]))})]}):r.jsxs(lr,{orientation:"horizontal",disabled:ye!=="blocks",className:"relative isolate",children:[r.jsx(rn,{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(kr,{virtualMcpId:t,externalSelection:C,onSectionPicked:Ms,onViewJsonFile:D})}),ye==="blocks"&&r.jsx(cr,{withHandle:!0}),r.jsx(rn,{id:"preview-canvas",defaultSize:ye==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:r.jsxs(lr,{orientation:"horizontal",disabled:!(T&&st),children:[r.jsx(rn,{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&&!nn&&"bg-muted/30"),children:[(be||Ca)&&Et&&r.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:r.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),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(On,{kind:"starting",progress:hs,claimPhase:bn})}),!se&&Je.kind==="suspended"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(On,{kind:"suspended",onResume:Ie.resume})}),!se&&Je.kind==="errored"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(On,{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(Zs,{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",!nn&&"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:Ls.handleError,onLoad:()=>{if(wn(Pr),Va(lt),Ls.handleLoad(),fe(),En.current=at.current,At&&Dn(Lt),te.mode!=="sandbox"||se){(te.mode==="production"&&!te.showWakingPill||se)&&ye==="blocks"&&jn();return}if(yi("vm_preview_loaded",{view_mode:ye,vm_id:Ue?.sandboxHandle??null}),!N)try{const u=S.current?.contentWindow?.location?.pathname;if(!u)return;const P=De.current;if(P!==null&&(De.current=null,Ne(u)!==Ne(P))||Ne(u)===Ne(Ce))return;Z(u),Rt({path:u,pageKey:re,params:rt})}catch{}ye==="visual"&&Fs(),ye==="blocks"&&jn()}},te.iframeBase)})]})}),T&&st&&r.jsxs(r.Fragment,{children:[r.jsx(cr,{withHandle:!0}),r.jsx(rn,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:r.jsx(Sr,{ref:A,virtualMcpId:t,pageKey:st,onClose:L},me.kind==="legacy"?void 0:JSON.stringify([Nn,xe]))})]})]})})]})}),r.jsx(Hc,{open:ee,onOpenChange:H,isPending:is.isPending,error:J,templates:Ge,onSubmit:ii})]})}const Yn={app:null,split:!1};function Fd(t){const e=le.c(24),{project:n,maxApps:s,children:a}=t,l=Ee();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={silent:!0},e[0]=d):d=e[0];const o=Qi(d),i=xt();let c;e[1]!==n.metadata.runtime?(c=n.metadata.runtime??{},e[1]=n.metadata.runtime,e[2]=c):c=e[2];const m=c;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]!==n.id||e[8]!==n.metadata||e[9]!==m||e[10]!==l?(y=v=>o.update.mutate({id:n.id,data:{metadata:{...rl(n.metadata),runtime:{...m,apps:v.length?v:null}}}},{onSuccess:()=>i.start(),onError:()=>un.error(l("sandbox.appTabs.saveError"))}),e[5]=o.update,e[6]=i,e[7]=n.id,e[8]=n.metadata,e[9]=m,e[10]=l,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]!==s||e[19]!==n.id||e[20]!==b||e[21]!==h||e[22]!==g?(R=r.jsx(Bd,{virtualMcpId:n.id,mainPath:b,apps:f,maxApps:s,onAddApp:h,onRemoveApp:g,children:a}),e[16]=f,e[17]=a,e[18]=s,e[19]=n.id,e[20]=b,e[21]=h,e[22]=g,e[23]=R):R=e[23],R}function Bd(t){const e=le.c(102),{virtualMcpId:n,mainPath:s,apps:a,maxApps:l,onAddApp:d,onRemoveApp:o,children:i}=t,c=Ee(),m=sa(),{currentBranch:p}=nt(),f=xt(),y=ts().lifecycle.phase,x=Ut(n,p),{url:b}=ta(n);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]!==n?(S=Hn.previewAppLayout(n),e[5]=n,e[6]=S):S=e[6];const[j,T]=Kn(S,Md);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,D=A===null||L,O=A??a[0]?.path??null,[F,U]=E.useState(null),[G,W]=E.useState(!1);let Y;e[10]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>{U(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]!==s||e[15]!==d||e[16]!==T?(Q=()=>{if(F===null)return;const fe=fr(F);if(!fe){q();return}if(fe===fr(s??"")||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]=s,e[15]=d,e[16]=T,e[17]=Q):Q=e[17];const K=Q;let ee;e[18]!==s||e[19]!==c?(ee=s?$n(s):c("sandbox.appTabs.root"),e[18]=s,e[19]=c,e[20]=ee):ee=e[20];const H=ee;let J;e[21]!==L||e[22]!==c?(J=c(L?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=L,e[22]=c,e[23]=J):J=e[23];const V=J;let N;e[24]!==c?(N=c("sandbox.appTabs.label"),e[24]=c,e[25]=N):N=e[25];let _;e[26]!==c?(_=c("sandbox.appTabs.main"),e[26]=c,e[27]=_):_=e[27];let $;e[28]!==c?($=c("sandbox.appTabs.mainHint"),e[28]=c,e[29]=$):$=e[29];let z;e[30]!==T?(z=()=>T(Yn),e[30]=T,e[31]=z):z=e[31];let X;e[32]!==w||e[33]!==H||e[34]!==v||e[35]!==D||e[36]!==_||e[37]!==$||e[38]!==z?(X=r.jsx(Nr,{label:H,badge:_,hint:$,ready:v,failed:w,onScreen:D,onSelect:z}),e[32]=w,e[33]=H,e[34]=v,e[35]=D,e[36]=_,e[37]=$,e[38]=z,e[39]=X):X=e[39];let ne;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]!==c){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]!==c?(fe=ce=>{const Re=$n(ce.path);return r.jsx(Nr,{label:Re,hint:c("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:c("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]=c,e[58]=fe):fe=e[58],ne=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]=c,e[49]=ne}else ne=e[49];let I;e[59]!==X||e[60]!==ne||e[61]!==N?(I=r.jsxs("div",{role:"tablist","aria-label":N,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[X,ne]}),e[59]=X,e[60]=ne,e[61]=N,e[62]=I):I=e[62];let Z;e[63]!==a.length||e[64]!==K||e[65]!==F||e[66]!==G||e[67]!==l||e[68]!==c?(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":c("sandbox.appTabs.pathLabel"),"aria-invalid":G,onChange:fe=>{U(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<l&&r.jsx(mt,{label:c("sandbox.appTabs.add"),onClick:()=>U(""),children:r.jsx(zr,{})}),e[63]=a.length,e[64]=K,e[65]=F,e[66]=G,e[67]=l,e[68]=c,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?Yn:{app:O,split:!0}),children:r.jsx(Ji,{})}),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(Vn.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]!==D?(be=D&&r.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:i}),e[82]=i,e[83]=D,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(Id,{name:$n(A),mainName:H,appUrl:R?al(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 Md(t){return t??Yn}function Nr(t){const e=le.c(28),{label:n,badge:s,hint:a,ready:l,failed:d,onScreen:o,onSelect:i,onRemove:c,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=l?"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]!==n?(h=r.jsx("span",{className:"max-w-40 truncate",children:n}),e[6]=n,e[7]=h):h=e[7];let g;e[8]!==s?(g=s&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:s}),e[8]=s,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]!==c||e[22]!==m?(C=c&&r.jsx("button",{type:"button","aria-label":m,onClick:c,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]=c,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 Id(t){const e=le.c(71),{name:n,mainName:s,appUrl:a,ready:l,failed:d,notStarted:o,onStart:i,className:c,onClose:m}=t,p=Ee(),[f,y]=E.useState("/"),[x,b]=E.useState("desktop"),[h,g]=E.useState(0),R=E.useRef(null);let v;e[0]!==a||e[1]!==f?(v=a?il(a,f):null,e[0]=a,e[1]=f,e[2]=v):v=e[2];const w=v;let C;e[3]!==c?(C=Fe("flex min-h-0 min-w-0 flex-1 flex-col",c),e[3]=c,e[4]=C):C=e[4];let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=$=>{$.preventDefault(),y(R.current?.value||"/")},e[5]=k):k=e[5];let S;e[6]!==n||e[7]!==p?(S=p("sandbox.appPane.path",{app:n}),e[6]=n,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(zd),e[15]=B):B=e[15];let A;e[16]!==x?(A=x==="desktop"?r.jsx(Ur,{}):r.jsx(Ir,{}),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 D;e[21]!==n||e[22]!==p?(D=p("sandbox.appPane.reload",{app:n}),e[21]=n,e[22]=p,e[23]=D):D=e[23];const O=!w||!l;let F,U;e[24]===Symbol.for("react.memo_cache_sentinel")?(F=()=>g(Ud),U=r.jsx(wi,{}),e[24]=F,e[25]=U):(F=e[24],U=e[25]);let G;e[26]!==D||e[27]!==O?(G=r.jsx(mt,{label:D,disabled:O,onClick:F,children:U}),e[26]=D,e[27]=O,e[28]=G):G=e[28];let W;e[29]!==n||e[30]!==p?(W=p("sandbox.appPane.openInNewTab",{app:n}),e[29]=n,e[30]=p,e[31]=W):W=e[31];const Y=!w||!l;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]!==n||e[40]!==m||e[41]!==p?(ee=m&&r.jsx(mt,{label:p("sandbox.appPane.close",{app:n}),onClick:m,children:r.jsx(ma,{})}),e[39]=n,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]!==s||e[50]!==p?(J=p("sandbox.appPane.previewOnly",{app:s}),e[49]=s,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 N;e[54]!==x||e[55]!==d||e[56]!==s||e[57]!==n||e[58]!==o||e[59]!==i||e[60]!==l||e[61]!==h||e[62]!==w||e[63]!==p?(N=r.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:l&&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:n})}),r.jsx(_e,{size:"sm",variant:"outline",onClick:i,children:p("sandbox.appPane.start",{app:n})})]}):!l||!w?r.jsx("p",{className:"self-center px-6 text-center text-sm text-muted-foreground",children:l?p("sandbox.appPane.noUrl"):d?p("sandbox.appPane.failed",{app:s}):p("sandbox.appPane.waiting")}):r.jsx("iframe",{src:w,title:n,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]=s,e[57]=n,e[58]=o,e[59]=i,e[60]=l,e[61]=h,e[62]=w,e[63]=p,e[64]=N):N=e[64];let _;return e[65]!==n||e[66]!==C||e[67]!==H||e[68]!==V||e[69]!==N?(_=r.jsxs("section",{"aria-label":n,className:C,children:[H,V,N]}),e[65]=n,e[66]=C,e[67]=H,e[68]=V,e[69]=N,e[70]=_):_=e[70],_}function Ud(t){return t+1}function zd(t){return t==="desktop"?"mobile":"desktop"}function mt(t){const e=le.c(11),{label:n,children:s,active:a,disabled:l,onClick:d}=t;let o;e[0]!==a||e[1]!==s||e[2]!==l||e[3]!==n||e[4]!==d?(o=r.jsx(ht,{asChild:!0,children:r.jsx(Ze,{"aria-label":n,"aria-pressed":a,active:a,disabled:l,onClick:d,children:s})}),e[0]=a,e[1]=s,e[2]=l,e[3]=n,e[4]=d,e[5]=o):o=e[5];let i;e[6]!==n?(i=r.jsx(gt,{children:n}),e[6]=n,e[7]=i):i=e[7];let c;return e[8]!==o||e[9]!==i?(c=r.jsxs(vt,{children:[o,i]}),e[8]=o,e[9]=i,e[10]=c):c=e[10],c}const Kd=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},Hd=1e4,Vd=1e4,Wd=5e3,qd=2;function Gd(t,e){return t&&e===0?Vd:Math.min(1e3*2**Math.max(0,e-1),Wd)}function Jd(t,e,n){return e?!0:t===!0&&n<qd}function Yd(t,e){const n=le.c(11),s=Kd,a=ki();let l;n[0]!==t?(l=Qn.localAppReachable(t??""),n[0]=t,n[1]=l):l=n[1];const d=l;let o;n[2]!==s||n[3]!==a||n[4]!==d||n[5]!==t?(o=async p=>{const{signal:f}=p,y=new AbortController,x=()=>y.abort();f.addEventListener("abort",x);const b=setTimeout(x,Hd),h=await s(t,y.signal).catch(Xd);clearTimeout(b),f.removeEventListener("abort",x);const g=a.getQueryData(d),R=h?0:(g?.failures??0)+1;return{up:Jd(g?.up??null,h,R),failures:R}},n[2]=s,n[3]=a,n[4]=d,n[5]=t,n[6]=o):o=n[6];const i=!!t;let c;n[7]!==d||n[8]!==o||n[9]!==i?(c={queryKey:d,queryFn:o,enabled:i,retry:!1,staleTime:0,gcTime:0,refetchInterval:Qd},n[7]=d,n[8]=o,n[9]=i,n[10]=c):c=n[10];const{data:m}=_r(c);return t?m?.up??null:null}function Qd(t){return t.state.data?Gd(t.state.data.up,t.state.data.failures):!1}function Xd(){return!1}function Zd(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const n=e.problem;return!n||n.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:n}}return{kind:"connecting"}}function Xu(t){const e=le.c(53),{virtualMcpId:n}=t,s=Ee(),a=Xi(n),{connection:l}=na(n),{activeTask:d,taskId:o,currentBranch:i}=nt(),c=ml(o),[m,p]=E.useState(!1),f=Ut(n,i);let y;e[0]!==f||e[1]!==l?(y=l?He(f):null,e[0]=f,e[1]=l,e[2]=y):y=e[2];const x=y,b=Yd(x),h=ga(),g=ol("multi_app_preview");if(dl({threadId:o,sandboxBranch:d?.branch??i,agentHasRepo:Fn(a?.metadata),threadHasRepo:Fn(c)||Fn(d?.metadata)})==="none"&&!l){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(pr,{className:"size-7 text-foreground"})}),e[3]=k):k=e[3];let S;e[4]!==s?(S=s("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=s,e[5]=S):S=e[5];let j;e[6]!==s?(j=s("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=s,e[7]=j):j=e[7];let T,B;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>p(!0),B=r.jsx(pr,{className:"size-4"}),e[8]=T,e[9]=B):(T=e[8],B=e[9]);let A;e[10]!==s?(A=s("mainPanelTabs.previewTab.connectGithub"),e[10]=s,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 D;e[14]!==S||e[15]!==j||e[16]!==L?(D=r.jsx(ll,{className:"h-full",image:k,title:S,description:j,actions:L}),e[14]=S,e[15]=j,e[16]=L,e[17]=D):D=e[17];let O;e[18]!==m?(O=r.jsx(cl,{open:m,onOpenChange:p,mode:"agent"}),e[18]=m,e[19]=O):O=e[19];let F;return e[20]!==O||e[21]!==D?(F=r.jsxs(r.Fragment,{children:[D,O]}),e[20]=O,e[21]=D,e[22]=F):F=e[22],F}if(l&&a&&!He(f)){let k;e[23]!==h||e[24]!==f?(k=Zd({backend:f,access:h}),e[23]=h,e[24]=f,e[25]=k):k=e[25];let S;e[26]!==l.endpoint?(S=jo(l.endpoint),e[26]=l.endpoint,e[27]=S):S=e[27];let j;return e[28]!==k||e[29]!==S?(j=r.jsx(tu,{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]!==s?(k=s("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=s,e[32]=k):k=e[32];let S;e[33]!==x||e[34]!==s?(S=s("mainPanelTabs.previewTab.localAppWaiting.body",{host:eu(x)}),e[33]=x,e[34]=s,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]!==s?(T=s("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=s,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(fn,{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]!==n?(v=r.jsx($d,{virtualMcpId:n}),e[46]=n,e[47]=v):v=e[47];const w=v;let C;return e[48]!==a||e[49]!==g||e[50]!==w||e[51]!==l?(C=r.jsx(Oi,{children:g&&a&&!l?r.jsx(Fd,{project:a,maxApps:nl,children:w}):w}),e[48]=a,e[49]=g,e[50]=w,e[51]=l,e[52]=C):C=e[52],C}function eu(t){try{return new URL(t).host}catch{return t}}function tu(t){const e=le.c(13),{status:n,host:s}=t,a=Ee();if(n.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 c;return e[4]!==o||e[5]!==i?(c=r.jsx(fn,{headingLevel:2,waiting:!1,title:o,lead:i}),e[4]=o,e[5]=i,e[6]=c):c=e[6],c}let l;e[7]!==s||e[8]!==n?(l=bl(n,s),e[7]=s,e[8]=n,e[9]=l):l=e[9];let d;return e[10]!==s||e[11]!==l?(d=r.jsx(xl,{wait:l,hosts:s}),e[10]=s,e[11]=l,e[12]=d):d=e[12],d}export{xl as L,Xu as P,fn as S,Qu as u};
|