decocms 4.540.1 → 4.542.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.
Files changed (454) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-ClFvSa3l.js → ActiveShapeUtils-ppN64tl0.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-Cxr7gZFk.js → AlertCircle-RV4AM_8y.js} +1 -1
  3. package/dist/client/assets/{AreaChart-DgmDRfhz.js → AreaChart-B5eHYCMZ.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-5wkW-hEo.js → ArrowLeft-XO66B9Td.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-ze_LLfn6.js → ArrowUp-DpQ-09y4.js} +1 -1
  6. package/dist/client/assets/{BarChart-Toa6_kFI.js → BarChart-rvb3yNLn.js} +1 -1
  7. package/dist/client/assets/{Building02-D7vWgCSn.js → Building02-NRzC_IEp.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-DPKynmNL.js → CartesianChart-BVsrzbFJ.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-8cAW3ovr.js → CategoricalChart-64zykerQ.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-Dap6CDoz.js → CheckCircle-CfYD_Bi6.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-BOIt7T3u.js → ChevronSelectorVertical-C5MARPJN.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-B635wgc1.js → ChevronUp-xR4eZngE.js} +1 -1
  13. package/dist/client/assets/{Copy01-D5FEj5_l.js → Copy01-Dy1KrWO0.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-CwcYwmjF.js → CreditCard01-DVN26JVZ.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-BlJdlZxy.js → DotsVertical-CncVW4wJ.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-VBsMY4mL.js → ErrorBarContext-C5dp8Quc.js} +1 -1
  17. package/dist/client/assets/{Globe04-BvpBdv-m.js → Globe04-BxFc3HLH.js} +1 -1
  18. package/dist/client/assets/{Image01-aiwVgEhl.js → Image01-CaawlkVR.js} +1 -1
  19. package/dist/client/assets/{Key01-Bxg4WT0j.js → Key01-FaGRi3tG.js} +1 -1
  20. package/dist/client/assets/{Link01-CcXDwgg2.js → Link01-B_YWUHoH.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-CAGHvVZ6.js → LinkBroken01-z_Mm0CSf.js} +1 -1
  22. package/dist/client/assets/{Minus-Dsn0b7GK.js → Minus-yAYwM_Ty.js} +1 -1
  23. package/dist/client/assets/{Monitor01-DKCvSUp5.js → Monitor01-Bl7f7T5L.js} +1 -1
  24. package/dist/client/assets/{Play-vsKk_Jz0.js → Play-OByKGnTy.js} +1 -1
  25. package/dist/client/assets/{Plus-Bra09L11.js → Plus-Ccck99Do.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-CaDDFuom.js → ReferenceLine-BxNBuCjR.js} +1 -1
  27. package/dist/client/assets/{SearchMd-CcaPghb6.js → SearchMd-BAGHgvYw.js} +1 -1
  28. package/dist/client/assets/{Sector-Dgqo2T4d.js → Sector-BCmuavOw.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-CLHHYXzS.js → ShoppingBag01-BhoOjVkp.js} +1 -1
  30. package/dist/client/assets/{Sun-D80Oomy0.js → Sun-CZRF_565.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-CucWWNd0.js → SwitchHorizontal01-Ce37vA9c.js} +1 -1
  32. package/dist/client/assets/{Tool01-Btqju7fM.js → Tool01-CHLDtlIL.js} +1 -1
  33. package/dist/client/assets/{Trash01-BrSYsLgM.js → Trash01-BQBP0tUM.js} +1 -1
  34. package/dist/client/assets/{Upload01-DRsgvg8v.js → Upload01-D_q00M49.js} +1 -1
  35. package/dist/client/assets/{UserSquare-D2LgcI23.js → UserSquare-BSsT3MHy.js} +1 -1
  36. package/dist/client/assets/{Users01-YRcnRYKP.js → Users01-C6bE7RDt.js} +1 -1
  37. package/dist/client/assets/{XClose-CjCoL-G7.js → XClose-BjZnEBvF.js} +1 -1
  38. package/dist/client/assets/Zap-CHuT8W6R.js +1 -0
  39. package/dist/client/assets/{ZoomOut-CLslRLDT.js → ZoomOut-CBOWQYet.js} +1 -1
  40. package/dist/client/assets/{access-gate-NRvGMpYz.js → access-gate-BU0Til0A.js} +1 -1
  41. package/dist/client/assets/{add-connection-dialog-ArB48aBC.js → add-connection-dialog-BB5lDWHR.js} +1 -1
  42. package/dist/client/assets/agent-analytics-DvRSJxx0.js +2 -0
  43. package/dist/client/assets/agent-app-B0uhmcWv.js +1 -0
  44. package/dist/client/assets/agent-assets-DtVY4a5g.js +1 -0
  45. package/dist/client/assets/{agent-automation-F4Fj9gGm.js → agent-automation-DcUA7Zto.js} +2 -2
  46. package/dist/client/assets/agent-automations-C9tGxGRj.js +1 -0
  47. package/dist/client/assets/agent-calendar-D4_LWZH3.js +1 -0
  48. package/dist/client/assets/agent-connect-sources-BJ3ZDaf3.js +1 -0
  49. package/dist/client/assets/agent-deck-CACa1iZR.js +1 -0
  50. package/dist/client/assets/agent-e2e-Cn5SS6MS.js +1 -0
  51. package/dist/client/assets/agent-experiments-TwOhraCy.js +1 -0
  52. package/dist/client/assets/agent-file-W_Lb3P1H.js +1 -0
  53. package/dist/client/assets/agent-hosting-CP_GZV0j.js +1 -0
  54. package/dist/client/assets/agent-icon-nQ1AH9dU.js +1 -0
  55. package/dist/client/assets/agent-library-BvH-Q75b.js +1 -0
  56. package/dist/client/assets/agent-library-file-BC8zk1Dl.js +1 -0
  57. package/dist/client/assets/agent-monitor-UYQNblqG.js +1 -0
  58. package/dist/client/assets/agent-overview-BlaBQIjD.js +1 -0
  59. package/dist/client/assets/{agent-releases-B4WDlEVB.js → agent-releases-CAYqdnuz.js} +2 -2
  60. package/dist/client/assets/agent-settings-Lu1EqGNe.js +1 -0
  61. package/dist/client/assets/agent-site-editor-code-BAyfkSPu.js +2 -0
  62. package/dist/client/assets/agent-site-editor-content-CKgCOX3-.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-CqKZe72W.js → agent-site-editor-dBOL06nH.js} +2 -2
  64. package/dist/client/assets/agent-site-editor-preview-B9oFLAt2.js +1 -0
  65. package/dist/client/assets/agent-view-D-sscasX.js +1 -0
  66. package/dist/client/assets/{agent-view-guard-2IDv_f14.js → agent-view-guard-B4NqxjMv.js} +1 -1
  67. package/dist/client/assets/agents-list-DYMJQcr6.js +1 -0
  68. package/dist/client/assets/{ai-providers-D42POTOI.js → ai-providers-Ci2k4cWf.js} +1 -1
  69. package/dist/client/assets/{alert-sh_9lE1j.js → alert-Bsjmz-OK.js} +1 -1
  70. package/dist/client/assets/{analytics-sections-DOBmjBqZ.js → analytics-sections-Nw_65a4t.js} +1 -1
  71. package/dist/client/assets/{api-keys-E7GGN-1o.js → api-keys-D4BF_tKg.js} +1 -1
  72. package/dist/client/assets/api-keys-D_tuzPJP.js +1 -0
  73. package/dist/client/assets/app-editor-hRLD7Ehq.js +1 -0
  74. package/dist/client/assets/{asset-utils-BGF2krWn.js → asset-utils-BSDCnt-j.js} +1 -1
  75. package/dist/client/assets/{auth-BaCW7whq.js → auth-CK6AyRu5.js} +1 -1
  76. package/dist/client/assets/{auth-catchall-WqLBMkpk.js → auth-catchall-CJTrtQsq.js} +1 -1
  77. package/dist/client/assets/{auth-entry-Df4qDDi6.js → auth-entry-CPeTN7o5.js} +1 -1
  78. package/dist/client/assets/{auth-split-layout-QrwyfUaa.js → auth-split-layout-BGf8-EnP.js} +1 -1
  79. package/dist/client/assets/{authenticate-and-persist-oauth-DVw-HHUy.js → authenticate-and-persist-oauth-Bb8BBbsA.js} +1 -1
  80. package/dist/client/assets/automation-list-row-B9IR9kWn.js +1 -0
  81. package/dist/client/assets/{automation-runs-Dzosp28H.js → automation-runs-DnR9pxm5.js} +1 -1
  82. package/dist/client/assets/automations-Bxg30h3H.js +1 -0
  83. package/dist/client/assets/{autosend-Cyz0grx9.js → autosend-DTWIjCgK.js} +1 -1
  84. package/dist/client/assets/{badge-DXrGf1RH.js → badge-BV7rxTvN.js} +1 -1
  85. package/dist/client/assets/{block-document-DZsMfWjg.js → block-document-CQARMaA2.js} +3 -3
  86. package/dist/client/assets/{blocks-preview-workspace-context-oDr51QB4.js → blocks-preview-workspace-context-C2nnj0H9.js} +1 -1
  87. package/dist/client/assets/{blocks-tab-states-8ODefLbh.js → blocks-tab-states-DhR3pyff.js} +1 -1
  88. package/dist/client/assets/{blog-schema--tzgaEDh.js → blog-schema-YJUL-tEX.js} +1 -1
  89. package/dist/client/assets/{buckets-D4zl2kA5.js → buckets-C4JU-8qW.js} +1 -1
  90. package/dist/client/assets/{build-improve-prompt-doc-B9gVIbTl.js → build-improve-prompt-doc-Bv3kayMV.js} +2 -2
  91. package/dist/client/assets/{calendar-_mtTQBPC.js → calendar-ym6zGcEl.js} +1 -1
  92. package/dist/client/assets/{capability-load-error-CODEJJ02.js → capability-load-error-7V5aWr5c.js} +1 -1
  93. package/dist/client/assets/category-editor-CdId4wR5.js +1 -0
  94. package/dist/client/assets/{cdn-tab-CYZVXn7M.js → cdn-tab-2DyF7VRR.js} +1 -1
  95. package/dist/client/assets/{chart-DciC8HyE.js → chart-eh3rIFzp.js} +1 -1
  96. package/dist/client/assets/{chat-context-q7TqJ1C-.js → chat-context-kqrW-XPR.js} +5 -5
  97. package/dist/client/assets/{chat-draft-DA1-_rtX.js → chat-draft-CRTo5XoS.js} +1 -1
  98. package/dist/client/assets/{checkbox-oUIybZae.js → checkbox-aDQexY19.js} +1 -1
  99. package/dist/client/assets/choose-editor-D9t0sU_N.js +1 -0
  100. package/dist/client/assets/{cli-auth-success-XAbb0SQg.js → cli-auth-success-BSvz1123.js} +1 -1
  101. package/dist/client/assets/{client-icons-Ct-9O-sI.js → client-icons-DGnfsAP4.js} +1 -1
  102. package/dist/client/assets/cms-settings-editor-BCSWQ-Po.js +1 -0
  103. package/dist/client/assets/{collapsible-CF6QTwAQ.js → collapsible-Cx6KFD5C.js} +1 -1
  104. package/dist/client/assets/collection-detail-ZxhaHEpw.js +1 -0
  105. package/dist/client/assets/{collection-display-button-DtZ_r2fC.js → collection-display-button-Bswg3uCR.js} +1 -1
  106. package/dist/client/assets/{collection-search-cs3sNNIu.js → collection-search-B3vfcK1n.js} +1 -1
  107. package/dist/client/assets/{collection-table-wrapper-BvylNn6r.js → collection-table-wrapper-Cs4FMkXQ.js} +1 -1
  108. package/dist/client/assets/{collection-tabs-CS3-Zvq6.js → collection-tabs-BdhCjBRd.js} +1 -1
  109. package/dist/client/assets/{combobox-CpjBTDRG.js → combobox-DXDZmm8e.js} +1 -1
  110. package/dist/client/assets/{command-ChermTHn.js → command-De9pJLwH.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-bNAA5L8t.js → companion-mcps-section-B-ueLE1c.js} +1 -1
  112. package/dist/client/assets/{config-D9RpcTcN.js → config-Bakd4Y8w.js} +1 -1
  113. package/dist/client/assets/{connect-BEDMehlu.js → connect-BMYdSTT8.js} +1 -1
  114. package/dist/client/assets/{connect-layout-DLeNmrtI.js → connect-layout-BpMetD5F.js} +1 -1
  115. package/dist/client/assets/{connect-source-dialog-wF7gjtEV.js → connect-source-dialog-BkUskMwn.js} +1 -1
  116. package/dist/client/assets/{connection-lIRd-x5L.js → connection-C-NllGni.js} +1 -1
  117. package/dist/client/assets/{connection-card-BJPC2LD1.js → connection-card-DZD_rAWh.js} +1 -1
  118. package/dist/client/assets/connection-detail-BRz9FZ83.js +1 -0
  119. package/dist/client/assets/{connection-form-helpers-9iSTOC_0.js → connection-form-helpers-DmavsUyJ.js} +1 -1
  120. package/dist/client/assets/connections-Cj6HJEn1.js +1 -0
  121. package/dist/client/assets/{content-tab-CMOs3pI-.js → content-tab-DkKuIDyy.js} +9 -9
  122. package/dist/client/assets/context-C2r290S4.js +1 -0
  123. package/dist/client/assets/{context-menu-BjIhJNTh.js → context-menu-CiH3Gj0R.js} +1 -1
  124. package/dist/client/assets/context-shell-BwT70eIn.js +36 -0
  125. package/dist/client/assets/{core.esm-pg4Fq_TB.js → core.esm-DQyn-kJS.js} +1 -1
  126. package/dist/client/assets/{create-organization-dialog-Cvs1ExBM.js → create-organization-dialog-CiZys2Ku.js} +1 -1
  127. package/dist/client/assets/{daily-pulse-CBbiZh0k.js → daily-pulse-CMy69HGI.js} +1 -1
  128. package/dist/client/assets/discover-DQ9dXI7n.js +1 -0
  129. package/dist/client/assets/{domain-settings-C-gJGQ4j.js → domain-settings-5g_MWfwe.js} +1 -1
  130. package/dist/client/assets/{drawer-Bqg0yBDx.js → drawer-DDmudFbW.js} +1 -1
  131. package/dist/client/assets/{editor-mPZ0kVNv.js → editor-BqqnxL88.js} +1 -1
  132. package/dist/client/assets/{editor-classes-BpwwAF3C.js → editor-classes-D-ez-qBv.js} +1 -1
  133. package/dist/client/assets/{empty-state-B9oIyVIp.js → empty-state-C7LII3ZM.js} +1 -1
  134. package/dist/client/assets/{empty-state-C79vgg_z.js → empty-state-iEpXVBwd.js} +1 -1
  135. package/dist/client/assets/{experiments-tab-DPfc6GOy.js → experiments-tab-DGo_lvyv.js} +1 -1
  136. package/dist/client/assets/{experiments-tab-choice-8xzKkZlX.js → experiments-tab-choice-B_rL9_Nx.js} +1 -1
  137. package/dist/client/assets/{extract-connection-data-D9hWJKHz.js → extract-connection-data-DYwFbKkm.js} +1 -1
  138. package/dist/client/assets/{feature-gate-BtqZg2be.js → feature-gate-E1LoWMx3.js} +1 -1
  139. package/dist/client/assets/{feature-paywall-D6hFCms_.js → feature-paywall-CDMJv8wq.js} +1 -1
  140. package/dist/client/assets/file-explorer-CsD267WS.js +2 -0
  141. package/dist/client/assets/{file-preview-B1hazn-f.js → file-preview-Cj5pBQv2.js} +1 -1
  142. package/dist/client/assets/{file-share-button-CWVL8de8.js → file-share-button-DOup2WzD.js} +1 -1
  143. package/dist/client/assets/{file-type-icon-CszJOHRP.js → file-type-icon-BgzyV542.js} +1 -1
  144. package/dist/client/assets/folder-icon-DY3kBxQc.js +1 -0
  145. package/dist/client/assets/{form-CpJsHKNZ.js → form-gDNfP07W.js} +1 -1
  146. package/dist/client/assets/{general-CQlaDytM.js → general-CWpdg4Hl.js} +1 -1
  147. package/dist/client/assets/{github-icon-CtxsZ4zj.js → github-icon-DAxkwypb.js} +1 -1
  148. package/dist/client/assets/{held-block-view-CqquZXR8.js → held-block-view-C3Ird9F-.js} +3 -3
  149. package/dist/client/assets/home-TaMnsEq5.js +1 -0
  150. package/dist/client/assets/{hosted-publish-feedback-CutWUEfr.js → hosted-publish-feedback-CVQKURab.js} +1 -1
  151. package/dist/client/assets/{icon-button-i_FWnpGN.js → icon-button-CTmBGRaQ.js} +1 -1
  152. package/dist/client/assets/{index-Du1V-xNi.js → index-15xKR9ar.js} +1 -1
  153. package/dist/client/assets/{index-COnziA0Z.js → index-BWpKrclg.js} +33 -33
  154. package/dist/client/assets/{index-CUvxA4QU.js → index-C-GH7ZUH.js} +1 -1
  155. package/dist/client/assets/{index-BdKCEpsg.js → index-CFDA2Gyk.js} +1 -1
  156. package/dist/client/assets/{index-_xgP5c6W.js → index-CXhEXTV0.js} +1 -1
  157. package/dist/client/assets/{index-Duw_6D72.js → index-Cbe7caeT.js} +1 -1
  158. package/dist/client/assets/{index-Bb3_Vv2S.js → index-Cjtut9JA.js} +1 -1
  159. package/dist/client/assets/{index-Dpy3WDHU.js → index-CzqNFJgA.js} +1 -1
  160. package/dist/client/assets/index-D3fuewCp.js +4 -0
  161. package/dist/client/assets/{index-Bm91KVNh.js → index-DGoeX32I.js} +1 -1
  162. package/dist/client/assets/{index-CmmBgJe2.js → index-DKRm_nGH.js} +2 -2
  163. package/dist/client/assets/{index-BMsnE8rU.js → index-G8_ivZDF.js} +1 -1
  164. package/dist/client/assets/{index-N3lvHn2Z.js → index-Qn_AZuwz.js} +1 -1
  165. package/dist/client/assets/index-_wqQ3Hkr.css +1 -0
  166. package/dist/client/assets/{index-CVG6lJ_v.js → index-lchr3O79.js} +1 -1
  167. package/dist/client/assets/{index-redirect-CWUepeSE.js → index-redirect-COc2iMJs.js} +1 -1
  168. package/dist/client/assets/{index-yKC5LgkM.js → index-ylByMMZI.js} +1 -1
  169. package/dist/client/assets/{infiniteQueryObserver-Bj3tjA3X.js → infiniteQueryObserver-CbIPWgZj.js} +1 -1
  170. package/dist/client/assets/{infra-billing-CeYZXwq2.js → infra-billing-gMBDswwS.js} +1 -1
  171. package/dist/client/assets/{input-BCYkWTfH.js → input-Cf50b9sU.js} +3 -3
  172. package/dist/client/assets/{input-C2ECoWjM.js → input-CgS5sNmj.js} +1 -1
  173. package/dist/client/assets/{integration-icon-DfwU4DVr.js → integration-icon-BQ9jVlvt.js} +1 -1
  174. package/dist/client/assets/{jira-icon-BoR-oDVU.js → jira-icon-CzGOnWKo.js} +1 -1
  175. package/dist/client/assets/{label-BGevM5Zb.js → label-DzRNwB_s.js} +1 -1
  176. package/dist/client/assets/{layout-30w4Crds.js → layout-d2_2jbV9.js} +1 -1
  177. package/dist/client/assets/{legacy-agents-deep-Bg1OmBvu.js → legacy-agents-deep-CyFzwt79.js} +1 -1
  178. package/dist/client/assets/{legacy-main-redirect-C51h-pXK.js → legacy-main-redirect-B0hY-Z0B.js} +1 -1
  179. package/dist/client/assets/library-CS74d8fl.js +1 -0
  180. package/dist/client/assets/library-tab-cQd24fFO.js +162 -0
  181. package/dist/client/assets/{login-BGcTYLxc.js → login-BB7FreRC.js} +1 -1
  182. package/dist/client/assets/{markdown-DGqjdf2p.js → markdown-CkZaCBow.js} +1 -1
  183. package/dist/client/assets/{mcp-app-renderer-CPV0UyxX.js → mcp-app-renderer-BVLr3WK6.js} +1 -1
  184. package/dist/client/assets/{mcp-oauth-Byx9hV1d.js → mcp-oauth-DWlxkjKx.js} +1 -1
  185. package/dist/client/assets/{mcp-oauth-we2DqBn9.js → mcp-oauth-KJGfGjkD.js} +1 -1
  186. package/dist/client/assets/{members-Cg4UJ7N1.js → members-BvQ1xqU5.js} +1 -1
  187. package/dist/client/assets/{memory-CphWYQkc.js → memory-_Oguj4if.js} +1 -1
  188. package/dist/client/assets/{mini-report-page-O_faAMnc.js → mini-report-page-BC7L0ipE.js} +1 -1
  189. package/dist/client/assets/mock-board-BC3rEvaU.js +81 -0
  190. package/dist/client/assets/{monaco-editor-CS14LLrn.js → monaco-editor-zzUPRyBn.js} +1 -1
  191. package/dist/client/assets/monitoring-ilB7hU6H.js +1 -0
  192. package/dist/client/assets/{monitoring-stats-row--haENI5d.js → monitoring-stats-row-DZ9HvRuy.js} +1 -1
  193. package/dist/client/assets/{multi-select-B-zuXpH9.js → multi-select-D2pKycte.js} +1 -1
  194. package/dist/client/assets/{mustache-CQoqMaLT.js → mustache-BBgPaDqo.js} +1 -1
  195. package/dist/client/assets/{named-rule-uses-BFiLyzQ0.js → named-rule-uses-8PEXqP7W.js} +1 -1
  196. package/dist/client/assets/{new-project-dialog-aU8scugU.js → new-project-dialog-Dd5pVssc.js} +1 -1
  197. package/dist/client/assets/{oauth-callback-DKy_B6sS.js → oauth-callback-DIj2YLwh.js} +1 -1
  198. package/dist/client/assets/{oauth-callback-ai-provider-B1IhX-iu.js → oauth-callback-ai-provider-zp6PPNfP.js} +1 -1
  199. package/dist/client/assets/{onboarding-BJKtDuRG.js → onboarding-CSUeJ8OK.js} +1 -1
  200. package/dist/client/assets/openai-conversation-CT9LWWrS.js +3 -0
  201. package/dist/client/assets/{optimistic-project-sidebar-views-ynymb8s7.js → optimistic-project-sidebar-views-BhoNMrVo.js} +1 -1
  202. package/dist/client/assets/{order-monitor-day-DWL08pAX.js → order-monitor-day-D-Ti4NDE.js} +1 -1
  203. package/dist/client/assets/{organization-choice-DUcNXaGm.js → organization-choice-Bs2Llr3r.js} +1 -1
  204. package/dist/client/assets/{orgs-H9UBPKXM.js → orgs-Bs_15YVG.js} +1 -1
  205. package/dist/client/assets/{page-seo-form-DO9Vic5L.js → page-seo-form-DizfAl8r.js} +1 -1
  206. package/dist/client/assets/{pair-BIX6BY2B.js → pair-BFVxcKKp.js} +1 -1
  207. package/dist/client/assets/{parse-sections-BLo4hVcc.js → parse-sections-BVn3AvAz.js} +1 -1
  208. package/dist/client/assets/plan-_57doTJd.js +1 -0
  209. package/dist/client/assets/{plan-ladder-CjIFfgE3.js → plan-ladder-DVSwNgR2.js} +1 -1
  210. package/dist/client/assets/{plan-usage-card-BaLOCqds.js → plan-usage-card-B64WjIMI.js} +1 -1
  211. package/dist/client/assets/{popover-CDni3562.js → popover-ClEv7Zyf.js} +1 -1
  212. package/dist/client/assets/post-calendar-CMHuZuip.js +1 -0
  213. package/dist/client/assets/{post-editor-Bpl8R1AD.js → post-editor-CqgW2_fW.js} +2 -2
  214. package/dist/client/assets/{preview-content-D6Uu7-0I.js → preview-content-BSsfQ6ZE.js} +1 -1
  215. package/dist/client/assets/{preview-dialog-BirKakH8.js → preview-dialog-DBnDC8gE.js} +1 -1
  216. package/dist/client/assets/{preview-panel-pMNaSC76.js → preview-panel-DQBuS4_f.js} +1 -1
  217. package/dist/client/assets/{preview-tab-86IcFjhE.js → preview-tab-_86kIh0E.js} +3 -3
  218. package/dist/client/assets/{product-picker-dialog-QF0K31fY.js → product-picker-dialog-C8oMVTn6.js} +1 -1
  219. package/dist/client/assets/{profile-CeSI4XH9.js → profile-Bsx5sLNH.js} +1 -1
  220. package/dist/client/assets/project-app-view-C5QghQe6.js +1 -0
  221. package/dist/client/assets/project-apps-oe6VMb11.js +1 -0
  222. package/dist/client/assets/{project-feed-WkJFdN5v.js → project-feed-DAjFP_Ib.js} +1 -1
  223. package/dist/client/assets/{project-icon-BjJ8vKrn.js → project-icon-BKeF243f.js} +1 -1
  224. package/dist/client/assets/project-reports-uzkOMqSE.js +1 -0
  225. package/dist/client/assets/project-tasks-jNTlksUk.js +1 -0
  226. package/dist/client/assets/projects-BaKJExhs.js +1 -0
  227. package/dist/client/assets/{projects-empty-state-BfLeCdxn.js → projects-empty-state-B_kHw_MZ.js} +1 -1
  228. package/dist/client/assets/{prompts-CEZb6CxD.js → prompts-Br3MvaH9.js} +1 -1
  229. package/dist/client/assets/record-editor-B5oAS_5D.js +1 -0
  230. package/dist/client/assets/redirect-editor-CSg_SJ3I.js +1 -0
  231. package/dist/client/assets/{releases-api-ByaSp1jR.js → releases-api-DwHPczFb.js} +1 -1
  232. package/dist/client/assets/reports-CL4pYm69.js +1 -0
  233. package/dist/client/assets/{reports-U2_3nuZM.js → reports-iqRQlH1z.js} +1 -1
  234. package/dist/client/assets/reports-onboarding-Bm9Wvkaq.js +1 -0
  235. package/dist/client/assets/reports-tab-DesQ1SQx.js +2 -0
  236. package/dist/client/assets/repositories-C-WO-gxz.js +1 -0
  237. package/dist/client/assets/{repositories-CpQ7e-w5.js → repositories-DUBWep32.js} +1 -1
  238. package/dist/client/assets/{repository-binding-BGeZ0DuT.js → repository-binding-Bpq6heaQ.js} +1 -1
  239. package/dist/client/assets/{repository-import-picker-_KegTBCz.js → repository-import-picker-DxJJpcCz.js} +1 -1
  240. package/dist/client/assets/{repository-picker-CU40xoJ7.js → repository-picker-P8Asvsk4.js} +1 -1
  241. package/dist/client/assets/{require-capability-B4rUwk-N.js → require-capability-B-uxpRvL.js} +1 -1
  242. package/dist/client/assets/{required-auth-layout-C2OmldxX.js → required-auth-layout-DYZU5vk_.js} +1 -1
  243. package/dist/client/assets/{reset-password-DcH680r3.js → reset-password-Bs_JmNWK.js} +1 -1
  244. package/dist/client/assets/{resizable-GdeSoBXC.js → resizable-vbjrp9Su.js} +1 -1
  245. package/dist/client/assets/{resolve-tab-icon-DyiyXAmc.js → resolve-tab-icon-CzFxm7IQ.js} +1 -1
  246. package/dist/client/assets/{review-settings-DWVxOdsw.js → review-settings-CsHCgNLm.js} +1 -1
  247. package/dist/client/assets/roles-C-6Op6OQ.js +1 -0
  248. package/dist/client/assets/route-Bdui6QXz.js +1 -0
  249. package/dist/client/assets/route-BlJ-TDEK.js +1 -0
  250. package/dist/client/assets/route-Cr42SuLO.js +1 -0
  251. package/dist/client/assets/{sandbox-lifecycle-context-D2UA9HUf.js → sandbox-lifecycle-context-D9eDp86x.js} +1 -1
  252. package/dist/client/assets/{schema-CB4Vxu7L.js → schema-Cd1llToh.js} +1 -1
  253. package/dist/client/assets/{schema-BYBruCaH.js → schema-DzZBw0EW.js} +1 -1
  254. package/dist/client/assets/{scroll-area-BUyfS5TA.js → scroll-area-CwuazZb5.js} +1 -1
  255. package/dist/client/assets/{search-input-T7tfUlv8.js → search-input-D2iQ_3lu.js} +1 -1
  256. package/dist/client/assets/{search-toggle-DL7-awnb.js → search-toggle-Cw7hl_Xx.js} +1 -1
  257. package/dist/client/assets/{secret-picker-BslDVKKv.js → secret-picker-Ct1DoTR9.js} +1 -1
  258. package/dist/client/assets/{secrets-Bqd4jPVf.js → secrets-CBPyw7ba.js} +1 -1
  259. package/dist/client/assets/{section-array-field-BWV4uW6Z.js → section-array-field-BXLl3jB0.js} +1 -1
  260. package/dist/client/assets/sections-DRD1aU5D.js +1 -0
  261. package/dist/client/assets/sections-editor-B628EbZ4.js +1 -0
  262. package/dist/client/assets/{select-BaNSHFfS.js → select-BMteQTWS.js} +1 -1
  263. package/dist/client/assets/{select-model-DvLnkRjD.js → select-model-ujDDmA_R.js} +1 -1
  264. package/dist/client/assets/seo-editor-nXgc_X38.js +1 -0
  265. package/dist/client/assets/{separator-D-a0pq5E.js → separator-l2LsOpLi.js} +1 -1
  266. package/dist/client/assets/settings-tab-Cj4D3Abl.js +1 -0
  267. package/dist/client/assets/{sheet-DvSGxi5a.js → sheet-BW-FxyJZ.js} +1 -1
  268. package/dist/client/assets/shell-layout-BbFvnpcf.js +1 -0
  269. package/dist/client/assets/{site-draft-actions-Cy4yCAlU.js → site-draft-actions-9GNFURGo.js} +1 -1
  270. package/dist/client/assets/{site-draft-view-C07YNlzV.js → site-draft-view-DhCorNAk.js} +2 -2
  271. package/dist/client/assets/site-editor-8rMP2pUf.js +1 -0
  272. package/dist/client/assets/{site-editor-toast-CH9jUz3L.js → site-editor-toast-QHleRFN5.js} +1 -1
  273. package/dist/client/assets/skill-md-ChfVs4uF.js +2 -0
  274. package/dist/client/assets/skills-ApZ_uT4M.js +1 -0
  275. package/dist/client/assets/{slider-eIUNwmro.js → slider-DtzvJZ1j.js} +1 -1
  276. package/dist/client/assets/{sortable.esm-ChXVP1eQ.js → sortable.esm-DNzjY6xb.js} +1 -1
  277. package/dist/client/assets/{sso-DdFStQXx.js → sso-Con6Y9JD.js} +1 -1
  278. package/dist/client/assets/{suggestion-s4BFDhSc.js → suggestion-BgdlUdcB.js} +1 -1
  279. package/dist/client/assets/{switch-C0t-igJf.js → switch-Bv0wLEBx.js} +1 -1
  280. package/dist/client/assets/{symbol-BT27QHWj.js → symbol-CJoI4vsX.js} +1 -1
  281. package/dist/client/assets/{synced-repos-CqoJDfXB.js → synced-repos-Bdx0Lzti.js} +1 -1
  282. package/dist/client/assets/{tab-icon-glyph-BWPb5Xfp.js → tab-icon-glyph-CSlj-TVq.js} +1 -1
  283. package/dist/client/assets/{table-KCysjL80.js → table-CheWM6KL.js} +1 -1
  284. package/dist/client/assets/{tabs-CoLoYhlT.js → tabs-CjWwohzM.js} +1 -1
  285. package/dist/client/assets/{task-assignee-avatar-DAh0DA3d.js → task-assignee-avatar-DwSiTsoy.js} +1 -1
  286. package/dist/client/assets/{task-board-CrNZ__0e.js → task-board-L6ZGzY-s.js} +1 -1
  287. package/dist/client/assets/{task-route-DKvZDUIz.js → task-route-D7Tzzgt_.js} +1 -1
  288. package/dist/client/assets/{task-status-Ra7_uhYM.js → task-status-FHJjKh4u.js} +1 -1
  289. package/dist/client/assets/taskboard-analytics-kV8i_37N.js +1 -0
  290. package/dist/client/assets/{tasks-CUiZakj6.js → tasks-3fvPlwxK.js} +3 -3
  291. package/dist/client/assets/tasks-BImUOCfZ.js +1 -0
  292. package/dist/client/assets/{textarea-C_fBPqU6.js → textarea-BNvvIWSZ.js} +1 -1
  293. package/dist/client/assets/thread-analytics-DOn_63z0.js +1 -0
  294. package/dist/client/assets/{thread-intent-4tNJ-MPs.js → thread-intent-DjvP3GsU.js} +1 -1
  295. package/dist/client/assets/thread-route-B3uNqVbb.js +1 -0
  296. package/dist/client/assets/{thread-route-Bnw3gplh.js → thread-route-BOOkt7de.js} +1 -1
  297. package/dist/client/assets/{thread-sheet-body-BwIWxLs3.js → thread-sheet-body-sjcfE700.js} +1 -1
  298. package/dist/client/assets/{time-range-picker-DXIxiKEP.js → time-range-picker-BostqQTB.js} +1 -1
  299. package/dist/client/assets/{toggle-group-ythhcZKM.js → toggle-group-BAFBdL9F.js} +1 -1
  300. package/dist/client/assets/{tool-namespace-BTv6Xybs.js → tool-namespace-CG1Oreso.js} +1 -1
  301. package/dist/client/assets/{toolbar-icon-button-dgGE6Jet.js → toolbar-icon-button-CnXJyVJt.js} +1 -1
  302. package/dist/client/assets/{tooltip-D8ZXcwhe.js → tooltip-D2ANqV2w.js} +1 -1
  303. package/dist/client/assets/{tooltipContext-DziaRNob.js → tooltipContext-DvKfbID4.js} +1 -1
  304. package/dist/client/assets/{track-D30a8sx3.js → track-BA-6upge.js} +1 -1
  305. package/dist/client/assets/{types-CofNWIMh.js → types-BNmsSext.js} +1 -1
  306. package/dist/client/assets/{url-slug-se91w2Rf.js → url-slug-DcB6_J0W.js} +1 -1
  307. package/dist/client/assets/{usage-stats-B8cFnQJA.js → usage-stats-I2nqy87E.js} +1 -1
  308. package/dist/client/assets/{use-ai-providers-DTLn4WND.js → use-ai-providers-BcLfhqAn.js} +1 -1
  309. package/dist/client/assets/{use-apply-named-rule-HLQawGs9.js → use-apply-named-rule-CdtINk0A.js} +1 -1
  310. package/dist/client/assets/{use-automations-BgkyRpI7.js → use-automations-DX8SlLEI.js} +1 -1
  311. package/dist/client/assets/{use-autosave-Bdhhmkhm.js → use-autosave-c4cGzjJa.js} +1 -1
  312. package/dist/client/assets/{use-chat-layout-state-DNSQAhNn.js → use-chat-layout-state-CyqukwDV.js} +1 -1
  313. package/dist/client/assets/{use-clock-tick-CRkdqRFq.js → use-clock-tick-CXtcWsca.js} +1 -1
  314. package/dist/client/assets/{use-cms-publish-actions-ijHf3SXF.js → use-cms-publish-actions-BDOdjoX5.js} +1 -1
  315. package/dist/client/assets/{use-connect-companion-CrnfY-x7.js → use-connect-companion-pjD5dMZl.js} +1 -1
  316. package/dist/client/assets/{use-connection-BOMkN6q_.js → use-connection-CZNQu-z2.js} +1 -1
  317. package/dist/client/assets/{use-copy-D-ZLjAxF.js → use-copy-Bq-mz0ld.js} +1 -1
  318. package/dist/client/assets/{use-create-virtual-mcp-BTQTbo6V.js → use-create-virtual-mcp-BVwiobb2.js} +1 -1
  319. package/dist/client/assets/{use-date-fns-locale-B5UxfCyN.js → use-date-fns-locale-CLYhNSnw.js} +1 -1
  320. package/dist/client/assets/{use-debounced-autosave-CSj5KwPH.js → use-debounced-autosave-Cxe8yde_.js} +1 -1
  321. package/dist/client/assets/{use-debounced-value-tZ4DXPdN.js → use-debounced-value-CqLWq6L2.js} +1 -1
  322. package/dist/client/assets/{use-deco-credits-C0z_exCV.js → use-deco-credits-C26dK60_.js} +1 -1
  323. package/dist/client/assets/{use-decopilot-events-CsyvAJLs.js → use-decopilot-events-Dg011Qgn.js} +1 -1
  324. package/dist/client/assets/{use-delete-connection-fTuP_lVU.js → use-delete-connection-DzeFDNj4.js} +1 -1
  325. package/dist/client/assets/{use-deployment-admin-_9kJl1R4.js → use-deployment-admin-COukxauw.js} +1 -1
  326. package/dist/client/assets/{use-entitlements-Bek8GQfU.js → use-entitlements-Bxptpo8e.js} +1 -1
  327. package/dist/client/assets/{use-fast-preview-draft-url-TbXAala5.js → use-fast-preview-draft-url-DWrGmO4E.js} +1 -1
  328. package/dist/client/assets/{use-file-configs-BPOIBiEJ.js → use-file-configs-DAoix9gu.js} +1 -1
  329. package/dist/client/assets/{use-inbox-feed-CEGPGrQS.js → use-inbox-feed-CEHyMhUC.js} +1 -1
  330. package/dist/client/assets/{use-infinite-scroll-BK7m1Rbc.js → use-infinite-scroll-CojsIRJO.js} +1 -1
  331. package/dist/client/assets/{use-join-requests-DSY52QIf.js → use-join-requests-GMVGPaSk.js} +1 -1
  332. package/dist/client/assets/{use-main-panel-tabs-DKwC6O2O.js → use-main-panel-tabs-DXx3VvH2.js} +1 -1
  333. package/dist/client/assets/{use-mcp-auth-status-DZTmNHLl.js → use-mcp-auth-status-CvV54_ol.js} +1 -1
  334. package/dist/client/assets/{use-mcp-client-CNQ2UmVO.js → use-mcp-client-zIBQco5Q.js} +1 -1
  335. package/dist/client/assets/{use-mcp-prompts-DDgSZA70.js → use-mcp-prompts-XayY9yfQ.js} +1 -1
  336. package/dist/client/assets/{use-mcp-tools-F7OlrZvj.js → use-mcp-tools-BmZF8fTN.js} +1 -1
  337. package/dist/client/assets/{use-mobile-DccFwPqc.js → use-mobile-CoPLJ8cu.js} +1 -1
  338. package/dist/client/assets/{use-move-blocks-ClZ1itdH.js → use-move-blocks-Ck5rS_vn.js} +1 -1
  339. package/dist/client/assets/{use-navigate-to-agent-D_4FOoK_.js → use-navigate-to-agent-DqWY18b4.js} +1 -1
  340. package/dist/client/assets/{use-org-fs-DlkRCXe3.js → use-org-fs-B4wvUwJj.js} +1 -1
  341. package/dist/client/assets/{use-org-repo-syncs-Cr5sGILp.js → use-org-repo-syncs-D-0WnIj6.js} +1 -1
  342. package/dist/client/assets/{use-org-sso-_0yCR_2x.js → use-org-sso-sTi3oL5_.js} +1 -1
  343. package/dist/client/assets/{use-organization-roles-DjEiTO-o.js → use-organization-roles-DXXkhsvq.js} +1 -1
  344. package/dist/client/assets/{use-organization-settings-DApKHEhs.js → use-organization-settings-D_5fr-OI.js} +1 -1
  345. package/dist/client/assets/{use-panel-navigate-DEzceHY3.js → use-panel-navigate-nriEb2Qz.js} +1 -1
  346. package/dist/client/assets/{use-project-native-view-presence-CzFo9pRQ.js → use-project-native-view-presence-Bdl4n5BM.js} +1 -1
  347. package/dist/client/assets/use-project-scope-CdqclLu1.js +1 -0
  348. package/dist/client/assets/{use-recent-apps-BJGzapK6.js → use-recent-apps-6oU0G5sy.js} +1 -1
  349. package/dist/client/assets/{use-releases-CRrtlof1.js → use-releases-CjPNvHz7.js} +1 -1
  350. package/dist/client/assets/{use-reports-diagnostic-kKOlKnuD.js → use-reports-diagnostic-CbLn3JeW.js} +1 -1
  351. package/dist/client/assets/{use-sandbox-events-CBidgN1S.js → use-sandbox-events-C3mgE5Ut.js} +1 -1
  352. package/dist/client/assets/{use-secrets-CF7cOK-X.js → use-secrets-DMgYR7J2.js} +1 -1
  353. package/dist/client/assets/{use-section-preview-base-aV2rnRKl.js → use-section-preview-base-CJSLbEeV.js} +1 -1
  354. package/dist/client/assets/{use-session-runtime-DAUgnVml.js → use-session-runtime-HJpkQoy0.js} +1 -1
  355. package/dist/client/assets/{use-sidebar-collapsed-BWB98fPF.js → use-sidebar-collapsed-DGKLEITN.js} +1 -1
  356. package/dist/client/assets/{use-tags-C9Y_8zUq.js → use-tags-C5S50qhF.js} +1 -1
  357. package/dist/client/assets/{use-task-board-analytics-D0U09TNC.js → use-task-board-analytics-BhLHNvA-.js} +1 -1
  358. package/dist/client/assets/{use-task-board-events-BnMcxz87.js → use-task-board-events-CWQQpnEy.js} +1 -1
  359. package/dist/client/assets/{use-task-board-item-prs-Cm4keV8Q.js → use-task-board-item-prs-a7ezuDRL.js} +1 -1
  360. package/dist/client/assets/use-task-board-prompts-DonCfR5m.js +1 -0
  361. package/dist/client/assets/{use-task-metadata-OcqiZ2kJ.js → use-task-metadata-MAOPH7xT.js} +1 -1
  362. package/dist/client/assets/use-thread-analytics-B2fKyMxQ.js +1 -0
  363. package/dist/client/assets/{use-thread-outputs-ozdLQUlC.js → use-thread-outputs-vH0sJUqm.js} +1 -1
  364. package/dist/client/assets/useInfiniteQuery-CFafSHXd.js +1 -0
  365. package/dist/client/assets/{useQueries-TfPC02wF.js → useQueries-Qve4MUYw.js} +1 -1
  366. package/dist/client/assets/useSuspenseInfiniteQuery-D_oVQ9bL.js +1 -0
  367. package/dist/client/assets/{users-CM3rnXWW.js → users-DHtbHEKw.js} +1 -1
  368. package/dist/client/assets/{utils-CsFkMYtG.js → utils-BoR7m7ir.js} +1 -1
  369. package/dist/client/assets/variant-calendar-DSZCP6Sl.js +1 -0
  370. package/dist/client/assets/{variant-matcher-override-CbINPKEm.js → variant-matcher-override-Cvh79vYa.js} +1 -1
  371. package/dist/client/assets/{view-header-CZ36cUo3.js → view-header-DTW0kjf6.js} +1 -1
  372. package/dist/client/assets/{virtual-mcp-C73-2MCU.js → virtual-mcp-RiqyMxQd.js} +1 -1
  373. package/dist/client/assets/{watch-sse-pool-CbGDmnzl.js → watch-sse-pool-6veZzsu7.js} +1 -1
  374. package/dist/client/index.html +2 -2
  375. package/dist/server/server.js +1 -1
  376. package/package.json +1 -1
  377. package/dist/client/assets/agent-analytics-BcCIFcf5.js +0 -2
  378. package/dist/client/assets/agent-app-BTGawEAl.js +0 -1
  379. package/dist/client/assets/agent-assets-BJxi96mC.js +0 -1
  380. package/dist/client/assets/agent-automations-DPdxPC74.js +0 -1
  381. package/dist/client/assets/agent-calendar-DmZ4-S9J.js +0 -1
  382. package/dist/client/assets/agent-connect-sources-DiS5leUi.js +0 -1
  383. package/dist/client/assets/agent-deck-oywJhoOr.js +0 -1
  384. package/dist/client/assets/agent-e2e-Ckvaovne.js +0 -1
  385. package/dist/client/assets/agent-experiments-CDSby3Jb.js +0 -1
  386. package/dist/client/assets/agent-file-Bi6WzPE2.js +0 -1
  387. package/dist/client/assets/agent-hosting-DwY3IDTG.js +0 -1
  388. package/dist/client/assets/agent-icon-r8Z1kQx0.js +0 -1
  389. package/dist/client/assets/agent-library-Bo9r99Ao.js +0 -1
  390. package/dist/client/assets/agent-library-file-BD-Hx5H6.js +0 -1
  391. package/dist/client/assets/agent-monitor-B6G8_tf4.js +0 -1
  392. package/dist/client/assets/agent-overview-BNTC3CuC.js +0 -1
  393. package/dist/client/assets/agent-settings-DrwNvgfn.js +0 -1
  394. package/dist/client/assets/agent-site-editor-code-epc2EIGV.js +0 -2
  395. package/dist/client/assets/agent-site-editor-content-DErZLUCZ.js +0 -1
  396. package/dist/client/assets/agent-site-editor-preview-CvNjulHl.js +0 -1
  397. package/dist/client/assets/agent-view-5PmLTSLw.js +0 -1
  398. package/dist/client/assets/agents-list-D0i0UyzK.js +0 -1
  399. package/dist/client/assets/api-keys-DZ0ezHTq.js +0 -1
  400. package/dist/client/assets/app-editor-BmJSiobK.js +0 -1
  401. package/dist/client/assets/automation-list-row-CdYjXTyX.js +0 -1
  402. package/dist/client/assets/automations-C4dbgmbr.js +0 -1
  403. package/dist/client/assets/category-editor-BLrXoVj7.js +0 -1
  404. package/dist/client/assets/choose-editor-CN33p2Cz.js +0 -1
  405. package/dist/client/assets/cms-settings-editor-DB-2MJgt.js +0 -1
  406. package/dist/client/assets/collection-detail-QFm_ohuF.js +0 -1
  407. package/dist/client/assets/column-rules-B3scTGJn.js +0 -3
  408. package/dist/client/assets/connection-detail-BQIiIdK2.js +0 -1
  409. package/dist/client/assets/connections-omwMleY5.js +0 -1
  410. package/dist/client/assets/context-BPegQD0y.js +0 -1
  411. package/dist/client/assets/context-shell-OvxUfcFS.js +0 -197
  412. package/dist/client/assets/discover-CA-2TqxK.js +0 -1
  413. package/dist/client/assets/file-explorer-EUveJAIL.js +0 -2
  414. package/dist/client/assets/folder-icon-BrFOzh35.js +0 -2
  415. package/dist/client/assets/home-xrjnwP6i.js +0 -1
  416. package/dist/client/assets/index-Bwvnt-S2.js +0 -4
  417. package/dist/client/assets/index-By_-wb1N.css +0 -1
  418. package/dist/client/assets/library-b-ntlbXh.js +0 -1
  419. package/dist/client/assets/mock-board-CQktgxk_.js +0 -81
  420. package/dist/client/assets/monitoring-C3Ch6Teo.js +0 -1
  421. package/dist/client/assets/openai-conversation-BZT74_io.js +0 -3
  422. package/dist/client/assets/plan-DKLSpJYQ.js +0 -1
  423. package/dist/client/assets/post-calendar-Ds_fWL4E.js +0 -1
  424. package/dist/client/assets/project-app-view-D0bkuBLc.js +0 -1
  425. package/dist/client/assets/project-apps-lRXyFM1r.js +0 -1
  426. package/dist/client/assets/project-reports-W6KiESHB.js +0 -1
  427. package/dist/client/assets/project-tasks-CH9CIFPr.js +0 -1
  428. package/dist/client/assets/projects-BTP5sS_F.js +0 -1
  429. package/dist/client/assets/record-editor-BMrHZfpJ.js +0 -1
  430. package/dist/client/assets/redirect-editor-BF11laHA.js +0 -1
  431. package/dist/client/assets/reports-C5TYz7EY.js +0 -1
  432. package/dist/client/assets/reports-onboarding-Bruf-fyJ.js +0 -1
  433. package/dist/client/assets/reports-tab-Da3H-8PE.js +0 -2
  434. package/dist/client/assets/repositories-hb3vgifj.js +0 -1
  435. package/dist/client/assets/roles-tNHszeml.js +0 -1
  436. package/dist/client/assets/route-BYeuiauO.js +0 -1
  437. package/dist/client/assets/route-B_J7kzlG.js +0 -1
  438. package/dist/client/assets/route-C-s8klhs.js +0 -1
  439. package/dist/client/assets/sections-editor-DfuqBfpL.js +0 -1
  440. package/dist/client/assets/sections-q5OYq_j5.js +0 -1
  441. package/dist/client/assets/seo-editor-kIki17wn.js +0 -1
  442. package/dist/client/assets/settings-tab-D43TggxT.js +0 -1
  443. package/dist/client/assets/shell-layout-Dbb1xZ69.js +0 -1
  444. package/dist/client/assets/site-editor-Do8tzkEW.js +0 -1
  445. package/dist/client/assets/skills-DguxwEpq.js +0 -1
  446. package/dist/client/assets/taskboard-analytics-Cym7TppR.js +0 -1
  447. package/dist/client/assets/tasks-ChcFyM82.js +0 -1
  448. package/dist/client/assets/thread-analytics-D22kre4r.js +0 -1
  449. package/dist/client/assets/thread-route-DJDdAJyj.js +0 -1
  450. package/dist/client/assets/use-project-scope-DlZ3hr3v.js +0 -1
  451. package/dist/client/assets/use-thread-analytics-DCAQaEKg.js +0 -1
  452. package/dist/client/assets/useInfiniteQuery-CyMRSsxy.js +0 -1
  453. package/dist/client/assets/useSuspenseInfiniteQuery-CwcJeHZI.js +0 -1
  454. package/dist/client/assets/variant-calendar-CZfhcIKG.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-DfuqBfpL.js","assets/index-COnziA0Z.js","assets/index-By_-wb1N.css","assets/chat-context-q7TqJ1C-.js","assets/use-panel-navigate-DEzceHY3.js","assets/thread-route-Bnw3gplh.js","assets/use-project-scope-DlZ3hr3v.js","assets/repository-binding-BGeZ0DuT.js","assets/use-mcp-client-CNQ2UmVO.js","assets/auth-BaCW7whq.js","assets/autosend-Cyz0grx9.js","assets/thread-intent-4tNJ-MPs.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-CbGDmnzl.js","assets/task-board-CrNZ__0e.js","assets/schema-BYBruCaH.js","assets/slugify-CEUa2lfQ.js","assets/use-entitlements-Bek8GQfU.js","assets/use-ai-providers-DTLn4WND.js","assets/location-V0VwTJTt.js","assets/use-decopilot-events-CsyvAJLs.js","assets/use-organization-settings-DApKHEhs.js","assets/held-block-view-CqquZXR8.js","assets/utils-CsFkMYtG.js","assets/ZoomOut-CLslRLDT.js","assets/Image01-aiwVgEhl.js","assets/agent-icon-r8Z1kQx0.js","assets/AlertCircle-Cxr7gZFk.js","assets/Tool01-Btqju7fM.js","assets/ArrowUp-ze_LLfn6.js","assets/ArrowLeft-5wkW-hEo.js","assets/LinkBroken01-CAGHvVZ6.js","assets/ShoppingBag01-CLHHYXzS.js","assets/Building02-D7vWgCSn.js","assets/CheckCircle-Dap6CDoz.js","assets/ChevronUp-B635wgc1.js","assets/ChevronSelectorVertical-BOIt7T3u.js","assets/UserSquare-D2LgcI23.js","assets/Copy01-D5FEj5_l.js","assets/CreditCard01-CwcYwmjF.js","assets/DotsVertical-BlJdlZxy.js","assets/Globe04-BvpBdv-m.js","assets/SwitchHorizontal01-CucWWNd0.js","assets/Key01-Bxg4WT0j.js","assets/Link01-CcXDwgg2.js","assets/Minus-Dsn0b7GK.js","assets/Monitor01-DKCvSUp5.js","assets/Sun-D80Oomy0.js","assets/Play-vsKk_Jz0.js","assets/Plus-Bra09L11.js","assets/SearchMd-CcaPghb6.js","assets/Trash01-BrSYsLgM.js","assets/Upload01-DRsgvg8v.js","assets/Users01-YRcnRYKP.js","assets/XClose-CjCoL-G7.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-BIX6BY2B.js","assets/collapsible-CF6QTwAQ.js","assets/use-copy-D-ZLjAxF.js","assets/usage-stats-B8cFnQJA.js","assets/tool-namespace-BTv6Xybs.js","assets/form-CpJsHKNZ.js","assets/label-BGevM5Zb.js","assets/utils-CVEq3hMx.js","assets/markdown-DGqjdf2p.js","assets/use-mobile-DccFwPqc.js","assets/tooltip-D8ZXcwhe.js","assets/index-CVG6lJ_v.js","assets/use-clock-tick-CRkdqRFq.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-CPV0UyxX.js","assets/types-CofNWIMh.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/shell-layout-Dbb1xZ69.js","assets/use-deployment-admin-_9kJl1R4.js","assets/admin-fetch-BhTJlAsX.js","assets/command-ChermTHn.js","assets/index-CUvxA4QU.js","assets/integration-icon-DfwU4DVr.js","assets/project-icon-BjJ8vKrn.js","assets/new-project-dialog-aU8scugU.js","assets/repository-import-picker-_KegTBCz.js","assets/use-navigate-to-agent-D_4FOoK_.js","assets/repository-picker-CU40xoJ7.js","assets/github-icon-CtxsZ4zj.js","assets/useInfiniteQuery-CyMRSsxy.js","assets/infiniteQueryObserver-Bj3tjA3X.js","assets/collection-search-cs3sNNIu.js","assets/use-debounced-value-tZ4DXPdN.js","assets/required-auth-layout-C2OmldxX.js","assets/use-org-sso-_0yCR_2x.js","assets/shell-layout-CE2Eihra.css","assets/sheet-DvSGxi5a.js","assets/use-connection-BOMkN6q_.js","assets/use-mcp-prompts-DDgSZA70.js","assets/use-thread-outputs-ozdLQUlC.js","assets/file-type-icon-CszJOHRP.js","assets/section-array-field-BWV4uW6Z.js","assets/alert-sh_9lE1j.js","assets/parse-sections-BLo4hVcc.js","assets/blocks-tab-states-8ODefLbh.js","assets/slider-eIUNwmro.js","assets/index-Bb3_Vv2S.js","assets/index-BdQq_4o_.js","assets/tooltipContext-DziaRNob.js","assets/CategoricalChart-8cAW3ovr.js","assets/index-Du1V-xNi.js","assets/ActiveShapeUtils-ClFvSa3l.js","assets/Sector-Dgqo2T4d.js","assets/symbol-BT27QHWj.js","assets/site-editor-toast-CH9jUz3L.js","assets/use-session-runtime-DAUgnVml.js","assets/experiments-tab-choice-8xzKkZlX.js","assets/sandbox-url-D3mC8qhT.js","assets/use-sandbox-events-CBidgN1S.js","assets/sandbox-git-api-DcqI6XE4.js","assets/empty-state-B9oIyVIp.js","assets/switch-C0t-igJf.js","assets/textarea-C_fBPqU6.js","assets/popover-CDni3562.js","assets/scroll-area-BUyfS5TA.js","assets/monaco-editor-CS14LLrn.js","assets/editor-mPZ0kVNv.js","assets/calendar-_mtTQBPC.js","assets/select-BaNSHFfS.js","assets/editor-classes-BpwwAF3C.js","assets/core.esm-pg4Fq_TB.js","assets/sortable.esm-ChXVP1eQ.js","assets/toggle-group-ythhcZKM.js","assets/active-indicator-CCMhAsc_.js","assets/combobox-CpjBTDRG.js","assets/search-input-T7tfUlv8.js","assets/tabs-CoLoYhlT.js","assets/use-file-configs-BPOIBiEJ.js","assets/asset-utils-BGF2krWn.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/mustache-CQoqMaLT.js","assets/use-section-preview-base-aV2rnRKl.js","assets/section-preview-url-7zfngvgW.js","assets/page-seo-form-DO9Vic5L.js","assets/use-apply-named-rule-HLQawGs9.js","assets/use-move-blocks-ClZ1itdH.js","assets/variant-matcher-override-CbINPKEm.js","assets/variant-draft-pointer-BeAKcq_c.js"])))=>i.map(i=>d[i]);
