decocms 4.521.0 → 4.522.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-NiXAWNnI.js → ActiveShapeUtils-DgNRIskl.js} +1 -1
- package/dist/client/assets/{AlertCircle-DGVmeswV.js → AlertCircle-CM8LBbRI.js} +1 -1
- package/dist/client/assets/{AreaChart-DL7RX4W6.js → AreaChart-BDF0Y7ZZ.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DDWHto_R.js → ArrowLeft-o6iMnbNE.js} +1 -1
- package/dist/client/assets/{ArrowUp-bm_9Fp5i.js → ArrowUp-BXMfywqx.js} +1 -1
- package/dist/client/assets/{BarChart-DmTON82J.js → BarChart-CXp4Uz8n.js} +1 -1
- package/dist/client/assets/{Building02-p3_mZ-E2.js → Building02-BHRxs6ob.js} +1 -1
- package/dist/client/assets/{CartesianChart-oH_IqMjj.js → CartesianChart-PuQz8SzS.js} +1 -1
- package/dist/client/assets/{CategoricalChart-Dy74bBD9.js → CategoricalChart-ixJIwUQc.js} +1 -1
- package/dist/client/assets/{CheckCircle-Bx5iI6Lz.js → CheckCircle-_6kE8J_Y.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-CtVpNCaH.js → ChevronSelectorVertical-Cxa072WE.js} +1 -1
- package/dist/client/assets/{ChevronUp-ojSOtVX2.js → ChevronUp-CzyRtbYf.js} +1 -1
- package/dist/client/assets/{Copy01-CixCoZek.js → Copy01-DHQGmb70.js} +1 -1
- package/dist/client/assets/{CreditCard01-D0K-VlXU.js → CreditCard01-h12_eEzi.js} +1 -1
- package/dist/client/assets/{DotsVertical-DzE0Ijkk.js → DotsVertical-Bq4P-tWv.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DRS3e7xk.js → ErrorBarContext-DndlWqze.js} +1 -1
- package/dist/client/assets/{Globe04-CE15ScrO.js → Globe04-fNWMmp0g.js} +1 -1
- package/dist/client/assets/{Image01-Bks737AT.js → Image01-nc4SHYwM.js} +1 -1
- package/dist/client/assets/{Key01-CxbATohw.js → Key01-D-TFQCEV.js} +1 -1
- package/dist/client/assets/{Link01-DCdDhO7H.js → Link01-BXRKhx3s.js} +1 -1
- package/dist/client/assets/{LinkBroken01-ZF7OlrXq.js → LinkBroken01-BGVU3ZYB.js} +1 -1
- package/dist/client/assets/{Minus-DqMKpYLh.js → Minus-I9YJmaEA.js} +1 -1
- package/dist/client/assets/{Monitor01-B-_Pl3qs.js → Monitor01-DKMgKH5T.js} +1 -1
- package/dist/client/assets/{Play-B6eaz3Uv.js → Play-DRKKkb6S.js} +1 -1
- package/dist/client/assets/{Plus-B28tKNm1.js → Plus-BDzIUMmX.js} +1 -1
- package/dist/client/assets/{ReferenceLine-C5aqWs1r.js → ReferenceLine-aBuxkoA0.js} +1 -1
- package/dist/client/assets/{SearchMd-OCyidoZI.js → SearchMd-DaDIzrN6.js} +1 -1
- package/dist/client/assets/{Sector-CtNXSnWN.js → Sector-DgbJAFTT.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DHyiQNjO.js → ShoppingBag01-D8V6jyOF.js} +1 -1
- package/dist/client/assets/{Sun-BUl5hUgs.js → Sun-pq7DLIkN.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BKu4aB4V.js → SwitchHorizontal01-BkDZFUwe.js} +1 -1
- package/dist/client/assets/{Tool01-CnZckhqi.js → Tool01-kEVQyvkb.js} +1 -1
- package/dist/client/assets/{Trash01-C34kFeWG.js → Trash01-C0MTVRPf.js} +1 -1
- package/dist/client/assets/{Upload01-sDXthFWJ.js → Upload01-Bzv5xKwk.js} +1 -1
- package/dist/client/assets/{User01-2Hx1yZRb.js → User01-CWMwTWQs.js} +1 -1
- package/dist/client/assets/{UserSquare-UeuSXkL4.js → UserSquare-C9kie61X.js} +1 -1
- package/dist/client/assets/{Users01-D78JG135.js → Users01-wuFaBjJt.js} +1 -1
- package/dist/client/assets/{XClose-BbuvN9Qp.js → XClose-BhvC0HDH.js} +1 -1
- package/dist/client/assets/{ZoomOut-DnRMz8gp.js → ZoomOut-OMu4FTNj.js} +1 -1
- package/dist/client/assets/{access-gate-B-XccyUi.js → access-gate-CleNG4b1.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-3BCYyOlq.js → add-connection-dialog-cxw9Vczu.js} +1 -1
- package/dist/client/assets/agent-analytics-BziQPnGE.js +1 -0
- package/dist/client/assets/agent-app-B_sgoDWu.js +1 -0
- package/dist/client/assets/{agent-assets-BX70IHOT.js → agent-assets-B66pzU8f.js} +1 -1
- package/dist/client/assets/{agent-automation-DSOT91yw.js → agent-automation-CPwvPaTi.js} +1 -1
- package/dist/client/assets/{agent-automations-DELrtNmQ.js → agent-automations-B54NFYpy.js} +1 -1
- package/dist/client/assets/agent-calendar-DZOmQQue.js +1 -0
- package/dist/client/assets/{agent-connect-sources-EYRSBit6.js → agent-connect-sources-BPjRiYtY.js} +1 -1
- package/dist/client/assets/agent-deck-Ba91n9SI.js +1 -0
- package/dist/client/assets/{agent-e2e-DgDrdrOU.js → agent-e2e-BFK9eU0J.js} +1 -1
- package/dist/client/assets/agent-experiments-D8m0kz__.js +1 -0
- package/dist/client/assets/agent-file-C093Q8j5.js +1 -0
- package/dist/client/assets/{agent-hosting-COv9KqxJ.js → agent-hosting-C1kU5jFj.js} +1 -1
- package/dist/client/assets/{agent-icon-2Sd6TPJR.js → agent-icon-CkduijMR.js} +1 -1
- package/dist/client/assets/agent-library-Bt1DJeQH.js +1 -0
- package/dist/client/assets/agent-library-file-AfgLtORg.js +1 -0
- package/dist/client/assets/agent-monitor-DI6jTwwp.js +1 -0
- package/dist/client/assets/{agent-overview-jQR56ImR.js → agent-overview-y5Nh2nwn.js} +1 -1
- package/dist/client/assets/{agent-releases-1LcFLBWb.js → agent-releases-kZt-8iLB.js} +1 -1
- package/dist/client/assets/agent-settings-OvqJh8WY.js +1 -0
- package/dist/client/assets/{agent-site-editor-FH5rkph4.js → agent-site-editor-C5VhY5wZ.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-DzKBDbgz.js +2 -0
- package/dist/client/assets/agent-site-editor-content-BngyQ48R.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-Bj-4WvPn.js +1 -0
- package/dist/client/assets/agent-view-B1RWTFTJ.js +1 -0
- package/dist/client/assets/{agent-view-guard-BtSTYr3f.js → agent-view-guard-C1iKElhG.js} +1 -1
- package/dist/client/assets/{agents-list-BciltAjT.js → agents-list-JKV6Z3Xq.js} +1 -1
- package/dist/client/assets/{ai-providers-1_g2-YFO.js → ai-providers-CPQGsZpL.js} +1 -1
- package/dist/client/assets/{alert-B6jt7ehz.js → alert-CQRqIByK.js} +1 -1
- package/dist/client/assets/{alert-dialog-C6IuYhIc.js → alert-dialog-vz8WFIXE.js} +1 -1
- package/dist/client/assets/{analytics-sections-CMbHJdjJ.js → analytics-sections-Br7qXadL.js} +1 -1
- package/dist/client/assets/{analytics-tab-BptBREH9.js → analytics-tab-Ca8Gnxj6.js} +1 -1
- package/dist/client/assets/api-keys-CbEdpED-.js +1 -0
- package/dist/client/assets/{api-keys-DNoVGHBL.js → api-keys-MDgvdru8.js} +1 -1
- package/dist/client/assets/{app-editor-DIGpXnGi.js → app-editor-BagDBqNr.js} +1 -1
- package/dist/client/assets/app-preview-url-9Od4s8Sz.js +1 -0
- package/dist/client/assets/{asset-utils-BaoKrfcS.js → asset-utils-DMAyDksX.js} +1 -1
- package/dist/client/assets/{auth-MbbNpK0f.js → auth-ClNhQHlU.js} +1 -1
- package/dist/client/assets/{auth-catchall-CQhqMFI7.js → auth-catchall-Dzeq8yKB.js} +1 -1
- package/dist/client/assets/{auth-entry-BytQWBJH.js → auth-entry-CoGcxry-.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BLy72f6M.js → auth-split-layout-d-6d2zKA.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-ChOS0TQ8.js → authenticate-and-persist-oauth-5jgv9Xa2.js} +1 -1
- package/dist/client/assets/{automation-list-row-CDTQ4wXs.js → automation-list-row-B7N_rQ-Y.js} +1 -1
- package/dist/client/assets/{automation-runs-uGIsi6Hf.js → automation-runs-Dvua0N09.js} +1 -1
- package/dist/client/assets/{automations-CYPV9xM6.js → automations-BQ3r7tjH.js} +1 -1
- package/dist/client/assets/{autosend-nr-hPbHj.js → autosend-B29qh5n2.js} +1 -1
- package/dist/client/assets/{avatar-DarGMVT9.js → avatar-CFIaQZRf.js} +1 -1
- package/dist/client/assets/{badge-7nY_ai7T.js → badge-BsRLQum1.js} +1 -1
- package/dist/client/assets/{block-document-BFjSBfhL.js → block-document-BSywzMOo.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-CPEN608S.js → blocks-preview-workspace-context-oHu98aZe.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-DEKXC5rW.js → blocks-tab-states-BDili_03.js} +1 -1
- package/dist/client/assets/{blog-schema-DXeDEF-x.js → blog-schema-D3dQU75t.js} +1 -1
- package/dist/client/assets/{buckets-Fnw-QnpR.js → buckets-BJl3bULc.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BNyp6j2d.js → build-improve-prompt-doc-BzT4r5hv.js} +1 -1
- package/dist/client/assets/{calendar-D8eqk8F_.js → calendar-Dclm8CN2.js} +1 -1
- package/dist/client/assets/{campaigns-view-DwenRJ4m.js → campaigns-view-CmIRcofB.js} +1 -1
- package/dist/client/assets/{capability-load-error-DK8yJwbi.js → capability-load-error-WW2Kcric.js} +1 -1
- package/dist/client/assets/{category-editor-CvvoknG-.js → category-editor-huqv9n0W.js} +1 -1
- package/dist/client/assets/{cdn-tab-DGngqFre.js → cdn-tab-9Cucncg1.js} +1 -1
- package/dist/client/assets/{chart-BVOKVwol.js → chart-CZwNq7lc.js} +1 -1
- package/dist/client/assets/{chat-context-4LDKQ9-8.js → chat-context-BQpXrVMs.js} +1 -1
- package/dist/client/assets/{chat-draft-DtnFj70R.js → chat-draft-Bns-ELTf.js} +1 -1
- package/dist/client/assets/{checkbox--QGg9JL6.js → checkbox-1Jo3Rqz5.js} +1 -1
- package/dist/client/assets/{choose-editor-Co3gZPYu.js → choose-editor-9aJwWQ-M.js} +1 -1
- package/dist/client/assets/{cli-auth-success-PhyGH5OW.js → cli-auth-success-BarCqyVt.js} +1 -1
- package/dist/client/assets/{client-icons-C_ct3pd0.js → client-icons-ZCQWA3z5.js} +1 -1
- package/dist/client/assets/cms-settings-editor-CrRPvfvI.js +1 -0
- package/dist/client/assets/{collapsible-DGVOZrNj.js → collapsible-CAZdvMIU.js} +1 -1
- package/dist/client/assets/{collection-detail-BAmfEJxU.js → collection-detail-BECO_yHl.js} +1 -1
- package/dist/client/assets/{collection-display-button-ClKK9pYP.js → collection-display-button-BZ9Qz-3L.js} +1 -1
- package/dist/client/assets/{collection-search-DRo1WmLT.js → collection-search-cWsbRUjB.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Dgqpnsq8.js → collection-table-wrapper-CTDkSQdz.js} +1 -1
- package/dist/client/assets/{collection-tabs-Dc2dImyc.js → collection-tabs-CD4jljvJ.js} +1 -1
- package/dist/client/assets/{column-rules-DiqfCnEN.js → column-rules-BGaJgm-I.js} +1 -1
- package/dist/client/assets/{combobox-DZgmK343.js → combobox-DDNVNn5C.js} +1 -1
- package/dist/client/assets/{command-CPx9UwtG.js → command-BBdqXAPJ.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-CLb76BIo.js → companion-mcps-section-BNjkM4cU.js} +1 -1
- package/dist/client/assets/{config-CxVvKo3A.js → config-CCpNMXqo.js} +1 -1
- package/dist/client/assets/{connect-A3Avs8Pl.js → connect-CQEXdvDN.js} +1 -1
- package/dist/client/assets/{connect-layout-BksXTmdN.js → connect-layout-BEF1TkbT.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-DSaPW3-r.js → connect-source-dialog-C13X-wCa.js} +1 -1
- package/dist/client/assets/{connection-GML1C2tu.js → connection-DQvDlLfk.js} +1 -1
- package/dist/client/assets/{connection-card-ZvVd_UVc.js → connection-card-d-hDQNew.js} +1 -1
- package/dist/client/assets/{connection-detail-DtbzbTIM.js → connection-detail-Bp-r3EJs.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CGyT85pi.js → connection-form-helpers-BXv-epm5.js} +1 -1
- package/dist/client/assets/{connections-D4x-lAFA.js → connections-r5CBQTPj.js} +1 -1
- package/dist/client/assets/{content-tab-DgdEt3c6.js → content-tab-axoESGsZ.js} +3 -3
- package/dist/client/assets/{context-BcuOiE0n.js → context-Cppcn4Xj.js} +1 -1
- package/dist/client/assets/{context-menu-BPat3chT.js → context-menu-C6lu6sij.js} +1 -1
- package/dist/client/assets/{context-shell-BpD_TiZV.js → context-shell-DnRrhD8r.js} +3 -3
- package/dist/client/assets/{core.esm-CumN7OYl.js → core.esm-DlrTVFm2.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-C7cTp33N.js → create-organization-dialog-Dk6dw47b.js} +1 -1
- package/dist/client/assets/{daily-pulse-DIdfLtIG.js → daily-pulse-C9hDLLgw.js} +1 -1
- package/dist/client/assets/{discover-CG4C5Odc.js → discover-CNW-wNTc.js} +1 -1
- package/dist/client/assets/{domain-settings-DkAHUlQw.js → domain-settings-Dy4NOoy7.js} +1 -1
- package/dist/client/assets/{drawer-Bp7WNOCz.js → drawer-8XhEo4S9.js} +1 -1
- package/dist/client/assets/{editor-CmZJbc4Z.js → editor-RlVhV_5_.js} +1 -1
- package/dist/client/assets/{editor-classes-DYddjmhz.js → editor-classes-C3bkPxTU.js} +1 -1
- package/dist/client/assets/{empty-state-DBHadTD8.js → empty-state-COpU6lcn.js} +1 -1
- package/dist/client/assets/{empty-state-vh9cmtA2.js → empty-state-p228cI1e.js} +1 -1
- package/dist/client/assets/{experiments-tab-BaB_Zi0V.js → experiments-tab-D2FKrGeK.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-p3E1pILX.js → experiments-tab-choice-Z74ukAS5.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C2lA8ZOm.js → extract-connection-data-BJS9dJQe.js} +1 -1
- package/dist/client/assets/{feature-gate-D8HHU_kV.js → feature-gate-tPt6Tn6z.js} +1 -1
- package/dist/client/assets/{feature-paywall-CRRIPYfS.js → feature-paywall-OwIX0f3G.js} +1 -1
- package/dist/client/assets/{file-explorer-BTIbvupP.js → file-explorer-CEw1YBaZ.js} +1 -1
- package/dist/client/assets/{file-preview-CsDpTAv6.js → file-preview-i9LkXBSE.js} +1 -1
- package/dist/client/assets/{file-share-button-BmWv4msr.js → file-share-button-B06eRoXO.js} +1 -1
- package/dist/client/assets/{file-type-icon-Ixvc6_bA.js → file-type-icon-C1atr-sB.js} +1 -1
- package/dist/client/assets/{folder-icon-ByIjnQde.js → folder-icon-Du4go64w.js} +1 -1
- package/dist/client/assets/{form-CIAWZjuP.js → form-MT3iZ1Vu.js} +1 -1
- package/dist/client/assets/{general-DEusZ5JT.js → general-DqW0kTD8.js} +1 -1
- package/dist/client/assets/{home-B9bSA6tC.js → home-CmVL1fox.js} +1 -1
- package/dist/client/assets/{icon-button-7F5Toil2.js → icon-button-Bt9yq8Xo.js} +1 -1
- package/dist/client/assets/{index-CRYNJjMc.js → index-6KnUwzPl.js} +1 -1
- package/dist/client/assets/{index-CYGV5ggz.js → index-BKThXOYa.js} +1 -1
- package/dist/client/assets/{index-4NUDq9UX.js → index-BMe2AVc3.js} +1 -1
- package/dist/client/assets/{index-CblLVDuN.js → index-B_5mdOkJ.js} +1 -1
- package/dist/client/assets/{index-CfHLnaAs.js → index-CJ0HMSBA.js} +1 -1
- package/dist/client/assets/{index-BZ3kN-UW.js → index-CWpr_BWP.js} +1 -1
- package/dist/client/assets/{index-B1T14RYF.js → index-CkE02jcD.js} +1 -1
- package/dist/client/assets/{index-BEqT-aNW.js → index-D2IcFDBY.js} +1 -1
- package/dist/client/assets/{index-xD4K2nG7.js → index-DIs1KTwD.js} +1 -1
- package/dist/client/assets/{index-MrGr5MGL.js → index-DnroRdaH.js} +1 -1
- package/dist/client/assets/{index-DxIuEmxM.js → index-DuRsqxKc.js} +1 -1
- package/dist/client/assets/{index-DJCD1T3p.js → index-DyYo9Tzb.js} +5 -5
- package/dist/client/assets/{index-B0ZOlWzX.js → index-hZj-AA0X.js} +1 -1
- package/dist/client/assets/{index-redirect-BSxSh5S-.js → index-redirect-B4v1eDMS.js} +1 -1
- package/dist/client/assets/{index-DrxFcbdt.js → index-vV-QfGRD.js} +1 -1
- package/dist/client/assets/{index-DiKBQ93t.js → index-zVFg_sNX.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-5dM4o4Hf.js → infiniteQueryObserver-CuPmu1oh.js} +1 -1
- package/dist/client/assets/{infra-billing-BW0f21OW.js → infra-billing-BS6n5yAA.js} +1 -1
- package/dist/client/assets/{input-Di5PUIe8.js → input-C2OmAhM5.js} +3 -3
- package/dist/client/assets/{input-2QjNp7qX.js → input-C_izEjEb.js} +1 -1
- package/dist/client/assets/{integration-icon-CMGBZM9F.js → integration-icon-DOchPlwn.js} +1 -1
- package/dist/client/assets/{jira-icon-DZrAPkCR.js → jira-icon-CbdTqBoW.js} +1 -1
- package/dist/client/assets/{label-CBlQ82Fk.js → label-I4hMcj8q.js} +1 -1
- package/dist/client/assets/{layout-jno9iSY1.js → layout-D5TkSoGq.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-C-JHuDVd.js → legacy-agents-deep-DGKAIGFW.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BjKbMolf.js → legacy-main-redirect-CytPUWwX.js} +1 -1
- package/dist/client/assets/library-DtKkvgcM.js +1 -0
- package/dist/client/assets/{login-DrbMDqlp.js → login-8xawz8Ys.js} +1 -1
- package/dist/client/assets/{markdown-BU6g98sq.js → markdown-Djk34d4X.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-B6MBkXrw.js → mcp-app-renderer-Bme3JE-4.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CFQzR34b.js → mcp-oauth-7ZYfLtAb.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DHXkg8Ce.js → mcp-oauth-DSndhUBm.js} +1 -1
- package/dist/client/assets/{members-D1907SI-.js → members-CmDYFY4J.js} +1 -1
- package/dist/client/assets/{memory-CaQIwNtK.js → memory-Dc9IJUtC.js} +1 -1
- package/dist/client/assets/{mini-report-page-5Lry2_1Y.js → mini-report-page-CQACEwiO.js} +1 -1
- package/dist/client/assets/{mock-board-Dfc7Zn2k.js → mock-board-Dg4mWd3n.js} +3 -3
- package/dist/client/assets/{monaco-editor-D1yDvJd3.js → monaco-editor-B01xJhQJ.js} +1 -1
- package/dist/client/assets/{monitoring-CvGmGp-w.js → monitoring-BazEB5tH.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C-A-doof.js → monitoring-stats-row-B6BOcziE.js} +1 -1
- package/dist/client/assets/{multi-select-BNUkLp8H.js → multi-select-7hIXxB_M.js} +1 -1
- package/dist/client/assets/{mustache-CksHv2Dr.js → mustache-DIVQnpzp.js} +1 -1
- package/dist/client/assets/{named-rule-uses-BBl065fe.js → named-rule-uses-IzC6F6u2.js} +1 -1
- package/dist/client/assets/{named-rule-view-BXK5sJ8X.js → named-rule-view-DtNzMl0M.js} +1 -1
- package/dist/client/assets/{new-project-dialog-CYkF5k4O.js → new-project-dialog-BT2t_SSj.js} +1 -1
- package/dist/client/assets/{oauth-callback-BPlDpCVw.js → oauth-callback-Do_YigFi.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-C-kNRGr2.js → oauth-callback-ai-provider-C0f_zQCS.js} +1 -1
- package/dist/client/assets/{onboarding-81KXiaqI.js → onboarding-BnkfQtqs.js} +1 -1
- package/dist/client/assets/{openai-conversation-Bi9e1sKc.js → openai-conversation-uf-NaETi.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-CVVwXn2X.js → optimistic-project-sidebar-views-DcAPj08x.js} +1 -1
- package/dist/client/assets/{order-monitor-day-BVSLADXz.js → order-monitor-day-b0dngH-9.js} +1 -1
- package/dist/client/assets/{organization-choice-DmteYBAc.js → organization-choice-C4lluOTa.js} +1 -1
- package/dist/client/assets/{orgs-BFPSbb2q.js → orgs-BCDy4mZz.js} +1 -1
- package/dist/client/assets/{page-seo-form-VA7wIeJU.js → page-seo-form-B1PV8KNM.js} +1 -1
- package/dist/client/assets/{pair-Cjnol9_x.js → pair-B3zvEIIj.js} +1 -1
- package/dist/client/assets/{parse-sections-7Tm_vjpy.js → parse-sections-qa9uMkWq.js} +1 -1
- package/dist/client/assets/{plan-KARVWZDV.js → plan-CQxNZHC8.js} +1 -1
- package/dist/client/assets/{plan-ladder-C-o1aFSi.js → plan-ladder-a4C7BXTB.js} +1 -1
- package/dist/client/assets/{popover-BsX8gIsV.js → popover-4xaDZJbI.js} +1 -1
- package/dist/client/assets/{post-calendar-B6fP7Sp3.js → post-calendar-DNeEjANZ.js} +1 -1
- package/dist/client/assets/{post-editor-B530kxYZ.js → post-editor-DfeVzrAc.js} +1 -1
- package/dist/client/assets/{preview-content-IEhLMW40.js → preview-content-COrzQemh.js} +1 -1
- package/dist/client/assets/{preview-dialog-B8MUF8yg.js → preview-dialog-CChuJR-E.js} +1 -1
- package/dist/client/assets/{preview-panel-C3yGSsCn.js → preview-panel-B4T5VF9k.js} +1 -1
- package/dist/client/assets/preview-tab-nDzq5CI_.js +551 -0
- package/dist/client/assets/{product-picker-dialog-Duu5EFXJ.js → product-picker-dialog-66_ZBd6p.js} +1 -1
- package/dist/client/assets/{profile-SgKnnlOX.js → profile-BoXxRe7I.js} +1 -1
- package/dist/client/assets/{project-app-view-69GUddZy.js → project-app-view-CTZMqjMN.js} +1 -1
- package/dist/client/assets/{project-apps-DxvrGikA.js → project-apps-CFTq1Y-8.js} +1 -1
- package/dist/client/assets/{project-feed-Dkn186cj.js → project-feed-L5bWiY53.js} +1 -1
- package/dist/client/assets/{project-icon-DozUqz8V.js → project-icon-COhPwkM1.js} +1 -1
- package/dist/client/assets/project-reports-DtdDzr3n.js +1 -0
- package/dist/client/assets/project-tasks-CChFXQQd.js +1 -0
- package/dist/client/assets/{projects-BvtnS4il.js → projects-JfCJ9HCR.js} +1 -1
- package/dist/client/assets/{projects-empty-state-Bd8sqs2o.js → projects-empty-state-DyHgWh9N.js} +1 -1
- package/dist/client/assets/{prompts-CfiuzCI2.js → prompts-Cm2D0Z05.js} +1 -1
- package/dist/client/assets/record-editor-2KaA7crX.js +1 -0
- package/dist/client/assets/{redirect-editor-Cq58-dw7.js → redirect-editor-CggwOLDc.js} +1 -1
- package/dist/client/assets/{releases-api-toiaosbq.js → releases-api-GGZ-8Anh.js} +1 -1
- package/dist/client/assets/reports-C15MDy2O.js +1 -0
- package/dist/client/assets/{reports-X-r24zwl.js → reports-CkzVYOoY.js} +1 -1
- package/dist/client/assets/{reports-onboarding-B1eQP37P.js → reports-onboarding-DWlbzUF4.js} +1 -1
- package/dist/client/assets/{reports-tab-BqceAQel.js → reports-tab-BYq7jCB4.js} +2 -2
- package/dist/client/assets/repositories-BMJ80hvj.js +1 -0
- package/dist/client/assets/{repositories-CkzQSY8F.js → repositories-DYf28QZF.js} +1 -1
- package/dist/client/assets/{repository-binding-CiDG0Cr0.js → repository-binding-gq1GBtrT.js} +1 -1
- package/dist/client/assets/{repository-import-picker-TlIvK00I.js → repository-import-picker-C73tcC8B.js} +1 -1
- package/dist/client/assets/{repository-picker-BrjMgENb.js → repository-picker-B8wuJyRa.js} +1 -1
- package/dist/client/assets/{require-capability-D5vaDJ6i.js → require-capability-D7dgUciv.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CLsGddT6.js → required-auth-layout-DZkKYp8M.js} +1 -1
- package/dist/client/assets/{reset-password-BDTPUkZZ.js → reset-password-CfQZGfa5.js} +1 -1
- package/dist/client/assets/{resizable-LNv9WlFU.js → resizable-D1dDtqQL.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-DDEl8WpS.js → resolve-tab-icon-lfySyczb.js} +1 -1
- package/dist/client/assets/{review-settings-CR1udLwz.js → review-settings-Dj-sWMX-.js} +1 -1
- package/dist/client/assets/{roles-DIBxviRh.js → roles-ByQqydIE.js} +1 -1
- package/dist/client/assets/route-CysIWZWk.js +1 -0
- package/dist/client/assets/{route-DiDqKVTg.js → route-DHhUQOhe.js} +1 -1
- package/dist/client/assets/{route-CwE5K4wd.js → route-QYIHXwU7.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-D9HAcpIU.js → runnable-block-editor-B4zh6lba.js} +3 -3
- package/dist/client/assets/{sandbox-lifecycle-context-BKUYq7kP.js → sandbox-lifecycle-context-DloCbbmN.js} +1 -1
- package/dist/client/assets/{schema-BbiQjr1e.js → schema-CPwozgJP.js} +1 -1
- package/dist/client/assets/{schema-6JU3flf4.js → schema-CTTxJoP_.js} +1 -1
- package/dist/client/assets/{scroll-area-CCVLtkoB.js → scroll-area-DiGl8PGX.js} +1 -1
- package/dist/client/assets/{search-input-43leKkGn.js → search-input-CEnhZhls.js} +1 -1
- package/dist/client/assets/{search-toggle-Ds25LhLA.js → search-toggle-CHDTRD6S.js} +1 -1
- package/dist/client/assets/{secret-ciphertext-BrIiDgyd.js → secret-ciphertext-BCK--5Cz.js} +1 -1
- package/dist/client/assets/{secret-picker-aJPnp_F5.js → secret-picker-C7nA9X4N.js} +1 -1
- package/dist/client/assets/{secrets-CfWgVKjc.js → secrets-Ce2i66vs.js} +1 -1
- package/dist/client/assets/{sections-Dvgo02ra.js → sections-bCMUlLuC.js} +1 -1
- package/dist/client/assets/{sections-editor-BSfFPyUU.js → sections-editor-XSwlJ2Cj.js} +1 -1
- package/dist/client/assets/{select-CHmq3OGd.js → select-C-zh4izi.js} +1 -1
- package/dist/client/assets/{select-model-CvpLn49w.js → select-model-BtS81Ntu.js} +1 -1
- package/dist/client/assets/{seo-editor-BQ3pdKQv.js → seo-editor-CIajRMfi.js} +1 -1
- package/dist/client/assets/{separator-vkFvxZ8m.js → separator-DIkWQC_j.js} +1 -1
- package/dist/client/assets/settings-tab-CK_vb6JO.js +1 -0
- package/dist/client/assets/{sheet-C_qetF7d.js → sheet-BGGFeoq4.js} +1 -1
- package/dist/client/assets/{shell-layout-Bb-Bk8Da.js → shell-layout-B-nPBdqh.js} +1 -1
- package/dist/client/assets/{site-draft-actions-GBt56z1o.js → site-draft-actions-DjhWpZtv.js} +1 -1
- package/dist/client/assets/site-draft-view-JHzZFPts.js +2 -0
- package/dist/client/assets/site-editor-DdWjSX_7.js +1 -0
- package/dist/client/assets/{site-editor-toast-Dvaha1qd.js → site-editor-toast-_3UyGVXO.js} +1 -1
- package/dist/client/assets/{skills-CNP2yKUA.js → skills-CQRbtiaU.js} +1 -1
- package/dist/client/assets/{slider-Dt2pZuy0.js → slider-CAxJNhVJ.js} +1 -1
- package/dist/client/assets/{sortable.esm-Dgy_5_Gq.js → sortable.esm-CTCSonzx.js} +1 -1
- package/dist/client/assets/{sso-BwMXXLZ-.js → sso-C3qgAqTV.js} +1 -1
- package/dist/client/assets/{suggestion-DUWht7S9.js → suggestion-BreNkI7w.js} +1 -1
- package/dist/client/assets/{switch-BKqScyl8.js → switch-BhAC9EZR.js} +1 -1
- package/dist/client/assets/{symbol-Bw5pneOj.js → symbol-BNtwIEgn.js} +1 -1
- package/dist/client/assets/{synced-repos-DhRHDr6D.js → synced-repos-DfPDLDas.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-ALHCeulj.js → tab-icon-glyph-BGL6d0vd.js} +1 -1
- package/dist/client/assets/{table-DSiO4Kq6.js → table-COAtImDT.js} +1 -1
- package/dist/client/assets/{tabs-BcHqdI-j.js → tabs-B7U3KLHD.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-CwyY8xOb.js → task-assignee-avatar-DnziWP0c.js} +1 -1
- package/dist/client/assets/{task-board-ICmHlMKj.js → task-board-DEUJ2XLS.js} +1 -1
- package/dist/client/assets/{task-route-SvQTR3TJ.js → task-route-CdSfJVrQ.js} +1 -1
- package/dist/client/assets/{task-status-Dk0B9E0G.js → task-status-C5L321bH.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-vr9mjCEM.js → taskboard-analytics-DWL_sW0h.js} +1 -1
- package/dist/client/assets/tasks-30CPgq9I.js +1 -0
- package/dist/client/assets/{tasks-DUtkLCHD.js → tasks-HKWQm6zE.js} +1 -1
- package/dist/client/assets/{textarea-CTbC00Fo.js → textarea-Cv4TQOKa.js} +1 -1
- package/dist/client/assets/{thread-analytics-CYtiXz-Q.js → thread-analytics-B326k_i6.js} +1 -1
- package/dist/client/assets/{thread-intent-DcKV1aEK.js → thread-intent-jHkZEAkC.js} +1 -1
- package/dist/client/assets/{thread-route-D05ck8nv.js → thread-route-CLZvS5V9.js} +1 -1
- package/dist/client/assets/{thread-route-DlbP9X8e.js → thread-route-CazXc1NZ.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-DXSUCFvU.js → thread-sheet-body-DRJG57mM.js} +1 -1
- package/dist/client/assets/{time-range-picker-cljXExVl.js → time-range-picker-C2pswe5U.js} +1 -1
- package/dist/client/assets/{toggle-group-cK7x-LaG.js → toggle-group-YVE3K8WT.js} +1 -1
- package/dist/client/assets/{tool-namespace-CFMdc33T.js → tool-namespace-B_9TZDnU.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-AJC8O64v.js → toolbar-icon-button-BCVN_LM1.js} +1 -1
- package/dist/client/assets/{tooltip-oRr5C_aw.js → tooltip-GaCwLmrY.js} +1 -1
- package/dist/client/assets/{tooltipContext-DBLuHkF3.js → tooltipContext-CwU4QuBB.js} +1 -1
- package/dist/client/assets/{track-D3xYnfew.js → track-D8i5l6Cn.js} +1 -1
- package/dist/client/assets/{types-BnGn2ply.js → types-dnuqvL8k.js} +1 -1
- package/dist/client/assets/{url-slug-CiQKnf5R.js → url-slug-Q7mUdJTY.js} +1 -1
- package/dist/client/assets/{usage-stats-BFNP5B9b.js → usage-stats-BL4ux2To.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DB7Q0SBY.js → use-ai-providers-5JlPbZUZ.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-DW6Wbxy3.js → use-apply-named-rule-BhihCRUb.js} +1 -1
- package/dist/client/assets/{use-automations-BXbY6ysU.js → use-automations-BgRj8Qi2.js} +1 -1
- package/dist/client/assets/{use-autosave-BB3cf8aT.js → use-autosave-CLzL7buY.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-KA32sUXt.js → use-chat-layout-state-BmbACNVo.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CmSlUOB2.js → use-clock-tick-BT2wKcdE.js} +1 -1
- package/dist/client/assets/{use-connect-companion-Dzb46un3.js → use-connect-companion-BG0eO1j9.js} +1 -1
- package/dist/client/assets/{use-connection-PJ_l98GU.js → use-connection-RsX02h--.js} +1 -1
- package/dist/client/assets/{use-content-sync-9tvG-lut.js → use-content-sync-CfkEzIh9.js} +1 -1
- package/dist/client/assets/{use-copy-D4R9cJ_t.js → use-copy-DURp1qxD.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-cYnUmw5j.js → use-create-virtual-mcp-CAFje7fY.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BgdR-wYC.js → use-date-fns-locale-BQOaedf-.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CL6P-Lri.js → use-debounced-autosave-BTXPrvCH.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BdOjhsVi.js → use-debounced-value-upvagLL0.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DHNd5iXt.js → use-deco-credits-CKkvjPFp.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CDLwP1Su.js → use-decopilot-events-BTx6-qTi.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CkSINryc.js → use-delete-connection-CiYgYxZE.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BZATCf2q.js → use-deployment-admin-vZDJlQ6F.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-CGwz_fku.js → use-fast-preview-draft-url-zBO4zzxr.js} +1 -1
- package/dist/client/assets/{use-file-configs-nRV9S9D0.js → use-file-configs-BhQVXI_M.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-CMEIMGZ6.js → use-inbox-feed-pFcAadCx.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CNz9_Nor.js → use-infinite-scroll-BwdSukxD.js} +1 -1
- package/dist/client/assets/{use-join-requests-oCznfTNy.js → use-join-requests-BIxxkmdF.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-BKmILeUa.js → use-main-panel-tabs-BRdyiq_g.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BlkUCjXO.js → use-mcp-auth-status-BknaNnme.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DKIfKwpJ.js → use-mcp-client-BqYCJLNH.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-MhXPkujh.js → use-mcp-prompts-DDgYwR7u.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CTl2xkGk.js → use-mcp-tools-PibnH1lh.js} +1 -1
- package/dist/client/assets/{use-members-BiXVclqd.js → use-members-DjoUUKip.js} +1 -1
- package/dist/client/assets/{use-mobile-CCkX9zL-.js → use-mobile-DIircfAX.js} +1 -1
- package/dist/client/assets/{use-move-blocks-C6LWTkiD.js → use-move-blocks-CZVHB-Qe.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CEb5-IwU.js → use-navigate-to-agent-ORYVFAbZ.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-D-NQ16Mb.js → use-open-billing-url-DOXR78A2.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-xXOFDOL1.js → use-org-auth-client-CIaaKZte.js} +1 -1
- package/dist/client/assets/{use-org-fs-DRaVeNa6.js → use-org-fs-C7LGz1-C.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-LHzk4Keo.js → use-org-repo-syncs-D94nqbQj.js} +1 -1
- package/dist/client/assets/{use-org-sso-Bx0Susbk.js → use-org-sso-DN4ZiztH.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CbO1bQ_O.js → use-organization-roles-fM-riBuc.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Bf2WDJz9.js → use-organization-settings-CPceHw0I.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-CYYYdsdC.js → use-panel-navigate-D4lLfNFu.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-B2rH_d27.js → use-project-native-view-presence-BvyTsGLr.js} +1 -1
- package/dist/client/assets/{use-project-scope-C66L_LKx.js → use-project-scope-B4y5G2Ei.js} +1 -1
- package/dist/client/assets/{use-recent-apps-DaFNVa3y.js → use-recent-apps-C_8OWGAP.js} +1 -1
- package/dist/client/assets/{use-releases-DwpIDRIp.js → use-releases-DeERsgJz.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-DnLCgooz.js → use-reports-diagnostic-DCvOvl0T.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-CioHBl5Q.js → use-sandbox-events-D8NHRWeu.js} +1 -1
- package/dist/client/assets/{use-secrets-BrDaOgAh.js → use-secrets-BdvIPaij.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DxyD_MVI.js → use-section-preview-base-BvxipU3p.js} +1 -1
- package/dist/client/assets/{use-session-runtime-DgSb1tZ1.js → use-session-runtime-CqcbAAQE.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-Lbn9i3wJ.js → use-sidebar-collapsed-HOr77qXH.js} +1 -1
- package/dist/client/assets/{use-tags-DxXXXYXQ.js → use-tags-Dma5_1PE.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-B_lpE6sk.js → use-task-board-analytics-BurDuxFg.js} +1 -1
- package/dist/client/assets/{use-task-board-events-Ciu9fgM5.js → use-task-board-events-CzPazKvc.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BXiZI60U.js → use-task-board-item-prs-CUp5a2aS.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DXSFycil.js → use-task-metadata-Bp_awmsI.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-BBBfMO-x.js → use-thread-analytics-BoPqG6bS.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-Be0M4DCF.js → use-thread-outputs-BGT_pFPh.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-D_Px4YIv.js +1 -0
- package/dist/client/assets/{useQueries-CjLpsE8j.js → useQueries-aBrIvzTH.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-4o7EP3RX.js +1 -0
- package/dist/client/assets/{users-DhWYm0Ur.js → users-CjdCQhWU.js} +1 -1
- package/dist/client/assets/{utils-BlqF72Vj.js → utils-CdAi3CPI.js} +1 -1
- package/dist/client/assets/{variant-calendar-Z__DuHea.js → variant-calendar-CVabKfKo.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-BcEAaLIA.js → variant-matcher-override-D18mNo8N.js} +1 -1
- package/dist/client/assets/virtual-mcp-6YEjnlwk.js +1 -0
- package/dist/client/assets/{watch-sse-pool-9GQSHr-W.js → watch-sse-pool-FRqOQxvE.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +680 -680
- package/package.json +1 -1
- package/dist/client/assets/agent-analytics-CwuUduKr.js +0 -1
- package/dist/client/assets/agent-app-Dd83t7Jr.js +0 -1
- package/dist/client/assets/agent-calendar-DAFHiZ7t.js +0 -1
- package/dist/client/assets/agent-deck-19EIpeOv.js +0 -1
- package/dist/client/assets/agent-experiments-CDIR-vBl.js +0 -1
- package/dist/client/assets/agent-file-Crkwe1n0.js +0 -1
- package/dist/client/assets/agent-library-6vXi0pmB.js +0 -1
- package/dist/client/assets/agent-library-file-D_31XTpy.js +0 -1
- package/dist/client/assets/agent-monitor-DZGhzZ5b.js +0 -1
- package/dist/client/assets/agent-settings-BJW57Xya.js +0 -1
- package/dist/client/assets/agent-site-editor-code-Dp5l17ta.js +0 -2
- package/dist/client/assets/agent-site-editor-content-BIwmC0as.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-DJt8FppE.js +0 -1
- package/dist/client/assets/agent-view-DuXo8UyN.js +0 -1
- package/dist/client/assets/api-keys-YdF23sAO.js +0 -1
- package/dist/client/assets/app-preview-url-DmK5uokM.js +0 -1
- package/dist/client/assets/cms-settings-editor-VrhsAjtC.js +0 -1
- package/dist/client/assets/library-DC_yyIum.js +0 -1
- package/dist/client/assets/preview-tab-DZ2jzEbi.js +0 -551
- package/dist/client/assets/project-reports-6uzfgJoN.js +0 -1
- package/dist/client/assets/project-tasks-BLcB7Cwc.js +0 -1
- package/dist/client/assets/record-editor-DD-1yqpv.js +0 -1
- package/dist/client/assets/reports-VJqlTUDX.js +0 -1
- package/dist/client/assets/repositories-DRGtDHym.js +0 -1
- package/dist/client/assets/route-CMp29IPi.js +0 -1
- package/dist/client/assets/settings-tab-B_bx6QgP.js +0 -1
- package/dist/client/assets/site-draft-view-CZq-6QXP.js +0 -2
- package/dist/client/assets/site-editor-Dw86EYnX.js +0 -1
- package/dist/client/assets/tasks-DzLAZqT6.js +0 -1
- package/dist/client/assets/useInfiniteQuery-C9OOM3iT.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DC4aZJSW.js +0 -1
- package/dist/client/assets/virtual-mcp-DQmDpfRM.js +0 -1
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-XSwlJ2Cj.js","assets/index-DyYo9Tzb.js","assets/index-BQfNeaI1.css","assets/chat-context-BQpXrVMs.js","assets/use-panel-navigate-D4lLfNFu.js","assets/thread-route-CLZvS5V9.js","assets/use-project-scope-B4y5G2Ei.js","assets/repository-binding-gq1GBtrT.js","assets/use-mcp-client-BqYCJLNH.js","assets/auth-ClNhQHlU.js","assets/autosend-B29qh5n2.js","assets/thread-intent-jHkZEAkC.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-FRqOQxvE.js","assets/task-board-DEUJ2XLS.js","assets/schema-CPwozgJP.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-BTx6-qTi.js","assets/use-ai-providers-5JlPbZUZ.js","assets/location-V0VwTJTt.js","assets/use-organization-settings-CPceHw0I.js","assets/runnable-block-editor-B4zh6lba.js","assets/utils-CdAi3CPI.js","assets/ZoomOut-OMu4FTNj.js","assets/Image01-nc4SHYwM.js","assets/agent-icon-CkduijMR.js","assets/AlertCircle-CM8LBbRI.js","assets/Tool01-kEVQyvkb.js","assets/ArrowUp-BXMfywqx.js","assets/ArrowLeft-o6iMnbNE.js","assets/LinkBroken01-BGVU3ZYB.js","assets/ShoppingBag01-D8V6jyOF.js","assets/Building02-BHRxs6ob.js","assets/CheckCircle-_6kE8J_Y.js","assets/ChevronUp-CzyRtbYf.js","assets/ChevronSelectorVertical-Cxa072WE.js","assets/UserSquare-C9kie61X.js","assets/Copy01-DHQGmb70.js","assets/CreditCard01-h12_eEzi.js","assets/DotsVertical-Bq4P-tWv.js","assets/Globe04-fNWMmp0g.js","assets/SwitchHorizontal01-BkDZFUwe.js","assets/Key01-D-TFQCEV.js","assets/Link01-BXRKhx3s.js","assets/Minus-I9YJmaEA.js","assets/Monitor01-DKMgKH5T.js","assets/Sun-pq7DLIkN.js","assets/Play-DRKKkb6S.js","assets/Plus-BDzIUMmX.js","assets/SearchMd-DaDIzrN6.js","assets/Trash01-C0MTVRPf.js","assets/Upload01-Bzv5xKwk.js","assets/User01-CWMwTWQs.js","assets/Users01-wuFaBjJt.js","assets/XClose-BhvC0HDH.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-B3zvEIIj.js","assets/format-time-Cq80KKvY.js","assets/differenceInSeconds-C3x8sHUj.js","assets/collapsible-CAZdvMIU.js","assets/use-copy-DURp1qxD.js","assets/usage-stats-BL4ux2To.js","assets/tool-namespace-B_9TZDnU.js","assets/form-MT3iZ1Vu.js","assets/label-I4hMcj8q.js","assets/utils-CVEq3hMx.js","assets/markdown-Djk34d4X.js","assets/use-mobile-DIircfAX.js","assets/tooltip-GaCwLmrY.js","assets/index-6KnUwzPl.js","assets/use-clock-tick-BT2wKcdE.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-Bme3JE-4.js","assets/types-dnuqvL8k.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/shell-layout-B-nPBdqh.js","assets/avatar-CFIaQZRf.js","assets/command-BBdqXAPJ.js","assets/index-DnroRdaH.js","assets/integration-icon-DOchPlwn.js","assets/project-icon-COhPwkM1.js","assets/new-project-dialog-BT2t_SSj.js","assets/repository-import-picker-C73tcC8B.js","assets/use-navigate-to-agent-ORYVFAbZ.js","assets/repository-picker-B8wuJyRa.js","assets/useInfiniteQuery-D_Px4YIv.js","assets/infiniteQueryObserver-CuPmu1oh.js","assets/collection-search-cWsbRUjB.js","assets/use-debounced-value-upvagLL0.js","assets/required-auth-layout-DZkKYp8M.js","assets/use-org-sso-DN4ZiztH.js","assets/shell-layout-CE2Eihra.css","assets/sheet-BGGFeoq4.js","assets/use-connection-RsX02h--.js","assets/use-mcp-prompts-DDgYwR7u.js","assets/use-thread-outputs-BGT_pFPh.js","assets/file-type-icon-C1atr-sB.js","assets/secret-ciphertext-BCK--5Cz.js","assets/alert-CQRqIByK.js","assets/parse-sections-qa9uMkWq.js","assets/switch-BhAC9EZR.js","assets/textarea-Cv4TQOKa.js","assets/site-editor-toast-_3UyGVXO.js","assets/use-session-runtime-CqcbAAQE.js","assets/experiments-tab-choice-Z74ukAS5.js","assets/sandbox-url-D3mC8qhT.js","assets/use-sandbox-events-D8NHRWeu.js","assets/sandbox-git-api-CH_-QFpD.js","assets/popover-4xaDZJbI.js","assets/blocks-tab-states-BDili_03.js","assets/slider-CAxJNhVJ.js","assets/index-CWpr_BWP.js","assets/index-BdQq_4o_.js","assets/tooltipContext-CwU4QuBB.js","assets/CategoricalChart-ixJIwUQc.js","assets/index-DIs1KTwD.js","assets/ActiveShapeUtils-DgNRIskl.js","assets/Sector-DgbJAFTT.js","assets/symbol-BNtwIEgn.js","assets/empty-state-p228cI1e.js","assets/scroll-area-DiGl8PGX.js","assets/monaco-editor-B01xJhQJ.js","assets/editor-RlVhV_5_.js","assets/calendar-Dclm8CN2.js","assets/select-C-zh4izi.js","assets/editor-classes-C3bkPxTU.js","assets/core.esm-DlrTVFm2.js","assets/sortable.esm-CTCSonzx.js","assets/toggle-group-YVE3K8WT.js","assets/active-indicator-CCMhAsc_.js","assets/combobox-DDNVNn5C.js","assets/alert-dialog-vz8WFIXE.js","assets/search-input-CEnhZhls.js","assets/tabs-B7U3KLHD.js","assets/use-file-configs-BhQVXI_M.js","assets/asset-utils-DMAyDksX.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/mustache-DIVQnpzp.js","assets/use-section-preview-base-BvxipU3p.js","assets/section-preview-url-7zfngvgW.js","assets/use-members-DjoUUKip.js","assets/use-org-auth-client-CIaaKZte.js","assets/page-seo-form-B1PV8KNM.js","assets/use-apply-named-rule-BhihCRUb.js","assets/use-move-blocks-CZVHB-Qe.js","assets/variant-matcher-override-D18mNo8N.js","assets/variant-draft-pointer-BeAKcq_c.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as ce,j as s,r as T,l as De,b as Pe,B as Me,aG as Xt,aY as it,aH as Ae,q as rr,D as ar,K as ir,s as or,v as lr,e as Sa,h as Ct,I as An,w as Pa,aZ as ja,a2 as Kn,aT as Ea,aW as Na,au as _n,aw as On,a5 as cr,P as Dn,y as Ta,t as Zt,aX as Ca,o as Ra,m as La}from"./index-DyYo9Tzb.js";import{u as dr,g as Aa,c as Ns,B as Pn,P as _a,r as Oa,R as Da,a as Ba,b as ur,S as $a,d as Ma,l as Fa,m as za,e as Ka,f as jn,N as Ia}from"./runnable-block-editor-B4zh6lba.js";import{b as Ua,c as Rt,r as fr,l as pr,f as Ha,g as Va,w as qa}from"./chat-context-BQpXrVMs.js";import{t as Wa}from"./ChevronUp-CzyRtbYf.js";import{T as Ga,U as Ja,M as mr,V as Ya,W as Qa,b as Xa,X as Za,Y as hr,Z as ei,_ as gr,$ as Ts,a0 as ti}from"./agent-icon-CkduijMR.js";import{a as ni,n as si}from"./UserSquare-C9kie61X.js";import{s as vr}from"./Plus-BDzIUMmX.js";import{a as xr,b as br,P as yr}from"./popover-4xaDZJbI.js";import{a as Et,b as Nt,c as wr,d as kr,e as Sr,C as Pr}from"./command-BBdqXAPJ.js";import{c as ri,d as ai,a as ii}from"./repository-binding-gq1GBtrT.js";import{a as Lt}from"./sandbox-lifecycle-context-DloCbbmN.js";import{e as oi}from"./backoff-CrEUbyZT.js";import{r as li}from"./thread-intent-jHkZEAkC.js";import{u as jr}from"./use-session-runtime-CqcbAAQE.js";import{S as Er,d as ci,f as di,i as ui,g as fi,h as pi,j as mi,k as hi,u as nn,l as In,m as at,n as gi,o as vi,q as xi,c as Nr,b as Tr,t as bi,v as He,w as yi,x as wi,y as ki,z as Cs,A as Si,B as Pi,C as Rs,D as ji,E as Ei,e as Ni}from"./site-editor-toast-_3UyGVXO.js";import{u as Cr}from"./use-mobile-DIircfAX.js";import{T as lt,a as ct,c as dt}from"./tooltip-GaCwLmrY.js";import{T as We}from"./toolbar-icon-button-BCVN_LM1.js";import{w as Wt,i as Ti}from"./variant-matcher-override-D18mNo8N.js";import{b as Ci,w as Ls}from"./variant-draft-pointer-BeAKcq_c.js";import{u as Rr,i as Ri,B as Li,S as Ai,C as _i,a as Oi,b as Di,l as Bi,D as $i}from"./blocks-tab-states-BDili_03.js";import{i as Mi,a as Fi,v as zi,b as Ki,s as Tt,n as Un,c as Lr,f as Ve,d as Ar,h as Ii,e as Ui,g as Hi,j as Vi,k as qi,p as Wi,N as Gi,l as Ji,r as Yi,m as As,o as Qi}from"./parse-sections-qa9uMkWq.js";import{r as Xi,D as _s,w as Os,b as Ds,a as Zi}from"./section-preview-url-7zfngvgW.js";import{p as eo,a as to,u as no,b as Bs}from"./use-fast-preview-draft-url-zBO4zzxr.js";import{a as so,c as _r}from"./shell-layout-B-nPBdqh.js";import{u as Hn,b as ro}from"./use-sandbox-events-D8NHRWeu.js";import{u as Bn}from"./useQueries-aBrIvzTH.js";import{i as ao}from"./LinkBroken01-BGVU3ZYB.js";import{u as Or}from"./blocks-preview-workspace-context-oHu98aZe.js";import{MonacoCodeEditor as io}from"./monaco-editor-B01xJhQJ.js";import{d as oo}from"./utils-CdAi3CPI.js";import{R as $s,a as Gt,b as Ms}from"./resizable-D1dDtqQL.js";import{u as lo,a as En}from"./experiments-tab-choice-Z74ukAS5.js";import{w as $n}from"./device-hint-SeLRi17j.js";import{L as co}from"./label-I4hMcj8q.js";import{a as uo,T as Fs}from"./toggle-group-YVE3K8WT.js";import{h as Dr,w as fo,a as zs}from"./preview-link-C762yHOt.js";import{r as po,R as mo}from"./virtual-mcp-6YEjnlwk.js";import{d as ho}from"./delay-CnY5UFtP.js";import{s as Br}from"./XClose-BhvC0HDH.js";import{o as go}from"./omit-sandbox-map-jj4lCB2U.js";import{a as Nn,b as vo,w as xo,n as Ks}from"./app-preview-url-9Od4s8Sz.js";import{a as bo}from"./use-organization-settings-CPceHw0I.js";import{E as yo}from"./empty-state-p228cI1e.js";import{G as Is}from"./repository-picker-B8wuJyRa.js";import{R as wo}from"./repository-import-picker-C73tcC8B.js";import{r as ko}from"./preview-source-BsRLGWUP.js";import{C as So,s as Po,L as jo,R as en,D as Us}from"./secret-ciphertext-BCK--5Cz.js";import{A as Eo,a as No,b as To}from"./alert-CQRqIByK.js";import{u as Co}from"./use-task-metadata-Bp_awmsI.js";function Ro(t){const e=ce.c(10),{waiting:n}=t,r=n?"true":"false";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(Ga,{className:"size-5 sm:size-6"})}),e[0]=i):i=e[0];let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=d):d=e[1];let a;e[2]!==n?(a=n&&s.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]=a):a=e[3];let o;e[4]!==a?(o=s.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[d,a]}),e[4]=a,e[5]=o):o=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(Ja,{className:"size-5 sm:size-6"})}),e[6]=c):c=e[6];let l;return e[7]!==r||e[8]!==o?(l=s.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":r,className:"flex items-center gap-2",children:[i,o,c]}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function Lo(t){const e=ce.c(25),{index:n,numbered:r,step:i,heading:d}=t,a=T.useId();let o;e[0]!==n||e[1]!==r?(o=r&&s.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]=r,e[2]=o):o=e[2];let c;e[3]!==d||e[4]!==a||e[5]!==i.title?(c=s.jsx(d,{id:a,className:"text-sm font-medium text-foreground",children:i.title}),e[3]=d,e[4]=a,e[5]=i.title,e[6]=c):c=e[6];let l;e[7]!==o||e[8]!==c?(l=s.jsxs("div",{className:"flex items-center gap-3",children:[o,c]}),e[7]=o,e[8]=c,e[9]=l):l=e[9];const m=r&&"sm:pl-9";let f;e[10]!==m?(f=De("flex min-w-0 flex-col gap-3",m),e[10]=m,e[11]=f):f=e[11];let p;e[12]!==i.body?(p=i.body&&s.jsx("p",{className:"text-sm text-muted-foreground",children:i.body}),e[12]=i.body,e[13]=p):p=e[13];let x;e[14]!==i.command?(x=i.command&&s.jsx(So,{command:i.command}),e[14]=i.command,e[15]=x):x=e[15];let h;e[16]!==i.after||e[17]!==f||e[18]!==p||e[19]!==x?(h=s.jsxs("div",{className:f,children:[p,x,i.after]}),e[16]=i.after,e[17]=f,e[18]=p,e[19]=x,e[20]=h):h=e[20];let E;return e[21]!==a||e[22]!==l||e[23]!==h?(E=s.jsxs("li",{"aria-labelledby":a,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[l,h]}),e[21]=a,e[22]=l,e[23]=h,e[24]=E):E=e[24],E}const Ao=[];function tn(t){const e=ce.c(20),{title:n,lead:r,waiting:i,alerts:d,steps:a,footer:o,headingLevel:c}=t,l=a===void 0?Ao:a,m=c===void 0?1:c,f=m===1?"h1":"h2",p=i&&l.length===0?"status":void 0;let x;e[0]!==i?(x=s.jsx(Ro,{waiting:i}),e[0]=i,e[1]=x):x=e[1];let h;e[2]!==f||e[3]!==n?(h=s.jsx(f,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:n}),e[2]=f,e[3]=n,e[4]=h):h=e[4];let E;e[5]!==r?(E=r&&s.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:r}),e[5]=r,e[6]=E):E=e[6];let g;e[7]!==p||e[8]!==x||e[9]!==h||e[10]!==E?(g=s.jsxs("header",{role:p,className:"flex flex-col items-center gap-3 text-center",children:[x,h,E]}),e[7]=p,e[8]=x,e[9]=h,e[10]=E,e[11]=g):g=e[11];let y;e[12]!==m||e[13]!==l?(y=l.length>0&&s.jsx("ol",{className:"flex flex-col gap-3",children:l.map((b,v)=>s.jsx(Lo,{index:v+1,numbered:l.length>1,step:b,heading:m===1?"h2":"h3"},b.title))}),e[12]=m,e[13]=l,e[14]=y):y=e[14];let N;return e[15]!==d||e[16]!==o||e[17]!==g||e[18]!==y?(N=s.jsx("div",{className:"h-full w-full overflow-y-auto",children:s.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:[g,d,y,o]})}),e[15]=d,e[16]=o,e[17]=g,e[18]=y,e[19]=N):N=e[19],N}function _o(t){const e=ce.c(55),{wait:n,hosts:r,invalidLink:i}=t,d=i===void 0?!1:i,a=Pe();let o;e[0]!==d||e[1]!==a?(o=d&&s.jsx(Eo,{variant:"warning",children:s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[s.jsx(No,{className:"line-clamp-none text-foreground",children:a("decoServe.link.invalidTitle")}),s.jsx(To,{children:a("decoServe.link.invalidBody")})]})}),e[0]=d,e[1]=a,e[2]=o):o=e[2];const c=o;if(n.kind==="problem"){let C;e[3]!==a||e[4]!==n.host||e[5]!==n.problem?(C=Po(a,n.problem,n.host),e[3]=a,e[4]=n.host,e[5]=n.problem,e[6]=C):C=e[6];const{title:A,body:R}=C;let L;e[7]!==R?(L=s.jsx(en,{text:R}),e[7]=R,e[8]=L):L=e[8];let O;e[9]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Us,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=O):O=e[9];let _;return e[10]!==c||e[11]!==L||e[12]!==A?(_=s.jsx(tn,{headingLevel:2,waiting:!1,title:A,lead:L,alerts:c,footer:O}),e[10]=c,e[11]=L,e[12]=A,e[13]=_):_=e[13],_}const l=n.kind==="looking",m=l&&!n.paused;let f;e[14]!==a?(f=a("decoServe.waiting.title"),e[14]=a,e[15]=f):f=e[15];let p;e[16]!==a?(p=a("decoServe.waiting.lead"),e[16]=a,e[17]=p):p=e[17];let x;e[18]!==c||e[19]!==n.kind?(x=(c||n.kind==="denied")&&s.jsxs(s.Fragment,{children:[c,n.kind==="denied"&&s.jsx(jo,{})]}),e[18]=c,e[19]=n.kind,e[20]=x):x=e[20];let h;e[21]!==a?(h=a("decoServe.guide.step1.title"),e[21]=a,e[22]=h):h=e[22];let E;e[23]!==a?(E=a("decoServe.guide.step1.body"),e[23]=a,e[24]=E):E=e[24];let g;e[25]!==E?(g=s.jsx(en,{text:E}),e[25]=E,e[26]=g):g=e[26];let y;e[27]!==h||e[28]!==g?(y={title:h,body:g,command:Er},e[27]=h,e[28]=g,e[29]=y):y=e[29];let N;e[30]!==a?(N=a("decoServe.waiting.step2.title"),e[30]=a,e[31]=N):N=e[31];let b;e[32]!==a?(b=a("decoServe.waiting.step2.body"),e[32]=a,e[33]=b):b=e[33];let v;e[34]!==r||e[35]!==l||e[36]!==a||e[37]!==n.kind||e[38]!==n.onStart||e[39]!==n.paused?(v=n.kind==="needs-gesture"?s.jsx(Me,{variant:"outline",className:"self-start",onClick:n.onStart,children:a("decoServe.guide.step2.start")}):l&&s.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:n.paused?a("decoServe.guide.step2.paused"):a("decoServe.guide.step2.looking",{hosts:r})}),e[34]=r,e[35]=l,e[36]=a,e[37]=n.kind,e[38]=n.onStart,e[39]=n.paused,e[40]=v):v=e[40];let S;e[41]!==N||e[42]!==b||e[43]!==v?(S={title:N,body:b,after:v},e[41]=N,e[42]=b,e[43]=v,e[44]=S):S=e[44];let j;e[45]!==y||e[46]!==S?(j=[y,S],e[45]=y,e[46]=S,e[47]=j):j=e[47];let k;e[48]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Us,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[48]=k):k=e[48];let P;return e[49]!==j||e[50]!==m||e[51]!==f||e[52]!==p||e[53]!==x?(P=s.jsx(tn,{headingLevel:2,waiting:m,title:f,lead:p,alerts:x,steps:j,footer:k}),e[49]=j,e[50]=m,e[51]=f,e[52]=p,e[53]=x,e[54]=P):P=e[54],P}function Oo(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 Do=15e3,Bo=3e3;function $o(t){const{candidates:e,probe:n,onFound:r,onChange:i,doc:d=document,setTimer:a=(v,S)=>setTimeout(v,S),clearTimer:o=v=>clearTimeout(v),timeoutMs:c=Bo}=t;let l={status:"searching",firstRoundDone:!1,problem:null},m=!1,f=!1,p=0,x=null,h=null;const E=()=>d.visibilityState==="hidden",g=v=>{l={...l,...v},i(l)},y=async v=>{h=new AbortController;const S=h,j=a(()=>S.abort(),c);try{return await n(v,S.signal),!0}catch(k){if(m)return!1;const P=di(k);return P.reason!=="not-answering"?g({problem:{...P,endpoint:v}}):l.problem?.endpoint===v&&g({problem:null}),!1}finally{o(j),h=null}},N=async()=>{if(x=null,!(m||f)){if(e.length===0){g({status:"stopped",firstRoundDone:!0});return}if(E()){g({status:"paused"});return}f=!0,l.status!=="searching"&&g({status:"searching"});for(const v of e){if(m)break;if(await y(v)){if(f=!1,m)return;m=!0,d.removeEventListener("visibilitychange",b),g({status:"found",firstRoundDone:!0}),r(v);return}}if(f=!1,!m){if(p+=1,l.firstRoundDone||g({firstRoundDone:!0}),E()){g({status:"paused"});return}x=a(()=>{N()},ci(p,Do))}}};function b(){if(!m){if(E()){x!==null&&(o(x),x=null),f||g({status:"paused"});return}x!==null&&o(x),p=0,N()}}return d.addEventListener("visibilitychange",b),i(l),N(),()=>{m=!0,x!==null&&o(x),h?.abort(),d.removeEventListener("visibilitychange",b)}}function Mo(t,e){return fi(pi({endpoint:t,fetch:n=>fetch(n,{signal:e})}))}const Fo=["loopback-network","local-network-access"];async function zo(){if(ui(window.location.origin))return null;for(const t of Fo)try{return await navigator.permissions.query({name:t})}catch{}return null}let $r=null,Hs=!1;const Tn=new Set;function Ko(t){if(Tn.add(t),!Hs){Hs=!0;const e=n=>{$r=n;for(const r of Tn)r()};zo().then(n=>{if(!n)return e("unsupported");e(n.state),n.addEventListener("change",()=>e(n.state))})}return()=>Tn.delete(t)}const Io={status:"stopped",firstRoundDone:!1,problem:null},Cn=new Map;function Uo(t){const e=Cn.get(t);if(e)return e;let n={status:"searching",firstRoundDone:!1,problem:null};const r=new Set;let i=null;const d={onFound:()=>{},getSnapshot:()=>n,subscribe:a=>(r.add(a),i??=$o({candidates:t.split(" "),probe:Mo,onFound:o=>d.onFound(o),onChange:o=>{n=o;for(const c of r)c()}}),()=>{r.delete(a),!(r.size>0)&&(i?.(),i=null,Cn.delete(t))})};return Cn.set(t,d),d}function Mr(){return T.useSyncExternalStore(Ko,qs,qs)}const Ho=()=>()=>{},Vs=()=>Io,qs=()=>$r;function $d(t){const e=ce.c(9),{candidates:n,onFound:r}=t,[i,d]=T.useState(!1),a=Mr(),c=(a==="granted"||a==="unsupported"||a==="prompt"&&i)&&n.length>0;let l;e[0]!==c||e[1]!==n||e[2]!==r?(l=c?Uo(n.join(" ")):null,l&&(l.onFound=r),e[0]=c,e[1]=n,e[2]=r,e[3]=l):l=e[3];const m=T.useSyncExternalStore(l?.subscribe??Ho,l?.getSnapshot??Vs,l?.getSnapshot??Vs),f=a==="prompt"&&!i;let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>d(!0),e[4]=p):p=e[4];let x;return e[5]!==a||e[6]!==m||e[7]!==f?(x={state:m,access:a,needsGesture:f,start:p},e[5]=a,e[6]=m,e[7]=f,e[8]=x):x=e[8],x}const Rn={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Vo(t){const{previewState:e,progressStatus:n,fastPreviewActive:r=!1,fastPreviewReady:i=!1,codingSession:d=!1,hostedDraft:a=!1}=t,o=d?null:t.previewServerUrl;return t.deciding?{...Rn,showDecidingLoader:!0}:t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Rn:a&&t.hostedPointerPending&&!i?{...Rn,showDecidingLoader:!0}:r&&i&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:r&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!r&&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 qo=1e4,Wo=1e3,Go=3e4;function Jo({iframeRef:t,src:e,active:n}){const r=T.useRef(0),i=T.useRef(null),d=T.useRef(null),a=T.useRef(e),o=T.useRef(n);a.current=e,o.current=n;const c=()=>{i.current&&clearTimeout(i.current),d.current&&clearTimeout(d.current),i.current=null,d.current=null},l=()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,m()},qo)},m=()=>{if(!o.current||!a.current)return;d.current&&clearTimeout(d.current);const x=oi(Go,Wo,r.current,2,.5);r.current+=1,d.current=setTimeout(()=>{d.current=null;const h=t.current,E=a.current;!h||!E||!o.current||(h.src=E,l())},x)},f=()=>{r.current=0,c()},p=()=>{i.current&&(clearTimeout(i.current),i.current=null),m()};return T.useEffect(()=>{if(c(),r.current=0,!(!n||!e))return l(),c},[e,n]),{handleLoad:f,handleError:p}}const Yo=1500,Qo=500;function Xo({iframe:t,reload:e,waitMs:n=Yo,confirmMs:r=Qo}){let i;const d=()=>{clearTimeout(a),i=setTimeout(e,r)};t.addEventListener("load",d,{once:!0});const a=setTimeout(()=>{t.removeEventListener("load",d),e()},n);return()=>{clearTimeout(a),clearTimeout(i),t.removeEventListener("load",d)}}const Zo=Xt({tag:Ae(),id:Ae(),classes:Ae(),text:Ae(),html:Ae(),manifestKey:Ae().nullable(),componentName:Ae().nullable(),parents:Ae(),url:Ae(),path:Ae(),viewport:Xt({width:it(),height:it()}),position:Xt({x:it(),y:it()})}),el=`(function() {
|
|
3
|
+
if (window.__visualEditorActive) return;
|
|
4
|
+
window.__visualEditorActive = true;
|
|
5
|
+
|
|
6
|
+
var cursorStyle = document.createElement("style");
|
|
7
|
+
cursorStyle.textContent = "* { cursor: default !important; }";
|
|
8
|
+
document.head.appendChild(cursorStyle);
|
|
9
|
+
|
|
10
|
+
var highlight = document.createElement("div");
|
|
11
|
+
highlight.style.cssText = "position:fixed;pointer-events:none;outline:2px solid #a855f7;background:rgba(168,85,247,0.08);border-radius:2px;z-index:2147483647;display:none;";
|
|
12
|
+
document.body.appendChild(highlight);
|
|
13
|
+
|
|
14
|
+
var badge = document.createElement("div");
|
|
15
|
+
badge.style.cssText = "position:fixed;pointer-events:none;background:#a855f7;color:white;font:11px/1 monospace;padding:2px 6px;border-radius:2px;z-index:2147483647;display:none;white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis;";
|
|
16
|
+
document.body.appendChild(badge);
|
|
17
|
+
|
|
18
|
+
var lastTarget = null;
|
|
19
|
+
var rafPending = false;
|
|
20
|
+
var moveHandler = function(e) {
|
|
21
|
+
if (rafPending) return;
|
|
22
|
+
rafPending = true;
|
|
23
|
+
var target = e.target;
|
|
24
|
+
requestAnimationFrame(function() {
|
|
25
|
+
rafPending = false;
|
|
26
|
+
var el = target;
|
|
27
|
+
if (!el || el === highlight || el === badge) return;
|
|
28
|
+
if (el === lastTarget) return;
|
|
29
|
+
lastTarget = el;
|
|
30
|
+
var r = el.getBoundingClientRect();
|
|
31
|
+
highlight.style.display = "block";
|
|
32
|
+
highlight.style.top = r.top + "px";
|
|
33
|
+
highlight.style.left = r.left + "px";
|
|
34
|
+
highlight.style.width = r.width + "px";
|
|
35
|
+
highlight.style.height = r.height + "px";
|
|
36
|
+
var tag = el.tagName.toLowerCase();
|
|
37
|
+
var id = el.id ? "#" + el.id : "";
|
|
38
|
+
var cls = el.className && typeof el.className === "string"
|
|
39
|
+
? "." + el.className.trim().split(/\\s+/).slice(0, 2).join(".")
|
|
40
|
+
: "";
|
|
41
|
+
badge.textContent = tag + id + cls;
|
|
42
|
+
badge.style.display = "block";
|
|
43
|
+
badge.style.top = Math.max(0, r.top - 20) + "px";
|
|
44
|
+
badge.style.left = r.left + "px";
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
document.addEventListener("mousemove", moveHandler, true);
|
|
48
|
+
|
|
49
|
+
var outHandler = function(e) {
|
|
50
|
+
if (!e.relatedTarget || e.relatedTarget === document.documentElement) {
|
|
51
|
+
highlight.style.display = "none";
|
|
52
|
+
badge.style.display = "none";
|
|
53
|
+
lastTarget = null;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
document.addEventListener("mouseout", outHandler, true);
|
|
57
|
+
|
|
58
|
+
var clickHandler = function(e) {
|
|
59
|
+
e.preventDefault();
|
|
60
|
+
e.stopImmediatePropagation();
|
|
61
|
+
var el = e.target;
|
|
62
|
+
if (!el || el === highlight || el === badge) return;
|
|
63
|
+
|
|
64
|
+
highlight.style.outline = "2px solid #a855f7";
|
|
65
|
+
highlight.style.background = "rgba(168,85,247,0.15)";
|
|
66
|
+
setTimeout(function() {
|
|
67
|
+
highlight.style.outline = "2px solid #a855f7";
|
|
68
|
+
highlight.style.background = "rgba(168,85,247,0.08)";
|
|
69
|
+
}, 400);
|
|
70
|
+
|
|
71
|
+
var tag = el.tagName.toLowerCase();
|
|
72
|
+
var id = el.id || "";
|
|
73
|
+
var classes = el.className && typeof el.className === "string" ? el.className.trim() : "";
|
|
74
|
+
var text = (el.textContent || "").trim().slice(0, 200);
|
|
75
|
+
var html = (el.outerHTML || "").slice(0, 800).replace(/\\svalue=("[^"]*"|'[^']*'|\\S+)/gi, "");
|
|
76
|
+
|
|
77
|
+
var closestSection = el.closest("section[data-manifest-key]");
|
|
78
|
+
var manifestKey = closestSection ? closestSection.getAttribute("data-manifest-key") : null;
|
|
79
|
+
|
|
80
|
+
var ancestor = el;
|
|
81
|
+
var componentName = null;
|
|
82
|
+
for (var i = 0; i < 10 && ancestor; i++) {
|
|
83
|
+
if (ancestor.dataset) componentName = ancestor.dataset.componentName || componentName;
|
|
84
|
+
ancestor = ancestor.parentElement;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
var parents = [];
|
|
88
|
+
var p = el.parentElement;
|
|
89
|
+
for (var j = 0; j < 4 && p && p !== document.body; j++) {
|
|
90
|
+
var pTag = p.tagName ? p.tagName.toLowerCase() : "";
|
|
91
|
+
var pId = p.id ? "#" + p.id : "";
|
|
92
|
+
var pCls = p.className && typeof p.className === "string"
|
|
93
|
+
? "." + p.className.trim().split(/\\s+/)[0]
|
|
94
|
+
: "";
|
|
95
|
+
parents.unshift(pTag + pId + pCls);
|
|
96
|
+
p = p.parentElement;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
window.parent.postMessage({
|
|
100
|
+
type: "visual-editor::element-clicked",
|
|
101
|
+
payload: {
|
|
102
|
+
tag: tag, id: id, classes: classes, text: text, html: html,
|
|
103
|
+
manifestKey: manifestKey, componentName: componentName,
|
|
104
|
+
parents: parents.join(" > "),
|
|
105
|
+
url: window.location.href, path: window.location.pathname,
|
|
106
|
+
viewport: { width: window.innerWidth, height: window.innerHeight },
|
|
107
|
+
position: { x: Math.round(e.clientX), y: Math.round(e.clientY) }
|
|
108
|
+
}
|
|
109
|
+
}, "*");
|
|
110
|
+
};
|
|
111
|
+
document.addEventListener("click", clickHandler, true);
|
|
112
|
+
|
|
113
|
+
window.addEventListener("message", function(e) {
|
|
114
|
+
// Only Studio's own postMessage (source === this frame's parent) may drive the bridge — a nested/downstream frame's forged message can't deactivate the editor.
|
|
115
|
+
if (e.source !== window.parent) return;
|
|
116
|
+
// Parent-driven clear: the cross-origin iframe can't self-detect a frame exit.
|
|
117
|
+
if (e.data && e.data.type === "visual-editor::clear-hover") {
|
|
118
|
+
highlight.style.display = "none";
|
|
119
|
+
badge.style.display = "none";
|
|
120
|
+
lastTarget = null;
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (e.data && e.data.type === "visual-editor::deactivate") {
|
|
124
|
+
highlight.remove();
|
|
125
|
+
badge.remove();
|
|
126
|
+
cursorStyle.remove();
|
|
127
|
+
document.removeEventListener("mousemove", moveHandler, true);
|
|
128
|
+
document.removeEventListener("mouseout", outHandler, true);
|
|
129
|
+
document.removeEventListener("click", clickHandler, true);
|
|
130
|
+
window.__visualEditorActive = false;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
})();`;function tl(t,e){const n=t.map(()=>null),r=[];for(let p=0;p<t.length;p++)t[p]!==null&&r.push(p);const i=r.length,d=e.length;if(!i||!d)return n;const a=(p,x)=>{const h=t[r[p]??0];return!h||!h.length?1:h.indexOf(e[x]??"")>=0?2:0},o=[],c=[];for(let p=0;p<=i;p++)o.push(new Array(d+1).fill(0)),c.push(new Array(d+1).fill(2));for(let p=1;p<=i;p++){const x=o[p-1]??[],h=o[p]??[],E=c[p]??[];for(let g=1;g<=d;g++){let y=x[g]??0,N=2;const b=h[g-1]??0;b>y&&(y=b,N=0);const v=a(p-1,g-1),S=(x[g-1]??0)+v;v>0&&S>y&&(y=S,N=1),h[g]=y,E[g]=N}}let l=0,m=i,f=d;for(;m>0&&f>0;){const p=c[m]?.[f]??2;p===1?(n[r[m-1]??0]=f-1,l++,m--,f--):p===0?f--:m--}if(l===0&&d===i)for(let p=0;p<i;p++)n[r[p]??0]=p;return n}const nl=Xt({sectionIndex:it(),manifestKey:Ae(),clickSeq:it()}),Ws=`(function() {
|
|
134
|
+
if (window.__cmsEditorActive) return;
|
|
135
|
+
window.__cmsEditorActive = true;
|
|
136
|
+
|
|
137
|
+
// Preserve scroll across variant-override navigations and save-reloads.
|
|
138
|
+
// Selecting a variant rebuilds the iframe src (new x-deco-matchers-override)
|
|
139
|
+
// or reloads it, which would otherwise jump to the top. We persist the scroll
|
|
140
|
+
// offset to sessionStorage (survives reload, same-origin) keyed by pathname
|
|
141
|
+
// (the override only changes the query, so the key is stable), then restore it
|
|
142
|
+
// on the next load — retried for ~1s so it outlasts re-hydration and lazy
|
|
143
|
+
// sections that grow the page after load. The recency guard avoids restoring a
|
|
144
|
+
// stale offset on a genuinely fresh visit.
|
|
145
|
+
var SCROLL_KEY = "__cms_preview_scroll:" + location.pathname;
|
|
146
|
+
var saveScroll = function() {
|
|
147
|
+
try {
|
|
148
|
+
sessionStorage.setItem(SCROLL_KEY, JSON.stringify({
|
|
149
|
+
x: window.scrollX, y: window.scrollY, t: Date.now()
|
|
150
|
+
}));
|
|
151
|
+
} catch (_) {}
|
|
152
|
+
};
|
|
153
|
+
var saveScrollPending = false;
|
|
154
|
+
window.addEventListener("scroll", function() {
|
|
155
|
+
if (saveScrollPending) return;
|
|
156
|
+
saveScrollPending = true;
|
|
157
|
+
requestAnimationFrame(function() { saveScrollPending = false; saveScroll(); });
|
|
158
|
+
}, { passive: true });
|
|
159
|
+
(function restoreScroll() {
|
|
160
|
+
var raw = null;
|
|
161
|
+
try { raw = sessionStorage.getItem(SCROLL_KEY); } catch (_) {}
|
|
162
|
+
if (!raw) return;
|
|
163
|
+
var saved = null;
|
|
164
|
+
try { saved = JSON.parse(raw); } catch (_) { return; }
|
|
165
|
+
if (!saved || (Date.now() - saved.t) > 10000) return;
|
|
166
|
+
if (!saved.x && !saved.y) return;
|
|
167
|
+
var attempts = 0;
|
|
168
|
+
var apply = function() {
|
|
169
|
+
attempts++;
|
|
170
|
+
window.scrollTo(saved.x || 0, saved.y || 0);
|
|
171
|
+
if (attempts < 8) setTimeout(apply, 120);
|
|
172
|
+
};
|
|
173
|
+
apply();
|
|
174
|
+
})();
|
|
175
|
+
|
|
176
|
+
var highlight = document.createElement("div");
|
|
177
|
+
highlight.style.cssText = "position:absolute;pointer-events:none;outline:2px solid #06b6d4;background:rgba(6,182,212,0.06);border-radius:2px;z-index:2147483647;display:none;";
|
|
178
|
+
document.body.appendChild(highlight);
|
|
179
|
+
|
|
180
|
+
var badge = document.createElement("div");
|
|
181
|
+
badge.style.cssText = "position:absolute;pointer-events:none;background:#06b6d4;color:white;font:11px/1 monospace;padding:2px 6px;border-radius:2px;z-index:2147483647;display:none;white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis;";
|
|
182
|
+
document.body.appendChild(badge);
|
|
183
|
+
|
|
184
|
+
var isTopLevelSection = function(el) {
|
|
185
|
+
return el && el.parentElement
|
|
186
|
+
? !el.parentElement.closest("section[data-manifest-key]")
|
|
187
|
+
: true;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
// All top-level page sections in DOM order (deco renders page sections as
|
|
191
|
+
// <section data-manifest-key>; nested islands/sections carry the attribute
|
|
192
|
+
// too, hence the top-level filter). This is the full DOM run, framework
|
|
193
|
+
// sections included — getAllSections() narrows it to the editable window.
|
|
194
|
+
var topLevelSections = function() {
|
|
195
|
+
return Array.from(document.querySelectorAll("section[data-manifest-key]"))
|
|
196
|
+
.filter(isTopLevelSection);
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
// Acceptable DOM keys per section; [] = wildcard, null = renders nothing.
|
|
200
|
+
var sectionCandidates = [];
|
|
201
|
+
|
|
202
|
+
// Stringified from section-alignment.ts so both sides share one copy.
|
|
203
|
+
var alignSections = ${tl.toString()};
|
|
204
|
+
|
|
205
|
+
// Indexed like the decofile array; unmapped entries stay null (not clickable).
|
|
206
|
+
var computeAlignment = function(tops) {
|
|
207
|
+
var domKeys = tops.map(function(s) { return s.getAttribute("data-manifest-key"); });
|
|
208
|
+
return alignSections(sectionCandidates, domKeys).map(function(idx) {
|
|
209
|
+
return idx === null ? null : tops[idx];
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// Editable sections, indexed to match the decofile array the panel uses.
|
|
214
|
+
// Recomputed from the live DOM each call (cheap, rAF-throttled) so it
|
|
215
|
+
// self-heals as client-rendered/lazy sections mount. Until the editor sends
|
|
216
|
+
// candidates, fall back to the full top-level run.
|
|
217
|
+
var getAllSections = function() {
|
|
218
|
+
var tops = topLevelSections();
|
|
219
|
+
return sectionCandidates.length ? computeAlignment(tops) : tops;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
// Resolve to the OUTERMOST page-level section (clicking nested content still
|
|
223
|
+
// maps to the top-level section the panel indexes); null if it isn't in the
|
|
224
|
+
// aligned editable set (a framework section deco injected).
|
|
225
|
+
var findSection = function(el, out) {
|
|
226
|
+
var node = el;
|
|
227
|
+
var found = null;
|
|
228
|
+
while (node && node !== document.body) {
|
|
229
|
+
if (node.tagName === "SECTION" && node.hasAttribute && node.hasAttribute("data-manifest-key")) {
|
|
230
|
+
found = node;
|
|
231
|
+
}
|
|
232
|
+
node = node.parentElement;
|
|
233
|
+
}
|
|
234
|
+
if (!found) return null;
|
|
235
|
+
var sections = getAllSections();
|
|
236
|
+
if (out) out.sections = sections;
|
|
237
|
+
return sections.indexOf(found) >= 0 ? found : null;
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
// A Lazy wrapper's key is just the loader — show the inner section's instead.
|
|
241
|
+
var LAZY_KEYS = [
|
|
242
|
+
"website/sections/Rendering/Lazy.tsx",
|
|
243
|
+
"website/sections/Rendering/SingleDeferred.tsx"
|
|
244
|
+
];
|
|
245
|
+
var isLazyKey = function(key) {
|
|
246
|
+
return LAZY_KEYS.some(function(s) { return key.endsWith(s); });
|
|
247
|
+
};
|
|
248
|
+
var displayKey = function(section) {
|
|
249
|
+
var key = section.getAttribute("data-manifest-key") || "section";
|
|
250
|
+
if (isLazyKey(key)) {
|
|
251
|
+
var inner = section.querySelector("section[data-manifest-key]");
|
|
252
|
+
if (inner) return inner.getAttribute("data-manifest-key") || key;
|
|
253
|
+
}
|
|
254
|
+
return key;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
// Per-section metadata sent by the editor, aligned by index with
|
|
258
|
+
// getAllSections(). labels: names the DOM can't carry (a global section or a
|
|
259
|
+
// global inside async rendering); kinds: section type that drives the color.
|
|
260
|
+
var sectionLabels = [];
|
|
261
|
+
var sectionKinds = [];
|
|
262
|
+
var labelFor = function(section, sections) {
|
|
263
|
+
var idx = (sections || getAllSections()).indexOf(section);
|
|
264
|
+
if (idx >= 0 && sectionLabels[idx]) return sectionLabels[idx];
|
|
265
|
+
return displayKey(section);
|
|
266
|
+
};
|
|
267
|
+
var kindFor = function(section, sections) {
|
|
268
|
+
var idx = (sections || getAllSections()).indexOf(section);
|
|
269
|
+
return (idx >= 0 && sectionKinds[idx]) || "normal";
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
// Highlight palette by section kind: global = light purple, variant = green,
|
|
273
|
+
// normal = blue.
|
|
274
|
+
var COLORS = {
|
|
275
|
+
normal: { solid: "#06b6d4", bg: "rgba(6,182,212,0.06)", active: "rgba(6,182,212,0.18)" },
|
|
276
|
+
global: { solid: "#c084fc", bg: "rgba(192,132,252,0.10)", active: "rgba(192,132,252,0.22)" },
|
|
277
|
+
variant: { solid: "#22c55e", bg: "rgba(34,197,94,0.08)", active: "rgba(34,197,94,0.20)" }
|
|
278
|
+
};
|
|
279
|
+
var applyColor = function(kind) {
|
|
280
|
+
var c = COLORS[kind] || COLORS.normal;
|
|
281
|
+
highlight.style.outline = "2px solid " + c.solid;
|
|
282
|
+
highlight.style.background = c.bg;
|
|
283
|
+
badge.style.background = c.solid;
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
var lastSection = null;
|
|
287
|
+
var lastLabel = "";
|
|
288
|
+
var lastKind = "normal";
|
|
289
|
+
var rafPending = false;
|
|
290
|
+
// True while an in-place render fetch/swap is in flight; suppresses hover so it can't re-show the overlay right before the swap snapshots it.
|
|
291
|
+
var renderPending = false;
|
|
292
|
+
|
|
293
|
+
// Document-relative coordinates (rect + scroll) on absolutely-positioned
|
|
294
|
+
// nodes, so the browser scrolls the highlight together with the page
|
|
295
|
+
// natively — no per-frame JS repositioning, no scroll lag.
|
|
296
|
+
var positionHighlight = function(section) {
|
|
297
|
+
var r = section.getBoundingClientRect();
|
|
298
|
+
var top = r.top + window.scrollY;
|
|
299
|
+
var left = r.left + window.scrollX;
|
|
300
|
+
highlight.style.display = "block";
|
|
301
|
+
highlight.style.top = top + "px";
|
|
302
|
+
highlight.style.left = left + "px";
|
|
303
|
+
highlight.style.width = r.width + "px";
|
|
304
|
+
highlight.style.height = r.height + "px";
|
|
305
|
+
badge.textContent = lastLabel || displayKey(section);
|
|
306
|
+
badge.style.display = "block";
|
|
307
|
+
badge.style.top = Math.max(0, top - 20) + "px";
|
|
308
|
+
badge.style.left = left + "px";
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
var moveHandler = function(e) {
|
|
312
|
+
if (renderPending || rafPending) return;
|
|
313
|
+
rafPending = true;
|
|
314
|
+
var target = e.target;
|
|
315
|
+
requestAnimationFrame(function() {
|
|
316
|
+
rafPending = false;
|
|
317
|
+
if (renderPending) return;
|
|
318
|
+
if (!target || target === highlight || target === badge) return;
|
|
319
|
+
var out = {};
|
|
320
|
+
var section = findSection(target, out);
|
|
321
|
+
if (section === lastSection) return;
|
|
322
|
+
lastSection = section;
|
|
323
|
+
if (!section) {
|
|
324
|
+
highlight.style.display = "none";
|
|
325
|
+
badge.style.display = "none";
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
lastLabel = labelFor(section, out.sections);
|
|
329
|
+
lastKind = kindFor(section, out.sections);
|
|
330
|
+
applyColor(lastKind);
|
|
331
|
+
positionHighlight(section);
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
document.addEventListener("mousemove", moveHandler, true);
|
|
335
|
+
|
|
336
|
+
// Window scroll is handled natively by the absolute positioning above; this
|
|
337
|
+
// only re-syncs on resize and on scrolls inside nested scroll containers
|
|
338
|
+
// (capture=true catches those), where document coordinates do shift.
|
|
339
|
+
var reposition = function() {
|
|
340
|
+
if (!lastSection || highlight.style.display === "none") return;
|
|
341
|
+
if (rafPending) return;
|
|
342
|
+
rafPending = true;
|
|
343
|
+
requestAnimationFrame(function() {
|
|
344
|
+
rafPending = false;
|
|
345
|
+
if (lastSection && highlight.style.display !== "none") positionHighlight(lastSection);
|
|
346
|
+
});
|
|
347
|
+
};
|
|
348
|
+
window.addEventListener("scroll", reposition, { capture: true, passive: true });
|
|
349
|
+
window.addEventListener("resize", reposition, { passive: true });
|
|
350
|
+
|
|
351
|
+
var outHandler = function(e) {
|
|
352
|
+
if (!e.relatedTarget || e.relatedTarget === document.documentElement) {
|
|
353
|
+
highlight.style.display = "none";
|
|
354
|
+
badge.style.display = "none";
|
|
355
|
+
lastSection = null;
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
document.addEventListener("mouseout", outHandler, true);
|
|
359
|
+
|
|
360
|
+
var clickSeq = 0;
|
|
361
|
+
|
|
362
|
+
// Blocks observes clicks to select sections in the side panel; it must not
|
|
363
|
+
// cancel the iframe page's own handlers or native control behavior.
|
|
364
|
+
var clickHandler = function(e) {
|
|
365
|
+
var target = e.target;
|
|
366
|
+
if (!target || target === highlight || target === badge) return;
|
|
367
|
+
var out = {};
|
|
368
|
+
var section = findSection(target, out);
|
|
369
|
+
if (!section) return;
|
|
370
|
+
|
|
371
|
+
var sectionIndex = out.sections.indexOf(section);
|
|
372
|
+
var manifestKey = section.getAttribute("data-manifest-key") || "";
|
|
373
|
+
|
|
374
|
+
var c = COLORS[lastKind] || COLORS.normal;
|
|
375
|
+
highlight.style.outline = "2px solid " + c.solid;
|
|
376
|
+
highlight.style.background = c.active;
|
|
377
|
+
setTimeout(function() {
|
|
378
|
+
highlight.style.background = c.bg;
|
|
379
|
+
}, 400);
|
|
380
|
+
|
|
381
|
+
clickSeq++;
|
|
382
|
+
window.parent.postMessage({
|
|
383
|
+
type: "cms-editor::section-clicked",
|
|
384
|
+
payload: { sectionIndex: sectionIndex, manifestKey: manifestKey, clickSeq: clickSeq }
|
|
385
|
+
}, "*");
|
|
386
|
+
};
|
|
387
|
+
document.addEventListener("click", clickHandler, true);
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Navigation is disabled while editing: leaving the page would leave the
|
|
391
|
+
* panel editing the previous page's sections. Only the default action of a
|
|
392
|
+
* real navigation is cancelled, never propagation — in-page controls must
|
|
393
|
+
* keep working (#5567).
|
|
394
|
+
*/
|
|
395
|
+
var isNavigatingAnchor = function(a) {
|
|
396
|
+
if (!a) return false;
|
|
397
|
+
var href = a.getAttribute("href");
|
|
398
|
+
if (!href) return false;
|
|
399
|
+
var trimmed = href.trim();
|
|
400
|
+
if (!trimmed || trimmed.charAt(0) === "#") return false;
|
|
401
|
+
if (/^javascript:/i.test(trimmed)) return false;
|
|
402
|
+
// Same document + fragment only scrolls.
|
|
403
|
+
try {
|
|
404
|
+
var url = new URL(a.href, location.href);
|
|
405
|
+
if (url.href.split("#")[0] === location.href.split("#")[0]) return false;
|
|
406
|
+
} catch (_) {}
|
|
407
|
+
return true;
|
|
408
|
+
};
|
|
409
|
+
var navBlocker = function(e) {
|
|
410
|
+
var el = e.target;
|
|
411
|
+
var a = el && el.closest ? el.closest("a") : null;
|
|
412
|
+
if (!isNavigatingAnchor(a)) return;
|
|
413
|
+
e.preventDefault();
|
|
414
|
+
};
|
|
415
|
+
document.addEventListener("click", navBlocker, true);
|
|
416
|
+
|
|
417
|
+
var submitBlocker = function(e) { e.preventDefault(); };
|
|
418
|
+
document.addEventListener("submit", submitBlocker, true);
|
|
419
|
+
|
|
420
|
+
// Fast Preview in-place render: POST merged decofile to /live/previews, swap the HTML in (document/window listeners survive; overlay nodes get re-attached).
|
|
421
|
+
var renderCtrl = null;
|
|
422
|
+
var renderQueue = Promise.resolve();
|
|
423
|
+
var TRANSITION_TAG =
|
|
424
|
+
"<style id=\\"deco-disable-transitions\\">* { transition: none !important; }</style></head>";
|
|
425
|
+
|
|
426
|
+
// A skipped view transition rejects its promises with "AbortError:
|
|
427
|
+
// Transition was skipped"; nobody else waits on them, so they are settled
|
|
428
|
+
// here rather than left as uncaught errors in the page's console.
|
|
429
|
+
var settleTransition = function(vt) {
|
|
430
|
+
if (!vt) return;
|
|
431
|
+
var ignore = function() {};
|
|
432
|
+
if (vt.ready) vt.ready.catch(ignore);
|
|
433
|
+
if (vt.updateCallbackDone) vt.updateCallbackDone.catch(ignore);
|
|
434
|
+
if (vt.finished) vt.finished.catch(ignore);
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
// A site that opts into cross-document view transitions
|
|
438
|
+
// (@view-transition { navigation: auto }) gets one on every reload a save
|
|
439
|
+
// makes. When the next save navigates the frame before that transition
|
|
440
|
+
// starts, the browser skips it and rejects the outgoing page's ready
|
|
441
|
+
// promise, which only a pageswap listener can reach. Kept after deactivate:
|
|
442
|
+
// settling changes nothing else, and the frame may still navigate.
|
|
443
|
+
if (!window.__cmsEditorPageSwap) {
|
|
444
|
+
window.__cmsEditorPageSwap = true;
|
|
445
|
+
window.addEventListener("pageswap", function(e) {
|
|
446
|
+
settleTransition(e.viewTransition);
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// A quick second save skips the running transition. Only finished says
|
|
451
|
+
// when the swap is over, so the chain waits on it; the rest is settled.
|
|
452
|
+
var runSwapTransition = function(swap) {
|
|
453
|
+
if (typeof document.startViewTransition !== "function") {
|
|
454
|
+
swap();
|
|
455
|
+
return Promise.resolve();
|
|
456
|
+
}
|
|
457
|
+
var vt = document.startViewTransition(swap);
|
|
458
|
+
settleTransition(vt);
|
|
459
|
+
return vt.finished;
|
|
460
|
+
};
|
|
461
|
+
var renderInPlace = function(src, body) {
|
|
462
|
+
if (renderCtrl) renderCtrl.abort();
|
|
463
|
+
var ctrl = new AbortController();
|
|
464
|
+
renderCtrl = ctrl;
|
|
465
|
+
renderPending = true;
|
|
466
|
+
highlight.style.display = "none";
|
|
467
|
+
badge.style.display = "none";
|
|
468
|
+
window.parent.postMessage({ type: "cms-editor::render-start" }, "*");
|
|
469
|
+
renderQueue = renderQueue.then(function() {
|
|
470
|
+
return fetch(src, {
|
|
471
|
+
method: "POST",
|
|
472
|
+
body: body,
|
|
473
|
+
signal: ctrl.signal,
|
|
474
|
+
headers: { accept: "text/html", "content-type": "application/json" }
|
|
475
|
+
}).then(function(res) {
|
|
476
|
+
if (!res.ok) throw new Error("render " + res.status);
|
|
477
|
+
return res.text();
|
|
478
|
+
}).then(function(html) {
|
|
479
|
+
var swap = function() {
|
|
480
|
+
document.documentElement.innerHTML = html.replace("</head>", TRANSITION_TAG);
|
|
481
|
+
document.body.appendChild(highlight);
|
|
482
|
+
document.body.appendChild(badge);
|
|
483
|
+
// Old section is gone; hide the overlay until the next hover repositions it.
|
|
484
|
+
highlight.style.display = "none";
|
|
485
|
+
badge.style.display = "none";
|
|
486
|
+
lastSection = null;
|
|
487
|
+
};
|
|
488
|
+
var headHtml = html.slice(html.indexOf("<head>"), html.indexOf("</head>") + 7);
|
|
489
|
+
var doc = new DOMParser().parseFromString(headHtml, "text/html");
|
|
490
|
+
var sheets = Array.prototype.map.call(
|
|
491
|
+
doc.head.querySelectorAll("link[rel=\\"stylesheet\\"]"),
|
|
492
|
+
function(el) { return el.href ? fetch(el.href).catch(function() {}) : null; }
|
|
493
|
+
);
|
|
494
|
+
return Promise.all(sheets).then(function() {
|
|
495
|
+
return runSwapTransition(swap);
|
|
496
|
+
});
|
|
497
|
+
}).then(function() {
|
|
498
|
+
var t = document.getElementById("deco-disable-transitions");
|
|
499
|
+
if (t) t.remove();
|
|
500
|
+
if (ctrl === renderCtrl) renderPending = false;
|
|
501
|
+
window.parent.postMessage({ type: "cms-editor::render-end" }, "*");
|
|
502
|
+
}).catch(function(err) {
|
|
503
|
+
if (ctrl === renderCtrl) renderPending = false;
|
|
504
|
+
if (err && err.name === "AbortError") return;
|
|
505
|
+
window.parent.postMessage({ type: "cms-editor::render-error" }, "*");
|
|
506
|
+
});
|
|
507
|
+
});
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
window.addEventListener("message", function(e) {
|
|
511
|
+
// Only Studio's own postMessage (source === this frame's parent) may drive the bridge — forged senders can't trigger the render fetch/swap.
|
|
512
|
+
if (e.source !== window.parent) return;
|
|
513
|
+
if (e.data && e.data.type === "cms-editor::render" && typeof e.data.src === "string") {
|
|
514
|
+
renderInPlace(e.data.src, e.data.body);
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
if (e.data && e.data.type === "cms-editor::set-labels" && Array.isArray(e.data.labels)) {
|
|
518
|
+
sectionLabels = e.data.labels;
|
|
519
|
+
if (Array.isArray(e.data.kinds)) sectionKinds = e.data.kinds;
|
|
520
|
+
if (Array.isArray(e.data.keys)) sectionCandidates = e.data.keys;
|
|
521
|
+
if (lastSection) {
|
|
522
|
+
lastLabel = labelFor(lastSection);
|
|
523
|
+
lastKind = kindFor(lastSection);
|
|
524
|
+
applyColor(lastKind);
|
|
525
|
+
if (highlight.style.display !== "none") positionHighlight(lastSection);
|
|
526
|
+
}
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
// Parent-driven clear: the cross-origin iframe can't self-detect a frame exit.
|
|
530
|
+
if (e.data && e.data.type === "cms-editor::clear-hover") {
|
|
531
|
+
highlight.style.display = "none";
|
|
532
|
+
badge.style.display = "none";
|
|
533
|
+
lastSection = null;
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
if (e.data && e.data.type === "cms-editor::deactivate") {
|
|
537
|
+
highlight.remove();
|
|
538
|
+
badge.remove();
|
|
539
|
+
document.removeEventListener("mousemove", moveHandler, true);
|
|
540
|
+
document.removeEventListener("mouseout", outHandler, true);
|
|
541
|
+
document.removeEventListener("click", clickHandler, true);
|
|
542
|
+
// Or the page stays unnavigable after leaving Blocks mode.
|
|
543
|
+
document.removeEventListener("click", navBlocker, true);
|
|
544
|
+
document.removeEventListener("submit", submitBlocker, true);
|
|
545
|
+
window.removeEventListener("scroll", reposition, { capture: true });
|
|
546
|
+
window.removeEventListener("resize", reposition);
|
|
547
|
+
window.__cmsEditorActive = false;
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
})();`;function Mn(t,e,n=!1){let r=t,i=typeof r?.__resolveType=="string"?r.__resolveType:"";for(let d=0;i&&d<5;d++){const a=e[i];if(a&&typeof a=="object"&&"__resolveType"in a){const o=a.__resolveType;if(typeof o=="string"&&o&&o!==i){r=a,i=o;continue}}break}if(!i)return[];if(i.includes("flags/multivariate")||n&&Mi(i,n)){const d=Array.isArray(r.variants)?r.variants:[];if(d.length===0||d.every(c=>{const l=c?.rule;return Fi(l?.__resolveType,n)}))return null;const o=[];for(const c of d){const l=zi(c,n);if(l&&typeof l=="object")for(const m of Mn(l,e,n)??[])o.includes(m)||o.push(m)}return o}if(Ki(i)){const d=r.section&&typeof r.section=="object"?Mn(r.section,e,n):[];return d===null?null:d.length?[i,...d]:[i]}return[i]}function rt(t){return t.replace(/[`*_]/g,"\\$&")}function sl(t,e){const n=[`The user selected an element on the live preview and asked: **"${rt(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:** \`${rt(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 r=`<${t.tag}${t.classes?` class="${rt(t.classes)}"`:""}>`;n.push(`**Clicked element:** \`${r}\``),t.parents&&n.push(`**DOM breadcrumb:** ${rt(t.parents)} > ${t.tag}`),t.text&&n.push(`**Text content:** "${rt(t.text)}"`),t.componentName&&n.push(`**Component name:** ${rt(t.componentName)}`);const i=t.html.replace(/```/g,"`` `");return n.push("","**HTML snippet:**","```html",i,"```"),n.push("","Please read the source file, locate the element, and apply the requested change."),n.join(`
|
|
551
|
+
`)}function rl(t,e,n=320,r=44,i=12){const{x:d,y:a}=t,{width:o,height:c}=e,l=Math.max(i,Math.min(d-n/2,o-n-i)),f=a/c>.68?Math.max(i,a-r-18):Math.min(a+18,c-r-i);return{leftPct:l/o*100,topPct:f/c*100}}function al(t){const e=ce.c(45),{element:n,onDismiss:r}=t,[i,d]=T.useState(""),a=T.useRef(null),{sendMessage:o}=Ua(),{openSidePanel:c}=so(),l=Pe();let m;e[0]!==n||e[1]!==i||e[2]!==r||e[3]!==c||e[4]!==o?(m=()=>{if(!i.trim())return;const z=sl(n,i);c(),o({parts:[{type:"text",text:z}]}),r()},e[0]=n,e[1]=i,e[2]=r,e[3]=c,e[4]=o,e[5]=m):m=e[5];const f=m;let p;e[6]!==n.position||e[7]!==n.viewport?(p=rl(n.position,n.viewport),e[6]=n.position,e[7]=n.viewport,e[8]=p):p=e[8];const x=p,h=`${x.leftPct}%`,E=`${x.topPct}%`;let g;e[9]!==h||e[10]!==E?(g={left:h,top:E,width:"320px"},e[9]=h,e[10]=E,e[11]=g):g=e[11];let y;e[12]!==f?(y=z=>{z.preventDefault(),f()},e[12]=f,e[13]=y):y=e[13];let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=z=>d(z.target.value),e[14]=N):N=e[14];let b;e[15]!==r?(b=z=>{z.key==="Escape"&&r()},e[15]=r,e[16]=b):b=e[16];let v;e[17]!==l?(v=l("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=l,e[18]=v):v=e[18];let S;e[19]!==i||e[20]!==b||e[21]!==v?(S=s.jsx("input",{ref:a,autoFocus:!0,type:"text",value:i,onChange:N,onKeyDown:b,placeholder:v,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=i,e[20]=b,e[21]=v,e[22]=S):S=e[22];let j;e[23]!==i?(j=i.trim(),e[23]=i,e[24]=j):j=e[24];const k=!j;let P;e[25]!==l?(P=l("sandbox.visualEditorPrompt.sendButton"),e[25]=l,e[26]=P):P=e[26];let C;e[27]!==l?(C=l("sandbox.visualEditorPrompt.sendButton"),e[27]=l,e[28]=C):C=e[28];let A;e[29]!==C?(A=s.jsx("title",{children:C}),e[29]=C,e[30]=A):A=e[30];let R;e[31]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=R):R=e[31];let L;e[32]!==A?(L=s.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[A,R]}),e[32]=A,e[33]=L):L=e[33];let O;e[34]!==k||e[35]!==P||e[36]!==L?(O=s.jsx("button",{type:"submit",disabled:k,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:P,children:L}),e[34]=k,e[35]=P,e[36]=L,e[37]=O):O=e[37];let _;e[38]!==S||e[39]!==O||e[40]!==y?(_=s.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:y,children:[S,O]}),e[38]=S,e[39]=O,e[40]=y,e[41]=_):_=e[41];let B;return e[42]!==_||e[43]!==g?(B=s.jsx("div",{className:"absolute z-30 pointer-events-none",style:g,children:_}),e[42]=_,e[43]=g,e[44]=B):B=e[44],B}const Gs="site-links",il=/details?page|\bpdp\b/i,ol=/listingpage|\bplp\b/i;function ll(t,e,n){const r=new Set;for(const o of n)il.test(o)&&r.add("product"),ol.test(o)&&r.add("category");const i=Tt(Un(t)),d=i[i.length-1],a=i[i.length-2];return d?.type==="text"&&d.text==="/p"&&a?.type==="param"&&a.name===e&&r.add("product"),e==="*"&&i.some(o=>o.type==="param"&&o.name==="*")&&r.add("category"),r}const cl=["rosa","preto","pink","black"];function Jt(t,e){const n=e.trim();return n?t(n):cl.flatMap(r=>t(r))}function dl(t,e){const n=e.trim(),r=[];/^\d+$/.test(n)&&r.push({resolveType:t,props:{ids:[n]}});const d=n.includes("-")&&!/\s/.test(n)?n.replace(/-+/g," "):n;return r.push({resolveType:t,props:{query:d,count:10}}),r}const Fr=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function Vn(t){return t.split("/")[0]??""}function ul(t){const e=new Set;for(const n of t){const r=Vn(n);Fr.has(r)&&e.add(r)}return e}function fl(t,e){const n=Vn(t);return!Fr.has(n)||e.size===0?!0:e.has(n)}const pl=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>Jt(n=>dl(t,n),e),optionsFromPayload:Yt},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Jt(n=>[{resolveType:t,props:{props:{search:n,pageSize:10,currentPage:1}}}],e),optionsFromPayload:Yt},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Jt(n=>[{resolveType:t,props:{term:n,hitsPerPage:10}}],e),optionsFromPayload:Yt},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Jt(n=>[{resolveType:t,props:{query:n,term:n,count:10,hitsPerPage:10}}],e),optionsFromPayload:Yt},{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:yl}];function ml(t,e,n=new Set){const r=[...e],i=o=>{const c=[];for(const l of pl){if(l.kind!==o)continue;const m=r.find(f=>l.test(f)&&fl(f,n));m&&c.push({cand:l,resolveType:m})}return c.find(l=>n.has(Vn(l.resolveType)))??c[0]},d=(o,c,l)=>({kind:o.kind,id:`${o.kind}:${c}`,resolveType:c,clientFilter:o.clientFilter,isFallback:l,buildRequests:m=>o.buildRequests(c,m),optionsFromPayload:o.optionsFromPayload}),a=[];for(const o of["product","category"]){if(!t.has(o))continue;const c=i(o);c&&a.push(d(c.cand,c.resolveType,!1))}return t.size>0&&a.push(hl(t.has("category")?"category":"product")),a}function hl(t){return{kind:t,id:Gs,resolveType:Gs,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,n)=>jl(e,n)}}function Ge(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function gl(t,e,n){const r=new Set,i=new Set,d=a=>{if(Array.isArray(a)){for(const l of a)d(l);return}const o=Ge(a);if(!o)return;const c=o.__resolveType;if(typeof c=="string"){if(n(c))r.add(c);else if(c in e&&!i.has(c)){i.add(c);const l=Ge(e[c])?.__resolveType;typeof l=="string"&&n(l)&&r.add(c),d(e[c])}}for(const l of Object.values(o))d(l)};return d(t),r}function zr(t){const e=new Set,n=[];for(const r of t)for(const i of r)e.has(i.value)||(e.add(i.value),n.push(i));return n}function Kr(t){try{return decodeURIComponent(t)}catch{return t}}function vl(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xl(t){const e=[];let n="^";for(const r of t)r.type==="text"?n+=vl(r.text):(e.push(r.name),n+=r.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${n}$`),order:e}}function Ir(t,e,n){if(typeof t!="string"||!t)return null;let r;try{r=new URL(t,"https://placeholder.invalid").pathname}catch{return null}r=r.replace(/\/+$/,"");const i=Tt(Un(e)),{pattern:d,order:a}=xl(i),o=a.indexOf(n);if(o===-1)return null;const c=r.match(d);if(!c)return null;const l=c[o+1]?.replace(/^\/+|\/+$/g,"");return l?Kr(l):null}function Yt(t,e){const n=Ge(t),r=Array.isArray(t)?t:Array.isArray(n?.products)?n.products:Array.isArray(n?.list)?n.list:[],i=[],d=new Set;for(const a of r){const o=Ge(a);if(!o)continue;const c=Ir(o.url,e.template,e.paramName);if(!c||d.has(c))continue;d.add(c);const l=Ge(o.isVariantOf),m=typeof l?.name=="string"&&l.name||typeof o.name=="string"&&o.name||c,f=Array.isArray(o.image)?Ge(o.image[0]):null,p=typeof f?.url=="string"?f.url:void 0;i.push({value:c,label:m,image:p})}return i}function bl(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?Kr(n):null}function yl(t){const e=[],n=new Set,r=(i,d)=>{const a=Ge(i);if(!a)return;const o=typeof a.name=="string"&&a.name?a.name:"",c=o?[...d,o]:d,l=bl(a.url);if(l&&!n.has(l)&&(n.add(l),e.push({value:l,label:c.join(" › ")||l})),Array.isArray(a.children))for(const m of a.children)r(m,c)};if(Array.isArray(t))for(const i of t)r(i,[]);return e}const wl=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 kl(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase())}function Sl(t){if(typeof t!="string"||!t)return[];const e=[],n=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let r,i=0;for(;(r=n.exec(t))!==null&&i++<5e3;){const d=r[1]??"",a=(r[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:d,text:a})}return e}function Pl(t){if(typeof t!="string"||!t)return[];const e=[],n=new Set,r=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,i=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let d,a=0;for(;(d=r.exec(t))!==null&&a++<3e3;){const o=(d[1]??"").replace(/\\\//g,"/");if(!o||n.has(o))continue;n.add(o);const c=t.slice(d.index,d.index+900).match(i)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:d[2]??"",image:c||void 0})}return e}function jl(t,e){const n=[],r=new Set,i=(d,a,o,c)=>{if(n.length>=200)return;const l=Ir(d,e.template,e.paramName);!l||r.has(l)||e.paramName==="*"&&/(^|\/)p$/.test(l)||o==="category"&&wl.has(l.split("/")[0]??"")||(r.add(l),n.push({value:l,label:a&&a.length<=80?a:kl(l),kind:o,image:c}))};for(const{url:d,name:a,image:o}of Pl(t))i(d,a,"product",o);for(const{href:d,text:a}of Sl(t))d.startsWith("/")&&!d.startsWith("//")&&i(d,a,"category");return n}function St(t,e,n=50){const r=e.trim().toLowerCase();return(r?t.filter(d=>d.label.toLowerCase().includes(r)||d.value.toLowerCase().includes(r)):t).slice(0,n)}const Ur=1e4;function El(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 Nl(t,{resolveType:e,props:n}){const r=await fetch(mi(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...n}),signal:AbortSignal.timeout(Ur)});if(!r.ok)throw new Error(`Failed to fetch options: ${r.status}`);return r.json()}async function Js(t,e){const n=await fetch(hi(t,e),{signal:AbortSignal.timeout(Ur)});if(!n.ok)throw new Error(`Failed to fetch page: ${n.status}`);return n.text()}async function Tl(t,e,n){const r=e.optionsFromPayload(await Js(t,"/"),n),i=r.find(a=>a.kind==="category");if(!i)return r;const d=Ve(n.template,{[n.paramName]:i.value});if(d==="/")return r;try{const a=e.optionsFromPayload(await Js(t,d),n).filter(o=>o.kind==="product");return zr([r,a])}catch{return r}}function Cl(t,e,n){return ir.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":n}`)}async function Rl(t,e,n,r){if(e.homepageLinks)return Tl(t,e,r);const i=e.buildRequests?.(n)??[];if(i.length===0)return[];const d=await Promise.allSettled(i.map(o=>Nl(t,o))),a=d.filter(o=>o.status==="fulfilled").map(o=>o.value);if(a.length===0){const o=d.find(c=>c.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return zr(a.map(o=>e.optionsFromPayload(o,r)))}function Fn(t,e,n,r,i){return{queryKey:Cl(t,e,n),queryFn:()=>Rl(t,e,n,r),enabled:i,staleTime:6e4,retry:1}}function Pt(t){const e=ce.c(16),{heading:n,iconKind:r,options:i,template:d,paramName:a,keyPrefix:o,onSelect:c}=t;if(i.length===0)return null;let l;if(e[0]!==r||e[1]!==o||e[2]!==c||e[3]!==i||e[4]!==a||e[5]!==d){let f;e[7]!==r||e[8]!==o||e[9]!==c||e[10]!==a||e[11]!==d?(f=p=>s.jsxs(Nt,{value:`${o}:${p.value}`,className:"gap-3 py-2",onSelect:()=>c(p.value),children:[r==="product"&&s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:p.image?s.jsx("img",{src:p.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):s.jsx(mr,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:p.label}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Ve(d,{[a]:p.value})})]})]},`${o}:${p.value}`),e[7]=r,e[8]=o,e[9]=c,e[10]=a,e[11]=d,e[12]=f):f=e[12],l=i.map(f),e[0]=r,e[1]=o,e[2]=c,e[3]=i,e[4]=a,e[5]=d,e[6]=l}else l=e[6];let m;return e[13]!==n||e[14]!==l?(m=s.jsx(Et,{heading:n,children:l}),e[13]=n,e[14]=l,e[15]=m):m=e[15],m}function Ys(t){const e=ce.c(2),{text:n}=t;let r;return e[0]!==n?(r=s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r}function Ll(t){const e=ce.c(52),{sources:n,template:r,paramName:i,value:d,sandboxRef:a,onCommit:o}=t,c=Pe(),[l,m]=T.useState(!1),[f,p]=T.useState(""),[x,h]=T.useState(""),E=T.useRef(null),g=i==="*"?c("sandbox.preview.catchAllParamLabel"):`:${i}`,y=El(c),b=[...new Set(n.map(ne=>y[ne.kind].noun))].join(" or ");let v;e[0]!==c||e[1]!==b?(v=c("sandbox.pathParamPickerChip.searchPlaceholder",{options:b}),e[0]=c,e[1]=b,e[2]=v):v=e[2];const S=v,j={template:r,paramName:i};let k;e[3]!==f?(k=(ne,ie)=>({source:ne,query:ie,options:ne.clientFilter?St(ie.data??[],f):ie.data??[]}),e[3]=f,e[4]=k):k=e[4];const P=k,C=n.filter(Fl),A=n.filter(Ml),R=Bn({queries:C.map(ne=>Fn(a,ne,x,j,l))});let L;e[5]!==R||e[6]!==P?(L=(ne,ie)=>P(ne,R[ie]),e[5]=R,e[6]=P,e[7]=L):L=e[7];const O=C.map(L),_=O.length===0||O.every($l),B=Bn({queries:A.map(ne=>Fn(a,ne,x,j,l&&_))});let z;e[8]!==B||e[9]!==P?(z=(ne,ie)=>P(ne,B[ie]),e[8]=B,e[9]=P,e[10]=z):z=e[10];const H=A.map(z),I=_?H:O,W=I.length===1&&I[0]?.source.homepageLinks?I[0]:null,G=W&&!W.query.isLoading&&!W.query.isError?W?.query.data??[]:[],te=St(G.filter(Bl),f),D=St(G.filter(Dl),f),$=te.length>0&&D.length>0,F=ne=>{m(ne),E.current&&clearTimeout(E.current),p(ne?d:""),h(ne?d:"")};let J;e[11]===Symbol.for("react.memo_cache_sentinel")?(J=ne=>{p(ne),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{h(ne)},300)},e[11]=J):J=e[11];const M=J,V=ne=>{o(ne),F(!1)},Y=Lr(f),q=Ve(r,{[i]:Y}),se=ar,ee=rr,Z="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",ae=Ol;let pe;e[12]!==g||e[13]!==c?(pe=c("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:g}),e[12]=g,e[13]=c,e[14]=pe):pe=e[14];let de;e[15]!==pe?(de=s.jsx(or,{className:"sr-only",children:s.jsx(lr,{children:pe})}),e[15]=pe,e[16]=de):de=e[16];let ve;e[17]===Symbol.for("react.memo_cache_sentinel")?(ve=s.jsx(mr,{size:16,className:"shrink-0 text-foreground"}),e[17]=ve):ve=e[17];let ue;e[18]!==c?(ue=c("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=c,e[19]=ue):ue=e[19];let xe;e[20]!==g?(xe=s.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:g}),e[20]=g,e[21]=xe):xe=e[21];let me;e[22]!==ue||e[23]!==xe?(me=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[ve,s.jsxs("span",{className:"text-sm font-medium text-foreground",children:[ue," ",xe]})]}),e[22]=ue,e[23]=xe,e[24]=me):me=e[24];const ge=kr,je=!1,fe="min-h-0 flex-1";let oe;e[25]!==S||e[26]!==f?(oe=s.jsx(Sr,{autoFocus:!0,placeholder:S,value:f,onValueChange:M}),e[25]=S,e[26]=f,e[27]=oe):oe=e[27];const Ne=wr,Fe="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let ze;e[28]!==c?(ze=c("sandbox.pathParamPickerChip.noResults"),e[28]=c,e[29]=ze):ze=e[29];let Be;e[30]!==ze?(Be=s.jsx(Pr,{children:ze}),e[30]=ze,e[31]=Be):Be=e[31];const ut=Y&&s.jsx(Et,{className:"shrink-0",children:s.jsxs(Nt,{value:`__raw__:${Y}`,className:"gap-3 py-2",onSelect:()=>V(Y),children:[s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:s.jsx(ao,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:c("sandbox.pathParamPickerChip.useRawValue",{rawTerm:Y,paramLabel:g})}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:q})]})]})}),Je=$?s.jsxs("div",{className:"flex min-h-0 flex-1",children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:s.jsx(Pt,{heading:y.category.heading,iconKind:"category",options:te,template:r,paramName:i,keyPrefix:`${W?.source.id}:cat`,onSelect:V})}),s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:s.jsx(Pt,{heading:y.product.heading,iconKind:"product",options:D,template:r,paramName:i,keyPrefix:`${W?.source.id}:prod`,onSelect:V})})]}):s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:I.map(ne=>{const{source:ie,query:ke,options:Ie}=ne,{noun:ft}=y[ie.kind];if(ke.isLoading)return s.jsx(Ys,{text:c("sandbox.pathParamPickerChip.loading",{noun:ft})},ie.id);if(ke.isError)return s.jsx(Ys,{text:c("sandbox.pathParamPickerChip.couldNotLoad")},ie.id);if(ie.homepageLinks){const Ye=ke.data??[];return s.jsxs(T.Fragment,{children:[s.jsx(Pt,{heading:y.category.heading,iconKind:"category",options:St(Ye.filter(_l),f),template:r,paramName:i,keyPrefix:`${ie.id}:cat`,onSelect:V}),s.jsx(Pt,{heading:y.product.heading,iconKind:"product",options:St(Ye.filter(Al),f),template:r,paramName:i,keyPrefix:`${ie.id}:prod`,onSelect:V})]},ie.id)}return s.jsx(Pt,{heading:I.length>1?y[ie.kind].heading:void 0,iconKind:ie.kind,options:Ie,template:r,paramName:i,keyPrefix:ie.id,onSelect:V},ie.id)})});let he;e[32]!==Ne||e[33]!==Be||e[34]!==ut||e[35]!==Je?(he=s.jsxs(Ne,{className:Fe,children:[Be,ut,Je]}),e[32]=Ne,e[33]=Be,e[34]=ut,e[35]=Je,e[36]=he):he=e[36];let Re;e[37]!==ge||e[38]!==oe||e[39]!==he?(Re=s.jsxs(ge,{shouldFilter:je,className:fe,children:[oe,he]}),e[37]=ge,e[38]=oe,e[39]=he,e[40]=Re):Re=e[40];let _e;e[41]!==ee||e[42]!==de||e[43]!==me||e[44]!==Re||e[45]!==ae?(_e=s.jsxs(ee,{className:Z,onClick:ae,children:[de,me,Re]}),e[41]=ee,e[42]=de,e[43]=me,e[44]=Re,e[45]=ae,e[46]=_e):_e=e[46];let Ke;return e[47]!==se||e[48]!==F||e[49]!==l||e[50]!==_e?(Ke=s.jsx(se,{open:l,onOpenChange:F,children:_e}),e[47]=se,e[48]=F,e[49]=l,e[50]=_e,e[51]=Ke):Ke=e[51],s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",title:c("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:g}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-xs text-special hover:bg-special/25",onClick:ne=>{ne.stopPropagation(),F(!0)},children:d||g}),Ke]})}function Al(t){return t.kind==="product"}function _l(t){return t.kind!=="product"}function Ol(t){return t.stopPropagation()}function Dl(t){return t.kind==="product"}function Bl(t){return t.kind!=="product"}function $l(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Ml(t){return t.isFallback}function Fl(t){return!t.isFallback}function zl(t){const e=ce.c(8),{sources:n,template:r,paramName:i,sandboxRef:d,onFill:a}=t;let o,c;if(e[0]!==i||e[1]!==d||e[2]!==n||e[3]!==r){const x={template:r,paramName:i},h=n.filter(Kl);c=Bn,o=h.map(E=>Fn(d,E,"",x,!0)),e[0]=i,e[1]=d,e[2]=n,e[3]=r,e[4]=o,e[5]=c}else o=e[4],c=e[5];let l;e[6]!==o?(l={queries:o},e[6]=o,e[7]=l):l=e[7];const m=c(l),[f,p]=T.useState(!1);if(!f)for(const x of m){if(x.isLoading)break;const h=x.data?.[0];if(h){p(!0),queueMicrotask(()=>a(h.value));break}}return null}function Kl(t){return!t.isFallback}function Il(t){const e=ce.c(31),{name:n,value:r,onCommit:i}=t,d=Pe(),[a,o]=T.useState(r),[c,l]=T.useState(!1),m=T.useRef(!1);let f;e[0]!==n||e[1]!==d?(f=n==="*"?d("sandbox.preview.catchAllParamLabel"):`:${n}`,e[0]=n,e[1]=d,e[2]=f):f=e[2];const p=f,x=a||p;let h;e[3]!==x?(h=s.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:x}),e[3]=x,e[4]=h):h=e[4];let E;e[5]!==p||e[6]!==d?(E=d("sandbox.preview.valueForParam",{label:p}),e[5]=p,e[6]=d,e[7]=E):E=e[7];let g,y;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=P=>o(P.target.value),y=()=>l(!0),e[8]=g,e[9]=y):(g=e[8],y=e[9]);let N;e[10]!==r?(N=P=>{P.key==="Enter"&&P.currentTarget.blur(),P.key==="Escape"&&(m.current=!0,o(r),P.currentTarget.blur())},e[10]=r,e[11]=N):N=e[11];let b;e[12]!==a||e[13]!==i||e[14]!==r?(b=()=>{if(l(!1),m.current){m.current=!1;return}const P=Lr(a);o(P),P!==r&&i(P)},e[12]=a,e[13]=i,e[14]=r,e[15]=b):b=e[15];let v;e[16]!==a||e[17]!==p||e[18]!==E||e[19]!==N||e[20]!==b?(v=s.jsx("input",{type:"text",value:a,placeholder:p,title:E,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:Ul,onChange:g,onFocus:y,onKeyDown:N,onBlur:b}),e[16]=a,e[17]=p,e[18]=E,e[19]=N,e[20]=b,e[21]=v):v=e[21];let S;e[22]!==h||e[23]!==v?(S=s.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[h,v]}),e[22]=h,e[23]=v,e[24]=S):S=e[24];let j;e[25]!==c||e[26]!==d?(j=c&&s.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:[s.jsx(Ya,{size:10}),d("sandbox.preview.enterToGo")]}),e[25]=c,e[26]=d,e[27]=j):j=e[27];let k;return e[28]!==j||e[29]!==S?(k=s.jsxs(s.Fragment,{children:[S,j]}),e[28]=j,e[29]=S,e[30]=k):k=e[30],k}function Ul(t){return t.stopPropagation()}function Hl(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const n=new URL(e),r=t.resolvedPath==="/"?"":t.resolvedPath;return`${n.host}${r}`}catch{return e}}function Vl(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function ql(t){return t.showPreviewToolbar&&t.contentEditingEnabled}class Hr extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function Wl(t,e){if(t)return t;const n=await e?.().catch(()=>null);if(!n)throw new Hr;return n}async function Gl(t,e,n){return n?Ns(t,e,await Wl(n.meta,n.loadMeta)):Ns(t,e)}function Jl(t){const e=ce.c(5);let n;e[0]!==t?(n=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=n):n=e[1];const r=dr(n);let i;return e[2]!==t||e[3]!==r?(i={mutationFn:async d=>{const{name:a,path:o,template:c,schema:l}=d;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const m=Aa(a),f=c?{...c,name:a,path:o}:await Gl(a,o,l);return await r.mutateAsync({blockKey:m,data:f}),{key:m,name:a,path:o}}},e[2]=t,e[3]=r,e[4]=i):i=e[4],Sa(i)}function Yl(t){const e=ce.c(89),{open:n,onOpenChange:r,isPending:i,error:d,templates:a,onSubmit:o}=t,c=i===void 0?!1:i,l=Pe();let m;e[0]!==l?(m=l("sectionsEditor.createPageModal.defaultPageName"),e[0]=l,e[1]=m):m=e[1];const[f,p]=T.useState(m);let x;e[2]!==l?(x=l("sectionsEditor.createPageModal.defaultPagePath"),e[2]=l,e[3]=x):x=e[3];const[h,E]=T.useState(x),[g,y]=T.useState(Pn),[N,b]=T.useState(null),[v,S]=T.useState(n);n!==v&&(S(n),n&&(p(l("sectionsEditor.createPageModal.defaultPageName")),E(l("sectionsEditor.createPageModal.defaultPagePath")),y(Pn),b(null)));const j=!!a?.length;let k;e[4]!==c||e[5]!==r?(k=ue=>{!ue&&!c&&(b(null),r(!1))},e[4]=c,e[5]=r,e[6]=k):k=e[6];const P=k;let C;e[7]!==c||e[8]!==f||e[9]!==o||e[10]!==h||e[11]!==j||e[12]!==g?(C=async ue=>{ue.preventDefault();const xe=f.trim(),me=h.trim();if(!xe||!me||c)return;const ge=Ar(me);if(ge){b(ge);return}b(null),await o({name:xe,path:me,templateKey:j&&g!==Pn?g:null})},e[7]=c,e[8]=f,e[9]=o,e[10]=h,e[11]=j,e[12]=g,e[13]=C):C=e[13];const A=C,R=N??d;let L;e[14]!==l?(L=l("sectionsEditor.createPageModal.title"),e[14]=l,e[15]=L):L=e[15];let O;e[16]!==L?(O=s.jsx(or,{children:s.jsx(lr,{children:L})}),e[16]=L,e[17]=O):O=e[17];let _;e[18]!==l?(_=l("sectionsEditor.createPageModal.nameLabel"),e[18]=l,e[19]=_):_=e[19];let B;e[20]!==_?(B=s.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:_}),e[20]=_,e[21]=B):B=e[21];let z;e[22]===Symbol.for("react.memo_cache_sentinel")?(z=ue=>p(ue.target.value),e[22]=z):z=e[22];let H;e[23]!==l?(H=l("sectionsEditor.createPageModal.namePlaceholder"),e[23]=l,e[24]=H):H=e[24];let I;e[25]!==c||e[26]!==f||e[27]!==H?(I=s.jsx(An,{id:"new-page-name",value:f,onChange:z,placeholder:H,autoFocus:!0,disabled:c}),e[25]=c,e[26]=f,e[27]=H,e[28]=I):I=e[28];let W;e[29]!==I||e[30]!==B?(W=s.jsxs("div",{className:"space-y-1.5",children:[B,I]}),e[29]=I,e[30]=B,e[31]=W):W=e[31];let U;e[32]!==l?(U=l("sectionsEditor.createPageModal.pathLabel"),e[32]=l,e[33]=U):U=e[33];let G;e[34]!==U?(G=s.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:U}),e[34]=U,e[35]=G):G=e[35];let te;e[36]===Symbol.for("react.memo_cache_sentinel")?(te=ue=>E(ue.target.value),e[36]=te):te=e[36];let D;e[37]!==l?(D=l("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=l,e[38]=D):D=e[38];let $;e[39]!==c||e[40]!==h||e[41]!==D?($=s.jsx(An,{id:"new-page-path",value:h,onChange:te,placeholder:D,disabled:c}),e[39]=c,e[40]=h,e[41]=D,e[42]=$):$=e[42];let F;e[43]!==G||e[44]!==$?(F=s.jsxs("div",{className:"space-y-1.5",children:[G,$]}),e[43]=G,e[44]=$,e[45]=F):F=e[45];let J;e[46]!==c||e[47]!==j||e[48]!==l||e[49]!==g||e[50]!==a?(J=j&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.createPageModal.templateLabel")}),s.jsx(_a,{id:"new-page-template",value:g,onChange:y,templates:a??[],disabled:c})]}),e[46]=c,e[47]=j,e[48]=l,e[49]=g,e[50]=a,e[51]=J):J=e[51];let M;e[52]!==R?(M=R&&s.jsx("p",{className:"text-xs text-destructive",children:R}),e[52]=R,e[53]=M):M=e[53];let V;e[54]!==W||e[55]!==F||e[56]!==J||e[57]!==M?(V=s.jsxs("div",{className:"space-y-4 py-4",children:[W,F,J,M]}),e[54]=W,e[55]=F,e[56]=J,e[57]=M,e[58]=V):V=e[58];let Y;e[59]!==r?(Y=()=>r(!1),e[59]=r,e[60]=Y):Y=e[60];let q;e[61]!==l?(q=l("sectionsEditor.createPageModal.cancelButton"),e[61]=l,e[62]=q):q=e[62];let se;e[63]!==c||e[64]!==Y||e[65]!==q?(se=s.jsx(Me,{type:"button",variant:"outline",onClick:Y,disabled:c,children:q}),e[63]=c,e[64]=Y,e[65]=q,e[66]=se):se=e[66];let ee;e[67]!==c||e[68]!==f||e[69]!==h?(ee=!f.trim()||!h.trim()||c,e[67]=c,e[68]=f,e[69]=h,e[70]=ee):ee=e[70];let Z;e[71]!==c||e[72]!==l?(Z=c?s.jsxs(s.Fragment,{children:[s.jsx(Ct,{className:"size-3.5"}),l("sectionsEditor.createPageModal.creatingButton")]}):l("sectionsEditor.createPageModal.createButton"),e[71]=c,e[72]=l,e[73]=Z):Z=e[73];let ae;e[74]!==ee||e[75]!==Z?(ae=s.jsx(Me,{type:"submit",disabled:ee,children:Z}),e[74]=ee,e[75]=Z,e[76]=ae):ae=e[76];let pe;e[77]!==se||e[78]!==ae?(pe=s.jsxs(Pa,{children:[se,ae]}),e[77]=se,e[78]=ae,e[79]=pe):pe=e[79];let de;e[80]!==A||e[81]!==V||e[82]!==pe||e[83]!==O?(de=s.jsx(rr,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:A,children:[O,V,pe]})}),e[80]=A,e[81]=V,e[82]=pe,e[83]=O,e[84]=de):de=e[84];let ve;return e[85]!==P||e[86]!==n||e[87]!==de?(ve=s.jsx(ar,{open:n,onOpenChange:P,children:de}),e[85]=P,e[86]=n,e[87]=de,e[88]=ve):ve=e[88],ve}function Ql(t){const e=ce.c(29),{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:d,meta:a,decofile:o,blockKey:c}=t,l=Pe();let m;e[0]!==i||e[1]!==n||e[2]!==r?(m={orgSlug:n,virtualMcpId:r,branch:i},e[0]=i,e[1]=n,e[2]=r,e[3]=m):m=e[3];const f=dr(m);let p;e[4]!==f?(p=Ba((S,j)=>f.mutate({blockKey:S,data:j})),e[4]=f,e[5]=p):p=e[5];const x=p;let h;e[6]!==c||e[7]!==o?(h=Oa(o,c),e[6]=c,e[7]=o,e[8]=h):h=e[8];const{resolveType:E,props:g,title:y}=h;if(!E){let S;e[9]!==l?(S=l("sandbox.preview.loaderNoLongerExists"),e[9]=l,e[10]=S):S=e[10];let j;return e[11]!==S?(j=s.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:S}),e[11]=S,e[12]=j):j=e[12],j}const N=`loader:${c}`;let b;e[13]!==c||e[14]!==E||e[15]!==y?(b={mode:"saved",blockKey:c,resolveType:E,title:y},e[13]=c,e[14]=E,e[15]=y,e[16]=b):b=e[16];let v;return e[17]!==i||e[18]!==o||e[19]!==a||e[20]!==n||e[21]!==d||e[22]!==g||e[23]!==f.isPending||e[24]!==x||e[25]!==N||e[26]!==b||e[27]!==r?(v=s.jsx(Da,{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:d,meta:a,decofile:o,kind:"loaders",target:b,initialValue:g,isCreating:f.isPending,onCreate:Xl,onSaveReferencedBlock:x,showRun:!1},N),e[17]=i,e[18]=o,e[19]=a,e[20]=n,e[21]=d,e[22]=g,e[23]=f.isPending,e[24]=x,e[25]=N,e[26]=b,e[27]=r,e[28]=v):v=e[28],v}async function Xl(){}function Zl(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Qs(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:Zl(t.error)}}function ec(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 tc(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=ec(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(i=>i.status==="error"&&!i.hasData&&i.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 nc=T.lazy(()=>ja(()=>import("./sections-editor-XSwlJ2Cj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147])).then(t=>({default:t.SectionsEditor})));function Xs(t){const e=ce.c(60),{virtualMcpId:n,externalSelection:r,onViewJsonFile:i}=t,d=r===void 0?null:r,{org:a}=Kn(),{currentBranch:o,taskId:c}=Rt(),l=Hn(),m=Lt(),f=Or(),p=l.lifecycle.phase==="running",x=m.previewUrl;let h;e[0]!==o||e[1]!==a||e[2]!==x||e[3]!==c||e[4]!==n?(h=o?{orgSlug:a.slug,virtualMcpId:n,branch:o,threadId:c??null,previewUrl:x}:null,e[0]=o,e[1]=a,e[2]=x,e[3]=c,e[4]=n,e[5]=h):h=e[5];const E=h,g=nn(n,o);let y;e[6]!==p?(y={fetchEnabled:p},e[6]=p,e[7]=y):y=e[7];const N=In(E,y);let b;e[8]!==p?(b={fetchEnabled:p},e[8]=p,e[9]=b):b=e[9];const v=Rr(E,b),S=tc({lifecyclePhase:l.lifecycle.phase,decofile:Qs(N),meta:Qs(v),hasEditableContent:Ii(N.data,v.data),fastPreviewActive:jr(n).runtime==="cms"||at(g)}),j=ur()===void 0,k=sc;if(Ri(g)){let D;return e[10]===Symbol.for("react.memo_cache_sentinel")?(D=k(s.jsx(Ai,{})),e[10]=D):D=e[10],D}if(g.kind==="pending"&&g.retrying){let D;return e[11]!==g?(D=k(s.jsx(_i,{backend:g})),e[11]=g,e[12]=D):D=e[12],D}if(S.kind==="loading"||j){let D;return e[13]===Symbol.for("react.memo_cache_sentinel")?(D=k(s.jsx(Ea,{})),e[13]=D):D=e[13],D}if(N.data&&gi(v.data)){const D=f.state.target,$=D?.kind==="page"||D?.kind==="section"?D.key:null,F=$??"",J=o??"";let M;return e[14]!==N.data||e[15]!==$||e[16]!==a.slug||e[17]!==F||e[18]!==J||e[19]!==n?(M=k(s.jsx($a,{orgSlug:a.slug,virtualMcpId:n,branch:J,decofile:N.data,initialKey:$,compact:!0},F)),e[14]=N.data,e[15]=$,e[16]=a.slug,e[17]=F,e[18]=J,e[19]=n,e[20]=M):M=e[20],M}if(S.kind==="empty"){let D;return e[21]===Symbol.for("react.memo_cache_sentinel")?(D=k(s.jsx(Oi,{})),e[21]=D):D=e[21],D}if(S.kind==="error"){let D;e[22]!==N||e[23]!==m||e[24]!==v||e[25]!==S.source?(D=()=>{if(S.source==="sandbox"){m.retry();return}Promise.all([N.refetch(),v.refetch()])},e[22]=N,e[23]=m,e[24]=v,e[25]=S.source,e[26]=D):D=e[26];const $=D;let F;return e[27]!==$||e[28]!==S.source?(F=k(s.jsx(Li,{source:S.source,onRetry:$})),e[27]=$,e[28]=S.source,e[29]=F):F=e[29],F}let P;e[30]===Symbol.for("react.memo_cache_sentinel")?(P=D=>k(s.jsx("div",{className:"h-full min-h-0",children:D})),e[30]=P):P=e[30];const C=P,A=f.state.target;if(A?.kind==="loader"&&N.data&&v.data){const D=o??"",$=x??null;let F;return e[31]!==N.data||e[32]!==v.data||e[33]!==a.slug||e[34]!==D||e[35]!==$||e[36]!==A.key||e[37]!==n?(F=C(s.jsx(Ql,{orgSlug:a.slug,virtualMcpId:n,branch:D,previewUrl:$,meta:v.data,decofile:N.data,blockKey:A.key})),e[31]=N.data,e[32]=v.data,e[33]=a.slug,e[34]=D,e[35]=$,e[36]=A.key,e[37]=n,e[38]=F):F=e[38],F}let R;e[39]!==o||e[40]!==a.slug||e[41]!==A||e[42]!==n?(R=A||!o?null:fr(pr(a.slug,n,o)),e[39]=o,e[40]=a.slug,e[41]=A,e[42]=n,e[43]=R):R=e[43];const L=R;let O="/",_=null,B=null;A?.kind==="page"?(O=A.path,_=A.key):A?.kind==="section"?B=A.key:L&&(O=L.path,_=L.pageKey);const z=_?`page:${_}`:B?`section:${B}`:`path:${O}`;let H;e[44]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(Ct,{className:"size-5 text-muted-foreground"})}),e[44]=H):H=e[44];const I=o??"",W=x??void 0,U=B?null:d,G=!!_&&f.state.editSeoPageKey===_;let te;return e[45]!==B||e[46]!==_||e[47]!==O||e[48]!==z||e[49]!==i||e[50]!==a.slug||e[51]!==U||e[52]!==G||e[53]!==I||e[54]!==W||e[55]!==n||e[56]!==f.consumeEditSeo||e[57]!==f.setFocusedBlock||e[58]!==f.setVariantOverride?(te=C(s.jsx(T.Suspense,{fallback:H,children:s.jsx(nc,{orgSlug:a.slug,virtualMcpId:n,branch:I,previewReady:!0,previewUrl:W,currentPath:O,activePageBlockKey:_,activeGlobalBlockKey:B,externalSelection:U,initialEditSeo:G,onExitSeo:f.consumeEditSeo,onVariantPreviewOverride:f.setVariantOverride,onFocusedBlockChange:f.setFocusedBlock,onViewJsonFile:i},z)})),e[45]=B,e[46]=_,e[47]=O,e[48]=z,e[49]=i,e[50]=a.slug,e[51]=U,e[52]=G,e[53]=I,e[54]=W,e[55]=n,e[56]=f.consumeEditSeo,e[57]=f.setFocusedBlock,e[58]=f.setVariantOverride,e[59]=te):te=e[59],te}function sc(t){return s.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function Zs(t){const e=ce.c(39),{virtualMcpId:n,pageKey:r,onClose:i,ref:d}=t,a=Pe(),o=ur(),c=o===!0,l=vi(n);let m;e[0]!==l||e[1]!==r?(m=xi(l,oo(r)),e[0]=l,e[1]=r,e[2]=m):m=e[2];const f=m,{org:p}=Kn(),{currentBranch:x,taskId:h}=Rt(),g=Lt().previewUrl;let y;e[3]!==x||e[4]!==p.slug||e[5]!==g||e[6]!==h||e[7]!==n?(y=x?{orgSlug:p.slug,virtualMcpId:n,branch:x,threadId:h??null,previewUrl:g}:null,e[3]=x,e[4]=p.slug,e[5]=g,e[6]=h,e[7]=n,e[8]=y):y=e[8];const b=In(y),v=x??"";let S;e[9]!==p.slug||e[10]!==v||e[11]!==n?(S={orgSlug:p.slug,virtualMcpId:n,branch:v},e[9]=p.slug,e[10]=v,e[11]=n,e[12]=S):S=e[12];const{save:j,flush:k}=Ma(S),P=b.data?.[r],C=b.data===void 0&&b.isLoading||o===void 0,A=b.data!==void 0&&P===void 0,R=!x||A||C;let L;e[13]!==P?(L=P===void 0?"":JSON.stringify(P,null,2),e[13]=P,e[14]=L):L=e[14];const O=L;let _;e[15]!==r||e[16]!==R||e[17]!==j?(_=U=>{if(R)return;let G;try{G=JSON.parse(U)}catch{return}G===null||typeof G!="object"||Array.isArray(G)||j(r,G)},e[15]=r,e[16]=R,e[17]=j,e[18]=_):_=e[18];const B=_;let z;e[19]!==k?(z=()=>({flush:k}),e[19]=k,e[20]=z):z=e[20],T.useImperativeHandle(d,z);let H;e[21]!==f||e[22]!==c||e[23]!==i||e[24]!==a?(H=c?s.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:s.jsx("span",{title:f,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:f})}):s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:a("sectionsEditor.pageJsonDialog.titleShort")}),s.jsx(Me,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":a("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:s.jsx(Na,{size:14})})]}),e[21]=f,e[22]=c,e[23]=i,e[24]=a,e[25]=H):H=e[25];let I;e[26]!==b.data||e[27]!==k||e[28]!==O||e[29]!==C||e[30]!==A||e[31]!==r||e[32]!==R||e[33]!==B||e[34]!==a?(I=C?s.jsx("div",{className:"flex flex-1 items-center justify-center",children:s.jsx(Ct,{className:"size-5 text-muted-foreground"})}):A?s.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",a("sectionsEditor.pageJsonDialog.pageNotFound")]}):s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(io,{code:O,language:"json",readOnly:R,height:"100%",onChange:U=>B(U??""),onSave:U=>{B(U),k()}},`${r}:${b.data===void 0?"loading":"ready"}`)}),e[26]=b.data,e[27]=k,e[28]=O,e[29]=C,e[30]=A,e[31]=r,e[32]=R,e[33]=B,e[34]=a,e[35]=I):I=e[35];let W;return e[36]!==H||e[37]!==I?(W=s.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[H,I]}),e[36]=H,e[37]=I,e[38]=W):W=e[38],W}function Vr(t){return t.contentEditingEnabled&&!t.isMobile}function rc(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function ac(t,e){return t==="blocks"?"preview":e?"blocks":t}function ic(t){return Vr({contentEditingEnabled:_r(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function oc(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function lc(t){const e=eo(t),{display:n}=t;let r=null;if(n.mode==="production"&&n.iframeBase)try{r=new URL(t.path,n.iframeBase).href}catch{r=null}const i=to(r,e);return{value:e,frame:i?$n(i,t.device):null,newTab:i}}function cc(t){const e=ce.c(90),{tests:n,options:r,onChange:i,available:d}=t,a=Pe();let o;e[0]!==r?(o=Dr(r),e[0]=r,e[1]=o):o=e[1];const c=o;let l;e[2]!==r.tests?(l=r.tests??{},e[2]=r.tests,e[3]=l):l=e[3];const m=l;let f;e[4]!==i||e[5]!==r?(f=q=>{const se=q?Bi(q):null,{at:ee,...Z}=r;i(se?{...Z,at:se}:Z)},e[4]=i,e[5]=r,e[6]=f):f=e[6];const p=f;let x;e[7]!==m||e[8]!==i||e[9]!==r?(x=(q,se)=>{const ee={...m};se==="on"?ee[q]=!0:se==="off"?ee[q]=!1:delete ee[q];const{tests:Z,...ae}=r;i(Object.keys(ee).length>0?{...ae,tests:ee}:ae)},e[7]=m,e[8]=i,e[9]=r,e[10]=x):x=e[10];const h=x;let E;e[11]!==a?(E=a("sandbox.previewAs.label"),e[11]=a,e[12]=E):E=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Qa,{size:16}),e[13]=g):g=e[13];let y;e[14]!==c||e[15]!==E?(y=s.jsx(lt,{asChild:!0,children:s.jsx(xr,{asChild:!0,children:s.jsx(We,{"aria-label":E,active:c,"data-testid":"preview-as-trigger",children:g})})}),e[14]=c,e[15]=E,e[16]=y):y=e[16];let N;e[17]!==a?(N=a("sandbox.previewAs.label"),e[17]=a,e[18]=N):N=e[18];let b;e[19]!==N?(b=s.jsx(ct,{children:N}),e[19]=N,e[20]=b):b=e[20];let v;e[21]!==y||e[22]!==b?(v=s.jsxs(dt,{children:[y,b]}),e[21]=y,e[22]=b,e[23]=v):v=e[23];let S;e[24]!==a?(S=a("sandbox.previewAs.label"),e[24]=a,e[25]=S):S=e[25];let j;e[26]!==S?(j=s.jsx("h3",{className:"text-sm font-medium",children:S}),e[26]=S,e[27]=j):j=e[27];let k;e[28]!==d||e[29]!==a?(k=a(d?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[28]=d,e[29]=a,e[30]=k):k=e[30];let P;e[31]!==k?(P=s.jsx("p",{className:"text-xs text-muted-foreground",children:k}),e[31]=k,e[32]=P):P=e[32];let C;e[33]!==j||e[34]!==P?(C=s.jsxs("div",{className:"flex flex-col gap-1",children:[j,P]}),e[33]=j,e[34]=P,e[35]=C):C=e[35];let A;e[36]!==a?(A=a("sandbox.previewAs.momentLabel"),e[36]=a,e[37]=A):A=e[37];let R;e[38]!==A?(R=s.jsx(co,{htmlFor:"preview-as-moment",children:A}),e[38]=A,e[39]=R):R=e[39];let L;e[40]!==r.at?(L=Di(r.at),e[40]=r.at,e[41]=L):L=e[41];let O;e[42]!==p?(O=q=>p(q.target.value),e[42]=p,e[43]=O):O=e[43];let _;e[44]!==L||e[45]!==O?(_=s.jsx(An,{id:"preview-as-moment",type:"datetime-local",className:$i,value:L,onChange:O}),e[44]=L,e[45]=O,e[46]=_):_=e[46];const B=r.at===void 0;let z;e[47]!==p?(z=()=>p(""),e[47]=p,e[48]=z):z=e[48];let H;e[49]!==a?(H=a("sandbox.previewAs.now"),e[49]=a,e[50]=H):H=e[50];let I;e[51]!==B||e[52]!==z||e[53]!==H?(I=s.jsx(Me,{type:"button",variant:"ghost",size:"sm",disabled:B,onClick:z,children:H}),e[51]=B,e[52]=z,e[53]=H,e[54]=I):I=e[54];let W;e[55]!==_||e[56]!==I?(W=s.jsxs("div",{className:"flex items-center gap-2",children:[_,I]}),e[55]=_,e[56]=I,e[57]=W):W=e[57];let U;e[58]!==a?(U=a("sandbox.previewAs.momentHint"),e[58]=a,e[59]=U):U=e[59];let G;e[60]!==U?(G=s.jsx("p",{className:"text-xs text-muted-foreground",children:U}),e[60]=U,e[61]=G):G=e[61];let te;e[62]!==R||e[63]!==W||e[64]!==G?(te=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[R,W,G]}),e[62]=R,e[63]=W,e[64]=G,e[65]=te):te=e[65];let D;e[66]!==a?(D=a("sandbox.previewAs.testsLabel"),e[66]=a,e[67]=D):D=e[67];let $;e[68]!==D?($=s.jsx("span",{className:"text-sm font-medium",children:D}),e[68]=D,e[69]=$):$=e[69];let F;e[70]!==m||e[71]!==h||e[72]!==a||e[73]!==n?(F=n.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.noTests")}):s.jsxs(s.Fragment,{children:[s.jsx("ul",{className:"flex flex-col gap-1.5",children:n.map(q=>s.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[s.jsx("span",{className:"min-w-0 truncate text-sm",children:q}),s.jsxs(uo,{type:"single",variant:"outline",size:"sm",value:m[q]===void 0?"":m[q]?"on":"off",onValueChange:se=>h(q,se),"aria-label":q,children:[s.jsx(Fs,{value:"off",children:a("sandbox.previewAs.off")}),s.jsx(Fs,{value:"on",children:a("sandbox.previewAs.on")})]})]},q))}),s.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.testsHint")})]}),e[70]=m,e[71]=h,e[72]=a,e[73]=n,e[74]=F):F=e[74];let J;e[75]!==$||e[76]!==F?(J=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[$,F]}),e[75]=$,e[76]=F,e[77]=J):J=e[77];let M;e[78]!==c||e[79]!==i||e[80]!==a?(M=c&&s.jsx(Me,{type:"button",variant:"outline",size:"sm",onClick:()=>i({}),children:a("sandbox.previewAs.reset")}),e[78]=c,e[79]=i,e[80]=a,e[81]=M):M=e[81];let V;e[82]!==C||e[83]!==te||e[84]!==J||e[85]!==M?(V=s.jsxs(br,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[C,te,J,M]}),e[82]=C,e[83]=te,e[84]=J,e[85]=M,e[86]=V):V=e[86];let Y;return e[87]!==v||e[88]!==V?(Y=s.jsxs(yr,{children:[v,V]}),e[87]=v,e[88]=V,e[89]=Y):Y=e[89],Y}const dc=15e3;function uc(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 er(t){return t.loading?{...t,loading:!1}:t}const fc=500,pc={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},tr=1,Qt=["desktop","mobile","tablet"],mc=["preview","visual","blocks"],nr={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function hc(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 jt(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function Ln(t,e){try{return new URL(t,e).href}catch{return null}}function gc(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 vc(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function xc(t,e,n){const r=t.toLowerCase(),i=e.toLowerCase(),d=i.split("/").filter(Boolean),a=c=>{if(c===n)return 100;const l=c.indexOf(n);if(l===-1)return 0;let m=40;return l===0?m+=30:/[\s/-]/.test(c[l-1]??"")&&(m+=20),m+=Math.round(n.length/c.length*20),m};let o=Math.max(a(r),a(i));return d.at(-1)===n?o=Math.max(o,95):d.includes(n)&&(o=Math.max(o,90)),o}function bc(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function yc({virtualMcpId:t}){const e=Pe(),n=Cr(),{currentBranch:r,taskId:i,virtualMcpId:d}=Rt(),a=!!Ha(),o=Or(),c=ri(d===t?t:null),l=jr(t),m=po(c?.metadata?.ui?.layout??null),f=_r(m),p=Vr({contentEditingEnabled:f,isMobile:n}),[x]=T.useState(()=>ic({cmsMode:m,isMobile:n})),[h,E]=_n(On.previewEditingMode(t),u=>u&&mc.includes(u)?u:null),g=h??x,[y,N]=_n(On.previewDeviceSize(t),u=>u&&Qt.includes(u)?u:"desktop"),[b,v]=T.useState(null),[S,j]=T.useState(null),k=T.useRef(null),P=T.useRef(null),[C,A]=T.useState(!1),R=T.useRef(null),L=()=>{R.current?.flush(),A(!1)},O=()=>A(u=>(u&&R.current?.flush(),!u)),[_,B]=T.useState({width:0,height:0}),[z,H]=T.useState(!1),[I,W]=T.useState({}),[U,G]=T.useState(""),te=T.useRef(null),[D,$]=T.useState(!1),[F,J]=T.useState(),[M,V]=T.useState(null),[Y,q]=T.useState(null),[se,ee]=T.useState(null),[Z,ae]=T.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[pe,de]=T.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[ve,ue]=T.useState({}),[xe,me]=T.useState(!1),ge=T.useRef(null),je=()=>{me(!0),ge.current&&clearTimeout(ge.current),ge.current=setTimeout(()=>me(!1),15e3)},fe=()=>{ge.current&&(clearTimeout(ge.current),ge.current=null),me(!1)},{org:oe}=Kn(),Ne=Hn(),Fe=Lt(),ze=Fe.vmEntry,Be=Ne.lifecycle.phase,{url:ut,undecided:Je}=Nr(t),he=nn(t,r),{connection:Re}=Tr(t),_e=lo(t),Ke=bi({hasServeConnection:!!Re,runtime:l.runtime}),ne=Je||Ke==="github"&&(_e==="loading"||_e==="error"),ie=!at(he)&&!ne&&!(Ke==="github"&&he.kind==="pending"),ke=He(he)??ut,Ie=ke??Fe.previewUrl,ft=!!ke||Be==="running",Ye=c?.id===t?li(c.metadata):null,pt=!ke&&!Je&&c?.id===t&&l.runtime==="cms",qr=l.projectDefault==="cms",mt=ie?Xi({sandboxUrl:Ie,previewServerUrl:Ye,fastPreviewActive:pt}):null,qn=t&&r?{orgSlug:oe.slug,virtualMcpId:t,branch:r,threadId:i??null,previewUrl:Ie}:null,Wn=In(qn,{fetchEnabled:ft}),sn=Rr(qn,{fetchEnabled:ft}),le=Wn.data,Se=sn.data,Qe=le?Ui(le,Se).sort((u,w)=>u.name.localeCompare(w.name)):[],Gn=t&&r?{orgSlug:oe.slug,virtualMcpId:t,branch:r}:null,Jn=Jl(Gn),rn=le&&Se?Hi(le,Se):[],Yn=ie&&le&&Se?Fa(Se,le,"loaders"):[],Qn=U?(()=>{const u=U.toLowerCase();return Qe.map(w=>({page:w,score:xc(w.name,w.path,u)})).filter(({score:w})=>w>0).sort((w,K)=>K.score-w.score||w.page.path.length-K.page.path.length).map(({page:w})=>w)})():Qe,Xn=rn.filter(u=>{if(!U)return!0;const w=U.toLowerCase();return u.name.toLowerCase().includes(w)||u.key.toLowerCase().includes(w)||u.resolveType.toLowerCase().includes(w)}),Zn=p?Yn:[],es=Zn.filter(u=>{if(!U)return!0;const w=U.toLowerCase();return u.title.toLowerCase().includes(w)||u.key.toLowerCase().includes(w)||u.resolveType.toLowerCase().includes(w)}),At=Y?Yn.find(u=>u.key===Y)??null:null,Oe=Un,an=M||Y?null:Vi(Qe,Z,pe),re=an?.key??null,Xe=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??re,_t=an?.path??null,Ze=(re?ve[re]:void 0)??{},Ee=Ve(Z,Ze),on={};if(ie&&ft&&Ie&&Se&&le){const u=za(Se,"loaders"),w=re?le[re]:void 0,K=gl(w,le,be=>u.has(be)),X=ul(K);for(const be of Tt(Z)){if(be.type!=="param")continue;const $e=ll(Z,be.name,K),Ce=ml($e,u,X);Ce.length>0&&(on[be.name]=Ce)}}const Ot=t&&r?{orgSlug:oe.slug,virtualMcpId:t,branch:r,threadId:i??null}:null,ts=le&&re?qi(le,re,0):[],ns=at(he),ss=le?Wi(ts,le,ns):[],ln=ss.map(u=>u.isSavedBlock?u.label:""),cn=ss.map(u=>u.isSavedBlock?"global":u.isMultivariate?"variant":"normal"),dn=ts.map(u=>Mn(u,le??{},ns)),Dt=T.useRef(null),Le=T.useRef(null),Wr=Ne.status.state==="paused",un=Ne.phase,rs=Ka({claimPhase:un,lifecycle:Ne.lifecycle}),qe=Fe.previewState,Gr=Fe.userStopped,Jr=yi(oe.slug,t??""),{url:Ue}=no(pt&&t&&r?{orgSlug:oe.slug,virtualMcpId:t,branch:r,previewServerUrl:Ye??null,path:Ee}:null),Yr=qr&&l.runtime==="sandbox",Te=wi(he,Ke,_e),as=ki(Te&&pt&&he.kind==="protocol"&&t&&r?{orgSlug:oe.slug,virtualMcpId:t,branch:r}:null),is=Te?as.pointer:null,Q=Vo({previewState:qe,progressStatus:rs.status,previewServerUrl:Ye,fastPreviewActive:pt,fastPreviewReady:!!Ue,codingSession:Yr,localPreviewUrl:ke,hostedDraft:Te,hostedPointerPending:Te&&(he.kind==="pending"||as.pending),deciding:ne}),os=Q.showWakingPill||Te&&Q.mode==="production"&&!is,ht=Q.mode!=="none",Qr=Q.mode==="production"&&Q.iframeBase?jt(Q.iframeBase):null,et=Q.mode==="production"?Qr:jt(Ie),Xr=c?.id===t&&c.metadata?.fastPreviewInPlace===!0,gt=ie?ke?Q.mode==="sandbox"&&p&&g==="blocks":Q.mode==="production"&&pt&&Xr&&p&&g==="blocks":!1,ls=T.useRef(null),{pin:Zr,effective:ea}=gc(ls.current,{inPlaceRenderActive:gt,draftPreviewUrl:Ue,resolvedPath:Ee});ls.current=Zr;const cs=o.state.variantOverride??[],Bt=ie?cs:[],vt=ie?[]:cs,fn=at(he)&&Gi.some(u=>Ji(Se,u)==="available"),tt=fn?I:{},ds=Dr(tt),ta=fn&&le?Object.keys(Yi(le).experiments):[],$t=Te?lc({display:Q,path:Ee,pointer:is,device:y,forcedVariants:vt,previewOptions:tt}):null,nt=t?Cs(oe.slug,t):null,us=JSON.stringify([vt,tt]);T.useEffect(()=>{if(!Te||!nt)return;const[u,w]=JSON.parse(us);Bs(nt,{forcedVariants:u,previewOptions:w})},[Te,nt,us]),T.useEffect(()=>{if(!(!Te||!nt))return()=>Bs(nt,null)},[Te,nt]);const pn=Re&&He(he)?Ci(Re.endpoint,vt,ds):null,na=Re&&He(he)?pn?fo(pn,tt):_s:null,st=hc(Q.mode==="sandbox"?Wt($n(Os(se??Ln(Ee,Q.iframeBase)??Q.iframeBase,na),y),Bt):Q.mode==="production"&&$t?.frame?$t.frame:Q.mode==="production"?Wt($n(zs(Ls(Os(se??ea??Ln(Ee,Q.iframeBase)??Q.iframeBase,os?_s:null),vt),tt),y),Bt):null),fs=Ue??(Q.iframeBase?Ln(Ee,Q.iframeBase):null),ps=Q.mode==="production"&&$t?$t.newTab:Q.mode==="production"?fs?Wt(zs(Ls(fs,vt),tt),Bt):null:st??Q.iframeBase,sa=()=>{const u=ps;u&&window.open(u,"_blank","noopener")},xt=t&&r?pr(oe.slug,t,r):null,bt=u=>{xt&&qa(xt,u)},ye=o.state.target;T.useEffect(()=>{if(!(!ye||!mt||!Se))if(ye.kind==="page"){const u=ve[ye.key]??{};Le.current=Ve(ye.path,u),V(null),q(null),ee(null),de(ye.key),ae(ye.path),bt({path:ye.path,pageKey:ye.key,params:u})}else if(ye.kind==="loader")Le.current=null,V(null),q(ye.key),ee(null);else{const u=rn.find(w=>w.key===ye.key);if(u){Le.current=null;const w=As(Se);q(null),V(u),ee(Ds(mt,w,u.key))}}},[ye,mt,Se,ve]),T.useEffect(()=>{!re||_t===null||ye?.kind==="page"&&ye.key===re&&ye.path===_t||o.selectTarget({kind:"page",key:re,path:_t})},[re,_t,ye]);const[ms,ra]=T.useState(null);if(qe.kind==="iframe"&&ms!==qe.previewUrl){const u=ms!==null;ra(qe.previewUrl);const w=xt?fr(xt):null;if(w){if(Le.current=Ve(w.path,w.params),ae(w.path),de(w.pageKey),ee(null),V(null),q(null),w.pageKey&&Object.keys(w.params).length>0){const K=w.pageKey;ue(X=>({...X,[K]:w.params}))}}else u&&(Le.current=null,ae("/"),ee(null),de(null),V(null),q(null))}Dt.current=st;const aa=Q.mode==="production"&&!!Ue&&!ke,[hs,mn]=T.useState({src:st??void 0,loading:!1}),Mt=uc(hs,st??void 0,aa);Mt!==hs&&mn(Mt);const yt=Mt.src,gs=Mt.loading,vs=Jo({iframeRef:k,src:Q.mode==="sandbox"?st:null,active:Q.mode==="sandbox"}),xs=T.useRef(null);T.useEffect(()=>{const u=gs?setTimeout(()=>mn(er),dc):null,w=()=>{u&&clearTimeout(u)};if(!Ue||!yt||xs.current===Ue)return w;xs.current=Ue;const K=k.current;return K&&K.getAttribute("src")!==yt&&(je(),K.src=yt),w},[Ue,yt,gs]);const bs=()=>{const u=k.current?.contentWindow,w=et;if(!u||!w||!le||!re)return;const K=le[re];if(!K||typeof K!="object")return;const X=Zi({previewBaseUrl:w,pageBlock:K,decofile:le,path:Ee,pathTemplate:Z});if(!X)return;const be=Wt(X.src,Ti(Bt,re));u.postMessage({type:"cms-editor::render",src:be,body:X.body},w)},hn=T.useRef(null);T.useEffect(()=>{if(!gt||M||Y||!re||!le){hn.current=null;return}const u={nav:JSON.stringify({page:re,path:Ee,pathTemplate:Z}),content:JSON.stringify(le)},w=vc(hn.current,u);hn.current=u,w&&bs()},[le,gt,M,Y,re,Ee,Z]);const gn=T.useRef(null);T.useEffect(()=>{if(!gt||M||Y||!re||!le){gn.current=null;return}const u=JSON.stringify(o.state.variantOverride??null),w=gn.current;gn.current={page:re,sig:u},!(!w||w.page!==re||w.sig===u)&&bs()},[o.state.variantOverride,gt,M,Y,re]);const ia=!!t&&!!r&&!Ne.notFound&&!Gr&&!Wr&&(un?.kind==="ready"||Be!=="idle"),we=oc({editingMode:g,sandboxDisplay:Q.mode==="sandbox",blocksEditingEnabled:p});T.useEffect(()=>{const u=et;if(!u)return;const w=K=>{if(K.origin===u)if(K.data?.type==="visual-editor::element-clicked"){const X=Zo.safeParse(K.data.payload);X.success&&v(X.data)}else if(K.data?.type==="cms-editor::section-clicked"){const X=nl.safeParse(K.data.payload);X.success&&j({index:X.data.sectionIndex,seq:X.data.clickSeq})}else K.data?.type==="cms-editor::render-start"?je():K.data?.type==="cms-editor::render-end"?(fe(),k.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:ln,kinds:cn,keys:dn},u)):K.data?.type==="cms-editor::render-error"&&fe()};return window.addEventListener("message",w),()=>window.removeEventListener("message",w)},[et,ln,cn,dn]);const ys=()=>{const u=k.current?.contentWindow,w=jt(Ie);!u||!w||u.postMessage({type:"visual-editor::activate",script:el},w)},oa=()=>{const u=k.current?.contentWindow,w=jt(Ie);!u||!w||u.postMessage({type:"visual-editor::deactivate"},w)},vn=()=>{const u=k.current?.contentWindow,w=et;!u||!w||(u.postMessage(Q.mode==="production"||ke?{type:"editor::inject",args:{script:Ws}}:{type:"visual-editor::activate",script:Ws},w),u.postMessage({type:"cms-editor::set-labels",labels:ln,kinds:cn,keys:dn},w))},la=()=>{const u=k.current?.contentWindow,w=et;!u||!w||u.postMessage({type:"cms-editor::deactivate"},w)},ca=()=>{const u=k.current?.contentWindow,w=et;!u||!w||(u.postMessage({type:"cms-editor::clear-hover"},w),u.postMessage({type:"visual-editor::clear-hover"},w))},Ft=u=>{if(u==="blocks"&&!p)return;const w=g;!n&&u!==w&&(u==="blocks"?P.current?.resize("30%"):P.current?.collapse()),E(u),v(null),j(null),u!=="blocks"&&q(null),w==="visual"&&oa(),u==="visual"&&ys(),w==="blocks"&&u!=="blocks"&&la(),u==="blocks"&&vn()},da=()=>{Ft(rc(g,p))},ua=()=>{Ft(ac(g,p))},xn=()=>{const u=k.current;if(!u)return;je();const w=document.activeElement,K=u.tabIndex;u.tabIndex=-1,u.style.pointerEvents="none",u.blur(),bc(u,Dt.current);let X;const be=()=>{clearTimeout(X),u.tabIndex=K,u.style.pointerEvents="";const $e=document.activeElement;(!$e||$e===document.body||$e===u)&&w?.focus(),u.removeEventListener("load",be)};u.addEventListener("load",be),X=setTimeout(be,3e3)};ro(xn);const zt=Cs(oe.slug,t??""),Kt=Te&&ht&&!!t,ws=T.useRef(null);T.useEffect(()=>{if(Kt)return Si(zt)},[Kt,zt]);const{reload:wt}=Pi(oe.slug,t??""),ks=T.useRef(wt.seq);T.useEffect(()=>{if(ks.current!==wt.seq&&(ks.current=wt.seq,!!Kt&&ws.current===Dt.current)){if(wt.navigates){Rs(zt);return}xn()}},[wt.seq]);const fa=ji(Gn),kt=Ei(He(he)?fa:""),Ss=T.useRef(kt);T.useEffect(()=>{const u=Ss.current;if(Ss.current=kt,!u||!kt||u===kt)return;const w=k.current;if(w)return Xo({iframe:w,reload:xn})},[kt]);const pa=()=>{const u=Qt.indexOf(y);N(Qt[(u+1)%Qt.length])},bn=(u,w)=>{if(!re)return;const K=re,X={...Ze,[u]:w};Le.current=Ve(Z,X),ue(be=>({...be,[K]:X})),bt({path:Z,pageKey:K,params:X})},ma=Hl({iframeBase:Q.iframeBase,resolvedPath:Ee,activeGlobalSectionName:M?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),yn=u=>{const w=ve[u.key]??{},K=Ve(u.path,w);(M||Oe(K)!==Oe(Ee))&&je(),Le.current=K,V(null),q(null),ee(null),j(null),de(u.key),ae(u.path),bt({path:u.path,pageKey:u.key,params:w}),o.selectTarget({kind:"page",key:u.key,path:u.path})};Va(xt,u=>{(M||Oe(u)!==Oe(Ee))&&je(),Le.current=u,V(null),q(null),ee(null),j(null),de(null),ae(u),bt({path:u,pageKey:null,params:{}})});const ha=u=>{if(at(he)){const X=le?Qi(le,u.key,Se):null;X?yn(X):Zt.info(e("sandbox.preview.blockOnNoPage"));return}if(!mt||!Se){Zt.error(e("sandbox.preview.previewMetadataNotReady"));return}je(),Le.current=null;const w=As(Se),K=Ds(mt,w,u.key);V(u),q(null),ee(K),j(null),o.selectTarget({kind:"section",key:u.key})},ga=u=>{p&&(V(null),q(u.key),ee(null),Ft("blocks"),o.selectTarget({kind:"loader",key:u.key}))},va=async({name:u,path:w,templateKey:K})=>{if(!t||!r)return;const X=Ar(w);if(X){J(X);return}const be=w.trim().startsWith("/")?w.trim():`/${w.trim()}`;if(Qe.some(Ce=>Oe(Ce.path)===Oe(be))){J(e("sandbox.preview.pageAlreadyExists",{path:be}));return}let $e;if(K&&($e=le?.[K],!$e)){J(e("sandbox.preview.templateNoLongerExists"));return}J(void 0);try{const Ce=await Jn.mutateAsync({name:u,path:be,template:$e,schema:at(he)?{meta:Se,loadMeta:async()=>(await sn.refetch()).data}:void 0});$(!1),Zt.success(e("sandbox.preview.pageCreated",{name:u})),await ho(fc),yn({key:Ce.key,name:Ce.name,path:Ce.path}),Ft("blocks")}catch(Ce){J(Ce instanceof Hr?e("sandbox.preview.pageSchemaNotReady"):Ce instanceof Error?Ce.message:e("sandbox.preview.failedToCreatePage"))}},It=Vl({previewSurfaceActive:ht,daemonReady:ia,production:Q.mode==="production",servePreviewUrl:He(he)}),xa=ql({showPreviewToolbar:It,contentEditingEnabled:f}),Ut=()=>{H(!1),G("")},wn=M?.name??At?.title??an?.name,kn=Wn.isPending||sn.isPending,Sn=kn?jt(Q.iframeBase):wn,Ht=M?`section:${M.key}`:Y?`loader:${Y}`:re?`page:${re}`:void 0,ba=It?xa?s.jsxs(yr,{open:z,onOpenChange:u=>{H(u),u||G("")},children:[s.jsx(xr,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:kn?Sn??void 0:M||At?wn:[wn,Z].filter(Boolean).join(" · "),className:"group/page-picker flex h-7 w-fit min-w-[320px] items-stretch overflow-hidden whitespace-nowrap rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background text-left text-xs text-muted-foreground transition-colors hover:border-border focus-ring",children:s.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:[M&&s.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:[s.jsx(Xa,{size:11}),e("sandbox.preview.globalBadge")]}),At&&s.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:[s.jsx(Za,{size:11}),e("sandbox.preview.loaderBadge")]}),Sn&&s.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:Sn}),!kn&&!M&&!At&&s.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:Z}),s.jsx(Wa,{size:12,className:De("shrink-0 transition-transform",z&&"rotate-180")})]})})}),s.jsxs(br,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[s.jsxs(kr,{shouldFilter:!1,defaultValue:Ht,children:[s.jsx(Sr,{value:U,onValueChange:u=>{G(u),te.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),s.jsxs(wr,{ref:te,className:"max-h-80",children:[s.jsx(Pr,{children:Qe.length===0&&rn.length===0&&Zn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),Qn.length>0&&s.jsx(Et,{children:Qn.map(u=>s.jsxs(Nt,{value:`page:${u.key}`,"aria-current":Ht===`page:${u.key}`||void 0,title:`${u.name} · ${u.path}`,onSelect:()=>{Ut(),yn(u)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:u.name}),s.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))}),Xn.length>0&&s.jsx(Et,{heading:e("sandbox.preview.globalComponents"),children:Xn.map(u=>s.jsx(Nt,{value:`section:${u.key}`,"aria-current":Ht===`section:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ut(),ha(u)},children:s.jsx("span",{className:"truncate",children:u.name})},u.key))}),es.length>0&&s.jsx(Et,{heading:e("sandbox.preview.globalLoaders"),children:es.map(u=>s.jsx(Nt,{value:`loader:${u.key}`,"aria-current":Ht===`loader:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ut(),ga(u)},children:s.jsx("span",{className:"truncate",children:u.title})},u.key))})]})]}),!M&&!Y&&Tt(Z).some(u=>u.type!=="text")&&s.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:Tt(Z).map((u,w)=>{if(u.type==="text")return s.jsx("span",{children:u.text},`text-${w}`);const K=on[u.name];return K&&Ot?s.jsx(Ll,{sources:K,template:Z,paramName:u.name,value:Ze[u.name]??"",sandboxRef:Ot,onCommit:X=>bn(u.name,X)},`${re}:${u.name}`):s.jsx(Il,{name:u.name,value:Ze[u.name]??"",onCommit:X=>bn(u.name,X)},`${re}:${u.name}`)})}),s.jsx("div",{className:"border-t p-1.5",children:s.jsxs(Me,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Ut(),J(void 0),$(!0)},children:[s.jsx(vr,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):s.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:ma}):null,Ps=It||f?s.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[s.jsxs(dt,{children:[s.jsx(lt,{asChild:!0,children:s.jsx(We,{onClick:pa,"aria-label":e(nr[y]),children:y==="mobile"?s.jsx(hr,{size:16}):y==="tablet"?s.jsx(ei,{size:16}):s.jsx(gr,{size:16})})}),s.jsx(ct,{children:e(nr[y])})]}),ba,s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[fn&&s.jsx(cc,{tests:ta,options:I,onChange:W,available:!!pn||!os||!ds}),s.jsx(We,{onClick:sa,disabled:Te&&!ps,"aria-label":e("sandbox.preview.openInNewTab"),children:s.jsx(cr,{size:16})})]})]}):null,ya=(ie||a)&&Q.mode==="sandbox",Vt=pc[y],qt=y==="desktop"&&(_.width===0||_.width>=Vt.width+2*tr),js=qt?1:Math.min(_.width>0?_.width/(Vt.width+2*tr):1,1),wa=qt?{width:"100%",height:"100%"}:{width:`${Vt.width}px`,height:_.height>0?`${_.height/js}px`:`${Vt.height}px`,transform:`scale(${js})`,transformOrigin:"top center"},Es=s.jsxs(s.Fragment,{children:[ya&&(It||f)&&s.jsx(We,{onClick:da,"aria-pressed":we==="visual","aria-label":e("sandbox.preview.visualEditor"),active:we==="visual",children:s.jsx(Ts,{size:16})}),p&&s.jsxs(dt,{children:[s.jsx(lt,{asChild:!0,children:s.jsx(We,{onClick:ua,"aria-pressed":we==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:we==="blocks",children:s.jsx(ni,{size:16})})}),s.jsx(ct,{children:e("sandbox.preview.blocksEditor")})]}),Xe&&s.jsxs(dt,{children:[s.jsx(lt,{asChild:!0,children:s.jsx(We,{onClick:O,"aria-pressed":C,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:C,children:s.jsx(ti,{size:16})})}),s.jsx(ct,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),ka=!!Y&&we==="blocks";return s.jsxs("div",{className:"flex flex-col w-full h-full",children:[Ot&&Object.entries(on).map(([u,w])=>(Ze[u]??"")===""?s.jsx(zl,{sources:w,template:Z,paramName:u,sandboxRef:Ot,onFill:K=>bn(u,K)},`${re}:${u}`):null),s.jsxs(s.Fragment,{children:[s.jsx(Dn.Toolbar.Center.Portal,{fallback:s.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:Ps}),children:Ps}),s.jsx(Dn.Toolbar.Right.Portal,{fallback:Es,children:Es})]}),s.jsx("div",{className:"flex-1 overflow-hidden relative",children:ka?s.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[s.jsx(Xs,{virtualMcpId:t,externalSelection:S,onViewJsonFile:O}),C&&Xe&&s.jsx("div",{className:"absolute inset-0 z-10",children:s.jsx(Zs,{ref:R,virtualMcpId:t,pageKey:Xe,onClose:L})})]}):s.jsxs($s,{orientation:"horizontal",disabled:we!=="blocks",className:"relative isolate",children:[s.jsx(Gt,{ref:P,id:"preview-blocks-editor",defaultSize:we==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:we==="blocks"&&s.jsx(Xs,{virtualMcpId:t,externalSelection:S,onViewJsonFile:O})}),we==="blocks"&&s.jsx(Ms,{withHandle:!0}),s.jsx(Gt,{id:"preview-canvas",defaultSize:we==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:s.jsxs($s,{orientation:"horizontal",disabled:!(C&&Xe),children:[s.jsx(Gt,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:s.jsxs("div",{ref:u=>{if(!u)return;const w=()=>B(X=>X.width===u.clientWidth&&X.height===u.clientHeight?X:{width:u.clientWidth,height:u.clientHeight});w();const K=new ResizeObserver(w);return K.observe(u),()=>K.disconnect()},className:De("h-full relative overflow-clip flex justify-center",ht&&!qt&&"bg-muted/30"),children:[(xe||Jr)&&ht&&s.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:s.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),Q.showDecidingLoader&&s.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:s.jsx(Ct,{className:"size-5 text-muted-foreground"})}),Q.showBlockingOverlay&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(jn,{kind:"starting",progress:rs,claimPhase:un})}),!ke&&!ne&&qe.kind==="suspended"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(jn,{kind:"suspended",onResume:Fe.resume})}),!ke&&!ne&&qe.kind==="errored"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(jn,{kind:"errored",error:qe.error,onRetry:Fe.retry,connectionsHref:`/${oe.slug}/settings/connections`})}),Q.showWakingPill&&s.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:[s.jsx(Ct,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),we==="visual"&&!b&&s.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:[s.jsx(Ts,{size:12}),e("sandbox.preview.clickElementToAsk")]}),we==="visual"&&b&&s.jsx(al,{element:b,onDismiss:()=>v(null)}),ht&&st&&s.jsx("div",{className:De("shrink-0",!qt&&"bg-background shadow-edge"),style:wa,onMouseLeave:ca,children:s.jsx("iframe",{ref:k,src:yt,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:vs.handleError,onLoad:()=>{if(mn(er),vs.handleLoad(),fe(),ws.current=Dt.current,Kt&&Rs(zt),Q.mode!=="sandbox"||ke){(Q.mode==="production"&&!Q.showWakingPill||ke)&&we==="blocks"&&vn();return}if(Ta("vm_preview_loaded",{view_mode:we,vm_id:ze?.sandboxHandle??null}),!M)try{const u=k.current?.contentWindow?.location?.pathname;if(!u)return;const w=Le.current;if(w!==null&&(Le.current=null,Oe(u)!==Oe(w))||Oe(u)===Oe(Ee))return;ae(u),bt({path:u,pageKey:pe,params:Ze})}catch{}we==="visual"&&ys(),we==="blocks"&&vn()}},Q.iframeBase)})]})}),C&&Xe&&s.jsxs(s.Fragment,{children:[s.jsx(Ms,{withHandle:!0}),s.jsx(Gt,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:s.jsx(Zs,{ref:R,virtualMcpId:t,pageKey:Xe,onClose:L})})]})]})})]})}),s.jsx(Yl,{open:D,onOpenChange:$,isPending:Jn.isPending,error:F,templates:Qe,onSubmit:va})]})}const zn={app:null,split:!1};function wc(t){const e=ce.c(24),{project:n,maxApps:r,children:i}=t,d=Pe();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={silent:!0},e[0]=a):a=e[0];const o=ai(a),c=Lt();let l;e[1]!==n.metadata.runtime?(l=n.metadata.runtime??{},e[1]=n.metadata.runtime,e[2]=l):l=e[2];const m=l;let f;e[3]!==m.apps?(f=m.apps??[],e[3]=m.apps,e[4]=f):f=e[4];const p=f;let x;e[5]!==o.update||e[6]!==c||e[7]!==n.id||e[8]!==n.metadata||e[9]!==m||e[10]!==d?(x=b=>o.update.mutate({id:n.id,data:{metadata:{...go(n.metadata),runtime:{...m,apps:b.length?b:null}}}},{onSuccess:()=>c.start(),onError:()=>Zt.error(d("sandbox.appTabs.saveError"))}),e[5]=o.update,e[6]=c,e[7]=n.id,e[8]=n.metadata,e[9]=m,e[10]=d,e[11]=x):x=e[11];const h=x,E=m.path??null;let g,y;e[12]!==p||e[13]!==h?(g=b=>h([...p,{path:b}]),y=b=>h(p.filter(v=>v.path!==b)),e[12]=p,e[13]=h,e[14]=g,e[15]=y):(g=e[14],y=e[15]);let N;return e[16]!==p||e[17]!==i||e[18]!==r||e[19]!==n.id||e[20]!==E||e[21]!==g||e[22]!==y?(N=s.jsx(kc,{virtualMcpId:n.id,mainPath:E,apps:p,maxApps:r,onAddApp:g,onRemoveApp:y,children:i}),e[16]=p,e[17]=i,e[18]=r,e[19]=n.id,e[20]=E,e[21]=g,e[22]=y,e[23]=N):N=e[23],N}function kc(t){const e=ce.c(102),{virtualMcpId:n,mainPath:r,apps:i,maxApps:d,onAddApp:a,onRemoveApp:o,children:c}=t,l=Pe(),m=Cr(),{currentBranch:f}=Rt(),p=Lt(),x=Hn().lifecycle.phase,h=nn(n,f),{url:E}=Nr(n);let g;e[0]!==h||e[1]!==E?(g=He(h)??E,e[0]=h,e[1]=E,e[2]=g):g=e[2];const y=g,N=y??p.previewUrl,b=!!y||x==="running",v=!b&&p.status==="errored";let S;e[3]!==p.vmEntry?.startedWith?.apps?(S=p.vmEntry?.startedWith?.apps??[],e[3]=p.vmEntry?.startedWith?.apps,e[4]=S):S=e[4];const j=S;let k;e[5]!==n?(k=On.previewAppLayout(n),e[5]=n,e[6]=k):k=e[6];const[P,C]=_n(k,Sc);let A;e[7]!==i||e[8]!==P?(A=i.some(fe=>fe.path===P.app)?P.app:null,e[7]=i,e[8]=P,e[9]=A):A=e[9];const R=A,L=R!==null&&P.split&&!m,O=R===null||L,_=R??i[0]?.path??null,[B,z]=T.useState(null),[H,I]=T.useState(!1);let W;e[10]===Symbol.for("react.memo_cache_sentinel")?(W=()=>{z(null),I(!1)},e[10]=W):W=e[10];const U=W;let G;e[11]!==i||e[12]!==B||e[13]!==m||e[14]!==r||e[15]!==a||e[16]!==C?(G=()=>{if(B===null)return;const fe=Ks(B);if(!fe){U();return}if(fe===Ks(r??"")||i.some(oe=>oe.path===fe)){I(!0);return}a(fe),C({app:fe,split:!m}),U()},e[11]=i,e[12]=B,e[13]=m,e[14]=r,e[15]=a,e[16]=C,e[17]=G):G=e[17];const te=G;let D;e[18]!==r||e[19]!==l?(D=r?Nn(r):l("sandbox.appTabs.root"),e[18]=r,e[19]=l,e[20]=D):D=e[20];const $=D;let F;e[21]!==L||e[22]!==l?(F=l(L?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=L,e[22]=l,e[23]=F):F=e[23];const J=F;let M;e[24]!==l?(M=l("sandbox.appTabs.label"),e[24]=l,e[25]=M):M=e[25];let V;e[26]!==l?(V=l("sandbox.appTabs.main"),e[26]=l,e[27]=V):V=e[27];let Y;e[28]!==l?(Y=l("sandbox.appTabs.mainHint"),e[28]=l,e[29]=Y):Y=e[29];let q;e[30]!==C?(q=()=>C(zn),e[30]=C,e[31]=q):q=e[31];let se;e[32]!==v||e[33]!==$||e[34]!==b||e[35]!==O||e[36]!==V||e[37]!==Y||e[38]!==q?(se=s.jsx(sr,{label:$,badge:V,hint:Y,ready:b,failed:v,onScreen:O,onSelect:q}),e[32]=v,e[33]=$,e[34]=b,e[35]=O,e[36]=V,e[37]=Y,e[38]=q,e[39]=se):se=e[39];let ee;if(e[40]!==i||e[41]!==R||e[42]!==v||e[43]!==$||e[44]!==o||e[45]!==b||e[46]!==C||e[47]!==L||e[48]!==l){let fe;e[50]!==R||e[51]!==v||e[52]!==$||e[53]!==o||e[54]!==b||e[55]!==C||e[56]!==L||e[57]!==l?(fe=oe=>{const Ne=Nn(oe.path);return s.jsx(sr,{label:Ne,hint:l("sandbox.appTabs.extraHint",{app:$}),ready:b,failed:v,onScreen:oe.path===R,onSelect:()=>C({app:oe.path,split:L}),onRemove:()=>o(oe.path),removeLabel:l("sandbox.appTabs.remove",{app:Ne})},oe.path)},e[50]=R,e[51]=v,e[52]=$,e[53]=o,e[54]=b,e[55]=C,e[56]=L,e[57]=l,e[58]=fe):fe=e[58],ee=i.map(fe),e[40]=i,e[41]=R,e[42]=v,e[43]=$,e[44]=o,e[45]=b,e[46]=C,e[47]=L,e[48]=l,e[49]=ee}else ee=e[49];let Z;e[59]!==se||e[60]!==ee||e[61]!==M?(Z=s.jsxs("div",{role:"tablist","aria-label":M,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[se,ee]}),e[59]=se,e[60]=ee,e[61]=M,e[62]=Z):Z=e[62];let ae;e[63]!==i.length||e[64]!==te||e[65]!==B||e[66]!==H||e[67]!==d||e[68]!==l?(ae=B!==null?s.jsx("form",{className:"w-40 shrink-0",onSubmit:fe=>{fe.preventDefault(),te()},children:s.jsx("input",{autoFocus:!0,value:B,placeholder:"apps/checkout","aria-label":l("sandbox.appTabs.pathLabel"),"aria-invalid":H,onChange:fe=>{z(fe.target.value),I(!1)},onBlur:U,onKeyDown:fe=>{fe.key==="Escape"&&U()},className:De("h-7 w-full rounded-md border bg-background px-2 font-mono text-xs outline-none",H?"border-destructive":"border-border")})}):i.length<d&&s.jsx(ot,{label:l("sandbox.appTabs.add"),onClick:()=>z(""),children:s.jsx(vr,{})}),e[63]=i.length,e[64]=te,e[65]=B,e[66]=H,e[67]=d,e[68]=l,e[69]=ae):ae=e[69];let pe;e[70]!==m||e[71]!==C||e[72]!==L||e[73]!==J||e[74]!==_?(pe=!m&&_&&s.jsx(ot,{label:J,active:L,onClick:()=>C(L?zn:{app:_,split:!0}),children:s.jsx(si,{})}),e[70]=m,e[71]=C,e[72]=L,e[73]=J,e[74]=_,e[75]=pe):pe=e[75];let de;e[76]!==Z||e[77]!==ae||e[78]!==pe?(de=s.jsxs(s.Fragment,{children:[Z,ae,pe]}),e[76]=Z,e[77]=ae,e[78]=pe,e[79]=de):de=e[79];const ve=de;let ue;e[80]!==ve?(ue=s.jsx(Dn.Topbar.Left.Portal,{fallback:s.jsx("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:ve}),children:s.jsx("div",{className:"ml-1 flex min-w-0 items-center gap-1 border-l border-border/60 pl-2",children:ve})}),e[80]=ve,e[81]=ue):ue=e[81];let xe;e[82]!==c||e[83]!==O?(xe=O&&s.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:c}),e[82]=c,e[83]=O,e[84]=xe):xe=e[84];let me;e[85]!==R||e[86]!==v||e[87]!==p.start||e[88]!==y||e[89]!==$||e[90]!==N||e[91]!==b||e[92]!==C||e[93]!==L||e[94]!==j?(me=R!==null&&s.jsx(Pc,{name:Nn(R),mainName:$,appUrl:N?vo(N,R):null,ready:b,failed:v,notStarted:!y&&!j.includes(R),onStart:p.start,className:De(L&&"border-l border-border"),onClose:L?()=>C({app:R,split:!1}):void 0},R),e[85]=R,e[86]=v,e[87]=p.start,e[88]=y,e[89]=$,e[90]=N,e[91]=b,e[92]=C,e[93]=L,e[94]=j,e[95]=me):me=e[95];let ge;e[96]!==xe||e[97]!==me?(ge=s.jsxs("div",{className:"flex min-h-0 flex-1",children:[xe,me]}),e[96]=xe,e[97]=me,e[98]=ge):ge=e[98];let je;return e[99]!==ue||e[100]!==ge?(je=s.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[ue,ge]}),e[99]=ue,e[100]=ge,e[101]=je):je=e[101],je}function Sc(t){return t??zn}function sr(t){const e=ce.c(28),{label:n,badge:r,hint:i,ready:d,failed:a,onScreen:o,onSelect:c,onRemove:l,removeLabel:m}=t,f=o?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground";let p;e[0]!==f?(p=De("group/app-tab flex h-7 shrink-0 items-center rounded-md text-xs transition-colors",f),e[0]=f,e[1]=p):p=e[1];const x=d?"bg-success":a?"bg-destructive":"animate-pulse bg-warning";let h;e[2]!==x?(h=De("size-1.5 rounded-full",x),e[2]=x,e[3]=h):h=e[3];let E;e[4]!==h?(E=s.jsx("span",{"aria-hidden":!0,className:h}),e[4]=h,e[5]=E):E=e[5];let g;e[6]!==n?(g=s.jsx("span",{className:"max-w-40 truncate",children:n}),e[6]=n,e[7]=g):g=e[7];let y;e[8]!==r?(y=r&&s.jsx("span",{className:"text-[10px] text-muted-foreground",children:r}),e[8]=r,e[9]=y):y=e[9];let N;e[10]!==o||e[11]!==c||e[12]!==E||e[13]!==g||e[14]!==y?(N=s.jsx(lt,{asChild:!0,children:s.jsxs("button",{type:"button",role:"tab","aria-selected":o,onClick:c,className:"flex h-full items-center gap-1.5 rounded-md px-2.5 focus-ring",children:[E,g,y]})}),e[10]=o,e[11]=c,e[12]=E,e[13]=g,e[14]=y,e[15]=N):N=e[15];let b;e[16]!==i?(b=s.jsx(ct,{className:"max-w-64",children:i}),e[16]=i,e[17]=b):b=e[17];let v;e[18]!==N||e[19]!==b?(v=s.jsxs(dt,{children:[N,b]}),e[18]=N,e[19]=b,e[20]=v):v=e[20];let S;e[21]!==l||e[22]!==m?(S=l&&s.jsx("button",{type:"button","aria-label":m,onClick:l,className:"-ml-1 mr-1 flex size-5 items-center justify-center rounded opacity-0 hover:bg-sidebar-accent focus-ring focus-visible:opacity-100 group-hover/app-tab:opacity-100",children:s.jsx(Br,{className:"size-3"})}),e[21]=l,e[22]=m,e[23]=S):S=e[23];let j;return e[24]!==v||e[25]!==S||e[26]!==p?(j=s.jsxs("div",{className:p,children:[v,S]}),e[24]=v,e[25]=S,e[26]=p,e[27]=j):j=e[27],j}function Pc(t){const e=ce.c(71),{name:n,mainName:r,appUrl:i,ready:d,failed:a,notStarted:o,onStart:c,className:l,onClose:m}=t,f=Pe(),[p,x]=T.useState("/"),[h,E]=T.useState("desktop"),[g,y]=T.useState(0),N=T.useRef(null);let b;e[0]!==i||e[1]!==p?(b=i?xo(i,p):null,e[0]=i,e[1]=p,e[2]=b):b=e[2];const v=b;let S;e[3]!==l?(S=De("flex min-h-0 min-w-0 flex-1 flex-col",l),e[3]=l,e[4]=S):S=e[4];let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=Y=>{Y.preventDefault(),x(N.current?.value||"/")},e[5]=j):j=e[5];let k;e[6]!==n||e[7]!==f?(k=f("sandbox.appPane.path",{app:n}),e[6]=n,e[7]=f,e[8]=k):k=e[8];let P;e[9]!==p||e[10]!==k?(P=s.jsx("form",{className:"min-w-0 flex-1",onSubmit:j,children:s.jsx("input",{ref:N,defaultValue:p,"aria-label":k,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]=p,e[10]=k,e[11]=P):P=e[11];let C;e[12]!==h||e[13]!==f?(C=f(h==="desktop"?"sandbox.preview.deviceMobile":"sandbox.preview.deviceDesktop"),e[12]=h,e[13]=f,e[14]=C):C=e[14];let A;e[15]===Symbol.for("react.memo_cache_sentinel")?(A=()=>E(Ec),e[15]=A):A=e[15];let R;e[16]!==h?(R=h==="desktop"?s.jsx(gr,{}):s.jsx(hr,{}),e[16]=h,e[17]=R):R=e[17];let L;e[18]!==C||e[19]!==R?(L=s.jsx(ot,{label:C,onClick:A,children:R}),e[18]=C,e[19]=R,e[20]=L):L=e[20];let O;e[21]!==n||e[22]!==f?(O=f("sandbox.appPane.reload",{app:n}),e[21]=n,e[22]=f,e[23]=O):O=e[23];const _=!v||!d;let B,z;e[24]===Symbol.for("react.memo_cache_sentinel")?(B=()=>y(jc),z=s.jsx(Ca,{}),e[24]=B,e[25]=z):(B=e[24],z=e[25]);let H;e[26]!==O||e[27]!==_?(H=s.jsx(ot,{label:O,disabled:_,onClick:B,children:z}),e[26]=O,e[27]=_,e[28]=H):H=e[28];let I;e[29]!==n||e[30]!==f?(I=f("sandbox.appPane.openInNewTab",{app:n}),e[29]=n,e[30]=f,e[31]=I):I=e[31];const W=!v||!d;let U;e[32]!==v?(U=()=>v&&window.open(v,"_blank","noopener"),e[32]=v,e[33]=U):U=e[33];let G;e[34]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(cr,{}),e[34]=G):G=e[34];let te;e[35]!==I||e[36]!==W||e[37]!==U?(te=s.jsx(ot,{label:I,disabled:W,onClick:U,children:G}),e[35]=I,e[36]=W,e[37]=U,e[38]=te):te=e[38];let D;e[39]!==n||e[40]!==m||e[41]!==f?(D=m&&s.jsx(ot,{label:f("sandbox.appPane.close",{app:n}),onClick:m,children:s.jsx(Br,{})}),e[39]=n,e[40]=m,e[41]=f,e[42]=D):D=e[42];let $;e[43]!==H||e[44]!==te||e[45]!==D||e[46]!==P||e[47]!==L?($=s.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:[P,L,H,te,D]}),e[43]=H,e[44]=te,e[45]=D,e[46]=P,e[47]=L,e[48]=$):$=e[48];let F;e[49]!==r||e[50]!==f?(F=f("sandbox.appPane.previewOnly",{app:r}),e[49]=r,e[50]=f,e[51]=F):F=e[51];let J;e[52]!==F?(J=s.jsx("p",{className:"shrink-0 truncate border-b border-border bg-muted/40 px-3 py-1.5 text-xs text-muted-foreground",children:F}),e[52]=F,e[53]=J):J=e[53];let M;e[54]!==h||e[55]!==a||e[56]!==r||e[57]!==n||e[58]!==o||e[59]!==c||e[60]!==d||e[61]!==g||e[62]!==v||e[63]!==f?(M=s.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:d&&o?s.jsxs("div",{className:"flex flex-col items-center gap-3 self-center px-6 text-center",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:f("sandbox.appPane.notStarted",{app:n})}),s.jsx(Me,{size:"sm",variant:"outline",onClick:c,children:f("sandbox.appPane.start",{app:n})})]}):!d||!v?s.jsx("p",{className:"self-center px-6 text-center text-sm text-muted-foreground",children:d?f("sandbox.appPane.noUrl"):a?f("sandbox.appPane.failed",{app:r}):f("sandbox.appPane.waiting")}):s.jsx("iframe",{src:v,title:n,className:De("h-full bg-background",h==="mobile"?"w-[412px] max-w-full border-x border-border":"w-full")},`${v}#${g}`)}),e[54]=h,e[55]=a,e[56]=r,e[57]=n,e[58]=o,e[59]=c,e[60]=d,e[61]=g,e[62]=v,e[63]=f,e[64]=M):M=e[64];let V;return e[65]!==n||e[66]!==S||e[67]!==$||e[68]!==J||e[69]!==M?(V=s.jsxs("section",{"aria-label":n,className:S,children:[$,J,M]}),e[65]=n,e[66]=S,e[67]=$,e[68]=J,e[69]=M,e[70]=V):V=e[70],V}function jc(t){return t+1}function Ec(t){return t==="desktop"?"mobile":"desktop"}function ot(t){const e=ce.c(11),{label:n,children:r,active:i,disabled:d,onClick:a}=t;let o;e[0]!==i||e[1]!==r||e[2]!==d||e[3]!==n||e[4]!==a?(o=s.jsx(lt,{asChild:!0,children:s.jsx(We,{"aria-label":n,"aria-pressed":i,active:i,disabled:d,onClick:a,children:r})}),e[0]=i,e[1]=r,e[2]=d,e[3]=n,e[4]=a,e[5]=o):o=e[5];let c;e[6]!==n?(c=s.jsx(ct,{children:n}),e[6]=n,e[7]=c):c=e[7];let l;return e[8]!==o||e[9]!==c?(l=s.jsxs(dt,{children:[o,c]}),e[8]=o,e[9]=c,e[10]=l):l=e[10],l}const Nc=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},Tc=1e4,Cc=1e4,Rc=5e3,Lc=2;function Ac(t,e){return t&&e===0?Cc:Math.min(1e3*2**Math.max(0,e-1),Rc)}function _c(t,e,n){return e?!0:t===!0&&n<Lc}function Oc(t,e){const n=ce.c(11),r=Nc,i=Ra();let d;n[0]!==t?(d=ir.localAppReachable(t??""),n[0]=t,n[1]=d):d=n[1];const a=d;let o;n[2]!==r||n[3]!==i||n[4]!==a||n[5]!==t?(o=async f=>{const{signal:p}=f,x=new AbortController,h=()=>x.abort();p.addEventListener("abort",h);const E=setTimeout(h,Tc),g=await r(t,x.signal).catch(Bc);clearTimeout(E),p.removeEventListener("abort",h);const y=i.getQueryData(a),N=g?0:(y?.failures??0)+1;return{up:_c(y?.up??null,g,N),failures:N}},n[2]=r,n[3]=i,n[4]=a,n[5]=t,n[6]=o):o=n[6];const c=!!t;let l;n[7]!==a||n[8]!==o||n[9]!==c?(l={queryKey:a,queryFn:o,enabled:c,retry:!1,staleTime:0,gcTime:0,refetchInterval:Dc},n[7]=a,n[8]=o,n[9]=c,n[10]=l):l=n[10];const{data:m}=La(l);return t?m?.up??null:null}function Dc(t){return t.state.data?Ac(t.state.data.up,t.state.data.failures):!1}function Bc(){return!1}function $c(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 Md(t){const e=ce.c(53),{virtualMcpId:n}=t,r=Pe(),i=ii(n),{connection:d}=Tr(n),{activeTask:a,taskId:o,currentBranch:c}=Rt(),l=Co(o),[m,f]=T.useState(!1),p=nn(n,c);let x;e[0]!==p||e[1]!==d?(x=d?He(p):null,e[0]=p,e[1]=d,e[2]=x):x=e[2];const h=x,E=Oc(h),g=Mr(),y=bo("multi_app_preview");if(ko({threadId:o,sandboxBranch:a?.branch??c,agentHasRepo:En(i?.metadata),threadHasRepo:En(l)||En(a?.metadata)})==="none"&&!d){let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(Is,{className:"size-7 text-foreground"})}),e[3]=j):j=e[3];let k;e[4]!==r?(k=r("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=r,e[5]=k):k=e[5];let P;e[6]!==r?(P=r("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=r,e[7]=P):P=e[7];let C,A;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=()=>f(!0),A=s.jsx(Is,{className:"size-4"}),e[8]=C,e[9]=A):(C=e[8],A=e[9]);let R;e[10]!==r?(R=r("mainPanelTabs.previewTab.connectGithub"),e[10]=r,e[11]=R):R=e[11];let L;e[12]!==R?(L=s.jsxs(Me,{onClick:C,children:[A,R]}),e[12]=R,e[13]=L):L=e[13];let O;e[14]!==k||e[15]!==P||e[16]!==L?(O=s.jsx(yo,{className:"h-full",image:j,title:k,description:P,actions:L}),e[14]=k,e[15]=P,e[16]=L,e[17]=O):O=e[17];let _;e[18]!==m?(_=s.jsx(wo,{open:m,onOpenChange:f,mode:"agent"}),e[18]=m,e[19]=_):_=e[19];let B;return e[20]!==_||e[21]!==O?(B=s.jsxs(s.Fragment,{children:[O,_]}),e[20]=_,e[21]=O,e[22]=B):B=e[22],B}if(d&&i&&!He(p)){let j;e[23]!==g||e[24]!==p?(j=$c({backend:p,access:g}),e[23]=g,e[24]=p,e[25]=j):j=e[25];let k;e[26]!==d.endpoint?(k=Ni(d.endpoint),e[26]=d.endpoint,e[27]=k):k=e[27];let P;return e[28]!==j||e[29]!==k?(P=s.jsx(Fc,{status:j,host:k}),e[28]=j,e[29]=k,e[30]=P):P=e[30],P}if(h&&E!==!0){let j;e[31]!==r?(j=r("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=r,e[32]=j):j=e[32];let k;e[33]!==h||e[34]!==r?(k=r("mainPanelTabs.previewTab.localAppWaiting.body",{host:Mc(h)}),e[33]=h,e[34]=r,e[35]=k):k=e[35];let P;e[36]!==k?(P=s.jsx(en,{text:k}),e[36]=k,e[37]=P):P=e[37];let C;e[38]!==r?(C=r("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=r,e[39]=C):C=e[39];let A;e[40]!==C?(A=s.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:C}),e[40]=C,e[41]=A):A=e[41];let R;return e[42]!==j||e[43]!==P||e[44]!==A?(R=s.jsx(tn,{headingLevel:2,waiting:!0,title:j,lead:P,footer:A}),e[42]=j,e[43]=P,e[44]=A,e[45]=R):R=e[45],R}let b;e[46]!==n?(b=s.jsx(yc,{virtualMcpId:n}),e[46]=n,e[47]=b):b=e[47];const v=b;let S;return e[48]!==i||e[49]!==y||e[50]!==v||e[51]!==d?(S=s.jsx(Ia,{children:y&&i&&!d?s.jsx(wc,{project:i,maxApps:mo,children:v}):v}),e[48]=i,e[49]=y,e[50]=v,e[51]=d,e[52]=S):S=e[52],S}function Mc(t){try{return new URL(t).host}catch{return t}}function Fc(t){const e=ce.c(20),{status:n,host:r}=t,i=Pe();if(n.kind==="connected"){let o;e[0]!==i?(o=i("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=i,e[1]=o):o=e[1];let c;e[2]!==i?(c=i("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=i,e[3]=c):c=e[3];let l;e[4]!==c?(l=s.jsx(en,{text:c}),e[4]=c,e[5]=l):l=e[5];let m;e[6]!==i?(m=i("mainPanelTabs.previewTab.localhostNoPreview.step.title"),e[6]=i,e[7]=m):m=e[7];let f;e[8]!==m?(f=[{title:m,command:`${Er} --preview localhost:3000`}],e[8]=m,e[9]=f):f=e[9];let p;return e[10]!==o||e[11]!==l||e[12]!==f?(p=s.jsx(tn,{headingLevel:2,waiting:!1,title:o,lead:l,steps:f}),e[10]=o,e[11]=l,e[12]=f,e[13]=p):p=e[13],p}let d;e[14]!==r||e[15]!==n?(d=Oo(n,r),e[14]=r,e[15]=n,e[16]=d):d=e[16];let a;return e[17]!==r||e[18]!==d?(a=s.jsx(_o,{wait:d,hosts:r}),e[17]=r,e[18]=d,e[19]=a):a=e[19],a}export{_o as L,Md as P,tn as S,$d as u};
|