2
- import{c as ce,j as n,r as C,l as De,b as Pe,B as Me,aK as Xt,b9 as ot,aL as Ae,ba as Sa,bb as Pa,bc as ja,bd as Ea,v as rr,D as ar,K as or,w as ir,x as lr,e as Na,h as Tt,I as Rs,y as Ca,be as Ta,a4 as zs,b2 as La,b7 as Ra,ax as As,az as _s,a7 as cr,P as Os,C as Aa,t as Zt,b8 as _a,q as Oa,m as Da}from"./index-COnziA0Z.js";import{u as dr,g as Ba,c as Nn,B as Ss,P as $a,r as Ma,R as Fa,a as za,H as Ka,b as ur,S as Ia,d as Ua,l as Ha,m as Va,e as qa,f as Ps,N as Wa}from"./held-block-view-CqquZXR8.js";import{b as Ga,c as Lt,r as fr,l as pr,f as Ja,g as Ya,w as Qa}from"./chat-context-q7TqJ1C-.js";import{t as Xa}from"./ChevronUp-B635wgc1.js";import{S as Za,T as eo,M as mr,U as to,V as so,b as no,W as ro,X as hr,Y as ao,Z as gr,_ as Cn,$ as oo}from"./agent-icon-r8Z1kQx0.js";import{a as io,n as lo}from"./UserSquare-D2LgcI23.js";import{s as vr}from"./Plus-Bra09L11.js";import{a as xr,b as br,P as yr}from"./popover-CDni3562.js";import{a as Et,b as Nt,c as wr,d as kr,e as Sr,C as Pr}from"./command-ChermTHn.js";import{c as co,d as uo,a as fo}from"./repository-binding-BGeZ0DuT.js";import{a as Rt}from"./sandbox-lifecycle-context-D2UA9HUf.js";import{e as po}from"./backoff-CrEUbyZT.js";import{r as mo}from"./thread-intent-4tNJ-MPs.js";import{u as jr}from"./use-session-runtime-DAUgnVml.js";import{S as Er,d as ho,f as go,i as vo,g as xo,h as bo,j as yo,k as wo,u as ss,l as Ks,m as at,n as ko,o as So,q as Po,c as Nr,b as Cr,t as jo,v as He,w as Eo,x as No,y as Co,z as Tn,A as To,B as Lo,C as Ln,D as Ro,E as Ao,e as _o}from"./site-editor-toast-CH9jUz3L.js";import{u as Tr}from"./use-mobile-DccFwPqc.js";import{T as lt,a as ct,c as dt}from"./tooltip-D8ZXcwhe.js";import{T as We}from"./toolbar-icon-button-dgGE6Jet.js";import{w as Wt,i as Oo}from"./variant-matcher-override-CbINPKEm.js";import{b as Do,w as Rn}from"./variant-draft-pointer-BeAKcq_c.js";import{u as Lr,i as Bo,B as $o,S as Mo,C as Fo,a as zo,c as Ko,b as Io,d as Uo,l as Ho,D as Vo}from"./blocks-tab-states-8ODefLbh.js";import{s as Ct,n as Is,a as Rr,f as Ve,v as Ar,h as qo,e as Wo,b as Go,c as Jo,g as Yo,p as Qo,N as Xo,d as Zo,r as ei,i as An,j as ti}from"./parse-sections-BLo4hVcc.js";import{r as si,D as _n,w as On,b as Dn,a as ni}from"./section-preview-url-7zfngvgW.js";import{p as ri,a as ai,u as oi,b as Bn}from"./use-fast-preview-draft-url-TbXAala5.js";import{a as ii,b as _r}from"./shell-layout-Dbb1xZ69.js";import{u as Us,b as li}from"./use-sandbox-events-CBidgN1S.js";import{u as Ds}from"./useQueries-TfPC02wF.js";import{i as ci}from"./LinkBroken01-CAGHvVZ6.js";import{u as Or}from"./blocks-preview-workspace-context-oDr51QB4.js";import{MonacoCodeEditor as di}from"./monaco-editor-CS14LLrn.js";import{d as ui}from"./utils-CsFkMYtG.js";import{R as $n,a as Gt,b as Mn}from"./resizable-GdeSoBXC.js";import{u as fi,a as js}from"./experiments-tab-choice-8xzKkZlX.js";import{w as Bs}from"./device-hint-SeLRi17j.js";import{L as pi}from"./label-BGevM5Zb.js";import{a as mi,T as Fn}from"./toggle-group-ythhcZKM.js";import{h as Dr,w as hi,a as zn}from"./preview-link-C762yHOt.js";import{r as gi,R as vi}from"./virtual-mcp-C73-2MCU.js";import{d as xi}from"./delay-CnY5UFtP.js";import{s as Br}from"./XClose-CjCoL-G7.js";import{o as bi}from"./omit-sandbox-map-jj4lCB2U.js";import{a as Es,b as yi,w as wi,n as Kn}from"./app-preview-url-9Od4s8Sz.js";import{a as ki}from"./use-organization-settings-DApKHEhs.js";import{E as Si}from"./empty-state-B9oIyVIp.js";import{G as In}from"./github-icon-CtxsZ4zj.js";import{R as Pi}from"./repository-import-picker-_KegTBCz.js";import{r as ji}from"./preview-source-BsRLGWUP.js";import{C as Ei,s as Ni,L as Ci,R as es,D as Un}from"./section-array-field-BWV4uW6Z.js";import{A as Ti,a as Li,b as Ri}from"./alert-sh_9lE1j.js";import{u as Ai}from"./use-task-metadata-OcqiZ2kJ.js";function _i(t){const e=ce.c(10),{waiting:s}=t,r=s?"true":"false";let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:n.jsx(Za,{className:"size-5 sm:size-6"})}),e[0]=a):a=e[0];let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=d):d=e[1];let o;e[2]!==s?(o=s&&n.jsx("span",{"data-testid":"connection-dot",className:"absolute top-0 size-2 animate-[connection-shuttle_1.8s_var(--ease-in-out-cubic)_infinite_alternate] rounded-full bg-foreground"}),e[2]=s,e[3]=o):o=e[3];let i;e[4]!==o?(i=n.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[d,o]}),e[4]=o,e[5]=i):i=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:n.jsx(eo,{className:"size-5 sm:size-6"})}),e[6]=c):c=e[6];let l;return e[7]!==r||e[8]!==i?(l=n.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":r,className:"flex items-center gap-2",children:[a,i,c]}),e[7]=r,e[8]=i,e[9]=l):l=e[9],l}function Oi(t){const e=ce.c(25),{index:s,numbered:r,step:a,heading:d}=t,o=C.useId();let i;e[0]!==s||e[1]!==r?(i=r&&n.jsx("span",{"aria-hidden":"true",className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium tabular-nums text-foreground",children:s}),e[0]=s,e[1]=r,e[2]=i):i=e[2];let c;e[3]!==d||e[4]!==o||e[5]!==a.title?(c=n.jsx(d,{id:o,className:"text-sm font-medium text-foreground",children:a.title}),e[3]=d,e[4]=o,e[5]=a.title,e[6]=c):c=e[6];let l;e[7]!==i||e[8]!==c?(l=n.jsxs("div",{className:"flex items-center gap-3",children:[i,c]}),e[7]=i,e[8]=c,e[9]=l):l=e[9];const m=r&&"sm:pl-9";let p;e[10]!==m?(p=De("flex min-w-0 flex-col gap-3",m),e[10]=m,e[11]=p):p=e[11];let f;e[12]!==a.body?(f=a.body&&n.jsx("p",{className:"text-sm text-muted-foreground",children:a.body}),e[12]=a.body,e[13]=f):f=e[13];let x;e[14]!==a.command?(x=a.command&&n.jsx(Ei,{command:a.command}),e[14]=a.command,e[15]=x):x=e[15];let h;e[16]!==a.after||e[17]!==p||e[18]!==f||e[19]!==x?(h=n.jsxs("div",{className:p,children:[f,x,a.after]}),e[16]=a.after,e[17]=p,e[18]=f,e[19]=x,e[20]=h):h=e[20];let j;return e[21]!==o||e[22]!==l||e[23]!==h?(j=n.jsxs("li",{"aria-labelledby":o,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[l,h]}),e[21]=o,e[22]=l,e[23]=h,e[24]=j):j=e[24],j}const Di=[];function ts(t){const e=ce.c(20),{title:s,lead:r,waiting:a,alerts:d,steps:o,footer:i,headingLevel:c}=t,l=o===void 0?Di:o,m=c===void 0?1:c,p=m===1?"h1":"h2",f=a&&l.length===0?"status":void 0;let x;e[0]!==a?(x=n.jsx(_i,{waiting:a}),e[0]=a,e[1]=x):x=e[1];let h;e[2]!==p||e[3]!==s?(h=n.jsx(p,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:s}),e[2]=p,e[3]=s,e[4]=h):h=e[4];let j;e[5]!==r?(j=r&&n.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:r}),e[5]=r,e[6]=j):j=e[6];let g;e[7]!==f||e[8]!==x||e[9]!==h||e[10]!==j?(g=n.jsxs("header",{role:f,className:"flex flex-col items-center gap-3 text-center",children:[x,h,j]}),e[7]=f,e[8]=x,e[9]=h,e[10]=j,e[11]=g):g=e[11];let b;e[12]!==m||e[13]!==l?(b=l.length>0&&n.jsx("ol",{className:"flex flex-col gap-3",children:l.map((y,v)=>n.jsx(Oi,{index:v+1,numbered:l.length>1,step:y,heading:m===1?"h2":"h3"},y.title))}),e[12]=m,e[13]=l,e[14]=b):b=e[14];let N;return e[15]!==d||e[16]!==i||e[17]!==g||e[18]!==b?(N=n.jsx("div",{className:"h-full w-full overflow-y-auto",children:n.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,b,i]})}),e[15]=d,e[16]=i,e[17]=g,e[18]=b,e[19]=N):N=e[19],N}function Bi(t){const e=ce.c(55),{wait:s,hosts:r,invalidLink:a}=t,d=a===void 0?!1:a,o=Pe();let i;e[0]!==d||e[1]!==o?(i=d&&n.jsx(Ti,{variant:"warning",children:n.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[n.jsx(Li,{className:"line-clamp-none text-foreground",children:o("decoServe.link.invalidTitle")}),n.jsx(Ri,{children:o("decoServe.link.invalidBody")})]})}),e[0]=d,e[1]=o,e[2]=i):i=e[2];const c=i;if(s.kind==="problem"){let R;e[3]!==o||e[4]!==s.host||e[5]!==s.problem?(R=Ni(o,s.problem,s.host),e[3]=o,e[4]=s.host,e[5]=s.problem,e[6]=R):R=e[6];const{title:O,body:T}=R;let L;e[7]!==T?(L=n.jsx(es,{text:T}),e[7]=T,e[8]=L):L=e[8];let D;e[9]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(Un,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=D):D=e[9];let A;return e[10]!==c||e[11]!==L||e[12]!==O?(A=n.jsx(ts,{headingLevel:2,waiting:!1,title:O,lead:L,alerts:c,footer:D}),e[10]=c,e[11]=L,e[12]=O,e[13]=A):A=e[13],A}const l=s.kind==="looking",m=l&&!s.paused;let p;e[14]!==o?(p=o("decoServe.waiting.title"),e[14]=o,e[15]=p):p=e[15];let f;e[16]!==o?(f=o("decoServe.waiting.lead"),e[16]=o,e[17]=f):f=e[17];let x;e[18]!==c||e[19]!==s.kind?(x=(c||s.kind==="denied")&&n.jsxs(n.Fragment,{children:[c,s.kind==="denied"&&n.jsx(Ci,{})]}),e[18]=c,e[19]=s.kind,e[20]=x):x=e[20];let h;e[21]!==o?(h=o("decoServe.guide.step1.title"),e[21]=o,e[22]=h):h=e[22];let j;e[23]!==o?(j=o("decoServe.guide.step1.body"),e[23]=o,e[24]=j):j=e[24];let g;e[25]!==j?(g=n.jsx(es,{text:j}),e[25]=j,e[26]=g):g=e[26];let b;e[27]!==h||e[28]!==g?(b={title:h,body:g,command:Er},e[27]=h,e[28]=g,e[29]=b):b=e[29];let N;e[30]!==o?(N=o("decoServe.waiting.step2.title"),e[30]=o,e[31]=N):N=e[31];let y;e[32]!==o?(y=o("decoServe.waiting.step2.body"),e[32]=o,e[33]=y):y=e[33];let v;e[34]!==r||e[35]!==l||e[36]!==o||e[37]!==s.kind||e[38]!==s.onStart||e[39]!==s.paused?(v=s.kind==="needs-gesture"?n.jsx(Me,{variant:"outline",className:"self-start",onClick:s.onStart,children:o("decoServe.guide.step2.start")}):l&&n.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:s.paused?o("decoServe.guide.step2.paused"):o("decoServe.guide.step2.looking",{hosts:r})}),e[34]=r,e[35]=l,e[36]=o,e[37]=s.kind,e[38]=s.onStart,e[39]=s.paused,e[40]=v):v=e[40];let P;e[41]!==N||e[42]!==y||e[43]!==v?(P={title:N,body:y,after:v},e[41]=N,e[42]=y,e[43]=v,e[44]=P):P=e[44];let E;e[45]!==b||e[46]!==P?(E=[b,P],e[45]=b,e[46]=P,e[47]=E):E=e[47];let k;e[48]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(Un,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[48]=k):k=e[48];let S;return e[49]!==E||e[50]!==m||e[51]!==p||e[52]!==f||e[53]!==x?(S=n.jsx(ts,{headingLevel:2,waiting:m,title:p,lead:f,alerts:x,steps:E,footer:k}),e[49]=E,e[50]=m,e[51]=p,e[52]=f,e[53]=x,e[54]=S):S=e[54],S}function $i(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 Mi=15e3,Fi=3e3;function zi(t){const{candidates:e,probe:s,onFound:r,onChange:a,doc:d=document,setTimer:o=(v,P)=>setTimeout(v,P),clearTimer:i=v=>clearTimeout(v),timeoutMs:c=Fi}=t;let l={status:"searching",firstRoundDone:!1,problem:null},m=!1,p=!1,f=0,x=null,h=null;const j=()=>d.visibilityState==="hidden",g=v=>{l={...l,...v},a(l)},b=async v=>{h=new AbortController;const P=h,E=o(()=>P.abort(),c);try{return await s(v,P.signal),!0}catch(k){if(m)return!1;const S=go(k);return S.reason!=="not-answering"?g({problem:{...S,endpoint:v}}):l.problem?.endpoint===v&&g({problem:null}),!1}finally{i(E),h=null}},N=async()=>{if(x=null,!(m||p)){if(e.length===0){g({status:"stopped",firstRoundDone:!0});return}if(j()){g({status:"paused"});return}p=!0,l.status!=="searching"&&g({status:"searching"});for(const v of e){if(m)break;if(await b(v)){if(p=!1,m)return;m=!0,d.removeEventListener("visibilitychange",y),g({status:"found",firstRoundDone:!0}),r(v);return}}if(p=!1,!m){if(f+=1,l.firstRoundDone||g({firstRoundDone:!0}),j()){g({status:"paused"});return}x=o(()=>{N()},ho(f,Mi))}}};function y(){if(!m){if(j()){x!==null&&(i(x),x=null),p||g({status:"paused"});return}x!==null&&i(x),f=0,N()}}return d.addEventListener("visibilitychange",y),a(l),N(),()=>{m=!0,x!==null&&i(x),h?.abort(),d.removeEventListener("visibilitychange",y)}}function Ki(t,e){return xo(bo({endpoint:t,fetch:s=>fetch(s,{signal:e})}))}const Ii=["loopback-network","local-network-access"];async function Ui(){if(vo(window.location.origin))return null;for(const t of Ii)try{return await navigator.permissions.query({name:t})}catch{}return null}let $r=null,Hn=!1;const Ns=new Set;function Hi(t){if(Ns.add(t),!Hn){Hn=!0;const e=s=>{$r=s;for(const r of Ns)r()};Ui().then(s=>{if(!s)return e("unsupported");e(s.state),s.addEventListener("change",()=>e(s.state))})}return()=>Ns.delete(t)}const Vi={status:"stopped",firstRoundDone:!1,problem:null},Cs=new Map;function qi(t){const e=Cs.get(t);if(e)return e;let s={status:"searching",firstRoundDone:!1,problem:null};const r=new Set;let a=null;const d={onFound:()=>{},getSnapshot:()=>s,subscribe:o=>(r.add(o),a??=zi({candidates:t.split(" "),probe:Ki,onFound:i=>d.onFound(i),onChange:i=>{s=i;for(const c of r)c()}}),()=>{r.delete(o),!(r.size>0)&&(a?.(),a=null,Cs.delete(t))})};return Cs.set(t,d),d}function Mr(){return C.useSyncExternalStore(Hi,qn,qn)}const Wi=()=>()=>{},Vn=()=>Vi,qn=()=>$r;function zd(t){const e=ce.c(9),{candidates:s,onFound:r}=t,[a,d]=C.useState(!1),o=Mr(),c=(o==="granted"||o==="unsupported"||o==="prompt"&&a)&&s.length>0;let l;e[0]!==c||e[1]!==s||e[2]!==r?(l=c?qi(s.join(" ")):null,l&&(l.onFound=r),e[0]=c,e[1]=s,e[2]=r,e[3]=l):l=e[3];const m=C.useSyncExternalStore(l?.subscribe??Wi,l?.getSnapshot??Vn,l?.getSnapshot??Vn),p=o==="prompt"&&!a;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>d(!0),e[4]=f):f=e[4];let x;return e[5]!==o||e[6]!==m||e[7]!==p?(x={state:m,access:o,needsGesture:p,start:f},e[5]=o,e[6]=m,e[7]=p,e[8]=x):x=e[8],x}const Ts={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Gi(t){const{previewState:e,progressStatus:s,fastPreviewActive:r=!1,fastPreviewReady:a=!1,codingSession:d=!1,hostedDraft:o=!1}=t,i=d?null:t.previewServerUrl;return t.deciding?{...Ts,showDecidingLoader:!0}:t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Ts:o&&t.hostedPointerPending&&!a?{...Ts,showDecidingLoader:!0}:r&&a&&i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!1}:r&&o&&i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!1}:!r&&e.kind==="iframe"&&s!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Ji=1e4,Yi=1e3,Qi=3e4;function Xi({iframeRef:t,src:e,active:s}){const r=C.useRef(0),a=C.useRef(null),d=C.useRef(null),o=C.useRef(e),i=C.useRef(s);o.current=e,i.current=s;const c=()=>{a.current&&clearTimeout(a.current),d.current&&clearTimeout(d.current),a.current=null,d.current=null},l=()=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,m()},Ji)},m=()=>{if(!i.current||!o.current)return;d.current&&clearTimeout(d.current);const x=po(Qi,Yi,r.current,2,.5);r.current+=1,d.current=setTimeout(()=>{d.current=null;const h=t.current,j=o.current;!h||!j||!i.current||(h.src=j,l())},x)},p=()=>{r.current=0,c()},f=()=>{a.current&&(clearTimeout(a.current),a.current=null),m()};return C.useEffect(()=>{if(c(),r.current=0,!(!s||!e))return l(),c},[e,s]),{handleLoad:p,handleError:f}}const Zi=1500,el=500;function tl({iframe:t,reload:e,waitMs:s=Zi,confirmMs:r=el}){let a;const d=()=>{clearTimeout(o),a=setTimeout(e,r)};t.addEventListener("load",d,{once:!0});const o=setTimeout(()=>{t.removeEventListener("load",d),e()},s);return()=>{clearTimeout(o),clearTimeout(a),t.removeEventListener("load",d)}}const sl=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:ot(),height:ot()}),position:Xt({x:ot(),y:ot()})}),nl=`(function() {
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-B628EbZ4.js","assets/index-BWpKrclg.js","assets/index-_wqQ3Hkr.css","assets/chat-context-kqrW-XPR.js","assets/use-panel-navigate-nriEb2Qz.js","assets/thread-route-BOOkt7de.js","assets/use-project-scope-CdqclLu1.js","assets/repository-binding-Bpq6heaQ.js","assets/use-mcp-client-zIBQco5Q.js","assets/auth-CK6AyRu5.js","assets/autosend-DTWIjCgK.js","assets/thread-intent-DjvP3GsU.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-6veZzsu7.js","assets/task-board-L6ZGzY-s.js","assets/schema-DzZBw0EW.js","assets/slugify-CEUa2lfQ.js","assets/use-entitlements-Bxptpo8e.js","assets/use-ai-providers-BcLfhqAn.js","assets/location-V0VwTJTt.js","assets/use-decopilot-events-Dg011Qgn.js","assets/use-organization-settings-D_5fr-OI.js","assets/held-block-view-C3Ird9F-.js","assets/utils-BoR7m7ir.js","assets/ZoomOut-CBOWQYet.js","assets/Image01-CaawlkVR.js","assets/agent-icon-nQ1AH9dU.js","assets/AlertCircle-RV4AM_8y.js","assets/Tool01-CHLDtlIL.js","assets/ArrowUp-DpQ-09y4.js","assets/ArrowLeft-XO66B9Td.js","assets/LinkBroken01-z_Mm0CSf.js","assets/ShoppingBag01-BhoOjVkp.js","assets/Building02-NRzC_IEp.js","assets/CheckCircle-CfYD_Bi6.js","assets/ChevronUp-xR4eZngE.js","assets/ChevronSelectorVertical-C5MARPJN.js","assets/UserSquare-BSsT3MHy.js","assets/Copy01-Dy1KrWO0.js","assets/CreditCard01-DVN26JVZ.js","assets/DotsVertical-CncVW4wJ.js","assets/Globe04-BxFc3HLH.js","assets/SwitchHorizontal01-Ce37vA9c.js","assets/Key01-FaGRi3tG.js","assets/Link01-B_YWUHoH.js","assets/Minus-yAYwM_Ty.js","assets/Monitor01-Bl7f7T5L.js","assets/Sun-CZRF_565.js","assets/Play-OByKGnTy.js","assets/Plus-Ccck99Do.js","assets/SearchMd-BAGHgvYw.js","assets/Trash01-BQBP0tUM.js","assets/Upload01-D_q00M49.js","assets/Users01-C6bE7RDt.js","assets/XClose-BjZnEBvF.js","assets/Zap-CHuT8W6R.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-BFVxcKKp.js","assets/collapsible-Cx6KFD5C.js","assets/use-copy-Bq-mz0ld.js","assets/usage-stats-I2nqy87E.js","assets/tool-namespace-CG1Oreso.js","assets/form-gDNfP07W.js","assets/label-DzRNwB_s.js","assets/utils-CVEq3hMx.js","assets/markdown-CkZaCBow.js","assets/use-mobile-CoPLJ8cu.js","assets/tooltip-D2ANqV2w.js","assets/index-lchr3O79.js","assets/use-clock-tick-CXtcWsca.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-BVLr3WK6.js","assets/types-BNmsSext.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/shell-layout-BbFvnpcf.js","assets/use-deployment-admin-COukxauw.js","assets/admin-fetch-BhTJlAsX.js","assets/command-De9pJLwH.js","assets/index-C-GH7ZUH.js","assets/integration-icon-BQ9jVlvt.js","assets/project-icon-BKeF243f.js","assets/new-project-dialog-Dd5pVssc.js","assets/repository-import-picker-DxJJpcCz.js","assets/use-navigate-to-agent-DqWY18b4.js","assets/repository-picker-P8Asvsk4.js","assets/github-icon-DAxkwypb.js","assets/useInfiniteQuery-CFafSHXd.js","assets/infiniteQueryObserver-CbIPWgZj.js","assets/collection-search-B3vfcK1n.js","assets/use-debounced-value-CqLWq6L2.js","assets/required-auth-layout-DYZU5vk_.js","assets/use-org-sso-sTi3oL5_.js","assets/shell-layout-CE2Eihra.css","assets/sheet-BW-FxyJZ.js","assets/use-connection-CZNQu-z2.js","assets/use-mcp-prompts-XayY9yfQ.js","assets/use-thread-outputs-vH0sJUqm.js","assets/file-type-icon-BgzyV542.js","assets/section-array-field-BXLl3jB0.js","assets/alert-Bsjmz-OK.js","assets/parse-sections-BVn3AvAz.js","assets/blocks-tab-states-DhR3pyff.js","assets/slider-DtzvJZ1j.js","assets/index-Cjtut9JA.js","assets/index-BdQq_4o_.js","assets/tooltipContext-DvKfbID4.js","assets/CategoricalChart-64zykerQ.js","assets/index-15xKR9ar.js","assets/ActiveShapeUtils-ppN64tl0.js","assets/Sector-BCmuavOw.js","assets/symbol-CJoI4vsX.js","assets/site-editor-toast-QHleRFN5.js","assets/use-session-runtime-HJpkQoy0.js","assets/experiments-tab-choice-B_rL9_Nx.js","assets/sandbox-url-D3mC8qhT.js","assets/use-sandbox-events-C3mgE5Ut.js","assets/sandbox-git-api-DcqI6XE4.js","assets/empty-state-C7LII3ZM.js","assets/switch-Bv0wLEBx.js","assets/textarea-BNvvIWSZ.js","assets/popover-ClEv7Zyf.js","assets/scroll-area-CwuazZb5.js","assets/monaco-editor-zzUPRyBn.js","assets/editor-BqqnxL88.js","assets/calendar-ym6zGcEl.js","assets/select-BMteQTWS.js","assets/editor-classes-D-ez-qBv.js","assets/core.esm-DQyn-kJS.js","assets/sortable.esm-DNzjY6xb.js","assets/toggle-group-BAFBdL9F.js","assets/active-indicator-CCMhAsc_.js","assets/combobox-DXDZmm8e.js","assets/search-input-D2iQ_3lu.js","assets/tabs-CjWwohzM.js","assets/use-file-configs-DAoix9gu.js","assets/asset-utils-BSDCnt-j.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/mustache-BBgPaDqo.js","assets/use-section-preview-base-CJSLbEeV.js","assets/section-preview-url-7zfngvgW.js","assets/page-seo-form-DizfAl8r.js","assets/use-apply-named-rule-CdtINk0A.js","assets/use-move-blocks-Ck5rS_vn.js","assets/variant-matcher-override-Cvh79vYa.js","assets/variant-draft-pointer-BeAKcq_c.js"])))=>i.map(i=>d[i]);
2
+ import{c as ce,j as n,r as C,l as De,b as Pe,B as Me,aK as Xt,b9 as ot,aL as Ae,ba as Sa,bb as Pa,bc as ja,bd as Ea,v as rr,D as ar,K as or,w as ir,x as lr,e as Na,h as Tt,I as Rs,y as Ca,be as Ta,a4 as zs,b2 as La,b7 as Ra,aw as As,ay as _s,a7 as cr,P as Os,C as Aa,t as Zt,b8 as _a,q as Oa,m as Da}from"./index-BWpKrclg.js";import{u as dr,g as Ba,c as Nn,B as Ss,P as $a,r as Ma,R as Fa,a as za,H as Ka,b as ur,S as Ia,d as Ua,l as Ha,m as Va,e as qa,f as Ps,N as Wa}from"./held-block-view-C3Ird9F-.js";import{b as Ga,c as Lt,r as fr,l as pr,f as Ja,g as Ya,w as Qa}from"./chat-context-kqrW-XPR.js";import{t as Xa}from"./ChevronUp-xR4eZngE.js";import{S as Za,T as eo,M as mr,U as to,V as so,b as no,W as ro,X as hr,Y as ao,Z as gr,_ as Cn,$ as oo}from"./agent-icon-nQ1AH9dU.js";import{a as io,n as lo}from"./UserSquare-BSsT3MHy.js";import{s as vr}from"./Plus-Ccck99Do.js";import{a as xr,b as br,P as yr}from"./popover-ClEv7Zyf.js";import{a as Et,b as Nt,c as wr,d as kr,e as Sr,C as Pr}from"./command-De9pJLwH.js";import{c as co,d as uo,a as fo}from"./repository-binding-Bpq6heaQ.js";import{a as Rt}from"./sandbox-lifecycle-context-D9eDp86x.js";import{e as po}from"./backoff-CrEUbyZT.js";import{r as mo}from"./thread-intent-DjvP3GsU.js";import{u as jr}from"./use-session-runtime-HJpkQoy0.js";import{S as Er,d as ho,f as go,i as vo,g as xo,h as bo,j as yo,k as wo,u as ss,l as Ks,m as at,n as ko,o as So,q as Po,c as Nr,b as Cr,t as jo,v as He,w as Eo,x as No,y as Co,z as Tn,A as To,B as Lo,C as Ln,D as Ro,E as Ao,e as _o}from"./site-editor-toast-QHleRFN5.js";import{u as Tr}from"./use-mobile-CoPLJ8cu.js";import{T as lt,a as ct,c as dt}from"./tooltip-D2ANqV2w.js";import{T as We}from"./toolbar-icon-button-CnXJyVJt.js";import{w as Wt,i as Oo}from"./variant-matcher-override-Cvh79vYa.js";import{b as Do,w as Rn}from"./variant-draft-pointer-BeAKcq_c.js";import{u as Lr,i as Bo,B as $o,S as Mo,C as Fo,a as zo,c as Ko,b as Io,d as Uo,l as Ho,D as Vo}from"./blocks-tab-states-DhR3pyff.js";import{s as Ct,n as Is,a as Rr,f as Ve,v as Ar,h as qo,e as Wo,b as Go,c as Jo,g as Yo,p as Qo,N as Xo,d as Zo,r as ei,i as An,j as ti}from"./parse-sections-BVn3AvAz.js";import{r as si,D as _n,w as On,b as Dn,a as ni}from"./section-preview-url-7zfngvgW.js";import{p as ri,a as ai,u as oi,b as Bn}from"./use-fast-preview-draft-url-DWrGmO4E.js";import{a as ii,b as _r}from"./shell-layout-BbFvnpcf.js";import{u as Us,b as li}from"./use-sandbox-events-C3mgE5Ut.js";import{u as Ds}from"./useQueries-Qve4MUYw.js";import{i as ci}from"./LinkBroken01-z_Mm0CSf.js";import{u as Or}from"./blocks-preview-workspace-context-C2nnj0H9.js";import{MonacoCodeEditor as di}from"./monaco-editor-zzUPRyBn.js";import{d as ui}from"./utils-BoR7m7ir.js";import{R as $n,a as Gt,b as Mn}from"./resizable-vbjrp9Su.js";import{u as fi,a as js}from"./experiments-tab-choice-B_rL9_Nx.js";import{w as Bs}from"./device-hint-SeLRi17j.js";import{L as pi}from"./label-DzRNwB_s.js";import{a as mi,T as Fn}from"./toggle-group-BAFBdL9F.js";import{h as Dr,w as hi,a as zn}from"./preview-link-C762yHOt.js";import{r as gi,R as vi}from"./virtual-mcp-RiqyMxQd.js";import{d as xi}from"./delay-CnY5UFtP.js";import{s as Br}from"./XClose-BjZnEBvF.js";import{o as bi}from"./omit-sandbox-map-jj4lCB2U.js";import{a as Es,b as yi,w as wi,n as Kn}from"./app-preview-url-9Od4s8Sz.js";import{a as ki}from"./use-organization-settings-D_5fr-OI.js";import{E as Si}from"./empty-state-C7LII3ZM.js";import{G as In}from"./github-icon-DAxkwypb.js";import{R as Pi}from"./repository-import-picker-DxJJpcCz.js";import{r as ji}from"./preview-source-BsRLGWUP.js";import{C as Ei,s as Ni,L as Ci,R as es,D as Un}from"./section-array-field-BXLl3jB0.js";import{A as Ti,a as Li,b as Ri}from"./alert-Bsjmz-OK.js";import{u as Ai}from"./use-task-metadata-MAOPH7xT.js";function _i(t){const e=ce.c(10),{waiting:s}=t,r=s?"true":"false";let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:n.jsx(Za,{className:"size-5 sm:size-6"})}),e[0]=a):a=e[0];let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=d):d=e[1];let o;e[2]!==s?(o=s&&n.jsx("span",{"data-testid":"connection-dot",className:"absolute top-0 size-2 animate-[connection-shuttle_1.8s_var(--ease-in-out-cubic)_infinite_alternate] rounded-full bg-foreground"}),e[2]=s,e[3]=o):o=e[3];let i;e[4]!==o?(i=n.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[d,o]}),e[4]=o,e[5]=i):i=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:n.jsx(eo,{className:"size-5 sm:size-6"})}),e[6]=c):c=e[6];let l;return e[7]!==r||e[8]!==i?(l=n.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":r,className:"flex items-center gap-2",children:[a,i,c]}),e[7]=r,e[8]=i,e[9]=l):l=e[9],l}function Oi(t){const e=ce.c(25),{index:s,numbered:r,step:a,heading:d}=t,o=C.useId();let i;e[0]!==s||e[1]!==r?(i=r&&n.jsx("span",{"aria-hidden":"true",className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium tabular-nums text-foreground",children:s}),e[0]=s,e[1]=r,e[2]=i):i=e[2];let c;e[3]!==d||e[4]!==o||e[5]!==a.title?(c=n.jsx(d,{id:o,className:"text-sm font-medium text-foreground",children:a.title}),e[3]=d,e[4]=o,e[5]=a.title,e[6]=c):c=e[6];let l;e[7]!==i||e[8]!==c?(l=n.jsxs("div",{className:"flex items-center gap-3",children:[i,c]}),e[7]=i,e[8]=c,e[9]=l):l=e[9];const m=r&&"sm:pl-9";let p;e[10]!==m?(p=De("flex min-w-0 flex-col gap-3",m),e[10]=m,e[11]=p):p=e[11];let f;e[12]!==a.body?(f=a.body&&n.jsx("p",{className:"text-sm text-muted-foreground",children:a.body}),e[12]=a.body,e[13]=f):f=e[13];let x;e[14]!==a.command?(x=a.command&&n.jsx(Ei,{command:a.command}),e[14]=a.command,e[15]=x):x=e[15];let h;e[16]!==a.after||e[17]!==p||e[18]!==f||e[19]!==x?(h=n.jsxs("div",{className:p,children:[f,x,a.after]}),e[16]=a.after,e[17]=p,e[18]=f,e[19]=x,e[20]=h):h=e[20];let j;return e[21]!==o||e[22]!==l||e[23]!==h?(j=n.jsxs("li",{"aria-labelledby":o,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[l,h]}),e[21]=o,e[22]=l,e[23]=h,e[24]=j):j=e[24],j}const Di=[];function ts(t){const e=ce.c(20),{title:s,lead:r,waiting:a,alerts:d,steps:o,footer:i,headingLevel:c}=t,l=o===void 0?Di:o,m=c===void 0?1:c,p=m===1?"h1":"h2",f=a&&l.length===0?"status":void 0;let x;e[0]!==a?(x=n.jsx(_i,{waiting:a}),e[0]=a,e[1]=x):x=e[1];let h;e[2]!==p||e[3]!==s?(h=n.jsx(p,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:s}),e[2]=p,e[3]=s,e[4]=h):h=e[4];let j;e[5]!==r?(j=r&&n.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:r}),e[5]=r,e[6]=j):j=e[6];let g;e[7]!==f||e[8]!==x||e[9]!==h||e[10]!==j?(g=n.jsxs("header",{role:f,className:"flex flex-col items-center gap-3 text-center",children:[x,h,j]}),e[7]=f,e[8]=x,e[9]=h,e[10]=j,e[11]=g):g=e[11];let b;e[12]!==m||e[13]!==l?(b=l.length>0&&n.jsx("ol",{className:"flex flex-col gap-3",children:l.map((y,v)=>n.jsx(Oi,{index:v+1,numbered:l.length>1,step:y,heading:m===1?"h2":"h3"},y.title))}),e[12]=m,e[13]=l,e[14]=b):b=e[14];let N;return e[15]!==d||e[16]!==i||e[17]!==g||e[18]!==b?(N=n.jsx("div",{className:"h-full w-full overflow-y-auto",children:n.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,b,i]})}),e[15]=d,e[16]=i,e[17]=g,e[18]=b,e[19]=N):N=e[19],N}function Bi(t){const e=ce.c(55),{wait:s,hosts:r,invalidLink:a}=t,d=a===void 0?!1:a,o=Pe();let i;e[0]!==d||e[1]!==o?(i=d&&n.jsx(Ti,{variant:"warning",children:n.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[n.jsx(Li,{className:"line-clamp-none text-foreground",children:o("decoServe.link.invalidTitle")}),n.jsx(Ri,{children:o("decoServe.link.invalidBody")})]})}),e[0]=d,e[1]=o,e[2]=i):i=e[2];const c=i;if(s.kind==="problem"){let R;e[3]!==o||e[4]!==s.host||e[5]!==s.problem?(R=Ni(o,s.problem,s.host),e[3]=o,e[4]=s.host,e[5]=s.problem,e[6]=R):R=e[6];const{title:O,body:T}=R;let L;e[7]!==T?(L=n.jsx(es,{text:T}),e[7]=T,e[8]=L):L=e[8];let D;e[9]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(Un,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=D):D=e[9];let A;return e[10]!==c||e[11]!==L||e[12]!==O?(A=n.jsx(ts,{headingLevel:2,waiting:!1,title:O,lead:L,alerts:c,footer:D}),e[10]=c,e[11]=L,e[12]=O,e[13]=A):A=e[13],A}const l=s.kind==="looking",m=l&&!s.paused;let p;e[14]!==o?(p=o("decoServe.waiting.title"),e[14]=o,e[15]=p):p=e[15];let f;e[16]!==o?(f=o("decoServe.waiting.lead"),e[16]=o,e[17]=f):f=e[17];let x;e[18]!==c||e[19]!==s.kind?(x=(c||s.kind==="denied")&&n.jsxs(n.Fragment,{children:[c,s.kind==="denied"&&n.jsx(Ci,{})]}),e[18]=c,e[19]=s.kind,e[20]=x):x=e[20];let h;e[21]!==o?(h=o("decoServe.guide.step1.title"),e[21]=o,e[22]=h):h=e[22];let j;e[23]!==o?(j=o("decoServe.guide.step1.body"),e[23]=o,e[24]=j):j=e[24];let g;e[25]!==j?(g=n.jsx(es,{text:j}),e[25]=j,e[26]=g):g=e[26];let b;e[27]!==h||e[28]!==g?(b={title:h,body:g,command:Er},e[27]=h,e[28]=g,e[29]=b):b=e[29];let N;e[30]!==o?(N=o("decoServe.waiting.step2.title"),e[30]=o,e[31]=N):N=e[31];let y;e[32]!==o?(y=o("decoServe.waiting.step2.body"),e[32]=o,e[33]=y):y=e[33];let v;e[34]!==r||e[35]!==l||e[36]!==o||e[37]!==s.kind||e[38]!==s.onStart||e[39]!==s.paused?(v=s.kind==="needs-gesture"?n.jsx(Me,{variant:"outline",className:"self-start",onClick:s.onStart,children:o("decoServe.guide.step2.start")}):l&&n.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:s.paused?o("decoServe.guide.step2.paused"):o("decoServe.guide.step2.looking",{hosts:r})}),e[34]=r,e[35]=l,e[36]=o,e[37]=s.kind,e[38]=s.onStart,e[39]=s.paused,e[40]=v):v=e[40];let P;e[41]!==N||e[42]!==y||e[43]!==v?(P={title:N,body:y,after:v},e[41]=N,e[42]=y,e[43]=v,e[44]=P):P=e[44];let E;e[45]!==b||e[46]!==P?(E=[b,P],e[45]=b,e[46]=P,e[47]=E):E=e[47];let k;e[48]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(Un,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[48]=k):k=e[48];let S;return e[49]!==E||e[50]!==m||e[51]!==p||e[52]!==f||e[53]!==x?(S=n.jsx(ts,{headingLevel:2,waiting:m,title:p,lead:f,alerts:x,steps:E,footer:k}),e[49]=E,e[50]=m,e[51]=p,e[52]=f,e[53]=x,e[54]=S):S=e[54],S}function $i(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 Mi=15e3,Fi=3e3;function zi(t){const{candidates:e,probe:s,onFound:r,onChange:a,doc:d=document,setTimer:o=(v,P)=>setTimeout(v,P),clearTimer:i=v=>clearTimeout(v),timeoutMs:c=Fi}=t;let l={status:"searching",firstRoundDone:!1,problem:null},m=!1,p=!1,f=0,x=null,h=null;const j=()=>d.visibilityState==="hidden",g=v=>{l={...l,...v},a(l)},b=async v=>{h=new AbortController;const P=h,E=o(()=>P.abort(),c);try{return await s(v,P.signal),!0}catch(k){if(m)return!1;const S=go(k);return S.reason!=="not-answering"?g({problem:{...S,endpoint:v}}):l.problem?.endpoint===v&&g({problem:null}),!1}finally{i(E),h=null}},N=async()=>{if(x=null,!(m||p)){if(e.length===0){g({status:"stopped",firstRoundDone:!0});return}if(j()){g({status:"paused"});return}p=!0,l.status!=="searching"&&g({status:"searching"});for(const v of e){if(m)break;if(await b(v)){if(p=!1,m)return;m=!0,d.removeEventListener("visibilitychange",y),g({status:"found",firstRoundDone:!0}),r(v);return}}if(p=!1,!m){if(f+=1,l.firstRoundDone||g({firstRoundDone:!0}),j()){g({status:"paused"});return}x=o(()=>{N()},ho(f,Mi))}}};function y(){if(!m){if(j()){x!==null&&(i(x),x=null),p||g({status:"paused"});return}x!==null&&i(x),f=0,N()}}return d.addEventListener("visibilitychange",y),a(l),N(),()=>{m=!0,x!==null&&i(x),h?.abort(),d.removeEventListener("visibilitychange",y)}}function Ki(t,e){return xo(bo({endpoint:t,fetch:s=>fetch(s,{signal:e})}))}const Ii=["loopback-network","local-network-access"];async function Ui(){if(vo(window.location.origin))return null;for(const t of Ii)try{return await navigator.permissions.query({name:t})}catch{}return null}let $r=null,Hn=!1;const Ns=new Set;function Hi(t){if(Ns.add(t),!Hn){Hn=!0;const e=s=>{$r=s;for(const r of Ns)r()};Ui().then(s=>{if(!s)return e("unsupported");e(s.state),s.addEventListener("change",()=>e(s.state))})}return()=>Ns.delete(t)}const Vi={status:"stopped",firstRoundDone:!1,problem:null},Cs=new Map;function qi(t){const e=Cs.get(t);if(e)return e;let s={status:"searching",firstRoundDone:!1,problem:null};const r=new Set;let a=null;const d={onFound:()=>{},getSnapshot:()=>s,subscribe:o=>(r.add(o),a??=zi({candidates:t.split(" "),probe:Ki,onFound:i=>d.onFound(i),onChange:i=>{s=i;for(const c of r)c()}}),()=>{r.delete(o),!(r.size>0)&&(a?.(),a=null,Cs.delete(t))})};return Cs.set(t,d),d}function Mr(){return C.useSyncExternalStore(Hi,qn,qn)}const Wi=()=>()=>{},Vn=()=>Vi,qn=()=>$r;function zd(t){const e=ce.c(9),{candidates:s,onFound:r}=t,[a,d]=C.useState(!1),o=Mr(),c=(o==="granted"||o==="unsupported"||o==="prompt"&&a)&&s.length>0;let l;e[0]!==c||e[1]!==s||e[2]!==r?(l=c?qi(s.join(" ")):null,l&&(l.onFound=r),e[0]=c,e[1]=s,e[2]=r,e[3]=l):l=e[3];const m=C.useSyncExternalStore(l?.subscribe??Wi,l?.getSnapshot??Vn,l?.getSnapshot??Vn),p=o==="prompt"&&!a;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>d(!0),e[4]=f):f=e[4];let x;return e[5]!==o||e[6]!==m||e[7]!==p?(x={state:m,access:o,needsGesture:p,start:f},e[5]=o,e[6]=m,e[7]=p,e[8]=x):x=e[8],x}const Ts={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Gi(t){const{previewState:e,progressStatus:s,fastPreviewActive:r=!1,fastPreviewReady:a=!1,codingSession:d=!1,hostedDraft:o=!1}=t,i=d?null:t.previewServerUrl;return t.deciding?{...Ts,showDecidingLoader:!0}:t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Ts:o&&t.hostedPointerPending&&!a?{...Ts,showDecidingLoader:!0}:r&&a&&i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!1}:r&&o&&i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!1}:!r&&e.kind==="iframe"&&s!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Ji=1e4,Yi=1e3,Qi=3e4;function Xi({iframeRef:t,src:e,active:s}){const r=C.useRef(0),a=C.useRef(null),d=C.useRef(null),o=C.useRef(e),i=C.useRef(s);o.current=e,i.current=s;const c=()=>{a.current&&clearTimeout(a.current),d.current&&clearTimeout(d.current),a.current=null,d.current=null},l=()=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,m()},Ji)},m=()=>{if(!i.current||!o.current)return;d.current&&clearTimeout(d.current);const x=po(Qi,Yi,r.current,2,.5);r.current+=1,d.current=setTimeout(()=>{d.current=null;const h=t.current,j=o.current;!h||!j||!i.current||(h.src=j,l())},x)},p=()=>{r.current=0,c()},f=()=>{a.current&&(clearTimeout(a.current),a.current=null),m()};return C.useEffect(()=>{if(c(),r.current=0,!(!s||!e))return l(),c},[e,s]),{handleLoad:p,handleError:f}}const Zi=1500,el=500;function tl({iframe:t,reload:e,waitMs:s=Zi,confirmMs:r=el}){let a;const d=()=>{clearTimeout(o),a=setTimeout(e,r)};t.addEventListener("load",d,{once:!0});const o=setTimeout(()=>{t.removeEventListener("load",d),e()},s);return()=>{clearTimeout(o),clearTimeout(a),t.removeEventListener("load",d)}}const sl=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:ot(),height:ot()}),position:Xt({x:ot(),y:ot()})}),nl=`(function() {
3
3
  if (window.__visualEditorActive) return;
4
4
  window.__visualEditorActive = true;
5
5
 
@@ -548,4 +548,4 @@ import{c as ce,j as n,r as C,l as De,b as Pe,B as Me,aK as Xt,b9 as ot,aL as Ae,
548
548
  }
549
549
  });
550
550
  })();`;function $s(t,e,s=!1){let r=t,a=typeof r?.__resolveType=="string"?r.__resolveType:"";for(let d=0;a&&d<5;d++){const o=e[a];if(o&&typeof o=="object"&&"__resolveType"in o){const i=o.__resolveType;if(typeof i=="string"&&i&&i!==a){r=o,a=i;continue}}break}if(!a)return[];if(a.includes("flags/multivariate")||s&&Sa(a,s)){const d=Array.isArray(r.variants)?r.variants:[];if(d.length===0||d.every(c=>{const l=c?.rule;return Pa(l?.__resolveType,s)}))return null;const i=[];for(const c of d){const l=ja(c,s);if(l&&typeof l=="object")for(const m of $s(l,e,s)??[])i.includes(m)||i.push(m)}return i}if(Ea(a)){const d=r.section&&typeof r.section=="object"?$s(r.section,e,s):[];return d===null?null:d.length?[a,...d]:[a]}return[a]}function rt(t){return t.replace(/[`*_]/g,"\\$&")}function ol(t,e){const s=[`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&&s.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)}"`:""}>`;s.push(`**Clicked element:** \`${r}\``),t.parents&&s.push(`**DOM breadcrumb:** ${rt(t.parents)} > ${t.tag}`),t.text&&s.push(`**Text content:** "${rt(t.text)}"`),t.componentName&&s.push(`**Component name:** ${rt(t.componentName)}`);const a=t.html.replace(/```/g,"`` `");return s.push("","**HTML snippet:**","```html",a,"```"),s.push("","Please read the source file, locate the element, and apply the requested change."),s.join(`
551
- `)}function il(t,e,s=320,r=44,a=12){const{x:d,y:o}=t,{width:i,height:c}=e,l=Math.max(a,Math.min(d-s/2,i-s-a)),p=o/c>.68?Math.max(a,o-r-18):Math.min(o+18,c-r-a);return{leftPct:l/i*100,topPct:p/c*100}}function ll(t){const e=ce.c(45),{element:s,onDismiss:r}=t,[a,d]=C.useState(""),o=C.useRef(null),{sendMessage:i}=Ga(),{openSidePanel:c}=ii(),l=Pe();let m;e[0]!==s||e[1]!==a||e[2]!==r||e[3]!==c||e[4]!==i?(m=()=>{if(!a.trim())return;const H=ol(s,a);c(),i({parts:[{type:"text",text:H}]}),r()},e[0]=s,e[1]=a,e[2]=r,e[3]=c,e[4]=i,e[5]=m):m=e[5];const p=m;let f;e[6]!==s.position||e[7]!==s.viewport?(f=il(s.position,s.viewport),e[6]=s.position,e[7]=s.viewport,e[8]=f):f=e[8];const x=f,h=`${x.leftPct}%`,j=`${x.topPct}%`;let g;e[9]!==h||e[10]!==j?(g={left:h,top:j,width:"320px"},e[9]=h,e[10]=j,e[11]=g):g=e[11];let b;e[12]!==p?(b=H=>{H.preventDefault(),p()},e[12]=p,e[13]=b):b=e[13];let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=H=>d(H.target.value),e[14]=N):N=e[14];let y;e[15]!==r?(y=H=>{H.key==="Escape"&&r()},e[15]=r,e[16]=y):y=e[16];let v;e[17]!==l?(v=l("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=l,e[18]=v):v=e[18];let P;e[19]!==a||e[20]!==y||e[21]!==v?(P=n.jsx("input",{ref:o,autoFocus:!0,type:"text",value:a,onChange:N,onKeyDown:y,placeholder:v,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=a,e[20]=y,e[21]=v,e[22]=P):P=e[22];let E;e[23]!==a?(E=a.trim(),e[23]=a,e[24]=E):E=e[24];const k=!E;let S;e[25]!==l?(S=l("sandbox.visualEditorPrompt.sendButton"),e[25]=l,e[26]=S):S=e[26];let R;e[27]!==l?(R=l("sandbox.visualEditorPrompt.sendButton"),e[27]=l,e[28]=R):R=e[28];let O;e[29]!==R?(O=n.jsx("title",{children:R}),e[29]=R,e[30]=O):O=e[30];let T;e[31]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=T):T=e[31];let L;e[32]!==O?(L=n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[O,T]}),e[32]=O,e[33]=L):L=e[33];let D;e[34]!==k||e[35]!==S||e[36]!==L?(D=n.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:S,children:L}),e[34]=k,e[35]=S,e[36]=L,e[37]=D):D=e[37];let A;e[38]!==P||e[39]!==D||e[40]!==b?(A=n.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:b,children:[P,D]}),e[38]=P,e[39]=D,e[40]=b,e[41]=A):A=e[41];let M;return e[42]!==A||e[43]!==g?(M=n.jsx("div",{className:"absolute z-30 pointer-events-none",style:g,children:A}),e[42]=A,e[43]=g,e[44]=M):M=e[44],M}const Gn="site-links",cl=/details?page|\bpdp\b/i,dl=/listingpage|\bplp\b/i;function ul(t,e,s){const r=new Set;for(const i of s)cl.test(i)&&r.add("product"),dl.test(i)&&r.add("category");const a=Ct(Is(t)),d=a[a.length-1],o=a[a.length-2];return d?.type==="text"&&d.text==="/p"&&o?.type==="param"&&o.name===e&&r.add("product"),e==="*"&&a.some(i=>i.type==="param"&&i.name==="*")&&r.add("category"),r}const fl=["rosa","preto","pink","black"];function Jt(t,e){const s=e.trim();return s?t(s):fl.flatMap(r=>t(r))}function pl(t,e){const s=e.trim(),r=[];/^\d+$/.test(s)&&r.push({resolveType:t,props:{ids:[s]}});const d=s.includes("-")&&!/\s/.test(s)?s.replace(/-+/g," "):s;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 Hs(t){return t.split("/")[0]??""}function ml(t){const e=new Set;for(const s of t){const r=Hs(s);Fr.has(r)&&e.add(r)}return e}function hl(t,e){const s=Hs(t);return!Fr.has(s)||e.size===0?!0:e.has(s)}const gl=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>Jt(s=>pl(t,s),e),optionsFromPayload:Yt},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Jt(s=>[{resolveType:t,props:{props:{search:s,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(s=>[{resolveType:t,props:{term:s,hitsPerPage:10}}],e),optionsFromPayload:Yt},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Jt(s=>[{resolveType:t,props:{query:s,term:s,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:Sl}];function vl(t,e,s=new Set){const r=[...e],a=i=>{const c=[];for(const l of gl){if(l.kind!==i)continue;const m=r.find(p=>l.test(p)&&hl(p,s));m&&c.push({cand:l,resolveType:m})}return c.find(l=>s.has(Hs(l.resolveType)))??c[0]},d=(i,c,l)=>({kind:i.kind,id:`${i.kind}:${c}`,resolveType:c,clientFilter:i.clientFilter,isFallback:l,buildRequests:m=>i.buildRequests(c,m),optionsFromPayload:i.optionsFromPayload}),o=[];for(const i of["product","category"]){if(!t.has(i))continue;const c=a(i);c&&o.push(d(c.cand,c.resolveType,!1))}return t.size>0&&o.push(xl(t.has("category")?"category":"product")),o}function xl(t){return{kind:t,id:Gn,resolveType:Gn,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,s)=>Cl(e,s)}}function Ge(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function bl(t,e,s){const r=new Set,a=new Set,d=o=>{if(Array.isArray(o)){for(const l of o)d(l);return}const i=Ge(o);if(!i)return;const c=i.__resolveType;if(typeof c=="string"){if(s(c))r.add(c);else if(c in e&&!a.has(c)){a.add(c);const l=Ge(e[c])?.__resolveType;typeof l=="string"&&s(l)&&r.add(c),d(e[c])}}for(const l of Object.values(i))d(l)};return d(t),r}function zr(t){const e=new Set,s=[];for(const r of t)for(const a of r)e.has(a.value)||(e.add(a.value),s.push(a));return s}function Kr(t){try{return decodeURIComponent(t)}catch{return t}}function yl(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wl(t){const e=[];let s="^";for(const r of t)r.type==="text"?s+=yl(r.text):(e.push(r.name),s+=r.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${s}$`),order:e}}function Ir(t,e,s){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 a=Ct(Is(e)),{pattern:d,order:o}=wl(a),i=o.indexOf(s);if(i===-1)return null;const c=r.match(d);if(!c)return null;const l=c[i+1]?.replace(/^\/+|\/+$/g,"");return l?Kr(l):null}function Yt(t,e){const s=Ge(t),r=Array.isArray(t)?t:Array.isArray(s?.products)?s.products:Array.isArray(s?.list)?s.list:[],a=[],d=new Set;for(const o of r){const i=Ge(o);if(!i)continue;const c=Ir(i.url,e.template,e.paramName);if(!c||d.has(c))continue;d.add(c);const l=Ge(i.isVariantOf),m=typeof l?.name=="string"&&l.name||typeof i.name=="string"&&i.name||c,p=Array.isArray(i.image)?Ge(i.image[0]):null,f=typeof p?.url=="string"?p.url:void 0;a.push({value:c,label:m,image:f})}return a}function kl(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const s=e.replace(/^\/+|\/+$/g,"");return s?Kr(s):null}function Sl(t){const e=[],s=new Set,r=(a,d)=>{const o=Ge(a);if(!o)return;const i=typeof o.name=="string"&&o.name?o.name:"",c=i?[...d,i]:d,l=kl(o.url);if(l&&!s.has(l)&&(s.add(l),e.push({value:l,label:c.join(" › ")||l})),Array.isArray(o.children))for(const m of o.children)r(m,c)};if(Array.isArray(t))for(const a of t)r(a,[]);return e}const Pl=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 jl(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,s=>s.toUpperCase())}function El(t){if(typeof t!="string"||!t)return[];const e=[],s=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let r,a=0;for(;(r=s.exec(t))!==null&&a++<5e3;){const d=r[1]??"",o=(r[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:d,text:o})}return e}function Nl(t){if(typeof t!="string"||!t)return[];const e=[],s=new Set,r=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,a=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let d,o=0;for(;(d=r.exec(t))!==null&&o++<3e3;){const i=(d[1]??"").replace(/\\\//g,"/");if(!i||s.has(i))continue;s.add(i);const c=t.slice(d.index,d.index+900).match(a)?.[1]?.replace(/\\\//g,"/");e.push({url:i,name:d[2]??"",image:c||void 0})}return e}function Cl(t,e){const s=[],r=new Set,a=(d,o,i,c)=>{if(s.length>=200)return;const l=Ir(d,e.template,e.paramName);!l||r.has(l)||e.paramName==="*"&&/(^|\/)p$/.test(l)||i==="category"&&Pl.has(l.split("/")[0]??"")||(r.add(l),s.push({value:l,label:o&&o.length<=80?o:jl(l),kind:i,image:c}))};for(const{url:d,name:o,image:i}of Nl(t))a(d,o,"product",i);for(const{href:d,text:o}of El(t))d.startsWith("/")&&!d.startsWith("//")&&a(d,o,"category");return s}function St(t,e,s=50){const r=e.trim().toLowerCase();return(r?t.filter(d=>d.label.toLowerCase().includes(r)||d.value.toLowerCase().includes(r)):t).slice(0,s)}const Ur=1e4;function Tl(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 Ll(t,{resolveType:e,props:s}){const r=await fetch(yo(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...s}),signal:AbortSignal.timeout(Ur)});if(!r.ok)throw new Error(`Failed to fetch options: ${r.status}`);return r.json()}async function Jn(t,e){const s=await fetch(wo(t,e),{signal:AbortSignal.timeout(Ur)});if(!s.ok)throw new Error(`Failed to fetch page: ${s.status}`);return s.text()}async function Rl(t,e,s){const r=e.optionsFromPayload(await Jn(t,"/"),s),a=r.find(o=>o.kind==="category");if(!a)return r;const d=Ve(s.template,{[s.paramName]:a.value});if(d==="/")return r;try{const o=e.optionsFromPayload(await Jn(t,d),s).filter(i=>i.kind==="product");return zr([r,o])}catch{return r}}function Al(t,e,s){return or.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":s}`)}async function _l(t,e,s,r){if(e.homepageLinks)return Rl(t,e,r);const a=e.buildRequests?.(s)??[];if(a.length===0)return[];const d=await Promise.allSettled(a.map(i=>Ll(t,i))),o=d.filter(i=>i.status==="fulfilled").map(i=>i.value);if(o.length===0){const i=d.find(c=>c.status==="rejected");throw i?i.reason:new Error("Failed to fetch options")}return zr(o.map(i=>e.optionsFromPayload(i,r)))}function Ms(t,e,s,r,a){return{queryKey:Al(t,e,s),queryFn:()=>_l(t,e,s,r),enabled:a,staleTime:6e4,retry:1}}function Pt(t){const e=ce.c(16),{heading:s,iconKind:r,options:a,template:d,paramName:o,keyPrefix:i,onSelect:c}=t;if(a.length===0)return null;let l;if(e[0]!==r||e[1]!==i||e[2]!==c||e[3]!==a||e[4]!==o||e[5]!==d){let p;e[7]!==r||e[8]!==i||e[9]!==c||e[10]!==o||e[11]!==d?(p=f=>n.jsxs(Nt,{value:`${i}:${f.value}`,className:"gap-3 py-2",onSelect:()=>c(f.value),children:[r==="product"&&n.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.image?n.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):n.jsx(mr,{size:14,className:"text-muted-foreground"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm",children:f.label}),n.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Ve(d,{[o]:f.value})})]})]},`${i}:${f.value}`),e[7]=r,e[8]=i,e[9]=c,e[10]=o,e[11]=d,e[12]=p):p=e[12],l=a.map(p),e[0]=r,e[1]=i,e[2]=c,e[3]=a,e[4]=o,e[5]=d,e[6]=l}else l=e[6];let m;return e[13]!==s||e[14]!==l?(m=n.jsx(Et,{heading:s,children:l}),e[13]=s,e[14]=l,e[15]=m):m=e[15],m}function Yn(t){const e=ce.c(2),{text:s}=t;let r;return e[0]!==s?(r=n.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:s}),e[0]=s,e[1]=r):r=e[1],r}function Ol(t){const e=ce.c(52),{sources:s,template:r,paramName:a,value:d,sandboxRef:o,onCommit:i}=t,c=Pe(),[l,m]=C.useState(!1),[p,f]=C.useState(""),[x,h]=C.useState(""),j=C.useRef(null),g=a==="*"?c("sandbox.preview.catchAllParamLabel"):`:${a}`,b=Tl(c),y=[...new Set(s.map(ne=>b[ne.kind].noun))].join(" or ");let v;e[0]!==c||e[1]!==y?(v=c("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=c,e[1]=y,e[2]=v):v=e[2];const P=v,E={template:r,paramName:a};let k;e[3]!==p?(k=(ne,oe)=>({source:ne,query:oe,options:ne.clientFilter?St(oe.data??[],p):oe.data??[]}),e[3]=p,e[4]=k):k=e[4];const S=k,R=s.filter(Il),O=s.filter(Kl),T=Ds({queries:R.map(ne=>Ms(o,ne,x,E,l))});let L;e[5]!==T||e[6]!==S?(L=(ne,oe)=>S(ne,T[oe]),e[5]=T,e[6]=S,e[7]=L):L=e[7];const D=R.map(L),A=D.length===0||D.every(zl),M=Ds({queries:O.map(ne=>Ms(o,ne,x,E,l&&A))});let H;e[8]!==M||e[9]!==S?(H=(ne,oe)=>S(ne,M[oe]),e[8]=M,e[9]=S,e[10]=H):H=e[10];const X=O.map(H),V=A?X:D,J=V.length===1&&V[0]?.source.homepageLinks?V[0]:null,G=J&&!J.query.isLoading&&!J.query.isError?J?.query.data??[]:[],Y=St(G.filter(Fl),p),_=St(G.filter(Ml),p),$=Y.length>0&&_.length>0,F=ne=>{m(ne),j.current&&clearTimeout(j.current),f(ne?d:""),h(ne?d:"")};let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=ne=>{f(ne),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{h(ne)},300)},e[11]=I):I=e[11];const B=I,z=ne=>{i(ne),F(!1)},W=Rr(p),K=Ve(r,{[a]:W}),te=ar,se=rr,ee="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",ae=$l;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=n.jsx(ir,{className:"sr-only",children:n.jsx(lr,{children:pe})}),e[15]=pe,e[16]=de):de=e[16];let ve;e[17]===Symbol.for("react.memo_cache_sentinel")?(ve=n.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=n.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=n.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[ve,n.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 ie;e[25]!==P||e[26]!==p?(ie=n.jsx(Sr,{autoFocus:!0,placeholder:P,value:p,onValueChange:B}),e[25]=P,e[26]=p,e[27]=ie):ie=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=n.jsx(Pr,{children:ze}),e[30]=ze,e[31]=Be):Be=e[31];const ut=W&&n.jsx(Et,{className:"shrink-0",children:n.jsxs(Nt,{value:`__raw__:${W}`,className:"gap-3 py-2",onSelect:()=>z(W),children:[n.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:n.jsx(ci,{size:14,className:"text-muted-foreground"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm",children:c("sandbox.pathParamPickerChip.useRawValue",{rawTerm:W,paramLabel:g})}),n.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:K})]})]})}),Je=$?n.jsxs("div",{className:"flex min-h-0 flex-1",children:[n.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:n.jsx(Pt,{heading:b.category.heading,iconKind:"category",options:Y,template:r,paramName:a,keyPrefix:`${J?.source.id}:cat`,onSelect:z})}),n.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:n.jsx(Pt,{heading:b.product.heading,iconKind:"product",options:_,template:r,paramName:a,keyPrefix:`${J?.source.id}:prod`,onSelect:z})})]}):n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:V.map(ne=>{const{source:oe,query:ke,options:Ie}=ne,{noun:ft}=b[oe.kind];if(ke.isLoading)return n.jsx(Yn,{text:c("sandbox.pathParamPickerChip.loading",{noun:ft})},oe.id);if(ke.isError)return n.jsx(Yn,{text:c("sandbox.pathParamPickerChip.couldNotLoad")},oe.id);if(oe.homepageLinks){const Ye=ke.data??[];return n.jsxs(C.Fragment,{children:[n.jsx(Pt,{heading:b.category.heading,iconKind:"category",options:St(Ye.filter(Bl),p),template:r,paramName:a,keyPrefix:`${oe.id}:cat`,onSelect:z}),n.jsx(Pt,{heading:b.product.heading,iconKind:"product",options:St(Ye.filter(Dl),p),template:r,paramName:a,keyPrefix:`${oe.id}:prod`,onSelect:z})]},oe.id)}return n.jsx(Pt,{heading:V.length>1?b[oe.kind].heading:void 0,iconKind:oe.kind,options:Ie,template:r,paramName:a,keyPrefix:oe.id,onSelect:z},oe.id)})});let he;e[32]!==Ne||e[33]!==Be||e[34]!==ut||e[35]!==Je?(he=n.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 Le;e[37]!==ge||e[38]!==ie||e[39]!==he?(Le=n.jsxs(ge,{shouldFilter:je,className:fe,children:[ie,he]}),e[37]=ge,e[38]=ie,e[39]=he,e[40]=Le):Le=e[40];let _e;e[41]!==se||e[42]!==de||e[43]!==me||e[44]!==Le||e[45]!==ae?(_e=n.jsxs(se,{className:ee,onClick:ae,children:[de,me,Le]}),e[41]=se,e[42]=de,e[43]=me,e[44]=Le,e[45]=ae,e[46]=_e):_e=e[46];let Ke;return e[47]!==te||e[48]!==F||e[49]!==l||e[50]!==_e?(Ke=n.jsx(te,{open:l,onOpenChange:F,children:_e}),e[47]=te,e[48]=F,e[49]=l,e[50]=_e,e[51]=Ke):Ke=e[51],n.jsxs(n.Fragment,{children:[n.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 Dl(t){return t.kind==="product"}function Bl(t){return t.kind!=="product"}function $l(t){return t.stopPropagation()}function Ml(t){return t.kind==="product"}function Fl(t){return t.kind!=="product"}function zl(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Kl(t){return t.isFallback}function Il(t){return!t.isFallback}function Ul(t){const e=ce.c(8),{sources:s,template:r,paramName:a,sandboxRef:d,onFill:o}=t;let i,c;if(e[0]!==a||e[1]!==d||e[2]!==s||e[3]!==r){const x={template:r,paramName:a},h=s.filter(Hl);c=Ds,i=h.map(j=>Ms(d,j,"",x,!0)),e[0]=a,e[1]=d,e[2]=s,e[3]=r,e[4]=i,e[5]=c}else i=e[4],c=e[5];let l;e[6]!==i?(l={queries:i},e[6]=i,e[7]=l):l=e[7];const m=c(l),[p,f]=C.useState(!1);if(!p)for(const x of m){if(x.isLoading)break;const h=x.data?.[0];if(h){f(!0),queueMicrotask(()=>o(h.value));break}}return null}function Hl(t){return!t.isFallback}function Vl(t){const e=ce.c(31),{name:s,value:r,onCommit:a}=t,d=Pe(),[o,i]=C.useState(r),[c,l]=C.useState(!1),m=C.useRef(!1);let p;e[0]!==s||e[1]!==d?(p=s==="*"?d("sandbox.preview.catchAllParamLabel"):`:${s}`,e[0]=s,e[1]=d,e[2]=p):p=e[2];const f=p,x=o||f;let h;e[3]!==x?(h=n.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 j;e[5]!==f||e[6]!==d?(j=d("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=d,e[7]=j):j=e[7];let g,b;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=S=>i(S.target.value),b=()=>l(!0),e[8]=g,e[9]=b):(g=e[8],b=e[9]);let N;e[10]!==r?(N=S=>{S.key==="Enter"&&S.currentTarget.blur(),S.key==="Escape"&&(m.current=!0,i(r),S.currentTarget.blur())},e[10]=r,e[11]=N):N=e[11];let y;e[12]!==o||e[13]!==a||e[14]!==r?(y=()=>{if(l(!1),m.current){m.current=!1;return}const S=Rr(o);i(S),S!==r&&a(S)},e[12]=o,e[13]=a,e[14]=r,e[15]=y):y=e[15];let v;e[16]!==o||e[17]!==f||e[18]!==j||e[19]!==N||e[20]!==y?(v=n.jsx("input",{type:"text",value:o,placeholder:f,title:j,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:ql,onChange:g,onFocus:b,onKeyDown:N,onBlur:y}),e[16]=o,e[17]=f,e[18]=j,e[19]=N,e[20]=y,e[21]=v):v=e[21];let P;e[22]!==h||e[23]!==v?(P=n.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]=P):P=e[24];let E;e[25]!==c||e[26]!==d?(E=c&&n.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:[n.jsx(to,{size:10}),d("sandbox.preview.enterToGo")]}),e[25]=c,e[26]=d,e[27]=E):E=e[27];let k;return e[28]!==E||e[29]!==P?(k=n.jsxs(n.Fragment,{children:[P,E]}),e[28]=E,e[29]=P,e[30]=k):k=e[30],k}function ql(t){return t.stopPropagation()}function Wl(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const s=new URL(e),r=t.resolvedPath==="/"?"":t.resolvedPath;return`${s.host}${r}`}catch{return e}}function Gl(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Jl(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 Yl(t,e){if(t)return t;const s=await e?.().catch(()=>null);if(!s)throw new Hr;return s}async function Ql(t,e,s){return s?Nn(t,e,await Yl(s.meta,s.loadMeta)):Nn(t,e)}function Xl(t){const e=ce.c(5);let s;e[0]!==t?(s=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=s):s=e[1];const r=dr(s);let a;return e[2]!==t||e[3]!==r?(a={mutationFn:async d=>{const{name:o,path:i,template:c,schema:l}=d;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const m=Ba(o),p=c?{...c,name:o,path:i}:await Ql(o,i,l);return await r.mutateAsync({blockKey:m,data:p}),{key:m,name:o,path:i}}},e[2]=t,e[3]=r,e[4]=a):a=e[4],Na(a)}function Zl(t){const e=ce.c(89),{open:s,onOpenChange:r,isPending:a,error:d,templates:o,onSubmit:i}=t,c=a===void 0?!1:a,l=Pe();let m;e[0]!==l?(m=l("sectionsEditor.createPageModal.defaultPageName"),e[0]=l,e[1]=m):m=e[1];const[p,f]=C.useState(m);let x;e[2]!==l?(x=l("sectionsEditor.createPageModal.defaultPagePath"),e[2]=l,e[3]=x):x=e[3];const[h,j]=C.useState(x),[g,b]=C.useState(Ss),[N,y]=C.useState(null),[v,P]=C.useState(s);s!==v&&(P(s),s&&(f(l("sectionsEditor.createPageModal.defaultPageName")),j(l("sectionsEditor.createPageModal.defaultPagePath")),b(Ss),y(null)));const E=!!o?.length;let k;e[4]!==c||e[5]!==r?(k=ue=>{!ue&&!c&&(y(null),r(!1))},e[4]=c,e[5]=r,e[6]=k):k=e[6];const S=k;let R;e[7]!==c||e[8]!==p||e[9]!==i||e[10]!==h||e[11]!==E||e[12]!==g?(R=async ue=>{ue.preventDefault();const xe=p.trim(),me=h.trim();if(!xe||!me||c)return;const ge=Ar(me);if(ge){y(ge);return}y(null),await i({name:xe,path:me,templateKey:E&&g!==Ss?g:null})},e[7]=c,e[8]=p,e[9]=i,e[10]=h,e[11]=E,e[12]=g,e[13]=R):R=e[13];const O=R,T=N??d;let L;e[14]!==l?(L=l("sectionsEditor.createPageModal.title"),e[14]=l,e[15]=L):L=e[15];let D;e[16]!==L?(D=n.jsx(ir,{children:n.jsx(lr,{children:L})}),e[16]=L,e[17]=D):D=e[17];let A;e[18]!==l?(A=l("sectionsEditor.createPageModal.nameLabel"),e[18]=l,e[19]=A):A=e[19];let M;e[20]!==A?(M=n.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:A}),e[20]=A,e[21]=M):M=e[21];let H;e[22]===Symbol.for("react.memo_cache_sentinel")?(H=ue=>f(ue.target.value),e[22]=H):H=e[22];let X;e[23]!==l?(X=l("sectionsEditor.createPageModal.namePlaceholder"),e[23]=l,e[24]=X):X=e[24];let V;e[25]!==c||e[26]!==p||e[27]!==X?(V=n.jsx(Rs,{id:"new-page-name",value:p,onChange:H,placeholder:X,autoFocus:!0,disabled:c}),e[25]=c,e[26]=p,e[27]=X,e[28]=V):V=e[28];let J;e[29]!==V||e[30]!==M?(J=n.jsxs("div",{className:"space-y-1.5",children:[M,V]}),e[29]=V,e[30]=M,e[31]=J):J=e[31];let q;e[32]!==l?(q=l("sectionsEditor.createPageModal.pathLabel"),e[32]=l,e[33]=q):q=e[33];let G;e[34]!==q?(G=n.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:q}),e[34]=q,e[35]=G):G=e[35];let Y;e[36]===Symbol.for("react.memo_cache_sentinel")?(Y=ue=>j(ue.target.value),e[36]=Y):Y=e[36];let _;e[37]!==l?(_=l("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=l,e[38]=_):_=e[38];let $;e[39]!==c||e[40]!==h||e[41]!==_?($=n.jsx(Rs,{id:"new-page-path",value:h,onChange:Y,placeholder:_,disabled:c}),e[39]=c,e[40]=h,e[41]=_,e[42]=$):$=e[42];let F;e[43]!==G||e[44]!==$?(F=n.jsxs("div",{className:"space-y-1.5",children:[G,$]}),e[43]=G,e[44]=$,e[45]=F):F=e[45];let I;e[46]!==c||e[47]!==E||e[48]!==l||e[49]!==g||e[50]!==o?(I=E&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.createPageModal.templateLabel")}),n.jsx($a,{id:"new-page-template",value:g,onChange:b,templates:o??[],disabled:c})]}),e[46]=c,e[47]=E,e[48]=l,e[49]=g,e[50]=o,e[51]=I):I=e[51];let B;e[52]!==T?(B=T&&n.jsx("p",{className:"text-xs text-destructive",children:T}),e[52]=T,e[53]=B):B=e[53];let z;e[54]!==J||e[55]!==F||e[56]!==I||e[57]!==B?(z=n.jsxs("div",{className:"space-y-4 py-4",children:[J,F,I,B]}),e[54]=J,e[55]=F,e[56]=I,e[57]=B,e[58]=z):z=e[58];let W;e[59]!==r?(W=()=>r(!1),e[59]=r,e[60]=W):W=e[60];let K;e[61]!==l?(K=l("sectionsEditor.createPageModal.cancelButton"),e[61]=l,e[62]=K):K=e[62];let te;e[63]!==c||e[64]!==W||e[65]!==K?(te=n.jsx(Me,{type:"button",variant:"outline",onClick:W,disabled:c,children:K}),e[63]=c,e[64]=W,e[65]=K,e[66]=te):te=e[66];let se;e[67]!==c||e[68]!==p||e[69]!==h?(se=!p.trim()||!h.trim()||c,e[67]=c,e[68]=p,e[69]=h,e[70]=se):se=e[70];let ee;e[71]!==c||e[72]!==l?(ee=c?n.jsxs(n.Fragment,{children:[n.jsx(Tt,{className:"size-3.5"}),l("sectionsEditor.createPageModal.creatingButton")]}):l("sectionsEditor.createPageModal.createButton"),e[71]=c,e[72]=l,e[73]=ee):ee=e[73];let ae;e[74]!==se||e[75]!==ee?(ae=n.jsx(Me,{type:"submit",disabled:se,children:ee}),e[74]=se,e[75]=ee,e[76]=ae):ae=e[76];let pe;e[77]!==te||e[78]!==ae?(pe=n.jsxs(Ca,{children:[te,ae]}),e[77]=te,e[78]=ae,e[79]=pe):pe=e[79];let de;e[80]!==O||e[81]!==z||e[82]!==pe||e[83]!==D?(de=n.jsx(rr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:O,children:[D,z,pe]})}),e[80]=O,e[81]=z,e[82]=pe,e[83]=D,e[84]=de):de=e[84];let ve;return e[85]!==S||e[86]!==s||e[87]!==de?(ve=n.jsx(ar,{open:s,onOpenChange:S,children:de}),e[85]=S,e[86]=s,e[87]=de,e[88]=ve):ve=e[88],ve}function ec(t){const e=ce.c(36),{orgSlug:s,virtualMcpId:r,branch:a,previewUrl:d,meta:o,decofile:i,blockKey:c}=t,l=Pe();let m;e[0]!==a||e[1]!==s||e[2]!==r?(m={orgSlug:s,virtualMcpId:r,branch:a},e[0]=a,e[1]=s,e[2]=r,e[3]=m):m=e[3];const p=dr(m);let f;e[4]!==p?(f=za((k,S)=>p.mutate({blockKey:k,data:S})),e[4]=p,e[5]=f):f=e[5];const x=f;let h;e[6]!==c||e[7]!==i?(h=Ma(i,c),e[6]=c,e[7]=i,e[8]=h):h=e[8];const{resolveType:j,props:g,title:b}=h;if(!j){let k;e[9]!==l?(k=l("sandbox.preview.loaderNoLongerExists"),e[9]=l,e[10]=k):k=e[10];let S;return e[11]!==k?(S=n.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:k}),e[11]=k,e[12]=S):S=e[12],S}const N=`loader:${c}`,y=`loader:${c}`;let v;e[13]!==c||e[14]!==j||e[15]!==b?(v={mode:"saved",blockKey:c,resolveType:j,title:b},e[13]=c,e[14]=j,e[15]=b,e[16]=v):v=e[16];let P;e[17]!==a||e[18]!==i||e[19]!==o||e[20]!==s||e[21]!==d||e[22]!==g||e[23]!==p.isPending||e[24]!==x||e[25]!==y||e[26]!==v||e[27]!==r?(P=n.jsx(Fa,{orgSlug:s,virtualMcpId:r,branch:a,previewUrl:d,meta:o,decofile:i,kind:"loaders",target:v,initialValue:g,isCreating:p.isPending,onCreate:tc,onSaveReferencedBlock:x,showRun:!1},y),e[17]=a,e[18]=i,e[19]=o,e[20]=s,e[21]=d,e[22]=g,e[23]=p.isPending,e[24]=x,e[25]=y,e[26]=v,e[27]=r,e[28]=P):P=e[28];let E;return e[29]!==c||e[30]!==a||e[31]!==s||e[32]!==N||e[33]!==P||e[34]!==r?(E=n.jsx(Ka,{orgSlug:s,virtualMcpId:r,branch:a,blockKey:c,present:void 0,children:P},N),e[29]=c,e[30]=a,e[31]=s,e[32]=N,e[33]=P,e[34]=r,e[35]=E):E=e[35],E}async function tc(){}function sc(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Qn(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:sc(t.error)}}function nc(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 rc(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=nc(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const s=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return s&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(a=>a.status==="error"&&!a.hasData&&a.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:s?t.lifecyclePhase==="running"||t.lifecyclePhase==="crashed"?{kind:"error",source:"data"}:{kind:"loading"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"}}const ac=C.lazy(()=>Ta(()=>import("./sections-editor-DfuqBfpL.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])).then(t=>({default:t.SectionsEditor})));function Xn(t){const e=ce.c(60),{virtualMcpId:s,externalSelection:r,onViewJsonFile:a}=t,d=r===void 0?null:r,{org:o}=zs(),{currentBranch:i,taskId:c}=Lt(),l=Us(),m=Rt(),p=Or(),f=l.lifecycle.phase==="running",x=m.previewUrl;let h;e[0]!==i||e[1]!==o||e[2]!==x||e[3]!==c||e[4]!==s?(h=i?{orgSlug:o.slug,virtualMcpId:s,branch:i,threadId:c??null,previewUrl:x}:null,e[0]=i,e[1]=o,e[2]=x,e[3]=c,e[4]=s,e[5]=h):h=e[5];const j=h,g=ss(s,i);let b;e[6]!==f?(b={fetchEnabled:f},e[6]=f,e[7]=b):b=e[7];const N=Ks(j,b);let y;e[8]!==f?(y={fetchEnabled:f},e[8]=f,e[9]=y):y=e[9];const v=Lr(j,y),P=rc({lifecyclePhase:l.lifecycle.phase,decofile:Qn(N),meta:Qn(v),hasEditableContent:qo(N.data,v.data),fastPreviewActive:jr(s).runtime==="cms"||at(g)}),E=ur()===void 0,k=oc;if(Bo(g)){let _;return e[10]===Symbol.for("react.memo_cache_sentinel")?(_=k(n.jsx(Mo,{})),e[10]=_):_=e[10],_}if(g.kind==="pending"&&g.retrying){let _;return e[11]!==g?(_=k(n.jsx(Fo,{backend:g})),e[11]=g,e[12]=_):_=e[12],_}if(P.kind==="loading"||E){let _;return e[13]===Symbol.for("react.memo_cache_sentinel")?(_=k(n.jsx(La,{})),e[13]=_):_=e[13],_}if(N.data&&ko(v.data)){const _=p.state.target,$=_?.kind==="page"||_?.kind==="section"?_.key:null,F=$??"",I=i??"";let B;return e[14]!==N.data||e[15]!==$||e[16]!==o.slug||e[17]!==F||e[18]!==I||e[19]!==s?(B=k(n.jsx(Ia,{orgSlug:o.slug,virtualMcpId:s,branch:I,decofile:N.data,initialKey:$,compact:!0},F)),e[14]=N.data,e[15]=$,e[16]=o.slug,e[17]=F,e[18]=I,e[19]=s,e[20]=B):B=e[20],B}if(P.kind==="empty"){let _;return e[21]===Symbol.for("react.memo_cache_sentinel")?(_=k(n.jsx(zo,{})),e[21]=_):_=e[21],_}if(P.kind==="error"){let _;e[22]!==N||e[23]!==m||e[24]!==v||e[25]!==P.source?(_=()=>{if(P.source==="sandbox"){m.retry();return}Promise.all([N.refetch(),v.refetch()])},e[22]=N,e[23]=m,e[24]=v,e[25]=P.source,e[26]=_):_=e[26];const $=_;let F;return e[27]!==$||e[28]!==P.source?(F=k(n.jsx($o,{source:P.source,onRetry:$})),e[27]=$,e[28]=P.source,e[29]=F):F=e[29],F}let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=_=>k(n.jsx("div",{className:"h-full min-h-0",children:_})),e[30]=S):S=e[30];const R=S,O=p.state.target;if(O?.kind==="loader"&&N.data&&v.data){const _=i??"",$=x??null;let F;return e[31]!==N.data||e[32]!==v.data||e[33]!==o.slug||e[34]!==_||e[35]!==$||e[36]!==O.key||e[37]!==s?(F=R(n.jsx(ec,{orgSlug:o.slug,virtualMcpId:s,branch:_,previewUrl:$,meta:v.data,decofile:N.data,blockKey:O.key})),e[31]=N.data,e[32]=v.data,e[33]=o.slug,e[34]=_,e[35]=$,e[36]=O.key,e[37]=s,e[38]=F):F=e[38],F}let T;e[39]!==i||e[40]!==o.slug||e[41]!==O||e[42]!==s?(T=O||!i?null:fr(pr(o.slug,s,i)),e[39]=i,e[40]=o.slug,e[41]=O,e[42]=s,e[43]=T):T=e[43];const L=T;let D="/",A=null,M=null;O?.kind==="page"?(D=O.path,A=O.key):O?.kind==="section"?M=O.key:L&&(D=L.path,A=L.pageKey);const H=A?`page:${A}`:M?`section:${M}`:`path:${D}`;let X;e[44]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(Tt,{className:"size-5 text-muted-foreground"})}),e[44]=X):X=e[44];const V=i??"",J=x??void 0,q=M?null:d,G=!!A&&p.state.editSeoPageKey===A;let Y;return e[45]!==M||e[46]!==A||e[47]!==D||e[48]!==H||e[49]!==a||e[50]!==o.slug||e[51]!==q||e[52]!==G||e[53]!==V||e[54]!==J||e[55]!==s||e[56]!==p.consumeEditSeo||e[57]!==p.setFocusedBlock||e[58]!==p.setVariantOverride?(Y=R(n.jsx(C.Suspense,{fallback:X,children:n.jsx(ac,{orgSlug:o.slug,virtualMcpId:s,branch:V,previewReady:!0,previewUrl:J,currentPath:D,activePageBlockKey:A,activeGlobalBlockKey:M,externalSelection:q,initialEditSeo:G,onExitSeo:p.consumeEditSeo,onVariantPreviewOverride:p.setVariantOverride,onFocusedBlockChange:p.setFocusedBlock,onViewJsonFile:a},H)})),e[45]=M,e[46]=A,e[47]=D,e[48]=H,e[49]=a,e[50]=o.slug,e[51]=q,e[52]=G,e[53]=V,e[54]=J,e[55]=s,e[56]=p.consumeEditSeo,e[57]=p.setFocusedBlock,e[58]=p.setVariantOverride,e[59]=Y):Y=e[59],Y}function oc(t){return n.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function Zn(t){const e=ce.c(51),{virtualMcpId:s,pageKey:r,onClose:a,ref:d}=t,o=Pe(),i=ur(),c=i===!0,l=So(s);let m;e[0]!==l||e[1]!==r?(m=Po(l,ui(r)),e[0]=l,e[1]=r,e[2]=m):m=e[2];const p=m,{org:f}=zs(),{currentBranch:x,taskId:h}=Lt(),g=Rt().previewUrl;let b;e[3]!==x||e[4]!==f.slug||e[5]!==g||e[6]!==h||e[7]!==s?(b=x?{orgSlug:f.slug,virtualMcpId:s,branch:x,threadId:h??null,previewUrl:g}:null,e[3]=x,e[4]=f.slug,e[5]=g,e[6]=h,e[7]=s,e[8]=b):b=e[8];const y=Ks(b),v=x??"";let P;e[9]!==f.slug||e[10]!==v||e[11]!==s?(P={orgSlug:f.slug,virtualMcpId:s,branch:v},e[9]=f.slug,e[10]=v,e[11]=s,e[12]=P):P=e[12];let E;e[13]===Symbol.for("react.memo_cache_sentinel")?(E={holdsCopy:!0},e[13]=E):E=e[13];const{save:k,flush:S,hold:R}=Ua(P,E),O=x??"";let T;e[14]!==f.slug||e[15]!==O||e[16]!==s?(T=Ko({orgSlug:f.slug,virtualMcpId:s,branch:O}),e[14]=f.slug,e[15]=O,e[16]=s,e[17]=T):T=e[17];const L=Io(T);let D;e[18]!==r||e[19]!==L?(D=L(r),e[18]=r,e[19]=L,e[20]=D):D=e[20];const A=D;let M;e[21]!==A||e[22]!==r?(M={pageKey:r,copyEpoch:A},e[21]=A,e[22]=r,e[23]=M):M=e[23];const[H,X]=C.useState(M);(H.pageKey!==r||H.copyEpoch!==A)&&(X({pageKey:r,copyEpoch:A}),R(r));const V=y.data?.[r],J=y.data===void 0&&y.isLoading||i===void 0,q=y.data!==void 0&&V===void 0,G=!x||q||J;let Y;e[24]!==V?(Y=V===void 0?"":JSON.stringify(V,null,2),e[24]=V,e[25]=Y):Y=e[25];const _=Y;let $;e[26]!==r||e[27]!==G||e[28]!==k?($=K=>{if(G)return;let te;try{te=JSON.parse(K)}catch{return}te===null||typeof te!="object"||Array.isArray(te)||k(r,te)},e[26]=r,e[27]=G,e[28]=k,e[29]=$):$=e[29];const F=$;let I;e[30]!==S?(I=()=>({flush:S}),e[30]=S,e[31]=I):I=e[31],C.useImperativeHandle(d,I);let B;e[32]!==p||e[33]!==c||e[34]!==a||e[35]!==o?(B=c?n.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:n.jsx("span",{title:p,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:p})}):n.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:o("sectionsEditor.pageJsonDialog.titleShort")}),n.jsx(Me,{variant:"ghost",size:"icon-sm",onClick:a,"aria-label":o("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:n.jsx(Ra,{size:14})})]}),e[32]=p,e[33]=c,e[34]=a,e[35]=o,e[36]=B):B=e[36];let z;e[37]!==A||e[38]!==y.data||e[39]!==S||e[40]!==_||e[41]!==J||e[42]!==q||e[43]!==r||e[44]!==G||e[45]!==F||e[46]!==o?(z=J?n.jsx("div",{className:"flex flex-1 items-center justify-center",children:n.jsx(Tt,{className:"size-5 text-muted-foreground"})}):q?n.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",o("sectionsEditor.pageJsonDialog.pageNotFound")]}):n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(di,{code:_,language:"json",readOnly:G,height:"100%",onChange:K=>F(K??""),onSave:K=>{F(K),S()}},`${r}:${y.data===void 0?"loading":"ready"}:${A}`)}),e[37]=A,e[38]=y.data,e[39]=S,e[40]=_,e[41]=J,e[42]=q,e[43]=r,e[44]=G,e[45]=F,e[46]=o,e[47]=z):z=e[47];let W;return e[48]!==B||e[49]!==z?(W=n.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[B,z]}),e[48]=B,e[49]=z,e[50]=W):W=e[50],W}function Vr(t){return t.contentEditingEnabled&&!t.isMobile}function ic(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function lc(t,e){return t==="blocks"?"preview":e?"blocks":t}function cc(t){return Vr({contentEditingEnabled:_r(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function dc(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function uc(t){const e=ri(t),{display:s}=t;let r=null;if(s.mode==="production"&&s.iframeBase)try{r=new URL(t.path,s.iframeBase).href}catch{r=null}const a=ai(r,e);return{value:e,frame:a?Bs(a,t.device):null,newTab:a}}function fc(t){const e=ce.c(90),{tests:s,options:r,onChange:a,available:d}=t,o=Pe();let i;e[0]!==r?(i=Dr(r),e[0]=r,e[1]=i):i=e[1];const c=i;let l;e[2]!==r.tests?(l=r.tests??{},e[2]=r.tests,e[3]=l):l=e[3];const m=l;let p;e[4]!==a||e[5]!==r?(p=K=>{const te=K?Ho(K):null,{at:se,...ee}=r;a(te?{...ee,at:te}:ee)},e[4]=a,e[5]=r,e[6]=p):p=e[6];const f=p;let x;e[7]!==m||e[8]!==a||e[9]!==r?(x=(K,te)=>{const se={...m};te==="on"?se[K]=!0:te==="off"?se[K]=!1:delete se[K];const{tests:ee,...ae}=r;a(Object.keys(se).length>0?{...ae,tests:se}:ae)},e[7]=m,e[8]=a,e[9]=r,e[10]=x):x=e[10];const h=x;let j;e[11]!==o?(j=o("sandbox.previewAs.label"),e[11]=o,e[12]=j):j=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(so,{size:16}),e[13]=g):g=e[13];let b;e[14]!==c||e[15]!==j?(b=n.jsx(lt,{asChild:!0,children:n.jsx(xr,{asChild:!0,children:n.jsx(We,{"aria-label":j,active:c,"data-testid":"preview-as-trigger",children:g})})}),e[14]=c,e[15]=j,e[16]=b):b=e[16];let N;e[17]!==o?(N=o("sandbox.previewAs.label"),e[17]=o,e[18]=N):N=e[18];let y;e[19]!==N?(y=n.jsx(ct,{children:N}),e[19]=N,e[20]=y):y=e[20];let v;e[21]!==b||e[22]!==y?(v=n.jsxs(dt,{children:[b,y]}),e[21]=b,e[22]=y,e[23]=v):v=e[23];let P;e[24]!==o?(P=o("sandbox.previewAs.label"),e[24]=o,e[25]=P):P=e[25];let E;e[26]!==P?(E=n.jsx("h3",{className:"text-sm font-medium",children:P}),e[26]=P,e[27]=E):E=e[27];let k;e[28]!==d||e[29]!==o?(k=o(d?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[28]=d,e[29]=o,e[30]=k):k=e[30];let S;e[31]!==k?(S=n.jsx("p",{className:"text-xs text-muted-foreground",children:k}),e[31]=k,e[32]=S):S=e[32];let R;e[33]!==E||e[34]!==S?(R=n.jsxs("div",{className:"flex flex-col gap-1",children:[E,S]}),e[33]=E,e[34]=S,e[35]=R):R=e[35];let O;e[36]!==o?(O=o("sandbox.previewAs.momentLabel"),e[36]=o,e[37]=O):O=e[37];let T;e[38]!==O?(T=n.jsx(pi,{htmlFor:"preview-as-moment",children:O}),e[38]=O,e[39]=T):T=e[39];let L;e[40]!==r.at?(L=Uo(r.at),e[40]=r.at,e[41]=L):L=e[41];let D;e[42]!==f?(D=K=>f(K.target.value),e[42]=f,e[43]=D):D=e[43];let A;e[44]!==L||e[45]!==D?(A=n.jsx(Rs,{id:"preview-as-moment",type:"datetime-local",className:Vo,value:L,onChange:D}),e[44]=L,e[45]=D,e[46]=A):A=e[46];const M=r.at===void 0;let H;e[47]!==f?(H=()=>f(""),e[47]=f,e[48]=H):H=e[48];let X;e[49]!==o?(X=o("sandbox.previewAs.now"),e[49]=o,e[50]=X):X=e[50];let V;e[51]!==M||e[52]!==H||e[53]!==X?(V=n.jsx(Me,{type:"button",variant:"ghost",size:"sm",disabled:M,onClick:H,children:X}),e[51]=M,e[52]=H,e[53]=X,e[54]=V):V=e[54];let J;e[55]!==A||e[56]!==V?(J=n.jsxs("div",{className:"flex items-center gap-2",children:[A,V]}),e[55]=A,e[56]=V,e[57]=J):J=e[57];let q;e[58]!==o?(q=o("sandbox.previewAs.momentHint"),e[58]=o,e[59]=q):q=e[59];let G;e[60]!==q?(G=n.jsx("p",{className:"text-xs text-muted-foreground",children:q}),e[60]=q,e[61]=G):G=e[61];let Y;e[62]!==T||e[63]!==J||e[64]!==G?(Y=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[T,J,G]}),e[62]=T,e[63]=J,e[64]=G,e[65]=Y):Y=e[65];let _;e[66]!==o?(_=o("sandbox.previewAs.testsLabel"),e[66]=o,e[67]=_):_=e[67];let $;e[68]!==_?($=n.jsx("span",{className:"text-sm font-medium",children:_}),e[68]=_,e[69]=$):$=e[69];let F;e[70]!==m||e[71]!==h||e[72]!==o||e[73]!==s?(F=s.length===0?n.jsx("p",{className:"text-xs text-muted-foreground",children:o("sandbox.previewAs.noTests")}):n.jsxs(n.Fragment,{children:[n.jsx("ul",{className:"flex flex-col gap-1.5",children:s.map(K=>n.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[n.jsx("span",{className:"min-w-0 truncate text-sm",children:K}),n.jsxs(mi,{type:"single",variant:"outline",size:"sm",value:m[K]===void 0?"":m[K]?"on":"off",onValueChange:te=>h(K,te),"aria-label":K,children:[n.jsx(Fn,{value:"off",children:o("sandbox.previewAs.off")}),n.jsx(Fn,{value:"on",children:o("sandbox.previewAs.on")})]})]},K))}),n.jsx("p",{className:"text-xs text-muted-foreground",children:o("sandbox.previewAs.testsHint")})]}),e[70]=m,e[71]=h,e[72]=o,e[73]=s,e[74]=F):F=e[74];let I;e[75]!==$||e[76]!==F?(I=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[$,F]}),e[75]=$,e[76]=F,e[77]=I):I=e[77];let B;e[78]!==c||e[79]!==a||e[80]!==o?(B=c&&n.jsx(Me,{type:"button",variant:"outline",size:"sm",onClick:()=>a({}),children:o("sandbox.previewAs.reset")}),e[78]=c,e[79]=a,e[80]=o,e[81]=B):B=e[81];let z;e[82]!==R||e[83]!==Y||e[84]!==I||e[85]!==B?(z=n.jsxs(br,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[R,Y,I,B]}),e[82]=R,e[83]=Y,e[84]=I,e[85]=B,e[86]=z):z=e[86];let W;return e[87]!==v||e[88]!==z?(W=n.jsxs(yr,{children:[v,z]}),e[87]=v,e[88]=z,e[89]=W):W=e[89],W}const pc=15e3;function mc(t,e,s){return s?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 hc=500,gc={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},tr=1,Qt=["desktop","mobile","tablet"],vc=["preview","visual","blocks"],sr={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function xc(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 Ls(t,e){try{return new URL(t,e).href}catch{return null}}function bc(t,e){if(!e.inPlaceRenderActive)return{pin:e.draftPreviewUrl?{path:e.resolvedPath,url:e.draftPreviewUrl}:null,effective:e.draftPreviewUrl};if(e.draftPreviewUrl!==null&&t?.path!==e.resolvedPath){const s={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:s,effective:s.url}}return{pin:t,effective:t?.url??null}}function yc(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function wc(t,e,s){const r=t.toLowerCase(),a=e.toLowerCase(),d=a.split("/").filter(Boolean),o=c=>{if(c===s)return 100;const l=c.indexOf(s);if(l===-1)return 0;let m=40;return l===0?m+=30:/[\s/-]/.test(c[l-1]??"")&&(m+=20),m+=Math.round(s.length/c.length*20),m};let i=Math.max(o(r),o(a));return d.at(-1)===s?i=Math.max(i,95):d.includes(s)&&(i=Math.max(i,90)),i}function kc(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Sc({virtualMcpId:t}){const e=Pe(),s=Tr(),{currentBranch:r,taskId:a,virtualMcpId:d}=Lt(),o=!!Ja(),i=Or(),c=co(d===t?t:null),l=jr(t),m=gi(c?.metadata?.ui?.layout??null),p=_r(m),f=Vr({contentEditingEnabled:p,isMobile:s}),[x]=C.useState(()=>cc({cmsMode:m,isMobile:s})),[h,j]=As(_s.previewEditingMode(t),u=>u&&vc.includes(u)?u:null),g=h??x,[b,N]=As(_s.previewDeviceSize(t),u=>u&&Qt.includes(u)?u:"desktop"),[y,v]=C.useState(null),[P,E]=C.useState(null),k=C.useRef(null),S=C.useRef(null),[R,O]=C.useState(!1),T=C.useRef(null),L=()=>{T.current?.flush(),O(!1)},D=()=>O(u=>(u&&T.current?.flush(),!u)),[A,M]=C.useState({width:0,height:0}),[H,X]=C.useState(!1),[V,J]=C.useState({}),[q,G]=C.useState(""),Y=C.useRef(null),[_,$]=C.useState(!1),[F,I]=C.useState(),[B,z]=C.useState(null),[W,K]=C.useState(null),[te,se]=C.useState(null),[ee,ae]=C.useState(()=>i.state.target?.kind==="page"?i.state.target.path:"/"),[pe,de]=C.useState(()=>i.state.target?.kind==="page"?i.state.target.key:null),[ve,ue]=C.useState({}),[xe,me]=C.useState(!1),ge=C.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:ie}=zs(),Ne=Us(),Fe=Rt(),ze=Fe.vmEntry,Be=Ne.lifecycle.phase,{url:ut,undecided:Je}=Nr(t),he=ss(t,r),{connection:Le}=Cr(t),_e=fi(t),Ke=jo({hasServeConnection:!!Le,runtime:l.runtime}),ne=Je||Ke==="github"&&(_e==="loading"||_e==="error"),oe=!at(he)&&!ne&&!(Ke==="github"&&he.kind==="pending"),ke=He(he)??ut,Ie=ke??Fe.previewUrl,ft=!!ke||Be==="running",Ye=c?.id===t?mo(c.metadata):null,pt=!ke&&!Je&&c?.id===t&&l.runtime==="cms",qr=l.projectDefault==="cms",mt=oe?si({sandboxUrl:Ie,previewServerUrl:Ye,fastPreviewActive:pt}):null,Vs=t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r,threadId:a??null,previewUrl:Ie}:null,qs=Ks(Vs,{fetchEnabled:ft}),ns=Lr(Vs,{fetchEnabled:ft}),le=qs.data,Se=ns.data,Qe=le?Wo(le,Se).sort((u,w)=>u.name.localeCompare(w.name)):[],Ws=t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r}:null,Gs=Xl(Ws),rs=le&&Se?Go(le,Se):[],Js=oe&&le&&Se?Ha(Se,le,"loaders"):[],Ys=q?(()=>{const u=q.toLowerCase();return Qe.map(w=>({page:w,score:wc(w.name,w.path,u)})).filter(({score:w})=>w>0).sort((w,U)=>U.score-w.score||w.page.path.length-U.page.path.length).map(({page:w})=>w)})():Qe,Qs=rs.filter(u=>{if(!q)return!0;const w=q.toLowerCase();return u.name.toLowerCase().includes(w)||u.key.toLowerCase().includes(w)||u.resolveType.toLowerCase().includes(w)}),Xs=f?Js:[],Zs=Xs.filter(u=>{if(!q)return!0;const w=q.toLowerCase();return u.title.toLowerCase().includes(w)||u.key.toLowerCase().includes(w)||u.resolveType.toLowerCase().includes(w)}),At=W?Js.find(u=>u.key===W)??null:null,Oe=Is,as=B||W?null:Jo(Qe,ee,pe),re=as?.key??null,Xe=i.state.target?.kind==="section"?i.state.target.key:i.state.focusedBlockKey??re,_t=as?.path??null,Ze=(re?ve[re]:void 0)??{},Ee=Ve(ee,Ze),os={};if(oe&&ft&&Ie&&Se&&le){const u=Va(Se,"loaders"),w=re?le[re]:void 0,U=bl(w,le,be=>u.has(be)),Z=ml(U);for(const be of Ct(ee)){if(be.type!=="param")continue;const $e=ul(ee,be.name,U),Te=vl($e,u,Z);Te.length>0&&(os[be.name]=Te)}}const Ot=t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r,threadId:a??null}:null,en=le&&re?Yo(le,re,0):[],tn=at(he),sn=le?Qo(en,le,tn):[],is=sn.map(u=>u.isSavedBlock?u.label:""),ls=sn.map(u=>u.isSavedBlock?"global":u.isMultivariate?"variant":"normal"),cs=en.map(u=>$s(u,le??{},tn)),Dt=C.useRef(null),Re=C.useRef(null),Wr=Ne.status.state==="paused",ds=Ne.phase,nn=qa({claimPhase:ds,lifecycle:Ne.lifecycle}),qe=Fe.previewState,Gr=Fe.userStopped,Jr=Eo(ie.slug,t??""),{url:Ue}=oi(pt&&t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r,previewServerUrl:Ye??null,path:Ee}:null),Yr=qr&&l.runtime==="sandbox",Ce=No(he,Ke,_e),rn=Co(Ce&&pt&&he.kind==="protocol"&&t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r}:null),an=Ce?rn.pointer:null,Q=Gi({previewState:qe,progressStatus:nn.status,previewServerUrl:Ye,fastPreviewActive:pt,fastPreviewReady:!!Ue,codingSession:Yr,localPreviewUrl:ke,hostedDraft:Ce,hostedPointerPending:Ce&&(he.kind==="pending"||rn.pending),deciding:ne}),on=Q.showWakingPill||Ce&&Q.mode==="production"&&!an,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=oe?ke?Q.mode==="sandbox"&&f&&g==="blocks":Q.mode==="production"&&pt&&Xr&&f&&g==="blocks":!1,ln=C.useRef(null),{pin:Zr,effective:ea}=bc(ln.current,{inPlaceRenderActive:gt,draftPreviewUrl:Ue,resolvedPath:Ee});ln.current=Zr;const cn=i.state.variantOverride??[],Bt=oe?cn:[],vt=oe?[]:cn,us=at(he)&&Xo.some(u=>Zo(Se,u)==="available"),tt=us?V:{},dn=Dr(tt),ta=us&&le?Object.keys(ei(le).experiments):[],$t=Ce?uc({display:Q,path:Ee,pointer:an,device:b,forcedVariants:vt,previewOptions:tt}):null,st=t?Tn(ie.slug,t):null,un=JSON.stringify([vt,tt]);C.useEffect(()=>{if(!Ce||!st)return;const[u,w]=JSON.parse(un);Bn(st,{forcedVariants:u,previewOptions:w})},[Ce,st,un]),C.useEffect(()=>{if(!(!Ce||!st))return()=>Bn(st,null)},[Ce,st]);const fs=Le&&He(he)?Do(Le.endpoint,vt,dn):null,sa=Le&&He(he)?fs?hi(fs,tt):_n:null,nt=xc(Q.mode==="sandbox"?Wt(Bs(On(te??Ls(Ee,Q.iframeBase)??Q.iframeBase,sa),b),Bt):Q.mode==="production"&&$t?.frame?$t.frame:Q.mode==="production"?Wt(Bs(zn(Rn(On(te??ea??Ls(Ee,Q.iframeBase)??Q.iframeBase,on?_n:null),vt),tt),b),Bt):null),fn=Ue??(Q.iframeBase?Ls(Ee,Q.iframeBase):null),pn=Q.mode==="production"&&$t?$t.newTab:Q.mode==="production"?fn?Wt(zn(Rn(fn,vt),tt),Bt):null:nt??Q.iframeBase,na=()=>{const u=pn;u&&window.open(u,"_blank","noopener")},xt=t&&r?pr(ie.slug,t,r):null,bt=u=>{xt&&Qa(xt,u)},ye=i.state.target;C.useEffect(()=>{if(!(!ye||!mt||!Se))if(ye.kind==="page"){const u=ve[ye.key]??{};Re.current=Ve(ye.path,u),z(null),K(null),se(null),de(ye.key),ae(ye.path),bt({path:ye.path,pageKey:ye.key,params:u})}else if(ye.kind==="loader")Re.current=null,z(null),K(ye.key),se(null);else{const u=rs.find(w=>w.key===ye.key);if(u){Re.current=null;const w=An(Se);K(null),z(u),se(Dn(mt,w,u.key))}}},[ye,mt,Se,ve]),C.useEffect(()=>{!re||_t===null||ye?.kind==="page"&&ye.key===re&&ye.path===_t||i.selectTarget({kind:"page",key:re,path:_t})},[re,_t,ye]);const[mn,ra]=C.useState(null);if(qe.kind==="iframe"&&mn!==qe.previewUrl){const u=mn!==null;ra(qe.previewUrl);const w=xt?fr(xt):null;if(w){if(Re.current=Ve(w.path,w.params),ae(w.path),de(w.pageKey),se(null),z(null),K(null),w.pageKey&&Object.keys(w.params).length>0){const U=w.pageKey;ue(Z=>({...Z,[U]:w.params}))}}else u&&(Re.current=null,ae("/"),se(null),de(null),z(null),K(null))}Dt.current=nt;const aa=Q.mode==="production"&&!!Ue&&!ke,[hn,ps]=C.useState({src:nt??void 0,loading:!1}),Mt=mc(hn,nt??void 0,aa);Mt!==hn&&ps(Mt);const yt=Mt.src,gn=Mt.loading,vn=Xi({iframeRef:k,src:Q.mode==="sandbox"?nt:null,active:Q.mode==="sandbox"}),xn=C.useRef(null);C.useEffect(()=>{const u=gn?setTimeout(()=>ps(er),pc):null,w=()=>{u&&clearTimeout(u)};if(!Ue||!yt||xn.current===Ue)return w;xn.current=Ue;const U=k.current;return U&&U.getAttribute("src")!==yt&&(je(),U.src=yt),w},[Ue,yt,gn]);const bn=()=>{const u=k.current?.contentWindow,w=et;if(!u||!w||!le||!re)return;const U=le[re];if(!U||typeof U!="object")return;const Z=ni({previewBaseUrl:w,pageBlock:U,decofile:le,path:Ee,pathTemplate:ee});if(!Z)return;const be=Wt(Z.src,Oo(Bt,re));u.postMessage({type:"cms-editor::render",src:be,body:Z.body},w)},ms=C.useRef(null);C.useEffect(()=>{if(!gt||B||W||!re||!le){ms.current=null;return}const u={nav:JSON.stringify({page:re,path:Ee,pathTemplate:ee}),content:JSON.stringify(le)},w=yc(ms.current,u);ms.current=u,w&&bn()},[le,gt,B,W,re,Ee,ee]);const hs=C.useRef(null);C.useEffect(()=>{if(!gt||B||W||!re||!le){hs.current=null;return}const u=JSON.stringify(i.state.variantOverride??null),w=hs.current;hs.current={page:re,sig:u},!(!w||w.page!==re||w.sig===u)&&bn()},[i.state.variantOverride,gt,B,W,re]);const oa=!!t&&!!r&&!Ne.notFound&&!Gr&&!Wr&&(ds?.kind==="ready"||Be!=="idle"),we=dc({editingMode:g,sandboxDisplay:Q.mode==="sandbox",blocksEditingEnabled:f});C.useEffect(()=>{const u=et;if(!u)return;const w=U=>{if(U.origin===u)if(U.data?.type==="visual-editor::element-clicked"){const Z=sl.safeParse(U.data.payload);Z.success&&v(Z.data)}else if(U.data?.type==="cms-editor::section-clicked"){const Z=al.safeParse(U.data.payload);Z.success&&E({index:Z.data.sectionIndex,seq:Z.data.clickSeq})}else U.data?.type==="cms-editor::render-start"?je():U.data?.type==="cms-editor::render-end"?(fe(),k.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:is,kinds:ls,keys:cs},u)):U.data?.type==="cms-editor::render-error"&&fe()};return window.addEventListener("message",w),()=>window.removeEventListener("message",w)},[et,is,ls,cs]);const yn=()=>{const u=k.current?.contentWindow,w=jt(Ie);!u||!w||u.postMessage({type:"visual-editor::activate",script:nl},w)},ia=()=>{const u=k.current?.contentWindow,w=jt(Ie);!u||!w||u.postMessage({type:"visual-editor::deactivate"},w)},gs=()=>{const u=k.current?.contentWindow,w=et;!u||!w||(u.postMessage(Q.mode==="production"||ke?{type:"editor::inject",args:{script:Wn}}:{type:"visual-editor::activate",script:Wn},w),u.postMessage({type:"cms-editor::set-labels",labels:is,kinds:ls,keys:cs},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"&&!f)return;const w=g;!s&&u!==w&&(u==="blocks"?S.current?.resize("30%"):S.current?.collapse()),j(u),v(null),E(null),u!=="blocks"&&K(null),w==="visual"&&ia(),u==="visual"&&yn(),w==="blocks"&&u!=="blocks"&&la(),u==="blocks"&&gs()},da=()=>{Ft(ic(g,f))},ua=()=>{Ft(lc(g,f))},vs=()=>{const u=k.current;if(!u)return;je();const w=document.activeElement,U=u.tabIndex;u.tabIndex=-1,u.style.pointerEvents="none",u.blur(),kc(u,Dt.current);let Z;const be=()=>{clearTimeout(Z),u.tabIndex=U,u.style.pointerEvents="";const $e=document.activeElement;(!$e||$e===document.body||$e===u)&&w?.focus(),u.removeEventListener("load",be)};u.addEventListener("load",be),Z=setTimeout(be,3e3)};li(vs);const zt=Tn(ie.slug,t??""),Kt=Ce&&ht&&!!t,wn=C.useRef(null);C.useEffect(()=>{if(Kt)return To(zt)},[Kt,zt]);const{reload:wt}=Lo(ie.slug,t??""),kn=C.useRef(wt.seq);C.useEffect(()=>{if(kn.current!==wt.seq&&(kn.current=wt.seq,!!Kt&&wn.current===Dt.current)){if(wt.navigates){Ln(zt);return}vs()}},[wt.seq]);const fa=Ro(Ws),kt=Ao(He(he)?fa:""),Sn=C.useRef(kt);C.useEffect(()=>{const u=Sn.current;if(Sn.current=kt,!u||!kt||u===kt)return;const w=k.current;if(w)return tl({iframe:w,reload:vs})},[kt]);const pa=()=>{const u=Qt.indexOf(b);N(Qt[(u+1)%Qt.length])},xs=(u,w)=>{if(!re)return;const U=re,Z={...Ze,[u]:w};Re.current=Ve(ee,Z),ue(be=>({...be,[U]:Z})),bt({path:ee,pageKey:U,params:Z})},ma=Wl({iframeBase:Q.iframeBase,resolvedPath:Ee,activeGlobalSectionName:B?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),bs=u=>{const w=ve[u.key]??{},U=Ve(u.path,w);(B||Oe(U)!==Oe(Ee))&&je(),Re.current=U,z(null),K(null),se(null),E(null),de(u.key),ae(u.path),bt({path:u.path,pageKey:u.key,params:w}),i.selectTarget({kind:"page",key:u.key,path:u.path})};Ya(xt,u=>{(B||Oe(u)!==Oe(Ee))&&je(),Re.current=u,z(null),K(null),se(null),E(null),de(null),ae(u),bt({path:u,pageKey:null,params:{}})});const ha=u=>{if(at(he)){const Z=le?ti(le,u.key,Se):null;Z?bs(Z):Zt.info(e("sandbox.preview.blockOnNoPage"));return}if(!mt||!Se){Zt.error(e("sandbox.preview.previewMetadataNotReady"));return}je(),Re.current=null;const w=An(Se),U=Dn(mt,w,u.key);z(u),K(null),se(U),E(null),i.selectTarget({kind:"section",key:u.key})},ga=u=>{f&&(z(null),K(u.key),se(null),Ft("blocks"),i.selectTarget({kind:"loader",key:u.key}))},va=async({name:u,path:w,templateKey:U})=>{if(!t||!r)return;const Z=Ar(w);if(Z){I(Z);return}const be=w.trim().startsWith("/")?w.trim():`/${w.trim()}`;if(Qe.some(Te=>Oe(Te.path)===Oe(be))){I(e("sandbox.preview.pageAlreadyExists",{path:be}));return}let $e;if(U&&($e=le?.[U],!$e)){I(e("sandbox.preview.templateNoLongerExists"));return}I(void 0);try{const Te=await Gs.mutateAsync({name:u,path:be,template:$e,schema:at(he)?{meta:Se,loadMeta:async()=>(await ns.refetch()).data}:void 0});$(!1),Zt.success(e("sandbox.preview.pageCreated",{name:u})),await xi(hc),bs({key:Te.key,name:Te.name,path:Te.path}),Ft("blocks")}catch(Te){I(Te instanceof Hr?e("sandbox.preview.pageSchemaNotReady"):Te instanceof Error?Te.message:e("sandbox.preview.failedToCreatePage"))}},It=Gl({previewSurfaceActive:ht,daemonReady:oa,production:Q.mode==="production",servePreviewUrl:He(he)}),xa=Jl({showPreviewToolbar:It,contentEditingEnabled:p}),Ut=()=>{X(!1),G("")},ys=B?.name??At?.title??as?.name,ws=qs.isPending||ns.isPending,ks=ws?jt(Q.iframeBase):ys,Ht=B?`section:${B.key}`:W?`loader:${W}`:re?`page:${re}`:void 0,ba=It?xa?n.jsxs(yr,{open:H,onOpenChange:u=>{X(u),u||G("")},children:[n.jsx(xr,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:ws?ks??void 0:B||At?ys:[ys,ee].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:n.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:[B&&n.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:[n.jsx(no,{size:11}),e("sandbox.preview.globalBadge")]}),At&&n.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:[n.jsx(ro,{size:11}),e("sandbox.preview.loaderBadge")]}),ks&&n.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:ks}),!ws&&!B&&!At&&n.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:ee}),n.jsx(Xa,{size:12,className:De("shrink-0 transition-transform",H&&"rotate-180")})]})})}),n.jsxs(br,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[n.jsxs(kr,{shouldFilter:!1,defaultValue:Ht,children:[n.jsx(Sr,{value:q,onValueChange:u=>{G(u),Y.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),n.jsxs(wr,{ref:Y,className:"max-h-80",children:[n.jsx(Pr,{children:Qe.length===0&&rs.length===0&&Xs.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),Ys.length>0&&n.jsx(Et,{children:Ys.map(u=>n.jsxs(Nt,{value:`page:${u.key}`,"aria-current":Ht===`page:${u.key}`||void 0,title:`${u.name} · ${u.path}`,onSelect:()=>{Ut(),bs(u)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:u.name}),n.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))}),Qs.length>0&&n.jsx(Et,{heading:e("sandbox.preview.globalComponents"),children:Qs.map(u=>n.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:n.jsx("span",{className:"truncate",children:u.name})},u.key))}),Zs.length>0&&n.jsx(Et,{heading:e("sandbox.preview.globalLoaders"),children:Zs.map(u=>n.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:n.jsx("span",{className:"truncate",children:u.title})},u.key))})]})]}),!B&&!W&&Ct(ee).some(u=>u.type!=="text")&&n.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:Ct(ee).map((u,w)=>{if(u.type==="text")return n.jsx("span",{children:u.text},`text-${w}`);const U=os[u.name];return U&&Ot?n.jsx(Ol,{sources:U,template:ee,paramName:u.name,value:Ze[u.name]??"",sandboxRef:Ot,onCommit:Z=>xs(u.name,Z)},`${re}:${u.name}`):n.jsx(Vl,{name:u.name,value:Ze[u.name]??"",onCommit:Z=>xs(u.name,Z)},`${re}:${u.name}`)})}),n.jsx("div",{className:"border-t p-1.5",children:n.jsxs(Me,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Ut(),I(void 0),$(!0)},children:[n.jsx(vr,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):n.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:ma}):null,Pn=It||p?n.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[n.jsxs(dt,{children:[n.jsx(lt,{asChild:!0,children:n.jsx(We,{onClick:pa,"aria-label":e(sr[b]),children:b==="mobile"?n.jsx(hr,{size:16}):b==="tablet"?n.jsx(ao,{size:16}):n.jsx(gr,{size:16})})}),n.jsx(ct,{children:e(sr[b])})]}),ba,n.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[us&&n.jsx(fc,{tests:ta,options:V,onChange:J,available:!!fs||!on||!dn}),n.jsx(We,{onClick:na,disabled:Ce&&!pn,"aria-label":e("sandbox.preview.openInNewTab"),children:n.jsx(cr,{size:16})})]})]}):null,ya=(oe||o)&&Q.mode==="sandbox",Vt=gc[b],qt=b==="desktop"&&(A.width===0||A.width>=Vt.width+2*tr),jn=qt?1:Math.min(A.width>0?A.width/(Vt.width+2*tr):1,1),wa=qt?{width:"100%",height:"100%"}:{width:`${Vt.width}px`,height:A.height>0?`${A.height/jn}px`:`${Vt.height}px`,transform:`scale(${jn})`,transformOrigin:"top center"},En=n.jsxs(n.Fragment,{children:[ya&&(It||p)&&n.jsx(We,{onClick:da,"aria-pressed":we==="visual","aria-label":e("sandbox.preview.visualEditor"),active:we==="visual",children:n.jsx(Cn,{size:16})}),f&&n.jsxs(dt,{children:[n.jsx(lt,{asChild:!0,children:n.jsx(We,{onClick:ua,"aria-pressed":we==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:we==="blocks",children:n.jsx(io,{size:16})})}),n.jsx(ct,{children:e("sandbox.preview.blocksEditor")})]}),Xe&&n.jsxs(dt,{children:[n.jsx(lt,{asChild:!0,children:n.jsx(We,{onClick:D,"aria-pressed":R,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:R,children:n.jsx(oo,{size:16})})}),n.jsx(ct,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),ka=!!W&&we==="blocks";return n.jsxs("div",{className:"flex flex-col w-full h-full",children:[Ot&&Object.entries(os).map(([u,w])=>(Ze[u]??"")===""?n.jsx(Ul,{sources:w,template:ee,paramName:u,sandboxRef:Ot,onFill:U=>xs(u,U)},`${re}:${u}`):null),n.jsxs(n.Fragment,{children:[n.jsx(Os.Toolbar.Center.Portal,{fallback:n.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:Pn}),children:Pn}),n.jsx(Os.Toolbar.Right.Portal,{fallback:En,children:En})]}),n.jsx("div",{className:"flex-1 overflow-hidden relative",children:ka?n.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[n.jsx(Xn,{virtualMcpId:t,externalSelection:P,onViewJsonFile:D}),R&&Xe&&n.jsx("div",{className:"absolute inset-0 z-10",children:n.jsx(Zn,{ref:T,virtualMcpId:t,pageKey:Xe,onClose:L})})]}):n.jsxs($n,{orientation:"horizontal",disabled:we!=="blocks",className:"relative isolate",children:[n.jsx(Gt,{ref:S,id:"preview-blocks-editor",defaultSize:we==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:we==="blocks"&&n.jsx(Xn,{virtualMcpId:t,externalSelection:P,onViewJsonFile:D})}),we==="blocks"&&n.jsx(Mn,{withHandle:!0}),n.jsx(Gt,{id:"preview-canvas",defaultSize:we==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:n.jsxs($n,{orientation:"horizontal",disabled:!(R&&Xe),children:[n.jsx(Gt,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:n.jsxs("div",{ref:u=>{if(!u)return;const w=()=>M(Z=>Z.width===u.clientWidth&&Z.height===u.clientHeight?Z:{width:u.clientWidth,height:u.clientHeight});w();const U=new ResizeObserver(w);return U.observe(u),()=>U.disconnect()},className:De("h-full relative overflow-clip flex justify-center",ht&&!qt&&"bg-muted/30"),children:[(xe||Jr)&&ht&&n.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:n.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&&n.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:n.jsx(Tt,{className:"size-5 text-muted-foreground"})}),Q.showBlockingOverlay&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(Ps,{kind:"starting",progress:nn,claimPhase:ds})}),!ke&&!ne&&qe.kind==="suspended"&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(Ps,{kind:"suspended",onResume:Fe.resume})}),!ke&&!ne&&qe.kind==="errored"&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(Ps,{kind:"errored",error:qe.error,onRetry:Fe.retry,connectionsHref:`/${ie.slug}/settings/connections`})}),Q.showWakingPill&&n.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:[n.jsx(Tt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),we==="visual"&&!y&&n.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:[n.jsx(Cn,{size:12}),e("sandbox.preview.clickElementToAsk")]}),we==="visual"&&y&&n.jsx(ll,{element:y,onDismiss:()=>v(null)}),ht&&nt&&n.jsx("div",{className:De("shrink-0",!qt&&"bg-background shadow-edge"),style:wa,onMouseLeave:ca,children:n.jsx("iframe",{ref:k,src:yt,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:vn.handleError,onLoad:()=>{if(ps(er),vn.handleLoad(),fe(),wn.current=Dt.current,Kt&&Ln(zt),Q.mode!=="sandbox"||ke){(Q.mode==="production"&&!Q.showWakingPill||ke)&&we==="blocks"&&gs();return}if(Aa("vm_preview_loaded",{view_mode:we,vm_id:ze?.sandboxHandle??null}),!B)try{const u=k.current?.contentWindow?.location?.pathname;if(!u)return;const w=Re.current;if(w!==null&&(Re.current=null,Oe(u)!==Oe(w))||Oe(u)===Oe(Ee))return;ae(u),bt({path:u,pageKey:pe,params:Ze})}catch{}we==="visual"&&yn(),we==="blocks"&&gs()}},Q.iframeBase)})]})}),R&&Xe&&n.jsxs(n.Fragment,{children:[n.jsx(Mn,{withHandle:!0}),n.jsx(Gt,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:n.jsx(Zn,{ref:T,virtualMcpId:t,pageKey:Xe,onClose:L})})]})]})})]})}),n.jsx(Zl,{open:_,onOpenChange:$,isPending:Gs.isPending,error:F,templates:Qe,onSubmit:va})]})}const Fs={app:null,split:!1};function Pc(t){const e=ce.c(24),{project:s,maxApps:r,children:a}=t,d=Pe();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={silent:!0},e[0]=o):o=e[0];const i=uo(o),c=Rt();let l;e[1]!==s.metadata.runtime?(l=s.metadata.runtime??{},e[1]=s.metadata.runtime,e[2]=l):l=e[2];const m=l;let p;e[3]!==m.apps?(p=m.apps??[],e[3]=m.apps,e[4]=p):p=e[4];const f=p;let x;e[5]!==i.update||e[6]!==c||e[7]!==s.id||e[8]!==s.metadata||e[9]!==m||e[10]!==d?(x=y=>i.update.mutate({id:s.id,data:{metadata:{...bi(s.metadata),runtime:{...m,apps:y.length?y:null}}}},{onSuccess:()=>c.start(),onError:()=>Zt.error(d("sandbox.appTabs.saveError"))}),e[5]=i.update,e[6]=c,e[7]=s.id,e[8]=s.metadata,e[9]=m,e[10]=d,e[11]=x):x=e[11];const h=x,j=m.path??null;let g,b;e[12]!==f||e[13]!==h?(g=y=>h([...f,{path:y}]),b=y=>h(f.filter(v=>v.path!==y)),e[12]=f,e[13]=h,e[14]=g,e[15]=b):(g=e[14],b=e[15]);let N;return e[16]!==f||e[17]!==a||e[18]!==r||e[19]!==s.id||e[20]!==j||e[21]!==g||e[22]!==b?(N=n.jsx(jc,{virtualMcpId:s.id,mainPath:j,apps:f,maxApps:r,onAddApp:g,onRemoveApp:b,children:a}),e[16]=f,e[17]=a,e[18]=r,e[19]=s.id,e[20]=j,e[21]=g,e[22]=b,e[23]=N):N=e[23],N}function jc(t){const e=ce.c(102),{virtualMcpId:s,mainPath:r,apps:a,maxApps:d,onAddApp:o,onRemoveApp:i,children:c}=t,l=Pe(),m=Tr(),{currentBranch:p}=Lt(),f=Rt(),x=Us().lifecycle.phase,h=ss(s,p),{url:j}=Nr(s);let g;e[0]!==h||e[1]!==j?(g=He(h)??j,e[0]=h,e[1]=j,e[2]=g):g=e[2];const b=g,N=b??f.previewUrl,y=!!b||x==="running",v=!y&&f.status==="errored";let P;e[3]!==f.vmEntry?.startedWith?.apps?(P=f.vmEntry?.startedWith?.apps??[],e[3]=f.vmEntry?.startedWith?.apps,e[4]=P):P=e[4];const E=P;let k;e[5]!==s?(k=_s.previewAppLayout(s),e[5]=s,e[6]=k):k=e[6];const[S,R]=As(k,Ec);let O;e[7]!==a||e[8]!==S?(O=a.some(fe=>fe.path===S.app)?S.app:null,e[7]=a,e[8]=S,e[9]=O):O=e[9];const T=O,L=T!==null&&S.split&&!m,D=T===null||L,A=T??a[0]?.path??null,[M,H]=C.useState(null),[X,V]=C.useState(!1);let J;e[10]===Symbol.for("react.memo_cache_sentinel")?(J=()=>{H(null),V(!1)},e[10]=J):J=e[10];const q=J;let G;e[11]!==a||e[12]!==M||e[13]!==m||e[14]!==r||e[15]!==o||e[16]!==R?(G=()=>{if(M===null)return;const fe=Kn(M);if(!fe){q();return}if(fe===Kn(r??"")||a.some(ie=>ie.path===fe)){V(!0);return}o(fe),R({app:fe,split:!m}),q()},e[11]=a,e[12]=M,e[13]=m,e[14]=r,e[15]=o,e[16]=R,e[17]=G):G=e[17];const Y=G;let _;e[18]!==r||e[19]!==l?(_=r?Es(r):l("sandbox.appTabs.root"),e[18]=r,e[19]=l,e[20]=_):_=e[20];const $=_;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 I=F;let B;e[24]!==l?(B=l("sandbox.appTabs.label"),e[24]=l,e[25]=B):B=e[25];let z;e[26]!==l?(z=l("sandbox.appTabs.main"),e[26]=l,e[27]=z):z=e[27];let W;e[28]!==l?(W=l("sandbox.appTabs.mainHint"),e[28]=l,e[29]=W):W=e[29];let K;e[30]!==R?(K=()=>R(Fs),e[30]=R,e[31]=K):K=e[31];let te;e[32]!==v||e[33]!==$||e[34]!==y||e[35]!==D||e[36]!==z||e[37]!==W||e[38]!==K?(te=n.jsx(nr,{label:$,badge:z,hint:W,ready:y,failed:v,onScreen:D,onSelect:K}),e[32]=v,e[33]=$,e[34]=y,e[35]=D,e[36]=z,e[37]=W,e[38]=K,e[39]=te):te=e[39];let se;if(e[40]!==a||e[41]!==T||e[42]!==v||e[43]!==$||e[44]!==i||e[45]!==y||e[46]!==R||e[47]!==L||e[48]!==l){let fe;e[50]!==T||e[51]!==v||e[52]!==$||e[53]!==i||e[54]!==y||e[55]!==R||e[56]!==L||e[57]!==l?(fe=ie=>{const Ne=Es(ie.path);return n.jsx(nr,{label:Ne,hint:l("sandbox.appTabs.extraHint",{app:$}),ready:y,failed:v,onScreen:ie.path===T,onSelect:()=>R({app:ie.path,split:L}),onRemove:()=>i(ie.path),removeLabel:l("sandbox.appTabs.remove",{app:Ne})},ie.path)},e[50]=T,e[51]=v,e[52]=$,e[53]=i,e[54]=y,e[55]=R,e[56]=L,e[57]=l,e[58]=fe):fe=e[58],se=a.map(fe),e[40]=a,e[41]=T,e[42]=v,e[43]=$,e[44]=i,e[45]=y,e[46]=R,e[47]=L,e[48]=l,e[49]=se}else se=e[49];let ee;e[59]!==te||e[60]!==se||e[61]!==B?(ee=n.jsxs("div",{role:"tablist","aria-label":B,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[te,se]}),e[59]=te,e[60]=se,e[61]=B,e[62]=ee):ee=e[62];let ae;e[63]!==a.length||e[64]!==Y||e[65]!==M||e[66]!==X||e[67]!==d||e[68]!==l?(ae=M!==null?n.jsx("form",{className:"w-40 shrink-0",onSubmit:fe=>{fe.preventDefault(),Y()},children:n.jsx("input",{autoFocus:!0,value:M,placeholder:"apps/checkout","aria-label":l("sandbox.appTabs.pathLabel"),"aria-invalid":X,onChange:fe=>{H(fe.target.value),V(!1)},onBlur:q,onKeyDown:fe=>{fe.key==="Escape"&&q()},className:De("h-7 w-full rounded-md border bg-background px-2 font-mono text-xs outline-none",X?"border-destructive":"border-border")})}):a.length<d&&n.jsx(it,{label:l("sandbox.appTabs.add"),onClick:()=>H(""),children:n.jsx(vr,{})}),e[63]=a.length,e[64]=Y,e[65]=M,e[66]=X,e[67]=d,e[68]=l,e[69]=ae):ae=e[69];let pe;e[70]!==m||e[71]!==R||e[72]!==L||e[73]!==I||e[74]!==A?(pe=!m&&A&&n.jsx(it,{label:I,active:L,onClick:()=>R(L?Fs:{app:A,split:!0}),children:n.jsx(lo,{})}),e[70]=m,e[71]=R,e[72]=L,e[73]=I,e[74]=A,e[75]=pe):pe=e[75];let de;e[76]!==ee||e[77]!==ae||e[78]!==pe?(de=n.jsxs(n.Fragment,{children:[ee,ae,pe]}),e[76]=ee,e[77]=ae,e[78]=pe,e[79]=de):de=e[79];const ve=de;let ue;e[80]!==ve?(ue=n.jsx(Os.Topbar.Left.Portal,{fallback:n.jsx("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:ve}),children:n.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]!==D?(xe=D&&n.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:c}),e[82]=c,e[83]=D,e[84]=xe):xe=e[84];let me;e[85]!==T||e[86]!==v||e[87]!==f.start||e[88]!==b||e[89]!==$||e[90]!==N||e[91]!==y||e[92]!==R||e[93]!==L||e[94]!==E?(me=T!==null&&n.jsx(Nc,{name:Es(T),mainName:$,appUrl:N?yi(N,T):null,ready:y,failed:v,notStarted:!b&&!E.includes(T),onStart:f.start,className:De(L&&"border-l border-border"),onClose:L?()=>R({app:T,split:!1}):void 0},T),e[85]=T,e[86]=v,e[87]=f.start,e[88]=b,e[89]=$,e[90]=N,e[91]=y,e[92]=R,e[93]=L,e[94]=E,e[95]=me):me=e[95];let ge;e[96]!==xe||e[97]!==me?(ge=n.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=n.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 Ec(t){return t??Fs}function nr(t){const e=ce.c(28),{label:s,badge:r,hint:a,ready:d,failed:o,onScreen:i,onSelect:c,onRemove:l,removeLabel:m}=t,p=i?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground";let f;e[0]!==p?(f=De("group/app-tab flex h-7 shrink-0 items-center rounded-md text-xs transition-colors",p),e[0]=p,e[1]=f):f=e[1];const x=d?"bg-success":o?"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 j;e[4]!==h?(j=n.jsx("span",{"aria-hidden":!0,className:h}),e[4]=h,e[5]=j):j=e[5];let g;e[6]!==s?(g=n.jsx("span",{className:"max-w-40 truncate",children:s}),e[6]=s,e[7]=g):g=e[7];let b;e[8]!==r?(b=r&&n.jsx("span",{className:"text-[10px] text-muted-foreground",children:r}),e[8]=r,e[9]=b):b=e[9];let N;e[10]!==i||e[11]!==c||e[12]!==j||e[13]!==g||e[14]!==b?(N=n.jsx(lt,{asChild:!0,children:n.jsxs("button",{type:"button",role:"tab","aria-selected":i,onClick:c,className:"flex h-full items-center gap-1.5 rounded-md px-2.5 focus-ring",children:[j,g,b]})}),e[10]=i,e[11]=c,e[12]=j,e[13]=g,e[14]=b,e[15]=N):N=e[15];let y;e[16]!==a?(y=n.jsx(ct,{className:"max-w-64",children:a}),e[16]=a,e[17]=y):y=e[17];let v;e[18]!==N||e[19]!==y?(v=n.jsxs(dt,{children:[N,y]}),e[18]=N,e[19]=y,e[20]=v):v=e[20];let P;e[21]!==l||e[22]!==m?(P=l&&n.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:n.jsx(Br,{className:"size-3"})}),e[21]=l,e[22]=m,e[23]=P):P=e[23];let E;return e[24]!==v||e[25]!==P||e[26]!==f?(E=n.jsxs("div",{className:f,children:[v,P]}),e[24]=v,e[25]=P,e[26]=f,e[27]=E):E=e[27],E}function Nc(t){const e=ce.c(71),{name:s,mainName:r,appUrl:a,ready:d,failed:o,notStarted:i,onStart:c,className:l,onClose:m}=t,p=Pe(),[f,x]=C.useState("/"),[h,j]=C.useState("desktop"),[g,b]=C.useState(0),N=C.useRef(null);let y;e[0]!==a||e[1]!==f?(y=a?wi(a,f):null,e[0]=a,e[1]=f,e[2]=y):y=e[2];const v=y;let P;e[3]!==l?(P=De("flex min-h-0 min-w-0 flex-1 flex-col",l),e[3]=l,e[4]=P):P=e[4];let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=W=>{W.preventDefault(),x(N.current?.value||"/")},e[5]=E):E=e[5];let k;e[6]!==s||e[7]!==p?(k=p("sandbox.appPane.path",{app:s}),e[6]=s,e[7]=p,e[8]=k):k=e[8];let S;e[9]!==f||e[10]!==k?(S=n.jsx("form",{className:"min-w-0 flex-1",onSubmit:E,children:n.jsx("input",{ref:N,defaultValue:f,"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]=f,e[10]=k,e[11]=S):S=e[11];let R;e[12]!==h||e[13]!==p?(R=p(h==="desktop"?"sandbox.preview.deviceMobile":"sandbox.preview.deviceDesktop"),e[12]=h,e[13]=p,e[14]=R):R=e[14];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=()=>j(Tc),e[15]=O):O=e[15];let T;e[16]!==h?(T=h==="desktop"?n.jsx(gr,{}):n.jsx(hr,{}),e[16]=h,e[17]=T):T=e[17];let L;e[18]!==R||e[19]!==T?(L=n.jsx(it,{label:R,onClick:O,children:T}),e[18]=R,e[19]=T,e[20]=L):L=e[20];let D;e[21]!==s||e[22]!==p?(D=p("sandbox.appPane.reload",{app:s}),e[21]=s,e[22]=p,e[23]=D):D=e[23];const A=!v||!d;let M,H;e[24]===Symbol.for("react.memo_cache_sentinel")?(M=()=>b(Cc),H=n.jsx(_a,{}),e[24]=M,e[25]=H):(M=e[24],H=e[25]);let X;e[26]!==D||e[27]!==A?(X=n.jsx(it,{label:D,disabled:A,onClick:M,children:H}),e[26]=D,e[27]=A,e[28]=X):X=e[28];let V;e[29]!==s||e[30]!==p?(V=p("sandbox.appPane.openInNewTab",{app:s}),e[29]=s,e[30]=p,e[31]=V):V=e[31];const J=!v||!d;let q;e[32]!==v?(q=()=>v&&window.open(v,"_blank","noopener"),e[32]=v,e[33]=q):q=e[33];let G;e[34]===Symbol.for("react.memo_cache_sentinel")?(G=n.jsx(cr,{}),e[34]=G):G=e[34];let Y;e[35]!==V||e[36]!==J||e[37]!==q?(Y=n.jsx(it,{label:V,disabled:J,onClick:q,children:G}),e[35]=V,e[36]=J,e[37]=q,e[38]=Y):Y=e[38];let _;e[39]!==s||e[40]!==m||e[41]!==p?(_=m&&n.jsx(it,{label:p("sandbox.appPane.close",{app:s}),onClick:m,children:n.jsx(Br,{})}),e[39]=s,e[40]=m,e[41]=p,e[42]=_):_=e[42];let $;e[43]!==X||e[44]!==Y||e[45]!==_||e[46]!==S||e[47]!==L?($=n.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:[S,L,X,Y,_]}),e[43]=X,e[44]=Y,e[45]=_,e[46]=S,e[47]=L,e[48]=$):$=e[48];let F;e[49]!==r||e[50]!==p?(F=p("sandbox.appPane.previewOnly",{app:r}),e[49]=r,e[50]=p,e[51]=F):F=e[51];let I;e[52]!==F?(I=n.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]=I):I=e[53];let B;e[54]!==h||e[55]!==o||e[56]!==r||e[57]!==s||e[58]!==i||e[59]!==c||e[60]!==d||e[61]!==g||e[62]!==v||e[63]!==p?(B=n.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:d&&i?n.jsxs("div",{className:"flex flex-col items-center gap-3 self-center px-6 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:p("sandbox.appPane.notStarted",{app:s})}),n.jsx(Me,{size:"sm",variant:"outline",onClick:c,children:p("sandbox.appPane.start",{app:s})})]}):!d||!v?n.jsx("p",{className:"self-center px-6 text-center text-sm text-muted-foreground",children:d?p("sandbox.appPane.noUrl"):o?p("sandbox.appPane.failed",{app:r}):p("sandbox.appPane.waiting")}):n.jsx("iframe",{src:v,title:s,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]=o,e[56]=r,e[57]=s,e[58]=i,e[59]=c,e[60]=d,e[61]=g,e[62]=v,e[63]=p,e[64]=B):B=e[64];let z;return e[65]!==s||e[66]!==P||e[67]!==$||e[68]!==I||e[69]!==B?(z=n.jsxs("section",{"aria-label":s,className:P,children:[$,I,B]}),e[65]=s,e[66]=P,e[67]=$,e[68]=I,e[69]=B,e[70]=z):z=e[70],z}function Cc(t){return t+1}function Tc(t){return t==="desktop"?"mobile":"desktop"}function it(t){const e=ce.c(11),{label:s,children:r,active:a,disabled:d,onClick:o}=t;let i;e[0]!==a||e[1]!==r||e[2]!==d||e[3]!==s||e[4]!==o?(i=n.jsx(lt,{asChild:!0,children:n.jsx(We,{"aria-label":s,"aria-pressed":a,active:a,disabled:d,onClick:o,children:r})}),e[0]=a,e[1]=r,e[2]=d,e[3]=s,e[4]=o,e[5]=i):i=e[5];let c;e[6]!==s?(c=n.jsx(ct,{children:s}),e[6]=s,e[7]=c):c=e[7];let l;return e[8]!==i||e[9]!==c?(l=n.jsxs(dt,{children:[i,c]}),e[8]=i,e[9]=c,e[10]=l):l=e[10],l}const Lc=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},Rc=1e4,Ac=1e4,_c=5e3,Oc=2;function Dc(t,e){return t&&e===0?Ac:Math.min(1e3*2**Math.max(0,e-1),_c)}function Bc(t,e,s){return e?!0:t===!0&&s<Oc}function $c(t,e){const s=ce.c(11),r=Lc,a=Oa();let d;s[0]!==t?(d=or.localAppReachable(t??""),s[0]=t,s[1]=d):d=s[1];const o=d;let i;s[2]!==r||s[3]!==a||s[4]!==o||s[5]!==t?(i=async p=>{const{signal:f}=p,x=new AbortController,h=()=>x.abort();f.addEventListener("abort",h);const j=setTimeout(h,Rc),g=await r(t,x.signal).catch(Fc);clearTimeout(j),f.removeEventListener("abort",h);const b=a.getQueryData(o),N=g?0:(b?.failures??0)+1;return{up:Bc(b?.up??null,g,N),failures:N}},s[2]=r,s[3]=a,s[4]=o,s[5]=t,s[6]=i):i=s[6];const c=!!t;let l;s[7]!==o||s[8]!==i||s[9]!==c?(l={queryKey:o,queryFn:i,enabled:c,retry:!1,staleTime:0,gcTime:0,refetchInterval:Mc},s[7]=o,s[8]=i,s[9]=c,s[10]=l):l=s[10];const{data:m}=Da(l);return t?m?.up??null:null}function Mc(t){return t.state.data?Dc(t.state.data.up,t.state.data.failures):!1}function Fc(){return!1}function zc(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const s=e.problem;return!s||s.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:s}}return{kind:"connecting"}}function Kd(t){const e=ce.c(53),{virtualMcpId:s}=t,r=Pe(),a=fo(s),{connection:d}=Cr(s),{activeTask:o,taskId:i,currentBranch:c}=Lt(),l=Ai(i),[m,p]=C.useState(!1),f=ss(s,c);let x;e[0]!==f||e[1]!==d?(x=d?He(f):null,e[0]=f,e[1]=d,e[2]=x):x=e[2];const h=x,j=$c(h),g=Mr(),b=ki("multi_app_preview");if(ji({threadId:i,sandboxBranch:o?.branch??c,agentHasRepo:js(a?.metadata),threadHasRepo:js(l)||js(o?.metadata)})==="none"&&!d){let E;e[3]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:n.jsx(In,{className:"size-7 text-foreground"})}),e[3]=E):E=e[3];let k;e[4]!==r?(k=r("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=r,e[5]=k):k=e[5];let S;e[6]!==r?(S=r("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=r,e[7]=S):S=e[7];let R,O;e[8]===Symbol.for("react.memo_cache_sentinel")?(R=()=>p(!0),O=n.jsx(In,{className:"size-4"}),e[8]=R,e[9]=O):(R=e[8],O=e[9]);let T;e[10]!==r?(T=r("mainPanelTabs.previewTab.connectGithub"),e[10]=r,e[11]=T):T=e[11];let L;e[12]!==T?(L=n.jsxs(Me,{onClick:R,children:[O,T]}),e[12]=T,e[13]=L):L=e[13];let D;e[14]!==k||e[15]!==S||e[16]!==L?(D=n.jsx(Si,{className:"h-full",image:E,title:k,description:S,actions:L}),e[14]=k,e[15]=S,e[16]=L,e[17]=D):D=e[17];let A;e[18]!==m?(A=n.jsx(Pi,{open:m,onOpenChange:p,mode:"agent"}),e[18]=m,e[19]=A):A=e[19];let M;return e[20]!==A||e[21]!==D?(M=n.jsxs(n.Fragment,{children:[D,A]}),e[20]=A,e[21]=D,e[22]=M):M=e[22],M}if(d&&a&&!He(f)){let E;e[23]!==g||e[24]!==f?(E=zc({backend:f,access:g}),e[23]=g,e[24]=f,e[25]=E):E=e[25];let k;e[26]!==d.endpoint?(k=_o(d.endpoint),e[26]=d.endpoint,e[27]=k):k=e[27];let S;return e[28]!==E||e[29]!==k?(S=n.jsx(Ic,{status:E,host:k}),e[28]=E,e[29]=k,e[30]=S):S=e[30],S}if(h&&j!==!0){let E;e[31]!==r?(E=r("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=r,e[32]=E):E=e[32];let k;e[33]!==h||e[34]!==r?(k=r("mainPanelTabs.previewTab.localAppWaiting.body",{host:Kc(h)}),e[33]=h,e[34]=r,e[35]=k):k=e[35];let S;e[36]!==k?(S=n.jsx(es,{text:k}),e[36]=k,e[37]=S):S=e[37];let R;e[38]!==r?(R=r("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=r,e[39]=R):R=e[39];let O;e[40]!==R?(O=n.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:R}),e[40]=R,e[41]=O):O=e[41];let T;return e[42]!==E||e[43]!==S||e[44]!==O?(T=n.jsx(ts,{headingLevel:2,waiting:!0,title:E,lead:S,footer:O}),e[42]=E,e[43]=S,e[44]=O,e[45]=T):T=e[45],T}let y;e[46]!==s?(y=n.jsx(Sc,{virtualMcpId:s}),e[46]=s,e[47]=y):y=e[47];const v=y;let P;return e[48]!==a||e[49]!==b||e[50]!==v||e[51]!==d?(P=n.jsx(Wa,{children:b&&a&&!d?n.jsx(Pc,{project:a,maxApps:vi,children:v}):v}),e[48]=a,e[49]=b,e[50]=v,e[51]=d,e[52]=P):P=e[52],P}function Kc(t){try{return new URL(t).host}catch{return t}}function Ic(t){const e=ce.c(20),{status:s,host:r}=t,a=Pe();if(s.kind==="connected"){let i;e[0]!==a?(i=a("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=a,e[1]=i):i=e[1];let c;e[2]!==a?(c=a("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=a,e[3]=c):c=e[3];let l;e[4]!==c?(l=n.jsx(es,{text:c}),e[4]=c,e[5]=l):l=e[5];let m;e[6]!==a?(m=a("mainPanelTabs.previewTab.localhostNoPreview.step.title"),e[6]=a,e[7]=m):m=e[7];let p;e[8]!==m?(p=[{title:m,command:`${Er} --preview localhost:3000`}],e[8]=m,e[9]=p):p=e[9];let f;return e[10]!==i||e[11]!==l||e[12]!==p?(f=n.jsx(ts,{headingLevel:2,waiting:!1,title:i,lead:l,steps:p}),e[10]=i,e[11]=l,e[12]=p,e[13]=f):f=e[13],f}let d;e[14]!==r||e[15]!==s?(d=$i(s,r),e[14]=r,e[15]=s,e[16]=d):d=e[16];let o;return e[17]!==r||e[18]!==d?(o=n.jsx(Bi,{wait:d,hosts:r}),e[17]=r,e[18]=d,e[19]=o):o=e[19],o}export{Bi as L,Kd as P,ts as S,zd as u};
551
+ `)}function il(t,e,s=320,r=44,a=12){const{x:d,y:o}=t,{width:i,height:c}=e,l=Math.max(a,Math.min(d-s/2,i-s-a)),p=o/c>.68?Math.max(a,o-r-18):Math.min(o+18,c-r-a);return{leftPct:l/i*100,topPct:p/c*100}}function ll(t){const e=ce.c(45),{element:s,onDismiss:r}=t,[a,d]=C.useState(""),o=C.useRef(null),{sendMessage:i}=Ga(),{openSidePanel:c}=ii(),l=Pe();let m;e[0]!==s||e[1]!==a||e[2]!==r||e[3]!==c||e[4]!==i?(m=()=>{if(!a.trim())return;const H=ol(s,a);c(),i({parts:[{type:"text",text:H}]}),r()},e[0]=s,e[1]=a,e[2]=r,e[3]=c,e[4]=i,e[5]=m):m=e[5];const p=m;let f;e[6]!==s.position||e[7]!==s.viewport?(f=il(s.position,s.viewport),e[6]=s.position,e[7]=s.viewport,e[8]=f):f=e[8];const x=f,h=`${x.leftPct}%`,j=`${x.topPct}%`;let g;e[9]!==h||e[10]!==j?(g={left:h,top:j,width:"320px"},e[9]=h,e[10]=j,e[11]=g):g=e[11];let b;e[12]!==p?(b=H=>{H.preventDefault(),p()},e[12]=p,e[13]=b):b=e[13];let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=H=>d(H.target.value),e[14]=N):N=e[14];let y;e[15]!==r?(y=H=>{H.key==="Escape"&&r()},e[15]=r,e[16]=y):y=e[16];let v;e[17]!==l?(v=l("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=l,e[18]=v):v=e[18];let P;e[19]!==a||e[20]!==y||e[21]!==v?(P=n.jsx("input",{ref:o,autoFocus:!0,type:"text",value:a,onChange:N,onKeyDown:y,placeholder:v,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=a,e[20]=y,e[21]=v,e[22]=P):P=e[22];let E;e[23]!==a?(E=a.trim(),e[23]=a,e[24]=E):E=e[24];const k=!E;let S;e[25]!==l?(S=l("sandbox.visualEditorPrompt.sendButton"),e[25]=l,e[26]=S):S=e[26];let R;e[27]!==l?(R=l("sandbox.visualEditorPrompt.sendButton"),e[27]=l,e[28]=R):R=e[28];let O;e[29]!==R?(O=n.jsx("title",{children:R}),e[29]=R,e[30]=O):O=e[30];let T;e[31]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=T):T=e[31];let L;e[32]!==O?(L=n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[O,T]}),e[32]=O,e[33]=L):L=e[33];let D;e[34]!==k||e[35]!==S||e[36]!==L?(D=n.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:S,children:L}),e[34]=k,e[35]=S,e[36]=L,e[37]=D):D=e[37];let A;e[38]!==P||e[39]!==D||e[40]!==b?(A=n.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:b,children:[P,D]}),e[38]=P,e[39]=D,e[40]=b,e[41]=A):A=e[41];let M;return e[42]!==A||e[43]!==g?(M=n.jsx("div",{className:"absolute z-30 pointer-events-none",style:g,children:A}),e[42]=A,e[43]=g,e[44]=M):M=e[44],M}const Gn="site-links",cl=/details?page|\bpdp\b/i,dl=/listingpage|\bplp\b/i;function ul(t,e,s){const r=new Set;for(const i of s)cl.test(i)&&r.add("product"),dl.test(i)&&r.add("category");const a=Ct(Is(t)),d=a[a.length-1],o=a[a.length-2];return d?.type==="text"&&d.text==="/p"&&o?.type==="param"&&o.name===e&&r.add("product"),e==="*"&&a.some(i=>i.type==="param"&&i.name==="*")&&r.add("category"),r}const fl=["rosa","preto","pink","black"];function Jt(t,e){const s=e.trim();return s?t(s):fl.flatMap(r=>t(r))}function pl(t,e){const s=e.trim(),r=[];/^\d+$/.test(s)&&r.push({resolveType:t,props:{ids:[s]}});const d=s.includes("-")&&!/\s/.test(s)?s.replace(/-+/g," "):s;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 Hs(t){return t.split("/")[0]??""}function ml(t){const e=new Set;for(const s of t){const r=Hs(s);Fr.has(r)&&e.add(r)}return e}function hl(t,e){const s=Hs(t);return!Fr.has(s)||e.size===0?!0:e.has(s)}const gl=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>Jt(s=>pl(t,s),e),optionsFromPayload:Yt},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Jt(s=>[{resolveType:t,props:{props:{search:s,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(s=>[{resolveType:t,props:{term:s,hitsPerPage:10}}],e),optionsFromPayload:Yt},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Jt(s=>[{resolveType:t,props:{query:s,term:s,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:Sl}];function vl(t,e,s=new Set){const r=[...e],a=i=>{const c=[];for(const l of gl){if(l.kind!==i)continue;const m=r.find(p=>l.test(p)&&hl(p,s));m&&c.push({cand:l,resolveType:m})}return c.find(l=>s.has(Hs(l.resolveType)))??c[0]},d=(i,c,l)=>({kind:i.kind,id:`${i.kind}:${c}`,resolveType:c,clientFilter:i.clientFilter,isFallback:l,buildRequests:m=>i.buildRequests(c,m),optionsFromPayload:i.optionsFromPayload}),o=[];for(const i of["product","category"]){if(!t.has(i))continue;const c=a(i);c&&o.push(d(c.cand,c.resolveType,!1))}return t.size>0&&o.push(xl(t.has("category")?"category":"product")),o}function xl(t){return{kind:t,id:Gn,resolveType:Gn,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,s)=>Cl(e,s)}}function Ge(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function bl(t,e,s){const r=new Set,a=new Set,d=o=>{if(Array.isArray(o)){for(const l of o)d(l);return}const i=Ge(o);if(!i)return;const c=i.__resolveType;if(typeof c=="string"){if(s(c))r.add(c);else if(c in e&&!a.has(c)){a.add(c);const l=Ge(e[c])?.__resolveType;typeof l=="string"&&s(l)&&r.add(c),d(e[c])}}for(const l of Object.values(i))d(l)};return d(t),r}function zr(t){const e=new Set,s=[];for(const r of t)for(const a of r)e.has(a.value)||(e.add(a.value),s.push(a));return s}function Kr(t){try{return decodeURIComponent(t)}catch{return t}}function yl(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wl(t){const e=[];let s="^";for(const r of t)r.type==="text"?s+=yl(r.text):(e.push(r.name),s+=r.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${s}$`),order:e}}function Ir(t,e,s){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 a=Ct(Is(e)),{pattern:d,order:o}=wl(a),i=o.indexOf(s);if(i===-1)return null;const c=r.match(d);if(!c)return null;const l=c[i+1]?.replace(/^\/+|\/+$/g,"");return l?Kr(l):null}function Yt(t,e){const s=Ge(t),r=Array.isArray(t)?t:Array.isArray(s?.products)?s.products:Array.isArray(s?.list)?s.list:[],a=[],d=new Set;for(const o of r){const i=Ge(o);if(!i)continue;const c=Ir(i.url,e.template,e.paramName);if(!c||d.has(c))continue;d.add(c);const l=Ge(i.isVariantOf),m=typeof l?.name=="string"&&l.name||typeof i.name=="string"&&i.name||c,p=Array.isArray(i.image)?Ge(i.image[0]):null,f=typeof p?.url=="string"?p.url:void 0;a.push({value:c,label:m,image:f})}return a}function kl(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const s=e.replace(/^\/+|\/+$/g,"");return s?Kr(s):null}function Sl(t){const e=[],s=new Set,r=(a,d)=>{const o=Ge(a);if(!o)return;const i=typeof o.name=="string"&&o.name?o.name:"",c=i?[...d,i]:d,l=kl(o.url);if(l&&!s.has(l)&&(s.add(l),e.push({value:l,label:c.join(" › ")||l})),Array.isArray(o.children))for(const m of o.children)r(m,c)};if(Array.isArray(t))for(const a of t)r(a,[]);return e}const Pl=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 jl(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,s=>s.toUpperCase())}function El(t){if(typeof t!="string"||!t)return[];const e=[],s=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let r,a=0;for(;(r=s.exec(t))!==null&&a++<5e3;){const d=r[1]??"",o=(r[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:d,text:o})}return e}function Nl(t){if(typeof t!="string"||!t)return[];const e=[],s=new Set,r=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,a=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let d,o=0;for(;(d=r.exec(t))!==null&&o++<3e3;){const i=(d[1]??"").replace(/\\\//g,"/");if(!i||s.has(i))continue;s.add(i);const c=t.slice(d.index,d.index+900).match(a)?.[1]?.replace(/\\\//g,"/");e.push({url:i,name:d[2]??"",image:c||void 0})}return e}function Cl(t,e){const s=[],r=new Set,a=(d,o,i,c)=>{if(s.length>=200)return;const l=Ir(d,e.template,e.paramName);!l||r.has(l)||e.paramName==="*"&&/(^|\/)p$/.test(l)||i==="category"&&Pl.has(l.split("/")[0]??"")||(r.add(l),s.push({value:l,label:o&&o.length<=80?o:jl(l),kind:i,image:c}))};for(const{url:d,name:o,image:i}of Nl(t))a(d,o,"product",i);for(const{href:d,text:o}of El(t))d.startsWith("/")&&!d.startsWith("//")&&a(d,o,"category");return s}function St(t,e,s=50){const r=e.trim().toLowerCase();return(r?t.filter(d=>d.label.toLowerCase().includes(r)||d.value.toLowerCase().includes(r)):t).slice(0,s)}const Ur=1e4;function Tl(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 Ll(t,{resolveType:e,props:s}){const r=await fetch(yo(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...s}),signal:AbortSignal.timeout(Ur)});if(!r.ok)throw new Error(`Failed to fetch options: ${r.status}`);return r.json()}async function Jn(t,e){const s=await fetch(wo(t,e),{signal:AbortSignal.timeout(Ur)});if(!s.ok)throw new Error(`Failed to fetch page: ${s.status}`);return s.text()}async function Rl(t,e,s){const r=e.optionsFromPayload(await Jn(t,"/"),s),a=r.find(o=>o.kind==="category");if(!a)return r;const d=Ve(s.template,{[s.paramName]:a.value});if(d==="/")return r;try{const o=e.optionsFromPayload(await Jn(t,d),s).filter(i=>i.kind==="product");return zr([r,o])}catch{return r}}function Al(t,e,s){return or.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":s}`)}async function _l(t,e,s,r){if(e.homepageLinks)return Rl(t,e,r);const a=e.buildRequests?.(s)??[];if(a.length===0)return[];const d=await Promise.allSettled(a.map(i=>Ll(t,i))),o=d.filter(i=>i.status==="fulfilled").map(i=>i.value);if(o.length===0){const i=d.find(c=>c.status==="rejected");throw i?i.reason:new Error("Failed to fetch options")}return zr(o.map(i=>e.optionsFromPayload(i,r)))}function Ms(t,e,s,r,a){return{queryKey:Al(t,e,s),queryFn:()=>_l(t,e,s,r),enabled:a,staleTime:6e4,retry:1}}function Pt(t){const e=ce.c(16),{heading:s,iconKind:r,options:a,template:d,paramName:o,keyPrefix:i,onSelect:c}=t;if(a.length===0)return null;let l;if(e[0]!==r||e[1]!==i||e[2]!==c||e[3]!==a||e[4]!==o||e[5]!==d){let p;e[7]!==r||e[8]!==i||e[9]!==c||e[10]!==o||e[11]!==d?(p=f=>n.jsxs(Nt,{value:`${i}:${f.value}`,className:"gap-3 py-2",onSelect:()=>c(f.value),children:[r==="product"&&n.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.image?n.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):n.jsx(mr,{size:14,className:"text-muted-foreground"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm",children:f.label}),n.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Ve(d,{[o]:f.value})})]})]},`${i}:${f.value}`),e[7]=r,e[8]=i,e[9]=c,e[10]=o,e[11]=d,e[12]=p):p=e[12],l=a.map(p),e[0]=r,e[1]=i,e[2]=c,e[3]=a,e[4]=o,e[5]=d,e[6]=l}else l=e[6];let m;return e[13]!==s||e[14]!==l?(m=n.jsx(Et,{heading:s,children:l}),e[13]=s,e[14]=l,e[15]=m):m=e[15],m}function Yn(t){const e=ce.c(2),{text:s}=t;let r;return e[0]!==s?(r=n.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:s}),e[0]=s,e[1]=r):r=e[1],r}function Ol(t){const e=ce.c(52),{sources:s,template:r,paramName:a,value:d,sandboxRef:o,onCommit:i}=t,c=Pe(),[l,m]=C.useState(!1),[p,f]=C.useState(""),[x,h]=C.useState(""),j=C.useRef(null),g=a==="*"?c("sandbox.preview.catchAllParamLabel"):`:${a}`,b=Tl(c),y=[...new Set(s.map(ne=>b[ne.kind].noun))].join(" or ");let v;e[0]!==c||e[1]!==y?(v=c("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=c,e[1]=y,e[2]=v):v=e[2];const P=v,E={template:r,paramName:a};let k;e[3]!==p?(k=(ne,oe)=>({source:ne,query:oe,options:ne.clientFilter?St(oe.data??[],p):oe.data??[]}),e[3]=p,e[4]=k):k=e[4];const S=k,R=s.filter(Il),O=s.filter(Kl),T=Ds({queries:R.map(ne=>Ms(o,ne,x,E,l))});let L;e[5]!==T||e[6]!==S?(L=(ne,oe)=>S(ne,T[oe]),e[5]=T,e[6]=S,e[7]=L):L=e[7];const D=R.map(L),A=D.length===0||D.every(zl),M=Ds({queries:O.map(ne=>Ms(o,ne,x,E,l&&A))});let H;e[8]!==M||e[9]!==S?(H=(ne,oe)=>S(ne,M[oe]),e[8]=M,e[9]=S,e[10]=H):H=e[10];const X=O.map(H),V=A?X:D,J=V.length===1&&V[0]?.source.homepageLinks?V[0]:null,G=J&&!J.query.isLoading&&!J.query.isError?J?.query.data??[]:[],Y=St(G.filter(Fl),p),_=St(G.filter(Ml),p),$=Y.length>0&&_.length>0,F=ne=>{m(ne),j.current&&clearTimeout(j.current),f(ne?d:""),h(ne?d:"")};let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=ne=>{f(ne),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{h(ne)},300)},e[11]=I):I=e[11];const B=I,z=ne=>{i(ne),F(!1)},W=Rr(p),K=Ve(r,{[a]:W}),te=ar,se=rr,ee="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",ae=$l;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=n.jsx(ir,{className:"sr-only",children:n.jsx(lr,{children:pe})}),e[15]=pe,e[16]=de):de=e[16];let ve;e[17]===Symbol.for("react.memo_cache_sentinel")?(ve=n.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=n.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=n.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[ve,n.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 ie;e[25]!==P||e[26]!==p?(ie=n.jsx(Sr,{autoFocus:!0,placeholder:P,value:p,onValueChange:B}),e[25]=P,e[26]=p,e[27]=ie):ie=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=n.jsx(Pr,{children:ze}),e[30]=ze,e[31]=Be):Be=e[31];const ut=W&&n.jsx(Et,{className:"shrink-0",children:n.jsxs(Nt,{value:`__raw__:${W}`,className:"gap-3 py-2",onSelect:()=>z(W),children:[n.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:n.jsx(ci,{size:14,className:"text-muted-foreground"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm",children:c("sandbox.pathParamPickerChip.useRawValue",{rawTerm:W,paramLabel:g})}),n.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:K})]})]})}),Je=$?n.jsxs("div",{className:"flex min-h-0 flex-1",children:[n.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:n.jsx(Pt,{heading:b.category.heading,iconKind:"category",options:Y,template:r,paramName:a,keyPrefix:`${J?.source.id}:cat`,onSelect:z})}),n.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:n.jsx(Pt,{heading:b.product.heading,iconKind:"product",options:_,template:r,paramName:a,keyPrefix:`${J?.source.id}:prod`,onSelect:z})})]}):n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:V.map(ne=>{const{source:oe,query:ke,options:Ie}=ne,{noun:ft}=b[oe.kind];if(ke.isLoading)return n.jsx(Yn,{text:c("sandbox.pathParamPickerChip.loading",{noun:ft})},oe.id);if(ke.isError)return n.jsx(Yn,{text:c("sandbox.pathParamPickerChip.couldNotLoad")},oe.id);if(oe.homepageLinks){const Ye=ke.data??[];return n.jsxs(C.Fragment,{children:[n.jsx(Pt,{heading:b.category.heading,iconKind:"category",options:St(Ye.filter(Bl),p),template:r,paramName:a,keyPrefix:`${oe.id}:cat`,onSelect:z}),n.jsx(Pt,{heading:b.product.heading,iconKind:"product",options:St(Ye.filter(Dl),p),template:r,paramName:a,keyPrefix:`${oe.id}:prod`,onSelect:z})]},oe.id)}return n.jsx(Pt,{heading:V.length>1?b[oe.kind].heading:void 0,iconKind:oe.kind,options:Ie,template:r,paramName:a,keyPrefix:oe.id,onSelect:z},oe.id)})});let he;e[32]!==Ne||e[33]!==Be||e[34]!==ut||e[35]!==Je?(he=n.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 Le;e[37]!==ge||e[38]!==ie||e[39]!==he?(Le=n.jsxs(ge,{shouldFilter:je,className:fe,children:[ie,he]}),e[37]=ge,e[38]=ie,e[39]=he,e[40]=Le):Le=e[40];let _e;e[41]!==se||e[42]!==de||e[43]!==me||e[44]!==Le||e[45]!==ae?(_e=n.jsxs(se,{className:ee,onClick:ae,children:[de,me,Le]}),e[41]=se,e[42]=de,e[43]=me,e[44]=Le,e[45]=ae,e[46]=_e):_e=e[46];let Ke;return e[47]!==te||e[48]!==F||e[49]!==l||e[50]!==_e?(Ke=n.jsx(te,{open:l,onOpenChange:F,children:_e}),e[47]=te,e[48]=F,e[49]=l,e[50]=_e,e[51]=Ke):Ke=e[51],n.jsxs(n.Fragment,{children:[n.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 Dl(t){return t.kind==="product"}function Bl(t){return t.kind!=="product"}function $l(t){return t.stopPropagation()}function Ml(t){return t.kind==="product"}function Fl(t){return t.kind!=="product"}function zl(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Kl(t){return t.isFallback}function Il(t){return!t.isFallback}function Ul(t){const e=ce.c(8),{sources:s,template:r,paramName:a,sandboxRef:d,onFill:o}=t;let i,c;if(e[0]!==a||e[1]!==d||e[2]!==s||e[3]!==r){const x={template:r,paramName:a},h=s.filter(Hl);c=Ds,i=h.map(j=>Ms(d,j,"",x,!0)),e[0]=a,e[1]=d,e[2]=s,e[3]=r,e[4]=i,e[5]=c}else i=e[4],c=e[5];let l;e[6]!==i?(l={queries:i},e[6]=i,e[7]=l):l=e[7];const m=c(l),[p,f]=C.useState(!1);if(!p)for(const x of m){if(x.isLoading)break;const h=x.data?.[0];if(h){f(!0),queueMicrotask(()=>o(h.value));break}}return null}function Hl(t){return!t.isFallback}function Vl(t){const e=ce.c(31),{name:s,value:r,onCommit:a}=t,d=Pe(),[o,i]=C.useState(r),[c,l]=C.useState(!1),m=C.useRef(!1);let p;e[0]!==s||e[1]!==d?(p=s==="*"?d("sandbox.preview.catchAllParamLabel"):`:${s}`,e[0]=s,e[1]=d,e[2]=p):p=e[2];const f=p,x=o||f;let h;e[3]!==x?(h=n.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 j;e[5]!==f||e[6]!==d?(j=d("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=d,e[7]=j):j=e[7];let g,b;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=S=>i(S.target.value),b=()=>l(!0),e[8]=g,e[9]=b):(g=e[8],b=e[9]);let N;e[10]!==r?(N=S=>{S.key==="Enter"&&S.currentTarget.blur(),S.key==="Escape"&&(m.current=!0,i(r),S.currentTarget.blur())},e[10]=r,e[11]=N):N=e[11];let y;e[12]!==o||e[13]!==a||e[14]!==r?(y=()=>{if(l(!1),m.current){m.current=!1;return}const S=Rr(o);i(S),S!==r&&a(S)},e[12]=o,e[13]=a,e[14]=r,e[15]=y):y=e[15];let v;e[16]!==o||e[17]!==f||e[18]!==j||e[19]!==N||e[20]!==y?(v=n.jsx("input",{type:"text",value:o,placeholder:f,title:j,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:ql,onChange:g,onFocus:b,onKeyDown:N,onBlur:y}),e[16]=o,e[17]=f,e[18]=j,e[19]=N,e[20]=y,e[21]=v):v=e[21];let P;e[22]!==h||e[23]!==v?(P=n.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]=P):P=e[24];let E;e[25]!==c||e[26]!==d?(E=c&&n.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:[n.jsx(to,{size:10}),d("sandbox.preview.enterToGo")]}),e[25]=c,e[26]=d,e[27]=E):E=e[27];let k;return e[28]!==E||e[29]!==P?(k=n.jsxs(n.Fragment,{children:[P,E]}),e[28]=E,e[29]=P,e[30]=k):k=e[30],k}function ql(t){return t.stopPropagation()}function Wl(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const s=new URL(e),r=t.resolvedPath==="/"?"":t.resolvedPath;return`${s.host}${r}`}catch{return e}}function Gl(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Jl(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 Yl(t,e){if(t)return t;const s=await e?.().catch(()=>null);if(!s)throw new Hr;return s}async function Ql(t,e,s){return s?Nn(t,e,await Yl(s.meta,s.loadMeta)):Nn(t,e)}function Xl(t){const e=ce.c(5);let s;e[0]!==t?(s=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=s):s=e[1];const r=dr(s);let a;return e[2]!==t||e[3]!==r?(a={mutationFn:async d=>{const{name:o,path:i,template:c,schema:l}=d;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const m=Ba(o),p=c?{...c,name:o,path:i}:await Ql(o,i,l);return await r.mutateAsync({blockKey:m,data:p}),{key:m,name:o,path:i}}},e[2]=t,e[3]=r,e[4]=a):a=e[4],Na(a)}function Zl(t){const e=ce.c(89),{open:s,onOpenChange:r,isPending:a,error:d,templates:o,onSubmit:i}=t,c=a===void 0?!1:a,l=Pe();let m;e[0]!==l?(m=l("sectionsEditor.createPageModal.defaultPageName"),e[0]=l,e[1]=m):m=e[1];const[p,f]=C.useState(m);let x;e[2]!==l?(x=l("sectionsEditor.createPageModal.defaultPagePath"),e[2]=l,e[3]=x):x=e[3];const[h,j]=C.useState(x),[g,b]=C.useState(Ss),[N,y]=C.useState(null),[v,P]=C.useState(s);s!==v&&(P(s),s&&(f(l("sectionsEditor.createPageModal.defaultPageName")),j(l("sectionsEditor.createPageModal.defaultPagePath")),b(Ss),y(null)));const E=!!o?.length;let k;e[4]!==c||e[5]!==r?(k=ue=>{!ue&&!c&&(y(null),r(!1))},e[4]=c,e[5]=r,e[6]=k):k=e[6];const S=k;let R;e[7]!==c||e[8]!==p||e[9]!==i||e[10]!==h||e[11]!==E||e[12]!==g?(R=async ue=>{ue.preventDefault();const xe=p.trim(),me=h.trim();if(!xe||!me||c)return;const ge=Ar(me);if(ge){y(ge);return}y(null),await i({name:xe,path:me,templateKey:E&&g!==Ss?g:null})},e[7]=c,e[8]=p,e[9]=i,e[10]=h,e[11]=E,e[12]=g,e[13]=R):R=e[13];const O=R,T=N??d;let L;e[14]!==l?(L=l("sectionsEditor.createPageModal.title"),e[14]=l,e[15]=L):L=e[15];let D;e[16]!==L?(D=n.jsx(ir,{children:n.jsx(lr,{children:L})}),e[16]=L,e[17]=D):D=e[17];let A;e[18]!==l?(A=l("sectionsEditor.createPageModal.nameLabel"),e[18]=l,e[19]=A):A=e[19];let M;e[20]!==A?(M=n.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:A}),e[20]=A,e[21]=M):M=e[21];let H;e[22]===Symbol.for("react.memo_cache_sentinel")?(H=ue=>f(ue.target.value),e[22]=H):H=e[22];let X;e[23]!==l?(X=l("sectionsEditor.createPageModal.namePlaceholder"),e[23]=l,e[24]=X):X=e[24];let V;e[25]!==c||e[26]!==p||e[27]!==X?(V=n.jsx(Rs,{id:"new-page-name",value:p,onChange:H,placeholder:X,autoFocus:!0,disabled:c}),e[25]=c,e[26]=p,e[27]=X,e[28]=V):V=e[28];let J;e[29]!==V||e[30]!==M?(J=n.jsxs("div",{className:"space-y-1.5",children:[M,V]}),e[29]=V,e[30]=M,e[31]=J):J=e[31];let q;e[32]!==l?(q=l("sectionsEditor.createPageModal.pathLabel"),e[32]=l,e[33]=q):q=e[33];let G;e[34]!==q?(G=n.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:q}),e[34]=q,e[35]=G):G=e[35];let Y;e[36]===Symbol.for("react.memo_cache_sentinel")?(Y=ue=>j(ue.target.value),e[36]=Y):Y=e[36];let _;e[37]!==l?(_=l("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=l,e[38]=_):_=e[38];let $;e[39]!==c||e[40]!==h||e[41]!==_?($=n.jsx(Rs,{id:"new-page-path",value:h,onChange:Y,placeholder:_,disabled:c}),e[39]=c,e[40]=h,e[41]=_,e[42]=$):$=e[42];let F;e[43]!==G||e[44]!==$?(F=n.jsxs("div",{className:"space-y-1.5",children:[G,$]}),e[43]=G,e[44]=$,e[45]=F):F=e[45];let I;e[46]!==c||e[47]!==E||e[48]!==l||e[49]!==g||e[50]!==o?(I=E&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.createPageModal.templateLabel")}),n.jsx($a,{id:"new-page-template",value:g,onChange:b,templates:o??[],disabled:c})]}),e[46]=c,e[47]=E,e[48]=l,e[49]=g,e[50]=o,e[51]=I):I=e[51];let B;e[52]!==T?(B=T&&n.jsx("p",{className:"text-xs text-destructive",children:T}),e[52]=T,e[53]=B):B=e[53];let z;e[54]!==J||e[55]!==F||e[56]!==I||e[57]!==B?(z=n.jsxs("div",{className:"space-y-4 py-4",children:[J,F,I,B]}),e[54]=J,e[55]=F,e[56]=I,e[57]=B,e[58]=z):z=e[58];let W;e[59]!==r?(W=()=>r(!1),e[59]=r,e[60]=W):W=e[60];let K;e[61]!==l?(K=l("sectionsEditor.createPageModal.cancelButton"),e[61]=l,e[62]=K):K=e[62];let te;e[63]!==c||e[64]!==W||e[65]!==K?(te=n.jsx(Me,{type:"button",variant:"outline",onClick:W,disabled:c,children:K}),e[63]=c,e[64]=W,e[65]=K,e[66]=te):te=e[66];let se;e[67]!==c||e[68]!==p||e[69]!==h?(se=!p.trim()||!h.trim()||c,e[67]=c,e[68]=p,e[69]=h,e[70]=se):se=e[70];let ee;e[71]!==c||e[72]!==l?(ee=c?n.jsxs(n.Fragment,{children:[n.jsx(Tt,{className:"size-3.5"}),l("sectionsEditor.createPageModal.creatingButton")]}):l("sectionsEditor.createPageModal.createButton"),e[71]=c,e[72]=l,e[73]=ee):ee=e[73];let ae;e[74]!==se||e[75]!==ee?(ae=n.jsx(Me,{type:"submit",disabled:se,children:ee}),e[74]=se,e[75]=ee,e[76]=ae):ae=e[76];let pe;e[77]!==te||e[78]!==ae?(pe=n.jsxs(Ca,{children:[te,ae]}),e[77]=te,e[78]=ae,e[79]=pe):pe=e[79];let de;e[80]!==O||e[81]!==z||e[82]!==pe||e[83]!==D?(de=n.jsx(rr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:O,children:[D,z,pe]})}),e[80]=O,e[81]=z,e[82]=pe,e[83]=D,e[84]=de):de=e[84];let ve;return e[85]!==S||e[86]!==s||e[87]!==de?(ve=n.jsx(ar,{open:s,onOpenChange:S,children:de}),e[85]=S,e[86]=s,e[87]=de,e[88]=ve):ve=e[88],ve}function ec(t){const e=ce.c(36),{orgSlug:s,virtualMcpId:r,branch:a,previewUrl:d,meta:o,decofile:i,blockKey:c}=t,l=Pe();let m;e[0]!==a||e[1]!==s||e[2]!==r?(m={orgSlug:s,virtualMcpId:r,branch:a},e[0]=a,e[1]=s,e[2]=r,e[3]=m):m=e[3];const p=dr(m);let f;e[4]!==p?(f=za((k,S)=>p.mutate({blockKey:k,data:S})),e[4]=p,e[5]=f):f=e[5];const x=f;let h;e[6]!==c||e[7]!==i?(h=Ma(i,c),e[6]=c,e[7]=i,e[8]=h):h=e[8];const{resolveType:j,props:g,title:b}=h;if(!j){let k;e[9]!==l?(k=l("sandbox.preview.loaderNoLongerExists"),e[9]=l,e[10]=k):k=e[10];let S;return e[11]!==k?(S=n.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:k}),e[11]=k,e[12]=S):S=e[12],S}const N=`loader:${c}`,y=`loader:${c}`;let v;e[13]!==c||e[14]!==j||e[15]!==b?(v={mode:"saved",blockKey:c,resolveType:j,title:b},e[13]=c,e[14]=j,e[15]=b,e[16]=v):v=e[16];let P;e[17]!==a||e[18]!==i||e[19]!==o||e[20]!==s||e[21]!==d||e[22]!==g||e[23]!==p.isPending||e[24]!==x||e[25]!==y||e[26]!==v||e[27]!==r?(P=n.jsx(Fa,{orgSlug:s,virtualMcpId:r,branch:a,previewUrl:d,meta:o,decofile:i,kind:"loaders",target:v,initialValue:g,isCreating:p.isPending,onCreate:tc,onSaveReferencedBlock:x,showRun:!1},y),e[17]=a,e[18]=i,e[19]=o,e[20]=s,e[21]=d,e[22]=g,e[23]=p.isPending,e[24]=x,e[25]=y,e[26]=v,e[27]=r,e[28]=P):P=e[28];let E;return e[29]!==c||e[30]!==a||e[31]!==s||e[32]!==N||e[33]!==P||e[34]!==r?(E=n.jsx(Ka,{orgSlug:s,virtualMcpId:r,branch:a,blockKey:c,present:void 0,children:P},N),e[29]=c,e[30]=a,e[31]=s,e[32]=N,e[33]=P,e[34]=r,e[35]=E):E=e[35],E}async function tc(){}function sc(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Qn(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:sc(t.error)}}function nc(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 rc(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=nc(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const s=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return s&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(a=>a.status==="error"&&!a.hasData&&a.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:s?t.lifecyclePhase==="running"||t.lifecyclePhase==="crashed"?{kind:"error",source:"data"}:{kind:"loading"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"}}const ac=C.lazy(()=>Ta(()=>import("./sections-editor-B628EbZ4.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])).then(t=>({default:t.SectionsEditor})));function Xn(t){const e=ce.c(60),{virtualMcpId:s,externalSelection:r,onViewJsonFile:a}=t,d=r===void 0?null:r,{org:o}=zs(),{currentBranch:i,taskId:c}=Lt(),l=Us(),m=Rt(),p=Or(),f=l.lifecycle.phase==="running",x=m.previewUrl;let h;e[0]!==i||e[1]!==o||e[2]!==x||e[3]!==c||e[4]!==s?(h=i?{orgSlug:o.slug,virtualMcpId:s,branch:i,threadId:c??null,previewUrl:x}:null,e[0]=i,e[1]=o,e[2]=x,e[3]=c,e[4]=s,e[5]=h):h=e[5];const j=h,g=ss(s,i);let b;e[6]!==f?(b={fetchEnabled:f},e[6]=f,e[7]=b):b=e[7];const N=Ks(j,b);let y;e[8]!==f?(y={fetchEnabled:f},e[8]=f,e[9]=y):y=e[9];const v=Lr(j,y),P=rc({lifecyclePhase:l.lifecycle.phase,decofile:Qn(N),meta:Qn(v),hasEditableContent:qo(N.data,v.data),fastPreviewActive:jr(s).runtime==="cms"||at(g)}),E=ur()===void 0,k=oc;if(Bo(g)){let _;return e[10]===Symbol.for("react.memo_cache_sentinel")?(_=k(n.jsx(Mo,{})),e[10]=_):_=e[10],_}if(g.kind==="pending"&&g.retrying){let _;return e[11]!==g?(_=k(n.jsx(Fo,{backend:g})),e[11]=g,e[12]=_):_=e[12],_}if(P.kind==="loading"||E){let _;return e[13]===Symbol.for("react.memo_cache_sentinel")?(_=k(n.jsx(La,{})),e[13]=_):_=e[13],_}if(N.data&&ko(v.data)){const _=p.state.target,$=_?.kind==="page"||_?.kind==="section"?_.key:null,F=$??"",I=i??"";let B;return e[14]!==N.data||e[15]!==$||e[16]!==o.slug||e[17]!==F||e[18]!==I||e[19]!==s?(B=k(n.jsx(Ia,{orgSlug:o.slug,virtualMcpId:s,branch:I,decofile:N.data,initialKey:$,compact:!0},F)),e[14]=N.data,e[15]=$,e[16]=o.slug,e[17]=F,e[18]=I,e[19]=s,e[20]=B):B=e[20],B}if(P.kind==="empty"){let _;return e[21]===Symbol.for("react.memo_cache_sentinel")?(_=k(n.jsx(zo,{})),e[21]=_):_=e[21],_}if(P.kind==="error"){let _;e[22]!==N||e[23]!==m||e[24]!==v||e[25]!==P.source?(_=()=>{if(P.source==="sandbox"){m.retry();return}Promise.all([N.refetch(),v.refetch()])},e[22]=N,e[23]=m,e[24]=v,e[25]=P.source,e[26]=_):_=e[26];const $=_;let F;return e[27]!==$||e[28]!==P.source?(F=k(n.jsx($o,{source:P.source,onRetry:$})),e[27]=$,e[28]=P.source,e[29]=F):F=e[29],F}let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=_=>k(n.jsx("div",{className:"h-full min-h-0",children:_})),e[30]=S):S=e[30];const R=S,O=p.state.target;if(O?.kind==="loader"&&N.data&&v.data){const _=i??"",$=x??null;let F;return e[31]!==N.data||e[32]!==v.data||e[33]!==o.slug||e[34]!==_||e[35]!==$||e[36]!==O.key||e[37]!==s?(F=R(n.jsx(ec,{orgSlug:o.slug,virtualMcpId:s,branch:_,previewUrl:$,meta:v.data,decofile:N.data,blockKey:O.key})),e[31]=N.data,e[32]=v.data,e[33]=o.slug,e[34]=_,e[35]=$,e[36]=O.key,e[37]=s,e[38]=F):F=e[38],F}let T;e[39]!==i||e[40]!==o.slug||e[41]!==O||e[42]!==s?(T=O||!i?null:fr(pr(o.slug,s,i)),e[39]=i,e[40]=o.slug,e[41]=O,e[42]=s,e[43]=T):T=e[43];const L=T;let D="/",A=null,M=null;O?.kind==="page"?(D=O.path,A=O.key):O?.kind==="section"?M=O.key:L&&(D=L.path,A=L.pageKey);const H=A?`page:${A}`:M?`section:${M}`:`path:${D}`;let X;e[44]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(Tt,{className:"size-5 text-muted-foreground"})}),e[44]=X):X=e[44];const V=i??"",J=x??void 0,q=M?null:d,G=!!A&&p.state.editSeoPageKey===A;let Y;return e[45]!==M||e[46]!==A||e[47]!==D||e[48]!==H||e[49]!==a||e[50]!==o.slug||e[51]!==q||e[52]!==G||e[53]!==V||e[54]!==J||e[55]!==s||e[56]!==p.consumeEditSeo||e[57]!==p.setFocusedBlock||e[58]!==p.setVariantOverride?(Y=R(n.jsx(C.Suspense,{fallback:X,children:n.jsx(ac,{orgSlug:o.slug,virtualMcpId:s,branch:V,previewReady:!0,previewUrl:J,currentPath:D,activePageBlockKey:A,activeGlobalBlockKey:M,externalSelection:q,initialEditSeo:G,onExitSeo:p.consumeEditSeo,onVariantPreviewOverride:p.setVariantOverride,onFocusedBlockChange:p.setFocusedBlock,onViewJsonFile:a},H)})),e[45]=M,e[46]=A,e[47]=D,e[48]=H,e[49]=a,e[50]=o.slug,e[51]=q,e[52]=G,e[53]=V,e[54]=J,e[55]=s,e[56]=p.consumeEditSeo,e[57]=p.setFocusedBlock,e[58]=p.setVariantOverride,e[59]=Y):Y=e[59],Y}function oc(t){return n.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function Zn(t){const e=ce.c(51),{virtualMcpId:s,pageKey:r,onClose:a,ref:d}=t,o=Pe(),i=ur(),c=i===!0,l=So(s);let m;e[0]!==l||e[1]!==r?(m=Po(l,ui(r)),e[0]=l,e[1]=r,e[2]=m):m=e[2];const p=m,{org:f}=zs(),{currentBranch:x,taskId:h}=Lt(),g=Rt().previewUrl;let b;e[3]!==x||e[4]!==f.slug||e[5]!==g||e[6]!==h||e[7]!==s?(b=x?{orgSlug:f.slug,virtualMcpId:s,branch:x,threadId:h??null,previewUrl:g}:null,e[3]=x,e[4]=f.slug,e[5]=g,e[6]=h,e[7]=s,e[8]=b):b=e[8];const y=Ks(b),v=x??"";let P;e[9]!==f.slug||e[10]!==v||e[11]!==s?(P={orgSlug:f.slug,virtualMcpId:s,branch:v},e[9]=f.slug,e[10]=v,e[11]=s,e[12]=P):P=e[12];let E;e[13]===Symbol.for("react.memo_cache_sentinel")?(E={holdsCopy:!0},e[13]=E):E=e[13];const{save:k,flush:S,hold:R}=Ua(P,E),O=x??"";let T;e[14]!==f.slug||e[15]!==O||e[16]!==s?(T=Ko({orgSlug:f.slug,virtualMcpId:s,branch:O}),e[14]=f.slug,e[15]=O,e[16]=s,e[17]=T):T=e[17];const L=Io(T);let D;e[18]!==r||e[19]!==L?(D=L(r),e[18]=r,e[19]=L,e[20]=D):D=e[20];const A=D;let M;e[21]!==A||e[22]!==r?(M={pageKey:r,copyEpoch:A},e[21]=A,e[22]=r,e[23]=M):M=e[23];const[H,X]=C.useState(M);(H.pageKey!==r||H.copyEpoch!==A)&&(X({pageKey:r,copyEpoch:A}),R(r));const V=y.data?.[r],J=y.data===void 0&&y.isLoading||i===void 0,q=y.data!==void 0&&V===void 0,G=!x||q||J;let Y;e[24]!==V?(Y=V===void 0?"":JSON.stringify(V,null,2),e[24]=V,e[25]=Y):Y=e[25];const _=Y;let $;e[26]!==r||e[27]!==G||e[28]!==k?($=K=>{if(G)return;let te;try{te=JSON.parse(K)}catch{return}te===null||typeof te!="object"||Array.isArray(te)||k(r,te)},e[26]=r,e[27]=G,e[28]=k,e[29]=$):$=e[29];const F=$;let I;e[30]!==S?(I=()=>({flush:S}),e[30]=S,e[31]=I):I=e[31],C.useImperativeHandle(d,I);let B;e[32]!==p||e[33]!==c||e[34]!==a||e[35]!==o?(B=c?n.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:n.jsx("span",{title:p,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:p})}):n.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:o("sectionsEditor.pageJsonDialog.titleShort")}),n.jsx(Me,{variant:"ghost",size:"icon-sm",onClick:a,"aria-label":o("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:n.jsx(Ra,{size:14})})]}),e[32]=p,e[33]=c,e[34]=a,e[35]=o,e[36]=B):B=e[36];let z;e[37]!==A||e[38]!==y.data||e[39]!==S||e[40]!==_||e[41]!==J||e[42]!==q||e[43]!==r||e[44]!==G||e[45]!==F||e[46]!==o?(z=J?n.jsx("div",{className:"flex flex-1 items-center justify-center",children:n.jsx(Tt,{className:"size-5 text-muted-foreground"})}):q?n.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",o("sectionsEditor.pageJsonDialog.pageNotFound")]}):n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(di,{code:_,language:"json",readOnly:G,height:"100%",onChange:K=>F(K??""),onSave:K=>{F(K),S()}},`${r}:${y.data===void 0?"loading":"ready"}:${A}`)}),e[37]=A,e[38]=y.data,e[39]=S,e[40]=_,e[41]=J,e[42]=q,e[43]=r,e[44]=G,e[45]=F,e[46]=o,e[47]=z):z=e[47];let W;return e[48]!==B||e[49]!==z?(W=n.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[B,z]}),e[48]=B,e[49]=z,e[50]=W):W=e[50],W}function Vr(t){return t.contentEditingEnabled&&!t.isMobile}function ic(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function lc(t,e){return t==="blocks"?"preview":e?"blocks":t}function cc(t){return Vr({contentEditingEnabled:_r(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function dc(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function uc(t){const e=ri(t),{display:s}=t;let r=null;if(s.mode==="production"&&s.iframeBase)try{r=new URL(t.path,s.iframeBase).href}catch{r=null}const a=ai(r,e);return{value:e,frame:a?Bs(a,t.device):null,newTab:a}}function fc(t){const e=ce.c(90),{tests:s,options:r,onChange:a,available:d}=t,o=Pe();let i;e[0]!==r?(i=Dr(r),e[0]=r,e[1]=i):i=e[1];const c=i;let l;e[2]!==r.tests?(l=r.tests??{},e[2]=r.tests,e[3]=l):l=e[3];const m=l;let p;e[4]!==a||e[5]!==r?(p=K=>{const te=K?Ho(K):null,{at:se,...ee}=r;a(te?{...ee,at:te}:ee)},e[4]=a,e[5]=r,e[6]=p):p=e[6];const f=p;let x;e[7]!==m||e[8]!==a||e[9]!==r?(x=(K,te)=>{const se={...m};te==="on"?se[K]=!0:te==="off"?se[K]=!1:delete se[K];const{tests:ee,...ae}=r;a(Object.keys(se).length>0?{...ae,tests:se}:ae)},e[7]=m,e[8]=a,e[9]=r,e[10]=x):x=e[10];const h=x;let j;e[11]!==o?(j=o("sandbox.previewAs.label"),e[11]=o,e[12]=j):j=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(so,{size:16}),e[13]=g):g=e[13];let b;e[14]!==c||e[15]!==j?(b=n.jsx(lt,{asChild:!0,children:n.jsx(xr,{asChild:!0,children:n.jsx(We,{"aria-label":j,active:c,"data-testid":"preview-as-trigger",children:g})})}),e[14]=c,e[15]=j,e[16]=b):b=e[16];let N;e[17]!==o?(N=o("sandbox.previewAs.label"),e[17]=o,e[18]=N):N=e[18];let y;e[19]!==N?(y=n.jsx(ct,{children:N}),e[19]=N,e[20]=y):y=e[20];let v;e[21]!==b||e[22]!==y?(v=n.jsxs(dt,{children:[b,y]}),e[21]=b,e[22]=y,e[23]=v):v=e[23];let P;e[24]!==o?(P=o("sandbox.previewAs.label"),e[24]=o,e[25]=P):P=e[25];let E;e[26]!==P?(E=n.jsx("h3",{className:"text-sm font-medium",children:P}),e[26]=P,e[27]=E):E=e[27];let k;e[28]!==d||e[29]!==o?(k=o(d?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[28]=d,e[29]=o,e[30]=k):k=e[30];let S;e[31]!==k?(S=n.jsx("p",{className:"text-xs text-muted-foreground",children:k}),e[31]=k,e[32]=S):S=e[32];let R;e[33]!==E||e[34]!==S?(R=n.jsxs("div",{className:"flex flex-col gap-1",children:[E,S]}),e[33]=E,e[34]=S,e[35]=R):R=e[35];let O;e[36]!==o?(O=o("sandbox.previewAs.momentLabel"),e[36]=o,e[37]=O):O=e[37];let T;e[38]!==O?(T=n.jsx(pi,{htmlFor:"preview-as-moment",children:O}),e[38]=O,e[39]=T):T=e[39];let L;e[40]!==r.at?(L=Uo(r.at),e[40]=r.at,e[41]=L):L=e[41];let D;e[42]!==f?(D=K=>f(K.target.value),e[42]=f,e[43]=D):D=e[43];let A;e[44]!==L||e[45]!==D?(A=n.jsx(Rs,{id:"preview-as-moment",type:"datetime-local",className:Vo,value:L,onChange:D}),e[44]=L,e[45]=D,e[46]=A):A=e[46];const M=r.at===void 0;let H;e[47]!==f?(H=()=>f(""),e[47]=f,e[48]=H):H=e[48];let X;e[49]!==o?(X=o("sandbox.previewAs.now"),e[49]=o,e[50]=X):X=e[50];let V;e[51]!==M||e[52]!==H||e[53]!==X?(V=n.jsx(Me,{type:"button",variant:"ghost",size:"sm",disabled:M,onClick:H,children:X}),e[51]=M,e[52]=H,e[53]=X,e[54]=V):V=e[54];let J;e[55]!==A||e[56]!==V?(J=n.jsxs("div",{className:"flex items-center gap-2",children:[A,V]}),e[55]=A,e[56]=V,e[57]=J):J=e[57];let q;e[58]!==o?(q=o("sandbox.previewAs.momentHint"),e[58]=o,e[59]=q):q=e[59];let G;e[60]!==q?(G=n.jsx("p",{className:"text-xs text-muted-foreground",children:q}),e[60]=q,e[61]=G):G=e[61];let Y;e[62]!==T||e[63]!==J||e[64]!==G?(Y=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[T,J,G]}),e[62]=T,e[63]=J,e[64]=G,e[65]=Y):Y=e[65];let _;e[66]!==o?(_=o("sandbox.previewAs.testsLabel"),e[66]=o,e[67]=_):_=e[67];let $;e[68]!==_?($=n.jsx("span",{className:"text-sm font-medium",children:_}),e[68]=_,e[69]=$):$=e[69];let F;e[70]!==m||e[71]!==h||e[72]!==o||e[73]!==s?(F=s.length===0?n.jsx("p",{className:"text-xs text-muted-foreground",children:o("sandbox.previewAs.noTests")}):n.jsxs(n.Fragment,{children:[n.jsx("ul",{className:"flex flex-col gap-1.5",children:s.map(K=>n.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[n.jsx("span",{className:"min-w-0 truncate text-sm",children:K}),n.jsxs(mi,{type:"single",variant:"outline",size:"sm",value:m[K]===void 0?"":m[K]?"on":"off",onValueChange:te=>h(K,te),"aria-label":K,children:[n.jsx(Fn,{value:"off",children:o("sandbox.previewAs.off")}),n.jsx(Fn,{value:"on",children:o("sandbox.previewAs.on")})]})]},K))}),n.jsx("p",{className:"text-xs text-muted-foreground",children:o("sandbox.previewAs.testsHint")})]}),e[70]=m,e[71]=h,e[72]=o,e[73]=s,e[74]=F):F=e[74];let I;e[75]!==$||e[76]!==F?(I=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[$,F]}),e[75]=$,e[76]=F,e[77]=I):I=e[77];let B;e[78]!==c||e[79]!==a||e[80]!==o?(B=c&&n.jsx(Me,{type:"button",variant:"outline",size:"sm",onClick:()=>a({}),children:o("sandbox.previewAs.reset")}),e[78]=c,e[79]=a,e[80]=o,e[81]=B):B=e[81];let z;e[82]!==R||e[83]!==Y||e[84]!==I||e[85]!==B?(z=n.jsxs(br,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[R,Y,I,B]}),e[82]=R,e[83]=Y,e[84]=I,e[85]=B,e[86]=z):z=e[86];let W;return e[87]!==v||e[88]!==z?(W=n.jsxs(yr,{children:[v,z]}),e[87]=v,e[88]=z,e[89]=W):W=e[89],W}const pc=15e3;function mc(t,e,s){return s?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 hc=500,gc={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},tr=1,Qt=["desktop","mobile","tablet"],vc=["preview","visual","blocks"],sr={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function xc(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 Ls(t,e){try{return new URL(t,e).href}catch{return null}}function bc(t,e){if(!e.inPlaceRenderActive)return{pin:e.draftPreviewUrl?{path:e.resolvedPath,url:e.draftPreviewUrl}:null,effective:e.draftPreviewUrl};if(e.draftPreviewUrl!==null&&t?.path!==e.resolvedPath){const s={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:s,effective:s.url}}return{pin:t,effective:t?.url??null}}function yc(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function wc(t,e,s){const r=t.toLowerCase(),a=e.toLowerCase(),d=a.split("/").filter(Boolean),o=c=>{if(c===s)return 100;const l=c.indexOf(s);if(l===-1)return 0;let m=40;return l===0?m+=30:/[\s/-]/.test(c[l-1]??"")&&(m+=20),m+=Math.round(s.length/c.length*20),m};let i=Math.max(o(r),o(a));return d.at(-1)===s?i=Math.max(i,95):d.includes(s)&&(i=Math.max(i,90)),i}function kc(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Sc({virtualMcpId:t}){const e=Pe(),s=Tr(),{currentBranch:r,taskId:a,virtualMcpId:d}=Lt(),o=!!Ja(),i=Or(),c=co(d===t?t:null),l=jr(t),m=gi(c?.metadata?.ui?.layout??null),p=_r(m),f=Vr({contentEditingEnabled:p,isMobile:s}),[x]=C.useState(()=>cc({cmsMode:m,isMobile:s})),[h,j]=As(_s.previewEditingMode(t),u=>u&&vc.includes(u)?u:null),g=h??x,[b,N]=As(_s.previewDeviceSize(t),u=>u&&Qt.includes(u)?u:"desktop"),[y,v]=C.useState(null),[P,E]=C.useState(null),k=C.useRef(null),S=C.useRef(null),[R,O]=C.useState(!1),T=C.useRef(null),L=()=>{T.current?.flush(),O(!1)},D=()=>O(u=>(u&&T.current?.flush(),!u)),[A,M]=C.useState({width:0,height:0}),[H,X]=C.useState(!1),[V,J]=C.useState({}),[q,G]=C.useState(""),Y=C.useRef(null),[_,$]=C.useState(!1),[F,I]=C.useState(),[B,z]=C.useState(null),[W,K]=C.useState(null),[te,se]=C.useState(null),[ee,ae]=C.useState(()=>i.state.target?.kind==="page"?i.state.target.path:"/"),[pe,de]=C.useState(()=>i.state.target?.kind==="page"?i.state.target.key:null),[ve,ue]=C.useState({}),[xe,me]=C.useState(!1),ge=C.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:ie}=zs(),Ne=Us(),Fe=Rt(),ze=Fe.vmEntry,Be=Ne.lifecycle.phase,{url:ut,undecided:Je}=Nr(t),he=ss(t,r),{connection:Le}=Cr(t),_e=fi(t),Ke=jo({hasServeConnection:!!Le,runtime:l.runtime}),ne=Je||Ke==="github"&&(_e==="loading"||_e==="error"),oe=!at(he)&&!ne&&!(Ke==="github"&&he.kind==="pending"),ke=He(he)??ut,Ie=ke??Fe.previewUrl,ft=!!ke||Be==="running",Ye=c?.id===t?mo(c.metadata):null,pt=!ke&&!Je&&c?.id===t&&l.runtime==="cms",qr=l.projectDefault==="cms",mt=oe?si({sandboxUrl:Ie,previewServerUrl:Ye,fastPreviewActive:pt}):null,Vs=t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r,threadId:a??null,previewUrl:Ie}:null,qs=Ks(Vs,{fetchEnabled:ft}),ns=Lr(Vs,{fetchEnabled:ft}),le=qs.data,Se=ns.data,Qe=le?Wo(le,Se).sort((u,w)=>u.name.localeCompare(w.name)):[],Ws=t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r}:null,Gs=Xl(Ws),rs=le&&Se?Go(le,Se):[],Js=oe&&le&&Se?Ha(Se,le,"loaders"):[],Ys=q?(()=>{const u=q.toLowerCase();return Qe.map(w=>({page:w,score:wc(w.name,w.path,u)})).filter(({score:w})=>w>0).sort((w,U)=>U.score-w.score||w.page.path.length-U.page.path.length).map(({page:w})=>w)})():Qe,Qs=rs.filter(u=>{if(!q)return!0;const w=q.toLowerCase();return u.name.toLowerCase().includes(w)||u.key.toLowerCase().includes(w)||u.resolveType.toLowerCase().includes(w)}),Xs=f?Js:[],Zs=Xs.filter(u=>{if(!q)return!0;const w=q.toLowerCase();return u.title.toLowerCase().includes(w)||u.key.toLowerCase().includes(w)||u.resolveType.toLowerCase().includes(w)}),At=W?Js.find(u=>u.key===W)??null:null,Oe=Is,as=B||W?null:Jo(Qe,ee,pe),re=as?.key??null,Xe=i.state.target?.kind==="section"?i.state.target.key:i.state.focusedBlockKey??re,_t=as?.path??null,Ze=(re?ve[re]:void 0)??{},Ee=Ve(ee,Ze),os={};if(oe&&ft&&Ie&&Se&&le){const u=Va(Se,"loaders"),w=re?le[re]:void 0,U=bl(w,le,be=>u.has(be)),Z=ml(U);for(const be of Ct(ee)){if(be.type!=="param")continue;const $e=ul(ee,be.name,U),Te=vl($e,u,Z);Te.length>0&&(os[be.name]=Te)}}const Ot=t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r,threadId:a??null}:null,en=le&&re?Yo(le,re,0):[],tn=at(he),sn=le?Qo(en,le,tn):[],is=sn.map(u=>u.isSavedBlock?u.label:""),ls=sn.map(u=>u.isSavedBlock?"global":u.isMultivariate?"variant":"normal"),cs=en.map(u=>$s(u,le??{},tn)),Dt=C.useRef(null),Re=C.useRef(null),Wr=Ne.status.state==="paused",ds=Ne.phase,nn=qa({claimPhase:ds,lifecycle:Ne.lifecycle}),qe=Fe.previewState,Gr=Fe.userStopped,Jr=Eo(ie.slug,t??""),{url:Ue}=oi(pt&&t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r,previewServerUrl:Ye??null,path:Ee}:null),Yr=qr&&l.runtime==="sandbox",Ce=No(he,Ke,_e),rn=Co(Ce&&pt&&he.kind==="protocol"&&t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r}:null),an=Ce?rn.pointer:null,Q=Gi({previewState:qe,progressStatus:nn.status,previewServerUrl:Ye,fastPreviewActive:pt,fastPreviewReady:!!Ue,codingSession:Yr,localPreviewUrl:ke,hostedDraft:Ce,hostedPointerPending:Ce&&(he.kind==="pending"||rn.pending),deciding:ne}),on=Q.showWakingPill||Ce&&Q.mode==="production"&&!an,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=oe?ke?Q.mode==="sandbox"&&f&&g==="blocks":Q.mode==="production"&&pt&&Xr&&f&&g==="blocks":!1,ln=C.useRef(null),{pin:Zr,effective:ea}=bc(ln.current,{inPlaceRenderActive:gt,draftPreviewUrl:Ue,resolvedPath:Ee});ln.current=Zr;const cn=i.state.variantOverride??[],Bt=oe?cn:[],vt=oe?[]:cn,us=at(he)&&Xo.some(u=>Zo(Se,u)==="available"),tt=us?V:{},dn=Dr(tt),ta=us&&le?Object.keys(ei(le).experiments):[],$t=Ce?uc({display:Q,path:Ee,pointer:an,device:b,forcedVariants:vt,previewOptions:tt}):null,st=t?Tn(ie.slug,t):null,un=JSON.stringify([vt,tt]);C.useEffect(()=>{if(!Ce||!st)return;const[u,w]=JSON.parse(un);Bn(st,{forcedVariants:u,previewOptions:w})},[Ce,st,un]),C.useEffect(()=>{if(!(!Ce||!st))return()=>Bn(st,null)},[Ce,st]);const fs=Le&&He(he)?Do(Le.endpoint,vt,dn):null,sa=Le&&He(he)?fs?hi(fs,tt):_n:null,nt=xc(Q.mode==="sandbox"?Wt(Bs(On(te??Ls(Ee,Q.iframeBase)??Q.iframeBase,sa),b),Bt):Q.mode==="production"&&$t?.frame?$t.frame:Q.mode==="production"?Wt(Bs(zn(Rn(On(te??ea??Ls(Ee,Q.iframeBase)??Q.iframeBase,on?_n:null),vt),tt),b),Bt):null),fn=Ue??(Q.iframeBase?Ls(Ee,Q.iframeBase):null),pn=Q.mode==="production"&&$t?$t.newTab:Q.mode==="production"?fn?Wt(zn(Rn(fn,vt),tt),Bt):null:nt??Q.iframeBase,na=()=>{const u=pn;u&&window.open(u,"_blank","noopener")},xt=t&&r?pr(ie.slug,t,r):null,bt=u=>{xt&&Qa(xt,u)},ye=i.state.target;C.useEffect(()=>{if(!(!ye||!mt||!Se))if(ye.kind==="page"){const u=ve[ye.key]??{};Re.current=Ve(ye.path,u),z(null),K(null),se(null),de(ye.key),ae(ye.path),bt({path:ye.path,pageKey:ye.key,params:u})}else if(ye.kind==="loader")Re.current=null,z(null),K(ye.key),se(null);else{const u=rs.find(w=>w.key===ye.key);if(u){Re.current=null;const w=An(Se);K(null),z(u),se(Dn(mt,w,u.key))}}},[ye,mt,Se,ve]),C.useEffect(()=>{!re||_t===null||ye?.kind==="page"&&ye.key===re&&ye.path===_t||i.selectTarget({kind:"page",key:re,path:_t})},[re,_t,ye]);const[mn,ra]=C.useState(null);if(qe.kind==="iframe"&&mn!==qe.previewUrl){const u=mn!==null;ra(qe.previewUrl);const w=xt?fr(xt):null;if(w){if(Re.current=Ve(w.path,w.params),ae(w.path),de(w.pageKey),se(null),z(null),K(null),w.pageKey&&Object.keys(w.params).length>0){const U=w.pageKey;ue(Z=>({...Z,[U]:w.params}))}}else u&&(Re.current=null,ae("/"),se(null),de(null),z(null),K(null))}Dt.current=nt;const aa=Q.mode==="production"&&!!Ue&&!ke,[hn,ps]=C.useState({src:nt??void 0,loading:!1}),Mt=mc(hn,nt??void 0,aa);Mt!==hn&&ps(Mt);const yt=Mt.src,gn=Mt.loading,vn=Xi({iframeRef:k,src:Q.mode==="sandbox"?nt:null,active:Q.mode==="sandbox"}),xn=C.useRef(null);C.useEffect(()=>{const u=gn?setTimeout(()=>ps(er),pc):null,w=()=>{u&&clearTimeout(u)};if(!Ue||!yt||xn.current===Ue)return w;xn.current=Ue;const U=k.current;return U&&U.getAttribute("src")!==yt&&(je(),U.src=yt),w},[Ue,yt,gn]);const bn=()=>{const u=k.current?.contentWindow,w=et;if(!u||!w||!le||!re)return;const U=le[re];if(!U||typeof U!="object")return;const Z=ni({previewBaseUrl:w,pageBlock:U,decofile:le,path:Ee,pathTemplate:ee});if(!Z)return;const be=Wt(Z.src,Oo(Bt,re));u.postMessage({type:"cms-editor::render",src:be,body:Z.body},w)},ms=C.useRef(null);C.useEffect(()=>{if(!gt||B||W||!re||!le){ms.current=null;return}const u={nav:JSON.stringify({page:re,path:Ee,pathTemplate:ee}),content:JSON.stringify(le)},w=yc(ms.current,u);ms.current=u,w&&bn()},[le,gt,B,W,re,Ee,ee]);const hs=C.useRef(null);C.useEffect(()=>{if(!gt||B||W||!re||!le){hs.current=null;return}const u=JSON.stringify(i.state.variantOverride??null),w=hs.current;hs.current={page:re,sig:u},!(!w||w.page!==re||w.sig===u)&&bn()},[i.state.variantOverride,gt,B,W,re]);const oa=!!t&&!!r&&!Ne.notFound&&!Gr&&!Wr&&(ds?.kind==="ready"||Be!=="idle"),we=dc({editingMode:g,sandboxDisplay:Q.mode==="sandbox",blocksEditingEnabled:f});C.useEffect(()=>{const u=et;if(!u)return;const w=U=>{if(U.origin===u)if(U.data?.type==="visual-editor::element-clicked"){const Z=sl.safeParse(U.data.payload);Z.success&&v(Z.data)}else if(U.data?.type==="cms-editor::section-clicked"){const Z=al.safeParse(U.data.payload);Z.success&&E({index:Z.data.sectionIndex,seq:Z.data.clickSeq})}else U.data?.type==="cms-editor::render-start"?je():U.data?.type==="cms-editor::render-end"?(fe(),k.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:is,kinds:ls,keys:cs},u)):U.data?.type==="cms-editor::render-error"&&fe()};return window.addEventListener("message",w),()=>window.removeEventListener("message",w)},[et,is,ls,cs]);const yn=()=>{const u=k.current?.contentWindow,w=jt(Ie);!u||!w||u.postMessage({type:"visual-editor::activate",script:nl},w)},ia=()=>{const u=k.current?.contentWindow,w=jt(Ie);!u||!w||u.postMessage({type:"visual-editor::deactivate"},w)},gs=()=>{const u=k.current?.contentWindow,w=et;!u||!w||(u.postMessage(Q.mode==="production"||ke?{type:"editor::inject",args:{script:Wn}}:{type:"visual-editor::activate",script:Wn},w),u.postMessage({type:"cms-editor::set-labels",labels:is,kinds:ls,keys:cs},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"&&!f)return;const w=g;!s&&u!==w&&(u==="blocks"?S.current?.resize("30%"):S.current?.collapse()),j(u),v(null),E(null),u!=="blocks"&&K(null),w==="visual"&&ia(),u==="visual"&&yn(),w==="blocks"&&u!=="blocks"&&la(),u==="blocks"&&gs()},da=()=>{Ft(ic(g,f))},ua=()=>{Ft(lc(g,f))},vs=()=>{const u=k.current;if(!u)return;je();const w=document.activeElement,U=u.tabIndex;u.tabIndex=-1,u.style.pointerEvents="none",u.blur(),kc(u,Dt.current);let Z;const be=()=>{clearTimeout(Z),u.tabIndex=U,u.style.pointerEvents="";const $e=document.activeElement;(!$e||$e===document.body||$e===u)&&w?.focus(),u.removeEventListener("load",be)};u.addEventListener("load",be),Z=setTimeout(be,3e3)};li(vs);const zt=Tn(ie.slug,t??""),Kt=Ce&&ht&&!!t,wn=C.useRef(null);C.useEffect(()=>{if(Kt)return To(zt)},[Kt,zt]);const{reload:wt}=Lo(ie.slug,t??""),kn=C.useRef(wt.seq);C.useEffect(()=>{if(kn.current!==wt.seq&&(kn.current=wt.seq,!!Kt&&wn.current===Dt.current)){if(wt.navigates){Ln(zt);return}vs()}},[wt.seq]);const fa=Ro(Ws),kt=Ao(He(he)?fa:""),Sn=C.useRef(kt);C.useEffect(()=>{const u=Sn.current;if(Sn.current=kt,!u||!kt||u===kt)return;const w=k.current;if(w)return tl({iframe:w,reload:vs})},[kt]);const pa=()=>{const u=Qt.indexOf(b);N(Qt[(u+1)%Qt.length])},xs=(u,w)=>{if(!re)return;const U=re,Z={...Ze,[u]:w};Re.current=Ve(ee,Z),ue(be=>({...be,[U]:Z})),bt({path:ee,pageKey:U,params:Z})},ma=Wl({iframeBase:Q.iframeBase,resolvedPath:Ee,activeGlobalSectionName:B?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),bs=u=>{const w=ve[u.key]??{},U=Ve(u.path,w);(B||Oe(U)!==Oe(Ee))&&je(),Re.current=U,z(null),K(null),se(null),E(null),de(u.key),ae(u.path),bt({path:u.path,pageKey:u.key,params:w}),i.selectTarget({kind:"page",key:u.key,path:u.path})};Ya(xt,u=>{(B||Oe(u)!==Oe(Ee))&&je(),Re.current=u,z(null),K(null),se(null),E(null),de(null),ae(u),bt({path:u,pageKey:null,params:{}})});const ha=u=>{if(at(he)){const Z=le?ti(le,u.key,Se):null;Z?bs(Z):Zt.info(e("sandbox.preview.blockOnNoPage"));return}if(!mt||!Se){Zt.error(e("sandbox.preview.previewMetadataNotReady"));return}je(),Re.current=null;const w=An(Se),U=Dn(mt,w,u.key);z(u),K(null),se(U),E(null),i.selectTarget({kind:"section",key:u.key})},ga=u=>{f&&(z(null),K(u.key),se(null),Ft("blocks"),i.selectTarget({kind:"loader",key:u.key}))},va=async({name:u,path:w,templateKey:U})=>{if(!t||!r)return;const Z=Ar(w);if(Z){I(Z);return}const be=w.trim().startsWith("/")?w.trim():`/${w.trim()}`;if(Qe.some(Te=>Oe(Te.path)===Oe(be))){I(e("sandbox.preview.pageAlreadyExists",{path:be}));return}let $e;if(U&&($e=le?.[U],!$e)){I(e("sandbox.preview.templateNoLongerExists"));return}I(void 0);try{const Te=await Gs.mutateAsync({name:u,path:be,template:$e,schema:at(he)?{meta:Se,loadMeta:async()=>(await ns.refetch()).data}:void 0});$(!1),Zt.success(e("sandbox.preview.pageCreated",{name:u})),await xi(hc),bs({key:Te.key,name:Te.name,path:Te.path}),Ft("blocks")}catch(Te){I(Te instanceof Hr?e("sandbox.preview.pageSchemaNotReady"):Te instanceof Error?Te.message:e("sandbox.preview.failedToCreatePage"))}},It=Gl({previewSurfaceActive:ht,daemonReady:oa,production:Q.mode==="production",servePreviewUrl:He(he)}),xa=Jl({showPreviewToolbar:It,contentEditingEnabled:p}),Ut=()=>{X(!1),G("")},ys=B?.name??At?.title??as?.name,ws=qs.isPending||ns.isPending,ks=ws?jt(Q.iframeBase):ys,Ht=B?`section:${B.key}`:W?`loader:${W}`:re?`page:${re}`:void 0,ba=It?xa?n.jsxs(yr,{open:H,onOpenChange:u=>{X(u),u||G("")},children:[n.jsx(xr,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:ws?ks??void 0:B||At?ys:[ys,ee].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:n.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:[B&&n.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:[n.jsx(no,{size:11}),e("sandbox.preview.globalBadge")]}),At&&n.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:[n.jsx(ro,{size:11}),e("sandbox.preview.loaderBadge")]}),ks&&n.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:ks}),!ws&&!B&&!At&&n.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:ee}),n.jsx(Xa,{size:12,className:De("shrink-0 transition-transform",H&&"rotate-180")})]})})}),n.jsxs(br,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[n.jsxs(kr,{shouldFilter:!1,defaultValue:Ht,children:[n.jsx(Sr,{value:q,onValueChange:u=>{G(u),Y.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),n.jsxs(wr,{ref:Y,className:"max-h-80",children:[n.jsx(Pr,{children:Qe.length===0&&rs.length===0&&Xs.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),Ys.length>0&&n.jsx(Et,{children:Ys.map(u=>n.jsxs(Nt,{value:`page:${u.key}`,"aria-current":Ht===`page:${u.key}`||void 0,title:`${u.name} · ${u.path}`,onSelect:()=>{Ut(),bs(u)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:u.name}),n.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))}),Qs.length>0&&n.jsx(Et,{heading:e("sandbox.preview.globalComponents"),children:Qs.map(u=>n.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:n.jsx("span",{className:"truncate",children:u.name})},u.key))}),Zs.length>0&&n.jsx(Et,{heading:e("sandbox.preview.globalLoaders"),children:Zs.map(u=>n.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:n.jsx("span",{className:"truncate",children:u.title})},u.key))})]})]}),!B&&!W&&Ct(ee).some(u=>u.type!=="text")&&n.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:Ct(ee).map((u,w)=>{if(u.type==="text")return n.jsx("span",{children:u.text},`text-${w}`);const U=os[u.name];return U&&Ot?n.jsx(Ol,{sources:U,template:ee,paramName:u.name,value:Ze[u.name]??"",sandboxRef:Ot,onCommit:Z=>xs(u.name,Z)},`${re}:${u.name}`):n.jsx(Vl,{name:u.name,value:Ze[u.name]??"",onCommit:Z=>xs(u.name,Z)},`${re}:${u.name}`)})}),n.jsx("div",{className:"border-t p-1.5",children:n.jsxs(Me,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Ut(),I(void 0),$(!0)},children:[n.jsx(vr,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):n.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:ma}):null,Pn=It||p?n.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[n.jsxs(dt,{children:[n.jsx(lt,{asChild:!0,children:n.jsx(We,{onClick:pa,"aria-label":e(sr[b]),children:b==="mobile"?n.jsx(hr,{size:16}):b==="tablet"?n.jsx(ao,{size:16}):n.jsx(gr,{size:16})})}),n.jsx(ct,{children:e(sr[b])})]}),ba,n.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[us&&n.jsx(fc,{tests:ta,options:V,onChange:J,available:!!fs||!on||!dn}),n.jsx(We,{onClick:na,disabled:Ce&&!pn,"aria-label":e("sandbox.preview.openInNewTab"),children:n.jsx(cr,{size:16})})]})]}):null,ya=(oe||o)&&Q.mode==="sandbox",Vt=gc[b],qt=b==="desktop"&&(A.width===0||A.width>=Vt.width+2*tr),jn=qt?1:Math.min(A.width>0?A.width/(Vt.width+2*tr):1,1),wa=qt?{width:"100%",height:"100%"}:{width:`${Vt.width}px`,height:A.height>0?`${A.height/jn}px`:`${Vt.height}px`,transform:`scale(${jn})`,transformOrigin:"top center"},En=n.jsxs(n.Fragment,{children:[ya&&(It||p)&&n.jsx(We,{onClick:da,"aria-pressed":we==="visual","aria-label":e("sandbox.preview.visualEditor"),active:we==="visual",children:n.jsx(Cn,{size:16})}),f&&n.jsxs(dt,{children:[n.jsx(lt,{asChild:!0,children:n.jsx(We,{onClick:ua,"aria-pressed":we==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:we==="blocks",children:n.jsx(io,{size:16})})}),n.jsx(ct,{children:e("sandbox.preview.blocksEditor")})]}),Xe&&n.jsxs(dt,{children:[n.jsx(lt,{asChild:!0,children:n.jsx(We,{onClick:D,"aria-pressed":R,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:R,children:n.jsx(oo,{size:16})})}),n.jsx(ct,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),ka=!!W&&we==="blocks";return n.jsxs("div",{className:"flex flex-col w-full h-full",children:[Ot&&Object.entries(os).map(([u,w])=>(Ze[u]??"")===""?n.jsx(Ul,{sources:w,template:ee,paramName:u,sandboxRef:Ot,onFill:U=>xs(u,U)},`${re}:${u}`):null),n.jsxs(n.Fragment,{children:[n.jsx(Os.Toolbar.Center.Portal,{fallback:n.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:Pn}),children:Pn}),n.jsx(Os.Toolbar.Right.Portal,{fallback:En,children:En})]}),n.jsx("div",{className:"flex-1 overflow-hidden relative",children:ka?n.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[n.jsx(Xn,{virtualMcpId:t,externalSelection:P,onViewJsonFile:D}),R&&Xe&&n.jsx("div",{className:"absolute inset-0 z-10",children:n.jsx(Zn,{ref:T,virtualMcpId:t,pageKey:Xe,onClose:L})})]}):n.jsxs($n,{orientation:"horizontal",disabled:we!=="blocks",className:"relative isolate",children:[n.jsx(Gt,{ref:S,id:"preview-blocks-editor",defaultSize:we==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:we==="blocks"&&n.jsx(Xn,{virtualMcpId:t,externalSelection:P,onViewJsonFile:D})}),we==="blocks"&&n.jsx(Mn,{withHandle:!0}),n.jsx(Gt,{id:"preview-canvas",defaultSize:we==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:n.jsxs($n,{orientation:"horizontal",disabled:!(R&&Xe),children:[n.jsx(Gt,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:n.jsxs("div",{ref:u=>{if(!u)return;const w=()=>M(Z=>Z.width===u.clientWidth&&Z.height===u.clientHeight?Z:{width:u.clientWidth,height:u.clientHeight});w();const U=new ResizeObserver(w);return U.observe(u),()=>U.disconnect()},className:De("h-full relative overflow-clip flex justify-center",ht&&!qt&&"bg-muted/30"),children:[(xe||Jr)&&ht&&n.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:n.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&&n.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:n.jsx(Tt,{className:"size-5 text-muted-foreground"})}),Q.showBlockingOverlay&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(Ps,{kind:"starting",progress:nn,claimPhase:ds})}),!ke&&!ne&&qe.kind==="suspended"&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(Ps,{kind:"suspended",onResume:Fe.resume})}),!ke&&!ne&&qe.kind==="errored"&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(Ps,{kind:"errored",error:qe.error,onRetry:Fe.retry,connectionsHref:`/${ie.slug}/settings/connections`})}),Q.showWakingPill&&n.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:[n.jsx(Tt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),we==="visual"&&!y&&n.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:[n.jsx(Cn,{size:12}),e("sandbox.preview.clickElementToAsk")]}),we==="visual"&&y&&n.jsx(ll,{element:y,onDismiss:()=>v(null)}),ht&&nt&&n.jsx("div",{className:De("shrink-0",!qt&&"bg-background shadow-edge"),style:wa,onMouseLeave:ca,children:n.jsx("iframe",{ref:k,src:yt,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:vn.handleError,onLoad:()=>{if(ps(er),vn.handleLoad(),fe(),wn.current=Dt.current,Kt&&Ln(zt),Q.mode!=="sandbox"||ke){(Q.mode==="production"&&!Q.showWakingPill||ke)&&we==="blocks"&&gs();return}if(Aa("vm_preview_loaded",{view_mode:we,vm_id:ze?.sandboxHandle??null}),!B)try{const u=k.current?.contentWindow?.location?.pathname;if(!u)return;const w=Re.current;if(w!==null&&(Re.current=null,Oe(u)!==Oe(w))||Oe(u)===Oe(Ee))return;ae(u),bt({path:u,pageKey:pe,params:Ze})}catch{}we==="visual"&&yn(),we==="blocks"&&gs()}},Q.iframeBase)})]})}),R&&Xe&&n.jsxs(n.Fragment,{children:[n.jsx(Mn,{withHandle:!0}),n.jsx(Gt,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:n.jsx(Zn,{ref:T,virtualMcpId:t,pageKey:Xe,onClose:L})})]})]})})]})}),n.jsx(Zl,{open:_,onOpenChange:$,isPending:Gs.isPending,error:F,templates:Qe,onSubmit:va})]})}const Fs={app:null,split:!1};function Pc(t){const e=ce.c(24),{project:s,maxApps:r,children:a}=t,d=Pe();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={silent:!0},e[0]=o):o=e[0];const i=uo(o),c=Rt();let l;e[1]!==s.metadata.runtime?(l=s.metadata.runtime??{},e[1]=s.metadata.runtime,e[2]=l):l=e[2];const m=l;let p;e[3]!==m.apps?(p=m.apps??[],e[3]=m.apps,e[4]=p):p=e[4];const f=p;let x;e[5]!==i.update||e[6]!==c||e[7]!==s.id||e[8]!==s.metadata||e[9]!==m||e[10]!==d?(x=y=>i.update.mutate({id:s.id,data:{metadata:{...bi(s.metadata),runtime:{...m,apps:y.length?y:null}}}},{onSuccess:()=>c.start(),onError:()=>Zt.error(d("sandbox.appTabs.saveError"))}),e[5]=i.update,e[6]=c,e[7]=s.id,e[8]=s.metadata,e[9]=m,e[10]=d,e[11]=x):x=e[11];const h=x,j=m.path??null;let g,b;e[12]!==f||e[13]!==h?(g=y=>h([...f,{path:y}]),b=y=>h(f.filter(v=>v.path!==y)),e[12]=f,e[13]=h,e[14]=g,e[15]=b):(g=e[14],b=e[15]);let N;return e[16]!==f||e[17]!==a||e[18]!==r||e[19]!==s.id||e[20]!==j||e[21]!==g||e[22]!==b?(N=n.jsx(jc,{virtualMcpId:s.id,mainPath:j,apps:f,maxApps:r,onAddApp:g,onRemoveApp:b,children:a}),e[16]=f,e[17]=a,e[18]=r,e[19]=s.id,e[20]=j,e[21]=g,e[22]=b,e[23]=N):N=e[23],N}function jc(t){const e=ce.c(102),{virtualMcpId:s,mainPath:r,apps:a,maxApps:d,onAddApp:o,onRemoveApp:i,children:c}=t,l=Pe(),m=Tr(),{currentBranch:p}=Lt(),f=Rt(),x=Us().lifecycle.phase,h=ss(s,p),{url:j}=Nr(s);let g;e[0]!==h||e[1]!==j?(g=He(h)??j,e[0]=h,e[1]=j,e[2]=g):g=e[2];const b=g,N=b??f.previewUrl,y=!!b||x==="running",v=!y&&f.status==="errored";let P;e[3]!==f.vmEntry?.startedWith?.apps?(P=f.vmEntry?.startedWith?.apps??[],e[3]=f.vmEntry?.startedWith?.apps,e[4]=P):P=e[4];const E=P;let k;e[5]!==s?(k=_s.previewAppLayout(s),e[5]=s,e[6]=k):k=e[6];const[S,R]=As(k,Ec);let O;e[7]!==a||e[8]!==S?(O=a.some(fe=>fe.path===S.app)?S.app:null,e[7]=a,e[8]=S,e[9]=O):O=e[9];const T=O,L=T!==null&&S.split&&!m,D=T===null||L,A=T??a[0]?.path??null,[M,H]=C.useState(null),[X,V]=C.useState(!1);let J;e[10]===Symbol.for("react.memo_cache_sentinel")?(J=()=>{H(null),V(!1)},e[10]=J):J=e[10];const q=J;let G;e[11]!==a||e[12]!==M||e[13]!==m||e[14]!==r||e[15]!==o||e[16]!==R?(G=()=>{if(M===null)return;const fe=Kn(M);if(!fe){q();return}if(fe===Kn(r??"")||a.some(ie=>ie.path===fe)){V(!0);return}o(fe),R({app:fe,split:!m}),q()},e[11]=a,e[12]=M,e[13]=m,e[14]=r,e[15]=o,e[16]=R,e[17]=G):G=e[17];const Y=G;let _;e[18]!==r||e[19]!==l?(_=r?Es(r):l("sandbox.appTabs.root"),e[18]=r,e[19]=l,e[20]=_):_=e[20];const $=_;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 I=F;let B;e[24]!==l?(B=l("sandbox.appTabs.label"),e[24]=l,e[25]=B):B=e[25];let z;e[26]!==l?(z=l("sandbox.appTabs.main"),e[26]=l,e[27]=z):z=e[27];let W;e[28]!==l?(W=l("sandbox.appTabs.mainHint"),e[28]=l,e[29]=W):W=e[29];let K;e[30]!==R?(K=()=>R(Fs),e[30]=R,e[31]=K):K=e[31];let te;e[32]!==v||e[33]!==$||e[34]!==y||e[35]!==D||e[36]!==z||e[37]!==W||e[38]!==K?(te=n.jsx(nr,{label:$,badge:z,hint:W,ready:y,failed:v,onScreen:D,onSelect:K}),e[32]=v,e[33]=$,e[34]=y,e[35]=D,e[36]=z,e[37]=W,e[38]=K,e[39]=te):te=e[39];let se;if(e[40]!==a||e[41]!==T||e[42]!==v||e[43]!==$||e[44]!==i||e[45]!==y||e[46]!==R||e[47]!==L||e[48]!==l){let fe;e[50]!==T||e[51]!==v||e[52]!==$||e[53]!==i||e[54]!==y||e[55]!==R||e[56]!==L||e[57]!==l?(fe=ie=>{const Ne=Es(ie.path);return n.jsx(nr,{label:Ne,hint:l("sandbox.appTabs.extraHint",{app:$}),ready:y,failed:v,onScreen:ie.path===T,onSelect:()=>R({app:ie.path,split:L}),onRemove:()=>i(ie.path),removeLabel:l("sandbox.appTabs.remove",{app:Ne})},ie.path)},e[50]=T,e[51]=v,e[52]=$,e[53]=i,e[54]=y,e[55]=R,e[56]=L,e[57]=l,e[58]=fe):fe=e[58],se=a.map(fe),e[40]=a,e[41]=T,e[42]=v,e[43]=$,e[44]=i,e[45]=y,e[46]=R,e[47]=L,e[48]=l,e[49]=se}else se=e[49];let ee;e[59]!==te||e[60]!==se||e[61]!==B?(ee=n.jsxs("div",{role:"tablist","aria-label":B,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[te,se]}),e[59]=te,e[60]=se,e[61]=B,e[62]=ee):ee=e[62];let ae;e[63]!==a.length||e[64]!==Y||e[65]!==M||e[66]!==X||e[67]!==d||e[68]!==l?(ae=M!==null?n.jsx("form",{className:"w-40 shrink-0",onSubmit:fe=>{fe.preventDefault(),Y()},children:n.jsx("input",{autoFocus:!0,value:M,placeholder:"apps/checkout","aria-label":l("sandbox.appTabs.pathLabel"),"aria-invalid":X,onChange:fe=>{H(fe.target.value),V(!1)},onBlur:q,onKeyDown:fe=>{fe.key==="Escape"&&q()},className:De("h-7 w-full rounded-md border bg-background px-2 font-mono text-xs outline-none",X?"border-destructive":"border-border")})}):a.length<d&&n.jsx(it,{label:l("sandbox.appTabs.add"),onClick:()=>H(""),children:n.jsx(vr,{})}),e[63]=a.length,e[64]=Y,e[65]=M,e[66]=X,e[67]=d,e[68]=l,e[69]=ae):ae=e[69];let pe;e[70]!==m||e[71]!==R||e[72]!==L||e[73]!==I||e[74]!==A?(pe=!m&&A&&n.jsx(it,{label:I,active:L,onClick:()=>R(L?Fs:{app:A,split:!0}),children:n.jsx(lo,{})}),e[70]=m,e[71]=R,e[72]=L,e[73]=I,e[74]=A,e[75]=pe):pe=e[75];let de;e[76]!==ee||e[77]!==ae||e[78]!==pe?(de=n.jsxs(n.Fragment,{children:[ee,ae,pe]}),e[76]=ee,e[77]=ae,e[78]=pe,e[79]=de):de=e[79];const ve=de;let ue;e[80]!==ve?(ue=n.jsx(Os.Topbar.Left.Portal,{fallback:n.jsx("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:ve}),children:n.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]!==D?(xe=D&&n.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:c}),e[82]=c,e[83]=D,e[84]=xe):xe=e[84];let me;e[85]!==T||e[86]!==v||e[87]!==f.start||e[88]!==b||e[89]!==$||e[90]!==N||e[91]!==y||e[92]!==R||e[93]!==L||e[94]!==E?(me=T!==null&&n.jsx(Nc,{name:Es(T),mainName:$,appUrl:N?yi(N,T):null,ready:y,failed:v,notStarted:!b&&!E.includes(T),onStart:f.start,className:De(L&&"border-l border-border"),onClose:L?()=>R({app:T,split:!1}):void 0},T),e[85]=T,e[86]=v,e[87]=f.start,e[88]=b,e[89]=$,e[90]=N,e[91]=y,e[92]=R,e[93]=L,e[94]=E,e[95]=me):me=e[95];let ge;e[96]!==xe||e[97]!==me?(ge=n.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=n.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 Ec(t){return t??Fs}function nr(t){const e=ce.c(28),{label:s,badge:r,hint:a,ready:d,failed:o,onScreen:i,onSelect:c,onRemove:l,removeLabel:m}=t,p=i?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground";let f;e[0]!==p?(f=De("group/app-tab flex h-7 shrink-0 items-center rounded-md text-xs transition-colors",p),e[0]=p,e[1]=f):f=e[1];const x=d?"bg-success":o?"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 j;e[4]!==h?(j=n.jsx("span",{"aria-hidden":!0,className:h}),e[4]=h,e[5]=j):j=e[5];let g;e[6]!==s?(g=n.jsx("span",{className:"max-w-40 truncate",children:s}),e[6]=s,e[7]=g):g=e[7];let b;e[8]!==r?(b=r&&n.jsx("span",{className:"text-[10px] text-muted-foreground",children:r}),e[8]=r,e[9]=b):b=e[9];let N;e[10]!==i||e[11]!==c||e[12]!==j||e[13]!==g||e[14]!==b?(N=n.jsx(lt,{asChild:!0,children:n.jsxs("button",{type:"button",role:"tab","aria-selected":i,onClick:c,className:"flex h-full items-center gap-1.5 rounded-md px-2.5 focus-ring",children:[j,g,b]})}),e[10]=i,e[11]=c,e[12]=j,e[13]=g,e[14]=b,e[15]=N):N=e[15];let y;e[16]!==a?(y=n.jsx(ct,{className:"max-w-64",children:a}),e[16]=a,e[17]=y):y=e[17];let v;e[18]!==N||e[19]!==y?(v=n.jsxs(dt,{children:[N,y]}),e[18]=N,e[19]=y,e[20]=v):v=e[20];let P;e[21]!==l||e[22]!==m?(P=l&&n.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:n.jsx(Br,{className:"size-3"})}),e[21]=l,e[22]=m,e[23]=P):P=e[23];let E;return e[24]!==v||e[25]!==P||e[26]!==f?(E=n.jsxs("div",{className:f,children:[v,P]}),e[24]=v,e[25]=P,e[26]=f,e[27]=E):E=e[27],E}function Nc(t){const e=ce.c(71),{name:s,mainName:r,appUrl:a,ready:d,failed:o,notStarted:i,onStart:c,className:l,onClose:m}=t,p=Pe(),[f,x]=C.useState("/"),[h,j]=C.useState("desktop"),[g,b]=C.useState(0),N=C.useRef(null);let y;e[0]!==a||e[1]!==f?(y=a?wi(a,f):null,e[0]=a,e[1]=f,e[2]=y):y=e[2];const v=y;let P;e[3]!==l?(P=De("flex min-h-0 min-w-0 flex-1 flex-col",l),e[3]=l,e[4]=P):P=e[4];let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=W=>{W.preventDefault(),x(N.current?.value||"/")},e[5]=E):E=e[5];let k;e[6]!==s||e[7]!==p?(k=p("sandbox.appPane.path",{app:s}),e[6]=s,e[7]=p,e[8]=k):k=e[8];let S;e[9]!==f||e[10]!==k?(S=n.jsx("form",{className:"min-w-0 flex-1",onSubmit:E,children:n.jsx("input",{ref:N,defaultValue:f,"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]=f,e[10]=k,e[11]=S):S=e[11];let R;e[12]!==h||e[13]!==p?(R=p(h==="desktop"?"sandbox.preview.deviceMobile":"sandbox.preview.deviceDesktop"),e[12]=h,e[13]=p,e[14]=R):R=e[14];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=()=>j(Tc),e[15]=O):O=e[15];let T;e[16]!==h?(T=h==="desktop"?n.jsx(gr,{}):n.jsx(hr,{}),e[16]=h,e[17]=T):T=e[17];let L;e[18]!==R||e[19]!==T?(L=n.jsx(it,{label:R,onClick:O,children:T}),e[18]=R,e[19]=T,e[20]=L):L=e[20];let D;e[21]!==s||e[22]!==p?(D=p("sandbox.appPane.reload",{app:s}),e[21]=s,e[22]=p,e[23]=D):D=e[23];const A=!v||!d;let M,H;e[24]===Symbol.for("react.memo_cache_sentinel")?(M=()=>b(Cc),H=n.jsx(_a,{}),e[24]=M,e[25]=H):(M=e[24],H=e[25]);let X;e[26]!==D||e[27]!==A?(X=n.jsx(it,{label:D,disabled:A,onClick:M,children:H}),e[26]=D,e[27]=A,e[28]=X):X=e[28];let V;e[29]!==s||e[30]!==p?(V=p("sandbox.appPane.openInNewTab",{app:s}),e[29]=s,e[30]=p,e[31]=V):V=e[31];const J=!v||!d;let q;e[32]!==v?(q=()=>v&&window.open(v,"_blank","noopener"),e[32]=v,e[33]=q):q=e[33];let G;e[34]===Symbol.for("react.memo_cache_sentinel")?(G=n.jsx(cr,{}),e[34]=G):G=e[34];let Y;e[35]!==V||e[36]!==J||e[37]!==q?(Y=n.jsx(it,{label:V,disabled:J,onClick:q,children:G}),e[35]=V,e[36]=J,e[37]=q,e[38]=Y):Y=e[38];let _;e[39]!==s||e[40]!==m||e[41]!==p?(_=m&&n.jsx(it,{label:p("sandbox.appPane.close",{app:s}),onClick:m,children:n.jsx(Br,{})}),e[39]=s,e[40]=m,e[41]=p,e[42]=_):_=e[42];let $;e[43]!==X||e[44]!==Y||e[45]!==_||e[46]!==S||e[47]!==L?($=n.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:[S,L,X,Y,_]}),e[43]=X,e[44]=Y,e[45]=_,e[46]=S,e[47]=L,e[48]=$):$=e[48];let F;e[49]!==r||e[50]!==p?(F=p("sandbox.appPane.previewOnly",{app:r}),e[49]=r,e[50]=p,e[51]=F):F=e[51];let I;e[52]!==F?(I=n.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]=I):I=e[53];let B;e[54]!==h||e[55]!==o||e[56]!==r||e[57]!==s||e[58]!==i||e[59]!==c||e[60]!==d||e[61]!==g||e[62]!==v||e[63]!==p?(B=n.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:d&&i?n.jsxs("div",{className:"flex flex-col items-center gap-3 self-center px-6 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:p("sandbox.appPane.notStarted",{app:s})}),n.jsx(Me,{size:"sm",variant:"outline",onClick:c,children:p("sandbox.appPane.start",{app:s})})]}):!d||!v?n.jsx("p",{className:"self-center px-6 text-center text-sm text-muted-foreground",children:d?p("sandbox.appPane.noUrl"):o?p("sandbox.appPane.failed",{app:r}):p("sandbox.appPane.waiting")}):n.jsx("iframe",{src:v,title:s,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]=o,e[56]=r,e[57]=s,e[58]=i,e[59]=c,e[60]=d,e[61]=g,e[62]=v,e[63]=p,e[64]=B):B=e[64];let z;return e[65]!==s||e[66]!==P||e[67]!==$||e[68]!==I||e[69]!==B?(z=n.jsxs("section",{"aria-label":s,className:P,children:[$,I,B]}),e[65]=s,e[66]=P,e[67]=$,e[68]=I,e[69]=B,e[70]=z):z=e[70],z}function Cc(t){return t+1}function Tc(t){return t==="desktop"?"mobile":"desktop"}function it(t){const e=ce.c(11),{label:s,children:r,active:a,disabled:d,onClick:o}=t;let i;e[0]!==a||e[1]!==r||e[2]!==d||e[3]!==s||e[4]!==o?(i=n.jsx(lt,{asChild:!0,children:n.jsx(We,{"aria-label":s,"aria-pressed":a,active:a,disabled:d,onClick:o,children:r})}),e[0]=a,e[1]=r,e[2]=d,e[3]=s,e[4]=o,e[5]=i):i=e[5];let c;e[6]!==s?(c=n.jsx(ct,{children:s}),e[6]=s,e[7]=c):c=e[7];let l;return e[8]!==i||e[9]!==c?(l=n.jsxs(dt,{children:[i,c]}),e[8]=i,e[9]=c,e[10]=l):l=e[10],l}const Lc=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},Rc=1e4,Ac=1e4,_c=5e3,Oc=2;function Dc(t,e){return t&&e===0?Ac:Math.min(1e3*2**Math.max(0,e-1),_c)}function Bc(t,e,s){return e?!0:t===!0&&s<Oc}function $c(t,e){const s=ce.c(11),r=Lc,a=Oa();let d;s[0]!==t?(d=or.localAppReachable(t??""),s[0]=t,s[1]=d):d=s[1];const o=d;let i;s[2]!==r||s[3]!==a||s[4]!==o||s[5]!==t?(i=async p=>{const{signal:f}=p,x=new AbortController,h=()=>x.abort();f.addEventListener("abort",h);const j=setTimeout(h,Rc),g=await r(t,x.signal).catch(Fc);clearTimeout(j),f.removeEventListener("abort",h);const b=a.getQueryData(o),N=g?0:(b?.failures??0)+1;return{up:Bc(b?.up??null,g,N),failures:N}},s[2]=r,s[3]=a,s[4]=o,s[5]=t,s[6]=i):i=s[6];const c=!!t;let l;s[7]!==o||s[8]!==i||s[9]!==c?(l={queryKey:o,queryFn:i,enabled:c,retry:!1,staleTime:0,gcTime:0,refetchInterval:Mc},s[7]=o,s[8]=i,s[9]=c,s[10]=l):l=s[10];const{data:m}=Da(l);return t?m?.up??null:null}function Mc(t){return t.state.data?Dc(t.state.data.up,t.state.data.failures):!1}function Fc(){return!1}function zc(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const s=e.problem;return!s||s.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:s}}return{kind:"connecting"}}function Kd(t){const e=ce.c(53),{virtualMcpId:s}=t,r=Pe(),a=fo(s),{connection:d}=Cr(s),{activeTask:o,taskId:i,currentBranch:c}=Lt(),l=Ai(i),[m,p]=C.useState(!1),f=ss(s,c);let x;e[0]!==f||e[1]!==d?(x=d?He(f):null,e[0]=f,e[1]=d,e[2]=x):x=e[2];const h=x,j=$c(h),g=Mr(),b=ki("multi_app_preview");if(ji({threadId:i,sandboxBranch:o?.branch??c,agentHasRepo:js(a?.metadata),threadHasRepo:js(l)||js(o?.metadata)})==="none"&&!d){let E;e[3]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:n.jsx(In,{className:"size-7 text-foreground"})}),e[3]=E):E=e[3];let k;e[4]!==r?(k=r("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=r,e[5]=k):k=e[5];let S;e[6]!==r?(S=r("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=r,e[7]=S):S=e[7];let R,O;e[8]===Symbol.for("react.memo_cache_sentinel")?(R=()=>p(!0),O=n.jsx(In,{className:"size-4"}),e[8]=R,e[9]=O):(R=e[8],O=e[9]);let T;e[10]!==r?(T=r("mainPanelTabs.previewTab.connectGithub"),e[10]=r,e[11]=T):T=e[11];let L;e[12]!==T?(L=n.jsxs(Me,{onClick:R,children:[O,T]}),e[12]=T,e[13]=L):L=e[13];let D;e[14]!==k||e[15]!==S||e[16]!==L?(D=n.jsx(Si,{className:"h-full",image:E,title:k,description:S,actions:L}),e[14]=k,e[15]=S,e[16]=L,e[17]=D):D=e[17];let A;e[18]!==m?(A=n.jsx(Pi,{open:m,onOpenChange:p,mode:"agent"}),e[18]=m,e[19]=A):A=e[19];let M;return e[20]!==A||e[21]!==D?(M=n.jsxs(n.Fragment,{children:[D,A]}),e[20]=A,e[21]=D,e[22]=M):M=e[22],M}if(d&&a&&!He(f)){let E;e[23]!==g||e[24]!==f?(E=zc({backend:f,access:g}),e[23]=g,e[24]=f,e[25]=E):E=e[25];let k;e[26]!==d.endpoint?(k=_o(d.endpoint),e[26]=d.endpoint,e[27]=k):k=e[27];let S;return e[28]!==E||e[29]!==k?(S=n.jsx(Ic,{status:E,host:k}),e[28]=E,e[29]=k,e[30]=S):S=e[30],S}if(h&&j!==!0){let E;e[31]!==r?(E=r("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=r,e[32]=E):E=e[32];let k;e[33]!==h||e[34]!==r?(k=r("mainPanelTabs.previewTab.localAppWaiting.body",{host:Kc(h)}),e[33]=h,e[34]=r,e[35]=k):k=e[35];let S;e[36]!==k?(S=n.jsx(es,{text:k}),e[36]=k,e[37]=S):S=e[37];let R;e[38]!==r?(R=r("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=r,e[39]=R):R=e[39];let O;e[40]!==R?(O=n.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:R}),e[40]=R,e[41]=O):O=e[41];let T;return e[42]!==E||e[43]!==S||e[44]!==O?(T=n.jsx(ts,{headingLevel:2,waiting:!0,title:E,lead:S,footer:O}),e[42]=E,e[43]=S,e[44]=O,e[45]=T):T=e[45],T}let y;e[46]!==s?(y=n.jsx(Sc,{virtualMcpId:s}),e[46]=s,e[47]=y):y=e[47];const v=y;let P;return e[48]!==a||e[49]!==b||e[50]!==v||e[51]!==d?(P=n.jsx(Wa,{children:b&&a&&!d?n.jsx(Pc,{project:a,maxApps:vi,children:v}):v}),e[48]=a,e[49]=b,e[50]=v,e[51]=d,e[52]=P):P=e[52],P}function Kc(t){try{return new URL(t).host}catch{return t}}function Ic(t){const e=ce.c(20),{status:s,host:r}=t,a=Pe();if(s.kind==="connected"){let i;e[0]!==a?(i=a("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=a,e[1]=i):i=e[1];let c;e[2]!==a?(c=a("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=a,e[3]=c):c=e[3];let l;e[4]!==c?(l=n.jsx(es,{text:c}),e[4]=c,e[5]=l):l=e[5];let m;e[6]!==a?(m=a("mainPanelTabs.previewTab.localhostNoPreview.step.title"),e[6]=a,e[7]=m):m=e[7];let p;e[8]!==m?(p=[{title:m,command:`${Er} --preview localhost:3000`}],e[8]=m,e[9]=p):p=e[9];let f;return e[10]!==i||e[11]!==l||e[12]!==p?(f=n.jsx(ts,{headingLevel:2,waiting:!1,title:i,lead:l,steps:p}),e[10]=i,e[11]=l,e[12]=p,e[13]=f):f=e[13],f}let d;e[14]!==r||e[15]!==s?(d=$i(s,r),e[14]=r,e[15]=s,e[16]=d):d=e[16];let o;return e[17]!==r||e[18]!==d?(o=n.jsx(Bi,{wait:d,hosts:r}),e[17]=r,e[18]=d,e[19]=o):o=e[19],o}export{Bi as L,Kd as P,ts as S,zd as u};